vite-plus 0.3.3 → 1.0.0-rc.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/LICENSE +35 -146
- package/README.md +6 -4
- package/binding/index.cjs +58 -54
- package/binding/index.d.cts +36 -4
- package/dist/{agent-Cu6-tXIP.js → agent-DIwEez_1.js} +6 -5
- package/dist/bin.js +75 -35
- package/dist/config/bin.js +3 -3
- package/dist/constants-BAsBfS1J.js +356 -0
- package/dist/create/bin.js +19 -13
- package/dist/{define-config-IgzmnvvV.js → define-config-Bz6dc3fm.js} +165 -43
- package/dist/{define-config-D0mevyb3.cjs → define-config-CAeeMTvb.cjs} +179 -44
- package/dist/{define-config-DPNEJxPz.d.ts → define-config-Cf_5GHmY.d.ts} +71 -25
- 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-BWiANxFS.js +8052 -0
- package/dist/{dist-BDYZP12R.js → dist-BsAzy8OW.js} +109 -105
- package/dist/documentation-DqcZSthV.js +11 -0
- package/dist/{editor-4sjlHmUh.js → editor-DWgrWTbN.js} +246 -159
- 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 +3127 -18
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BVqEe9KY.js → oxlint-plugin-config-B-P1a_0g.js} +1 -1
- package/dist/oxlint-plugin.js +9 -7
- package/dist/pack-bin.js +1 -1
- package/dist/{package-CHH8jWan.js → package-BrupPpWA.js} +6 -2
- package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
- package/dist/{prompts-k14KgthC.js → prompts-BW7_fDGJ.js} +3 -4
- package/dist/{report-CK5TnTsr.js → report-NhQk8VHb.js} +1 -0
- package/dist/{resolve-vite-config-CTOTuqTi.js → resolve-vite-config-D3XIVT6s.js} +1 -1
- package/dist/{resolve-vite-config-BqvS2P98.js → resolve-vite-config-DcsMQaYy.js} +2 -2
- package/dist/staged/bin.js +1206 -3318
- package/dist/sync-versions/bin.js +4 -4
- 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 +11 -11
- package/dist/toolchain.json +11 -11
- package/dist/{tsconfig-euB-GmIE.js → tsconfig-DESFDzWP.js} +1 -1
- package/dist/{tsconfig-C3h9CVTA.js → tsconfig-piorpNV7.js} +8 -4
- package/dist/version.js +5 -3
- package/dist/versions.js +6 -6
- package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
- package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
- package/docs/config/fmt.md +4 -2
- package/docs/config/lint.md +4 -2
- package/docs/config/run.md +62 -26
- package/docs/guide/automatic-data-tracking.md +20 -15
- package/docs/guide/cache.md +12 -8
- package/docs/guide/check.md +2 -0
- package/docs/guide/commit-hooks.md +8 -1
- package/docs/guide/env.md +18 -13
- package/docs/guide/fmt.md +6 -2
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +1 -1
- package/docs/guide/lint.md +5 -1
- package/docs/guide/local-cli.md +3 -3
- package/docs/guide/migrate-rules.md +58 -12
- package/docs/guide/migrate.md +86 -20
- package/docs/guide/monorepo.md +7 -1
- package/docs/guide/run.md +3 -1
- package/docs/guide/test.md +2 -0
- package/docs/guide/troubleshooting.md +3 -3
- package/docs/guide/vitest-v5.md +221 -0
- package/package.json +64 -87
- package/bin/oxfmt +0 -33
- package/bin/oxlint +0 -38
- package/dist/cli-truncate-Bg3RDXpi.js +0 -865
- package/dist/constants-C2dTOTe-.js +0 -80
- package/dist/dist-Dqv1-Clg.js +0 -3
- package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
- package/dist/log-update-CoW8Z4Dl.js +0 -491
- package/dist/semver-CaDAb8vV.js +0 -1400
- 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/install.md
CHANGED
|
@@ -39,7 +39,7 @@ 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
|
-
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
|
|
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.
|
|
43
43
|
|
|
44
44
|
## Usage
|
|
45
45
|
|
package/docs/guide/lint.md
CHANGED
|
@@ -20,7 +20,11 @@ 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
|
+
`vp lint` finds its config from the working directory, so package directories without their own `lint` block use the root config. Relative file arguments retain their meaning. Use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) for file- or package-specific rules instead of adding `lint` blocks to package configs.
|
|
24
|
+
|
|
25
|
+
`vp check` uses the workspace-root `lint` block when it exists, including from a package directory. Package configs cannot replace those lint settings in `vp check`.
|
|
26
|
+
|
|
27
|
+
An explicit `vp lint -c <path>` or `vp lint --config <path>` selects another config. Otherwise, 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
28
|
|
|
25
29
|
For the upstream rule set, options, and compatibility details, see the [Oxlint docs](https://oxc.rs/docs/guide/usage/linter.html).
|
|
26
30
|
|
package/docs/guide/local-cli.md
CHANGED
|
@@ -52,20 +52,20 @@ You need to add overrides to your package manager so that other packages resolve
|
|
|
52
52
|
```yaml [pnpm-workspace.yaml]
|
|
53
53
|
overrides:
|
|
54
54
|
vite: npm:@voidzero-dev/vite-plus-core@latest
|
|
55
|
-
vitest:
|
|
55
|
+
vitest: 5.0.1
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
```json [npm / Bun package.json]
|
|
59
59
|
"overrides": {
|
|
60
60
|
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
61
|
-
"vitest": "
|
|
61
|
+
"vitest": "5.0.1"
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
```json [Yarn package.json]
|
|
66
66
|
"resolutions": {
|
|
67
67
|
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
68
|
-
"vitest": "
|
|
68
|
+
"vitest": "5.0.1"
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -44,23 +44,67 @@ When a default upgrade skips setup actions that would apply, it prints a hint to
|
|
|
44
44
|
|
|
45
45
|
Migration preserves the previous defaults by setting `deps.resolveDepSubpath` to `true` when absent. Enabled ATTW checks receive `profile: 'strict'` when no profile is set. Explicit values, including `false`, remain unchanged.
|
|
46
46
|
|
|
47
|
+
The inserted settings include comments with documentation links and instructions for adopting the new defaults. Remove `deps.resolveDepSubpath: true` to [preserve external subpath imports as written](https://tsdown.dev/options/dependencies#deps-resolvedepsubpath). Remove the inserted `attw.profile: 'strict'` to use the new `esm-only` [resolution profile](https://tsdown.dev/options/lint#profiles). This skips `node10` and CommonJS resolution checks. Keep either setting if your package requires the previous behavior. Migration does not add these comments to explicit settings.
|
|
48
|
+
|
|
47
49
|
`noExternal` moves to `deps.alwaysBundle`, preserving matcher expressions, references, and callback methods. Existing `deps.alwaysBundle` values remain unchanged.
|
|
48
50
|
|
|
49
51
|
When `external` accompanies either `skipNodeModulesBundle` form, static matchers and references to local constants move to `inputOptions.external` before `deps.neverBundle` is set. Constant declarations and references stay intact. This preserves the original matching rules, including external file paths. Unsupported matchers, conflicting `inputOptions`, and declaration-specific dependency rules leave the pack object unchanged and produce a manual-migration warning.
|
|
50
52
|
|
|
51
53
|
The transform does not evaluate configuration code. Objects with spreads, computed keys, or duplicate keys, and conflicting old and new options require manual review. Dynamic boolean selectors remain unchanged. Unrelated Vite and plugin options remain unchanged. Run `vp pack` after migration to check the result. Node.js requirements, TypeScript module resolution, and programmatic `build()` return values require separate review.
|
|
52
54
|
|
|
55
|
+
## Task Cache Configuration
|
|
56
|
+
|
|
57
|
+
`vp migrate` moves `env`, `untrackedEnv`, `input`, and `output` from the top level of each task into the task's [`cache`](/config/run#cache) object. It updates static `run.tasks` objects in `vite.config.*`. This also runs on existing Vite+ projects without `--full`, including workspace packages.
|
|
58
|
+
|
|
59
|
+
| Previous task config | Updated task config |
|
|
60
|
+
| -------------------- | ---------------------------------------------- |
|
|
61
|
+
| No `cache` | Adds `cache` with the moved settings |
|
|
62
|
+
| `cache: true` | Replaces `true` with the moved settings |
|
|
63
|
+
| `cache: { ... }` | Adds the moved settings to the existing object |
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// Before
|
|
67
|
+
build: {
|
|
68
|
+
command: 'vp build',
|
|
69
|
+
env: ['NODE_ENV'],
|
|
70
|
+
input: [{ auto: true }, '!dist/**'],
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// After
|
|
74
|
+
build: {
|
|
75
|
+
command: 'vp build',
|
|
76
|
+
cache: {
|
|
77
|
+
env: ['NODE_ENV'],
|
|
78
|
+
input: [{ auto: true }, '!dist/**'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Moved settings keep their text and indentation, and the formatting step described in [After the Migration](#after-the-migration) indents them inside `cache`. Comments on their own line above a moved setting, and `//` comments that follow it on the same line, move with it.
|
|
84
|
+
|
|
85
|
+
The transform does not evaluate configuration code. It leaves a task unchanged and prints a manual-migration warning when the task has:
|
|
86
|
+
|
|
87
|
+
- spreads, or computed, escaped, or duplicate keys;
|
|
88
|
+
- a moved setting written as a method, such as `input() { ... }`;
|
|
89
|
+
- a comment between a moved setting and its comma, or after the last setting in `cache`;
|
|
90
|
+
- a moved setting that already exists in `cache`;
|
|
91
|
+
- a `cache` value other than `true` or an object literal.
|
|
92
|
+
|
|
93
|
+
It also warns about tasks in a `vite.config.*` object that is not the exported config itself, such as a variable the config refers to or an object passed to `mergeConfig`. Tasks created in other modules, for example by a shared helper function, are not detected. Move their settings by hand; `vp run` lists every task that still needs it.
|
|
94
|
+
|
|
95
|
+
With `cache: false`, the moved settings would have no effect, so decide whether to remove them or enable caching. On a project that is otherwise up to date, `vp migrate` prints these warnings without running the rest of the migration.
|
|
96
|
+
|
|
53
97
|
## Dependency Rules
|
|
54
98
|
|
|
55
99
|
What happens to each toolchain dependency, at a glance:
|
|
56
100
|
|
|
57
|
-
| Dependency | What happens
|
|
58
|
-
| ------------------------------ |
|
|
59
|
-
| `vite-plus` | Added where the package is migrated; plain ranges re-pinned to the concrete target, directly or through a catalog.
|
|
60
|
-
| `vite` | Existing declarations kept and pointed at the core alias.
|
|
61
|
-
| `vitest` | Removed in the common node-mode case because `vite-plus` provides it transitively. Kept or added only when [directly required](#when-vitest-is-directly-required).
|
|
62
|
-
| `@vitest/*` | Directly installed lockstep packages aligned to the bundled Vitest version (see [Vitest Ecosystem Packages](#vitest-ecosystem-packages)).
|
|
63
|
-
| `@voidzero-dev/vite-plus-test` | Removed everywhere: dependencies, overrides, resolutions, and catalog aliases. Imports are rewritten to the current `vite-plus/test*` surface.
|
|
101
|
+
| Dependency | What happens |
|
|
102
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `vite-plus` | Added where the package is migrated; plain ranges re-pinned to the concrete target, directly or through a catalog. |
|
|
104
|
+
| `vite` | Existing declarations kept and pointed at the core alias. pnpm packages that use only `vite-plus` need no new `vite` entry (see [Vite and Overrides](#vite-and-overrides)). |
|
|
105
|
+
| `vitest` | Removed in the common node-mode case because `vite-plus` provides it transitively. Kept or added only when [directly required](#when-vitest-is-directly-required). |
|
|
106
|
+
| `@vitest/*` | Directly installed lockstep packages aligned to the bundled Vitest version (see [Vitest Ecosystem Packages](#vitest-ecosystem-packages)). |
|
|
107
|
+
| `@voidzero-dev/vite-plus-test` | Removed everywhere: dependencies, overrides, resolutions, and catalog aliases. Imports are rewritten to the current `vite-plus/test*` surface. |
|
|
64
108
|
|
|
65
109
|
### Version Selection
|
|
66
110
|
|
|
@@ -72,14 +116,14 @@ What happens to each toolchain dependency, at a glance:
|
|
|
72
116
|
|
|
73
117
|
### Vite and Overrides
|
|
74
118
|
|
|
75
|
-
|
|
119
|
+
You can use `vite-plus` in a pnpm package without declaring `vite`. The `vite-plus` package includes a `vite` dependency aliased to its core, which provides Vitest's required peer. Migration keeps the workspace override for other Vite consumers but does not add `vite` to a package solely because it uses `vite-plus`.
|
|
76
120
|
|
|
77
121
|
Related rules:
|
|
78
122
|
|
|
79
123
|
- A direct `vite` declaration is never removed merely because a root override exists.
|
|
80
124
|
- Plain or stale aliases are normalized; named catalog references are kept.
|
|
81
125
|
- Under pnpm the managed override keys use an explicit `@*` range (`vite@*`, `vitest@*`). pnpm applies an override by replacing the declared spec on every manifest, importer manifests included. A bare key matches any spec, including `catalog:`, and `vp up` then rewrites that reference to a concrete version. The `@*` range keeps the override on the semver ranges that transitive and peer declarations use. It leaves `catalog:` references to the catalog, which already resolves them to Vite+ core. Migration re-keys a project that still holds the bare key, and keeps its named-catalog choice.
|
|
82
|
-
-
|
|
126
|
+
- Bun mirrors its core alias as a direct dependency for its peer resolver, and npm browser-provider layouts may need a top-level `vite` edge so nested Vitest packages can resolve `vite`.
|
|
83
127
|
|
|
84
128
|
### When Vitest Is Directly Required
|
|
85
129
|
|
|
@@ -114,9 +158,11 @@ Packages that are **not** aligned:
|
|
|
114
158
|
- `@vitest/coverage-c8` stopped at an older release and has no Vitest 4 version; and
|
|
115
159
|
- third-party `vitest-*` integrations keep their own compatible versions, though their required Vitest peer may still trigger [direct provisioning](#when-vitest-is-directly-required).
|
|
116
160
|
|
|
117
|
-
For browser mode, the base `@vitest/browser` runtime and `@vitest/browser-preview
|
|
161
|
+
For browser mode, Vite+ bundles the base `@vitest/browser` runtime and `@vitest/browser-preview`; migration removes their direct dependency entries. The Playwright provider stays opt-in. Migration uses the bundled Vitest version for `@vitest/browser-playwright`, through the preferred toolchain catalog or the dependency entry, and installs its `playwright` peer alongside.
|
|
162
|
+
|
|
163
|
+
Migration detects Playwright usage before it rewrites imports, including legacy `vitest/browser-playwright`, `vitest/browser/providers/playwright`, and `vitest/plugins/browser-playwright` aliases.
|
|
118
164
|
|
|
119
|
-
|
|
165
|
+
`vp migrate` restores removed Vite+ WebDriverIO aliases to `@vitest/browser-webdriverio` and adds `^5.0.0` if the provider is missing. It upgrades older versions, narrows ranges that allow versions below `5.0.0`, updates referenced catalog entries, and removes overrides that force an older provider. Versions and ranges that meet the minimum stay unchanged. Migration ensures the required `webdriverio` peer and adds an `@vitest/browser` override matching bundled Vitest (`resolutions` for Yarn). You manage later community provider upgrades. See [Community WebDriverIO provider](./vitest-v5.md#community-webdriverio-provider).
|
|
120
166
|
|
|
121
167
|
Object-valued nested npm and Bun overrides are preserved: they are user-defined scopes rather than scalar version pins.
|
|
122
168
|
|
|
@@ -225,7 +271,7 @@ Migration converts legacy Node.js version-manager files to `.node-version`, the
|
|
|
225
271
|
|
|
226
272
|
**Other rules.**
|
|
227
273
|
|
|
228
|
-
-
|
|
274
|
+
- Packages that use `vite-plus` without a direct `vite` declaration keep that layout (see [Vite and Overrides](#vite-and-overrides)).
|
|
229
275
|
- Unrelated selector-shaped and object-valued overrides are preserved.
|
|
230
276
|
|
|
231
277
|
### npm
|
package/docs/guide/migrate.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { migrationPrompt, upgradePrompt } from '../.vitepress/theme/data/migration-prompts.ts';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
1
5
|
# Migrate to Vite+
|
|
2
6
|
|
|
3
7
|
`vp migrate` helps move existing projects onto Vite+.
|
|
4
8
|
|
|
5
9
|
## Overview
|
|
6
10
|
|
|
7
|
-
This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, and tsup setups into Vite+.
|
|
11
|
+
This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, tsdown, and tsup setups into Vite+.
|
|
8
12
|
|
|
9
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.
|
|
10
14
|
|
|
@@ -55,11 +59,13 @@ See [Migration Rules](./migrate-rules.md) for the exact dependency, source rewri
|
|
|
55
59
|
|
|
56
60
|
Most projects will require further manual adjustments after running `vp migrate`.
|
|
57
61
|
|
|
62
|
+
For the Vitest v5 upgrade, read the [compatibility settings and review checklist](./vitest-v5.md) and the [upstream Vitest migration guide](https://vitest.dev/guide/migration/). The preflight checks your original runner version and Node runtime before dependency updates. Keep the original lockfile available and resolve blocking findings before retrying.
|
|
63
|
+
|
|
58
64
|
## Recommended Workflow
|
|
59
65
|
|
|
60
66
|
Before running the migration:
|
|
61
67
|
|
|
62
|
-
-
|
|
68
|
+
- For projects that do not use Vite+ yet, upgrade to Vite 8+ and Vitest 4.1+ first
|
|
63
69
|
- Make sure you understand any existing lint, format, or test setup that should be preserved
|
|
64
70
|
|
|
65
71
|
After running the migration:
|
|
@@ -71,38 +77,87 @@ After running the migration:
|
|
|
71
77
|
|
|
72
78
|
## Migration Prompt
|
|
73
79
|
|
|
74
|
-
|
|
80
|
+
View and copy this prompt into your coding agent to migrate an existing project to Vite+:
|
|
81
|
+
|
|
82
|
+
<CopyPrompt :prompt="migrationPrompt" label="View Migration Prompt" />
|
|
83
|
+
|
|
84
|
+
## Upgrade from Vite+ 0.3 to 1.0
|
|
85
|
+
|
|
86
|
+
Vite+ 1.0 includes the breaking changes in Vitest 5. Read the [Vite+ compatibility guide](./vitest-v5.md) alongside the [upstream migration guide](https://vitest.dev/guide/migration/).
|
|
87
|
+
|
|
88
|
+
Library builds also use tsdown 0.23. Review the [pack configuration migration rules](./migrate-rules.md#pack-configuration) and [upstream release notes](https://github.com/rolldown/tsdown/releases/tag/v0.23.0) for option changes and new defaults.
|
|
89
|
+
|
|
90
|
+
Keep your project's original dependencies and lockfile until migration identifies the old runner. Updating the project dependencies first can prevent the migration from preserving v4 behavior. Use one of the following paths from the workspace root.
|
|
91
|
+
|
|
92
|
+
### With the Global CLI
|
|
75
93
|
|
|
76
|
-
|
|
77
|
-
Migrate this project to Vite+. Vite+ replaces the current split tooling around runtime management, package management, dev/build/test commands, linting, formatting, and packaging. Run `vp help` to understand Vite+ capabilities and `vp help migrate` before making changes. Use `vp migrate --no-interactive` in the workspace root. Make sure the project is using Vite 8+ and Vitest 4.1+ before migrating.
|
|
94
|
+
Upgrade the [global CLI](./upgrade.md#global-vp) to your target 1.0 release, then run `vp migrate --no-interactive`. For a preview, follow the [preview installation instructions](./upgrade.md#global-vp-preview).
|
|
78
95
|
|
|
79
|
-
|
|
96
|
+
### Without the Global CLI
|
|
80
97
|
|
|
81
|
-
|
|
82
|
-
- Confirm `vitest` imports were rewritten to `vite-plus/test` (and `@vitest/browser*` to `vite-plus/test/browser*`) where needed
|
|
83
|
-
- On pnpm, keep the `vite`, `vitest` dependency entries configured by `vp migrate` so the workspace aliases and overrides stay effective; with other package managers, you can remove them once those rewrites are confirmed
|
|
84
|
-
- Move remaining tool-specific config into the appropriate blocks in `vite.config.ts`
|
|
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.0.0-rc.1` release:
|
|
85
99
|
|
|
86
|
-
|
|
100
|
+
::: code-group
|
|
87
101
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
```bash [pnpm]
|
|
103
|
+
pnpm dlx --package=vite-plus@1.0.0-rc.1 vp migrate --no-interactive
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```bash [npm]
|
|
107
|
+
npx --package=vite-plus@1.0.0-rc.1 vp migrate --no-interactive
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
:::
|
|
93
111
|
|
|
94
|
-
|
|
112
|
+
Replace `1.0.0-rc.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
|
+
|
|
114
|
+
After migration, finish dependency installation and validate with the updated local CLI:
|
|
115
|
+
|
|
116
|
+
::: code-group
|
|
117
|
+
|
|
118
|
+
```bash [pnpm]
|
|
119
|
+
pnpm install
|
|
120
|
+
pnpm exec vp check
|
|
121
|
+
pnpm exec vp test
|
|
122
|
+
pnpm exec vp build
|
|
123
|
+
```
|
|
95
124
|
|
|
96
|
-
|
|
125
|
+
```bash [npm]
|
|
126
|
+
npm install
|
|
127
|
+
npm exec -- vp check
|
|
128
|
+
npm exec -- vp test
|
|
129
|
+
npm exec -- vp build
|
|
97
130
|
```
|
|
98
131
|
|
|
132
|
+
:::
|
|
133
|
+
|
|
134
|
+
Use `vp pack` in place of `vp build` for a library that uses the pack command. Run configured browser, coverage, and benchmark suites as well.
|
|
135
|
+
|
|
136
|
+
### Review the Upgrade
|
|
137
|
+
|
|
138
|
+
On an existing Vite+ project, use the default upgrade flow. Add `--full` if you also want to repeat project setup. Resolve blockers and review the file-specific report before committing. See [Upgrade vs. Full Setup](./migrate-rules.md#upgrade-vs-full-setup) for the scope of each mode.
|
|
139
|
+
|
|
140
|
+
After the migrated project passes validation, [check whether you can remove the generated v4 compatibility settings](./vitest-v5.md#remove-unneeded-compatibility-settings) with no code changes or small, localized fixes. Keep compatibility for now if removal requires extensive test changes or you cannot validate the result.
|
|
141
|
+
|
|
142
|
+
For libraries, review the generated [tsdown compatibility settings](#tsdown) after a successful `vp pack` run. Follow their documentation links before adopting the new defaults, and check the emitted imports and declarations with your package's consumers.
|
|
143
|
+
|
|
144
|
+
### Copy Prompt
|
|
145
|
+
|
|
146
|
+
View and copy this prompt into your coding agent to upgrade an existing Vite+ 0.3 project:
|
|
147
|
+
|
|
148
|
+
<CopyPrompt :prompt="upgradePrompt" label="View Upgrade Prompt" />
|
|
149
|
+
|
|
99
150
|
## Tool-Specific Migrations
|
|
100
151
|
|
|
101
152
|
### Vitest
|
|
102
153
|
|
|
103
|
-
Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@
|
|
154
|
+
Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@5.0.1` 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
|
+
|
|
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`).
|
|
104
157
|
|
|
105
|
-
|
|
158
|
+
`vp migrate` adds the Playwright provider at the bundled Vitest version and ensures its framework peer. You can import it from `vite-plus/test/browser-playwright`.
|
|
159
|
+
|
|
160
|
+
For WebDriverIO, import from the community-maintained `@vitest/browser-webdriverio`. Migration restores legacy Vite+ provider imports, ensures a provider version of at least `5.0.0`, and adds an `@vitest/browser` override that matches the bundled runner. Manage later provider upgrades and framework peers yourself. See [Community WebDriverIO provider](./vitest-v5.md#community-webdriverio-provider).
|
|
106
161
|
|
|
107
162
|
If you are migrating manually, update all the imports to `vite-plus/test*` instead:
|
|
108
163
|
|
|
@@ -126,6 +181,17 @@ const { page } = await import('vite-plus/test/browser/context');
|
|
|
126
181
|
|
|
127
182
|
### tsdown
|
|
128
183
|
|
|
184
|
+
`vp migrate` updates supported static options in `pack` blocks and `tsdown.config.*` for tsdown 0.23. This also runs for existing Vite+ projects and workspace packages without `--full`. See [Pack Configuration](./migrate-rules.md#pack-configuration) for the option mappings and cases that require manual review.
|
|
185
|
+
|
|
186
|
+
The transform preserves earlier defaults by inserting `deps.resolveDepSubpath: true` and, when ATTW checks are enabled, `attw.profile: 'strict'` if these settings are absent. Each inserted setting includes a `tsdown <0.23 compatibility` comment with a documentation link and removal guidance. Explicit settings remain unchanged.
|
|
187
|
+
|
|
188
|
+
Keep these settings for the first `vp pack` run. After validation, review whether your package can adopt the new defaults:
|
|
189
|
+
|
|
190
|
+
- Removing `deps.resolveDepSubpath: true` [preserves external subpath imports as written](https://tsdown.dev/options/dependencies#deps-resolvedepsubpath). Check that consumers can resolve the emitted imports.
|
|
191
|
+
- Removing the inserted `attw.profile: 'strict'` selects the `esm-only` [resolution profile](https://tsdown.dev/options/lint#profiles). This skips `node10` and CommonJS resolution checks. Keep `strict` if your package requires those checks.
|
|
192
|
+
|
|
193
|
+
Remove each accepted setting's generated comment too. Run `vp pack` and your package's consumer checks after each change. Keep the setting when you cannot validate the result.
|
|
194
|
+
|
|
129
195
|
If your project uses a `tsdown.config.ts`, move its options into the `pack` block in `vite.config.ts`:
|
|
130
196
|
|
|
131
197
|
```ts [tsdown.config.ts] {4-6}
|
package/docs/guide/monorepo.md
CHANGED
|
@@ -6,7 +6,13 @@ Because `vite.config.ts` is just JavaScript, you can choose to put your entire c
|
|
|
6
6
|
|
|
7
7
|
## Root Config With Overrides
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Run `vp lint`, `vp fmt`, and `vp check` from the workspace root to apply the root lint and format settings across packages. These commands do not apply nested configs to individual files. Define file- or package-specific settings with overrides in the root `vite.config.ts`.
|
|
10
|
+
|
|
11
|
+
When run from a package directory, `vp lint` and `vp fmt` still use the root settings unless the package config defines its own `lint` or `fmt` block. We do not recommend package-level blocks; use overrides in the root config instead. File arguments remain relative to the package working directory.
|
|
12
|
+
|
|
13
|
+
`vp check` uses the root `lint` and `fmt` blocks when they exist. Package configs cannot replace root format settings, lint rules, or type-check options in `vp check`.
|
|
14
|
+
|
|
15
|
+
Use `-c <path>` or `--config <path>` with `vp lint` or `vp fmt` to select another config explicitly.
|
|
10
16
|
|
|
11
17
|
Use `lint.overrides` for Oxlint rules that only apply to some packages:
|
|
12
18
|
|
package/docs/guide/run.md
CHANGED
package/docs/guide/test.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`vp test` runs tests with [Vitest](https://vitest.dev).
|
|
4
4
|
|
|
5
|
+
The bundled runner uses Vitest `5.0.1` and requires Node `^22.18.0 || ^24.11.0 || >=26.0.0`. For existing projects, follow [Upgrade to Vitest 5](./vitest-v5.md) before updating dependencies.
|
|
6
|
+
|
|
5
7
|
## Overview
|
|
6
8
|
|
|
7
9
|
`vp test` is built on [Vitest](https://vitest.dev/), so you get a Vite-native test runner that reuses your Vite config and plugins, supports Jest-style expectations, snapshots, and coverage, and handles modern ESM, TypeScript, and JSX projects cleanly.
|
|
@@ -26,13 +26,13 @@ The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`. `
|
|
|
26
26
|
|
|
27
27
|
## Nested lint or format config is not applied
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
When running `vp lint`, `vp fmt`, or `vp check`, configs in subdirectories do not override settings for individual files. `vp lint` and `vp fmt` let Oxlint and Oxfmt discover configuration from the working directory, so a `lint` or `fmt` block in a package config takes effect when run from that package, which we do not recommend. `vp check` selects the workspace-root `lint` and `fmt` blocks when they exist. Use `-c <path>` or `--config <path>` with `vp lint` or `vp fmt` to select another config explicitly.
|
|
30
30
|
|
|
31
31
|
Keep lint and format settings in the root `vite.config.ts`. Use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) and [`fmt.overrides`](/guide/monorepo#format-overrides) for file- or package-specific settings. You can also [import configuration objects](/guide/monorepo#composing-configuration-files) into the root config to keep settings in separate files.
|
|
32
32
|
|
|
33
|
-
For IDE integration,
|
|
33
|
+
For IDE integration, `disableNestedConfig` and `fmt.disableNestedConfig` disable per-file nested lint and format configs. See [IDE Integration](/guide/ide-integration) for setup instructions for your editor.
|
|
34
34
|
|
|
35
|
-
We're holding off on nested
|
|
35
|
+
We're holding off on applying nested configs to individual files for now. Some of the factors we're considering are how implicit config discovery affects the predictability of linting and formatting, what context AI agents need to understand the settings that apply, and the potential performance cost of finding and loading multiple configs. At the same time, we recognize that keeping package-specific context close to the code may have benefits. The use cases we've heard so far haven't given us a strong enough reason to commit to those semantics. Waiting leaves room to add support later, and we'd like to hear why your project needs nested configs, especially where root-level overrides fall short.
|
|
36
36
|
|
|
37
37
|
Do you need nested configs? [Share your use case and opinion on GitHub](https://github.com/voidzero-dev/vite-plus/discussions/2669), including your project structure, the reason why you want them and whether root-level overrides meet your needs.
|
|
38
38
|
|