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.
- package/LICENSE +35 -146
- package/README.md +3 -3
- package/binding/index.cjs +140 -55
- package/binding/index.d.cts +49 -0
- package/dist/{agent-C59HKB4Y.js → agent-Dinpyd-k.js} +6 -5
- package/dist/bin.js +48 -18
- package/dist/config/bin.js +2 -2
- package/dist/constants-CiKwrA0v.js +356 -0
- package/dist/create/bin.js +96 -71
- package/dist/{define-config-DPNEJxPz.d.ts → define-config-B9usMnEa.d.ts} +51 -10
- package/dist/{define-config-DpAPETDf.cjs → define-config-CBccpane.cjs} +173 -44
- package/dist/{define-config-DAaCa0U_.js → define-config-jhuYJ7Tb.js} +158 -42
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/documentation-DqcZSthV.js +11 -0
- package/dist/{editor-QOIGtmH4.js → editor-DMBczTdj.js} +216 -152
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +3122 -15
- package/dist/{oxlint-plugin-config-BU42tr8y.js → oxlint-plugin-config-BgsDA6ua.js} +1 -1
- package/dist/oxlint-plugin.js +9 -7
- package/dist/pack-bin.js +1 -1
- package/dist/{package-BB-Jh_z3.js → package-B85H2Nw0.js} +6 -2
- package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
- package/dist/{prompts-CujFOJXu.js → prompts-CQobX7uP.js} +2 -2
- package/dist/{resolve-vite-config-CHHjsjKJ.js → resolve-vite-config-BUFUmi8h.js} +2 -2
- package/dist/{resolve-vite-config-6Nox70uP.js → resolve-vite-config-I8fmpR7I.js} +1 -1
- package/dist/staged/bin.js +1205 -3317
- package/dist/sync-versions/bin.js +3 -2
- package/dist/sync-versions/bin.mjs +17 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.js +1 -1
- package/dist/test/browser/providers/preview/context.js +1 -1
- package/dist/test/browser-playwright/context.js +1 -1
- package/dist/test/browser-preview/context.js +1 -1
- package/dist/test/context.d.ts +2 -942
- package/dist/test/context.js +1 -1
- package/dist/test/internal/traces.js +1 -0
- package/dist/test/locators.d.ts +2 -294
- package/dist/test/matchers.d.ts +2 -29
- package/dist/test/mocker.d.ts +2 -0
- package/dist/test/mocker.js +1 -0
- package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.d.ts +2 -0
- package/dist/test/plugins/browser-playwright.d.ts +2 -0
- package/dist/test/plugins/browser-preview.d.ts +2 -0
- package/dist/test/plugins/browser.d.ts +2 -0
- package/dist/test/plugins/mocker-automock.d.ts +2 -0
- package/dist/test/plugins/mocker-browser.d.ts +2 -0
- package/dist/test/plugins/mocker-node.d.ts +2 -0
- package/dist/test/plugins/mocker-redirect.d.ts +2 -0
- package/dist/test/plugins/mocker-register.d.ts +2 -0
- package/dist/test/plugins/mocker-transforms.d.ts +2 -0
- package/dist/test/plugins/mocker.d.ts +2 -0
- package/dist/test/plugins/pretty-format.d.ts +2 -0
- package/dist/test/plugins/snapshot-environment.d.ts +2 -0
- package/dist/test/plugins/snapshot-manager.d.ts +2 -0
- package/dist/test/plugins/snapshot.d.ts +2 -0
- package/dist/test/plugins/spy.d.ts +2 -0
- package/dist/test/plugins/utils-constants.d.ts +2 -0
- package/dist/test/plugins/utils-diff.d.ts +2 -0
- package/dist/test/plugins/utils-display.d.ts +2 -0
- package/dist/test/plugins/utils-error.d.ts +2 -0
- package/dist/test/plugins/utils-helpers.d.ts +2 -0
- package/dist/test/plugins/utils-offset.d.ts +2 -0
- package/dist/test/plugins/utils-resolver.d.ts +2 -0
- package/dist/test/plugins/utils-serialize.d.ts +2 -0
- package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
- package/dist/test/plugins/utils-source-map.d.ts +2 -0
- package/dist/test/plugins/utils-timers.d.ts +2 -0
- package/dist/test/plugins/utils.d.ts +2 -0
- package/dist/toolchain.js +10 -10
- package/dist/toolchain.json +10 -10
- package/dist/{tsconfig-DCtWfQPA.js → tsconfig-Buo0RSzz.js} +8 -4
- package/dist/{tsconfig-MXktI3SX.js → tsconfig-C1VeTG9k.js} +1 -1
- package/dist/version.js +5 -3
- package/dist/versions.js +5 -5
- package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
- package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
- package/docs/config/fmt.md +2 -2
- package/docs/config/lint.md +2 -2
- package/docs/config/run.md +1 -1
- package/docs/config/staged.md +1 -2
- package/docs/guide/check.md +2 -0
- package/docs/guide/ci.md +28 -31
- package/docs/guide/commit-hooks.md +18 -34
- package/docs/guide/create.md +1 -2
- package/docs/guide/docker.md +20 -68
- package/docs/guide/env.md +47 -32
- package/docs/guide/fmt.md +4 -2
- package/docs/guide/global-cli.md +426 -0
- package/docs/guide/ide-integration.md +1 -2
- package/docs/guide/implode.md +14 -1
- package/docs/guide/index.md +38 -35
- package/docs/guide/install.md +18 -20
- package/docs/guide/lint.md +6 -10
- package/docs/guide/local-cli.md +123 -0
- package/docs/guide/migrate-rules.md +104 -297
- package/docs/guide/migrate.md +82 -59
- package/docs/guide/monorepo.md +5 -1
- package/docs/guide/run.md +1 -1
- package/docs/guide/test.md +2 -0
- package/docs/guide/troubleshooting.md +6 -11
- package/docs/guide/upgrade-project.md +61 -0
- package/docs/guide/upgrade.md +17 -62
- package/docs/guide/vitest-v5.md +221 -0
- package/package.json +67 -90
- package/bin/oxfmt +0 -33
- package/bin/oxlint +0 -38
- package/dist/cli-truncate-Bg3RDXpi.js +0 -865
- package/dist/constants-IhOditRA.js +0 -80
- package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
- package/dist/log-update-CoW8Z4Dl.js +0 -491
- package/dist/strip-ansi-C3wrWz9t.js +0 -853
- package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
- package/dist/test/browser/providers/webdriverio/context.js +0 -1
- package/dist/test/browser/providers/webdriverio.d.ts +0 -77
- package/dist/test/browser/providers/webdriverio.js +0 -1
- package/dist/test/browser-webdriverio/context.d.ts +0 -1
- package/dist/test/browser-webdriverio.d.ts +0 -77
- package/dist/test/browser-webdriverio.js +0 -1
- package/dist/test/coverage.d.ts +0 -2
- package/dist/test/coverage.js +0 -1
- package/dist/test/environments.d.ts +0 -2
- package/dist/test/environments.js +0 -1
- package/dist/test/plugins/browser-webdriverio.js +0 -1
- package/dist/test/plugins/expect.js +0 -1
- package/dist/test/plugins/runner-types.js +0 -1
- package/dist/test/plugins/runner-utils.js +0 -1
- package/dist/test/plugins/runner.js +0 -1
- package/dist/test/reporters.d.ts +0 -2
- package/dist/test/reporters.js +0 -1
- package/dist/test/runners.d.ts +0 -2
- package/dist/test/runners.js +0 -1
- package/dist/test/snapshot.d.ts +0 -2
- package/dist/test/snapshot.js +0 -1
- package/dist/test/suite.d.ts +0 -2
- package/dist/test/suite.js +0 -1
- package/dist/tsgolint-path-CbDReEOx.js +0 -34
- package/dist/tsgolint-path.d.ts +0 -7
- package/dist/tsgolint-path.js +0 -2
- package/dist/wrap-ansi-DNjkuBEp.js +0 -157
- package/dist/wrap-ansi-DUi52C6W.js +0 -2
- package/docs/guide/installer-env-vars.md +0 -286
package/docs/guide/index.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
# Getting Started
|
|
2
2
|
|
|
3
|
-
Vite+ is the unified toolchain and entry point for web development.
|
|
3
|
+
Vite+ is the unified toolchain and entry point for web development.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It brings together [Vite](https://vite.dev/), [Vitest](https://vitest.dev/), [Oxlint](https://oxc.rs/docs/guide/usage/linter.html), [Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html), [Rolldown](https://rolldown.rs/), [tsdown](https://tsdown.dev/), and [Vite Task](https://github.com/voidzero-dev/vite-task) in a single [`vite-plus` package](/guide/local-cli) for a blazing fast frontend toolchain.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Vite+ also ships a [global `vp` CLI](/guide/global-cli) that manages Node.js and package managers and makes Vite+ easier to use across projects. You can use either CLI independently, but we recommend [using them together](/guide/global-cli#use-both-clis-together).
|
|
8
|
+
|
|
9
|
+
If you already have a Vite project, run [`vp migrate`](/guide/migrate) to migrate it to Vite+, or give your coding agent our [migration prompt](/guide/migrate#migration-prompt).
|
|
10
|
+
|
|
11
|
+
Building with an AI assistant? View and copy a prompt to create a new project, migrate an existing project, or upgrade Vite+:
|
|
8
12
|
|
|
9
13
|
<CopyPrompt />
|
|
10
14
|
|
|
11
|
-
## Install `vp`
|
|
15
|
+
## Install `vp` Globally
|
|
16
|
+
|
|
17
|
+
The commands below install the global `vp` CLI, which manages Node.js and package managers and makes `vp` available across projects. If you only need the frontend toolchain in a single project, you can install the [project-local CLI](/guide/local-cli#install) instead.
|
|
12
18
|
|
|
13
19
|
### macOS / Linux
|
|
14
20
|
|
|
@@ -28,7 +34,9 @@ Alternatively, download and run [`vp-setup.exe`](https://setup.viteplus.dev).
|
|
|
28
34
|
The `vp-setup.exe` is not yet code-signed. Your browser may show a warning when downloading. Click **"..."** → **"Keep"** → **"Keep anyway"** to proceed. If Windows Defender SmartScreen blocks the file when you run it, click **"More info"** → **"Run anyway"**.
|
|
29
35
|
:::
|
|
30
36
|
|
|
31
|
-
The installer scripts and `vp-setup.exe` read [environment variables](/guide/
|
|
37
|
+
The installer scripts and `vp-setup.exe` read [environment variables](/guide/global-cli#installation-variables) such as `VP_VERSION` and `VP_HOME`.
|
|
38
|
+
|
|
39
|
+
If you use Nushell with custom XDG directories, read the [Nushell startup requirements](/guide/global-cli#nushell-and-xdg-directories) before installing.
|
|
32
40
|
|
|
33
41
|
After installation, open a new shell and run:
|
|
34
42
|
|
|
@@ -71,7 +79,7 @@ This is required because the managed [unofficial-builds](https://unofficial-buil
|
|
|
71
79
|
|
|
72
80
|
## Quick Start
|
|
73
81
|
|
|
74
|
-
|
|
82
|
+
With the global CLI installed, create a project, install dependencies, and use the default commands:
|
|
75
83
|
|
|
76
84
|
```bash
|
|
77
85
|
vp create # Create a new project
|
|
@@ -82,54 +90,49 @@ vp test # Run JavaScript tests
|
|
|
82
90
|
vp build # Build for production
|
|
83
91
|
```
|
|
84
92
|
|
|
85
|
-
You can also
|
|
93
|
+
You can also run `vp` on its own to open the interactive command line. In a local-only setup, run the same commands through your package manager, such as `pnpm exec vp check`.
|
|
86
94
|
|
|
87
95
|
## Core Commands
|
|
88
96
|
|
|
89
|
-
Vite+
|
|
97
|
+
Vite+ covers the full frontend development cycle, from starting a project through development, checks, tests, and production builds. Most commands are available from both distributions; machine-level environment and self-management commands require the global CLI.
|
|
90
98
|
|
|
91
|
-
###
|
|
99
|
+
### Set Up a Project
|
|
92
100
|
|
|
93
101
|
- [`vp create`](/guide/create) creates new apps, packages, and monorepos.
|
|
94
102
|
- [`vp migrate`](/guide/migrate) moves existing projects onto Vite+.
|
|
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`).
|
|
97
|
-
- [`vp staged`](/guide/commit-hooks) runs checks on staged files.
|
|
98
103
|
- [`vp install`](/guide/install) installs dependencies with the right package manager.
|
|
99
|
-
- [`vp
|
|
104
|
+
- [`vp add`](/guide/install), [`vp remove`](/guide/install), [`vp update`](/guide/install), [`vp dedupe`](/guide/install), [`vp outdated`](/guide/install), [`vp list`](/guide/install), [`vp why`](/guide/install), and [`vp info`](/guide/install) cover the rest of the package-management workflow.
|
|
105
|
+
- [`vp link`](/guide/install), [`vp unlink`](/guide/install), [`vp rebuild`](/guide/install), and [`vp pm <command>`](/guide/install) provide lower-level package-manager operations.
|
|
100
106
|
|
|
101
|
-
###
|
|
107
|
+
### Project Toolchain
|
|
102
108
|
|
|
103
|
-
- [`vp dev`](/guide/dev) starts the dev server powered by Vite.
|
|
104
109
|
- [`vp check`](/guide/check) runs format, lint, and type checks together.
|
|
105
|
-
- [`vp lint`](/guide/lint)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
- [`vp lint`](/guide/lint) and [`vp fmt`](/guide/fmt) run the individual checks directly.
|
|
111
|
+
- [`vp test`](/guide/test) runs tests with Vitest.
|
|
112
|
+
- [`vp dev`](/guide/dev) starts the development server powered by Vite.
|
|
113
|
+
- [`vp build`](/guide/build) builds apps, and [`vp preview`](/guide/build) previews the production build locally.
|
|
114
|
+
- [`vp pack`](/guide/pack) builds libraries or standalone artifacts.
|
|
115
|
+
- [`vp toolchain`](/guide/upgrade#show-the-toolchain) shows the active project toolchain; use `--global` to inspect the global installation instead.
|
|
109
116
|
- [`vp run`](/guide/run) runs tasks across workspaces with caching.
|
|
110
|
-
- [`vp exec`](/guide/vpx) runs local project binaries.
|
|
111
|
-
- [`vp node`](/guide/env) runs Node.js scripts with the resolved Vite+ environment.
|
|
112
|
-
- [`vp dlx`](/guide/vpx) downloads and runs package binaries without adding them as dependencies.
|
|
113
117
|
- [`vp cache clean`](/guide/cache) clears task cache entries.
|
|
114
|
-
- [`vpx`](/guide/vpx)
|
|
118
|
+
- [`vp exec`](/guide/vpx) runs local project binaries, while [`vp dlx`](/guide/vpx) and [`vpx`](/guide/vpx) download and run package binaries.
|
|
119
|
+
- [`vp config`](/guide/commit-hooks) installs the Git hook dispatcher and configures agent integration.
|
|
120
|
+
- [`vp hooks`](/guide/commit-hooks) manages the Git hook dispatcher, and [`vp staged`](/guide/commit-hooks) runs checks on staged files.
|
|
121
|
+
- [Monorepo Guide](/guide/monorepo) covers multi-package project structure and commands.
|
|
115
122
|
|
|
116
|
-
###
|
|
123
|
+
### Global CLI
|
|
117
124
|
|
|
118
|
-
- [`vp
|
|
119
|
-
- [`vp
|
|
120
|
-
- [`vp
|
|
125
|
+
- [`vp env`](/guide/env) manages Node.js and package-manager environments, and [`vp node`](/guide/env) runs scripts with the resolved environment.
|
|
126
|
+
- [`vp upgrade`](/guide/upgrade) updates the global `vp` installation itself.
|
|
127
|
+
- [`vp implode`](/guide/implode) removes the global `vp` installation and related Vite+ data from your machine.
|
|
121
128
|
|
|
122
|
-
###
|
|
129
|
+
### Workflow
|
|
123
130
|
|
|
124
|
-
- [
|
|
125
|
-
- [`vp link`](/guide/install), [`vp unlink`](/guide/install), and [`vp rebuild`](/guide/install) cover local package links and native module rebuilds.
|
|
126
|
-
- [`vp pm <command>`](/guide/install) calls other package manager commands directly.
|
|
131
|
+
- [IDE Integration](/guide/ide-integration), [CI](/guide/ci), and [Docker](/guide/docker) cover common development and deployment environments.
|
|
127
132
|
|
|
128
|
-
###
|
|
133
|
+
### Reference
|
|
129
134
|
|
|
130
|
-
- [
|
|
131
|
-
- [`vp upgrade`](/guide/upgrade) updates the `vp` installation itself.
|
|
132
|
-
- [`vp implode`](/guide/implode) removes `vp` and related Vite+ data from your machine.
|
|
135
|
+
- [Troubleshooting](/guide/troubleshooting) covers common command, configuration, and integration problems.
|
|
133
136
|
|
|
134
137
|
::: info
|
|
135
138
|
Vite+ ships with many predefined commands such as `vp build`, `vp test`, and `vp dev`. These commands are built-in and cannot be changed. If you want to run a command from your `package.json` scripts, use `vp run <command>` or `vpr <command>`.
|
package/docs/guide/install.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Package Management
|
|
2
2
|
|
|
3
|
-
`vp
|
|
3
|
+
`vp` detects and runs the current workspace's package manager. These commands are available from both the [global CLI](/guide/global-cli) and the [project-local CLI](/guide/local-cli).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -21,8 +21,6 @@ Vite+ detects the package manager from the workspace root in this order:
|
|
|
21
21
|
|
|
22
22
|
If none of those files are present, `vp` falls back to `pnpm` by default. Vite+ automatically downloads the matching package manager and uses it for the command you ran, but package-manager detection never rewrites `package.json`. Use `vp env pin <package-manager>@<version>` when the project should declare an exact version explicitly.
|
|
23
23
|
|
|
24
|
-
After selecting the package manager, Vite+ forwards the command without separately validating whether `package.json` exists. Missing-manifest behavior therefore matches the selected package manager.
|
|
25
|
-
|
|
26
24
|
The [`devEngines.packageManager`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines) field accepts a single object or an array of objects, and its `version` may be a semver range:
|
|
27
25
|
|
|
28
26
|
```json
|
|
@@ -41,14 +39,7 @@ A range resolves to an already-downloaded satisfying version when possible, othe
|
|
|
41
39
|
|
|
42
40
|
Vite+ currently downloads the declared package manager (the `onFail: "download"` behavior); the other `onFail` values are accepted but not yet differentiated.
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- the extracted CLI binary (`bin/yarn.js`) for Yarn 2 and later
|
|
47
|
-
- the npm package tarball for npm, pnpm, and Yarn Classic
|
|
48
|
-
|
|
49
|
-
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.
|
|
50
|
-
|
|
51
|
-
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.
|
|
42
|
+
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 aliases behave the same way: `pnpm`/`pnpx`/`pn`/`pnx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Mismatched tools are not translated; `npm` in a `pnpm` project still resolves as npm.
|
|
52
43
|
|
|
53
44
|
## Usage
|
|
54
45
|
|
|
@@ -83,8 +74,7 @@ Updates keep the version spec a package was installed with: a package installed
|
|
|
83
74
|
::: warning
|
|
84
75
|
These commands do **NOT** interact with the underlying package manager's global installation directory.
|
|
85
76
|
|
|
86
|
-
Instead, Vite+ stores its global packages in `packages/` under the resolved data
|
|
87
|
-
directory. These packages remain available across different Node.js versions.
|
|
77
|
+
Instead, Vite+ stores its global packages in `packages/` under the resolved data directory. These packages remain available across different Node.js versions.
|
|
88
78
|
|
|
89
79
|
As a result, commands such as `vp link` do not affect Vite+'s global packages and will not appear in `vp list -g`.
|
|
90
80
|
:::
|
|
@@ -122,6 +112,10 @@ Use `vp install` when you want to install exactly what the current `package.json
|
|
|
122
112
|
- `vp install --filter <pattern>` scopes install work in monorepos
|
|
123
113
|
- `vp install -w` installs in the workspace root
|
|
124
114
|
|
|
115
|
+
##### Git and remote tarball dependencies (npm v12+)
|
|
116
|
+
|
|
117
|
+
npm v12 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.
|
|
118
|
+
|
|
125
119
|
#### Global Install
|
|
126
120
|
|
|
127
121
|
Use these commands when you want package-manager-managed tools available outside a single project.
|
|
@@ -160,10 +154,7 @@ Use these when you need to understand the current state of dependencies.
|
|
|
160
154
|
- `vp why react` explains why `react` is installed
|
|
161
155
|
- `vp info react` shows registry metadata such as versions and dist-tags
|
|
162
156
|
|
|
163
|
-
These commands show the packages that the package manager installed. They do
|
|
164
|
-
not show tools that Vite+ bundles or compiles. Run `vp toolchain [tool]` to show
|
|
165
|
-
these tools, including Vite, Rolldown, and Oxc. For readable output, `vp why`
|
|
166
|
-
shows a hint when Vite+ also provides the package.
|
|
157
|
+
These commands show the packages that the package manager installed. They do not show tools that Vite+ bundles or compiles. Run `vp toolchain [tool]` to show these tools, including Vite, Rolldown, and Oxc. For readable output, `vp why` shows a hint when Vite+ also provides the package.
|
|
167
158
|
|
|
168
159
|
#### Rebuild
|
|
169
160
|
|
|
@@ -194,8 +185,6 @@ npm v12 skips dependency install scripts (`preinstall` / `install` / `postinstal
|
|
|
194
185
|
|
|
195
186
|
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.
|
|
196
187
|
|
|
197
|
-
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.
|
|
198
|
-
|
|
199
188
|
#### Advanced
|
|
200
189
|
|
|
201
190
|
Use these when you need lower-level package-manager behavior.
|
|
@@ -228,3 +217,12 @@ vp pm stage reject <stage-id> # discard a staged version (2FA)
|
|
|
228
217
|
- pnpm (`pnpm stage`, requires pnpm ≥ 11.3) and npm (`npm stage`, requires npm ≥ 11.15 and Node ≥ 22.14) pass through directly.
|
|
229
218
|
- yarn (Berry) uses its npm plugin (`yarn npm publish --staged`, `yarn npm stage …`); `view`/`download` fall back to npm.
|
|
230
219
|
- yarn Classic and bun have no staged-publishing support and fall back to `npm stage`.
|
|
220
|
+
|
|
221
|
+
## Package-Manager Integrity Verification
|
|
222
|
+
|
|
223
|
+
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:
|
|
224
|
+
|
|
225
|
+
- the extracted CLI binary (`bin/yarn.js`) for Yarn 2 and later
|
|
226
|
+
- the npm package tarball for npm, pnpm, and Yarn Classic
|
|
227
|
+
|
|
228
|
+
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.
|
package/docs/guide/lint.md
CHANGED
|
@@ -20,7 +20,9 @@ vp lint --type-aware
|
|
|
20
20
|
|
|
21
21
|
Put lint configuration directly in the `lint` block in the root `vite.config.ts` so all your configuration stays in one place. We do not recommend using `oxlint.config.ts` or `.oxlintrc.json` with Vite+.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
When the workspace-root config has a `lint` block, `vp lint` and `vp check` use it even when run from a package directory. Package configs cannot replace the root rules or disable its `typeAware` and `typeCheck` options. Commands keep the package working directory, so relative file arguments retain their meaning. Use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) for file- or package-specific rules.
|
|
24
|
+
|
|
25
|
+
An explicit `vp lint -c <path>` or `vp lint --config <path>` selects another config. Otherwise, when running from the workspace root or when the root config has no `lint` block, Oxlint discovers the nearest `vite.config.*` file with a `lint` block. Supported extensions are `.js`, `.mjs`, `.ts`, `.cjs`, `.mts`, and `.cts`. Nested configs do not override settings for individual files.
|
|
24
26
|
|
|
25
27
|
For the upstream rule set, options, and compatibility details, see the [Oxlint docs](https://oxc.rs/docs/guide/usage/linter.html).
|
|
26
28
|
|
|
@@ -96,14 +98,8 @@ export default defineConfig({
|
|
|
96
98
|
|
|
97
99
|
For rule tests, `RuleTester` is available from `vite-plus/lint/plugins-dev`.
|
|
98
100
|
|
|
99
|
-
Both entrypoints re-export the copy that ships with Vite+. The API therefore
|
|
100
|
-
always matches the bundled Oxlint.
|
|
101
|
+
Both entrypoints re-export the copy that ships with Vite+. The API therefore always matches the bundled Oxlint.
|
|
101
102
|
|
|
102
|
-
Use them instead of adding `@oxlint/plugins` or `oxlint` as a direct
|
|
103
|
-
dependency. A separately pinned copy can drift from the linter that loads your
|
|
104
|
-
plugin. It also does not resolve from a plugin file under pnpm's strict layout,
|
|
105
|
-
unless every package that holds a plugin declares it.
|
|
103
|
+
Use them instead of adding `@oxlint/plugins` or `oxlint` as a direct dependency. A separately pinned copy can drift from the linter that loads your plugin. It also does not resolve from a plugin file under pnpm's strict layout, unless every package that holds a plugin declares it.
|
|
106
104
|
|
|
107
|
-
`vp migrate` rewrites existing `oxlint` and `@oxlint/plugins` imports for you.
|
|
108
|
-
See [Oxlint JS Plugin Imports](/guide/migrate-rules#oxlint-js-plugin-imports).
|
|
109
|
-
The `vite-plus/prefer-vite-plus-imports` rule reports any that come back.
|
|
105
|
+
`vp migrate` rewrites existing `oxlint` and `@oxlint/plugins` imports for you. See [Oxlint JS Plugin Imports](/guide/migrate-rules#oxlint-js-plugin-imports). The `vite-plus/prefer-vite-plus-imports` rule reports any that come back.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Project-local CLI
|
|
2
|
+
|
|
3
|
+
Different from [global `vp` cli](/guide/global-cli), the `vite-plus` is a npm package which contains the project-local `vp` CLI and the integrated frontend toolchain. Install it as a development dependency when you want the toolchain version recorded in the project's manifest and lockfile, or when you do not want to install the standalone global CLI.
|
|
4
|
+
|
|
5
|
+
The local package includes Vite, Rolldown, Vitest, Oxlint, Oxfmt, tsdown, the Vite+ task runner, and package-manager commands. It requires an existing Node.js runtime and package manager.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
For most of use cases, we recommend to use Vite+ cli to install in a project or create a new project. Learn more in [Creating a Project](/guide/create) and [Migrate to Vite+](/guide/migrate).
|
|
10
|
+
|
|
11
|
+
::: code-group
|
|
12
|
+
|
|
13
|
+
```bash [pnpm]
|
|
14
|
+
pnpm dlx --package=vite-plus vp create
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash [npm]
|
|
18
|
+
npx --package=vite-plus vp create
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash [Yarn]
|
|
22
|
+
yarn dlx --package vite-plus vp create
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash [Bun]
|
|
26
|
+
bunx --package vite-plus vp create
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
:::
|
|
30
|
+
|
|
31
|
+
Run its binary through your package manager. For example:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
./node_modules/.bin/vp migrate --help
|
|
35
|
+
./node_modules/.bin/vp check
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The documentation uses bare `vp` commands for readability. Without the global CLI, prefix interactive commands with your package manager's local-binary executor, such as `pnpm exec`.
|
|
39
|
+
|
|
40
|
+
### Manual Installation
|
|
41
|
+
|
|
42
|
+
If you are manually migrating a project to Vite+, install these dev dependencies first:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
vp install -D vite-plus
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
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):
|
|
49
|
+
|
|
50
|
+
::: code-group
|
|
51
|
+
|
|
52
|
+
```yaml [pnpm-workspace.yaml]
|
|
53
|
+
overrides:
|
|
54
|
+
vite: npm:@voidzero-dev/vite-plus-core@latest
|
|
55
|
+
vitest: 5.0.1
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```json [npm / Bun package.json]
|
|
59
|
+
"overrides": {
|
|
60
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
61
|
+
"vitest": "5.0.1"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```json [Yarn package.json]
|
|
66
|
+
"resolutions": {
|
|
67
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
68
|
+
"vitest": "5.0.1"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
:::
|
|
73
|
+
|
|
74
|
+
::: details Why are these settings needed?
|
|
75
|
+
|
|
76
|
+
Dependencies and plugins can import `vite` or `vitest` directly, even when your own code imports from `vite-plus`. These overrides align their dependencies with the toolchain Vite+ uses:
|
|
77
|
+
|
|
78
|
+
- The `vite` alias directs those imports to Vite+'s core package. Separate Vite instances can break runtime identity checks: [issue #1391](https://github.com/voidzero-dev/vite-plus/issues/1391) reported TanStack Start returning 404s because an `instanceof` check crossed two copies. [PR #2617](https://github.com/voidzero-dev/vite-plus/pull/2617) addresses the CLI side by sharing Vite through the same alias.
|
|
79
|
+
- The exact `vitest` pin keeps dependencies and `vp test` on the same Vitest version, avoiding separate mocks, `expect` instances, and runner state. [PR #2365](https://github.com/voidzero-dev/vite-plus/pull/2365) documents this requirement for manual installation.
|
|
80
|
+
|
|
81
|
+
Keep the core alias aligned with your installed `vite-plus` version and update the Vitest pin to match its bundled version when upgrading. [Issue #2356](https://github.com/voidzero-dev/vite-plus/issues/2356) describes how dependency bots can update these packages independently and leave incompatible versions installed together.
|
|
82
|
+
|
|
83
|
+
:::
|
|
84
|
+
|
|
85
|
+
## Best Practices
|
|
86
|
+
|
|
87
|
+
We recommend using the [global CLI](/guide/global-cli) together with the project-local CLI. The global CLI makes `vp` available directly in your terminal and delegates development commands such as `vp dev`, `vp build`, and `vp test` to the project's installed `vite-plus` package. This gives you convenient access to the toolchain while keeping its version controlled by the project. You can also use only the project-local CLI if you prefer.
|
|
88
|
+
|
|
89
|
+
For open-source projects or any project with collaborators, we recommend adding `package.json` scripts that call `vp`, whether you use both CLIs or only the project-local CLI. Inside scripts, `vp` resolves automatically from `node_modules/.bin`:
|
|
90
|
+
|
|
91
|
+
```json [package.json]
|
|
92
|
+
{
|
|
93
|
+
"scripts": {
|
|
94
|
+
"dev": "vp dev",
|
|
95
|
+
"check": "vp check",
|
|
96
|
+
"test": "vp test",
|
|
97
|
+
"build": "vp build"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
After installing the project's dependencies, contributors can run these scripts through their package manager, such as `pnpm run dev` or `npm run dev`, without being required to install the global CLI.
|
|
103
|
+
|
|
104
|
+
## What It Includes
|
|
105
|
+
|
|
106
|
+
The project-local CLI can be used independently for:
|
|
107
|
+
|
|
108
|
+
- [`vp dev`](/guide/dev), [`vp build`](/guide/build), and [`vp preview`](/guide/build) with Vite and Rolldown
|
|
109
|
+
- [`vp check`](/guide/check), [`vp lint`](/guide/lint), and [`vp fmt`](/guide/fmt) with Oxc
|
|
110
|
+
- [`vp test`](/guide/test) with Vitest
|
|
111
|
+
- [`vp pack`](/guide/pack) with tsdown
|
|
112
|
+
- [`vp toolchain`](/guide/upgrade#show-the-toolchain) for inspecting the versions bundled with the project-local package
|
|
113
|
+
- [`vp run`](/guide/run) and task caching across workspaces
|
|
114
|
+
- [package-manager commands](/guide/install) using the Node.js runtime already active in your shell
|
|
115
|
+
- [`vp create`](/guide/create), [`vp migrate`](/guide/migrate), and project configuration commands
|
|
116
|
+
|
|
117
|
+
The local package cannot manage the machine-level Vite+ installation. The `vp env`, `vp upgrade`, and `vp implode` commands require the [global CLI](/guide/global-cli). Upgrade or remove a local-only installation through your package manager.
|
|
118
|
+
|
|
119
|
+
## Add the Global CLI Later
|
|
120
|
+
|
|
121
|
+
You can install the global CLI at any time without changing the project's dependency. Commands such as `vp dev`, `vp build`, and `vp test` will continue to use the project's installed `vite-plus` version.
|
|
122
|
+
|
|
123
|
+
See [Use Both CLIs Together](/guide/global-cli#use-both-clis-together) for the selection rules.
|