Skip to content
Merged
7 changes: 7 additions & 0 deletions .changeset/ahdjzkizttbkaudepwzx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"create-cloudflare": patch
---

Handle git commit failures gracefully

When creating the initial commit fails (for example, when GPG signing is cancelled or misconfigured), the setup process now continues instead of crashing. A message is displayed informing the user that the commit was skipped and they can commit manually later.
5 changes: 5 additions & 0 deletions .changeset/breezy-ends-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Update autoconfig logic to handle Next.js projects by using the new `@opennextjs/cloudflare migrate` command
12 changes: 12 additions & 0 deletions .changeset/dependabot-update-12289.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"miniflare": patch
"wrangler": patch
---

Update dependencies of "miniflare", "wrangler"

The following dependency versions have been updated:

| Dependency | From | To |
| ---------- | ------------ | ------------ |
| workerd | 1.20260128.0 | 1.20260129.0 |
19 changes: 19 additions & 0 deletions .changeset/few-cameras-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
"wrangler": patch
---

Add framework id, build command, and deploy command to the `autoconfig_summary` field in the deploy output entry

Add the framework id alongside the commands to build and deploy the project to the output being printed by `wrangler deploy` to `WRANGLER_OUTPUT_FILE_DIRECTORY` or `WRANGLER_OUTPUT_FILE_PATH`.

For example for an npm Astro project these would be:

- Framework id: `astro`
- Build command: `npm run build`
- Deploy command: `npx wrangler deploy`

While for a Next.js project they would instead be:

- Framework id: `next`
- Build command: `npx @opennextjs/cloudflare build`
- Deploy command: `npx @opennextjs/cloudflare deploy`
20 changes: 20 additions & 0 deletions .changeset/tricky-pugs-send.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@cloudflare/workers-utils": minor
"wrangler": minor
---

Add a new `subrequests` limit to the `limits` field of the Wrangler configuration file

Before only the `cpu_ms` limit was supported in the `limits` field of the Wrangler configuration file, now a `subrequests` limit can be specified as well which enables the user to limit the number of fetch requests that a Worker's invocation can make.

Example:

```json
{
"$schema": "./node_modules/wrangler/config-schema.json",
"limits": {
"cpu_ms": 1000,
"subrequests": 150 // newly added field
}
}
```
6 changes: 6 additions & 0 deletions .changeset/version-metadata-timestamp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"miniflare": minor
"wrangler": minor
---

Add `timestamp` field to the version metadata binding in local development. The version metadata binding now includes `id`, `tag`, and `timestamp` fields, making it easier to test version-aware logic locally.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"reinitialise",
"scandir",
"selfsigned",
"subrequests",
"textfile",
"tsbuildinfo",
"turborepo",
Expand Down
23 changes: 23 additions & 0 deletions packages/create-cloudflare/src/__tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,28 @@ describe("git helpers", () => {

expect(ctx.commitMessage).toBeDefined();
});

