vite-plus 1.5.1 → 1.6.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 (44) hide show
  1. package/binding/index.cjs +57 -56
  2. package/binding/index.d.cts +9 -0
  3. package/dist/{agent-CowvWq3j.js → agent-CTG3B-ec.js} +2 -2
  4. package/dist/bin.js +21 -6
  5. package/dist/{comparison-CmVirWIW-UlEf2maz.js → comparison-CmVirWIW-Z8p6CfWL.js} +4 -1
  6. package/dist/config/bin.js +2 -2
  7. package/dist/constants-DXqV1vWL.js +77 -0
  8. package/dist/create/bin.js +29 -34
  9. package/dist/{define-config-XKYhw0xH.js → define-config-CeYkQCqG.js} +1 -1
  10. package/dist/{define-config-BGCfAiIo.cjs → define-config-jt2Hyhp2.cjs} +1 -1
  11. package/dist/define-config.cjs +1 -1
  12. package/dist/define-config.js +1 -1
  13. package/dist/{editor-BVaNnIey.js → editor-C0U0Ymqk.js} +213 -83
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/lint-plugins.cjs +1 -1
  17. package/dist/migration/bin.js +9 -8
  18. package/dist/{oxlint-plugin-config-5hVqz4kj.js → oxlint-plugin-config-DvBRM_Se.js} +1 -1
  19. package/dist/oxlint-plugin.js +2 -2
  20. package/dist/pack-bin.js +1 -1
  21. package/dist/{package-DLUCo6L_.js → package-CK48ZXBV.js} +1 -1
  22. package/dist/{constants-D5f7inVN.js → package-Cc9gI1u1.js} +2 -77
  23. package/dist/{package-overrides-Ci8GXouY.js → package-overrides-nw4zcITi.js} +1 -1
  24. package/dist/{prompts-DLpJGhfK.js → prompts-JkuWOV60.js} +9 -5
  25. package/dist/{resolve-vite-config-D7IUZYKq.js → resolve-vite-config-CfUvxuCo.js} +1 -1
  26. package/dist/{resolve-vite-config-D-JtjGRa.js → resolve-vite-config-x5QVnaf4.js} +2 -2
  27. package/dist/staged/bin.js +1 -1
  28. package/dist/sync-versions/bin.js +1 -1
  29. package/dist/toolchain.js +7 -7
  30. package/dist/toolchain.json +7 -7
  31. package/dist/{tsconfig-DLERIAbF.js → tsconfig-CZlh956U.js} +1 -1
  32. package/dist/{tsconfig-D3DiCiW6.js → tsconfig-DUR3fhIX.js} +2 -2
  33. package/dist/user-agent-CpEaSTwI.js +6 -0
  34. package/dist/version.js +3 -2
  35. package/dist/versions.js +3 -3
  36. package/dist/vpx-bin.js +2 -0
  37. package/docs/config/run.md +8 -7
  38. package/docs/guide/automatic-data-tracking.md +138 -0
  39. package/docs/guide/check.md +13 -0
  40. package/docs/guide/global-cli.md +12 -2
  41. package/docs/guide/migrate-rules.md +3 -1
  42. package/docs/guide/migrate.md +4 -4
  43. package/docs/guide/run.md +22 -0
  44. package/package.json +17 -17
@@ -1,6 +1,5 @@
1
- import { createRequire } from "node:module";
2
1
  // package.json
3
- var version = "1.5.1";
2
+ var version = "1.6.0";
4
3
  var exports = {
5
4
  ".": {
6
5
  "types": "./dist/index.d.ts",
@@ -281,78 +280,4 @@ var exports = {
281
280
  }
282
281
  };
283
282
  var engines = { "node": "^22.18.0 || ^24.11.0 || >=26.0.0" };
284
- // src/utils/constants.ts
285
- const VITE_PLUS_NAME = "vite-plus";
286
- const VITE_PLUS_VERSION = process.env.VP_VERSION || version;
287
- const VITE_CONFIG_FILES = [
288
- "vite.config.js",
289
- "vite.config.mjs",
290
- "vite.config.ts",
291
- "vite.config.cjs",
292
- "vite.config.mts",
293
- "vite.config.cts"
294
- ];
295
- const VITEST_VERSION = "5.1.0";
296
- const SETUP_VP_VERSION = "v1.21.2";
297
- const TSDOWN_MIGRATION_SKILL_URL = "https://github.com/rolldown/tsdown/blob/main/skills/tsdown-migrate/SKILL.md";
298
- const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
299
- vite: `npm:@voidzero-dev/vite-plus-core@${VITE_PLUS_VERSION}`,
300
- vitest: VITEST_VERSION
301
- };
302
- /**
303
- * Package-name patterns the migrator exempts from a package manager's
304
- * "minimum release age" gate (pnpm `minimumReleaseAgeExclude` / Yarn
305
- * `npmPreapprovedPackages`).
306
- *
307
- * Vite+ pins `vitest` to an exact, sometimes freshly published version, and the
308
- * in-tree `@vitest/*` siblings install transitively at that same version, so an
309
- * age gate would otherwise quarantine the Vite+-managed family and break
310
- * `vp install`. The `@vitest/*` glob also covers the optional `@vitest/browser-*`
311
- * peers the migrator pins for browser projects. This does NOT pin or manage any
312
- * package — it only lets the chosen versions through the user's gate, including
313
- * the `@vitest/coverage-*` version the coverage guard asks the user to align to
314
- * the bundled vitest.
315
- */
316
- const VITEST_AGE_GATE_EXEMPT_PACKAGES = ["vitest", "@vitest/*"];
317
- /**
318
- * When VP_FORCE_MIGRATE is set, force full dependency rewriting
319
- * even for projects already using vite-plus. Used by ecosystem CI to
320
- * override dependencies with locally built tgz packages.
321
- */
322
- function isForceOverrideMode() {
323
- return process.env.VP_FORCE_MIGRATE === "1";
324
- }
325
- const require = createRequire(import.meta.url);
326
- function resolve(path) {
327
- return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
328
- }
329
- /**
330
- * Like {@link resolve}, but prefers the copy shipped with the CLI
331
- * (`import.meta.dirname`) over the project's (`process.cwd()`).
332
- *
333
- * Use this for runtime modules that MUST match what `vite-plus/test*`
334
- * imports resolve to — chiefly the Vitest runner binary. The `vite-plus/test`
335
- * shims `export * from 'vitest'`, which Node resolves to vite-plus's own
336
- * bundled (pinned) Vitest. If `vp test` instead spawned a project-local
337
- * Vitest (a different physical copy/version), the runner and the imported
338
- * `vi`/`expect`/runner internals would come from two distinct Vitest
339
- * modules — a classic source of Vitest internal-state and mock-hoisting
340
- * mismatches. `process.cwd()` stays as a fallback for layouts where the
341
- * bundled copy is somehow unreachable, so this is never worse than {@link resolve}.
342
- */
343
- function resolveBundled(path) {
344
- return require.resolve(path, { paths: [import.meta.dirname, process.cwd()] });
345
- }
346
- const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: a tsconfig file contains baseUrl which is not yet supported by the oxlint type checker.\n Run `vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>` to remove baseUrl from your tsconfig.";
347
- const BASEURL_TSCONFIG_FIX_PACKAGE = "@andrewbranch/ts5to6";
348
- const BASEURL_TSCONFIG_FIX_FLAG = "--fixBaseUrl";
349
- function createBaseUrlTsconfigFixArgs(target = ".") {
350
- return [BASEURL_TSCONFIG_FIX_FLAG, target];
351
- }
352
- const DEFAULT_ENVS = {
353
- JS_RUNTIME_VERSION: process.versions.node,
354
- JS_RUNTIME_NAME: process.release.name,
355
- NODE_PACKAGE_MANAGER: "vite-plus"
356
- };
357
- const CONFIG_METADATA_ENV = "VP_RESOLVING_CONFIG_METADATA";
358
- export { engines as _, SETUP_VP_VERSION as a, VITEST_VERSION as c, VITE_PLUS_OVERRIDE_PACKAGES as d, VITE_PLUS_VERSION as f, resolveBundled as g, resolve as h, DEFAULT_ENVS as i, VITE_CONFIG_FILES as l, isForceOverrideMode as m, BASEURL_TSCONFIG_WARNING as n, TSDOWN_MIGRATION_SKILL_URL as o, createBaseUrlTsconfigFixArgs as p, CONFIG_METADATA_ENV as r, VITEST_AGE_GATE_EXEMPT_PACKAGES as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, VITE_PLUS_NAME as u, exports as v, version as y };
283
+ export { exports as n, version as r, engines as t };
@@ -1,4 +1,4 @@
1
- import { a as GREATER_LESS_THAN, b as safeRegex, c as LOOSE_PLAIN, d as XRANGE_PLAIN, f as XRANGE_PLAIN_LOOSE, g as formatComparableVersion, i as FULL_PLAIN, m as compareParsed, o as LONE_CARET, s as LONE_TILDE, t as BUILD, x as tryParse, y as parse } from "./comparison-CmVirWIW-UlEf2maz.js";
1
+ import { S as tryParse, a as GREATER_LESS_THAN, b as parse, c as LOOSE_PLAIN, d as XRANGE_PLAIN, f as XRANGE_PLAIN_LOOSE, g as formatComparableVersion, i as FULL_PLAIN, m as compareParsed, o as LONE_CARET, s as LONE_TILDE, t as BUILD, x as safeRegex } from "./comparison-CmVirWIW-Z8p6CfWL.js";
2
2
  // ../../node_modules/.pnpm/verkit@0.5.0/node_modules/verkit/dist/set-BGFWKKE8.js
