vite-plus 1.3.0 → 1.4.0

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 (90) hide show
  1. package/AGENTS.md +4 -0
  2. package/LICENSE +1 -878
  3. package/README.md +1 -1
  4. package/bin/vpx +9 -0
  5. package/binding/index.cjs +59 -54
  6. package/binding/index.d.cts +128 -2
  7. package/dist/{agent-97KmGCyL.js → agent-D8oxxhVR.js} +5 -7
  8. package/dist/bin.js +25 -32
  9. package/dist/{cli-parse-DHE8NrBU.js → cli-parse-aeUeFDlC.js} +2 -3
  10. package/dist/command-TjS_6y9O.js +1 -0
  11. package/dist/{command-CdMBoZFD.js → command-rY79K5NI.js} +28 -30
  12. package/dist/{comparison-CmVirWIW-DUGaiYqF.js → comparison-CmVirWIW-UlEf2maz.js} +1 -2
  13. package/dist/config/bin.js +8 -10
  14. package/dist/{constants-DR55DpRm.js → constants-DRUnJ_Dz.js} +3 -5
  15. package/dist/create/bin.d.ts +4 -8
  16. package/dist/create/bin.js +46 -65
  17. package/dist/{define-config-CvE5pHqB.js → define-config-ChwJcu5e.js} +6 -9
  18. package/dist/{define-config-BxDc_9BK.cjs → define-config-Cv2P6NT2.cjs} +7 -12
  19. package/dist/{define-config-Bexdd6RZ.d.ts → define-config-rPhYIFSn.d.ts} +1 -11
  20. package/dist/define-config.cjs +1 -1
  21. package/dist/define-config.d.ts +1 -1
  22. package/dist/define-config.js +1 -1
  23. package/dist/{dist-DIpm7mot.js → dist-Bs0SObNC.js} +73 -145
  24. package/dist/{dist-Cqz8OtiO.js → dist-CdkMvIiQ.js} +11 -5
  25. package/dist/dist-zDZV5eEc.js +3 -0
  26. package/dist/{documentation-DqcZSthV.js → documentation-cv_y0Auv.js} +1 -2
  27. package/dist/{editor-CtJGQP7C.js → editor-ClL78D8u.js} +1490 -4209
  28. package/dist/{help-BmKpeOP9.js → help-B03t_iQ4.js} +1 -2
  29. package/dist/hooks/bin.js +4 -5
  30. package/dist/{hooks-DhwsWb46.js → hooks-xRcJPc-O.js} +5 -4
  31. package/dist/index.cjs +2 -3
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/{json-JP24qHUF.js → json-kl84kDyH.js} +9 -18
  35. package/dist/lint-plugins.cjs +1 -1
  36. package/dist/migration/bin.js +719 -184
  37. package/dist/migration/compat/worker.js +4 -6
  38. package/dist/{oxlint-plugin-config-BIzrO2y2.js → oxlint-plugin-config-BVpqYdcC.js} +3 -4
  39. package/dist/oxlint-plugin.d.ts +0 -2
  40. package/dist/oxlint-plugin.js +6 -7
  41. package/dist/{pack-BK38MLVZ.d.ts → pack-ARPFMefW.d.ts} +0 -2
  42. package/dist/pack-bin.d.ts +1 -3
  43. package/dist/pack-bin.js +3 -4
  44. package/dist/pack.d.ts +1 -1
  45. package/dist/{package-CQDXTm6j.js → package-DzsomcUD.js} +10 -95
  46. package/dist/{package-overrides-D1RcXSFl.js → package-overrides-Ci8GXouY.js} +5 -8
  47. package/dist/picomatch-DEUoj81q.js +1916 -0
  48. package/dist/{prompts-1xNz_ne0.js → prompts-GL1vj0wk.js} +30 -50
  49. package/dist/{protocol-D99W10Qi.js → protocol-CkNmY-Mr.js} +1 -2
  50. package/dist/{report-NhQk8VHb.js → report-DLHO30yZ.js} +2 -2
  51. package/dist/{resolve-vite-config-BVr1SUNg.js → resolve-vite-config-Dn5896A4.js} +9 -25
  52. package/dist/resolve-vite-config-QO6cC0SP.js +1 -0
  53. package/dist/{rolldown-runtime-kJ_i4yPo.js → rolldown-runtime-DegdyBIC.js} +1 -2
  54. package/dist/script-esm-hooks.d.ts +8 -0
  55. package/dist/script-esm-hooks.js +24 -0
  56. package/dist/script-hooks-9Fof5UMY.js +176 -0
  57. package/dist/script-preload.cjs +468 -0
  58. package/dist/script-register.d.ts +1 -0
  59. package/dist/script-register.js +22 -0
  60. package/dist/script-watch.d.ts +1 -0
  61. package/dist/script-watch.js +1908 -0
  62. package/dist/staged/bin.js +53 -2011
  63. package/dist/sync-versions/bin.js +26 -48
  64. package/dist/sync-versions/bin.mjs +109 -217
  65. package/dist/{terminal-MKGAuy-p.js → terminal-BcuPUy-j.js} +1 -2
  66. package/dist/toolchain.js +35 -9
  67. package/dist/toolchain.json +35 -9
  68. package/dist/{tsconfig-zWgHiQ3X.js → tsconfig-Do6MAG_f.js} +1 -1
  69. package/dist/{tsconfig-BZu7kl-x.js → tsconfig-LE_mAwe_.js} +8 -10
  70. package/dist/version.d.ts +1 -3
  71. package/dist/version.js +5 -6
  72. package/dist/versions.js +4 -4
  73. package/dist/{vitest-ecosystem-BU0AqZq-.js → vitest-ecosystem-BeEYz-qF.js} +1 -2
  74. package/dist/{vitest-v5-entry-points-DthU1e_O.js → vitest-v5-entry-points-NyJsFeux.js} +1 -2
  75. package/dist/vpx-bin.d.ts +1 -0
  76. package/dist/vpx-bin.js +232 -0
  77. package/dist/vpx-script-EXgV5QOf.js +434 -0
  78. package/docs/config/run.md +4 -0
  79. package/docs/guide/check.md +1 -0
  80. package/docs/guide/ci.md +13 -3
  81. package/docs/guide/env.md +11 -4
  82. package/docs/guide/global-cli.md +52 -0
  83. package/docs/guide/migrate-rules.md +48 -5
  84. package/docs/guide/migrate.md +5 -5
  85. package/docs/guide/package-management.md +1 -1
  86. package/docs/guide/vpx.md +170 -9
  87. package/package.json +20 -17
  88. package/dist/command-DVTILtS-.js +0 -1
  89. package/dist/dist-Dhu07wmN.js +0 -3
  90. package/dist/resolve-vite-config-7WDtXO4G.js +0 -1
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/cac@7.0.1/node_modules/cac/dist/index.js
1
+ // ../../node_modules/.pnpm/cac@7.1.0/node_modules/cac/dist/index.js
2
2
  function toArr(any) {
3
3
  return any == null ? [] : Array.isArray(any) ? any : [any];
4
4
  }
