Skip to content

Commit 43984de

Browse files
authored
Merge pull request #1841 from polywrap/origin-0.11-dev
Prep Origin 0.11 | /workflows/release-pr
2 parents 7a00d99 + e40a4cb commit 43984de

File tree

535 files changed

+8764
-29194
lines changed

Some content is hidden

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

535 files changed

+8764
-29194
lines changed

.github/workflows/cd-containers.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,22 @@ jobs:
4242
run: |
4343
echo IMAGE_RS_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm >> $GITHUB_ENV
4444
echo IMAGE_AS_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm >> $GITHUB_ENV
45+
echo IMAGE_GO_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/golang/vm >> $GITHUB_ENV
4546
4647
- name: Read Image VERSION & NAME into env.IMAGE_..._VERSION/NAME
4748
run: |
4849
echo IMAGE_RS_VM_NAME=$(cat $IMAGE_RS_VM_DIR/NAME) >> $GITHUB_ENV
4950
echo IMAGE_RS_VM_VERSION=$(cat $IMAGE_RS_VM_DIR/VERSION) >> $GITHUB_ENV
5051
echo IMAGE_AS_VM_NAME=$(cat $IMAGE_AS_VM_DIR/NAME) >> $GITHUB_ENV
5152
echo IMAGE_AS_VM_VERSION=$(cat $IMAGE_AS_VM_DIR/VERSION) >> $GITHUB_ENV
53+
echo IMAGE_GO_VM_NAME=$(cat $IMAGE_GO_VM_DIR/NAME) >> $GITHUB_ENV
54+
echo IMAGE_GO_VM_VERSION=$(cat $IMAGE_GO_VM_DIR/VERSION) >> $GITHUB_ENV
5255
5356
- name: Check if image tags already exist
5457
run: |
5558
echo IMAGE_RS_VM_UNPUBLISHED=$(! curl -s "https://hub.docker.com/v2/repositories/$IMAGE_RS_VM_NAME/tags/$IMAGE_RS_VM_VERSION" | grep -q "error 404" > /dev/null ; echo $?) >> $GITHUB_ENV
5659
echo IMAGE_AS_VM_UNPUBLISHED=$(! curl -s "https://hub.docker.com/v2/repositories/$IMAGE_AS_VM_NAME/tags/$IMAGE_AS_VM_VERSION" | grep -q "error 404" > /dev/null ; echo $?) >> $GITHUB_ENV
60+
echo IMAGE_GO_VM_UNPUBLISHED=$(! curl -s "https://hub.docker.com/v2/repositories/$IMAGE_GO_VM_NAME/tags/$IMAGE_GO_VM_VERSION" | grep -q "error 404" > /dev/null ; echo $?) >> $GITHUB_ENV
5761
5862
- name: Build & Publish RS VM Image
5963
if: env.IMAGE_RS_VM_UNPUBLISHED == '1'
@@ -70,3 +74,11 @@ jobs:
7074
docker buildx create --use --name as-vm-builder
7175
docker buildx build . --platform=linux/amd64,linux/arm64 -t $IMAGE_AS_VM_NAME:latest -t $IMAGE_AS_VM_NAME:$IMAGE_AS_VM_VERSION --output type=registry
7276
docker buildx rm as-vm-builder
77+
78+
- name: Build & Publish GO VM Image
79+
if: env.IMAGE_GO_VM_UNPUBLISHED == '1'
80+
working-directory: ${{env.IMAGE_GO_VM_DIR}}
81+
run: |
82+
docker buildx create --use --name go-vm-builder
83+
docker buildx build . --platform=linux/amd64,linux/arm64 -t $IMAGE_GO_VM_NAME:latest -t $IMAGE_GO_VM_NAME:$IMAGE_GO_VM_VERSION --output type=registry
84+
docker buildx rm go-vm-builder

.github/workflows/ci-golang.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI-Golang
2+
3+
on:
4+
push:
5+
branches:
6+
- origin
7+
- origin-dev
8+
pull_request:
9+
10+
jobs:
11+
Test-Cli:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Read .nvmrc
18+
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
19+
id: nvm
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@master
23+
with:
24+
node-version: '${{ steps.nvm.outputs.NVMRC }}'
25+
26+
- name: Get yarn cache directory path
27+
id: yarn-cache-dir-path
28+
run: echo "::set-output name=dir::$(yarn cache dir)"
29+
30+
- uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
36+
37+
- name: Install dependencies
38+
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
39+
40+
- name: Build
41+
run: yarn build
42+
43+
- name: Test
44+
run: yarn test:golang
45+
working-directory: ./packages/cli

.github/workflows/ci-javascript.yaml

+60-12
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ jobs:
8383
CI-WRAP-Test-Harness:
8484
uses: ./.github/workflows/ci-wrap-test-harness.yaml
8585

86-
Test-Core:
86+
Test-Templates:
8787
runs-on: ubuntu-latest
88-
needs: CI-WRAP-Test-Harness
8988
timeout-minutes: 60
9089
if: ${{ always() }}
9190
steps:
@@ -139,18 +138,63 @@ jobs:
139138
- name: Build
140139
run: yarn build
141140

142-
- name: Get updated wrappers
143-
if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
144-
uses: actions/download-artifact@v3
145-
id: get-wrappers
141+
- name: Test
142+
run: yarn test:templates
143+
144+
Test-Core:
145+
runs-on: ubuntu-latest
146+
timeout-minutes: 60
147+
if: ${{ always() }}
148+
steps:
149+
- name: Checkout repository
150+
uses: actions/checkout@v2
151+
152+
- name: Read .nvmrc
153+
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
154+
id: nvm
155+
156+
- name: Setup Node.js
157+
uses: actions/setup-node@master
146158
with:
147-
name: rebuilt-wrappers
148-
path: ./wrappers
159+
node-version: '${{ steps.nvm.outputs.NVMRC }}'
149160

150-
- if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
151-
run: |
152-
rm -rf packages/test-cases/cases/wrappers
153-
mv wrappers packages/test-cases/cases
161+
- name: Setup Python
162+
uses: actions/setup-python@v4
163+
with:
164+
python-version: '3.10'
165+
166+
- name: Setup Poetry
167+
uses: abatilo/actions-poetry@v2
168+
with:
169+
poetry-version: '1.4.2'
170+
171+
- name: Setup Go
172+
uses: actions/setup-go@v3
173+
with:
174+
go-version: '^1.13.1'
175+
176+
- name: Install cue lang
177+
run: go install cuelang.org/go/cmd/cue@latest
178+
179+
- name: Check if cue is installed
180+
run: cue version
181+
182+
- name: Get yarn cache directory path
183+
id: yarn-cache-dir-path
184+
run: echo "::set-output name=dir::$(yarn cache dir)"
185+
186+
- uses: actions/cache@v2
187+
with:
188+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
189+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
190+
restore-keys: |
191+
${{ runner.os }}-yarn-
192+
193+
- name: Install dependencies
194+
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
195+
196+
- name: Build
197+
run: yarn build
154198

155199
- name: Test
156200
run: yarn test:core
@@ -224,3 +268,7 @@ jobs:
224268
- name: Test cli:e2e:p2
225269
run: yarn test:e2e:p2
226270
working-directory: ./packages/cli
271+
272+
- name: Test CLI JS
273+
run: yarn test
274+
working-directory: ./packages/js/cli

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
# Polywrap Origin (0.11.0)
2+
## Features
3+
**`polywrap` CLI:**
4+
* [PR-1074](https://github.com/polywrap/cli/pull/1074) **Golang-based Wraps Now Supported!**
5+
* Polywrap projects of `type: wasm/golang` are now supported.
6+
* To get started, simply run `polywrap create wasm golang my-wrap`
7+
* [PR-1829](https://github.com/polywrap/cli/pull/1829) **Support User-Defined Bindgen URIs**
8+
* The `build` and `codegen` commands now have the option `--bindgen <URI>`, which allows for the use of a custom bindgen wrap.
9+
* [PR-1774](https://github.com/polywrap/cli/pull/1774) **`polywrap deploy` Defaults To IPFS on wrapscan.io**
10+
* When you run the `polywrap deploy` command, you no longer need a `polywrap.deploy.yaml` manifest file. By default it will deploy your wrap to IPFS on https://wrapscan.io.
11+
12+
**`@polywrap/schema-bind`:**
13+
* [PR-1795](https://github.com/polywrap/cli/pull/1795) **Add `wrap-abi-bindgen` Support**
14+
* All wrap bindings are now emitted using the wraps defined within the [wrap-abi-bindgen](https://github.com/polywrap/wrap-abi-bindgen) project.
15+
* This enables binding updates to be released, without us needing to create a new release of the CLI.
16+
* [PR-1840](https://github.com/polywrap/cli/pull/1840) **Support Swift Plugin Bindings**
17+
* Add support for `plugin/swift` bindings, used when building plugins in Swift.
18+
19+
## Breaking Changes
20+
**`polywrap` CLI:**
21+
* [PR-1809](https://github.com/polywrap/cli/pull/1809) **`docgen` Command Removed**
22+
* The `docgen` command has been largely unused so it has been removed.
23+
* [PR-1839](https://github.com/polywrap/cli/pull/1839) **Remove ENS Deploy Modules**
24+
* All ENS deploy modules have been removed. If you'd like to publish your wrap's IPFS hash to ENS, simply use the [ENS web app](https://ens.domains/).
25+
26+
## Bugs
27+
**`polywrap` CLI:**
28+
* [PR-1823](https://github.com/polywrap/cli/pull/1823) **Support Fuzzy URI Strings in Manifests**
29+
* URIs within manifest files are no longer as strict, and can be any string.
30+
* [PR-1808](https://github.com/polywrap/cli/pull/1808) **IPFS Deploy W/ Node v18**
31+
* The IPFS deployer module has been updated so that it runs on all node versions, including version 18.
32+
* [PR-1804](https://github.com/polywrap/cli/pull/1804) **Emit Resources & Docs For Interface Wraps**
33+
* When building an wrap of type `interface`, resources and doc artifacts were not being properly emitted to the build folder.
34+
135
# Polywrap Origin (0.10.6)
236
## Bugs
337
**`polywrap` CLI:**

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.6
1+
0.11.0

WRAP_TEST_HARNESS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
master
1+
chore/latest-rust-wrap-bindings

package.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@
3131
"lint:fix": "lerna run lint -- --fix",
3232
"lint:ci": "yarn lint",
3333
"test": "lerna run test --no-private --concurrency 1",
34-
"test:core": "lerna run test --no-private --ignore polywrap* --concurrency 1",
35-
"test:cli": "yarn test:cli:unit && yarn test:cli:e2e",
36-
"test:cli:unit": "lerna run test:unit --no-private --scope polywrap --concurrency 1",
37-
"test:cli:e2e:p1": "lerna run test:e2e:p1 --no-private --scope polywrap --concurrency 1",
38-
"test:cli:e2e:p2": "lerna run test:e2e:p2 --no-private --scope polywrap --concurrency 1",
34+
"test:core": "lerna run test --no-private --ignore polywrap* --ignore @polywrap/cli-js --ignore @polywrap/templates --concurrency 1",
35+
"test:cli": "yarn test:cli:unit && yarn test:cli:e2e && yarn test:cli:js",
36+
"test:cli:unit": "lerna run test:unit --scope polywrap --concurrency 1",
37+
"test:cli:e2e": "yarn test:cli:e2e:p1 && yarn test:cli:e2e:p2",
38+
"test:cli:e2e:p1": "lerna run test:e2e:p1 --scope polywrap --concurrency 1",
39+
"test:cli:e2e:p2": "lerna run test:e2e:p2 --scope polywrap --concurrency 1",
40+
"test:cli:js": "lerna run test --scope @polywrap/cli-js --concurrency 1",
41+
"test:templates": "lerna run test --no-private --scope @polywrap/templates --concurrency 1",
3942
"version:apply": "lerna version $(cat VERSION) --exact --no-git-tag-version --yes",
4043
"postversion:apply": "git add . && git commit -m \"build(release): migrate to `cat ./VERSION`\"",
4144
"publish:npm": "lerna exec --no-private --concurrency 1 -- yarn publish --access public --non-interactive --verbose",
@@ -58,6 +61,7 @@
5861
},
5962
"resolutions": {
6063
"@types/react": "16.9.0",
61-
"@types/react-dom": "16.9.0"
64+
"@types/react-dom": "16.9.0",
65+
"@types/node": "18.15.0"
6266
}
6367
}

packages/cli/jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ module.exports = {
1111
modulePathIgnorePatterns: [
1212
"<rootDir>/build",
1313
"<rootDir>/src/__tests__/project/.polywrap",
14-
"<rootDir>/src/__tests__/e2e/build-rs.spec.ts"
14+
"<rootDir>/src/__tests__/e2e/build-rs.spec.ts",
15+
"<rootDir>/src/__tests__/e2e/build-go.spec.ts"
1516
],
1617
testPathIgnorePatterns: [
1718
"<rootDir>/src/__tests__/project/.polywrap"

packages/cli/jest.go.config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
collectCoverage: true,
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
globals: {
6+
"ts-jest": {
7+
diagnostics: false
8+
},
9+
},
10+
modulePathIgnorePatterns: [
11+
"<rootDir>/build",
12+
"<rootDir>/src/__tests__/project/.polywrap"
13+
],
14+
testPathIgnorePatterns: [
15+
"<rootDir>/src/__tests__/project/.polywrap"
16+
],
17+
transformIgnorePatterns: [
18+
"<rootDir>/src/__tests__/project/.polywrap"
19+
],
20+
setupFilesAfterEnv: ["./jest.setup.js"],
21+
testMatch: ["**/build-go.spec.ts"]
22+
};

packages/cli/lang/en.json

+6-11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"commands_build_description": "Build Polywrap Projects (type: interface, wasm)",
1010
"commands_build_error_manifestPathMissing": "{option} option missing {argument} argument",
1111
"commands_build_error_manifestNotFound": "Manifest not found. Search paths used: {paths}",
12+
"commands_build_error_goModNotFound": "go.mod file not found. Search paths used: {paths}",
1213
"commands_build_error_outputDirMissingPath": "{option} option missing {argument} argument",
1314
"commands_build_error_unsupportedProjectType": "Unsupported project type. You can only build the following project types: {supportedTypes}",
1415
"commands_build_keypressListener_exit": "Exit: [CTRL + C], [ESC], or [Q]",
@@ -91,19 +92,11 @@
9192
"commands_codegen_options_m": "Path to the Polywrap manifest file (default: {default})",
9293
"commands_codegen_options_o": "Output directory for custom generated types (default: 'types/')",
9394
"commands_codegen_options_o_path": "path",
95+
"commands_codegen_options_b": "Uri for custom bindgen wrap (must implement wrap-abi-bindgen interface; see https://github.com/polywrap/wrap-abi-bindgen)",
9496
"commands_codegen_success": "Types were generated successfully",
97+
"commands_codegen_invalid_uri": "Invalid WRAP URI format: {uri}.",
9598
"commands_codegen_project_load_error": "Failed to load project, please make sure {manifestPath} is a valid Project manifest",
9699
"commands_codegen_options_publish": "Output path for the built schema and manifest (default: {default})",
97-
"commands_docgen_description": "Generate wrapper documentation",
98-
"commands_docgen_success": "Docs were generated successfully",
99-
"commands_docgen_default": "default",
100-
"commands_docgen_options_c": "Output directory for generated docs (default: {default})",
101-
"commands_docgen_options_m": "Path to the project manifest file (default: {default})",
102-
"commands_docgen_options_schema": "Generate GraphQL schema",
103-
"commands_docgen_options_markdown": "Generate {framework} markdown",
104-
"commands_docgen_options_i": "Also generate docs for dependencies",
105-
"commands_docgen_error_manifestNotFound": "Manifest not found. Search paths used: {paths}",
106-
"commands_docgen_error_projectLoadFailed": "Could not load project form the given manifest. Manifest: `{manifestFile}`",
107100
"commands_create_description": "Create New Projects",
108101
"commands_create_directoryExists": "Directory with name {dir} already exists",
109102
"commands_create_error_commandFail": "Command failed: {error}",
@@ -176,7 +169,6 @@
176169
"commands_test_error_unsupportedOutputFileExt": "Unsupported outputFile extention: {outputFileExt}",
177170
"commands_test_error_cueDoesNotExist": "Require cue to run validator, checkout https://cuelang.org/ for more information",
178171
"commands_test_error_noWorkflowScriptFound": "Workflow script not found at path: {path}",
179-
"commands_test_error_noTestEnvFound": "polywrap test-env not found, please run 'polywrap infra up --modules=eth-ens-ipfs'",
180172
"commands_polywrap_error_notACommand": "is not a command",
181173
"commands_polywrap_helpPrompt": "Type {command} to view common commands",
182174
"commands_manifest_description": "Inspect & Migrade Polywrap Manifests",
@@ -243,6 +235,8 @@
243235
"lib_helpers_deployManifestExt_loadError": "Failed to load deploy manifest extension from {path}",
244236
"lib_helpers_deployManifestExt_loadText": "Load manifest extension from {path}",
245237
"lib_helpers_deployManifestExt_loadWarning": "No manifest extension found in {path}",
238+
"lib_helpers_gomod_unableToLoad": "Unable to load go.mod: {path}",
239+
"lib_helpers_gomod_invalid": "Invalid format of go.mod: {path}",
246240
"lib_helpers_manifest_outputError": "Failed to output manifest to {path}",
247241
"lib_helpers_manifest_outputText": "Manifest written to {path}",
248242
"lib_helpers_manifest_outputWarning": "Warnings writing manifest to {path}",
@@ -282,6 +276,7 @@
282276
"lib_typescript_tsNodeNotInstalled": "Your project uses typescript, but ts-node is not installed",
283277
"lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}",
284278
"lib_wasm_rust_invalidModule": "Module paths must point to Cargo.toml files. Found: {path}",
279+
"lib_wasm_golang_invalidModule": "Module paths must point to go.mod file. Found: {path}",
285280
"lib_docker_invalidImageId": "Invalid docker image ID returned: {imageId}",
286281
"lib_docker_noInstall": "Docker executable not found in PATH",
287282
"lib_infra_unrecognizedModule": "Unrecognized modules: {modules}. Default modules: {defaultModules}",

0 commit comments

Comments
 (0)