Skip to content

chore: migrate wrangler.toml to wrangler.jsonc#4

Open
chitcommit wants to merge 1 commit intomainfrom
chore/wrangler-toml-to-jsonc
Open

chore: migrate wrangler.toml to wrangler.jsonc#4
chitcommit wants to merge 1 commit intomainfrom
chore/wrangler-toml-to-jsonc

Conversation

@chitcommit
Copy link
Contributor

@chitcommit chitcommit commented Mar 16, 2026

Summary

  • Convert wrangler.toml to wrangler.jsonc format
  • Preserves all configuration (vars, bindings, routes, environments)
  • Part of ecosystem-wide migration to JSONC for comment support

Test plan

  • Verify npx wrangler deploy --dry-run succeeds with new config
  • Confirm no config drift vs. production

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added deployment infrastructure configuration to enable improved observability and system integration settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

Introduces a Cloudflare Wrangler configuration file (wrangler.jsonc) that defines Worker metadata, runtime settings, environment variables, KV namespace binding, and route configuration for the proof.chitty.cc domain.

Changes

Cohort / File(s) Summary
Cloudflare Wrangler Configuration
wrangler.jsonc
New configuration file defining Worker bundle properties, including entry point (src/worker.js), compatibility settings (Node.js), observability, tail consumer binding, route pattern, and KV cache namespace with SERVICE_NAME and SERVICE_VERSION environment variables.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A Wrangler's Tale

With wrangler.jsonc now in place,
The Worker finds its rightful space,
Configuration bindings bright and true,
KV caches and routes, all set anew! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: migrating configuration from wrangler.toml to wrangler.jsonc, which aligns with the file-level changes and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/wrangler-toml-to-jsonc
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@wrangler.jsonc`:
- Around line 17-20: The wrangler configuration's "routes" key is currently an
object but must be an array of route objects; change the "routes" value to an
array containing the existing object (with "pattern" and "zone_name") so the
schema is satisfied and deployment succeeds, and ensure commas/JSONC syntax
remain valid after converting "routes" to an array.
- Around line 25-30: The KV namespace entry under kv_namespaces with binding
"PROOF_KEY_CACHE" currently uses the placeholder id "TBD" which will block
deployment; replace the id value with the real 32-character hex namespace ID for
PROOF_KEY_CACHE (obtained via `wrangler kv:namespace create PROOF_KEY_CACHE` or
by listing existing namespaces) so the kv_namespaces entry's id field contains
the valid namespace identifier.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 154879df-05a2-46b3-a985-2ef17cf17422

📥 Commits

Reviewing files that changed from the base of the PR and between db21a23 and b56caca.

📒 Files selected for processing (1)
  • wrangler.jsonc

Comment on lines +17 to +20
"routes": {
"pattern": "proof.chitty.cc/*",
"zone_name": "chitty.cc"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Validate the wrangler configuration
npx wrangler deploy --dry-run 2>&1 | head -50

Repository: chittyapps/chittyproof

Length of output: 497


routes must be an array, not an object.

Wrangler configuration schema requires routes to be an array of route objects. Current object format causes deployment failure.

Proposed fix
-  "routes": {
-    "pattern": "proof.chitty.cc/*",
-    "zone_name": "chitty.cc"
-  },
+  "routes": [
+    {
+      "pattern": "proof.chitty.cc/*",
+      "zone_name": "chitty.cc"
+    }
+  ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"routes": {
"pattern": "proof.chitty.cc/*",
"zone_name": "chitty.cc"
},
"routes": [
{
"pattern": "proof.chitty.cc/*",
"zone_name": "chitty.cc"
}
],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wrangler.jsonc` around lines 17 - 20, The wrangler configuration's "routes"
key is currently an object but must be an array of route objects; change the
"routes" value to an array containing the existing object (with "pattern" and
"zone_name") so the schema is satisfied and deployment succeeds, and ensure
commas/JSONC syntax remain valid after converting "routes" to an array.

Comment on lines +25 to +30
"kv_namespaces": [
{
"binding": "PROOF_KEY_CACHE",
"id": "TBD"
}
]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Placeholder KV namespace ID will block deployment.

The id: "TBD" is not a valid KV namespace identifier. Before deploying, replace this with the actual namespace ID (a 32-character hex string) obtained via wrangler kv:namespace create PROOF_KEY_CACHE or from the Cloudflare dashboard.

If the namespace already exists, retrieve its ID:

#!/bin/bash
# List existing KV namespaces to find the correct ID
npx wrangler kv:namespace list 2>&1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wrangler.jsonc` around lines 25 - 30, The KV namespace entry under
kv_namespaces with binding "PROOF_KEY_CACHE" currently uses the placeholder id
"TBD" which will block deployment; replace the id value with the real
32-character hex namespace ID for PROOF_KEY_CACHE (obtained via `wrangler
kv:namespace create PROOF_KEY_CACHE` or by listing existing namespaces) so the
kv_namespaces entry's id field contains the valid namespace identifier.

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