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
8 changes: 8 additions & 0 deletions .changeset/lucky-trains-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@cloudflare/workers-utils": patch
"wrangler": patch
---

Preserve Containers configuration when using `versions` commands

Previously, commands like `wrangler versions upload` would inadvertently disable Containers on associated Durable Object namespaces because the `containers` property was being omitted from the API request body.
15 changes: 15 additions & 0 deletions .changeset/nodejs-compat-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"create-cloudflare": minor
---

Enable `nodejs_compat` by default for new projects

New projects created with C3 will now have the `nodejs_compat` compatibility flag automatically enabled. This makes it easier to get started with Workers, as many npm packages require Node.js compatibility to work correctly.

If you don't want `nodejs_compat` enabled, you can remove it from your `wrangler.json` or `wrangler.toml` configuration file:

```json
{
"compatibility_flags": []
}
```
7 changes: 7 additions & 0 deletions .changeset/red-towns-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/local-explorer-ui": minor
---

Set up local explorer UI with a view for KV namespaces

This is an experimental WIP package.
3 changes: 2 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ 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"
WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/
TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html
Expand Down Expand Up @@ -130,7 +131,7 @@ jobs:
- name: Run Vite plugin E2E tests
if: steps.changes.outputs.everything_but_markdown == 'true'
run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream
timeout-minutes: 15
timeout-minutes: 20
env:
NODE_DEBUG: "vite-plugin:test"
# The remote-binding tests need to connect to Cloudflare
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/opencode-issue-solver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
assess-issue:
runs-on: ubuntu-latest
permissions: {}

steps:
- name: Exit
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ fixtures/redirected-config-worker/build/*
fixtures/redirected-config-worker-with-environments/build/*

packages/vite-plugin-cloudflare/playground/**/*.d.ts

# Generated by TanStack Router
packages/local-explorer-ui/src/routeTree.gen.ts
9 changes: 9 additions & 0 deletions fixtures/d1-read-replication-app/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
9 changes: 9 additions & 0 deletions fixtures/dynamic-worker-loading/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
2 changes: 1 addition & 1 deletion fixtures/import-npm/packages/import-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "../../../../packages/workers-tsconfig",
"undici": "^5.29.0",
"undici": "^7.18.2",
"wrangler": "../../../../packages/wrangler"
}
}
9 changes: 9 additions & 0 deletions fixtures/unbound-durable-object/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
9 changes: 9 additions & 0 deletions fixtures/worker-logs/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
2 changes: 1 addition & 1 deletion fixtures/worker-with-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"cf-typegen": "wrangler types --no-include-runtime",
"deploy": "wrangler deploy",
"start": "wrangler dev",
"start": "X_LOCAL_EXPLORER=true wrangler dev",
"test:ci": "vitest run",
"test:watch": "vitest"
},
Expand Down
154 changes: 154 additions & 0 deletions fixtures/worker-with-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ export default {
await env.KV.put(keyToSet, val);
return new Response("OK");
}
case "/kv/delete": {
const keyToDelete = url.searchParams.get("key") ?? "default";
await env.KV.delete(keyToDelete);
return new Response(`Deleted key ${keyToDelete} from KV`);
}
case "/kv/seed": {
await Promise.all(SEED_DATA.map(([k, v]) => env.KV.put(k, v)));
return new Response(`Seeded ${SEED_DATA.length} KV entries`);
}

// D1 database route
case "/d1": {
Expand Down Expand Up @@ -48,3 +57,148 @@ export class MyDurableObject extends DurableObject<Env> {
return new Response("OK");
}
}
const SEED_DATA: [string, string][] = [
["greeting", "Hello, World!"],
["counter", "42"],
["config:theme", "dark"],
["config:language", "en-US"],
["config:timezone", "America/New_York"],
["config:debug", "false"],
["config:max-retries", "3"],
["feature:dark-mode", "enabled"],
["feature:beta-ui", "disabled"],
["feature:notifications", "enabled"],
["api:rate-limit", "1000"],
["api:timeout-ms", "30000"],
["api:base-url", "https://api.example.com/v1"],
[
"user:1",
JSON.stringify({
id: 1,
name: "Alice",
email: "alice@example.com",
role: "admin",
}),
],
[
"user:2",
JSON.stringify({
id: 2,
name: "Bob",
email: "bob@example.com",
role: "user",
}),
],
[
"user:3",
JSON.stringify({
id: 3,
name: "Charlie",
email: "charlie@example.com",
role: "user",
}),
],
[
"user:4",
JSON.stringify({
id: 4,
name: "Diana",
email: "diana@example.com",
role: "moderator",
}),
],
[
"user:5",
JSON.stringify({
id: 5,
name: "Eve",
email: "eve@example.com",
role: "user",
}),
],
[
"session:abc123",
JSON.stringify({ userId: 1, expiresAt: "2025-12-31T23:59:59Z" }),
],
[
"session:def456",
JSON.stringify({ userId: 2, expiresAt: "2025-06-15T12:00:00Z" }),
],
[
"session:ghi789",
JSON.stringify({ userId: 3, expiresAt: "2025-03-01T08:30:00Z" }),
],
["cache:homepage", "<html><body><h1>Welcome</h1></body></html>"],
["cache:about", "<html><body><h1>About Us</h1></body></html>"],
["cache:contact", "<html><body><h1>Contact</h1></body></html>"],
[
"product:1",
JSON.stringify({ id: 1, name: "Widget", price: 9.99, stock: 150 }),
],
[
"product:2",
JSON.stringify({ id: 2, name: "Gadget", price: 24.99, stock: 75 }),
],
[
"product:3",
JSON.stringify({ id: 3, name: "Gizmo", price: 14.99, stock: 200 }),
],
[
"product:4",
JSON.stringify({ id: 4, name: "Thingamajig", price: 39.99, stock: 30 }),
],
[
"product:5",
JSON.stringify({ id: 5, name: "Doohickey", price: 19.99, stock: 100 }),
],
["stats:visits", "123456"],
["stats:unique-users", "45678"],
["stats:page-views", "987654"],
["stats:bounce-rate", "0.35"],
["stats:avg-session", "4m 32s"],
[
"log:error:1",
JSON.stringify({
level: "error",
message: "Connection timeout",
timestamp: "2025-01-15T10:30:00Z",
}),
],
[
"log:error:2",
JSON.stringify({
level: "error",
message: "Invalid token",
timestamp: "2025-01-15T11:45:00Z",
}),
],
[
"log:warn:1",
JSON.stringify({
level: "warn",
message: "Rate limit approaching",
timestamp: "2025-01-15T12:00:00Z",
}),
],
["queue:pending", "15"],
["queue:processing", "3"],
["queue:completed", "1247"],
["queue:failed", "12"],
["special/key/with/slashes", "value with slashes in key"],
["key with spaces", "value for spaced key"],
["key.with.dots", "dotted key value"],
["UPPERCASE_KEY", "uppercase key value"],
["mixedCase_Key-123", "mixed case key value"],
[
"long-value-example",
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
],
["emoji-key-🔑", "value with emoji in key"],
["empty-value", ""],
["null-value", null],
["boolean-true", "true"],
["boolean-false", "false"],
["number-integer", "42"],
["number-float", "3.14159"],
["number-negative", "-273.15"],
];
9 changes: 9 additions & 0 deletions fixtures/workers-with-assets-only/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
9 changes: 9 additions & 0 deletions fixtures/workers-with-assets-static-routing/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
9 changes: 9 additions & 0 deletions fixtures/workers-with-assets/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
Loading
Loading