Skip to content

Avoid direct @vitest/runner import - #6668

Merged
tim-smart merged 6 commits into
mainfrom
agent/codex-engineer/4f911f46
Jul 27, 2026
Merged

Avoid direct @vitest/runner import#6668
tim-smart merged 6 commits into
mainfrom
agent/codex-engineer/4f911f46

Conversation

@tim-smart

@tim-smart tim-smart commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the direct @vitest/runner import and development dependency
  • require Vitest 4.1 or later and read suite state from TestRunner.getCurrentSuite
  • ensure @effect/vitest observes the runner instance owned by the consumer's Vitest installation
  • add a minor changeset documenting the dropped Vitest 3 and 4.0 support

Reproduction

Declaring @vitest/runner separately does not fix npm's Vitest-only install. With Vitest 4.0.18, npm installed runner 4.1.10 for @effect/vitest, while Vitest resolved its nested runner 4.0.18. Resolution from the two packages returned distinct physical paths.

The final implementation has no runner declaration or subpath import. Collector state comes from the main Vitest entry's TestRunner, so it uses the running Vitest instance by construction and emits no vitest/suite deprecation warning.

Validation

  • pnpm lint-fix
  • pnpm check
  • pnpm --filter @effect/vitest build
  • pnpm test --run: 343 files passed; 8,416 tests passed, 1 expected failure, 8 skipped

Closes EFF-124
Closes #6666

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 27, 2026
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f003677

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@effect/vitest Major
effect Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/ai-anthropic Major
@effect/ai-openai-compat Major
@effect/ai-openai Major
@effect/ai-openrouter Major
@effect/atom-react Major
@effect/atom-solid Major
@effect/atom-vue Major
@effect/sql-clickhouse Major
@effect/sql-d1 Major
@effect/sql-libsql Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-pglite Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-do Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/docgen Major
@effect/openapi-generator Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@tim-smart, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 003291d7-2d3a-4b48-8cb6-8845acf8b95d

📥 Commits

Reviewing files that changed from the base of the PR and between b60b4de and f003677.

📒 Files selected for processing (3)
  • .changeset/fix-vitest-runner-import.md
  • packages/vitest/package.json
  • packages/vitest/src/internal/internal.ts
📝 Walkthrough

Walkthrough

@effect/vitest now resolves getCurrentSuite through vitest/suite, removes the direct @vitest/runner peer dependency, broadens Vitest compatibility to versions 3 and 4, and records a patch changeset.

Changes

Vitest suite import and package contract

Layer / File(s) Summary
Update suite import and peer contract
packages/vitest/src/internal/internal.ts, packages/vitest/package.json, .changeset/fix-vitest-runner-import.md
Imports getCurrentSuite from vitest/suite, removes @vitest/runner from peer dependencies, supports vitest `^3.0.0

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: 4.0

Suggested reviewers: gcanti, coyasong

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR removes the direct @vitest/runner import by switching to vitest/suite, which addresses the hoisting failure described in #6666.
Out of Scope Changes check ✅ Passed All changes relate to the Vitest runner import/dependency fix and accompanying changeset; no unrelated edits are evident.

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

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

File Name Current Size Previous Size Difference
basic.ts 6.63 KB 6.63 KB 0.00 KB (0.00%)
batching.ts 9.37 KB 9.37 KB 0.00 KB (0.00%)
brand.ts 6.26 KB 6.26 KB 0.00 KB (0.00%)
cache.ts 10.12 KB 10.12 KB 0.00 KB (0.00%)
config.ts 19.21 KB 19.21 KB 0.00 KB (0.00%)
differ.ts 18.42 KB 18.42 KB 0.00 KB (0.00%)
http-client.ts 20.76 KB 20.76 KB 0.00 KB (0.00%)
logger.ts 10.28 KB 10.28 KB 0.00 KB (0.00%)
metric.ts 8.55 KB 8.55 KB 0.00 KB (0.00%)
optic.ts 7.41 KB 7.41 KB 0.00 KB (0.00%)
pubsub.ts 14.20 KB 14.20 KB 0.00 KB (0.00%)
queue.ts 11.08 KB 11.08 KB 0.00 KB (0.00%)
schedule.ts 10.28 KB 10.28 KB 0.00 KB (0.00%)
schema-class.ts 18.16 KB 18.16 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 28.02 KB 28.02 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 24.33 KB 24.33 KB 0.00 KB (0.00%)
schema-string-transformation.ts 12.69 KB 12.69 KB 0.00 KB (0.00%)
schema-string.ts 10.35 KB 10.35 KB 0.00 KB (0.00%)
schema-template-literal.ts 14.49 KB 14.49 KB 0.00 KB (0.00%)
schema-toArbitraryLazy.ts 20.93 KB 20.93 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 23.38 KB 23.38 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 18.32 KB 18.32 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 18.00 KB 18.00 KB 0.00 KB (0.00%)
schema-toFormatter.ts 17.88 KB 17.88 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 21.51 KB 21.51 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 18.55 KB 18.55 KB 0.00 KB (0.00%)
schema.ts 17.43 KB 17.43 KB 0.00 KB (0.00%)
stm.ts 12.05 KB 12.05 KB 0.00 KB (0.00%)
stream.ts 9.36 KB 9.36 KB 0.00 KB (0.00%)

@coderabbitai coderabbitai Bot added the 4.0 label Jul 27, 2026
@tim-smart tim-smart changed the title Fix @effect/vitest runner dependency Avoid direct @vitest/runner import Jul 27, 2026
@tim-smart
tim-smart merged commit 83c7497 into main Jul 27, 2026
15 checks passed
@tim-smart
tim-smart deleted the agent/codex-engineer/4f911f46 branch July 27, 2026 22:23
@github-project-automation github-project-automation Bot moved this from Discussion Ongoing to Done in PR Backlog Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Package @effect/vitest imports directly @vitest/runner

1 participant