Repository navigation
Accept @cloudflare/workers-types v5 in @fedify/cfworkers - #1260
Conversation
@fedify/cfworkers took its peer range on @cloudflare/workers-types from the pnpm catalog, so every published release required ^4.20250906.0. Cloudflare stopped publishing v4 at 4.20260702.1, and recent Wrangler releases declare an optional peer on v5, so npm refused to install @fedify/cfworkers next to them with ERESOLVE unless --legacy-peer-deps or an override was used. The only type the published declarations import from the package is Queue, which is unchanged in v5; KV bindings are typed structurally. The peer range is therefore widened to ^4.20250906.0 || ^5.0.0 and no longer comes from the catalog. The catalog entry stays on v4, and the package now lists it as a devDependency so the workspace keeps developing and testing against v4 instead of auto-installing whatever the widened peer allows. This commit includes the following changes: - A Node regression test checking that the peer range accepts the v4 minimum, the last v4 release and v5 releases, and rejects older v4 and v6. It resolves catalog: the way pnpm publish does, so it fails against the previous manifest for the actual reason. - A type check that the public API accepts KVNamespace and Queue as declared by @cloudflare/workers-types itself. - A changelog fragment for @fedify/cfworkers. v5 compatibility was verified in npm consumer projects built from locally packed tarballs: installing alongside wrangler@4.147.0, @cloudflare/workers-types@5 and @cloudflare/workers-types@4 all succeed and type-check. An in-repo v5 type check was not added because installing v5 into the shared node_modules makes Deno hoist it and breaks unrelated type checks. Fixes fedify-dev#1255 Assisted-by: Codex:gpt-6-astra Assisted-by: Claude Code:claude-opus-5-5
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (2)
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe cfworkers package now accepts specified versions of ChangesCloudflare Workers types compatibility
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review; the PR is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Carry the released fixes into 2.3.12 while preserving the 2.0.32, 2.1.28, and 2.2.17 changelog sections and destination package versions. Keep the 2.3 Cloudflare types minimum and key lookup instrumentation. Route JSON-LD context transport failures through the existing error handling and verify their metric classifications and HTTP status codes. Include the documentation and initializer CI fixes from 2.2.17. AI assistance resolved conflicts and added metric regression checks. Verified with mise check, mise test:deno, mise test:node, and mise test:bun, in that order. #1260 #1270 Assisted-by: Codex:gpt-6
Fixes #1255.
@fedify/cfworkerstook its peer range on@cloudflare/workers-typesfrom the pnpm catalog, so every 2.x release requires v4. Cloudflare stopped publishing v4 in July and recent Wrangler releases want v5, so npm fails withERESOLVEwhen both are installed. pnpm only warns, so workspace installs never exposed the failure.The built dist/mod.d.ts imports only
Queuefrom the package, and its declaration is identical in v4 and v5. KV bindings go through our own structural interface. So the peer range is now written out as^4.20250906.0 || ^5.0.0instead ofcatalog:. The catalog stays on v4, and an explicit dev dependency on it in packages/cfworkers/package.json keeps workspace installs on v4.Testing
The regression test, packages/cfworkers/test/peer-dependencies.check.mjs, runs under
node --testsince it checks packaging, not Workers behavior. It resolvescatalog:through pnpm-workspace.yaml the waypnpm publishdoes, so the old manifest fails because v5 is rejected, not becausecatalog:is an invalid range. The .check.mjs name keeps Vitest from picking it up.There is no v5 type check in the repository. Both an npm alias and a v5 dev dependency make Deno hoist v5 into the shared node_modules/, which breaks
deno checkfor unrelated packages such as packages/cli/. Instead, I packed the packages locally and installed them into fresh npm projects. Before the fix, addingwrangler@4.147.0failed withERESOLVE. With the fix, the projects install and type-check with Wrangler 4.147.0, workers-types v5, or workers-types v4.mise run checkandmise run test-each cfworkerspass.Forward-porting
2.3-maintenance and later use
^4.20260511.1as the v4 floor. Keep that floor (^4.20260511.1 || ^5.0.0) and update the minimum and below-minimum versions in the regression test to match. Regenerate pnpm-lock.yaml and deno.lock on each branch with that branch's pinned Deno. Running Deno 2.9 on 2.0–2.3 also breaks localpnpm pack(#1259).