-
Notifications
You must be signed in to change notification settings - Fork 778
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
output wrangler.jsonc in c3 #8024
Conversation
🦋 Changeset detectedLatest commit: 320847d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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/13265352200/npm-package-wrangler-8024 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8024/npm-package-wrangler-8024 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-wrangler-8024 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-workers-bindings-extension-8024 -O ./cloudflare-workers-bindings-extension.0.0.0-v40878168e.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v40878168e.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-create-cloudflare-8024 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-kv-asset-handler-8024 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-miniflare-8024 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-pages-shared-8024 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-unenv-preset-8024 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-vite-plugin-8024 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-vitest-pool-workers-8024 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-workers-editor-shared-8024 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-workers-shared-8024 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13265352200/npm-package-cloudflare-workflows-shared-8024 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
ce8efc4
to
29d29c5
Compare
Are we planning to update the docs site to use |
|
2c902d4
to
e6d31c4
Compare
@@ -238,6 +238,14 @@ describe.skipIf(experimental || frameworkToTest || isQuarantineMode())( | |||
`Cloning template from: cloudflare/templates/multiplayer-globe-template`, | |||
); | |||
expect(output).toContain(`template cloned and validated`); | |||
expect(readFileSync(`${project.path}/.vscode/settings.json`, "utf8")) |
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.
super nit: should this use JSON.parse(...) so that we don't depend on the exact format which we don't really care about?
@@ -772,21 +772,21 @@ const runCli = async ( | |||
*/ | |||
const addTestVarsToWranglerToml = async (projectPath: string) => { | |||
const wranglerTomlPath = join(projectPath, "wrangler.toml"); | |||
const wranglerJsonPath = join(projectPath, "wrangler.json"); | |||
const wranglerJsoncPath = join(projectPath, "wrangler.jsonc"); | |||
if (existsSync(wranglerTomlPath)) { | |||
const wranglerToml = readToml(wranglerTomlPath); |
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.
super nit: should wranglerToml
/ wranglerJson
be renamed to just config
(they are neither Toml nor json)
expect(jsonPath).toExist(); | ||
const config = readJSON(jsonPath) as { main?: string }; | ||
expect(jsoncPath).toExist(); | ||
const config = readJSON(jsoncPath) as { main?: string }; |
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.
super nit: don't we have the type for the config?
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.
Not in C3, I don't think? It's defined in Wrangler, and right now there's no dependency between the two packages
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.
Nice!
.changeset/large-badgers-deny.md
Outdated
"create-cloudflare": minor | ||
--- | ||
|
||
Output wrangler.jsonc instead of wrangler.json by default |
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.
Output wrangler.jsonc instead of wrangler.json by default | |
Output wrangler.jsonc instead of wrangler.json |
This isn't configurable, so I don't think we should use "default" language
expect(jsonPath).toExist(); | ||
const config = readJSON(jsonPath) as { main?: string }; | ||
expect(jsoncPath).toExist(); | ||
const config = readJSON(jsoncPath) as { main?: string }; |
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.
Not in C3, I don't think? It's defined in Wrangler, and right now there's no dependency between the two packages
const settingsPath = `${ctx.project.path}/.vscode/settings.json`; | ||
|
||
// don't override a user's existing settings | ||
// as this is just a quick stop gap we'll just not bother if the file exists |
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.
This is where the json-comment library is very nice!
Fixes #7948
Fixes #8030