@rspack/binding-wasm32-wasi 2.0.0-beta.6 → 2.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding-wasm32-wasi",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.8",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "rspack.wasi.cjs",
@@ -23,7 +23,7 @@
23
23
  "wasi-worker-browser.mjs"
24
24
  ],
25
25
  "dependencies": {
26
- "@napi-rs/wasm-runtime": "1.0.7"
26
+ "@napi-rs/wasm-runtime": "1.1.1"
27
27
  },
28
28
  "cpu": [
29
29
  "wasm32"
package/rspack.wasi.cjs CHANGED
@@ -39,7 +39,7 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
39
39
  __wasmFilePath = __wasmDebugFilePath
40
40
  } else if (!__nodeFs.existsSync(__wasmFilePath)) {
41
41
  try {
42
- __wasmFilePath = __nodePath.resolve('@rspack/binding-wasm32-wasi')
42
+ __wasmFilePath = require.resolve('@rspack/binding-wasm32-wasi/rspack.wasm32-wasi.wasm')
43
43
  } catch {
44
44
  throw new Error('Cannot find rspack.wasm32-wasi.wasm file, and @rspack/binding-wasm32-wasi package is not installed.')
45
45
  }
@@ -47,7 +47,7 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
47
47
 
48
48
  const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule } = __emnapiInstantiateNapiModuleSync(__nodeFs.readFileSync(__wasmFilePath), {
49
49
  context: __emnapiContext,
50
- asyncWorkPoolSize: (function() {
50
+ asyncWorkPoolSize: (function () {
51
51
  const threadsSizeFromEnv = Number(process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process.env.UV_THREADPOOL_SIZE)
52
52
  // NaN > 0 is false
53
53
  if (threadsSizeFromEnv > 0) {
@@ -76,14 +76,14 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
76
76
  s.toString().includes("kPublicPort")
77
77
  );
78
78
  if (kPublicPort) {
79
- worker[kPublicPort].ref = () => {};
79
+ worker[kPublicPort].ref = () => { };
80
80
  }
81
81
 
82
82
  const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
83
83
  s.toString().includes("kHandle")
84
84
  );
85
85
  if (kHandle) {
86
- worker[kHandle].ref = () => {};
86
+ worker[kHandle].ref = () => { };
87
87
  }
88
88
 
89
89
  worker.unref();
Binary file