From aabf3f999cc3f19608b91fe493cdc55da0279f52 Mon Sep 17 00:00:00 2001 From: MK Date: Mon, 24 Aug 2026 16:37:27 +0800 Subject: [PATCH 1/5] docs(rfc): plan Vitest v5 upgrade --- rfcs/vitest-v5-upgrade.md | 363 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 363 insertions(+) create mode 100644 rfcs/vitest-v5-upgrade.md diff --git a/rfcs/vitest-v5-upgrade.md b/rfcs/vitest-v5-upgrade.md new file mode 100644 index 0000000000..9ebcda1f73 --- /dev/null +++ b/rfcs/vitest-v5-upgrade.md @@ -0,0 +1,363 @@ +# RFC: Upgrade the Bundled Vitest to v5 + +- Status: Proposed +- Tracking issue: [#2405](https://github.com/voidzero-dev/vite-plus/issues/2405) +- Upstream baseline: [`v5.0.0-rc.2`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2) +- Release target: the final `v5.0.0` release + +## Decision + +Upgrade `vp test` and the `vite-plus/test*` API to the final Vitest v5 release before Vite+ 1.0. Do not put a Vitest release candidate in a stable Vite+ release. + +The upgrade has four parts: + +1. Update the bundled runner, browser packages, public shims, resolver, and Vite config integration as one versioned unit. +2. Add a Vitest v5 pass to `vp migrate`. It preserves v4 behavior where a config option can do so, applies safe source rewrites, and reports changes that need review. +3. Raise the `vite-plus` Node.js range to the intersection of the current Vite+ range and the Vitest v5 range: `^22.18.0 || ^24.11.0 || >=26.0.0`. +4. Release the change through a Vite+ prerelease, run the compatibility matrix in this RFC, and recheck the final Vitest changelog before a stable release. + +New projects use the Vitest v5 defaults. Migrated projects get explicit compatibility options. A user can remove those options later to adopt the new defaults one at a time. + +## Context + +Vite+ currently pins `vitest` and the managed `@vitest/*` family to `4.1.11` in `pnpm-workspace.yaml`. The `vite-plus` package: + +- resolves and starts its bundled Vitest binary from `packages/cli/src/resolve-test.ts`; +- generates `vite-plus/test*` exports from the installed Vitest export map in `packages/cli/build.ts`; +- projects browser providers and selected `@vitest/*` packages into extra compatibility paths; +- forces Vitest-family imports to the bundled package graph in `packages/cli/src/define-config.ts`; +- injects resolver, dependency-inline, and coverage-version plugins into the root and each inline test project; +- rewrites Vitest imports and aligns Vitest ecosystem packages during `vp migrate`. + +These parts enforce one physical Vitest instance. That property must remain. Mock state, assertion state, browser types, coverage providers, and runner state can fail when a project loads two copies. + +Vitest v5 changes the package graph and project configuration model. A version-only catalog update would create invalid exports, duplicate Vite+ plugins in inline projects, retain removed packages, and keep migration rules that emit paths which no longer exist. + +## Goals + +- Keep `vp test`, `vite-plus/test*`, browser mode, coverage, and config helpers on one compatible Vitest v5 graph. +- Preserve v4 behavior for existing projects when a v5 option provides an exact compatibility setting. +- Give a file and an action for each change that cannot be automated safely. +- Keep useful Vite+ legacy aliases through the Vite+ 1.x line when they have an exact v5 target. +- Test Node, package manager, project, browser, coverage, reporter, and programmatic API boundaries before release. + +## Non-goals + +- Reimplement removed Vitest internals. +- Make the v5 benchmark rewrite automatic. +- Hide new Vitest behavior inside the runner after migration. +- Support Vitest v5 on Node 20 or Node 25. +- Require the community WebDriverIO provider to publish in lockstep with Vitest. + +## Upstream audit + +The audit covers every v5 prerelease through `v5.0.0-rc.2` and the complete [Vitest v5 migration guide](https://main.vitest.dev/guide/migration#vitest-5). The release train introduced breaking changes in these groups: + +| Release | Breaking-change themes | +| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [`beta.1`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.1) | `pretty-format` output, title formatting, browser iframe scaling, coverage glob matching, and `toThrow('') | +| [`beta.2`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.2) | artifact paths, removed sequential APIs, browser automocks, serialized locators, inlined expect, blob reports, and removed entry points | +| [`beta.3`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.3) | Node and Vite prerequisites, and strict `expect.poll` timeout handling | +| [`beta.4`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.4) | top-level hoisted mocks, strict browser assertions and locators, and the benchmark rewrite | +| [`beta.5`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.5) | config lookup, runner packaging, DOM globals, worker IDs, browser sessions, and per-file coverage thresholds | +| [`beta.6`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.6) | screenshot config, fake timers, WebDriverIO ownership, mock clearing, report defaults, UI authentication, and worker-start failure handling | +| [`beta.7`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.7) | the `resolveConfig` return value | +| [`rc.1`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.1) | project inheritance, nested projects, shared servers, test-name separators, async assertions, failure screenshots, class mocks, and assertion generics | +| [`rc.2`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2) | no new breaking change | + +The final release is still pending at the time of this RFC. Release work must compare the final release with `rc.2` and update this audit. + +## Compatibility design + +### 1. Runtime and dependency graph + +Pin the official Vitest packages to one exact v5 version. Keep the existing coverage-provider version guard. Coverage packages remain project-installed peers and must match the bundled runner exactly. + +| Package group | Policy | +| --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `vitest` | Exact dependency and the only runner started by `vp test` | +| `@vitest/browser`, `@vitest/browser-playwright`, `@vitest/browser-preview` | Exact version equal to the runner | +| `@vitest/mocker`, `@vitest/pretty-format`, `@vitest/snapshot`, `@vitest/spy`, `@vitest/utils` | Keep only when a public Vite+ shim needs the standalone package; pin exactly | +| `@vitest/expect` | Remove from the bundled graph; route Vitest assertions through the root `vitest` entry so assertion state stays shared | +| `@vitest/runner` | Remove from catalogs, dependencies, shims, migration alignment, and resolver assumptions; v5 no longer publishes it with the runner | +| `@vitest/ws-client` | Do not add a Vite+ shim; report direct use because upstream deprecated it and will not add v5 features | +| `@vitest/browser-webdriverio` | Keep as an optional compatibility peer backed by the [community repository](https://github.com/vitest-community/vitest-webdriverio); use a compatible range and test a selected version instead of forcing the runner's exact version | +| `@vitest/coverage-v8`, `@vitest/coverage-istanbul`, `@vitest/ui` | Project-installed optional packages; require the exact runner version | + +Replace the resolver's broad `@vitest/*` rule with an explicit supported-package set. In particular, do not redirect a user's standalone `@vitest/expect` to a Vite+ copy. Keep bundle-first resolution for the root `vitest` package, its public subpaths, the official browser packages, and other packages that share runner state. Keep the project fallback for optional peers. + +The repository vendors Vite and Rolldown workspaces. Their catalogs still request Vitest v4, and `sync-remote` rejects the v4/v5 major conflict. Prefer upstream v5 updates. If release timing requires a local bridge, add `vitest` to the sync tool's reviewed major-conflict set, align direct `@vitest/*` dependencies in the vendored workspaces, and run their test suites with the resolved v5 graph. Do not leave a hidden mix of v4 and v5 packages in the development lockfile. + +### 2. Node.js and Vite prerequisites + +Vitest v5 supports Node `^22.12.0 || ^24.0.0 || >=26.0.0` and Vite `^6.4.0 || ^7.0.0 || ^8.0.0`. The bundled Vite satisfies the Vite range. + +Set the published `vite-plus` engine to `^22.18.0 || ^24.11.0 || >=26.0.0`. This removes Node 20 and Node 25 from the CLI package. Do not raise the standalone core package's engine only because of Vitest. + +Before the global CLI delegates `vp test` to a local CLI, validate the selected project runtime against the local `vite-plus` engine. On failure, stop before loading Vitest and print an action such as: + +```text +vp test requires Node ^22.18.0 || ^24.11.0 || >=26.0.0. +This project selects Node 20.19.0. Run `vp env pin 22 --force`, or update the project's runtime range. +``` + +The migration preflight must inspect `.node-version`, `.nvmrc`, `devEngines.runtime`, `engines.node`, CI matrices, and common container images. It may update a Vite+ runtime pin after confirmation. It must not silently widen a library's public `engines.node` contract. + +### 3. Public `vite-plus/test*` exports + +Continue to generate the main test surface from the v5 `vitest` export map, then add a reviewed compatibility map. Snapshot the final export keys in a test so an upstream export change cannot alter the Vite+ package by accident. + +Keep these aliases through the Vite+ 1.x line because each has an exact public target: + +| Vite+ compatibility path | v5 target | +| ----------------------------- | ---------------- | +| `vite-plus/test/coverage` | `vitest/node` | +| `vite-plus/test/reporters` | `vitest/node` | +| `vite-plus/test/environments` | `vitest/runtime` | +| `vite-plus/test/snapshot` | `vitest/runtime` | +| `vite-plus/test/mocker` | `@vitest/mocker` | + +Do not create partial shims for `vite-plus/test/runners`, `vite-plus/test/suite`, `vite-plus/test/plugins/runner`, `vite-plus/test/plugins/expect`, or `vite-plus/test/internal/module-runner`. Their old symbols do not have a complete one-to-one v5 implementation with the required shared state. The migration reports them and directs users to `expect`, `TestRunner`, and its static methods from `vite-plus/test` where possible. + +Keep the Playwright and Preview provider aliases. Keep the WebDriverIO aliases only when the community peer is installed and compatible. Update `packages/cli/BUNDLING.md` to state which paths mirror upstream and which paths are Vite+ compatibility contracts. + +### 4. Config integration and project inheritance + +Vitest v4 inline projects did not inherit root plugins. The current Vite+ wrapper therefore prepends its three plugins to the root and every inline project. Vitest v5 sets `extends: true` by default and merges plugin arrays. The current wrapper would register each Vite+ plugin twice. + +Change the injection algorithm as follows: + +1. Inject the resolver, dependency-inline, and coverage-version plugins into the root config. +2. For an inline project that inherits the declaring config, rely on the inherited plugins. +3. For `extends: false` or an explicit external base config, inject the plugins into that project. +4. Apply the same rule after resolving function and promise project entries. +5. Make each Vite+ plugin idempotent by name as a defense against user merges and nested referenced configs. +6. Keep the coverage guard keyed by the shared Vitest instance because `configureVitest` can run for several projects. + +Referenced config files and directories still resolve their own Vite config. Their `defineConfig` or `defineProject` call injects the Vite+ plugins. Add fixtures for raw config files that do not use the Vite+ helpers and give them the existing soft fallback behavior. + +Do not restore Vitest's removed parent-directory config lookup inside the runner. If `vp test` starts below a parent config and no explicit config was passed, inspect parents only to produce this diagnostic: + +```text +No test config was found in this directory. +A config exists at ../vite.config.ts. Run `vp test --config ../vite.config.ts --dir .`. +``` + +This keeps Vite+ aligned with the v5 CLI while giving the user a direct repair. + +## Migration design + +Add a versioned Vitest v5 migration pass. Run its preflight before package changes. Print the report again after edits with unresolved items grouped by file. + +### Behavior-preserving config edits + +For an existing project, write these options when the related v4 option was absent: + +```ts +export default defineConfig({ + test: { + clearMocks: false, + sharedViteServer: false, + projects: [ + { + extends: false, + test: { + clearMocks: false, + browser: { + locators: { exact: false }, + }, + }, + }, + ], + }, +}); +``` + +Only write `sharedViteServer: false` when the config has inline projects. Only write `extends: false` on inline object projects that omitted it. Write `clearMocks: false` into each effective project that does not inherit the root setting. Only write `browser.locators.exact: false` for browser projects. Preserve explicit v5 settings. + +Also apply these edits when no conflict exists: + +- move `browser.api` to top-level `api`; +- copy a custom `browser.screenshotDirectory` to `browser.expect.toMatchScreenshot.screenshotDirectory`; +- add `perFile: true` to glob threshold objects that inherited a top-level `coverage.thresholds.perFile: true` in v4; +- set `{ stdout: true }` for configured JSON or JUnit reporters that had no `outputFile` and therefore wrote to stdout in v4; +- add `.vitest/` to `.gitignore`, but retain old artifact entries until their directories are empty; +- add `Temporal` to `fakeTimers.toNotFake` when the project installs a global Temporal polyfill and did not configure the option. + +### Safe source and config rewrites + +Apply AST rewrites for these forms: + +- `test.sequential`, `describe.sequential`, and `{ sequential: true }` to `{ concurrent: false }` forms; +- regex or partial browser `toHaveTextContent` calls to `toMatchTextContent`; +- `await render(...)` for `vitest-browser-vue` and `vitest-browser-svelte` when the enclosing callback can become `async` without changing its contract; +- `resolveConfig` pair destructuring to the v5 return value and `.test` access; +- deprecated Vitest entry points to the canonical Vite+ v5 paths; +- root-safe `@vitest/expect` imports to `vite-plus/test`; +- supported `@vitest/runner` uses to `TestRunner` from `vite-plus/test`; +- HTML reporter `outputFile` directory settings to `outputDir`. + +Run specific mappings before the current generic `vitest/` rewrite. The generic rule must only emit a path present in the final `vite-plus` export map. + +### Review-required findings + +Report these items with file locations and do not claim that they were migrated: + +- `-t` patterns that may span a suite boundary; +- nested `vi.mock`, `vi.unmock`, or `vi.hoisted` calls; +- the v4 benchmark API and removed benchmark CLI flags; +- unawaited `resolves`, `rejects`, file-snapshot, poll, or browser assertions; +- custom matcher declarations that use the old `Assertion`, `Matchers`, or `jest.Matchers` shape; +- custom browser commands that receive a locator string; +- scripts, CI jobs, or tools that read old artifact and report paths or pipe JSON/JUnit stdout; +- code that uses `VITEST_POOL_ID` or `VITEST_WORKER_ID` as a zero-based value; +- custom environments that restore `populateGlobal().originals` with assignment; +- direct UI or browser-orchestrator URLs without a token or session ID; +- referenced config files that merge a root config containing `test.projects`; +- plugins that depend on one Vite server or config execution per project; +- imports from removed runner, suite, or internal module-runner APIs that have no direct replacement; +- direct `@vitest/ws-client` use and `@vitest/expect` or `@vitest/runner` symbols that are not available from the root v5 API. + +The command should exit successfully after safe edits but print a high-visibility review count. It should stop before package updates for an unsupported Node range, a conflicting `api` move, or a removed API with no replacement and active runtime use. + +### Exact output and removed-API reference + +Migration and documentation must use the exact v5 defaults: + +| Surface | v4 | v5 | +| --------------------- | ------------------------------- | ------------------------------------------------------ | +| Attachments | `.vitest-attachements/` | `.vitest/attachments/` | +| Failure screenshots | `__screenshots__/` | `.vitest/attachments/failure-screenshots/` | +| Blob reporter | `.vitest-reports/blob-*.json` | `.vitest/blob/blob-*.json` | +| HTML reporter | `html/index.html`; `outputFile` | `.vitest/index.html`; `outputDir` | +| JSON reporter | stdout | `.vitest/json/output.json` | +| JUnit reporter | stdout | `.vitest/junit/output.xml` | +| Reference screenshots | `browser.screenshotDirectory` | `browser.expect.toMatchScreenshot.screenshotDirectory` | + +JSON and JUnit can retain stdout with `{ stdout: true }`. An explicit reporter `outputFile` remains valid except for the HTML reporter's renamed directory option. + +The benchmark migration removes the top-level `bench` API; `bench.skip`, `bench.only`, and `bench.todo`; `benchmark.reporters`; `benchmark.outputFile`; `benchmark.compare`; `benchmark.outputJson`; `--compare`; and `--outputJson`. The replacement is the `bench` test-context fixture, regular test modifiers, and the JSON reporter. `Vitest.mode` is always `test`. + +The entry-point migration uses these exact mappings: + +| Removed v4 entry point | v5 action | +| ---------------------------------------- | ---------------------------------------------- | +| `vitest/coverage`, `vitest/reporters` | import from `vite-plus/test/node` | +| `vitest/environments`, `vitest/snapshot` | import from `vite-plus/test/runtime` | +| `vitest/runners` | import `TestRunner` from `vite-plus/test` | +| `vitest/suite` | use static methods on `TestRunner` | +| `vitest/mocker` | import from `vite-plus/test/mocker` | +| `vitest/internal/module-runner` | no public replacement; require manual redesign | + +## Complete incompatible-change and risk matrix + +This matrix tracks every v5 migration-guide item and the extra breaking entries in the prerelease notes. “Scan” refers to the versioned `vp migrate` pass. + +| Change | Upgrade risk | Vite+ handling | +| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| Node `>=22.12` and Vite `>=6.4` | The local CLI can fail before tests start. | Raise the CLI engine, validate the selected runtime, and keep bundled Vite in range. | +| `clearMocks: true` default | Setup-file, top-level, `beforeAll`, and cross-test mock history disappears. | Add `clearMocks: false` for existing configs; use `true` for new projects. | +| Full test names use `>` | `-t 'suite test'` no longer matches across the boundary. | Scan scripts and CI strings; recommend one segment or `suite.*test`. | +| Browser iframe scaling changed | Headed browser UI and screenshot dimensions can differ from v4. | Run headed and headless screenshot fixtures at fixed viewports; refresh baselines only after review. | +| Inline projects inherit root config | Plugins, aliases, setup files, and arrays can apply twice or begin applying. | Add `extends: false` during migration and make Vite+ plugin injection inheritance-aware. | +| Referenced configs can define nested projects | A merged root `projects` field can recurse, duplicate projects, or resolve paths from a new base. | Scan referenced configs and root-config merges; require manual extraction of a shared config. | +| Inline projects share a Vite server | Config files and plugin hooks run fewer times; stateful plugins can change behavior. | Add `sharedViteServer: false` for migrated inline-project configs; new projects use sharing. | +| Hoisted mock calls must be top-level | A prior warning becomes a startup error. | Report each nested call; do not move it automatically because scope dependencies may change. | +| Browser automocks remain mocked | Exports that called real code now return mock defaults. | Report factory-free browser mocks; suggest `{ spy: true }` when real behavior is required. | +| Class mocks inherit implementation prototypes | Methods and `instanceof` results change. | Add focused release tests; report class constructor mocks as review items. | +| Benchmark API rewrite | `bench`, benchmark modes, reporters, output, and compare options are removed. | Block on active benchmark APIs and link the new test-context fixture design. | +| UI token authentication | Stored or proxied bare UI URLs stop working. | Preserve the token URL in CLI output; report hard-coded `/__vitest__/` URLs. | +| Fake timers mock `Temporal` | Time tests with a global polyfill change. | Preserve v4 behavior with `toNotFake: ['Temporal']` when detected. | +| `toThrow('')` matches any message | Assertions for an empty error message become too broad. | Rewrite `toThrow('')` and `toThrowError('')` to `/^$/`. | +| Assertion types add return and received parameters | Custom matcher declarations and direct assertion types fail type checking. | Report old generic forms, update Vite+ examples, and add type fixtures. | +| `expect.poll` rejects at timeout | Polls that completed late now fail. | Report configured polls and ask users to review the timeout; do not raise it automatically. | +| Unawaited async assertions fail | Tests that passed with a warning now fail. | Detect expression statements and add `await` only when the transform is safe; report the rest. | +| Titles and inspected values use `pretty-format` | Snapshots, `test.each` titles, and reporter consumers can change. | Run snapshot suites and report title snapshots; do not retain the v4 formatter. | +| Sequential APIs and options are removed | Test collection fails or concurrency changes. | Apply the documented `{ concurrent: false }` rewrite. | +| Browser command locators serialize as objects | Custom commands receive an object instead of a selector string. | Report locator-typed command parameters and suggest `SerializedLocator`. | +| Browser locators are exact by default | Partial or case-insensitive text lookups stop matching. | Add `browser.locators.exact: false` to migrated browser projects. | +| `toHaveTextContent` is strict | Partial strings and regular expressions fail. | Rewrite old partial uses to `toMatchTextContent`; keep known exact uses. | +| Vue and Svelte browser `render` are async | Immediate queries can race or access a promise. | Add `await` where safe and report non-async call sites. | +| Glob thresholds no longer inherit `perFile` | Coverage enforcement can become weaker. | Copy `perFile: true` into existing glob threshold objects. | +| `coverage.thresholds.perFile` also accepts an object | Config libraries that assume a boolean can reject or misread the new shape. | Update Vite+ config types and serializers; the old boolean form needs no migration. | +| Coverage include/exclude matching is precise | The measured file set can shrink or change. | Report patterns without glob syntax and compare v4/v5 coverage file lists in CI. | +| Parent config lookup is removed | Running below the config root can ignore configuration. | Give a parent-config diagnostic with `--config` and `--dir`; do not change v5 lookup rules. | +| DOM global assignment updates the window | `matchMedia` and other DOM APIs can observe new values. | Cover jsdom and happy-dom fixtures; report assignments to known DOM globals. | +| `populateGlobal().originals` contains descriptors | Custom environment teardown can restore descriptor objects as values. | Report assignments from `originals`; recommend `Object.defineProperty`. | +| Browser orchestrator URLs need a session | Direct `/__vitest_test__/` links fail. | Report hard-coded URLs and retain the URL printed or opened by Vitest. | +| `browser.api` moves to `api` | Custom ports are ignored. | Move the option when no top-level conflict exists; stop on conflict. | +| Reports and artifacts move under `.vitest` | CI uploads, merges, ignores, and stdout pipes can break. | Update known config and ignore files; report scripts that reference the old defaults. | +| Screenshot references use a dedicated option | Existing baselines can be read from the wrong directory. | Copy the old custom directory to the new expectation option and retain files. | +| Worker and concurrency IDs are 1-based | Array indexes, ports, and database names shift. | Report environment-variable reads and require project-specific review. | +| Worker-start failures are reported gracefully | Wrappers that match the old thrown error or localStorage warning can observe different diagnostics. | Snapshot the Vite+ failure path and preserve Vitest's exit status; no project source migration is needed. | +| `resolveConfig` returns resolved Vite config | Destructuring returns `undefined`; consumers miss `.test`. | Apply a targeted AST rewrite and add a programmatic API fixture. | +| Runner, expect, WebSocket, and WebDriverIO package migration | Removed runner publication, deprecated WebSocket APIs, split expect state, and community provider ownership cause resolution or state failures. | Remove `@vitest/runner`; report `@vitest/ws-client`; route Vitest assertions through root `vitest`; decouple community WebDriverIO. | +| Deprecated entry points are removed | Generated Vite+ shims and current generic migration output can become invalid. | Keep exact compatibility aliases, rewrite to canonical paths, and block unsupported internals. | + +## Rollout + +### Phase 1: compatibility branch + +- Pin the current v5 release candidate only in a development branch. +- Update the package graph, export generator, resolver, project plugin injection, and migration package set. +- Add export snapshots and unit fixtures before accepting generated package changes. +- Resolve the vendored Vite and Rolldown catalog conflict without a mixed Vitest family. + +### Phase 2: migration support + +- Implement the versioned scan, safe rewrites, compatibility config options, and Node preflight. +- Add before-and-after fixtures for plain Vitest projects, existing Vite+ projects, workspaces, and browser projects. +- Publish the migration guide with each item in the risk matrix. + +### Phase 3: Vite+ prerelease + +- Move to the final Vitest `v5.0.0` packages when available. +- Recheck all releases after `rc.2` and update the RFC and migration guide. +- Publish a Vite+ prerelease and run ecosystem CI against real projects. +- Keep the v4-based Vite+ release available for Node 20 and for any WebDriverIO user blocked by community-provider timing. + +### Phase 4: stable release + +Release only after the gates below pass. State the Node requirement and the `vp migrate` command in the release notes. Do not remove the exact legacy aliases listed in this RFC during the Vite+ 1.x line. + +## Validation and release gates + +The investigation spike updated the available official packages to `5.0.0-rc.2`, removed the unavailable runner package, built the CLI and 60 generated test exports, and passed the focused config/resolver tests. The complete TypeScript unit run passed 63 files and 1,029 tests. The spike also reproduced the vendored Rolldown catalog conflict, which confirms that dependency synchronization needs an explicit solution. + +The implementation must pass these gates: + +1. `pnpm tsgo`, `vp check`, `pnpm test:unit`, Rust checks for changed global-CLI code, and the CLI snapshot suite. +2. Package export tests that import every generated `vite-plus/test*` path under Node ESM and TypeScript. +3. Identity tests that prove `vp test`, `vite-plus/test`, browser providers, custom matchers, and coverage use one runner and assertion state. +4. Node 22.18, 24.11, and 26 jobs, plus actionable rejection tests for Node 20 and 25 project pins. +5. npm, pnpm, Yarn PnP, and Bun install and test fixtures. +6. Single-project, inherited inline-project, `extends: false`, referenced-config, nested-project, and shared-server fixtures. +7. Playwright and Preview browser suites. Run the WebDriverIO suite against a verified community release without requiring an exact Vitest patch version. +8. V8 and Istanbul coverage with matching providers, mismatched-provider rejection, glob threshold checks, and v4/v5 file-list comparison. +9. JSON, JUnit, HTML, blob merge, attachments, failure screenshots, and reference-screenshot path fixtures. +10. UI token, browser session, custom command locator, jsdom, happy-dom, Temporal, custom environment, worker ID, `resolveConfig`, custom matcher, and benchmark migration fixtures. +11. `ecosystem-ci` cases for `vite-plus-vitest-global-type-minimal-repro`, `vitest-playwright-repro`, and `vite-plus-vitest-type-aug`, followed by the broader ecosystem set. +12. Vendored Vite and Rolldown tests under the final synchronized dependency graph. + +## Alternatives + +### Adopt all v5 defaults for existing projects + +This keeps migrated configs smaller but makes an ordinary package update change mock history, project inheritance, plugin lifetimes, and locator matching at once. New projects still get these defaults. Existing projects should opt in after their current suite passes. + +### Force v4 defaults inside `vp test` + +This avoids config edits but makes Vite+ behavior differ from the Vitest v5 documentation and programmatic API. Explicit migration options are visible and removable. + +### Mirror every v4 package and entry point + +Several removed runner and suite APIs do not have a complete v5 target. Partial shims would fail later and with less useful errors. Keep only aliases with exact public replacements. + +### Drop WebDriverIO support + +The provider kept its package name and moved to community maintenance. An optional peer and compatibility shim preserve current Vite+ imports without coupling release versions. Drop the shim only if the community package cannot pass the v5 browser contract before the Vite+ stable release. + +## Release-blocking questions + +1. Does the final community `@vitest/browser-webdriverio` release pass the Vite+ browser suite with final Vitest v5? If not, document the provider exception and keep affected users on the v4-based Vite+ release. +2. Will the vendored Vite and Rolldown revisions move to Vitest v5 before the Vite+ release branch? If not, the temporary sync override and all affected upstream suites must land in the same change. From 5add513e96db7535bde38bb36e2b44ac1ba92076 Mon Sep 17 00:00:00 2001 From: MK Date: Sun, 30 Aug 2026 11:52:04 +0800 Subject: [PATCH 2/5] docs(rfc): refine Vitest v5 migration --- rfcs/vitest-v5-upgrade.md | 129 +++++++++++++++++++++++--------------- 1 file changed, 80 insertions(+), 49 deletions(-) diff --git a/rfcs/vitest-v5-upgrade.md b/rfcs/vitest-v5-upgrade.md index 9ebcda1f73..71f25c8f2f 100644 --- a/rfcs/vitest-v5-upgrade.md +++ b/rfcs/vitest-v5-upgrade.md @@ -2,7 +2,7 @@ - Status: Proposed - Tracking issue: [#2405](https://github.com/voidzero-dev/vite-plus/issues/2405) -- Upstream baseline: [`v5.0.0-rc.2`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2) +- Upstream baseline: [`v5.0.0-rc.3`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.3) - Release target: the final `v5.0.0` release ## Decision @@ -51,7 +51,7 @@ Vitest v5 changes the package graph and project configuration model. A version-o ## Upstream audit -The audit covers every v5 prerelease through `v5.0.0-rc.2` and the complete [Vitest v5 migration guide](https://main.vitest.dev/guide/migration#vitest-5). The release train introduced breaking changes in these groups: +The audit covers every v5 prerelease through `v5.0.0-rc.3` and the complete [Vitest v5 migration guide](https://main.vitest.dev/guide/migration#vitest-5). The release train introduced breaking changes in these groups: | Release | Breaking-change themes | | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -64,8 +64,9 @@ The audit covers every v5 prerelease through `v5.0.0-rc.2` and the complete [Vit | [`beta.7`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.7) | the `resolveConfig` return value | | [`rc.1`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.1) | project inheritance, nested projects, shared servers, test-name separators, async assertions, failure screenshots, class mocks, and assertion generics | | [`rc.2`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2) | no new breaking change | +| [`rc.3`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.3) | no new breaking change; Istanbul coverage moved to `@vitest/istanbuljs` packages | -The final release is still pending at the time of this RFC. Release work must compare the final release with `rc.2` and update this audit. +The final release is still pending at the time of this RFC. Release work must compare the final release with `rc.3` and update this audit. ## Compatibility design @@ -88,6 +89,8 @@ Replace the resolver's broad `@vitest/*` rule with an explicit supported-package The repository vendors Vite and Rolldown workspaces. Their catalogs still request Vitest v4, and `sync-remote` rejects the v4/v5 major conflict. Prefer upstream v5 updates. If release timing requires a local bridge, add `vitest` to the sync tool's reviewed major-conflict set, align direct `@vitest/*` dependencies in the vendored workspaces, and run their test suites with the resolved v5 graph. Do not leave a hidden mix of v4 and v5 packages in the development lockfile. +Vitest `v5.0.0-rc.3` moves Istanbul internals to `@vitest/istanbuljs` packages. Keep those packages on the project-installed `@vitest/coverage-istanbul` dependency edge. The resolver allowlist must not redirect them to a missing Vite+ copy. + ### 2. Node.js and Vite prerequisites Vitest v5 supports Node `^22.12.0 || ^24.0.0 || >=26.0.0` and Vite `^6.4.0 || ^7.0.0 || ^8.0.0`. The bundled Vite satisfies the Vite range. @@ -175,6 +178,10 @@ export default defineConfig({ Only write `sharedViteServer: false` when the config has inline projects. Only write `extends: false` on inline object projects that omitted it. Write `clearMocks: false` into each effective project that does not inherit the root setting. Only write `browser.locators.exact: false` for browser projects. Preserve explicit v5 settings. +Many v4 projects have no Vite or Vitest config. The Vitest v5 migration pass must not create `vite.config.ts` for these projects by default. It must report the `clearMocks` default change and each other applicable default change. If another Vite+ migration step creates a config, write the compatibility options into that config. + +Offer a separate config-creation action after user confirmation. That action writes a minimal Vite+ config with the applicable compatibility options. Its output must state that a new config can change config discovery and project structure. + Also apply these edits when no conflict exists: - move `browser.api` to top-level `api`; @@ -184,12 +191,14 @@ Also apply these edits when no conflict exists: - add `.vitest/` to `.gitignore`, but retain old artifact entries until their directories are empty; - add `Temporal` to `fakeTimers.toNotFake` when the project installs a global Temporal polyfill and did not configure the option. +The `toNotFake` option only preserves behavior while fake timers run. It does not preserve the v4 behavior of `vi.setSystemTime()` without fake timers. + ### Safe source and config rewrites Apply AST rewrites for these forms: - `test.sequential`, `describe.sequential`, and `{ sequential: true }` to `{ concurrent: false }` forms; -- regex or partial browser `toHaveTextContent` calls to `toMatchTextContent`; +- all v4 browser `toHaveTextContent` calls with a string or regular expression to `toMatchTextContent`; - `await render(...)` for `vitest-browser-vue` and `vitest-browser-svelte` when the enclosing callback can become `async` without changing its contract; - `resolveConfig` pair destructuring to the v5 return value and `.test` access; - deprecated Vitest entry points to the canonical Vite+ v5 paths; @@ -199,12 +208,28 @@ Apply AST rewrites for these forms: Run specific mappings before the current generic `vitest/` rewrite. The generic rule must only emit a path present in the final `vite-plus` export map. +Do not infer exact text-match intent from a v4 `toHaveTextContent` call. A string used partial matching in v4, even when the current fixture contains the same complete string. A project can keep `toHaveTextContent` only when the user chooses v5 assertion behavior. + +Use an explicit symbol allowlist for `@vitest/runner` migrations: + +| v4 runner symbol | v5 migration | +| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `test`, `it`, `describe`, `suite`, `recordArtifact`, `TestAPI`, `SuiteAPI`, `SuiteCollector`, `TestArtifact` | import the same name from `vite-plus/test` | +| `File`, `Suite`, `Test`, `Task`, `VitestRunner`, `VitestRunnerConfig` | import `RunnerTestFile`, `RunnerTestSuite`, `RunnerTestCase`, `RunnerTask`, `VitestTestRunner`, or `TestRunnerConfig` from `vite-plus/test` | +| `getCurrentSuite`, `getCurrentTest`, `createTaskCollector` | use `TestRunner.getCurrentSuite`, `TestRunner.getCurrentTest`, or `TestRunner.createTaskCollector` from `vite-plus/test` | +| `getFn`, `getHooks`, `setFn`, `setHooks` | use `TestRunner.getTestFn`, `TestRunner.getSuiteHooks`, `TestRunner.setTestFn`, or `TestRunner.setSuiteHooks` from `vite-plus/test` | +| `FileSpecification`, `SuiteHooks`, `TaskUpdateEvent`, `startTests`, `collectTests`, `updateTask`, and unlisted symbols | report the use and require manual migration | + +The migration must preserve local import aliases when it applies a supported rewrite. An unsupported runtime use blocks the package update. An unsupported type-only use produces a review-required finding. + ### Review-required findings -Report these items with file locations and do not claim that they were migrated: +This list is the authoritative scanner checklist. Report each item with a file location. Do not claim that the scanner migrated these items: - `-t` patterns that may span a suite boundary; - nested `vi.mock`, `vi.unmock`, or `vi.hoisted` calls; +- factory-free `vi.mock()` calls in browser tests; +- class constructor mocks created with `vi.fn`, `vi.spyOn`, or `mockImplementation`; - the v4 benchmark API and removed benchmark CLI flags; - unawaited `resolves`, `rejects`, file-snapshot, poll, or browser assertions; - custom matcher declarations that use the old `Assertion`, `Matchers`, or `jest.Matchers` shape; @@ -212,9 +237,13 @@ Report these items with file locations and do not claim that they were migrated: - scripts, CI jobs, or tools that read old artifact and report paths or pipe JSON/JUnit stdout; - code that uses `VITEST_POOL_ID` or `VITEST_WORKER_ID` as a zero-based value; - custom environments that restore `populateGlobal().originals` with assignment; +- assignments to DOM globals in jsdom or happy-dom tests; +- Temporal use in a file or setup scope that also calls `vi.setSystemTime()`; - direct UI or browser-orchestrator URLs without a token or session ID; - referenced config files that merge a root config containing `test.projects`; +- dynamic, function, or promise inline projects whose effective config cannot be determined from source; - plugins that depend on one Vite server or config execution per project; +- configured `coverage.include` or `coverage.exclude` when a v4/v5 resolved file-set comparison is unavailable; - imports from removed runner, suite, or internal module-runner APIs that have no direct replacement; - direct `@vitest/ws-client` use and `@vitest/expect` or `@vitest/runner` symbols that are not available from the root v5 API. @@ -253,46 +282,48 @@ The entry-point migration uses these exact mappings: This matrix tracks every v5 migration-guide item and the extra breaking entries in the prerelease notes. “Scan” refers to the versioned `vp migrate` pass. -| Change | Upgrade risk | Vite+ handling | -| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| Node `>=22.12` and Vite `>=6.4` | The local CLI can fail before tests start. | Raise the CLI engine, validate the selected runtime, and keep bundled Vite in range. | -| `clearMocks: true` default | Setup-file, top-level, `beforeAll`, and cross-test mock history disappears. | Add `clearMocks: false` for existing configs; use `true` for new projects. | -| Full test names use `>` | `-t 'suite test'` no longer matches across the boundary. | Scan scripts and CI strings; recommend one segment or `suite.*test`. | -| Browser iframe scaling changed | Headed browser UI and screenshot dimensions can differ from v4. | Run headed and headless screenshot fixtures at fixed viewports; refresh baselines only after review. | -| Inline projects inherit root config | Plugins, aliases, setup files, and arrays can apply twice or begin applying. | Add `extends: false` during migration and make Vite+ plugin injection inheritance-aware. | -| Referenced configs can define nested projects | A merged root `projects` field can recurse, duplicate projects, or resolve paths from a new base. | Scan referenced configs and root-config merges; require manual extraction of a shared config. | -| Inline projects share a Vite server | Config files and plugin hooks run fewer times; stateful plugins can change behavior. | Add `sharedViteServer: false` for migrated inline-project configs; new projects use sharing. | -| Hoisted mock calls must be top-level | A prior warning becomes a startup error. | Report each nested call; do not move it automatically because scope dependencies may change. | -| Browser automocks remain mocked | Exports that called real code now return mock defaults. | Report factory-free browser mocks; suggest `{ spy: true }` when real behavior is required. | -| Class mocks inherit implementation prototypes | Methods and `instanceof` results change. | Add focused release tests; report class constructor mocks as review items. | -| Benchmark API rewrite | `bench`, benchmark modes, reporters, output, and compare options are removed. | Block on active benchmark APIs and link the new test-context fixture design. | -| UI token authentication | Stored or proxied bare UI URLs stop working. | Preserve the token URL in CLI output; report hard-coded `/__vitest__/` URLs. | -| Fake timers mock `Temporal` | Time tests with a global polyfill change. | Preserve v4 behavior with `toNotFake: ['Temporal']` when detected. | -| `toThrow('')` matches any message | Assertions for an empty error message become too broad. | Rewrite `toThrow('')` and `toThrowError('')` to `/^$/`. | -| Assertion types add return and received parameters | Custom matcher declarations and direct assertion types fail type checking. | Report old generic forms, update Vite+ examples, and add type fixtures. | -| `expect.poll` rejects at timeout | Polls that completed late now fail. | Report configured polls and ask users to review the timeout; do not raise it automatically. | -| Unawaited async assertions fail | Tests that passed with a warning now fail. | Detect expression statements and add `await` only when the transform is safe; report the rest. | -| Titles and inspected values use `pretty-format` | Snapshots, `test.each` titles, and reporter consumers can change. | Run snapshot suites and report title snapshots; do not retain the v4 formatter. | -| Sequential APIs and options are removed | Test collection fails or concurrency changes. | Apply the documented `{ concurrent: false }` rewrite. | -| Browser command locators serialize as objects | Custom commands receive an object instead of a selector string. | Report locator-typed command parameters and suggest `SerializedLocator`. | -| Browser locators are exact by default | Partial or case-insensitive text lookups stop matching. | Add `browser.locators.exact: false` to migrated browser projects. | -| `toHaveTextContent` is strict | Partial strings and regular expressions fail. | Rewrite old partial uses to `toMatchTextContent`; keep known exact uses. | -| Vue and Svelte browser `render` are async | Immediate queries can race or access a promise. | Add `await` where safe and report non-async call sites. | -| Glob thresholds no longer inherit `perFile` | Coverage enforcement can become weaker. | Copy `perFile: true` into existing glob threshold objects. | -| `coverage.thresholds.perFile` also accepts an object | Config libraries that assume a boolean can reject or misread the new shape. | Update Vite+ config types and serializers; the old boolean form needs no migration. | -| Coverage include/exclude matching is precise | The measured file set can shrink or change. | Report patterns without glob syntax and compare v4/v5 coverage file lists in CI. | -| Parent config lookup is removed | Running below the config root can ignore configuration. | Give a parent-config diagnostic with `--config` and `--dir`; do not change v5 lookup rules. | -| DOM global assignment updates the window | `matchMedia` and other DOM APIs can observe new values. | Cover jsdom and happy-dom fixtures; report assignments to known DOM globals. | -| `populateGlobal().originals` contains descriptors | Custom environment teardown can restore descriptor objects as values. | Report assignments from `originals`; recommend `Object.defineProperty`. | -| Browser orchestrator URLs need a session | Direct `/__vitest_test__/` links fail. | Report hard-coded URLs and retain the URL printed or opened by Vitest. | -| `browser.api` moves to `api` | Custom ports are ignored. | Move the option when no top-level conflict exists; stop on conflict. | -| Reports and artifacts move under `.vitest` | CI uploads, merges, ignores, and stdout pipes can break. | Update known config and ignore files; report scripts that reference the old defaults. | -| Screenshot references use a dedicated option | Existing baselines can be read from the wrong directory. | Copy the old custom directory to the new expectation option and retain files. | -| Worker and concurrency IDs are 1-based | Array indexes, ports, and database names shift. | Report environment-variable reads and require project-specific review. | -| Worker-start failures are reported gracefully | Wrappers that match the old thrown error or localStorage warning can observe different diagnostics. | Snapshot the Vite+ failure path and preserve Vitest's exit status; no project source migration is needed. | -| `resolveConfig` returns resolved Vite config | Destructuring returns `undefined`; consumers miss `.test`. | Apply a targeted AST rewrite and add a programmatic API fixture. | -| Runner, expect, WebSocket, and WebDriverIO package migration | Removed runner publication, deprecated WebSocket APIs, split expect state, and community provider ownership cause resolution or state failures. | Remove `@vitest/runner`; report `@vitest/ws-client`; route Vitest assertions through root `vitest`; decouple community WebDriverIO. | -| Deprecated entry points are removed | Generated Vite+ shims and current generic migration output can become invalid. | Keep exact compatibility aliases, rewrite to canonical paths, and block unsupported internals. | +| Change | Upgrade risk | Vite+ handling | +| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| Node `>=22.12` and Vite `>=6.4` | The local CLI can fail before tests start. | Raise the CLI engine, validate the selected runtime, and keep bundled Vite in range. | +| `clearMocks: true` default | Setup-file, top-level, `beforeAll`, and cross-test mock history disappears. | Add `clearMocks: false` for existing configs; use `true` for new projects. | +| Configless v4 projects | New defaults apply without a config file that the migration can edit. | Report applicable changes. Do not create a config without a separate action and user confirmation. | +| Full test names use `>` | `-t 'suite test'` no longer matches across the boundary. | Scan scripts and CI strings; recommend one segment or `suite.*test`. | +| Browser iframe scaling changed | Headed browser UI and screenshot dimensions can differ from v4. | Run headed and headless screenshot fixtures at fixed viewports; refresh baselines only after review. | +| Inline projects inherit root config | Plugins, aliases, setup files, and arrays can apply twice or begin applying. | Add `extends: false` to static entries, report dynamic entries, and make plugin injection inheritance-aware. | +| Referenced configs can define nested projects | A merged root `projects` field can recurse, duplicate projects, or resolve paths from a new base. | Scan referenced configs and root-config merges; require manual extraction of a shared config. | +| Inline projects share a Vite server | Config files and plugin hooks run fewer times; stateful plugins can change behavior. | Add `sharedViteServer: false` for migrated inline-project configs; new projects use sharing. | +| Hoisted mock calls must be top-level | A prior warning becomes a startup error. | Report each nested call; do not move it automatically because scope dependencies may change. | +| Browser automocks remain mocked | Exports that called real code now return mock defaults. | Report factory-free browser mocks; suggest `{ spy: true }` when real behavior is required. | +| Class mocks inherit implementation prototypes | Methods and `instanceof` results change. | Add focused release tests; report class constructor mocks as review items. | +| Benchmark API rewrite | `bench`, benchmark modes, reporters, output, and compare options are removed. | Block on active benchmark APIs and link the new test-context fixture design. | +| UI token authentication | Stored or proxied bare UI URLs stop working. | Preserve the token URL in CLI output; report hard-coded `/__vitest__/` URLs. | +| Fake timers mock `Temporal` | Time tests with a global polyfill change. | Preserve v4 fake-timer behavior with `toNotFake: ['Temporal']` when detected. | +| `vi.setSystemTime()` mocks `Temporal` | Code can observe mocked Temporal time without enabling fake timers. | Report scopes that contain both Temporal use and `vi.setSystemTime()`; do not rewrite them. | +| `toThrow('')` matches any message | Assertions for an empty error message become too broad. | Rewrite `toThrow('')` and `toThrowError('')` to `/^$/`. | +| Assertion types add return and received parameters | Custom matcher declarations and direct assertion types fail type checking. | Report old generic forms, update Vite+ examples, and add type fixtures. | +| `expect.poll` rejects at timeout | Polls that completed late now fail. | Report configured polls and ask users to review the timeout; do not raise it automatically. | +| Unawaited async assertions fail | Tests that passed with a warning now fail. | Detect expression statements and add `await` only when the transform is safe; report the rest. | +| Titles and inspected values use `pretty-format` | Snapshots, `test.each` titles, and reporter consumers can change. | Run snapshot suites and report title snapshots; do not retain the v4 formatter. | +| Sequential APIs and options are removed | Test collection fails or concurrency changes. | Apply the documented `{ concurrent: false }` rewrite. | +| Browser command locators serialize as objects | Custom commands receive an object instead of a selector string. | Report locator-typed command parameters and suggest `SerializedLocator`. | +| Browser locators are exact by default | Partial or case-insensitive text lookups stop matching. | Add `browser.locators.exact: false` to migrated browser projects. | +| `toHaveTextContent` is strict | Partial strings and regular expressions fail. | Rewrite all v4 string and regular-expression calls to `toMatchTextContent` unless the user chooses v5 semantics. | +| Vue and Svelte browser `render` are async | Immediate queries can race or access a promise. | Add `await` where safe and report non-async call sites. | +| Glob thresholds no longer inherit `perFile` | Coverage enforcement can become weaker. | Copy `perFile: true` into existing glob threshold objects. | +| `coverage.thresholds.perFile` also accepts an object | Config libraries that assume a boolean can reject or misread the new shape. | Update Vite+ config types and serializers; the old boolean form needs no migration. | +| Coverage include/exclude matching is precise | The measured file set can shrink or change. | Compare resolved v4/v5 file sets. If comparison is unavailable, report all configured patterns for review. | +| Parent config lookup is removed | Running below the config root can ignore configuration. | Give a parent-config diagnostic with `--config` and `--dir`; do not change v5 lookup rules. | +| DOM global assignment updates the window | `matchMedia` and other DOM APIs can observe new values. | Cover jsdom and happy-dom fixtures; report assignments to known DOM globals. | +| `populateGlobal().originals` contains descriptors | Custom environment teardown can restore descriptor objects as values. | Report assignments from `originals`; recommend `Object.defineProperty`. | +| Browser orchestrator URLs need a session | Direct `/__vitest_test__/` links fail. | Report hard-coded URLs and retain the URL printed or opened by Vitest. | +| `browser.api` moves to `api` | Custom ports are ignored. | Move the option when no top-level conflict exists; stop on conflict. | +| Reports and artifacts move under `.vitest` | CI uploads, merges, ignores, and stdout pipes can break. | Update known config and ignore files; report scripts that reference the old defaults. | +| Screenshot references use a dedicated option | Existing baselines can be read from the wrong directory. | Copy the old custom directory to the new expectation option and retain files. | +| Worker and concurrency IDs are 1-based | Array indexes, ports, and database names shift. | Report environment-variable reads and require project-specific review. | +| Worker-start failures are reported gracefully | Wrappers that match the old thrown error or localStorage warning can observe different diagnostics. | Snapshot the Vite+ failure path and preserve Vitest's exit status; no project source migration is needed. | +| `resolveConfig` returns resolved Vite config | Destructuring returns `undefined`; consumers miss `.test`. | Apply a targeted AST rewrite and add a programmatic API fixture. | +| Runner, expect, WebSocket, and WebDriverIO package migration | Removed runner publication, deprecated WebSocket APIs, split expect state, and community provider ownership cause resolution or state failures. | Use the runner symbol allowlist, report unsupported APIs, route assertions through root `vitest`, and decouple WebDriverIO. | +| Deprecated entry points are removed | Generated Vite+ shims and current generic migration output can become invalid. | Keep exact compatibility aliases, rewrite to canonical paths, and block unsupported internals. | ## Rollout @@ -306,13 +337,13 @@ This matrix tracks every v5 migration-guide item and the extra breaking entries ### Phase 2: migration support - Implement the versioned scan, safe rewrites, compatibility config options, and Node preflight. -- Add before-and-after fixtures for plain Vitest projects, existing Vite+ projects, workspaces, and browser projects. +- Add before-and-after fixtures for configless projects, configured projects, workspaces, and browser projects. - Publish the migration guide with each item in the risk matrix. ### Phase 3: Vite+ prerelease - Move to the final Vitest `v5.0.0` packages when available. -- Recheck all releases after `rc.2` and update the RFC and migration guide. +- Recheck all releases after `rc.3` and update the RFC and migration guide. - Publish a Vite+ prerelease and run ecosystem CI against real projects. - Keep the v4-based Vite+ release available for Node 20 and for any WebDriverIO user blocked by community-provider timing. @@ -331,9 +362,9 @@ The implementation must pass these gates: 3. Identity tests that prove `vp test`, `vite-plus/test`, browser providers, custom matchers, and coverage use one runner and assertion state. 4. Node 22.18, 24.11, and 26 jobs, plus actionable rejection tests for Node 20 and 25 project pins. 5. npm, pnpm, Yarn PnP, and Bun install and test fixtures. -6. Single-project, inherited inline-project, `extends: false`, referenced-config, nested-project, and shared-server fixtures. +6. Configless, single-project, inherited inline-project, `extends: false`, referenced-config, nested-project, and shared-server fixtures. Add a fixture that combines `extends: false` with `sharedViteServer: false`. Assert independent server and plugin-hook behavior without extra inheritance. 7. Playwright and Preview browser suites. Run the WebDriverIO suite against a verified community release without requiring an exact Vitest patch version. -8. V8 and Istanbul coverage with matching providers, mismatched-provider rejection, glob threshold checks, and v4/v5 file-list comparison. +8. V8 and Istanbul coverage with matching providers, mismatched-provider rejection, glob threshold checks, and v4/v5 file-list comparison. Verify the `@vitest/istanbuljs` dependency graph from `rc.3` or later. 9. JSON, JUnit, HTML, blob merge, attachments, failure screenshots, and reference-screenshot path fixtures. 10. UI token, browser session, custom command locator, jsdom, happy-dom, Temporal, custom environment, worker ID, `resolveConfig`, custom matcher, and benchmark migration fixtures. 11. `ecosystem-ci` cases for `vite-plus-vitest-global-type-minimal-repro`, `vitest-playwright-repro`, and `vite-plus-vitest-type-aug`, followed by the broader ecosystem set. From 20cf70c21f2e9c2dda1673266d0509f01e9fa348 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 3 Sep 2026 21:34:38 +0800 Subject: [PATCH 3/5] docs(rfc): target final Vitest v5 release --- rfcs/vitest-v5-upgrade.md | 40 +++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/rfcs/vitest-v5-upgrade.md b/rfcs/vitest-v5-upgrade.md index 71f25c8f2f..d06fb1439b 100644 --- a/rfcs/vitest-v5-upgrade.md +++ b/rfcs/vitest-v5-upgrade.md @@ -2,19 +2,19 @@ - Status: Proposed - Tracking issue: [#2405](https://github.com/voidzero-dev/vite-plus/issues/2405) -- Upstream baseline: [`v5.0.0-rc.3`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.3) -- Release target: the final `v5.0.0` release +- Upstream baseline: [`v5.0.0`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0) +- Release target: Vite+ before `1.0` ## Decision -Upgrade `vp test` and the `vite-plus/test*` API to the final Vitest v5 release before Vite+ 1.0. Do not put a Vitest release candidate in a stable Vite+ release. +Upgrade `vp test` and the `vite-plus/test*` API to Vitest `5.0.0` before Vite+ 1.0. Pin the official Vitest packages to the final release. The upgrade has four parts: 1. Update the bundled runner, browser packages, public shims, resolver, and Vite config integration as one versioned unit. 2. Add a Vitest v5 pass to `vp migrate`. It preserves v4 behavior where a config option can do so, applies safe source rewrites, and reports changes that need review. 3. Raise the `vite-plus` Node.js range to the intersection of the current Vite+ range and the Vitest v5 range: `^22.18.0 || ^24.11.0 || >=26.0.0`. -4. Release the change through a Vite+ prerelease, run the compatibility matrix in this RFC, and recheck the final Vitest changelog before a stable release. +4. Release the change through a Vite+ prerelease and run the compatibility matrix in this RFC before a stable release. New projects use the Vitest v5 defaults. Migrated projects get explicit compatibility options. A user can remove those options later to adopt the new defaults one at a time. @@ -51,7 +51,7 @@ Vitest v5 changes the package graph and project configuration model. A version-o ## Upstream audit -The audit covers every v5 prerelease through `v5.0.0-rc.3` and the complete [Vitest v5 migration guide](https://main.vitest.dev/guide/migration#vitest-5). The release train introduced breaking changes in these groups: +The audit covers every v5 prerelease, the final [`v5.0.0` release](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0), and the complete [Vitest v5 migration guide](https://vitest.dev/guide/migration#vitest-5). Vitest v5 introduced breaking changes in these groups: | Release | Breaking-change themes | | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -65,14 +65,16 @@ The audit covers every v5 prerelease through `v5.0.0-rc.3` and the complete [Vit | [`rc.1`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.1) | project inheritance, nested projects, shared servers, test-name separators, async assertions, failure screenshots, class mocks, and assertion generics | | [`rc.2`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2) | no new breaking change | | [`rc.3`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.3) | no new breaking change; Istanbul coverage moved to `@vitest/istanbuljs` packages | +| [`rc.4`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.4) | `vitest list` and the programmatic `collect()` API use static parsing by default | +| [`v5.0.0`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.0) | no new breaking change after `rc.4` | -The final release is still pending at the time of this RFC. Release work must compare the final release with `rc.3` and update this audit. +Vitest published `v5.0.0` on September 3, 2026. The comparison from `rc.4` to the final tag contains fixes, documentation, dependency updates, and performance work. It contains no additional breaking commit. The final package manifests retain the audited Node, Vite, export, browser-provider, and Istanbul dependency contracts. ## Compatibility design ### 1. Runtime and dependency graph -Pin the official Vitest packages to one exact v5 version. Keep the existing coverage-provider version guard. Coverage packages remain project-installed peers and must match the bundled runner exactly. +Pin the official Vitest packages to the exact version `5.0.0`. Keep the existing coverage-provider version guard. Coverage packages remain project-installed peers and must match the bundled runner exactly. | Package group | Policy | | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -89,7 +91,7 @@ Replace the resolver's broad `@vitest/*` rule with an explicit supported-package The repository vendors Vite and Rolldown workspaces. Their catalogs still request Vitest v4, and `sync-remote` rejects the v4/v5 major conflict. Prefer upstream v5 updates. If release timing requires a local bridge, add `vitest` to the sync tool's reviewed major-conflict set, align direct `@vitest/*` dependencies in the vendored workspaces, and run their test suites with the resolved v5 graph. Do not leave a hidden mix of v4 and v5 packages in the development lockfile. -Vitest `v5.0.0-rc.3` moves Istanbul internals to `@vitest/istanbuljs` packages. Keep those packages on the project-installed `@vitest/coverage-istanbul` dependency edge. The resolver allowlist must not redirect them to a missing Vite+ copy. +Vitest `5.0.0` uses `@vitest/istanbuljs` packages for Istanbul internals. Keep those packages on the project-installed `@vitest/coverage-istanbul` dependency edge. The resolver allowlist must not redirect them to a missing Vite+ copy. ### 2. Node.js and Vite prerequisites @@ -124,6 +126,8 @@ Do not create partial shims for `vite-plus/test/runners`, `vite-plus/test/suite` Keep the Playwright and Preview provider aliases. Keep the WebDriverIO aliases only when the community peer is installed and compatible. Update `packages/cli/BUNDLING.md` to state which paths mirror upstream and which paths are Vite+ compatibility contracts. +At the time of the final Vitest release, the latest community WebDriverIO provider is `5.0.0-rc.1`. The final Vitest manifest accepts `@vitest/browser-webdriverio` versions `^5.0.0-beta.5 || >=5.0.0`. Test the selected community version against Vitest `5.0.0`; do not hold the official package graph at an earlier release candidate. + ### 4. Config integration and project inheritance Vitest v4 inline projects did not inherit root plugins. The current Vite+ wrapper therefore prepends its three plugins to the root and every inline project. Vitest v5 sets `extends: true` by default and merges plugin arrays. The current wrapper would register each Vite+ plugin twice. @@ -195,7 +199,7 @@ The `toNotFake` option only preserves behavior while fake timers run. It does no ### Safe source and config rewrites -Apply AST rewrites for these forms: +Apply AST or structured command rewrites for these forms: - `test.sequential`, `describe.sequential`, and `{ sequential: true }` to `{ concurrent: false }` forms; - all v4 browser `toHaveTextContent` calls with a string or regular expression to `toMatchTextContent`; @@ -204,6 +208,8 @@ Apply AST rewrites for these forms: - deprecated Vitest entry points to the canonical Vite+ v5 paths; - root-safe `@vitest/expect` imports to `vite-plus/test`; - supported `@vitest/runner` uses to `TestRunner` from `vite-plus/test`; +- direct `vitest list` commands without a static-parse flag to include `--no-static-parse`; +- direct calls to the programmatic `Vitest.collect()` API to pass `{ staticParse: false }` when the options are absent or are a static object without `staticParse`; - HTML reporter `outputFile` directory settings to `outputDir`. Run specific mappings before the current generic `vitest/` rewrite. The generic rule must only emit a path present in the final `vite-plus` export map. @@ -243,6 +249,7 @@ This list is the authoritative scanner checklist. Report each item with a file l - referenced config files that merge a root config containing `test.projects`; - dynamic, function, or promise inline projects whose effective config cannot be determined from source; - plugins that depend on one Vite server or config execution per project; +- `vitest list` commands or programmatic `collect()` calls whose static-parse setting cannot be determined or rewritten safely; - configured `coverage.include` or `coverage.exclude` when a v4/v5 resolved file-set comparison is unavailable; - imports from removed runner, suite, or internal module-runner APIs that have no direct replacement; - direct `@vitest/ws-client` use and `@vitest/expect` or `@vitest/runner` symbols that are not available from the root v5 API. @@ -280,7 +287,7 @@ The entry-point migration uses these exact mappings: ## Complete incompatible-change and risk matrix -This matrix tracks every v5 migration-guide item and the extra breaking entries in the prerelease notes. “Scan” refers to the versioned `vp migrate` pass. +This matrix tracks every v5 migration-guide item and the extra breaking entries in the release notes. “Scan” refers to the versioned `vp migrate` pass. | Change | Upgrade risk | Vite+ handling | | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | @@ -288,6 +295,7 @@ This matrix tracks every v5 migration-guide item and the extra breaking entries | `clearMocks: true` default | Setup-file, top-level, `beforeAll`, and cross-test mock history disappears. | Add `clearMocks: false` for existing configs; use `true` for new projects. | | Configless v4 projects | New defaults apply without a config file that the migration can edit. | Report applicable changes. Do not create a config without a separate action and user confirmation. | | Full test names use `>` | `-t 'suite test'` no longer matches across the boundary. | Scan scripts and CI strings; recommend one segment or `suite.*test`. | +| Test listing uses static parsing | Runtime-generated tests and collection side effects can be absent from `vitest list` and `Vitest.collect()` results. | Add `--no-static-parse` or `{ staticParse: false }` to direct migrated uses; report dynamic wrappers. | | Browser iframe scaling changed | Headed browser UI and screenshot dimensions can differ from v4. | Run headed and headless screenshot fixtures at fixed viewports; refresh baselines only after review. | | Inline projects inherit root config | Plugins, aliases, setup files, and arrays can apply twice or begin applying. | Add `extends: false` to static entries, report dynamic entries, and make plugin injection inheritance-aware. | | Referenced configs can define nested projects | A merged root `projects` field can recurse, duplicate projects, or resolve paths from a new base. | Scan referenced configs and root-config merges; require manual extraction of a shared config. | @@ -329,7 +337,7 @@ This matrix tracks every v5 migration-guide item and the extra breaking entries ### Phase 1: compatibility branch -- Pin the current v5 release candidate only in a development branch. +- Pin the official Vitest packages to `5.0.0` in a development branch. - Update the package graph, export generator, resolver, project plugin injection, and migration package set. - Add export snapshots and unit fixtures before accepting generated package changes. - Resolve the vendored Vite and Rolldown catalog conflict without a mixed Vitest family. @@ -342,8 +350,8 @@ This matrix tracks every v5 migration-guide item and the extra breaking entries ### Phase 3: Vite+ prerelease -- Move to the final Vitest `v5.0.0` packages when available. -- Recheck all releases after `rc.3` and update the RFC and migration guide. +- Confirm that the lockfile resolves the final official `5.0.0` package graph. +- Verify one compatible community WebDriverIO provider against Vitest `5.0.0`. - Publish a Vite+ prerelease and run ecosystem CI against real projects. - Keep the v4-based Vite+ release available for Node 20 and for any WebDriverIO user blocked by community-provider timing. @@ -353,7 +361,7 @@ Release only after the gates below pass. State the Node requirement and the `vp ## Validation and release gates -The investigation spike updated the available official packages to `5.0.0-rc.2`, removed the unavailable runner package, built the CLI and 60 generated test exports, and passed the focused config/resolver tests. The complete TypeScript unit run passed 63 files and 1,029 tests. The spike also reproduced the vendored Rolldown catalog conflict, which confirms that dependency synchronization needs an explicit solution. +The earlier investigation spike used `5.0.0-rc.2`. It removed the unavailable runner package, built the CLI and 60 generated test exports, and passed the focused config/resolver tests. The complete TypeScript unit run passed 63 files and 1,029 tests. The spike also reproduced the vendored Rolldown catalog conflict, which confirms that dependency synchronization needs an explicit solution. Repeat these checks against final `5.0.0`; the `rc.4` static-collection change was not present in the spike. The implementation must pass these gates: @@ -364,9 +372,9 @@ The implementation must pass these gates: 5. npm, pnpm, Yarn PnP, and Bun install and test fixtures. 6. Configless, single-project, inherited inline-project, `extends: false`, referenced-config, nested-project, and shared-server fixtures. Add a fixture that combines `extends: false` with `sharedViteServer: false`. Assert independent server and plugin-hook behavior without extra inheritance. 7. Playwright and Preview browser suites. Run the WebDriverIO suite against a verified community release without requiring an exact Vitest patch version. -8. V8 and Istanbul coverage with matching providers, mismatched-provider rejection, glob threshold checks, and v4/v5 file-list comparison. Verify the `@vitest/istanbuljs` dependency graph from `rc.3` or later. +8. V8 and Istanbul coverage with matching providers, mismatched-provider rejection, glob threshold checks, and v4/v5 file-list comparison. Verify the final `@vitest/istanbuljs` dependency graph. 9. JSON, JUnit, HTML, blob merge, attachments, failure screenshots, and reference-screenshot path fixtures. -10. UI token, browser session, custom command locator, jsdom, happy-dom, Temporal, custom environment, worker ID, `resolveConfig`, custom matcher, and benchmark migration fixtures. +10. UI token, browser session, custom command locator, jsdom, happy-dom, Temporal, custom environment, worker ID, `resolveConfig`, `vitest list`, `Vitest.collect()`, custom matcher, and benchmark migration fixtures. 11. `ecosystem-ci` cases for `vite-plus-vitest-global-type-minimal-repro`, `vitest-playwright-repro`, and `vite-plus-vitest-type-aug`, followed by the broader ecosystem set. 12. Vendored Vite and Rolldown tests under the final synchronized dependency graph. From 3bf4aa04a00945e88240342a24eb0a0aff63ee27 Mon Sep 17 00:00:00 2001 From: MK Date: Sun, 6 Sep 2026 23:32:15 +0800 Subject: [PATCH 4/5] feat(test): upgrade to Vitest v5 with migration support --- .../__tests__/upgrade-deps-utils.spec.ts | 6 + .github/scripts/upgrade-deps.ts | 7 +- .github/workflows/ci.yml | 15 +- .../command_tool_deep_help_delegation.md | 7 +- .../create_approve_builds_migrate_pnpm11.md | 2 + .../snapshots/create_approve_builds_pnpm11.md | 2 + .../migration_agent_claude/package.json | 2 +- .../snapshots/migration_agent_claude.md | 4 + .../migration_bunfig_inline_array.md | 4 + .../snapshots/migration_bunfig_missing.md | 4 + .../migration_bunfig_no_install_section.md | 4 + .../snapshots/migration_from_vitest_config.md | 4 +- .../snapshots/migration_from_vitest_files.md | 4 + .../migration_merge_vite_config_ts.md | 2 + .../snapshots/migration_monorepo_bun.md | 17 + .../snapshots/migration_monorepo_pnpm.md | 17 + .../snapshots.toml | 1 + ...migration_monorepo_root_vitest_adjacent.md | 9 + .../snapshots.toml | 1 + ...tion_monorepo_skip_vite_peer_dependency.md | 14 + .../migration_monorepo_yarn4/snapshots.toml | 1 + .../snapshots/migration_monorepo_yarn4.md | 22 + .../fixtures/migration_no_agent/package.json | 2 +- .../snapshots/migration_no_agent.md | 4 + .../migration_not_supported_vitest3.md | 8 +- .../snapshots/migration_npmx_dev.md | 9 + .../fixtures/migration_nvmrc/.nvmrc | 2 +- .../snapshots/migration_nvmrc.md | 2 +- .../snapshots/migration_nvmrc_lts.md | 9 + .../snapshots/migration_nvmrc_node_alias.md | 10 + .../snapshots.toml | 6 +- ...gration_preserve_below_policy_node_pins.md | 58 +- .../snapshots.toml | 1 + .../migration_rewrite_declare_module.md | 9 + .../package.json | 2 +- .../migration_rewrite_reference_types.md | 4 + .../snapshots.toml | 1 + .../migration_skip_vite_dependency.md | 9 + .../snapshots.toml | 1 + .../migration_skip_vite_peer_dependency.md | 9 + .../snapshots/migration_standalone_npm.md | 5 + .../snapshots/migration_standalone_pnpm.md | 5 + .../migration_standalone_yarn4_idempotent.md | 5 + ...migration_standalone_yarn_below_catalog.md | 5 + ...igration_upgrade_browser_peer_only_pnpm.md | 10 +- .../snapshots.toml | 1 + ...ration_upgrade_browser_source_only_pnpm.md | 5 + .../snapshots.toml | 1 + ...ration_upgrade_browser_webdriverio_pnpm.md | 7 +- .../migration_upgrade_bun_catalog.md | 9 + ...tion_upgrade_deprecated_coverage_c8_npm.md | 9 + .../migration_upgrade_hooks_flag_pnpm/.nvmrc | 2 +- .../migration_upgrade_hooks_flag_pnpm.md | 4 + ..._upgrade_monorepo_vitest_localized_pnpm.md | 9 + ...ration_upgrade_nuxt_test_utils_monorepo.md | 22 + ...ration_upgrade_peer_vitest_catalog_pnpm.md | 13 + .../snapshots.toml | 2 +- .../migration_upgrade_pkg_pr_new_npm.md | 13 + .../snapshots.toml | 2 +- .../migration_upgrade_pkg_pr_new_pnpm.md | 13 + .../snapshots.toml | 2 +- .../migration_upgrade_pnpm9_overrides.md | 9 + ...grade_required_vitest_peer_metadata_npm.md | 13 + .../migration_upgrade_setup_full_pnpm/.nvmrc | 2 +- .../migration_upgrade_setup_full_pnpm.md | 6 +- .../.nvmrc | 2 +- ...tion_upgrade_setup_skipped_default_pnpm.md | 9 + .../migration_upgrade_stale_local_pnpm.md | 9 + .../pnpm-workspace.yaml | 4 +- .../migration_upgrade_version_table_pnpm.md | 13 +- ...tion_upgrade_vite_plus_protocol_pin_npm.md | 9 + ...migration_upgrade_vitest_exact_peer_npm.md | 9 + ...ion_upgrade_vitest_non_runtime_only_npm.md | 20 +- ...pgrade_vitest_reference_whitespace_pnpm.md | 4 + ..._upgrade_vitest_retained_references_npm.md | 13 + .../snapshots/migration_vitest_import_only.md | 4 + .../migration_vitest_peer_dep/snapshots.toml | 1 + .../snapshots/migration_vitest_peer_dep.md | 9 + .../migration_vitest_unmanaged_override.md | 4 + .../migration_vitest_v5/example.test.ts | 6 + .../fixtures/migration_vitest_v5/package.json | 13 + .../migration_vitest_v5/snapshots.toml | 94 ++ .../snapshots/api_conflict_preflight.md | 37 + .../snapshots/benchmark_preflight.md | 45 + .../snapshots/compatibility.md | 79 ++ .../snapshots/mixed_project_assertions.md | 74 ++ .../snapshots/node_container_scope.md | 89 ++ .../snapshots/node_preflight.md | 48 + .../plugin_projects_and_dom_types.md | 55 + .../snapshots/removed_api_preflight.md | 38 + .../migration_vitest_v5/vite.config.ts | 8 + .../fixtures/migration_volta/package.json | 2 +- .../snapshots/migration_volta.md | 4 +- .../migration_volta_with_nvmrc/.nvmrc | 2 +- .../migration_volta_with_nvmrc/snapshots.toml | 2 +- .../snapshots/migration_volta_with_nvmrc.md | 4 +- .../snapshots/test_inline_snapshot_indent.md | 2 +- .../test_managed_package_manager_path.md | 2 +- .../test_v5_coverage/coverage.test.js | 8 + .../test_v5_coverage/legacy/coverage.test.js | 3 + .../test_v5_coverage/legacy/package.json | 6 + .../test_v5_coverage/legacy/vitest.config.mjs | 12 + .../fixtures/test_v5_coverage/package.json | 10 + .../fixtures/test_v5_coverage/snapshots.toml | 11 + .../coverage_providers_and_v4_file_set.md | 24 + .../fixtures/test_v5_coverage/src/covered.js | 1 + .../fixtures/test_v5_coverage/src/ignored.js | 1 + .../fixtures/test_v5_coverage/src/untested.js | 1 + .../test_v5_coverage/threshold.config.js | 13 + .../fixtures/test_v5_coverage/verify.mjs | 74 ++ .../test_v5_install_managers/identity.test.js | 12 + .../test_v5_install_managers/package.json | 6 + .../test_v5_install_managers/snapshots.toml | 60 + .../snapshots/bun_install_and_runtime.md | 23 + .../snapshots/npm_install_and_runtime.md | 23 + .../snapshots/pnpm_install_and_runtime.md | 23 + .../yarn_pnp_conversion_and_runtime.md | 72 ++ .../yarn_without_project_vite_or_vitest.md | 36 + .../test_v5_install_managers/vite.config.js | 2 + .../test_v5_node_apis/benchmark.test.js | 10 + .../test_v5_node_apis/dynamic.test.js | 6 + .../fixtures/test_v5_node_apis/package.json | 5 + .../test_v5_node_apis/runtime.test.js | 24 + .../fixtures/test_v5_node_apis/snapshots.toml | 14 + .../list_static_and_runtime_collection.md | 39 + .../snapshots/node_api_and_reports.md | 15 + .../fixtures/test_v5_node_apis/verify.mjs | 65 + .../custom-environment.js | 19 + .../test_v5_optional_packages/custom.test.js | 4 + .../happy-dom.test.js | 8 + .../test_v5_optional_packages/jsdom.test.js | 10 + .../test_v5_optional_packages/package.json | 12 + .../test_v5_optional_packages/snapshots.toml | 11 + ...nments_temporal_html_and_worker_startup.md | 48 + .../temporal.test.js | 26 + .../test_v5_optional_packages/verify-ui.mjs | 26 + .../verify-worker.mjs | 15 + .../test_v5_optional_packages/vite.config.js | 10 + .../worker-failure.config.js | 6 + .../test_v5_parent_config/package.json | 5 + .../test_v5_parent_config/snapshots.toml | 11 + .../snapshots/diagnostic.global.md | 20 + .../snapshots/diagnostic.local.md | 18 + .../snapshots/explicit_config.md | 16 + .../test_v5_parent_config/sub/example.test.ts | 5 + .../test_v5_parent_config/vite.config.ts | 3 + .../fixtures/test_v5_preview/browser.test.js | 28 + .../fixtures/test_v5_preview/defines.test.js | 9 + .../fixtures/test_v5_preview/package.json | 1 + .../fixtures/test_v5_preview/snapshots.toml | 19 + .../snapshots/preview_runtime.md | 9 + .../snapshots/upstream_browser_defines.md | 11 + .../snapshots/upstream_real_timers.md | 11 + .../fixtures/test_v5_preview/upstream.test.js | 7 + .../fixtures/test_v5_preview/verify.mjs | 66 + .../test_v5_projects/identity.test.js | 11 + .../fixtures/test_v5_projects/package.json | 5 + .../fixtures/test_v5_projects/snapshots.toml | 9 + .../snapshots/project_runtime_matrix.md | 21 + .../vendor/jest-extended/index.js | 7 + .../vendor/jest-extended/package.json | 1 + .../test_v5_projects/vendor/vitest/index.js | 1 + .../vendor/vitest/package.json | 1 + .../fixtures/test_v5_projects/verify.mjs | 42 + .../fixtures/test_v5_projects/vite.config.mjs | 27 + .../test_v5_projects/vitest.nested.config.js | 8 + .../vitest.referenced.config.js | 8 + .../fixtures/test_v5_runtime/package.json | 4 + .../fixtures/test_v5_runtime/snapshots.toml | 15 + .../snapshots/reject_node_20.md | 18 + .../snapshots/reject_node_25.md | 18 + .../test_v5_screenshots/browser.test.js | 10 + .../test_v5_screenshots/failure.test.js | 6 + .../fixtures/test_v5_screenshots/package.json | 1 + .../test_v5_screenshots/snapshots.toml | 13 + .../snapshots/headed_paths_and_dimensions.md | 11 + .../headless_paths_and_dimensions.md | 9 + .../fixtures/test_v5_screenshots/verify.mjs | 57 + .../test_v5_upstream_types/package.json | 12 + .../test_v5_upstream_types/snapshots.toml | 21 + .../snapshots/jest_dom_browser_type_order.md | 14 + .../jest_dom_v7_browser_type_order.md | 20 + .../test_v5_upstream_types/verify.mjs | 45 + .../test_v5_webdriverio/browser.test.js | 20 + .../fixtures/test_v5_webdriverio/package.json | 1 + .../test_v5_webdriverio/snapshots.toml | 5 + ...community_provider_and_browser_protocol.md | 7 + .../fixtures/test_v5_webdriverio/verify.mjs | 43 + .../snapshots/test_vi_mock_hoist.md | 2 +- .../snapshots/vite_plugins_async_test.md | 2 +- .../snapshots/vitest_browser_mode.md | 9 +- .../vitest_browser_mode/vitest.config.ts | 6 +- .../tests/cli_snapshots/redact.rs | 11 + crates/vp_cli_snapshots/tests/redact_unit.rs | 18 + crates/vp_global_cli/src/js_executor.rs | 71 +- crates/vp_migration/src/import_rewriter.rs | 160 ++- docs/.vitepress/config.mts | 5 +- docs/guide/migrate.md | 8 +- docs/guide/test.md | 2 + docs/guide/vitest-v5.md | 138 ++ ecosystem-ci/patch-project.ts | 26 +- package.json | 1 + packages/cli/BUNDLING.md | 33 + packages/cli/build.ts | 67 +- packages/cli/package.json | 87 +- .../__snapshots__/exports-map.spec.ts.snap | 75 ++ .../__tests__/define-config-plugins.spec.ts | 58 + .../define-config-vitest-resolver.spec.ts | 87 +- .../cli/src/__tests__/exports-map.spec.ts | 98 ++ .../cli/src/__tests__/oxlint-plugin.spec.ts | 14 + .../cli/src/__tests__/resolve-test.spec.ts | 34 +- packages/cli/src/bin.ts | 10 +- packages/cli/src/define-config.ts | 237 +++- .../src/migration/__tests__/migrator.spec.ts | 24 +- .../src/migration/__tests__/vitest-v5.spec.ts | 1142 +++++++++++++++++ packages/cli/src/migration/bin.ts | 64 +- packages/cli/src/migration/migrator.ts | 1 + packages/cli/src/migration/migrator/README.md | 1 + .../cli/src/migration/migrator/catalog.ts | 7 +- .../src/migration/migrator/package-json.ts | 3 +- .../migration/migrator/vite-plus-bootstrap.ts | 5 +- .../migration/migrator/vitest-ecosystem.ts | 15 +- .../cli/src/migration/migrator/vitest-v5.ts | 1012 +++++++++++++++ packages/cli/src/migration/vitest-v5/ast.ts | 281 ++++ .../cli/src/migration/vitest-v5/commands.ts | 139 ++ .../cli/src/migration/vitest-v5/config.ts | 763 +++++++++++ .../cli/src/migration/vitest-v5/source.ts | 777 +++++++++++ packages/cli/src/oxlint-plugin.ts | 8 +- packages/cli/src/resolve-test.ts | 50 +- packages/cli/src/utils/constants.ts | 13 +- packages/cli/src/utils/vitest-ecosystem.ts | 34 +- packages/cli/src/vitest-v5-entry-points.json | 7 + .../src/__tests__/sync-remote-deps.spec.ts | 53 + .../__tests__/test-vendored-vitest.spec.ts | 27 + packages/tools/src/sync-remote-deps.ts | 69 +- packages/tools/src/test-vendored-vitest.ts | 125 ++ pnpm-lock.yaml | 826 +++++++++--- pnpm-workspace.yaml | 37 +- rfcs/vitest-v5-upgrade.md | 53 +- 239 files changed, 9005 insertions(+), 497 deletions(-) create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/example.test.ts create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/api_conflict_preflight.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/benchmark_preflight.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/compatibility.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/mixed_project_assertions.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_container_scope.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_preflight.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/plugin_projects_and_dom_types.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/removed_api_preflight.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/vite.config.ts create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/coverage.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/legacy/coverage.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/legacy/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/legacy/vitest.config.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/snapshots/coverage_providers_and_v4_file_set.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/src/covered.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/src/ignored.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/src/untested.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/threshold.config.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_coverage/verify.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/identity.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/snapshots/bun_install_and_runtime.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/snapshots/npm_install_and_runtime.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/snapshots/pnpm_install_and_runtime.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/snapshots/yarn_pnp_conversion_and_runtime.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/snapshots/yarn_without_project_vite_or_vitest.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_install_managers/vite.config.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/benchmark.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/dynamic.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/runtime.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/snapshots/list_static_and_runtime_collection.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/snapshots/node_api_and_reports.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_node_apis/verify.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/custom-environment.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/custom.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/happy-dom.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/jsdom.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/snapshots/environments_temporal_html_and_worker_startup.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/temporal.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/verify-ui.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/verify-worker.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/vite.config.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/worker-failure.config.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/snapshots/diagnostic.global.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/snapshots/diagnostic.local.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/snapshots/explicit_config.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/sub/example.test.ts create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_parent_config/vite.config.ts create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/browser.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/defines.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/snapshots/preview_runtime.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/snapshots/upstream_browser_defines.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/snapshots/upstream_real_timers.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/upstream.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_preview/verify.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/identity.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/snapshots/project_runtime_matrix.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vendor/jest-extended/index.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vendor/jest-extended/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vendor/vitest/index.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vendor/vitest/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/verify.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vite.config.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vitest.nested.config.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_projects/vitest.referenced.config.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_runtime/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_runtime/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_runtime/snapshots/reject_node_20.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_runtime/snapshots/reject_node_25.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/browser.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/failure.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/snapshots/headed_paths_and_dimensions.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/snapshots/headless_paths_and_dimensions.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_screenshots/verify.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_upstream_types/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_upstream_types/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_upstream_types/snapshots/jest_dom_browser_type_order.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_upstream_types/snapshots/jest_dom_v7_browser_type_order.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_upstream_types/verify.mjs create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_webdriverio/browser.test.js create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_webdriverio/package.json create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_webdriverio/snapshots.toml create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_webdriverio/snapshots/community_provider_and_browser_protocol.md create mode 100644 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_webdriverio/verify.mjs create mode 100644 docs/guide/vitest-v5.md create mode 100644 packages/cli/src/__tests__/__snapshots__/exports-map.spec.ts.snap create mode 100644 packages/cli/src/migration/__tests__/vitest-v5.spec.ts create mode 100644 packages/cli/src/migration/migrator/vitest-v5.ts create mode 100644 packages/cli/src/migration/vitest-v5/ast.ts create mode 100644 packages/cli/src/migration/vitest-v5/commands.ts create mode 100644 packages/cli/src/migration/vitest-v5/config.ts create mode 100644 packages/cli/src/migration/vitest-v5/source.ts create mode 100644 packages/cli/src/vitest-v5-entry-points.json create mode 100644 packages/tools/src/__tests__/test-vendored-vitest.spec.ts create mode 100644 packages/tools/src/test-vendored-vitest.ts diff --git a/.github/scripts/__tests__/upgrade-deps-utils.spec.ts b/.github/scripts/__tests__/upgrade-deps-utils.spec.ts index b8b6b1f4a8..671ff1d069 100644 --- a/.github/scripts/__tests__/upgrade-deps-utils.spec.ts +++ b/.github/scripts/__tests__/upgrade-deps-utils.spec.ts @@ -16,3 +16,9 @@ test('selects the highest stable version from the supported major', () => { test('returns undefined when the supported major has no stable release', () => { expect(findLatestStableVersionForMajor(['4.2.0-beta.1', '5.0.0'], 4)).toBeUndefined(); }); + +test('keeps Vitest upgrades on v5 after the migration', () => { + expect( + findLatestStableVersionForMajor(['4.1.11', '5.0.0', '5.1.0', '5.2.0-beta.1', '6.0.0'], 5), + ).toBe('5.1.0'); +}); diff --git a/.github/scripts/upgrade-deps.ts b/.github/scripts/upgrade-deps.ts index acc5a6e633..b895b6f2d0 100644 --- a/.github/scripts/upgrade-deps.ts +++ b/.github/scripts/upgrade-deps.ts @@ -72,7 +72,7 @@ type PnpmWorkspaceEntry = { const STABLE_SEMVER_TAG_RE = /^v?\d+\.\d+\.\d+$/; // Vitest major upgrades can change the bundled API, export shims, and CLI // behavior. Advance this only after Vite+ has adapted to the new major. -const SUPPORTED_VITEST_MAJOR = 4; +const SUPPORTED_VITEST_MAJOR = 5; const isFullSha = (s: string): boolean => /^[0-9a-f]{40}$/.test(s); @@ -211,18 +211,15 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise + doctor [...filters] list [...filters] [...filters] complete [shell] @@ -28,6 +29,7 @@ For more info, run any command with the `--help` flag: $ vitest dev --help $ vitest bench --help $ vitest init --help + $ vitest doctor --help $ vitest list --help $ vitest --help $ vitest complete --help @@ -47,7 +49,7 @@ Options: --coverage.allowExternal Collect coverage of files outside the project root (default: false) --coverage.skipFull Do not show files with 100% statement, branch, and function coverage (default: false) --coverage.thresholds.100 Shortcut to set all coverage thresholds to 100 (default: false) - --coverage.thresholds.perFile Check thresholds per file. See --coverage.thresholds.lines, --coverage.thresholds.functions, --coverage.thresholds.branches and --coverage.thresholds.statements for the actual thresholds (default: false) + --coverage.thresholds.perFile Check thresholds per file. See --coverage.thresholds.lines, --coverage.thresholds.functions, --coverage.thresholds.branches and --coverage.thresholds.statements for the actual thresholds (default: false). Object form is available in config files only. --coverage.thresholds.autoUpdate Update threshold values: "lines", "functions", "branches" and "statements" to configuration file when current coverage is above the configured thresholds (default: false) --coverage.thresholds.lines Threshold for lines. Visit https://github.com/istanbuljs/nyc#coverage-thresholds for more information. This option is not available for custom providers --coverage.thresholds.functions Threshold for functions. Visit https://github.com/istanbuljs/nyc#coverage-thresholds for more information. This option is not available for custom providers @@ -63,4 +65,5 @@ Options: --coverage.changed Collect coverage only for files changed since a specified commit or branch (e.g., origin/main or HEAD~1). Inherits value from --changed by default. --coverage.excludeAfterRemap Apply exclusions again after coverage has been remapped to original sources. (default: false) --coverage.htmlDir Directory of HTML coverage output to be served in UI mode and HTML reporter. + --coverage.autoAttachSubprocess Track coverage of the node:child_process and node:worker_threads spawned during test run. Supported only by v8 provider. (default: false) ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_migrate_pnpm11/snapshots/create_approve_builds_migrate_pnpm11.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_migrate_pnpm11/snapshots/create_approve_builds_migrate_pnpm11.md index 51d6f4d597..79610e972d 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_migrate_pnpm11/snapshots/create_approve_builds_migrate_pnpm11.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_migrate_pnpm11/snapshots/create_approve_builds_migrate_pnpm11.md @@ -73,6 +73,8 @@ peerDependencyRules: the guidance's `vp pm approve-builds` command approves the gated build ``` +✓ Lockfile passes supply-chain policies (verified ago) +Already up to date node_modules/.pnpm/core-js@3.39.0/node_modules/core-js: Running postinstall script, done in ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_pnpm11/snapshots/create_approve_builds_pnpm11.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_pnpm11/snapshots/create_approve_builds_pnpm11.md index 02d8568dde..3f4588cd04 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_pnpm11/snapshots/create_approve_builds_pnpm11.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/create_approve_builds_pnpm11/snapshots/create_approve_builds_pnpm11.md @@ -69,6 +69,8 @@ peerDependencyRules: the guidance's `vp pm approve-builds` command approves the gated build ``` +✓ Lockfile passes supply-chain policies (verified ago) +Already up to date node_modules/.pnpm/core-js@3.39.0/node_modules/core-js: Running postinstall script, done in ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/package.json b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/package.json index abe4023cd1..9e1c18d988 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/package.json +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/package.json @@ -1,6 +1,6 @@ { "name": "migration-agent-claude", "dependencies": { - "vitest": "^3.0.0" + "vitest": "^4.1.0" } } diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/snapshots/migration_agent_claude.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/snapshots/migration_agent_claude.md index d49e12e6ef..7c5658547c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/snapshots/migration_agent_claude.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_agent_claude/snapshots/migration_agent_claude.md @@ -7,6 +7,10 @@ migration with --agent claude should write CLAUDE.md ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_inline_array/snapshots/migration_bunfig_inline_array.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_inline_array/snapshots/migration_bunfig_inline_array.md index 2bf7d20796..acb7be696e 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_inline_array/snapshots/migration_bunfig_inline_array.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_inline_array/snapshots/migration_bunfig_inline_array.md @@ -7,6 +7,10 @@ migration preserves inline arrays in an existing bunfig.toml ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node bun • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_missing/snapshots/migration_bunfig_missing.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_missing/snapshots/migration_bunfig_missing.md index 0494111c9a..4175f7d200 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_missing/snapshots/migration_bunfig_missing.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_missing/snapshots/migration_bunfig_missing.md @@ -7,6 +7,10 @@ migration does not create bunfig.toml ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node bun • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_no_install_section/snapshots/migration_bunfig_no_install_section.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_no_install_section/snapshots/migration_bunfig_no_install_section.md index 0948892875..c307849e14 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_no_install_section/snapshots/migration_bunfig_no_install_section.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_bunfig_no_install_section/snapshots/migration_bunfig_no_install_section.md @@ -7,6 +7,10 @@ migration preserves bunfig.toml without an install section ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node bun • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_config/snapshots/migration_from_vitest_config.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_config/snapshots/migration_from_vitest_config.md index ca978ebabc..3c06ad5c93 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_config/snapshots/migration_from_vitest_config.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_config/snapshots/migration_from_vitest_config.md @@ -30,8 +30,10 @@ import { defineConfig } from 'vite-plus'; export default defineConfig({ plugins: [foo()], test: { + clearMocks: false, dir: join(import.meta.dirname, 'test'), browser: { + locators: { exact: false }, enabled: true, provider: playwright(), headless: true, @@ -86,7 +88,7 @@ catalog: vite: npm:@voidzero-dev/vite-plus-core@ vitest: vite-plus: - '@vitest/browser-webdriverio': + '@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0 '@vitest/browser-playwright': '@vitest/coverage-v8': allowBuilds: diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_files/snapshots/migration_from_vitest_files.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_files/snapshots/migration_from_vitest_files.md index 839948754a..b293b96c0d 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_files/snapshots/migration_from_vitest_files.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_from_vitest_files/snapshots/migration_from_vitest_files.md @@ -7,6 +7,10 @@ migration should rewrite imports to vite-plus ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_merge_vite_config_ts/snapshots/migration_merge_vite_config_ts.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_merge_vite_config_ts/snapshots/migration_merge_vite_config_ts.md index 93c54c83f6..706b01f853 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_merge_vite_config_ts/snapshots/migration_merge_vite_config_ts.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_merge_vite_config_ts/snapshots/migration_merge_vite_config_ts.md @@ -53,8 +53,10 @@ export default defineConfig({ }, plugins: lazyPlugins(() => [react()]), test: { + clearMocks: false, dir: join(import.meta.dirname, 'test'), browser: { + locators: { exact: false }, enabled: true, provider: playwright(), headless: true, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_bun/snapshots/migration_monorepo_bun.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_bun/snapshots/migration_monorepo_bun.md index 7a02ce2eb8..86a27c35d1 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_bun/snapshots/migration_monorepo_bun.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_bun/snapshots/migration_monorepo_bun.md @@ -7,11 +7,27 @@ migration should work with bun object-form workspaces ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 2 review items + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/utils/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + ✔ Merged .oxlintrc.json into vite.config.ts ◇ Migrated . to Vite+ • Node bun • 2 config updates applied, 1 file had imports rewritten • Inline Vite plugins wrapped with lazyPlugins for check/lint/fmt +! Warnings: + - Vitest v5: 2 review items + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/utils/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file vite.config.ts` @@ -43,6 +59,7 @@ export default defineConfig({ } ] }, + test: { clearMocks: false }, plugins: lazyPlugins(() => [react()]), }); ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_pnpm/snapshots/migration_monorepo_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_pnpm/snapshots/migration_monorepo_pnpm.md index ffbf239a39..b06c487ba4 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_pnpm/snapshots/migration_monorepo_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_pnpm/snapshots/migration_monorepo_pnpm.md @@ -7,6 +7,14 @@ migration should merge vite.config.ts and remove oxlintrc and oxfmtrc ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 2 review items + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/utils/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + ✔ Merged .oxlintrc.json into vite.config.ts ✔ Merged .oxfmtrc.json into vite.config.ts @@ -14,6 +22,14 @@ VITE+ - The Unified Toolchain for the Web • Node pnpm • 4 config updates applied, 1 file had imports rewritten • Inline Vite plugins wrapped with lazyPlugins for check/lint/fmt +! Warnings: + - Vitest v5: 2 review items + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/utils/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file vite.config.ts` @@ -51,6 +67,7 @@ export default defineConfig({ } ] }, + test: { clearMocks: false }, plugins: lazyPlugins(() => [react()]), }); ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots.toml index 6277bbdcf3..ef55410659 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_monorepo_root_vitest_adjacent" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "root with a vitest-adjacent dep but no direct vitest still gets a direct vitest pin", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "vitest pinned at the root even though vite-plus is injected first", continue-on-failure = true }, ] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots/migration_monorepo_root_vitest_adjacent.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots/migration_monorepo_root_vitest_adjacent.md index 568c949547..3d026b9f9f 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots/migration_monorepo_root_vitest_adjacent.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_root_vitest_adjacent/snapshots/migration_monorepo_root_vitest_adjacent.md @@ -1,5 +1,10 @@ # migration_monorepo_root_vitest_adjacent +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` root with a vitest-adjacent dep but no direct vitest still gets a direct vitest pin @@ -7,6 +12,10 @@ root with a vitest-adjacent dep but no direct vitest still gets a direct vitest ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots.toml index 3551495224..ad2c569fca 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_monorepo_skip_vite_peer_dependency" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "migration should preserve vite peer contracts in workspace packages", continue-on-failure = true }, { argv = ["vpt", "print-file", "packages/vite-plugin/src/index.ts"], comment = "vite-plugin has vite in peerDeps: vite imports stay public, vitest rewrites", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "check root package.json (no peerDependencies)", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots/migration_monorepo_skip_vite_peer_dependency.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots/migration_monorepo_skip_vite_peer_dependency.md index aa2b4ee2d9..2b8cee65bb 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots/migration_monorepo_skip_vite_peer_dependency.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_skip_vite_peer_dependency/snapshots/migration_monorepo_skip_vite_peer_dependency.md @@ -1,5 +1,10 @@ # migration_monorepo_skip_vite_peer_dependency +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` migration should preserve vite peer contracts in workspace packages @@ -7,9 +12,18 @@ migration should preserve vite peer contracts in workspace packages ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +packages/vite-plugin/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten +! Warnings: + - Vitest v5: 1 review item + +packages/vite-plugin/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file packages/vite-plugin/src/index.ts` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots.toml index b24d023fbc..024fe3aebb 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_monorepo_yarn4" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "migration should merge vite.config.ts and remove oxlintrc", continue-on-failure = true }, { argv = ["vpt", "print-file", "vite.config.ts"], comment = "check vite.config.ts", continue-on-failure = true }, { argv = ["vpt", "stat-file", ".oxlintrc.json", "--assert-not", "file"], comment = "check .oxlintrc.json is removed", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots/migration_monorepo_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots/migration_monorepo_yarn4.md index 2427b17e57..8a476e4520 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots/migration_monorepo_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_monorepo_yarn4/snapshots/migration_monorepo_yarn4.md @@ -1,5 +1,10 @@ # migration_monorepo_yarn4 +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` migration should merge vite.config.ts and remove oxlintrc @@ -7,6 +12,14 @@ migration should merge vite.config.ts and remove oxlintrc ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 2 review items + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/utils/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + ⚠ Vite+ does not currently support Yarn Plug'n'Play (PnP). ✔ Switched Yarn to node-modules mode @@ -17,6 +30,14 @@ VITE+ - The Unified Toolchain for the Web • 2 config updates applied, 1 file had imports rewritten • Inline Vite plugins wrapped with lazyPlugins for check/lint/fmt • Package manager settings configured +! Warnings: + - Vitest v5: 2 review items + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/utils/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file vite.config.ts` @@ -48,6 +69,7 @@ export default defineConfig({ } ] }, + test: { clearMocks: false }, plugins: lazyPlugins(() => [react()]), }); ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/package.json b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/package.json index 58151f5f0a..a810147949 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/package.json +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/package.json @@ -1,6 +1,6 @@ { "name": "migration-no-agent", "dependencies": { - "vitest": "^3.0.0" + "vitest": "^4.1.0" } } diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/snapshots/migration_no_agent.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/snapshots/migration_no_agent.md index c9b1704fc3..32ca1b5637 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/snapshots/migration_no_agent.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_no_agent/snapshots/migration_no_agent.md @@ -7,6 +7,10 @@ migration with --no-agent should skip agent instructions ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_not_supported_vitest3/snapshots/migration_not_supported_vitest3.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_not_supported_vitest3/snapshots/migration_not_supported_vitest3.md index 13e484183e..940ce39c89 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_not_supported_vitest3/snapshots/migration_not_supported_vitest3.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_not_supported_vitest3/snapshots/migration_not_supported_vitest3.md @@ -14,10 +14,12 @@ migration should fail because vitest version is not supported ``` VITE+ - The Unified Toolchain for the Web -✘ vitest@3.2.4 in package.json is not supported by auto migration +Vitest v5: 2 review items (1 block dependency updates) -Please upgrade vitest to version >=4.0.0 first -Vite+ cannot automatically migrate this project yet. +package.json + 1:1 BLOCK [source-version] Upgrade the original project to Vitest 4 before running this migration. + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_npmx_dev/snapshots/migration_npmx_dev.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_npmx_dev/snapshots/migration_npmx_dev.md index 47b7ab55d9..614ea32428 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_npmx_dev/snapshots/migration_npmx_dev.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_npmx_dev/snapshots/migration_npmx_dev.md @@ -7,6 +7,10 @@ npmx.dev shape: existing Vite+ upgrade, concrete @vitest/* should move into the ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: @@ -16,6 +20,11 @@ VITE+ - The Unified Toolchain for the Web @vitest/browser-playwright 4.1.10 → @vitest/coverage-v8 4.1.10 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/.nvmrc b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/.nvmrc index d7fd7cd552..c519bf5baa 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/.nvmrc +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/.nvmrc @@ -1 +1 @@ -v25.8.2 +v24.11.0 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/snapshots/migration_nvmrc.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/snapshots/migration_nvmrc.md index 52016a7ea3..a45814eb79 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/snapshots/migration_nvmrc.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc/snapshots/migration_nvmrc.md @@ -18,7 +18,7 @@ VITE+ - The Unified Toolchain for the Web check .node-version is created with v prefix stripped ``` -25.8.2 +24.11.0 ``` ## `vpt stat-file .nvmrc --assert-not file` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_lts/snapshots/migration_nvmrc_lts.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_lts/snapshots/migration_nvmrc_lts.md index 980c299d10..e2dd4c857a 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_lts/snapshots/migration_nvmrc_lts.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_lts/snapshots/migration_nvmrc_lts.md @@ -7,10 +7,19 @@ migration should detect .nvmrc with lts alias and auto-migrate ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +.nvmrc + 1:1 REVIEW [node-runtime] Resolve .nvmrc (lts/iron) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied • Node version manager file migrated to .node-version +! Warnings: + - Vitest v5: 1 review item + +.node-version + 1:1 REVIEW [node-runtime] Resolve .node-version (lts/iron) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. ``` ## `vpt print-file .node-version` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_node_alias/snapshots/migration_nvmrc_node_alias.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_node_alias/snapshots/migration_nvmrc_node_alias.md index 9fda9150d8..7792d6378c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_node_alias/snapshots/migration_nvmrc_node_alias.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_nvmrc_node_alias/snapshots/migration_nvmrc_node_alias.md @@ -7,11 +7,21 @@ ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +.nvmrc + 1:1 REVIEW [node-runtime] Resolve .nvmrc (node) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. + "node" in .nvmrc is not a specific version; automatically mapping to "lts/*" ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied • Node version manager file migrated to .node-version +! Warnings: + - Vitest v5: 1 review item + +.node-version + 1:1 REVIEW [node-runtime] Resolve .node-version (lts/*) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. ``` ## `vpt print-file .node-version` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots.toml index 697fa1ae73..d65afb29f7 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots.toml @@ -2,8 +2,10 @@ name = "migration_preserve_below_policy_node_pins" vp = "global" steps = [ - { argv = ["vp", "migrate", "--no-interactive"], comment = "existing Vite+ project: a Node pin below the supported range is preserved, not raised (native binding supports Node >=20)", continue-on-failure = true }, + { argv = ["vp", "migrate", "--no-interactive"], comment = "reject a Node pin below the new CLI engine before modifying the project; never raise it silently", continue-on-failure = true }, { argv = ["vpt", "print-file", ".node-version"], comment = "stays 24.3.0", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "engines.node stays 24.x and devEngines.runtime node stays ^24 (preserved, not raised)", continue-on-failure = true }, - { argv = ["vpt", "print-file", "pnpm-workspace.yaml"], comment = "vite-stack catalog updated to the migration target", continue-on-failure = true }, + { argv = ["vpt", "print-file", "pnpm-workspace.yaml"], comment = "catalog remains unchanged after failed preflight", continue-on-failure = true }, + { argv = ["vpt", "write-file", ".node-version", "24.11.0\n"], comment = "the user explicitly selects a supported runtime", snapshot = false }, + { argv = ["vp", "migrate", "--no-interactive"], comment = "migration can proceed without changing the public engine contract", continue-on-failure = true }, ] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots/migration_preserve_below_policy_node_pins.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots/migration_preserve_below_policy_node_pins.md index 12d3b03dcb..59f6075606 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots/migration_preserve_below_policy_node_pins.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_preserve_below_policy_node_pins/snapshots/migration_preserve_below_policy_node_pins.md @@ -2,17 +2,21 @@ ## `vp migrate --no-interactive` -existing Vite+ project: a Node pin below the supported range is preserved, not raised (native binding supports Node >=20) +reject a Node pin below the new CLI engine before modifying the project; never raise it silently + +**Exit code:** 1 ``` VITE+ - The Unified Toolchain for the Web -◇ Updated . to Vite+ -• Node pnpm -• Dependencies: - vite-plus 0.1.21 → - vite → -• Package manager settings configured +Vitest v5: 2 review items (1 block dependency updates) + +.node-version + 1:1 BLOCK [node-runtime] .node-version (24.3.0) cannot run Vite+ with Vitest v5. Select Node ^22.18.0 || ^24.11.0 || >=26.0.0; use vp env pin 22 --force for a runtime pin. Do not widen a library's engines.node contract automatically. + +package.json + 1:1 REVIEW [node-runtime] engines.node (24.x) includes unsupported test runtimes. Pin the test/CI runtime to Node ^22.18.0 || ^24.11.0 || >=26.0.0; keep the library's public engine contract separate. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. ``` ## `vpt print-file .node-version` @@ -55,7 +59,7 @@ engines.node stays 24.x and devEngines.runtime node stays ^24 (preserved, not ra ## `vpt print-file pnpm-workspace.yaml` -vite-stack catalog updated to the migration target +catalog remains unchanged after failed preflight ``` packages: @@ -64,12 +68,36 @@ packages: catalogs: vite-stack: vite: npm:@voidzero-dev/vite-plus-core@ + vitest: npm:@voidzero-dev/vite-plus-test@0.1.21 vite-plus: -overrides: - vite@*: catalog:vite-stack -peerDependencyRules: - allowAny: - - vite - allowedVersions: - vite: '*' +``` + +## `vpt write-file .node-version '24.11.0 +'` + +the user explicitly selects a supported runtime + + +## `vp migrate --no-interactive` + +migration can proceed without changing the public engine contract + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [node-runtime] engines.node (24.x) includes unsupported test runtimes. Pin the test/CI runtime to Node ^22.18.0 || ^24.11.0 || >=26.0.0; keep the library's public engine contract separate. +◇ Updated . to Vite+ +• Node pnpm +• Dependencies: + vite-plus 0.1.21 → + vite → +• Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [node-runtime] engines.node (24.x) includes unsupported test runtimes. Pin the test/CI runtime to Node ^22.18.0 || ^24.11.0 || >=26.0.0; keep the library's public engine contract separate. ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots.toml index 6925688aca..702fe11fcd 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_rewrite_declare_module" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "retained vitest augmentations should keep a package-local vitest", continue-on-failure = true }, { argv = ["vpt", "print-file", "src/index.ts"], comment = "declare module 'vite'/'vitest' outside config files are preserved: through the core alias a 'vite' augmentation reaches the UserConfig that types vite-plus defineConfig, while vite-plus exports no UserConfig symbol to merge a rewritten augmentation with", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "check package.json", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots/migration_rewrite_declare_module.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots/migration_rewrite_declare_module.md index f3c4113b66..db7fc0b9a2 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots/migration_rewrite_declare_module.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_declare_module/snapshots/migration_rewrite_declare_module.md @@ -1,5 +1,10 @@ # migration_rewrite_declare_module +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` retained vitest augmentations should keep a package-local vitest @@ -7,6 +12,10 @@ retained vitest augmentations should keep a package-local vitest ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/package.json b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/package.json index bacbc28e4e..5f6c39340a 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/package.json +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/package.json @@ -2,6 +2,6 @@ "name": "migration-rewrite-reference-types", "devDependencies": { "vite": "^6.0.0", - "vitest": "^3.0.0" + "vitest": "^4.1.0" } } diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/snapshots/migration_rewrite_reference_types.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/snapshots/migration_rewrite_reference_types.md index b38abf818e..7b1a8db528 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/snapshots/migration_rewrite_reference_types.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_rewrite_reference_types/snapshots/migration_rewrite_reference_types.md @@ -7,6 +7,10 @@ vitest/tsdown reference types are rewritten; vite references are preserved (issu ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots.toml index 57e698ea19..ff9c166fb5 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_skip_vite_dependency" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "migration should skip rewriting vite imports when vite is in dependencies", continue-on-failure = true }, { argv = ["vpt", "print-file", "src/index.ts"], comment = "vite imports should NOT be rewritten, vitest imports SHOULD be rewritten", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "check package.json", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots/migration_skip_vite_dependency.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots/migration_skip_vite_dependency.md index 9663a94770..97d90891a5 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots/migration_skip_vite_dependency.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_dependency/snapshots/migration_skip_vite_dependency.md @@ -1,5 +1,10 @@ # migration_skip_vite_dependency +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` migration should skip rewriting vite imports when vite is in dependencies @@ -7,6 +12,10 @@ migration should skip rewriting vite imports when vite is in dependencies ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots.toml index 45f4bd7dda..a8d3af4afc 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_skip_vite_peer_dependency" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "migration should preserve vite peer contracts", continue-on-failure = true }, { argv = ["vpt", "print-file", "src/index.ts"], comment = "vite imports stay public, vitest imports rewrite", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "vite peer range is preserved", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots/migration_skip_vite_peer_dependency.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots/migration_skip_vite_peer_dependency.md index 8ace240699..d51c0aabe5 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots/migration_skip_vite_peer_dependency.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_skip_vite_peer_dependency/snapshots/migration_skip_vite_peer_dependency.md @@ -1,5 +1,10 @@ # migration_skip_vite_peer_dependency +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` migration should preserve vite peer contracts @@ -7,6 +12,10 @@ migration should preserve vite peer contracts ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md index 05a6fe8589..017d2d446a 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md @@ -7,6 +7,11 @@ migration should work with npm, add overrides, and update lockfile ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + Formatting code... Code formatted diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_pnpm/snapshots/migration_standalone_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_pnpm/snapshots/migration_standalone_pnpm.md index 08aa2e4839..d4b4405aaf 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_pnpm/snapshots/migration_standalone_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_pnpm/snapshots/migration_standalone_pnpm.md @@ -7,6 +7,11 @@ migration should work with pnpm, write overrides and peerDependencyRules to pnpm ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + Formatting code... Code formatted diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn4_idempotent/snapshots/migration_standalone_yarn4_idempotent.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn4_idempotent/snapshots/migration_standalone_yarn4_idempotent.md index a721c83007..582a2f8b84 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn4_idempotent/snapshots/migration_standalone_yarn4_idempotent.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn4_idempotent/snapshots/migration_standalone_yarn4_idempotent.md @@ -7,6 +7,11 @@ implicit Yarn Berry PnP converts before the first pass ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + ⚠ Vite+ does not currently support Yarn Plug'n'Play (PnP). ✔ Switched Yarn to node-modules mode diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn_below_catalog/snapshots/migration_standalone_yarn_below_catalog.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn_below_catalog/snapshots/migration_standalone_yarn_below_catalog.md index f533720f40..1c8e88df7a 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn_below_catalog/snapshots/migration_standalone_yarn_below_catalog.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_yarn_below_catalog/snapshots/migration_standalone_yarn_below_catalog.md @@ -7,6 +7,11 @@ Yarn < 4.10.0 cannot resolve `catalog:`, so managed specs stay concrete ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + ⚠ Vite+ does not currently support Yarn Plug'n'Play (PnP). ✔ Switched Yarn to node-modules mode diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_peer_only_pnpm/snapshots/migration_upgrade_browser_peer_only_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_peer_only_pnpm/snapshots/migration_upgrade_browser_peer_only_pnpm.md index caddc39162..f7584dcd56 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_peer_only_pnpm/snapshots/migration_upgrade_browser_peer_only_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_peer_only_pnpm/snapshots/migration_upgrade_browser_peer_only_pnpm.md @@ -71,5 +71,13 @@ repaired project should no longer be pending ``` VITE+ - The Unified Toolchain for the Web -This project is already using Vite+! Happy coding! +◇ Updated . to Vite+ +• Node pnpm +• Dependencies: + vite → +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots.toml index 5fcc933381..a5b5034a56 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_upgrade_browser_source_only_pnpm" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "source-only browser provider should be restored", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "provider, framework peer, and local vitest should be present", continue-on-failure = true }, { argv = ["vpt", "print-file", "pnpm-workspace.yaml"], comment = "shared vitest catalog and override should be present", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots/migration_upgrade_browser_source_only_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots/migration_upgrade_browser_source_only_pnpm.md index 9f857f2cc1..cde2d633da 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots/migration_upgrade_browser_source_only_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_source_only_pnpm/snapshots/migration_upgrade_browser_source_only_pnpm.md @@ -1,5 +1,10 @@ # migration_upgrade_browser_source_only_pnpm +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` source-only browser provider should be restored diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots.toml index ae1ea23cc3..4300fcd93c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_upgrade_browser_webdriverio_pnpm" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "source-only WebdriverIO provider should be restored", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "provider, webdriverio, and local vitest should be present", continue-on-failure = true }, { argv = ["vpt", "print-file", "pnpm-workspace.yaml"], comment = "driver builds and shared vitest should be enabled", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots/migration_upgrade_browser_webdriverio_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots/migration_upgrade_browser_webdriverio_pnpm.md index fdf43408bc..5ffaab714e 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots/migration_upgrade_browser_webdriverio_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_browser_webdriverio_pnpm/snapshots/migration_upgrade_browser_webdriverio_pnpm.md @@ -1,5 +1,10 @@ # migration_upgrade_browser_webdriverio_pnpm +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` source-only WebdriverIO provider should be restored @@ -48,7 +53,7 @@ catalog: vite: npm:@voidzero-dev/vite-plus-core@ vite-plus: vitest: - '@vitest/browser-webdriverio': + '@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0 overrides: vite@*: 'catalog:' vitest@*: 'catalog:' diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_bun_catalog/snapshots/migration_upgrade_bun_catalog.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_bun_catalog/snapshots/migration_upgrade_bun_catalog.md index b694a66f21..786beda9ca 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_bun_catalog/snapshots/migration_upgrade_bun_catalog.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_bun_catalog/snapshots/migration_upgrade_bun_catalog.md @@ -7,12 +7,21 @@ existing bun Vite+ catalog WORKSPACE gains a direct vite edge for bun#8406 (bun ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node bun • Dependencies: vite-plus 0.1.20 → vite → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_deprecated_coverage_c8_npm/snapshots/migration_upgrade_deprecated_coverage_c8_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_deprecated_coverage_c8_npm/snapshots/migration_upgrade_deprecated_coverage_c8_npm.md index 1559bb6fe7..0d791d9cc9 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_deprecated_coverage_c8_npm/snapshots/migration_upgrade_deprecated_coverage_c8_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_deprecated_coverage_c8_npm/snapshots/migration_upgrade_deprecated_coverage_c8_npm.md @@ -7,6 +7,10 @@ deprecated coverage-c8 has an independent version line ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: @@ -14,6 +18,11 @@ VITE+ - The Unified Toolchain for the Web vite → vitest 4.1.8 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/.nvmrc b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/.nvmrc index 5bd6811705..0a492611a0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/.nvmrc +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/.nvmrc @@ -1 +1 @@ -20.19.0 +24.11.0 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/snapshots/migration_upgrade_hooks_flag_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/snapshots/migration_upgrade_hooks_flag_pnpm.md index 9686b0da9e..bd0ef42a13 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/snapshots/migration_upgrade_hooks_flag_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_hooks_flag_pnpm/snapshots/migration_upgrade_hooks_flag_pnpm.md @@ -10,6 +10,10 @@ existing Vite+ project: upgrade plus only the git hooks action ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_monorepo_vitest_localized_pnpm/snapshots/migration_upgrade_monorepo_vitest_localized_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_monorepo_vitest_localized_pnpm/snapshots/migration_upgrade_monorepo_vitest_localized_pnpm.md index c5969a996a..aa0ca72bed 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_monorepo_vitest_localized_pnpm/snapshots/migration_upgrade_monorepo_vitest_localized_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_monorepo_vitest_localized_pnpm/snapshots/migration_upgrade_monorepo_vitest_localized_pnpm.md @@ -7,12 +7,21 @@ existing Vite+ workspace packages should be reconciled ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: vite-plus latest → vite → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +packages/app/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_nuxt_test_utils_monorepo/snapshots/migration_upgrade_nuxt_test_utils_monorepo.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_nuxt_test_utils_monorepo/snapshots/migration_upgrade_nuxt_test_utils_monorepo.md index 465554a573..b35590d70e 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_nuxt_test_utils_monorepo/snapshots/migration_upgrade_nuxt_test_utils_monorepo.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_nuxt_test_utils_monorepo/snapshots/migration_upgrade_nuxt_test_utils_monorepo.md @@ -7,6 +7,13 @@ preserve upstream Vitest package-wide and localize it to the affected workspace ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 2 review items + +packages/nuxt/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/unit/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: @@ -15,6 +22,14 @@ VITE+ - The Unified Toolchain for the Web • 1 file had imports rewritten • Kept upstream `vitest` imports in 2 files for @nuxt/test-utils compatibility • Package manager settings configured +! Warnings: + - Vitest v5: 2 review items + +packages/nuxt/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/unit/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file packages/nuxt/package.json` @@ -112,5 +127,12 @@ workspace result is idempotent ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 2 review items + +packages/nuxt/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. + +packages/unit/package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. This project is already using Vite+! Happy coding! ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_peer_vitest_catalog_pnpm/snapshots/migration_upgrade_peer_vitest_catalog_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_peer_vitest_catalog_pnpm/snapshots/migration_upgrade_peer_vitest_catalog_pnpm.md index 9c3d0f07fa..46a6337a93 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_peer_vitest_catalog_pnpm/snapshots/migration_upgrade_peer_vitest_catalog_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_peer_vitest_catalog_pnpm/snapshots/migration_upgrade_peer_vitest_catalog_pnpm.md @@ -7,12 +7,21 @@ peer catalog must resolve before managed Vitest catalogs are pruned ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: vite-plus latest → vite → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` @@ -65,5 +74,9 @@ repaired project should no longer be pending ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. This project is already using Vite+! Happy coding! ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots.toml index 2cac60d5fb..bcbbc6553f 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots.toml @@ -1,7 +1,7 @@ [[case]] name = "migration_upgrade_pkg_pr_new_npm" vp = "global" -env = { VP_OVERRIDE_PACKAGES = "{\"vite\":\"npm:@voidzero-dev/vite-plus-core@0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617\",\"vitest\":\"4.1.10\"}", VP_VERSION = "0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617" } +env = { VP_OVERRIDE_PACKAGES = "{\"vite\":\"npm:@voidzero-dev/vite-plus-core@0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617\",\"vitest\":\"5.0.0\"}", VP_VERSION = "0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617" } steps = [ { argv = ["vp", "migrate", "--no-interactive"], comment = "bridge commit builds replace every stale managed spec", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "direct dependencies and npm overrides use the same immutable commit version", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots/migration_upgrade_pkg_pr_new_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots/migration_upgrade_pkg_pr_new_npm.md index 3af614f730..8c2a658107 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots/migration_upgrade_pkg_pr_new_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_npm/snapshots/migration_upgrade_pkg_pr_new_npm.md @@ -7,12 +7,21 @@ bridge commit builds replace every stale managed spec ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: vite-plus 0.1.20 → vite → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` @@ -40,6 +49,10 @@ bridge commit migration is idempotent ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. This project is already using Vite+! Happy coding! ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots.toml index 195da5bf86..9c44fb93df 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots.toml @@ -1,7 +1,7 @@ [[case]] name = "migration_upgrade_pkg_pr_new_pnpm" vp = "global" -env = { VP_OVERRIDE_PACKAGES = "{\"vite\":\"npm:@voidzero-dev/vite-plus-core@0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617\",\"vitest\":\"4.1.10\"}", VP_VERSION = "0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617" } +env = { VP_OVERRIDE_PACKAGES = "{\"vite\":\"npm:@voidzero-dev/vite-plus-core@0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617\",\"vitest\":\"5.0.0\"}", VP_VERSION = "0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617" } steps = [ { argv = ["vp", "migrate", "--no-interactive"], comment = "bridge commit builds upgrade like an ordinary npm version", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "direct dependencies use catalogs aligned to the bridge build", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots/migration_upgrade_pkg_pr_new_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots/migration_upgrade_pkg_pr_new_pnpm.md index 59094af3ff..ed7eace139 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots/migration_upgrade_pkg_pr_new_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pkg_pr_new_pnpm/snapshots/migration_upgrade_pkg_pr_new_pnpm.md @@ -7,6 +7,10 @@ bridge commit builds upgrade like an ordinary npm version ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: @@ -15,6 +19,11 @@ VITE+ - The Unified Toolchain for the Web vitest 0.1.20 → @vitest/coverage-v8 4.1.6 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` @@ -70,6 +79,10 @@ bridge commit migration is idempotent ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. This project is already using Vite+! Happy coding! ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots.toml index 2dd891519b..f936f856c5 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots.toml @@ -1,7 +1,7 @@ [[case]] name = "migration_upgrade_pnpm9_overrides" vp = "global" -env = { VP_OVERRIDE_PACKAGES = "{\"vite\":\"npm:@voidzero-dev/vite-plus-core@0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617\",\"vitest\":\"4.1.10\"}", VP_VERSION = "0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617" } +env = { VP_OVERRIDE_PACKAGES = "{\"vite\":\"npm:@voidzero-dev/vite-plus-core@0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617\",\"vitest\":\"5.0.0\"}", VP_VERSION = "0.0.0-commit.0c515e3fbf5c140db35280d700df0bd600838617" } steps = [ { argv = ["vp", "migrate", "--no-interactive"], comment = "pnpm 9.5-10.6.1: settings stay in package.json, catalog is still rewritten off the wrappers", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "pnpm.overrides stay catalog: (not inlined to a version)", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots/migration_upgrade_pnpm9_overrides.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots/migration_upgrade_pnpm9_overrides.md index 79bec01712..1fd1d3c898 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots/migration_upgrade_pnpm9_overrides.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_pnpm9_overrides/snapshots/migration_upgrade_pnpm9_overrides.md @@ -7,6 +7,10 @@ pnpm 9.5-10.6.1: settings stay in package.json, catalog is still rewritten off t ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: @@ -15,6 +19,11 @@ VITE+ - The Unified Toolchain for the Web vitest 0.1.20 → @vitest/coverage-v8 4.1.6 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_required_vitest_peer_metadata_npm/snapshots/migration_upgrade_required_vitest_peer_metadata_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_required_vitest_peer_metadata_npm/snapshots/migration_upgrade_required_vitest_peer_metadata_npm.md index 0df8aa080f..c37ca047b0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_required_vitest_peer_metadata_npm/snapshots/migration_upgrade_required_vitest_peer_metadata_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_required_vitest_peer_metadata_npm/snapshots/migration_upgrade_required_vitest_peer_metadata_npm.md @@ -7,6 +7,10 @@ clean checkout conservatively preserves existing Vitest ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: @@ -14,6 +18,11 @@ VITE+ - The Unified Toolchain for the Web vite → vitest 4.1.8 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` @@ -57,5 +66,9 @@ metadata confirms the unnamed required Vitest peer ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. This project is already using Vite+! Happy coding! ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/.nvmrc b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/.nvmrc index 5bd6811705..0a492611a0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/.nvmrc +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/.nvmrc @@ -1 +1 @@ -20.19.0 +24.11.0 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/snapshots/migration_upgrade_setup_full_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/snapshots/migration_upgrade_setup_full_pnpm.md index 1ff640f201..649f56e446 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/snapshots/migration_upgrade_setup_full_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_full_pnpm/snapshots/migration_upgrade_setup_full_pnpm.md @@ -14,6 +14,10 @@ existing Vite+ project: upgrade plus the full setup ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: @@ -53,7 +57,7 @@ vite-plus version upgrade is applied .nvmrc is migrated to .node-version by the full setup ``` -20.19.0 +24.11.0 ``` ## `vpt stat-file .nvmrc --assert-not file` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/.nvmrc b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/.nvmrc index 5bd6811705..0a492611a0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/.nvmrc +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/.nvmrc @@ -1 +1 @@ -20.19.0 +24.11.0 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/snapshots/migration_upgrade_setup_skipped_default_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/snapshots/migration_upgrade_setup_skipped_default_pnpm.md index dced98c173..89362e455e 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/snapshots/migration_upgrade_setup_skipped_default_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_setup_skipped_default_pnpm/snapshots/migration_upgrade_setup_skipped_default_pnpm.md @@ -7,6 +7,10 @@ existing Vite+ project: upgrade the toolchain version only, skip the full setup ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: @@ -14,6 +18,11 @@ VITE+ - The Unified Toolchain for the Web vite → • Package manager settings configured • Skipped editor, hooks, and lint setup. Run `vp migrate --full` to apply them. +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_stale_local_pnpm/snapshots/migration_upgrade_stale_local_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_stale_local_pnpm/snapshots/migration_upgrade_stale_local_pnpm.md index e02b10c9fb..595b32294f 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_stale_local_pnpm/snapshots/migration_upgrade_stale_local_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_stale_local_pnpm/snapshots/migration_upgrade_stale_local_pnpm.md @@ -10,12 +10,21 @@ newer global CLI must bypass the installed stale local CLI ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: vite-plus 0.1.24 → vite → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/pnpm-workspace.yaml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/pnpm-workspace.yaml index 9e76cdd806..ce4cfd2128 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/pnpm-workspace.yaml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/pnpm-workspace.yaml @@ -4,5 +4,5 @@ packages: catalog: vite-plus: 0.1.21 vite: npm:@voidzero-dev/vite-plus-core@0.1.21 - vitest: 3.2.4 - '@vitest/coverage-v8': 3.2.4 + vitest: 4.1.8 + '@vitest/coverage-v8': 4.1.8 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/snapshots/migration_upgrade_version_table_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/snapshots/migration_upgrade_version_table_pnpm.md index 6f4a2ff727..d829b8b8cc 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/snapshots/migration_upgrade_version_table_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_version_table_pnpm/snapshots/migration_upgrade_version_table_pnpm.md @@ -12,12 +12,21 @@ existing-Vite+ upgrade shows the toolchain version-change table with the raw vit ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node pnpm • Dependencies: vite-plus 0.1.21 → vite 8.0.0 → - vitest 3.2.4 → - @vitest/coverage-v8 3.2.4 → + vitest 4.1.8 → + @vitest/coverage-v8 4.1.8 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vite_plus_protocol_pin_npm/snapshots/migration_upgrade_vite_plus_protocol_pin_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vite_plus_protocol_pin_npm/snapshots/migration_upgrade_vite_plus_protocol_pin_npm.md index 5837313658..4d480b3630 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vite_plus_protocol_pin_npm/snapshots/migration_upgrade_vite_plus_protocol_pin_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vite_plus_protocol_pin_npm/snapshots/migration_upgrade_vite_plus_protocol_pin_npm.md @@ -7,11 +7,20 @@ deliberate vite-plus protocol pin must survive bootstrap ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: vite → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_exact_peer_npm/snapshots/migration_upgrade_vitest_exact_peer_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_exact_peer_npm/snapshots/migration_upgrade_vitest_exact_peer_npm.md index e70c98d085..64b032b8cd 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_exact_peer_npm/snapshots/migration_upgrade_vitest_exact_peer_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_exact_peer_npm/snapshots/migration_upgrade_vitest_exact_peer_npm.md @@ -7,6 +7,10 @@ exact @vitest peers require a package-local vitest ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: @@ -18,6 +22,11 @@ VITE+ - The Unified Toolchain for the Web @vitest/utils 4.1.8 → @vitest/web-worker 4.1.8 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_non_runtime_only_npm/snapshots/migration_upgrade_vitest_non_runtime_only_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_non_runtime_only_npm/snapshots/migration_upgrade_vitest_non_runtime_only_npm.md index 77366f0439..f4ef069a69 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_non_runtime_only_npm/snapshots/migration_upgrade_vitest_non_runtime_only_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_non_runtime_only_npm/snapshots/migration_upgrade_vitest_non_runtime_only_npm.md @@ -7,14 +7,24 @@ non-runtime @vitest packages must not keep a vitest pin ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 2 review items + +package.json + 1:1 REVIEW [legacy-dependency] Review the direct @vitest/ws-client dependency after migrating its imports; it is no longer part of the bundled Vitest graph. + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: - vite-plus latest → - vite → - @vitest/utils 4.1.8 → - @vitest/ws-client 4.1.8 → + vite-plus latest → + vite → + @vitest/utils 4.1.8 → • Package manager settings configured +! Warnings: + - Vitest v5: 2 review items + +package.json + 1:1 REVIEW [legacy-dependency] Review the direct @vitest/ws-client dependency after migrating its imports; it is no longer part of the bundled Vitest graph. + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` @@ -27,7 +37,7 @@ internal packages align, eslint plugin stays independent, vitest is removed "devDependencies": { "@vitest/eslint-plugin": "^1.6.0", "@vitest/utils": "", - "@vitest/ws-client": "", + "@vitest/ws-client": "^4.1.8", "vite-plus": "" }, "overrides": { diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_reference_whitespace_pnpm/snapshots/migration_upgrade_vitest_reference_whitespace_pnpm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_reference_whitespace_pnpm/snapshots/migration_upgrade_vitest_reference_whitespace_pnpm.md index 3ace8f239c..f90da7940c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_reference_whitespace_pnpm/snapshots/migration_upgrade_vitest_reference_whitespace_pnpm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_reference_whitespace_pnpm/snapshots/migration_upgrade_vitest_reference_whitespace_pnpm.md @@ -7,6 +7,10 @@ TypeScript whitespace in a Vitest type directive is valid ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_retained_references_npm/snapshots/migration_upgrade_vitest_retained_references_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_retained_references_npm/snapshots/migration_upgrade_vitest_retained_references_npm.md index ed98a9fea3..965fecdf78 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_retained_references_npm/snapshots/migration_upgrade_vitest_retained_references_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_upgrade_vitest_retained_references_npm/snapshots/migration_upgrade_vitest_retained_references_npm.md @@ -7,6 +7,10 @@ retained upstream references require package-local Vitest ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Updated . to Vite+ • Node npm • Dependencies: @@ -14,6 +18,11 @@ VITE+ - The Unified Toolchain for the Web vite → vitest 4.1.8 → • Package manager settings configured +! Warnings: + - Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ``` ## `vpt print-file package.json` @@ -90,5 +99,9 @@ retained references remain stable on rerun ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. This project is already using Vite+! Happy coding! ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_import_only/snapshots/migration_vitest_import_only.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_import_only/snapshots/migration_vitest_import_only.md index c31bf9f0dc..54f0c0c0c9 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_import_only/snapshots/migration_vitest_import_only.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_import_only/snapshots/migration_vitest_import_only.md @@ -7,6 +7,10 @@ ordinary vitest imports should migrate without retaining direct vitest ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied, 1 file had imports rewritten diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots.toml index 4b4ca5ffeb..16de4053ab 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots.toml @@ -2,6 +2,7 @@ name = "migration_vitest_peer_dep" vp = "global" steps = [ + { argv = ["vpt", "write-file", "node_modules/vitest/package.json", "{\"name\":\"vitest\",\"version\":\"4.1.11\"}"], comment = "record the original runner version without adding a direct dependency", snapshot = false }, { argv = ["vp", "migrate", "--no-interactive"], comment = "vitest should be added to devDeps when vitest-browser-svelte is present", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "vitest should be in devDependencies", continue-on-failure = true }, { argv = ["vpt", "print-file", "pnpm-workspace.yaml"], continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots/migration_vitest_peer_dep.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots/migration_vitest_peer_dep.md index 17f735d8f0..dedf529414 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots/migration_vitest_peer_dep.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_peer_dep/snapshots/migration_vitest_peer_dep.md @@ -1,5 +1,10 @@ # migration_vitest_peer_dep +## `vpt write-file node_modules/vitest/package.json '{"name":"vitest","version":"4.1.11"}'` + +record the original runner version without adding a direct dependency + + ## `vp migrate --no-interactive` vitest should be added to devDeps when vitest-browser-svelte is present @@ -7,6 +12,10 @@ vitest should be added to devDeps when vitest-browser-svelte is present ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default and uses exact browser locators. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_unmanaged_override/snapshots/migration_vitest_unmanaged_override.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_unmanaged_override/snapshots/migration_vitest_unmanaged_override.md index 8278e5fb88..ee88facaf2 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_unmanaged_override/snapshots/migration_vitest_unmanaged_override.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_unmanaged_override/snapshots/migration_vitest_unmanaged_override.md @@ -7,6 +7,10 @@ vitest omitted from managed overrides must remain user-owned ``` VITE+ - The Unified Toolchain for the Web +Vitest v5: 1 review item + +package.json + 1:1 REVIEW [configless-defaults] No test config exists. Vitest v5 clears mocks by default. A separate confirmed action can create compatibility config, but a new config can change config discovery and project structure. ◇ Migrated . to Vite+ • Node pnpm • 2 config updates applied diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/example.test.ts b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/example.test.ts new file mode 100644 index 0000000000..853beb85e1 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/example.test.ts @@ -0,0 +1,6 @@ +import { expect, test } from 'vitest'; + +test.sequential('compatibility', () => { + expect(Promise.resolve(42)).resolves.toBe(42); + expect(() => { throw new Error(''); }).toThrow(''); +}); diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/package.json b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/package.json new file mode 100644 index 0000000000..59c0e1da8b --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/package.json @@ -0,0 +1,13 @@ +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vitest list" + }, + "devDependencies": { + "vite": "^8.0.0", + "vitest": "4.1.11" + } +} diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots.toml new file mode 100644 index 0000000000..194387c3cc --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots.toml @@ -0,0 +1,94 @@ +[[case]] +name = "compatibility" +vp = "global" +steps = [ + ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], + ["vpt", "print-file", "vite.config.ts"], + ["vpt", "print-file", "example.test.ts"], + ["vpt", "print-file", "package.json"], + ["vpt", "print-file", ".vite-plus/migrations.json"], + ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], +] + +[[case]] +name = "node_preflight" +vp = "global" +steps = [ + { argv = ["vpt", "write-file", ".node-version", "20.19.0\n"], snapshot = false }, + { argv = ["vp", "migrate", "--no-interactive"], continue-on-failure = true }, + ["vpt", "print-file", "package.json"], + ["vpt", "print-file", "example.test.ts"], +] + +[[case]] +name = "node_container_scope" +vp = "global" +comment = "Check the runtime image and feature option, not source properties or Dev Container feature tags." +steps = [ + { argv = ["vpt", "write-file", "worker.js", "export const options = { node:2 };\n"], snapshot = false }, + { argv = ["vpt", "write-file", ".devcontainer/devcontainer.json", "{\"features\":{\"ghcr.io/devcontainers/features/node:1\":{\"version\":\"lts\"}}}\n"], snapshot = false }, + { argv = ["vpt", "write-file", "Dockerfile", "# FROM node:20\nFROM node:20-alpine AS build\nRUN echo node:2\n"], snapshot = false }, + { argv = ["vp", "migrate", "--no-interactive"], continue-on-failure = true }, + ["vpt", "print-file", "package.json"], + { argv = ["vpt", "write-file", "Dockerfile", "# FROM node:20\nFROM node:24.11.0-alpine AS build\nRUN echo node:2\n"], snapshot = false }, + ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], + ["vpt", "print-file", "worker.js"], + ["vpt", "print-file", ".devcontainer/devcontainer.json"], +] + +[[case]] +name = "mixed_project_assertions" +vp = "global" +comment = "Keep Node DOM matchers, migrate browser matchers, and retain review findings for shared transform inputs across repeated migrations." +steps = [ + { argv = ["vpt", "write-file", "vite.config.ts", "export default { test: { projects: [{ test: { name: 'node', include: ['node.test.ts', 'shared.test.ts'] } }, { test: { name: 'browser', browser: { enabled: true }, include: ['browser.test.ts', 'shared.test.ts'] } }] } };\n"], snapshot = false }, + { argv = ["vpt", "write-file", "node.test.ts", "import { expect } from 'vitest';\nexpect(element).toHaveTextContent('partial');\n"], snapshot = false }, + { argv = ["vpt", "write-file", "browser.test.ts", "import { expect } from 'vitest';\nawait expect.element(element)['toHaveTextContent']('partial');\n"], snapshot = false }, + { argv = ["vpt", "write-file", "shared.test.ts", "import { expect } from 'vitest';\nexpect(element).toHaveTextContent('partial');\n"], snapshot = false }, + ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], + ["vpt", "print-file", "node.test.ts"], + ["vpt", "print-file", "browser.test.ts"], + ["vpt", "print-file", "shared.test.ts"], + ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], +] + +[[case]] +name = "plugin_projects_and_dom_types" +vp = "global" +comment = "Do not scan plugin project paths as Vitest configs; report the Jest-only DOM type entry without changing a mixed test contract." +steps = [ + { argv = ["vpt", "write-file", "vite.config.ts", "import { defineConfig } from 'vitest/config';\nconst config = defineConfig({ plugins: [{ name: 'paths', projects: ['./tsconfig.json', './plugin-options.ts'] }], test: {} });\nexport default config;\n"], snapshot = false }, + { argv = ["vpt", "write-file", "tsconfig.json", "{\"compilerOptions\":{\"types\":[\"@testing-library/jest-dom\",\"vitest/globals\"]}}\n"], snapshot = false }, + { argv = ["vpt", "write-file", "plugin-options.ts", "export default { test: {} };\n"], snapshot = false }, + ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], + ["vpt", "print-file", "plugin-options.ts"], + ["vpt", "print-file", "tsconfig.json"], +] + +[[case]] +name = "removed_api_preflight" +vp = "global" +steps = [ + { argv = ["vpt", "write-file", "custom-runner.ts", "import { startTests } from '@vitest/runner';\nstartTests([]);\n"], snapshot = false }, + { argv = ["vp", "migrate", "--no-interactive"], continue-on-failure = true }, + ["vpt", "print-file", "package.json"], +] + +[[case]] +name = "api_conflict_preflight" +vp = "global" +steps = [ + { argv = ["vpt", "write-file", "vite.config.ts", "export default { test: { api: { port: 1 }, browser: { api: { port: 2 } } } };\n"], snapshot = false }, + { argv = ["vp", "migrate", "--no-interactive"], continue-on-failure = true }, + ["vpt", "print-file", "package.json"], +] + +[[case]] +name = "benchmark_preflight" +vp = "global" +steps = [ + { argv = ["vpt", "write-file", "example.bench.ts", "import { bench } from 'vitest';\nbench('old benchmark', () => 20 + 22);\n"], snapshot = false }, + { argv = ["vp", "migrate", "--no-interactive"], continue-on-failure = true }, + ["vpt", "print-file", "package.json"], + ["vpt", "print-file", "example.bench.ts"], +] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/api_conflict_preflight.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/api_conflict_preflight.md new file mode 100644 index 0000000000..72023e2592 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/api_conflict_preflight.md @@ -0,0 +1,37 @@ +# api_conflict_preflight + +## `vpt write-file vite.config.ts 'export default { test: { api: { port: 1 }, browser: { api: { port: 2 } } } }; +'` + + +## `vp migrate --no-interactive` + +**Exit code:** 1 + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item (1 block dependency updates) + +vite.config.ts + 1:55 BLOCK [api-conflict] Resolve conflicting test.api and test.browser.api values before upgrading. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. +``` + +## `vpt print-file package.json` + +``` +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vitest list" + }, + "devDependencies": { + "vite": "^8.0.0", + "vitest": "" + } +} +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/benchmark_preflight.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/benchmark_preflight.md new file mode 100644 index 0000000000..dbfbc7c8e5 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/benchmark_preflight.md @@ -0,0 +1,45 @@ +# benchmark_preflight + +## `vpt write-file example.bench.ts 'import { bench } from '\''vitest'\''; +bench('\''old benchmark'\'', () => 20 + 22); +'` + + +## `vp migrate --no-interactive` + +**Exit code:** 1 + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item (1 block dependency updates) + +example.bench.ts + 1:10 BLOCK [benchmark-api] Replace the removed top-level bench import with the bench test-context fixture. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. +``` + +## `vpt print-file package.json` + +``` +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vitest list" + }, + "devDependencies": { + "vite": "^8.0.0", + "vitest": "" + } +} +``` + +## `vpt print-file example.bench.ts` + +``` +import { bench } from 'vitest'; +bench('old benchmark', () => 20 + 22); +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/compatibility.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/compatibility.md new file mode 100644 index 0000000000..1d3b3bbc25 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/compatibility.md @@ -0,0 +1,79 @@ +# compatibility + +## `vp migrate --no-interactive --no-hooks --no-agent --no-editor` + +``` +VITE+ - The Unified Toolchain for the Web + +◇ Migrated . to Vite+ +• Node pnpm +• 2 files had imports rewritten +``` + +## `vpt print-file vite.config.ts` + +``` +import { defineConfig } from 'vite-plus'; + +export default defineConfig({ + fmt: {}, + lint: {"jsPlugins":[{"name":"vite-plus","specifier":"vite-plus/oxlint-plugin"}],"rules":{"vite-plus/prefer-vite-plus-imports":"error"},"options":{"typeAware":true,"typeCheck":true}}, + test: { + clearMocks: false, + sharedViteServer: false, + reporters: [['json', { stdout: true }], ['junit', { stdout: true }]], + projects: [{ extends: false, test: { clearMocks: false, name: 'unit' } }, { extends: true, test: { name: 'inherited' } }], + }, +}); +``` + +## `vpt print-file example.test.ts` + +``` +import { expect, test } from 'vite-plus/test'; + +test('compatibility', { concurrent: false }, async () => { + await expect(Promise.resolve(42)).resolves.toBe(42); + expect(() => { throw new Error(''); }).toThrow(/^$/); +}); +``` + +## `vpt print-file package.json` + +``` +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vp test list --no-static-parse" + }, + "devDependencies": { + "vite": "catalog:", + "vite-plus": "catalog:" + } +} +``` + +## `vpt print-file .vite-plus/migrations.json` + +``` +{ + "version": 1, + "vitest5": { + ".": { + "sourceVersion": "4.1.11", + "configless": false + } + } +} +``` + +## `vp migrate --no-interactive --no-hooks --no-agent --no-editor` + +``` +VITE+ - The Unified Toolchain for the Web + +This project is already using Vite+! Happy coding! +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/mixed_project_assertions.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/mixed_project_assertions.md new file mode 100644 index 0000000000..5a4f5a51a9 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/mixed_project_assertions.md @@ -0,0 +1,74 @@ +# mixed_project_assertions + +Keep Node DOM matchers, migrate browser matchers, and retain review findings for shared transform inputs across repeated migrations. + +## `vpt write-file vite.config.ts 'export default { test: { projects: [{ test: { name: '\''node'\'', include: ['\''node.test.ts'\'', '\''shared.test.ts'\''] } }, { test: { name: '\''browser'\'', browser: { enabled: true }, include: ['\''browser.test.ts'\'', '\''shared.test.ts'\''] } }] } }; +'` + + +## `vpt write-file node.test.ts 'import { expect } from '\''vitest'\''; +expect(element).toHaveTextContent('\''partial'\''); +'` + + +## `vpt write-file browser.test.ts 'import { expect } from '\''vitest'\''; +await expect.element(element)['\''toHaveTextContent'\'']('\''partial'\''); +'` + + +## `vpt write-file shared.test.ts 'import { expect } from '\''vitest'\''; +expect(element).toHaveTextContent('\''partial'\''); +'` + + +## `vp migrate --no-interactive --no-hooks --no-agent --no-editor` + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item + +shared.test.ts + 2:1 REVIEW [text-content-project] Resolve this assertion's test project: browser assertions need toMatchTextContent for v4 partial matching; keep Node jest-dom assertions unchanged. +◇ Migrated . to Vite+ +• Node pnpm +• 4 files had imports rewritten +! Warnings: + - Vitest v5: 1 review item + +shared.test.ts + 2:1 REVIEW [text-content-project] Resolve this assertion's test project: browser assertions need toMatchTextContent for v4 partial matching; keep Node jest-dom assertions unchanged. +``` + +## `vpt print-file node.test.ts` + +``` +import { expect } from 'vite-plus/test'; +expect(element).toHaveTextContent('partial'); +``` + +## `vpt print-file browser.test.ts` + +``` +import { expect } from 'vite-plus/test'; +await expect.element(element)["toMatchTextContent"]('partial'); +``` + +## `vpt print-file shared.test.ts` + +``` +import { expect } from 'vite-plus/test'; +expect(element).toHaveTextContent('partial'); +``` + +## `vp migrate --no-interactive --no-hooks --no-agent --no-editor` + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item + +shared.test.ts + 2:1 REVIEW [text-content-project] Resolve this assertion's test project: browser assertions need toMatchTextContent for v4 partial matching; keep Node jest-dom assertions unchanged. +This project is already using Vite+! Happy coding! +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_container_scope.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_container_scope.md new file mode 100644 index 0000000000..9866ad5bc7 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_container_scope.md @@ -0,0 +1,89 @@ +# node_container_scope + +Check the runtime image and feature option, not source properties or Dev Container feature tags. + +## `vpt write-file worker.js 'export const options = { node:2 }; +'` + + +## `vpt write-file .devcontainer/devcontainer.json '{"features":{"ghcr.io/devcontainers/features/node:1":{"version":"lts"}}} +'` + + +## `vpt write-file Dockerfile '# FROM node:20 +FROM node:20-alpine AS build +RUN echo node:2 +'` + + +## `vp migrate --no-interactive` + +**Exit code:** 1 + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 2 review items (1 block dependency updates) + +.devcontainer/devcontainer.json + 1:1 REVIEW [node-runtime] Resolve Dev Container Node feature (lts) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. + +Dockerfile + 2:1 BLOCK [node-runtime] Node container image (20) cannot run Vite+ with Vitest v5. Select Node ^22.18.0 || ^24.11.0 || >=26.0.0; use vp env pin 22 --force for a runtime pin. Do not widen a library's engines.node contract automatically. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. +``` + +## `vpt print-file package.json` + +``` +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vitest list" + }, + "devDependencies": { + "vite": "^8.0.0", + "vitest": "" + } +} +``` + +## `vpt write-file Dockerfile '# FROM node:20 +FROM node:24.11.0-alpine AS build +RUN echo node:2 +'` + + +## `vp migrate --no-interactive --no-hooks --no-agent --no-editor` + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item + +.devcontainer/devcontainer.json + 1:1 REVIEW [node-runtime] Resolve Dev Container Node feature (lts) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. +◇ Migrated . to Vite+ +• Node pnpm +• 2 files had imports rewritten +! Warnings: + - Vitest v5: 1 review item + +.devcontainer/devcontainer.json + 1:1 REVIEW [node-runtime] Resolve Dev Container Node feature (lts) and select Node ^22.18.0 || ^24.11.0 || >=26.0.0. +``` + +## `vpt print-file worker.js` + +``` +export const options = { node:2 }; +``` + +## `vpt print-file .devcontainer/devcontainer.json` + +``` +{"features":{"ghcr.io/devcontainers/features/node:1":{"version":"lts"}}} +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_preflight.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_preflight.md new file mode 100644 index 0000000000..19c25fdf2f --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/node_preflight.md @@ -0,0 +1,48 @@ +# node_preflight + +## `vpt write-file .node-version '20.19.0 +'` + + +## `vp migrate --no-interactive` + +**Exit code:** 1 + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item (1 block dependency updates) + +.node-version + 1:1 BLOCK [node-runtime] .node-version (20.19.0) cannot run Vite+ with Vitest v5. Select Node ^22.18.0 || ^24.11.0 || >=26.0.0; use vp env pin 22 --force for a runtime pin. Do not widen a library's engines.node contract automatically. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. +``` + +## `vpt print-file package.json` + +``` +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vitest list" + }, + "devDependencies": { + "vite": "^8.0.0", + "vitest": "" + } +} +``` + +## `vpt print-file example.test.ts` + +``` +import { expect, test } from 'vitest'; + +test.sequential('compatibility', () => { + expect(Promise.resolve(42)).resolves.toBe(42); + expect(() => { throw new Error(''); }).toThrow(''); +}); +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/plugin_projects_and_dom_types.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/plugin_projects_and_dom_types.md new file mode 100644 index 0000000000..22675f10dc --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/plugin_projects_and_dom_types.md @@ -0,0 +1,55 @@ +# plugin_projects_and_dom_types + +Do not scan plugin project paths as Vitest configs; report the Jest-only DOM type entry without changing a mixed test contract. + +## `vpt write-file vite.config.ts 'import { defineConfig } from '\''vitest/config'\''; +const config = defineConfig({ plugins: [{ name: '\''paths'\'', projects: ['\''./tsconfig.json'\'', '\''./plugin-options.ts'\''] }], test: {} }); +export default config; +'` + + +## `vpt write-file tsconfig.json '{"compilerOptions":{"types":["@testing-library/jest-dom","vitest/globals"]}} +'` + + +## `vpt write-file plugin-options.ts 'export default { test: {} }; +'` + + +## `vp migrate --no-interactive --no-hooks --no-agent --no-editor` + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 2 review items + +tsconfig.json + 1:1 REVIEW [jest-dom-types] If this config checks Vitest tests, load @testing-library/jest-dom/vitest in compilerOptions.types or an included TypeScript setup file. The root jest-dom type entry augments Jest, not Vitest v5. + +vite.config.ts + 3:1 REVIEW [dynamic-config] Review the effective exported test config and its v4 defaults. +◇ Migrated . to Vite+ +• Node pnpm +• 1 config update applied, 2 files had imports rewritten +• Inline Vite plugins wrapped with lazyPlugins for check/lint/fmt +! Warnings: + - Vitest v5: 2 review items + +tsconfig.json + 1:1 REVIEW [jest-dom-types] If this config checks Vitest tests, load @testing-library/jest-dom/vitest in compilerOptions.types or an included TypeScript setup file. The root jest-dom type entry augments Jest, not Vitest v5. + +vite.config.ts + 7:1 REVIEW [dynamic-config] Review the effective exported test config and its v4 defaults. +``` + +## `vpt print-file plugin-options.ts` + +``` +export default { test: {} }; +``` + +## `vpt print-file tsconfig.json` + +``` +{"compilerOptions":{"types":["@testing-library/jest-dom","vitest/globals"]}} +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/removed_api_preflight.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/removed_api_preflight.md new file mode 100644 index 0000000000..2b277372fd --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/snapshots/removed_api_preflight.md @@ -0,0 +1,38 @@ +# removed_api_preflight + +## `vpt write-file custom-runner.ts 'import { startTests } from '\''@vitest/runner'\''; +startTests([]); +'` + + +## `vp migrate --no-interactive` + +**Exit code:** 1 + +``` +VITE+ - The Unified Toolchain for the Web + +Vitest v5: 1 review item (1 block dependency updates) + +custom-runner.ts + 1:10 BLOCK [removed-api] Migrate startTests from @vitest/runner manually; no reviewed root v5 replacement exists. +Resolve the blocking Vitest v5 findings, then re-run `vp migrate`. No project files were changed. +``` + +## `vpt print-file package.json` + +``` +{ + "name": "migration-vitest-v5", + "private": true, + "type": "module", + "packageManager": "pnpm@11.24.0", + "scripts": { + "test": "vitest list" + }, + "devDependencies": { + "vite": "^8.0.0", + "vitest": "" + } +} +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/vite.config.ts b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/vite.config.ts new file mode 100644 index 0000000000..0c35ccb6e7 --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_vitest_v5/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + reporters: ['json', ['junit', {}]], + projects: [{ test: { name: 'unit' } }, { extends: true, test: { name: 'inherited' } }], + }, +}); diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/package.json b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/package.json index 2b9893f340..05a285f697 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/package.json +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/package.json @@ -4,7 +4,7 @@ "vite": "^7.0.0" }, "volta": { - "node": "20.19.0", + "node": "24.11.0", "npm": "10.2.5" } } diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/snapshots/migration_volta.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/snapshots/migration_volta.md index 2b17219a50..85227f734c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/snapshots/migration_volta.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta/snapshots/migration_volta.md @@ -20,7 +20,7 @@ VITE+ - The Unified Toolchain for the Web check .node-version is created from volta.node ``` -20.19.0 +24.11.0 ``` ## `vpt print-file package.json` @@ -35,7 +35,7 @@ volta field is preserved in package.json (not removed) "vite-plus": "catalog:" }, "volta": { - "node": "20.19.0", + "node": "24.11.0", "npm": "10.2.5" }, "devEngines": { diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/.nvmrc b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/.nvmrc index 5f53e875de..c519bf5baa 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/.nvmrc +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/.nvmrc @@ -1 +1 @@ -v20.19.0 +v24.11.0 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots.toml index e2a1e969b6..4c41cf96b4 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots.toml @@ -3,7 +3,7 @@ name = "migration_volta_with_nvmrc" vp = "global" steps = [ { argv = ["vp", "migrate", "--no-interactive"], comment = ".nvmrc should take priority over volta.node", continue-on-failure = true }, - { argv = ["vpt", "print-file", ".node-version"], comment = "check .node-version comes from .nvmrc (v20.19.0), not volta.node (18.0.0)", continue-on-failure = true }, + { argv = ["vpt", "print-file", ".node-version"], comment = "check .node-version comes from .nvmrc (v24.11.0), not volta.node (18.0.0)", continue-on-failure = true }, { argv = ["vpt", "stat-file", ".nvmrc", "--assert-not", "file"], comment = "check .nvmrc is removed", continue-on-failure = true }, { argv = ["vpt", "print-file", "package.json"], comment = "volta field must remain intact", continue-on-failure = true }, ] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots/migration_volta_with_nvmrc.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots/migration_volta_with_nvmrc.md index 9cb0ddf50f..cb3c2e856c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots/migration_volta_with_nvmrc.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_volta_with_nvmrc/snapshots/migration_volta_with_nvmrc.md @@ -17,10 +17,10 @@ VITE+ - The Unified Toolchain for the Web ## `vpt print-file .node-version` -check .node-version comes from .nvmrc (v20.19.0), not volta.node (18.0.0) +check .node-version comes from .nvmrc (v24.11.0), not volta.node (18.0.0) ``` -20.19.0 +24.11.0 ``` ## `vpt stat-file .nvmrc --assert-not file` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_inline_snapshot_indent/snapshots/test_inline_snapshot_indent.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_inline_snapshot_indent/snapshots/test_inline_snapshot_indent.md index 871bcffef7..f5be99adbd 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_inline_snapshot_indent/snapshots/test_inline_snapshot_indent.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_inline_snapshot_indent/snapshots/test_inline_snapshot_indent.md @@ -16,7 +16,7 @@ write inline snapshot via --update (regression test for #1553) Test Files 1 passed (1) Tests 1 passed (1) Start at