Skip to content

Commit

Permalink
Merge pull request #1929 from polywrap/fix-templates
Browse files Browse the repository at this point in the history
chore: update templates
  • Loading branch information
dOrgJelli authored Nov 23, 2023
2 parents fef53c9 + 2d1a4f7 commit 10b41cb
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 83 deletions.
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

0 comments on commit 10b41cb

Please sign in to comment.