test("commit failure is handled gracefully", async () => {
const ctx = createTestContext("test", { projectName: "test" });
ctx.args.git = true;

// Note: beforeEach already sets up git --version mock via mockGitInstalled(true)
// So we only need to mock git add and git commit
vi.mocked(runCommand)
.mockResolvedValueOnce("") // git add
.mockRejectedValueOnce(
new Error("gpg: signing failed: Operation cancelled"),
);

// Should not throw
await expect(gitCommit(ctx)).resolves.not.toThrow();

expect(spinner.start).toHaveBeenCalledOnce();
expect(spinner.stop).toHaveBeenCalledOnce();
expect(updateStatus).toHaveBeenCalledWith(
expect.stringContaining("Failed to create initial commit"),
);
expect(ctx.commitMessage).toBeDefined();
});
});
});
1 change: 1 addition & 0 deletions packages/create-cloudflare/src/__tests__/metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ describe("createReporter", () => {
durationMs: 1234,
durationSeconds: 1234 / 1000,
durationMinutes: 1234 / 1000 / 60,

error: {
message: "test error",
stack: expect.any(String),
Expand Down
90 changes: 0 additions & 90 deletions packages/create-cloudflare/src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
}
| {
Expand Down Expand Up @@ -121,16 +111,6 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
}
| {
Expand Down Expand Up @@ -167,16 +147,6 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
}
| {
Expand Down Expand Up @@ -264,16 +234,6 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
}
| {
Expand Down Expand Up @@ -321,16 +281,6 @@ export type Event =
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;

/**
* The error that caused the prompt to be crashed
*/
Expand Down Expand Up @@ -385,16 +335,6 @@ export type Event =
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;

/**
* The answer of the prompt. This could either be taken from the args provided or from the user input.
*/
Expand Down Expand Up @@ -481,16 +421,6 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
}
| {
Expand Down Expand Up @@ -545,16 +475,6 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
}
| {
Expand Down Expand Up @@ -601,15 +521,5 @@ export type Event =
* The duration of the prompt since it started in milliseconds (ms)
*/
durationMs?: number;

/**
* The duration of the prompt since it started in seconds
*/
durationSeconds?: number;

/**
* The duration of the prompt since it started in minutes
*/
durationMinutes?: number;
};
};
28 changes: 19 additions & 9 deletions packages/create-cloudflare/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,27 @@ export const gitCommit = async (ctx: C3Context) => {
const s = spinner();
s.start("Committing new files");

await runCommand(["git", "add", "."], {
silent: true,
cwd: ctx.project.path,
});
try {
await runCommand(["git", "add", "."], {
silent: true,
cwd: ctx.project.path,
});

await runCommand(["git", "commit", "-m", ctx.commitMessage, "--no-verify"], {
silent: true,
cwd: ctx.project.path,
});
await runCommand(
["git", "commit", "-m", ctx.commitMessage, "--no-verify"],
{
silent: true,
cwd: ctx.project.path,
},
);

s.stop(`${brandColor("git")} ${dim(`commit`)}`);
s.stop(`${brandColor("git")} ${dim(`commit`)}`);
} catch {
s.stop(`${brandColor("git")} ${dim(`commit failed`)}`);
updateStatus(
"Failed to create initial commit. You can commit manually later.",
);
}
};

const createCommitMessage = async (ctx: C3Context) => {
Expand Down
1 change: 0 additions & 1 deletion packages/create-cloudflare/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export function createReporter() {
startTime = Date.now();
} else {
const ms = Date.now() - startTime;

additionalProperties["durationMs"] = ms;
additionalProperties["durationSeconds"] = ms / 1000;
additionalProperties["durationMinutes"] = ms / 1000 / 60;
Expand Down
2 changes: 1 addition & 1 deletion packages/miniflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@cspotcode/source-map-support": "0.8.1",
"sharp": "^0.34.5",
"undici": "catalog:default",
"workerd": "1.20260128.0",
"workerd": "1.20260129.0",
"ws": "catalog:default",
"youch": "4.1.0-beta.10"
},
Expand Down
9 changes: 8 additions & 1 deletion packages/miniflare/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import { R2_PLUGIN, R2_PLUGIN_NAME } from "./r2";
import { RATELIMIT_PLUGIN, RATELIMIT_PLUGIN_NAME } from "./ratelimit";
import { SECRET_STORE_PLUGIN, SECRET_STORE_PLUGIN_NAME } from "./secret-store";
import { VECTORIZE_PLUGIN, VECTORIZE_PLUGIN_NAME } from "./vectorize";
import {
VERSION_METADATA_PLUGIN,
VERSION_METADATA_PLUGIN_NAME,
} from "./version-metadata";
import { VPC_SERVICES_PLUGIN, VPC_SERVICES_PLUGIN_NAME } from "./vpc-services";
import {
WORKER_LOADER_PLUGIN,
Expand Down Expand Up @@ -65,6 +69,7 @@ export const PLUGINS = {
[HELLO_WORLD_PLUGIN_NAME]: HELLO_WORLD_PLUGIN,
[WORKER_LOADER_PLUGIN_NAME]: WORKER_LOADER_PLUGIN,
[MEDIA_PLUGIN_NAME]: MEDIA_PLUGIN,
[VERSION_METADATA_PLUGIN_NAME]: VERSION_METADATA_PLUGIN,
};
export type Plugins = typeof PLUGINS;

Expand Down Expand Up @@ -127,7 +132,8 @@ export type WorkerOptions = z.input<typeof CORE_PLUGIN.options> &
z.input<typeof MTLS_PLUGIN.options> &
z.input<typeof HELLO_WORLD_PLUGIN.options> &
z.input<typeof WORKER_LOADER_PLUGIN.options> &
z.input<typeof MEDIA_PLUGIN.options>;
z.input<typeof MEDIA_PLUGIN.options> &
z.input<typeof VERSION_METADATA_PLUGIN.options>;

export type SharedOptions = z.input<typeof CORE_PLUGIN.sharedOptions> &
z.input<typeof CACHE_PLUGIN.sharedOptions> &
Expand Down Expand Up @@ -202,3 +208,4 @@ export * from "./mtls";
export * from "./hello-world";
export * from "./worker-loader";
export * from "./media";
export * from "./version-metadata";
Loading
Loading