diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 877efb9..4673605 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,7 @@ jobs: uses: actions-rs/toolchain@v1 with: toolchain: stable + target: wasm32-wasip2 - name: Format run: cargo fmt --all -- --check - name: Docs diff --git a/Cargo.lock b/Cargo.lock index 7fed6b2..6ebb638 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -354,24 +354,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] -name = "component-init" +name = "component-init-cli" version = "0.1.0" dependencies = [ "anyhow", - "async-trait", - "futures", - "wasm-encoder 0.235.0", - "wasmparser 0.235.0", + "clap", + "component-init-wasmtime", + "tokio", ] [[package]] -name = "component-init-cli" +name = "component-init-transform" version = "0.1.0" dependencies = [ "anyhow", - "clap", - "component-init-wasmtime", - "tokio", + "async-trait", + "futures", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", ] [[package]] @@ -380,7 +380,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "component-init", + "component-init-transform", "test-programs-artifacts", "tokio", "wasmtime", diff --git a/Cargo.toml b/Cargo.toml index 38503a9..ab54305 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] -members = ["cli", "wasmtime", "test-programs", "test-programs/artifacts"] +members = ["cli", "transform", "wasmtime", "test-programs", "test-programs/artifacts"] +resolver = "3" [workspace.package] version = "0.1.0" @@ -9,7 +10,7 @@ edition = "2024" anyhow = "1.0.89" async-trait = "0.1.83" clap = { version = "4", features = ["derive"] } -component-init = { path = "." } +component-init-transform = { path = "./transform" } component-init-wasmtime = { path = "./wasmtime" } futures = "0.3.31" test-programs = { path = "./test-programs" } @@ -22,15 +23,3 @@ wasmtime-wasi = "34.0.1" wasmtime-wasi-http = "34.0.1" wat = "1.235.0" wit-bindgen = "0.43.0" - -[package] -name = "component-init" -version.workspace = true -edition.workspace = true - -[dependencies] -anyhow.workspace = true -async-trait.workspace = true -futures.workspace = true -wasm-encoder.workspace = true -wasmparser.workspace = true diff --git a/transform/Cargo.toml b/transform/Cargo.toml new file mode 100644 index 0000000..ffef3ba --- /dev/null +++ b/transform/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "component-init-transform" +version.workspace = true +edition.workspace = true + +[dependencies] +anyhow.workspace = true +async-trait.workspace = true +futures.workspace = true +wasm-encoder.workspace = true +wasmparser.workspace = true diff --git a/src/lib.rs b/transform/src/lib.rs similarity index 100% rename from src/lib.rs rename to transform/src/lib.rs diff --git a/wasmtime/Cargo.toml b/wasmtime/Cargo.toml index a41e953..4da06e7 100644 --- a/wasmtime/Cargo.toml +++ b/wasmtime/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true [dependencies] anyhow.workspace = true async-trait.workspace = true -component-init.workspace = true +component-init-transform.workspace = true wasmtime.workspace = true [dev-dependencies] diff --git a/wasmtime/src/lib.rs b/wasmtime/src/lib.rs index 7afc2ac..32bbdc9 100644 --- a/wasmtime/src/lib.rs +++ b/wasmtime/src/lib.rs @@ -1,12 +1,12 @@ use anyhow::{Context, Result, anyhow}; -use component_init::Invoker; +use component_init_transform::Invoker; use wasmtime::{ Config, Engine, Store, component::{Component, ComponentNamedList, Instance, Lift, Linker}, }; pub async fn initialize(component: &[u8]) -> Result> { - component_init::initialize(component, |instrumented| { + component_init_transform::initialize(component, |instrumented| { Box::pin(async move { let i = invoker(instrumented) .await