Skip to content

Commit 294f30a

Browse files
authored
Merge branch 'main' into fix-proxy-worker-request-errors
2 parents 55a5344 + f5605f5 commit 294f30a

54 files changed

Lines changed: 1761 additions & 483 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@cloudflare/runtime-types": minor
3+
---
4+
5+
Publish `@cloudflare/runtime-types` as a standalone package
6+
7+
Consumers can now share the runtime type generator used by Wrangler and the Cloudflare Vite and Vitest integrations.
8+
9+
This package is not yet stable enough for external use — APIs may change without notice.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"wrangler": patch
3+
"@cloudflare/vite-plugin": patch
4+
---
5+
6+
Prepare the required egress sidecar for local Containers without configured images
7+
8+
Wrangler dev and Vite dev/preview now pull the required sidecar for Durable Object-managed Containers that select their application image at start time. Previously, these Containers failed to start unless the sidecar image was already cached in Docker.

‎.changeset/quiet-types-build.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@cloudflare/vite-plugin": minor
3+
"wrangler": minor
4+
---
5+
6+
Generate types during development and supported builds with Vite's `experimental.newConfig` option or Wrangler's `--experimental-new-config` flag (and `--experimental-cf-build-output` for builds)
7+
8+
When Wrangler's `--experimental-new-config` flag or Vite's `experimental.newConfig` option is enabled, inferred configuration and runtime declarations are now kept in `.cloudflare/types/index.d.ts`. Vite refreshes them during development and production builds. Wrangler refreshes them during development and when building with both `--experimental-new-config` and `--experimental-cf-build-output`. In the experimental `wrangler.config.ts` format, the `types` option is now top-level because it applies to both commands.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Match D1 SQL statement splitting to the local SQLite runtime
6+
7+
Wrangler now uses SQLite's statement-completion state machine when splitting D1 SQL files. This keeps trigger, quoted identifier, comment, and keyword handling consistent with local execution.

‎fixtures/experimental-new-config/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@fixture/experimental-new-config",
33
"private": true,
44
"scripts": {
5-
"build": "wrangler deploy --x-new-config --dry-run --outdir=dist",
5+
"build": "wrangler build --x-new-config --x-cf-build-output",
66
"check:type": "tsc --build",
77
"deploy": "wrangler deploy --x-new-config",
88
"dev": "wrangler dev --x-new-config",

‎fixtures/experimental-new-config/test/index.test.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ async function stageFixture(): Promise<string> {
4646
"src",
4747
"cloudflare.config.ts",
4848
"wrangler.config.ts",
49-
"worker-configuration.d.ts",
5049
"tsconfig.json",
5150
"tsconfig.node.json",
5251
"tsconfig.worker.json",
@@ -207,4 +206,16 @@ describe("--x-new-config dev", () => {
207206
const response = await fetch(`http://${ip}:${port}/`);
208207
expect(await response.text()).toBe("The mode is dev");
209208
});
209+
210+
test("generates types in the hidden Cloudflare directory", async ({
211+
expect,
212+
}) => {
213+
const generatedTypes = await fs.readFile(
214+
path.join(tmpDir, ".cloudflare/types/index.d.ts"),
215+
"utf8"
216+
);
217+
expect(generatedTypes).toContain(
218+
'import("../../cloudflare.config").default'
219+
);
220+
});
210221
});

‎fixtures/experimental-new-config/tsconfig.worker.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"src",
99
"cloudflare.config.ts",
1010
"wrangler.config.ts",
11-
"worker-configuration.d.ts"
11+
".cloudflare/types"
1212
]
1313
}

‎fixtures/experimental-new-config/worker-configuration.d.ts‎

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineWranglerConfig } from "wrangler/experimental-config";
22

3-
// Opts out of runtime types so the generated `worker-configuration.d.ts` only
3+
// Opts out of runtime types so the generated `.cloudflare/types/index.d.ts` only
44
// includes the inferred env (runtime globals come from
55
// `@cloudflare/workers-types`). Function form + non-empty configs are exercised
66
// by other unit tests in `packages/wrangler/src/__tests__/`.
77
export default defineWranglerConfig({
8-
dev: { types: { includeRuntime: false } },
8+
types: { includeRuntime: false },
99
});

‎packages/config/src/generate.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ interface GenerateTypesOptions {
1616
}
1717

1818
/**
19-
* Generate the content for worker-configuration.d.ts
19+
* Generate the content for a Worker types declaration file.
2020
*
2121
* @example
2222
* ```typescript
2323
* import { generateTypes } from "@cloudflare/config";
2424
* import { writeFileSync } from "node:fs";
2525
*
2626
* const content = generateTypes({
27-
* configPath: "./cloudflare.config.ts",
27+
* configPath: "../../cloudflare.config.ts",
2828
* });
2929
*
30-
* writeFileSync("worker-configuration.d.ts", content);
30+
* writeFileSync(".cloudflare/types/index.d.ts", content);
3131
* ```
3232
*/
3333
export function generateTypes({

0 commit comments

Comments
 (0)