-
Notifications
You must be signed in to change notification settings - Fork 735
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
Add newline to prepended name and compatibility_date in wrangler.toml #5816
base: main
Are you sure you want to change the base?
Add newline to prepended name and compatibility_date in wrangler.toml #5816
Conversation
|
7dcb807
to
676b2e6
Compare
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/10822770220/npm-package-wrangler-5816 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5816/npm-package-wrangler-5816 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-wrangler-5816 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-create-cloudflare-5816 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-cloudflare-kv-asset-handler-5816 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-miniflare-5816 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-cloudflare-pages-shared-5816 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-cloudflare-vitest-pool-workers-5816 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-cloudflare-workers-editor-shared-5816 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10822770220/npm-package-cloudflare-workers-shared-5816 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
This was causing create-cloudflare to generate an incorrect wrangler.toml for templates that didn't include these attributes.
676b2e6
to
ccf01c9
Compare
This was causing create-cloudflare to generate an incorrect wrangler.toml for templates that didn't include these attributes.
What this PR solves / how to test
When
npm create cloudflare
creates a project, it either updatesname
andcompatibility_date
properties in wrangler.toml, or adds them if they don't exist yet.In that case they are added by prepending to the toml file, but this is done without a new line, which results in a broken toml file.
For example this:
npm create cloudflare@latest my-app -- --template xtuc/img-color-worker
Results in this wrangler.toml:
Apparently in this case the template did have a
name =
, which was updated, but nocompatibility_date =
, so it was prepended to the file but without a new line.The fix is pretty simple, and I've added a line to the corresponding unit test to parse the resulting toml to make sure it's valid.
Your CONTRIBUTING.md says it's ok to open a PR directly for trivial changes. I think this could be considered trivial, but course that depends on your definition. :-)
So if you'd like me to open an issue for this, then please let me know.
Author has addressed the following