diff --git a/Cargo.lock b/Cargo.lock index 8a09cd1..dcfaa3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,8 +43,6 @@ version = "0.1.0" dependencies = [ "cargo-component-bindings", "minijinja", - "serde", - "serde_json", "thiserror", "wasmtime", "wasmtime-wasi", diff --git a/examples/crates/aggregate-wit-ui/Cargo.toml b/examples/crates/aggregate-wit-ui/Cargo.toml index 192f7c0..1d01203 100644 --- a/examples/crates/aggregate-wit-ui/Cargo.toml +++ b/examples/crates/aggregate-wit-ui/Cargo.toml @@ -14,8 +14,6 @@ minijinja = { version = "1.0.10" } wasmtime = { version = "16", features = ['component-model'] } wasmtime-wasi = "16.0" thiserror = "1.0" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" [lib] crate-type = ["cdylib"] @@ -26,8 +24,7 @@ package = "wallet:aggregate-wit-ui" [package.metadata.component.dependencies] [package.metadata.component.target.dependencies] -"seed-keeper:wit-ui" = { path = "../../../crates/seed-keeper-wit-ui/wit" } -"example:edwards-ui" = { path = "../edwards-ui/wit" } - +"seed-keeper:wit-ui" = { path = "wit/deps/seed-keeper-ui" } +"example:edwards-ui" = { path = "wit/deps/edwards-ui" } "seed-keeper:edwards-wit" = { path = "wit/deps/edwards" } -"seed-keeper:wallet" = { path = "../../../crates/seed-keeper-wallet/wit" } +"seed-keeper:wallet" = { path = "wit/deps/wallet" } diff --git a/examples/crates/aggregate-wit-ui/tests/mod.rs b/examples/crates/aggregate-wit-ui/tests/mod.rs index cb7324c..36e4603 100644 --- a/examples/crates/aggregate-wit-ui/tests/mod.rs +++ b/examples/crates/aggregate-wit-ui/tests/mod.rs @@ -3,11 +3,9 @@ //! Note: In order for this to run, we need to include the WIT dependencies in ./wit/deps/*, //! which is copy and paste from the source directory. mod bindgen { - // name of the world in the .wit file - wasmtime::component::bindgen!("example"); + wasmtime::component::bindgen!("agg"); } -use serde::{Deserialize, Serialize}; use std::{ env, path::{Path, PathBuf}, @@ -109,10 +107,6 @@ pub enum TestError { /// From io #[error("IO: {0}")] Io(#[from] std::io::Error), - - /// From serde_json - #[error("Serde JSON: {0}")] - SerdeJson(#[from] serde_json::Error), } impl From for TestError { @@ -121,14 +115,6 @@ impl From for TestError { } } -#[derive(Debug, Serialize, Deserialize)] -struct TestFixtures { - seed: Vec, - encrypted: Vec, - username: Vec, - password: Vec, -} - /// Utility function to get the workspace dir pub fn workspace_dir() -> PathBuf { let output = std::process::Command::new(env!("CARGO")) @@ -170,7 +156,7 @@ mod aggregate_example_tests { let mut linker = Linker::new(&engine); // link imports like get_seed to our instantiation - bindgen::Example::add_to_linker(&mut linker, |state: &mut MyCtx| state)?; + bindgen::Agg::add_to_linker(&mut linker, |state: &mut MyCtx| state)?; // link the WASI imports to our instantiation wasmtime_wasi::preview2::command::sync::add_to_linker(&mut linker)?; @@ -181,7 +167,7 @@ mod aggregate_example_tests { }; let mut store = Store::new(&engine, state); - let (bindings, _) = bindgen::Example::instantiate(&mut store, &component, &linker)?; + let (bindings, _) = bindgen::Agg::instantiate(&mut store, &component, &linker)?; // Use bindings // Call render with initial data, should return all HTML diff --git a/examples/crates/aggregate-wit-ui/wit/world.wit b/examples/crates/aggregate-wit-ui/wit/world.wit index 268c2eb..abefa55 100644 --- a/examples/crates/aggregate-wit-ui/wit/world.wit +++ b/examples/crates/aggregate-wit-ui/wit/world.wit @@ -65,7 +65,7 @@ interface wurbo-out { } /// An example world for the component to target. -world example { +world agg { // requests to the DOM via jco import wurbo-in;