feat(vitest): support Vitest 5 and upgrade dependencies - #317
Conversation
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>
|
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 configurationConfiguration used: Repository: btravstack/unthrown/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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>
There was a problem hiding this comment.
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 toMatchers<R extends void | Promise<void> = ..., T = unknown> extends UnthrownMatchers<R>, passing the return-type paramRtoUnthrownMatchers. - Bumped catalog deps:
vitest/@vitest/coverage-v85.0.1,@orpc/*2.0.0-beta.38,oxlint1.85.0,oxfmt0.70.0,turbo2.11.3, plus lockfile-only@oxlint/plugins1.85.0. - Added
@types/node(catalog) tocheckout-domainandexisting-errorsexamples to unify thevitestpeer variant; updated peer range to^5across docs/README/package.json/CLAUDE.md and added aminorchangeset.
| 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.
Summary
@unthrown/vitestsupports Vitest 5. Vitest 5 declaresMatchers<R extends void | Promise<void>, T>insidevitestitself (v4 hadMatchers<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 tovitest@^5.vitest/@vitest/coverage-v85.0.1,@orpc/*2.0.0-beta.38,oxlint1.85.0,oxfmt0.70.0,turbo2.11.3;@oxlint/plugins1.85.0 in the lockfile only (published^1.80.0range unchanged).examples/checkout-domainandexamples/existing-errorsresolved a differentvitestpeer variant (no@types/node), and under Vitest 5 each copy has its ownMatchers, so they lost the matchers. Both now declare@types/node; the reason is recorded inCLAUDE.md.Held back on purpose: vitest 5.0.2 and oRPC beta.39/40 (inside the 7-day
minimumReleaseAge), Prisma 8 (RC only;@unthrown/prismapeers^7), and TypeDoc's TypeScript 6.0.3 (deliberate pin).Test plan
pnpm format --check,pnpm lint,pnpm knip,pnpm typecheck,pnpm buildpnpm test— all 19 tasks, drizzle included (Docker)pnpm --filter @unthrown/docs build🤖 Generated with Claude Code
Summary by CodeRabbit
@unthrown/vitestnow supports Vitest 5, including its matcher type definitions.