fix: update wasm-bindgen version

This commit is contained in:
mrxiaozhuox 2022-07-26 17:03:34 +08:00
parent ded8f86279
commit a21433016a
4 changed files with 29 additions and 27 deletions

46
Cargo.lock generated
View file

@ -2964,9 +2964,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"wasm-bindgen-macro", "wasm-bindgen-macro",
@ -2974,13 +2974,13 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"lazy_static",
"log", "log",
"once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",
@ -2989,9 +2989,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-cli-support" name = "wasm-bindgen-cli-support"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4016fbd42224de21aab2f009aeaec61067d278a298ba7f8f7f8d40fbffea0822" checksum = "f583642dbe7dcd382bdefe7d66bfc1b9915677aebafe90da5b30c1951b8eb6b4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.9.3", "base64 0.9.3",
@ -3013,9 +3013,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-externref-xform" name = "wasm-bindgen-externref-xform"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f33c8e2d3f3b6f6647f982911eb4cb44998c8cca97a4fe7afc99f616ebb33a73" checksum = "160edba014673ad3d778bf6455a29ebf34eeec826205fd827ab77d2c5facb4ff"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"walrus", "walrus",
@ -3035,9 +3035,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -3045,9 +3045,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -3058,9 +3058,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-multi-value-xform" name = "wasm-bindgen-multi-value-xform"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7015b54357604811162710d5cf274ab85d974fe1e324222dd5b2133afdefe9b9" checksum = "f325e04a6c8054111290e264928836909af56d702ee4cf66e453951365a18b13"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"walrus", "walrus",
@ -3068,15 +3068,15 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
[[package]] [[package]]
name = "wasm-bindgen-threads-xform" name = "wasm-bindgen-threads-xform"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6961b838d9a9c121ba4a1eea1628014cc759469e3defb42bbac9c5ed0f65be14" checksum = "49a8f631f078e8e8dedec16ca98dc23cc47d4b63db9bf067cb4471aa768d7256"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"walrus", "walrus",
@ -3085,9 +3085,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-wasm-conventions" name = "wasm-bindgen-wasm-conventions"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0a0eca38fe89471f57d6903f3e17e732d2d6f995a7af5b23f27df7fee0f0d18" checksum = "f550ec6c59aad41a02ba60f59aa92bca03ada228e0a01fd5d5f21d889ef97a23"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"walrus", "walrus",
@ -3095,9 +3095,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-wasm-interpreter" name = "wasm-bindgen-wasm-interpreter"
version = "0.2.81" version = "0.2.82"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b1c9fb7f71137840932bbb853ef1f83d68c88584b716c9bbae38675c9fb8b86" checksum = "9c736fc384fa38ac5a906f7409d0e99832a79993dd76315d3befc3471d494141"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"log", "log",

View file

@ -13,7 +13,7 @@ license = "MIT/Apache-2.0"
# cli core # cli core
clap = { version = "3.0.14", features = ["derive"] } clap = { version = "3.0.14", features = ["derive"] }
thiserror = "1.0.30" thiserror = "1.0.30"
wasm-bindgen-cli-support = "0.2.79" wasm-bindgen-cli-support = "0.2.82"
colored = "2.0.0" colored = "2.0.0"
# features # features

View file

@ -124,7 +124,7 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<BuildResult> {
.unwrap(); .unwrap();
}); });
if bindgen_result.is_err() { if bindgen_result.is_err() {
return Err(Error::BuildFailed("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.79` Bindgen crate.".to_string())); return Err(Error::BuildFailed("Bindgen build failed! \nThis is probably due to the Bindgen version, dioxus-cli using `0.2.82` Bindgen crate.".to_string()));
} }
// check binaryen:wasm-opt tool // check binaryen:wasm-opt tool

View file

@ -36,8 +36,7 @@ impl PluginManager {
let plugin_dir = Self::init_plugin_dir(); let plugin_dir = Self::init_plugin_dir();
let mut index = 0; let mut index = 0;
println!("{plugin_dir:?}"); for entry in WalkDir::new(&plugin_dir).into_iter().filter_map(|e| e.ok()) {
for entry in WalkDir::new(plugin_dir).into_iter().filter_map(|e| e.ok()) {
let plugin_dir = entry.path().to_path_buf(); let plugin_dir = entry.path().to_path_buf();
if plugin_dir.is_dir() { if plugin_dir.is_dir() {
let init_file = plugin_dir.join("init.lua"); let init_file = plugin_dir.join("init.lua");
@ -52,6 +51,9 @@ impl PluginManager {
} }
} }
lua.globals()
.set("package.path", format!("{}", plugin_dir.display())).unwrap();
lua.globals().set("manager", manager).unwrap(); lua.globals().set("manager", manager).unwrap();
Some(Self { lua }) Some(Self { lua })