[wrangler] Use formatConfigSnippet for compatibility_date warning in dev#13205
Conversation
The compatibility_date warning in getDevCompatibilityDate() hardcoded a TOML-format snippet. Use formatConfigSnippet() instead so the snippet renders correctly for both wrangler.toml and wrangler.json configs.
🦋 Changeset detectedLatest commit: a22948f The changes in this PR will be included in the next version bump. 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
@petebacondarwin Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
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: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
|
✅ All changesets look good Review Summary: The changeset
|
Use
formatConfigSnippetso the compatibility_date warning inwrangler devrenders correctly for both TOML and JSON config files.The
getDevCompatibilityDate()function inConfigController.tswarns when nocompatibility_dateis set and suggests adding one to the config file. The suggestion was hardcoded in TOML format (compatibility_date = "..."), which is incorrect when the user's config iswrangler.jsonorwrangler.jsonc.This replaces the hardcoded TOML snippet with
formatConfigSnippet(), which already exists in@cloudflare/workers-utilsand is used elsewhere (e.g.deploy.ts,match-tag.ts) for exactly this purpose.