From 25b090a30162f85c0b5b289cd2ee30410928d027 Mon Sep 17 00:00:00 2001 From: ANT Bot <116369605+workers-devprod@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:27:17 +0000 Subject: [PATCH 01/13] Version Packages (#12840) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/brave-mails-take.md | 5 -- .changeset/bumpy-suns-press.md | 7 -- .changeset/c3-frameworks-update-12805.md | 11 --- .changeset/c3-frameworks-update-12806.md | 11 --- .changeset/dependabot-update-12861.md | 12 --- .changeset/deprecate-ssh-passthrough-flags.md | 7 -- .changeset/eight-melons-rule.md | 18 ----- .changeset/fix-c3-dashboard-url.md | 7 -- .changeset/floppy-webs-smell.md | 7 -- .changeset/kind-socks-beam.md | 26 ------ .changeset/many-fishes-raise.md | 57 ------------- .changeset/migrate-workers-playground.md | 14 ---- .changeset/quiet-foxes-grow.md | 17 ---- .changeset/real-plants-slide.md | 7 -- .changeset/ripe-pants-start.md | 9 --- .changeset/rude-steaks-kick.md | 12 --- .changeset/ten-dancers-know.md | 5 -- .changeset/thin-poems-dream.md | 7 -- .changeset/two-ants-yawn.md | 7 -- .changeset/vpc-hostname-validation.md | 7 -- packages/containers-shared/CHANGELOG.md | 8 ++ packages/containers-shared/package.json | 2 +- packages/create-cloudflare/CHANGELOG.md | 30 +++++++ packages/create-cloudflare/package.json | 2 +- packages/local-explorer-ui/CHANGELOG.md | 6 ++ packages/local-explorer-ui/package.json | 2 +- packages/miniflare/CHANGELOG.md | 23 ++++++ packages/miniflare/package.json | 2 +- packages/pages-shared/CHANGELOG.md | 7 ++ packages/pages-shared/package.json | 2 +- .../playground-preview-worker/CHANGELOG.md | 14 ++++ .../playground-preview-worker/package.json | 2 +- packages/vite-plugin-cloudflare/CHANGELOG.md | 22 +++++ packages/vite-plugin-cloudflare/package.json | 2 +- packages/vitest-pool-workers/CHANGELOG.md | 64 +++++++++++++++ packages/vitest-pool-workers/package.json | 2 +- packages/workers-playground/CHANGELOG.md | 14 ++++ packages/workers-playground/package.json | 2 +- packages/wrangler/CHANGELOG.md | 81 +++++++++++++++++++ packages/wrangler/package.json | 2 +- 40 files changed, 279 insertions(+), 263 deletions(-) delete mode 100644 .changeset/brave-mails-take.md delete mode 100644 .changeset/bumpy-suns-press.md delete mode 100644 .changeset/c3-frameworks-update-12805.md delete mode 100644 .changeset/c3-frameworks-update-12806.md delete mode 100644 .changeset/dependabot-update-12861.md delete mode 100644 .changeset/deprecate-ssh-passthrough-flags.md delete mode 100644 .changeset/eight-melons-rule.md delete mode 100644 .changeset/fix-c3-dashboard-url.md delete mode 100644 .changeset/floppy-webs-smell.md delete mode 100644 .changeset/kind-socks-beam.md delete mode 100644 .changeset/many-fishes-raise.md delete mode 100644 .changeset/migrate-workers-playground.md delete mode 100644 .changeset/quiet-foxes-grow.md delete mode 100644 .changeset/real-plants-slide.md delete mode 100644 .changeset/ripe-pants-start.md delete mode 100644 .changeset/rude-steaks-kick.md delete mode 100644 .changeset/ten-dancers-know.md delete mode 100644 .changeset/thin-poems-dream.md delete mode 100644 .changeset/two-ants-yawn.md delete mode 100644 .changeset/vpc-hostname-validation.md diff --git a/.changeset/brave-mails-take.md b/.changeset/brave-mails-take.md deleted file mode 100644 index b9cca3e1ba01..000000000000 --- a/.changeset/brave-mails-take.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@cloudflare/local-explorer-ui": patch ---- - -Fix local explorer's sidebar header link to point to the correct `/cdn-cgi/explorer/` path rather than `/`. diff --git a/.changeset/bumpy-suns-press.md b/.changeset/bumpy-suns-press.md deleted file mode 100644 index 21ce7c8bfbab..000000000000 --- a/.changeset/bumpy-suns-press.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@cloudflare/vite-plugin": minor ---- - -Support local explorer `/cdn-cgi/` routes - -The local explorer UI can now be accessed at `/cdn-cgi/explorer`. diff --git a/.changeset/c3-frameworks-update-12805.md b/.changeset/c3-frameworks-update-12805.md deleted file mode 100644 index e074d7ae8be9..000000000000 --- a/.changeset/c3-frameworks-update-12805.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"create-cloudflare": patch ---- - -Update dependencies of "create-cloudflare" - -The following dependency versions have been updated: - -| Dependency | From | To | -| --------------- | ------ | ------ | -| @angular/create | 21.2.0 | 21.2.1 | diff --git a/.changeset/c3-frameworks-update-12806.md b/.changeset/c3-frameworks-update-12806.md deleted file mode 100644 index c65ff9e3a4a1..000000000000 --- a/.changeset/c3-frameworks-update-12806.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"create-cloudflare": patch ---- - -Update dependencies of "create-cloudflare" - -The following dependency versions have been updated: - -| Dependency | From | To | -| ----------- | ------- | ------- | -| create-vike | 0.0.591 | 0.0.592 | diff --git a/.changeset/dependabot-update-12861.md b/.changeset/dependabot-update-12861.md deleted file mode 100644 index 61c8bc4ed273..000000000000 --- a/.changeset/dependabot-update-12861.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"miniflare": patch -"wrangler": patch ---- - -Update dependencies of "miniflare", "wrangler" - -The following dependency versions have been updated: - -| Dependency | From | To | -| ---------- | ------------ | ------------ | -| workerd | 1.20260310.1 | 1.20260312.1 | diff --git a/.changeset/deprecate-ssh-passthrough-flags.md b/.changeset/deprecate-ssh-passthrough-flags.md deleted file mode 100644 index 777a7a842734..000000000000 --- a/.changeset/deprecate-ssh-passthrough-flags.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": minor ---- - -Deprecate SSH passthrough flags in `wrangler containers ssh` - -The `--cipher`, `--log-file`, `--escape-char`, `--config-file`, `--pkcs11`, `--identity-file`, `--mac-spec`, `--option`, and `--tag` flags are now deprecated. These flags expose OpenSSH-specific options that are tied to the current implementation. A future release will replace the underlying SSH transport, at which point these flags will be removed. They still function for now. diff --git a/.changeset/eight-melons-rule.md b/.changeset/eight-melons-rule.md deleted file mode 100644 index 7b2546676407..000000000000 --- a/.changeset/eight-melons-rule.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"wrangler": patch ---- - -Add back support for wrangler d1 exports with multiple tables. - -Example: - -```bash -# All tables (default) -wrangler d1 export db --output all-tables.sql - -# Single table (unchanged) -wrangler d1 export db --output single-table.sql --table foo - -# Multiple tables (new) -wrangler d1 export db --output multiple-tables.sql --table foo --table bar -``` diff --git a/.changeset/fix-c3-dashboard-url.md b/.changeset/fix-c3-dashboard-url.md deleted file mode 100644 index 6e726e18cf88..000000000000 --- a/.changeset/fix-c3-dashboard-url.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"create-cloudflare": patch ---- - -Fix C3 success summary dashboard link to point to Workers service production view - -The "Dash:" URL now includes `/production` so it opens the correct Workers & Pages service view in the Cloudflare dashboard. diff --git a/.changeset/floppy-webs-smell.md b/.changeset/floppy-webs-smell.md deleted file mode 100644 index cb0abe279a41..000000000000 --- a/.changeset/floppy-webs-smell.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@cloudflare/vite-plugin": patch ---- - -Warn when the `assets` field is provided for auxiliary Workers - -Auxiliary Workers do not support static assets. Previously, the `assets` field was silently ignored but we now warn if it is used. diff --git a/.changeset/kind-socks-beam.md b/.changeset/kind-socks-beam.md deleted file mode 100644 index a714be447f36..000000000000 --- a/.changeset/kind-socks-beam.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -"wrangler": minor ---- - -Support disabling persistence in `unstable_startWorker()` and `unstable_dev()` - -You can now disable persistence entirely by setting `persist: false` in the `dev` options: - -```typescript -const worker = await unstable_dev("./src/worker.ts", { - persist: false, -}); -``` - -Or when using `unstable_startWorker()`: - -```typescript -const worker = await unstable_startWorker({ - entrypoint: "./src/worker.ts", - dev: { - persist: false, - }, -}); -``` - -This is useful for testing scenarios where you want to ensure a clean state on each run without any persisted data from previous runs. diff --git a/.changeset/many-fishes-raise.md b/.changeset/many-fishes-raise.md deleted file mode 100644 index 499a88363fd9..000000000000 --- a/.changeset/many-fishes-raise.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -"@cloudflare/vitest-pool-workers": minor ---- - -Support Vitest 4 in `@cloudflare/vitest-pool-workers`. - -This a breaking change to the `@cloudflare/vitest-pool-workers` integration in order to support Vitest v4. Along with supporting Vitest v4 (and dropping support for Vitest v2 and v3), we've made a number of changes that may require changes to your tests. Our aim has been to improve stability & the foundations of `@cloudflare/vitest-pool-workers` as we move towards a v1 release of the package. - -We've made a codemod to make the migration easier, which will make the required changes to your config file: - -```sh -npx jscodeshift -t node_modules/@cloudflare/vitest-pool-workers/dist/codemods/vitest-v3-to-v4.mjs vitest.config.ts -``` - -Or, without installing the package first: - -```sh -npx jscodeshift -t https://unpkg.com/@cloudflare/vitest-pool-workers/dist/codemods/vitest-v3-to-v4.mjs --parser=ts vitest.config.ts -``` - -- **Config API:** `defineWorkersProject` and `defineWorkersConfig` from `@cloudflare/vitest-pool-workers/config` have been replaced with a `cloudflareTest()` Vite plugin exported from `@cloudflare/vitest-pool-workers`. The `test.poolOptions.workers` options are now passed directly to `cloudflareTest()`: - - Before: - - ```ts - import { defineWorkersProject } from "@cloudflare/vitest-pool-workers/config"; - - export default defineWorkersProject({ - test: { - poolOptions: { - workers: { - wrangler: { configPath: "./wrangler.jsonc" }, - }, - }, - }, - }); - ``` - - After: - - ```ts - import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; - import { defineConfig } from "vitest/config"; - - export default defineConfig({ - plugins: [ - cloudflareTest({ - wrangler: { configPath: "./wrangler.jsonc" }, - }), - ], - }); - ``` - -- **`isolatedStorage` & `singleWorker`:** These have been removed in favour of a simpler isolation model that more closely matches Vitest. Storage isolation is now on a per test file basis, and you can make your test files share the same storage by using the Vitest flags `--max-workers=1 --no-isolate` -- **`import { env, SELF } from "cloudflare:test"`:** These have been removed in favour of `import { env, exports } from "cloudflare:workers"`. `exports.default.fetch()` has the same behaviour as `SELF.fetch()`, except that it doesn't expose Assets. To test your assets, write an integration test using [`startDevWorker()`](https://developers.cloudflare.com/workers/testing/unstable_startworker/) -- **`import { fetchMock } from "cloudflare:test"`:** This has been removed. Instead, [mock `globalThis.fetch`](https://github.com/cloudflare/workers-sdk/blob/main/fixtures/vitest-pool-workers-examples/request-mocking/test/imperative.test.ts) or use ecosystem libraries like [MSW (recommended)](https://mswjs.io/). -- **Vitest peer dependency:** `@cloudflare/vitest-pool-workers` now requires `vitest@^4.1.0`. diff --git a/.changeset/migrate-workers-playground.md b/.changeset/migrate-workers-playground.md deleted file mode 100644 index 54adfc165d49..000000000000 --- a/.changeset/migrate-workers-playground.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@cloudflare/workers-playground": patch -"@cloudflare/playground-preview-worker": patch ---- - -Migrate workers-playground from Cloudflare Pages to Cloudflare Workers - -Replace the Cloudflare Pages deployment with a Workers + static assets deployment. - -In production (`wrangler.jsonc`), this is an assets-only Worker with no code entry point — the `playground-preview-worker` handles all routing and proxying in front of it. - -For local development, a separate config (`wrangler.dev.jsonc`) adds a Worker entry point (`src/worker.ts`) that replicates the proxying behavior of the production `playground-preview-worker`. It proxies `/playground/api/*` requests to the testing `playground-preview-worker`, and for the `/playground` route it fetches an auth cookie from the testing endpoint, transforms it for local use (stripping `SameSite`/`Secure` directives and replacing the testing origin with `localhost`), and injects it into the response so the preview iframe can authenticate. - -The `playground-preview-worker` referer allowlist is updated to also accept requests from `*.workers-playground.workers.dev` (in addition to the existing `*.workers-playground.pages.dev`). diff --git a/.changeset/quiet-foxes-grow.md b/.changeset/quiet-foxes-grow.md deleted file mode 100644 index 86a5dca81cfe..000000000000 --- a/.changeset/quiet-foxes-grow.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"wrangler": patch ---- - -fix: `vectorize` commands now output valid json - -This fixes: - -- `wrangler vectorize create` -- `wrangler vectorize info` -- `wrangler vectorize insert` -- `wrangler vectorize upsert` -- `wrangler vectorize list` -- `wrangler vectorize list-vectors` -- `wrangler vectorize list-metadata-index` - -Also, `wrangler vectorize create --json` now also includes the `created_at`, `modified_on` and `description` fields. diff --git a/.changeset/real-plants-slide.md b/.changeset/real-plants-slide.md deleted file mode 100644 index 2af079ad576f..000000000000 --- a/.changeset/real-plants-slide.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -Fix autoconfig for Astro v6 projects to skip wrangler config generation - -Astro 6+ generates its own wrangler configuration on build, so autoconfig now detects the Astro version and skips creating a `wrangler.jsonc` file for projects using Astro 6 or later. This prevents conflicts between the autoconfig-generated config and Astro's built-in config generation. diff --git a/.changeset/ripe-pants-start.md b/.changeset/ripe-pants-start.md deleted file mode 100644 index 427eb5cb1e05..000000000000 --- a/.changeset/ripe-pants-start.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"create-cloudflare": patch ---- - -Generate `app/env.d.ts` and `server/env.d.ts` for Nuxt applications - -Previously, only a top-level `env.d.ts` was created, which meant server files didn't receive Cloudflare types. Now the CLI generates separate `app/env.d.ts` and `server/env.d.ts` files, both importing from a shared `_cloudflare/env.d.ts` to avoid duplication. - -This ensures Cloudflare types are available in both app and server directories. diff --git a/.changeset/rude-steaks-kick.md b/.changeset/rude-steaks-kick.md deleted file mode 100644 index 7f504b1b7e80..000000000000 --- a/.changeset/rude-steaks-kick.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"miniflare": patch ---- - -Fix local explorer route matching to be more precise - -Previously, the route matching used `startsWith("/cdn-cgi/explorer")` which would incorrectly match paths like `/cdn-cgi/explorerfoo` or `/cdn-cgi/explorereeeeee`, causing unexpected behavior. The route matching has been improved to only match: - -- `/cdn-cgi/explorer` (exact match) -- `/cdn-cgi/explorer/` and any sub-paths (e.g., `/cdn-cgi/explorer/api/*`) - -Paths that merely start with `/cdn-cgi/explorer` but aren't actually the explorer (like `/cdn-cgi/explorerfoo`) will now correctly fall through to the user worker. diff --git a/.changeset/ten-dancers-know.md b/.changeset/ten-dancers-know.md deleted file mode 100644 index 11d03a1faa4c..000000000000 --- a/.changeset/ten-dancers-know.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"miniflare": patch ---- - -Add support for worker connect handler in miniflare diff --git a/.changeset/thin-poems-dream.md b/.changeset/thin-poems-dream.md deleted file mode 100644 index eed356804992..000000000000 --- a/.changeset/thin-poems-dream.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@cloudflare/containers-shared": minor ---- - -Update the `proxy-everything` image used for containers local dev - -The egress interceptor image now supports HTTPS and ingress over HTTP CONNECT in workerd. diff --git a/.changeset/two-ants-yawn.md b/.changeset/two-ants-yawn.md deleted file mode 100644 index 75296424868a..000000000000 --- a/.changeset/two-ants-yawn.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@cloudflare/vite-plugin": patch ---- - -Fix Sandbox SDK preview URL WebSocket routing - -When using Sandbox SDK preview URLs, WebSocket requests using the `vite-hmr` protocol could be dropped before they reached the worker, causing HMR to fail. The plugin now forwards Sandbox WebSocket traffic and preserves the original request origin/host so worker proxy logic receives the correct URL. diff --git a/.changeset/vpc-hostname-validation.md b/.changeset/vpc-hostname-validation.md deleted file mode 100644 index 017f6997553f..000000000000 --- a/.changeset/vpc-hostname-validation.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -Add client-side validation for VPC service host flags - -The `--hostname`, `--ipv4`, and `--ipv6` flags on `wrangler vpc service create` and `wrangler vpc service update` now validate input before sending requests to the API. Previously, invalid values were accepted by the CLI and only rejected by the API with opaque error messages. Now users get clear, actionable error messages for common mistakes like passing a URL instead of a hostname, using an IP address in the `--hostname` flag, or providing malformed IP addresses. diff --git a/packages/containers-shared/CHANGELOG.md b/packages/containers-shared/CHANGELOG.md index 2b6861b2ed20..0f6c8542ec18 100644 --- a/packages/containers-shared/CHANGELOG.md +++ b/packages/containers-shared/CHANGELOG.md @@ -1,5 +1,13 @@ # @cloudflare/containers-shared +## 0.11.0 + +### Minor Changes + +- [#12857](https://github.com/cloudflare/workers-sdk/pull/12857) [`3f09bb2`](https://github.com/cloudflare/workers-sdk/commit/3f09bb2e22672c4a11dc5fcdaf9e6954d3e1973b) Thanks [@gabivlj](https://github.com/gabivlj)! - Update the `proxy-everything` image used for containers local dev + + The egress interceptor image now supports HTTPS and ingress over HTTP CONNECT in workerd. + ## 0.10.0 ### Minor Changes diff --git a/packages/containers-shared/package.json b/packages/containers-shared/package.json index cd55dba2fcec..3877a85aa808 100644 --- a/packages/containers-shared/package.json +++ b/packages/containers-shared/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/containers-shared", - "version": "0.10.0", + "version": "0.11.0", "private": true, "description": "Package that contains shared container functionality for Cloudflare Workers SDK.", "homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/containers-shared#readme", diff --git a/packages/create-cloudflare/CHANGELOG.md b/packages/create-cloudflare/CHANGELOG.md index c5e4f002a746..ff8a212f9768 100644 --- a/packages/create-cloudflare/CHANGELOG.md +++ b/packages/create-cloudflare/CHANGELOG.md @@ -1,5 +1,35 @@ # create-cloudflare +## 2.64.7 + +### Patch Changes + +- [#12805](https://github.com/cloudflare/workers-sdk/pull/12805) [`9e78285`](https://github.com/cloudflare/workers-sdk/commit/9e78285c84b11dfbc6e2d031a2f59dfcf11c5df1) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update dependencies of "create-cloudflare" + + The following dependency versions have been updated: + + | Dependency | From | To | + | --------------- | ------ | ------ | + | @angular/create | 21.2.0 | 21.2.1 | + +- [#12806](https://github.com/cloudflare/workers-sdk/pull/12806) [`56986b9`](https://github.com/cloudflare/workers-sdk/commit/56986b95eea536a27f27c3177e37d675c5c5850b) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update dependencies of "create-cloudflare" + + The following dependency versions have been updated: + + | Dependency | From | To | + | ----------- | ------- | ------- | + | create-vike | 0.0.591 | 0.0.592 | + +- [#12512](https://github.com/cloudflare/workers-sdk/pull/12512) [`01f252d`](https://github.com/cloudflare/workers-sdk/commit/01f252db83daff52ede0c582443548833f02caf1) Thanks [@thebeyondr](https://github.com/thebeyondr)! - Fix C3 success summary dashboard link to point to Workers service production view + + The "Dash:" URL now includes `/production` so it opens the correct Workers & Pages service view in the Cloudflare dashboard. + +- [#12820](https://github.com/cloudflare/workers-sdk/pull/12820) [`556bce0`](https://github.com/cloudflare/workers-sdk/commit/556bce0acd78e42b84b25247d73699513c2cf1aa) Thanks [@dario-piotrowicz](https://github.com/dario-piotrowicz)! - Generate `app/env.d.ts` and `server/env.d.ts` for Nuxt applications + + Previously, only a top-level `env.d.ts` was created, which meant server files didn't receive Cloudflare types. Now the CLI generates separate `app/env.d.ts` and `server/env.d.ts` files, both importing from a shared `_cloudflare/env.d.ts` to avoid duplication. + + This ensures Cloudflare types are available in both app and server directories. + ## 2.64.6 ### Patch Changes diff --git a/packages/create-cloudflare/package.json b/packages/create-cloudflare/package.json index 67a84999942e..23c0904e5f58 100644 --- a/packages/create-cloudflare/package.json +++ b/packages/create-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "create-cloudflare", - "version": "2.64.6", + "version": "2.64.7", "description": "A CLI for creating and deploying new applications to Cloudflare.", "keywords": [ "cloudflare", diff --git a/packages/local-explorer-ui/CHANGELOG.md b/packages/local-explorer-ui/CHANGELOG.md index 9aacf4499203..ce9d6ee09b40 100644 --- a/packages/local-explorer-ui/CHANGELOG.md +++ b/packages/local-explorer-ui/CHANGELOG.md @@ -1,5 +1,11 @@ # @cloudflare/local-explorer-ui +## 0.8.1 + +### Patch Changes + +- [#12864](https://github.com/cloudflare/workers-sdk/pull/12864) [`ecc7f79`](https://github.com/cloudflare/workers-sdk/commit/ecc7f792f950fc786ff40fa140bd8907bd26ff31) Thanks [@NuroDev](https://github.com/NuroDev)! - Fix local explorer's sidebar header link to point to the correct `/cdn-cgi/explorer/` path rather than `/`. + ## 0.8.0 ### Minor Changes diff --git a/packages/local-explorer-ui/package.json b/packages/local-explorer-ui/package.json index 3dbb098284d9..cefd27cad219 100644 --- a/packages/local-explorer-ui/package.json +++ b/packages/local-explorer-ui/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/local-explorer-ui", - "version": "0.8.0", + "version": "0.8.1", "private": true, "type": "module", "scripts": { diff --git a/packages/miniflare/CHANGELOG.md b/packages/miniflare/CHANGELOG.md index 3e87faeefc17..86b3459ae381 100644 --- a/packages/miniflare/CHANGELOG.md +++ b/packages/miniflare/CHANGELOG.md @@ -1,5 +1,28 @@ # miniflare +## 4.20260312.0 + +### Patch Changes + +- [#12861](https://github.com/cloudflare/workers-sdk/pull/12861) [`f7de0fd`](https://github.com/cloudflare/workers-sdk/commit/f7de0fdd6074089ba5a484df683647cb70fe06f6) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update dependencies of "miniflare", "wrangler" + + The following dependency versions have been updated: + + | Dependency | From | To | + | ---------- | ------------ | ------------ | + | workerd | 1.20260310.1 | 1.20260312.1 | + +- [#12864](https://github.com/cloudflare/workers-sdk/pull/12864) [`ecc7f79`](https://github.com/cloudflare/workers-sdk/commit/ecc7f792f950fc786ff40fa140bd8907bd26ff31) Thanks [@NuroDev](https://github.com/NuroDev)! - Fix local explorer route matching to be more precise + + Previously, the route matching used `startsWith("/cdn-cgi/explorer")` which would incorrectly match paths like `/cdn-cgi/explorerfoo` or `/cdn-cgi/explorereeeeee`, causing unexpected behavior. The route matching has been improved to only match: + + - `/cdn-cgi/explorer` (exact match) + - `/cdn-cgi/explorer/` and any sub-paths (e.g., `/cdn-cgi/explorer/api/*`) + + Paths that merely start with `/cdn-cgi/explorer` but aren't actually the explorer (like `/cdn-cgi/explorerfoo`) will now correctly fall through to the user worker. + +- [#12775](https://github.com/cloudflare/workers-sdk/pull/12775) [`1dda1c8`](https://github.com/cloudflare/workers-sdk/commit/1dda1c83cc286f5bc8bf7a13ed455265c50b0206) Thanks [@fhanau](https://github.com/fhanau)! - Add support for worker connect handler in miniflare + ## 4.20260310.0 ### Minor Changes diff --git a/packages/miniflare/package.json b/packages/miniflare/package.json index 7f688489e60b..b91f768709c1 100644 --- a/packages/miniflare/package.json +++ b/packages/miniflare/package.json @@ -1,6 +1,6 @@ { "name": "miniflare", - "version": "4.20260310.0", + "version": "4.20260312.0", "description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", diff --git a/packages/pages-shared/CHANGELOG.md b/packages/pages-shared/CHANGELOG.md index f46564d893b3..8f9a953bf65c 100644 --- a/packages/pages-shared/CHANGELOG.md +++ b/packages/pages-shared/CHANGELOG.md @@ -1,5 +1,12 @@ # @cloudflare/pages-shared +## 0.13.114 + +### Patch Changes + +- Updated dependencies [[`f7de0fd`](https://github.com/cloudflare/workers-sdk/commit/f7de0fdd6074089ba5a484df683647cb70fe06f6), [`ecc7f79`](https://github.com/cloudflare/workers-sdk/commit/ecc7f792f950fc786ff40fa140bd8907bd26ff31), [`1dda1c8`](https://github.com/cloudflare/workers-sdk/commit/1dda1c83cc286f5bc8bf7a13ed455265c50b0206)]: + - miniflare@4.20260312.0 + ## 0.13.113 ### Patch Changes diff --git a/packages/pages-shared/package.json b/packages/pages-shared/package.json index b3adf9d713a5..4731c558e474 100644 --- a/packages/pages-shared/package.json +++ b/packages/pages-shared/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/pages-shared", - "version": "0.13.113", + "version": "0.13.114", "repository": { "type": "git", "url": "https://github.com/cloudflare/workers-sdk.git", diff --git a/packages/playground-preview-worker/CHANGELOG.md b/packages/playground-preview-worker/CHANGELOG.md index 059bfc7060d9..2dfbf184d170 100644 --- a/packages/playground-preview-worker/CHANGELOG.md +++ b/packages/playground-preview-worker/CHANGELOG.md @@ -1,5 +1,19 @@ # playground-preview-worker +## 0.3.1 + +### Patch Changes + +- [#12655](https://github.com/cloudflare/workers-sdk/pull/12655) [`a31ee0b`](https://github.com/cloudflare/workers-sdk/commit/a31ee0b0c793532382f0473afd04d3c241d04724) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - Migrate workers-playground from Cloudflare Pages to Cloudflare Workers + + Replace the Cloudflare Pages deployment with a Workers + static assets deployment. + + In production (`wrangler.jsonc`), this is an assets-only Worker with no code entry point — the `playground-preview-worker` handles all routing and proxying in front of it. + + For local development, a separate config (`wrangler.dev.jsonc`) adds a Worker entry point (`src/worker.ts`) that replicates the proxying behavior of the production `playground-preview-worker`. It proxies `/playground/api/*` requests to the testing `playground-preview-worker`, and for the `/playground` route it fetches an auth cookie from the testing endpoint, transforms it for local use (stripping `SameSite`/`Secure` directives and replacing the testing origin with `localhost`), and injects it into the response so the preview iframe can authenticate. + + The `playground-preview-worker` referer allowlist is updated to also accept requests from `*.workers-playground.workers.dev` (in addition to the existing `*.workers-playground.pages.dev`). + ## 0.3.0 ### Minor Changes diff --git a/packages/playground-preview-worker/package.json b/packages/playground-preview-worker/package.json index 88359ecae9db..84c9b25a8d70 100644 --- a/packages/playground-preview-worker/package.json +++ b/packages/playground-preview-worker/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/playground-preview-worker", - "version": "0.3.0", + "version": "0.3.1", "private": true, "scripts": { "build-middleware": "pnpm run build-middleware:common && pnpm run build-middleware:loader", diff --git a/packages/vite-plugin-cloudflare/CHANGELOG.md b/packages/vite-plugin-cloudflare/CHANGELOG.md index d1d0fde6a2de..27587d4a2d56 100644 --- a/packages/vite-plugin-cloudflare/CHANGELOG.md +++ b/packages/vite-plugin-cloudflare/CHANGELOG.md @@ -1,5 +1,27 @@ # @cloudflare/vite-plugin +## 1.28.0 + +### Minor Changes + +- [#12855](https://github.com/cloudflare/workers-sdk/pull/12855) [`c2b76bc`](https://github.com/cloudflare/workers-sdk/commit/c2b76bc35bd038200b9919179f63b66e190e00eb) Thanks [@jamesopstad](https://github.com/jamesopstad)! - Support local explorer `/cdn-cgi/` routes + + The local explorer UI can now be accessed at `/cdn-cgi/explorer`. + +### Patch Changes + +- [#12834](https://github.com/cloudflare/workers-sdk/pull/12834) [`64edac7`](https://github.com/cloudflare/workers-sdk/commit/64edac70799112a69e28202b9f2e9c1e3aada92c) Thanks [@jamesopstad](https://github.com/jamesopstad)! - Warn when the `assets` field is provided for auxiliary Workers + + Auxiliary Workers do not support static assets. Previously, the `assets` field was silently ignored but we now warn if it is used. + +- [#12794](https://github.com/cloudflare/workers-sdk/pull/12794) [`b980af6`](https://github.com/cloudflare/workers-sdk/commit/b980af6603a08ae1d00020b3572dacfd6a0a541d) Thanks [@aron-cf](https://github.com/aron-cf)! - Fix Sandbox SDK preview URL WebSocket routing + + When using Sandbox SDK preview URLs, WebSocket requests using the `vite-hmr` protocol could be dropped before they reached the worker, causing HMR to fail. The plugin now forwards Sandbox WebSocket traffic and preserves the original request origin/host so worker proxy logic receives the correct URL. + +- Updated dependencies [[`f7de0fd`](https://github.com/cloudflare/workers-sdk/commit/f7de0fdd6074089ba5a484df683647cb70fe06f6), [`ff543e3`](https://github.com/cloudflare/workers-sdk/commit/ff543e30d69694613ab9d2da4281488fd27fd1b9), [`8e89e85`](https://github.com/cloudflare/workers-sdk/commit/8e89e85cf4f75b483a2dce5aa6947f050e5f35cc), [`e63539d`](https://github.com/cloudflare/workers-sdk/commit/e63539de64308cd0706b8876a22e1b1ccabe0721), [`8d1e130`](https://github.com/cloudflare/workers-sdk/commit/8d1e130bba5fa4019edab855e817a17110b360d0), [`6ee18e1`](https://github.com/cloudflare/workers-sdk/commit/6ee18e1bda05ef3870dfe917510bd2a55310254b), [`ecc7f79`](https://github.com/cloudflare/workers-sdk/commit/ecc7f792f950fc786ff40fa140bd8907bd26ff31), [`1dda1c8`](https://github.com/cloudflare/workers-sdk/commit/1dda1c83cc286f5bc8bf7a13ed455265c50b0206), [`4bb61b9`](https://github.com/cloudflare/workers-sdk/commit/4bb61b9758bc4e4349ede7327a1075774178be64)]: + - miniflare@4.20260312.0 + - wrangler@4.73.0 + ## 1.27.0 ### Minor Changes diff --git a/packages/vite-plugin-cloudflare/package.json b/packages/vite-plugin-cloudflare/package.json index 30f811740861..8c8cf607c777 100644 --- a/packages/vite-plugin-cloudflare/package.json +++ b/packages/vite-plugin-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/vite-plugin", - "version": "1.27.0", + "version": "1.28.0", "description": "Cloudflare plugin for Vite", "keywords": [ "cloudflare", diff --git a/packages/vitest-pool-workers/CHANGELOG.md b/packages/vitest-pool-workers/CHANGELOG.md index 32b7a6f40218..d60afa8b756a 100644 --- a/packages/vitest-pool-workers/CHANGELOG.md +++ b/packages/vitest-pool-workers/CHANGELOG.md @@ -1,5 +1,69 @@ # @cloudflare/vitest-pool-workers +## 0.13.0 + +### Minor Changes + +- [#11632](https://github.com/cloudflare/workers-sdk/pull/11632) [`a6ddbdb`](https://github.com/cloudflare/workers-sdk/commit/a6ddbdb2b67978377dda1acda289fe21eb0892bd) Thanks [@penalosa](https://github.com/penalosa)! - Support Vitest 4 in `@cloudflare/vitest-pool-workers`. + + This a breaking change to the `@cloudflare/vitest-pool-workers` integration in order to support Vitest v4. Along with supporting Vitest v4 (and dropping support for Vitest v2 and v3), we've made a number of changes that may require changes to your tests. Our aim has been to improve stability & the foundations of `@cloudflare/vitest-pool-workers` as we move towards a v1 release of the package. + + We've made a codemod to make the migration easier, which will make the required changes to your config file: + + ```sh + npx jscodeshift -t node_modules/@cloudflare/vitest-pool-workers/dist/codemods/vitest-v3-to-v4.mjs vitest.config.ts + ``` + + Or, without installing the package first: + + ```sh + npx jscodeshift -t https://unpkg.com/@cloudflare/vitest-pool-workers/dist/codemods/vitest-v3-to-v4.mjs --parser=ts vitest.config.ts + ``` + + - **Config API:** `defineWorkersProject` and `defineWorkersConfig` from `@cloudflare/vitest-pool-workers/config` have been replaced with a `cloudflareTest()` Vite plugin exported from `@cloudflare/vitest-pool-workers`. The `test.poolOptions.workers` options are now passed directly to `cloudflareTest()`: + + Before: + + ```ts + import { defineWorkersProject } from "@cloudflare/vitest-pool-workers/config"; + + export default defineWorkersProject({ + test: { + poolOptions: { + workers: { + wrangler: { configPath: "./wrangler.jsonc" }, + }, + }, + }, + }); + ``` + + After: + + ```ts + import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; + import { defineConfig } from "vitest/config"; + + export default defineConfig({ + plugins: [ + cloudflareTest({ + wrangler: { configPath: "./wrangler.jsonc" }, + }), + ], + }); + ``` + + - **`isolatedStorage` & `singleWorker`:** These have been removed in favour of a simpler isolation model that more closely matches Vitest. Storage isolation is now on a per test file basis, and you can make your test files share the same storage by using the Vitest flags `--max-workers=1 --no-isolate` + - **`import { env, SELF } from "cloudflare:test"`:** These have been removed in favour of `import { env, exports } from "cloudflare:workers"`. `exports.default.fetch()` has the same behaviour as `SELF.fetch()`, except that it doesn't expose Assets. To test your assets, write an integration test using [`startDevWorker()`](https://developers.cloudflare.com/workers/testing/unstable_startworker/) + - **`import { fetchMock } from "cloudflare:test"`:** This has been removed. Instead, [mock `globalThis.fetch`](https://github.com/cloudflare/workers-sdk/blob/main/fixtures/vitest-pool-workers-examples/request-mocking/test/imperative.test.ts) or use ecosystem libraries like [MSW (recommended)](https://mswjs.io/). + - **Vitest peer dependency:** `@cloudflare/vitest-pool-workers` now requires `vitest@^4.1.0`. + +### Patch Changes + +- Updated dependencies [[`f7de0fd`](https://github.com/cloudflare/workers-sdk/commit/f7de0fdd6074089ba5a484df683647cb70fe06f6), [`ff543e3`](https://github.com/cloudflare/workers-sdk/commit/ff543e30d69694613ab9d2da4281488fd27fd1b9), [`8e89e85`](https://github.com/cloudflare/workers-sdk/commit/8e89e85cf4f75b483a2dce5aa6947f050e5f35cc), [`e63539d`](https://github.com/cloudflare/workers-sdk/commit/e63539de64308cd0706b8876a22e1b1ccabe0721), [`8d1e130`](https://github.com/cloudflare/workers-sdk/commit/8d1e130bba5fa4019edab855e817a17110b360d0), [`6ee18e1`](https://github.com/cloudflare/workers-sdk/commit/6ee18e1bda05ef3870dfe917510bd2a55310254b), [`ecc7f79`](https://github.com/cloudflare/workers-sdk/commit/ecc7f792f950fc786ff40fa140bd8907bd26ff31), [`1dda1c8`](https://github.com/cloudflare/workers-sdk/commit/1dda1c83cc286f5bc8bf7a13ed455265c50b0206), [`4bb61b9`](https://github.com/cloudflare/workers-sdk/commit/4bb61b9758bc4e4349ede7327a1075774178be64)]: + - miniflare@4.20260312.0 + - wrangler@4.73.0 + ## 0.12.21 ### Patch Changes diff --git a/packages/vitest-pool-workers/package.json b/packages/vitest-pool-workers/package.json index ae01ed42324d..da285bccc195 100644 --- a/packages/vitest-pool-workers/package.json +++ b/packages/vitest-pool-workers/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/vitest-pool-workers", - "version": "0.12.21", + "version": "0.13.0", "description": "Workers Vitest integration for writing Vitest unit and integration tests that run inside the Workers runtime", "keywords": [ "cloudflare", diff --git a/packages/workers-playground/CHANGELOG.md b/packages/workers-playground/CHANGELOG.md index db8d98cfb82e..c47b33e00022 100644 --- a/packages/workers-playground/CHANGELOG.md +++ b/packages/workers-playground/CHANGELOG.md @@ -1,5 +1,19 @@ # workers-playground +## 0.4.1 + +### Patch Changes + +- [#12655](https://github.com/cloudflare/workers-sdk/pull/12655) [`a31ee0b`](https://github.com/cloudflare/workers-sdk/commit/a31ee0b0c793532382f0473afd04d3c241d04724) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - Migrate workers-playground from Cloudflare Pages to Cloudflare Workers + + Replace the Cloudflare Pages deployment with a Workers + static assets deployment. + + In production (`wrangler.jsonc`), this is an assets-only Worker with no code entry point — the `playground-preview-worker` handles all routing and proxying in front of it. + + For local development, a separate config (`wrangler.dev.jsonc`) adds a Worker entry point (`src/worker.ts`) that replicates the proxying behavior of the production `playground-preview-worker`. It proxies `/playground/api/*` requests to the testing `playground-preview-worker`, and for the `/playground` route it fetches an auth cookie from the testing endpoint, transforms it for local use (stripping `SameSite`/`Secure` directives and replacing the testing origin with `localhost`), and injects it into the response so the preview iframe can authenticate. + + The `playground-preview-worker` referer allowlist is updated to also accept requests from `*.workers-playground.workers.dev` (in addition to the existing `*.workers-playground.pages.dev`). + ## 0.4.0 ### Minor Changes diff --git a/packages/workers-playground/package.json b/packages/workers-playground/package.json index 0fdd61040195..6b08557a937d 100644 --- a/packages/workers-playground/package.json +++ b/packages/workers-playground/package.json @@ -1,6 +1,6 @@ { "name": "@cloudflare/workers-playground", - "version": "0.4.0", + "version": "0.4.1", "private": true, "type": "module", "scripts": { diff --git a/packages/wrangler/CHANGELOG.md b/packages/wrangler/CHANGELOG.md index ef3ad8a44dc3..76176ca86dd7 100644 --- a/packages/wrangler/CHANGELOG.md +++ b/packages/wrangler/CHANGELOG.md @@ -1,5 +1,86 @@ # wrangler +## 4.73.0 + +### Minor Changes + +- [#12853](https://github.com/cloudflare/workers-sdk/pull/12853) [`ff543e3`](https://github.com/cloudflare/workers-sdk/commit/ff543e30d69694613ab9d2da4281488fd27fd1b9) Thanks [@gpanders](https://github.com/gpanders)! - Deprecate SSH passthrough flags in `wrangler containers ssh` + + The `--cipher`, `--log-file`, `--escape-char`, `--config-file`, `--pkcs11`, `--identity-file`, `--mac-spec`, `--option`, and `--tag` flags are now deprecated. These flags expose OpenSSH-specific options that are tied to the current implementation. A future release will replace the underlying SSH transport, at which point these flags will be removed. They still function for now. + +- [#12815](https://github.com/cloudflare/workers-sdk/pull/12815) [`e63539d`](https://github.com/cloudflare/workers-sdk/commit/e63539de64308cd0706b8876a22e1b1ccabe0721) Thanks [@NuroDev](https://github.com/NuroDev)! - Support disabling persistence in `unstable_startWorker()` and `unstable_dev()` + + You can now disable persistence entirely by setting `persist: false` in the `dev` options: + + ```typescript + const worker = await unstable_dev("./src/worker.ts", { + persist: false, + }); + ``` + + Or when using `unstable_startWorker()`: + + ```typescript + const worker = await unstable_startWorker({ + entrypoint: "./src/worker.ts", + dev: { + persist: false, + }, + }); + ``` + + This is useful for testing scenarios where you want to ensure a clean state on each run without any persisted data from previous runs. + +### Patch Changes + +- [#12861](https://github.com/cloudflare/workers-sdk/pull/12861) [`f7de0fd`](https://github.com/cloudflare/workers-sdk/commit/f7de0fdd6074089ba5a484df683647cb70fe06f6) Thanks [@dependabot](https://github.com/apps/dependabot)! - Update dependencies of "miniflare", "wrangler" + + The following dependency versions have been updated: + + | Dependency | From | To | + | ---------- | ------------ | ------------ | + | workerd | 1.20260310.1 | 1.20260312.1 | + +- [#12734](https://github.com/cloudflare/workers-sdk/pull/12734) [`8e89e85`](https://github.com/cloudflare/workers-sdk/commit/8e89e85cf4f75b483a2dce5aa6947f050e5f35cc) Thanks [@flostellbrink](https://github.com/flostellbrink)! - Add back support for wrangler d1 exports with multiple tables. + + Example: + + ```bash + # All tables (default) + wrangler d1 export db --output all-tables.sql + + # Single table (unchanged) + wrangler d1 export db --output single-table.sql --table foo + + # Multiple tables (new) + wrangler d1 export db --output multiple-tables.sql --table foo --table bar + ``` + +- [#12807](https://github.com/cloudflare/workers-sdk/pull/12807) [`8d1e130`](https://github.com/cloudflare/workers-sdk/commit/8d1e130bba5fa4019edab855e817a17110b360d0) Thanks [@MaxwellCalkin](https://github.com/MaxwellCalkin)! - fix: `vectorize` commands now output valid json + + This fixes: + + - `wrangler vectorize create` + - `wrangler vectorize info` + - `wrangler vectorize insert` + - `wrangler vectorize upsert` + - `wrangler vectorize list` + - `wrangler vectorize list-vectors` + - `wrangler vectorize list-metadata-index` + + Also, `wrangler vectorize create --json` now also includes the `created_at`, `modified_on` and `description` fields. + +- [#12856](https://github.com/cloudflare/workers-sdk/pull/12856) [`6ee18e1`](https://github.com/cloudflare/workers-sdk/commit/6ee18e1bda05ef3870dfe917510bd2a55310254b) Thanks [@dario-piotrowicz](https://github.com/dario-piotrowicz)! - Fix autoconfig for Astro v6 projects to skip wrangler config generation + + Astro 6+ generates its own wrangler configuration on build, so autoconfig now detects the Astro version and skips creating a `wrangler.jsonc` file for projects using Astro 6 or later. This prevents conflicts between the autoconfig-generated config and Astro's built-in config generation. + +- [#12700](https://github.com/cloudflare/workers-sdk/pull/12700) [`4bb61b9`](https://github.com/cloudflare/workers-sdk/commit/4bb61b9758bc4e4349ede7327a1075774178be64) Thanks [@RiscadoA](https://github.com/RiscadoA)! - Add client-side validation for VPC service host flags + + The `--hostname`, `--ipv4`, and `--ipv6` flags on `wrangler vpc service create` and `wrangler vpc service update` now validate input before sending requests to the API. Previously, invalid values were accepted by the CLI and only rejected by the API with opaque error messages. Now users get clear, actionable error messages for common mistakes like passing a URL instead of a hostname, using an IP address in the `--hostname` flag, or providing malformed IP addresses. + +- Updated dependencies [[`f7de0fd`](https://github.com/cloudflare/workers-sdk/commit/f7de0fdd6074089ba5a484df683647cb70fe06f6), [`ecc7f79`](https://github.com/cloudflare/workers-sdk/commit/ecc7f792f950fc786ff40fa140bd8907bd26ff31), [`1dda1c8`](https://github.com/cloudflare/workers-sdk/commit/1dda1c83cc286f5bc8bf7a13ed455265c50b0206)]: + - miniflare@4.20260312.0 + ## 4.72.0 ### Minor Changes diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index b26f68829f06..99200c8ea255 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -1,6 +1,6 @@ { "name": "wrangler", - "version": "4.72.0", + "version": "4.73.0", "description": "Command-line interface for all things Cloudflare Workers", "keywords": [ "wrangler", From f0362f52adbbcacc4aa06cbac00e71c26b811df4 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 13 Mar 2026 09:53:15 +0000 Subject: [PATCH 02/13] Gate E2E API token behind Version Packages PR, merge queue, or run-remote-tests label (#12865) --- .github/actions/check-remote-tests/action.yml | 33 +++++++++ .github/workflows/README.md | 10 +++ .github/workflows/c3-e2e.yml | 9 ++- .github/workflows/e2e-vite.yml | 9 ++- .github/workflows/e2e-wrangler.yml | 13 ++-- .github/workflows/rerun-remote-tests.yml | 71 +++++++++++++++++++ CONTRIBUTING.md | 14 ++++ 7 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 .github/actions/check-remote-tests/action.yml create mode 100644 .github/workflows/rerun-remote-tests.yml diff --git a/.github/actions/check-remote-tests/action.yml b/.github/actions/check-remote-tests/action.yml new file mode 100644 index 000000000000..02e932e23574 --- /dev/null +++ b/.github/actions/check-remote-tests/action.yml @@ -0,0 +1,33 @@ +name: "Check Remote Tests" +description: > + Determines whether E2E tests should be given Cloudflare API credentials. + Returns true for merge-queue runs, Version Packages PRs, or when the + "run-remote-tests" label is present on a pull request. +outputs: + run-remote: + description: "'true' when remote tests should run, 'false' otherwise" + value: ${{ steps.decide.outputs.run_remote }} +runs: + using: "composite" + steps: + - name: Decide whether to run remote tests + id: decide + shell: bash + env: + GH_TOKEN: ${{ github.token }} + EVENT_NAME: ${{ github.event_name }} + HEAD_REF: ${{ github.head_ref }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + if [ "$EVENT_NAME" = "merge_group" ] || \ + [ "$HEAD_REF" = "changeset-release/main" ]; then + echo "run_remote=true" >> "$GITHUB_OUTPUT" + elif [ "$EVENT_NAME" = "pull_request" ]; then + HAS_LABEL=$(gh pr view "$PR_NUMBER" \ + --repo "$REPO" --json labels \ + --jq '[.labels[].name] | any(. == "run-remote-tests")') + echo "run_remote=${HAS_LABEL}" >> "$GITHUB_OUTPUT" + else + echo "run_remote=false" >> "$GITHUB_OUTPUT" + fi diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4a4e7ac80d69..8e03e253aeaf 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -25,6 +25,7 @@ See below for a summary of this repo's Actions - PRs in the merge queue. - Actions - Runs the E2E tests for Wrangler. + - Cloudflare API credentials are only passed on Version Packages PRs (`changeset-release/main`), in the merge queue, or when the `run-remote-tests` label is applied. Other PRs run the E2E suite without remote tests. ### Vite Plugin E2E tests (e2e-vite.yml) @@ -33,6 +34,7 @@ See below for a summary of this repo's Actions - PRs in the merge queue. - Actions - Runs the E2E tests for the Vite plugin. + - Cloudflare API credentials are only passed on Version Packages PRs (`changeset-release/main`), in the merge queue, or when the `run-remote-tests` label is applied. Other PRs run the E2E suite without remote tests. ## Deploy Pages Previews (deploy-pages-preview.yml) @@ -102,3 +104,11 @@ See below for a summary of this repo's Actions - Updates to PRs. - Actions - Runs the E2E tests for C3. + - Cloudflare API credentials are only passed on Version Packages PRs (`changeset-release/main`), in the merge queue, or when the `run-remote-tests` label is applied. Other PRs run the E2E suite without remote tests. + +### Rerun Remote Tests (rerun-remote-tests.yml) + +- Triggers + - The `run-remote-tests` label is added to a PR. +- Actions + - Re-runs the Wrangler, Vite, and C3 E2E workflows for the PR so they pick up the label and pass API credentials to the test steps. diff --git a/.github/workflows/c3-e2e.yml b/.github/workflows/c3-e2e.yml index 7c228674c5ff..c30eaf465556 100644 --- a/.github/workflows/c3-e2e.yml +++ b/.github/workflows/c3-e2e.yml @@ -5,6 +5,7 @@ on: permissions: contents: read + pull-requests: read jobs: e2e: @@ -45,6 +46,10 @@ jobs: everything_but_markdown: - '!**/*.md' + - name: Check if remote tests should run + id: check-remote + uses: ./.github/actions/check-remote-tests + - name: Install Dependencies if: steps.changes.outputs.everything_but_markdown == 'true' uses: ./.github/actions/install-dependencies @@ -77,8 +82,8 @@ jobs: run: pnpm run test:e2e:c3 env: NODE_VERSION: ${{ env.NODE_VERSION }} - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_API_TOKEN || '' }} + CLOUDFLARE_ACCOUNT_ID: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_ACCOUNT_ID || '' }} E2E_EXPERIMENTAL: ${{ matrix.experimental }} E2E_TEST_PM: ${{ matrix.pm.name }} E2E_TEST_PM_VERSION: ${{ matrix.pm.version }} diff --git a/.github/workflows/e2e-vite.yml b/.github/workflows/e2e-vite.yml index 99aaa5ec0f41..a247505dda1d 100644 --- a/.github/workflows/e2e-vite.yml +++ b/.github/workflows/e2e-vite.yml @@ -6,6 +6,7 @@ on: permissions: contents: read + pull-requests: read jobs: e2e-vite-plugin-test: @@ -38,6 +39,10 @@ jobs: everything_but_markdown: - '!**/*.md' + - name: Check if remote tests should run + id: check-remote + uses: ./.github/actions/check-remote-tests + - name: Install Dependencies if: steps.changes.outputs.everything_but_markdown == 'true' uses: ./.github/actions/install-dependencies @@ -60,8 +65,8 @@ jobs: env: NODE_DEBUG: "vite-plugin:test" # The remote-binding tests need to connect to Cloudflare - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_API_TOKEN || '' }} + CLOUDFLARE_ACCOUNT_ID: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_ACCOUNT_ID || '' }} NODE_OPTIONS: "--max_old_space_size=8192" CI_OS: ${{ matrix.os }} diff --git a/.github/workflows/e2e-wrangler.yml b/.github/workflows/e2e-wrangler.yml index 33112e79061a..2d20a868293d 100644 --- a/.github/workflows/e2e-wrangler.yml +++ b/.github/workflows/e2e-wrangler.yml @@ -6,6 +6,7 @@ on: permissions: contents: read + pull-requests: read jobs: e2e-wrangler-test: @@ -39,6 +40,10 @@ jobs: everything_but_markdown: - '!**/*.md' + - name: Check if remote tests should run + id: check-remote + uses: ./.github/actions/check-remote-tests + - name: Install Dependencies if: steps.changes.outputs.everything_but_markdown == 'true' uses: ./.github/actions/install-dependencies @@ -58,8 +63,8 @@ jobs: if: steps.changes.outputs.everything_but_markdown == 'true' run: pnpm run test:e2e:wrangler env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_API_TOKEN || '' }} + CLOUDFLARE_ACCOUNT_ID: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_ACCOUNT_ID || '' }} HYPERDRIVE_DATABASE_URL: ${{ secrets.TEST_HYPERDRIVE_DATABASE_URL}} HYPERDRIVE_MYSQL_DATABASE_URL: ${{ secrets.TEST_HYPERDRIVE_MYSQL_DATABASE_URL}} NODE_OPTIONS: "--max_old_space_size=8192" @@ -71,8 +76,8 @@ jobs: if: steps.changes.outputs.everything_but_markdown == 'true' run: pnpm run test:e2e -F @fixture/get-platform-proxy-remote-bindings env: - TEST_CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - TEST_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} + TEST_CLOUDFLARE_API_TOKEN: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_API_TOKEN || '' }} + TEST_CLOUDFLARE_ACCOUNT_ID: ${{ steps.check-remote.outputs.run-remote == 'true' && secrets.TEST_CLOUDFLARE_ACCOUNT_ID || '' }} NODE_OPTIONS: "--max_old_space_size=8192" CI_OS: ${{ matrix.os }} diff --git a/.github/workflows/rerun-remote-tests.yml b/.github/workflows/rerun-remote-tests.yml new file mode 100644 index 000000000000..402df32485df --- /dev/null +++ b/.github/workflows/rerun-remote-tests.yml @@ -0,0 +1,71 @@ +name: "Rerun Remote Tests" + +# When the "run-remote-tests" label is added to or removed from a PR, re-run +# the E2E workflows so they pick up the label change and pass (or withhold) the +# Cloudflare API token to the test steps. This avoids adding "labeled" as a +# trigger type to every E2E workflow (which would cause wasteful re-runs on +# unrelated label changes). +on: + pull_request: + types: [labeled, unlabeled] + +permissions: {} + +jobs: + rerun-e2e: + name: "Rerun E2E Tests" + if: github.event.label.name == 'run-remote-tests' + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: "Re-run E2E workflows" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + REPO: ${{ github.repository }} + run: | + for workflow in e2e-wrangler.yml e2e-vite.yml c3-e2e.yml; do + run=$(gh api "repos/${REPO}/actions/workflows/${workflow}/runs?head_sha=${HEAD_SHA}&per_page=1" \ + --jq '.workflow_runs[0] | "\(.id) \(.status)"' || true) + + run_id=$(echo "$run" | awk '{print $1}') + status=$(echo "$run" | awk '{print $2}') + + if [ -z "$run_id" ] || [ "$run_id" = "null" ]; then + echo "No run found for ${workflow} at SHA ${HEAD_SHA}" + continue + fi + + # Each E2E workflow has a "check-remote" step that calls + # `gh pr view ... --json labels` at runtime, so a run that + # hasn't started yet will see the newly-added label on its + # own — no need to cancel and re-run it. + if [ "$status" != "completed" ] && [ "$status" != "in_progress" ]; then + echo "${workflow} run ${run_id} is ${status} — not yet started, skipping." + continue + fi + + # If the run is actively executing, the label check has + # already evaluated to false. Cancel it first — the rerun + # endpoint only works on completed runs. + if [ "$status" = "in_progress" ]; then + echo "Cancelling in-progress ${workflow} run ${run_id}..." + gh api "repos/${REPO}/actions/runs/${run_id}/cancel" --method POST || true + + # Cancellation is async; poll until the run reaches "completed". + for i in $(seq 1 30); do + current=$(gh api "repos/${REPO}/actions/runs/${run_id}" --jq '.status') + if [ "$current" = "completed" ]; then + echo "Run ${run_id} is now completed (cancelled)." + break + fi + echo " Waiting for cancellation to finish (${i}/30, status: ${current})..." + sleep 2 + done + fi + + gh api "repos/${REPO}/actions/runs/${run_id}/rerun" --method POST \ + && echo "Re-triggered ${workflow} (run ${run_id})" \ + || echo "Failed to re-run ${workflow} (run ${run_id})" + done diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afd7ce468d2d..b8f696338ed1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -345,6 +345,20 @@ If you need to test the interaction of Wrangler with a real Cloudflare account, A summary of this repositories actions can be found [in the `.github/workflows` folder](.github/workflows/README.md) +## Remote E2E Tests in CI + +E2E tests that hit the Cloudflare backend (deploying Workers, testing bindings, etc.) are inherently slow and can be flaky due to network and service dependencies. To keep PR feedback loops fast and reliable, **CI does not pass Cloudflare API credentials to E2E test jobs by default**. The E2E test suites still run on every PR, but tests that require remote access are automatically skipped when the API token is absent. + +Remote E2E tests run automatically in these cases: + +- **Version Packages PRs** (branch `changeset-release/main`) — acts as a pre-release safety net, catching remote-test failures before packages are published. +- **Merge queue** — final check before code lands on `main`. + +If you need remote E2E tests on your PR (e.g. you're changing deployment logic or binding behavior), apply the **`run-remote-tests`** label. This triggers a re-run of the E2E workflows with API credentials enabled. + +> [!NOTE] +> The `run-remote-tests` label has no effect on PRs from forks, because GitHub does not expose repository secrets to fork PRs. + ## Running E2E tests locally A large number of Wrangler, C3 & Vite's E2E tests don't require any authentication, and can be run with no Cloudflare account credentials. These can be run as follows, optionally providing [`CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` environment variables.](#creating-an-api-token): From 3aae352ed77f0da8b0632d9cbec2d1d6b88d8f9c Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 13 Mar 2026 10:00:53 +0000 Subject: [PATCH 03/13] [vite-plugin] Enable turbo remote caching for playground tests (#12871) --- .github/workflows/vite-plugin-playgrounds.yml | 8 +++++--- packages/vite-plugin-cloudflare/playground/turbo.json | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vite-plugin-playgrounds.yml b/.github/workflows/vite-plugin-playgrounds.yml index bd973038d9bf..64885fb5af66 100644 --- a/.github/workflows/vite-plugin-playgrounds.yml +++ b/.github/workflows/vite-plugin-playgrounds.yml @@ -55,7 +55,7 @@ jobs: - name: Build plugin with initial Vite version if: steps.changes.outputs.everything_but_markdown == 'true' run: | - pnpm turbo build --filter @cloudflare/vite-plugin + pnpm dotenv -- pnpm turbo build --filter @cloudflare/vite-plugin - name: Downgrade to Vite 6 if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.vite == 'vite-6' run: | @@ -69,8 +69,9 @@ jobs: # We use `--only` to prevent TurboRepo from rebuilding dependencies # This ensures the Vite plugin is not rebuilt using a different Vite version run: | - pnpm turbo test:ci:serve --filter @vite-plugin-cloudflare/playground --only + pnpm dotenv -- pnpm turbo test:ci:serve --filter @vite-plugin-cloudflare/playground --only env: + VITE_VERSION: ${{ matrix.vite }} NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html @@ -81,8 +82,9 @@ jobs: # We use `--only` to prevent TurboRepo from rebuilding dependencies # This ensures the Vite plugin is not rebuilt using a different Vite version run: | - pnpm turbo test:ci:build --filter @vite-plugin-cloudflare/playground --only + pnpm dotenv -- pnpm turbo test:ci:build --filter @vite-plugin-cloudflare/playground --only env: + VITE_VERSION: ${{ matrix.vite }} NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html diff --git a/packages/vite-plugin-cloudflare/playground/turbo.json b/packages/vite-plugin-cloudflare/playground/turbo.json index 7a8d3e2d3380..ba55bd3b8749 100644 --- a/packages/vite-plugin-cloudflare/playground/turbo.json +++ b/packages/vite-plugin-cloudflare/playground/turbo.json @@ -7,12 +7,12 @@ }, "test:ci:serve": { "dependsOn": ["build"], - "env": ["NODE_DEBUG"], + "env": ["NODE_DEBUG", "VITE_VERSION"], "outputLogs": "new-only" }, "test:ci:build": { "dependsOn": ["build"], - "env": ["NODE_DEBUG"], + "env": ["NODE_DEBUG", "VITE_VERSION"], "outputLogs": "new-only" } } From 7b0d8f5830e9b317c69abdcd452a79d88811f000 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 13 Mar 2026 10:41:33 +0000 Subject: [PATCH 04/13] Fix unclear error when assets upload session returns a `null` response (#12841) --- .changeset/olive-heads-arrive.md | 7 ++++ .../src/__tests__/deploy/assets.test.ts | 32 +++++++++++++++++++ packages/wrangler/src/assets.ts | 21 ++++++++---- 3 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 .changeset/olive-heads-arrive.md diff --git a/.changeset/olive-heads-arrive.md b/.changeset/olive-heads-arrive.md new file mode 100644 index 000000000000..ea40c96fcb98 --- /dev/null +++ b/.changeset/olive-heads-arrive.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +Fix unclear error when assets upload session returns a `null` response + +When deploying assets, if the Cloudflare API returns a `null` response object, Wrangler now provides a clear error message asking users to retry instead of failing with a confusing error. diff --git a/packages/wrangler/src/__tests__/deploy/assets.test.ts b/packages/wrangler/src/__tests__/deploy/assets.test.ts index e7182c210e8a..c288a88984c6 100644 --- a/packages/wrangler/src/__tests__/deploy/assets.test.ts +++ b/packages/wrangler/src/__tests__/deploy/assets.test.ts @@ -1195,5 +1195,37 @@ describe("deploy", () => { }); await runWrangler("deploy --dispatch-namespace my-namespace"); }); + + it("should error when assets upload session response is null", async () => { + const assets = [{ filePath: "file-1.txt", content: "Content of file-1" }]; + writeAssets(assets); + writeWranglerConfig({ + assets: { directory: "assets" }, + }); + + // Mock the AUS endpoint to return a null result + msw.use( + http.post( + `*/accounts/some-account-id/workers/scripts/test-name/assets-upload-session`, + () => { + return HttpResponse.json( + { + success: true, + errors: [], + messages: [], + result: null, + }, + { status: 201 } + ); + } + ) + ); + + await expect( + runWrangler("deploy") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `[Error: An unexpected response has been received from the Cloudflare API for assets upload. Please try again.]` + ); + }); }); }); diff --git a/packages/wrangler/src/assets.ts b/packages/wrangler/src/assets.ts index a77b218a35cb..f9caeace9d46 100644 --- a/packages/wrangler/src/assets.ts +++ b/packages/wrangler/src/assets.ts @@ -71,15 +71,24 @@ export const syncAssets = async ( // 2. fetch buckets w/ hashes logger.info("🌀 Starting asset upload..."); - const initializeAssetsResponse = await fetchResult( - complianceConfig, - url, - { + const initializeAssetsResponse = + await fetchResult(complianceConfig, url, { headers: { "Content-Type": "application/json" }, method: "POST", body: JSON.stringify({ manifest: manifest }), - } - ); + }); + + // In the past we've seen the endpoint return that incorrectly doesn't contain + // a null response (see: https://github.com/cloudflare/workers-sdk/issues/9465). + // So just to be extra sure here we check the object and provide a clear error message to the user + // if it is falsy. + if (!initializeAssetsResponse) { + throw new FatalError( + "An unexpected response has been received from the Cloudflare API for assets upload. Please try again.", + 1, + { telemetryMessage: true } + ); + } // if nothing to upload, return if (initializeAssetsResponse.buckets.flat().length === 0) { From 077c4d54cbf068aeca86927620332b9aeceec762 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Fri, 13 Mar 2026 11:44:58 +0000 Subject: [PATCH 05/13] fix(create-cloudflare): skip create-vite Install and start now prompt (#12866) --- .changeset/ten-maps-judge.md | 7 +++++++ packages/create-cloudflare/templates/react/pages/c3.ts | 7 ++++++- packages/create-cloudflare/templates/react/workers/c3.ts | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/ten-maps-judge.md diff --git a/.changeset/ten-maps-judge.md b/.changeset/ten-maps-judge.md new file mode 100644 index 000000000000..eba3793ec73b --- /dev/null +++ b/.changeset/ten-maps-judge.md @@ -0,0 +1,7 @@ +--- +"create-cloudflare": patch +--- + +Fix React app creation flow skipping Cloudflare setup + +Creating a React app with create-cloudflare no longer allows the Cloudflare setup step to be skipped by accepting create-vite's `Install and start now` prompt. diff --git a/packages/create-cloudflare/templates/react/pages/c3.ts b/packages/create-cloudflare/templates/react/pages/c3.ts index 1efb4ed8bee5..16d4f39491ca 100644 --- a/packages/create-cloudflare/templates/react/pages/c3.ts +++ b/packages/create-cloudflare/templates/react/pages/c3.ts @@ -10,7 +10,12 @@ const { npm } = detectPackageManager(); const generate = async (ctx: C3Context) => { const variant = await getVariant(ctx); - await runFrameworkGenerator(ctx, [ctx.project.name, "--template", variant]); + await runFrameworkGenerator(ctx, [ + ctx.project.name, + "--template", + variant, + "--no-immediate", + ]); logRaw(""); }; diff --git a/packages/create-cloudflare/templates/react/workers/c3.ts b/packages/create-cloudflare/templates/react/workers/c3.ts index fda371089ff2..2b60b50096e4 100644 --- a/packages/create-cloudflare/templates/react/workers/c3.ts +++ b/packages/create-cloudflare/templates/react/workers/c3.ts @@ -24,6 +24,7 @@ const generate = async (ctx: C3Context) => { ctx.project.name, "--template", variant.value, + "--no-immediate", ]); logRaw(""); From bd079a6de2db6704f13527a7e427dbd8eb61f795 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 13 Mar 2026 12:46:33 +0000 Subject: [PATCH 06/13] [wrangler] Deduplicate unenv-preset e2e tests and bump beforeAll timeout (#12863) --- .../wrangler/e2e/unenv-preset/preset.test.ts | 64 ++++++++++++++++++- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/packages/wrangler/e2e/unenv-preset/preset.test.ts b/packages/wrangler/e2e/unenv-preset/preset.test.ts index e92505aac06b..f250d2e1f684 100644 --- a/packages/wrangler/e2e/unenv-preset/preset.test.ts +++ b/packages/wrangler/e2e/unenv-preset/preset.test.ts @@ -776,9 +776,14 @@ const localTestConfigs: TestConfig[] = [ ], ].flat() as TestConfig[]; -describe.each(localTestConfigs)( +// Many test configs share the same (compatibilityDate, compatibilityFlags) combination +// and therefore produce identical wrangler dev instances. Group them to avoid redundant +// startups and test executions (84 configs → 58 unique wrangler instances). +const groupedLocalConfigs = groupByWranglerConfig(localTestConfigs); + +describe.each(groupedLocalConfigs)( `Local preset test: $name`, - ({ compatibilityDate, compatibilityFlags = [], expectRuntimeFlags = {} }) => { + ({ compatibilityDate, compatibilityFlags, expectRuntimeFlags }) => { let url: string; beforeAll(async () => { @@ -812,7 +817,7 @@ describe.each(localTestConfigs)( } return async () => await wrangler.stop(); - }, 10_000); + }, 30_000); test.for(Object.keys(WorkerdTests))( "%s", @@ -950,6 +955,59 @@ describe.runIf(Boolean(CLOUDFLARE_ACCOUNT_ID))( } ); +type ConfigGroup = { + name: string; + compatibilityDate: string; + compatibilityFlags: string[]; + expectRuntimeFlags: Record; +}; + +/** + * Groups test configs by their effective wrangler configuration + * (compatibilityDate + compatibilityFlags). Configs that would produce + * identical wrangler dev instances are merged into a single group, + * combining their expectRuntimeFlags assertions. + */ +function groupByWranglerConfig(configs: TestConfig[]): ConfigGroup[] { + const groups = new Map(); + + for (const config of configs) { + const flags = config.compatibilityFlags ?? []; + const key = JSON.stringify({ + date: config.compatibilityDate, + flags: [...flags].sort(), + }); + + const existing = groups.get(key); + if (existing) { + existing.name += `, ${config.name}`; + for (const [flag, value] of Object.entries( + config.expectRuntimeFlags ?? {} + )) { + if ( + flag in existing.expectRuntimeFlags && + existing.expectRuntimeFlags[flag] !== value + ) { + throw new Error( + `Conflicting expectRuntimeFlags for "${flag}" in group "${existing.name}": ` + + `existing=${existing.expectRuntimeFlags[flag]}, new=${value} (from "${config.name}")` + ); + } + existing.expectRuntimeFlags[flag] = value; + } + } else { + groups.set(key, { + name: config.name, + compatibilityDate: config.compatibilityDate, + compatibilityFlags: flags, + expectRuntimeFlags: { ...(config.expectRuntimeFlags ?? {}) }, + }); + } + } + + return [...groups.values()]; +} + /** * Collects enabled flags: * - skips "experimental" flag From 85f38a090ee70eecbfda2c7013ac62abf5c82517 Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:51:51 +0000 Subject: [PATCH 07/13] remove direct base-ui dependency and use kumo (#12854) Co-authored-by: Ben <4991309+NuroDev@users.noreply.github.com> --- .../src/assets/icons/cloudflare-logo.svg | 3 - .../local-explorer-ui/src/assets/icons/d1.svg | 3 + .../src/assets/icons/durable-objects.svg | 3 + .../local-explorer-ui/src/assets/icons/kv.svg | 2 +- .../src/components/AddKVForm.tsx | 12 +- .../src/components/Breadcrumbs.tsx | 25 +- .../src/components/CopyButton.tsx | 7 +- .../src/components/KVTable.tsx | 311 ++++++++---------- .../src/components/SearchForm.tsx | 11 +- .../src/components/Sidebar.tsx | 15 +- .../src/components/TableSelect.tsx | 114 +++++++ .../src/routes/d1/$databaseId.tsx | 152 ++------- .../src/routes/do/$className/$objectId.tsx | 130 +------- .../src/routes/do/$className/index.tsx | 55 ++-- .../local-explorer-ui/src/routes/index.tsx | 4 +- .../src/routes/kv/$namespaceId.tsx | 159 ++++----- 16 files changed, 464 insertions(+), 542 deletions(-) delete mode 100644 packages/local-explorer-ui/src/assets/icons/cloudflare-logo.svg create mode 100644 packages/local-explorer-ui/src/assets/icons/d1.svg create mode 100644 packages/local-explorer-ui/src/assets/icons/durable-objects.svg create mode 100644 packages/local-explorer-ui/src/components/TableSelect.tsx diff --git a/packages/local-explorer-ui/src/assets/icons/cloudflare-logo.svg b/packages/local-explorer-ui/src/assets/icons/cloudflare-logo.svg deleted file mode 100644 index 0b12cb4fd606..000000000000 --- a/packages/local-explorer-ui/src/assets/icons/cloudflare-logo.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/local-explorer-ui/src/assets/icons/d1.svg b/packages/local-explorer-ui/src/assets/icons/d1.svg new file mode 100644 index 000000000000..e2340868d450 --- /dev/null +++ b/packages/local-explorer-ui/src/assets/icons/d1.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/local-explorer-ui/src/assets/icons/durable-objects.svg b/packages/local-explorer-ui/src/assets/icons/durable-objects.svg new file mode 100644 index 000000000000..f43a1c394192 --- /dev/null +++ b/packages/local-explorer-ui/src/assets/icons/durable-objects.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/local-explorer-ui/src/assets/icons/kv.svg b/packages/local-explorer-ui/src/assets/icons/kv.svg index 6327cb2e6b9b..563665d38d97 100644 --- a/packages/local-explorer-ui/src/assets/icons/kv.svg +++ b/packages/local-explorer-ui/src/assets/icons/kv.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/local-explorer-ui/src/components/AddKVForm.tsx b/packages/local-explorer-ui/src/components/AddKVForm.tsx index d001158d0349..ea09deae1ab5 100644 --- a/packages/local-explorer-ui/src/components/AddKVForm.tsx +++ b/packages/local-explorer-ui/src/components/AddKVForm.tsx @@ -1,5 +1,4 @@ -import { Button } from "@base-ui/react/button"; -import { cn } from "@cloudflare/kumo"; +import { Button, cn } from "@cloudflare/kumo"; import { useEffect, useState } from "react"; import { validateKey } from "../utils/kv-validation"; @@ -64,7 +63,7 @@ export function AddKVForm({ onAdd, clearSignal = 0 }: AddKVFormProps) {
- - - {title} - + + }> + {title} + - {items.map((item, index) => ( - - - {item} - - ))} + {items.map((item, index) => ( + + + {item} + + ))} + {children}
diff --git a/packages/local-explorer-ui/src/components/CopyButton.tsx b/packages/local-explorer-ui/src/components/CopyButton.tsx index c0e4a4c1f67d..be4865e4cbab 100644 --- a/packages/local-explorer-ui/src/components/CopyButton.tsx +++ b/packages/local-explorer-ui/src/components/CopyButton.tsx @@ -1,5 +1,4 @@ -import { Button } from "@base-ui/react/button"; -import { cn } from "@cloudflare/kumo"; +import { Button, cn } from "@cloudflare/kumo"; import { CheckIcon, CopyIcon } from "@phosphor-icons/react"; import { useState } from "react"; @@ -19,13 +18,15 @@ export function CopyButton({ text }: CopyButtonProps) { return ( diff --git a/packages/local-explorer-ui/src/components/KVTable.tsx b/packages/local-explorer-ui/src/components/KVTable.tsx index 1d530a106aba..3f80da53cc00 100644 --- a/packages/local-explorer-ui/src/components/KVTable.tsx +++ b/packages/local-explorer-ui/src/components/KVTable.tsx @@ -1,6 +1,4 @@ -import { Button } from "@base-ui/react/button"; -import { Menu } from "@base-ui/react/menu"; -import { cn } from "@cloudflare/kumo"; +import { Button, cn, DropdownMenu, Table } from "@cloudflare/kumo"; import { DotsThreeIcon, PencilIcon, TrashIcon } from "@phosphor-icons/react"; import { useState } from "react"; import { validateKey } from "../utils/kv-validation"; @@ -37,35 +35,34 @@ interface ActionMenuProps { function ActionMenu({ onEdit, onDelete }: ActionMenuProps) { return ( - - - - - - - - - - Edit - - - - - Delete - - - - - + + + + + } + /> + + + + Edit + + + + + Delete + + + ); } @@ -142,144 +139,124 @@ export function KVTable({ entries, onSave, onDelete }: KVTableProps) { const isKeyInvalid = editData ? !!validateKey(editData.key) : false; return ( - - - - - - - - - - {entries.map((entry, index) => { - const isEditing = editData?.originalKey === entry.key.name; - const isLast = index === entries.length - 1; - return ( - - -
- Key - - Value -
- {isEditing && editData ? ( -
- - handleKeyChange(e.target.value)} - onKeyDown={handleKeyDown} - disabled={saving} - autoFocus - /> - {editData.keyError && ( - - {editData.keyError} - - )} -
- ) : ( -
- - {entry.key.name} - - -
- )} -
- {isEditing && editData ? ( -
- -