Skip to content

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

Merged
penalosa merged 2 commits into
mainfrom
penalosa/vitest-v1
Aug 19, 2026
Merged

penalosa merged 2 commits into
mainfrom
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: ca667fb

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

This PR includes changesets to release 2 packages
Name Type
@cloudflare/codemods Minor
@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/codemods

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/codemods@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: ca667fb

devin-ai-integration[bot]

This comment was marked as resolved.

@penalosa
penalosa force-pushed the penalosa/vitest-v1 branch from 80b5da1 to 5696452 Compare August 7, 2026 11:40
Base automatically changed from penalosa/msw-cloudflare to main August 14, 2026 12:33
devin-ai-integration[bot]

This comment was marked as resolved.

@penalosa
penalosa force-pushed the penalosa/vitest-v1 branch from 5696452 to 140cb9f Compare August 17, 2026 12:24
@workers-devprod
workers-devprod requested review from a team and NuroDev and removed request for a team August 17, 2026 12:24
@workers-devprod

workers-devprod commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers
  • packages/workflows-shared/src/engine.ts: [@cloudflare/workflows]

@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 new potential issues.

View 8 additional findings in Devin Review.

Open in Devin Review

Comment thread .changeset/msw-cloudflare-integration.md Outdated
Comment thread tools/deployments/__tests__/validate-changesets.test.ts
Comment thread packages/vitest-plugin/src/codemods/vitest-pool-workers-to-vitest-plugin.ts Outdated
@ask-bonk

ask-bonk Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I've addressed the review findings from Devin Review:

Fixed issues:

  1. Incomplete NODE_DEBUG rename — packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts still used util.debuglog("vitest-pool-workers"). Renamed to vitest-plugin so all debug output is gated behind a single consistent namespace.
  2. Missing miniflare changeset — packages/miniflare/src/index.ts changed the assets fallback-worker detection to vitest-plugin-runner-. Added a patch changeset for miniflare so the coupled behaviour ships with the rename.
  3. Stale AGENTS.md build section — Updated packages/vitest-plugin/AGENTS.md BUILD section to list both codemod entry points.
  4. v3→v4 codemod emitting old package name — The shipped codemod rewrote imports to @cloudflare/vitest-pool-workers. It now matches the old /config specifier as input but emits @cloudflare/vitest-plugin. Updated the inline snapshot tests in codemods.test.ts and the header comment accordingly.
  5. Misleading /config subpath example — Updated the rename codemod header comment to use a valid /types subpath and note that v3 defineWorkersProject configs should run vitest-v3-to-v4 first (v1 has no /config export).
  6. Stale deprecate.test.ts / deprecate.ts — Updated the dependants-graph assertions and CLI help text to the new package name (verified against the on-disk workspace graph).
  7. MSW changeset classification — Bumped msw-cloudflare-integration.md from minor to major, matching the stable-breaking-change rule (older MSW versions stop intercepting).

Additional fix (not flagged but would break the release):

  • Several existing changesets (access-dev-vitest-pool, restore-vitest-pool-inject-keys, ripe-rice-hang, tender-pears-listen) referenced @cloudflare/vitest-pool-workers in their frontmatter, which no longer exists after the rename and would fail validate-changesets (Unknown package name). Updated those frontmatter keys to @cloudflare/vitest-plugin.

I verified the codemod output and changeset package-name validity locally.

@ask-bonk

ask-bonk Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I've addressed all the review findings for PR #15074. Here's a summary of the changes:

Changes made

  1. Incomplete NODE_DEBUG rename — Fixed packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts:39 to use util.debuglog("vitest-plugin") instead of the old vitest-pool-workers namespace, so all pool debug output is consistent.

  2. Missing miniflare changeset — Added .changeset/miniflare-vitest-plugin-runner.md (patch) since packages/miniflare/src/index.ts:2088 changed the assets fallback-worker detection to the new vitest-plugin-runner- prefix.

  3. Stale AGENTS.md — Updated packages/vitest-plugin/AGENTS.md BUILD section to list both codemod entry points.

  4. v3→v4 codemod output — Fixed vitest-v3-to-v4.ts:159 to emit @cloudflare/vitest-plugin (still matching the old /config input), updated the 5 inline snapshots in codemods.test.ts, and the header comment. Verified via actual codemod execution.

  5. Misleading subpath example — Updated the rename codemod header comment to use a valid /types subpath and note that v3 defineWorkersProject configs need vitest-v3-to-v4 first.

  6. Stale deprecate tooling — Updated assertions in deprecate.test.ts and CLI help text in deprecate.ts, verified against a simulation of the on-disk workspace dependency graph (all 13 assertions pass).

  7. MSW changeset — Bumped from minor to major per the stable-breaking-change rule.

Additional fix (not flagged but release-breaking)

Four existing changesets referenced @cloudflare/vitest-pool-workers in frontmatter, which no longer exists post-rename and would fail validate-changesets. Updated those keys to @cloudflare/vitest-plugin. Validated all changesets resolve to real package names.

Note: I could not run the full test suite (node_modules not installed in this environment), but I verified the codemod transforms and changeset package-name validity with standalone scripts.

github run

devin-ai-integration[bot]

This comment was marked as resolved.

@penalosa
penalosa force-pushed the penalosa/vitest-v1 branch from 7dfdbfc to ee17c7e Compare August 18, 2026 20:20
Rename `@cloudflare/vitest-pool-workers` to `@cloudflare/vitest-plugin` — the
package is a Vite/Vitest plugin (`cloudflareTest()` in `plugins: []`), not a
custom Vitest pool, so the old name no longer describes what it is.

- Move `packages/vitest-pool-workers` to `packages/vitest-plugin`, and the
  `vitest-pool-workers-examples` / `vitest-pool-workers-remote-bindings`
  fixtures to `vitest-plugin-examples` / `vitest-plugin-remote-bindings`
- Repoint the `workspace:*` consumers (`edge-preview-authenticated-proxy` and
  the `browser-run`, `worker-with-unsafe-external-plugin` and
  `workers-shared-asset-config` fixtures)
- Allow the one-off major bump in `validate-changesets.ts`
- Update `WORKER_NAME_PREFIX` to `vitest-plugin-`, and the matching
  `vitest-plugin-runner-` check in Miniflare's `fallbackWorkerName` — these
  must stay in sync or the assets + Vitest fallback Worker misroutes

Migration is handled by `npx @cloudflare/codemods vitest:pool-workers-to-vitest-plugin`.

The packages that consume the *published* package rather than the workspace one
stay on the old name until v1 is on npm — the four `catalog:default` consumers
(`pages-shared`, `workers-shared`, `workflows-shared`, `kv-asset-handler`) and
the C3 `hello-world` templates. Both need repointing as a release follow-up.
@penalosa
penalosa force-pushed the penalosa/vitest-v1 branch from ee17c7e to 1b9b5c3 Compare August 18, 2026 20:28
devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you might have missed a few places such as:

Or are these intentionally left as such?

Comment thread tools/deployments/validate-changesets.ts
@penalosa

Copy link
Copy Markdown
Contributor Author

I think you might have missed a few places such as:

These are intentionally left because they rely on the published package (to avoid circular deps). I'll update these in a followup once published

@dario-piotrowicz

Copy link
Copy Markdown
Member

I think you might have missed a few places such as:

These are intentionally left because they rely on the published package (to avoid circular deps). I'll update these in a followup once published

oh, alright, thanks! 😄

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Codeowners Bypass

@workers-devprod workers-devprod 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.

Codeowners reviews satisfied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants