diff --git a/.gitattributes b/.gitattributes index 7e1fe39..b01b98b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ # exclude these from the language stats lib/wasmbuild_bg.js linguist-vendored +.idea/ \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc5e56c..c464638 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: steps: - name: clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install Rust uses: dsherret/rust-toolchain-file@v1 diff --git a/Cargo.lock b/Cargo.lock index d36671d..9a4b3c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,12 +8,6 @@ version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - [[package]] name = "base64" version = "0.22.1" @@ -84,9 +78,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "foldhash" @@ -94,30 +88,30 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "gimli" -version = "0.26.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" dependencies = [ "fallible-iterator", - "indexmap 1.9.3", + "indexmap", "stable_deref_trait", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", + "foldhash 0.1.5", "serde", ] @@ -126,6 +120,11 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", + "serde", + "serde_core", +] [[package]] name = "heck" @@ -144,19 +143,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -172,9 +161,9 @@ checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "c7e709f3e3d22866f9c25b3aff01af289b18422cc8b4262fb19103ee80fe513d" dependencies = [ "once_cell", "wasm-bindgen", @@ -345,9 +334,9 @@ checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "walrus" -version = "0.24.4" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff282e73d21b86a9d397f42570d158eb9e5c521d0ead4d13cd049fd7cb45c467" +checksum = "8e227b6648df548f43f267aeee20dfd74d3121ccea10f6a73ea5aa319012df20" dependencies = [ "anyhow", "gimli", @@ -357,14 +346,14 @@ dependencies = [ "rayon", "walrus-macro", "wasm-encoder", - "wasmparser", + "wasmparser 0.245.1", ] [[package]] name = "walrus-macro" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef06db404cbaed87cb25fd2ca3a62502af485f43383c9641ffcf1479d02fffd" +checksum = "cef8d704ff46ad931a2cd1f7a504fe43ffb8e968d931e179ff18d0dff4949bd5" dependencies = [ "heck", "proc-macro2", @@ -374,9 +363,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "ec1adf1535672f5b7824f817792b1afd731d7e843d2d04ec8f27e8cb51edd8ac" dependencies = [ "cfg-if", "once_cell", @@ -387,9 +376,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-cli-support" -version = "0.2.106" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03794299fa80bda34aef2784a496c6440fbc75fb1977c4e05750ddcd617e5a09" +checksum = "537bf26ba62c0e0aeb0b3f63ba03d45db2fe66679c6fc248204c1ab566a2e178" dependencies = [ "anyhow", "base64", @@ -400,14 +389,14 @@ dependencies = [ "serde_json", "walrus", "wasm-bindgen-shared", - "wasmparser", + "wasmparser 0.240.0", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "19e638317c08b21663aed4d2b9a2091450548954695ff4efa75bff5fa546b3b1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -415,9 +404,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "2c64760850114d03d5f65457e96fc988f11f01d38fbaa51b254e4ab5809102af" dependencies = [ "bumpalo", "proc-macro2", @@ -428,21 +417,21 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "60eecd4fe26177cfa3339eb00b4a36445889ba3ad37080c2429879718e20ca41" dependencies = [ "unicode-ident", ] [[package]] name = "wasm-encoder" -version = "0.240.0" +version = "0.245.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06d642d8c5ecc083aafe9ceb32809276a304547a3a6eeecceb5d8152598bc71f" +checksum = "3f9dca005e69bf015e45577e415b9af8c67e8ee3c0e38b5b0add5aa92581ed5c" dependencies = [ "leb128fmt", - "wasmparser", + "wasmparser 0.245.1", ] [[package]] @@ -465,7 +454,20 @@ checksum = "b722dcf61e0ea47440b53ff83ccb5df8efec57a69d150e4f24882e4eba7e24a4" dependencies = [ "bitflags", "hashbrown 0.15.5", - "indexmap 2.12.1", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmparser" +version = "0.245.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f08c9adee0428b7bddf3890fc27e015ac4b761cc608c822667102b8bfd6995e" +dependencies = [ + "bitflags", + "hashbrown 0.16.1", + "indexmap", "semver", "serde", ] diff --git a/deno.json b/deno.json index fa77620..847ad53 100644 --- a/deno.json +++ b/deno.json @@ -19,7 +19,7 @@ }, "tasks": { "fmt": "deno fmt && cargo fmt", - "build": "cargo install wasm-bindgen-cli --version 0.2.106 --locked && WASMBUILD_BINDGEN_UPGRADE=1 deno run -A ./main.ts -p wasmbuild", + "build": "cargo install wasm-bindgen-cli --version 0.2.111 --locked && WASMBUILD_BINDGEN_UPGRADE=1 deno run -A ./main.ts -p wasmbuild", "build:lkg": "deno run -A jsr:@deno/wasmbuild@^0.15.4 -p wasmbuild", "test": "cd tests && rm -rf lib lib_out_js_file lib_inline lib_no_cache && deno task test:main && deno task test:js-ext && deno task test:inline && deno test -A && deno task test:check && deno task test:start && deno task test:start-inline", "test:main": "cd tests && deno run -A ../main.ts -p deno_test", diff --git a/lib/versions.ts b/lib/versions.ts index f2c8349..071f32e 100644 --- a/lib/versions.ts +++ b/lib/versions.ts @@ -6,10 +6,10 @@ interface WasmCrate { } export const versions = { - "wasm-bindgen": "0.2.106", - "wasm-bindgen-futures": "0.4.56", - "js-sys": "0.3.83", - "web-sys": "0.3.83", + "wasm-bindgen": "0.2.111", + "wasm-bindgen-futures": "0.4.61", + "js-sys": "0.3.88", + "web-sys": "0.3.88", } as const; export function verifyVersions(crate: WasmCrate) { diff --git a/lib/wasmbuild.js b/lib/wasmbuild.js index 81f3582..7daf216 100644 --- a/lib/wasmbuild.js +++ b/lib/wasmbuild.js @@ -4,7 +4,7 @@ // deno-fmt-ignore-file // @ts-self-types="./wasmbuild.d.ts" -// source-hash: d191f1a910caf8cc420de41ad5000f22e50a1473 +// source-hash: 96ee15c4a5de2d545341c90f78d6f37fdf42e217 import * as wasm from "./wasmbuild_bg.wasm"; export * from "./wasmbuild_bg.js"; import { __wbg_set_wasm } from "./wasmbuild_bg.js"; diff --git a/lib/wasmbuild_bg.js b/lib/wasmbuild_bg.js index 82ba8c7..2dae881 100644 --- a/lib/wasmbuild_bg.js +++ b/lib/wasmbuild_bg.js @@ -3,11 +3,100 @@ // deno-lint-ignore-file // deno-fmt-ignore-file -let wasm; -export function __wbg_set_wasm(val) { - wasm = val; +/** + * @param {string} name + * @param {string} ext + * @param {Uint8Array} wasm_bytes + * @returns {any} + */ +export function generate_bindgen(name, ext, wasm_bytes) { + const ptr0 = passStringToWasm0( + name, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc, + ); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passStringToWasm0( + ext, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc, + ); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArray8ToWasm0(wasm_bytes, wasm.__wbindgen_malloc); + const len2 = WASM_VECTOR_LEN; + const ret = wasm.generate_bindgen(ptr0, len0, ptr1, len1, ptr2, len2); + if (ret[2]) { + throw takeFromExternrefTable0(ret[1]); + } + return takeFromExternrefTable0(ret[0]); +} +export function __wbg_Error_ecbf49c1b9d07c30(arg0, arg1) { + const ret = Error(getStringFromWasm0(arg0, arg1)); + return ret; +} +export function __wbg_String_8564e559799eccda(arg0, arg1) { + const ret = String(arg1); + const ptr1 = passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc, + ); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); +} +export function __wbg___wbindgen_is_string_4d5f2c5b2acf65b0(arg0) { + const ret = typeof arg0 === "string"; + return ret; +} +export function __wbg___wbindgen_throw_df03e93053e0f4bc(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +} +export function __wbg_new_58794ce12509602d(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; +} +export function __wbg_new_62f131e968c83d75() { + const ret = new Object(); + return ret; +} +export function __wbg_new_66075f8c2ea6575e() { + const ret = new Array(); + return ret; +} +export function __wbg_new_74eb411a4d7bd3f1() { + const ret = new Map(); + return ret; +} +export function __wbg_set_3ba5af57f57f831c(arg0, arg1, arg2) { + const ret = arg0.set(arg1, arg2); + return ret; +} +export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) { + arg0[arg1] = arg2; +} +export function __wbg_set_7bf9e2df46e7632c(arg0, arg1, arg2) { + arg0[arg1 >>> 0] = arg2; +} +export function __wbindgen_cast_0000000000000001(arg0) { + // Cast intrinsic for `F64 -> Externref`. + const ret = arg0; + return ret; +} +export function __wbindgen_cast_0000000000000002(arg0, arg1) { + // Cast intrinsic for `Ref(String) -> Externref`. + const ret = getStringFromWasm0(arg0, arg1); + return ret; +} +export function __wbindgen_init_externref_table() { + const table = wasm.__wbindgen_externrefs; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); } - let cachedDataViewMemory0 = null; function getDataViewMemory0() { if ( @@ -123,111 +212,7 @@ if (!("encodeInto" in cachedTextEncoder)) { let WASM_VECTOR_LEN = 0; -/** - * @param {string} name - * @param {string} ext - * @param {Uint8Array} wasm_bytes - * @returns {any} - */ -export function generate_bindgen(name, ext, wasm_bytes) { - const ptr0 = passStringToWasm0( - name, - wasm.__wbindgen_malloc, - wasm.__wbindgen_realloc, - ); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0( - ext, - wasm.__wbindgen_malloc, - wasm.__wbindgen_realloc, - ); - const len1 = WASM_VECTOR_LEN; - const ptr2 = passArray8ToWasm0(wasm_bytes, wasm.__wbindgen_malloc); - const len2 = WASM_VECTOR_LEN; - const ret = wasm.generate_bindgen(ptr0, len0, ptr1, len1, ptr2, len2); - if (ret[2]) { - throw takeFromExternrefTable0(ret[1]); - } - return takeFromExternrefTable0(ret[0]); -} - -export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) { - const ret = Error(getStringFromWasm0(arg0, arg1)); - return ret; -} - -export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) { - const ret = String(arg1); - const ptr1 = passStringToWasm0( - ret, - wasm.__wbindgen_malloc, - wasm.__wbindgen_realloc, - ); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); -} - -export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) { - const ret = typeof arg0 === "string"; - return ret; -} - -export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) { - throw new Error(getStringFromWasm0(arg0, arg1)); -} - -export function __wbg_new_1ba21ce319a06297() { - const ret = new Object(); - return ret; -} - -export function __wbg_new_25f239778d6112b9() { - const ret = new Array(); - return ret; -} - -export function __wbg_new_b546ae120718850e() { - const ret = new Map(); - return ret; -} - -export function __wbg_new_df1173567d5ff028(arg0, arg1) { - const ret = new Error(getStringFromWasm0(arg0, arg1)); - return ret; -} - -export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) { - arg0[arg1] = arg2; -} - -export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) { - arg0[arg1 >>> 0] = arg2; -} - -export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) { - const ret = arg0.set(arg1, arg2); - return ret; -} - -export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) { - // Cast intrinsic for `Ref(String) -> Externref`. - const ret = getStringFromWasm0(arg0, arg1); - return ret; -} - -export function __wbindgen_cast_d6cd19b81560fd6e(arg0) { - // Cast intrinsic for `F64 -> Externref`. - const ret = arg0; - return ret; -} - -export function __wbindgen_init_externref_table() { - const table = wasm.__wbindgen_externrefs; - const offset = table.grow(4); - table.set(0, undefined); - table.set(offset + 0, undefined); - table.set(offset + 1, null); - table.set(offset + 2, true); - table.set(offset + 3, false); +let wasm; +export function __wbg_set_wasm(val) { + wasm = val; } diff --git a/lib/wasmbuild_bg.wasm b/lib/wasmbuild_bg.wasm index fcf5a02..4d56d04 100644 Binary files a/lib/wasmbuild_bg.wasm and b/lib/wasmbuild_bg.wasm differ diff --git a/rs_lib/Cargo.toml b/rs_lib/Cargo.toml index 892e89b..6d7712f 100644 --- a/rs_lib/Cargo.toml +++ b/rs_lib/Cargo.toml @@ -8,9 +8,9 @@ crate-type = ["cdylib"] [dependencies] anyhow = "=1.0.93" -js-sys = "=0.3.83" +js-sys = "=0.3.88" serde = { version = "1.0.215", features = ["derive", "rc"] } # make sure to update the version in lib/versions.ts to match this version -wasm-bindgen = "=0.2.106" -wasm-bindgen-cli-support = "=0.2.106" +wasm-bindgen = "=0.2.111" +wasm-bindgen-cli-support = "=0.2.111" serde-wasm-bindgen = "=0.6.5" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index efd3308..d409795 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.85.0" +channel = "1.88.0" components = [ "clippy", "rustfmt" ] diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 1b4cfd3..4b2e473 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" start = [] [dependencies] -wasm-bindgen = "0.2.106" +wasm-bindgen = "0.2.111" [lib] name = "deno_test"