From 8fffa492822f26ae2139f2a8b8031bfbbd72e1f1 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 18 Dec 2024 23:48:30 +0800 Subject: [PATCH] fix(napi): resuse threads worker on Node.js (#2399) --- .cargo/config.toml | 7 +- .github/workflows/test-release.yaml | 2 +- .yarnrc.yml | 5 + cli/cli.mjs | 2 +- cli/esbuild.mjs | 4 +- cli/src/api/templates/load-wasi-template.ts | 4 +- crates/backend/src/codegen/fn.rs | 2 +- crates/build/src/wasi.rs | 5 + .../src/bindgen_runtime/module_register.rs | 40 ++-- crates/napi/src/env.rs | 34 +++- crates/napi/src/lib.rs | 10 + crates/napi/src/tokio_runtime.rs | 63 ++++--- examples/binary/tsconfig.json | 3 + .../napi-compat-mode/__tests__/object.spec.ts | 2 + examples/napi-compat-mode/package.json | 2 +- examples/napi-compat-mode/tsconfig.json | 16 ++ .../__snapshots__/typegen.spec.ts.snap | Bin 5685 -> 5685 bytes .../__tests__/__snapshots__/values.spec.ts.md | 1 + .../__snapshots__/values.spec.ts.snap | Bin 418 -> 427 bytes examples/napi/example.wasi-browser.js | 2 +- examples/napi/example.wasi.cjs | 2 +- examples/napi/package.json | 3 +- examples/napi/src/object.rs | 4 +- examples/napi/tsconfig.json | 3 +- examples/tsconfig.json | 10 - memory-testing/tsconfig.json | 3 + package.json | 1 + tsconfig.json | 7 +- tsconfig.root-lint.json | 15 -- yarn.lock | 175 +++++++++++++++++- 30 files changed, 323 insertions(+), 104 deletions(-) create mode 100644 examples/binary/tsconfig.json create mode 100644 examples/napi-compat-mode/tsconfig.json delete mode 100644 examples/tsconfig.json create mode 100644 memory-testing/tsconfig.json delete mode 100644 tsconfig.root-lint.json diff --git a/.cargo/config.toml b/.cargo/config.toml index 84e72904..f7769b63 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,7 @@ [target.'cfg(target_family = "wasm")'] -rustflags = ["-C", "target-feature=+atomics,+bulk-memory"] +rustflags = [ + "--cfg", + "tokio_unstable", + "-C", + "target-feature=+atomics,+bulk-memory", +] diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml index 90184ecd..51103808 100644 --- a/.github/workflows/test-release.yaml +++ b/.github/workflows/test-release.yaml @@ -153,7 +153,7 @@ jobs: - name: 'Install dependencies' shell: bash run: | - yarn config set supportedArchitectures.cpu --json '["current", "x64", "x86"]' + yarn config set supportedArchitectures.cpu --json '["current", "x64", "ia32", "wasm32"]' yarn install --mode=skip-build --immutable - name: Check build diff --git a/.yarnrc.yml b/.yarnrc.yml index f3c6c728..16000d00 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1,8 @@ nodeLinker: node-modules yarnPath: .yarn/releases/yarn-4.5.3.cjs + +supportedArchitectures: + cpu: + - current + - wasm32 diff --git a/cli/cli.mjs b/cli/cli.mjs index 1c0fd092..19c7d6f6 100755 --- a/cli/cli.mjs +++ b/cli/cli.mjs @@ -5,7 +5,7 @@ import { resolve } from 'path' import { fileURLToPath } from 'url' execSync( - `node --loader ts-node/esm/transpile-only ${resolve( + `node --import @oxc-node/core/register ${resolve( fileURLToPath(import.meta.url), '../src/cli.ts', )} ${process.argv.slice(2).join(' ')}`, diff --git a/cli/esbuild.mjs b/cli/esbuild.mjs index 78657910..65e9e5f8 100644 --- a/cli/esbuild.mjs +++ b/cli/esbuild.mjs @@ -1,9 +1,9 @@ -import * as esbuild from 'esbuild' +import { build} from 'esbuild' import { pull } from 'lodash-es' import packageJson from './package.json' assert { type: 'json' } -await esbuild.build({ +await build({ entryPoints: ['./dist/index.js'], outfile: './dist/index.cjs', bundle: true, diff --git a/cli/src/api/templates/load-wasi-template.ts b/cli/src/api/templates/load-wasi-template.ts index ad62b29f..b387037e 100644 --- a/cli/src/api/templates/load-wasi-template.ts +++ b/cli/src/api/templates/load-wasi-template.ts @@ -15,7 +15,7 @@ const __wasi = new __WASI({ fs: __fs, preopens: { '/': '/', - } + }, })` : ` const __wasi = new __WASI({ @@ -147,11 +147,11 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule return 4 } })(), + reuseWorker: true, wasi: __wasi, onCreateWorker() { const worker = new Worker(__nodePath.join(__dirname, 'wasi-worker.mjs'), { env: process.env, - execArgv: ['--experimental-wasi-unstable-preview1'], }) worker.onmessage = ({ data }) => { __wasmCreateOnMessageForFsProxy(__nodeFs)(data) diff --git a/crates/backend/src/codegen/fn.rs b/crates/backend/src/codegen/fn.rs index 9cd316e1..52adfbe6 100644 --- a/crates/backend/src/codegen/fn.rs +++ b/crates/backend/src/codegen/fn.rs @@ -79,7 +79,7 @@ impl TryToTokens for NapiFn { #(#refs)* - #[cfg(debug_assert)] + #[cfg(debug_assertions)] { for a in &_args_array { assert!(!a.is_null(), "failed to initialize napi ref"); diff --git a/crates/build/src/wasi.rs b/crates/build/src/wasi.rs index 4c44275a..f5d8d7b3 100644 --- a/crates/build/src/wasi.rs +++ b/crates/build/src/wasi.rs @@ -25,4 +25,9 @@ pub fn setup() { println!("cargo:rustc-link-search={setjmp_link_dir}"); println!("cargo:rustc-link-lib=static=setjmp-mt"); } + if let Ok(wasi_sdk_path) = env::var("WASI_SDK_PATH") { + println!( + "cargo:rustc-link-search={wasi_sdk_path}/share/wasi-sysroot/lib/wasm32-wasip1-threads" + ); + } } diff --git a/crates/napi/src/bindgen_runtime/module_register.rs b/crates/napi/src/bindgen_runtime/module_register.rs index 62185f5a..9157d5a1 100644 --- a/crates/napi/src/bindgen_runtime/module_register.rs +++ b/crates/napi/src/bindgen_runtime/module_register.rs @@ -6,12 +6,6 @@ use std::ffi::CStr; use std::mem::MaybeUninit; #[cfg(not(feature = "noop"))] use std::ptr; -#[cfg(all( - not(any(target_os = "macos", target_family = "wasm")), - feature = "napi4", - feature = "tokio_rt" -))] -use std::sync::atomic::AtomicUsize; #[cfg(not(feature = "noop"))] use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{LazyLock, RwLock}; @@ -411,13 +405,13 @@ pub unsafe extern "C" fn napi_register_module_v1( } } }); + }); - REGISTERED_CLASSES.borrow_mut(|map| { - map.insert( - std::thread::current().id(), - PersistedPerInstanceHashMap::from_hashmap(registered_classes), - ) - }); + REGISTERED_CLASSES.borrow_mut(|map| { + map.insert( + std::thread::current().id(), + PersistedPerInstanceHashMap::from_hashmap(registered_classes), + ) }); #[cfg(feature = "compat-mode")] @@ -430,23 +424,25 @@ pub unsafe extern "C" fn napi_register_module_v1( }) } - #[cfg(all( - not(any(target_os = "macos", target_family = "wasm")), - feature = "napi4", - feature = "tokio_rt" - ))] + #[cfg(all(feature = "napi4", feature = "tokio_rt"))] { crate::tokio_runtime::ensure_runtime(); - static init_counter: AtomicUsize = AtomicUsize::new(0); - let cleanup_hook_payload = - init_counter.fetch_add(1, Ordering::Relaxed) as *mut std::ffi::c_void; - + #[cfg(not(target_family = "wasm"))] unsafe { sys::napi_add_env_cleanup_hook( env, Some(crate::tokio_runtime::drop_runtime), - cleanup_hook_payload, + ptr::null_mut(), + ) + }; + + #[cfg(target_family = "wasm")] + unsafe { + crate::napi_add_env_cleanup_hook( + env, + Some(crate::tokio_runtime::drop_runtime), + ptr::null_mut(), ) }; } diff --git a/crates/napi/src/env.rs b/crates/napi/src/env.rs index 8710738b..edfb8280 100644 --- a/crates/napi/src/env.rs +++ b/crates/napi/src/env.rs @@ -1011,13 +1011,27 @@ impl Env { hook: Box::new(cleanup_fn), }; let hook_ref = Box::leak(Box::new(hook)); - check_status!(unsafe { - sys::napi_add_env_cleanup_hook( - self.0, - Some(cleanup_env::), - hook_ref as *mut CleanupEnvHookData as *mut _, - ) - })?; + #[cfg(not(target_family = "wasm"))] + { + check_status!(unsafe { + sys::napi_add_env_cleanup_hook( + self.0, + Some(cleanup_env::), + (hook_ref as *mut CleanupEnvHookData).cast(), + ) + })?; + } + + #[cfg(target_family = "wasm")] + { + check_status!(unsafe { + crate::napi_add_env_cleanup_hook( + self.0, + Some(cleanup_env::), + (hook_ref as *mut CleanupEnvHookData).cast(), + ) + })?; + } Ok(CleanupEnvHook(hook_ref)) } @@ -1146,8 +1160,7 @@ impl Env { check_status!(unsafe { sys::napi_set_instance_data( self.0, - Box::leak(Box::new((TaggedObject::new(native), finalize_cb))) as *mut (TaggedObject, F) - as *mut c_void, + Box::into_raw(Box::new((TaggedObject::new(native), finalize_cb))).cast(), Some( set_instance_finalize_callback:: as unsafe extern "C" fn( @@ -1156,7 +1169,7 @@ impl Env { finalize_hint: *mut c_void, ), ), - Box::leak(Box::new(hint)) as *mut Hint as *mut c_void, + Box::into_raw(Box::new(hint)).cast(), ) }) } @@ -1377,6 +1390,7 @@ unsafe extern "C" fn drop_buffer( mem::drop(unsafe { Vec::from_raw_parts(finalize_data as *mut u8, length, cap) }); } +#[cfg_attr(target_family = "wasm", allow(unused_variables))] pub(crate) unsafe extern "C" fn raw_finalize( env: sys::napi_env, finalize_data: *mut c_void, diff --git a/crates/napi/src/lib.rs b/crates/napi/src/lib.rs index 19ea3f37..0fa3771e 100644 --- a/crates/napi/src/lib.rs +++ b/crates/napi/src/lib.rs @@ -65,6 +65,16 @@ //! ``` //! +#[cfg(target_family = "wasm")] +#[link(wasm_import_module = "napi")] +extern "C" { + fn napi_add_env_cleanup_hook( + env: sys::napi_env, + fun: Option, + arg: *mut core::ffi::c_void, + ) -> sys::napi_status; +} + #[cfg(feature = "napi8")] mod async_cleanup_hook; #[cfg(feature = "napi8")] diff --git a/crates/napi/src/tokio_runtime.rs b/crates/napi/src/tokio_runtime.rs index 398df3a2..f4c1e759 100644 --- a/crates/napi/src/tokio_runtime.rs +++ b/crates/napi/src/tokio_runtime.rs @@ -11,18 +11,24 @@ use crate::{ }; fn create_runtime() -> Option { - #[cfg(not(target_family = "wasm"))] - { - let runtime = tokio::runtime::Runtime::new().expect("Create tokio runtime failed"); - Some(runtime) - } - #[cfg(target_family = "wasm")] { - tokio::runtime::Builder::new_current_thread() - .enable_all() - .build() - .ok() + Some( + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("Create tokio runtime failed"), + ) + } + + #[cfg(not(target_family = "wasm"))] + { + Some( + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .expect("Create tokio runtime failed"), + ) } } @@ -56,14 +62,12 @@ pub fn create_custom_tokio_runtime(rt: Runtime) { USER_DEFINED_RT.get_or_init(move || Mutex::new(Some(rt))); } -#[cfg(not(any(target_os = "macos", target_family = "wasm")))] static RT_REFERENCE_COUNT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); /// Ensure that the Tokio runtime is initialized. /// In windows the Tokio runtime will be dropped when Node env exits. /// But in Electron renderer process, the Node env will exits and recreate when the window reloads. /// So we need to ensure that the Tokio runtime is initialized when the Node env is created. -#[cfg(not(any(target_os = "macos", target_family = "wasm")))] pub(crate) fn ensure_runtime() { use std::sync::atomic::Ordering; @@ -75,12 +79,13 @@ pub(crate) fn ensure_runtime() { RT_REFERENCE_COUNT.fetch_add(1, Ordering::Relaxed); } -#[cfg(not(any(target_os = "macos", target_family = "wasm")))] pub(crate) unsafe extern "C" fn drop_runtime(_arg: *mut std::ffi::c_void) { use std::sync::atomic::Ordering; if RT_REFERENCE_COUNT.fetch_sub(1, Ordering::AcqRel) == 1 { - RT.write().unwrap().take(); + if let Some(rt) = RT.write().unwrap().take() { + rt.shutdown_background(); + } } } @@ -198,23 +203,23 @@ pub fn execute_tokio_future< }; #[cfg(not(target_family = "wasm"))] - { - let jh = spawn(inner); - spawn(async move { - if let Err(err) = jh.await { - if let Ok(reason) = err.try_into_panic() { - if let Some(s) = reason.downcast_ref::<&str>() { - deferred_for_panic.reject(Error::new(crate::Status::GenericFailure, s)); - } else { - deferred_for_panic.reject(Error::new( - crate::Status::GenericFailure, - "Panic in async function", - )); - } + let jh = spawn(inner); + + #[cfg(not(target_family = "wasm"))] + spawn(async move { + if let Err(err) = jh.await { + if let Ok(reason) = err.try_into_panic() { + if let Some(s) = reason.downcast_ref::<&str>() { + deferred_for_panic.reject(Error::new(crate::Status::GenericFailure, s)); + } else { + deferred_for_panic.reject(Error::new( + crate::Status::GenericFailure, + "Panic in async function", + )); } } - }); - } + } + }); #[cfg(target_family = "wasm")] { diff --git a/examples/binary/tsconfig.json b/examples/binary/tsconfig.json new file mode 100644 index 00000000..4082f16a --- /dev/null +++ b/examples/binary/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} diff --git a/examples/napi-compat-mode/__tests__/object.spec.ts b/examples/napi-compat-mode/__tests__/object.spec.ts index e55249b2..508080ce 100644 --- a/examples/napi-compat-mode/__tests__/object.spec.ts +++ b/examples/napi-compat-mode/__tests__/object.spec.ts @@ -6,6 +6,7 @@ test('setProperty', (t) => { const obj = {} const key = 'jsPropertyKey' bindings.testSetProperty(obj, key) + // @ts-expect-error t.snapshot(obj[key]) }) @@ -26,6 +27,7 @@ test('setNamedProperty', (t) => { const [key] = keys t.is(keys.length, 1) t.snapshot(key) + // @ts-expect-error t.is(obj[key], property) }) diff --git a/examples/napi-compat-mode/package.json b/examples/napi-compat-mode/package.json index d83880b3..28d87714 100644 --- a/examples/napi-compat-mode/package.json +++ b/examples/napi-compat-mode/package.json @@ -23,7 +23,7 @@ "__tests__/**/*.spec.ts" ], "environmentVariables": { - "TS_NODE_PROJECT": "../tsconfig.json" + "TS_NODE_PROJECT": "./tsconfig.json" }, "workerThreads": false, "cache": false, diff --git a/examples/napi-compat-mode/tsconfig.json b/examples/napi-compat-mode/tsconfig.json new file mode 100644 index 00000000..c65b0616 --- /dev/null +++ b/examples/napi-compat-mode/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "include": ["."], + "compilerOptions": { + "moduleResolution": "node", + "outDir": "./dist", + "rootDir": ".", + "target": "ESNext", + "module": "CommonJS", + "skipLibCheck": true, + "noEmit": true, + "importHelpers": false, + "noEmitHelpers": false + }, + "exclude": ["dist"] +} diff --git a/examples/napi/__tests__/__snapshots__/typegen.spec.ts.snap b/examples/napi/__tests__/__snapshots__/typegen.spec.ts.snap index 8cc3e873a187158d65229275e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$K}%x1Xm{XZLpZ%AIhMuPiq?k5*PIVHGRvQaiib z=Q(riw(;B~U2=G6KxYo#kH8D?4tyO2Ay+^G+yM{36YvIn0H44&5Hz3%TmuZKfhp}w zX#2((R#S>!VHgtHCv-~a5E>0KqfJ8F6FN*_IuRKgXHxu0O3{wJbw(7DTWmD2ap4;q zX4jD^l@n`@wI1@e#GDXV1ADI VV8hegh>9Dbe*ke5(%;1b008Dev-JP~ literal 418 zcmV;T0bTwp34sQ2g;iP_q;LRA3Q8yIBo2;LafGYYdr#w8zs@GwP9Oa4O$HUTTzctpnJv9F${SJmg$;i9 zn&%>j`@~hyz~NAnh6R8Uz%zgk0AB$104@o*BH)$)Nx%~UF9f_3@JYZo0eb=l32>bN zcL^}0`haRT&WSA%f2C;(YJ*NeT?{F~8C5{F0d>bl6e@FmG}Y=)60z+^8=NY%^jsud zoX27#{3>&66Vys_R^hBS4%9|xu`Y@U}yYbR-P~)J@!8$HkXIBxW zVAx<-pR8xIt%m>Un8#&3HDy38Q M2cT<>mZ1Uw0Iop5jQ{`u diff --git a/examples/napi/example.wasi-browser.js b/examples/napi/example.wasi-browser.js index d754e448..fa730957 100644 --- a/examples/napi/example.wasi-browser.js +++ b/examples/napi/example.wasi-browser.js @@ -14,7 +14,7 @@ const __wasi = new __WASI({ fs: __fs, preopens: { '/': '/', - } + }, }) const __emnapiContext = __emnapiGetDefaultContext() diff --git a/examples/napi/example.wasi.cjs b/examples/napi/example.wasi.cjs index 35648da5..8a5e303d 100644 --- a/examples/napi/example.wasi.cjs +++ b/examples/napi/example.wasi.cjs @@ -56,11 +56,11 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule return 4 } })(), + reuseWorker: true, wasi: __wasi, onCreateWorker() { const worker = new Worker(__nodePath.join(__dirname, 'wasi-worker.mjs'), { env: process.env, - execArgv: ['--experimental-wasi-unstable-preview1'], }) worker.onmessage = ({ data }) => { __wasmCreateOnMessageForFsProxy(__nodeFs)(data) diff --git a/examples/napi/package.json b/examples/napi/package.json index e014b3f7..2f681da3 100644 --- a/examples/napi/package.json +++ b/examples/napi/package.json @@ -8,7 +8,7 @@ "scripts": { "browser": "vite", "build": "napi-raw build --platform --js index.cjs --dts index.d.cts", - "test": "cross-env TS_NODE_PROJECT=./tsconfig.json node --es-module-specifier-resolution=node --loader ts-node/esm/transpile-only --experimental-wasi-unstable-preview1 ../../node_modules/ava/entrypoints/cli.mjs" + "test": "cross-env TS_NODE_PROJECT=./tsconfig.json node --loader ts-node/esm/transpile-only ../../node_modules/ava/entrypoints/cli.mjs" }, "napi": { "binaryName": "example", @@ -28,6 +28,7 @@ "@napi-rs/cli": "workspace:*", "@napi-rs/triples": "workspace:*", "@napi-rs/wasm-runtime": "workspace:*", + "@oxc-node/core": "^0.0.16", "@types/lodash": "^4.17.10", "@vitest/browser": "^2.1.2", "@vitest/ui": "^2.1.2", diff --git a/examples/napi/src/object.rs b/examples/napi/src/object.rs index 1896e5c4..af0bc228 100644 --- a/examples/napi/src/object.rs +++ b/examples/napi/src/object.rs @@ -174,11 +174,11 @@ pub fn generate_function_and_call_it(env: &Env) -> Result { } #[napi] -fn get_null_byte_property(obj: JsObject) -> Result> { +pub fn get_null_byte_property(obj: JsObject) -> Result> { obj.get::("\0virtual") } #[napi] -fn set_null_byte_property(mut obj: JsObject) -> Result<()> { +pub fn set_null_byte_property(mut obj: JsObject) -> Result<()> { obj.set("\0virtual", "test") } diff --git a/examples/napi/tsconfig.json b/examples/napi/tsconfig.json index 1d513f26..6e7a6daa 100644 --- a/examples/napi/tsconfig.json +++ b/examples/napi/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.json", "include": ["."], "compilerOptions": { "moduleResolution": "node", @@ -7,7 +7,6 @@ "rootDir": ".", "target": "ESNext", "module": "ESNext", - "skipLibCheck": false, "noEmit": true, "types": ["bun-types"], "importHelpers": false diff --git a/examples/tsconfig.json b/examples/tsconfig.json deleted file mode 100644 index 8989757c..00000000 --- a/examples/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tsconfig.json", - "include": ["."], - "compilerOptions": { - "outDir": "./dist", - "rootDir": ".", - "target": "ES2015" - }, - "exclude": ["dist"] -} diff --git a/memory-testing/tsconfig.json b/memory-testing/tsconfig.json new file mode 100644 index 00000000..3c43903c --- /dev/null +++ b/memory-testing/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.json" +} diff --git a/package.json b/package.json index 0130d394..fc4396b0 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ }, "devDependencies": { "@napi-rs/cli": "workspace:*", + "@oxc-node/core": "^0.0.16", "@taplo/cli": "^0.7.0", "@types/debug": "^4.1.12", "@types/lodash-es": "^4.17.12", diff --git a/tsconfig.json b/tsconfig.json index 664e01ca..e093de87 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,11 @@ "outDir": "scripts", "lib": ["ES2022"] }, - "include": ["."], + "include": [], + "references": [ + { "path": "./examples/napi-compat-mode/tsconfig.json" }, + { "path": "./examples/napi/tsconfig.json" }, + { "path": "./cli/tsconfig.json" } + ], "exclude": ["node_modules", "bench", "cli/scripts", "scripts", "target"] } diff --git a/tsconfig.root-lint.json b/tsconfig.root-lint.json deleted file mode 100644 index 9f946838..00000000 --- a/tsconfig.root-lint.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": [ - "./ava.config.mjs", - "./triples/index.js", - "./wasm-runtime/*.js", - "./wasm-runtime/*.cjs", - "./memory-testing/*.js", - "./memory-testing/*.mjs", - "./crates/cli/index.js", - "./examples/**/*.js", - "./examples/**/*.mjs", - "./examples/**/*.cjs" - ] -} diff --git a/yarn.lock b/yarn.lock index f7165ca2..136ba8a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -521,6 +521,7 @@ __metadata: "@napi-rs/cli": "workspace:*" "@napi-rs/triples": "workspace:*" "@napi-rs/wasm-runtime": "workspace:*" + "@oxc-node/core": "npm:^0.0.16" "@types/lodash": "npm:^4.17.10" "@vitest/browser": "npm:^2.1.2" "@vitest/ui": "npm:^2.1.2" @@ -1399,7 +1400,7 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^0.2.3, @napi-rs/wasm-runtime@npm:^0.2.4, @napi-rs/wasm-runtime@workspace:*, @napi-rs/wasm-runtime@workspace:wasm-runtime": +"@napi-rs/wasm-runtime@npm:^0.2.3, @napi-rs/wasm-runtime@npm:^0.2.4, @napi-rs/wasm-runtime@npm:^0.2.5, @napi-rs/wasm-runtime@workspace:*, @napi-rs/wasm-runtime@workspace:wasm-runtime": version: 0.0.0-use.local resolution: "@napi-rs/wasm-runtime@workspace:wasm-runtime" dependencies: @@ -2183,6 +2184,177 @@ __metadata: languageName: node linkType: hard +"@oxc-node/core-android-arm-eabi@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-android-arm-eabi@npm:0.0.16" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxc-node/core-android-arm64@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-android-arm64@npm:0.0.16" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-node/core-darwin-arm64@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-darwin-arm64@npm:0.0.16" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-node/core-darwin-x64@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-darwin-x64@npm:0.0.16" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxc-node/core-freebsd-x64@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-freebsd-x64@npm:0.0.16" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxc-node/core-linux-arm-gnueabihf@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-arm-gnueabihf@npm:0.0.16" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxc-node/core-linux-arm64-gnu@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-arm64-gnu@npm:0.0.16" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-node/core-linux-arm64-musl@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-arm64-musl@npm:0.0.16" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxc-node/core-linux-ppc64-gnu@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-ppc64-gnu@npm:0.0.16" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-node/core-linux-s390x-gnu@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-s390x-gnu@npm:0.0.16" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxc-node/core-linux-x64-gnu@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-x64-gnu@npm:0.0.16" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-node/core-linux-x64-musl@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-linux-x64-musl@npm:0.0.16" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxc-node/core-wasm32-wasi@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-wasm32-wasi@npm:0.0.16" + dependencies: + "@napi-rs/wasm-runtime": "npm:^0.2.5" + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@oxc-node/core-win32-arm64-msvc@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-win32-arm64-msvc@npm:0.0.16" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-node/core-win32-ia32-msvc@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-win32-ia32-msvc@npm:0.0.16" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxc-node/core-win32-x64-msvc@npm:0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core-win32-x64-msvc@npm:0.0.16" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@oxc-node/core@npm:^0.0.16": + version: 0.0.16 + resolution: "@oxc-node/core@npm:0.0.16" + dependencies: + "@oxc-node/core-android-arm-eabi": "npm:0.0.16" + "@oxc-node/core-android-arm64": "npm:0.0.16" + "@oxc-node/core-darwin-arm64": "npm:0.0.16" + "@oxc-node/core-darwin-x64": "npm:0.0.16" + "@oxc-node/core-freebsd-x64": "npm:0.0.16" + "@oxc-node/core-linux-arm-gnueabihf": "npm:0.0.16" + "@oxc-node/core-linux-arm64-gnu": "npm:0.0.16" + "@oxc-node/core-linux-arm64-musl": "npm:0.0.16" + "@oxc-node/core-linux-ppc64-gnu": "npm:0.0.16" + "@oxc-node/core-linux-s390x-gnu": "npm:0.0.16" + "@oxc-node/core-linux-x64-gnu": "npm:0.0.16" + "@oxc-node/core-linux-x64-musl": "npm:0.0.16" + "@oxc-node/core-wasm32-wasi": "npm:0.0.16" + "@oxc-node/core-win32-arm64-msvc": "npm:0.0.16" + "@oxc-node/core-win32-ia32-msvc": "npm:0.0.16" + "@oxc-node/core-win32-x64-msvc": "npm:0.0.16" + dependenciesMeta: + "@oxc-node/core-android-arm-eabi": + optional: true + "@oxc-node/core-android-arm64": + optional: true + "@oxc-node/core-darwin-arm64": + optional: true + "@oxc-node/core-darwin-x64": + optional: true + "@oxc-node/core-freebsd-x64": + optional: true + "@oxc-node/core-linux-arm-gnueabihf": + optional: true + "@oxc-node/core-linux-arm64-gnu": + optional: true + "@oxc-node/core-linux-arm64-musl": + optional: true + "@oxc-node/core-linux-ppc64-gnu": + optional: true + "@oxc-node/core-linux-s390x-gnu": + optional: true + "@oxc-node/core-linux-x64-gnu": + optional: true + "@oxc-node/core-linux-x64-musl": + optional: true + "@oxc-node/core-wasm32-wasi": + optional: true + "@oxc-node/core-win32-arm64-msvc": + optional: true + "@oxc-node/core-win32-ia32-msvc": + optional: true + "@oxc-node/core-win32-x64-msvc": + optional: true + checksum: 10c0/b986b8f6a89c378b9fe06e3c3a50ee086b42709b5c3057bd3b56ff374407bd44fd1efd6b090f5de13dc3256ff47e77c1cb5717a4a655788b647fbdba7c6ad390 + languageName: node + linkType: hard + "@oxlint/darwin-arm64@npm:0.15.0": version: 0.15.0 resolution: "@oxlint/darwin-arm64@npm:0.15.0" @@ -8801,6 +8973,7 @@ __metadata: resolution: "napi-rs@workspace:." dependencies: "@napi-rs/cli": "workspace:*" + "@oxc-node/core": "npm:^0.0.16" "@taplo/cli": "npm:^0.7.0" "@types/debug": "npm:^4.1.12" "@types/lodash-es": "npm:^4.17.12"