[vitest-plugin] Rename package for v1 - #15074
Conversation
🦋 Changeset detectedLatest commit: 5696452 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
UnknownError: ProviderInitError |
|
@penalosa Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
|
✅ All changesets look good |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
| // Debug log gated behind NODE_DEBUG=vitest-plugin | ||
| const debug = util.debuglog("vitest-plugin"); |
There was a problem hiding this comment.
🟡 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.
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-") |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| entry: [ | ||
| path.join(pkgRoot, "src", "codemods", "vitest-v3-to-v4.ts"), | ||
| path.join( | ||
| pkgRoot, | ||
| "src", | ||
| "codemods", | ||
| "vitest-pool-workers-to-vitest-plugin.ts" | ||
| ), | ||
| ], |
There was a problem hiding this comment.
🟡 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.ts → dist/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.
Was this helpful? React with 👍 or 👎 to provide feedback.
80b5da1 to
5696452
Compare
This PR is stacked on #13830 and should merge after it.
Renames
@cloudflare/vitest-pool-workersto@cloudflare/vitest-pluginfor the v1 release. This updates workspace consumers, fixtures, package metadata, CI configuration, and documentation, and includes a codemod and migration changeset for existing users.A picture of a cute animal (not mandatory, but encouraged)