Skip to content

Commit

Permalink
Merge pull request #1930 from polywrap/origin-dev
Browse files Browse the repository at this point in the history
chore: prep 0.12.2
  • Loading branch information
dOrgJelli authored Nov 23, 2023
2 parents 8ba54d0 + 912621b commit fa4977d
Show file tree
Hide file tree
Showing 38 changed files with 120 additions and 86 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Polywrap Origin (0.12.2)
## Features
**`polywrap` CLI:**
* [PR-1928](https://github.com/polywrap/cli/pull/1928) **Add `--no-wasm` Option To `polywrap build`**
* `build` command now supports the `--no-wasm` option, which disables the wasm compilation step when compiling projects.

## Bugs
**`@polywrap/templates`:**
* [PR-1929](https://github.com/polywrap/cli/pull/1929) **Fix Rust Codegen Compiler Errors**

# Polywrap Origin (0.12.1)
## Features
**`polywrap` CLI:**
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.1
0.12.2
4 changes: 4 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ Currently, `build` can be run for Wasm, Plugin and Interface projects.
Skip codegen before building.
By default, `build` performs a `codegen` step before building your Project. This option skips this step.

- `--no-wasm`
Skip wasm compilation.
By default, `build` performs wasm compilation. This option skips this step.

- `-s, --strategy <strategy>`
Specify which build strategy to use. By default, the `vm` build strategy is used.
Available strategies:
Expand Down
1 change: 1 addition & 0 deletions packages/cli/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"commands_build_options_options": "options",
"commands_build_options_t": "Use the development server's ENS instance",
"commands_build_options_codegen": "Skip code generation before build",
"commands_build_options_no_wasm": "Skip wasm compilation",
"commands_build_options_codegen_dir": "Codegen output directory (default: {default})",
"commands_build_options_s": "Strategy to use for building the wrapper (default: {default})",
"commands_build_options_s_strategy": "strategy",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"commands_build_options_options": "options",
"commands_build_options_t": "Use the development server's ENS instance",
"commands_build_options_codegen": "Skip code generation before build",
"commands_build_options_no_wasm": "Skip wasm compilation",
"commands_build_options_codegen_dir": "Codegen output directory (default: {default})",
"commands_build_options_s": "Strategy to use for building the wrapper (default: {default})",
"commands_build_options_s_strategy": "strategy",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Options:
-c, --client-config <config-path> Add custom configuration to the
PolywrapClient
-n, --no-codegen Skip code generation before build
--no-wasm Skip wasm compilation
--codegen-dir Codegen output directory (default:
./src/wrap)
--wrapper-envs <envs-path> Path to a JSON file containing wrapper
Expand Down Expand Up @@ -265,7 +266,7 @@ describe("e2e tests for build command", () => {
expect(output).toContain(`WRAP manifest written in ${buildDir}/wrap.info`);
});
})

