Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/eight-melons-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"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
```
7 changes: 7 additions & 0 deletions .changeset/fix-c3-dashboard-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"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.
7 changes: 7 additions & 0 deletions .changeset/floppy-webs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@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.
14 changes: 14 additions & 0 deletions .changeset/migrate-workers-playground.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@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`).
17 changes: 17 additions & 0 deletions .changeset/quiet-foxes-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"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.
5 changes: 5 additions & 0 deletions .changeset/ten-dancers-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"miniflare": patch
---

Add support for worker connect handler in miniflare
7 changes: 7 additions & 0 deletions .changeset/vpc-hostname-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"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.
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Deploy Pages Previews
name: Deploy Previews

# This workflow is designed to deploy a "preview" version of a Pages project based on PR labels.
# This workflow is designed to deploy a "preview" version of a project based on PR labels.

# Triggers:
# - update to a PR that has one of the `preview:...` labels
#
# Actions:
# - deploy the matching Pages project to Cloudflare.
# - deploy the matching project to Cloudflare.
#
# PR Label | Pages Project
# PR Label | Project
# ---------------------------------------------------------
# preview:chrome-devtools-patches | packages/chrome-devtools-patches
# preview:quick-edit | packages/quick-edit
# preview:workers-playground | packages/workers-playground
# preview:quick-edit | packages/quick-edit
#
# Note: this workflow does not run tests against these packages, only for deploys previews.
# Note: this workflow does not run tests against these packages, only deploys previews.

on:
pull_request:
Expand All @@ -26,11 +25,11 @@ permissions:
pull-requests: write

jobs:
deploy-pages-projects:
deploy-projects:
# Only run this on PRs that are for the "cloudflare" org and not "from" `main`
# - non-Cloudflare PRs will not have the secrets needed
# - PRs "from" main would accidentally do a production deployment
if: github.repository_owner == 'cloudflare' && github.head_ref != 'main' && (contains(github.event.*.labels.*.name, 'preview:chrome-devtools-patches') || contains(github.event.*.labels.*.name, 'preview:quick-edit') || contains(github.event.*.labels.*.name, 'preview:workers-playground'))
if: github.repository_owner == 'cloudflare' && github.head_ref != 'main' && (contains(github.event.*.labels.*.name, 'preview:chrome-devtools-patches') || contains(github.event.*.labels.*.name, 'preview:quick-edit'))
timeout-minutes: 60
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-app-previews
Expand Down Expand Up @@ -69,23 +68,11 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
NODE_OPTIONS: "--max_old_space_size=30000"

- name: Deploy Workers Playground preview
if: contains(github.event.*.labels.*.name, 'preview:workers-playground')
run: |
output=$(pnpm --filter workers-playground run build:testing && pnpm --filter workers-playground run deploy)
echo "Extracting deployed URL from command output"
url=$(echo "$output" | sed -nE 's/.*Take a peek over at (https?:\/\/[^ ]+).*/\1/p')
echo "Extracted URL: $url"
echo "PLAYGROUND_URL=$url" >> $GITHUB_ENV
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
VITE_DEVTOOLS_PREVIEW_URL: ${{ env.VITE_DEVTOOLS_PREVIEW_URL }}

- name: "Comment on PR with Devtools Link"
if: contains(github.event.*.labels.*.name, 'preview:chrome-devtools-patches')
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2
with:
header: ${{ steps.finder.outputs.pr }}
header: chrome-devtools-preview
message: |
The Wrangler DevTools preview is now live. You can access it directly at: ${{ env.VITE_DEVTOOLS_PREVIEW_URL }}/js_app

