feat: init commit, wait wit-bindgen supports host wasmtime

This commit is contained in:
2023-01-01 00:23:40 +08:00
parent b5f40688e2
commit 68e8d103b4
4 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.idea/
wit-bindgen/ wit-bindgen/
# ---> macOS # ---> macOS

13
interface.wit Normal file
View File

@@ -0,0 +1,13 @@
interface imports {
thunk: func()
}
interface exports {
thunk: func()
}
world smoke {
import imports: imports
default export exports
}

View File

@@ -9,5 +9,9 @@ edition = "2021"
crate-type = ['cdylib'] crate-type = ['cdylib']
[dependencies] [dependencies]
wit-bindgen-core = { path = '../wit-bindgen/crates/bindgen-core' }
wit-bindgen-guest-rust = { path = '../wit-bindgen/crates/guest-rust' }
boa_engine = "0.16.0" boa_engine = "0.16.0"
getrandom = { version = "0.2.8", features = ["js"] } getrandom = { version = "0.2.8", features = ["js"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

View File

@@ -0,0 +1,11 @@
wit_bindgen_guest_rust::generate!("../interface.wit");
struct Exports;
export_smoke!(Exports);
impl smoke::Smoke for Exports {
fn thunk() {
imports::thunk();
}
}