vite-plus 0.2.6 → 0.2.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/AGENTS.md +4 -0
- package/LICENSE +5 -1
- package/README.md +1 -1
- package/bin/vpr +3 -2
- package/binding/index.cjs +193 -80
- package/binding/index.d.cts +99 -8
- package/dist/agent-CI79DuSy.js +600 -0
- package/dist/bin.js +1367 -11
- package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
- package/dist/client/bundledDevClient.mjs +1 -0
- package/dist/config/bin.js +13 -126
- package/dist/{constants-CaXMuYUG.js → constants-BppDcRc1.js} +1 -1
- package/dist/create/bin.js +90 -77
- package/dist/{define-config-iGV0CGUk.cjs → define-config-CEm_MtvJ.cjs} +1 -1
- package/dist/{define-config-hV8qyU8p.js → define-config-DPnHe1Mx.js} +2 -2
- package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CKz3vcoG.js → dist-CSQWHI6y.js} +3 -8
- package/dist/dist-DT25H9pj.js +3 -0
- package/dist/{agent-0gFJkIKu.js → editor-CGWdbLgD.js} +709 -579
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-DiRs8ceZ.js → json-BU88uu6o.js} +2 -6
- package/dist/migration/bin.js +60 -50
- package/dist/{oxlint-plugin-config-CMSCIkks.js → oxlint-plugin-config-BHOzlwMw.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +2 -2
- package/dist/{package-CP5EUXlu.js → package-hV-77cBb.js} +2 -2
- package/dist/{tsconfig-Cac-NNdT.js → prompts-DYap08te.js} +32 -174
- package/dist/{resolve-vite-config-BY7PB-LW.js → resolve-vite-config-EWXclqvV.js} +1 -1
- package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
- package/dist/staged/bin.js +20 -23
- package/dist/{help-YP84FSEz.js → terminal-CrqqK8WT.js} +39 -2
- package/dist/tsconfig-CVUKLfL8.js +151 -0
- package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-eMZT-oea.js} +4 -2
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -5
- package/dist/versions.js +5 -5
- package/docs/config/index.md +13 -0
- package/docs/config/staged.md +2 -1
- package/docs/guide/build.md +1 -1
- package/docs/guide/ci.md +28 -3
- package/docs/guide/commit-hooks.md +76 -9
- package/docs/guide/dev.md +4 -0
- package/docs/guide/env.md +8 -4
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +2 -0
- package/docs/guide/installer-env-vars.md +3 -3
- package/docs/guide/migrate.md +11 -3
- package/docs/guide/monorepo.md +94 -6
- package/docs/guide/run.md +15 -0
- package/docs/guide/test.md +4 -0
- package/docs/guide/troubleshooting.md +9 -5
- package/package.json +18 -24
- package/dist/dist-CtM2JRbM.js +0 -3
- package/dist/editor-D4T70tKk.js +0 -675
- package/dist/terminal-uTv0ZaMr.js +0 -33
- package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
package/AGENTS.md
CHANGED
|
@@ -6,6 +6,10 @@ This project is using Vite+, a unified toolchain built on top of Vite, Rolldown,
|
|
|
6
6
|
|
|
7
7
|
Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/.
|
|
8
8
|
|
|
9
|
+
## Built-in Commands vs Scripts
|
|
10
|
+
|
|
11
|
+
`vp <name>` runs a built-in command. `vp run <name>` runs a `package.json` script or a `vite.config.ts` task. Scripts cannot overwrite built-ins, so `vp dev` and `vp run dev` may do different things. Check `package.json` and `vite.config.ts` first, and run `vp run <name>` when the project defines a script or task with that name.
|
|
12
|
+
|
|
9
13
|
## Review Checklist
|
|
10
14
|
|
|
11
15
|
- [ ] Run `vp install` after pulling remote changes and before getting started.
|
package/LICENSE
CHANGED
|
@@ -494,11 +494,15 @@ Repository: https://github.com/listr2/listr2
|
|
|
494
494
|
|
|
495
495
|
---------------------------------------
|
|
496
496
|
|
|
497
|
-
## lru-cache
|
|
497
|
+
## lru-cache, path-scurry
|
|
498
498
|
License: BlueOak-1.0.0
|
|
499
499
|
By: Isaac Z. Schlueter <i@izs.me>
|
|
500
500
|
Repository: https://github.com/isaacs/node-lru-cache
|
|
501
501
|
|
|
502
|
+
License: BlueOak-1.0.0
|
|
503
|
+
By: Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me)
|
|
504
|
+
Repository: https://github.com/isaacs/path-scurry
|
|
505
|
+
|
|
502
506
|
> # Blue Oak Model License
|
|
503
507
|
>
|
|
504
508
|
> Version 1.0.0
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Vite+ is the unified entry point for local web development. It combines [Vite](h
|
|
|
15
15
|
- **`vp check`:** Run formatting, linting, and type checks in one command
|
|
16
16
|
- **`vp test`:** Run tests through bundled Vitest
|
|
17
17
|
- **`vp build`:** Build applications for production with Vite + Rolldown
|
|
18
|
-
- **`vp run`:**
|
|
18
|
+
- **`vp run`:** Run `package.json` scripts and monorepo tasks with caching and dependency-aware scheduling
|
|
19
19
|
- **`vp pack`:** Build libraries for npm publishing or standalone app binaries
|
|
20
20
|
- **`vp create` / `vp migrate`:** Scaffold new projects and migrate existing ones
|
|
21
21
|
|
package/bin/vpr
CHANGED
|
@@ -4,6 +4,7 @@ import module from 'node:module';
|
|
|
4
4
|
if (module.enableCompileCache) {
|
|
5
5
|
module.enableCompileCache();
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Dynamic import so it runs AFTER enableCompileCache above (a static
|
|
8
|
+
// import is hoisted and would load the CLI bundle uncached). The argv
|
|
9
|
+
// rewrite to `run` lives in bin.ts (keyed on argv0).
|
|
9
10
|
await import('../dist/bin.js');
|
package/binding/index.cjs
CHANGED
|
@@ -81,12 +81,12 @@ function requireNative() {
|
|
|
81
81
|
const bindingPackageVersion =
|
|
82
82
|
require('@voidzero-dev/vite-plus-android-arm64/package.json').version;
|
|
83
83
|
if (
|
|
84
|
-
bindingPackageVersion !== '0.2.
|
|
84
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
85
85
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
86
86
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
87
87
|
) {
|
|
88
88
|
throw new Error(
|
|
89
|
-
`Native binding package version mismatch, expected 0.2.
|
|
89
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
return binding;
|
|
@@ -104,12 +104,12 @@ function requireNative() {
|
|
|
104
104
|
const bindingPackageVersion =
|
|
105
105
|
require('@voidzero-dev/vite-plus-android-arm-eabi/package.json').version;
|
|
106
106
|
if (
|
|
107
|
-
bindingPackageVersion !== '0.2.
|
|
107
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
108
108
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
109
109
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
110
110
|
) {
|
|
111
111
|
throw new Error(
|
|
112
|
-
`Native binding package version mismatch, expected 0.2.
|
|
112
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
return binding;
|
|
@@ -139,12 +139,12 @@ function requireNative() {
|
|
|
139
139
|
const bindingPackageVersion =
|
|
140
140
|
require('@voidzero-dev/vite-plus-win32-x64-gnu/package.json').version;
|
|
141
141
|
if (
|
|
142
|
-
bindingPackageVersion !== '0.2.
|
|
142
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
143
143
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
144
144
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
145
145
|
) {
|
|
146
146
|
throw new Error(
|
|
147
|
-
`Native binding package version mismatch, expected 0.2.
|
|
147
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
return binding;
|
|
@@ -162,12 +162,12 @@ function requireNative() {
|
|
|
162
162
|
const bindingPackageVersion =
|
|
163
163
|
require('@voidzero-dev/vite-plus-win32-x64-msvc/package.json').version;
|
|
164
164
|
if (
|
|
165
|
-
bindingPackageVersion !== '0.2.
|
|
165
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
166
166
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
167
167
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
168
168
|
) {
|
|
169
169
|
throw new Error(
|
|
170
|
-
`Native binding package version mismatch, expected 0.2.
|
|
170
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
173
|
return binding;
|
|
@@ -186,12 +186,12 @@ function requireNative() {
|
|
|
186
186
|
const bindingPackageVersion =
|
|
187
187
|
require('@voidzero-dev/vite-plus-win32-ia32-msvc/package.json').version;
|
|
188
188
|
if (
|
|
189
|
-
bindingPackageVersion !== '0.2.
|
|
189
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
190
190
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
191
191
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
192
192
|
) {
|
|
193
193
|
throw new Error(
|
|
194
|
-
`Native binding package version mismatch, expected 0.2.
|
|
194
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
197
|
return binding;
|
|
@@ -209,12 +209,12 @@ function requireNative() {
|
|
|
209
209
|
const bindingPackageVersion =
|
|
210
210
|
require('@voidzero-dev/vite-plus-win32-arm64-msvc/package.json').version;
|
|
211
211
|
if (
|
|
212
|
-
bindingPackageVersion !== '0.2.
|
|
212
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
213
213
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
214
214
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
215
215
|
) {
|
|
216
216
|
throw new Error(
|
|
217
|
-
`Native binding package version mismatch, expected 0.2.
|
|
217
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
220
|
return binding;
|
|
@@ -235,12 +235,12 @@ function requireNative() {
|
|
|
235
235
|
const bindingPackageVersion =
|
|
236
236
|
require('@voidzero-dev/vite-plus-darwin-universal/package.json').version;
|
|
237
237
|
if (
|
|
238
|
-
bindingPackageVersion !== '0.2.
|
|
238
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
239
239
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
240
240
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
241
241
|
) {
|
|
242
242
|
throw new Error(
|
|
243
|
-
`Native binding package version mismatch, expected 0.2.
|
|
243
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
return binding;
|
|
@@ -258,12 +258,12 @@ function requireNative() {
|
|
|
258
258
|
const bindingPackageVersion =
|
|
259
259
|
require('@voidzero-dev/vite-plus-darwin-x64/package.json').version;
|
|
260
260
|
if (
|
|
261
|
-
bindingPackageVersion !== '0.2.
|
|
261
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
262
262
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
263
263
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
264
264
|
) {
|
|
265
265
|
throw new Error(
|
|
266
|
-
`Native binding package version mismatch, expected 0.2.
|
|
266
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
267
267
|
);
|
|
268
268
|
}
|
|
269
269
|
return binding;
|
|
@@ -281,12 +281,12 @@ function requireNative() {
|
|
|
281
281
|
const bindingPackageVersion =
|
|
282
282
|
require('@voidzero-dev/vite-plus-darwin-arm64/package.json').version;
|
|
283
283
|
if (
|
|
284
|
-
bindingPackageVersion !== '0.2.
|
|
284
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
285
285
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
286
286
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
287
287
|
) {
|
|
288
288
|
throw new Error(
|
|
289
|
-
`Native binding package version mismatch, expected 0.2.
|
|
289
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
292
|
return binding;
|
|
@@ -308,12 +308,12 @@ function requireNative() {
|
|
|
308
308
|
const bindingPackageVersion =
|
|
309
309
|
require('@voidzero-dev/vite-plus-freebsd-x64/package.json').version;
|
|
310
310
|
if (
|
|
311
|
-
bindingPackageVersion !== '0.2.
|
|
311
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
312
312
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
313
313
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
314
314
|
) {
|
|
315
315
|
throw new Error(
|
|
316
|
-
`Native binding package version mismatch, expected 0.2.
|
|
316
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
317
317
|
);
|
|
318
318
|
}
|
|
319
319
|
return binding;
|
|
@@ -331,12 +331,12 @@ function requireNative() {
|
|
|
331
331
|
const bindingPackageVersion =
|
|
332
332
|
require('@voidzero-dev/vite-plus-freebsd-arm64/package.json').version;
|
|
333
333
|
if (
|
|
334
|
-
bindingPackageVersion !== '0.2.
|
|
334
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
335
335
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
336
336
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
337
337
|
) {
|
|
338
338
|
throw new Error(
|
|
339
|
-
`Native binding package version mismatch, expected 0.2.
|
|
339
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
340
340
|
);
|
|
341
341
|
}
|
|
342
342
|
return binding;
|
|
@@ -359,12 +359,12 @@ function requireNative() {
|
|
|
359
359
|
const bindingPackageVersion =
|
|
360
360
|
require('@voidzero-dev/vite-plus-linux-x64-musl/package.json').version;
|
|
361
361
|
if (
|
|
362
|
-
bindingPackageVersion !== '0.2.
|
|
362
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
363
363
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
364
364
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
365
365
|
) {
|
|
366
366
|
throw new Error(
|
|
367
|
-
`Native binding package version mismatch, expected 0.2.
|
|
367
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
368
368
|
);
|
|
369
369
|
}
|
|
370
370
|
return binding;
|
|
@@ -382,12 +382,12 @@ function requireNative() {
|
|
|
382
382
|
const bindingPackageVersion =
|
|
383
383
|
require('@voidzero-dev/vite-plus-linux-x64-gnu/package.json').version;
|
|
384
384
|
if (
|
|
385
|
-
bindingPackageVersion !== '0.2.
|
|
385
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
386
386
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
387
387
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
388
388
|
) {
|
|
389
389
|
throw new Error(
|
|
390
|
-
`Native binding package version mismatch, expected 0.2.
|
|
390
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
return binding;
|
|
@@ -407,12 +407,12 @@ function requireNative() {
|
|
|
407
407
|
const bindingPackageVersion =
|
|
408
408
|
require('@voidzero-dev/vite-plus-linux-arm64-musl/package.json').version;
|
|
409
409
|
if (
|
|
410
|
-
bindingPackageVersion !== '0.2.
|
|
410
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
411
411
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
412
412
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
413
413
|
) {
|
|
414
414
|
throw new Error(
|
|
415
|
-
`Native binding package version mismatch, expected 0.2.
|
|
415
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
418
|
return binding;
|
|
@@ -430,12 +430,12 @@ function requireNative() {
|
|
|
430
430
|
const bindingPackageVersion =
|
|
431
431
|
require('@voidzero-dev/vite-plus-linux-arm64-gnu/package.json').version;
|
|
432
432
|
if (
|
|
433
|
-
bindingPackageVersion !== '0.2.
|
|
433
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
434
434
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
435
435
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
436
436
|
) {
|
|
437
437
|
throw new Error(
|
|
438
|
-
`Native binding package version mismatch, expected 0.2.
|
|
438
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
439
439
|
);
|
|
440
440
|
}
|
|
441
441
|
return binding;
|
|
@@ -455,12 +455,12 @@ function requireNative() {
|
|
|
455
455
|
const bindingPackageVersion =
|
|
456
456
|
require('@voidzero-dev/vite-plus-linux-arm-musleabihf/package.json').version;
|
|
457
457
|
if (
|
|
458
|
-
bindingPackageVersion !== '0.2.
|
|
458
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
459
459
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
460
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
461
461
|
) {
|
|
462
462
|
throw new Error(
|
|
463
|
-
`Native binding package version mismatch, expected 0.2.
|
|
463
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
464
|
);
|
|
465
465
|
}
|
|
466
466
|
return binding;
|
|
@@ -478,12 +478,12 @@ function requireNative() {
|
|
|
478
478
|
const bindingPackageVersion =
|
|
479
479
|
require('@voidzero-dev/vite-plus-linux-arm-gnueabihf/package.json').version;
|
|
480
480
|
if (
|
|
481
|
-
bindingPackageVersion !== '0.2.
|
|
481
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
482
482
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
483
483
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
484
484
|
) {
|
|
485
485
|
throw new Error(
|
|
486
|
-
`Native binding package version mismatch, expected 0.2.
|
|
486
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
487
487
|
);
|
|
488
488
|
}
|
|
489
489
|
return binding;
|
|
@@ -503,12 +503,12 @@ function requireNative() {
|
|
|
503
503
|
const bindingPackageVersion =
|
|
504
504
|
require('@voidzero-dev/vite-plus-linux-loong64-musl/package.json').version;
|
|
505
505
|
if (
|
|
506
|
-
bindingPackageVersion !== '0.2.
|
|
506
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
507
507
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
508
508
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
509
509
|
) {
|
|
510
510
|
throw new Error(
|
|
511
|
-
`Native binding package version mismatch, expected 0.2.
|
|
511
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
512
512
|
);
|
|
513
513
|
}
|
|
514
514
|
return binding;
|
|
@@ -526,12 +526,12 @@ function requireNative() {
|
|
|
526
526
|
const bindingPackageVersion =
|
|
527
527
|
require('@voidzero-dev/vite-plus-linux-loong64-gnu/package.json').version;
|
|
528
528
|
if (
|
|
529
|
-
bindingPackageVersion !== '0.2.
|
|
529
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
530
530
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
531
531
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
532
532
|
) {
|
|
533
533
|
throw new Error(
|
|
534
|
-
`Native binding package version mismatch, expected 0.2.
|
|
534
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
537
|
return binding;
|
|
@@ -551,12 +551,12 @@ function requireNative() {
|
|
|
551
551
|
const bindingPackageVersion =
|
|
552
552
|
require('@voidzero-dev/vite-plus-linux-riscv64-musl/package.json').version;
|
|
553
553
|
if (
|
|
554
|
-
bindingPackageVersion !== '0.2.
|
|
554
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
555
555
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
556
556
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
557
557
|
) {
|
|
558
558
|
throw new Error(
|
|
559
|
-
`Native binding package version mismatch, expected 0.2.
|
|
559
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
560
560
|
);
|
|
561
561
|
}
|
|
562
562
|
return binding;
|
|
@@ -574,12 +574,12 @@ function requireNative() {
|
|
|
574
574
|
const bindingPackageVersion =
|
|
575
575
|
require('@voidzero-dev/vite-plus-linux-riscv64-gnu/package.json').version;
|
|
576
576
|
if (
|
|
577
|
-
bindingPackageVersion !== '0.2.
|
|
577
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
578
578
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
579
579
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
580
580
|
) {
|
|
581
581
|
throw new Error(
|
|
582
|
-
`Native binding package version mismatch, expected 0.2.
|
|
582
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
585
|
return binding;
|
|
@@ -598,12 +598,12 @@ function requireNative() {
|
|
|
598
598
|
const bindingPackageVersion =
|
|
599
599
|
require('@voidzero-dev/vite-plus-linux-ppc64-gnu/package.json').version;
|
|
600
600
|
if (
|
|
601
|
-
bindingPackageVersion !== '0.2.
|
|
601
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
602
602
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
603
603
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
604
604
|
) {
|
|
605
605
|
throw new Error(
|
|
606
|
-
`Native binding package version mismatch, expected 0.2.
|
|
606
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
607
607
|
);
|
|
608
608
|
}
|
|
609
609
|
return binding;
|
|
@@ -621,12 +621,12 @@ function requireNative() {
|
|
|
621
621
|
const bindingPackageVersion =
|
|
622
622
|
require('@voidzero-dev/vite-plus-linux-s390x-gnu/package.json').version;
|
|
623
623
|
if (
|
|
624
|
-
bindingPackageVersion !== '0.2.
|
|
624
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
625
625
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
626
626
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
627
627
|
) {
|
|
628
628
|
throw new Error(
|
|
629
|
-
`Native binding package version mismatch, expected 0.2.
|
|
629
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
630
630
|
);
|
|
631
631
|
}
|
|
632
632
|
return binding;
|
|
@@ -648,12 +648,12 @@ function requireNative() {
|
|
|
648
648
|
const bindingPackageVersion =
|
|
649
649
|
require('@voidzero-dev/vite-plus-openharmony-arm64/package.json').version;
|
|
650
650
|
if (
|
|
651
|
-
bindingPackageVersion !== '0.2.
|
|
651
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
652
652
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
653
653
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
654
654
|
) {
|
|
655
655
|
throw new Error(
|
|
656
|
-
`Native binding package version mismatch, expected 0.2.
|
|
656
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
657
657
|
);
|
|
658
658
|
}
|
|
659
659
|
return binding;
|
|
@@ -671,12 +671,12 @@ function requireNative() {
|
|
|
671
671
|
const bindingPackageVersion =
|
|
672
672
|
require('@voidzero-dev/vite-plus-openharmony-x64/package.json').version;
|
|
673
673
|
if (
|
|
674
|
-
bindingPackageVersion !== '0.2.
|
|
674
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
675
675
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
676
676
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
677
677
|
) {
|
|
678
678
|
throw new Error(
|
|
679
|
-
`Native binding package version mismatch, expected 0.2.
|
|
679
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
680
680
|
);
|
|
681
681
|
}
|
|
682
682
|
return binding;
|
|
@@ -694,12 +694,12 @@ function requireNative() {
|
|
|
694
694
|
const bindingPackageVersion =
|
|
695
695
|
require('@voidzero-dev/vite-plus-openharmony-arm/package.json').version;
|
|
696
696
|
if (
|
|
697
|
-
bindingPackageVersion !== '0.2.
|
|
697
|
+
bindingPackageVersion !== '0.2.8' &&
|
|
698
698
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
699
699
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
700
700
|
) {
|
|
701
701
|
throw new Error(
|
|
702
|
-
`Native binding package version mismatch, expected 0.2.
|
|
702
|
+
`Native binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
703
703
|
);
|
|
704
704
|
}
|
|
705
705
|
return binding;
|
|
@@ -716,47 +716,163 @@ function requireNative() {
|
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
-
|
|
719
|
+
function createLoadErrorChain(errors) {
|
|
720
|
+
return errors.reduce((previous, current) => {
|
|
721
|
+
let message;
|
|
722
|
+
try {
|
|
723
|
+
message = current && typeof current.message === 'string' ? current.message : String(current);
|
|
724
|
+
} catch {
|
|
725
|
+
message = 'Unknown error';
|
|
726
|
+
}
|
|
727
|
+
const error = new Error(message);
|
|
728
|
+
error.cause = previous;
|
|
729
|
+
return error;
|
|
730
|
+
}, null);
|
|
731
|
+
}
|
|
720
732
|
|
|
721
733
|
// NAPI_RS_FORCE_WASI is a tri-state flag:
|
|
722
734
|
// unset / any other value → native binding preferred, WASI is only a fallback
|
|
723
|
-
// 'true' →
|
|
724
|
-
// 'error' →
|
|
735
|
+
// 'true' → prefer WASI, but retain native as a lazy fallback
|
|
736
|
+
// 'error' → require WASI without initializing a native fallback
|
|
725
737
|
// Treating any non-empty string as truthy (the historical behavior) meant
|
|
726
738
|
// NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
|
|
727
739
|
// the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
|
|
740
|
+
//
|
|
741
|
+
// NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
|
|
742
|
+
// WASI loading. It never crosses into another flavor or falls back to native.
|
|
743
|
+
const __napiWasiFlavors = ['wasm32-wasi'];
|
|
744
|
+
const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR;
|
|
745
|
+
const __napiWasiFlavorRequested =
|
|
746
|
+
typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0;
|
|
747
|
+
if (__napiWasiFlavorRequested && __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1) {
|
|
748
|
+
throw new Error(
|
|
749
|
+
'Unsupported WASI flavor "' +
|
|
750
|
+
__napiWasiFlavor +
|
|
751
|
+
'". Available flavors: ' +
|
|
752
|
+
__napiWasiFlavors.join(', '),
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
const forceWasiError = process.env.NAPI_RS_FORCE_WASI === 'error';
|
|
728
756
|
const forceWasi =
|
|
729
|
-
process.env.NAPI_RS_FORCE_WASI === 'true' ||
|
|
757
|
+
process.env.NAPI_RS_FORCE_WASI === 'true' || forceWasiError || __napiWasiFlavorRequested;
|
|
758
|
+
|
|
759
|
+
if (!forceWasi) {
|
|
760
|
+
nativeBinding = requireNative();
|
|
761
|
+
}
|
|
730
762
|
|
|
731
763
|
if (!nativeBinding || forceWasi) {
|
|
732
764
|
let wasiBinding = null;
|
|
733
|
-
let
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
765
|
+
let wasiBindingLoaded = false;
|
|
766
|
+
const wasiBindingErrors = [];
|
|
767
|
+
const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
|
|
768
|
+
try {
|
|
769
|
+
require.resolve(specifier);
|
|
770
|
+
} catch (resolveError) {
|
|
771
|
+
if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
|
|
772
|
+
throw resolveError;
|
|
773
|
+
}
|
|
774
|
+
if (isPackage) {
|
|
775
|
+
try {
|
|
776
|
+
require.resolve(specifier + '/package.json');
|
|
777
|
+
} catch (packageError) {
|
|
778
|
+
if (packageError && packageError.code === 'MODULE_NOT_FOUND') {
|
|
779
|
+
return resolveError;
|
|
780
|
+
}
|
|
781
|
+
// An exports restriction proves the package exists even when its
|
|
782
|
+
// package.json is not public. Preserve the root resolution failure.
|
|
783
|
+
throw resolveError;
|
|
784
|
+
}
|
|
785
|
+
// The package exists but its main/export target is broken.
|
|
786
|
+
throw resolveError;
|
|
787
|
+
}
|
|
788
|
+
return resolveError;
|
|
740
789
|
}
|
|
741
|
-
|
|
742
|
-
|
|
790
|
+
if (localArtifacts) {
|
|
791
|
+
let artifactError = null;
|
|
792
|
+
for (let i = 0; i < localArtifacts.length; i++) {
|
|
793
|
+
try {
|
|
794
|
+
require.resolve(localArtifacts[i]);
|
|
795
|
+
return null;
|
|
796
|
+
} catch (resolveError) {
|
|
797
|
+
if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
|
|
798
|
+
throw resolveError;
|
|
799
|
+
}
|
|
800
|
+
artifactError = resolveError;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
return artifactError;
|
|
804
|
+
}
|
|
805
|
+
return null;
|
|
806
|
+
};
|
|
807
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
|
|
808
|
+
let candidateError = null;
|
|
809
|
+
let candidateFailed = false;
|
|
743
810
|
try {
|
|
744
|
-
|
|
745
|
-
|
|
811
|
+
candidateError = __napiWasiResolveCandidate('./vite-plus.wasi.cjs', false, [
|
|
812
|
+
'./vite-plus.wasm32-wasi.debug.wasm',
|
|
813
|
+
'./vite-plus.wasm32-wasi.wasm',
|
|
814
|
+
]);
|
|
815
|
+
candidateFailed = candidateError !== null;
|
|
816
|
+
if (!candidateFailed) {
|
|
817
|
+
wasiBinding = require('./vite-plus.wasi.cjs');
|
|
818
|
+
nativeBinding = wasiBinding;
|
|
819
|
+
wasiBindingLoaded = true;
|
|
820
|
+
}
|
|
746
821
|
} catch (err) {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
822
|
+
candidateError = err;
|
|
823
|
+
candidateFailed = true;
|
|
824
|
+
}
|
|
825
|
+
if (candidateFailed) {
|
|
826
|
+
wasiBindingErrors.push(candidateError);
|
|
827
|
+
loadErrors.push(candidateError);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === 'wasm32-wasi')) {
|
|
831
|
+
let candidateError = null;
|
|
832
|
+
let candidateFailed = false;
|
|
833
|
+
try {
|
|
834
|
+
candidateError = __napiWasiResolveCandidate(
|
|
835
|
+
'@voidzero-dev/vite-plus-wasm32-wasi',
|
|
836
|
+
true,
|
|
837
|
+
undefined,
|
|
838
|
+
);
|
|
839
|
+
candidateFailed = candidateError !== null;
|
|
840
|
+
if (!candidateFailed) {
|
|
841
|
+
if (
|
|
842
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
843
|
+
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
844
|
+
) {
|
|
845
|
+
const bindingPackageVersion =
|
|
846
|
+
require('@voidzero-dev/vite-plus-wasm32-wasi/package.json').version;
|
|
847
|
+
if (bindingPackageVersion !== '0.2.8') {
|
|
848
|
+
throw new Error(
|
|
849
|
+
`WASI binding package version mismatch, expected 0.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
850
|
+
);
|
|
851
|
+
}
|
|
752
852
|
}
|
|
753
|
-
|
|
853
|
+
wasiBinding = require('@voidzero-dev/vite-plus-wasm32-wasi');
|
|
854
|
+
nativeBinding = wasiBinding;
|
|
855
|
+
wasiBindingLoaded = true;
|
|
754
856
|
}
|
|
857
|
+
} catch (err) {
|
|
858
|
+
candidateError = err;
|
|
859
|
+
candidateFailed = true;
|
|
755
860
|
}
|
|
861
|
+
if (candidateFailed) {
|
|
862
|
+
wasiBindingErrors.push(candidateError);
|
|
863
|
+
loadErrors.push(candidateError);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
if (!wasiBindingLoaded && forceWasi && !forceWasiError && !__napiWasiFlavorRequested) {
|
|
867
|
+
nativeBinding = requireNative();
|
|
756
868
|
}
|
|
757
|
-
if (
|
|
758
|
-
const error = new Error(
|
|
759
|
-
|
|
869
|
+
if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
|
|
870
|
+
const error = new Error(
|
|
871
|
+
__napiWasiFlavorRequested
|
|
872
|
+
? 'WASI binding for flavor "' + __napiWasiFlavor + '" not found'
|
|
873
|
+
: 'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
|
|
874
|
+
);
|
|
875
|
+
error.cause = createLoadErrorChain(wasiBindingErrors);
|
|
760
876
|
throw error;
|
|
761
877
|
}
|
|
762
878
|
}
|
|
@@ -770,10 +886,7 @@ if (!nativeBinding) {
|
|
|
770
886
|
);
|
|
771
887
|
// assign instead of the `new Error(message, { cause })` options form,
|
|
772
888
|
// which Node < 16.9 silently ignores
|
|
773
|
-
error.cause = loadErrors
|
|
774
|
-
cur.cause = err;
|
|
775
|
-
return cur;
|
|
776
|
-
});
|
|
889
|
+
error.cause = createLoadErrorChain(loadErrors);
|
|
777
890
|
throw error;
|
|
778
891
|
}
|
|
779
892
|
throw new Error(`Failed to load native binding`);
|