3
3
  const STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
4
4
  const LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
@@ -1,10 +1,10 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DegdyBIC.js";
2
- import { _ as isGreaterThanOrEqual, b as safeRegex, g as formatComparableVersion, l as PRERELEASE, n as COERCE, r as COERCE_FULL, u as PRERELEASE_LOOSE, x as tryParse, y as parse } from "./comparison-CmVirWIW-UlEf2maz.js";
2
+ import { S as tryParse, _ as isGreaterThanOrEqual, b as parse, g as formatComparableVersion, l as PRERELEASE, n as COERCE, r as COERCE_FULL, u as PRERELEASE_LOOSE, x as safeRegex } from "./comparison-CmVirWIW-Z8p6CfWL.js";
3
3
  import { i as runCommandSilently, n as getVpCommand } from "./command-rY79K5NI.js";
4
4
  import { a as writeJsonFile, i as readJsonFile } from "./json-kl84kDyH.js";
5
5
  import { t as accent } from "./terminal-BcuPUy-j.js";
6
6
  import { t as require_dist } from "./dist-Bs0SObNC.js";
7
- import { f as VITE_PLUS_VERSION } from "./constants-D5f7inVN.js";
7
+ import { f as VITE_PLUS_VERSION } from "./constants-DXqV1vWL.js";
8
8
  import path from "node:path";
9
9
  import { downloadPackageManager } from "../binding/index.js";
10
10
  import { stripVTControlCharacters, styleText } from "node:util";
@@ -2504,13 +2504,14 @@ async function selectPackageManager(interactive, silent = false) {
2504
2504
  return PackageManager.pnpm;
2505
2505
  }
2506
2506
  }
