Conversation
|
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
40a7953 to
57c5f1c
Compare
ef95d91 to
f010fc4
Compare
- Update default catalog: vite ^8.0.0, vitest 4.1.0, @types/node ^22.10.1 - Remove vitest-3, vitest-4, and vite-plugin catalogs (single default catalog) - Remove vitest vite overrides from root package.json - Move all catalog:vitest-3 and catalog:vitest-4 refs to catalog:default - Update circular-dep packages to @cloudflare/vitest-pool-workers ^0.13.0 - Migrate vitest-pool-workers configs from defineWorkersProject/defineWorkersConfig to cloudflareTest() plugin (./config export removed in v4) - Rename vitest configs to .mts where needed for ESM-only imports - Fix workflows-shared: unique DO instance IDs (isolatedStorage dropped in v4), use workerdUnsafe.abortAllDurableObjects() for DO reset - Fix pages-shared: await mocked fetchAsset to avoid unhandled rejection - Fix create-cloudflare: add mockReset, cast beforeAll ctx to RunnerTestSuite - Fix moduleResolution: node -> bundler for Vite 8 type resolution - Update @vitest/pool-workers types path in test tsconfigs (./types in v4) - Bump @vitejs/plugin-react ^5.2.0, @vitejs/plugin-basic-ssl ^2.2.0, @tailwindcss/vite ^4.2.1 for Vite 8 peer compat - Fix pre-existing catalog drift (tree-kill, workerd, typescript, ws) - Remove vite from root package.json devDependencies - Add validate-catalog-usage.ts check to enforce catalog usage in CI
f010fc4 to
078e710
Compare
patch-console was only used as patchConsole(() => {}) — a no-op to silence
console output. This is redundant with the existing mockConsoleMethods() helper.
Removing it also removes the need for the console.Console monkeypatch in
vitest.setup.ts that worked around Vitest 4 stripping the constructor property.
vi.unstubAllEnvs() does not reliably remove env vars from process.env in Vitest 4 fork mode. Track keys before each test and delete additions in afterEach.
Vitest 4 requires object destructuring for the first argument in hooks. A plain parameter name like _fixtures is rejected at parse time.
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
⚠️ 1 issue in files not directly in the diff
⚠️ Stale AGENTS.md describes removed pnpm catalog convention (packages/vite-plugin-cloudflare/AGENTS.md:1)
The packages/vite-plugin-cloudflare/AGENTS.md states "Uses separate pnpm catalog (catalogs.vite-plugin) with different Vite version (7.x) than rest of repo (5.x)" but this PR removes the catalogs.vite-plugin catalog entirely from pnpm-workspace.yaml:46-53 and consolidates all Vite references to catalog:default with vite: "^8.0.0". AI agents relying on this file will be misled about the project's dependency management conventions. Per the repository's own rules in root AGENTS.md, these files provide mandatory guidance to AI coding agents.
View 13 additional findings in Devin Review.
- Set NODE_ENV=development before starting playground dev server (Vitest 4 defaults to NODE_ENV=test) - Add ts-expect-error for createCipher/createDecipher removed in @types/node@22 - Remove stale ts-expect-error for node:sqlite (types exist in @types/node@22)
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
⚠️ 1 issue in files not directly in the diff
⚠️ Stale AGENTS.md describes removed pnpm catalog convention (packages/vite-plugin-cloudflare/AGENTS.md:1)
The packages/vite-plugin-cloudflare/AGENTS.md states "Uses separate pnpm catalog (catalogs.vite-plugin) with different Vite version (7.x) than rest of repo (5.x)" but this PR removes the catalogs.vite-plugin catalog entirely from pnpm-workspace.yaml:46-53 and consolidates all Vite references to catalog:default with vite: "^8.0.0". AI agents relying on this file will be misled about the project's dependency management conventions. Per the repository's own rules in root AGENTS.md, these files provide mandatory guidance to AI coding agents.
View 14 additional findings in Devin Review.
Vitest 4 defaults NODE_ENV to test. Set it to development or production based on isBuild before starting the Vite server.
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
⚠️ 1 issue in files not directly in the diff
⚠️ Stale AGENTS.md describes removed pnpm catalog convention (packages/vite-plugin-cloudflare/AGENTS.md:1)
The packages/vite-plugin-cloudflare/AGENTS.md states "Uses separate pnpm catalog (catalogs.vite-plugin) with different Vite version (7.x) than rest of repo (5.x)" but this PR removes the catalogs.vite-plugin catalog entirely from pnpm-workspace.yaml:46-53 and consolidates all Vite references to catalog:default with vite: "^8.0.0". AI agents relying on this file will be misled about the project's dependency management conventions. Per the repository's own rules in root AGENTS.md, these files provide mandatory guidance to AI coding agents.
View 16 additional findings in Devin Review.
Fixes #[N/A — caretaking cleanup].
Standardise the repo on Vite 8 and Vitest 4 for all workspace development and testing. The
vite-legacydep invite-plugin-cloudflareis intentionally kept for backwards compat with users on older Vite.What changed
Catalog cleanup
vite: ^8.0.0,vitest: 4.1.0,@types/node: ^22.10.1vitest-3,vitest-4, andvite-pluginnamed catalogspackage.jsoncatalog:vitest-3/catalog:vitest-4/catalog:vite-pluginrefs tocatalog:defaulttree-kill,workerd,typescript,ws)vitefrom rootpackage.jsondevDependenciesCatalog enforcement
tools/deployments/validate-catalog-usage.ts— fails CI if a workspace member hardcodes a version that exists in the catalogpnpm checkascheck:catalogvitest-pool-workers v4 migration (circular-dep packages)
kv-asset-handler,pages-shared,workers-shared,workflows-shared: migrated vitest configs fromdefineWorkersProject/defineWorkersConfig(removed./configexport) tocloudflareTest()plugin@cloudflare/vitest-pool-workerscatalog from^0.10.0to^0.13.0@cloudflare/vitest-pool-workers→@cloudflare/vitest-pool-workers/typesTest fixes for Vitest 4
workflows-shared: unique DO instance IDs per test (isolatedStoragedropped in v4),workerdUnsafe.abortAllDurableObjects()for DO reset (avoids uncatchabledurableObjectResetunhandled rejection)pages-shared:awaitmockedfetchAssetreturn to avoid unhandled rejectioncreate-cloudflare:mockReset: truein vitest config, castbeforeAllctx toRunnerTestSuiteVite 8 type/peer compat
moduleResolution: "node"→"bundler"inworkers-editor-sharedandformat-errorstsconfigs@vitejs/plugin-reactto^5.2.0,@vitejs/plugin-basic-sslto^2.2.0,@tailwindcss/viteto^4.2.1