Skip to content

chore: vitest 4 - #29032

Closed
dulmandakh wants to merge 4 commits into
prisma:mainfrom
dulmandakh:vitest-4
Closed

dulmandakh wants to merge 4 commits into
prisma:mainfrom
dulmandakh:vitest-4

Conversation

@dulmandakh

@dulmandakh dulmandakh commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Updated package manager to pnpm 10.28.0.
    • Upgraded development tooling versions (Vitest, coverage, size-limit).
    • Removed Vitest from devDependencies across multiple packages.
    • Added/updated test configuration files for select packages to exclude build artifacts.
    • Relaxed/updated dev dependency ranges and overrides for improved flexibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Root-level package manager and dependency upgrades: pnpm updated to pnpm@10.28.0; vitest and @vitest/coverage-v8 bumped to 4.0.17; size-limit and @size-limit/file bumped to 12.0.0. vitest devDependency removed from multiple subpackages; two new vitest.config.ts files added; one Babel devDependency loosened; hono constraint relaxed to ^4.11.4.

Changes

Cohort / File(s) Summary
Root package manager & testing deps
package.json
Updated packageManager pnpm@10.15.1 → pnpm@10.28.0; bumped vitest & @vitest/coverage-v8 3.2.4 → 4.0.17; bumped size-limit & @size-limit/file 11.2.0 → 12.0.0; updated pnpm.overrides.hono → ^4.11.4.
Vitest devDependency removals (subpackages)
packages/client-generator-js/package.json, packages/client-generator-registry/package.json, packages/client-generator-ts/package.json, packages/config/package.json, packages/credentials-store/package.json, packages/dmmf/package.json, packages/engines/package.json, packages/generator/package.json, packages/get-platform/package.json, packages/query-plan-executor/package.json
Removed vitest (3.2.4) from devDependencies across listed packages; several packages retain test scripts that reference vitest.
New Vitest config files
packages/dmmf/vitest.config.ts, packages/ts-builders/vitest.config.ts
Added default Vitest configs that extend configDefaults.exclude with dist/*.
Babel devDependency version range
packages/internals/package.json
Changed devDependencies["@babel/helper-validator-identifier"] from 7.25.9 → ^7.28.5.
CLI hono constraint
packages/cli/package.json
Relaxed devDependencies.hono from 4.10.6 → ^4.11.4.

Suggested labels

lgtm

Suggested reviewers

  • igalklebanov
  • github-actions
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: vitest 4' accurately describes the main change: upgrading vitest from version 3 to version 4 across the project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41c115f and a05cf23.

📒 Files selected for processing (2)
  • packages/dmmf/vitest.config.ts
  • packages/ts-builders/vitest.config.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use kebab-case for new file names (e.g., query-utils.ts, filter-operators.test.ts)
Avoid creating barrel files (index.ts that re-export from other modules). Import directly from the source file unless the ./index.ts file already exists
Avoid adding useless code comments that do not add new information. Do not write inline comments that describe what the code does; only write comments explaining why the code was written or relevant context/background
Write documentation comments for exported items using proper doc comment syntax

Files:

  • packages/ts-builders/vitest.config.ts
  • packages/dmmf/vitest.config.ts
🧠 Learnings (1)
📚 Learning: 2026-01-05T16:15:18.374Z
Learnt from: jacek-prisma
Repo: prisma/prisma PR: 28992
File: packages/client/tests/functional/issues/28591-mapped-enums/test.ts:9-18
Timestamp: 2026-01-05T16:15:18.374Z
Learning: Prisma: After the TML-1663 fix, when using enums with map directives, only the mapped (lowercase) input values are accepted. For example, enum SuggestionStatus { PENDING map("pending") } will accept 'pending' but not 'PENDING'. This is a behavioral change from before. Update tests and usage accordingly to validate inputs against mapped values, and ensure any input normalization or validation relies on the mapped string rather than the enum name.

Applied to files:

  • packages/ts-builders/vitest.config.ts
  • packages/dmmf/vitest.config.ts
🔇 Additional comments (2)
packages/dmmf/vitest.config.ts (1)

1-7: Consider using dist/** for recursive exclusion.

The pattern dist/* only matches files directly inside dist/, but won't exclude test files in nested subdirectories (e.g., dist/subdir/foo.test.js). If the intent is to exclude all compiled output, dist/** would be more comprehensive.

Suggested change
 export default defineConfig({
   test: {
-    exclude: [...configDefaults.exclude, 'dist/*'],
+    exclude: [...configDefaults.exclude, 'dist/**'],
   },
 })
packages/ts-builders/vitest.config.ts (1)

1-7: Consider using dist/** for recursive exclusion.

Same as the other config file—dist/* only excludes direct children, not nested directories. Consider using dist/** for full recursive exclusion of compiled output.

Suggested change
 export default defineConfig({
   test: {
-    exclude: [...configDefaults.exclude, 'dist/*'],
+    exclude: [...configDefaults.exclude, 'dist/**'],
   },
 })

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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 and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@package.json`:
- Line 44: Upgrading the "@size-limit/file" entry to 12.0.0 introduces breaking
changes; update CI and dev environments to Node 20+ (update Dockerfiles/CI
matrix), if you use a TypeScript size-limit config (.size-limit.ts) add "jiti"
as a devDependency, audit any watcher code that relied on chokidar to ensure
compatibility with fs.watch-based behavior, and run integration tests that
exercise size-limit with your current esbuild and open plugins to validate and
bump those plugin versions if needed before committing the "@size-limit/file":
"12.0.0" change.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 223b6ea and 9ee310d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • package.json
  • packages/client-generator-js/package.json
  • packages/client-generator-registry/package.json
  • packages/client-generator-ts/package.json
  • packages/config/package.json
  • packages/credentials-store/package.json
  • packages/dmmf/package.json
  • packages/engines/package.json
  • packages/generator/package.json
  • packages/get-platform/package.json
  • packages/internals/package.json
  • packages/query-plan-executor/package.json
💤 Files with no reviewable changes (3)
  • packages/query-plan-executor/package.json
  • packages/client-generator-registry/package.json
  • packages/dmmf/package.json
🔇 Additional comments (9)
packages/config/package.json (1)

20-29: LGTM - vitest hoisted to workspace root.

Removing vitest from this package's devDependencies is correct since it's now defined at the workspace root. The "test": "vitest run" script on line 29 will resolve vitest from the root node_modules in pnpm workspaces.

packages/client-generator-ts/package.json (1)

45-52: LGTM - vitest hoisted to workspace root.

The removal is consistent with the monorepo-wide consolidation. The test script on line 52 will continue to work via pnpm workspace resolution.

packages/client-generator-js/package.json (1)

44-51: LGTM - consistent with monorepo vitest hoisting.

packages/get-platform/package.json (1)

16-40: LGTM - vitest was unused in this package.

This package uses Jest for testing (line 40: "test": "jest"), as evidenced by the Jest-related dependencies (jest, @swc/jest, @types/jest, jest-junit). Removing the unused vitest devDependency is a cleanup.

package.json (2)

55-55: Vitest 4 is a major upgrade with breaking changes.

"Vitest 4 has a few breaking changes that could affect you, so we advise reviewing the detailed Migration Guide before upgrading." Key changes include:

  • vi.fn().getMockName() now returns vi.fn() by default instead of spy. This can affect snapshots with mocks.
  • vi.restoreAllMocks() no longer resets or restores mocks created with vi.fn() or automocks; it only restores mocks created with vi.spyOn().
  • Reporter APIs onCollected, onSpecsCollected, onPathsCollected, onTaskUpdate and onFinished were removed.
  • Node 18 support was dropped. (Not an issue here since the project requires Node 20+.)

Please ensure tests pass and any affected configurations are updated accordingly.

Also applies to: 100-100


10-10: LGTM - pnpm patch version upgrade.

The pnpm upgrade from 10.15.1 to 10.28.0 is a minor/patch version bump within the allowed range (>=10.15 <11 per line 8).

packages/credentials-store/package.json (1)

29-36: LGTM - vitest hoisting pattern consistent with other packages.

The removal of vitest from devDependencies while retaining the test script reference is consistent with the workspace-level vitest configuration pattern seen across this PR.

packages/engines/package.json (1)

14-31: LGTM - consistent with vitest hoisting pattern.

The removal of vitest from devDependencies aligns with the PR's approach of centralizing vitest at the workspace root level. The test script on line 31 will resolve vitest from the root.

packages/generator/package.json (1)

26-34: The vitest hoisting pattern is properly configured at the workspace root.

The vitest devDependency removal from packages/generator/package.json is intentional. Vitest 4.0.17 is available at the workspace root and is hoisted to all packages, including this one, allowing the test script on line 33 to work correctly. This pattern is consistent across 29 packages in the monorepo.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread package.json Resolved
@aqrln aqrln added this to the 7.3.0 milestone Jan 16, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@package.json`:
- Line 165: The dependency spec for "hono" currently uses an open-ended range
">=4.11.4" which can pull in future major versions; update the package.json
entry for the "hono" dependency to a bounded semver range such as "^4.11.4" (or
"~4.11.4" if you want patch-only) to ensure deterministic installs, i.e.,
replace the string ">=4.11.4" with the chosen bounded range in the dependencies
block.

In `@packages/cli/package.json`:
- Line 146: The devDependency "hono" currently uses an open-ended range
">=4.11.4" which can pull in future major versions; change the version specifier
for "hono" in package.json from ">=4.11.4" to a bounded semver range such as
"^4.11.4" (or a specific pinned version) to ensure deterministic installs and
avoid accidental breaking upgrades.
♻️ Duplicate comments (1)
package.json (1)

44-44: Re-verify size-limit v12 migration steps.

At Line 44 and Line 91, size-limit v12 is a major bump; confirm any v12 breaking changes are addressed (e.g., optional jiti for TS configs, watcher behavior changes).

Also applies to: 91-91

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ee310d and 4011c58.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • packages/cli/package.json
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-12T16:26:09.447Z
Learnt from: igalklebanov
Repo: prisma/prisma PR: 28914
File: packages/cli/package.json:119-120
Timestamp: 2025-12-12T16:26:09.447Z
Learning: In packages/cli/package.json, verify that the build/bundling process includes devDependencies used at runtime and that you do not need to relocate them to dependencies. If the bundler includes runtime-used devDependencies, ensure the dependencies section only contains packages that are truly runtime, and document any exceptions. This guidance applies when reviewing changes to this package and its packaging setup to avoid unnecessary dependency moves and to maintain correct runtime packaging.

Applied to files:

  • packages/cli/package.json
🔇 Additional comments (2)
package.json (2)

10-10: Confirm pnpm 10.28.0 is enforced in CI/dev.

At Line 10, the packageManager bump can cause install/lockfile drift if CI or dev machines don’t use Corepack or a pinned pnpm version. Please verify the toolchain is updated accordingly and that the lockfile (if present) was regenerated with pnpm 10.28.0.


55-55: Validate Vitest v4 upgrade against configs/plugins.

At Line 55 and Line 100, Vitest v4 is a major upgrade—please re-run the test suite and verify vitest.config.* options, reporters, and coverage provider integration still match v4 expectations.

Also applies to: 100-100

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread package.json Resolved
Comment thread packages/cli/package.json Resolved
@dulmandakh

Copy link
Copy Markdown
Contributor Author

@aqrln please approve the workflows

@aqrln aqrln modified the milestones: 7.3.0, 7.4.0 Jan 28, 2026
@dulmandakh

Copy link
Copy Markdown
Contributor Author

closing in favor of #29142

@dulmandakh dulmandakh closed this Feb 6, 2026
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