2507
- async function downloadPackageManager$1(packageManager, version, interactive, silent = false, cwd) {
2507
+ async function downloadPackageManager$1(packageManager, version, interactive, silent = false, cwd, expectedHash) {
2508
2508
  const spinner = silent ? getSilentSpinner() : getSpinner(interactive);
2509
2509
  spinner.start(`${packageManager}@${version} installing...`);
2510
2510
  const downloadResult = await downloadPackageManager({
2511
2511
  name: packageManager,
2512
2512
  version,
2513
- cwd
2513
+ cwd,
2514
+ expectedHash
2514
2515
  });
2515
2516
  spinner.stop(`${packageManager}@${downloadResult.version} installed`);
2516
2517
  return downloadResult;
@@ -2530,7 +2531,10 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
2530
2531
  const { exitCode, stderr, stdout } = await runCommandSilently({
2531
2532
  ...getVpCommand(["install", ...installArgs]),
2532
2533
  cwd,
2533
- envs: process.env
2534
+ envs: options?.packageManagerOverride ? {
2535
+ ...process.env,
2536
+ VP_PACKAGE_MANAGER: options.packageManagerOverride
2537
+ } : process.env
2534
2538
  });
2535
2539
  const combinedOutput = `${stdout.toString()}\n${stderr.toString()}`;
2536
2540
  const pendingBuilds = detectIgnoredBuilds ? parseInstallGatedBuilds(combinedOutput, options?.packageManager) : void 0;
@@ -1 +1 @@
1
- export { i as resolveUniversalViteConfig } from "./resolve-vite-config-D-JtjGRa.js";
1
+ export { i as resolveUniversalViteConfig } from "./resolve-vite-config-x5QVnaf4.js";
@@ -1,5 +1,5 @@
1
- import { d as withConfigMetadataResolution } from "./define-config-XKYhw0xH.js";
2
- import { l as VITE_CONFIG_FILES } from "./constants-D5f7inVN.js";
1
+ import { d as withConfigMetadataResolution } from "./define-config-CeYkQCqG.js";
2
+ import { l as VITE_CONFIG_FILES } from "./constants-DXqV1vWL.js";
3
3
  import path from "node:path";
4
4
  import { findMonorepoRoot } from "../binding/index.js";
5
5
  import fs from "node:fs";
@@ -1,6 +1,6 @@
1
1
  import { r as __toESM } from "../rolldown-runtime-DegdyBIC.js";
2
2
  import { t as require_picomatch } from "../picomatch-DEUoj81q.js";
3
- import { a as resolveViteConfig } from "../resolve-vite-config-D-JtjGRa.js";
3
+ import { a as resolveViteConfig } from "../resolve-vite-config-x5QVnaf4.js";
4
4
  import { t as unwrapCliParseOutcome } from "../cli-parse-aeUeFDlC.js";
5
5
  import { i as log, n as errorMsg, o as printHeader } from "../terminal-BcuPUy-j.js";
6
6
  import { createRequire } from "node:module";
@@ -1,5 +1,5 @@
1
1
  import { c as modify, l as parse$1, o as applyEdits, t as detectFormattingOptions } from "../json-kl84kDyH.js";
2
- import { i as normalizeRange, t as extractOverrideTargetName } from "../package-overrides-Ci8GXouY.js";
2
+ import { i as normalizeRange, t as extractOverrideTargetName } from "../package-overrides-nw4zcITi.js";
3
3
  import { t as require_dist } from "../dist-Bs0SObNC.js";
4
4
  import { n as isAlignableVitestEcosystemPackage } from "../vitest-ecosystem-BeEYz-qF.js";
5
5
  import path from "node:path";
package/dist/toolchain.js CHANGED
@@ -4,7 +4,7 @@ export const toolchain = {
4
4
  {
5
5
  "id": "vite-plus",
6
6
  "name": "vite-plus",
7
- "version": "1.5.1",
7
+ "version": "1.6.0",
8
8
  "kind": "package",
9
9
  "delivery": [
10
10
  "dependency"
@@ -14,7 +14,7 @@ export const toolchain = {
14
14
  {
15
15
  "id": "vite-plus-core",
16
16
  "name": "@voidzero-dev/vite-plus-core",
17
- "version": "1.5.1",
17
+ "version": "1.6.0",
18
18
  "kind": "package",
19
19
  "delivery": [
20
20
  "dependency"
@@ -57,7 +57,7 @@ export const toolchain = {
57
57
  {
58
58
  "id": "oxlint",
59
59
  "name": "oxlint",
60
- "version": "1.91.0",
60
+ "version": "1.93.0",
61
61
  "kind": "tool",
62
62
  "delivery": [
63
63
  "dependency"
@@ -67,7 +67,7 @@ export const toolchain = {
67
67
  {
68
68
  "id": "oxfmt",
69
69
  "name": "oxfmt",
70
- "version": "0.76.0",
70
+ "version": "0.78.0",
71
71
  "kind": "tool",
72
72
  "delivery": [
73
73
  "dependency"
@@ -77,7 +77,7 @@ export const toolchain = {
77
77
  {
78
78
  "id": "oxlint-tsgolint",
79
79
  "name": "oxlint-tsgolint",
80
- "version": "7.0.2005",
80
+ "version": "7.0.2006",
81
81
  "kind": "tool",
82
82
  "delivery": [
83
83
  "dependency"
@@ -99,8 +99,8 @@ export const toolchain = {
99
99
  {
100
100
  "id": "vite-task",
101
101
  "name": "vite-task",
102
- "revision": "40cb9cac46bddbf8aa5ce5373df1a6a1980acc38",
103
- "builtAt": "2026-11-09T12:28:42Z",
102
+ "revision": "cb1ea8d214b26a0f3ca2b2ef3b6bc471b18ffacb",
103
+ "builtAt": "2026-11-11T03:47:01Z",
104
104
  "kind": "tool",
105
105
  "delivery": [
106
106
  "compiled"
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "id": "vite-plus",
6
6
  "name": "vite-plus",
7
- "version": "1.5.1",
7
+ "version": "1.6.0",
8
8
  "kind": "package",
9
9
  "delivery": [
10
10
  "dependency"
@@ -14,7 +14,7 @@
14
14
  {
15
15
  "id": "vite-plus-core",
16
16
  "name": "@voidzero-dev/vite-plus-core",
17
- "version": "1.5.1",
17
+ "version": "1.6.0",
18
18
  "kind": "package",
19
19
  "delivery": [
20
20
  "dependency"
@@ -57,7 +57,7 @@
57
57
  {
58
58
  "id": "oxlint",
59
59
  "name": "oxlint",
60
- "version": "1.91.0",
60
+ "version": "1.93.0",
61
61
  "kind": "tool",
62
62
  "delivery": [
63
63
  "dependency"
@@ -67,7 +67,7 @@
67
67
  {
68
68
  "id": "oxfmt",
69
69
  "name": "oxfmt",
70
- "version": "0.76.0",
70
+ "version": "0.78.0",
71
71
  "kind": "tool",
72
72
  "delivery": [
73
73
  "dependency"
@@ -77,7 +77,7 @@
77
77
  {
78
78
  "id": "oxlint-tsgolint",
79
79
  "name": "oxlint-tsgolint",
80
- "version": "7.0.2005",
80
+ "version": "7.0.2006",
81
81
  "kind": "tool",
82
82
  "delivery": [
83
83
  "dependency"
@@ -99,8 +99,8 @@
99
99
  {
100
100
  "id": "vite-task",
101
101
  "name": "vite-task",
102
- "revision": "40cb9cac46bddbf8aa5ce5373df1a6a1980acc38",
103
- "builtAt": "2026-11-09T12:28:42Z",
102
+ "revision": "cb1ea8d214b26a0f3ca2b2ef3b6bc471b18ffacb",
103
+ "builtAt": "2026-11-11T03:47:01Z",
104
104
  "kind": "tool",
105
105
  "delivery": [
106
106
  "compiled"
@@ -1 +1 @@
1
- export { i as fixBaseUrlInTsconfig, a as hasBaseUrlInTsconfig } from "./tsconfig-D3DiCiW6.js";
1
+ export { i as fixBaseUrlInTsconfig, a as hasBaseUrlInTsconfig } from "./tsconfig-DUR3fhIX.js";
@@ -1,8 +1,8 @@
1
- import { C as confirm, M as isCancel, T as log, t as cancelAndExit } from "./prompts-DLpJGhfK.js";
1
+ import { C as confirm, M as isCancel, T as log, t as cancelAndExit } from "./prompts-JkuWOV60.js";
2
2
  import { c as modify, l as parse, o as applyEdits } from "./json-kl84kDyH.js";
3
3
  import { t as vitest_v5_entry_points_default } from "./vitest-v5-entry-points-NyJsFeux.js";
4
4
  import { i as runCommandSilently, n as getVpCommand } from "./command-rY79K5NI.js";
5
- import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-D5f7inVN.js";
5
+ import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-DXqV1vWL.js";
6
6
  import path from "node:path";
7
7
  import { styleText } from "node:util";
8
8
  import fs from "node:fs";
@@ -0,0 +1,6 @@
1
+ import { r as version } from "./package-Cc9gI1u1.js";
2
+ // src/utils/user-agent.ts
3
+ function setUserAgent() {
4
+ process.env.VP_USER_AGENT = `vp/${version}`;
5
+ }
6
+ export { setUserAgent as t };
package/dist/version.js CHANGED
@@ -1,6 +1,7 @@
1
- import { y as version } from "./constants-D5f7inVN.js";
1
+ import { r as version } from "./package-Cc9gI1u1.js";
2
+ import "./constants-DXqV1vWL.js";
2
3
  import { t as renderCliDoc } from "./help-B03t_iQ4.js";
3
- import { a as hasVitePlusDependency, n as detectPackageMetadata } from "./package-DLUCo6L_.js";
4
+ import { a as hasVitePlusDependency, n as detectPackageMetadata } from "./package-CK48ZXBV.js";
4
5
  import { i as log, o as printHeader, t as accent } from "./terminal-BcuPUy-j.js";
5
6
  import path from "node:path";
6
7
  import { pathToFileURL } from "node:url";
package/dist/versions.js CHANGED
@@ -2,8 +2,8 @@ export const versions = {
2
2
  "vite": "8.3.7",
3
3
  "rolldown": "1.2.18",
4
4
  "vitest": "5.1.0",
5
- "oxfmt": "0.76.0",
6
- "oxlint": "1.91.0",
7
- "oxlint-tsgolint": "7.0.2005",
5
+ "oxfmt": "0.78.0",
6
+ "oxlint": "1.93.0",
7
+ "oxlint-tsgolint": "7.0.2006",
8
8
  "tsdown": "0.23.4"
9
9
  };
package/dist/vpx-bin.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-DegdyBIC.js";
2
2
  import { a as require_cross_spawn, t as exitCodeFromClose } from "./command-rY79K5NI.js";
3
+ import { t as setUserAgent } from "./user-agent-CpEaSTwI.js";
3
4
  import { a as canExecDirectly, c as nodeModulesBinPaths, l as packageInvocation, o as detectScript, r as ScriptError, s as isFile, u as parseVpxArgs } from "./vpx-script-EXgV5QOf.js";
4
5
  import { createRequire } from "node:module";
5
6
  import path from "node:path";
@@ -8,6 +9,7 @@ import { styleText } from "node:util";
8
9
  import { statSync } from "node:fs";
9
10
  // src/vpx-bin.ts
10
11
  var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
12
+ setUserAgent();
11
13
  function errorMsg(message) {
12
14
  console.error(styleText(["red", "bold"], "error:"), message);
13
15
  }
@@ -265,11 +265,12 @@ Vite Task automatically detects which files a command uses. See [Automatic Data
265
265
 
266
266
  ```ts [vite.config.ts]
267
267
  tasks: {
268
- build: {
269
- command: 'vp build',
268
+ lint: {
269
+ command: 'vp lint',
270
270
  cache: {
271
271
  // Use `{ auto: true }` to use automatic fingerprinting (default).
272
- input: [{ auto: true }, '!**/*.tsbuildinfo', '!dist/**'],
272
+ // Keep the build task's `dist` folder from affecting this task.
273
+ input: [{ auto: true }, '!dist/**'],
273
274
  },
274
275
  },
275
276
  }
@@ -348,14 +349,14 @@ tasks: {
348
349
 
349
350
  Use `{ auto: true }` to keep automatic write tracking while adding explicit output globs.
350
351
 
351
- This is useful when a task writes files that should not be restored from the cache. For example, exclude TypeScript `.tsbuildinfo` files:
352
+ This is useful when a task writes files that should not be restored from the cache, such as a debug log:
352
353
 
353
354
  ```ts [vite.config.ts]
354
355
  tasks: {
355
- typecheck: {
356
- command: 'tsc --build',
356
+ build: {
357
+ command: 'node build.mjs',
357
358
  cache: {
358
- output: [{ auto: true }, '!*.tsbuildinfo'],
359
+ output: [{ auto: true }, '!build.log'],
359
360
  },
360
361
  },
361
362
  }
@@ -39,6 +39,144 @@ For this task, Vite Task records source files, config files, missing files the c
39
39
 
40
40
  File system tracking also tracks outputs. If you omit [`cache.output`](/config/run#cache-output), Vite Task archives files the command writes after a successful run and restores them on a cache hit.
41
41
 
42
+ ### Rebuildable Inputs
43
+
44
+ Some tools read files they also write:
45
+
46
+ - With [`exports`](https://tsdown.dev/options/package-exports) enabled, tsdown reads `package.json` and writes the generated `exports` field back into it.
47
+ - Many build tools list `dist` to delete the old build before they write a new one there.
48
+ - Tools with their own cache read it and write it back, as `tsc --incremental` does with `tsconfig.tsbuildinfo`.
49
+
50
+ This section explains how Vite Task handles files and folders that a task both reads and writes.
51
+
52
+ Vite Task calls these files and folders **rebuildable**: the task produces them itself, so they don't have to exist before it runs. A task can rebuild:
53
+
54
+ - Files it writes, such as `dist/index.mjs` or the `package.json` that tsdown updates.
55
+ - Folders where the task wrote everything inside, such as `dist`.
56
+
57
+ ::: warning
58
+ Rebuildable inputs assume that a task doesn't keep changing its outputs when its inputs stay the same.
59
+
60
+ For example, a script that appends data to a file on every run breaks this assumption, and Vite Task can't detect it. Vite Task caches the file as the script left it, so the next run is a cache hit that restores the file without appending anything.
61
+ :::
62
+
63
+ After the task finishes, Vite Task fingerprints its inputs as the task left them. On the next run:
64
+
65
+ - A rebuildable input may be missing, as on a fresh clone or after you delete it. The cache still hits and restores it with the task's outputs.
66
+ - A rebuildable file that exists must match what the task left. If something else changed it, the cache misses.
67
+ - Inputs that aren't rebuildable, such as your source files, are still checked strictly. Deleting or editing one causes a cache miss.
68
+
69
+ #### Example: A Task Rewriting Sources
70
+
71
+ ```ts [vite.config.ts]
72
+ tasks: {
73
+ build: {
74
+ // `--exports` makes tsdown write the generated `exports` field into package.json.
75
+ command: 'tsdown --exports',
76
+ },
77
+ }
78
+ ```
79
+
80
+ ```
81
+ my-lib/
82
+ ├── src/
83
+ │ └── index.ts # input: tsdown reads it
84
+ └── package.json # rebuildable: tsdown reads it, then writes "exports" into it
85
+ ```
86
+
87
+ On the next run, Vite Task compares `package.json` with the file tsdown wrote, so the `exports` field that tsdown added doesn't cause a cache miss:
88
+
89
+ ```bash
90
+ $ vp run build # first run: tsdown adds "exports" to package.json
91
+ $ vp run build # cache hit
92
+ ```
93
+
94
+ Editing `package.json` yourself still causes a cache miss, as it should, because tsdown has to run again with your changes:
95
+
96
+ ```bash
97
+ $ vp pm pkg set version=1.1.0
98
+ $ vp run build # cache miss: 'package.json' modified
99
+ ```
100
+
101
+ #### Example: A Task Listing Its Output Folder For Deletion
102
+
103
+ ```ts [vite.config.ts]
104
+ tasks: {
105
+ build: {
106
+ // `--clean` deletes the old build in `dist` before tsdown writes a new one.
107
+ command: 'tsdown --clean',
108
+ },
109
+ }
110
+ ```
111
+
112
+ ```
113
+ my-lib/
114
+ ├── src/
115
+ │ └── index.ts # input
116
+ ├── package.json # input
117
+ └── dist/ # rebuildable: the task wrote everything inside
118
+ └── index.mjs # rebuildable: the task writes it
119
+ ```
120
+
121
+ Listing `dist` makes it an input. Since the task wrote everything inside `dist`, the whole folder is rebuildable:
122
+
123
+ ```bash
124
+ $ vp run build # first run: tsdown writes dist/
125
+ $ rm -rf dist # as on a fresh clone
126
+ $ vp run build # cache hit: dist/ is restored
127
+ ```
128
+
129
+ You don't need `'!dist/**'` in `cache.input` to keep `dist` out of the task's inputs, even though the task lists `dist` to delete the old build and then writes a new one.
130
+
131
+ #### Example: A Task Reading And Writing Its Own Cache
132
+
133
+ ```ts [vite.config.ts]
134
+ tasks: {
135
+ typecheck: {
136
+ command: 'tsc --incremental --noEmit',
137
+ },
138
+ }
139
+ ```
140
+
141
+ ```
142
+ my-app/
143
+ ├── src/
144
+ │ └── main.ts # input: tsc reads it
145
+ ├── tsconfig.json # input: tsc reads it
146
+ └── tsconfig.tsbuildinfo # rebuildable: tsc reads its cache from it, then writes it back
147
+ ```
148
+
149
+ Vite Task compares `tsconfig.tsbuildinfo` with the file tsc wrote, so tsc's updates to it don't cause a cache miss. If the file is missing, as on a fresh clone, a cache hit restores it:
150
+
151
+ ```bash
152
+ $ vp run typecheck # first run: tsc writes tsconfig.tsbuildinfo
153
+ $ vp run typecheck # cache hit
154
+ $ rm tsconfig.tsbuildinfo # as on a fresh clone
155
+ $ vp run typecheck # cache hit: tsconfig.tsbuildinfo is restored
156
+ ```
157
+
158
+ #### Avoid Caching Tasks That Modify Files In Place
159
+
160
+ A task that rewrites your source files makes them rebuildable. If a cached `vp fmt` rewrites every file in `src/utils`, the whole folder becomes rebuildable:
161
+
162
+ ```
163
+ src/
164
+ └── utils/ # rebuildable: vp fmt rewrote everything inside
165
+ ├── a.ts # rebuildable: vp fmt rewrote it
166
+ └── b.ts # rebuildable: vp fmt rewrote it
167
+ ```
168
+
169
+ Deleting `src/utils` is then a cache hit that writes the folder back.
170
+
171
+ Turn off auto-fix in the lint and format tasks you cache:
172
+
173
+ ```ts [vite.config.ts]
174
+ tasks: {
175
+ lint: 'vp lint', // instead of `vp lint --fix`
176
+ format: 'vp fmt --check', // instead of `vp fmt`
177
+ }
178
+ ```
179
+
42
180
  ### Limitations
43
181
 
44
182
  Vite Task cannot track environment variable reads, and it cannot always tell which tracked paths are stable inputs, generated outputs, or tool-managed cache paths that should not become inputs or outputs.
@@ -15,6 +15,7 @@ We recommend turning both `typeAware` and `typeCheck` on so `vp check` becomes t
15
15
  ```bash
16
16
  vp check
17
17
  vp check --fix # Format and run autofixers.
18
+ vp check --continue-on-error # Report all enabled checks, even if formatting fails.
18
19
  vp check --quiet # Hide lint warnings; still report and fail on errors.
19
20
  vp check --deny-warnings # Treat lint warnings as errors.
20
21
  vp check --no-fmt # Skip format; run lint (and type-check if enabled).
@@ -24,6 +25,18 @@ vp check --no-fmt --no-lint # Type-check only (requires both `typeAware` and `ty
24
25
 
25
26
  If formatting fails, `vp check` stops before lint and type checks run. To fix formatting and apply available lint fixes, run `vp check --fix`. This command changes files. To skip formatting and run the remaining enabled checks, run `vp check --no-fmt`.
26
27
 
28
+ Use `vp check --continue-on-error` to run all enabled checks and report formatting, lint,
29
+ and type errors in one invocation without modifying files. Type checks still
30
+ require the existing `lint.options.typeAware` and `lint.options.typeCheck` settings.
31
+ The command exits with a non-zero status if any check fails, even when later
32
+ checks pass. Without `--continue-on-error`, the existing fail-fast behavior is preserved.
33
+
34
+ `--continue-on-error` also works with `--fix`: checks continue after a tool reports a
35
+ failure, and formatting runs again after lint fixes. The first failing exit status
36
+ is preserved. Options such as `--no-fmt`, `--no-lint`, `--quiet`, and
37
+ `--deny-warnings` retain their usual behavior. Configuration loading or command
38
+ startup errors still abort the command.
39
+
27
40
  Put `vp check` flags before file paths. For example, use `vp check --fix src/index.ts`. Arguments after the first path go to the format and lint tools instead of `vp check`.
28
41
 
29
42
  ## Configuration
@@ -83,9 +83,9 @@ vp help
83
83
 
84
84
  When you enable environment management during installation, Vite+ records managed mode for Node.js and the npm, pnpm, Yarn, and Bun shims. Run `vp env off` to prefer system tools, or scope the change with `vp env off node` or `vp env off pm`.
85
85
 
86
- ::: details Installer Environment Variables & Options
86
+ ::: details Environment Variables & Options
87
87
 
88
- The Vite+ installers (`vp-setup.exe`, `install.ps1`, and `install.sh`) and the installed `vp` CLI read the environment variables below.
88
+ The Vite+ installers (`vp-setup.exe`, `install.ps1`, and `install.sh`) and the CLI use the environment variables below for installation, runtime configuration, and child tools.
89
89
 
90
90
  ### Installation Variables
91
91
 
@@ -331,6 +331,16 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
331
331
 
332
332
  Vite+ sets additional `VP_*` variables during shim dispatch and shell integration (recursion guards, active-version records, wrapper flags); do not set them manually.
333
333
 
334
+ ### Child Process Variables
335
+
336
+ These variables are set by Vite+ for tools it starts.
337
+
338
+ #### `VP_USER_AGENT`
339
+
340
+ `vp`, `vpr`, and `vpx` set `VP_USER_AGENT=vp/<version>` for their child processes. This works with both the global CLI and the project-local `vite-plus` package. Each invocation reports its own version; when the global CLI delegates to a local CLI, the local version takes over.
341
+
342
+ Use this variable to detect Vite+ even when an underlying package manager replaces `npm_config_user_agent`. Read the first space-separated product token (`vp/<version>`) so consumers can tolerate additional fields in future versions. The value identifies the CLI, not the command or its arguments. Ordinary tool shims, such as `node`, `npm`, and `npx`, preserve an inherited value without creating one.
343
+
334
344
  ### TLS/CA Configuration
335
345
 
336
346
  #### `SSL_CERT_FILE` / `NODE_EXTRA_CA_CERTS`
@@ -398,7 +398,9 @@ Migration converts the Volta `volta.node` pin to `.node-version`, because Vite+
398
398
 
399
399
  ### Bun
400
400
 
401
- - Bun catalogs only resolve inside a workspace (a root `package.json` with a non-empty `workspaces`). In a bun workspace, existing top-level or workspace catalog locations and named catalog references are preserved. A standalone (single-package) bun project keeps concrete specs and gets no catalog field, because `bun install` cannot resolve `catalog:` outside a workspace.
401
+ - Bun catalogs only resolve inside a workspace, which is a root `package.json` with a `workspaces` field. An empty `workspaces` field also counts. In a bun workspace, existing top-level or workspace catalog locations and named catalog references are preserved. A standalone bun project without `workspaces` keeps concrete specs and gets no catalog field, because `bun install` cannot resolve `catalog:` outside a workspace.
402
+ - Bun before 1.2.21 reads only catalogs under `workspaces`. On those versions, migration uses catalogs only when the project already has one under `workspaces`, and keeps concrete specs otherwise.
403
+ - When an existing named catalog already owns `vite-plus`, `vite`, or `vitest`, migration adds missing toolchain entries to that catalog instead of creating a default catalog beside it.
402
404
  - The core alias is mirrored as a direct `vite` dependency so Bun sees the peer provider before applying overrides.
403
405
 
404
406
  ## After the Migration
@@ -95,21 +95,21 @@ Upgrade the [global CLI](./upgrade.md#global-vp) to your target 1.0 release, the
95
95
 
96
96
  ### Without the Global CLI
97
97
 
98
- Use an existing Node.js runtime that satisfies `^22.18.0 || ^24.11.0 || >=26.0.0`. Run the target migrator through your package manager without adding it to the project first. For the `1.5.1` release:
98
+ Use an existing Node.js runtime that satisfies `^22.18.0 || ^24.11.0 || >=26.0.0`. Run the target migrator through your package manager without adding it to the project first. For the `1.6.0` release:
99
99
 
100
100
  ::: code-group
101
101
 
102
102
  ```bash [pnpm]
103
- pnpm dlx --package=vite-plus@1.5.1 vp migrate --no-interactive
103
+ pnpm dlx --package=vite-plus@1.6.0 vp migrate --no-interactive
104
104
  ```
105
105
 
106
106
  ```bash [npm]
107
- npx --package=vite-plus@1.5.1 vp migrate --no-interactive
107
+ npx --package=vite-plus@1.6.0 vp migrate --no-interactive
108
108
  ```
109
109
 
110
110
  :::
111
111
 
112
- Replace `1.5.1` with your target release. For a preview, use the version from the PR and pass `--registry=https://registry-bridge.viteplus.dev` to `pnpm` or `npx` before the `vp` command. Keep the version in `--package` explicit so you run the target migrator rather than the old local CLI.
112
+ Replace `1.6.0` with your target release. For a preview, use the version from the PR and pass `--registry=https://registry-bridge.viteplus.dev` to `pnpm` or `npx` before the `vp` command. Keep the version in `--package` explicit so you run the target migrator rather than the old local CLI.
113
113
 
114
114
  After migration, finish dependency installation and validate with the updated local CLI:
115
115