@@ -147,7 +147,7 @@ function setDotProp(obj, keys, val) {
147
147
  }
148
148
  }
149
149
  function setByType(obj, transforms) {
150
- for (const [key, transform] of Object.entries(transforms)) if (transform.shouldTransform) {
150
+ for (const [key, transform] of Object.entries(transforms)) if (transform.shouldTransform && key in obj) {
151
151
  obj[key] = [obj[key]].flat();
152
152
  if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
153
153
  }
@@ -200,7 +200,6 @@ var Option = class {
200
200
  else this.isBoolean = true;
201
201
  }
202
202
  };
203
- let runtimeProcessArgs;
204
203
  let runtimeInfo;
205
204
  if (typeof process !== "undefined") {
206
205
  let runtimeName;
@@ -208,9 +207,16 @@ if (typeof process !== "undefined") {
208
207
  else if (typeof Bun !== "undefined" && typeof Bun.version === "string") runtimeName = "bun";
209
208
  else runtimeName = "node";
210
209
  runtimeInfo = `${process.platform}-${process.arch} ${runtimeName}-${process.version}`;
211
- runtimeProcessArgs = process.argv;
212
210
  } else if (typeof navigator === "undefined") runtimeInfo = `unknown`;
213
211
  else runtimeInfo = `${navigator.platform} ${navigator.userAgent}`;
212
+ /**
213
+ * `process.argv` at call time. It must not be captured when this module is
214
+ * imported: a runner may load cac before it rewrites `process.argv` for the
215
+ * script it is about to run.
216
+ */
217
+ function getRuntimeProcessArgs() {
218
+ return typeof process === "undefined" ? void 0 : process.argv;
219
+ }
214
220
  var Command = class {
215
221
  rawName;
216
222
  description;
@@ -512,6 +518,7 @@ var CAC = class extends EventTarget {
512
518
  */
513
519
  parse(argv, { run = true } = {}) {
514
520
  if (!argv) {
521
+ const runtimeProcessArgs = getRuntimeProcessArgs();
515
522
  if (!runtimeProcessArgs) throw new Error("No argv provided and runtime process argv is not available.");
516
523
  argv = runtimeProcessArgs;
517
524
  }
@@ -618,5 +625,4 @@ var CAC = class extends EventTarget {
618
625
  * @param name The program name to display in help and version message
619
626
  */
620
627
  const cac = (name = "") => new CAC(name);
621
- //#endregion
622
628
  export { cac as t };
@@ -0,0 +1,3 @@
1
+ import { t as require_dist } from "./dist-Bs0SObNC.js";
2
+ export default require_dist();
3
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { documentationUrl } from "../binding/index.js";
2
- //#region src/utils/documentation.ts
2
+ // src/utils/documentation.ts
3
3
  function documentationUrl$1(path) {
4
4
  return documentationUrl(path);
5
5
  }
@@ -7,5 +7,4 @@ function documentationUrl$1(path) {
7
7
  function rewriteDocumentationLinks(content) {
8
8
  return content.replaceAll("https://viteplus.dev/guide/", documentationUrl$1("/guide/"));
9
9
  }
10
- //#endregion
11
10
  export { rewriteDocumentationLinks as n, documentationUrl$1 as t };