Skip to content

Commit f9344a0

Browse files
fix(create-cloudflare): Fix regression in C3's next template (#7774)
* fix(create-cloudflare): Fix regression in C3's next template [#7676](#7676) switched C3 templates to default to `wrangler.json` instead of `wrangler.toml`. Unfortunately, this unintendedly broke the `next` template, which was still attempting to read `wrangler.toml` specifically. This commit fixes the regression. Fixes #7770 * further fixes of the regression PR * fix failing tests on windows
1 parent 99f27df commit f9344a0

File tree

35 files changed

+61
-69
lines changed

35 files changed

+61
-69
lines changed

.changeset/chilly-kings-retire.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"create-cloudflare": patch
3+
---
4+
5+
Fix regression in C3's `next` template
6+
7+
[#7676](https://github.com/cloudflare/workers-sdk/pull/7676) switched C3 templates to default to `wrangler.json` instead of `wrangler.toml`. Unfortunately, this unintendedly broke the `next` template, which was still attempting to read `wrangler.toml` specifically. This commit fixes the regression.
8+
9+
Fixes #7770

packages/create-cloudflare/e2e-tests/frameworks.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ function getFrameworkTests(opts: {
193193
route: "/",
194194
expectedText: "Create Next App",
195195
},
196+
// see https://github.com/cloudflare/next-on-pages/blob/main/packages/next-on-pages/docs/supported.md#operating-systems
196197
unsupportedOSs: ["win32"],
197198
unsupportedPms: [
198199
// bun and yarn are failing in CI
@@ -475,7 +476,6 @@ function getFrameworkTests(opts: {
475476
},
476477
],
477478
testCommitMessage: true,
478-
quarantine: true,
479479
verifyBuildCfTypes: {
480480
outputFile: "env.d.ts",
481481
envInterfaceName: "CloudflareEnv",
@@ -484,6 +484,8 @@ function getFrameworkTests(opts: {
484484
route: "/",
485485
expectedText: "Create Next App",
486486
},
487+
// see https://github.com/cloudflare/next-on-pages/blob/main/packages/next-on-pages/docs/supported.md#operating-systems
488+
unsupportedOSs: ["win32"],
487489
verifyPreview: {
488490
route: "/",
489491
expectedText: "Create Next App",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Generated by Wrangler
2-
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen`
2+
// After adding bindings to `wrangler.json`, regenerate this interface via `npm run cf-typegen`
33
interface Env {
44
}

packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/js/src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { DurableObject } from "cloudflare:workers";
1111
*/
1212

1313
/**
14-
* Env provides a mechanism to reference bindings declared in wrangler.toml within JavaScript
14+
* Env provides a mechanism to reference bindings declared in wrangler.json within JavaScript
1515
*
1616
* @typedef {Object} Env
1717
* @property {DurableObjectNamespace} MY_DURABLE_OBJECT - The Durable Object namespace binding
@@ -24,7 +24,7 @@ export class MyDurableObject extends DurableObject {
2424
* `DurableObjectStub::get` for a given identifier (no-op constructors can be omitted)
2525
*
2626
* @param {DurableObjectState} ctx - The interface for interacting with Durable Object state
27-
* @param {Env} env - The interface to reference bindings declared in wrangler.toml
27+
* @param {Env} env - The interface to reference bindings declared in wrangler.json
2828
*/
2929
constructor(ctx, env) {
3030
super(ctx, env);
@@ -47,7 +47,7 @@ export default {
4747
* This is the standard fetch handler for a Cloudflare Worker
4848
*
4949
* @param {Request} request - The request submitted to the Worker from the client
50-
* @param {Env} env - The interface to reference bindings declared in wrangler.toml
50+
* @param {Env} env - The interface to reference bindings declared in wrangler.json
5151
* @param {ExecutionContext} ctx - The execution context of the Worker
5252
* @returns {Promise<Response>} The response to be sent back to the client
5353
*/

packages/create-cloudflare/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { DurableObject } from "cloudflare:workers";
77
* - Open a browser tab at http://localhost:8787/ to see your Durable Object in action
88
* - Run `npm run deploy` to publish your application
99
*
10-
* Bind resources to your worker in `wrangler.toml`. After adding bindings, a type definition for the
10+
* Bind resources to your worker in `wrangler.json`. After adding bindings, a type definition for the
1111
* `Env` object can be regenerated with `npm run cf-typegen`.
1212
*
1313
* Learn more at https://developers.cloudflare.com/durable-objects
@@ -21,7 +21,7 @@ export class MyDurableObject extends DurableObject {
2121
* `DurableObjectStub::get` for a given identifier (no-op constructors can be omitted)
2222
*
2323
* @param ctx - The interface for interacting with Durable Object state
24-
* @param env - The interface to reference bindings declared in wrangler.toml
24+
* @param env - The interface to reference bindings declared in wrangler.json
2525
*/
2626
constructor(ctx: DurableObjectState, env: Env) {
2727
super(ctx, env);
@@ -44,7 +44,7 @@ export default {
4444
* This is the standard fetch handler for a Cloudflare Worker
4545
*
4646
* @param request - The request submitted to the Worker from the client
47-
* @param env - The interface to reference bindings declared in wrangler.toml
47+
* @param env - The interface to reference bindings declared in wrangler.json
4848
* @param ctx - The execution context of the Worker
4949
* @returns The response to be sent back to the client
5050
*/

packages/create-cloudflare/templates-experimental/hello-world-with-assets/js/vitest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineWorkersConfig({
44
test: {
55
poolOptions: {
66
workers: {
7-
wrangler: { configPath: './wrangler.toml' },
7+
wrangler: { configPath: './wrangler.json' },
88
},
99
},
1010
},

packages/create-cloudflare/templates-experimental/hello-world-with-assets/ts/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* - Open a browser tab at http://localhost:8787/ to see your worker in action
66
* - Run `npm run deploy` to publish your worker
77
*
8-
* Bind resources to your worker in `wrangler.toml`. After adding bindings, a type definition for the
8+
* Bind resources to your worker in `wrangler.json`. After adding bindings, a type definition for the
99
* `Env` object can be regenerated with `npm run cf-typegen`.
1010
*
1111
* Learn more at https://developers.cloudflare.com/workers/

packages/create-cloudflare/templates-experimental/hello-world-with-assets/ts/vitest.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineWorkersConfig({
44
test: {
55
poolOptions: {
66
workers: {
7-
wrangler: { configPath: './wrangler.toml' },
7+
wrangler: { configPath: './wrangler.json' },
88
},
99
},
1010
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Generated by Wrangler
2-
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen`
2+
// After adding bindings to `wrangler.json`, regenerate this interface via `npm run cf-typegen`
33
interface Env {
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Generated by Wrangler
2-
// After adding bindings to `wrangler.toml`, regenerate this interface via `npm run cf-typegen`
2+
// After adding bindings to `wrangler.json`, regenerate this interface via `npm run cf-typegen`
33
interface CloudflareBindings {
44
}

0 commit comments

Comments
 (0)