#137 · Migrate worker-configuration.d.ts to wrangler generated runtime types
Last checked with GitLab: . Status comes from GitLab using a 2-minute cache. Merge events clear affected cached statuses. An already-open page does not update itself. Refresh page.
An MR completes this bounty when it is merged into main with Closes #137 and GitLab closes the issue. A mention or an updated timestamp is not completion. Awarded points appear in Activity.
cp .dev.vars.example .dev.vars && pnpm dev, after rebasing on main) and fully test your change before opening the MR.
Description
Background
Every Worker has a \worker-configuration.d.ts\ file generated by \wrangler\ containing the embedded \@cloudflare/workers-types\ declarations matching the wrangler version. These files were untracked in v5.13.9 (the gitignore added them; \git rm --cached\ cleaned 177k lines of git history noise).
Wrangler v4+ now produces a deprecation nag on every typecheck:
Action required — Migrate from \@cloudflare/workers-types\ to generated runtime types
\wrangler types\now generates runtime types and supersedes \@cloudflare/workers-types\.
You should now uninstall \@cloudflare/workers-types\ and remove it from your tsconfig.json.
Pre-empting the inevitable: this should be done before Cloudflare retires the old types.
Scope
For each of the 13 Cloudflare Worker apps in \apps/*\:
- Run \
wrangler types\(or \wrangler types --x-include-runtime\) to generate the new \runtime.d.ts\ - Remove \
@cloudflare/workers-types\from the app's \package.json\devDependencies (it's in the workspace catalog — remove from \pnpm-workspace.yaml\too if no other consumers) - Update each app's \
tsconfig.json\to reference the new generated types file instead of \"types": ["@cloudflare/workers-types"]\ - Verify each Worker's typecheck still passes
- Add the generated types file to \
.gitignore\(same rationale as v5.13.9's \worker-configuration.d.ts\ignore)
Acceptance
- Zero references to \
@cloudflare/workers-types\in any \package.json\or \tsconfig.json\across the monorepo - \
pnpm turbo typecheck\green for all 31 packages - Wrangler deprecation nag is gone
- New \
runtime.d.ts\files are gitignored, regenerable on \wrangler types\invocation - One paragraph added to monorepo \
CLAUDE.md\§ "Cloudflare Best Practices" documenting the regeneration command for new contributors
Bounty: M
Mechanical for each Worker but 13 apps × ~10 min each + the workspace-catalog cleanup + verifying every typecheck. Tests for the generated types story (since \KVNamespace\ etc. ambient resolution is sensitive — see issue #133 for the bot's tsc errors that are partially caused by this).
Relevant files
No relevant files linked yet.
Hints
No hints yet.
Activity
No points have been awarded for this bounty yet.
Comments
Sign in to join the discussion.
No comments yet. Be the first to weigh in.