vite-plus 1.4.0 → 1.5.1
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/binding/index.cjs +116 -55
- package/binding/index.d.cts +31 -0
- package/dist/{agent-D8oxxhVR.js → agent-CowvWq3j.js} +2 -2
- package/dist/bin.js +30 -8
- package/dist/config/bin.js +5 -5
- package/dist/{constants-DRUnJ_Dz.js → constants-D5f7inVN.js} +6 -2
- package/dist/create/bin.js +115 -65
- package/dist/{define-config-Cv2P6NT2.cjs → define-config-BGCfAiIo.cjs} +35 -3
- package/dist/{define-config-rPhYIFSn.d.ts → define-config-BrvHRi-G.d.ts} +30 -2
- package/dist/{define-config-ChwJcu5e.js → define-config-XKYhw0xH.js} +30 -5
- package/dist/define-config.cjs +2 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +1 -1
- package/dist/{editor-ClL78D8u.js → editor-BVaNnIey.js} +1266 -884
- package/dist/hooks/bin.js +2 -2
- package/dist/{hooks-xRcJPc-O.js → hooks-w_e2whkQ.js} +40 -21
- package/dist/index.cjs +4 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +1302 -311
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BVpqYdcC.js → oxlint-plugin-config-5hVqz4kj.js} +1 -1
- package/dist/oxlint-plugin.js +29 -4
- package/dist/pack-bin.js +2 -2
- package/dist/{package-DzsomcUD.js → package-DLUCo6L_.js} +1 -1
- package/dist/{prompts-GL1vj0wk.js → prompts-DLpJGhfK.js} +3 -3
- package/dist/register.d.ts +1 -0
- package/dist/register.js +12 -0
- package/dist/{report-DLHO30yZ.js → report-BEdpIQvC.js} +2 -0
- package/dist/{resolve-vite-config-Dn5896A4.js → resolve-vite-config-D-JtjGRa.js} +2 -2
- package/dist/{resolve-vite-config-QO6cC0SP.js → resolve-vite-config-D7IUZYKq.js} +1 -1
- package/dist/script-esm-hooks.d.ts +5 -2
- package/dist/script-esm-hooks.js +5 -2
- package/dist/script-preload.cjs +24 -1
- package/dist/script-register.js +7 -2
- package/dist/script-watch.js +135 -41
- package/dist/staged/bin.js +2 -2
- package/dist/sync-versions/bin.js +1 -1
- package/dist/toolchain.js +14 -14
- package/dist/toolchain.json +14 -14
- package/dist/{tsconfig-LE_mAwe_.js → tsconfig-D3DiCiW6.js} +2 -2
- package/dist/{tsconfig-Do6MAG_f.js → tsconfig-DLERIAbF.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +7 -7
- package/docs/config/check.md +2 -0
- package/docs/config/fmt.md +1 -1
- package/docs/config/lint.md +1 -1
- package/docs/config/run.md +6 -2
- package/docs/config/staged.md +1 -1
- package/docs/guide/check.md +5 -1
- package/docs/guide/ci.md +2 -2
- package/docs/guide/create.md +1 -1
- package/docs/guide/env.md +1 -1
- package/docs/guide/global-cli.md +13 -9
- package/docs/guide/homebrew.md +127 -0
- package/docs/guide/ide-integration.md +1 -3
- package/docs/guide/implode.md +5 -3
- package/docs/guide/index.md +4 -4
- package/docs/guide/local-cli.md +22 -1
- package/docs/guide/migrate-rules.md +81 -22
- package/docs/guide/migrate.md +9 -9
- package/docs/guide/package-management/add.md +84 -0
- package/docs/guide/package-management/approve-builds.md +48 -0
- package/docs/guide/package-management/audit.md +39 -0
- package/docs/guide/package-management/cache.md +53 -0
- package/docs/guide/package-management/ci.md +28 -0
- package/docs/guide/package-management/config.md +119 -0
- package/docs/guide/package-management/dedupe.md +32 -0
- package/docs/guide/package-management/deprecate.md +39 -0
- package/docs/guide/package-management/dist-tag.md +61 -0
- package/docs/guide/package-management/dlx.md +40 -0
- package/docs/guide/package-management/fund.md +32 -0
- package/docs/guide/package-management/global-packages.md +32 -0
- package/docs/guide/package-management/index.md +78 -0
- package/docs/guide/package-management/info.md +35 -0
- package/docs/guide/package-management/install.md +89 -0
- package/docs/guide/package-management/licenses.md +42 -0
- package/docs/guide/package-management/link.md +29 -0
- package/docs/guide/package-management/list.md +60 -0
- package/docs/guide/package-management/login.md +34 -0
- package/docs/guide/package-management/logout.md +34 -0
- package/docs/guide/package-management/outdated.md +60 -0
- package/docs/guide/package-management/owner.md +79 -0
- package/docs/guide/package-management/pack.md +40 -0
- package/docs/guide/package-management/package-manager-selection.md +60 -0
- package/docs/guide/package-management/patch-commit.md +27 -0
- package/docs/guide/package-management/patch.md +29 -0
- package/docs/guide/package-management/ping.md +32 -0
- package/docs/guide/package-management/pkg.md +88 -0
- package/docs/guide/package-management/prune.md +34 -0
- package/docs/guide/package-management/publish.md +61 -0
- package/docs/guide/package-management/rebuild.md +31 -0
- package/docs/guide/package-management/remove.md +47 -0
- package/docs/guide/package-management/search.md +38 -0
- package/docs/guide/package-management/stage.md +175 -0
- package/docs/guide/package-management/team.md +140 -0
- package/docs/guide/package-management/token.md +87 -0
- package/docs/guide/package-management/unlink.md +33 -0
- package/docs/guide/package-management/update.md +62 -0
- package/docs/guide/package-management/version.md +36 -0
- package/docs/guide/package-management/whoami.md +30 -0
- package/docs/guide/package-management/why.md +55 -0
- package/docs/guide/run.md +23 -1
- package/docs/guide/test.md +1 -1
- package/docs/guide/troubleshooting.md +1 -1
- package/docs/guide/upgrade.md +12 -6
- package/docs/guide/vitest-v5.md +2 -2
- package/docs/guide/vpx.md +45 -5
- package/package.json +40 -34
- package/docs/guide/package-management.md +0 -269
package/docs/guide/local-cli.md
CHANGED
|
@@ -87,6 +87,27 @@ overrides:
|
|
|
87
87
|
|
|
88
88
|
:::
|
|
89
89
|
|
|
90
|
+
::: warning Existing direct dependencies with npm
|
|
91
|
+
If your npm project already lists `vite` in `dependencies` or `devDependencies`, change that entry to the same alias as `overrides.vite`. npm requires a direct dependency and its override to use the [same dependency specification](https://docs.npmjs.com/cli/v11/configuring-npm/package-json/#overrides). Otherwise, `npm install` fails with `EOVERRIDE`.
|
|
92
|
+
|
|
93
|
+
For example, update an existing `vite` development dependency as follows. Keep the other dependencies in your manifest:
|
|
94
|
+
|
|
95
|
+
```json [package.json]
|
|
96
|
+
{
|
|
97
|
+
"devDependencies": {
|
|
98
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@<vite-plus-version>",
|
|
99
|
+
"vite-plus": "<vite-plus-version>"
|
|
100
|
+
},
|
|
101
|
+
"overrides": {
|
|
102
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@<vite-plus-version>",
|
|
103
|
+
"vitest": "<vitest-version>"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If you also declare `vitest` directly, set its dependency entry to the exact version in `overrides.vitest`. Run `npm install` after these changes to update the lockfile and installed dependencies.
|
|
109
|
+
:::
|
|
110
|
+
|
|
90
111
|
::: details Why are these settings needed?
|
|
91
112
|
|
|
92
113
|
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:
|
|
@@ -127,7 +148,7 @@ The project-local CLI can be used independently for:
|
|
|
127
148
|
- [`vp pack`](/guide/pack) with tsdown
|
|
128
149
|
- [`vp toolchain`](/guide/upgrade#show-the-toolchain) for inspecting the versions bundled with the project-local package
|
|
129
150
|
- [`vp run`](/guide/run) and task caching across workspaces
|
|
130
|
-
- [package-manager commands](/guide/package-management) using the Node.js runtime already active in your shell
|
|
151
|
+
- [package-manager commands](/guide/package-management/) using the Node.js runtime already active in your shell
|
|
131
152
|
- [`vp create`](/guide/create), [`vp migrate`](/guide/migrate), and project configuration commands
|
|
132
153
|
|
|
133
154
|
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.
|
|
@@ -200,7 +200,7 @@ Object-valued nested npm and Bun overrides are preserved: they are user-defined
|
|
|
200
200
|
|
|
201
201
|
`vite` and `vite/*` imports are rewritten to `vite-plus` **only in config entry files**: `vite.config.*`, `vitest.config.*`, and any config file the migration resolved. Every other file keeps its `vite` imports, for two reasons:
|
|
202
202
|
|
|
203
|
-
- `vite-plus` is not a guaranteed superset of Vite's exposed surface. It owns only `defineConfig`, `defineProject`, and `
|
|
203
|
+
- `vite-plus` is not a guaranteed superset of Vite's exposed surface. It owns only `defineConfig`, `defineProject`, `lazyPlugins`, and `resolveConfigFromFile`, so rewriting a pass-through symbol such as `createBuilder` or `loadConfigFromFile` (including in `typeof import('vite')` type positions) can break.
|
|
204
204
|
- An unrewritten `vite` import still resolves through the `@voidzero-dev/vite-plus-core` alias in a Vite+ project.
|
|
205
205
|
|
|
206
206
|
Plugin packages (an unscoped name starting with `vite-plugin-` or `unplugin-`, or `vite` in `peerDependencies`/`dependencies`) skip the rewrite even in config files. Only the `vite` specifier is in scope for this rule.
|
|
@@ -250,18 +250,20 @@ The `prefer-vite-plus-imports` lint rule follows the same Nuxt exception, so lin
|
|
|
250
250
|
|
|
251
251
|
Migration rewrites commands provided by the Vite+ toolchain in `package.json` scripts while preserving their arguments:
|
|
252
252
|
|
|
253
|
-
| Before | After
|
|
254
|
-
| ------------- |
|
|
255
|
-
| `vite` | `vp dev`, or the matching `vp` subcommand
|
|
256
|
-
| `vitest` | `vp test`
|
|
257
|
-
| `oxlint` | `vp lint`
|
|
258
|
-
| `oxfmt` | `vp fmt`
|
|
259
|
-
| `tsdown` | `vp pack`
|
|
260
|
-
| `lint-staged` | `vp staged`
|
|
261
|
-
| `eslint` | `vp lint`, when its optional migration runs
|
|
262
|
-
| `prettier` | `vp fmt`, when its optional migration runs
|
|
263
|
-
| `tsup` | `vp pack`, when its optional migration runs
|
|
264
|
-
| `tsx` | `vpx`, when its optional migration runs
|
|
253
|
+
| Before | After |
|
|
254
|
+
| ------------- | -------------------------------------------- |
|
|
255
|
+
| `vite` | `vp dev`, or the matching `vp` subcommand |
|
|
256
|
+
| `vitest` | `vp test` |
|
|
257
|
+
| `oxlint` | `vp lint` |
|
|
258
|
+
| `oxfmt` | `vp fmt` |
|
|
259
|
+
| `tsdown` | `vp pack` |
|
|
260
|
+
| `lint-staged` | `vp staged` |
|
|
261
|
+
| `eslint` | `vp lint`, when its optional migration runs |
|
|
262
|
+
| `prettier` | `vp fmt`, when its optional migration runs |
|
|
263
|
+
| `tsup` | `vp pack`, when its optional migration runs |
|
|
264
|
+
| `tsx` | `vpx`, when its optional migration runs |
|
|
265
|
+
| `oxnode` | `vpx`, when its optional migration runs |
|
|
266
|
+
| `ts-node` | `vpx`, for supported transpile-only commands |
|
|
265
267
|
|
|
266
268
|
For commands launched through `bunx`, migration preserves `bunx` and its `--bun` flag (keeping the user's chosen runtime) and rewrites only the managed command. tsx is the exception: `bunx tsx` becomes `vpx`, and `bunx --bun tsx` keeps tsx (see [tsx to `vpx`](#tsx-to-vpx)). This also works when `bunx` follows a command-launcher delimiter such as `run` or `--`:
|
|
267
269
|
|
|
@@ -278,23 +280,80 @@ Unrelated `bunx` commands and other package-executor forms remain unchanged.
|
|
|
278
280
|
|
|
279
281
|
When a `package.json` script, a lint-staged task, or a `#!/usr/bin/env tsx` shebang runs [tsx](https://tsx.is), migration offers to move it to [`vpx`](/guide/vpx), Vite+'s TypeScript script runner. It rewrites scripts and lint-staged tasks in `package.json` and JSON lint-staged files, and `#!/usr/bin/env tsx` shebangs in script files:
|
|
280
282
|
|
|
281
|
-
| Before | After
|
|
282
|
-
| -------------------------------------------------------------------------- |
|
|
283
|
-
| `tsx src/seed.ts --rows 10` | `vpx src/seed.ts --rows 10`
|
|
284
|
-
| `tsx watch --include "*.json" src/a.ts` | `vpx --watch --include "*.json" src/a.ts`
|
|
285
|
-
| `npx tsx a.ts`, `pnpm exec tsx a.ts`, `pnpm dlx tsx a.ts`, `bunx tsx a.ts` | `vpx a.ts`
|
|
286
|
-
| `node --import tsx ./a.ts` | `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
283
|
+
| Before | After |
|
|
284
|
+
| -------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
285
|
+
| `tsx src/seed.ts --rows 10` | `vpx src/seed.ts --rows 10` |
|
|
286
|
+
| `tsx watch --include "*.json" src/a.ts` | `vpx --watch --include "*.json" src/a.ts` |
|
|
287
|
+
| `npx tsx a.ts`, `pnpm exec tsx a.ts`, `pnpm dlx tsx a.ts`, `bunx tsx a.ts` | `vpx a.ts` |
|
|
288
|
+
| `node --import tsx ./a.ts` | `node --import vite-plus/register ./a.ts` |
|
|
289
|
+
| `node --import=tsx --test` | `node --import=vite-plus/register --test` |
|
|
290
|
+
| `NODE_OPTIONS='--import tsx' mocha` | `NODE_OPTIONS='--import vite-plus/register' mocha` |
|
|
291
|
+
| `cross-env NODE_ENV=dev tsx a.ts` | `cross-env NODE_ENV=dev vpx a.ts` |
|
|
292
|
+
| `concurrently "tsx watch a.ts" "vp dev"` | `concurrently "vpx --watch a.ts" "vp dev"` |
|
|
289
293
|
|
|
290
294
|
`tsx watch` becomes `vpx --watch`, never `vpx watch`, which runs the npm package `watch`. Node.js options and tsx watch options keep their order, and `--no-cache` is dropped. A quoted command is rewritten only for programs that run it, such as `concurrently`, `nodemon --exec`, `sh -c`, and `cross-env-shell`; a quoted argument of other programs, as in `echo "tsx a.ts"`, is data. `vpx` needs the same Node.js versions as Vite+ itself, and migration already upgrades incompatible runtime pins to them (see [Vitest 5](/guide/vitest-v5)).
|
|
291
295
|
|
|
292
|
-
|
|
296
|
+
The plain `node --import tsx` and `node --import=tsx` forms keep Node.js, its options, wrappers, and arguments. They use [`vite-plus/register`](/guide/vpx#using-nodejs-directly), so Node.js retains its eval, test discovery, and native watch behavior. Literal `NODE_OPTIONS` assignments also migrate, including assignments through `cross-env` and known command launchers. `vite-plus/register` accepts `TSX_TSCONFIG_PATH` as a fallback. Assignments that also load a legacy tsx hook, or reach a command that still needs tsx, stay unchanged.
|
|
297
|
+
|
|
298
|
+
For the tsx executable and legacy loader forms such as `--loader tsx/esm` and `-r tsx/cjs`, migration keeps the existing `vpx` rules. It keeps tsx, with a warning, for `--eval`, `--print`, or `--check`, the REPL, `--test` without files or in watch mode, an entry without a file extension, or commands that load tsx through `NODE_OPTIONS`. Commands with pipes, variables, or subshells also stay unchanged. `vpx` accepts `TSX_TSCONFIG_PATH` as a fallback too; an explicit `--tsconfig` takes priority.
|
|
299
|
+
|
|
300
|
+
Both migration paths read the scripts a command names, including local `--require` and `--import` modules. They keep tsx when a script does not exist yet, as when an earlier command generates it, or when the Vite+ loader would fail on it: a `require()` of `./a.js` that only tsx resolves to `a.ts`, a `.cts` file with `import` or `export`, or a file that mixes `import` with `__dirname`, `__filename`, `require()`, or `module.exports` in a package without `"type": "module"`. This check skips globs and scripts after a `cd` or another shell state change, and reads only the files a command names, not the modules they import. It does not look for other compiler differences, such as standard decorators, tsconfig `paths` in `require()`, or a tsconfig `module` of `node16` or `nodenext`; the loader reports those when the script runs. A package that lists tsx in `dependencies`, `optionalDependencies`, or `peerDependencies` keeps it too, since the replacement comes from the `vite-plus` devDependency.
|
|
293
301
|
|
|
294
302
|
Migration removes the `tsx` devDependency only when nothing uses tsx anymore: no kept script, no import of `tsx` or its subpaths such as `tsx/esm/api` (in source, build output, or a `package.json` `imports` alias), no shebang, no tool setting such as `--import=tsx` in `package.json` or a JSON or JavaScript config, and no tsx command in CI workflows, git hooks, or shell scripts. The root's dependency stays while any workspace package still uses tsx, and a package's dependency stays while a nested package under it does. When tsx stays, the warning names what still uses it.
|
|
295
303
|
|
|
304
|
+
Tool configurations and source files need manual edits. For example, change `nodeArguments: ['--import=tsx']` to `nodeArguments: ['--import=vite-plus/register']`, or Mocha's `"import": "tsx"` setting to `"import": "vite-plus/register"`. Keep tsx if the project uses its programmatic APIs.
|
|
305
|
+
|
|
296
306
|
See [Coming from tsx](/guide/vpx#coming-from-tsx) for the other differences.
|
|
297
307
|
|
|
308
|
+
### oxnode to `vpx`
|
|
309
|
+
|
|
310
|
+
Migration offers to replace `oxnode`, the command from `@oxc-node/cli`, with `vpx`. It rewrites `package.json` scripts, lint-staged tasks in `package.json` and JSON files, and `#!/usr/bin/env oxnode` shebangs. Node.js preload shebangs such as `#!/usr/bin/env -S node --import @oxc-node/core/register` keep Node.js and use `vite-plus/register`, including in extensionless scripts. The migration preserves the shebang's `env` syntax, flags, and relative paths. On a project that already uses Vite+, run `vp migrate --full` to include this migration.
|
|
311
|
+
|
|
312
|
+
| Before | After |
|
|
313
|
+
| --------------------------------------------------------- | ---------------------------------------------------- |
|
|
314
|
+
| `oxnode ./scripts/seed.ts` | `vpx ./scripts/seed.ts` |
|
|
315
|
+
| `oxnode -C dev ./build.ts` | `vpx -C dev ./build.ts` |
|
|
316
|
+
| `oxnode watch --include "config/*.json" ./server.ts` | `vpx --watch --include "config/*.json" ./server.ts` |
|
|
317
|
+
| `node --import @oxc-node/core/register ./scripts/seed.ts` | `node --import vite-plus/register ./scripts/seed.ts` |
|
|
318
|
+
| `NODE_OPTIONS='--import @oxc-node/core/register' mocha` | `NODE_OPTIONS='--import vite-plus/register' mocha` |
|
|
319
|
+
|
|
320
|
+
The `node --import @oxc-node/core/register` and `register.mjs` forms keep Node.js, its wrappers, arguments, and native watch, eval, and test modes. Literal `NODE_OPTIONS` assignments also use the public preload. Commands that use the `oxnode` executable follow the `vpx` rules instead: `oxnode --watch` stays unchanged because it starts Node.js's watcher, while `oxnode watch` and `vpx --watch` use oxc-node's watcher.
|
|
321
|
+
|
|
322
|
+
Commands that explicitly set `OXC_TRANSFORM_ALL` to anything other than `typescript` stay unchanged. Nonempty `VP_SCRIPT_TSCONFIG` and `TSX_TSCONFIG_PATH` assignments also stay unchanged because they would change config selection. Commands that read an environment file stay unchanged because it can select a different transform mode. Migration checks the named script and local preloads for standalone oxc-node API usage, which would configure a different loader after migration; it does not follow their imports.
|
|
323
|
+
|
|
324
|
+
Custom asynchronous `--loader` and `--experimental-loader` hooks stay in their original order when the register import changes. This supports project loaders for resolution and assets alongside the Vite+ TypeScript loader. It does not establish compatibility with a second TypeScript transformer or arbitrary synchronous `module.registerHooks()` chains.
|
|
325
|
+
|
|
326
|
+
Direct `oxnode` commands and Node.js preload commands stay unchanged when an additional `--require` or `--import` can change loader settings. Node.js commands also stay unchanged when inline code still calls standalone oxc-node APIs. Migration checks explicit local shebang loaders relative to the owning package for standalone API references, without following their imports. It leaves the paths unchanged: at runtime, relative loader paths use the caller's working directory, not the script's directory.
|
|
327
|
+
|
|
328
|
+
The `@oxc-node/cli` and `@oxc-node/core` development dependencies are removed only when no remaining use needs them. Loader references, API imports, CI commands, hooks, and shell scripts can keep these dependencies installed. Migration also checks files named by `--env-file` and `--env-file-if-exists`, regardless of their filename. If it cannot resolve or read an environment file, it keeps the dependencies for manual review. Runtime and peer dependencies stay in place.
|
|
329
|
+
|
|
330
|
+
### ts-node to `vpx`
|
|
331
|
+
|
|
332
|
+
Migration offers to replace supported ts-node commands with `vpx` only when type-checking is explicitly disabled. Plain `ts-node` type-checks before execution; `vpx` does not. Commands that still type-check stay unchanged with a warning, even when another option enables transpile-only mode.
|
|
333
|
+
|
|
334
|
+
| Before | After |
|
|
335
|
+
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
336
|
+
| `ts-node --transpileOnly ./scripts/seed.ts` | `vpx ./scripts/seed.ts` |
|
|
337
|
+
| `ts-node -T -P tsconfig.scripts.json ./scripts/seed.ts` | `vpx --tsconfig=tsconfig.scripts.json ./scripts/seed.ts` |
|
|
338
|
+
| `ts-node-transpile-only ./scripts/seed.ts` | `vpx ./scripts/seed.ts` |
|
|
339
|
+
| `node -r ts-node/register/transpile-only ./scripts/seed.ts` | `node --import vite-plus/register ./scripts/seed.ts` |
|
|
340
|
+
| `node --loader ts-node/esm/transpile-only ./scripts/seed.ts` | `node --import vite-plus/register ./scripts/seed.ts` |
|
|
341
|
+
| `NODE_OPTIONS='--require ts-node/register/transpile-only' node ./scripts/seed.ts` | `NODE_OPTIONS='--import vite-plus/register' node ./scripts/seed.ts` |
|
|
342
|
+
|
|
343
|
+
The migration also reads `transpileOnly` and `typeCheck` from local JSONC tsconfig files, local `extends` chains, and literal `TS_NODE_TRANSPILE_ONLY` / `TS_NODE_TYPE_CHECK` assignments. `-P`, `--project`, and `TS_NODE_PROJECT` select the configuration. A directory passed to `-P` or `--project` resolves to its `tsconfig.json`; a directory in `TS_NODE_PROJECT` stays unchanged. When ts-node discovers a config implicitly, migration pins that file with `--tsconfig` so `vpx` uses it for the whole run. `ts-node-esm` and `--esm` are supported when type-checking is disabled.
|
|
344
|
+
|
|
345
|
+
If an existing config and its local `extends` chain omit both `target` and `useDefineForClassFields`, the command stays unchanged with a warning. ts-node defaults to assignment semantics for class fields in this case, while `vpx` defaults to define semantics. Set `compilerOptions.useDefineForClassFields` to `false` to preserve assignment semantics before migrating.
|
|
346
|
+
|
|
347
|
+
Supported Node.js preload commands keep Node.js and replace both the old loader option and module with `--import vite-plus/register`. Literal `NODE_OPTIONS` assignments also migrate when they reach a known `node` command and pass the same checks. An existing `TS_NODE_PROJECT` file selection stays in place. A preload that needs an implicit config pinned stays unchanged: set `TS_NODE_PROJECT` to the config file before migration, because Node.js cannot take `--tsconfig`.
|
|
348
|
+
|
|
349
|
+
Preloads also stay unchanged when the working directory has no config but the entry file would discover a different one. Migration does not scan imported modules for additional config files.
|
|
350
|
+
|
|
351
|
+
Custom compilers, transpilers, SWC, ts-node compiler overrides, unsupported configuration inheritance, eval, and REPL usage stay unchanged. Environment files, Node.js config files, additional preloads, and unsupported `NODE_OPTIONS` assignments also keep the original command because they can change ts-node settings before registration. Nonempty `VP_SCRIPT_TSCONFIG`, `TSX_TSCONFIG_PATH`, or `OXC_TSCONFIG_PATH` assignments stay unchanged because they would select a different config. Migration checks named scripts for known module incompatibilities; it does not follow their imports. Migrated scripts use the [tsconfig and module rules of `vpx`](/guide/vpx#tsconfig).
|
|
352
|
+
|
|
353
|
+
Entries with static imports or re-exports of CommonJS values also stay unchanged. This includes named, namespace, and default bindings, `.js` files in CommonJS packages, and package entry points. Migration checks both import and require resolution without executing dependencies. Unresolved targets and targets that differ between these modes stay unchanged for manual review. Even `esModuleInterop: true` can unwrap a CommonJS `__esModule.default` value differently from Node.js, so that setting alone does not make a default import safe. Type-only imports and exports, imports used only for side effects, checked ES module targets, and named Node.js built-in bindings do not trigger this check.
|
|
354
|
+
|
|
355
|
+
As with oxnode, migration rewrites package scripts, JSON lint-staged tasks, and supported env shebangs. Shebangs that need a pinned config stay unchanged because the config path depends on the caller's working directory. Existing Vite+ projects use `vp migrate --full`. The `ts-node` development dependency is removed only when no remaining command, loader, API import, or config reference needs it. Runtime and peer dependencies remain, and `typescript` is not removed.
|
|
356
|
+
|
|
298
357
|
## Continuous Integration Rules
|
|
299
358
|
|
|
300
359
|
Migration replaces exact `voidzero-dev/setup-vp@v1` references in GitHub Actions workflows and composite actions under `.github` with the latest exact `setup-vp` release known to that Vite+ version. The frozen `v1` tag does not receive new releases. Existing exact versions and commit SHAs are left unchanged.
|
package/docs/guide/migrate.md
CHANGED
|
@@ -8,7 +8,7 @@ import { migrationPrompt, upgradePrompt } from '../.vitepress/theme/data/migrati
|
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, tsdown, tsup, and
|
|
11
|
+
This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, tsdown, tsup, tsx, oxnode, and ts-node setups into Vite+.
|
|
12
12
|
|
|
13
13
|
Use it when you want to take an existing project and move it onto the Vite+ defaults instead of wiring each tool by hand.
|
|
14
14
|
|
|
@@ -95,21 +95,21 @@ Upgrade the [global CLI](./upgrade.md#global-vp) to your target 1.0 release, the
|
|
|
95
95
|
|
|
96
96
|
### Without the Global CLI
|
|
97
97
|
|
|
98
|
-
Use an existing Node.js runtime that satisfies `^22.18.0 || ^24.11.0 || >=26.0.0`. Run the target migrator through your package manager without adding it to the project first. For the `1.
|
|
98
|
+
Use an existing Node.js runtime that satisfies `^22.18.0 || ^24.11.0 || >=26.0.0`. Run the target migrator through your package manager without adding it to the project first. For the `1.5.1` release:
|
|
99
99
|
|
|
100
100
|
::: code-group
|
|
101
101
|
|
|
102
102
|
```bash [pnpm]
|
|
103
|
-
pnpm dlx --package=vite-plus@1.
|
|
103
|
+
pnpm dlx --package=vite-plus@1.5.1 vp migrate --no-interactive
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
```bash [npm]
|
|
107
|
-
npx --package=vite-plus@1.
|
|
107
|
+
npx --package=vite-plus@1.5.1 vp migrate --no-interactive
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
:::
|
|
111
111
|
|
|
112
|
-
Replace `1.
|
|
112
|
+
Replace `1.5.1` with your target release. For a preview, use the version from the PR and pass `--registry=https://registry-bridge.viteplus.dev` to `pnpm` or `npx` before the `vp` command. Keep the version in `--package` explicit so you run the target migrator rather than the old local CLI.
|
|
113
113
|
|
|
114
114
|
After migration, finish dependency installation and validate with the updated local CLI:
|
|
115
115
|
|
|
@@ -151,7 +151,7 @@ View and copy this prompt into your coding agent to upgrade an existing Vite+ 0.
|
|
|
151
151
|
|
|
152
152
|
### Vitest
|
|
153
153
|
|
|
154
|
-
Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@5.0
|
|
154
|
+
Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@5.1.0` under `vite-plus/test*`, so for node-mode tests a single `vite-plus` install is enough — you no longer need to install `vitest` directly.
|
|
155
155
|
|
|
156
156
|
For browser mode, you can use the base browser runtime (`@vitest/browser`) and Preview provider (`@vitest/browser-preview`) included in `vite-plus`. To use Playwright or WebDriverIO, you also need the opt-in provider (`@vitest/browser-playwright` or `@vitest/browser-webdriverio`) and its framework peer (`playwright` or `webdriverio`).
|
|
157
157
|
|
|
@@ -234,11 +234,11 @@ export default defineConfig({
|
|
|
234
234
|
});
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
When no existing hook policy owns the workflow, `vp migrate` can move supported lint-staged rules and remove the old configuration and dependency. If an existing hook tool is preserved, keep lint-staged in place until you convert that hook policy manually. See the [Commit
|
|
237
|
+
When no existing hook policy owns the workflow, `vp migrate` can move supported lint-staged rules and remove the old configuration and dependency. If an existing hook tool is preserved, keep lint-staged in place until you convert that hook policy manually. See the [Commit Hooks](/guide/commit-hooks) and [Staged Config](/config/staged) for details.
|
|
238
238
|
|
|
239
239
|
### Git hook tools
|
|
240
240
|
|
|
241
|
-
The `vp migrate` command does not automatically convert Husky setups. When Husky is detected, Vite+ leaves its hooks, lifecycle scripts, configuration, and dependencies unchanged and shows a warning. You can migrate the project manually using the [Commit
|
|
241
|
+
The `vp migrate` command does not automatically convert Husky setups. When Husky is detected, Vite+ leaves its hooks, lifecycle scripts, configuration, and dependencies unchanged and shows a warning. You can migrate the project manually using the [Commit Hooks](/guide/commit-hooks).
|
|
242
242
|
|
|
243
243
|
Existing project-owned Vite+ hooks are also preserved. The default staged workflow is introduced only when no existing hook policy is found.
|
|
244
244
|
|
|
@@ -246,7 +246,7 @@ If your project currently uses `lefthook`, `simple-git-hooks`, or `yorkie`, `vp
|
|
|
246
246
|
|
|
247
247
|
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.
|
|
248
248
|
|
|
249
|
-
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
|
|
249
|
+
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/commit-hooks).
|
|
250
250
|
|
|
251
251
|
## Examples
|
|
252
252
|
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# vp add
|
|
2
|
+
|
|
3
|
+
Add packages to the project and update its manifest and lockfile.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp add react
|
|
7
|
+
vp add -D typescript
|
|
8
|
+
vp add --save-peer react
|
|
9
|
+
vp add --filter web react
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Options
|
|
13
|
+
|
|
14
|
+
Choose one dependency target at a time. Peer dependencies follow the native manager's behavior, including whether it also records a development dependency.
|
|
15
|
+
|
|
16
|
+
| Option | Description | Notes |
|
|
17
|
+
| ---------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
18
|
+
| `-P, --save-prod` | Save to dependencies, the default target. | Choose one dependency target. |
|
|
19
|
+
| `-D, --save-dev` | Save to devDependencies. | Choose one dependency target. |
|
|
20
|
+
| `--save-peer` | Request the manager's peer-dependency save behavior. | Choose one dependency target. |
|
|
21
|
+
| `-O, --save-optional` | Save to optionalDependencies. | Choose one dependency target. |
|
|
22
|
+
| `-E, --save-exact` | Save an exact dependency version. | |
|
|
23
|
+
| `--save-catalog-name <name>` | Save the dependency to a named catalog. | |
|
|
24
|
+
| `--save-catalog` | Save the dependency to the default catalog. | |
|
|
25
|
+
| `--allow-build <names>` | Allow the named packages to run postinstall scripts. | |
|
|
26
|
+
| `--ignore-scripts` | Do not run lifecycle scripts. | |
|
|
27
|
+
| `--no-optional` | Do not install optionalDependencies. | Cannot be combined with --global. |
|
|
28
|
+
| `--frozen-lockfile` | Prevent lockfile changes. | Cannot be combined with --global. Overrides an earlier `--no-frozen-lockfile`. |
|
|
29
|
+
| `--no-frozen-lockfile` | Explicitly allow lockfile updates. | Cannot be combined with --global. Overrides an earlier `--frozen-lockfile`. |
|
|
30
|
+
| `--lockfile-only` | Update the lockfile without a full install. | Cannot be combined with --global. |
|
|
31
|
+
| `--prefer-offline` | Use cached packages when available. | Cannot be combined with --global. |
|
|
32
|
+
| `--offline` | Only use packages already in cache. | Cannot be combined with --global. |
|
|
33
|
+
| `-f, --force` | Request a forced reinstall. | Cannot be combined with --global. |
|
|
34
|
+
| `--no-lockfile` | Skip reading or generating a lockfile. | Cannot be combined with --global. |
|
|
35
|
+
| `--shamefully-hoist` | Create a flat `node_modules` layout. | Cannot be combined with --global. |
|
|
36
|
+
| `--silent` | Suppress Vite+ output and request native quiet output. | Cannot be combined with --global. |
|
|
37
|
+
| `--filter <pattern>` | Select workspaces by pattern. | Can be repeated. |
|
|
38
|
+
| `-w, --workspace-root` | Add to workspace root. | |
|
|
39
|
+
| `--workspace` | Require the dependency to exist in the workspace. | |
|
|
40
|
+
| `-g, --global` | Install globally. | Requires the global CLI. Uses the [global package store](./global-packages). |
|
|
41
|
+
| `--node <version>` | Node.js version to use for global installation. | Requires --global. |
|
|
42
|
+
| `--concurrency <number>` | Number of global package installs to run in parallel. | Requires --global. Must be a positive integer. |
|
|
43
|
+
|
|
44
|
+
## Compatibility
|
|
45
|
+
|
|
46
|
+
The commands below describe project operations. Global mode is described under [Options](#options).
|
|
47
|
+
|
|
48
|
+
- **npm:** `npm install`.
|
|
49
|
+
- **pnpm:** `pnpm add`.
|
|
50
|
+
- **Yarn Classic:** `yarn add`.
|
|
51
|
+
- **Yarn Modern:** `yarn add`.
|
|
52
|
+
- **Bun:** `bun add`.
|
|
53
|
+
|
|
54
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
55
|
+
| ---------------------------- | --------------- | ---------------- | ------------ | ----------- | -------------- | -------------------------------------------------- |
|
|
56
|
+
| `-P, --save-prod` | Yes | Yes | Yes | Yes | Yes | |
|
|
57
|
+
| `-D, --save-dev` | Yes | Yes | Yes | Yes | Yes | |
|
|
58
|
+
| `--save-peer` | Yes | Yes | Yes | Yes | Yes | |
|
|
59
|
+
| `-O, --save-optional` | Yes | Yes | Yes | Yes | Yes | |
|
|
60
|
+
| `-E, --save-exact` | Yes | Yes | Yes | Yes | Yes | |
|
|
61
|
+
| `--save-catalog-name <name>` | No | 10.12.0 or later | No | No | 1.4 or later | |
|
|
62
|
+
| `--save-catalog` | No | 10.12.0 or later | No | No | 1.4 or later | |
|
|
63
|
+
| `--allow-build <names>` | No | 10.4.0 or later | No | No | No | |
|
|
64
|
+
| `--ignore-scripts` | Yes | Yes | Yes | 3 or later | Yes | On Yarn Modern, lockfile-only mode takes priority. |
|
|
65
|
+
| `--no-optional` | Yes | Yes | Yes | No | Yes | |
|
|
66
|
+
| `--frozen-lockfile` | No | No | Yes | No | Yes | |
|
|
67
|
+
| `--no-frozen-lockfile` | No | No | No | No | Yes | |
|
|
68
|
+
| `--lockfile-only` | Yes | Yes | No | 3 or later | Yes | |
|
|
69
|
+
| `--prefer-offline` | Yes | Yes | Yes | No | 1.4.1 or later | |
|
|
70
|
+
| `--offline` | Yes | Yes | Yes | No | 1.4.1 or later | |
|
|
71
|
+
| `-f, --force` | Yes | Yes | Yes | No | Yes | |
|
|
72
|
+
| `--no-lockfile` | Yes | Yes | Yes | No | No | |
|
|
73
|
+
| `--shamefully-hoist` | No | Yes | No | No | No | |
|
|
74
|
+
| `--silent` | Yes | Yes | Yes | No | Yes | |
|
|
75
|
+
| `--filter <pattern>` | 7.14.0 or later | Yes | No | Yes | 1.4 or later | |
|
|
76
|
+
| `-w, --workspace-root` | 8.1.0 or later | Yes | Yes | No | No | |
|
|
77
|
+
| `--workspace` | No | Yes | No | No | No | |
|
|
78
|
+
| `-g, --global` | Yes | Yes | Yes | Yes | Yes | |
|
|
79
|
+
| `--node <version>` | Yes | Yes | Yes | Yes | Yes | |
|
|
80
|
+
| `--concurrency <number>` | Yes | Yes | Yes | Yes | Yes | |
|
|
81
|
+
|
|
82
|
+
## Native Options
|
|
83
|
+
|
|
84
|
+
For native options, see [npm install](https://docs.npmjs.com/cli/v11/commands/npm-install), [pnpm add](https://pnpm.io/cli/add), [Yarn add](https://yarnpkg.com/cli/add), [Yarn Classic add](https://classic.yarnpkg.com/en/docs/cli/add), and [Bun add](https://bun.com/docs/pm/cli/add). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# vp pm approve-builds
|
|
2
|
+
|
|
3
|
+
Approve dependency lifecycle scripts using the selected manager's trust policy. Approve only packages whose install scripts you intend to execute.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp pm approve-builds
|
|
7
|
+
vp pm approve-builds sharp
|
|
8
|
+
vp pm approve-builds '!untrusted-package'
|
|
9
|
+
vp pm approve-builds --all
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Options
|
|
13
|
+
|
|
14
|
+
Supply packages to approve, or prefix a name with `!` to request denial where supported. Quote denial arguments to avoid shell history expansion.
|
|
15
|
+
|
|
16
|
+
| Option | Description | Notes |
|
|
17
|
+
| ------- | --------------------------------------------------- | ------------------------------------------------------------------ |
|
|
18
|
+
| `--all` | Approve all packages pending build-script approval. | Cannot be combined with package names, including names after `--`. |
|
|
19
|
+
|
|
20
|
+
## Compatibility
|
|
21
|
+
|
|
22
|
+
- **npm:** 11.16 or later: `npm approve-scripts`. Earlier versions warn and skip. Denials use `npm deny-scripts`.
|
|
23
|
+
- **pnpm:** 10.1 or later: `pnpm approve-builds`. Earlier versions warn and skip.
|
|
24
|
+
- **Yarn Classic:** No command. Warns and exits successfully without performing the operation.
|
|
25
|
+
- **Yarn Modern:** No command. Warns and exits successfully without performing the operation.
|
|
26
|
+
- **Bun:** `bun pm trust` for named packages or `--all`.
|
|
27
|
+
|
|
28
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
29
|
+
| ------- | ---------------- | ---------------- | ------------ | ----------- | --- | ----- |
|
|
30
|
+
| `--all` | 11.16.0 or later | 10.32.0 or later | No | No | Yes | |
|
|
31
|
+
|
|
32
|
+
With no package names, pnpm opens its interactive flow and npm lists pending packages with `--allow-scripts-pending`. Bun does not open an interactive selector; inspect pending packages with `bun pm untrusted` and then name the packages to trust.
|
|
33
|
+
|
|
34
|
+
Denial arguments prefixed with `!` require pnpm 11 or later or npm 11.16 or later. npm requires separate approval and denial invocations. Bun skips denial entries with a warning because it uses `trustedDependencies` rather than a denylist.
|
|
35
|
+
|
|
36
|
+
For Yarn Modern, configure `enableScripts: false` and explicitly allow trusted packages through `dependenciesMeta`.
|
|
37
|
+
|
|
38
|
+
### npm Build-Script Policy
|
|
39
|
+
|
|
40
|
+
npm 12 enforces `allowScripts` in `package.json`. Dependency install scripts not covered by the policy are skipped, including implicit native builds. Approval updates policy but does not run scripts skipped earlier. Follow it with [`vp pm rebuild <package>`](./rebuild).
|
|
41
|
+
|
|
42
|
+
In npm 11.16 through 11.x, this policy is advisory. Scripts still run and npm warns about unreviewed packages.
|
|
43
|
+
|
|
44
|
+
## Native Options
|
|
45
|
+
|
|
46
|
+
For native options, see [npm approve-scripts](https://docs.npmjs.com/cli/v11/commands/npm-approve-scripts), [npm deny-scripts](https://docs.npmjs.com/cli/v11/commands/npm-deny-scripts), [pnpm approve-builds](https://pnpm.io/cli/approve-builds), [Bun pm trust](https://bun.com/docs/pm/cli/pm), and [Bun pm untrusted](https://bun.com/docs/pm/cli/pm). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
47
|
+
|
|
48
|
+
For script policy configuration, see [npm package.json](https://docs.npmjs.com/cli/v11/configuring-npm/package-json), [Yarn enableScripts](https://yarnpkg.com/configuration/yarnrc#enableScripts), and [Bun lifecycle scripts](https://bun.com/docs/pm/lifecycle).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# vp pm audit
|
|
2
|
+
|
|
3
|
+
Audit dependencies for known vulnerabilities.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp pm audit
|
|
7
|
+
vp pm audit --json
|
|
8
|
+
vp pm audit --production --level high
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
| Option | Description | Notes |
|
|
14
|
+
| ----------------- | -------------------------------------------- | --------------------------------- |
|
|
15
|
+
| `--fix` | Request automatic vulnerability remediation. | |
|
|
16
|
+
| `--json` | Request native JSON output. | Output retains the native schema. |
|
|
17
|
+
| `--level <level>` | Minimum vulnerability level to report. | |
|
|
18
|
+
| `--production` | Only audit production dependencies. | |
|
|
19
|
+
|
|
20
|
+
## Compatibility
|
|
21
|
+
|
|
22
|
+
- **npm:** `npm audit` or `npm audit fix`.
|
|
23
|
+
- **pnpm:** `pnpm audit`.
|
|
24
|
+
- **Yarn Classic:** `yarn audit`.
|
|
25
|
+
- **Yarn Modern:** 2.4 or later: `yarn npm audit`. Earlier versions warn and skip.
|
|
26
|
+
- **Bun:** `bun audit` or `bun audit fix`.
|
|
27
|
+
|
|
28
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
29
|
+
| ----------------- | --- | ---- | ------------ | ----------- | --------------- | ----- |
|
|
30
|
+
| `--fix` | Yes | Yes | No | No | 1.4 or later | |
|
|
31
|
+
| `--json` | Yes | Yes | Yes | Yes | Yes | |
|
|
32
|
+
| `--level <level>` | Yes | Yes | Yes | Yes | Yes | |
|
|
33
|
+
| `--production` | Yes | Yes | Yes | Yes | 1.2.21 or later | |
|
|
34
|
+
|
|
35
|
+
Vulnerability output and failure thresholds retain the native manager's semantics.
|
|
36
|
+
|
|
37
|
+
## Native Options
|
|
38
|
+
|
|
39
|
+
For native options, see [npm audit](https://docs.npmjs.com/cli/v11/commands/npm-audit), [pnpm audit](https://pnpm.io/cli/audit), [Yarn npm audit](https://yarnpkg.com/cli/npm/audit), [Yarn Classic audit](https://classic.yarnpkg.com/en/docs/cli/audit), and [Bun audit](https://bun.com/docs/pm/cli/audit). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# vp pm cache
|
|
2
|
+
|
|
3
|
+
Inspect or clean the package manager's download cache or store. This is distinct from [`vp cache`](/guide/cache), which manages task results.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp pm cache dir
|
|
7
|
+
vp pm cache clean
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
|
|
12
|
+
- `dir` and `path` print the cache or store location.
|
|
13
|
+
- `clean` requests native cache cleanup.
|
|
14
|
+
|
|
15
|
+
Other subcommands warn and exit successfully without running a command. There are no additional Vite+ options.
|
|
16
|
+
|
|
17
|
+
### `dir`
|
|
18
|
+
|
|
19
|
+
Print the cache or store location. Alias: `path`. There are no command-specific options.
|
|
20
|
+
|
|
21
|
+
### `clean`
|
|
22
|
+
|
|
23
|
+
Request native cache cleanup. There are no command-specific options.
|
|
24
|
+
|
|
25
|
+
## Compatibility
|
|
26
|
+
|
|
27
|
+
### `dir`
|
|
28
|
+
|
|
29
|
+
- **npm:** `npm config get cache`.
|
|
30
|
+
- **pnpm:** `pnpm store path`.
|
|
31
|
+
- **Yarn Classic:** `yarn cache dir`.
|
|
32
|
+
- **Yarn Modern:** `yarn config get cacheFolder`.
|
|
33
|
+
- **Bun:** `bun pm cache`.
|
|
34
|
+
|
|
35
|
+
### `clean`
|
|
36
|
+
|
|
37
|
+
- **npm:** `npm cache clean`.
|
|
38
|
+
- **pnpm:** `pnpm store prune`. Prunes the store rather than deleting all content.
|
|
39
|
+
- **Yarn Classic:** `yarn cache clean`.
|
|
40
|
+
- **Yarn Modern:** `yarn cache clean`.
|
|
41
|
+
- **Bun:** `bun pm cache rm`.
|
|
42
|
+
|
|
43
|
+
npm normally requires an explicit native `--force` for cache deletion:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
vp pm cache clean -- --force
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
That example is npm-specific. Vite+ does not expose a separate `vp pm store` command.
|
|
50
|
+
|
|
51
|
+
## Native Options
|
|
52
|
+
|
|
53
|
+
For native options, see [npm config](https://docs.npmjs.com/cli/v11/commands/npm-config), [npm cache](https://docs.npmjs.com/cli/v11/commands/npm-cache), [pnpm store](https://pnpm.io/cli/store), [Yarn config get](https://yarnpkg.com/cli/config/get), [Yarn cache clean](https://yarnpkg.com/cli/cache/clean), [Yarn Classic cache](https://classic.yarnpkg.com/en/docs/cli/cache), and [Bun pm cache](https://bun.com/docs/pm/cli/pm). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# vp pm ci
|
|
2
|
+
|
|
3
|
+
Install dependencies with a frozen lockfile for CI.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp pm ci
|
|
7
|
+
vp pm ci -- --ignore-scripts
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
|
|
12
|
+
This command has no additional Vite+ options. For translated Vite+ options, use [`vp install --frozen-lockfile`](./install).
|
|
13
|
+
|
|
14
|
+
There are no command-specific options.
|
|
15
|
+
|
|
16
|
+
## Compatibility
|
|
17
|
+
|
|
18
|
+
- **npm:** `npm ci`.
|
|
19
|
+
- **pnpm:** `pnpm install --frozen-lockfile`.
|
|
20
|
+
- **Yarn Classic:** `yarn install --frozen-lockfile`.
|
|
21
|
+
- **Yarn Modern:** `yarn install --immutable`.
|
|
22
|
+
- **Bun:** `bun install --frozen-lockfile`.
|
|
23
|
+
|
|
24
|
+
The native manager determines installation cleanup and lockfile validation. This command does not make all managers behave like `npm ci` beyond the frozen-lockfile request.
|
|
25
|
+
|
|
26
|
+
## Native Options
|
|
27
|
+
|
|
28
|
+
For native options, see [npm ci](https://docs.npmjs.com/cli/v11/commands/npm-ci), [pnpm install](https://pnpm.io/cli/install), [Yarn install](https://yarnpkg.com/cli/install), [Yarn Classic install](https://classic.yarnpkg.com/en/docs/cli/install), and [Bun install](https://bun.com/docs/pm/cli/install). To pass these options through Vite+, see [Native Arguments](./#native-arguments). For CI setup, see the [CI guide](/guide/ci).
|