Expand All @@ -99,16 +86,3 @@ jobs:
- https://devtools.devprod.cloudflare.dev/js_app?theme=systemPreferred&ws=127.0.0.1%3A9229%2Fws&domain=tester&debugger=true
+ https://8afc7d3d.cloudflare-devtools.pages.dev/js_app?theme=systemPreferred&ws=127.0.0.1%3A9229%2Fws&domain=tester&debugger=true
```

- name: "Comment on PR with Combined Link"
if: contains(github.event.*.labels.*.name, 'preview:chrome-devtools-patches') && contains(github.event.*.labels.*.name, 'preview:workers-playground')
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2
with:
header: ${{ steps.finder.outputs.pr }}
append: true
message: |

---

The Workers Playground preview is also now live. The Playground preview embeds the above DevTools preview, so you can see them working together at:
${{ env.PLAYGROUND_URL }}/playground
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,9 @@ Every PR will have an associated pre-release build for all releasable packages w
It's also possible to generate preview builds for the applications in the repository. These aren't generated automatically because they're pretty slow CI jobs, but you can trigger preview builds by adding one of the following labels to your PR:

- `preview:chrome-devtools-patches` for deploying [chrome-devtools-patches](packages/chrome-devtools-patches)
- `preview:workers-playground` for deploying [workers-playground](packages/workers-playground)
- `preview:quick-edit` for deploying [quick-edit](packages/quick-edit)

Once built, you can find the preview link for these applications in the [Deploy Pages Previews](.github/workflows/deploy-pages-previews.yml) action output
Once built, you can find the preview link for these applications in the [Deploy Previews](.github/workflows/deploy-previews.yml) action output

## PR Tests

Expand Down
4 changes: 1 addition & 3 deletions fixtures/get-platform-proxy-remote-bindings/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
"tasks": {
"test:e2e": {
"env": [
"$TURBO_EXTENDS$",
"VITEST",
"NODE_DEBUG",
"MINIFLARE_WORKERD_PATH",
"WRANGLER",
"WRANGLER_IMPORT",
"MINIFLARE_IMPORT",
"CLOUDFLARE_ACCOUNT_ID",
"CLOUDFLARE_API_TOKEN",
"TEST_CLOUDFLARE_ACCOUNT_ID",
"TEST_CLOUDFLARE_API_TOKEN",
"WRANGLER_E2E_TEST_FILE"
Expand Down
2 changes: 0 additions & 2 deletions fixtures/vitest-pool-workers-remote-bindings/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"WRANGLER",
"WRANGLER_IMPORT",
"MINIFLARE_IMPORT",
"CLOUDFLARE_ACCOUNT_ID",
"CLOUDFLARE_API_TOKEN",
"TEST_CLOUDFLARE_ACCOUNT_ID",
"TEST_CLOUDFLARE_API_TOKEN",
"WRANGLER_E2E_TEST_FILE"
Expand Down
2 changes: 0 additions & 2 deletions fixtures/worker-logs/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"WRANGLER",
"WRANGLER_IMPORT",
"MINIFLARE_IMPORT",
"CLOUDFLARE_ACCOUNT_ID",
"CLOUDFLARE_API_TOKEN",
"TEST_CLOUDFLARE_ACCOUNT_ID",
"TEST_CLOUDFLARE_API_TOKEN",
"WRANGLER_E2E_TEST_FILE"
Expand Down
7 changes: 6 additions & 1 deletion lint-turbo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import assert from "assert";
import { execSync } from "child_process";
import { existsSync, readFileSync } from "fs";
import path from "path";
import { parse } from "jsonc-parser";

function readJson(filePath) {
return JSON.parse(readFileSync(filePath, "utf8"));
}

function readJsonc(filePath) {
return parse(readFileSync(filePath, "utf8"));
}

const listResult = execSync(
"pnpm --filter=!@cloudflare/workers-sdk list --recursive --depth -1 --parseable"
);
Expand Down Expand Up @@ -36,7 +41,7 @@ for (const p of paths) {
console.log(pkg.name, "has build script. Checking turbo.json");
let turboConfig;
try {
turboConfig = readJson(path.join(p, "turbo.json"));
turboConfig = readJsonc(path.join(p, "turbo.json"));
} catch {
console.log("Failed to read turbo.json for", pkg.name);
process.exit(1);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"dotenv-cli": "^7.3.0",
"esbuild": "catalog:default",
"esbuild-register": "^3.5.0",
"jsonc-parser": "catalog:default",
"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.2.18",
"tree-kill": "^1.2.2",
Expand Down
11 changes: 2 additions & 9 deletions packages/chrome-devtools-patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,9 @@ Two methods are available for testing updates:

**Preview Builds:**

On any pull request to the repo on GitHub, you can add labels to trigger preview builds of both the DevTools frontend, and the Playground. This is useful because it will allow you to manually test your changes in a live environment, and with one-click.
On any pull request to the repo on GitHub, you can add the `preview:chrome-devtools-patches` label to trigger a preview build of the DevTools frontend. This is useful because it will allow you to manually test your changes in a live environment, and with one-click.

There are two labels you can use:

- `preview:chrome-devtools-patches` - this will trigger the DevTools preview
- `preview:workers-playground` - this will trigger the Playground preview

If you add **both** labels, Playground will embed the DevTools preview, so you can test them together.

Once the previews are built, you will see a comment on the PR with links to the live URLs.
Once the preview is built, you will see a comment on the PR with a link to the live URL.

## Acceptance Criteria

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ function getExperimentalFrameworkTestConfig(
// this test creates an R2 bucket, so it requires a Cloudflare API token
// and needs to be skipped on forks
quarantine: !CLOUDFLARE_API_TOKEN,
timeout: LONG_TIMEOUT,
verifyDeploy: {
route: "/",
expectedText: "Generated by create next app",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-cloudflare/src/__tests__/dialog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe("dialog helpers", () => {

🔍 View Project
Visit: https://example.test.workers.dev
Dash: https://dash.cloudflare.com/?to=/:account/workers/services/view/test-project
Dash: https://dash.cloudflare.com/?to=/:account/workers/services/view/test-project/production

💻 Continue Developing
Deploy again: pnpm run deploy
Expand Down
2 changes: 1 addition & 1 deletion packages/create-cloudflare/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function printWelcomeMessage(
export const printSummary = (ctx: C3Context) => {
// Prepare relevant information
const dashboardUrl = ctx.account
? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}`
? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}/production`
: null;
const relativePath = relative(ctx.originalCWD, ctx.project.path);
const cdCommand = relativePath ? `cd ${relativePath}` : null;
Expand Down
4 changes: 1 addition & 3 deletions packages/create-cloudflare/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"test:e2e": {
"passThroughEnv": ["GITHUB_TOKEN"],
"env": [
"NODE_DEBUG",
"CLOUDFLARE_ACCOUNT_ID",
"CLOUDFLARE_API_TOKEN",
"$TURBO_EXTENDS$",
"E2E_EXPERIMENTAL",
"E2E_TEST_FILTER",
"E2E_TEST_PM",
Expand Down
1 change: 1 addition & 0 deletions packages/miniflare/src/shared/external-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ const PROXY_ENTRYPOINT_HEADER = "X-Miniflare-Proxy-Entrypoint";
const CREATE_PROXY_PROTOTYPE_CLASS_HELPER_SCRIPT = `
const HANDLER_RESERVED_KEYS = new Set([
"alarm",
"connect",
"scheduled",
"self",
"tail",
Expand Down
5 changes: 4 additions & 1 deletion packages/playground-preview-worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ app.get(`${previewDomain}/.update-preview-token`, (c) => {
!(
referer.hostname === "workers.cloudflare.com" ||
referer.hostname === "localhost" ||
referer.hostname.endsWith("workers-playground.pages.dev")
referer.hostname.endsWith(".workers-playground.pages.dev") ||
referer.hostname === "workers-playground.pages.dev" ||
referer.hostname.endsWith(".workers-playground.workers.dev") ||
referer.hostname === "workers-playground.workers.dev"
)
) {
throw new PreviewRequestForbidden();
Expand Down
Loading
Loading