@napi-rs/cli 3.5.0 → 3.5.1
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/dist/cli.js +10 -6
- package/dist/index.cjs +10 -6
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +10 -6
- package/package.json +3 -3
- package/src/api/templates/js-binding.ts +6 -2
- package/src/api/templates/load-wasi-template.ts +1 -1
- package/src/utils/config.ts +2 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napi-rs/cli",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "Cli tools for napi-rs",
|
|
5
5
|
"author": "LongYinan <lynweklm@gmail.com>",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://napi.rs/",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"engines": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"empathic": "^2.0.0",
|
|
86
86
|
"env-paths": "^3.0.0",
|
|
87
87
|
"prettier": "^3.6.2",
|
|
88
|
-
"tsdown": "^0.
|
|
88
|
+
"tsdown": "^0.18.0",
|
|
89
89
|
"tslib": "^2.8.1",
|
|
90
90
|
"typescript": "^5.9.3"
|
|
91
91
|
},
|
|
@@ -238,13 +238,17 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
238
238
|
wasiBindingError = err
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
if (!nativeBinding) {
|
|
241
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
242
242
|
try {
|
|
243
243
|
wasiBinding = require('${pkgName}-wasm32-wasi')
|
|
244
244
|
nativeBinding = wasiBinding
|
|
245
245
|
} catch (err) {
|
|
246
246
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
247
|
-
wasiBindingError
|
|
247
|
+
if (!wasiBindingError) {
|
|
248
|
+
wasiBindingError = err
|
|
249
|
+
} else {
|
|
250
|
+
wasiBindingError.cause = err
|
|
251
|
+
}
|
|
248
252
|
loadErrors.push(err)
|
|
249
253
|
}
|
|
250
254
|
}
|
|
@@ -145,7 +145,7 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
|
|
|
145
145
|
__wasmFilePath = __wasmDebugFilePath
|
|
146
146
|
} else if (!__nodeFs.existsSync(__wasmFilePath)) {
|
|
147
147
|
try {
|
|
148
|
-
__wasmFilePath =
|
|
148
|
+
__wasmFilePath = require.resolve('${packageName}-wasm32-wasi/${wasmFileName}.wasm')
|
|
149
149
|
} catch {
|
|
150
150
|
throw new Error('Cannot find ${wasmFileName}.wasm file, and ${packageName}-wasm32-wasi package is not installed.')
|
|
151
151
|
}
|
package/src/utils/config.ts
CHANGED
|
@@ -198,6 +198,8 @@ export async function readNapiConfig(
|
|
|
198
198
|
`Both napi field in ${pkgJsonPath} and [NAPI-RS config](${configPathUnderline}) file are found, the NAPI-RS config file will be used.`,
|
|
199
199
|
),
|
|
200
200
|
)
|
|
201
|
+
}
|
|
202
|
+
if (separatedConfig) {
|
|
201
203
|
Object.assign(userNapiConfig, separatedConfig)
|
|
202
204
|
}
|
|
203
205
|
const napiConfig: NapiConfig = merge(
|