Skip to content

feat(vitest): support Vitest 5 and upgrade dependencies - #317

Merged
btravers merged 2 commits into
mainfrom
chore/deps-vitest-5
Sep 30, 2026
Merged

btravers merged 2 commits into
mainfrom
chore/deps-vitest-5

Conversation

@btravers

@btravers btravers commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • @unthrown/vitest supports Vitest 5. Vitest 5 declares Matchers<R extends void | Promise<void>, T> inside vitest itself (v4 had Matchers<T = any> in the shared @vitest/expect). Interface merging requires identical type parameters, so one augmentation can't serve both majors: the peer range moves to vitest@^5.
  • Dependency upgrades (catalog): vitest / @vitest/coverage-v8 5.0.1, @orpc/* 2.0.0-beta.38, oxlint 1.85.0, oxfmt 0.70.0, turbo 2.11.3; @oxlint/plugins 1.85.0 in the lockfile only (published ^1.80.0 range unchanged).
  • Single vitest copy in the workspace. examples/checkout-domain and examples/existing-errors resolved a different vitest peer variant (no @types/node), and under Vitest 5 each copy has its own Matchers, so they lost the matchers. Both now declare @types/node; the reason is recorded in CLAUDE.md.
  • Changeset: minor. Through the fixed group, every package goes to 5.11.0; Vitest 4 users must upgrade Vitest.

Held back on purpose: vitest 5.0.2 and oRPC beta.39/40 (inside the 7-day minimumReleaseAge), Prisma 8 (RC only; @unthrown/prisma peers ^7), and TypeDoc's TypeScript 6.0.3 (deliberate pin).

Test plan

  • pnpm format --check, pnpm lint, pnpm knip, pnpm typecheck, pnpm build
  • pnpm test — all 19 tasks, drizzle included (Docker)
  • pnpm --filter @unthrown/docs build

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Compatibility
    • @unthrown/vitest now supports Vitest 5, including its matcher type definitions.
    • Vitest 4 is no longer supported by this package.
  • Documentation
    • Updated setup guidance and package documentation to reflect the Vitest 5 peer dependency.

Vitest 5 declares `Matchers<R, T>` inside `vitest` itself (v4 had
`Matchers<T>` in `@vitest/expect`), so the augmentation now mirrors the
new shape and the peer range moves to `vitest@^5`.

Also bumps vitest/coverage-v8 5.0.1, @orpc/* beta.38, oxlint 1.85.0,
oxfmt 0.70.0, turbo 2.11.3. The two examples without `@types/node` now
declare it so the workspace resolves a single vitest peer variant.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 09:39
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: btravstack/unthrown/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 54652234-29d2-40d5-8272-0659a9a1803f

📥 Commits

Reviewing files that changed from the base of the PR and between 714d47b and 5a97504.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (10)
  • .changeset/vitest-5.md
  • CLAUDE.md
  • docs/how-to/test-with-vitest.md
  • examples/checkout-domain/package.json
  • examples/existing-errors/package.json
  • packages/vitest/README.md
  • packages/vitest/package.json
  • packages/vitest/src/index.ts
  • packages/vitest/vitest.config.ts
  • pnpm-workspace.yaml
 _________________________________________
< 💣 Deploying bug fixes in 3... 2... 1... >
 -----------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

pnpm audit now flags fast-uri 3.1.6 (GHSA-qw65-cvwx-89v3,
GHSA-58mr-gqgx-xq4g, GHSA-hrr3-gc8f-f4qj) and brace-expansion 2.1.4 /
5.0.9 (GHSA-6j4f-fj2g-mc7p, GHSA-qhr7-859c-m2p7, GHSA-q2hr-2g5m-vwhr).
Raise the existing overrides to 3.1.8, 2.1.7 and 5.0.12. All are dev
tooling only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

It narrows a published package's vitest peer range from ^4 to ^5 (a breaking change for existing consumers) while releasing it as a minor, a deliberate release-policy call that warrants human confirmation.

Review effort: Balanced
Findings: None

What changed in this PR

This PR moves @unthrown/vitest from Vitest 4 to Vitest 5 and rolls the workspace catalog forward for several dev-tooling dependencies. The functional change is a single type augmentation: Vitest 5 relocated its Matchers interface into the vitest package and changed its shape to Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown>, so the module augmentation is rewritten to mirror that signature exactly (a requirement for interface merging). Supporting changes keep the workspace on a single vitest copy (so the augmented Matchers is shared) and update all peer-range documentation.

Changes:

  • Rewrote the declare module "vitest" augmentation to Matchers<R extends void | Promise<void> = ..., T = unknown> extends UnthrownMatchers<R>, passing the return-type param R to UnthrownMatchers.
  • Bumped catalog deps: vitest/@vitest/coverage-v8 5.0.1, @orpc/* 2.0.0-beta.38, oxlint 1.85.0, oxfmt 0.70.0, turbo 2.11.3, plus lockfile-only @oxlint/plugins 1.85.0.
  • Added @types/node (catalog) to checkout-domain and existing-errors examples to unify the vitest peer variant; updated peer range to ^5 across docs/README/package.json/CLAUDE.md and added a minor changeset.
File Description
packages/​vitest/​src/​index.ts Rewrites the Matchers augmentation to Vitest 5's two-parameter shape and updates the @typeParam R doc.
packages/​vitest/​vitest.config.ts Updates the coverage comment to describe the two now-uncovered defensive branches under Vitest 5's coverage tooling.
packages/​vitest/​package.json Moves the vitest peer range to ^5.
packages/​vitest/​README.md /​ docs/​how-to/​test-with-vitest.md Note vitest (^5) as the peer dependency.
pnpm-workspace.yaml /​ pnpm-lock.yaml Catalog + lockfile version bumps (vitest, orpc, oxlint, oxfmt, turbo, @oxlint/plugins).
examples/​checkout-domain/​package.json /​ examples/​existing-errors/​package.json Add @types/node to keep a single vitest peer variant.
CLAUDE.md Documents why Vitest 5 needs a v5-only augmentation and why examples declare @types/node.
.changeset/​vitest-5.md Records a minor bump describing the Vitest 5 support and peer-range move.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@btravers
btravers merged commit 947bbee into main Sep 30, 2026
14 checks passed
@btravers
btravers deleted the chore/deps-vitest-5 branch September 30, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants