Skip to content

[vitest-plugin] Rename package for v1 - #15074

Open
penalosa wants to merge 2 commits into
penalosa/msw-cloudflarefrom
penalosa/vitest-v1
Open

[vitest-plugin] Rename package for v1#15074
penalosa wants to merge 2 commits into
penalosa/msw-cloudflarefrom
penalosa/vitest-v1

Conversation

@penalosa

@penalosa penalosa commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This PR is stacked on #13830 and should merge after it.

Renames @cloudflare/vitest-pool-workers to @cloudflare/vitest-plugin for the v1 release. This updates workspace consumers, fixtures, package metadata, CI configuration, and documentation, and includes a codemod and migration changeset for existing users.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: migration guidance is included in the changeset and repository documentation is updated.

A picture of a cute animal (not mandatory, but encouraged)


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5696452

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/vitest-plugin 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

@ask-bonk

ask-bonk Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

UnknownError: ProviderInitError

github run

@ask-bonk

ask-bonk Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@penalosa Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/autoconfig@15074

@cloudflare/build-output-utils

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/build-output-utils@15074

@cloudflare/config

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/config@15074

create-cloudflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/create-cloudflare@15074

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/deploy-helpers@15074

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/kv-asset-handler@15074

miniflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/miniflare@15074

@cloudflare/pages-functions

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-functions@15074

@cloudflare/pages-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-shared@15074

@cloudflare/unenv-preset

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/unenv-preset@15074

@cloudflare/vite-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vite-plugin@15074

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vitest-plugin@15074

@cloudflare/workers-auth

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-auth@15074

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-editor-shared@15074

@cloudflare/workers-utils

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-utils@15074

wrangler

npm i https://pkg.pr.new/cloudflare/workers-sdk/wrangler@15074

commit: 5696452

@devin-ai-integration devin-ai-integration 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.

Devin Review found 3 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +72 to +73
// Debug log gated behind NODE_DEBUG=vitest-plugin
const debug = util.debuglog("vitest-plugin");

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.

🟡 Debug logging for the test pool is only partially renamed, so some diagnostics stay hidden

The debug-logging channel for the test integration was renamed to the new name in one place (util.debuglog("vitest-plugin") at packages/vitest-plugin/src/pool/index.ts:73) but a second place still uses the old name, so turning on debugging the documented way silently omits part of the output.
Impact: Anyone troubleshooting test runs with debug logging enabled will be missing messages, making problems harder to diagnose.

Incomplete NODE_DEBUG namespace rename across pool files

The rename changed util.debuglog("vitest-pool-workers")util.debuglog("vitest-plugin") in packages/vitest-plugin/src/pool/index.ts:73, and packages/vitest-plugin/src/pool/module-fallback.ts:16 and packages/vitest-plugin/test/helpers.ts:12 were similarly updated to vitest-plugin:*. However packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts:39 still reads private readonly debug = util.debuglog("vitest-pool-workers");. That instance logs Miniflare dispose and remote-proxy-session dispose failures (cloudflare-pool-worker.ts:116-127), which will therefore only appear when NODE_DEBUG=vitest-pool-workers is set — i.e. never for a user following the new naming.

Prompt for agents
The NODE_DEBUG namespace for the vitest plugin was renamed from "vitest-pool-workers" to "vitest-plugin" in packages/vitest-plugin/src/pool/index.ts, packages/vitest-plugin/src/pool/module-fallback.ts and packages/vitest-plugin/test/helpers.ts, but packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts still constructs its debug logger with the old namespace (`util.debuglog("vitest-pool-workers")`). Update that remaining call so all debug output is gated behind a single consistent namespace, and check for any documentation that mentions the debug namespace.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

!this.#workerOpts[0].core.name?.startsWith(
"vitest-pool-workers-runner-"
)
!this.#workerOpts[0].core.name?.startsWith("vitest-plugin-runner-")

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.

🟡 Runtime simulator behaviour changed without a release note, so the fix may never ship

The local Workers simulator's special-casing of the test runner worker was switched to the new name (startsWith("vitest-plugin-runner-") at packages/miniflare/src/index.ts:2311) without an accompanying release entry for that package, so the change will not trigger a release of it.
Impact: The updated simulator behaviour can sit unreleased, leaving published versions inconsistent with the renamed test package.

Missing changeset for the miniflare package

Repository rules (AGENTS.md, "Changesets": "Every change to package code requires a changeset or it will not trigger a release") require a changeset for any change to a published package's code. This PR adds only .changeset/rename-vitest-plugin.md (targeting @cloudflare/vitest-plugin) and edits .changeset/msw-cloudflare-integration.md, but modifies packages/miniflare/src/index.ts behaviourally: the assets fallback-worker selection now matches worker names beginning with vitest-plugin-runner- instead of vitest-pool-workers-runner- (produced by WORKER_NAME_PREFIX in packages/vitest-plugin/src/pool/helpers.ts:5). A patch changeset for miniflare is needed so the coupled behaviour is released together with the renamed package.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +97 to +105
entry: [
path.join(pkgRoot, "src", "codemods", "vitest-v3-to-v4.ts"),
path.join(
pkgRoot,
"src",
"codemods",
"vitest-pool-workers-to-vitest-plugin.ts"
),
],

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.

🟡 Package guide for AI agents is out of date after a new build output was added

A second migration script was added to the package's build outputs (new entry in the build config at packages/vitest-plugin/tsdown.config.ts:97-105) without updating the package's agent guide, which still lists only one script, so future contributors get stale structural information.
Impact: Contributors and automated agents relying on the package guide will not know the second migration script exists.

AGENTS.md rule for entry-point/build-output changes

Root AGENTS.md states: "When making architectural changes to a package (renaming files, adding entry points, changing build output), update the relevant AGENTS.md to reflect the new structure." This PR adds src/codemods/vitest-pool-workers-to-vitest-plugin.ts as a new tsdown entry and a new ./codemods/vitest-pool-workers-to-vitest-plugin entry in packages/vitest-plugin/package.json:46-48, but packages/vitest-plugin/AGENTS.md (BUILD section) still says only "3. codemods — src/codemods/vitest-v3-to-v4.tsdist/codemods".

Prompt for agents
packages/vitest-plugin/AGENTS.md documents the package's build outputs and currently lists only `src/codemods/vitest-v3-to-v4.ts` for the codemods build. This PR adds a second codemod entry (`src/codemods/vitest-pool-workers-to-vitest-plugin.ts`) to tsdown.config.ts and a matching `exports` subpath in package.json. Update the BUILD section of packages/vitest-plugin/AGENTS.md so it reflects both codemod entry points, per the root AGENTS.md rule about keeping package AGENTS.md in sync with entry-point/build-output changes.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@penalosa
penalosa force-pushed the penalosa/vitest-v1 branch from 80b5da1 to 5696452 Compare August 7, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants