vite-plus 0.3.2 → 1.0.0-rc.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 (149) hide show
  1. package/LICENSE +35 -146
  2. package/README.md +3 -3
  3. package/binding/index.cjs +140 -55
  4. package/binding/index.d.cts +49 -0
  5. package/dist/{agent-C59HKB4Y.js → agent-Dinpyd-k.js} +6 -5
  6. package/dist/bin.js +48 -18
  7. package/dist/config/bin.js +2 -2
  8. package/dist/constants-CiKwrA0v.js +356 -0
  9. package/dist/create/bin.js +96 -71
  10. package/dist/{define-config-DPNEJxPz.d.ts → define-config-B9usMnEa.d.ts} +51 -10
  11. package/dist/{define-config-DpAPETDf.cjs → define-config-CBccpane.cjs} +173 -44
  12. package/dist/{define-config-DAaCa0U_.js → define-config-jhuYJ7Tb.js} +158 -42
  13. package/dist/define-config.cjs +1 -1
  14. package/dist/define-config.d.ts +1 -1
  15. package/dist/define-config.js +1 -1
  16. package/dist/documentation-DqcZSthV.js +11 -0
  17. package/dist/{editor-QOIGtmH4.js → editor-DMBczTdj.js} +216 -152
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
  22. package/dist/lint-plugins.cjs +1 -1
  23. package/dist/migration/bin.js +3122 -15
  24. package/dist/{oxlint-plugin-config-BU42tr8y.js → oxlint-plugin-config-BgsDA6ua.js} +1 -1
  25. package/dist/oxlint-plugin.js +9 -7
  26. package/dist/pack-bin.js +1 -1
  27. package/dist/{package-BB-Jh_z3.js → package-B85H2Nw0.js} +6 -2
  28. package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
  29. package/dist/{prompts-CujFOJXu.js → prompts-CQobX7uP.js} +2 -2
  30. package/dist/{resolve-vite-config-CHHjsjKJ.js → resolve-vite-config-BUFUmi8h.js} +2 -2
  31. package/dist/{resolve-vite-config-6Nox70uP.js → resolve-vite-config-I8fmpR7I.js} +1 -1
  32. package/dist/staged/bin.js +1205 -3317
  33. package/dist/sync-versions/bin.js +3 -2
  34. package/dist/sync-versions/bin.mjs +17 -2
  35. package/dist/test/browser/context.js +1 -1
  36. package/dist/test/browser/providers/playwright/context.js +1 -1
  37. package/dist/test/browser/providers/preview/context.js +1 -1
  38. package/dist/test/browser-playwright/context.js +1 -1
  39. package/dist/test/browser-preview/context.js +1 -1
  40. package/dist/test/context.d.ts +2 -942
  41. package/dist/test/context.js +1 -1
  42. package/dist/test/internal/traces.js +1 -0
  43. package/dist/test/locators.d.ts +2 -294
  44. package/dist/test/matchers.d.ts +2 -29
  45. package/dist/test/mocker.d.ts +2 -0
  46. package/dist/test/mocker.js +1 -0
  47. package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
  48. package/dist/test/plugins/browser-context.js +1 -1
  49. package/dist/test/plugins/browser-locators.d.ts +2 -0
  50. package/dist/test/plugins/browser-playwright.d.ts +2 -0
  51. package/dist/test/plugins/browser-preview.d.ts +2 -0
  52. package/dist/test/plugins/browser.d.ts +2 -0
  53. package/dist/test/plugins/mocker-automock.d.ts +2 -0
  54. package/dist/test/plugins/mocker-browser.d.ts +2 -0
  55. package/dist/test/plugins/mocker-node.d.ts +2 -0
  56. package/dist/test/plugins/mocker-redirect.d.ts +2 -0
  57. package/dist/test/plugins/mocker-register.d.ts +2 -0
  58. package/dist/test/plugins/mocker-transforms.d.ts +2 -0
  59. package/dist/test/plugins/mocker.d.ts +2 -0
  60. package/dist/test/plugins/pretty-format.d.ts +2 -0
  61. package/dist/test/plugins/snapshot-environment.d.ts +2 -0
  62. package/dist/test/plugins/snapshot-manager.d.ts +2 -0
  63. package/dist/test/plugins/snapshot.d.ts +2 -0
  64. package/dist/test/plugins/spy.d.ts +2 -0
  65. package/dist/test/plugins/utils-constants.d.ts +2 -0
  66. package/dist/test/plugins/utils-diff.d.ts +2 -0
  67. package/dist/test/plugins/utils-display.d.ts +2 -0
  68. package/dist/test/plugins/utils-error.d.ts +2 -0
  69. package/dist/test/plugins/utils-helpers.d.ts +2 -0
  70. package/dist/test/plugins/utils-offset.d.ts +2 -0
  71. package/dist/test/plugins/utils-resolver.d.ts +2 -0
  72. package/dist/test/plugins/utils-serialize.d.ts +2 -0
  73. package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
  74. package/dist/test/plugins/utils-source-map.d.ts +2 -0
  75. package/dist/test/plugins/utils-timers.d.ts +2 -0
  76. package/dist/test/plugins/utils.d.ts +2 -0
  77. package/dist/toolchain.js +10 -10
  78. package/dist/toolchain.json +10 -10
  79. package/dist/{tsconfig-DCtWfQPA.js → tsconfig-Buo0RSzz.js} +8 -4
  80. package/dist/{tsconfig-MXktI3SX.js → tsconfig-C1VeTG9k.js} +1 -1
  81. package/dist/version.js +5 -3
  82. package/dist/versions.js +5 -5
  83. package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
  84. package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
  85. package/docs/config/fmt.md +2 -2
  86. package/docs/config/lint.md +2 -2
  87. package/docs/config/run.md +1 -1
  88. package/docs/config/staged.md +1 -2
  89. package/docs/guide/check.md +2 -0
  90. package/docs/guide/ci.md +28 -31
  91. package/docs/guide/commit-hooks.md +18 -34
  92. package/docs/guide/create.md +1 -2
  93. package/docs/guide/docker.md +20 -68
  94. package/docs/guide/env.md +47 -32
  95. package/docs/guide/fmt.md +4 -2
  96. package/docs/guide/global-cli.md +426 -0
  97. package/docs/guide/ide-integration.md +1 -2
  98. package/docs/guide/implode.md +14 -1
  99. package/docs/guide/index.md +38 -35
  100. package/docs/guide/install.md +18 -20
  101. package/docs/guide/lint.md +6 -10
  102. package/docs/guide/local-cli.md +123 -0
  103. package/docs/guide/migrate-rules.md +104 -297
  104. package/docs/guide/migrate.md +82 -59
  105. package/docs/guide/monorepo.md +5 -1
  106. package/docs/guide/run.md +1 -1
  107. package/docs/guide/test.md +2 -0
  108. package/docs/guide/troubleshooting.md +6 -11
  109. package/docs/guide/upgrade-project.md +61 -0
  110. package/docs/guide/upgrade.md +17 -62
  111. package/docs/guide/vitest-v5.md +221 -0
  112. package/package.json +67 -90
  113. package/bin/oxfmt +0 -33
  114. package/bin/oxlint +0 -38
  115. package/dist/cli-truncate-Bg3RDXpi.js +0 -865
  116. package/dist/constants-IhOditRA.js +0 -80
  117. package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
  118. package/dist/log-update-CoW8Z4Dl.js +0 -491
  119. package/dist/strip-ansi-C3wrWz9t.js +0 -853
  120. package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
  121. package/dist/test/browser/providers/webdriverio/context.js +0 -1
  122. package/dist/test/browser/providers/webdriverio.d.ts +0 -77
  123. package/dist/test/browser/providers/webdriverio.js +0 -1
  124. package/dist/test/browser-webdriverio/context.d.ts +0 -1
  125. package/dist/test/browser-webdriverio.d.ts +0 -77
  126. package/dist/test/browser-webdriverio.js +0 -1
  127. package/dist/test/coverage.d.ts +0 -2
  128. package/dist/test/coverage.js +0 -1
  129. package/dist/test/environments.d.ts +0 -2
  130. package/dist/test/environments.js +0 -1
  131. package/dist/test/plugins/browser-webdriverio.js +0 -1
  132. package/dist/test/plugins/expect.js +0 -1
  133. package/dist/test/plugins/runner-types.js +0 -1
  134. package/dist/test/plugins/runner-utils.js +0 -1
  135. package/dist/test/plugins/runner.js +0 -1
  136. package/dist/test/reporters.d.ts +0 -2
  137. package/dist/test/reporters.js +0 -1
  138. package/dist/test/runners.d.ts +0 -2
  139. package/dist/test/runners.js +0 -1
  140. package/dist/test/snapshot.d.ts +0 -2
  141. package/dist/test/snapshot.js +0 -1
  142. package/dist/test/suite.d.ts +0 -2
  143. package/dist/test/suite.js +0 -1
  144. package/dist/tsgolint-path-CbDReEOx.js +0 -34
  145. package/dist/tsgolint-path.d.ts +0 -7
  146. package/dist/tsgolint-path.js +0 -2
  147. package/dist/wrap-ansi-DNjkuBEp.js +0 -157
  148. package/dist/wrap-ansi-DUi52C6W.js +0 -2
  149. package/docs/guide/installer-env-vars.md +0 -286
