-
Notifications
You must be signed in to change notification settings - Fork 763
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
Fix wrangler config detection with json and toml formats #7799
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 40944d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-wrangler-7799 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7799/npm-package-wrangler-7799 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-wrangler-7799 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-workers-bindings-extension-7799 -O ./cloudflare-workers-bindings-extension.0.0.0-va62ad3220.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-va62ad3220.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-create-cloudflare-7799 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-kv-asset-handler-7799 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-miniflare-7799 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-pages-shared-7799 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-unenv-preset-7799 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-vitest-pool-workers-7799 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-workers-editor-shared-7799 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-workers-shared-7799 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12814728077/npm-package-cloudflare-workflows-shared-7799 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
Hey team, From the failing test it looks like this was intentional. Was there a specific use case in mind? If so, I can close this PR, as now that I have migrated our root worker, I shouldn't run into this again. |
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.
I think the intention was to look for any wrangler.json before looking for any wrangler.toml. But I guess this could be reconsidered...
Fixes #[insert GH or internal issue link(s)].
Describe your change...
Assume this (admittedly suboptimal) folder layout:
Wrangler, without this change, would pick up the outer config file due to the order
findUpSync
was run in. While it is an edge case, we did run into it with a worker where some functionality has been extracted to a separate one for use with jsrpc, and I was migrating them to use.json
instead of.toml
.Fortunately, findUpSync supports an array of strings as input, and even the priority of json > jsonc > toml is kept, if all three are present at the same level.