vite-plus 0.3.0 → 0.3.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.
Files changed (80) hide show
  1. package/LICENSE +29 -29
  2. package/README.md +2 -2
  3. package/binding/index.cjs +60 -55
  4. package/binding/index.d.cts +125 -14
  5. package/dist/{agent-Wqx0MPk0.js → agent-C5jMYVfB.js} +3 -2
  6. package/dist/bin.js +89 -58
  7. package/dist/cli-parse-DHE8NrBU.js +13 -0
  8. package/dist/client/bundledDevClient.mjs +1 -1
  9. package/dist/client/client.mjs +1 -1
  10. package/dist/client/env.mjs +1 -1
  11. package/dist/client.d.ts +1 -1
  12. package/dist/config/bin.js +83 -55
  13. package/dist/{constants-Bn-U8o4v.js → constants-0IAVgpox.js} +3 -3
  14. package/dist/create/bin.d.ts +13 -5
  15. package/dist/create/bin.js +37 -190
  16. package/dist/{define-config-WiVlryJ2.cjs → define-config-DIE9de46.cjs} +1 -1
  17. package/dist/{define-config-DWoAkNdp.d.ts → define-config-DPNEJxPz.d.ts} +5 -9
  18. package/dist/{define-config-GXUdVT-0.js → define-config-U3_xg7i-.js} +2 -2
  19. package/dist/define-config.cjs +1 -1
  20. package/dist/define-config.d.ts +1 -1
  21. package/dist/define-config.js +1 -1
  22. package/dist/dist-DfmT__Aw.js +619 -0
  23. package/dist/{editor-CC4DqODz.js → editor-B5-lvRaU.js} +68 -40
  24. package/dist/hooks/bin.js +9 -114
  25. package/dist/{hooks-DFqViZqZ.js → hooks-C-4gykWR.js} +1 -1
  26. package/dist/index.cjs +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +2 -2
  29. package/dist/internal.d.ts +1 -1
  30. package/dist/internal.js +1 -1
  31. package/dist/migration/bin.js +24 -143
  32. package/dist/migration/compat/worker.js +1 -1
  33. package/dist/module-runner.d.ts +1 -1
  34. package/dist/module-runner.js +1 -1
  35. package/dist/{oxlint-plugin-config-DX5ezKbB.js → oxlint-plugin-config-Drdl67Xp.js} +1 -1
  36. package/dist/oxlint-plugin.d.ts +2 -2
  37. package/dist/oxlint-plugin.js +1 -1
  38. package/dist/{pack-PvUg_xpv.d.ts → pack-BK38MLVZ.d.ts} +1 -1
  39. package/dist/pack-bin.d.ts +2 -3
  40. package/dist/pack-bin.js +5 -622
  41. package/dist/pack-client.d.ts +1 -1
  42. package/dist/pack.d.ts +2 -2
  43. package/dist/pack.js +1 -1
  44. package/dist/{package-CBe9EWPY.js → package-BZz2Ij68.js} +1 -1
  45. package/dist/{prompts-DF3yU-eU.js → prompts-CtzEgFY-.js} +3 -1400
  46. package/dist/{report-ZNR1Mk6h.js → report-CK5TnTsr.js} +1 -0
  47. package/dist/{resolve-vite-config-ipGb39Jo.js → resolve-vite-config-CGks1xR7.js} +3 -3
  48. package/dist/resolve-vite-config-Dnmc-lBc.js +2 -0
  49. package/dist/semver-CaDAb8vV.js +1400 -0
  50. package/dist/staged/bin.js +83 -218
  51. package/dist/sync-versions/bin.d.ts +1 -0
  52. package/dist/sync-versions/bin.js +3884 -0
  53. package/dist/sync-versions/bin.mjs +13323 -0
  54. package/dist/toolchain.js +9 -9
  55. package/dist/toolchain.json +9 -9
  56. package/dist/{tsconfig-LD2QhQ0O.js → tsconfig-CUggNuJR.js} +2 -2
  57. package/dist/{tsconfig-BVHG3DpR.js → tsconfig-VAbm4ZzJ.js} +1 -1
  58. package/dist/tsgolint-path.d.ts +3 -4
  59. package/dist/types/customEvent.d.ts +1 -1
  60. package/dist/types/hmrPayload.d.ts +1 -1
  61. package/dist/types/hot.d.ts +1 -1
  62. package/dist/types/import-meta.d.ts +1 -1
  63. package/dist/types/importGlob.d.ts +1 -1
  64. package/dist/types/importMeta.d.ts +1 -1
  65. package/dist/types/metadata.d.ts +1 -1
  66. package/dist/version.d.ts +2 -3
  67. package/dist/version.js +2 -2
  68. package/dist/versions.js +4 -4
  69. package/dist/vitest-ecosystem-BiRqcaRI.js +23 -0
  70. package/docs/guide/check.md +1 -0
  71. package/docs/guide/ci.md +42 -2
  72. package/docs/guide/env.md +124 -52
  73. package/docs/guide/ide-integration.md +14 -2
  74. package/docs/guide/index.md +1 -1
  75. package/docs/guide/install.md +3 -1
  76. package/docs/guide/installer-env-vars.md +10 -0
  77. package/docs/guide/migrate-rules.md +57 -2
  78. package/package.json +17 -19
  79. package/dist/lib-L3DWSRQp.js +0 -75
  80. package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
