Skip to content

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fixes #8270

Changes wrangler init --from-dash to generate wrangler.jsonc (JSON with Comments) config files instead of wrangler.toml files. JSON format is more familiar to many developers and easier to programmatically modify.

Changes Made

  • Core change: Modified init.ts to write wrangler.jsonc using JSON.stringify() instead of wrangler.toml using TOML serialization
  • Removed dependency: Eliminated @iarna/toml import from init.ts since it's no longer needed
  • Test updates: Updated all test files to expect wrangler.jsonc instead of wrangler.toml
  • Snapshot conversion: Converted test snapshots from TOML format to JSON format using automated snapshot updates

Important Review Areas

⚠️ Critical: The test snapshot conversion from TOML to JSON format is the highest-risk change. Please verify that the JSON snapshots are semantically equivalent to the original TOML versions, especially for:

  • Complex nested configurations (durable objects, routes, bindings)
  • Array vs object structures (e.g., [[routes]] in TOML vs "routes": [...] in JSON)
  • The large snapshot in the second test that includes many binding types

Other areas to check:

  • Verify .jsonc extension choice is consistent with existing codebase patterns (matches deploy/index.ts)
  • Confirm 2-space JSON indentation matches project standards
  • Check if any other references to wrangler.toml in tests were missed
  • Consider impact on users who might have scripts expecting TOML format

  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This is a straightforward format change with no new functionality
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: This is a new feature, not a bug fix

Link to Devin run: https://app.devin.ai/sessions/a9b7bafcaa02463a8036b22511a1488d
Requested by: @smacleod

….toml

- Remove TOML import from init.ts (no longer needed)
- Change init.ts to write wrangler.jsonc using JSON.stringify
- Update all tests to expect wrangler.jsonc instead of wrangler.toml
- Convert test snapshots from TOML to JSON format
- Add changeset for minor version bump

Fixes #8270

Co-Authored-By: [email protected] <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: 27df074

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

Copy link

pkg-pr-new bot commented Oct 8, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@10911

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@10911

miniflare

npm i https://pkg.pr.new/miniflare@10911

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@10911

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@10911

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@10911

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@10911

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@10911

wrangler

npm i https://pkg.pr.new/wrangler@10911

commit: 27df074

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't be making any changes in this file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't be making any changes in this file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't be making any changes in this file

devin-ai-integration bot and others added 3 commits October 8, 2025 00:23
Address PR feedback from @penalosa to revert changes to test files
that don't test the init --from-dash functionality:
- get-entry.test.ts
- index.test.ts
- deployments.status.test.ts

These files now reference wrangler.toml again since they test
functionality unrelated to the init command's config generation.

Co-Authored-By: [email protected] <[email protected]>
Update the --existing-script test expectations to check for wrangler.jsonc
with JSON content instead of wrangler.toml with TOML content, since
wrangler init --from-dash now generates JSON config files.

Co-Authored-By: [email protected] <[email protected]>
The --existing-script flow runs wrangler init --from-dash which now
generates wrangler.jsonc instead of wrangler.toml. Update the file copy
logic to check for and copy wrangler.jsonc, wrangler.json, or wrangler.toml
(in that preference order) to support both new and legacy workers.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration devin-ai-integration bot marked this pull request as ready for review October 8, 2025 02:41
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner October 8, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

make wrangler init --from-dash generate wrangler.json instead of wrangler.toml
1 participant