chore: vitest 5 migration blockers (CI verification only, do not merge) - #6457
Draft
kanadgupta wants to merge 5 commits into
Draft
Conversation
The 4.x istanbul provider crashes under Vitest 5 with "Expected string coverage payload, received object", which breaks the --coverage.enabled unit and integration CI jobs. 5.0.0 shipped the same day as vitest@5.0.0, so it needs the same minimumReleaseAge exclusion. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every @effect/vitest 4.0.0-rc.x pins vitest <5, but it only uses the stable entrypoint and the whole unit/integration suite passes on Vitest 5. Record the deliberate override so installs stop warning; drop it once upstream widens the range. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Declaring vitest in the root manifest enabled knip's Vitest plugin for the root workspace. It followed the root config's projects globs and re-analyzed every package's test files as root entries, which misattributed the dependencies of the release scripts referenced from GitHub workflows and failed knip:check with four unused devDependencies. Register the root config as a plain entry instead; package-level plugins already analyze their own configs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kanadgupta
changed the base branch from
develop
to
kanad-2026-09-03/vitest-5-project-mess-around
September 4, 2026 01:17
Every TypeScript workspace repeated the same Vitest scaffolding: istanbul coverage, passWithNoTests, the unit/integration/e2e include globs, and, in apps/cli and packages/config, the bun export-condition resolve blocks copied onto every inline project because Vitest 4 did not inherit them. vitest.shared.ts now owns that. definePackageConfig merges the shared defaults, and testProject(kind, overrides) declares one inline project per test kind with the file-suffix convention baked in. Vitest 5 inherits the declaring config into inline projects, so the duplicated resolve blocks and Dockerfile plugin entries are gone. The root config reuses the same run-level defaults and loads each package config as a nested project group. apps/cli-e2e also becomes a nested e2e project so it shows up as '@supabase/cli-e2e (e2e)' from the root and matches a '*(e2e)' filter; its lexicographic sequencer stays a run-level option for standalone runs. Its redundant node_modules exclude is dropped in favour of Vitest's defaults. vite is now an explicit root devDependency because the preset imports its default export-condition lists. Standalone per-package runs, the CI coverage commands, and a root run all collect the same projects and test counts as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Do not merge. This is a CI-verification PR stacked on #6456 (Vitest 5 projects exploration). It stays a draft and carries the
run-cilabel so the full develop suite runs against it; the commits will be folded into the real migration PR.Summary
Adds the fixes needed for the Vitest 5 upgrade in #6456 to pass CI, as additional commits on top of that branch.
@vitest/coverage-istanbulto 5.x. The 4.x provider crashes under Vitest 5 withExpected string coverage payload, received object, which breaks the--coverage.enabledunit and integration jobs.@vitest/coverage-istanbul@5.0.0shipped the same day asvitest@5.0.0, so it gets the sameminimumReleaseAgeExcludeentry.@effect/vitestpeer. Every@effect/vitest4.0.0-rc.x pinsvitest <5, but it only uses the stable entrypoint and the full unit and integration suite passes on Vitest 5. ApeerDependencyRules.allowedVersionsentry records the deliberate override so installs stop warning; drop it once upstream widens the range.vitestin the root manifest enabled knip's Vitest plugin for the root workspace. It followed the root config'sprojectsglobs and re-analyzed every package's test files as root entries, which misattributed the dependencies of the release scripts underapps/cli/scriptsandpackages/config/scriptsand failedknip:checkwith four "unused" devDependencies. The root config is registered as a plain entry instead, and the package-level plugins keep analyzing their own configs..vitest/. Vitest 5 centralizes reporter and attachment artifacts there.Step 2: one shared preset for the package configs
vitest.shared.tsat the repo root now owns the scaffolding every workspace repeated: istanbul coverage,passWithNoTests, quiet output from passing tests, the bun export-condition resolution, and the unit/integration/e2e/live include globs. Package configs shrink todefinePackageConfig({ test: { projects: [testProject("unit"), ...] } })plus genuinely package-specific overrides such as timeouts, setup files, or the CLI's Dockerfile loader plugin. Vitest 5 inherits the declaring config into inline projects, so the resolve blocks that Vitest 4 forced onto every inline project are gone.apps/cli-e2ebecomes a nestede2eproject so it appears as@supabase/cli-e2e (e2e)from the root and matches a*(e2e)filter. Its lexicographic sequencer remains a run-level option that applies to standalone runs.viteis an explicit root devDependency because the preset imports its default export-condition lists.Standalone per-package runs, the CI coverage commands, and a root run collect exactly the same projects and test counts as before.
The remaining
process.cwd()uses in tests were audited and are safe under root invocation (restore-after-chdir, a default argument, and a virtual-filesystem parser), so no test changes were needed beyond the one already in #6456.🤖 Generated with Claude Code