vite-plus 0.2.8 → 0.3.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.
- package/AGENTS.md +7 -0
- package/README.md +13 -6
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +100 -3
- package/dist/{agent-CI79DuSy.js → agent-Wqx0MPk0.js} +4 -188
- package/dist/bin.js +298 -278
- package/dist/command-CLJK5jGW.js +2 -0
- package/dist/command-CguLh2KL.js +471 -0
- package/dist/config/bin.js +29 -15
- package/dist/{constants-BppDcRc1.js → constants-Bn-U8o4v.js} +13 -3
- package/dist/create/bin.js +197 -247
- package/dist/{define-config-DPnHe1Mx.js → define-config-GXUdVT-0.js} +3 -3
- package/dist/{define-config-CEm_MtvJ.cjs → define-config-WiVlryJ2.cjs} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
- package/dist/dist-Dqv1-Clg.js +3 -0
- package/dist/{editor-CGWdbLgD.js → editor-CC4DqODz.js} +736 -153
- package/dist/{terminal-CrqqK8WT.js → help-BmKpeOP9.js} +27 -34
- package/dist/hooks/bin.d.ts +1 -0
- package/dist/hooks/bin.js +131 -0
- package/dist/hooks-DFqViZqZ.js +573 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-BU88uu6o.js → json-cULBl7Pi.js} +145 -139
- package/dist/migration/bin.js +67 -21
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-DX5ezKbB.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +5 -4
- package/dist/{package-hV-77cBb.js → package-CBe9EWPY.js} +2 -2
- package/dist/{prompts-DYap08te.js → prompts-DF3yU-eU.js} +136 -512
- package/dist/{report-BS7ULx7A.js → report-ZNR1Mk6h.js} +1 -0
- package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-ipGb39Jo.js} +2 -9
- package/dist/staged/bin.js +299 -251
- package/dist/terminal-MKGAuy-p.js +39 -0
- package/dist/test/browser/providers/playwright/context.d.ts +1 -1
- package/dist/test/browser/providers/playwright.d.ts +6 -6
- package/dist/test/browser/providers/preview/context.d.ts +1 -1
- package/dist/test/browser/providers/preview.d.ts +4 -4
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
- package/dist/test/browser/providers/webdriverio.d.ts +6 -6
- package/dist/test/browser-playwright/context.d.ts +1 -1
- package/dist/test/browser-playwright.d.ts +6 -6
- package/dist/test/browser-preview/context.d.ts +1 -1
- package/dist/test/browser-preview.d.ts +4 -4
- package/dist/test/browser-webdriverio/context.d.ts +1 -1
- package/dist/test/browser-webdriverio.d.ts +6 -6
- package/dist/test/context.d.ts +3 -3
- package/dist/test/locators.d.ts +1 -1
- package/dist/toolchain.d.ts +25 -0
- package/dist/toolchain.js +194 -0
- package/dist/toolchain.json +193 -0
- package/dist/tsconfig-BVHG3DpR.js +2 -0
- package/dist/{tsconfig-CVUKLfL8.js → tsconfig-LD2QhQ0O.js} +5 -4
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -4
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +6 -6
- package/docs/guide/ci.md +37 -4
- package/docs/guide/commit-hooks.md +87 -14
- package/docs/guide/create.md +7 -4
- package/docs/guide/env.md +20 -6
- package/docs/guide/fmt.md +2 -2
- package/docs/guide/github-actions-cache.md +5 -1
- package/docs/guide/ide-integration.md +61 -2
- package/docs/guide/index.md +3 -1
- package/docs/guide/install.md +27 -1
- package/docs/guide/installer-env-vars.md +53 -6
- package/docs/guide/lint.md +3 -1
- package/docs/guide/migrate-rules.md +9 -0
- package/docs/guide/migrate.md +41 -4
- package/docs/guide/monorepo.md +4 -4
- package/docs/guide/test.md +8 -0
- package/docs/guide/troubleshooting.md +12 -4
- package/docs/guide/upgrade.md +75 -5
- package/package.json +36 -33
- package/rules/vite-tools.yml +0 -7
- package/dist/dist-DT25H9pj.js +0 -3
- package/docs/_data/team.ts +0 -131
- package/docs/package.json +0 -30
- package/docs/pnpm-lock.yaml +0 -4003
- package/docs/pnpm-workspace.yaml +0 -6
- package/docs/public/checkmark.svg +0 -1
- package/docs/public/cta-background.jpg +0 -0
- package/docs/public/favicon.svg +0 -1
- package/docs/public/icon.svg +0 -1
- package/docs/public/logo.svg +0 -1
- package/docs/public/og.jpg +0 -0
- package/docs/vite.config.ts +0 -17
- package/dist/{log-update-CoW8Z4Dl.js → log-update-DHZRyJ2m.js} +1 -1
- package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as isCancel, C as log,
|
|
3
|
-
import { c as parse, o as applyEdits, s as modify } from "./json-
|
|
1
|
+
import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-Bn-U8o4v.js";
|
|
2
|
+
import { A as isCancel, C as log, t as cancelAndExit, x as confirm } from "./prompts-DF3yU-eU.js";
|
|
3
|
+
import { c as parse, o as applyEdits, s as modify } from "./json-cULBl7Pi.js";
|
|
4
|
+
import { n as runCommandSilently } from "./command-CguLh2KL.js";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { styleText } from "node:util";
|
|
6
7
|
import fs from "node:fs";
|
|
@@ -148,4 +149,4 @@ function rewriteTypesInTsconfig(filePath) {
|
|
|
148
149
|
return true;
|
|
149
150
|
}
|
|
150
151
|
//#endregion
|
|
151
|
-
export {
|
|
152
|
+
export { hasBaseUrlInTsconfig as a, hasVitestTypesInTsconfig as c, fixBaseUrlInTsconfig as i, removeDeprecatedTsconfigFalseOption as l, findTsconfigFiles as n, hasBaseUrlInTsconfigFile as o, findTsconfigFilesWithBaseUrl as r, hasTypesToRewriteInTsconfig as s, confirmBaseUrlFix as t, rewriteTypesInTsconfig as u };
|
package/dist/tsgolint-path.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resolveWindowsTsgolintExecutable, t as resolveTsgolintExecutable } from "./tsgolint-path-
|
|
1
|
+
import { n as resolveWindowsTsgolintExecutable, t as resolveTsgolintExecutable } from "./tsgolint-path-CbDReEOx.js";
|
|
2
2
|
export { resolveTsgolintExecutable, resolveWindowsTsgolintExecutable };
|
package/dist/version.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as renderCliDoc } from "./help-BmKpeOP9.js";
|
|
2
|
+
import { i as log, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
+
import { _ as version } from "./constants-Bn-U8o4v.js";
|
|
4
|
+
import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-CBe9EWPY.js";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import fs from "node:fs";
|
|
6
7
|
//#region src/version.ts
|
|
@@ -40,7 +41,7 @@ function isVitePlusDeclaredInAncestors(cwd) {
|
|
|
40
41
|
}
|
|
41
42
|
/**
|
|
42
43
|
* Resolve all tool versions from the locally installed vite-plus package.
|
|
43
|
-
* Uses the `vite-plus/versions` export generated by `
|
|
44
|
+
* Uses the `vite-plus/versions` export generated by `syncToolchainExports()`.
|
|
44
45
|
*/
|
|
45
46
|
async function resolveToolVersions(localPackagePath) {
|
|
46
47
|
try {
|
package/dist/versions.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const versions: {
|
|
2
2
|
readonly 'vite': string;
|
|
3
3
|
readonly 'rolldown': string;
|
|
4
|
-
readonly '
|
|
5
|
-
readonly 'oxlint': string;
|
|
4
|
+
readonly 'vitest': string;
|
|
6
5
|
readonly 'oxfmt': string;
|
|
6
|
+
readonly 'oxlint': string;
|
|
7
7
|
readonly 'oxlint-tsgolint': string;
|
|
8
|
-
readonly '
|
|
8
|
+
readonly 'tsdown': string;
|
|
9
9
|
};
|
package/dist/versions.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const versions = {
|
|
2
|
-
"vite": "8.2.
|
|
3
|
-
"rolldown": "1.2.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
2
|
+
"vite": "8.2.2",
|
|
3
|
+
"rolldown": "1.2.5",
|
|
4
|
+
"vitest": "4.1.11",
|
|
5
|
+
"oxfmt": "0.64.0",
|
|
6
|
+
"oxlint": "1.79.0",
|
|
7
7
|
"oxlint-tsgolint": "7.0.2001",
|
|
8
|
-
"
|
|
8
|
+
"tsdown": "0.22.14"
|
|
9
9
|
};
|
package/docs/guide/ci.md
CHANGED
|
@@ -6,12 +6,43 @@ You can use `voidzero-dev/setup-vp` to use Vite+ in CI environments.
|
|
|
6
6
|
|
|
7
7
|
[`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) provides integrations for GitHub Actions and GitLab CI/CD. Both install Vite+ and can install project dependencies. The GitHub Action can also set up Node.js and cache package manager data automatically, while the GitLab CI/CD template uses the Node.js runtime and cache configuration provided by the job.
|
|
8
8
|
|
|
9
|
+
## setup-vp Versioning
|
|
10
|
+
|
|
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
|
+
|
|
13
|
+
### Automatic Version Updates
|
|
14
|
+
|
|
15
|
+
Dependabot and Renovate can update exact versions in GitHub Actions workflows.
|
|
16
|
+
|
|
17
|
+
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`:
|
|
18
|
+
|
|
19
|
+
```yaml [.github/dependabot.yml]
|
|
20
|
+
version: 2
|
|
21
|
+
updates:
|
|
22
|
+
- package-ecosystem: github-actions
|
|
23
|
+
directory: /
|
|
24
|
+
schedule:
|
|
25
|
+
interval: weekly
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Dependabot checks `uses:` entries in `.github/workflows` each week.
|
|
29
|
+
|
|
30
|
+
[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`.
|
|
31
|
+
|
|
32
|
+
When you use a commit SHA, add the exact release tag in a comment. Renovate uses the comment to find updates:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- uses: voidzero-dev/setup-vp@<commit-sha> # <setup-vp-version>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
These settings apply only to GitHub Actions workflows. For GitLab CI/CD, update both version values together.
|
|
39
|
+
|
|
9
40
|
## GitHub Actions
|
|
10
41
|
|
|
11
42
|
The GitHub Action sets up Vite+, the required Node.js version, and the package manager. This means you usually do not need separate `setup-node`, package-manager setup, or manual dependency caching steps in your workflow.
|
|
12
43
|
|
|
13
44
|
```yaml [.github/workflows/ci.yml]
|
|
14
|
-
- uses: voidzero-dev/setup-vp
|
|
45
|
+
- uses: voidzero-dev/setup-vp@<setup-vp-version>
|
|
15
46
|
with:
|
|
16
47
|
node-version: '24'
|
|
17
48
|
cache: true
|
|
@@ -29,11 +60,13 @@ With `cache: true`, `setup-vp` handles dependency caching for you automatically.
|
|
|
29
60
|
|
|
30
61
|
## GitLab CI/CD
|
|
31
62
|
|
|
32
|
-
Use the reusable `setup-vp` remote template in your GitLab CI/CD configuration:
|
|
63
|
+
Use the reusable `setup-vp` remote template in your GitLab CI/CD configuration. Set the remote URL and `setup-ref` to the same release tag or commit SHA:
|
|
33
64
|
|
|
34
65
|
```yaml [.gitlab-ci.yml]
|
|
35
66
|
include:
|
|
36
|
-
- remote: 'https://raw.githubusercontent.com/voidzero-dev/setup-vp
|
|
67
|
+
- remote: 'https://raw.githubusercontent.com/voidzero-dev/setup-vp/<setup-vp-version>/gitlab/setup-vp.yml'
|
|
68
|
+
inputs:
|
|
69
|
+
setup-ref: '<setup-vp-version>'
|
|
37
70
|
|
|
38
71
|
test:
|
|
39
72
|
extends: .setup-vp
|
|
@@ -76,7 +109,7 @@ If you are migrating an existing GitHub Actions workflow, you can often replace
|
|
|
76
109
|
#### After:
|
|
77
110
|
|
|
78
111
|
```yaml [.github/workflows/ci.yml]
|
|
79
|
-
- uses: voidzero-dev/setup-vp
|
|
112
|
+
- uses: voidzero-dev/setup-vp@<setup-vp-version>
|
|
80
113
|
with:
|
|
81
114
|
node-version: '24'
|
|
82
115
|
cache: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Commit Hooks
|
|
2
2
|
|
|
3
|
-
Use `vp
|
|
4
|
-
files.
|
|
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.
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
@@ -9,18 +9,65 @@ Vite+ supports commit hooks and staged-file checks without additional tooling.
|
|
|
9
9
|
|
|
10
10
|
Use:
|
|
11
11
|
|
|
12
|
-
- `vp
|
|
12
|
+
- `vp hooks enable` / `disable` / `status` to manage the generated hook dispatcher
|
|
13
|
+
- `vp config` to install the dispatcher (when not disabled) and update agent integration
|
|
13
14
|
- `vp staged` to run checks against the files currently staged in Git
|
|
14
15
|
|
|
15
16
|
If you use [`vp create`](/guide/create) or [`vp migrate`](/guide/migrate), Vite+ prompts you to set this up for your project automatically.
|
|
16
17
|
|
|
18
|
+
### Quick start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Install or refresh the dispatcher
|
|
22
|
+
vp hooks enable
|
|
23
|
+
|
|
24
|
+
# Check what is active in this clone
|
|
25
|
+
vp hooks status
|
|
26
|
+
|
|
27
|
+
# Turn hooks off in this clone (survives npm install / prepare)
|
|
28
|
+
vp hooks disable
|
|
29
|
+
|
|
30
|
+
# Turn them back on
|
|
31
|
+
vp hooks enable
|
|
32
|
+
```
|
|
33
|
+
|
|
17
34
|
## Commands
|
|
18
35
|
|
|
36
|
+
### `vp hooks`
|
|
37
|
+
|
|
38
|
+
Manage the Vite+ Git hook dispatcher for the current repository:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
vp hooks enable
|
|
42
|
+
vp hooks enable --hooks-dir .custom-hooks
|
|
43
|
+
vp hooks disable
|
|
44
|
+
vp hooks status
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
| Command | Behavior |
|
|
48
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
49
|
+
| `enable` | Install or refresh the generated dispatcher under `<hooks-dir>/_` and set `core.hooksPath`. Clears a previous disable preference. |
|
|
50
|
+
| `disable` | Tear down the dispatcher (unset `core.hooksPath` when it points at Vite+, remove `<hooks-dir>/_`) and **persist** the disable decision in local git config so `vp config` / lifecycle scripts do not reinstall it. |
|
|
51
|
+
| `status` | Show preference, `core.hooksPath`, dispatcher presence, and project-owned hook scripts. |
|
|
52
|
+
|
|
53
|
+
By default, project hooks live in `.vite-hooks`. Pass `--hooks-dir` to use another subdirectory. After the first successful enable, the directory is remembered in local git config for later `enable` / `disable` / `status` / `vp config` calls in this clone.
|
|
54
|
+
|
|
55
|
+
`status` reports preference as:
|
|
56
|
+
|
|
57
|
+
- `not set` — no disable preference and no prior enable in this clone
|
|
58
|
+
- `enabled` — enable has run (or the dispatcher is currently owned)
|
|
59
|
+
- `disabled (local)` — after `vp hooks disable`
|
|
60
|
+
|
|
61
|
+
Check the `Dispatcher` and `core.hooksPath` lines to see whether hooks are actually active.
|
|
62
|
+
|
|
63
|
+
`disable` / `enable` do **not** delete project-owned hook scripts (for example `.vite-hooks/pre-commit`), the `staged` block in `vite.config.ts`, or lifecycle scripts that call `vp config`.
|
|
64
|
+
|
|
19
65
|
### `vp config`
|
|
20
66
|
|
|
21
67
|
`vp config` configures Vite+ for the current project. It installs the generated Git hook
|
|
22
|
-
dispatcher
|
|
23
|
-
project hooks
|
|
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:
|
|
24
71
|
|
|
25
72
|
```bash
|
|
26
73
|
vp config
|
|
@@ -31,14 +78,17 @@ vp config --no-agent
|
|
|
31
78
|
|
|
32
79
|
Use `--no-hooks` when you want `vp config` to leave the Git hook dispatcher unchanged. Use
|
|
33
80
|
`--no-agent` when you want it to skip updates to existing coding agent instruction files. You can
|
|
34
|
-
pass both flags when you want `vp config` to skip both setup steps.
|
|
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.
|
|
35
84
|
|
|
36
85
|
You can also set `VP_GIT_HOOKS=0` to disable hook installation from lifecycle scripts such as
|
|
37
86
|
`prepare` or `postinstall`.
|
|
38
87
|
|
|
39
88
|
Project-owned hook scripts such as `.vite-hooks/pre-commit` should be committed to the repository.
|
|
40
|
-
The generated dispatcher and shims under `.vite-hooks/_` are ignored and recreated by `vp config
|
|
41
|
-
`vp
|
|
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.
|
|
42
92
|
|
|
43
93
|
### `vp staged`
|
|
44
94
|
|
|
@@ -88,7 +138,7 @@ Set `VP_GIT_HOOKS=0` in the environment of the process that runs `git commit`, a
|
|
|
88
138
|
VP_GIT_HOOKS=0 git commit -m "content update"
|
|
89
139
|
```
|
|
90
140
|
|
|
91
|
-
`HUSKY=0` is honored the same way for ecosystem tooling compatibility. Setting `VP_GIT_HOOKS=0` in an environment also keeps `vp config` from reinstalling hooks there when a lifecycle script such as `prepare` runs.
|
|
141
|
+
`HUSKY=0` is honored the same way for ecosystem tooling compatibility. Setting `VP_GIT_HOOKS=0` in an environment also keeps `vp config` / `vp hooks enable` from reinstalling hooks there when a lifecycle script such as `prepare` runs.
|
|
92
142
|
|
|
93
143
|
### Init script
|
|
94
144
|
|
|
@@ -107,21 +157,44 @@ Because the hook itself reads this file, it works even when the committing proce
|
|
|
107
157
|
|
|
108
158
|
## Removing commit hooks
|
|
109
159
|
|
|
110
|
-
To stop using the Vite+ hook dispatcher
|
|
160
|
+
To stop using the Vite+ hook dispatcher in this clone (and keep `prepare` / `vp config` from
|
|
161
|
+
reinstalling it):
|
|
111
162
|
|
|
112
|
-
|
|
163
|
+
```bash
|
|
164
|
+
vp hooks disable
|
|
165
|
+
# or, if you used a custom directory:
|
|
166
|
+
vp hooks disable --hooks-dir .custom-hooks
|
|
167
|
+
```
|
|
113
168
|
|
|
114
|
-
|
|
169
|
+
This:
|
|
170
|
+
|
|
171
|
+
1. Unsets `core.hooksPath` when it points at the Vite+ dispatcher
|
|
172
|
+
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
|
|
175
|
+
|
|
176
|
+
To re-enable:
|
|
115
177
|
|
|
116
178
|
```bash
|
|
117
|
-
|
|
179
|
+
vp hooks enable
|
|
118
180
|
```
|
|
119
181
|
|
|
120
|
-
|
|
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`.
|
|
184
|
+
|
|
185
|
+
### Manual equivalent
|
|
186
|
+
|
|
187
|
+
If you prefer to do it by hand:
|
|
121
188
|
|
|
122
189
|
```bash
|
|
190
|
+
git config --unset core.hooksPath
|
|
123
191
|
rm -rf .vite-hooks/_
|
|
192
|
+
# optional: prevent prepare/vp config from reinstalling in this clone
|
|
193
|
+
git config --local vp.hooks.disabled true
|
|
194
|
+
# optional: remembered hooks directory (set by enable/disable)
|
|
195
|
+
# git config --local vp.hooks.dir .vite-hooks
|
|
124
196
|
```
|
|
125
197
|
|
|
126
198
|
Project-owned scripts such as `.vite-hooks/pre-commit` and the `staged` block in `vite.config.ts`
|
|
127
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.
|
package/docs/guide/create.md
CHANGED
|
@@ -49,23 +49,26 @@ Run `vp create --list` to see the built-in templates and the common shorthand te
|
|
|
49
49
|
- `--no-editor` skips editor config setup
|
|
50
50
|
- `--git` initialize a git repository
|
|
51
51
|
- `--no-git` skips git repository initialization
|
|
52
|
-
- `--hooks` enables pre-commit hook setup
|
|
53
|
-
- `--no-hooks` skips hook setup
|
|
54
52
|
- `--package-manager <name>` uses a specified package manager (`pnpm`, `npm`, `yarn`, or `bun`)
|
|
55
53
|
- `--approve-builds` approves and runs gated dependency build scripts without prompting
|
|
56
54
|
- `--no-interactive` runs without prompts
|
|
57
55
|
- `--verbose` shows detailed scaffolding output
|
|
58
56
|
- `--list` prints the available built-in and popular templates
|
|
57
|
+
- `--hooks` enables pre-commit hook setup (dispatcher + `.vite-hooks` + `staged` config)
|
|
58
|
+
- `--no-hooks` skips hook setup
|
|
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).
|
|
59
62
|
|
|
60
63
|
### Dependency build scripts
|
|
61
64
|
|
|
62
|
-
For security, pnpm, bun,
|
|
65
|
+
For security, pnpm, bun, yarn (Berry), and npm (v12+) do not run a dependency's build scripts (`install` / `postinstall`, e.g. native builds like `better-sqlite3`) until you approve them. When a template adds such a dependency directly, `vp create` surfaces it after installing instead of leaving the project in a half-built state:
|
|
63
66
|
|
|
64
67
|
- Interactive: you are asked which of those dependencies to approve and build (nothing is selected by default).
|
|
65
68
|
- Non-interactive: a note lists them and points at `vp pm approve-builds`.
|
|
66
69
|
- `--approve-builds`: approves and builds them automatically, so non-interactive runs (CI) can produce a ready-to-use project.
|
|
67
70
|
|
|
68
|
-
Approval is recorded the way each package manager expects: pnpm's `allowBuilds`, bun's `trustedDependencies`, or yarn's `dependenciesMeta.<pkg>.built` (in the workspace root manifest). Transitive build scripts you did not choose (e.g. `esbuild` pulled in by Vite) are left at the package manager's defaults and are not surfaced. npm
|
|
71
|
+
Approval is recorded the way each package manager expects: pnpm's `allowBuilds`, bun's `trustedDependencies`, npm's `allowScripts`, or yarn's `dependenciesMeta.<pkg>.built` (in the workspace root manifest). Transitive build scripts you did not choose (e.g. `esbuild` pulled in by Vite) are left at the package manager's defaults and are not surfaced. npm 11 and older run build scripts during install, so there is nothing to approve there.
|
|
69
72
|
|
|
70
73
|
## Template Options
|
|
71
74
|
|
package/docs/guide/env.md
CHANGED
|
@@ -21,7 +21,12 @@ latest LTS.
|
|
|
21
21
|
|
|
22
22
|
When a project declares `packageManager` (or `devEngines.packageManager`) in `package.json`, matching package-manager shims also use that package-manager version. For example, `packageManager: "npm@10.9.4"` makes both `npm` and `npx` run through npm 10.9.4. Alias pairs follow the installed package-manager shims: `npm`/`npx`, `pnpm`/`pnpx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Vite+ does not translate mismatched commands, so a project pinned to `pnpm` still lets `npm` fall back to the npm that comes with the resolved Node.js runtime.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
A fresh install uses the split platform layout by default. On Unix, Vite+
|
|
25
|
+
stores managed runtimes and related files in `~/.local/share/vite-plus`. It
|
|
26
|
+
stores executables in the Vite+-owned `~/.local/share/vite-plus/bin` directory.
|
|
27
|
+
On Windows, Vite+ uses `%LOCALAPPDATA%\vite-plus\data` for data and
|
|
28
|
+
`%LOCALAPPDATA%\vite-plus\bin` for executables. Vite+ does not move an existing
|
|
29
|
+
`~/.vite-plus` install. `VP_HOME` puts all categories under one custom root.
|
|
25
30
|
|
|
26
31
|
If you want to keep that behavior, run:
|
|
27
32
|
|
|
@@ -43,7 +48,7 @@ This switches to system-first mode, where the shims prefer your system Node.js a
|
|
|
43
48
|
|
|
44
49
|
### Setup
|
|
45
50
|
|
|
46
|
-
- `vp env setup` creates or updates shims in
|
|
51
|
+
- `vp env setup` creates or updates shims in the resolved bin directory. It writes shell setup scripts in the config directory.
|
|
47
52
|
- `vp env on` enables managed mode so shims always use Vite+-managed Node.js
|
|
48
53
|
- `vp env off` enables system-first mode so shims prefer system Node.js first
|
|
49
54
|
- `vp env print` prints the shell snippet for the current session
|
|
@@ -51,9 +56,12 @@ This switches to system-first mode, where the shims prefer your system Node.js a
|
|
|
51
56
|
PowerShell needs to dot-source the generated setup script in the current shell before `vp env use` can affect only that shell session:
|
|
52
57
|
|
|
53
58
|
```powershell
|
|
54
|
-
. "$env:
|
|
59
|
+
. "$env:APPDATA\vite-plus\env.ps1"
|
|
55
60
|
```
|
|
56
61
|
|
|
62
|
+
If an older Vite+ install uses `%USERPROFILE%\.vite-plus`, source the `env.ps1`
|
|
63
|
+
file in that directory instead.
|
|
64
|
+
|
|
57
65
|
Add that line to the end of your PowerShell `$PROFILE` to apply it automatically in new shells. It does not require elevated privileges.
|
|
58
66
|
|
|
59
67
|
Create the profile file if it does not already exist:
|
|
@@ -76,9 +84,11 @@ node --version
|
|
|
76
84
|
vp-use --unset
|
|
77
85
|
```
|
|
78
86
|
|
|
79
|
-
Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd`
|
|
87
|
+
Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` in the bin directory on Windows.
|
|
80
88
|
|
|
81
|
-
In CI, `vp env use` can
|
|
89
|
+
In CI, `vp env use` can run without shell initialization. It writes a temporary
|
|
90
|
+
session file in the resolved state directory. Later shim calls in the same job
|
|
91
|
+
use this file to select the Node.js version.
|
|
82
92
|
|
|
83
93
|
### Manage
|
|
84
94
|
|
|
@@ -144,7 +154,11 @@ Vite+ creates a `corepack` shim by default, so corepack works without a system N
|
|
|
144
154
|
- On Node.js 25 and later, where corepack is no longer bundled, Vite+ installs corepack as a managed global package on first use. Only the `corepack` binary is linked; run `vp install -g corepack` yourself if you also want the package's pnpm/yarn launchers exposed directly.
|
|
145
155
|
- If you install corepack explicitly with `vp install -g corepack`, that installation is always preferred.
|
|
146
156
|
|
|
147
|
-
`corepack enable` normally creates `pnpm
|
|
157
|
+
`corepack enable` normally creates `pnpm` and `yarn` launchers next to the
|
|
158
|
+
corepack binary. Vite+ does not add that location to `PATH`. The shim sets
|
|
159
|
+
`--install-directory` to the resolved bin directory by default. The launchers
|
|
160
|
+
are then available on `PATH`. They still use the Node.js and package-manager
|
|
161
|
+
versions for the project:
|
|
148
162
|
|
|
149
163
|
```bash
|
|
150
164
|
corepack enable # pnpm and yarn now resolve via corepack
|
package/docs/guide/fmt.md
CHANGED
|
@@ -20,11 +20,11 @@ vp fmt . --write
|
|
|
20
20
|
|
|
21
21
|
Put formatting configuration directly in the `fmt` block in `vite.config.ts` so all your configuration stays in one place. We do not recommend using `.oxfmtrc.json` with Vite+.
|
|
22
22
|
|
|
23
|
-
For editors,
|
|
23
|
+
For editors, disable nested formatter configs so format-on-save uses the root Vite+ `fmt` block:
|
|
24
24
|
|
|
25
25
|
```json [.vscode/settings.json]
|
|
26
26
|
{
|
|
27
|
-
"oxc.fmt.
|
|
27
|
+
"oxc.fmt.disableNestedConfig": true
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -63,6 +63,10 @@ vp run lint # should print "cache hit"
|
|
|
63
63
|
|
|
64
64
|
Restore `node_modules/.vite/task-cache` after `vp install`, because package installation can recreate or modify `node_modules`.
|
|
65
65
|
|
|
66
|
+
Set `<setup-vp-version>` below 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.
|
|
67
|
+
|
|
68
|
+
See [Automatic Version Updates](/guide/ci#automatic-version-updates) to configure Dependabot or Renovate.
|
|
69
|
+
|
|
66
70
|
```yaml [.github/workflows/ci.yml]
|
|
67
71
|
name: CI
|
|
68
72
|
|
|
@@ -80,7 +84,7 @@ jobs:
|
|
|
80
84
|
steps:
|
|
81
85
|
- uses: actions/checkout@v4
|
|
82
86
|
|
|
83
|
-
- uses: voidzero-dev/setup-vp
|
|
87
|
+
- uses: voidzero-dev/setup-vp@<setup-vp-version>
|
|
84
88
|
with:
|
|
85
89
|
node-version: '24'
|
|
86
90
|
cache: true
|
|
@@ -26,7 +26,8 @@ You can also manually set up the VS Code config:
|
|
|
26
26
|
"[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
|
|
27
27
|
"[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
|
|
28
28
|
"[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
|
|
29
|
-
"oxc.
|
|
29
|
+
"oxc.disableNestedConfig": true,
|
|
30
|
+
"oxc.fmt.disableNestedConfig": true,
|
|
30
31
|
"editor.formatOnSave": true,
|
|
31
32
|
"editor.formatOnSaveMode": "file",
|
|
32
33
|
"editor.codeActionsOnSave": {
|
|
@@ -35,7 +36,7 @@ You can also manually set up the VS Code config:
|
|
|
35
36
|
}
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
This gives the project a shared default formatter and enables Oxc-powered fix actions on save. The language-specific override blocks (`[javascript]`, `[typescript]`, etc.) are required because VS Code prioritizes user-level `[language]` settings over the workspace-level `editor.defaultFormatter` — without them, a global Prettier configuration would silently take over. Setting `oxc.
|
|
39
|
+
This gives the project a shared default formatter and enables Oxc-powered fix actions on save. The language-specific override blocks (`[javascript]`, `[typescript]`, etc.) are required because VS Code prioritizes user-level `[language]` settings over the workspace-level `editor.defaultFormatter` — without them, a global Prettier configuration would silently take over. Setting `oxc.disableNestedConfig` and `oxc.fmt.disableNestedConfig` prevents nested Oxlint and Oxfmt configs from diverging from the root Vite+ config. Vite+ uses `formatOnSaveMode: "file"` because Oxfmt does not support partial formatting.
|
|
39
40
|
|
|
40
41
|
To let the VS Code NPM Scripts panel run scripts through `vp`, add the following to your `.vscode/settings.json`:
|
|
41
42
|
|
|
@@ -99,3 +100,61 @@ You can also manually set up the Zed config:
|
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
Setting `oxfmt.fmt.configPath` to `./vite.config.ts` keeps editor format-on-save aligned with the `fmt` block in your Vite+ config. The full generated config covers additional languages (CSS, HTML, JSON, Markdown, etc.) — run `vp create` or `vp migrate` to get the complete file written automatically.
|
|
103
|
+
|
|
104
|
+
## JetBrains (IntelliJ, WebStorm, etc...)
|
|
105
|
+
|
|
106
|
+
For the best Vite+ experience with JetBrains IDEs such as IntelliJ & WebStorm, install the [Oxc](https://plugins.jetbrains.com/plugin/27061-oxc) plugin from the JetBrains marketplace.
|
|
107
|
+
|
|
108
|
+
When you create or migrate a project, Vite+ prompts you to choose whether you want the editor config written for JetBrains IDEs.
|
|
109
|
+
|
|
110
|
+
::: tip Vite+ does not merge with existing config files
|
|
111
|
+
Due to some complexities with merging XML files, Vite+ currently does not merge your current files if the files already exist.
|
|
112
|
+
You'll be given the opportunity to replace any existing files, instead of merging.
|
|
113
|
+
:::
|
|
114
|
+
|
|
115
|
+
You can also manually set up the IDE configuration to match your Vite+ setup:
|
|
116
|
+
|
|
117
|
+
```xml [.idea/externalDependencies.xml]
|
|
118
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
119
|
+
<project version="4">
|
|
120
|
+
<component name="ExternalDependencies">
|
|
121
|
+
<plugin id="com.github.oxc.project.oxcintellijplugin" />
|
|
122
|
+
</component>
|
|
123
|
+
</project>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```xml [.idea/workspace.xml]
|
|
127
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
128
|
+
<project version="4">
|
|
129
|
+
<!-- other settings... -->
|
|
130
|
+
<component name="PropertiesComponent">
|
|
131
|
+
<![CDATA[{
|
|
132
|
+
"keyToString": {
|
|
133
|
+
// other settings
|
|
134
|
+
"javascript.nodejs.core.library.configured.version": "24.18.0", // Replace with your selected Node.js version
|
|
135
|
+
"javascript.nodejs.core.library.typings.version": "24.13.3", // Replace with the version of @types/node that corresponds to your runtime (or omit if you don't want it)
|
|
136
|
+
"javascript.preferred.runtime.type.id": "node",
|
|
137
|
+
"nodejs_interpreter_path": "$USER_HOME$/.vite-plus/bin/node",
|
|
138
|
+
"nodejs_package_manager_path": "pnpm" // Replace with your package manager of choice
|
|
139
|
+
}
|
|
140
|
+
}]]>
|
|
141
|
+
</component>
|
|
142
|
+
</project>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```xml [.idea/OxfmtSettings.xml]
|
|
146
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
147
|
+
<project version="4">
|
|
148
|
+
<component name="OxfmtSettings">
|
|
149
|
+
<option name="preferOxfmtCodeStyleSettings" value="true" />
|
|
150
|
+
</component>
|
|
151
|
+
</project>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Often, `.idea` folders are gitignored in a project, even the `externalDependencies.xml` file, which is used to tell your IDE what plugins should be used for the workspace.
|
|
155
|
+
|
|
156
|
+
Please make sure to add this line to your main `.gitignore` file, to ensure that the file will be included:
|
|
157
|
+
|
|
158
|
+
```gitignore [.gitignore]
|
|
159
|
+
!.idea/externalDependencies.xml
|
|
160
|
+
```
|
package/docs/guide/index.md
CHANGED
|
@@ -4,7 +4,7 @@ Vite+ is the unified toolchain and entry point for web development. It manages y
|
|
|
4
4
|
|
|
5
5
|
Vite+ ships in two parts: `vp`, the global command-line tool, and `vite-plus`, the local package installed in each project. If you already have a Vite project, use [`vp migrate`](/guide/migrate) to migrate it to Vite+, or paste our [migration prompt](/guide/migrate#migration-prompt) into your coding agent.
|
|
6
6
|
|
|
7
|
-
Building with an AI assistant?
|
|
7
|
+
Building with an AI assistant? View and copy a ready-made setup prompt:
|
|
8
8
|
|
|
9
9
|
<CopyPrompt />
|
|
10
10
|
|
|
@@ -93,6 +93,7 @@ Vite+ can handle the entire local frontend development cycle from starting a pro
|
|
|
93
93
|
- [`vp create`](/guide/create) creates new apps, packages, and monorepos.
|
|
94
94
|
- [`vp migrate`](/guide/migrate) moves existing projects onto Vite+.
|
|
95
95
|
- [`vp config`](/guide/commit-hooks) installs the Git hook dispatcher and configures agent integration.
|
|
96
|
+
- [`vp hooks`](/guide/commit-hooks) manages the Git hook dispatcher (`enable`, `disable`, `status`).
|
|
96
97
|
- [`vp staged`](/guide/commit-hooks) runs checks on staged files.
|
|
97
98
|
- [`vp install`](/guide/install) installs dependencies with the right package manager.
|
|
98
99
|
- [`vp env`](/guide/env) manages Node.js versions.
|
|
@@ -126,6 +127,7 @@ Vite+ can handle the entire local frontend development cycle from starting a pro
|
|
|
126
127
|
|
|
127
128
|
### Maintain
|
|
128
129
|
|
|
130
|
+
- [`vp toolchain`](/guide/upgrade#show-the-toolchain) shows the versions and relationships in the active Vite+ toolchain.
|
|
129
131
|
- [`vp upgrade`](/guide/upgrade) updates the `vp` installation itself.
|
|
130
132
|
- [`vp implode`](/guide/implode) removes `vp` and related Vite+ data from your machine.
|
|
131
133
|
|
package/docs/guide/install.md
CHANGED
|
@@ -39,6 +39,13 @@ A range resolves to an already-downloaded satisfying version when possible, othe
|
|
|
39
39
|
|
|
40
40
|
Vite+ currently downloads the declared package manager (the `onFail: "download"` behavior); the other `onFail` values are accepted but not yet differentiated.
|
|
41
41
|
|
|
42
|
+
A `packageManager` pin can carry an integrity hash (`yarn@4.17.1+sha512.…`). `corepack use` writes that hash. Vite+ hashes the same artifact as Corepack:
|
|
43
|
+
|
|
44
|
+
- the extracted CLI binary (`bin/yarn.js`) for Yarn 2 and later
|
|
45
|
+
- the npm package tarball for npm, pnpm, and Yarn Classic
|
|
46
|
+
|
|
47
|
+
Vite+ hashes the CLI once, when it installs Yarn, and records the pin it verified. A later command compares its own pin against that record. A pin that does not match the record fails the check, and the command stops. Corepack keeps the same kind of record for its own cache.
|
|
48
|
+
|
|
42
49
|
The explicit `packageManager` field (or the `devEngines.packageManager` declaration) also affects matching package-manager shims. If a project has `packageManager: "npm@10.9.4"`, `npm` and `npx` use npm 10.9.4. Other generated alias pairs behave the same way: `pnpm`/`pnpx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Mismatched tools are not translated; `npm` in a `pnpm` project still resolves as npm.
|
|
43
50
|
|
|
44
51
|
## Usage
|
|
@@ -74,7 +81,8 @@ Updates keep the version spec a package was installed with: a package installed
|
|
|
74
81
|
::: warning
|
|
75
82
|
These commands do **NOT** interact with the underlying package manager's global installation directory.
|
|
76
83
|
|
|
77
|
-
Instead, Vite+
|
|
84
|
+
Instead, Vite+ stores its global packages in `packages/` under the resolved data
|
|
85
|
+
directory. These packages remain available across different Node.js versions.
|
|
78
86
|
|
|
79
87
|
As a result, commands such as `vp link` do not affect Vite+'s global packages and will not appear in `vp list -g`.
|
|
80
88
|
:::
|
|
@@ -149,6 +157,11 @@ Use these when you need to understand the current state of dependencies.
|
|
|
149
157
|
- `vp why react` explains why `react` is installed
|
|
150
158
|
- `vp info react` shows registry metadata such as versions and dist-tags
|
|
151
159
|
|
|
160
|
+
These commands show the packages that the package manager installed. They do
|
|
161
|
+
not show tools that Vite+ bundles or compiles. Run `vp toolchain [tool]` to show
|
|
162
|
+
these tools, including Vite, Rolldown, and Oxc. For readable output, `vp why`
|
|
163
|
+
shows a hint when Vite+ also provides the package.
|
|
164
|
+
|
|
152
165
|
#### Rebuild
|
|
153
166
|
|
|
154
167
|
Use `vp rebuild` when native modules need to be recompiled, for example after switching Node.js versions or when a C/C++ addon fails to load.
|
|
@@ -167,6 +180,19 @@ vp rebuild -- --update-binary
|
|
|
167
180
|
|
|
168
181
|
With pnpm v10+, bare `vp rebuild` only rebuilds packages whose build scripts are listed in `onlyBuiltDependencies` (or approved via `pnpm approve-builds`); name the package explicitly to force a rebuild that bypasses the approval gate.
|
|
169
182
|
|
|
183
|
+
#### Dependency build scripts (npm v12+)
|
|
184
|
+
|
|
185
|
+
npm v12 skips dependency install scripts (`preinstall` / `install` / `postinstall`, including implicit `node-gyp` builds) unless the `allowScripts` field in package.json covers them; the install succeeds and npm warns about what it skipped. `vp pm approve-builds` manages that allowlist:
|
|
186
|
+
|
|
187
|
+
- `vp pm approve-builds <pkg...>` approves the named packages (`npm approve-scripts`)
|
|
188
|
+
- `vp pm approve-builds !<pkg...>` denies them (`npm deny-scripts`)
|
|
189
|
+
- `vp pm approve-builds --all` approves everything currently pending
|
|
190
|
+
- `vp pm approve-builds` lists the packages whose scripts are not yet covered
|
|
191
|
+
|
|
192
|
+
Approval only records the allowlist: scripts an earlier install skipped do not run until you run `vp rebuild <pkg>`. With npm 11.16 - 11.x the same commands work, but npm treats the allowlist as advisory and still runs scripts.
|
|
193
|
+
|
|
194
|
+
npm v12 also stops resolving git dependencies (`github:`, `git+https:`) and remote tarball URLs by default; such installs fail with `EALLOWGIT` / `EALLOWREMOTE`. Opt back in per project with npm's `allow-git` / `allow-remote` config.
|
|
195
|
+
|
|
170
196
|
#### Advanced
|
|
171
197
|
|
|
172
198
|
Use these when you need lower-level package-manager behavior.
|