Skip to content

build: remove wrangler.toml, cloudflare.config.ts is the only Worker config - #21

Merged
CubityFirst merged 2 commits into
mainfrom
cf-config-migration
Nov 12, 2026
Merged

CubityFirst merged 2 commits into
mainfrom
cf-config-migration

Conversation

@CubityFirst

Copy link
Copy Markdown
Owner

The Worker config is moving entirely to cloudflare.config.ts (the cf CLI's config format), so the Wrangler config files are removed. All four wrangler.toml files (api, auth, admin, frontend) are deleted. cloudflare.config.ts, plus wrangler.config.ts for build settings, is now the only Worker config. There's nothing left to keep "mirrored in both files".

cf deploy and Workers Builds already read cloudflare.config.ts, so deploys are unchanged. The toml was only still around for local dev and local D1 access. Those now work like this:

Local dev (pnpm dev). api/auth/admin run wrangler dev --experimental-new-config --port <n> --persist-to ../../.wrangler/state. That flag makes wrangler dev load cloudflare.config.ts + wrangler.config.ts (and .dev.vars) directly, and it keeps --persist-to, so all workers still share one state dir (the api reads auth's DB via AUTH_DB). Plain cf dev still can't be used:

  • cf rejects --persist-to for dev.
  • cf-wrangler dev in the pinned wrangler 4.156 hard-codes no persist dir. Wrangler 4.161 fixes that, but it's younger than this repo's 7-day minimumReleaseAge, so I didn't take it. Switching the dev scripts to cf dev -- --port … --persist-to … is a follow-up once 4.161+ ages in.

Local D1 SQL. wrangler d1 execute <db> --local can only find a database through a Wrangler config file, and cf d1 query --local has no local implementation. The new scripts/d1-local.mjs <main|auth> "<sql>" (or --file) runs SQL through the running api dev server's Local Explorer API (/cdn-cgi/local/explorer/api/d1/database/<id>/raw), against the same SQLite files the dev servers use. The e2e teardown, collab/ink-features/profile-card specs (via e2e/d1Local.ts), the api sizeCap integration test and backfill-logo-keys.ts use it. Remote commands (wrangler d1 execute --remote, wrangler r2 object) work without a config file and are unchanged.

Docs updated: CLAUDE.md, CONTRIBUTING.md, README.md, docs/oauth, memories/, and the wrangler.config.ts headers.

Verification (local)

  • pnpm typecheck passes. Unit tests (CI's set + mcp): 2,370 passed.

  • pnpm build, cf build (api/auth/admin) and cf-wrangler build (frontend) all succeed.

  • Real pnpm dev: all four servers up. Every binding shows as before, and DOC_COLLAB + AUTH are [connected]. Register → /me works through the vite proxy → api → auth service binding → AUTH_DB.

  • api integration suites (pnpm test:integration, including the collab sizeCap test that now writes D1 through the helper): 71/71 passed.

  • Playwright e2e: 128 passed, 35 failed. All 35 fail identically in Chromium and Firefox, and they come from frontend UI drift already on main, not this change (no frontend source is touched here):

    These need their own fix. The specs that depend on the new D1 helper (Ink grant via the auth DB) pass, and the teardown leaves no e2e rows behind.

@CubityFirst
CubityFirst merged commit 93a5634 into main Nov 12, 2026
1 check passed
@CubityFirst
CubityFirst deleted the cf-config-migration branch November 12, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant