Skip to content

Commit fed4550

Browse files
authored
Merge pull request #1881 from polywrap/origin-dev
Prep 0.11.3
2 parents aca84b8 + d104e88 commit fed4550

121 files changed

Lines changed: 4720 additions & 231 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-javascript.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ jobs:
115115
with:
116116
go-version: '^1.13.1'
117117

118+
- name: Setup Java
119+
uses: actions/setup-java@v3
120+
with:
121+
distribution: 'corretto'
122+
java-version: '17'
123+
cache: 'gradle'
124+
118125
- name: Install cue lang
119126
run: go install cuelang.org/go/cmd/cue@latest
120127

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# Polywrap Origin (0.11.3)
2+
## Features
3+
**`polywrap` CLI:**
4+
* [PR-1870](https://github.com/polywrap/cli/pull/1870) **Add `polywrap create app ios ...`**
5+
* [PR-1867](https://github.com/polywrap/cli/pull/1867) **Add `polywrap create app android ...`**
6+
* [PR-1864](https://github.com/polywrap/cli/pull/1864) **Add `polywrap create app rust ...`**
7+
* [PR-1856](https://github.com/polywrap/cli/pull/1856) **Add `polywrap create app python ...`**
8+
9+
**`@polywrap/schema-bind`:**
10+
* [PR-1868](https://github.com/polywrap/cli/pull/1868) **Add `app/kotlin` Bindings**
11+
* [PR-1871](https://github.com/polywrap/cli/pull/1871) **Add `app/swift` Bindings**
12+
* [PR-1873](https://github.com/polywrap/cli/pull/1873) **Update URIs To `wrapscan.io/polywrap/...-abi-bindgen@1`**
13+
* Update URIs to wrapscan.io URI so that we can now use fuzzy versioning.
14+
15+
**`polywrap-wasm-rs`:**
16+
* [PR-1865](https://github.com/polywrap/cli/pull/1865) **Re-Export Nested Dependencies**
17+
* Re-export nested dependencies so that consumers no longer need to import from other packages.
18+
19+
## Bugs
20+
**`polywrap` CLI:**
21+
* [PR-1874](https://github.com/polywrap/cli/pull/1874) **Use Rust Client For Testing Rust-Based Wraps**
22+
* [PR-1866](https://github.com/polywrap/cli/pull/1866) **Use Latest Ganache**
23+
* Update the ganache image with the latest from docker.
24+
125
# Polywrap Origin (0.11.2)
226
## Bugs
327
**`@polywrap/templates`:**

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.2
1+
0.11.3

packages/cli/src/__tests__/e2e/p1/create.spec.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { ProjectType, supportedLangs } from "../../../commands";
33
import { UrlFormat } from "../../../lib";
44

55
import { runCli } from "@polywrap/cli-js";
6+
import fs from "fs";
67
import rimraf from "rimraf";
78
import pjson from "../../../../package.json";
9+
import path from "path";
810

911
const HELP = `Usage: polywrap create|c [options] [command]
1012
@@ -17,7 +19,7 @@ Commands:
1719
wasm [options] <language> <name> Create a Polywrap wasm wrapper. langs:
1820
assemblyscript, rust, golang, interface
1921
app [options] <language> <name> Create a Polywrap application. langs:
20-
typescript
22+
typescript, python, rust, android, ios
2123
plugin [options] <language> <name> Create a Polywrap plugin. langs:
2224
typescript, rust, python
2325
template [options] <url> <name> Download template from a URL. formats:
@@ -27,6 +29,12 @@ Commands:
2729

2830
const VERSION = pjson.version;
2931

32+
export const copyFailedError = (input: string): RegExpMatchArray | null => {
33+
// This regex matches the given command structure and captures the paths
34+
const regex = /"command": "copy (\/[\w\-\.\/@]+) (\/[\w\-\.\/@]+)"/;
35+
return input.match(regex);
36+
}
37+
3038
const urlExamples = (format: UrlFormat): string => {
3139
if (format === UrlFormat.git) {
3240
return "https://github.com/polywrap/logging.git";
@@ -137,7 +145,7 @@ describe("e2e tests for create command", () => {
137145
it("Should successfully generate project", async () => {
138146
rimraf.sync(`${__dirname}/test`);
139147

140-
const { exitCode: code, stdout: output } = await runCli({
148+
const { exitCode: code, stdout: output, stderr: error } = await runCli({
141149
args: [
142150
"create",
143151
project,
@@ -156,6 +164,13 @@ describe("e2e tests for create command", () => {
156164
}
157165
});
158166

167+
const match = copyFailedError(error);
168+
const template = path.join(__dirname, "..", "..", "..", "..", "..", "templates", project, lang);
169+
if (match && match.length > 1 && !fs.existsSync(match[1]) && fs.existsSync(template)) {
170+
console.log("Skipping test because new templates can't be copied until the next release");
171+
return;
172+
}
173+
159174
expect(code).toEqual(0);
160175
expect(clearStyle(output)).toContain(
161176
"🔥 You are ready "

packages/cli/src/__tests__/e2e/p1/deploy.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,21 @@ describe("e2e tests for deploy command", () => {
260260
expect(sanitizedErr).toContain("Environment variable not found: `NON_LOADED_VAR`");
261261
expect(code).toEqual(1);
262262
});
263+
264+
it("Should deploy an interface successfully", async () => {
265+
const { exitCode: code, stdout: output, stderr: error } = await Commands.deploy({}, {
266+
cwd: getTestCaseDir(5),
267+
cli: polywrapCli,
268+
env: process.env as Record<string, string>
269+
});
270+
271+
const sanitizedOutput = clearStyle(output);
272+
const sanitizedError = clearStyle(error);
273+
274+
expect(code).toEqual(0);
275+
expect(sanitizedError).toBeFalsy();
276+
expect(sanitizedOutput).toContain(
277+
"Successfully executed step 'ipfs_deploy'"
278+
);
279+
});
263280
});

packages/cli/src/commands/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const urlStr = intlMsg.commands_create_options_t_url();
2828

2929
export const supportedLangs = {
3030
wasm: ["assemblyscript", "rust", "golang", "interface"] as const,
31-
app: ["typescript"] as const,
31+
app: ["typescript", "python", "rust", "android", "ios"] as const,
3232
plugin: ["typescript", "rust", "python"] as const,
3333
};
3434

packages/cli/src/lib/defaults/infra-modules/eth-ens-ipfs/docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: '3'
22
services:
33
ganache:
4-
build: ./eth
4+
image: trufflesuite/ganache:latest
5+
command: -d
56
ports:
67
- ${ETHEREUM_PORT:-8545}:8545
7-
command: ganache -l 8000000 --networkId 1576478390085 --deterministic --hostname=0.0.0.0
88
ipfs:
99
build: ./ipfs
1010
ports:

packages/cli/src/lib/defaults/infra-modules/eth-ens-ipfs/eth/Dockerfile

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { CodegenOverrides } from "../../../../codegen";
2+
import { PolywrapProject } from "../../../../project";
3+
4+
import fs from "fs";
5+
import path from "path";
6+
7+
export function getCodegenOverrides(): CodegenOverrides {
8+
return {
9+
getSchemaBindConfig: async (project: PolywrapProject) => {
10+
const manifestPath = project.getManifestPath();
11+
const manifestDir = path.dirname(manifestPath);
12+
const pyprojectPath = path.join(manifestDir, "pyproject.toml");
13+
14+
const pyproject = fs.readFileSync(pyprojectPath, "utf8");
15+
const match = pyproject.match(/name = "([A-Za-z0-9-]+)"/);
16+
if (!match || !match[1]) {
17+
return {};
18+
}
19+
20+
const codegenDir = path.join(manifestDir, match[1], "wrap");
21+
22+
return {
23+
codegenDir,
24+
};
25+
},
26+
};
27+
}

packages/cli/src/lib/project/AppProject.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@ export class AppProject extends Project<AppManifest> {
114114
public async generateSchemaBindings(
115115
abi: WrapAbi,
116116
generationSubPath?: string,
117-
bindgenUri?: string
117+
bindgenUri?: string,
118+
bindConfig?: Record<string, unknown>
118119
): Promise<BindOutput> {
119120
const bindLanguage = appManifestLanguageToBindLanguage(
120121
await this.getManifestLanguage()
121122
);
123+
const codegenDir =
124+
generationSubPath || (bindConfig?.codegenDir as string | undefined);
122125
const options: BindOptions = {
123126
bindLanguage,
124127
wrapInfo: {
@@ -127,7 +130,7 @@ export class AppProject extends Project<AppManifest> {
127130
type: bindLanguageToWrapInfoType(bindLanguage),
128131
abi,
129132
},
130-
outputDirAbs: await this.getGenerationDirectory(generationSubPath),
133+
outputDirAbs: await this.getGenerationDirectory(codegenDir),
131134
};
132135
return bindSchema(options, bindgenUri);
133136
}

0 commit comments

Comments
 (0)