vite-plus 0.3.2 → 0.3.3

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.
Files changed (51) hide show
  1. package/binding/index.cjs +137 -55
  2. package/binding/index.d.cts +40 -0
  3. package/dist/{agent-C59HKB4Y.js → agent-Cu6-tXIP.js} +2 -2
  4. package/dist/bin.js +5 -5
  5. package/dist/config/bin.js +2 -2
  6. package/dist/{constants-IhOditRA.js → constants-C2dTOTe-.js} +1 -1
  7. package/dist/create/bin.js +84 -65
  8. package/dist/{define-config-DpAPETDf.cjs → define-config-D0mevyb3.cjs} +1 -1
  9. package/dist/{define-config-DAaCa0U_.js → define-config-IgzmnvvV.js} +1 -1
  10. package/dist/define-config.cjs +1 -1
  11. package/dist/define-config.js +1 -1
  12. package/dist/{editor-QOIGtmH4.js → editor-4sjlHmUh.js} +17 -6
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/lint-plugins.cjs +1 -1
  16. package/dist/migration/bin.js +6 -6
  17. package/dist/{oxlint-plugin-config-BU42tr8y.js → oxlint-plugin-config-BVqEe9KY.js} +1 -1
  18. package/dist/oxlint-plugin.js +1 -1
  19. package/dist/pack-bin.js +1 -1
  20. package/dist/{package-BB-Jh_z3.js → package-CHH8jWan.js} +1 -1
  21. package/dist/{prompts-CujFOJXu.js → prompts-k14KgthC.js} +1 -1
  22. package/dist/{resolve-vite-config-CHHjsjKJ.js → resolve-vite-config-BqvS2P98.js} +2 -2
  23. package/dist/{resolve-vite-config-6Nox70uP.js → resolve-vite-config-CTOTuqTi.js} +1 -1
  24. package/dist/staged/bin.js +1 -1
  25. package/dist/toolchain.js +7 -7
  26. package/dist/toolchain.json +7 -7
  27. package/dist/{tsconfig-DCtWfQPA.js → tsconfig-C3h9CVTA.js} +2 -2
  28. package/dist/{tsconfig-MXktI3SX.js → tsconfig-euB-GmIE.js} +1 -1
  29. package/dist/version.js +2 -2
  30. package/dist/versions.js +3 -3
  31. package/docs/config/staged.md +1 -2
  32. package/docs/guide/ci.md +28 -31
  33. package/docs/guide/commit-hooks.md +11 -34
  34. package/docs/guide/create.md +1 -2
  35. package/docs/guide/docker.md +20 -68
  36. package/docs/guide/env.md +30 -20
  37. package/docs/guide/global-cli.md +426 -0
  38. package/docs/guide/ide-integration.md +1 -2
  39. package/docs/guide/implode.md +14 -1
  40. package/docs/guide/index.md +37 -34
  41. package/docs/guide/install.md +17 -19
  42. package/docs/guide/lint.md +3 -9
  43. package/docs/guide/local-cli.md +123 -0
  44. package/docs/guide/migrate-rules.md +93 -290
  45. package/docs/guide/migrate.md +5 -48
  46. package/docs/guide/run.md +1 -1
  47. package/docs/guide/troubleshooting.md +3 -8
  48. package/docs/guide/upgrade-project.md +61 -0
  49. package/docs/guide/upgrade.md +17 -62
  50. package/package.json +17 -17
  51. package/docs/guide/installer-env-vars.md +0 -286
package/binding/index.cjs CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  const { readFileSync } = require('fs');
6
6
  let nativeBinding = null;
7
+ // Which artifact actually loaded. The WASI fallback chain overwrites it with
8
+ // the flavor it resolved; the late native retry below leaves it alone because
9
+ // it only runs while no WASI candidate has been loaded.
10
+ let __napiLoadedBindingTarget = 'native';
7
11
  const loadErrors = [];
8
12
 