package/dist/version.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { t as renderCliDoc } from "./help-BmKpeOP9.js";
2
2
  import { i as log, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
3
- import { _ as version } from "./constants-IhOditRA.js";
4
- import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-BB-Jh_z3.js";
3
+ import { y as version } from "./constants-CiKwrA0v.js";
4
+ import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-B85H2Nw0.js";
5
5
  import path from "node:path";
6
+ import { pathToFileURL } from "node:url";
6
7
  import fs from "node:fs";
7
8
  //#region src/version.ts
8
9
  /** Tool display names in the order shown by `vp --version`. */
@@ -45,7 +46,8 @@ function isVitePlusDeclaredInAncestors(cwd) {
45
46
  */
46
47
  async function resolveToolVersions(localPackagePath) {
47
48
  try {
48
- const mod = await import(`${localPackagePath}/dist/versions.js`);
49
+ const file = path.join(localPackagePath, "dist", "versions.js");
50
+ const mod = await import(pathToFileURL(file).href);
49
51
  if (mod.versions && typeof mod.versions === "object") return mod.versions;
50
52
  } catch {}
51
53
  return {};
package/dist/versions.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export const versions = {
2
2
  "vite": "8.3.0",
3
- "rolldown": "1.2.8",
4
- "vitest": "4.1.11",
5
- "oxfmt": "0.67.0",
6
- "oxlint": "1.82.0",
7
- "oxlint-tsgolint": "7.0.2001",
3
+ "rolldown": "1.2.9",
4
+ "vitest": "5.0.1",
5
+ "oxfmt": "0.70.0",
6
+ "oxlint": "1.85.0",
7
+ "oxlint-tsgolint": "7.0.2002",
8
8
  "tsdown": "0.23.0"
9
9
  };
@@ -0,0 +1,23 @@
1
+ //#region src/utils/vitest-ecosystem.ts
2
+ /** Official packages that share the bundled runner's release version. */
3
+ const VITEST_EXACT_VERSION_PACKAGES = /* @__PURE__ */ new Set([
4
+ "@vitest/browser",
5
+ "@vitest/browser-playwright",
6
+ "@vitest/browser-preview",
7
+ "@vitest/coverage-v8",
8
+ "@vitest/coverage-istanbul",
9
+ "@vitest/mocker",
10
+ "@vitest/pretty-format",
11
+ "@vitest/snapshot",
12
+ "@vitest/spy",
13
+ "@vitest/ui",
14
+ "@vitest/utils",
15
+ "@vitest/web-worker"
16
+ ]);
17
+ /** Optional peers fall back to the project; unrelated @vitest packages do not redirect. */
18
+ const VITEST_RESOLVER_PACKAGES = /* @__PURE__ */ new Set(["vitest", ...VITEST_EXACT_VERSION_PACKAGES]);
19
+ function isAlignableVitestEcosystemPackage(name) {
20
+ return VITEST_EXACT_VERSION_PACKAGES.has(name);
21
+ }
22
+ //#endregion
23
+ export { isAlignableVitestEcosystemPackage as n, VITEST_RESOLVER_PACKAGES as t };
@@ -0,0 +1,25 @@
1
+ //#region src/vitest-v5-entry-points.json
2
+ var vitest_v5_entry_points_default = {
3
+ "vitest/coverage": "vite-plus/test/node",
4
+ "vitest/reporters": "vite-plus/test/node",
5
+ "vitest/environments": "vite-plus/test/runtime",
6
+ "vitest/snapshot": "vite-plus/test/runtime",
7
+ "vitest/mocker": "vite-plus/test/mocker",
8
+ "vite-plus/test/coverage": "vite-plus/test/node",
9
+ "vite-plus/test/reporters": "vite-plus/test/node",
10
+ "vite-plus/test/environments": "vite-plus/test/runtime",
11
+ "vite-plus/test/snapshot": "vite-plus/test/runtime",
12
+ "vitest/browser-webdriverio": "@vitest/browser-webdriverio",
13
+ "vitest/browser-webdriverio/context": "vite-plus/test/browser/context",
14
+ "vitest/browser/providers/webdriverio": "@vitest/browser-webdriverio",
15
+ "vitest/browser/providers/webdriverio/context": "vite-plus/test/browser/context",
16
+ "vitest/plugins/browser-webdriverio": "@vitest/browser-webdriverio",
17
+ "vite-plus/test/browser-webdriverio": "@vitest/browser-webdriverio",
18
+ "vite-plus/test/browser-webdriverio/context": "vite-plus/test/browser/context",
19
+ "vite-plus/test/browser/providers/webdriverio": "@vitest/browser-webdriverio",
20
+ "vite-plus/test/browser/providers/webdriverio/context": "vite-plus/test/browser/context",
21
+ "vite-plus/test/plugins/browser-webdriverio": "@vitest/browser-webdriverio",
22
+ "@vitest/browser/providers/webdriverio": "@vitest/browser-webdriverio"
23
+ };
24
+ //#endregion
25
+ export { vitest_v5_entry_points_default as t };
@@ -1,6 +1,6 @@
1
1
  # Format Config
2
2
 
3
- `vp fmt` and `vp check` read Oxfmt settings from the `fmt` block in the root `vite.config.ts`. See [Oxfmt's configuration](https://oxc.rs/docs/guide/usage/formatter/config.html) for details.
3
+ `vp fmt` and `vp check` use the workspace-root `fmt` block, including when run from a package directory. Package configs do not replace these format settings. Use `vp fmt -c <path>` or `vp fmt --config <path>` to select another config. If the root config has no `fmt` block, Oxfmt uses [native discovery](/guide/fmt#configuration). See [Oxfmt's configuration](https://oxc.rs/docs/guide/usage/formatter/config.html) for details.
4
4
 
5
5
  ## Example
6
6
 
@@ -19,4 +19,4 @@ export default defineConfig({
19
19
 
20
20
  For file- or package-specific formatting settings, use [`fmt.overrides`](/guide/monorepo#format-overrides) from the root `vite.config.ts`.
21
21
 
22
- Vite+ does not currently support nested format configuration. See [troubleshooting](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) for details and how to give feedback on future support.
22
+ Oxfmt disables nested configs in Vite+ mode, so nested format configs do not override settings for individual files. See [troubleshooting](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) for details.
@@ -1,6 +1,6 @@
1
1
  # Lint Config
2
2
 
3
- `vp lint` and `vp check` read Oxlint settings from the `lint` block in the root `vite.config.ts`. See [Oxlint's configuration](https://oxc.rs/docs/guide/usage/linter/config.html) for details.
3
+ `vp lint` and `vp check` use the workspace-root `lint` block, including when run from a package directory. Package configs do not replace these lint settings. Use `vp lint -c <path>` or `vp lint --config <path>` to select another config. If the root config has no `lint` block, Oxlint uses [native discovery](/guide/lint#configuration). See [Oxlint's configuration](https://oxc.rs/docs/guide/usage/linter/config.html) for details.
4
4
 
5
5
  ## Example
6
6
 
@@ -25,4 +25,4 @@ We recommend enabling both `options.typeAware` and `options.typeCheck` so `vp li
25
25
 
26
26
  For file- or package-specific lint rules, use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) from the root `vite.config.ts`.
27
27
 
28
- Vite+ does not currently support nested lint configuration. See [troubleshooting](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) for details and how to give feedback on future support.
28
+ Oxlint disables nested configs in Vite+ mode, so nested lint configs do not override settings for individual files. See [troubleshooting](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) for details.
@@ -219,7 +219,7 @@ Vite Task passes a set of common environment variables to all tasks:
219
219
 
220
220
  - **System:** `HOME`, `USER`, `PATH`, `SHELL`, `LANG`, `TZ`
221
221
  - **Node.js:** `NODE_OPTIONS`, `COREPACK_HOME`, `PNPM_HOME`
222
- - **CI/CD:** `CI`, `VERCEL_*`, `NEXT_*`
222
+ - **CI/CD:** `CI`, `VERCEL_*`, `NEXT_*`, `GITHUB_*`, `RUNNER_*`, `ACTIONS_ID_TOKEN_REQUEST_URL`, `ACTIONS_ID_TOKEN_REQUEST_TOKEN`
223
223
  - **Terminal:** Color variables (`FORCE_COLOR`, `NO_COLOR`, `COLORTERM`, `TERM`, `TERM_PROGRAM`) aren't passed to tasks unless you list them under `env` (the value gets fingerprinted, so changing it invalidates the cache) or `untrackedEnv` (passed without fingerprinting). If `FORCE_COLOR` isn't in either list, the child gets `FORCE_COLOR=1` so cached logs stay colored. Colors get stripped on display when the terminal can't render them.
224
224
 
225
225
  ### `input`
@@ -1,7 +1,6 @@
1
1
  # Staged Config
2
2
 
3
- `vp staged` reads staged-file rules from the `staged` block in `vite.config.ts`. See the
4
- [Commit hooks guide](/guide/commit-hooks).
3
+ `vp staged` reads staged-file rules from the `staged` block in `vite.config.ts`. See the [Commit hooks guide](/guide/commit-hooks).
5
4
 
6
5
  ## Example
7
6
 
@@ -29,6 +29,8 @@ vp check --no-fmt --no-lint # Type-check only (requires `typeCheck` enabled).
29
29
  - [`fmt`](/guide/fmt#configuration) block in `vite.config.ts`
30
30
  - TypeScript project structure and tsconfig files for type-aware linting
31
31
 
32
+ When run from a workspace package, `vp check` uses the workspace-root `lint` and `fmt` blocks. Package configs cannot replace root format settings, lint rules, or type-check options. File paths and TypeScript projects are still resolved from the package working directory.
33
+
32
34
  Recommended base `lint` config:
33
35
 
34
36
  ```ts [vite.config.ts]
package/docs/guide/ci.md CHANGED
@@ -10,37 +10,7 @@ You can use `voidzero-dev/setup-vp` to use Vite+ in CI environments.
10
10
 
11
11
  Set `<setup-vp-version>` in each example to an exact version from the [`setup-vp` releases page](https://github.com/voidzero-dev/setup-vp/releases). You can use a commit SHA instead. Do not use the `v1` tag. The `v1` tag no longer receives updates.
12
12
 
13
- Run `vp migrate` to replace exact `voidzero-dev/setup-vp@v1` references in
14
- GitHub Actions workflows and composite actions under `.github` with the latest
15
- exact release known to your Vite+ version. Existing exact versions and commit
16
- SHAs remain unchanged.
17
-
18
- ### Automatic Version Updates
19
-
20
- Dependabot and Renovate can update exact versions in GitHub Actions workflows.
21
-
22
- To use [Dependabot version updates](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates), add a `github-actions` entry to `.github/dependabot.yml`:
23
-
24
- ```yaml [.github/dependabot.yml]
25
- version: 2
26
- updates:
27
- - package-ecosystem: github-actions
28
- directory: /
29
- schedule:
30
- interval: weekly
31
- ```
32
-
33
- Dependabot checks `uses:` entries in `.github/workflows` each week.
34
-
35
- [Renovate's GitHub Actions manager](https://docs.renovatebot.com/modules/manager/github-actions/) detects `uses:` entries by default. You do not need a package rule for `setup-vp`.
36
-
37
- When you use a commit SHA, add the exact release tag in a comment. Renovate uses the comment to find updates:
38
-
39
- ```yaml
40
- - uses: voidzero-dev/setup-vp@<commit-sha> # <setup-vp-version>
41
- ```
42
-
43
- These settings apply only to GitHub Actions workflows. For GitLab CI/CD and Azure Pipelines, update both version values together.
13
+ Run `vp migrate` to replace exact `voidzero-dev/setup-vp@v1` references in GitHub Actions workflows and composite actions under `.github` with the latest exact release known to your Vite+ version. Existing exact versions and commit SHAs remain unchanged.
44
14
 
45
15
  ## GitHub Actions
46
16
 
@@ -125,6 +95,33 @@ The Azure Pipelines template supports Microsoft-hosted Linux, macOS, and Windows
125
95
 
126
96
  For advanced configuration and the complete parameter reference, see the [`setup-vp` Azure Pipelines documentation](https://github.com/voidzero-dev/setup-vp#azure-pipelines).
127
97
 
98
+ ## Automatic Version Updates
99
+
100
+ Dependabot and Renovate can update exact versions in GitHub Actions workflows.
101
+
102
+ To use [Dependabot version updates](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates), add a `github-actions` entry to `.github/dependabot.yml`:
103
+
104
+ ```yaml [.github/dependabot.yml]
105
+ version: 2
106
+ updates:
107
+ - package-ecosystem: github-actions
108
+ directory: /
109
+ schedule:
110
+ interval: weekly
111
+ ```
112
+
113
+ Dependabot checks `uses:` entries in `.github/workflows` each week.
114
+
115
+ [Renovate's GitHub Actions manager](https://docs.renovatebot.com/modules/manager/github-actions/) detects `uses:` entries by default. You do not need a package rule for `setup-vp`.
116
+
117
+ When you use a commit SHA, add the exact release tag in a comment. Renovate uses the comment to find updates:
118
+
119
+ ```yaml
120
+ - uses: voidzero-dev/setup-vp@<commit-sha> # <setup-vp-version>
121
+ ```
122
+
123
+ These settings apply only to GitHub Actions workflows. For GitLab CI/CD and Azure Pipelines, update both version values together.
124
+
128
125
  ## Simplifying Existing Workflows
129
126
 
130
127
  If you are migrating an existing GitHub Actions workflow, you can often replace large blocks of Node, package-manager, and cache setup with a single `setup-vp` step.
@@ -1,7 +1,6 @@
1
1
  # Commit Hooks
2
2
 
3
- Use `vp hooks` to manage the Git hook dispatcher, `vp config` for project setup
4
- (hooks + agent integration), and `vp staged` to run checks on staged files.
3
+ Use `vp hooks` to manage the Git hook dispatcher, `vp config` for project setup (hooks + agent integration), and `vp staged` to run checks on staged files.
5
4
 
6
5
  ## Overview
7
6
 
@@ -64,10 +63,7 @@ Check the `Dispatcher` and `core.hooksPath` lines to see whether hooks are actua
64
63
 
65
64
  ### `vp config`
66
65
 
67
- `vp config` configures Vite+ for the current project. It installs the generated Git hook
68
- dispatcher (unless hooks were disabled with `vp hooks disable`) and can also handle related
69
- project integration such as agent setup. The hooks directory defaults to `.vite-hooks`, or the
70
- last directory used by `vp hooks` / `vp config` in this clone:
66
+ `vp config` configures Vite+ for the current project. It installs the generated Git hook dispatcher (unless hooks were disabled with `vp hooks disable`) and can also handle related project integration such as agent setup. The hooks directory defaults to `.vite-hooks`, or the last directory used by `vp hooks` / `vp config` in this clone:
71
67
 
72
68
  ```bash
73
69
  vp config
@@ -76,24 +72,22 @@ vp config --no-hooks
76
72
  vp config --no-agent
77
73
  ```
78
74
 
79
- Use `--no-hooks` when you want `vp config` to leave the Git hook dispatcher unchanged. Use
80
- `--no-agent` when you want it to skip updates to existing coding agent instruction files. You can
81
- pass both flags when you want `vp config` to skip both setup steps. After `vp hooks disable`,
82
- `vp config` skips reinstalling the dispatcher and points you at `vp hooks enable` instead of
83
- prompting again.
75
+ Use `--no-hooks` when you want `vp config` to leave the Git hook dispatcher unchanged. Use `--no-agent` when you want it to skip updates to existing coding agent instruction files. You can pass both flags when you want `vp config` to skip both setup steps. After `vp hooks disable`, `vp config` skips reinstalling the dispatcher and points you at `vp hooks enable` instead of prompting again.
84
76
 
85
- You can also set `VP_GIT_HOOKS=0` to disable hook installation from lifecycle scripts such as
86
- `prepare` or `postinstall`.
77
+ You can also set `VP_GIT_HOOKS=0` to disable hook installation from lifecycle scripts such as `prepare` or `postinstall`.
87
78
 
88
- Project-owned hook scripts such as `.vite-hooks/pre-commit` should be committed to the repository.
89
- The generated dispatcher and shims under `.vite-hooks/_` are ignored and recreated by `vp config`
90
- or `vp hooks enable`. Neither command creates or modifies project hook scripts or staged-file
91
- configuration.
79
+ Project-owned hook scripts such as `.vite-hooks/pre-commit` should be committed to the repository. The generated dispatcher and shims under `.vite-hooks/_` are ignored and recreated by `vp config` or `vp hooks enable`. Neither command creates or modifies project hook scripts or staged-file configuration.
92
80
 
93
81
  ### `vp staged`
94
82
 
95
- `vp staged` runs staged-file checks using the `staged` config from `vite.config.ts`. To run it
96
- before each commit, add it to the project-owned pre-commit hook:
83
+ `vp staged` runs staged-file checks using the `staged` config from `vite.config.ts`. It bundles `lint-staged` 17 and requires:
84
+
85
+ - Node.js `22.22.1` or later in the `22.x` line, or `24.11.0` or later
86
+ - Git `2.32.0` or later
87
+
88
+ Node.js `20.x` is no longer supported for staged checks. These requirements also apply when a pre-commit hook runs `vp staged`. Upgrade the project's Node.js runtime and the Git installation on developer machines and CI runners before using the command. See the [lint-staged 17 release notes](https://github.com/lint-staged/lint-staged/releases/tag/v17.0.0) for the upstream changes.
89
+
90
+ To run it before each commit, add it to the project-owned pre-commit hook:
97
91
 
98
92
  ```bash
99
93
  vp staged
@@ -119,12 +113,7 @@ export default defineConfig({
119
113
  });
120
114
  ```
121
115
 
122
- This is the default Vite+ approach and should replace separate `lint-staged` configuration in most
123
- projects. When you opt into hooks during `vp create`, Vite+ scaffolds both this configuration and
124
- the corresponding pre-commit hook. During `vp migrate`, existing hook policy is preserved, and
125
- the default is introduced only when no existing hook policy is found. Because
126
- `vp staged` reads from `vite.config.ts`, your staged-file checks stay in the same place as your
127
- lint, format, test, build, and task-runner config.
116
+ This is the default Vite+ approach and should replace separate `lint-staged` configuration in most projects. When you opt into hooks during `vp create`, Vite+ scaffolds both this configuration and the corresponding pre-commit hook. During `vp migrate`, existing hook policy is preserved, and the default is introduced only when no existing hook policy is found. Because `vp staged` reads from `vite.config.ts`, your staged-file checks stay in the same place as your lint, format, test, build, and task-runner config.
128
117
 
129
118
  ## Disabling Hooks in Specific Environments
130
119
 
@@ -157,8 +146,7 @@ Because the hook itself reads this file, it works even when the committing proce
157
146
 
158
147
  ## Removing commit hooks
159
148
 
160
- To stop using the Vite+ hook dispatcher in this clone (and keep `prepare` / `vp config` from
161
- reinstalling it):
149
+ To stop using the Vite+ hook dispatcher in this clone (and keep `prepare` / `vp config` from reinstalling it):
162
150
 
163
151
  ```bash
164
152
  vp hooks disable
@@ -170,8 +158,7 @@ This:
170
158
 
171
159
  1. Unsets `core.hooksPath` when it points at the Vite+ dispatcher
172
160
  2. Removes the generated `<hooks-dir>/_` directory
173
- 3. Records a **local** disable preference so lifecycle scripts skip reinstall until you run
174
- `vp hooks enable` again
161
+ 3. Records a **local** disable preference so lifecycle scripts skip reinstall until you run `vp hooks enable` again
175
162
 
176
163
  To re-enable:
177
164
 
@@ -179,8 +166,7 @@ To re-enable:
179
166
  vp hooks enable
180
167
  ```
181
168
 
182
- If you no longer want hooks for the project at all (shared with teammates), also remove `vp config`
183
- from the `prepare` or `postinstall` script in `package.json`.
169
+ If you no longer want hooks for the project at all (shared with teammates), also remove `vp config` from the `prepare` or `postinstall` script in `package.json`.
184
170
 
185
171
  ### Manual equivalent
186
172
 
@@ -195,6 +181,4 @@ git config --local vp.hooks.disabled true
195
181
  # git config --local vp.hooks.dir .vite-hooks
196
182
  ```
197
183
 
198
- Project-owned scripts such as `.vite-hooks/pre-commit` and the `staged` block in `vite.config.ts`
199
- can remain for later use, or you can remove them separately if the project no longer needs them.
200
- `vp hooks disable` does **not** delete those project-owned files.
184
+ Project-owned scripts such as `.vite-hooks/pre-commit` and the `staged` block in `vite.config.ts` can remain for later use, or you can remove them separately if the project no longer needs them. `vp hooks disable` does **not** delete those project-owned files.
@@ -57,8 +57,7 @@ Run `vp create --list` to see the built-in templates and the common shorthand te
57
57
  - `--hooks` enables pre-commit hook setup (dispatcher + `.vite-hooks` + `staged` config)
58
58
  - `--no-hooks` skips hook setup
59
59
 
60
- After create, manage the dispatcher with `vp hooks status`, `vp hooks disable`, and `vp hooks enable`.
61
- See the [Commit hooks guide](/guide/commit-hooks).
60
+ After create, manage the dispatcher with `vp hooks status`, `vp hooks disable`, and `vp hooks enable`. See the [Commit hooks guide](/guide/commit-hooks).
62
61
 
63
62
  ### Dependency build scripts
64
63
 
@@ -6,16 +6,11 @@ Vite+ publishes an official Docker image with the `vp` CLI preinstalled:
6
6
  ghcr.io/voidzero-dev/vite-plus
7
7
  ```
8
8
 
9
- Use it for builds, CI, and devcontainers. It is not intended as a production
10
- runtime image.
9
+ Use it for builds, CI, and devcontainers. It is not intended as a production runtime image.
11
10
 
12
- `vp` resolves the Node.js version from your project (`.node-version`,
13
- `devEngines.runtime`, or `engines.node`) and downloads that exact version during
14
- install/build. This means the image does not need Node-version-specific tags.
11
+ `vp` resolves the Node.js version from your project (`.node-version`, `devEngines.runtime`, or `engines.node`) and downloads that exact version during install/build. This means the image does not need Node-version-specific tags.
15
12
 
16
- For production, use a multi-stage build: build the app with the Vite+ image, then
17
- copy only the resolved Node.js binary, build output, and production dependencies
18
- into a smaller runtime image.
13
+ For production, use a multi-stage build: build the app with the Vite+ image, then copy only the resolved Node.js binary, build output, and production dependencies into a smaller runtime image.
19
14
 
20
15
  ## Image tags
21
16
 
@@ -28,19 +23,13 @@ Tags track the `vp` version:
28
23
  | `ghcr.io/voidzero-dev/vite-plus:<major>.<minor>` | Latest minor |
29
24
  | `ghcr.io/voidzero-dev/vite-plus:<major>.<minor>.<patch>` | Exact version |
30
25
 
31
- The examples use `:latest` to track the newest release; pin an exact tag or a
32
- digest if you need reproducible builds. The image is published for `linux/amd64`
33
- and `linux/arm64` and runs as the non-root `vp` user by default. That user has
34
- passwordless `sudo`, so build/CI steps that need root (extra apt packages,
35
- `playwright install --with-deps`) work without changing the image user.
26
+ The examples use `:latest` to track the newest release; pin an exact tag or a digest if you need reproducible builds. The image is published for `linux/amd64` and `linux/arm64` and runs as the non-root `vp` user by default. That user has passwordless `sudo`, so build/CI steps that need root (extra apt packages, `playwright install --with-deps`) work without changing the image user.
36
27
 
37
28
  Browse all published versions and digests on the [GitHub package page](https://github.com/voidzero-dev/vite-plus/pkgs/container/vite-plus).
38
29
 
39
30
  ## Production: SSR / Node.js server app
40
31
 
41
- For apps that run Node.js in production (SvelteKit, Nuxt, a custom Vite SSR
42
- server, and so on), build with the toolchain image and copy the resolved Node.js
43
- and the built app into a slim runtime stage:
32
+ For apps that run Node.js in production (SvelteKit, Nuxt, a custom Vite SSR server, and so on), build with the toolchain image and copy the resolved Node.js and the built app into a slim runtime stage:
44
33
 
45
34
  ```dockerfile [Dockerfile]
46
35
  # syntax=docker/dockerfile:1
@@ -86,28 +75,19 @@ EXPOSE 3000
86
75
  CMD ["node", "dist/server.js"]
87
76
  ```
88
77
 
89
- The deployed image contains only Node.js plus your app and production
90
- dependencies, and matches `.node-version` exactly. It is much smaller than the
91
- default `node:*` image; see the distroless tip below for the smallest result.
78
+ The deployed image contains only Node.js plus your app and production dependencies, and matches `.node-version` exactly. It is much smaller than the default `node:*` image; see the distroless tip below for the smallest result.
92
79
 
93
80
  ::: warning Prune production dependencies in a separate stage
94
- Install production dependencies in their own `deps` stage as shown. Running
95
- `vp install --prod` after a full `vp install` in the same stage does not remove
96
- the already-installed devDependencies, so the `vite-plus` toolchain would be
97
- copied into the runtime image. If your server bundle is fully self-contained (no
98
- un-bundled runtime dependencies), you can skip copying `node_modules` entirely.
81
+ Install production dependencies in their own `deps` stage as shown. Running `vp install --prod` after a full `vp install` in the same stage does not remove the already-installed devDependencies, so the `vite-plus` toolchain would be copied into the runtime image. If your server bundle is fully self-contained (no un-bundled runtime dependencies), you can skip copying `node_modules` entirely.
99
82
  :::
100
83
 
101
84
  ::: tip Smaller still
102
- For a shell-less, minimal-CVE runtime, swap the runtime base for distroless
103
- (`gcr.io/distroless/cc`) and keep an `ENTRYPOINT` in vector form. It is glibc
104
- based, so the copied Node.js binary remains compatible.
85
+ For a shell-less, minimal-CVE runtime, swap the runtime base for distroless (`gcr.io/distroless/cc`) and keep an `ENTRYPOINT` in vector form. It is glibc based, so the copied Node.js binary remains compatible.
105
86
  :::
106
87
 
107
88
  ## Production: static SPA / SSG
108
89
 
109
- A static site needs no Node.js at runtime; serve the build output with any static
110
- server:
90
+ A static site needs no Node.js at runtime; serve the build output with any static server:
111
91
 
112
92
  ```dockerfile [Dockerfile]
113
93
  FROM ghcr.io/voidzero-dev/vite-plus:latest AS build
@@ -123,8 +103,7 @@ COPY --from=build /app/dist /usr/share/nginx/html
123
103
 
124
104
  ## Continuous integration
125
105
 
126
- Use the image directly in container-based CI (GitLab CI, Buildkite, CircleCI,
127
- Jenkins, and others):
106
+ Use the image directly in container-based CI (GitLab CI, Buildkite, CircleCI, Jenkins, and others):
128
107
 
129
108
  ```yaml [.gitlab-ci.yml]
130
109
  build:
@@ -140,11 +119,7 @@ On GitHub Actions, prefer [`setup-vp`](./ci) instead of the image.
140
119
 
141
120
  ## Browser mode tests (Vitest / Playwright)
142
121
 
143
- Running as the non-root `vp` user is what you want for browsers: Chromium keeps
144
- its sandbox (running a browser as root disables it). Install the browser and its
145
- system libraries in the job. `playwright install --with-deps` needs root to
146
- `apt-get install` those libraries. The `vp` user has passwordless `sudo`, so
147
- Playwright uses it to install them without changing the image user:
122
+ Running as the non-root `vp` user is what you want for browsers: Chromium keeps its sandbox (running a browser as root disables it). Install the browser and its system libraries in the job. `playwright install --with-deps` needs root to `apt-get install` those libraries. The `vp` user has passwordless `sudo`, so Playwright uses it to install them without changing the image user:
148
123
 
149
124
  ```yaml [.gitlab-ci.yml]
150
125
  test:
@@ -155,15 +130,9 @@ test:
155
130
  - vp test
156
131
  ```
157
132
 
158
- `vp exec` runs the project's own Playwright (from your lockfile), so it installs
159
- the browser revision your tests expect. Prefer it over `vpx playwright install`,
160
- which would download whatever Playwright is latest and can fetch a different
161
- browser revision.
133
+ `vp exec` runs the project's own Playwright (from your lockfile), so it installs the browser revision your tests expect. Prefer it over `vpx playwright install`, which would download whatever Playwright is latest and can fetch a different browser revision.
162
134
 
163
- To bake the browser and its libraries into a derived image instead of installing
164
- them on every run, install the project dependencies first so the baked browser
165
- matches your lockfile, then install with the project's Playwright (root is
166
- available through `sudo`):
135
+ To bake the browser and its libraries into a derived image instead of installing them on every run, install the project dependencies first so the baked browser matches your lockfile, then install with the project's Playwright (root is available through `sudo`):
167
136
 
168
137
  ```dockerfile [Dockerfile]
169
138
  FROM ghcr.io/voidzero-dev/vite-plus:latest
@@ -173,13 +142,11 @@ RUN vp install --frozen-lockfile
173
142
  RUN vp exec playwright install --with-deps chromium
174
143
  ```
175
144
 
176
- If Chromium crashes under load in CI, give the container more shared memory with
177
- `--ipc=host`; see the [Playwright Docker docs](https://playwright.dev/docs/docker).
145
+ If Chromium crashes under load in CI, give the container more shared memory with `--ipc=host`; see the [Playwright Docker docs](https://playwright.dev/docs/docker).
178
146
 
179
147
  ## Devcontainers
180
148
 
181
- Use the image as a ready-to-go development container with the toolchain
182
- preinstalled:
149
+ Use the image as a ready-to-go development container with the toolchain preinstalled:
183
150
 
184
151
  ```jsonc [.devcontainer/devcontainer.json]
185
152
  {
@@ -197,23 +164,8 @@ docker run --rm -it -v "$PWD:/app" -w /app ghcr.io/voidzero-dev/vite-plus vp bui
197
164
 
198
165
  ## Notes
199
166
 
200
- - **Node.js version**: provisioned from `.node-version`, `engines.node`, or
201
- `devEngines.runtime` at build time, so there is no Node.js-specific image tag. The
202
- dependency `COPY` uses a `.node-version*` glob so the file is optional: projects
203
- that pin via `engines.node`/`devEngines.runtime` need no `.node-version`, and
204
- those that use one have it available in every stage.
205
- - **Non-root user**: the image runs as the non-root `vp` user, so copy sources
206
- with `COPY --chown=vp:vp ...` as shown. Without it, `COPY` writes root-owned
207
- files that `vp install` cannot update (permission denied). The `vp` user has
208
- passwordless `sudo` for the occasional root step (installing extra apt packages
209
- or `playwright install --with-deps`), so you rarely need to switch the image
210
- user. The production runtime stage is a separate, vp-free base image, so this
211
- convenience does not reach your deployed image.
212
- - **Native addons**: the image includes a C/C++ build toolchain (`build-essential`,
213
- `python3`), so native dependencies such as `better-sqlite3` compile during
214
- `vp install`.
215
- - **glibc**: the image is glibc based so it uses the official, signature-verified
216
- Node.js builds.
217
- - **Custom base image**: to add `vp` to your own base image instead, run the
218
- installer: `curl -fsSL https://vite.plus | bash` (set `VP_VERSION` to pin a
219
- version).
167
+ - **Node.js version**: provisioned from `.node-version`, `engines.node`, or `devEngines.runtime` at build time, so there is no Node.js-specific image tag. The dependency `COPY` uses a `.node-version*` glob so the file is optional: projects that pin via `engines.node`/`devEngines.runtime` need no `.node-version`, and those that use one have it available in every stage.
168
+ - **Non-root user**: the image runs as the non-root `vp` user, so copy sources with `COPY --chown=vp:vp ...` as shown. Without it, `COPY` writes root-owned files that `vp install` cannot update (permission denied). The `vp` user has passwordless `sudo` for the occasional root step (installing extra apt packages or `playwright install --with-deps`), so you rarely need to switch the image user. The production runtime stage is a separate, vp-free base image, so this convenience does not reach your deployed image.
169
+ - **Native addons**: the image includes a C/C++ build toolchain (`build-essential`, `python3`), so native dependencies such as `better-sqlite3` compile during `vp install`.
170
+ - **glibc**: the image is glibc based so it uses the official, signature-verified Node.js builds.
171
+ - **Custom base image**: to add `vp` to your own base image instead, run the installer: `curl -fsSL https://vite.plus | bash` (set `VP_VERSION` to pin a version).