Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
aca84b8
Merge pull request #1861 from polywrap/origin-0.11
dOrgJelli Aug 21, 2023
e3f3597
Merge pull request #1862 from polywrap/origin-0.11-dev
dOrgJelli Aug 21, 2023
4ab2e72
chore(wasm/rs): re-export dependencies
cbrzn Aug 22, 2023
4632cd5
draft kotlin android template
krisbitney Aug 23, 2023
0388ee5
updated kotlin template dependencies
krisbitney Aug 24, 2023
3a34dee
updated kotlin template dependencies
krisbitney Aug 24, 2023
28b1889
chore(cli/infra): use truffle ganache docker image
cbrzn Aug 24, 2023
cf46912
chore(cli/infra): remove eth docker image
cbrzn Aug 24, 2023
ca948ef
chore: add deterministic wallet in eth infra module
cbrzn Aug 27, 2023
108fe19
feat: add python app template
Niraj-Kamdar Aug 17, 2023
ceb4235
fix: python app template
Niraj-Kamdar Aug 21, 2023
be322bf
fix: python app code generator
Niraj-Kamdar Aug 23, 2023
d8c6538
chore: update yarn.lock
Niraj-Kamdar Aug 28, 2023
0a17b7f
chore: update polywrap version in template
Niraj-Kamdar Aug 28, 2023
dd78b9c
updated kotlin template app bindings and polywrap import uris
krisbitney Aug 28, 2023
4d65742
added kotlin app bindings to schema/bind
krisbitney Aug 28, 2023
46403b0
fix: python app template test script
Niraj-Kamdar Aug 28, 2023
1f31476
added kotlin app template to cli create command
krisbitney Aug 28, 2023
ea464be
removed custom kotlin app bindings uri from kotlin app template
krisbitney Aug 28, 2023
febe270
chore: use codegen overrides
Niraj-Kamdar Aug 28, 2023
246fd67
chore: add patch for skipping create test until next release
Niraj-Kamdar Aug 28, 2023
a21d273
fix: template tests
Niraj-Kamdar Aug 28, 2023
ad4696f
updated wrap imports
krisbitney Aug 28, 2023
6b7ef91
fix: rust plugin template
Niraj-Kamdar Aug 29, 2023
7e6828f
wip: rust template
Niraj-Kamdar Aug 17, 2023
0156c2e
wip
Niraj-Kamdar Aug 20, 2023
7feacfa
working ipfs demo
Niraj-Kamdar Aug 22, 2023
e8a4915
chore: use ipfs.io in template
Niraj-Kamdar Aug 28, 2023
40d5182
fix: issues
Niraj-Kamdar Aug 28, 2023
14d4ce2
fix: rust app template
Niraj-Kamdar Aug 29, 2023
7785e9c
fix: rust plugin test
Niraj-Kamdar Aug 29, 2023
4e8b79e
draft swift template
krisbitney Aug 29, 2023
1d40718
chore: update nvmrc files
dOrgJelli Aug 29, 2023
fed5ed1
chore: update URI to wrapscan URI
dOrgJelli Aug 29, 2023
7ce4cd2
added cocoapods
krisbitney Aug 29, 2023
5a85ce1
chore: do not raise error if not using pyproject.toml
Niraj-Kamdar Aug 29, 2023
bc889b7
adjustments for use with cocoapods
krisbitney Aug 29, 2023
e7fede2
fix .gitignore
krisbitney Aug 29, 2023
beca7b0
fix .gitignore
krisbitney Aug 29, 2023
54f00ce
fix: intl json file
Niraj-Kamdar Aug 29, 2023
d5eb1af
fixed codegen dependsOn configuration
krisbitney Aug 29, 2023
5316b44
swift template working
krisbitney Aug 29, 2023
29dc8eb
changed swift template codegen url to github url
krisbitney Aug 29, 2023
8e8c544
changed swift template codegen to assume url is known by cli
krisbitney Aug 29, 2023
1672a80
added swift app bindings to cli
krisbitney Aug 29, 2023
3fee09b
reverted adding "ios" to polywrap create command (should be different…
krisbitney Aug 29, 2023
6273728
added "ios" app template option to polywrap create command
krisbitney Aug 29, 2023
1957c7c
renamed kotlin template to "android"
krisbitney Aug 29, 2023
acfa2b1
updated polywrap create "help" expected output
krisbitney Aug 29, 2023
98e0c52
updated polywrap create "help" expected output
krisbitney Aug 29, 2023
08cfd3f
Update packages/templates/app/ios/polywrap.graphql
krisbitney Aug 30, 2023
6cf00b5
using latest bindings
krisbitney Aug 30, 2023
2e774b8
using "Ethers" instead of "Ethereum"
krisbitney Aug 30, 2023
b2ce1f0
chore: add test for interface deployment
dOrgJelli Aug 30, 2023
58345db
Merge pull request #1872 from polywrap/add-test-for-interface-deploy
dOrgJelli Aug 30, 2023
3d34b53
Merge pull request #1866 from polywrap/update/eth-image
dOrgJelli Aug 30, 2023
6dce65d
chore: update binding branch reference
dOrgJelli Aug 30, 2023
fa59643
Merge pull request #1856 from polywrap/nk/add-py-app-template
dOrgJelli Aug 30, 2023
3c7f121
Merge pull request #1865 from polywrap/wasm-rs/re-export-deps
dOrgJelli Aug 30, 2023
60f59ae
feat: update abi-bindgen wrap uris to wrapscan
dOrgJelli Aug 30, 2023
e4b9d3c
Merge pull request #1873 from polywrap/bindgen-wraps-on-wrapscan
dOrgJelli Aug 30, 2023
aeedc6a
merge origin-dev
dOrgJelli Aug 30, 2023
8592f80
Merge pull request #1871 from polywrap/kris/swift-app-bindings
dOrgJelli Aug 30, 2023
2929036
merge origin-dev
dOrgJelli Aug 30, 2023
a1144e1
Merge pull request #1868 from polywrap/kris/kotlin-app-bindings
dOrgJelli Aug 30, 2023
581b9d4
merge origin-dev
dOrgJelli Aug 30, 2023
02b42d5
merge origin-dev
dOrgJelli Aug 30, 2023
e2ee8a6
merge origin-dev
dOrgJelli Aug 30, 2023
f7deeb0
chore: remove wraps.eth dep
dOrgJelli Aug 31, 2023
a269b7a
feat: add rust app template tests
Niraj-Kamdar Aug 31, 2023
cfe4b6a
Merge remote-tracking branch 'origin/origin-dev' into kris/kotlin-tem…
krisbitney Aug 31, 2023
2bc2ac4
renamed kotlin folder to android and fixed bindings cli integration
krisbitney Aug 31, 2023
7f700bc
Merge remote-tracking branch 'origin/kris/kotlin-template' into kris/…
krisbitney Aug 31, 2023
d9cb604
added android template to template tests to prevent regression
krisbitney Aug 31, 2023
c78542e
draft rust tests in wrap-rust template
krisbitney Aug 31, 2023
2c32efa
passing rust tests in wrap-rust template
krisbitney Aug 31, 2023
facdaf1
Update packages/templates/wasm/rust/Cargo.toml
krisbitney Sep 1, 2023
ed76091
updated versions and js dependencies in wrap-rust template
krisbitney Sep 1, 2023
6f02090
refactored tests dir in wrap-rust template
krisbitney Sep 1, 2023
02b2f34
Merge pull request #1874 from polywrap/kris/rs-tests-in-rs-wasm-template
dOrgJelli Sep 1, 2023
d2a7610
Merge branch 'origin-dev' into nk/add-rs-app-template
dOrgJelli Sep 1, 2023
949f1f1
chore: minor fixes
dOrgJelli Sep 1, 2023
e024085
chore: move to dev deps
dOrgJelli Sep 1, 2023
d541e62
chore: fix CI
dOrgJelli Sep 1, 2023
7e311f8
Merge pull request #1864 from polywrap/nk/add-rs-app-template
dOrgJelli Sep 1, 2023
18bfbb9
Merge branch 'origin-dev' into kris/kotlin-template
dOrgJelli Sep 1, 2023
f34219f
added java setup to CI
krisbitney Sep 1, 2023
60ce291
Merge pull request #1867 from polywrap/kris/kotlin-template
dOrgJelli Sep 1, 2023
c3da5ee
Merge branch 'origin-dev' into kris/swift-template
dOrgJelli Sep 1, 2023
4e9996b
Update tests.spec.ts
dOrgJelli Sep 1, 2023
ad96a24
Merge pull request #1870 from polywrap/kris/swift-template
dOrgJelli Sep 1, 2023
c734189
fix: update package.json's in template projects
dOrgJelli Sep 1, 2023
59408b2
chore: update CHANGELOG & VERSION files
dOrgJelli Sep 1, 2023
d104e88
Merge pull request #1880 from polywrap/fix-template-project-package-json
dOrgJelli Sep 1, 2023
fed4550
Merge pull request #1881 from polywrap/origin-dev
dOrgJelli Sep 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci-javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ jobs:
with:
go-version: '^1.13.1'

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
cache: 'gradle'

- name: Install cue lang
run: go install cuelang.org/go/cmd/cue@latest

Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# Polywrap Origin (0.11.3)
## Features
**`polywrap` CLI:**
* [PR-1870](https://github.com/polywrap/cli/pull/1870) **Add `polywrap create app ios ...`**
* [PR-1867](https://github.com/polywrap/cli/pull/1867) **Add `polywrap create app android ...`**
* [PR-1864](https://github.com/polywrap/cli/pull/1864) **Add `polywrap create app rust ...`**
* [PR-1856](https://github.com/polywrap/cli/pull/1856) **Add `polywrap create app python ...`**

**`@polywrap/schema-bind`:**
* [PR-1868](https://github.com/polywrap/cli/pull/1868) **Add `app/kotlin` Bindings**
* [PR-1871](https://github.com/polywrap/cli/pull/1871) **Add `app/swift` Bindings**
* [PR-1873](https://github.com/polywrap/cli/pull/1873) **Update URIs To `wrapscan.io/polywrap/...-abi-bindgen@1`**
* Update URIs to wrapscan.io URI so that we can now use fuzzy versioning.

**`polywrap-wasm-rs`:**
* [PR-1865](https://github.com/polywrap/cli/pull/1865) **Re-Export Nested Dependencies**
* Re-export nested dependencies so that consumers no longer need to import from other packages.

## Bugs
**`polywrap` CLI:**
* [PR-1874](https://github.com/polywrap/cli/pull/1874) **Use Rust Client For Testing Rust-Based Wraps**
* [PR-1866](https://github.com/polywrap/cli/pull/1866) **Use Latest Ganache**
* Update the ganache image with the latest from docker.

# Polywrap Origin (0.11.2)
## Bugs
**`@polywrap/templates`:**
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.2
0.11.3
19 changes: 17 additions & 2 deletions packages/cli/src/__tests__/e2e/p1/create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { ProjectType, supportedLangs } from "../../../commands";
import { UrlFormat } from "../../../lib";

import { runCli } from "@polywrap/cli-js";
import fs from "fs";
import rimraf from "rimraf";
import pjson from "../../../../package.json";
import path from "path";

const HELP = `Usage: polywrap create|c [options] [command]

Expand All @@ -17,7 +19,7 @@ Commands:
wasm [options] <language> <name> Create a Polywrap wasm wrapper. langs:
assemblyscript, rust, golang, interface
app [options] <language> <name> Create a Polywrap application. langs:
typescript
typescript, python, rust, android, ios
plugin [options] <language> <name> Create a Polywrap plugin. langs:
typescript, rust, python
template [options] <url> <name> Download template from a URL. formats:
Expand All @@ -27,6 +29,12 @@ Commands:

const VERSION = pjson.version;

export const copyFailedError = (input: string): RegExpMatchArray | null => {
// This regex matches the given command structure and captures the paths
const regex = /"command": "copy (\/[\w\-\.\/@]+) (\/[\w\-\.\/@]+)"/;
return input.match(regex);
}

const urlExamples = (format: UrlFormat): string => {
if (format === UrlFormat.git) {
return "https://github.com/polywrap/logging.git";
Expand Down Expand Up @@ -137,7 +145,7 @@ describe("e2e tests for create command", () => {
it("Should successfully generate project", async () => {
rimraf.sync(`${__dirname}/test`);

const { exitCode: code, stdout: output } = await runCli({
const { exitCode: code, stdout: output, stderr: error } = await runCli({
args: [
"create",
project,
Expand All @@ -156,6 +164,13 @@ describe("e2e tests for create command", () => {
}
});

const match = copyFailedError(error);
const template = path.join(__dirname, "..", "..", "..", "..", "..", "templates", project, lang);
if (match && match.length > 1 && !fs.existsSync(match[1]) && fs.existsSync(template)) {
console.log("Skipping test because new templates can't be copied until the next release");
return;
}

expect(code).toEqual(0);
expect(clearStyle(output)).toContain(
"🔥 You are ready "
Expand Down
17 changes: 17 additions & 0 deletions packages/cli/src/__tests__/e2e/p1/deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,21 @@ describe("e2e tests for deploy command", () => {
expect(sanitizedErr).toContain("Environment variable not found: `NON_LOADED_VAR`");
expect(code).toEqual(1);
});

it("Should deploy an interface successfully", async () => {
const { exitCode: code, stdout: output, stderr: error } = await Commands.deploy({}, {
cwd: getTestCaseDir(5),
cli: polywrapCli,
env: process.env as Record<string, string>
});

const sanitizedOutput = clearStyle(output);
const sanitizedError = clearStyle(error);

expect(code).toEqual(0);
expect(sanitizedError).toBeFalsy();
expect(sanitizedOutput).toContain(
"Successfully executed step 'ipfs_deploy'"
);
});
});
2 changes: 1 addition & 1 deletion packages/cli/src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const urlStr = intlMsg.commands_create_options_t_url();

export const supportedLangs = {
wasm: ["assemblyscript", "rust", "golang", "interface"] as const,
app: ["typescript"] as const,
app: ["typescript", "python", "rust", "android", "ios"] as const,
plugin: ["typescript", "rust", "python"] as const,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: '3'
services:
ganache:
build: ./eth
image: trufflesuite/ganache:latest
command: -d
ports:
- ${ETHEREUM_PORT:-8545}:8545
command: ganache -l 8000000 --networkId 1576478390085 --deterministic --hostname=0.0.0.0
ipfs:
build: ./ipfs
ports:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CodegenOverrides } from "../../../../codegen";
import { PolywrapProject } from "../../../../project";

import fs from "fs";
import path from "path";

export function getCodegenOverrides(): CodegenOverrides {
return {
getSchemaBindConfig: async (project: PolywrapProject) => {
const manifestPath = project.getManifestPath();
const manifestDir = path.dirname(manifestPath);
const pyprojectPath = path.join(manifestDir, "pyproject.toml");

const pyproject = fs.readFileSync(pyprojectPath, "utf8");
const match = pyproject.match(/name = "([A-Za-z0-9-]+)"/);
if (!match || !match[1]) {
return {};
}

const codegenDir = path.join(manifestDir, match[1], "wrap");

return {
codegenDir,
};
},
};
}
7 changes: 5 additions & 2 deletions packages/cli/src/lib/project/AppProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ export class AppProject extends Project<AppManifest> {
public async generateSchemaBindings(
abi: WrapAbi,
generationSubPath?: string,
bindgenUri?: string
bindgenUri?: string,
bindConfig?: Record<string, unknown>
): Promise<BindOutput> {
const bindLanguage = appManifestLanguageToBindLanguage(
await this.getManifestLanguage()
);
const codegenDir =
generationSubPath || (bindConfig?.codegenDir as string | undefined);
const options: BindOptions = {
bindLanguage,
wrapInfo: {
Expand All @@ -127,7 +130,7 @@ export class AppProject extends Project<AppManifest> {
type: bindLanguageToWrapInfoType(bindLanguage),
abi,
},
outputDirAbs: await this.getGenerationDirectory(generationSubPath),
outputDirAbs: await this.getGenerationDirectory(codegenDir),
};
return bindSchema(options, bindgenUri);
}
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/src/lib/project/manifests/app/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { BindLanguage } from "@polywrap/schema-bind";

export const appManifestLanguages = {
"app/typescript": "app/typescript",
"app/python": "app/python",
"app/rust": "app/rust",
"app/kotlin": "app/kotlin",
"app/swift": "app/swift",
};

export type AppManifestLanguages = typeof appManifestLanguages;
Expand All @@ -22,6 +26,14 @@ export function appManifestLanguageToBindLanguage(
switch (manifestLanguage) {
case "app/typescript":
return "app-ts";
case "app/python":
return "app-py";
case "app/rust":
return "app-rs";
case "app/kotlin":
return "app-kt";
case "app/swift":
return "app-swift";
default:
throw Error(
intlMsg.lib_language_unsupportedManifestLanguage({
Expand Down
32 changes: 24 additions & 8 deletions packages/schema/bind/src/bindings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,53 @@ export function getGenerateBindingFn(
switch (bindLanguage) {
case "wrap-as":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/wrap-assemblyscript"
"wrapscan.io/polywrap/wrap-assemblyscript-abi-bindgen@1"
);
case "wrap-rs":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/wrap-rust"
"wrapscan.io/polywrap/wrap-rust-abi-bindgen@1"
);
case "wrap-go":
return Golang.Wasm.generateBinding;
case "plugin-ts":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/plugin-typescript"
"wrapscan.io/polywrap/plugin-typescript-abi-bindgen@1"
);
case "plugin-rs":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/plugin-rust"
"wrapscan.io/polywrap/plugin-rust-abi-bindgen@1"
);
case "plugin-py":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/plugin-python"
"wrapscan.io/polywrap/plugin-python-abi-bindgen@1"
);
case "plugin-kt":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/plugin-kotlin"
"wrapscan.io/polywrap/plugin-kotlin-abi-bindgen@1"
);
case "plugin-swift":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/plugin-swift"
"wrapscan.io/polywrap/plugin-swift-abi-bindgen@1"
);
case "app-ts":
return WrapBindgen.getGenerateBindingFn(
"https://github.com/polywrap/wrap-abi-bindgen/tree/nk/ts-app-codegen/implementations/app-typescript"
"wrapscan.io/polywrap/app-typescript-abi-bindgen@1"
);
case "app-py":
return WrapBindgen.getGenerateBindingFn(
"wrapscan.io/polywrap/app-python-abi-bindgen@1"
);
case "app-rs":
return WrapBindgen.getGenerateBindingFn(
"wrapscan.io/polywrap/app-rust-abi-bindgen@1"
);
case "app-swift":
return WrapBindgen.getGenerateBindingFn(
"wrapscan.io/polywrap/app-swift-abi-bindgen@1"
);
case "app-kt":
return WrapBindgen.getGenerateBindingFn(
"wrapscan.io/polywrap/app-kotlin-abi-bindgen@1"
);
default:
throw Error(`Error: Language binding unsupported - ${bindLanguage}`);
Expand Down
4 changes: 4 additions & 0 deletions packages/schema/bind/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const bindLanguage = {
"plugin-kt": "plugin-kt",
"plugin-swift": "plugin-swift",
"app-ts": "app-ts",
"app-py": "app-py",
"app-rs": "app-rs",
"app-swift": "app-swift",
"app-kt": "app-kt",
};

export type BindLanguages = typeof bindLanguage;
Expand Down
17 changes: 17 additions & 0 deletions packages/templates/app/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
wrap
.polywrap
1 change: 1 addition & 0 deletions packages/templates/app/android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Loading