@@ -82,14 +82,26 @@ You can also manually set up the Zed config:
82
82
  "JavaScript": {
83
83
  "format_on_save": "on",
84
84
  "prettier": { "allowed": false },
85
- "formatter": [{ "language_server": { "name": "oxfmt" } }],
86
- "code_action": "source.fixAll.oxc"
85
+ "formatter": [
86
+ { "language_server": { "name": "oxfmt" } },
87
+ { "code_action": "source.fixAll.oxc" }
88
+ ]
89
+ },
90
+ "JSX": {
91
+ "format_on_save": "on",
92
+ "prettier": { "allowed": false },
93
+ "formatter": [{ "language_server": { "name": "oxfmt" } }]
87
94
  },
88
95
  "TypeScript": {
89
96
  "format_on_save": "on",
90
97
  "prettier": { "allowed": false },
91
98
  "formatter": [{ "language_server": { "name": "oxfmt" } }]
92
99
  },
100
+ "TSX": {
101
+ "format_on_save": "on",
102
+ "prettier": { "allowed": false },
103
+ "formatter": [{ "language_server": { "name": "oxfmt" } }]
104
+ },
93
105
  "Vue.js": {
94
106
  "format_on_save": "on",
95
107
  "prettier": { "allowed": false },
@@ -96,7 +96,7 @@ Vite+ can handle the entire local frontend development cycle from starting a pro
96
96
  - [`vp hooks`](/guide/commit-hooks) manages the Git hook dispatcher (`enable`, `disable`, `status`).
97
97
  - [`vp staged`](/guide/commit-hooks) runs checks on staged files.
98
98
  - [`vp install`](/guide/install) installs dependencies with the right package manager.
99
- - [`vp env`](/guide/env) manages Node.js versions.
99
+ - [`vp env`](/guide/env) manages Node.js and package-manager environments.
100
100
 
101
101
  ### Develop
102
102
 
@@ -19,7 +19,9 @@ Vite+ detects the package manager from the workspace root in this order:
19
19
  9. `bunfig.toml`
20
20
  10. `yarn.config.cjs`
21
21
 
22
- If none of those files are present, `vp` falls back to `pnpm` by default. Vite+ automatically downloads the matching package manager and uses it for the command you ran. When detection comes from lockfiles or config files, the resolved version is written to `devEngines.packageManager` so future runs are deterministic; projects that already declare `packageManager` or `devEngines.packageManager` are left as-is.
22
+ If none of those files are present, `vp` falls back to `pnpm` by default. Vite+ automatically downloads the matching package manager and uses it for the command you ran, but package-manager detection never rewrites `package.json`. Use `vp env pin <package-manager>@<version>` when the project should declare an exact version explicitly.
23
+
24
+ After selecting the package manager, Vite+ forwards the command without separately validating whether `package.json` exists. Missing-manifest behavior therefore matches the selected package manager.
23
25
 
24
26
  The [`devEngines.packageManager`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines) field accepts a single object or an array of objects, and its `version` may be a semver range:
25
27
 
@@ -127,6 +127,16 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
127
127
  VP_NODE_VERSION=22 vp env exec node -v
128
128
  ```
129
129
 
130
+ ### `VP_PACKAGE_MANAGER`
131
+
132
+ - **Purpose**: Override the selected package manager and version
133
+ - **Default**: None (resolved from the project or global default)
134
+ - **Format**: `npm|pnpm|yarn|bun@<version>`
135
+ - **Example**:
136
+ ```bash
137
+ VP_PACKAGE_MANAGER=pnpm@10.18.0 vp install
138
+ ```
139
+
130
140
  ### `VP_NODE_SKIP_SIGNATURE_VERIFY`
131
141
 
132
142
  - **Purpose**: Skip PGP signature verification of Node.js downloads
@@ -39,6 +39,52 @@ When a default upgrade skips setup actions that would apply, it prints a hint
39
39
  to run `vp migrate --full`. Fresh (non Vite+) projects always run the full
40
40
  migration.
41
41
 
42
+ ## Pack Configuration
43
+
44
+ `vp migrate` updates static `pack` objects in `vite.config.*` and exported
45
+ objects in `tsdown.config.*` for [tsdown 0.23](https://github.com/rolldown/tsdown/releases/tag/v0.23.0).
46
+ This also runs on existing Vite+ projects without `--full`, including workspace
47
+ packages. Arrays and direct objects returned by `defineConfig` callbacks are
48
+ supported. JSON tsdown configs receive the same updates after they merge into
49
+ `vite.config.ts`.
50
+
51
+ | Previous option | Updated option |
52
+ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
53
+ | `bundle: false` | `unbundle: true` |
54
+ | `bundle: true` | Removed; bundling remains the default |
55
+ | `outExtension` | `outExtensions` |
56
+ | `publicDir` | `copy` |
57
+ | `removeNodeProtocol: true` | `nodeProtocol: 'strip'` |
58
+ | `injectStyle` | `css.inject` |
59
+ | `inlineOnly` / `deps.onlyAllowBundle` | `deps.onlyBundle` |
60
+ | `noExternal` | `deps.alwaysBundle` |
61
+ | `skipNodeModulesBundle: true` / `deps.skipNodeModulesBundle: true` | `deps.neverBundle: true` |
62
+ | `dts.tsgo` / `dts.oxc` | Select with `dts.generator`; retain generator option objects and remove boolean flags |
63
+ | `dts.cjsReexport` | Removed; tsdown generates CJS declarations separately |
64
+ | `--public-dir` in `tsdown` or `vp pack` scripts | `--copy` |
65
+
66
+ Migration preserves the previous defaults by setting `deps.resolveDepSubpath`
67
+ to `true` when absent. Enabled ATTW checks receive `profile: 'strict'` when
68
+ no profile is set. Explicit values, including `false`, remain unchanged.
69
+
70
+ `noExternal` moves to `deps.alwaysBundle`, preserving matcher expressions,
71
+ references, and callback methods. Existing `deps.alwaysBundle` values remain
72
+ unchanged.
73
+
74
+ When `external` accompanies either `skipNodeModulesBundle` form, static matchers
75
+ and references to local constants move to `inputOptions.external` before
76
+ `deps.neverBundle` is set. Constant declarations and references stay intact.
77
+ This preserves the original matching rules, including external file paths. Unsupported matchers,
78
+ conflicting `inputOptions`, and declaration-specific dependency rules leave the
79
+ pack object unchanged and produce a manual-migration warning.
80
+
81
+ The transform does not evaluate configuration code. Objects with spreads,
82
+ computed keys, or duplicate keys, and conflicting old and new options require
83
+ manual review. Dynamic boolean selectors remain unchanged. Unrelated Vite and
84
+ plugin options remain unchanged. Run `vp pack` after migration to check the
85
+ result. Node.js requirements, TypeScript module resolution, and programmatic
86
+ `build()` return values require separate review.
87
+
42
88
  ## Dependency Rules
43
89
 
44
90
  What happens to each toolchain dependency, at a glance:
@@ -252,6 +298,14 @@ as `run` or `--`:
252
298
 
253
299
  Unrelated `bunx` commands and other package-executor forms remain unchanged.
254
300
 
301
+ ## Continuous Integration Rules
302
+
303
+ Migration replaces exact `voidzero-dev/setup-vp@v1` references in GitHub
304
+ Actions workflows and composite actions under `.github` with the latest exact
305
+ `setup-vp` release known to that Vite+ version. The frozen `v1` tag does not
306
+ receive new releases. Existing exact versions and commit SHAs are left
307
+ unchanged.
308
+
255
309
  ## Node.js Version Rules
256
310
 
257
311
  Migration converts legacy Node.js version-manager files to `.node-version`,
@@ -263,8 +317,9 @@ migrations run it unconditionally.
263
317
  existing `.node-version` is kept.
264
318
  - When `.nvmrc` is removed, any `actions/setup-node` `node-version-file:
265
319
  .nvmrc` reference in `.github/workflows/*.{yml,yaml}` and composite actions
266
- (`.github/actions/**/action.{yml,yaml}`) is repointed to `.node-version` so
267
- CI does not fail with "node version file ... does not exist".
320
+ under `.github` (`.github/**/action.{yml,yaml}`) is repointed to
321
+ `.node-version` so CI does not fail with "node version file ... does not
322
+ exist".
268
323
 
269
324
  ## Package-Manager Rules
270
325
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -350,7 +350,7 @@
350
350
  }
351
351
  },
352
352
  "dependencies": {
353
- "@oxc-project/types": "=0.146.0",
353
+ "@oxc-project/types": "=0.148.0",
354
354
  "@oxlint/plugins": "=1.79.0",
355
355
  "@vitest/browser": "4.1.11",
356
356
  "@vitest/browser-preview": "4.1.11",
@@ -361,11 +361,11 @@
361
361
  "@vitest/snapshot": "4.1.11",
362
362
  "@vitest/spy": "4.1.11",
363
363
  "@vitest/utils": "4.1.11",
364
- "oxfmt": "=0.64.0",
365
- "oxlint": "=1.79.0",
364
+ "oxfmt": "=0.66.0",
365
+ "oxlint": "=1.81.0",
366
366
  "oxlint-tsgolint": "=7.0.2001",
367
- "vitest": "4.1.11",
368
- "@voidzero-dev/vite-plus-core": "0.3.0"
367
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
368
+ "vitest": "4.1.11"
369
369
  },
370
370
  "devDependencies": {
371
371
  "@emnapi/core": "2.0.0-alpha.4",
@@ -377,6 +377,7 @@
377
377
  "@types/validate-npm-package-name": "^4.0.2",
378
378
  "@vitest/browser-playwright": "4.1.11",
379
379
  "@vitest/browser-webdriverio": "4.1.11",
380
+ "@voidzero-dev/vite-plus-prompts": "0.0.0",
380
381
  "bingo": "^0.9.3",
381
382
  "cac": "^7.0.0",
382
383
  "cross-spawn": "^7.0.5",
@@ -386,16 +387,13 @@
386
387
  "jsonc-parser": "^3.3.1",
387
388
  "lint-staged": "^16.2.6",
388
389
  "minimatch": "^10.0.3",
389
- "mri": "^1.2.0",
390
390
  "nanotar": "^0.3.0",
391
391
  "picocolors": "^1.1.1",
392
392
  "semver": "^7.8.0",
393
- "tsdown": "^0.22.14",
393
+ "tsdown": "^0.23.0",
394
394
  "validate-npm-package-name": "^7.0.2",
395
395
  "yaml": "^2.8.1",
396
- "zod": "^3.25.76",
397
- "@voidzero-dev/vite-plus-prompts": "0.0.0",
398
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0"
396
+ "zod": "^3.25.76"
399
397
  },
400
398
  "peerDependencies": {
401
399
  "@vitest/browser-playwright": "4.1.11",
@@ -427,14 +425,14 @@
427
425
  "node": "^20.19.0 || ^22.18.0 || >=24.11.0"
428
426
  },
429
427
  "optionalDependencies": {
430
- "@voidzero-dev/vite-plus-darwin-arm64": "0.3.0",
431
- "@voidzero-dev/vite-plus-darwin-x64": "0.3.0",
432
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.3.0",
433
- "@voidzero-dev/vite-plus-linux-arm64-musl": "0.3.0",
434
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.3.0",
435
- "@voidzero-dev/vite-plus-linux-x64-musl": "0.3.0",
436
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.3.0",
437
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.3.0"
428
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.3.1",
429
+ "@voidzero-dev/vite-plus-darwin-x64": "0.3.1",
430
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.3.1",
431
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "0.3.1",
432
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.3.1",
433
+ "@voidzero-dev/vite-plus-linux-x64-musl": "0.3.1",
434
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.3.1",
435
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.3.1"
438
436
  },
439
437
  "scripts": {
440
438
  "build": "oxnode -C dev ./build.ts",
@@ -1,75 +0,0 @@
1
- //#region ../../node_modules/.pnpm/mri@1.2.0/node_modules/mri/lib/index.mjs
2
- function toArr(any) {
3
- return any == null ? [] : Array.isArray(any) ? any : [any];
4
- }
5
- function toVal(out, key, val, opts) {
6
- var x, old = out[key], nxt = !!~opts.string.indexOf(key) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : !!~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x = +val, x * 0 === 0) ? x : val), !!val) : (x = +val, x * 0 === 0) ? x : val;
7
- out[key] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
8
- }
9
- function lib_default(args, opts) {
10
- args = args || [];
11
- opts = opts || {};
12
- var k, arr, arg, name, val, out = { _: [] };
13
- var i = 0, j = 0, idx = 0, len = args.length;
14
- const alibi = opts.alias !== void 0;
15
- const strict = opts.unknown !== void 0;
16
- const defaults = opts.default !== void 0;
17
- opts.alias = opts.alias || {};
18
- opts.string = toArr(opts.string);
19
- opts.boolean = toArr(opts.boolean);
20
- if (alibi) for (k in opts.alias) {
21
- arr = opts.alias[k] = toArr(opts.alias[k]);
22
- for (i = 0; i < arr.length; i++) (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
23
- }
24
- for (i = opts.boolean.length; i-- > 0;) {
25
- arr = opts.alias[opts.boolean[i]] || [];
26
- for (j = arr.length; j-- > 0;) opts.boolean.push(arr[j]);
27
- }
28
- for (i = opts.string.length; i-- > 0;) {
29
- arr = opts.alias[opts.string[i]] || [];
30
- for (j = arr.length; j-- > 0;) opts.string.push(arr[j]);
31
- }
32
- if (defaults) for (k in opts.default) {
33
- name = typeof opts.default[k];
34
- arr = opts.alias[k] = opts.alias[k] || [];
35
- if (opts[name] !== void 0) {
36
- opts[name].push(k);
37
- for (i = 0; i < arr.length; i++) opts[name].push(arr[i]);
38
- }
39
- }
40
- const keys = strict ? Object.keys(opts.alias) : [];
41
- for (i = 0; i < len; i++) {
42
- arg = args[i];
43
- if (arg === "--") {
44
- out._ = out._.concat(args.slice(++i));
45
- break;
46
- }
47
- for (j = 0; j < arg.length; j++) if (arg.charCodeAt(j) !== 45) break;
48
- if (j === 0) out._.push(arg);
49
- else if (arg.substring(j, j + 3) === "no-") {
50
- name = arg.substring(j + 3);
51
- if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
52
- out[name] = false;
53
- } else {
54
- for (idx = j + 1; idx < arg.length; idx++) if (arg.charCodeAt(idx) === 61) break;
55
- name = arg.substring(j, idx);
56
- val = arg.substring(++idx) || i + 1 === len || ("" + args[i + 1]).charCodeAt(0) === 45 || args[++i];
57
- arr = j === 2 ? [name] : name;
58
- for (idx = 0; idx < arr.length; idx++) {
59
- name = arr[idx];
60
- if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
61
- toVal(out, name, idx + 1 < arr.length || val, opts);
62
- }
63
- }
64
- }
65
- if (defaults) {
66
- for (k in opts.default) if (out[k] === void 0) out[k] = opts.default[k];
67
- }
68
- if (alibi) for (k in out) {
69
- arr = opts.alias[k] || [];
70
- while (arr.length > 0) out[arr.shift()] = out[k];
71
- }
72
- return out;
73
- }
74
- //#endregion
75
- export { lib_default as t };
@@ -1,8 +1,8 @@
1
1
  import { a as ansiStyles, t as stripAnsi } from "./strip-ansi-C3wrWz9t.js";
2
2
  import { t as isFullwidthCodePoint } from "./is-fullwidth-code-point-BUNlIICg.js";
3
3
  import { t as wrapAnsi } from "./wrap-ansi-DNjkuBEp.js";
4
- import process$1 from "node:process";
5
4
  import os from "node:os";
5
+ import process$1 from "node:process";
6
6
  //#region ../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js
7
7
  const isBrowser = globalThis.window?.document !== void 0;
8
8
  globalThis.process?.versions?.node;