9
13
  const isMusl = () => {
@@ -64,7 +68,16 @@ const isMuslFromChildProcess = () => {
64
68
  function requireNative() {
65
69
  if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
66
70
  try {
67
- return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
71
+ const overrideBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
72
+ // The override may be a generated WASI loader, which already reports its
73
+ // own flavor. Adopt it: `module.exports` aliases this object, so claiming
74
+ // 'native' would both misreport the artifact and overwrite the loader's
75
+ // marker through the alias.
76
+ __napiLoadedBindingTarget =
77
+ overrideBinding && typeof overrideBinding.__napiBindingTarget === 'string'
78
+ ? overrideBinding.__napiBindingTarget
79
+ : 'native';
80
+ return overrideBinding;
68
81
  } catch (err) {
69
82
  loadErrors.push(err);
70
83
  }
@@ -80,12 +93,12 @@ function requireNative() {
80
93
  const bindingPackageVersion =
81
94
  require('@voidzero-dev/vite-plus-android-arm64/package.json').version;
82
95
  if (
83
- bindingPackageVersion !== '0.3.2' &&
96
+ bindingPackageVersion !== '0.3.3' &&
84
97
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
85
98
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
86
99
  ) {
87
100
  throw new Error(
88
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
101
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
89
102
  );
90
103
  }
91
104
  return binding;
@@ -103,12 +116,12 @@ function requireNative() {
103
116
  const bindingPackageVersion =
104
117
  require('@voidzero-dev/vite-plus-android-arm-eabi/package.json').version;
105
118
  if (
106
- bindingPackageVersion !== '0.3.2' &&
119
+ bindingPackageVersion !== '0.3.3' &&
107
120
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
108
121
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
109
122
  ) {
110
123
  throw new Error(
111
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
124
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
112
125
  );
113
126
  }
114
127
  return binding;
@@ -138,12 +151,12 @@ function requireNative() {
138
151
  const bindingPackageVersion =
139
152
  require('@voidzero-dev/vite-plus-win32-x64-gnu/package.json').version;
140
153
  if (
141
- bindingPackageVersion !== '0.3.2' &&
154
+ bindingPackageVersion !== '0.3.3' &&
142
155
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
143
156
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
144
157
  ) {
145
158
  throw new Error(
146
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
159
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
147
160
  );
148
161
  }
149
162
  return binding;
@@ -161,12 +174,12 @@ function requireNative() {
161
174
  const bindingPackageVersion =
162
175
  require('@voidzero-dev/vite-plus-win32-x64-msvc/package.json').version;
163
176
  if (
164
- bindingPackageVersion !== '0.3.2' &&
177
+ bindingPackageVersion !== '0.3.3' &&
165
178
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
166
179
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
167
180
  ) {
168
181
  throw new Error(
169
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
182
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
170
183
  );
171
184
  }
172
185
  return binding;
@@ -185,12 +198,12 @@ function requireNative() {
185
198
  const bindingPackageVersion =
186
199
  require('@voidzero-dev/vite-plus-win32-ia32-msvc/package.json').version;
187
200
  if (
188
- bindingPackageVersion !== '0.3.2' &&
201
+ bindingPackageVersion !== '0.3.3' &&
189
202
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
190
203
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
191
204
  ) {
192
205
  throw new Error(
193
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
206
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
194
207
  );
195
208
  }
196
209
  return binding;
@@ -208,12 +221,12 @@ function requireNative() {
208
221
  const bindingPackageVersion =
209
222
  require('@voidzero-dev/vite-plus-win32-arm64-msvc/package.json').version;
210
223
  if (
211
- bindingPackageVersion !== '0.3.2' &&
224
+ bindingPackageVersion !== '0.3.3' &&
212
225
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
213
226
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
214
227
  ) {
215
228
  throw new Error(
216
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
229
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
217
230
  );
218
231
  }
219
232
  return binding;
@@ -234,12 +247,12 @@ function requireNative() {
234
247
  const bindingPackageVersion =
235
248
  require('@voidzero-dev/vite-plus-darwin-universal/package.json').version;
236
249
  if (
237
- bindingPackageVersion !== '0.3.2' &&
250
+ bindingPackageVersion !== '0.3.3' &&
238
251
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
239
252
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
240
253
  ) {
241
254
  throw new Error(
242
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
255
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
243
256
  );
244
257
  }
245
258
  return binding;
@@ -257,12 +270,12 @@ function requireNative() {
257
270
  const bindingPackageVersion =
258
271
  require('@voidzero-dev/vite-plus-darwin-x64/package.json').version;
259
272
  if (
260
- bindingPackageVersion !== '0.3.2' &&
273
+ bindingPackageVersion !== '0.3.3' &&
261
274
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
262
275
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
263
276
  ) {
264
277
  throw new Error(
265
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
278
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
266
279
  );
267
280
  }
268
281
  return binding;
@@ -280,12 +293,12 @@ function requireNative() {
280
293
  const bindingPackageVersion =
281
294
  require('@voidzero-dev/vite-plus-darwin-arm64/package.json').version;
282
295
  if (
283
- bindingPackageVersion !== '0.3.2' &&
296
+ bindingPackageVersion !== '0.3.3' &&
284
297
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
285
298
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
286
299
  ) {
287
300
  throw new Error(
288
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
301
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
289
302
  );
290
303
  }
291
304
  return binding;
@@ -307,12 +320,12 @@ function requireNative() {
307
320
  const bindingPackageVersion =
308
321
  require('@voidzero-dev/vite-plus-freebsd-x64/package.json').version;
309
322
  if (
310
- bindingPackageVersion !== '0.3.2' &&
323
+ bindingPackageVersion !== '0.3.3' &&
311
324
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
312
325
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
313
326
  ) {
314
327
  throw new Error(
315
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
328
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
316
329
  );
317
330
  }
318
331
  return binding;
@@ -330,12 +343,12 @@ function requireNative() {
330
343
  const bindingPackageVersion =
331
344
  require('@voidzero-dev/vite-plus-freebsd-arm64/package.json').version;
332
345
  if (
333
- bindingPackageVersion !== '0.3.2' &&
346
+ bindingPackageVersion !== '0.3.3' &&
334
347
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
335
348
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
336
349
  ) {
337
350
  throw new Error(
338
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
351
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
339
352
  );
340
353
  }
341
354
  return binding;
@@ -358,12 +371,12 @@ function requireNative() {
358
371
  const bindingPackageVersion =
359
372
  require('@voidzero-dev/vite-plus-linux-x64-musl/package.json').version;
360
373
  if (
361
- bindingPackageVersion !== '0.3.2' &&
374
+ bindingPackageVersion !== '0.3.3' &&
362
375
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
363
376
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
364
377
  ) {
365
378
  throw new Error(
366
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
379
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
367
380
  );
368
381
  }
369
382
  return binding;
@@ -381,12 +394,12 @@ function requireNative() {
381
394
  const bindingPackageVersion =
382
395
  require('@voidzero-dev/vite-plus-linux-x64-gnu/package.json').version;
383
396
  if (
384
- bindingPackageVersion !== '0.3.2' &&
397
+ bindingPackageVersion !== '0.3.3' &&
385
398
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
386
399
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
387
400
  ) {
388
401
  throw new Error(
389
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
402
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
390
403
  );
391
404
  }
392
405
  return binding;
@@ -406,12 +419,12 @@ function requireNative() {
406
419
  const bindingPackageVersion =
407
420
  require('@voidzero-dev/vite-plus-linux-arm64-musl/package.json').version;
408
421
  if (
409
- bindingPackageVersion !== '0.3.2' &&
422
+ bindingPackageVersion !== '0.3.3' &&
410
423
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
411
424
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
412
425
  ) {
413
426
  throw new Error(
414
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
427
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
415
428
  );
416
429
  }
417
430
  return binding;
@@ -429,12 +442,12 @@ function requireNative() {
429
442
  const bindingPackageVersion =
430
443
  require('@voidzero-dev/vite-plus-linux-arm64-gnu/package.json').version;
431
444
  if (
432
- bindingPackageVersion !== '0.3.2' &&
445
+ bindingPackageVersion !== '0.3.3' &&
433
446
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
434
447
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
435
448
  ) {
436
449
  throw new Error(
437
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
450
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
438
451
  );
439
452
  }
440
453
  return binding;
@@ -454,12 +467,12 @@ function requireNative() {
454
467
  const bindingPackageVersion =
455
468
  require('@voidzero-dev/vite-plus-linux-arm-musleabihf/package.json').version;
456
469
  if (
457
- bindingPackageVersion !== '0.3.2' &&
470
+ bindingPackageVersion !== '0.3.3' &&
458
471
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
459
472
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
460
473
  ) {
461
474
  throw new Error(
462
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
475
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
463
476
  );
464
477
  }
465
478
  return binding;
@@ -477,12 +490,12 @@ function requireNative() {
477
490
  const bindingPackageVersion =
478
491
  require('@voidzero-dev/vite-plus-linux-arm-gnueabihf/package.json').version;
479
492
  if (
480
- bindingPackageVersion !== '0.3.2' &&
493
+ bindingPackageVersion !== '0.3.3' &&
481
494
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
482
495
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
483
496
  ) {
484
497
  throw new Error(
485
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
498
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
486
499
  );
487
500
  }
488
501
  return binding;
@@ -502,12 +515,12 @@ function requireNative() {
502
515
  const bindingPackageVersion =
503
516
  require('@voidzero-dev/vite-plus-linux-loong64-musl/package.json').version;
504
517
  if (
505
- bindingPackageVersion !== '0.3.2' &&
518
+ bindingPackageVersion !== '0.3.3' &&
506
519
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
507
520
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
508
521
  ) {
509
522
  throw new Error(
510
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
523
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
511
524
  );
512
525
  }
513
526
  return binding;
@@ -525,12 +538,12 @@ function requireNative() {
525
538
  const bindingPackageVersion =
526
539
  require('@voidzero-dev/vite-plus-linux-loong64-gnu/package.json').version;
527
540
  if (
528
- bindingPackageVersion !== '0.3.2' &&
541
+ bindingPackageVersion !== '0.3.3' &&
529
542
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
530
543
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
531
544
  ) {
532
545
  throw new Error(
533
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
546
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
534
547
  );
535
548
  }
536
549
  return binding;
@@ -550,12 +563,12 @@ function requireNative() {
550
563
  const bindingPackageVersion =
551
564
  require('@voidzero-dev/vite-plus-linux-riscv64-musl/package.json').version;
552
565
  if (
553
- bindingPackageVersion !== '0.3.2' &&
566
+ bindingPackageVersion !== '0.3.3' &&
554
567
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
555
568
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
556
569
  ) {
557
570
  throw new Error(
558
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
571
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
559
572
  );
560
573
  }
561
574
  return binding;
@@ -573,12 +586,12 @@ function requireNative() {
573
586
  const bindingPackageVersion =
574
587
  require('@voidzero-dev/vite-plus-linux-riscv64-gnu/package.json').version;
575
588
  if (
576
- bindingPackageVersion !== '0.3.2' &&
589
+ bindingPackageVersion !== '0.3.3' &&
577
590
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
578
591
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
579
592
  ) {
580
593
  throw new Error(
581
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
594
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
582
595
  );
583
596
  }
584
597
  return binding;
@@ -597,12 +610,12 @@ function requireNative() {
597
610
  const bindingPackageVersion =
598
611
  require('@voidzero-dev/vite-plus-linux-ppc64-gnu/package.json').version;
599
612
  if (
600
- bindingPackageVersion !== '0.3.2' &&
613
+ bindingPackageVersion !== '0.3.3' &&
601
614
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
602
615
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
603
616
  ) {
604
617
  throw new Error(
605
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
618
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
606
619
  );
607
620
  }
608
621
  return binding;
@@ -620,12 +633,12 @@ function requireNative() {
620
633
  const bindingPackageVersion =
621
634
  require('@voidzero-dev/vite-plus-linux-s390x-gnu/package.json').version;
622
635
  if (
623
- bindingPackageVersion !== '0.3.2' &&
636
+ bindingPackageVersion !== '0.3.3' &&
624
637
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
625
638
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
626
639
  ) {
627
640
  throw new Error(
628
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
641
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
629
642
  );
630
643
  }
631
644
  return binding;
@@ -647,12 +660,12 @@ function requireNative() {
647
660
  const bindingPackageVersion =
648
661
  require('@voidzero-dev/vite-plus-openharmony-arm64/package.json').version;
649
662
  if (
650
- bindingPackageVersion !== '0.3.2' &&
663
+ bindingPackageVersion !== '0.3.3' &&
651
664
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
652
665
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
653
666
  ) {
654
667
  throw new Error(
655
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
668
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
656
669
  );
657
670
  }
658
671
  return binding;
@@ -670,12 +683,12 @@ function requireNative() {
670
683
  const bindingPackageVersion =
671
684
  require('@voidzero-dev/vite-plus-openharmony-x64/package.json').version;
672
685
  if (
673
- bindingPackageVersion !== '0.3.2' &&
686
+ bindingPackageVersion !== '0.3.3' &&
674
687
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
675
688
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
676
689
  ) {
677
690
  throw new Error(
678
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
691
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
679
692
  );
680
693
  }
681
694
  return binding;
@@ -693,12 +706,12 @@ function requireNative() {
693
706
  const bindingPackageVersion =
694
707
  require('@voidzero-dev/vite-plus-openharmony-arm/package.json').version;
695
708
  if (
696
- bindingPackageVersion !== '0.3.2' &&
709
+ bindingPackageVersion !== '0.3.3' &&
697
710
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
698
711
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
699
712
  ) {
700
713
  throw new Error(
701
- `Native binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
714
+ `Native binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
702
715
  );
703
716
  }
704
717
  return binding;
@@ -815,6 +828,7 @@ if (!nativeBinding || forceWasi) {
815
828
  if (!candidateFailed) {
816
829
  wasiBinding = require('./vite-plus.wasi.cjs');
817
830
  nativeBinding = wasiBinding;
831
+ __napiLoadedBindingTarget = 'wasm32-wasi';
818
832
  wasiBindingLoaded = true;
819
833
  }
820
834
  } catch (err) {
@@ -843,14 +857,15 @@ if (!nativeBinding || forceWasi) {
843
857
  ) {
844
858
  const bindingPackageVersion =
845
859
  require('@voidzero-dev/vite-plus-wasm32-wasi/package.json').version;
846
- if (bindingPackageVersion !== '0.3.2') {
860
+ if (bindingPackageVersion !== '0.3.3') {
847
861
  throw new Error(
848
- `WASI binding package version mismatch, expected 0.3.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
862
+ `WASI binding package version mismatch, expected 0.3.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
849
863
  );
850
864
  }
851
865
  }
852
866
  wasiBinding = require('@voidzero-dev/vite-plus-wasm32-wasi');
853
867
  nativeBinding = wasiBinding;
868
+ __napiLoadedBindingTarget = 'wasm32-wasi';
854
869
  wasiBindingLoaded = true;
855
870
  }
856
871
  } catch (err) {
@@ -891,6 +906,71 @@ if (!nativeBinding) {
891
906
  throw new Error(`Failed to load native binding`);
892
907
  }
893
908
 
909
+ function __napiStampBindingTarget(exportsObject, target) {
910
+ if (Object.prototype.hasOwnProperty.call(exportsObject, '__napiBindingTarget')) {
911
+ if (exportsObject.__napiBindingTarget === target) {
912
+ // Already ours: the root entry aliases the object it loaded, so a WASI
913
+ // fallback candidate — or a `NAPI_RS_NATIVE_LIBRARY_PATH` override that
914
+ // is a generated loader — arrives already stamped with this same value.
915
+ return target;
916
+ }
917
+ const error = new Error(
918
+ '`__napiBindingTarget` is reserved by the generated binding loader, but the loaded binding already exports it. Rename the export, e.g. #[napi(js_name = "...")].',
919
+ );
920
+ error.code = 'ERR_NAPI_BINDING_TARGET_CONFLICT';
921
+ throw error;
922
+ }
923
+ if (!Object.isExtensible(exportsObject)) {
924
+ // A `#[napi(module_exports)]` hook may seal or freeze this object
925
+ // (`Object::seal` / `Object::freeze`). Reporting the artifact is metadata,
926
+ // never a reason to fail an otherwise successful load, so the stamp is
927
+ // skipped. What a consumer still sees then follows the entry point: the
928
+ // browser and deferred loaders declare `__napiBindingTarget` at module
929
+ // level and go on reporting it, while the CommonJS entries hand back this
930
+ // very object as `module.exports`, so there the value is absent.
931
+ return target;
932
+ }
933
+ try {
934
+ // [[Define]], not [[Set]]: an ordinary assignment walks the prototype
935
+ // chain, so an inherited accessor could swallow the value or throw and
936
+ // fail an otherwise successful load. The descriptor is what a successful
937
+ // assignment would have produced.
938
+ Object.defineProperty(exportsObject, '__napiBindingTarget', {
939
+ configurable: true,
940
+ enumerable: true,
941
+ value: target,
942
+ writable: true,
943
+ });
944
+ } catch {
945
+ // Same rule as the non-extensible skip above: reporting the artifact is
946
+ // metadata, never a reason to fail an otherwise successful load. An exotic
947
+ // object (a Proxy whose defineProperty trap refuses) is skipped, not
948
+ // thrown over.
949
+ }
950
+ // The CommonJS loaders assign this return value so `cjs-module-lexer` — and
951
+ // therefore Node's CJS -> ESM named export detection — can see
952
+ // `__napiBindingTarget` statically.
953
+ return target;
954
+ }
955
+ // Stamp before the alias, not after. The guard only reads `nativeBinding`
956
+ // (`hasOwnProperty` plus a comparison), which is safe against any addon
957
+ // accessor; an assignment is not, because a `#[napi(module_exports)]` hook can
958
+ // expose a getter reporting this very value and a setter that throws. So the
959
+ // assignment lands on the loader's own `module.exports`, still the original
960
+ // object here, and the alias below replaces it.
961
+ //
962
+ // The assignment is what keeps the marker a statically visible CommonJS export:
963
+ // `cjs-module-lexer` is Node's CJS -> ESM named export detection, it cannot see
964
+ // a bare call, and the later `module.exports = nativeBinding` does not undo the
965
+ // detection. The assignment itself always succeeds — its target is this
966
+ // loader's own, still extensible `module.exports` — and the alias below then
967
+ // discards the value it wrote. What a consumer reads is whatever the guard put
968
+ // on `nativeBinding`, so on a frozen binding, where the guard skips, the
969
+ // linked import resolves to `undefined`.
970
+ module.exports.__napiBindingTarget = __napiStampBindingTarget(
971
+ nativeBinding,
972
+ __napiLoadedBindingTarget,
973
+ );
894
974
  module.exports = nativeBinding;
895
975
  module.exports.LegalCommentsMode = nativeBinding.LegalCommentsMode;
896
976
  module.exports.minify = nativeBinding.minify;
@@ -941,6 +1021,7 @@ module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
941
1021
  module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
942
1022
  module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
943
1023
  module.exports.TsconfigCache = nativeBinding.TsconfigCache;
1024
+ module.exports.__internalForcePanic = nativeBinding.__internalForcePanic;
944
1025
  module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
945
1026
  module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
946
1027
  module.exports.BindingChunkModuleOrderBy = nativeBinding.BindingChunkModuleOrderBy;
@@ -973,6 +1054,7 @@ module.exports.parseCreateArgs = nativeBinding.parseCreateArgs;
973
1054
  module.exports.parseHooksArgs = nativeBinding.parseHooksArgs;
974
1055
  module.exports.parseMigrateArgs = nativeBinding.parseMigrateArgs;
975
1056
  module.exports.parseStagedArgs = nativeBinding.parseStagedArgs;
1057
+ module.exports.removeConfigKey = nativeBinding.removeConfigKey;
976
1058
  module.exports.rewriteEslint = nativeBinding.rewriteEslint;
977
1059
  module.exports.rewriteImportsInDirectory = nativeBinding.rewriteImportsInDirectory;
978
1060
  module.exports.rewritePrettier = nativeBinding.rewritePrettier;
@@ -7,6 +7,14 @@ type VoidNullable<T = void> = T | null | undefined | void;
7
7
  export type BindingStringOrRegex = string | RegExp;
8
8
  export type BindingResult<T> = { errors: BindingError[]; isBindingErrors: boolean } | T;
9
9
 
10
+ /**
11
+ * Which binding artifact the generated loader actually loaded: `'native'` for
12
+ * a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
13
+ * flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
14
+ * can point the loader at a WASI artifact this package does not build itself.
15
+ */
16
+ export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1';
17
+
10
18
  export interface CodegenOptions {
11
19
  /**
12
20
  * Remove whitespace.
@@ -14,6 +22,24 @@ export interface CodegenOptions {
14
22
  * @default true
15
23
  */
16
24
  removeWhitespace?: boolean;
25
+ /**
26
+ * Escape non-ASCII characters in string literals, untagged template literals, regular
27
+ * expression literals and identifier names.
28
+ *
29
+ * Uses `\uXXXX` for characters up to U+FFFF and `\u{...}` for higher code points.
30
+ * Regular expressions use escaped UTF-16 surrogate pairs for higher code points instead;
31
+ * escaping changes the observable `RegExp.prototype.source` value.
32
+ *
33
+ * Code point escapes (`\u{...}`) require ES2015 or later; this option does not provide
34
+ * ES5-compatible output.
35
+ *
36
+ * Non-ASCII characters are left unescaped in tagged template quasis (whose raw text is
37
+ * observable), JSX names and text, JSX attribute strings, hashbangs and preserved comments.
38
+ * JavaScript expressions inside tagged templates and JSX are escaped normally.
39
+ *
40
+ * @default false
41
+ */
42
+ asciiOnly?: boolean;
17
43
  /**
18
44
  * How to handle legal comments (comments containing `@license`, `@preserve`, or starting with `//!`/`/*!`).
19
45
  *
@@ -2026,6 +2052,13 @@ export declare class TsconfigCache {
2026
2052
  size(): number;
2027
2053
  }
2028
2054
 
2055
+ /**
2056
+ * Panics on purpose. CI calls this to check that a published binding can produce a
2057
+ * symbolicated backtrace from its separately published debug info.
2058
+ * See `scripts/misc/verify-debuginfo.mjs` and internal-docs/panic-symbolication/implementation.md
2059
+ */
2060
+ export declare function __internalForcePanic(): void;
2061
+
2029
2062
  export interface AliasItem {
2030
2063
  find: string;
2031
2064
  replacements: Array<string | undefined | null>;
@@ -2104,6 +2137,7 @@ export interface BindingChecksOptions {
2104
2137
  unresolvedEntry?: boolean;
2105
2138
  unresolvedImport?: boolean;
2106
2139
  filenameConflict?: boolean;
2140
+ moduleLevelDirective?: boolean;
2107
2141
  commonJsVariableInEsm?: boolean;
2108
2142
  importIsUndefined?: boolean;
2109
2143
  emptyImportMeta?: boolean;
@@ -3765,6 +3799,12 @@ export interface PathAccess {
3765
3799
  readDir: boolean;
3766
3800
  }
3767
3801
 
3802
+ /** Remove a top-level key from a recognized Vite config object. */
3803
+ export declare function removeConfigKey(
3804
+ viteConfigPath: string,
3805
+ configKey: string,
3806
+ ): MergeJsonConfigResult;
3807
+
3768
3808
  /**
3769
3809
  * Rewrite ESLint scripts: rename `eslint` → `vp lint` and strip ESLint-only flags.
3770
3810
  *
@@ -1,5 +1,5 @@
1
- import { a as SETUP_VP_VERSION } from "./constants-IhOditRA.js";
2
- import { C as multiselect, S as log, T as select, k as isCancel } from "./prompts-CujFOJXu.js";
1
+ import { a as SETUP_VP_VERSION } from "./constants-C2dTOTe-.js";
2
+ import { C as multiselect, S as log, T as select, k as isCancel } from "./prompts-k14KgthC.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import fs from "node:fs";
package/dist/bin.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { t as renderCliDoc } from "./help-BmKpeOP9.js";
2
2
  import { c as warnMsg, i as log, n as errorMsg, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
3
- import { g as resolveBundled, h as resolve$1, i as DEFAULT_ENVS, l as VITE_CONFIG_FILES, n as BASEURL_TSCONFIG_WARNING, r as CONFIG_METADATA_ENV, u as VITE_PLUS_NAME } from "./constants-IhOditRA.js";
4
- import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BU42tr8y.js";
3
+ import { g as resolveBundled, h as resolve$1, i as DEFAULT_ENVS, l as VITE_CONFIG_FILES, n as BASEURL_TSCONFIG_WARNING, r as CONFIG_METADATA_ENV, u as VITE_PLUS_NAME } from "./constants-C2dTOTe-.js";
4
+ import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BVqEe9KY.js";
5
5
  import { t as resolveTsgolintExecutable } from "./tsgolint-path-CbDReEOx.js";
6
- import { a as readNearestPackageJson } from "./package-BB-Jh_z3.js";
6
+ import { a as readNearestPackageJson } from "./package-CHH8jWan.js";
7
7
  import { t as cac } from "./dist-DfmT__Aw.js";
8
8
  import { createRequire } from "node:module";
9
9
  import path, { dirname, join, resolve } from "node:path";
@@ -1517,7 +1517,7 @@ async function applyToolInitConfigToViteConfig(command, args, projectPath = proc
1517
1517
  }
1518
1518
  if (spec.configKey === "lint" && hasTriggerFlag(args, ["--init"])) {
1519
1519
  const lintInitConfigPath = path.join(projectPath, ".vite-plus-lint-init.oxlintrc.json");
1520
- const { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig } = await import("./tsconfig-MXktI3SX.js");
1520
+ const { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig } = await import("./tsconfig-euB-GmIE.js");
1521
1521
  await fixBaseUrlInTsconfig(projectPath);
1522
1522
  const hasBaseUrl = hasBaseUrlInTsconfig(projectPath);
1523
1523
  const initConfig = createDefaultVitePlusLintConfig({ includeTypeAwareDefaults: !hasBaseUrl });
@@ -1817,7 +1817,7 @@ else if (command === "hooks") await import("./hooks/bin.js");
1817
1817
  else if (command === "--version" || command === "-V") await import("./version.js");
1818
1818
  else if (command === "staged") await import("./staged/bin.js");
1819
1819
  else try {
1820
- const { resolveUniversalViteConfig } = await import("./resolve-vite-config-6Nox70uP.js");
1820
+ const { resolveUniversalViteConfig } = await import("./resolve-vite-config-CTOTuqTi.js");
1821
1821
  const initInspection = inspectInitCommand(command, args.slice(1));
1822
1822
  if (initInspection.handled && initInspection.configKey && initInspection.hasExistingConfigKey && initInspection.existingViteConfigPath) {
1823
1823
  log(`Skipped initialization: '${accent(initInspection.configKey)}' already exists in '${accent(path.basename(initInspection.existingViteConfigPath))}'.`);
@@ -1,6 +1,6 @@
1
1
  import { i as log, n as errorMsg } from "../terminal-MKGAuy-p.js";
2
- import { i as promptGitHooks, n as defaultInteractive } from "../prompts-CujFOJXu.js";
3
- import { o as updateExistingAgentInstructions } from "../agent-C59HKB4Y.js";
2
+ import { i as promptGitHooks, n as defaultInteractive } from "../prompts-k14KgthC.js";
3
+ import { o as updateExistingAgentInstructions } from "../agent-Cu6-tXIP.js";
4
4
  import { t as require_dist } from "../dist-BDYZP12R.js";
5
5
  import { a as install, c as resolveHooksLocation, o as isGitHooksEnvDisabled, s as isHooksUserDisabled } from "../hooks-C-4gykWR.js";
6
6
  import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  //#region package.json
3
- var version = "0.3.2";
3
+ var version = "0.3.3";
4
4
  //#endregion
5
5
  //#region src/utils/constants.ts
6
6
  const VITE_PLUS_NAME = "vite-plus";