vite-plus 0.2.7 → 0.2.9
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/LICENSE +5 -1
- package/README.md +9 -3
- package/bin/vpr +3 -2
- package/binding/index.cjs +193 -80
- package/binding/index.d.cts +106 -11
- package/dist/agent-DQU8uS6P.js +416 -0
- package/dist/bin.js +1388 -23
- package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
- package/dist/client/bundledDevClient.mjs +1 -0
- package/dist/config/bin.js +32 -133
- package/dist/{constants-BsuzPowC.js → constants-CG513DRa.js} +10 -2
- package/dist/create/bin.js +255 -268
- package/dist/{define-config-C2KfLHpC.js → define-config-CV4bQG_8.js} +3 -3
- package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
- package/dist/{define-config-DLh9fE95.cjs → define-config-DyNLA_f0.cjs} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CKz3vcoG.js → dist-BDYZP12R.js} +196 -157
- package/dist/dist-Dqv1-Clg.js +3 -0
- package/dist/{agent-CPwWJ4qf.js → editor-g4PosU99.js} +819 -628
- package/dist/hooks/bin.d.ts +1 -0
- package/dist/hooks/bin.js +130 -0
- package/dist/hooks-pNCBWtFT.js +570 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-DiRs8ceZ.js → json-qlK6UH0r.js} +40 -38
- package/dist/migration/bin.js +65 -58
- package/dist/{oxlint-plugin-config-Bxgc4cwF.js → oxlint-plugin-config-BEZ9IUf7.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +1 -1
- package/dist/{package-Ds3uThLb.js → package-B4T8RGMG.js} +2 -2
- package/dist/{tsconfig-Jia2vgMG.js → prompts-CHz_98bJ.js} +169 -219
- package/dist/{resolve-vite-config-BiuLZnn8.js → resolve-vite-config-Dmeyeyj-.js} +2 -9
- package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
- package/dist/staged/bin.js +241 -226
- package/dist/terminal-Bz-ps6rJ.js +128 -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-7v_BHagU.js +151 -0
- package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-CbDReEOx.js} +5 -3
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +6 -6
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +6 -6
- package/docs/config/index.md +13 -0
- package/docs/config/staged.md +2 -1
- package/docs/guide/ci.md +37 -4
- package/docs/guide/commit-hooks.md +112 -21
- package/docs/guide/create.md +7 -4
- package/docs/guide/env.md +8 -4
- 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 +4 -2
- package/docs/guide/install.md +27 -0
- package/docs/guide/installer-env-vars.md +14 -3
- package/docs/guide/lint.md +3 -1
- package/docs/guide/migrate.md +49 -4
- package/docs/guide/monorepo.md +98 -10
- package/docs/guide/troubleshooting.md +12 -3
- package/docs/guide/upgrade.md +27 -4
- package/docs/package.json +1 -1
- package/docs/pnpm-workspace.yaml +7 -0
- package/docs/vite.config.ts +3 -0
- package/package.json +21 -23
- package/rules/vite-tools.yml +0 -7
- package/dist/dist-CtM2JRbM.js +0 -3
- package/dist/editor-BbT1lTNc.js +0 -675
- package/dist/help-YP84FSEz.js +0 -61
- package/dist/terminal-uTv0ZaMr.js +0 -33
- package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Commit Hooks
|
|
2
2
|
|
|
3
|
-
Use `vp
|
|
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.
|
|
4
5
|
|
|
5
6
|
## Overview
|
|
6
7
|
|
|
@@ -8,16 +9,65 @@ Vite+ supports commit hooks and staged-file checks without additional tooling.
|
|
|
8
9
|
|
|
9
10
|
Use:
|
|
10
11
|
|
|
11
|
-
- `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
|
|
12
14
|
- `vp staged` to run checks against the files currently staged in Git
|
|
13
15
|
|
|
14
16
|
If you use [`vp create`](/guide/create) or [`vp migrate`](/guide/migrate), Vite+ prompts you to set this up for your project automatically.
|
|
15
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
|
+
|
|
16
34
|
## Commands
|
|
17
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
|
+
|
|
18
65
|
### `vp config`
|
|
19
66
|
|
|
20
|
-
`vp config` configures Vite+ for the current project. It installs
|
|
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:
|
|
21
71
|
|
|
22
72
|
```bash
|
|
23
73
|
vp config
|
|
@@ -26,16 +76,24 @@ vp config --no-hooks
|
|
|
26
76
|
vp config --no-agent
|
|
27
77
|
```
|
|
28
78
|
|
|
29
|
-
Use `--no-hooks` when you want `vp config` to leave
|
|
30
|
-
`--no-agent` when you want it to skip updates to existing coding agent instruction files. You
|
|
31
|
-
|
|
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.
|
|
32
84
|
|
|
33
|
-
You can also set `
|
|
85
|
+
You can also set `VP_GIT_HOOKS=0` to disable hook installation from lifecycle scripts such as
|
|
34
86
|
`prepare` or `postinstall`.
|
|
35
87
|
|
|
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.
|
|
92
|
+
|
|
36
93
|
### `vp staged`
|
|
37
94
|
|
|
38
|
-
`vp staged` runs staged-file checks using the `staged` config from `vite.config.ts`.
|
|
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:
|
|
39
97
|
|
|
40
98
|
```bash
|
|
41
99
|
vp staged
|
|
@@ -43,6 +101,10 @@ vp staged --verbose
|
|
|
43
101
|
vp staged --fail-on-changes
|
|
44
102
|
```
|
|
45
103
|
|
|
104
|
+
```sh [.vite-hooks/pre-commit]
|
|
105
|
+
vp staged
|
|
106
|
+
```
|
|
107
|
+
|
|
46
108
|
## Configuration
|
|
47
109
|
|
|
48
110
|
Define staged-file checks in the `staged` block in `vite.config.ts`:
|
|
@@ -57,7 +119,12 @@ export default defineConfig({
|
|
|
57
119
|
});
|
|
58
120
|
```
|
|
59
121
|
|
|
60
|
-
This is the default Vite+ approach and should replace separate `lint-staged` configuration in most
|
|
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.
|
|
61
128
|
|
|
62
129
|
## Disabling Hooks in Specific Environments
|
|
63
130
|
|
|
@@ -65,13 +132,13 @@ The installed hooks check the environment on every run, so you can disable them
|
|
|
65
132
|
|
|
66
133
|
### Environment variable
|
|
67
134
|
|
|
68
|
-
Set `
|
|
135
|
+
Set `VP_GIT_HOOKS=0` in the environment of the process that runs `git commit`, and every Vite+ hook exits immediately without running:
|
|
69
136
|
|
|
70
137
|
```bash
|
|
71
|
-
|
|
138
|
+
VP_GIT_HOOKS=0 git commit -m "content update"
|
|
72
139
|
```
|
|
73
140
|
|
|
74
|
-
`HUSKY=0` is honored the same way for ecosystem tooling compatibility. Setting `
|
|
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.
|
|
75
142
|
|
|
76
143
|
### Init script
|
|
77
144
|
|
|
@@ -83,27 +150,51 @@ Before checking the environment variable, each hook sources an init script if on
|
|
|
83
150
|
To disable hooks for a whole machine, create the init script and export the variable there:
|
|
84
151
|
|
|
85
152
|
```sh [~/.config/vite-plus/hooks-init.sh]
|
|
86
|
-
export
|
|
153
|
+
export VP_GIT_HOOKS=0
|
|
87
154
|
```
|
|
88
155
|
|
|
89
156
|
Because the hook itself reads this file, it works even when the committing process does not inherit your shell environment, for example if a daemon or web server is making commits.
|
|
90
157
|
|
|
91
158
|
## Removing commit hooks
|
|
92
159
|
|
|
93
|
-
To
|
|
94
|
-
|
|
95
|
-
1. Unset the Git hooks path that points at the Vite+ dispatcher:
|
|
160
|
+
To stop using the Vite+ hook dispatcher in this clone (and keep `prepare` / `vp config` from
|
|
161
|
+
reinstalling it):
|
|
96
162
|
|
|
97
163
|
```bash
|
|
98
|
-
|
|
164
|
+
vp hooks disable
|
|
165
|
+
# or, if you used a custom directory:
|
|
166
|
+
vp hooks disable --hooks-dir .custom-hooks
|
|
99
167
|
```
|
|
100
168
|
|
|
101
|
-
|
|
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:
|
|
102
177
|
|
|
103
178
|
```bash
|
|
104
|
-
|
|
179
|
+
vp hooks enable
|
|
105
180
|
```
|
|
106
181
|
|
|
107
|
-
|
|
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:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
git config --unset core.hooksPath
|
|
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
|
|
196
|
+
```
|
|
108
197
|
|
|
109
|
-
|
|
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.
|
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
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
Managed mode is on by default, so `node`, `npm`, and related shims resolve through Vite+ and pick the right Node.js version for the current project.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Vite+ checks the current directory first, then walks up through its parents. The nearest directory
|
|
10
|
+
with a supported declaration wins. Within each directory, sources are checked in this order:
|
|
10
11
|
|
|
11
|
-
1. `.node-version` file
|
|
12
|
+
1. `.node-version` file
|
|
12
13
|
2. `devEngines.runtime` in `package.json` (the [devEngines standard](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines))
|
|
13
14
|
3. `engines.node` in `package.json`
|
|
14
|
-
4.
|
|
15
|
+
4. `.nvmrc` file
|
|
16
|
+
|
|
17
|
+
If no directory declares a version, Vite+ uses the global default (`vp env default`) and then the
|
|
18
|
+
latest LTS.
|
|
15
19
|
|
|
16
20
|
`devEngines.runtime` ranks above `engines.node` because it declares the development-environment requirement, while `engines.node` is a consumer-facing support range. `vp env doctor` warns when declared sources conflict.
|
|
17
21
|
|
|
@@ -112,7 +116,7 @@ vp env print # Print shell snippet for this session
|
|
|
112
116
|
|
|
113
117
|
# Manage
|
|
114
118
|
vp env pin lts # Pin the project to the latest LTS release
|
|
115
|
-
vp env install # Install the version from .node-version or
|
|
119
|
+
vp env install # Install the version from .node-version, package.json, or .nvmrc
|
|
116
120
|
vp env default lts # Set the global default version
|
|
117
121
|
vp env use 20 # Use Node.js 20 for the current shell session
|
|
118
122
|
vp env use --unset # Remove the session override
|
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
|
|
|
@@ -92,7 +92,8 @@ Vite+ can handle the entire local frontend development cycle from starting a pro
|
|
|
92
92
|
|
|
93
93
|
- [`vp create`](/guide/create) creates new apps, packages, and monorepos.
|
|
94
94
|
- [`vp migrate`](/guide/migrate) moves existing projects onto Vite+.
|
|
95
|
-
- [`vp config`](/guide/commit-hooks)
|
|
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
|
|
@@ -69,6 +76,8 @@ Use the `-g` flag for installing, updating or removing globally installed packag
|
|
|
69
76
|
- `vp list -g [pkg]` lists global packages
|
|
70
77
|
- `vp outdated -g [pkg]` prints outdated packages
|
|
71
78
|
|
|
79
|
+
Updates keep the version spec a package was installed with: a package installed from a dist-tag (e.g. `vp install -g some-pkg@nightly`) updates to the newest version of that tag, and a version range stays within the range. Reinstall with a different spec (e.g. `vp update -g some-pkg@latest`) to switch, or pass `--latest` to `vp update -g` to move packages to the `latest` tag and clear their recorded specs. `vp outdated -g` reports both the newest version matching the recorded spec (`Wanted`) and the newest version on the `latest` tag.
|
|
80
|
+
|
|
72
81
|
::: warning
|
|
73
82
|
These commands do **NOT** interact with the underlying package manager's global installation directory.
|
|
74
83
|
|
|
@@ -147,6 +156,11 @@ Use these when you need to understand the current state of dependencies.
|
|
|
147
156
|
- `vp why react` explains why `react` is installed
|
|
148
157
|
- `vp info react` shows registry metadata such as versions and dist-tags
|
|
149
158
|
|
|
159
|
+
These commands show the packages that the package manager installed. They do
|
|
160
|
+
not show tools that Vite+ bundles or compiles. Run `vp toolchain [tool]` to show
|
|
161
|
+
these tools, including Vite, Rolldown, and Oxc. For readable output, `vp why`
|
|
162
|
+
shows a hint when Vite+ also provides the package.
|
|
163
|
+
|
|
150
164
|
#### Rebuild
|
|
151
165
|
|
|
152
166
|
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.
|
|
@@ -165,6 +179,19 @@ vp rebuild -- --update-binary
|
|
|
165
179
|
|
|
166
180
|
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.
|
|
167
181
|
|
|
182
|
+
#### Dependency build scripts (npm v12+)
|
|
183
|
+
|
|
184
|
+
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:
|
|
185
|
+
|
|
186
|
+
- `vp pm approve-builds <pkg...>` approves the named packages (`npm approve-scripts`)
|
|
187
|
+
- `vp pm approve-builds !<pkg...>` denies them (`npm deny-scripts`)
|
|
188
|
+
- `vp pm approve-builds --all` approves everything currently pending
|
|
189
|
+
- `vp pm approve-builds` lists the packages whose scripts are not yet covered
|
|
190
|
+
|
|
191
|
+
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.
|
|
192
|
+
|
|
193
|
+
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.
|
|
194
|
+
|
|
168
195
|
#### Advanced
|
|
169
196
|
|
|
170
197
|
Use these when you need lower-level package-manager behavior.
|
|
@@ -100,6 +100,17 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
|
|
|
100
100
|
- **Default**: None (verification enabled)
|
|
101
101
|
- **Details**: [Node.js Signature Verification](/guide/env#node-js-signature-verification)
|
|
102
102
|
|
|
103
|
+
### `VP_DOWNLOAD_TIMEOUT`
|
|
104
|
+
|
|
105
|
+
- **Purpose**: Per-request timeout, in seconds, for large downloads such as Node.js runtimes and package-manager tarballs
|
|
106
|
+
- **Values**: Positive integer, at most `86400` (24 hours); invalid values are ignored with a warning
|
|
107
|
+
- **Default**: `600` (10 minutes)
|
|
108
|
+
- **Example**:
|
|
109
|
+
```bash
|
|
110
|
+
# Allow up to 30 minutes per download on a slow connection
|
|
111
|
+
VP_DOWNLOAD_TIMEOUT=1800 vp env install 22
|
|
112
|
+
```
|
|
113
|
+
|
|
103
114
|
### `VP_SHELL`
|
|
104
115
|
|
|
105
116
|
- **Purpose**: Specify the current shell
|
|
@@ -147,14 +158,14 @@ Vite+ sets additional `VP_*` variables during shim dispatch and shell integratio
|
|
|
147
158
|
|
|
148
159
|
## Logging and Debugging
|
|
149
160
|
|
|
150
|
-
### `
|
|
161
|
+
### `VP_LOG`
|
|
151
162
|
|
|
152
163
|
- **Purpose**: Log filter string for `tracing_subscriber`
|
|
153
164
|
- **Default**: None
|
|
154
165
|
- **Example**:
|
|
155
166
|
```bash
|
|
156
|
-
|
|
157
|
-
|
|
167
|
+
VP_LOG=debug vp dev
|
|
168
|
+
VP_LOG=vt=trace vp build
|
|
158
169
|
```
|
|
159
170
|
|
|
160
171
|
### `VP_DEBUG_SHIM`
|
package/docs/guide/lint.md
CHANGED
|
@@ -43,8 +43,10 @@ We recommend enabling both `typeAware` and `typeCheck` in the `lint` block:
|
|
|
43
43
|
- `typeAware: true` enables rules that require TypeScript type information
|
|
44
44
|
- `typeCheck: true` enables full type checking during linting
|
|
45
45
|
|
|
46
|
-
This path is powered by [tsgolint](https://github.com/oxc-project/tsgolint) on top of the TypeScript Go toolchain. It gives Oxlint access to type information and allows type checking directly via `vp lint` and `vp check`.
|
|
46
|
+
This path is powered by [tsgolint](https://github.com/oxc-project/tsgolint) on top of the TypeScript 7 (aka TypeScript Go) toolchain. It gives Oxlint access to type information and allows type checking directly via `vp lint` and `vp check`.
|
|
47
47
|
|
|
48
48
|
## JS Plugins
|
|
49
49
|
|
|
50
50
|
If you are migrating from ESLint and still depend on a few critical JavaScript-based ESLint plugins, Oxlint has [JS plugin support](https://oxc.rs/docs/guide/usage/linter/js-plugins) that can help you keep those plugins running while you complete the migration.
|
|
51
|
+
|
|
52
|
+
JS Plugins also enable [writing your own custom rules](https://oxc.rs/docs/guide/usage/linter/writing-js-plugins.html) for Oxlint.
|
package/docs/guide/migrate.md
CHANGED
|
@@ -22,6 +22,9 @@ The positional `PATH` argument is optional.
|
|
|
22
22
|
|
|
23
23
|
- If omitted, `vp migrate` migrates the current directory
|
|
24
24
|
- If provided, it migrates that target directory instead
|
|
25
|
+
- For a monorepo, the target must be the workspace root. Vite+ cannot
|
|
26
|
+
migrate one workspace member, because migration updates the package-manager
|
|
27
|
+
configuration, the catalogs, and the lockfiles that all members share.
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
30
|
vp migrate
|
|
@@ -69,6 +72,40 @@ After running the migration:
|
|
|
69
72
|
- Run `vp test`
|
|
70
73
|
- Run `vp build`
|
|
71
74
|
|
|
75
|
+
## Manual Installation & Migration
|
|
76
|
+
|
|
77
|
+
If you are manually migrating a project to Vite+, install these dev dependencies first:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
vp install -D vite-plus
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
You need to add overrides to your package manager so that other packages resolve the Vite+ versions: alias `vite` to `@voidzero-dev/vite-plus-core`, and pin `vitest` to the version Vite+ bundles (run `vp --version`) so the whole project shares a single Vitest copy with `vp test`. Without the `vitest` pin, a dependency or workspace package can pull a different Vitest than the bundled runner, splitting Vitest's internals (mocks, `expect`, runner state):
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
"overrides": {
|
|
87
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
88
|
+
"vitest": "4.1.10"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If you are using `pnpm`, add this to your `pnpm-workspace.yaml`:
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
overrides:
|
|
96
|
+
vite: npm:@voidzero-dev/vite-plus-core@latest
|
|
97
|
+
vitest: 4.1.10
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or, if you are using Yarn:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
"resolutions": {
|
|
104
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
105
|
+
"vitest": "4.1.10"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
72
109
|
## Migration Prompt
|
|
73
110
|
|
|
74
111
|
If you want to hand this work to a coding agent (or the reader is a coding agent!), use this migration prompt:
|
|
@@ -168,17 +205,25 @@ export default defineConfig({
|
|
|
168
205
|
});
|
|
169
206
|
```
|
|
170
207
|
|
|
171
|
-
|
|
208
|
+
When no existing hook policy owns the workflow, `vp migrate` can move supported lint-staged rules
|
|
209
|
+
and remove the old configuration and dependency. If an existing hook tool is preserved, keep
|
|
210
|
+
lint-staged in place until you convert that hook policy manually. See the
|
|
211
|
+
[Commit hooks guide](/guide/commit-hooks) and [Staged config reference](/config/staged) for details.
|
|
172
212
|
|
|
173
213
|
### Git hook tools
|
|
174
214
|
|
|
175
|
-
The `vp migrate` command
|
|
215
|
+
The `vp migrate` command does not automatically convert Husky setups. When Husky is detected,
|
|
216
|
+
Vite+ leaves its hooks, lifecycle scripts, configuration, and dependencies unchanged and shows a
|
|
217
|
+
warning. You can migrate the project manually using the [Commit hooks guide](/guide/commit-hooks).
|
|
218
|
+
|
|
219
|
+
Existing project-owned Vite+ hooks are also preserved. The default staged workflow is introduced
|
|
220
|
+
only when no existing hook policy is found.
|
|
176
221
|
|
|
177
222
|
If your project currently uses `lefthook`, `simple-git-hooks`, or `yorkie`, `vp migrate` will leave your existing configuration alone and show a warning. This happens even if you choose to set up hooks during the prompt or include the `--hooks` flag.
|
|
178
223
|
|
|
179
|
-
If you want to move one of those tools over to Vite+ manually, you can follow these steps. First, move your staged-file commands into the `staged` block within `vite.config.ts`. Then, update your lifecycle script so it runs `vp config`. You will also need to create a Vite+ hook at `.vite-hooks/pre-commit` that runs `vp staged`. Finally, once you have confirmed that the Vite+ hook is working as expected, you can remove the old tool's configuration and dependency.
|
|
224
|
+
If you want to move one of those tools over to Vite+ manually, you can follow these steps. First, move your staged-file commands into the `staged` block within `vite.config.ts`. Then, update your lifecycle script so it runs `vp config`. You will also need to create a Vite+ hook at `.vite-hooks/pre-commit` that runs `vp staged`. Run `vp hooks enable` (or `vp config`) to install the dispatcher and set `core.hooksPath`. Finally, once you have confirmed that the Vite+ hook is working as expected, you can remove the old tool's configuration and dependency.
|
|
180
225
|
|
|
181
|
-
You can find more details about the full Vite+ hook setup in the [Commit hooks guide](/guide/commit-hooks).
|
|
226
|
+
Use `vp hooks status` to verify the dispatcher is active, and `vp hooks disable` if you need to turn it off again in this clone. You can find more details about the full Vite+ hook setup in the [Commit hooks guide](/guide/commit-hooks).
|
|
182
227
|
|
|
183
228
|
## Examples
|
|
184
229
|
|