-
Notifications
You must be signed in to change notification settings - Fork 1k
[wrangler] feat: generate wrangler.jsonc in init --from-dash instead of wrangler.toml #10911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
….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]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest 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 |
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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]>
Fixes #8270
Changes
wrangler init --from-dash
to generatewrangler.jsonc
(JSON with Comments) config files instead ofwrangler.toml
files. JSON format is more familiar to many developers and easier to programmatically modify.Changes Made
init.ts
to writewrangler.jsonc
usingJSON.stringify()
instead ofwrangler.toml
using TOML serialization@iarna/toml
import from init.ts since it's no longer neededwrangler.jsonc
instead ofwrangler.toml
Important Review Areas
[[routes]]
in TOML vs"routes": [...]
in JSON)Other areas to check:
.jsonc
extension choice is consistent with existing codebase patterns (matchesdeploy/index.ts
)wrangler.toml
in tests were missedLink to Devin run: https://app.devin.ai/sessions/a9b7bafcaa02463a8036b22511a1488d
Requested by: @smacleod