describe("test-cases", () => {
for (let i = 0; i < testCases.length; i++) {
const testCaseName = testCases[i];
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface BuildCommandOptions extends BaseCommandOptions {
clientConfig: string | false;
wrapperEnvs: string | false;
noCodegen: boolean;
noWasm: boolean;
codegenDir: string | false;
watch: boolean;
strategy: `${SupportedStrategies}`;
Expand Down Expand Up @@ -80,6 +81,7 @@ export const build: Command = {
`${intlMsg.commands_common_options_config()}`
)
.option(`-n, --no-codegen`, `${intlMsg.commands_build_options_codegen()}`)
.option(`--no-wasm`, `${intlMsg.commands_build_options_no_wasm()}`)
.option(
`--codegen-dir`,
`${intlMsg.commands_build_options_codegen_dir({
Expand Down Expand Up @@ -117,6 +119,7 @@ export const build: Command = {
outputDir: parseDirOption(options.outputDir, defaultOutputDir),
bindgen: options.bindgen || false,
noCodegen: !options.codegen || false,
noWasm: !options.wasm || false,
codegenDir: parseDirOptionNoDefault(options.codegenDir),
strategy: options.strategy || defaultStrategy,
watch: options.watch || false,
Expand Down Expand Up @@ -174,6 +177,7 @@ async function run(options: Required<BuildCommandOptions>) {
bindgen,
strategy,
noCodegen,
noWasm,
codegenDir,
verbose,
quiet,
Expand Down Expand Up @@ -220,7 +224,7 @@ async function run(options: Required<BuildCommandOptions>) {

const isInterface = language === "interface";

if (isInterface) {
if (isInterface || noWasm) {
buildStrategy = new NoopBuildStrategy({
project: project as PolywrapProject,
outputDir,
Expand Down
11 changes: 2 additions & 9 deletions packages/cli/src/lib/test-env/client-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getTestEnvProviders } from "./providers";
import { ETH_ENS_IPFS_MODULE_CONSTANTS } from "../../lib";

import {
Expand All @@ -18,14 +17,8 @@ import { IWrapPackage, Uri } from "@polywrap/core-js";
export function getTestEnvClientConfig(): Partial<BuilderConfig> {
// TODO: move this into its own package, since it's being used everywhere?
// maybe have it exported from test-env.
const providers = getTestEnvProviders();
const ipfsProvider = providers.ipfsProvider;
const ethProvider = providers.ethProvider;

if (!ipfsProvider || !ethProvider) {
throw Error("Test environment not found.");
}

const ipfsProvider = ETH_ENS_IPFS_MODULE_CONSTANTS.ipfsProvider;
const ethProvider = ETH_ENS_IPFS_MODULE_CONSTANTS.ethereumProvider;
const ensAddress = ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.ensAddress;
const testnetEnsResolverUri = "proxy/testnet-ens-contenthash-uri-resolver";

Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/test-env/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./client-config";
export * from "./providers";
11 changes: 0 additions & 11 deletions packages/cli/src/lib/test-env/providers.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/templates/app/android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"codegen": "npx polywrap codegen -g app/src/main/java/wrap"
},
"devDependencies": {
"polywrap": "0.11.2"
"polywrap": "~0.12.1"
}
}
2 changes: 1 addition & 1 deletion packages/templates/app/ios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"codegen": "npx polywrap codegen -g Template/wrap"
},
"devDependencies": {
"polywrap": "0.11.2"
"polywrap": "~0.12.1"
}
}
2 changes: 1 addition & 1 deletion packages/templates/app/python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"test": "poetry run python -m sample"
},
"devDependencies": {
"polywrap": "0.11.2"
"polywrap": "~0.12.1"
}
}
2 changes: 1 addition & 1 deletion packages/templates/app/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include = [
]

[dependencies]
polywrap = { version = "~0.1.9-beta.2" }
polywrap = { version = "~0.1.10" }
serde = {version = "1.0.145", features = ["derive"]}

[dev-dependencies]
2 changes: 1 addition & 1 deletion packages/templates/app/rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"codegen": "npx polywrap codegen"
},
"devDependencies": {
"polywrap": "0.11.2"
"polywrap": "~0.12.1"
}
}
2 changes: 1 addition & 1 deletion packages/templates/app/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@types/node": "18.15.0",
"polywrap": "0.12.1",
"polywrap": "~0.12.1",
"ts-node": "10.9.1",
"typescript": "4.9.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/plugin/python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"test": "poetry run pytest"
},
"dependencies": {
"polywrap": "0.11.3"
"polywrap": "~0.12.1"
}
}
8 changes: 4 additions & 4 deletions packages/templates/plugin/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ include = [
]

[dependencies]
polywrap_core = { version = "~0.1.8" }
polywrap_plugin = { version = "~0.1.8" }
polywrap_core = { version = "~0.1.10" }
polywrap_plugin = { version = "~0.1.10" }
polywrap_msgpack_serde = { version = "~0.0.2-beta.7" }
wrap_manifest_schemas = { version = "~0.1.8" }
wrap_manifest_schemas = { version = "~0.1.10" }
serde = {version = "1.0.145", features = ["derive"]}

[dev-dependencies]
polywrap_client = { version = "~0.1.8" }
polywrap = { version = "~0.1.10" }
2 changes: 1 addition & 1 deletion packages/templates/plugin/rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "templates-plugin-rust",
"private": true,
"dependencies": {
"polywrap": "0.11.3"
"polywrap": "~0.12.1"
}
}
20 changes: 9 additions & 11 deletions packages/templates/plugin/rust/tests/e2e.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
use template_plugin_rs::SamplePlugin;
use template_plugin_rs::wrap::module::ArgsSampleMethod;
use polywrap_core::{
client::ClientConfig,
uri::Uri,
use polywrap::{
Client,
ClientConfig,
ClientConfigBuilder,
Uri,
};
use polywrap_plugin::{package::PluginPackage};
use polywrap_client::{
client::PolywrapClient,
builder::{PolywrapClientConfig, PolywrapClientConfigBuilder},
};
use polywrap_msgpack_serde::to_vec;
use std::{
sync::{Arc, Mutex},
sync::{Arc},
};

fn get_client() -> PolywrapClient {
fn get_client() -> Client {
let sample_plugin = SamplePlugin {};
let plugin_pkg = PluginPackage::<SamplePlugin>::from(sample_plugin);

let mut config = PolywrapClientConfig::new();
let mut config = ClientConfig::new();
config.add_package(
Uri::try_from("plugin/sample").unwrap(),
Arc::new(plugin_pkg)
);

PolywrapClient::new(config.into())
Client::new(config.into())
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/plugin/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/jest": "26.0.8",
"@types/prettier": "2.6.0",
"jest": "26.6.3",
"polywrap": "0.12.1",
"polywrap": "~0.12.1",
"rimraf": "3.0.2",
"ts-jest": "26.5.4",
"ts-node": "10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/wasm/assemblyscript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@types/jest": "26.0.8",
"jest": "26.6.3",
"polywrap": "0.12.1",
"polywrap": "~0.12.1",
"ts-jest": "26.5.4",
"typescript": "4.9.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/wasm/golang/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@types/jest": "26.0.8",
"jest": "26.6.3",
"polywrap": "0.12.1",
"polywrap": "~0.12.1",
"ts-jest": "26.5.4",
"typescript": "4.9.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/wasm/interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "templates-interface",
"private": true,
"dependencies": {
"polywrap": "~0.11.0"
"polywrap": "~0.12.1"
}
}
6 changes: 3 additions & 3 deletions packages/templates/wasm/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ edition = "2021"
include = ["src"]

[dependencies]
polywrap-wasm-rs = { version = "0.12.0" }
polywrap_msgpack_serde = "0.0.2-beta.7"
polywrap-wasm-rs = { version = "~0.12.1" }
polywrap_msgpack_serde = "0.0.2"
serde = { version = "1.0", features = ["derive"] }

[dev-dependencies]
polywrap = { version = "0.1.9-beta.2" }
polywrap = { version = "~0.1.10" }

[lib]
crate-type = ["cdylib"]
Expand Down
8 changes: 3 additions & 5 deletions packages/templates/wasm/rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
"codegen": "npx polywrap codegen",
"build": "npx polywrap build",
"deploy": "npx polywrap deploy",
"test": "yarn test:e2e && yarn test:workflow",
"test:e2e": "yarn test:e2e:codegen && cargo test --release",
"test:e2e:codegen": "npx polywrap codegen -m ./tests/types/polywrap.app.yaml -g ./tests/types/wrap",
"test:workflow": "npx polywrap test"
"test": "yarn test:codegen && cargo test --release",
"test:codegen": "npx polywrap codegen -m ./tests/types/polywrap.app.yaml -g ./tests/types/wrap"
},
"devDependencies": {
"polywrap": "0.12.1"
"polywrap": "~0.12.1"
}
}
11 changes: 0 additions & 11 deletions packages/templates/wasm/rust/polywrap.test.cue

This file was deleted.

10 changes: 0 additions & 10 deletions packages/templates/wasm/rust/polywrap.test.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions packages/templates/wasm/rust/tests/it/module.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use crate::types::wrap::types::{
TemplateModule,
TemplateModuleArgsSampleMethod
Template,
TemplateArgsSampleMethod
};

#[test]
fn sample_method() {
let args = TemplateModuleArgsSampleMethod {
let args = TemplateArgsSampleMethod {
arg: "input data".to_string(),
};
let template: TemplateModule = TemplateModule::new(None, None, None);
let response = template.sample_method(&args, None, None, None).unwrap();
let template: Template = Template::new(None);
let response = template.sample_method(&args, None).unwrap();
assert_eq!(response.result, "input data from sample_method");
}
2 changes: 1 addition & 1 deletion packages/templates/wasm/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@rollup/plugin-typescript": "^11.1.2",
"@types/jest": "26.0.8",
"jest": "26.6.3",
"polywrap": "0.12.1",
"polywrap": "~0.12.1",
"rollup": "^3.28.0",
"typescript": "^5.1.6"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"noWasm": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"wrap.info"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"stdout": [
"WRAP manifest written in ./build"
],
"exitCode": 0
}
Loading

0 comments on commit fa4977d

Please sign in to comment.