From a73b73c5d39aee7b2e16b2719855ed85e8f0016c Mon Sep 17 00:00:00 2001 From: James Opstad <13586373+jamesopstad@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:03:58 +0100 Subject: [PATCH 1/3] Make all properties in PreviewsConfig optional --- packages/workers-utils/src/config/environment.ts | 4 ++-- packages/wrangler/src/__tests__/preview.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/workers-utils/src/config/environment.ts b/packages/workers-utils/src/config/environment.ts index 01a4361b5c..599fb558ca 100644 --- a/packages/workers-utils/src/config/environment.ts +++ b/packages/workers-utils/src/config/environment.ts @@ -1607,5 +1607,5 @@ export type ContainerEngine = */ export interface PreviewsConfig extends - EnvironmentNonInheritable, - Pick {} + Partial, + Partial> {} diff --git a/packages/wrangler/src/__tests__/preview.test.ts b/packages/wrangler/src/__tests__/preview.test.ts index 51de704b58..1d7453c041 100644 --- a/packages/wrangler/src/__tests__/preview.test.ts +++ b/packages/wrangler/src/__tests__/preview.test.ts @@ -27,10 +27,10 @@ vi.mock("node:child_process", async () => { }; }); -function configWithPreviews(previews: Partial): Config { +function configWithPreviews(previews: PreviewsConfig): Config { return { ...defaultWranglerConfig, - previews: previews as PreviewsConfig, + previews, }; } From a680864dc67e5a14e290c78ba9dbaeab47f8caec Mon Sep 17 00:00:00 2001 From: James Opstad <13586373+jamesopstad@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:09:51 +0100 Subject: [PATCH 2/3] Add changeset --- .changeset/stupid-papayas-kneel.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/stupid-papayas-kneel.md diff --git a/.changeset/stupid-papayas-kneel.md b/.changeset/stupid-papayas-kneel.md new file mode 100644 index 0000000000..4cfeda6653 --- /dev/null +++ b/.changeset/stupid-papayas-kneel.md @@ -0,0 +1,7 @@ +--- +"@cloudflare/workers-utils": patch +--- + +Make all properties in `previews` optional + +All properties in `previews` were previously incorrectly typed as required. From 40ec89205e142c63e0b091cfcdfa7b361c256601 Mon Sep 17 00:00:00 2001 From: James Opstad <13586373+jamesopstad@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:15:19 +0100 Subject: [PATCH 3/3] Fix formatting --- packages/workers-utils/src/config/environment.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/workers-utils/src/config/environment.ts b/packages/workers-utils/src/config/environment.ts index 599fb558ca..aaac98544a 100644 --- a/packages/workers-utils/src/config/environment.ts +++ b/packages/workers-utils/src/config/environment.ts @@ -1608,4 +1608,6 @@ export type ContainerEngine = export interface PreviewsConfig extends Partial, - Partial> {} + Partial< + Pick + > {}