From 20f1424c2c490ad786351f04b74baa9e32f1ca8f Mon Sep 17 00:00:00 2001
From: Thejus Rajendran <63202440+thejus-r@users.noreply.github.com>
Date: Fri, 13 Nov 2026 04:06:12 +0530
Subject: [PATCH 01/30] fix(local-explorer-ui): fix tab menu overlap and add
changeset (#16831)
---
.changeset/violet-otters-rhyme.md | 5 +++++
.../src/components/studio/WindowTab/MenuProps.tsx | 13 ++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
create mode 100644 .changeset/violet-otters-rhyme.md
diff --git a/.changeset/violet-otters-rhyme.md b/.changeset/violet-otters-rhyme.md
new file mode 100644
index 0000000000..e919f76999
--- /dev/null
+++ b/.changeset/violet-otters-rhyme.md
@@ -0,0 +1,5 @@
+---
+"@cloudflare/local-explorer-ui": patch
+---
+
+fix: prevent New Query button from wrapping and overlapping tab labels in Studio
diff --git a/packages/local-explorer-ui/src/components/studio/WindowTab/MenuProps.tsx b/packages/local-explorer-ui/src/components/studio/WindowTab/MenuProps.tsx
index 49cb4c4a09..e17ac9292a 100644
--- a/packages/local-explorer-ui/src/components/studio/WindowTab/MenuProps.tsx
+++ b/packages/local-explorer-ui/src/components/studio/WindowTab/MenuProps.tsx
@@ -1,3 +1,4 @@
+import { Button } from "@cloudflare/kumo";
import { PlusIcon } from "@phosphor-icons/react";
import type { JSX } from "react";
@@ -9,12 +10,10 @@ export function StudioWindowTabMenu({
onClick,
}: StudioWindowTabMenuProps): JSX.Element {
return (
-
+
);
}
From 61eacca214a9533f41fac98d732f1cfdd905ddf6 Mon Sep 17 00:00:00 2001
From: Leo Ostera
Date: Fri, 13 Nov 2026 00:33:54 +0000
Subject: [PATCH 02/30] [miniflare] Fix local Artifacts issues found in
customer testing (#16771)
---
.changeset/artifacts-local-emulator-fixes.md | 11 +
.../plugins/artifacts/LOCAL_DEVELOPMENT.md | 6 +-
.../miniflare/src/plugins/artifacts/README.md | 17 +-
.../src/plugins/artifacts/controller.ts | 67 +++-
.../src/plugins/artifacts/git-client.ts | 57 ++-
.../src/plugins/artifacts/git-sidecar.ts | 116 ++++--
.../miniflare/src/plugins/artifacts/index.ts | 46 ++-
.../src/workers/artifacts/binding.worker.ts | 351 +++++++++++++-----
.../artifacts/wrapped-binding.worker.ts | 109 ++++++
.../test/plugins/artifacts/contract.spec.ts | 12 +-
.../test/plugins/artifacts/git-client.spec.ts | 4 +-
.../test/plugins/artifacts/index.spec.ts | 230 +++++++++++-
.../test/plugins/artifacts/lifecycle.spec.ts | 128 ++++++-
.../test/artifacts-errors.test.ts | 42 +++
14 files changed, 1019 insertions(+), 177 deletions(-)
create mode 100644 .changeset/artifacts-local-emulator-fixes.md
create mode 100644 packages/miniflare/src/workers/artifacts/wrapped-binding.worker.ts
create mode 100644 packages/vitest-plugin/test/artifacts-errors.test.ts
diff --git a/.changeset/artifacts-local-emulator-fixes.md b/.changeset/artifacts-local-emulator-fixes.md
new file mode 100644
index 0000000000..ccaf099db0
--- /dev/null
+++ b/.changeset/artifacts-local-emulator-fixes.md
@@ -0,0 +1,11 @@
+---
+"miniflare": patch
+---
+
+Fix several local Artifacts emulator issues found while testing it as a customer
+
+- The local Git remote keeps its port across dev server restarts, so existing clones keep working, and Wrangler prints each namespace's Git remote prefix at startup. If another process holds the port, a new one is chosen and printed.
+- Workers Vitest no longer logs a caught `ArtifactsError` as an uncaught exception. Local bindings now throw errors in the caller's isolate, so they never cross a workerd RPC boundary.
+- A push containing a file larger than 32 MiB is rejected, as in production, and a file at that limit can still be read. Reading a larger file throws `ArtifactsError` with code `MEMORY_LIMIT` instead of a raw RPC serialization error.
+- `listTokens()` includes revoked and expired tokens with `state: "revoked"` or `state: "expired"`, listed after all active tokens. An expired token can no longer be revoked: `revokeToken()` returns `false` and its state stays `"expired"`.
+- Results now follow the published binding types: `list()` items have no `remote`, `log()` caps `limit` at 1000 instead of rejecting it, and `readTree()` and `readCommit()` throw `INTERNAL_ERROR` for an object of another type instead of returning `null`.
diff --git a/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md b/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md
index 5ccd67c3c0..af2ff654c5 100644
--- a/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md
+++ b/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md
@@ -71,7 +71,7 @@ GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=http.extraHeader \
unset REPO_TOKEN
```
-After pushing `hello.txt` to `main`, read it in the Worker with `await repo.readFile({ ref: "main", path: "hello.txt" })` (a `Blob`, or `null` when absent). The initial create token permits writes. Its plaintext is returned only once; if you lose it, use `repo.createToken("read")` for cloning or `repo.createToken("write")` for pushing and save the returned `plaintext` securely. Revoke tokens that are no longer needed. Avoid printing tokens or committing them to config. A plain request without a token cannot clone a private local repository. Git's URL uses an ephemeral loopback port; obtain the current URL after restarting the dev server instead of hardcoding it.
+After pushing `hello.txt` to `main`, read it in the Worker with `await repo.readFile({ ref: "main", path: "hello.txt" })` (a `Blob`, or `null` when absent). The initial create token permits writes. Its plaintext is returned only once; if you lose it, use `repo.createToken("read")` for cloning or `repo.createToken("write")` for pushing and save the returned `plaintext` securely. Revoke tokens that are no longer needed. Avoid printing tokens or committing them to config. A plain request without a token cannot clone a private local repository. The dev tool prints the Git remote prefix for each namespace at startup. Its loopback port is recorded with the persisted state, so clones keep working across restarts; if another process has taken that port, a new one is chosen and printed, and `info()` returns the new URL.
## Storage and network boundaries
@@ -86,5 +86,7 @@ A local binding does not contact Cloudflare for repository operations. **Explici
- If startup says local Artifacts requires Git, install Git globally, check `git --version` in the dev tool's environment, and restart the tool with `git` on PATH.
- If Git asks for a username and password, use any username and the repository token as the password. If Git reports unauthorized, check the repository, scope, expiry, and revocation; do not use a Cloudflare or GitHub account password.
- If startup reports `Address already in use`, the dev or inspector port may be occupied. Pass `--port=0 --inspector-port=0` and use the printed `Ready on` URL.
-- If a Git URL stops responding after restart, get the new `remote` from the binding; the loopback listener is tied to the dev process.
+- If a Git URL stops responding after restart, another process probably holds its port. Get the new `remote` from the binding or the startup log, and update your clone with `git remote set-url origin `.
+- As in production, a push that contains a file larger than 32 MiB is rejected, and reading such a file throws an `ArtifactsError` with code `MEMORY_LIMIT`.
+- `listTokens()` lists active tokens first, then revoked and expired tokens with their `state`. Each repository keeps its 100 most recent inactive tokens. `revokeToken()` returns `false` for an expired token.
- Local development is not a replica of production placement or infrastructure. The local Git endpoint is HTTP on loopback only, and local state and tokens do not transfer to a remote namespace.
diff --git a/packages/miniflare/src/plugins/artifacts/README.md b/packages/miniflare/src/plugins/artifacts/README.md
index 0475cc6788..b1ebe36ddd 100644
--- a/packages/miniflare/src/plugins/artifacts/README.md
+++ b/packages/miniflare/src/plugins/artifacts/README.md
@@ -30,7 +30,7 @@ sequenceDiagram
Dev->>MF: Configure Artifacts binding
MF->>Plugin: getBindings()
Plugin->>Plugin: Select local and validate namespace
- Plugin-->>MF: Bind to local namespace entrypoint
+ Plugin-->>MF: Wrapped binding around the local namespace entrypoint
MF->>Plugin: getServices()
Plugin->>Plugin: Verify host Git is available on PATH
Plugin->>Controller: get(Git storage path)
@@ -41,10 +41,18 @@ sequenceDiagram
MF->>Workerd: Start configured services and socket
```
-`getBindings()` routes each local binding to a namespace-scoped service.
+`getBindings()` routes each local binding to a namespace-scoped service through
+a wrapped binding (`wrapped-binding.worker.ts`) that runs in the caller's
+isolate. The binding Worker and Durable Object return `{ ok, value | error }`
+outcomes, and the wrapper throws `ArtifactsError` there: an exception thrown
+across a workerd RPC boundary is logged as uncaught under `--verbose`, which
+Workers Vitest enables, even when the caller catches it.
`getServices()` creates the binding Worker, namespace Durable Object, persistent
metadata disk, internal Git backend service, and Git socket. The controller
reuses a sidecar per Git storage path and closes it when Miniflare is disposed.
+It records the Git socket's port in `git-port` next to the namespace's storage
+and reuses it on the next start while it is free, so clones keep their
+`origin`.
The socket used by Git clients and the sidecar's private HTTP listener are
**different endpoints**. If the sidecar exits after startup, the controller
forgets its endpoint and warns; an explicit Miniflare configuration reload
@@ -141,7 +149,10 @@ secret; the client's `Authorization` header is removed before that hop. For a
successful push, the Durable Object refreshes repository metadata before
returning the response. The sidecar uses native `git http-backend` for Git smart
HTTP rather than reproducing Git's pack protocol. All native Git commands
-(including the HTTP backend) override repository-local hook configuration.
+override repository-local hook configuration. The HTTP backend instead points
+`core.hooksPath` at a private directory with one `pre-receive` hook, which
+rejects pushes containing a blob over the 32 MiB per-file limit; reads of a
+larger blob written outside the binding fail with `MEMORY_LIMIT`.
A failed deletion leaves an inaccessible, persisted tombstone, so retrying
`delete()` or creating the same name can finish native Git cleanup even after a
process restart.
diff --git a/packages/miniflare/src/plugins/artifacts/controller.ts b/packages/miniflare/src/plugins/artifacts/controller.ts
index 0b1b75050b..cf28ebe01e 100644
--- a/packages/miniflare/src/plugins/artifacts/controller.ts
+++ b/packages/miniflare/src/plugins/artifacts/controller.ts
@@ -1,3 +1,5 @@
+import { mkdir, readFile, writeFile } from "node:fs/promises";
+import { createServer } from "node:net";
import path from "node:path";
import { Worker } from "node:worker_threads";
import getPort from "get-port";
@@ -9,6 +11,11 @@ export interface LocalArtifactsBackend {
port: number;
}
+export interface LocalArtifactsBackendOptions {
+ namespace?: string;
+ portFile?: string;
+}
+
// Node binding proxies make synchronous calls. The Git backend must run on
// another thread, otherwise those calls prevent it from answering workerd.
export class ArtifactsController {
@@ -17,7 +24,7 @@ export class ArtifactsController {
#activeRoots = new Set();
#pendingRoots?: Set;
- constructor(private readonly getLog?: () => Pick) {}
+ constructor(private readonly getLog?: () => Pick) {}
beginUpdate(): void {
if (this.#pendingRoots) {
@@ -44,7 +51,15 @@ export class ArtifactsController {
await this.#closeExcept(this.#activeRoots);
}
- get(root: string): Promise {
+ /**
+ * @param root Git storage directory for one namespace.
+ * @param options.namespace Prints the namespace's Git remote prefix.
+ * @param options.portFile Reuses the Git port recorded here, if it's free.
+ */
+ get(
+ root: string,
+ options: LocalArtifactsBackendOptions = {}
+ ): Promise {
root = path.resolve(root);
if (!this.#pendingRoots) {
throw new Error("Artifacts backend requested outside runtime update");
@@ -52,7 +67,7 @@ export class ArtifactsController {
this.#pendingRoots.add(root);
let backend = this.#backends.get(root);
if (!backend) {
- backend = this.#start(root, () => {
+ backend = this.#start(root, options, () => {
if (this.#backends.get(root) === backend) {
this.#backends.delete(root);
}
@@ -69,9 +84,15 @@ export class ArtifactsController {
async #start(
root: string,
+ { namespace, portFile }: LocalArtifactsBackendOptions,
onExit: () => void
): Promise {
- const port = await getPort({ host: "127.0.0.1" });
+ const port = await reserveGitPort(portFile);
+ if (namespace !== undefined) {
+ this.getLog?.().info(
+ `Local Artifacts Git remotes for namespace "${namespace}": http://127.0.0.1:${port}/git/${namespace}/.git`
+ );
+ }
// __dirname is dist/src in the bundled Miniflare entry point.
const worker = new Worker(
path.join(__dirname, "plugins/artifacts/git-sidecar.js"),
@@ -148,6 +169,44 @@ export class ArtifactsController {
}
}
+/**
+ * Clones keep their `origin` URL, so reuse the port this storage directory had
+ * last time. Fall back to any free port if another process now holds it.
+ */
+async function reserveGitPort(portFile: string | undefined): Promise {
+ if (portFile === undefined) {
+ return getPort({ host: "127.0.0.1" });
+ }
+ const previous = Number.parseInt(
+ await readFile(portFile, "utf8").catch(() => ""),
+ 10
+ );
+ // get-port refuses ports it returned in this process during the last
+ // 15 seconds, which would move the port when Vite restarts its server.
+ const port =
+ Number.isInteger(previous) &&
+ previous > 0 &&
+ previous < 65536 &&
+ (await isLoopbackPortFree(previous))
+ ? previous
+ : await getPort({ host: "127.0.0.1" });
+ if (port !== previous) {
+ await mkdir(path.dirname(portFile), { recursive: true });
+ await writeFile(portFile, `${port}\n`);
+ }
+ return port;
+}
+
+function isLoopbackPortFree(port: number): Promise {
+ return new Promise((resolve) => {
+ const server = createServer();
+ server.once("error", () => resolve(false));
+ server.listen({ host: "127.0.0.1", port, exclusive: true }, () => {
+ server.close(() => resolve(true));
+ });
+ });
+}
+
type SidecarStartupMessage =
| Pick
| { error: string };
diff --git a/packages/miniflare/src/plugins/artifacts/git-client.ts b/packages/miniflare/src/plugins/artifacts/git-client.ts
index a87871b001..c86ee6f4bf 100644
--- a/packages/miniflare/src/plugins/artifacts/git-client.ts
+++ b/packages/miniflare/src/plugins/artifacts/git-client.ts
@@ -237,6 +237,19 @@ export interface GitTreeEntry {
type GitObjectType = "blob" | "tree" | "commit" | "tag";
+/**
+ * Artifacts' documented per-file limit (32 MiB). Larger blobs cannot be
+ * pushed, and reading one reports `MEMORY_LIMIT`.
+ */
+export const MAX_BLOB_BYTES = 32 * 1024 * 1024;
+
+/** A Git object too large to return through the binding (`MEMORY_LIMIT`). */
+export class GitObjectTooLargeError extends Error {
+ constructor(hash: string) {
+ super(`Git object ${hash} exceeds the ${MAX_BLOB_BYTES} byte limit`);
+ }
+}
+
export class LocalRepositoryStorageError extends Error {
constructor(
readonly kind: "creation-lock" | "on-disk-conflict",
@@ -474,12 +487,11 @@ export class GitClient {
if ((await this.objectType(hash)) !== "blob") {
return null;
}
- const object = await this.git(["cat-file", "blob", hash]);
- return { data: Buffer.from(object.stdout).toString("base64") };
+ return this.readBlobData(hash);
}
async readTree(hash: string): Promise {
- if ((await this.objectType(hash)) !== "tree") {
+ if (!(await this.expectObjectType(hash, "tree"))) {
return null;
}
const tree = await this.git(["ls-tree", "-z", hash]);
@@ -503,7 +515,7 @@ export class GitClient {
}
async readCommit(hash: string): Promise {
- if ((await this.objectType(hash)) !== "commit") {
+ if (!(await this.expectObjectType(hash, "commit"))) {
return null;
}
const object = await this.git(["cat-file", "commit", hash]);
@@ -533,12 +545,37 @@ export class GitClient {
return null;
}
// Read the matched object, not a revision expression built from a path.
- const object = await this.git(["cat-file", "blob", match[2]], {
- allowFailure: true,
- });
- return object.status === 0
- ? { data: Buffer.from(object.stdout).toString("base64") }
- : null;
+ if ((await this.objectType(match[2])) !== "blob") {
+ return null;
+ }
+ return this.readBlobData(match[2]);
+ }
+
+ private async readBlobData(hash: string): Promise<{ data: string }> {
+ const size = await this.git(["cat-file", "-s", hash]);
+ if (Number(decoder.decode(size.stdout).trim()) > MAX_BLOB_BYTES) {
+ throw new GitObjectTooLargeError(hash);
+ }
+ const object = await this.git(["cat-file", "blob", hash]);
+ return { data: Buffer.from(object.stdout).toString("base64") };
+ }
+
+ /**
+ * `null` for a missing object. An object of another type is an error, as
+ * the public `readTree()` and `readCommit()` contracts require.
+ */
+ private async expectObjectType(
+ hash: string,
+ expected: GitObjectType
+ ): Promise {
+ const type = await this.objectType(hash);
+ if (type === null) {
+ return false;
+ }
+ if (type !== expected) {
+ throw new Error(`Git object ${hash} is a ${type}, not a ${expected}`);
+ }
+ return true;
}
async log(ref?: string, limit = 50, offset = 0): Promise {
diff --git a/packages/miniflare/src/plugins/artifacts/git-sidecar.ts b/packages/miniflare/src/plugins/artifacts/git-sidecar.ts
index c019608754..c0cd70dcbd 100644
--- a/packages/miniflare/src/plugins/artifacts/git-sidecar.ts
+++ b/packages/miniflare/src/plugins/artifacts/git-sidecar.ts
@@ -1,12 +1,21 @@
import { Buffer } from "node:buffer";
import { spawn } from "node:child_process";
import { randomBytes } from "node:crypto";
-import { mkdir, mkdtemp, readdir, rename, stat } from "node:fs/promises";
+import {
+ chmod,
+ mkdir,
+ mkdtemp,
+ readdir,
+ rename,
+ stat,
+ writeFile,
+} from "node:fs/promises";
import {
createServer,
type IncomingMessage,
type ServerResponse,
} from "node:http";
+import { tmpdir } from "node:os";
import path from "node:path";
import { Transform } from "node:stream";
import { parentPort, workerData } from "node:worker_threads";
@@ -15,7 +24,8 @@ import { z } from "zod";
import {
assertGitAvailable,
GitClient,
- gitArgumentsWithoutHooks,
+ GitObjectTooLargeError,
+ MAX_BLOB_BYTES,
gitEnvironment,
LocalRepositoryStorageError,
stopGitProcess,
@@ -128,6 +138,32 @@ type ForkRequest = Extract;
type ImportRequest = Extract;
type NewRepositoryRequest = CreateRequest | ForkRequest | ImportRequest;
+// Native Git has no per-file push limit, so a trusted hook enforces the
+// Artifacts one. `--not --all` checks only objects new to this repository.
+const PRE_RECEIVE_HOOK = `#!/bin/sh
+# Installed by Miniflare's local Artifacts simulator.
+zero=0000000000000000000000000000000000000000
+while read -r old new ref; do
+ [ "$new" = "$zero" ] && continue
+ large=$(git rev-list --objects --filter=blob:limit=${MAX_BLOB_BYTES + 1} --filter-print-omitted "$new" --not --all | sed -n 's/^~//p' | head -n 1)
+ if [ -n "$large" ]; then
+ echo "Artifacts does not accept files larger than 32 MiB ($ref contains blob $large)." >&2
+ exit 1
+ fi
+done
+`;
+
+/** Hooks for http-backend only. Repository-local hooks never run. */
+async function createPushHooks(): Promise {
+ const hooks = await mkdtemp(
+ path.join(tmpdir(), "miniflare-artifacts-hooks-")
+ );
+ const hook = path.join(hooks, "pre-receive");
+ await writeFile(hook, PRE_RECEIVE_HOOK);
+ await chmod(hook, 0o755);
+ return hooks;
+}
+
function createGitSecret(): string {
return randomBytes(32).toString("hex");
}
@@ -138,6 +174,21 @@ export async function startGitSidecar(root: string): Promise {
await assertGitAvailable();
await cleanupInterruptedRepositories(root);
const secret = createGitSecret();
+ const hooks = await createPushHooks();
+ try {
+ return await startGitServer(root, hooks, secret);
+ } catch (error) {
+ // close() removes the hooks; a failed start never returns a sidecar.
+ await removeDir(hooks);
+ throw error;
+ }
+}
+
+async function startGitServer(
+ root: string,
+ hooks: string,
+ secret: string
+): Promise {
const shutdown = new AbortController();
const repositoryLocks: RepositoryLocks = new Map();
const inFlight = new Map();
@@ -148,6 +199,7 @@ export async function startGitSidecar(root: string): Promise {
}
void handleRequest(
root,
+ hooks,
repositoryLocks,
inFlight,
request,
@@ -158,11 +210,15 @@ export async function startGitSidecar(root: string): Promise {
response.destroy(error instanceof Error ? error : undefined);
} else {
const storageError = error instanceof LocalRepositoryStorageError;
- response.writeHead(storageError ? 409 : 500, {
+ const tooLarge = error instanceof GitObjectTooLargeError;
+ response.writeHead(storageError ? 409 : tooLarge ? 413 : 500, {
"Content-Type": "text/plain",
...(storageError
? { "X-Local-Artifacts-Storage-Error": error.kind }
: {}),
+ ...(tooLarge
+ ? { "X-Local-Artifacts-Object-Error": "memory-limit" }
+ : {}),
});
response.end(
error instanceof Error ? error.message : "Native Git backend failed"
@@ -188,12 +244,13 @@ export async function startGitSidecar(root: string): Promise {
return {
address,
secret,
- close() {
+ async close() {
shutdown.abort();
server.closeAllConnections();
- return new Promise((resolve, reject) => {
+ await new Promise((resolve, reject) => {
server.close((error) => (error ? reject(error) : resolve()));
});
+ await removeDir(hooks);
},
};
}
@@ -218,6 +275,7 @@ function parseGitPath(pathname: string): {
// packfiles on node:http rather than buffering them through a Worker router.
async function handleRequest(
root: string,
+ hooks: string,
locks: RepositoryLocks,
inFlight: Map,
request: IncomingMessage,
@@ -257,6 +315,7 @@ async function handleRequest(
try {
await runGitHttpBackend(
root,
+ hooks,
request,
response,
`/${repositoryDirectory(namespace, repository)}${suffix}`,
@@ -510,6 +569,7 @@ function parseGitBackendHeaders(headerBytes: Buffer): {
async function runGitHttpBackend(
root: string,
+ hooks: string,
request: IncomingMessage,
response: ServerResponse,
pathInfo: string,
@@ -518,27 +578,31 @@ async function runGitHttpBackend(
signal?: AbortSignal
): Promise {
return new Promise((resolve, reject) => {
- const child = spawn("git", gitArgumentsWithoutHooks(["http-backend"]), {
- env: {
- ...gitEnvironment(),
- GIT_PROJECT_ROOT: root,
- GIT_HTTP_EXPORT_ALL: "1",
- PATH_INFO: pathInfo,
- QUERY_STRING: query,
- REQUEST_METHOD: request.method ?? "GET",
- CONTENT_TYPE: request.headers["content-type"] ?? "",
- CONTENT_LENGTH: request.headers["content-length"] ?? "",
- HTTP_CONTENT_ENCODING: String(
- request.headers["content-encoding"] ?? ""
- ),
- HTTP_GIT_PROTOCOL: String(request.headers["git-protocol"] ?? ""),
- REMOTE_USER: "local-artifacts",
- REMOTE_ADDR: request.socket.remoteAddress ?? "127.0.0.1",
- },
- stdio: ["pipe", "pipe", "pipe"],
- detached: process.platform !== "win32",
- signal,
- });
+ const child = spawn(
+ "git",
+ ["-c", `core.hooksPath=${hooks}`, "http-backend"],
+ {
+ env: {
+ ...gitEnvironment(),
+ GIT_PROJECT_ROOT: root,
+ GIT_HTTP_EXPORT_ALL: "1",
+ PATH_INFO: pathInfo,
+ QUERY_STRING: query,
+ REQUEST_METHOD: request.method ?? "GET",
+ CONTENT_TYPE: request.headers["content-type"] ?? "",
+ CONTENT_LENGTH: request.headers["content-length"] ?? "",
+ HTTP_CONTENT_ENCODING: String(
+ request.headers["content-encoding"] ?? ""
+ ),
+ HTTP_GIT_PROTOCOL: String(request.headers["git-protocol"] ?? ""),
+ REMOTE_USER: "local-artifacts",
+ REMOTE_ADDR: request.socket.remoteAddress ?? "127.0.0.1",
+ },
+ stdio: ["pipe", "pipe", "pipe"],
+ detached: process.platform !== "win32",
+ signal,
+ }
+ );
const stop = () => stopGitProcess(child);
if (signal?.aborted) {
stop();
diff --git a/packages/miniflare/src/plugins/artifacts/index.ts b/packages/miniflare/src/plugins/artifacts/index.ts
index 7519f5ba05..ab50a8fc19 100644
--- a/packages/miniflare/src/plugins/artifacts/index.ts
+++ b/packages/miniflare/src/plugins/artifacts/index.ts
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
import { mkdir } from "node:fs/promises";
import path from "node:path";
import SCRIPT from "worker:artifacts/binding";
+import SCRIPT_WRAPPED_BINDING from "worker:artifacts/wrapped-binding";
import {
buildRemoteProxyProps,
getEnvBindingsOfType,
@@ -16,13 +17,18 @@ import type { Service, Socket } from "../../runtime";
import type { MiniflareBinding, ParsedDevConfig, Plugin } from "../shared";
import type { ArtifactsController } from "./controller";
-export { ArtifactsController, type LocalArtifactsBackend } from "./controller";
+export {
+ ArtifactsController,
+ type LocalArtifactsBackend,
+ type LocalArtifactsBackendOptions,
+} from "./controller";
export type { GitSidecar } from "./git-sidecar";
export const ARTIFACTS_PLUGIN_NAME = "artifacts";
const ARTIFACTS_REMOTE_SERVICE_NAME = `${ARTIFACTS_PLUGIN_NAME}:remote`;
const ENTRYPOINT = "LocalArtifactsNamespace";
const OBJECT_CLASS = "LocalArtifactsNamespaceObject";
+const WRAPPED_BINDING_MODULE = `${ARTIFACTS_PLUGIN_NAME}:local-binding`;
const LOCAL_NAMESPACE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
type ArtifactsBinding = Extract;
@@ -73,9 +79,17 @@ export const ARTIFACTS_PLUGIN: Plugin = {
validateLocalNamespace(binding.namespace);
return {
name,
- service: {
- name: localServiceName(binding.namespace),
- entrypoint: ENTRYPOINT,
+ wrapped: {
+ moduleName: WRAPPED_BINDING_MODULE,
+ innerBindings: [
+ {
+ name: "namespace",
+ service: {
+ name: localServiceName(binding.namespace),
+ entrypoint: ENTRYPOINT,
+ },
+ },
+ ],
},
};
}
@@ -132,6 +146,27 @@ export const ARTIFACTS_PLUGIN: Plugin = {
}
return { services, extensions: [], sockets };
},
+ getExtensions({ options }) {
+ const hasLocalBinding = options.some((worker) =>
+ getEnvBindingsOfType(worker.config, "artifacts").some(
+ ([, binding]) => !getRemoteProxyConnectionString(binding, worker.dev)
+ )
+ );
+ if (!hasLocalBinding) {
+ return [];
+ }
+ return [
+ {
+ modules: [
+ {
+ name: WRAPPED_BINDING_MODULE,
+ esModule: SCRIPT_WRAPPED_BINDING(),
+ internal: true,
+ },
+ ],
+ },
+ ];
+ },
};
async function createLocalNamespaceRuntime(
@@ -146,7 +181,8 @@ async function createLocalNamespaceRuntime(
await mkdir(metadataPath, { recursive: true });
await assertSupportedGitLayout(metadataPath);
const { sidecar, port } = await artifactsController.get(
- path.join(persistPath, "git")
+ path.join(persistPath, "git"),
+ { namespace, portFile: path.join(persistPath, "git-port") }
);
const serviceName = localServiceName(namespace);
const storageName = `${serviceName}-storage`;
diff --git a/packages/miniflare/src/workers/artifacts/binding.worker.ts b/packages/miniflare/src/workers/artifacts/binding.worker.ts
index 2361e67386..7809d5a66f 100644
--- a/packages/miniflare/src/workers/artifacts/binding.worker.ts
+++ b/packages/miniflare/src/workers/artifacts/binding.worker.ts
@@ -1,6 +1,7 @@
import { DurableObject, WorkerEntrypoint } from "cloudflare:workers";
const repoName = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
+const MAX_LOG_LIMIT = 1000;
type TokenScope = "read" | "write";
@@ -95,7 +96,10 @@ interface RepositoryListOptions {
type RepositoryListResult = {
repos: Array<
- RepositoryMetadata & { status: "ready"; jurisdiction: "unrestricted" }
+ Omit & {
+ status: "ready";
+ jurisdiction: "unrestricted";
+ }
>;
total: number;
cursor?: string;
@@ -148,23 +152,49 @@ interface CommitMetadata {
committedAt: number;
}
+/** Repository handle as sent over RPC; the wrapped binding unwraps each outcome. */
interface LocalArtifactsRepo {
- info(): Promise;
- createToken(scope?: TokenScope, ttl?: number): Promise;
- listTokens(): Promise<{ total: number; tokens: TokenInfo[] }>;
- revokeToken(tokenOrId: string): Promise;
- readBlob(hash: string): Promise;
- readTree(hash: string): Promise;
- readCommit(hash: string): Promise;
- readFile(args: { ref: string; path: string }): Promise;
- log(options?: RepositoryLogOptions): Promise;
- fork(name: string, options?: ForkOptions): Promise;
+ info(): Promise>;
+ createToken(
+ scope?: TokenScope,
+ ttl?: number
+ ): Promise>;
+ listTokens(): Promise>;
+ revokeToken(tokenOrId: string): Promise>;
+ readBlob(hash: string): Promise>;
+ readTree(hash: string): Promise>;
+ readCommit(hash: string): Promise>;
+ readFile(args: {
+ ref: string;
+ path: string;
+ }): Promise>;
+ log(options?: RepositoryLogOptions): Promise>;
+ fork(
+ name: string,
+ options?: ForkOptions
+ ): Promise>;
}
interface BackendBlob {
data: string;
}
+/**
+ * File contents as sent over RPC. A `Blob` is serialized whole, and workerd
+ * caps a serialized RPC value at 32 MiB, so a file at Artifacts' 32 MiB limit
+ * would not fit. A stream is not subject to that cap; the wrapped binding turns
+ * it back into a `Blob` in the caller's isolate.
+ */
+export interface RepoFile {
+ body: ReadableStream;
+ /** The `Blob` type; empty for `readBlob()`, as for a typeless `Blob`. */
+ type: string;
+}
+
+function repoFile(bytes: Uint8Array, type = ""): RepoFile {
+ return { body: new Blob([bytes]).stream(), type };
+}
+
type ArtifactsErrorCode =
| "ALREADY_EXISTS"
| "NOT_FOUND"
@@ -202,6 +232,19 @@ class ArtifactsError extends Error {
}
}
+/**
+ * Exceptions that cross a workerd RPC boundary are logged as uncaught when
+ * workerd runs with `--verbose`, as Workers Vitest does by default. Every RPC
+ * method here returns an outcome instead, and the wrapped binding in
+ * `wrapped-binding.worker.ts` rethrows failures inside the caller's isolate.
+ */
+export type Outcome =
+ | { ok: true; value: T }
+ | {
+ ok: false;
+ error: { code: ArtifactsErrorCode; numericCode: number; message: string };
+ };
+
interface LocalArtifactsEnvironment {
config: { namespace: string; origin: string };
localArtifactsNamespace: DurableObjectNamespace;
@@ -214,29 +257,33 @@ export class LocalArtifactsNamespace extends WorkerEntrypoint {
- return publicCall(() => this.#namespace().create(name, options));
+ ): Promise> {
+ return forward(() => this.#namespace().create(name, options));
}
- async get(name: string): Promise {
- const repository = await publicCall(() => this.#namespace().get(name));
- return repository as unknown as LocalArtifactsRepo;
+ async get(name: string): Promise> {
+ return forward(
+ () =>
+ this.#namespace().get(name) as unknown as Promise<
+ Outcome
+ >
+ );
}
async import(
options: ImportRepositoryOptions
- ): Promise {
- return publicCall(() => this.#namespace().import(options));
+ ): Promise> {
+ return forward(() => this.#namespace().import(options));
}
async list(
options: RepositoryListOptions = {}
- ): Promise {
- return publicCall(() => this.#namespace().list(options));
+ ): Promise> {
+ return forward(() => this.#namespace().list(options));
}
- async delete(name: string): Promise {
- return publicCall(() => this.#namespace().delete(name));
+ async delete(name: string): Promise> {
+ return forward(() => this.#namespace().delete(name));
}
override async fetch(request: Request): Promise {
@@ -259,6 +306,37 @@ export class LocalArtifactsNamespaceObject extends DurableObject> {
+ return outcome(() => this.#create(name, options));
+ }
+
+ async get(name: string): Promise> {
+ return outcome(async () => {
+ validateName(name);
+ const repository = await this.getRepo(name);
+ return createRepoHandle(this, repository.name, repository.id);
+ });
+ }
+
+ async import(
+ options: ImportRepositoryOptions
+ ): Promise> {
+ return outcome(() => this.#import(options));
+ }
+
+ async list(
+ options: RepositoryListOptions = {}
+ ): Promise> {
+ return outcome(() => this.#list(options));
+ }
+
+ async delete(name: string): Promise> {
+ return outcome(() => this.#delete(name));
+ }
+
+ #create(
+ name: string,
+ options: RepositoryOptions
): Promise {
return this.exclusive(async () => {
validateName(name);
@@ -308,15 +386,7 @@ export class LocalArtifactsNamespaceObject extends DurableObject {
- validateName(name);
- const repository = await this.getRepo(name);
- return createRepoHandle(this, repository.name, repository.id);
- }
-
- async import(
- options: ImportRepositoryOptions
- ): Promise {
+ #import(options: ImportRepositoryOptions): Promise {
return this.exclusive(async () => {
const { source, target, sourceUrl } = parseImportRequest(options);
const repositories = await this.repos();
@@ -365,9 +435,7 @@ export class LocalArtifactsNamespaceObject extends DurableObject {
+ async #list(options: RepositoryListOptions): Promise {
const limit = options.limit ?? 50;
if (!Number.isInteger(limit) || limit < 1 || limit > 200) {
throw new ArtifactsError(
@@ -381,12 +449,16 @@ export class LocalArtifactsNamespaceObject extends DurableObject right.createdAt.localeCompare(left.createdAt));
const page = repositories
.slice(offset, offset + limit)
- .map((repository) => ({
- ...repoMetadata(repository),
- status: "ready" as const,
- // Local storage has no placement jurisdiction; this is the public default.
- jurisdiction: "unrestricted" as const,
- }));
+ .map((repository) => {
+ // List items have no `remote`; use info() for the Git URL.
+ const { remote: _remote, ...metadata } = repoMetadata(repository);
+ return {
+ ...metadata,
+ status: "ready" as const,
+ // Local storage has no placement jurisdiction; this is the public default.
+ jurisdiction: "unrestricted" as const,
+ };
+ });
const cursor =
offset + page.length < repositories.length
? encodeCursor(offset + page.length)
@@ -398,7 +470,7 @@ export class LocalArtifactsNamespaceObject extends DurableObject {
+ #delete(name: string): Promise {
return this.exclusive(async () => {
validateName(name);
const repositories = await this.repos();
@@ -439,17 +511,22 @@ export class LocalArtifactsNamespaceObject extends DurableObject {
const repository = await this.getRepo(name, expectedId);
- const active = repository.tokens.filter(
- (token) => !token.revokedAt && isActive(token)
- );
- const tokens = active
- .toReversed()
+ // Active tokens come first so retained history cannot push a token that
+ // still authenticates off the 30-item page. Each group is newest first.
+ const newestFirst = repository.tokens.toReversed();
+ const tokens = [
+ ...newestFirst.filter((token) => tokenState(token) === "active"),
+ ...newestFirst.filter((token) => tokenState(token) !== "active"),
+ ]
.slice(0, 30)
- .map(({ tokenHash: _tokenHash, revokedAt: _revokedAt, ...token }) => ({
- ...token,
- state: "active" as const,
+ .map((token) => ({
+ id: token.id,
+ scope: token.scope,
+ createdAt: token.createdAt,
+ expiresAt: token.expiresAt,
+ state: tokenState(token),
}));
- return { total: active.length, tokens };
+ return { total: repository.tokens.length, tokens };
}
async revokeToken(
@@ -475,7 +552,8 @@ export class LocalArtifactsNamespaceObject extends DurableObject {
for (const repository of Object.values(repositories)) {
- repository.tokens = repository.tokens.filter(
- (token) => !token.revokedAt && isActive(token)
- );
+ repository.tokens = retainTokens(repository.tokens);
}
return this.ctx.storage.put("repos", repositories);
}
@@ -624,6 +700,16 @@ export class LocalArtifactsNamespaceObject extends DurableObject(request: BackendRequest): Promise =>
- publicCall(async () =>
- namespace.backend(await namespace.getRepo(name, id), request)
- );
+ const read = async (request: BackendRequest): Promise =>
+ namespace.backend(await namespace.getRepo(name, id), request);
const readFile = async (args: {
ref: string;
path: string;
- }): Promise => {
+ }): Promise => {
if (!args?.ref) {
throw new ArtifactsError("INVALID_INPUT", "Invalid ref: ref required.");
}
@@ -729,45 +813,56 @@ function createRepoHandle(
return null;
}
const bytes = decodeBase64(result.data);
- return new Blob([bytes], { type: contentType(args.path, bytes) });
+ return repoFile(bytes, contentType(args.path, bytes));
};
return {
info: () =>
- publicCall(async () => repoMetadata(await namespace.getRepo(name, id))),
+ outcome(async () => repoMetadata(await namespace.getRepo(name, id))),
createToken: (scope: TokenScope = "write", ttl?: number) =>
- publicCall(() => namespace.createToken(name, scope, ttl, id)),
- listTokens: () => publicCall(() => namespace.listTokens(name, id)),
+ outcome(() => namespace.createToken(name, scope, ttl, id)),
+ listTokens: () => outcome(() => namespace.listTokens(name, id)),
revokeToken: (tokenOrId: string) =>
- publicCall(() => namespace.revokeToken(name, tokenOrId, id)),
- readBlob: async (hash: string) => {
- validateHash(hash);
- const result = await read({
- action: "readBlob",
- hash,
- });
- return result === null ? null : new Blob([decodeBase64(result.data)]);
- },
- readTree: async (hash: string) => {
- validateHash(hash);
- return await read({ action: "readTree", hash });
- },
- readCommit: async (hash: string) => {
- validateHash(hash);
- return await read({ action: "readCommit", hash });
- },
- readFile,
- log: (options: RepositoryLogOptions = {}) => {
- validateLogOptions(options);
- return read({
- action: "log",
- ...(options.ref === undefined ? {} : { ref: options.ref }),
- ...(options.limit === undefined ? {} : { limit: options.limit }),
- ...(options.offset === undefined ? {} : { offset: options.offset }),
- });
- },
+ outcome(() => namespace.revokeToken(name, tokenOrId, id)),
+ readBlob: (hash: string) =>
+ outcome(async () => {
+ validateHash(hash);
+ const result = await read({
+ action: "readBlob",
+ hash,
+ });
+ return result === null ? null : repoFile(decodeBase64(result.data));
+ }),
+ readTree: (hash: string) =>
+ outcome(async () => {
+ validateHash(hash);
+ return await read({ action: "readTree", hash });
+ }),
+ readCommit: (hash: string) =>
+ outcome(async () => {
+ validateHash(hash);
+ return await read({
+ action: "readCommit",
+ hash,
+ });
+ }),
+ readFile: (args: { ref: string; path: string }) =>
+ outcome(() => readFile(args)),
+ log: (options: RepositoryLogOptions = {}) =>
+ outcome(async () => {
+ validateLogOptions(options);
+ return await read({
+ action: "log",
+ ...(options.ref === undefined ? {} : { ref: options.ref }),
+ // The public API caps the page size rather than rejecting it.
+ ...(options.limit === undefined
+ ? {}
+ : { limit: Math.min(options.limit, MAX_LOG_LIMIT) }),
+ ...(options.offset === undefined ? {} : { offset: options.offset }),
+ });
+ }),
fork: (targetName: string, options: ForkOptions = {}) =>
- publicCall(() => namespace.fork(name, targetName, options, id)),
+ outcome(() => namespace.fork(name, targetName, options, id)),
};
}
@@ -1152,13 +1247,10 @@ function validateLogOptions(
if (ref !== undefined && typeof ref !== "string") {
throw new ArtifactsError("INVALID_INPUT", "Invalid ref: must be a string.");
}
- if (
- limit !== undefined &&
- (!Number.isInteger(limit) || limit < 1 || limit > 1000)
- ) {
+ if (limit !== undefined && (!Number.isInteger(limit) || limit < 1)) {
throw new ArtifactsError(
"INVALID_INPUT",
- "Invalid limit: must be between 1 and 1000."
+ "Invalid limit: must be a positive integer."
);
}
if (offset !== undefined && (!Number.isInteger(offset) || offset < 0)) {
@@ -1204,6 +1296,32 @@ function isActive(token: Pick): boolean {
return Date.parse(token.expiresAt) > Date.now();
}
+function tokenState(
+ token: Pick
+): TokenInfo["state"] {
+ if (token.revokedAt) {
+ return "revoked";
+ }
+ return isActive(token) ? "active" : "expired";
+}
+
+// listTokens() reports revoked and expired tokens, so keep a bounded history
+// of them rather than letting a long-lived repository grow without limit.
+const MAX_INACTIVE_TOKENS = 100;
+
+function retainTokens(tokens: RepositoryToken[]): RepositoryToken[] {
+ let inactive = tokens.filter(
+ (token) => tokenState(token) !== "active"
+ ).length;
+ return tokens.filter((token) => {
+ if (tokenState(token) === "active" || inactive <= MAX_INACTIVE_TOKENS) {
+ return true;
+ }
+ inactive--;
+ return false;
+ });
+}
+
function randomHex(bytes: number): string {
return [...crypto.getRandomValues(new Uint8Array(bytes))]
.map((byte) => byte.toString(16).padStart(2, "0"))
@@ -1303,8 +1421,15 @@ function contentType(path: string, bytes: Uint8Array): string {
}
}
+/** workerd implements `Uint8Array.fromBase64()`; TypeScript's lib doesn't declare it yet. */
+const Base64Bytes = Uint8Array as unknown as {
+ fromBase64(value: string): Uint8Array;
+};
+
function decodeBase64(value: string): Uint8Array {
- return Uint8Array.from(atob(value), (character) => character.charCodeAt(0));
+ // Native decoding takes milliseconds for a 32 MiB file, where mapping each
+ // `atob()` character takes seconds.
+ return Base64Bytes.fromBase64(value);
}
function encodeCursor(offset: number): string {
@@ -1327,14 +1452,34 @@ function decodeCursor(cursor: string | undefined): number {
}
}
-async function publicCall(action: () => Promise): Promise {
+async function outcome(action: () => Promise): Promise> {
try {
- return await action();
+ return { ok: true, value: await action() };
} catch (error) {
- if (isArtifactsError(error)) {
- throw error;
- }
- throw new ArtifactsError("INTERNAL_ERROR", "An internal error occurred.");
+ const failure = isArtifactsError(error)
+ ? error
+ : new ArtifactsError("INTERNAL_ERROR", "An internal error occurred.");
+ return {
+ ok: false,
+ error: {
+ code: failure.code,
+ numericCode: failure.numericCode,
+ message: failure.message,
+ },
+ };
+ }
+}
+
+/** Forward an outcome from the namespace object, including a failed call to it. */
+async function forward(
+ call: () => Promise>
+): Promise> {
+ try {
+ return await call();
+ } catch {
+ return outcome(() => {
+ throw new ArtifactsError("INTERNAL_ERROR", "An internal error occurred.");
+ });
}
}
diff --git a/packages/miniflare/src/workers/artifacts/wrapped-binding.worker.ts b/packages/miniflare/src/workers/artifacts/wrapped-binding.worker.ts
new file mode 100644
index 0000000000..778cd4a681
--- /dev/null
+++ b/packages/miniflare/src/workers/artifacts/wrapped-binding.worker.ts
@@ -0,0 +1,109 @@
+/**
+ * Wrapped binding for a local Artifacts namespace. It runs in the caller's
+ * isolate, so an `ArtifactsError` is thrown there and never crosses an RPC
+ * boundary, where workerd would log it as an uncaught exception.
+ */
+import type {
+ LocalArtifactsNamespace,
+ Outcome,
+ RepoFile,
+} from "./binding.worker";
+
+interface Env {
+ namespace: Pick<
+ LocalArtifactsNamespace,
+ "create" | "get" | "import" | "list" | "delete"
+ >;
+}
+
+type Unwrapped = F extends (...args: infer A) => Promise>
+ ? (...args: A) => Promise
+ : never;
+
+type RepoHandle = Extract<
+ Awaited>,
+ { ok: true }
+>["value"];
+
+type FileReader = F extends (
+ ...args: infer A
+) => Promise>
+ ? (...args: A) => Promise
+ : never;
+
+type Repo = {
+ [K in keyof RepoHandle]: K extends "readBlob" | "readFile"
+ ? FileReader
+ : Unwrapped;
+} & Disposable;
+
+type Failure = Extract, { ok: false }>["error"];
+
+/** The namespace service owns the codes; this only rethrows its failure. */
+class ArtifactsError extends Error {
+ readonly code: Failure["code"];
+ readonly numericCode: number;
+
+ constructor({ code, numericCode, message }: Failure) {
+ super(message);
+ this.name = "ArtifactsError";
+ this.code = code;
+ this.numericCode = numericCode;
+ }
+}
+
+function unwrap(result: Outcome): T {
+ if (result.ok) {
+ return result.value;
+ }
+ throw new ArtifactsError(result.error);
+}
+
+/** Buffers a streamed file into the `Blob` the public binding returns. */
+async function toBlob(file: RepoFile | null): Promise {
+ if (file === null) {
+ return null;
+ }
+ const bytes = await new Response(file.body).arrayBuffer();
+ return new Blob([bytes], { type: file.type });
+}
+
+function wrapRepo(handle: RepoHandle, dispose: (() => void) | undefined): Repo {
+ // A plain object keeps the methods enumerable, like the RPC stub it replaces.
+ return {
+ info: async () => unwrap(await handle.info()),
+ createToken: async (scope, ttl) =>
+ unwrap(await handle.createToken(scope, ttl)),
+ listTokens: async () => unwrap(await handle.listTokens()),
+ revokeToken: async (tokenOrId) =>
+ unwrap(await handle.revokeToken(tokenOrId)),
+ readBlob: async (hash) => toBlob(unwrap(await handle.readBlob(hash))),
+ readTree: async (hash) => unwrap(await handle.readTree(hash)),
+ readCommit: async (hash) => unwrap(await handle.readCommit(hash)),
+ readFile: async (args) => toBlob(unwrap(await handle.readFile(args))),
+ log: async (options) => unwrap(await handle.log(options)),
+ fork: async (name, options) => unwrap(await handle.fork(name, options)),
+ [Symbol.dispose]() {
+ dispose?.();
+ },
+ };
+}
+
+export default function (env: Env) {
+ const { namespace } = env;
+ return {
+ create: async (...args: Parameters) =>
+ unwrap(await namespace.create(...args)),
+ get: async (name: string) => {
+ const result = (await namespace.get(name)) as Outcome &
+ Partial;
+ const handle = unwrap(result);
+ return wrapRepo(handle, () => result[Symbol.dispose]?.());
+ },
+ import: async (...args: Parameters) =>
+ unwrap(await namespace.import(...args)),
+ list: async (...args: Parameters) =>
+ unwrap(await namespace.list(...args)),
+ delete: async (name: string) => unwrap(await namespace.delete(name)),
+ };
+}
diff --git a/packages/miniflare/test/plugins/artifacts/contract.spec.ts b/packages/miniflare/test/plugins/artifacts/contract.spec.ts
index 9694a52495..9ca1ce259f 100644
--- a/packages/miniflare/test/plugins/artifacts/contract.spec.ts
+++ b/packages/miniflare/test/plugins/artifacts/contract.spec.ts
@@ -119,9 +119,17 @@ test("shared Artifacts contract runs against the local RPC binding and cleans up
outcome: "value",
value: null,
});
+ }
+ // Per the binding types, readBlob() returns null for a non-blob, while
+ // readTree() and readCommit() reject an object of another type.
+ expect(find("blob wrong type")).toMatchObject({
+ outcome: "value",
+ value: null,
+ });
+ for (const kind of ["tree", "commit"]) {
expect(find(`${kind} wrong type`)).toMatchObject({
- outcome: "value",
- value: null,
+ outcome: "error",
+ value: { code: "INTERNAL_ERROR" },
});
}
expect(find("file missing ref")).toMatchObject({
diff --git a/packages/miniflare/test/plugins/artifacts/git-client.spec.ts b/packages/miniflare/test/plugins/artifacts/git-client.spec.ts
index 2b587bacb7..9edd2fced6 100644
--- a/packages/miniflare/test/plugins/artifacts/git-client.spec.ts
+++ b/packages/miniflare/test/plugins/artifacts/git-client.spec.ts
@@ -164,7 +164,9 @@ test("Git client imports, reads and forks a local repository", async ({
const tag = (
await git(["rev-parse", "refs/tags/v1"], imported.repository)
).stdout.trim();
- expect(await imported.readCommit(tag)).toBeNull();
+ await expect(imported.readCommit(tag)).rejects.toThrow(
+ "is a tag, not a commit"
+ );
expect(await imported.readBlob(tag)).toBeNull();
const blob = (
await git(["rev-parse", "HEAD:hello.txt"], source)
diff --git a/packages/miniflare/test/plugins/artifacts/index.spec.ts b/packages/miniflare/test/plugins/artifacts/index.spec.ts
index 193f806a79..a144fb20cc 100644
--- a/packages/miniflare/test/plugins/artifacts/index.spec.ts
+++ b/packages/miniflare/test/plugins/artifacts/index.spec.ts
@@ -3,6 +3,7 @@ import { createHash } from "node:crypto";
import {
chmod,
mkdir,
+ readdir,
readFile,
rename,
stat,
@@ -14,11 +15,12 @@ import { pipeline } from "node:stream/promises";
import { pathToFileURL } from "node:url";
import { promisify } from "node:util";
import { removeDir } from "@cloudflare/workers-utils/fs-helpers";
-import { ArtifactsController, Miniflare } from "miniflare";
+import { ArtifactsController, LogLevel, Miniflare } from "miniflare";
import { test, vi } from "vitest";
import {
GitClient,
gitEnvironment,
+ MAX_BLOB_BYTES,
withRepositoryCreationLock,
} from "../../../src/plugins/artifacts/git-client";
import {
@@ -27,7 +29,12 @@ import {
type GitSidecar,
} from "../../../src/plugins/artifacts/git-sidecar";
import { repositoryPath } from "../../../src/plugins/artifacts/storage";
-import { singleModuleManifest, useDispose, useTmp } from "../../test-shared";
+import {
+ singleModuleManifest,
+ TestLog,
+ useDispose,
+ useTmp,
+} from "../../test-shared";
import type { MiniflareOptions, RemoteProxyConnectionString } from "miniflare";
// Native Git subprocesses can slow down considerably while sharing a Windows
@@ -40,11 +47,14 @@ const exec = promisify(execFile);
const SCRIPT = `
export default {
async fetch(request, env) {
- const { method, name, args = [] } = await request.json();
+ const { method, name, args = [], sizeOnly } = await request.json();
try {
const target = name === undefined ? env.REPOS : await env.REPOS.get(name);
if (method === "keys") return Response.json(Object.keys(target));
const result = await target[method](...args);
+ if (result instanceof Blob && sizeOnly) {
+ return Response.json({ size: result.size });
+ }
if (result instanceof Blob) {
return Response.json({ bytes: [...new Uint8Array(await result.arrayBuffer())], type: result.type });
}
@@ -86,14 +96,30 @@ function rpcRequest(
mf: Miniflare,
method: string,
args: unknown[] = [],
- name?: string
+ name?: string,
+ sizeOnly = false
): Promise {
return mf.dispatchFetch("http://localhost", {
method: "POST",
- body: JSON.stringify({ method, args, name }),
+ body: JSON.stringify({ method, args, name, sizeOnly }),
});
}
+/** Reads a Blob through the binding and returns only its size. */
+async function rpcBlobSize(
+ mf: Miniflare,
+ method: string,
+ args: unknown[],
+ name: string
+): Promise {
+ const response = await rpcRequest(mf, method, args, name, true);
+ const result = (await response.json()) as { size: number; error?: string };
+ if (!response.ok) {
+ throw new Error(result.error);
+ }
+ return result.size;
+}
+
async function rpc(
mf: Miniflare,
method: string,
@@ -1119,7 +1145,13 @@ test("artifacts: token metadata, revocation and validation", async ({
true
);
expect(await rpc(mf, "revokeToken", [readToken.id], "repo")).toBe(false);
- expect((await rpc(mf, "listTokens", [], "repo")).total).toBe(1);
+ const afterRevoke = await rpc(mf, "listTokens", [], "repo");
+ expect(afterRevoke.total).toBe(2);
+ expect(
+ afterRevoke.tokens.find(
+ (token: { id: string }) => token.id === readToken.id
+ )
+ ).toMatchObject({ state: "revoked" });
expect(
await rpcFailure(mf, "createToken", ["write", 59], "repo")
).toMatchObject({
@@ -1696,3 +1728,189 @@ test("artifacts: disposing the sidecar closes its private listener", async ({
}
await expect(fetch(address)).rejects.toThrow();
});
+
+test("artifacts: caught binding errors are not logged as uncaught by verbose workerd", async ({
+ expect,
+}) => {
+ const logs: string[] = [];
+ const mf = new Miniflare({
+ ...options(),
+ verbose: true,
+ handleStructuredLogs: ({ message }) => logs.push(message),
+ });
+ useDispose(mf);
+ await rpc(mf, "create", ["repo"]);
+ const failures = [
+ await rpcFailure(mf, "get", ["missing"]),
+ await rpcFailure(mf, "create", ["-bad"]),
+ await rpcFailure(mf, "readFile", [{ ref: "", path: "x" }], "repo"),
+ await rpcFailure(mf, "createToken", ["write", 1], "repo"),
+ ];
+ expect(failures.map(({ name, code }) => [name, code])).toEqual([
+ ["ArtifactsError", "NOT_FOUND"],
+ ["ArtifactsError", "INVALID_REPO_NAME"],
+ ["ArtifactsError", "INVALID_INPUT"],
+ ["ArtifactsError", "INVALID_TTL"],
+ ]);
+ expect(failures[0]).toMatchObject({ numericCode: 10200 });
+ expect(
+ logs.filter((message) => message.includes("uncaught exception"))
+ ).toEqual([]);
+});
+
+test("artifacts: the Git port survives a restart with the same persistence", async ({
+ expect,
+}) => {
+ const root = await useTmp();
+ const log = new TestLog();
+ const first = new Miniflare({
+ ...options(),
+ log,
+ resourcePersistencePath: root,
+ });
+ useDispose(first);
+ const created = await rpc(first, "create", ["repo"]);
+ const port = new URL(created.remote).port;
+ expect(log.logsAtLevel(LogLevel.INFO)).toContain(
+ `Local Artifacts Git remotes for namespace "test": http://127.0.0.1:${port}/git/test/.git`
+ );
+ await first.dispose();
+
+ const second = new Miniflare({ ...options(), resourcePersistencePath: root });
+ useDispose(second);
+ const info = await rpc(second, "info", [], "repo");
+ expect(info.remote).toBe(created.remote);
+ const response = await fetch(
+ `${info.remote}/info/refs?service=git-upload-pack`,
+ { headers: { Authorization: `Bearer ${created.token}` } }
+ );
+ expect(response.status).toBe(200);
+ await response.body?.cancel();
+});
+
+test("artifacts: pushes reject files over 32 MiB and reads report MEMORY_LIMIT", async ({
+ expect,
+}) => {
+ const root = await useTmp();
+ const mf = new Miniflare({ ...options(), resourcePersistencePath: root });
+ useDispose(mf);
+ const created = await rpc(mf, "create", ["repo"]);
+ const source = await useTmp();
+ await git(["init", "--initial-branch=main", source]);
+ // Zeros keep the pack small; the limit applies to the blob's size.
+ await writeFile(
+ path.join(source, "large.bin"),
+ new Uint8Array(MAX_BLOB_BYTES + 1)
+ );
+ await writeFile(
+ path.join(source, "limit.bin"),
+ new Uint8Array(MAX_BLOB_BYTES)
+ );
+ await git(["add", "limit.bin"], source);
+ await git(["commit", "-m", "at the limit"], source);
+ const push = (ref: string) =>
+ git(
+ [
+ "-c",
+ `http.extraHeader=Authorization: Bearer ${created.token}`,
+ "push",
+ created.remote,
+ ref,
+ ],
+ source
+ );
+ await push("main");
+ await git(["add", "large.bin"], source);
+ await git(["commit", "-m", "over the limit"], source);
+ await expect(push("HEAD:refs/heads/large")).rejects.toThrow(
+ /larger than 32 MiB/
+ );
+ expect(
+ (await rpc(mf, "log", [{ ref: "main" }], "repo")).map(
+ (commit: { message: string }) => commit.message
+ )
+ ).toEqual(["at the limit"]);
+ // A file at the limit still fits through the binding's RPC.
+ expect(
+ await rpcBlobSize(
+ mf,
+ "readFile",
+ [{ ref: "main", path: "limit.bin" }],
+ "repo"
+ )
+ ).toBe(MAX_BLOB_BYTES);
+ expect(await rpc(mf, "readFile", [{ ref: "large", path: "x" }], "repo")).toBe(
+ null
+ );
+
+ // Repositories written outside the binding can still hold a larger blob.
+ const [namespaceDirectory] = await readdir(path.join(root, "artifacts"));
+ const repository = repositoryPath(
+ path.join(root, "artifacts", namespaceDirectory, "git"),
+ "test",
+ "repo"
+ );
+ await git(["push", repository, "HEAD:refs/heads/large"], source);
+ expect(
+ await rpcFailure(
+ mf,
+ "readFile",
+ [{ ref: "large", path: "large.bin" }],
+ "repo"
+ )
+ ).toMatchObject({ code: "MEMORY_LIMIT", numericCode: 10402 });
+ const blob = (
+ await git(["rev-parse", "HEAD:large.bin"], source)
+ ).stdout.trim();
+ expect(await rpcFailure(mf, "readBlob", [blob], "repo")).toMatchObject({
+ code: "MEMORY_LIMIT",
+ });
+});
+
+test("artifacts: list omits remote and log caps its page size", async ({
+ expect,
+}) => {
+ const mf = new Miniflare(options());
+ useDispose(mf);
+ await pushFixture(mf, path.join(await useTmp(), "source"));
+ const { repos } = await rpc(mf, "list");
+ expect(repos).toHaveLength(1);
+ expect(repos[0]).not.toHaveProperty("remote");
+ expect(await rpc(mf, "log", [{ limit: 5000 }], "Repo")).toHaveLength(1);
+ expect(await rpcFailure(mf, "log", [{ limit: 0 }], "Repo")).toMatchObject({
+ code: "INVALID_INPUT",
+ });
+});
+
+test("artifacts: disposing a repository handle releases its RPC stubs", async ({
+ expect,
+}) => {
+ const script = `
+export default {
+ async fetch(request, env) {
+ await env.REPOS.create("repo");
+ const repo = await env.REPOS.get("repo");
+ const before = (await repo.info()).name;
+ repo[Symbol.dispose]();
+ const after = await repo.info().then(() => "callable", (error) => error.message);
+ return Response.json({ before, after });
+ }
+};`;
+ const base = options();
+ const mf = new Miniflare({
+ ...base,
+ workers: [
+ {
+ config: {
+ ...base.workers[0].config,
+ manifest: singleModuleManifest(script),
+ },
+ },
+ ],
+ });
+ useDispose(mf);
+ expect(await (await mf.dispatchFetch("http://localhost")).json()).toEqual({
+ before: "repo",
+ after: expect.stringContaining("disposed"),
+ });
+});
diff --git a/packages/miniflare/test/plugins/artifacts/lifecycle.spec.ts b/packages/miniflare/test/plugins/artifacts/lifecycle.spec.ts
index 630ff85623..89c1057dd6 100644
--- a/packages/miniflare/test/plugins/artifacts/lifecycle.spec.ts
+++ b/packages/miniflare/test/plugins/artifacts/lifecycle.spec.ts
@@ -137,8 +137,16 @@ export default {
));
}
try {
- const target = name === undefined ? state : await state.get(name);
- return Response.json(await target[method](...args));
+ // The namespace object returns outcomes; the wrapped binding unwraps them.
+ const unwrap = (result) => {
+ if (result && typeof result === "object" && "ok" in result) {
+ if (result.ok) return result.value;
+ throw result.error;
+ }
+ return result;
+ };
+ const target = name === undefined ? state : unwrap(await state.get(name));
+ return Response.json(unwrap(await target[method](...args)));
} catch (error) {
return Response.json({ code: error.code, message: error.message }, { status: 400 });
}
@@ -259,6 +267,13 @@ async function gitStatus(
const start = Date.parse("2026-01-01T00:00:00.000Z");
+async function tokenStates(mf: Miniflare): Promise {
+ const { tokens } = (await clockRpc(mf, "listTokens", [], "repo")) as {
+ tokens: { state: string }[];
+ };
+ return tokens.map(({ state }) => state);
+}
+
test("artifacts: strips authentication headers before forwarding Git requests", async ({
expect,
}) => {
@@ -376,7 +391,7 @@ test("artifacts: token expiry is exclusive at the exact workerd clock boundary a
expect(await gitStatus(first, String(write.plaintext), "upload")).toBe(200);
await setClock(first, expiration);
- expect((await clockRpc(first, "listTokens", [], "repo")).total).toBe(1);
+ expect(await tokenStates(first)).toEqual(["active", "expired", "expired"]);
expect(await gitStatus(first, String(read.plaintext), "upload")).toBe(401);
expect(await gitStatus(first, String(write.plaintext), "receive")).toBe(401);
expect(await gitStatus(first, String(read.plaintext), "receive")).toBe(401);
@@ -385,7 +400,11 @@ test("artifacts: token expiry is exclusive at the exact workerd clock boundary a
const restarted = new Miniflare(clockOptions(script, root));
useDispose(restarted);
await setClock(restarted, expiration + 1);
- expect((await clockRpc(restarted, "listTokens", [], "repo")).total).toBe(1);
+ expect(await tokenStates(restarted)).toEqual([
+ "active",
+ "expired",
+ "expired",
+ ]);
expect(await gitStatus(restarted, String(write.plaintext), "upload")).toBe(
401
);
@@ -409,7 +428,7 @@ test("artifacts: token expiry is exclusive at the exact workerd clock boundary a
).toBe(401);
});
-test("artifacts: saving repositories prunes revoked and expired token records", async ({
+test("artifacts: listTokens reports revoked and expired tokens", async ({
expect,
}) => {
const mf = new Miniflare(clockOptions(await clockedWorker()));
@@ -418,18 +437,97 @@ test("artifacts: saving repositories prunes revoked and expired token records",
await clockRpc(mf, "create", ["repo"]);
const expired = await clockRpc(mf, "createToken", ["read", 60], "repo");
const revoked = await clockRpc(mf, "createToken", ["read", 600], "repo");
+ expect(await clockRpc(mf, "revokeToken", [revoked.id], "repo")).toBe(true);
await setClock(mf, start + 60_000);
const active = await clockRpc(mf, "createToken", ["read", 600], "repo");
- const stored = async () =>
- (await (
- await clockRequest(mf, { action: "storedTokens", name: "repo" })
- ).json()) as string[];
- expect(await stored()).toHaveLength(3);
- expect(await stored()).not.toContain(expired.id);
- expect(await stored()).toContain(revoked.id);
- expect(await clockRpc(mf, "revokeToken", [revoked.id], "repo")).toBe(true);
- expect(await stored()).not.toContain(revoked.id);
- expect(await stored()).toContain(active.id);
+ const listed = (await clockRpc(mf, "listTokens", [], "repo")) as {
+ total: number;
+ tokens: { id: string; state: string }[];
+ };
+ // The creation token plus the three read tokens, newest first.
+ expect(listed.total).toBe(4);
+ const states = new Map(listed.tokens.map(({ id, state }) => [id, state]));
+ expect(listed.tokens[0].id).toBe(active.id);
+ expect(states.get(String(active.id))).toBe("active");
+ expect(states.get(String(revoked.id))).toBe("revoked");
+ expect(states.get(String(expired.id))).toBe("expired");
+ // Listed history must not let a revoked or expired token authenticate.
+ expect(await gitStatus(mf, String(expired.plaintext), "upload")).toBe(401);
+ expect(await gitStatus(mf, String(revoked.plaintext), "upload")).toBe(401);
+});
+
+test("artifacts: an expired token cannot be revoked and stays expired", async ({
+ expect,
+}) => {
+ const mf = new Miniflare(clockOptions(await clockedWorker()));
+ useDispose(mf);
+ await setClock(mf, start);
+ await clockRpc(mf, "create", ["repo"]);
+ const expired = await clockRpc(mf, "createToken", ["read", 60], "repo");
+ await setClock(mf, start + 60_000);
+ expect(await clockRpc(mf, "revokeToken", [expired.id], "repo")).toBe(false);
+ const { tokens } = (await clockRpc(mf, "listTokens", [], "repo")) as {
+ tokens: { id: string; state: string }[];
+ };
+ expect(tokens.find(({ id }) => id === expired.id)).toMatchObject({
+ state: "expired",
+ });
+});
+
+test("artifacts: listTokens keeps active tokens ahead of retained history", async ({
+ expect,
+}) => {
+ const mf = new Miniflare(clockOptions(await clockedWorker()));
+ useDispose(mf);
+ await setClock(mf, start);
+ await clockRpc(mf, "create", ["repo"]);
+ const longLived = await clockRpc(
+ mf,
+ "createToken",
+ ["write", 31_536_000],
+ "repo"
+ );
+ for (let index = 0; index < 30; index++) {
+ const token = await clockRpc(mf, "createToken", ["read", 600], "repo");
+ await clockRpc(mf, "revokeToken", [token.id], "repo");
+ }
+ const listed = (await clockRpc(mf, "listTokens", [], "repo")) as {
+ total: number;
+ tokens: { id: string; state: string }[];
+ };
+ // The creation token, the long-lived token and 30 revoked tokens.
+ expect(listed.total).toBe(32);
+ expect(listed.tokens).toHaveLength(30);
+ expect(listed.tokens.slice(0, 2).map(({ state }) => state)).toEqual([
+ "active",
+ "active",
+ ]);
+ expect(listed.tokens[0].id).toBe(longLived.id);
+ expect(listed.tokens.slice(2).every(({ state }) => state === "revoked")).toBe(
+ true
+ );
+});
+
+test("artifacts: saving repositories keeps a bounded token history", async ({
+ expect,
+}) => {
+ const mf = new Miniflare(clockOptions(await clockedWorker()));
+ useDispose(mf);
+ await setClock(mf, start);
+ await clockRpc(mf, "create", ["repo"]);
+ const first = await clockRpc(mf, "createToken", ["read", 60], "repo");
+ for (let index = 0; index < 100; index++) {
+ await clockRpc(mf, "createToken", ["read", 60], "repo");
+ }
+ await setClock(mf, start + 60_000);
+ // The creation token is still active; 101 read tokens have now expired.
+ const active = await clockRpc(mf, "createToken", ["read", 600], "repo");
+ const stored = (await (
+ await clockRequest(mf, { action: "storedTokens", name: "repo" })
+ ).json()) as string[];
+ expect(stored).toHaveLength(102);
+ expect(stored).not.toContain(first.id);
+ expect(stored).toContain(active.id);
});
test("artifacts: concurrent same-name creates and forks commit one winner each", async ({
diff --git a/packages/vitest-plugin/test/artifacts-errors.test.ts b/packages/vitest-plugin/test/artifacts-errors.test.ts
new file mode 100644
index 0000000000..c46a884058
--- /dev/null
+++ b/packages/vitest-plugin/test/artifacts-errors.test.ts
@@ -0,0 +1,42 @@
+import dedent from "ts-dedent";
+import { test, vitestConfig } from "./helpers";
+
+// workerd logs any exception thrown across an RPC boundary as uncaught when it
+// runs with `--verbose`, which Workers Vitest enables by default.
+test("Workers Vitest does not report caught local Artifacts errors as uncaught", async ({
+ expect,
+ seed,
+ vitestRun,
+}) => {
+ await seed({
+ "vitest.config.mts": vitestConfig({
+ wrangler: { configPath: "./wrangler.jsonc" },
+ }),
+ "wrangler.jsonc": JSON.stringify({
+ name: "artifacts-errors-worker",
+ main: "./index.ts",
+ compatibility_date: "2026-09-03",
+ artifacts: [{ binding: "REPOS", namespace: "examples", remote: false }],
+ }),
+ "index.ts": "export default { fetch() { return new Response(); } };",
+ "index.test.ts": dedent`
+ import { env } from "cloudflare:test";
+ import { it } from "vitest";
+
+ it("throws ArtifactsError in the test isolate", async ({ expect }) => {
+ const missing = await env.REPOS.get("missing").catch((error) => error);
+ expect(missing).toMatchObject({
+ name: "ArtifactsError",
+ code: "NOT_FOUND",
+ numericCode: 10200,
+ });
+ const invalid = await env.REPOS.create("-bad").catch((error) => error);
+ expect(invalid).toMatchObject({ code: "INVALID_REPO_NAME" });
+ });
+ `,
+ });
+
+ const result = await vitestRun();
+ await expect(result.exitCode, result.stderr).resolves.toBe(0);
+ expect(result.stdout + result.stderr).not.toContain("uncaught exception");
+});
From 032f8c2b4a9b83970fc4b54de70790b48e3ba373 Mon Sep 17 00:00:00 2001
From: vaishnav <84540554+vaishnav-mk@users.noreply.github.com>
Date: Fri, 13 Nov 2026 12:54:43 +0530
Subject: [PATCH 03/30] [deploy-helpers,wrangler,codemods] Upload Workflow
export settings with the Worker (#16749)
---
.../workflow-binding-settings-on-export.md | 8 ++
.../workflow-exports-upload-settings.md | 10 ++
.../src/codemods/wrangler-to-cf/exports.ts | 4 +-
packages/deploy-helpers/src/deploy/deploy.ts | 41 ++++--
.../src/deploy/helpers/exports.ts | 20 +--
.../src/deploy/helpers/owned-workflows.ts | 52 +++-----
.../src/deploy/versions-upload.ts | 13 +-
.../tests/owned-workflows.test.ts | 41 +++---
.../src/__tests__/deploy/workflows.test.ts | 66 +++++++++-
.../experimental-config/workflows.test.ts | 121 ++++++++++++++++++
.../__tests__/helpers/mock-upload-worker.ts | 6 +
.../versions/versions.upload.test.ts | 14 +-
12 files changed, 308 insertions(+), 88 deletions(-)
create mode 100644 .changeset/workflow-binding-settings-on-export.md
create mode 100644 .changeset/workflow-exports-upload-settings.md
create mode 100644 packages/wrangler/src/__tests__/experimental-config/workflows.test.ts
diff --git a/.changeset/workflow-binding-settings-on-export.md b/.changeset/workflow-binding-settings-on-export.md
new file mode 100644
index 0000000000..6b2c2a4397
--- /dev/null
+++ b/.changeset/workflow-binding-settings-on-export.md
@@ -0,0 +1,8 @@
+---
+"@cloudflare/deploy-helpers": minor
+"wrangler": minor
+---
+
+Reject settings on a `workflows` binding to a Workflow declared in `exports`
+
+A `workflows` binding can still bind a Workflow that the Worker declares in `exports`, but it can no longer set `limits`, `concurrency`, `schedules`, `default_retention`, or `jurisdiction` for it. Set them on the export instead. Previously the binding and the export could both set them as long as they agreed, so configurations that set them on the binding now stop with an error that says which setting to move.
diff --git a/.changeset/workflow-exports-upload-settings.md b/.changeset/workflow-exports-upload-settings.md
new file mode 100644
index 0000000000..d9650a296d
--- /dev/null
+++ b/.changeset/workflow-exports-upload-settings.md
@@ -0,0 +1,10 @@
+---
+"@cloudflare/deploy-helpers": minor
+"wrangler": minor
+---
+
+Upload Workflow export settings with the Worker
+
+`wrangler deploy` and `wrangler versions upload` now include the settings of each `workflow` export (`limits`, `concurrency`, `schedules`, `default_retention`, and `jurisdiction`) in the upload, instead of sending only its type and name. Uploads of a Worker with `workflow` exports also send a `Cloudflare-Workers-Script-Api-Date` header, which lets the Workers API provision Workflow exports from these settings as part of the upload. `wrangler deploy` and `wrangler triggers deploy` still create or update each Workflow through the Workflows API afterwards, as before.
+
+If provisioning a scheduled Workflow fails because the account is on the free plan, `wrangler deploy` now explains that scheduled Workflows require a paid Workers plan.
diff --git a/packages/codemods/src/codemods/wrangler-to-cf/exports.ts b/packages/codemods/src/codemods/wrangler-to-cf/exports.ts
index 48ff9a62c8..b32926d19c 100644
--- a/packages/codemods/src/codemods/wrangler-to-cf/exports.ts
+++ b/packages/codemods/src/codemods/wrangler-to-cf/exports.ts
@@ -159,8 +159,8 @@ export function convertExports(
}
// A `workflows` binding to a Workflow this Worker defines becomes an export
// here, carrying the Workflow's settings. When the Wrangler `exports` table
- // already declares the same Workflow, the two merge the way Wrangler merges
- // them (`getWorkflowsOwnedByScript`), with the binding's settings winning.
+ // already declares the same Workflow, the two merge, with the binding's
+ // settings winning.
for (const [index, entry] of getRecords(source, "workflows").entries()) {
if (
!isLocalWorkflow(entry, source) ||
diff --git a/packages/deploy-helpers/src/deploy/deploy.ts b/packages/deploy-helpers/src/deploy/deploy.ts
index 812c31227f..dc2f54a89a 100644
--- a/packages/deploy-helpers/src/deploy/deploy.ts
+++ b/packages/deploy-helpers/src/deploy/deploy.ts
@@ -51,7 +51,10 @@ import {
tagsAreEqual,
warnOnErrorUpdatingServiceAndEnvironmentTags,
} from "./helpers/environments";
-import { EXPORTS_RECONCILIATION_ERROR_CODE } from "./helpers/error-codes";
+import {
+ EXPORTS_RECONCILIATION_ERROR_CODE,
+ WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE,
+} from "./helpers/error-codes";
import { resolveExportsUploadPayload } from "./helpers/exports";
import {
isExportsReconciliationErrorDetails,
@@ -286,7 +289,11 @@ async function deployWorker(
});
// Durable Object lifecycle is expressed through either legacy `migrations`
// or the declarative `exports` map. Only one is sent on each upload.
- const { migrations, exports } = await resolveExportsUploadPayload({
+ const {
+ migrations,
+ exports,
+ headers: exportsHeaders,
+ } = await resolveExportsUploadPayload({
scriptName,
isDryRun,
accountId,
@@ -543,9 +550,10 @@ async function deployWorker(
{
method: "POST",
body: workerBundle,
- headers: props.sendMetrics
- ? { metricsEnabled: "true" }
- : undefined,
+ headers: {
+ ...exportsHeaders,
+ ...(props.sendMetrics && { metricsEnabled: "true" }),
+ },
},
new URLSearchParams({ bindings_inherit: "strict" })
),
@@ -614,9 +622,10 @@ async function deployWorker(
{
method: "PUT",
body: workerBundle,
- headers: props.sendMetrics
- ? { metricsEnabled: "true" }
- : undefined,
+ headers: {
+ ...exportsHeaders,
+ ...(props.sendMetrics && { metricsEnabled: "true" }),
+ },
},
new URLSearchParams({
// pass excludeScript so the whole body of the
@@ -712,6 +721,22 @@ async function deployWorker(
);
}
+ // Workflow exports are provisioned on deploy, so this can come back here
+ // as well as from `triggers deploy`.
+ if (
+ err instanceof APIError &&
+ err.code === WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE
+ ) {
+ err.preventReport();
+ throw new UserError(
+ `A Workflow has "schedules" configured, but scheduled Workflows require a paid Workers plan.`,
+ {
+ cause: err,
+ telemetryMessage: "deploy workflow cron requires paid plan",
+ }
+ );
+ }
+
const message = await helpIfErrorIsSizeOrScriptStartup(
err,
dependencies,
diff --git a/packages/deploy-helpers/src/deploy/helpers/exports.ts b/packages/deploy-helpers/src/deploy/helpers/exports.ts
index d45558e508..440bf5ef7b 100644
--- a/packages/deploy-helpers/src/deploy/helpers/exports.ts
+++ b/packages/deploy-helpers/src/deploy/helpers/exports.ts
@@ -2,6 +2,9 @@ import { partitionExports } from "@cloudflare/workers-utils";
import { resolveDoLifecyclePayload } from "./durable";
import type { CfWorkerInit } from "@cloudflare/workers-utils";
+// Tells the upload API that `workflow` exports carry their settings.
+const WORKFLOW_EXPORTS_SCRIPT_API_DATE = "2026-11-09";
+
type ResolveExportsUploadPayloadProps = Parameters<
typeof resolveDoLifecyclePayload
>[0];
@@ -11,6 +14,7 @@ export async function resolveExportsUploadPayload(
): Promise<{
migrations: CfWorkerInit["migrations"];
exports: CfWorkerInit["exports"];
+ headers: Record | undefined;
}> {
const partitionedExports = partitionExports(props.config.exports);
const { migrations, exports: durableObjectExports } =
@@ -20,18 +24,18 @@ export async function resolveExportsUploadPayload(
const exports: NonNullable = {
...partitionedExports.worker,
...(durableObjectExports ?? {}),
- // Workflow settings are applied when `triggers deploy` provisions the
- // Workflow; the upload API only accepts the type and name.
- ...Object.fromEntries(
- Object.entries(partitionedExports.workflow).map(
- ([className, { name }]) =>
- [className, { type: "workflow", name }] as const
- )
- ),
+ ...partitionedExports.workflow,
};
return {
migrations,
exports: Object.keys(exports).length > 0 ? exports : undefined,
+ headers:
+ Object.keys(partitionedExports.workflow).length > 0
+ ? {
+ "Cloudflare-Workers-Script-Api-Date":
+ WORKFLOW_EXPORTS_SCRIPT_API_DATE,
+ }
+ : undefined,
};
}
diff --git a/packages/deploy-helpers/src/deploy/helpers/owned-workflows.ts b/packages/deploy-helpers/src/deploy/helpers/owned-workflows.ts
index 374cc58383..7d2544f827 100644
--- a/packages/deploy-helpers/src/deploy/helpers/owned-workflows.ts
+++ b/packages/deploy-helpers/src/deploy/helpers/owned-workflows.ts
@@ -1,4 +1,3 @@
-import { isDeepStrictEqual } from "node:util";
import { partitionExports, UserError } from "@cloudflare/workers-utils";
import type { Config, WorkflowBinding } from "@cloudflare/workers-utils";
@@ -16,9 +15,8 @@ export function isWorkflowDefinedInThisScript(
/**
* Collects the Workflows this script defines, from both `workflows` bindings
* and `exports` entries of type `workflow`. A Workflow declared in both places
- * is returned once, with the settings of both declarations merged;
- * {@link validateOwnedWorkflowDeclarations} guarantees the two declarations
- * agree.
+ * is returned once, with the export's settings;
+ * {@link validateOwnedWorkflowDeclarations} guarantees the binding sets none.
*
* @param config - The Worker config
* @param scriptName - The name of the script being deployed
@@ -37,26 +35,25 @@ export function getWorkflowsOwnedByScript(
for (const [className, workflowExport] of Object.entries(
partitionExports(config.exports).workflow
)) {
- const binding = owned.get(workflowExport.name);
owned.set(workflowExport.name, {
name: workflowExport.name,
class_name: className,
- limits: binding?.limits ?? workflowExport.limits,
- concurrency: binding?.concurrency ?? workflowExport.concurrency,
- schedules: binding?.schedules ?? workflowExport.schedules,
- default_retention:
- binding?.default_retention ?? workflowExport.default_retention,
- jurisdiction: binding?.jurisdiction ?? workflowExport.jurisdiction,
+ limits: workflowExport.limits,
+ concurrency: workflowExport.concurrency,
+ schedules: workflowExport.schedules,
+ default_retention: workflowExport.default_retention,
+ jurisdiction: workflowExport.jurisdiction,
});
}
return [...owned.values()];
}
/**
- * Checks that each `workflows` binding owned by this script agrees with the
- * `workflow` export of the same name, so {@link getWorkflowsOwnedByScript} can
- * merge them, and that no binding to another script's Workflow shares a name
- * with an export, since the export makes this script the Workflow's owner.
+ * Checks that each `workflows` binding owned by this script only binds the
+ * `workflow` export of the same name: same class, and no settings, since the
+ * export holds them. Also checks that no binding to another script's Workflow
+ * shares a name with an export, since the export makes this script the
+ * Workflow's owner.
* This can't run during config validation: ownership depends on the name the
* script is deployed under, which `--name` or a CI override can change after
* the config is validated.
@@ -64,8 +61,8 @@ export function getWorkflowsOwnedByScript(
* @param config - The Worker config
* @param scriptName - The name of the script being deployed
* @throws {UserError} If a binding and an export for the same Workflow use
- * different classes, set the same setting to different values, or disagree
- * about which script owns the Workflow
+ * different classes, the binding sets a setting, or they disagree about which
+ * script owns the Workflow
*/
export function validateOwnedWorkflowDeclarations(
config: Pick,
@@ -73,19 +70,15 @@ export function validateOwnedWorkflowDeclarations(
): void {
const exportsByWorkflowName = new Map(
Object.entries(partitionExports(config.exports).workflow).map(
- ([className, workflowExport]) => [
- workflowExport.name,
- { className, workflowExport },
- ]
+ ([className, workflowExport]) => [workflowExport.name, className]
)
);
const errors: string[] = [];
for (const [index, workflow] of (config.workflows ?? []).entries()) {
- const match = exportsByWorkflowName.get(workflow.name);
- if (match === undefined) {
+ const className = exportsByWorkflowName.get(workflow.name);
+ if (className === undefined) {
continue;
}
- const { className, workflowExport } = match;
if (!isWorkflowDefinedInThisScript(workflow, scriptName)) {
errors.push(
`"workflows[${index}]" binds the Workflow "${workflow.name}" of the Worker "${workflow.script_name}", but "exports.${className}" declares it in this Worker. Workflow names are unique per account, so remove "script_name" from the binding or give the export a different name.`
@@ -104,16 +97,9 @@ export function validateOwnedWorkflowDeclarations(
"default_retention",
"jurisdiction",
] as const) {
- const bindingValue = workflow[key];
- const exportValue = workflowExport[key];
- // `schedules` accepts a string or an array; compare both as arrays.
- if (
- bindingValue !== undefined &&
- exportValue !== undefined &&
- !isDeepStrictEqual([bindingValue].flat(), [exportValue].flat())
- ) {
+ if (workflow[key] !== undefined) {
errors.push(
- `"workflows[${index}].${key}" and "exports.${className}.${key}" both configure the Workflow "${workflow.name}", but with different values. Set "${key}" in only one of them.`
+ `"workflows[${index}].${key}" configures the Workflow "${workflow.name}", which "exports.${className}" declares. Set "${key}" on the export instead.`
);
}
}
diff --git a/packages/deploy-helpers/src/deploy/versions-upload.ts b/packages/deploy-helpers/src/deploy/versions-upload.ts
index 727c8b52d9..ada6c6ff9e 100644
--- a/packages/deploy-helpers/src/deploy/versions-upload.ts
+++ b/packages/deploy-helpers/src/deploy/versions-upload.ts
@@ -183,7 +183,11 @@ async function uploadWorkerVersion(
// script_version row with `SkipDeploy:true`, so reconciliation is
// deferred to the subsequent deploy (either `wrangler deploy` or
// `wrangler versions deploy `).
- const { migrations, exports } = await resolveExportsUploadPayload({
+ const {
+ migrations,
+ exports,
+ headers: exportsHeaders,
+ } = await resolveExportsUploadPayload({
scriptName,
isDryRun: props.dryRun,
accountId,
@@ -359,9 +363,10 @@ async function uploadWorkerVersion(
{
method: "POST",
body: workerBundle,
- headers: props.sendMetrics
- ? { metricsEnabled: "true" }
- : undefined,
+ headers: {
+ ...exportsHeaders,
+ ...(props.sendMetrics && { metricsEnabled: "true" }),
+ },
},
new URLSearchParams({ bindings_inherit: "strict" })
),
diff --git a/packages/deploy-helpers/tests/owned-workflows.test.ts b/packages/deploy-helpers/tests/owned-workflows.test.ts
index a06e8090dc..2a66913a48 100644
--- a/packages/deploy-helpers/tests/owned-workflows.test.ts
+++ b/packages/deploy-helpers/tests/owned-workflows.test.ts
@@ -5,7 +5,7 @@ import {
} from "../src/deploy/helpers/owned-workflows";
describe("getWorkflowsOwnedByScript", () => {
- it("keeps the jurisdiction from either declaration of a Workflow", ({
+ it("takes the settings of a Workflow declared in both places from its export", ({
expect,
}) => {
expect(
@@ -16,11 +16,14 @@ describe("getWorkflowsOwnedByScript", () => {
binding: "GREETING",
name: "greeting",
class_name: "GreetingWorkflow",
- jurisdiction: "eu",
},
],
exports: {
- GreetingWorkflow: { type: "workflow", name: "greeting" },
+ GreetingWorkflow: {
+ type: "workflow",
+ name: "greeting",
+ jurisdiction: "eu",
+ },
OrdersWorkflow: {
type: "workflow",
name: "orders",
@@ -31,16 +34,14 @@ describe("getWorkflowsOwnedByScript", () => {
"my-worker"
)
).toMatchObject([
- { name: "greeting", jurisdiction: "eu" },
+ { name: "greeting", class_name: "GreetingWorkflow", jurisdiction: "eu" },
{ name: "orders", jurisdiction: "us" },
]);
});
});
describe("validateOwnedWorkflowDeclarations", () => {
- it("accepts a binding and an export that configure the same Workflow settings in different forms", ({
- expect,
- }) => {
+ it("accepts a binding to a Workflow declared in exports", ({ expect }) => {
expect(() =>
validateOwnedWorkflowDeclarations(
{
@@ -49,8 +50,7 @@ describe("validateOwnedWorkflowDeclarations", () => {
binding: "GREETING",
name: "greeting",
class_name: "GreetingWorkflow",
- limits: { steps: 10 },
- schedules: "0 * * * *",
+ script_name: "my-worker",
},
],
exports: {
@@ -58,7 +58,6 @@ describe("validateOwnedWorkflowDeclarations", () => {
type: "workflow",
name: "greeting",
limits: { steps: 10 },
- concurrency: { limit: 1 },
schedules: ["0 * * * *"],
},
},
@@ -92,7 +91,7 @@ describe("validateOwnedWorkflowDeclarations", () => {
);
});
- it("errors when a binding and an export configure the same Workflow with different settings", ({
+ it("errors when a binding sets settings for a Workflow declared in exports", ({
expect,
}) => {
expect(() =>
@@ -111,25 +110,17 @@ describe("validateOwnedWorkflowDeclarations", () => {
},
],
exports: {
- GreetingWorkflow: {
- type: "workflow",
- name: "greeting",
- limits: { steps: 20 },
- concurrency: { limit: 2 },
- schedules: ["30 * * * *"],
- default_retention: { success_retention: "2 days" },
- jurisdiction: "us",
- },
+ GreetingWorkflow: { type: "workflow", name: "greeting" },
},
},
"my-worker"
)
).toThrowErrorMatchingInlineSnapshot(`
- [Error: "workflows[0].limits" and "exports.GreetingWorkflow.limits" both configure the Workflow "greeting", but with different values. Set "limits" in only one of them.
- "workflows[0].concurrency" and "exports.GreetingWorkflow.concurrency" both configure the Workflow "greeting", but with different values. Set "concurrency" in only one of them.
- "workflows[0].schedules" and "exports.GreetingWorkflow.schedules" both configure the Workflow "greeting", but with different values. Set "schedules" in only one of them.
- "workflows[0].default_retention" and "exports.GreetingWorkflow.default_retention" both configure the Workflow "greeting", but with different values. Set "default_retention" in only one of them.
- "workflows[0].jurisdiction" and "exports.GreetingWorkflow.jurisdiction" both configure the Workflow "greeting", but with different values. Set "jurisdiction" in only one of them.]
+ [Error: "workflows[0].limits" configures the Workflow "greeting", which "exports.GreetingWorkflow" declares. Set "limits" on the export instead.
+ "workflows[0].concurrency" configures the Workflow "greeting", which "exports.GreetingWorkflow" declares. Set "concurrency" on the export instead.
+ "workflows[0].schedules" configures the Workflow "greeting", which "exports.GreetingWorkflow" declares. Set "schedules" on the export instead.
+ "workflows[0].default_retention" configures the Workflow "greeting", which "exports.GreetingWorkflow" declares. Set "default_retention" on the export instead.
+ "workflows[0].jurisdiction" configures the Workflow "greeting", which "exports.GreetingWorkflow" declares. Set "jurisdiction" on the export instead.]
`);
});
diff --git a/packages/wrangler/src/__tests__/deploy/workflows.test.ts b/packages/wrangler/src/__tests__/deploy/workflows.test.ts
index 5e2585f8dd..b04b1afbe9 100644
--- a/packages/wrangler/src/__tests__/deploy/workflows.test.ts
+++ b/packages/wrangler/src/__tests__/deploy/workflows.test.ts
@@ -145,6 +145,7 @@ describe("deploy", () => {
mockDeployWorkflow(expect, "my-workflow");
mockSubDomainRequest();
mockUploadWorkerRequest({
+ expectedScriptApiDate: null,
expectedBindings: [
{
type: "workflow",
@@ -1298,8 +1299,13 @@ describe("deploy", () => {
mockSubDomainRequest();
mockUploadWorkerRequest({
expectedExports: {
- MyWorkflow: { type: "workflow", name: "my-workflow" },
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ limits: { steps: 10 },
+ },
},
+ expectedScriptApiDate: "2026-11-09",
});
await runWrangler("deploy");
@@ -1351,7 +1357,18 @@ describe("deploy", () => {
mockSubDomainRequest();
mockUploadWorkerRequest({
expectedExports: {
- MyWorkflow: { type: "workflow", name: "my-workflow" },
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ limits: { steps: 10 },
+ concurrency: { limit: 5 },
+ schedules: ["0 * * * *", "30 * * * *"],
+ default_retention: {
+ success_retention: "3 days",
+ error_retention: 86_400_000,
+ },
+ jurisdiction: "fedramp",
+ },
},
});
@@ -1383,7 +1400,6 @@ describe("deploy", () => {
binding: "WORKFLOW",
name: "my-workflow",
class_name: "MyWorkflow",
- schedules: "0 * * * *",
},
],
exports: {
@@ -1419,7 +1435,11 @@ describe("deploy", () => {
},
],
expectedExports: {
- MyWorkflow: { type: "workflow", name: "my-workflow" },
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ limits: { steps: 10 },
+ },
},
});
@@ -1430,11 +1450,47 @@ describe("deploy", () => {
script_name: "test-name",
class_name: "MyWorkflow",
limits: { steps: 10 },
- schedules: [{ cron: "0 * * * *" }],
},
]);
});
+ it("should explain a paid-plan error for scheduled workflow exports returned by the deploy", async ({
+ expect,
+ }) => {
+ writeWranglerConfig({
+ main: "index.js",
+ exports: {
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ schedules: "0 * * * *",
+ },
+ },
+ });
+ await fs.promises.writeFile("index.js", workflowSource);
+
+ mockUploadWorkerRequest();
+ msw.use(
+ http.post(
+ "*/accounts/:accountId/workers/scripts/:scriptName/deployments",
+ () =>
+ HttpResponse.json(
+ createFetchResult(null, false, [
+ {
+ code: WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE,
+ message: "workflow.cron_requires_paid_plan",
+ },
+ ]),
+ { status: 403 }
+ )
+ )
+ );
+
+ await expect(runWrangler("deploy")).rejects.toThrow(
+ 'A Workflow has "schedules" configured, but scheduled Workflows require a paid Workers plan.'
+ );
+ });
+
it("should check a binding against an export using the name passed to --name", async ({
expect,
}) => {
diff --git a/packages/wrangler/src/__tests__/experimental-config/workflows.test.ts b/packages/wrangler/src/__tests__/experimental-config/workflows.test.ts
new file mode 100644
index 0000000000..2fe5fa80e5
--- /dev/null
+++ b/packages/wrangler/src/__tests__/experimental-config/workflows.test.ts
@@ -0,0 +1,121 @@
+import { runInTempDir, seed } from "@cloudflare/workers-utils/test-helpers";
+import { http, HttpResponse } from "msw";
+import dedent from "ts-dedent";
+import { beforeEach, describe, it, vi } from "vitest";
+import { mockLastDeploymentRequest } from "../deploy/helpers";
+import { mockAccountId, mockApiToken } from "../helpers/mock-account-id";
+import { mockConsoleMethods } from "../helpers/mock-console";
+import { mockUploadWorkerRequest } from "../helpers/mock-upload-worker";
+import { mockGetSettings } from "../helpers/mock-worker-settings";
+import { mockSubDomainRequest } from "../helpers/mock-workers-subdomain";
+import { createFetchResult, msw } from "../helpers/msw";
+import { mswListNewDeploymentsLatestFull } from "../helpers/msw/handlers/versions";
+import { runWrangler } from "../helpers/run-wrangler";
+
+vi.mock("@cloudflare/config", async (importOriginal) => {
+ const { createConfigMock } = await import("../helpers/mock-new-config");
+ return createConfigMock(importOriginal);
+});
+
+describe("Workflows in cloudflare.config.ts", () => {
+ runInTempDir();
+ mockAccountId();
+ mockApiToken();
+ mockConsoleMethods();
+ beforeEach(() => {
+ msw.use(
+ http.get(
+ "*/accounts/:accountId/workers/scripts/:scriptName/secrets",
+ () => HttpResponse.json(createFetchResult([]))
+ ),
+ http.get("*/accounts/:accountId/workflows/:workflowName", () =>
+ HttpResponse.json(
+ createFetchResult(null, false, [
+ { code: 10200, message: "Workflow not found" },
+ ]),
+ { status: 404 }
+ )
+ )
+ );
+ });
+
+ it("deploys a Workflow export that the Worker also binds", async ({
+ expect,
+ }) => {
+ await seed({
+ "cloudflare.config.ts": dedent`
+ export default { worker: {
+ name: "test-name",
+ entrypoint: "./index.js",
+ compatibilityDate: "2025-12-02",
+ exports: {
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ limits: { steps: 10 },
+ schedules: "0 * * * *",
+ defaultRetention: { successRetention: "3 days" },
+ },
+ },
+ env: {
+ WORKFLOW: { type: "workflow", name: "my-workflow", worker: "test-name", exportName: "MyWorkflow" },
+ },
+ } };
+ `,
+ "index.js": dedent`
+ import { WorkflowEntrypoint } from "cloudflare:workers";
+ export default {};
+ export class MyWorkflow extends WorkflowEntrypoint {}
+ `,
+ });
+ mockGetSettings();
+ mockLastDeploymentRequest();
+ msw.use(...mswListNewDeploymentsLatestFull);
+ mockSubDomainRequest();
+ mockUploadWorkerRequest({
+ expectedBindings: [
+ {
+ type: "workflow",
+ name: "WORKFLOW",
+ workflow_name: "my-workflow",
+ class_name: "MyWorkflow",
+ script_name: "test-name",
+ },
+ ],
+ expectedExports: {
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ limits: { steps: 10 },
+ schedules: "0 * * * *",
+ default_retention: { success_retention: "3 days" },
+ },
+ },
+ expectedScriptApiDate: "2026-11-09",
+ });
+ const putBodies: unknown[] = [];
+ msw.use(
+ http.put(
+ "*/accounts/:accountId/workflows/:workflowName",
+ async ({ request }) => {
+ putBodies.push(await request.json());
+ return HttpResponse.json(
+ createFetchResult({ id: "mock-new-workflow-id" })
+ );
+ }
+ )
+ );
+
+ await runWrangler("deploy --experimental-new-config");
+
+ expect(putBodies).toEqual([
+ {
+ script_name: "test-name",
+ class_name: "MyWorkflow",
+ limits: { steps: 10 },
+ schedules: [{ cron: "0 * * * *" }],
+ default_retention: { success_retention: "3 days" },
+ },
+ ]);
+ });
+});
diff --git a/packages/wrangler/src/__tests__/helpers/mock-upload-worker.ts b/packages/wrangler/src/__tests__/helpers/mock-upload-worker.ts
index ee669fcc0f..85272b81f8 100644
--- a/packages/wrangler/src/__tests__/helpers/mock-upload-worker.ts
+++ b/packages/wrangler/src/__tests__/helpers/mock-upload-worker.ts
@@ -78,6 +78,7 @@ export function mockUploadWorkerRequest(
expectedDeploymentMessage?: string;
expectedDurableObjectsCodeUpdateStrategy?: DurableObjectCodeUpdateStrategy;
expectedBindingsInherit?: "strict";
+ expectedScriptApiDate?: string | null;
} = {}
) {
const handleUpload: HttpResponseResolver = async ({ params, request }) => {
@@ -105,6 +106,11 @@ export function mockUploadWorkerRequest(
if (expectedDispatchNamespace) {
expect(params.dispatchNamespace).toEqual(expectedDispatchNamespace);
}
+ if (options.expectedScriptApiDate !== undefined) {
+ expect(request.headers.get("Cloudflare-Workers-Script-Api-Date")).toEqual(
+ options.expectedScriptApiDate
+ );
+ }
// eslint-disable-next-line @typescript-eslint/no-deprecated -- formData() is the standard Web API; only deprecated on undici's server-side types
const formBody = await request.formData();
diff --git a/packages/wrangler/src/__tests__/versions/versions.upload.test.ts b/packages/wrangler/src/__tests__/versions/versions.upload.test.ts
index a3b096a1c5..65032e4fdc 100644
--- a/packages/wrangler/src/__tests__/versions/versions.upload.test.ts
+++ b/packages/wrangler/src/__tests__/versions/versions.upload.test.ts
@@ -3020,7 +3020,7 @@ describe("versions upload", () => {
setIsTTY(false);
});
- test("sends workflow exports by name without provisioning the Workflow", async ({
+ test("sends workflow exports with their settings without provisioning the Workflow", async ({
expect,
}) => {
mockGetScript();
@@ -3059,9 +3059,17 @@ describe("versions upload", () => {
await runWrangler("versions upload --config ./wrangler.json");
- const metadata = await getMetadata(requests[requests.length - 1]);
+ const request = requests[requests.length - 1];
+ expect(request.headers.get("Cloudflare-Workers-Script-Api-Date")).toBe(
+ "2026-11-09"
+ );
+ const metadata = await getMetadata(request);
expect(metadata.exports).toEqual({
- MyWorkflow: { type: "workflow", name: "my-workflow" },
+ MyWorkflow: {
+ type: "workflow",
+ name: "my-workflow",
+ limits: { steps: 10 },
+ },
});
expect(workflowPuts).toBe(0);
});
From f005593c1ed0d1f429dafc6919c4335f4d5070c7 Mon Sep 17 00:00:00 2001
From: Leo Ostera
Date: Fri, 13 Nov 2026 10:29:14 +0000
Subject: [PATCH 04/30] [wrangler] Use the local Artifacts simulator when
remote is omitted (#16735)
---
.changeset/artifacts-local-by-default.md | 12 +++
.../miniflare/src/config/local-bindings.ts | 14 +--
packages/miniflare/src/config/v4-convert.ts | 8 +-
packages/miniflare/src/config/v4-schema.ts | 6 +-
.../plugins/artifacts/LOCAL_DEVELOPMENT.md | 15 +---
.../miniflare/src/plugins/artifacts/README.md | 5 +-
.../miniflare/src/plugins/artifacts/index.ts | 5 +-
.../test/config/local-bindings.spec.ts | 24 ++---
.../miniflare/test/config/v4-convert.spec.ts | 22 ++---
.../src/config-bindings.test.ts | 37 +-------
.../remote-bindings/src/config-bindings.ts | 32 -------
.../src/maybe-start-or-update-session.test.ts | 29 +++---
.../src/maybe-start-or-update-session.ts | 12 +--
.../src/__tests__/artifacts-local.spec.ts | 18 +++-
.../src/miniflare-options.ts | 31 +++++++
packages/vitest-plugin/src/pool/config.ts | 23 ++---
.../vitest-plugin/src/pool/local-artifacts.ts | 53 -----------
.../test/artifacts-local.test.ts | 8 +-
.../src/config/artifacts-local-default.ts | 69 ++++++++++++++
.../src/config/binding-local-support.ts | 41 +--------
packages/workers-utils/src/index.ts | 5 ++
.../config/artifacts-local-default.test.ts | 90 +++++++++++++++++++
.../config/binding-local-support.test.ts | 47 ++--------
.../tests/print-bindings.test.ts | 2 +-
.../src/__tests__/dev/artifacts-local.test.ts | 21 +++--
.../src/__tests__/dev/remote-bindings.test.ts | 49 +++++-----
.../src/__tests__/get-platform-proxy.test.ts | 65 ++++++++++++++
.../src/__tests__/print-bindings.test.ts | 2 +-
.../src/api/integrations/platform/index.ts | 20 +++++
.../startDevWorker/LocalRuntimeController.ts | 22 ++++-
packages/wrangler/src/dev/miniflare/index.ts | 7 +-
31 files changed, 435 insertions(+), 359 deletions(-)
create mode 100644 .changeset/artifacts-local-by-default.md
delete mode 100644 packages/vitest-plugin/src/pool/local-artifacts.ts
create mode 100644 packages/workers-utils/src/config/artifacts-local-default.ts
create mode 100644 packages/workers-utils/tests/config/artifacts-local-default.test.ts
diff --git a/.changeset/artifacts-local-by-default.md b/.changeset/artifacts-local-by-default.md
new file mode 100644
index 0000000000..c9800753b9
--- /dev/null
+++ b/.changeset/artifacts-local-by-default.md
@@ -0,0 +1,12 @@
+---
+"wrangler": minor
+"miniflare": minor
+"@cloudflare/vite-plugin": minor
+"@cloudflare/workers-utils": minor
+---
+
+Use the local simulator for Artifacts bindings that omit `remote`
+
+**Behavior change:** Artifacts bindings now default to the local simulator during development, like KV, R2 and D1. Previously, an omitted `remote` in Wrangler and the Vite plugin used the deployed Artifacts resource. If you want deployed repos in `wrangler dev` or `vite dev`, set `"remote": true` on the binding (`dev: { remote: true }` in `cloudflare.config.ts`). Artifacts is in beta, so this ships as a minor release.
+
+While `remote` is omitted, `wrangler dev`, `getPlatformProxy()` and the Vite plugin warn when remote bindings are enabled, once for each binding rather than on every config reload: "Artifacts binding REPOS uses the local simulator by default. Set `remote: true` to use deployed repos, or `remote: false` to silence this warning." Workers Vitest and `wrangler dev --local` already used the simulator, so they don't warn. Local Artifacts needs no Cloudflare credentials, but requires Git 2.32 or newer on the host.
diff --git a/packages/miniflare/src/config/local-bindings.ts b/packages/miniflare/src/config/local-bindings.ts
index ef07be5c94..4e8a20e16a 100644
--- a/packages/miniflare/src/config/local-bindings.ts
+++ b/packages/miniflare/src/config/local-bindings.ts
@@ -24,7 +24,7 @@ export interface ResolveLocalBindingsOptions {
/**
* Resolves local binding values from the loaded local env. This replaces
* declared secret placeholders with text bindings, applies Hyperdrive
- * connection-string overrides, and resolves the Artifacts `dev.remote` default. Missing secrets are omitted, with a warning, so
+ * connection-string overrides. Missing secrets are omitted, with a warning, so
* Miniflare doesn't receive an unresolved deployment-only placeholder.
*
* @param configuredBindings The Worker's configured bindings.
@@ -61,18 +61,6 @@ export function resolveLocalBindings(
continue;
}
- // Artifacts uses the deployed resource unless `dev.remote` is `false`.
- // Miniflare routes a binding remotely only for an explicit
- // `dev.remote: true`, so resolve the default here, where it is known
- // whether remote bindings are enabled.
- if (binding.type === "artifacts") {
- bindings[name] =
- binding.dev?.remote === undefined
- ? { ...binding, dev: { ...binding.dev, remote: remoteBindings } }
- : binding;
- continue;
- }
-
if (binding.type === "secret") {
const localValue = localValues[name];
if (localValue !== undefined) {
diff --git a/packages/miniflare/src/config/v4-convert.ts b/packages/miniflare/src/config/v4-convert.ts
index 8a59a11a2b..53bc8f2d8d 100644
--- a/packages/miniflare/src/config/v4-convert.ts
+++ b/packages/miniflare/src/config/v4-convert.ts
@@ -815,13 +815,7 @@ function addProductBindings(
env[name] = {
type: "artifacts",
namespace: binding.namespace,
- // Without a remote proxy connection (for example `wrangler dev
- // --local`) the deployed resource is unreachable, so use the simulator.
- dev: {
- remote:
- binding.remote !== false &&
- isRemote(binding.remoteProxyConnectionString),
- },
+ dev: { remote: isRemote(binding.remoteProxyConnectionString) },
};
}
for (const name of Object.keys(worker.workerLoaders ?? {})) {
diff --git a/packages/miniflare/src/config/v4-schema.ts b/packages/miniflare/src/config/v4-schema.ts
index 1efb8ec2f6..14cc238136 100644
--- a/packages/miniflare/src/config/v4-schema.ts
+++ b/packages/miniflare/src/config/v4-schema.ts
@@ -641,7 +641,6 @@ const V4WorkerOptionsShapeSchema = z.object({
z.string(),
z.object({
namespace: z.string(),
- remote: z.boolean().optional(),
remoteProxyConnectionString:
RemoteProxyConnectionStringSchema.optional(),
})
@@ -986,10 +985,7 @@ export type V4WorkerOptionsShape = {
>;
helloWorld?: Record;
flagship?: Record;
- artifacts?: Record<
- string,
- { namespace: string; remote?: boolean } & V4RemoteBinding
- >;
+ artifacts?: Record;
workerLoaders?: Record>;
media?: V4RemoteBindingWithName;
versionMetadata?: string;
diff --git a/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md b/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md
index af2ff654c5..24dfdf42b0 100644
--- a/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md
+++ b/packages/miniflare/src/plugins/artifacts/LOCAL_DEVELOPMENT.md
@@ -6,7 +6,7 @@ This first version of the local Artifacts emulator requires Git 2.32 or newer in
Git 2.32 provides `GIT_CONFIG_GLOBAL`, which the emulator uses to isolate host Git settings. Use an up-to-date, security-patched release.
-In Wrangler and Vite, a binding with `"remote": true` or an omitted `remote` setting does not start the local emulator and does not need local Git, unless remote bindings are disabled (see below). Workers Vitest uses the local emulator unless `remote` is `true`. Production Artifacts also does not require Git on your machine. We plan to open-source a JavaScript Git engine in the future; it is not part of this initial local release, which uses native Git.
+A binding with `"remote": true` does not start the local emulator and does not need local Git, unless remote bindings are disabled (see below). Production Artifacts also does not require Git on your machine. We plan to open-source a JavaScript Git engine in the future; it is not part of this initial local release, which uses native Git.
## Configure a binding
@@ -17,9 +17,7 @@ For a Wrangler project, add an Artifacts binding to `wrangler.jsonc`:
"name": "example-worker",
"main": "src/index.ts",
"compatibility_date": "2026-09-03",
- "artifacts": [
- { "binding": "REPOS", "namespace": "examples", "remote": false },
- ],
+ "artifacts": [{ "binding": "REPOS", "namespace": "examples" }],
}
```
@@ -34,10 +32,7 @@ export default defineConfig({
entrypoint: "./src/index.ts",
compatibilityDate: "2026-09-03",
env: {
- REPOS: bindings.artifacts({
- namespace: "examples",
- dev: { remote: false },
- }),
+ REPOS: bindings.artifacts({ namespace: "examples" }),
},
},
});
@@ -45,9 +40,7 @@ export default defineConfig({
In Workers Vitest, point `cloudflareTest({ wrangler: { configPath: "./wrangler.jsonc" } })` at the Wrangler config above, or `cloudflareTest({ config: true })` at `cloudflare.config.ts`. These paths share the Miniflare implementation.
-In Wrangler and Vite, the local emulator is opt-in: set `remote: false` on the binding. If `remote` is omitted or set to `true`, development uses the deployed Artifacts resource and the credentials required by that tool; with `remote` omitted, the dev tool warns that changes affect real repositories. When remote bindings are disabled (`wrangler dev --local`, or Vite's `remoteBindings: false`), every Artifacts binding uses the local emulator.
-
-Workers Vitest defaults the other way, so a test suite does not create, push to or delete real repositories by accident: an omitted `remote` uses the local emulator, and `remote: true` opts into the deployed resource. Do not rely on production repositories being available locally.
+Artifacts bindings use the local emulator by default in Wrangler, Vite and Workers Vitest, like KV, R2 and D1. Set `remote: true` (`dev: { remote: true }` in `cloudflare.config.ts`) to use deployed repos instead, with the credentials required by your tool. Artifacts used to default to deployed repos, so while `remote` is omitted, `wrangler dev`, `getPlatformProxy()` and Vite warn once for each binding, not on every config reload, that the binding uses the local simulator; set `remote: false` to silence the warning. When remote bindings are disabled (`wrangler dev --local`, or Vite's `remoteBindings: false`), every Artifacts binding uses the local emulator. Do not rely on production repositories being available locally.
A Worker can create and inspect a local repository:
diff --git a/packages/miniflare/src/plugins/artifacts/README.md b/packages/miniflare/src/plugins/artifacts/README.md
index b1ebe36ddd..de6c16148e 100644
--- a/packages/miniflare/src/plugins/artifacts/README.md
+++ b/packages/miniflare/src/plugins/artifacts/README.md
@@ -9,10 +9,7 @@ available on PATH. Miniflare checks the Git version at local startup and gives
installation or upgrade instructions if needed. A Node worker thread runs the
native Git backend. Like every other binding, an Artifacts binding uses the
remote proxy only when `dev.remote` is `true` and the Worker has a remote proxy
-connection string; otherwise it uses local storage. The tools resolve the
-Artifacts default (deployed unless `remote: false`) before they reach
-Miniflare: Wrangler sets `dev.remote` when converting its config, and
-`resolveLocalBindings()` does it for `cloudflare.config.ts`. We plan to
+connection string; otherwise it uses local storage. We plan to
open-source a JavaScript Git engine in the future; it is not included in this
version.
diff --git a/packages/miniflare/src/plugins/artifacts/index.ts b/packages/miniflare/src/plugins/artifacts/index.ts
index ab50a8fc19..59d16a89d6 100644
--- a/packages/miniflare/src/plugins/artifacts/index.ts
+++ b/packages/miniflare/src/plugins/artifacts/index.ts
@@ -35,10 +35,7 @@ type ArtifactsBinding = Extract;
type ArtifactsEntry = [name: string, binding: ArtifactsBinding];
// Artifacts routes like every other binding: remote only when `dev.remote` is
-// `true` and the Worker has a remote proxy connection. Its deployed-by-default
-// rule is resolved before Miniflare, by `resolveBindingRemote()` in
-// `@cloudflare/workers-utils` for Wrangler configs and by
-// `resolveLocalBindings()` for `cloudflare.config.ts`.
+// `true` and the Worker has a remote proxy connection.
function getLocalNamespaceNames(
bindings: ArtifactsEntry[],
diff --git a/packages/miniflare/test/config/local-bindings.spec.ts b/packages/miniflare/test/config/local-bindings.spec.ts
index b0e4fd28eb..03bedd2d15 100644
--- a/packages/miniflare/test/config/local-bindings.spec.ts
+++ b/packages/miniflare/test/config/local-bindings.spec.ts
@@ -74,25 +74,25 @@ describe("resolveLocalBindings", () => {
});
test.for([
- { remote: undefined, remoteBindings: true, resolved: true },
- { remote: undefined, remoteBindings: false, resolved: false },
- { remote: false, remoteBindings: true, resolved: false },
- { remote: true, remoteBindings: true, resolved: true },
- // Miniflare uses the simulator without a remote proxy connection.
- { remote: true, remoteBindings: false, resolved: true },
+ { remote: undefined, remoteBindings: true },
+ { remote: undefined, remoteBindings: false },
+ { remote: false, remoteBindings: true },
+ { remote: true, remoteBindings: true },
])(
- "resolves Artifacts dev.remote=$remote with remoteBindings=$remoteBindings",
- ({ remote, remoteBindings, resolved }, { expect }) => {
+ "passes Artifacts dev.remote=$remote through with remoteBindings=$remoteBindings",
+ ({ remote, remoteBindings }, { expect }) => {
const binding = {
type: "artifacts" as const,
namespace: "examples",
...(remote === undefined ? {} : { dev: { remote } }),
};
- expect(
- resolveLocalBindings({ REPOS: binding }, options({ remoteBindings }))
- ).toEqual({
- REPOS: { ...binding, dev: { remote: resolved } },
+ // Miniflare routes remotely only for `dev.remote: true`, so an omitted
+ // `remote` uses the local simulator.
+ const resolveOptions = options({ remoteBindings });
+ expect(resolveLocalBindings({ REPOS: binding }, resolveOptions)).toEqual({
+ REPOS: binding,
});
+ expect(resolveOptions.logger.warn).not.toHaveBeenCalled();
}
);
});
diff --git a/packages/miniflare/test/config/v4-convert.spec.ts b/packages/miniflare/test/config/v4-convert.spec.ts
index 76336f87c2..dea97e741a 100644
--- a/packages/miniflare/test/config/v4-convert.spec.ts
+++ b/packages/miniflare/test/config/v4-convert.spec.ts
@@ -41,7 +41,7 @@ describe("convertV4MiniflareOptions", () => {
}
);
- test("Artifacts uses a connected remote proxy unless local is selected", ({
+ test("Artifacts uses a remote proxy only when given a connection string", ({
expect,
}) => {
const remoteProxyConnectionString = new URL(
@@ -51,20 +51,15 @@ describe("convertV4MiniflareOptions", () => {
name: "worker",
script: "export default {};",
artifacts: {
- DEFAULT: { namespace: "default", remoteProxyConnectionString },
- LOCAL: {
- namespace: "local",
- remote: false,
- remoteProxyConnectionString,
- },
- // `wrangler dev --local` passes no connection string.
- OFFLINE: { namespace: "offline" },
+ // Wrangler passes a connection string only for `remote: true`.
+ REMOTE: { namespace: "remote", remoteProxyConnectionString },
+ LOCAL: { namespace: "local" },
},
});
const env = converted.workers[0].config.env;
- expect(env?.DEFAULT).toEqual({
+ expect(env?.REMOTE).toEqual({
type: "artifacts",
- namespace: "default",
+ namespace: "remote",
dev: { remote: true },
});
expect(env?.LOCAL).toEqual({
@@ -72,11 +67,6 @@ describe("convertV4MiniflareOptions", () => {
namespace: "local",
dev: { remote: false },
});
- expect(env?.OFFLINE).toEqual({
- type: "artifacts",
- namespace: "offline",
- dev: { remote: false },
- });
expect(converted.workers[0].dev?.remoteProxyConnectionString).toBe(
remoteProxyConnectionString
);
diff --git a/packages/remote-bindings/src/config-bindings.test.ts b/packages/remote-bindings/src/config-bindings.test.ts
index d2fe523478..3a848e5408 100644
--- a/packages/remote-bindings/src/config-bindings.test.ts
+++ b/packages/remote-bindings/src/config-bindings.test.ts
@@ -1,38 +1,5 @@
-import { describe, test, vi } from "vitest";
-import {
- getRemoteBindings,
- warnForDefaultRemoteBindings,
-} from "./config-bindings";
-
-describe("warnForDefaultRemoteBindings", () => {
- test.for([
- { remote: undefined, enabled: true, warns: true },
- { remote: false, enabled: true, warns: false },
- { remote: true, enabled: true, warns: false },
- { remote: undefined, enabled: false, warns: false },
- { remote: false, enabled: false, warns: false },
- { remote: true, enabled: false, warns: false },
- ])(
- "remote=$remote enabled=$enabled",
- ({ remote, enabled, warns }, { expect }) => {
- const warn = vi.fn();
- const bindings = getRemoteBindings({
- env: {
- REPOS: { type: "artifacts", namespace: "examples", dev: { remote } },
- KV: { type: "kv", id: "kv-id" },
- },
- });
- warnForDefaultRemoteBindings(bindings, enabled, warn);
- if (warns) {
- expect(warn).toHaveBeenCalledExactlyOnceWith(
- "Artifacts binding REPOS uses the deployed resource. Set `dev: { remote: false }` to use the local simulator, or `dev: { remote: true }` to silence this warning."
- );
- } else {
- expect(warn).not.toHaveBeenCalled();
- }
- }
- );
-});
+import { describe, test } from "vitest";
+import { getRemoteBindings } from "./config-bindings";
describe("getRemoteBindings", () => {
test("maps supported remote bindings", ({ expect }) => {
diff --git a/packages/remote-bindings/src/config-bindings.ts b/packages/remote-bindings/src/config-bindings.ts
index 6015cc8b76..72d9072ff6 100644
--- a/packages/remote-bindings/src/config-bindings.ts
+++ b/packages/remote-bindings/src/config-bindings.ts
@@ -1,7 +1,3 @@
-import {
- getBindingLocalSupport,
- validateBindingRemoteSetting,
-} from "@cloudflare/workers-utils";
import type {
ParsedInputWorkerConfig,
ParsedOutputWorkerConfig,
@@ -13,34 +9,6 @@ type WorkerConfig = ParsedInputWorkerConfig | ParsedOutputWorkerConfig;
/** Bindings as declared in `cloudflare.config.ts`. */
export type ConfigBindings = WorkerConfig["env"];
-/**
- * Warns before native-config development accesses deployed data by default.
- * Explicit remote settings and sessions with remote bindings disabled are silent.
- */
-export function warnForDefaultRemoteBindings(
- bindings: Record,
- remoteBindingsEnabled: boolean,
- warn: (message: string) => void
-): void {
- for (const [name, binding] of Object.entries(bindings)) {
- if (
- getBindingLocalSupport(binding.type) ===
- "remote-default-with-local-opt-in"
- ) {
- validateBindingRemoteSetting(
- binding.type,
- "remote" in binding ? binding.remote : undefined,
- warn,
- {
- binding: name,
- remoteBindingsDisabled: !remoteBindingsEnabled,
- configFormat: "cloudflare-config",
- }
- );
- }
- }
-}
-
/**
* Convert native config bindings to the transport shape consumed by the
* remote-bindings session API. Local-only bindings are intentionally omitted.
diff --git a/packages/remote-bindings/src/maybe-start-or-update-session.test.ts b/packages/remote-bindings/src/maybe-start-or-update-session.test.ts
index 856c6feb68..1115be7a23 100644
--- a/packages/remote-bindings/src/maybe-start-or-update-session.test.ts
+++ b/packages/remote-bindings/src/maybe-start-or-update-session.test.ts
@@ -54,12 +54,10 @@ describe("maybeStartOrUpdateRemoteProxySession", () => {
}
);
- it("selects Artifacts remotely by default and locally only when opted in", ({
- expect,
- }) => {
- const defaultRemote = {
+ it("selects Artifacts remotely only when opted in", ({ expect }) => {
+ const defaultLocal = {
type: "artifacts" as const,
- namespace: "default-remote",
+ namespace: "default-local",
};
const local = {
type: "artifacts" as const,
@@ -73,15 +71,15 @@ describe("maybeStartOrUpdateRemoteProxySession", () => {
};
expect(
pickRemoteBindings({
- DEFAULT: defaultRemote,
+ DEFAULT: defaultLocal,
LOCAL: local,
REMOTE: remote,
})
- ).toEqual({ DEFAULT: defaultRemote, REMOTE: remote });
+ ).toEqual({ REMOTE: remote });
});
it.for([undefined, false, true])(
- "routes native Artifacts and warns only for the default remote=%s",
+ "starts a session for native Artifacts only when remote=%s is true",
async (remote, { expect }) => {
const logger = createTestLogger();
const startSession = vi.fn(async () =>
@@ -103,22 +101,17 @@ describe("maybeStartOrUpdateRemoteProxySession", () => {
{ cliDisplayName: "Wrangler", logger },
startSession
);
- if (remote === false) {
- expect(result).toBeNull();
- expect(startSession).not.toHaveBeenCalled();
- } else {
+ if (remote === true) {
expect(startSession).toHaveBeenCalledWith(
{ REPOS: { type: "artifacts", namespace: "examples", remote } },
expect.anything()
);
- }
- if (remote === undefined) {
- expect(logger.warn).toHaveBeenCalledExactlyOnceWith(
- "Artifacts binding REPOS uses the deployed resource. Set `dev: { remote: false }` to use the local simulator, or `dev: { remote: true }` to silence this warning."
- );
} else {
- expect(logger.warn).not.toHaveBeenCalled();
+ expect(result).toBeNull();
+ expect(startSession).not.toHaveBeenCalled();
}
+ // The dev tools warn about the local default; the session never does.
+ expect(logger.warn).not.toHaveBeenCalled();
}
);
diff --git a/packages/remote-bindings/src/maybe-start-or-update-session.ts b/packages/remote-bindings/src/maybe-start-or-update-session.ts
index dce661be35..e9e2fd4aa3 100644
--- a/packages/remote-bindings/src/maybe-start-or-update-session.ts
+++ b/packages/remote-bindings/src/maybe-start-or-update-session.ts
@@ -1,9 +1,6 @@
import assert from "node:assert";
import { resolveBindingRemote } from "@cloudflare/workers-utils";
-import {
- getRemoteBindings,
- warnForDefaultRemoteBindings,
-} from "./config-bindings";
+import { getRemoteBindings } from "./config-bindings";
import { startRemoteProxySession } from "./start-remote-proxy-session";
import type { ConfigBindings } from "./config-bindings";
import type { RemoteBindingsLogger } from "./logger";
@@ -89,13 +86,6 @@ export async function maybeStartOrUpdateRemoteProxySession(
workerConfigObject.target === "cf"
? getRemoteBindings({ env: workerConfigObject.env })
: workerConfigObject.bindings;
- if (workerConfigObject.target === "cf") {
- // Native-config consumers skip this function when remote bindings are
- // disabled. Wrangler emits its warning when building Miniflare options.
- warnForDefaultRemoteBindings(bindings, true, (message) =>
- context.logger.warn(message)
- );
- }
const remoteBindings = pickRemoteBindings(bindings);
if (
Object.keys(remoteBindings).length === 0 &&
diff --git a/packages/vite-plugin-cloudflare/src/__tests__/artifacts-local.spec.ts b/packages/vite-plugin-cloudflare/src/__tests__/artifacts-local.spec.ts
index 51d5e222f3..2783f47bf3 100644
--- a/packages/vite-plugin-cloudflare/src/__tests__/artifacts-local.spec.ts
+++ b/packages/vite-plugin-cloudflare/src/__tests__/artifacts-local.spec.ts
@@ -3,7 +3,7 @@ import * as path from "node:path";
import { cloudflare } from "@cloudflare/vite-plugin";
import { removeDirSync } from "@cloudflare/workers-utils";
import { pushGitFixture } from "@cloudflare/workers-utils/test-helpers";
-import { createServer } from "vite";
+import { createLogger, createServer } from "vite";
import { afterEach, test, vi } from "vitest";
// Excluded from type checking, so a crashed run cannot leave a stray
@@ -66,6 +66,9 @@ afterEach(() => vi.unstubAllEnvs());
test.for([
{ label: "explicit local", remote: false, remoteBindings: true },
+ // Omitted `remote` is local without starting a remote proxy session, so it
+ // works with no Cloudflare credentials.
+ { label: "omitted remote", remote: undefined, remoteBindings: true },
{
label: "omitted remote with sessions disabled",
remote: undefined,
@@ -83,10 +86,13 @@ test.for([
vi.stubEnv("CLOUDFLARE_ACCOUNT_ID", undefined);
const root = createFixture(remote);
onTestFinished(() => removeDirSync(root));
+ const warnings: string[] = [];
+ const customLogger = createLogger("silent");
+ customLogger.warn = (message) => void warnings.push(message);
const server = await createServer({
root,
configFile: false,
- logLevel: "silent",
+ customLogger,
server: { port: 0 },
plugins: [
cloudflare({
@@ -126,6 +132,14 @@ test.for([
name: string;
};
expect(info.name).toBe("demo");
+ // The default changed only where remote bindings are enabled.
+ const defaultWarning =
+ "Artifacts binding REPOS uses the local simulator by default. Set `dev: { remote: true }` to use deployed repos, or `dev: { remote: false }` to silence this warning.";
+ if (remote === undefined && remoteBindings) {
+ expect(warnings).toContain(defaultWarning);
+ } else {
+ expect(warnings).not.toContain(defaultWarning);
+ }
} finally {
await server.close();
}
diff --git a/packages/vite-plugin-cloudflare/src/miniflare-options.ts b/packages/vite-plugin-cloudflare/src/miniflare-options.ts
index e0081fd4d2..7ecc600ba3 100644
--- a/packages/vite-plugin-cloudflare/src/miniflare-options.ts
+++ b/packages/vite-plugin-cloudflare/src/miniflare-options.ts
@@ -18,6 +18,7 @@ import {
getLocalObservabilityEnabledFromEnv,
getZoneFromRoute,
} from "@cloudflare/workers-utils";
+import { createArtifactsLocalDefaultWarner } from "@cloudflare/workers-utils";
import { getDockerPath } from "@cloudflare/workers-utils/docker-path";
import {
buildPublicUrl,
@@ -262,6 +263,7 @@ export async function getDevMiniflareOptions(
resolvedPluginConfig.devVars,
resolvedPluginConfig.remoteBindings,
resolvedViteConfig.mode,
+ resolvedViteConfig.root,
viteDevServer.config.logger
);
const [routerWorkerManifest, assetWorkerManifest, viteProxyWorkerManifest] =
@@ -814,6 +816,7 @@ export async function getPreviewMiniflareOptions(
resolvedPluginConfig.devVars,
resolvedPluginConfig.remoteBindings,
resolvedViteConfig.mode,
+ resolvedViteConfig.root,
vitePreviewServer.config.logger
);
const containerPlansByWorkerName = new Map();
@@ -957,16 +960,44 @@ export async function getPreviewMiniflareOptions(
};
}
+// Remembers warnings per project root, so restarting the dev server after a
+// config change doesn't repeat them.
+const warnForArtifactsLocalDefault =
+ createArtifactsLocalDefaultWarner("cloudflare-config");
+
function resolveLocalBindingsByWorkerName(
workerConfigs: Array,
localEnv: LoadedEnv,
devVars: Record | undefined,
remoteBindings: boolean,
mode: string,
+ projectRoot: string,
logger: vite.Logger
): Map {
const resolvedLocalBindingsByWorkerName = new Map();
for (const config of workerConfigs) {
+ if (remoteBindings) {
+ warnForArtifactsLocalDefault(
+ {
+ id: projectRoot,
+ bindings: Object.entries(config.env ?? {}).flatMap(
+ ([name, binding]) =>
+ binding.type === "artifacts"
+ ? [
+ {
+ name,
+ remote: binding.dev?.remote,
+ // Name the Worker when several could declare the binding.
+ worker:
+ workerConfigs.length > 1 ? config.name : undefined,
+ },
+ ]
+ : []
+ ),
+ },
+ (message) => logger.warn(message)
+ );
+ }
resolvedLocalBindingsByWorkerName.set(
config.name,
resolveLocalBindings(config.env, {
diff --git a/packages/vitest-plugin/src/pool/config.ts b/packages/vitest-plugin/src/pool/config.ts
index 274f6f4adf..5369e26e7b 100644
--- a/packages/vitest-plugin/src/pool/config.ts
+++ b/packages/vitest-plugin/src/pool/config.ts
@@ -30,10 +30,6 @@ import {
getRunnerName,
WORKER_NAME_PREFIX,
} from "./helpers";
-import {
- defaultNewConfigArtifactsToLocal,
- defaultWranglerConfigArtifactsToLocal,
-} from "./local-artifacts";
import {
loadNewConfig,
mergeCloudflareConfigWorker,
@@ -674,14 +670,7 @@ async function parseCustomPoolOptions(
if (newConfig !== undefined) {
configPath = path.resolve(rootPath, newConfig.configPath);
- const loadedConfig = await loadNewConfig(configPath, mode, envDir);
- cloudflareConfig = {
- ...loadedConfig,
- worker: {
- ...loadedConfig.worker,
- env: defaultNewConfigArtifactsToLocal(loadedConfig.worker.env),
- },
- };
+ cloudflareConfig = await loadNewConfig(configPath, mode, envDir);
const { worker, settings } = cloudflareConfig;
options.resolvedConfig = {
path: configPath,
@@ -754,12 +743,10 @@ async function parseCustomPoolOptions(
// we can pass the parsed config straight into
// `unstable_getMiniflareWorkerOptions` without re-parsing it.
const wrangler = await import("wrangler");
- config = defaultWranglerConfigArtifactsToLocal(
- wrangler.unstable_readConfig({
- config: configPath,
- env: environment,
- })
- );
+ config = wrangler.unstable_readConfig({
+ config: configPath,
+ env: environment,
+ });
}
if (configPath !== undefined && config !== undefined) {
diff --git a/packages/vitest-plugin/src/pool/local-artifacts.ts b/packages/vitest-plugin/src/pool/local-artifacts.ts
deleted file mode 100644
index ddf1f4e1f1..0000000000
--- a/packages/vitest-plugin/src/pool/local-artifacts.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import type { ParsedInputWorkerConfig } from "@cloudflare/config";
-import type { Config } from "@cloudflare/workers-utils";
-
-// Tests should not create, push to or delete real repositories by accident, so
-// Workers Vitest uses the local Artifacts simulator unless a binding opts into
-// the deployed resource with `remote: true`. Wrangler and Vite default to the
-// deployed resource instead, with a warning.
-//
-// Making the omitted setting explicit before anything else reads the config
-// keeps the remote proxy session, the default-remote warning and Miniflare's
-// routing in agreement.
-
-/**
- * Sets `dev.remote: false` on `cloudflare.config.ts` Artifacts bindings that
- * omit it.
- *
- * @param env The Worker's configured bindings.
- * @returns The bindings, with every Artifacts binding's `dev.remote` set.
- */
-export function defaultNewConfigArtifactsToLocal(
- env: ParsedInputWorkerConfig["env"]
-): ParsedInputWorkerConfig["env"] {
- if (env === undefined) {
- return env;
- }
- return Object.fromEntries(
- Object.entries(env).map(([name, binding]) => [
- name,
- binding.type === "artifacts" && binding.dev?.remote === undefined
- ? { ...binding, dev: { ...binding.dev, remote: false } }
- : binding,
- ])
- );
-}
-
-/**
- * Sets `remote: false` on Wrangler config Artifacts bindings that omit it.
- *
- * @param config The parsed Wrangler config.
- * @returns The config, with every Artifacts binding's `remote` set.
- */
-export function defaultWranglerConfigArtifactsToLocal(config: Config): Config {
- if (config.artifacts.every((binding) => binding.remote !== undefined)) {
- return config;
- }
- return {
- ...config,
- artifacts: config.artifacts.map((binding) => ({
- ...binding,
- remote: binding.remote ?? false,
- })),
- };
-}
diff --git a/packages/vitest-plugin/test/artifacts-local.test.ts b/packages/vitest-plugin/test/artifacts-local.test.ts
index b62f816635..a642e643e1 100644
--- a/packages/vitest-plugin/test/artifacts-local.test.ts
+++ b/packages/vitest-plugin/test/artifacts-local.test.ts
@@ -61,8 +61,8 @@ function cloudflareConfig(): Record {
};
}
-// Unlike Wrangler and Vite, Workers Vitest keeps tests away from real
-// repositories: an omitted `remote` uses the local simulator, without a warning.
+// An omitted `remote` uses the local simulator. Workers Vitest always did, so
+// unlike Wrangler and Vite it doesn't warn that the default changed.
test.for([
{ label: "Wrangler config with remote=false", files: wranglerConfig(false) },
{
@@ -84,6 +84,8 @@ test.for([
const result = await vitestRun();
await expect(result.exitCode, result.stderr).resolves.toBe(0);
- expect(result.stdout + result.stderr).not.toContain("deployed resource");
+ expect(result.stdout + result.stderr).not.toContain(
+ "uses the local simulator by default"
+ );
}
);
diff --git a/packages/workers-utils/src/config/artifacts-local-default.ts b/packages/workers-utils/src/config/artifacts-local-default.ts
new file mode 100644
index 0000000000..ab379acdcf
--- /dev/null
+++ b/packages/workers-utils/src/config/artifacts-local-default.ts
@@ -0,0 +1,69 @@
+/**
+ * An Artifacts binding as far as its development default is concerned.
+ */
+export interface ArtifactsDevBinding {
+ /** The binding name, such as `REPOS`. */
+ name: string;
+ /** The binding's configured `remote` setting. */
+ remote: boolean | undefined;
+ /**
+ * The Worker that declares the binding. Set it when a config declares
+ * several Workers, so the warning says which one it means.
+ */
+ worker?: string;
+}
+
+/**
+ * Warns about Artifacts bindings that use the local simulator only because
+ * `remote` is omitted.
+ *
+ * @param project Identifies the project the bindings come from, such as its
+ * config path or root. Warnings are remembered per project, so two projects in
+ * one process each get their own.
+ */
+export type ArtifactsLocalDefaultWarner = (
+ project: { id: string; bindings: Iterable },
+ warn: (message: string) => void
+) => void;
+
+/**
+ * Artifacts bindings used deployed repos by default during development, and
+ * now use the local simulator like every other binding. Someone who relied on
+ * the old default would silently stop seeing their deployed repos, so warn
+ * about an omitted `remote` where the default changed: development sessions
+ * with remote bindings enabled. Workers Vitest and `--local` sessions already
+ * used the simulator, so their callers don't warn.
+ *
+ * The returned warner warns once per project, Worker and binding, so a session
+ * that reloads its config doesn't repeat the warning.
+ *
+ * TODO: Remove when Artifacts is generally available.
+ *
+ * @param configFormat Which config format the bindings come from, so the
+ * warning names the setting the user can write: `remote` in a Wrangler config,
+ * `dev: { remote }` in `cloudflare.config.ts`.
+ */
+export function createArtifactsLocalDefaultWarner(
+ configFormat: "wrangler" | "cloudflare-config"
+): ArtifactsLocalDefaultWarner {
+ const remoteSetting = (value: boolean) =>
+ configFormat === "cloudflare-config"
+ ? `\`dev: { remote: ${value} }\``
+ : `\`remote: ${value}\``;
+ const warned = new Set();
+ return ({ id, bindings }, warn) => {
+ for (const { name, remote, worker } of bindings) {
+ // JSON keeps the parts apart whatever characters they contain.
+ const key = JSON.stringify([id, worker ?? null, name]);
+ if (remote !== undefined || warned.has(key)) {
+ continue;
+ }
+ warned.add(key);
+ const subject =
+ worker === undefined ? name : `${name} in Worker ${worker}`;
+ warn(
+ `Artifacts binding ${subject} uses the local simulator by default. Set ${remoteSetting(true)} to use deployed repos, or ${remoteSetting(false)} to silence this warning.`
+ );
+ }
+ };
+}
diff --git a/packages/workers-utils/src/config/binding-local-support.ts b/packages/workers-utils/src/config/binding-local-support.ts
index 43ff6adaed..0c7e9ae5e9 100644
--- a/packages/workers-utils/src/config/binding-local-support.ts
+++ b/packages/workers-utils/src/config/binding-local-support.ts
@@ -8,8 +8,6 @@ import type { Binding } from "../types";
* `pickRemoteBindings()` and `validateBindingRemoteSetting()`.
*
* - `local-and-remote`: local simulator; `remote: true` opts into proxying.
- * - `remote-default-with-local-opt-in`: remote by default; `remote: false`
- * opts into the local simulator.
* - `local-only`: local simulator only; `remote: true` is a config error.
* - `remote`: no local simulator *yet* — requires explicit `remote: true`.
* Move to `local-and-remote` once a simulator lands.
@@ -20,7 +18,6 @@ import type { Binding } from "../types";
*/
export type BindingLocalSupport =
| "local-and-remote"
- | "remote-default-with-local-opt-in"
| "local-only"
| "remote"
| "DO-NOT-USE-this-resource-will-never-have-a-local-simulator";
@@ -60,7 +57,7 @@ const BINDING_LOCAL_SUPPORT: Record<
// TODO: Miniflare currently ignores `remote: true` on queues, tracked in #13727.
queue: "local-and-remote",
flagship: "local-and-remote",
- artifacts: "remote-default-with-local-opt-in",
+ artifacts: "local-and-remote",
analytics_engine: "local-and-remote",
vectorize: "remote",
@@ -113,8 +110,6 @@ export function resolveBindingRemote(
return true;
case "local-only":
return false;
- case "remote-default-with-local-opt-in":
- return !remoteBindingsDisabled && remote !== false;
case "local-and-remote":
case "remote":
return !remoteBindingsDisabled && remote === true;
@@ -126,48 +121,16 @@ export function resolveBindingRemote(
* binding type's local-development capabilities. Throws `UserError` for
* invalid combinations and uses the caller-provided logger for
* valid-but-noteworthy ones.
- *
- * @param options.binding - Binding name, used to identify the binding in warnings
- * @param options.remoteBindingsDisabled - Whether the dev session runs without
- * remote bindings, as with `wrangler dev --local`
- * @param options.configFormat - Which config format the binding came from, so
- * warnings name the setting the user can write: `remote` in a Wrangler config,
- * `dev: { remote }` in `cloudflare.config.ts`. Defaults to `"wrangler"`.
*/
export function validateBindingRemoteSetting(
type: Binding["type"],
remote: boolean | undefined,
- warn: (message: string) => void,
- {
- binding,
- remoteBindingsDisabled = false,
- configFormat = "wrangler",
- }: {
- binding?: string;
- remoteBindingsDisabled?: boolean;
- configFormat?: "wrangler" | "cloudflare-config";
- } = {}
+ warn: (message: string) => void
) {
- const remoteSetting = (value: boolean) =>
- configFormat === "cloudflare-config"
- ? `\`dev: { remote: ${value} }\``
- : `\`remote: ${value}\``;
const support = getBindingLocalSupport(type);
switch (support) {
case "local-and-remote":
return;
- case "remote-default-with-local-opt-in":
- // Changes made during dev affect real data, so make the default visible.
- if (remote === undefined && !remoteBindingsDisabled) {
- const subject =
- binding === undefined
- ? `${getBindingTypeFriendlyName(type)} bindings use`
- : `${getBindingTypeFriendlyName(type)} binding ${binding} uses`;
- warn(
- `${subject} the deployed resource. Set ${remoteSetting(false)} to use the local simulator, or ${remoteSetting(true)} to silence this warning.`
- );
- }
- return;
case "local-only":
if (remote === true) {
throw new UserError(
diff --git a/packages/workers-utils/src/index.ts b/packages/workers-utils/src/index.ts
index 7272b52751..9ea06332c2 100644
--- a/packages/workers-utils/src/index.ts
+++ b/packages/workers-utils/src/index.ts
@@ -87,6 +87,11 @@ export {
resolveBindingRemote,
validateBindingRemoteSetting,
} from "./config/binding-local-support";
+export {
+ type ArtifactsDevBinding,
+ type ArtifactsLocalDefaultWarner,
+ createArtifactsLocalDefaultWarner,
+} from "./config/artifacts-local-default";
export { validatePagesConfig } from "./config/validation-pages";
diff --git a/packages/workers-utils/tests/config/artifacts-local-default.test.ts b/packages/workers-utils/tests/config/artifacts-local-default.test.ts
new file mode 100644
index 0000000000..d4a5022326
--- /dev/null
+++ b/packages/workers-utils/tests/config/artifacts-local-default.test.ts
@@ -0,0 +1,90 @@
+import { describe, it, vi } from "vitest";
+import { createArtifactsLocalDefaultWarner } from "../../src/config/artifacts-local-default";
+
+const REPOS = { name: "REPOS", remote: undefined };
+
+describe("createArtifactsLocalDefaultWarner", () => {
+ it("warns about an omitted remote in a Wrangler config", ({ expect }) => {
+ const warn = vi.fn();
+ createArtifactsLocalDefaultWarner("wrangler")(
+ { id: "wrangler.jsonc", bindings: [REPOS] },
+ warn
+ );
+ expect(warn).toHaveBeenCalledExactlyOnceWith(
+ "Artifacts binding REPOS uses the local simulator by default. Set `remote: true` to use deployed repos, or `remote: false` to silence this warning."
+ );
+ });
+
+ it("names `dev: { remote }` for cloudflare.config.ts bindings", ({
+ expect,
+ }) => {
+ const warn = vi.fn();
+ createArtifactsLocalDefaultWarner("cloudflare-config")(
+ { id: "/project", bindings: [REPOS] },
+ warn
+ );
+ expect(warn).toHaveBeenCalledExactlyOnceWith(
+ "Artifacts binding REPOS uses the local simulator by default. Set `dev: { remote: true }` to use deployed repos, or `dev: { remote: false }` to silence this warning."
+ );
+ });
+
+ it("does not warn for an explicit setting", ({ expect }) => {
+ const warn = vi.fn();
+ createArtifactsLocalDefaultWarner("wrangler")(
+ {
+ id: "wrangler.jsonc",
+ bindings: [
+ { name: "LOCAL", remote: false },
+ { name: "REMOTE", remote: true },
+ ],
+ },
+ warn
+ );
+ expect(warn).not.toHaveBeenCalled();
+ });
+
+ it("warns once per binding across config reloads", ({ expect }) => {
+ const warn = vi.fn();
+ const warnForDefault = createArtifactsLocalDefaultWarner("wrangler");
+ warnForDefault({ id: "wrangler.jsonc", bindings: [REPOS] }, warn);
+ warnForDefault(
+ {
+ id: "wrangler.jsonc",
+ bindings: [REPOS, { name: "MORE", remote: undefined }],
+ },
+ warn
+ );
+ expect(warn.mock.calls.map(([message]) => message.split(" ")[2])).toEqual([
+ "REPOS",
+ "MORE",
+ ]);
+ });
+
+ it("warns separately for each project in one process", ({ expect }) => {
+ const warn = vi.fn();
+ const warnForDefault = createArtifactsLocalDefaultWarner("wrangler");
+ warnForDefault({ id: "a/wrangler.jsonc", bindings: [REPOS] }, warn);
+ warnForDefault({ id: "b/wrangler.jsonc", bindings: [REPOS] }, warn);
+ expect(warn).toHaveBeenCalledTimes(2);
+ });
+
+ it("names the Worker, and warns for each Worker declaring the binding", ({
+ expect,
+ }) => {
+ const warn = vi.fn();
+ createArtifactsLocalDefaultWarner("cloudflare-config")(
+ {
+ id: "/project",
+ bindings: [
+ { ...REPOS, worker: "api" },
+ { ...REPOS, worker: "jobs" },
+ ],
+ },
+ warn
+ );
+ expect(warn.mock.calls.map(([message]) => message)).toEqual([
+ expect.stringMatching(/^Artifacts binding REPOS in Worker api uses /),
+ expect.stringMatching(/^Artifacts binding REPOS in Worker jobs uses /),
+ ]);
+ });
+});
diff --git a/packages/workers-utils/tests/config/binding-local-support.test.ts b/packages/workers-utils/tests/config/binding-local-support.test.ts
index 9179106386..42fe6d2065 100644
--- a/packages/workers-utils/tests/config/binding-local-support.test.ts
+++ b/packages/workers-utils/tests/config/binding-local-support.test.ts
@@ -12,12 +12,12 @@ describe("resolveBindingRemote", () => {
remoteBindingsDisabled: boolean;
expected: boolean;
}>([
- // Remote by default with local opt-in.
+ // Artifacts is local by default, like every local-and-remote binding.
{
type: "artifacts",
remote: undefined,
remoteBindingsDisabled: false,
- expected: true,
+ expected: false,
},
{
type: "artifacts",
@@ -198,46 +198,9 @@ describe("validateBindingRemoteSetting", () => {
expect(() =>
validateBindingRemoteSetting("flagship", undefined, warn)
).not.toThrow();
- expect(warn).not.toHaveBeenCalled();
- });
- });
-
- describe("remote-default bindings with local opt-in", () => {
- it("warns when `remote` is omitted, naming the binding", ({ expect }) => {
- validateBindingRemoteSetting("artifacts", undefined, warn, {
- binding: "REPOS",
- });
- expect(warn).toHaveBeenCalledWith(
- "Artifacts binding REPOS uses the deployed resource. Set `remote: false` to use the local simulator, or `remote: true` to silence this warning."
- );
- });
-
- it("names `dev: { remote }` for cloudflare.config.ts bindings", ({
- expect,
- }) => {
- validateBindingRemoteSetting("artifacts", undefined, warn, {
- binding: "REPOS",
- configFormat: "cloudflare-config",
- });
- expect(warn).toHaveBeenCalledWith(
- "Artifacts binding REPOS uses the deployed resource. Set `dev: { remote: false }` to use the local simulator, or `dev: { remote: true }` to silence this warning."
- );
- });
-
- it("does not warn when remote bindings are disabled", ({ expect }) => {
- validateBindingRemoteSetting("artifacts", undefined, warn, {
- binding: "REPOS",
- remoteBindingsDisabled: true,
- });
- expect(warn).not.toHaveBeenCalled();
- });
-
- it("does not throw or warn for an explicit setting", ({ expect }) => {
- for (const remote of [true, false]) {
- expect(() =>
- validateBindingRemoteSetting("artifacts", remote, warn)
- ).not.toThrow();
- }
+ expect(() =>
+ validateBindingRemoteSetting("artifacts", undefined, warn)
+ ).not.toThrow();
expect(warn).not.toHaveBeenCalled();
});
});
diff --git a/packages/workers-utils/tests/print-bindings.test.ts b/packages/workers-utils/tests/print-bindings.test.ts
index ef17472f47..6503075da4 100644
--- a/packages/workers-utils/tests/print-bindings.test.ts
+++ b/packages/workers-utils/tests/print-bindings.test.ts
@@ -81,7 +81,7 @@ describe("printBindings", () => {
});
test.for([
- { label: "default", remote: undefined, disabled: false, mode: "remote" },
+ { label: "default", remote: undefined, disabled: false, mode: "local" },
{ label: "explicit local", remote: false, disabled: false, mode: "local" },
{ label: "explicit remote", remote: true, disabled: false, mode: "remote" },
{
diff --git a/packages/wrangler/src/__tests__/dev/artifacts-local.test.ts b/packages/wrangler/src/__tests__/dev/artifacts-local.test.ts
index 7befd411b0..2918716def 100644
--- a/packages/wrangler/src/__tests__/dev/artifacts-local.test.ts
+++ b/packages/wrangler/src/__tests__/dev/artifacts-local.test.ts
@@ -198,11 +198,15 @@ describe("Wrangler dev local Artifacts", { concurrent: false }, () => {
}
);
- it.for([null, true])(
- "uses the local simulator for remote=%s with --local",
+ it.for([
+ { remote: null, args: "" },
+ { remote: null, args: "--local" },
+ { remote: true, args: "--local" },
+ ])(
+ "uses the local simulator for remote=$remote with args '$args'",
{ timeout: ARTIFACTS_DEV_TEST_TIMEOUT },
- async (remote, { expect }) => {
- const dev = await startLocalDev({ remote, args: "--local" });
+ async ({ remote, args }, { expect }) => {
+ const dev = await startLocalDev({ remote, args });
try {
expect(output.out).toMatch(
/env\.REPOS \(examples\)\s+Artifacts\s+local/
@@ -210,7 +214,14 @@ describe("Wrangler dev local Artifacts", { concurrent: false }, () => {
expect(
(await request<{ repos: unknown[] }>(dev.url, "/list")).repos
).toEqual([]);
- expect(output.warn).not.toContain("uses the deployed resource");
+ const defaultWarning =
+ "Artifacts binding REPOS uses the local simulator by default. Set `remote: true` to use deployed repos, or `remote: false` to silence this warning.";
+ // `--local` always used the simulator, so only the default warns.
+ if (remote === null && args === "") {
+ expect(output.warn).toContain(defaultWarning);
+ } else {
+ expect(output.warn).not.toContain(defaultWarning);
+ }
} finally {
await stopRunningDev();
await dev.stopped;
diff --git a/packages/wrangler/src/__tests__/dev/remote-bindings.test.ts b/packages/wrangler/src/__tests__/dev/remote-bindings.test.ts
index ff3e5e0263..afb6359ad5 100644
--- a/packages/wrangler/src/__tests__/dev/remote-bindings.test.ts
+++ b/packages/wrangler/src/__tests__/dev/remote-bindings.test.ts
@@ -543,7 +543,6 @@ describe("dev with remote bindings", { concurrent: false, retry: 2 }, () => {
artifacts: {
MY_ARTIFACTS: {
namespace: "default",
- remote: true,
remoteProxyConnectionString,
},
},
@@ -740,41 +739,51 @@ describe("dev with remote bindings", { concurrent: false, retry: 2 }, () => {
await wranglerStopped;
});
- it("routes Artifacts remotely when remote is omitted", async ({ expect }) => {
+ it("routes Artifacts locally when remote is omitted, warning once across config reloads", async ({
+ expect,
+ }) => {
+ const writeConfig = (vars: Record) =>
+ seed({
+ "wrangler.jsonc": JSON.stringify({
+ name: "worker",
+ main: "index.js",
+ compatibility_date: "2025-01-01",
+ artifacts: [{ binding: "MY_ARTIFACTS", namespace: "default" }],
+ vars,
+ }),
+ });
+ await writeConfig({});
await seed({
- "wrangler.jsonc": JSON.stringify({
- name: "worker",
- main: "index.js",
- compatibility_date: "2025-01-01",
- artifacts: [{ binding: "MY_ARTIFACTS", namespace: "default" }],
- }),
"index.js": `export default { fetch() { return new Response("hello") } }`,
});
- const wranglerStopped = runWrangler("dev --port=0 --inspector-port=0");
+ const wranglerStopped = runWrangler("dev --port=0 --inspector-port=0", {
+ // Config changes only reload when config watching is enabled
+ WRANGLER_CI_DISABLE_CONFIG_WATCHING: "false",
+ });
await vi.waitFor(() => expect(std.out).toMatch(/Ready/), {
timeout: devReadyTimeout,
});
- expect(startRemoteProxySessionCallCount).toBe(1);
- expect(proxyWorkerBindings).toEqual({
- MY_ARTIFACTS: expect.objectContaining({
- type: "artifacts",
- namespace: "default",
- }),
- });
+ expect(startRemoteProxySessionCallCount).toBe(0);
expect(workerOptions).toEqual([
expect.objectContaining({
artifacts: {
MY_ARTIFACTS: {
namespace: "default",
- remote: undefined,
- remoteProxyConnectionString,
+ remoteProxyConnectionString: undefined,
},
},
}),
]);
- expect(std.warn).toContain(
- "Artifacts binding MY_ARTIFACTS uses the deployed resource. Set `remote: false` to use the local simulator, or `remote: true` to silence this warning."
+
+ // A config reload doesn't repeat the warning.
+ await writeConfig({ EDIT: "1" });
+ await vi.waitFor(
+ () => expect(workerOptions[0]).toMatchObject({ bindings: { EDIT: "1" } }),
+ { timeout: devReadyTimeout }
);
+ const warning =
+ "Artifacts binding MY_ARTIFACTS uses the local simulator by default. Set `remote: true` to use deployed repos, or `remote: false` to silence this warning.";
+ expect(std.warn.split(warning)).toHaveLength(2);
await stopWrangler();
await wranglerStopped;
});
diff --git a/packages/wrangler/src/__tests__/get-platform-proxy.test.ts b/packages/wrangler/src/__tests__/get-platform-proxy.test.ts
index 7955451a09..8a4dcd2984 100644
--- a/packages/wrangler/src/__tests__/get-platform-proxy.test.ts
+++ b/packages/wrangler/src/__tests__/get-platform-proxy.test.ts
@@ -1,10 +1,12 @@
import { mkdirSync } from "node:fs";
+import path from "node:path";
import {
runInTempDir,
writeWranglerConfig,
} from "@cloudflare/workers-utils/test-helpers";
import { fetch } from "undici";
import { beforeEach, describe, it, vi } from "vitest";
+import { mockConsoleMethods } from "./helpers/mock-console";
const { miniflareInstances } = vi.hoisted(() => ({
miniflareInstances: [] as Array<{ ready: Promise }>,
@@ -27,6 +29,7 @@ import { getPlatformProxy } from "../api";
describe("getPlatformProxy", () => {
runInTempDir();
+ const std = mockConsoleMethods();
beforeEach(() => {
miniflareInstances.length = 0;
@@ -64,4 +67,66 @@ describe("getPlatformProxy", () => {
await platform.dispose();
}
});
+
+ it("warns once about an omitted Artifacts remote when remote bindings are enabled", async ({
+ expect,
+ }) => {
+ writeWranglerConfig(
+ {
+ name: "test-worker",
+ compatibility_date: "2026-11-02",
+ artifacts: [{ binding: "REPOS", namespace: "examples" }],
+ },
+ "./wrangler.json"
+ );
+ const warning =
+ "Artifacts binding REPOS uses the local simulator by default. Set `remote: true` to use deployed repos, or `remote: false` to silence this warning.";
+ const start = async (remoteBindings: boolean) =>
+ (
+ await getPlatformProxy({
+ configPath: "./wrangler.json",
+ persist: false,
+ remoteBindings,
+ })
+ ).dispose();
+
+ // With remote bindings disabled, Artifacts always used the simulator.
+ await start(false);
+ expect(std.warn).not.toContain(warning);
+
+ await start(true);
+ await start(true);
+ expect(std.warn.split(warning)).toHaveLength(2);
+ });
+
+ it("warns for each project that uses the same relative config path", async ({
+ expect,
+ }) => {
+ const root = process.cwd();
+ const warning =
+ "Artifacts binding OTHER_REPOS uses the local simulator by default. Set `remote: true` to use deployed repos, or `remote: false` to silence this warning.";
+ try {
+ for (const project of ["a", "b"]) {
+ mkdirSync(path.join(root, project));
+ process.chdir(path.join(root, project));
+ writeWranglerConfig(
+ {
+ name: `worker-${project}`,
+ compatibility_date: "2026-11-02",
+ artifacts: [{ binding: "OTHER_REPOS", namespace: "examples" }],
+ },
+ "./wrangler.json"
+ );
+ await (
+ await getPlatformProxy({
+ configPath: "./wrangler.json",
+ persist: false,
+ })
+ ).dispose();
+ }
+ } finally {
+ process.chdir(root);
+ }
+ expect(std.warn.split(warning)).toHaveLength(3);
+ });
});
diff --git a/packages/wrangler/src/__tests__/print-bindings.test.ts b/packages/wrangler/src/__tests__/print-bindings.test.ts
index 3a3a8c33e4..68ab3548f5 100644
--- a/packages/wrangler/src/__tests__/print-bindings.test.ts
+++ b/packages/wrangler/src/__tests__/print-bindings.test.ts
@@ -177,7 +177,7 @@ describe("printBindings -- Flagship bindings", () => {
describe("printBindings -- Artifacts bindings", () => {
it.for([
- { label: "default", remote: undefined, mode: "remote" },
+ { label: "default", remote: undefined, mode: "local" },
{ label: "explicit local", remote: false, mode: "local" },
{ label: "explicit remote", remote: true, mode: "remote" },
])(
diff --git a/packages/wrangler/src/api/integrations/platform/index.ts b/packages/wrangler/src/api/integrations/platform/index.ts
index 94255f7d28..5e9ef67de1 100644
--- a/packages/wrangler/src/api/integrations/platform/index.ts
+++ b/packages/wrangler/src/api/integrations/platform/index.ts
@@ -1,6 +1,7 @@
import path from "node:path";
import { createContainerDevPlan } from "@cloudflare/containers-shared";
import {
+ createArtifactsLocalDefaultWarner,
DEFAULT_COMPAT_DATE,
DEFAULT_MODULE_RULES,
extractBindingsOfType,
@@ -130,6 +131,11 @@ export type GetPlatformProxyOptions = {
remoteBindings?: boolean;
};
+// Remembers warnings per config file, so a framework that calls
+// `getPlatformProxy()` again after a config change doesn't repeat them.
+const warnForArtifactsLocalDefault =
+ createArtifactsLocalDefaultWarner("wrangler");
+
/**
* Result of the `getPlatformProxy` utility
*/
@@ -180,6 +186,20 @@ export async function getPlatformProxy<
env,
});
+ if (options.remoteBindings !== false) {
+ warnForArtifactsLocalDefault(
+ {
+ // A relative path names a different file after a directory change.
+ id: config.configPath ? path.resolve(config.configPath) : process.cwd(),
+ bindings: config.artifacts.map(({ binding, remote }) => ({
+ name: binding,
+ remote,
+ })),
+ },
+ (message) => logger.warn(message)
+ );
+ }
+
let remoteProxySession: RemoteProxySession | undefined = undefined;
if (config.configPath && options.remoteBindings !== false) {
remoteProxySession = (
diff --git a/packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts b/packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts
index bf0d35896f..72d6aebf85 100644
--- a/packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts
+++ b/packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts
@@ -2,7 +2,11 @@ import { randomUUID } from "node:crypto";
import { readFile } from "node:fs/promises";
import { isDeepStrictEqual } from "node:util";
import { prepareContainerImagesForDev } from "@cloudflare/containers-shared";
-import { configFileName, getDockerPath } from "@cloudflare/workers-utils";
+import {
+ configFileName,
+ createArtifactsLocalDefaultWarner,
+ getDockerPath,
+} from "@cloudflare/workers-utils";
import chalk from "chalk";
import {
buildPublicUrl,
@@ -266,6 +270,9 @@ export class LocalRuntimeController extends RuntimeController {
#containerImagePreparationState?: ContainerImagePreparationState;
+ // Warns once per dev session, not on every config reload.
+ #warnForArtifactsLocalDefault = createArtifactsLocalDefaultWarner("wrangler");
+
// Used to store the information and abort handle for the
// current container that is being built
containerBeingBuilt?: {
@@ -359,6 +366,19 @@ export class LocalRuntimeController extends RuntimeController {
const configBundle = await convertToConfigBundle(data);
if (data.config.dev?.remote !== false) {
+ this.#warnForArtifactsLocalDefault(
+ {
+ id: data.config.config ?? data.config.name ?? "",
+ bindings: Object.entries(configBundle.bindings ?? {}).flatMap(
+ ([name, binding]) =>
+ binding.type === "artifacts"
+ ? [{ name, remote: binding.remote }]
+ : []
+ ),
+ },
+ (message) => logger.warn(message)
+ );
+
// note: remote bindings use (transitively) LocalRuntimeController, so we need to import
// from the module lazily in order to avoid circular dependency issues
const { maybeStartOrUpdateRemoteProxySession, pickRemoteBindings } =
diff --git a/packages/wrangler/src/dev/miniflare/index.ts b/packages/wrangler/src/dev/miniflare/index.ts
index 61b792a5b5..5684b66878 100644
--- a/packages/wrangler/src/dev/miniflare/index.ts
+++ b/packages/wrangler/src/dev/miniflare/index.ts
@@ -764,11 +764,7 @@ export function buildMiniflareBindingOptions(
}
for (const artifact of artifactsBindings) {
- validateBindingRemoteSetting("artifacts", artifact.remote, logger.warn, {
- binding: artifact.binding,
- // Without a remote proxy session the binding uses the local simulator.
- remoteBindingsDisabled: remoteProxyConnectionString === undefined,
- });
+ validateBindingRemoteSetting("artifacts", artifact.remote, logger.warn);
}
for (const flagship of flagshipBindings) {
@@ -1015,7 +1011,6 @@ export function buildMiniflareBindingOptions(
binding.binding,
{
namespace: binding.namespace,
- remote: binding.remote,
remoteProxyConnectionString: resolveBindingRemote(
"artifacts",
binding.remote
From 63eb6daa0eda348e1f9e86a506cfd80d104a1e28 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 13 Nov 2026 11:49:34 +0000
Subject: [PATCH 05/30] Bump the workerd-and-workers-types group with 2 updates
(#16886)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wrangler automated PR updater
Co-authored-by: Edmund Hung
---
.changeset/default-compat-date-16886.md | 23 +
.changeset/dependabot-update-16886.md | 13 +
packages/miniflare/src/workers/core/email.ts | 2 +-
.../workers-utils/src/default-compat-date.ts | 2 +-
pnpm-lock.yaml | 396 +++++++++---------
pnpm-workspace.yaml | 4 +-
6 files changed, 238 insertions(+), 202 deletions(-)
create mode 100644 .changeset/default-compat-date-16886.md
create mode 100644 .changeset/dependabot-update-16886.md
diff --git a/.changeset/default-compat-date-16886.md b/.changeset/default-compat-date-16886.md
new file mode 100644
index 0000000000..074a47e3af
--- /dev/null
+++ b/.changeset/default-compat-date-16886.md
@@ -0,0 +1,23 @@
+---
+"@cloudflare/workers-utils": patch
+"@cloudflare/autoconfig": patch
+"@cloudflare/build-output-utils": patch
+"@cloudflare/cli-shared-helpers": patch
+"@cloudflare/codemods": patch
+"@cloudflare/config": patch
+"@cloudflare/containers-shared": patch
+"@cloudflare/deploy-helpers": patch
+"@cloudflare/pages-functions": patch
+"@cloudflare/pages-shared": patch
+"@cloudflare/runtime-types": patch
+"@cloudflare/vite-plugin": patch
+"@cloudflare/vitest-plugin": patch
+"@cloudflare/workers-auth": patch
+"create-cloudflare": patch
+"miniflare": patch
+"wrangler": patch
+---
+
+Update `DEFAULT_COMPAT_DATE` to 2026-11-13
+
+Use the bundled workerd release's compatibility date by default when scaffolding new projects or when no compatibility date is configured.
diff --git a/.changeset/dependabot-update-16886.md b/.changeset/dependabot-update-16886.md
new file mode 100644
index 0000000000..f3d0e2eef3
--- /dev/null
+++ b/.changeset/dependabot-update-16886.md
@@ -0,0 +1,13 @@
+---
+"miniflare": patch
+"wrangler": patch
+---
+
+Update dependencies of "miniflare", "wrangler"
+
+The following dependency versions have been updated:
+
+| Dependency | From | To |
+| ------------------------- | ------------- | ------------- |
+| @cloudflare/workers-types | ^5.20261112.1 | ^5.20261113.1 |
+| workerd | 1.20261112.1 | 1.20261113.1 |
diff --git a/packages/miniflare/src/workers/core/email.ts b/packages/miniflare/src/workers/core/email.ts
index eac1f2be5d..1776b9e32a 100644
--- a/packages/miniflare/src/workers/core/email.ts
+++ b/packages/miniflare/src/workers/core/email.ts
@@ -379,7 +379,7 @@ export async function handleEmail(
});
return result;
},
- } satisfies ForwardableEmailMessage
+ } satisfies Omit
);
if (params.get("format") !== "json") {
diff --git a/packages/workers-utils/src/default-compat-date.ts b/packages/workers-utils/src/default-compat-date.ts
index 637a196f76..9c2a16c1b2 100644
--- a/packages/workers-utils/src/default-compat-date.ts
+++ b/packages/workers-utils/src/default-compat-date.ts
@@ -19,4 +19,4 @@ import type { CompatDate } from "./compatibility-date";
* @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/BUILD.bazel
* @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/compatibility-date.c%2B%2B
*/
-export const DEFAULT_COMPAT_DATE: CompatDate = "2026-11-12";
+export const DEFAULT_COMPAT_DATE: CompatDate = "2026-11-13";
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c14bf62ba0..74772b7e4c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -10,8 +10,8 @@ catalogs:
specifier: 1.4.3
version: 1.4.3
'@cloudflare/workers-types':
- specifier: ^5.20261112.1
- version: 5.20261112.1
+ specifier: ^5.20261113.1
+ version: 5.20261113.1
'@hey-api/openapi-ts':
specifier: 0.94.0
version: 0.94.0
@@ -82,8 +82,8 @@ catalogs:
specifier: 5.0.4
version: 5.0.4
workerd:
- specifier: 1.20261112.1
- version: 1.20261112.1
+ specifier: 1.20261113.1
+ version: 1.20261113.1
ws:
specifier: 8.21.0
version: 8.21.0
@@ -192,7 +192,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@fixture/shared':
specifier: workspace:*
version: link:../shared
@@ -225,7 +225,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/node':
specifier: 22.15.17
version: 22.15.17
@@ -249,7 +249,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/node':
specifier: 22.15.17
version: 22.15.17
@@ -273,7 +273,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/node':
specifier: 22.15.17
version: 22.15.17
@@ -300,7 +300,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@playwright/test':
specifier: catalog:default
version: 1.61.0
@@ -330,7 +330,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -351,7 +351,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -375,7 +375,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -414,7 +414,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
vitest:
specifier: catalog:default
version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@22.15.17)(@vitest/ui@5.0.4)(msw@2.14.6(@types/node@22.15.17)(typescript@5.9.3))(vite@8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0))
@@ -429,7 +429,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
undici:
specifier: catalog:default
version: 7.30.1
@@ -444,7 +444,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/mimetext':
specifier: ^2.0.4
version: 2.0.4
@@ -483,7 +483,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@fixture/shared':
specifier: workspace:*
version: link:../shared
@@ -510,7 +510,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/jest-image-snapshot':
specifier: ^6.4.0
version: 6.4.0
@@ -537,7 +537,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
miniflare:
specifier: workspace:*
version: link:../../packages/miniflare
@@ -607,7 +607,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/is-even':
specifier: ^1.0.2
version: 1.0.2
@@ -625,11 +625,11 @@ importers:
dependencies:
'@sentry/cloudflare':
specifier: ^10
- version: 10.50.0(@cloudflare/workers-types@5.20261112.1)
+ version: 10.50.0(@cloudflare/workers-types@5.20261113.1)
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
vitest:
specifier: catalog:default
version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@22.15.17)(@vitest/ui@5.0.4)(msw@2.14.6(@types/node@22.15.17)(typescript@5.9.3))(vite@8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0))
@@ -660,7 +660,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -688,7 +688,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/node':
specifier: 22.15.17
version: 22.15.17
@@ -718,7 +718,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
undici:
specifier: catalog:default
version: 7.30.1
@@ -736,7 +736,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/debug':
specifier: 4.1.12
version: 4.1.12
@@ -769,7 +769,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -794,7 +794,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@fixture/pages-plugin':
specifier: workspace:*
version: link:../pages-plugin-example
@@ -818,7 +818,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -857,7 +857,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -878,7 +878,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -899,7 +899,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -917,7 +917,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
is-odd:
specifier: ^3.0.1
version: 3.0.1
@@ -936,7 +936,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@fixture/pages-plugin':
specifier: workspace:*
version: link:../pages-plugin-example
@@ -996,7 +996,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1017,7 +1017,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1173,19 +1173,19 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
fixtures/rules-app:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
fixtures/secrets-store:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
wrangler:
specifier: workspace:*
version: link:../../packages/wrangler
@@ -1212,7 +1212,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/is-even':
specifier: ^1.0.2
version: 1.0.2
@@ -1236,7 +1236,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
vitest:
specifier: catalog:default
version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@22.15.17)(@vitest/ui@5.0.4)(msw@2.14.6(@types/node@22.15.17)(typescript@5.9.3))(vite@8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0))
@@ -1251,7 +1251,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
esbuild:
specifier: catalog:default
version: 0.28.2
@@ -1269,13 +1269,13 @@ importers:
devDependencies:
'@better-auth/stripe':
specifier: ^1.4.6
- version: 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(better-auth@1.5.4(d0026d6adc26d1c4b53992c680c192b2))(better-call@1.3.2(zod@4.6.5))(stripe@20.4.1(@types/node@22.15.17))
+ version: 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(better-auth@1.5.4(e89b805c87cf74da82f26bde06056715))(better-call@1.3.2(zod@4.6.5))(stripe@20.4.1(@types/node@22.15.17))
'@cloudflare/vitest-plugin':
specifier: workspace:*
version: link:../../packages/vitest-plugin
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@microlabs/otel-cf-workers':
specifier: 1.0.0-rc.45
version: 1.0.0-rc.45(@opentelemetry/api@1.9.1)
@@ -1296,7 +1296,7 @@ importers:
version: 5.0.4(vitest@5.0.4)
better-auth:
specifier: ^1.4.6
- version: 1.5.4(d0026d6adc26d1c4b53992c680c192b2)
+ version: 1.5.4(e89b805c87cf74da82f26bde06056715)
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -1373,7 +1373,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@fixture/shared':
specifier: workspace:*
version: link:../shared
@@ -1428,7 +1428,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
wrangler:
specifier: workspace:*
version: link:../../packages/wrangler
@@ -1440,7 +1440,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
miniflare:
specifier: workspace:*
version: link:../../packages/miniflare
@@ -1488,7 +1488,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
run-script-os:
specifier: ^1.1.6
version: 1.1.6
@@ -1512,7 +1512,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1533,7 +1533,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1554,7 +1554,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1575,7 +1575,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1596,7 +1596,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/jest-image-snapshot':
specifier: ^6.4.0
version: 6.4.0
@@ -1629,7 +1629,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/node':
specifier: 22.15.17
version: 22.15.17
@@ -1656,7 +1656,7 @@ importers:
version: link:../../packages/workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1674,7 +1674,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
typescript:
specifier: catalog:default
version: 5.8.3
@@ -1760,7 +1760,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -1855,7 +1855,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -1937,7 +1937,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -2151,7 +2151,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@octokit/types':
specifier: ^13.8.0
version: 13.8.0
@@ -2175,7 +2175,7 @@ importers:
version: link:../vitest-plugin
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -2199,7 +2199,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -2226,10 +2226,10 @@ importers:
devDependencies:
'@cloudflare/vitest-plugin':
specifier: catalog:default
- version: 1.4.3(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)(vitest@5.0.4)
+ version: 1.4.3(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)(vitest@5.0.4)
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/mime':
specifier: ^3.0.4
version: 3.0.4
@@ -2386,7 +2386,7 @@ importers:
version: 7.30.1
workerd:
specifier: catalog:default
- version: 1.20261112.1
+ version: 1.20261113.1
ws:
specifier: catalog:default
version: 8.21.0
@@ -2426,7 +2426,7 @@ importers:
version: link:../workers-shared
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -2638,7 +2638,7 @@ importers:
devDependencies:
'@cloudflare/vitest-plugin':
specifier: catalog:default
- version: 1.4.3(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)(vitest@5.0.4)
+ version: 1.4.3(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)(vitest@5.0.4)
'@cloudflare/workers-shared':
specifier: workspace:*
version: link:../workers-shared
@@ -2647,7 +2647,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
concurrently:
specifier: ^8.2.2
version: 8.2.2
@@ -2675,7 +2675,7 @@ importers:
devDependencies:
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -2709,7 +2709,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/node':
specifier: 22.15.17
version: 22.15.17
@@ -2733,7 +2733,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
esbuild:
specifier: catalog:default
version: 0.28.2
@@ -2773,7 +2773,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/ws':
specifier: ^8.5.13
version: 8.5.13
@@ -2800,7 +2800,7 @@ importers:
version: link:../miniflare
workerd:
specifier: catalog:default
- version: 1.20261112.1
+ version: 1.20261113.1
devDependencies:
'@cloudflare/workers-tsconfig':
specifier: workspace:*
@@ -2941,7 +2941,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -3046,7 +3046,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3067,7 +3067,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3088,7 +3088,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3109,7 +3109,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3130,7 +3130,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3151,7 +3151,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3172,7 +3172,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3193,7 +3193,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3214,7 +3214,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3235,7 +3235,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3256,7 +3256,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3277,7 +3277,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3298,7 +3298,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3319,7 +3319,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3340,7 +3340,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3361,7 +3361,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3382,7 +3382,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/mimetext':
specifier: ^2.0.4
version: 2.0.4
@@ -3415,7 +3415,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3436,7 +3436,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3457,7 +3457,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3478,7 +3478,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3499,7 +3499,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3520,7 +3520,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3541,7 +3541,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3562,7 +3562,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@playground/main-resolution-package':
specifier: file:./package
version: file:packages/vite-plugin-cloudflare/playground/main-resolution/package
@@ -3586,7 +3586,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/express':
specifier: ^5.0.1
version: 5.0.1
@@ -3613,7 +3613,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@playground/module-resolution-excludes':
specifier: file:./packages/excludes
version: file:packages/vite-plugin-cloudflare/playground/module-resolution/packages/excludes
@@ -3625,7 +3625,7 @@ importers:
version: file:packages/vite-plugin-cloudflare/playground/module-resolution/packages/requires
'@remix-run/cloudflare':
specifier: 2.12.0
- version: 2.12.0(@cloudflare/workers-types@5.20261112.1)(typescript@5.8.3)
+ version: 2.12.0(@cloudflare/workers-types@5.20261113.1)(typescript@5.8.3)
'@types/react':
specifier: ^18.3.11
version: 18.3.18
@@ -3658,7 +3658,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3679,7 +3679,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@fixture/shared':
specifier: workspace:*
version: link:../../../../fixtures/shared
@@ -3731,7 +3731,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/react':
specifier: 19.1.0
version: 19.1.0
@@ -3752,7 +3752,7 @@ importers:
dependencies:
partyserver:
specifier: ^0.3.3
- version: 0.3.3(@cloudflare/workers-types@5.20261112.1)
+ version: 0.3.3(@cloudflare/workers-types@5.20261113.1)
partysocket:
specifier: ^1.1.16
version: 1.1.16(react@19.2.1)
@@ -3771,7 +3771,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@tailwindcss/vite':
specifier: ^4.2.1
version: 4.2.2(vite@8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0))
@@ -3807,7 +3807,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3828,7 +3828,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../../../workers-utils
@@ -3852,7 +3852,7 @@ importers:
version: 8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0)
wrangler:
specifier: 4.135.0
- version: 4.135.0(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)
+ version: 4.135.0(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)
packages/vite-plugin-cloudflare/playground/react-spa:
dependencies:
@@ -3871,7 +3871,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/react':
specifier: 19.1.0
version: 19.1.0
@@ -3901,7 +3901,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3922,7 +3922,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -3950,7 +3950,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/react':
specifier: 19.1.0
version: 19.1.0
@@ -3983,7 +3983,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4004,7 +4004,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4025,7 +4025,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4046,7 +4046,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@vitejs/plugin-basic-ssl':
specifier: ^2.2.0
version: 2.2.0(vite@8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0))
@@ -4070,7 +4070,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4091,7 +4091,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4112,7 +4112,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4133,7 +4133,7 @@ importers:
version: link:../../../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
cf:
specifier: catalog:default
version: 1.0.0-beta.17(@types/node@22.15.17)
@@ -4188,7 +4188,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -4440,13 +4440,13 @@ importers:
devDependencies:
'@cloudflare/vitest-plugin':
specifier: catalog:default
- version: 1.4.3(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)(vitest@5.0.4)
+ version: 1.4.3(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)(vitest@5.0.4)
'@cloudflare/workers-tsconfig':
specifier: workspace:*
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@sentry/cli':
specifier: ^2.37.0
version: 2.41.1(encoding@0.1.13)
@@ -4585,13 +4585,13 @@ importers:
devDependencies:
'@cloudflare/vitest-plugin':
specifier: catalog:default
- version: 1.4.3(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)(vitest@5.0.4)
+ version: 1.4.3(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)(vitest@5.0.4)
'@cloudflare/workers-tsconfig':
specifier: workspace:*
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@types/mime':
specifier: ^3.0.4
version: 3.0.4
@@ -4633,7 +4633,7 @@ importers:
version: 2.0.0-rc.24
workerd:
specifier: catalog:default
- version: 1.20261112.1
+ version: 1.20261113.1
devDependencies:
'@aws-sdk/client-s3':
specifier: ^3.721.0
@@ -4691,7 +4691,7 @@ importers:
version: link:../workers-tsconfig
'@cloudflare/workers-types':
specifier: catalog:default
- version: 5.20261112.1
+ version: 5.20261113.1
'@cloudflare/workers-utils':
specifier: workspace:*
version: link:../workers-utils
@@ -5801,8 +5801,8 @@ packages:
cpu: [x64]
os: [darwin]
- '@cloudflare/workerd-darwin-64@1.20261112.1':
- resolution: {integrity: sha512-VeHFKYRITaoJScHG1quIEYEfGwrBxzPvBhaVhIv2Gf6iW2XoxQvi0HpUsYPZ69HVmBVf87XK6EF6vDmvDPsZmw==}
+ '@cloudflare/workerd-darwin-64@1.20261113.1':
+ resolution: {integrity: sha512-UcShHyWJVZNbuI8jL3F5QZXMrJm7oScge33D5p3hAyhIIkoVj72+bior+VcUcr1SBWkh5w3Umnrx179WE7Wvpw==}
engines: {node: '>=16'}
cpu: [x64]
os: [darwin]
@@ -5831,8 +5831,8 @@ packages:
cpu: [arm64]
os: [darwin]
- '@cloudflare/workerd-darwin-arm64@1.20261112.1':
- resolution: {integrity: sha512-lBzZv+bM3hxP28p3f6cYJOrE5eYps+s6TrlBgHhyqyrDwMoAHeL28/e3nlLvz7u4imcjbzn/aDMEmRMUV5F2Hg==}
+ '@cloudflare/workerd-darwin-arm64@1.20261113.1':
+ resolution: {integrity: sha512-bKfFcpueb9GOg0NZSR4x7dpEJZMsQOwCk0XzsAoXoBfG4osFRQcFxtAhrXvB1y445zXFLhrEkDJ/+LvGAMkPSg==}
engines: {node: '>=16'}
cpu: [arm64]
os: [darwin]
@@ -5861,8 +5861,8 @@ packages:
cpu: [x64]
os: [linux]
- '@cloudflare/workerd-linux-64@1.20261112.1':
- resolution: {integrity: sha512-IPM9rQ5w8076KOjTURcfdugzkhLRN7J9mMpVft7d1seqTs3r3YbM0GSn7vbynQ8+Np/9sVodL4BCOlpe+/PEmg==}
+ '@cloudflare/workerd-linux-64@1.20261113.1':
+ resolution: {integrity: sha512-3VCnXzi7apwPSMwkiTIeEc5z/UWWGQXBZZNHCBBCXPlavWCR06SQ77tO0rEoKonfjBGW0MQaHNZ7U1pCPe4v3g==}
engines: {node: '>=16'}
cpu: [x64]
os: [linux]
@@ -5891,8 +5891,8 @@ packages:
cpu: [arm64]
os: [linux]
- '@cloudflare/workerd-linux-arm64@1.20261112.1':
- resolution: {integrity: sha512-Uy5ThzPbIDzaWY94sO8mKbnhtbV5kswCoBAu/+TaJ5BBQxj6THLTMMgW0+ARwfn3FXtaKk1PBwCxW1n7LFJbpw==}
+ '@cloudflare/workerd-linux-arm64@1.20261113.1':
+ resolution: {integrity: sha512-phnb1686FTIVSr4qxQFOt7MyiWMotqsVUyZVnQl579/bCrqWaYUcRnikN5f6bBpDbxCk1OvOvYz0ykjT1lvYpg==}
engines: {node: '>=16'}
cpu: [arm64]
os: [linux]
@@ -5921,8 +5921,8 @@ packages:
cpu: [x64]
os: [win32]
- '@cloudflare/workerd-windows-64@1.20261112.1':
- resolution: {integrity: sha512-k4+8R3gHc5QuNIfx3jYq3jEtX7vEy1y9ZfYbyKaKww6zJscl6R7FE+z8/AAe80PSMrWs0EcCfK1nob5zJqN4sg==}
+ '@cloudflare/workerd-windows-64@1.20261113.1':
+ resolution: {integrity: sha512-WtQakCAIzUQJ6dQDPn7kIGlFJ9yjB0ooNx2WFqEHLYNAT7TLCNyaORem2WVM38TceVR8flCP5UWgYm6ht3dlIw==}
engines: {node: '>=16'}
cpu: [x64]
os: [win32]
@@ -5938,8 +5938,8 @@ packages:
'@cloudflare/workers-types@4.20260702.1':
resolution: {integrity: sha512-mOhf5TUEB1m2vPrxtqoIGfz0fUC9xyxRDx5gWHy5s+OCo6dcV+g7wI1R7gYCMFohhqF/2y2xeKVwMwCJjfn/WA==}
- '@cloudflare/workers-types@5.20261112.1':
- resolution: {integrity: sha512-FhkAlCQ+J/pV89nhehVaarhlvZFz+ybUsePmIDN1yfI7PMmpjwdxV663e9qu+G+oQSw9oM8u5sVmheNBFn4tnw==}
+ '@cloudflare/workers-types@5.20261113.1':
+ resolution: {integrity: sha512-FhF8hRtsQCr/BWZyUN7wm2x+jqAOkRIpLOW+2fJu5OQyIDOv+c3PxY8duEAkOYXuprLImxjW+PHTbvz9+Px5cw==}
'@codemirror/autocomplete@6.20.0':
resolution: {integrity: sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==}
@@ -16221,8 +16221,8 @@ packages:
engines: {node: '>=16'}
hasBin: true
- workerd@1.20261112.1:
- resolution: {integrity: sha512-ESBRrPFPyAGEW7QD2PuqF2RF+mjO+my1uA3lCfMeK0HfogmMQ9j2M7lain3FOVinD/El6d+77JA5AQJ85GDtFg==}
+ workerd@1.20261113.1:
+ resolution: {integrity: sha512-FJP8Bm1jiiJTE2xpSIhT9JkMaKzU54y9Jk0q7n3BLWyWdUNsn35QGCqARcqXGwO3FGkvahhYqUEG2bJzlgcfhw==}
engines: {node: '>=16'}
hasBin: true
@@ -17121,7 +17121,7 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.13
- '@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)':
+ '@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)':
dependencies:
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
@@ -17132,9 +17132,9 @@ snapshots:
nanostores: 1.1.1
zod: 4.6.5
optionalDependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
- '@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@6.2.1)(kysely@0.28.11)(nanostores@1.1.1)':
+ '@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@6.2.1)(kysely@0.28.11)(nanostores@1.1.1)':
dependencies:
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
@@ -17145,50 +17145,50 @@ snapshots:
nanostores: 1.1.1
zod: 4.6.5
optionalDependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
- '@better-auth/drizzle-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(drizzle-orm@0.45.1(@cloudflare/workers-types@5.20261112.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)))':
+ '@better-auth/drizzle-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(drizzle-orm@0.45.1(@cloudflare/workers-types@5.20261113.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)))':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
'@better-auth/utils': 0.3.1
- drizzle-orm: 0.45.1(@cloudflare/workers-types@5.20261112.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))
+ drizzle-orm: 0.45.1(@cloudflare/workers-types@5.20261113.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))
- '@better-auth/kysely-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(kysely@0.28.11)':
+ '@better-auth/kysely-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(kysely@0.28.11)':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
'@better-auth/utils': 0.3.1
kysely: 0.28.11
- '@better-auth/memory-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)':
+ '@better-auth/memory-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
'@better-auth/utils': 0.3.1
- '@better-auth/mongo-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(mongodb@7.1.0(socks@2.8.10))':
+ '@better-auth/mongo-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(mongodb@7.1.0(socks@2.8.10))':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
'@better-auth/utils': 0.3.1
mongodb: 7.1.0(socks@2.8.10)
- '@better-auth/prisma-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))':
+ '@better-auth/prisma-adapter@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
'@better-auth/utils': 0.3.1
'@prisma/client': 7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3)
prisma: 7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)
- '@better-auth/stripe@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(better-auth@1.5.4(d0026d6adc26d1c4b53992c680c192b2))(better-call@1.3.2(zod@4.6.5))(stripe@20.4.1(@types/node@22.15.17))':
+ '@better-auth/stripe@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(better-auth@1.5.4(e89b805c87cf74da82f26bde06056715))(better-call@1.3.2(zod@4.6.5))(stripe@20.4.1(@types/node@22.15.17))':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
- better-auth: 1.5.4(d0026d6adc26d1c4b53992c680c192b2)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ better-auth: 1.5.4(e89b805c87cf74da82f26bde06056715)
better-call: 1.3.2(zod@4.6.5)
defu: 6.1.4
stripe: 20.4.1(@types/node@22.15.17)
zod: 4.6.5
- '@better-auth/telemetry@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))':
+ '@better-auth/telemetry@1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))':
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1)
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
@@ -17807,13 +17807,13 @@ snapshots:
- bufferutil
- utf-8-validate
- '@cloudflare/vitest-plugin@1.4.3(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)(vitest@5.0.4)':
+ '@cloudflare/vitest-plugin@1.4.3(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)(vitest@5.0.4)':
dependencies:
cjs-module-lexer: 1.2.3
esbuild: 0.28.2
miniflare: 5.20261012.0-beta(@types/node@22.15.17)
vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@22.15.17)(@vitest/ui@5.0.4)(msw@2.14.6(@types/node@22.15.17)(typescript@5.9.3))(vite@8.3.4(@types/node@22.15.17)(esbuild@0.28.2)(jiti@2.6.1)(tsx@4.23.15)(yaml@2.9.0))
- wrangler: 4.151.0(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17)
+ wrangler: 4.151.0(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17)
zod: 4.6.5
transitivePeerDependencies:
- '@cloudflare/workers-types'
@@ -17833,7 +17833,7 @@ snapshots:
'@cloudflare/workerd-darwin-64@1.20261012.1':
optional: true
- '@cloudflare/workerd-darwin-64@1.20261112.1':
+ '@cloudflare/workerd-darwin-64@1.20261113.1':
optional: true
'@cloudflare/workerd-darwin-arm64@1.20260423.1':
@@ -17848,7 +17848,7 @@ snapshots:
'@cloudflare/workerd-darwin-arm64@1.20261012.1':
optional: true
- '@cloudflare/workerd-darwin-arm64@1.20261112.1':
+ '@cloudflare/workerd-darwin-arm64@1.20261113.1':
optional: true
'@cloudflare/workerd-linux-64@1.20260423.1':
@@ -17863,7 +17863,7 @@ snapshots:
'@cloudflare/workerd-linux-64@1.20261012.1':
optional: true
- '@cloudflare/workerd-linux-64@1.20261112.1':
+ '@cloudflare/workerd-linux-64@1.20261113.1':
optional: true
'@cloudflare/workerd-linux-arm64@1.20260423.1':
@@ -17878,7 +17878,7 @@ snapshots:
'@cloudflare/workerd-linux-arm64@1.20261012.1':
optional: true
- '@cloudflare/workerd-linux-arm64@1.20261112.1':
+ '@cloudflare/workerd-linux-arm64@1.20261113.1':
optional: true
'@cloudflare/workerd-windows-64@1.20260423.1':
@@ -17893,7 +17893,7 @@ snapshots:
'@cloudflare/workerd-windows-64@1.20261012.1':
optional: true
- '@cloudflare/workerd-windows-64@1.20261112.1':
+ '@cloudflare/workerd-windows-64@1.20261113.1':
optional: true
'@cloudflare/workers-editor-shared@0.1.1(@cloudflare/style-const@6.1.3(react@19.2.4))(@cloudflare/style-container@7.12.2(@cloudflare/style-const@6.1.3(react@19.2.4))(react@19.2.4))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
@@ -17906,7 +17906,7 @@ snapshots:
'@cloudflare/workers-types@4.20260702.1': {}
- '@cloudflare/workers-types@5.20261112.1': {}
+ '@cloudflare/workers-types@5.20261113.1': {}
'@codemirror/autocomplete@6.20.0':
dependencies:
@@ -19837,10 +19837,10 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.13
- '@remix-run/cloudflare@2.12.0(@cloudflare/workers-types@5.20261112.1)(typescript@5.8.3)':
+ '@remix-run/cloudflare@2.12.0(@cloudflare/workers-types@5.20261113.1)(typescript@5.8.3)':
dependencies:
'@cloudflare/kv-asset-handler': 0.1.3
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
'@remix-run/server-runtime': 2.12.0(typescript@5.8.3)
optionalDependencies:
typescript: 5.8.3
@@ -20312,12 +20312,12 @@ snapshots:
- encoding
- supports-color
- '@sentry/cloudflare@10.50.0(@cloudflare/workers-types@5.20261112.1)':
+ '@sentry/cloudflare@10.50.0(@cloudflare/workers-types@5.20261113.1)':
dependencies:
'@opentelemetry/api': 1.9.1
'@sentry/core': 10.50.0
optionalDependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
'@sentry/core@10.50.0': {}
@@ -21953,15 +21953,15 @@ snapshots:
before-after-hook@2.2.3: {}
- better-auth@1.5.4(d0026d6adc26d1c4b53992c680c192b2):
+ better-auth@1.5.4(e89b805c87cf74da82f26bde06056715):
dependencies:
- '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@6.2.1)(kysely@0.28.11)(nanostores@1.1.1)
- '@better-auth/drizzle-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(drizzle-orm@0.45.1(@cloudflare/workers-types@5.20261112.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)))
- '@better-auth/kysely-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(kysely@0.28.11)
- '@better-auth/memory-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)
- '@better-auth/mongo-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(mongodb@7.1.0(socks@2.8.10))
- '@better-auth/prisma-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))
- '@better-auth/telemetry': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261112.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))
+ '@better-auth/core': 1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@6.2.1)(kysely@0.28.11)(nanostores@1.1.1)
+ '@better-auth/drizzle-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(drizzle-orm@0.45.1(@cloudflare/workers-types@5.20261113.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)))
+ '@better-auth/kysely-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(kysely@0.28.11)
+ '@better-auth/memory-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)
+ '@better-auth/mongo-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(mongodb@7.1.0(socks@2.8.10))
+ '@better-auth/prisma-adapter': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))(@better-auth/utils@0.3.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))
+ '@better-auth/telemetry': 1.5.4(@better-auth/core@1.5.4(@better-auth/utils@0.3.1)(@better-fetch/fetch@1.1.21)(@cloudflare/workers-types@5.20261113.1)(better-call@1.3.2(zod@4.6.5))(jose@5.9.3)(kysely@0.28.11)(nanostores@1.1.1))
'@better-auth/utils': 0.3.1
'@better-fetch/fetch': 1.1.21
'@noble/ciphers': 2.1.1
@@ -21974,7 +21974,7 @@ snapshots:
zod: 4.6.5
optionalDependencies:
'@prisma/client': 7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3)
- drizzle-orm: 0.45.1(@cloudflare/workers-types@5.20261112.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))
+ drizzle-orm: 0.45.1(@cloudflare/workers-types@5.20261113.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))
mongodb: 7.1.0(socks@2.8.10)
mysql2: 3.15.3
pg: 8.16.3
@@ -22808,9 +22808,9 @@ snapshots:
dependencies:
wordwrap: 1.0.0
- drizzle-orm@0.45.1(@cloudflare/workers-types@5.20261112.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)):
+ drizzle-orm@0.45.1(@cloudflare/workers-types@5.20261113.1)(@electric-sql/pglite@0.4.1)(@opentelemetry/api@1.9.1)(@prisma/client@7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)):
optionalDependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
'@electric-sql/pglite': 0.4.1
'@opentelemetry/api': 1.9.1
'@prisma/client': 7.6.0(prisma@7.6.0(@types/react-dom@19.2.3(@types/react@19.2.13))(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3)
@@ -25387,9 +25387,9 @@ snapshots:
parseurl@1.3.3: {}
- partyserver@0.3.3(@cloudflare/workers-types@5.20261112.1):
+ partyserver@0.3.3(@cloudflare/workers-types@5.20261113.1):
dependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
nanoid: 5.1.7
partysocket@1.1.16(react@19.2.1):
@@ -28212,15 +28212,15 @@ snapshots:
'@cloudflare/workerd-linux-arm64': 1.20261012.1
'@cloudflare/workerd-windows-64': 1.20261012.1
- workerd@1.20261112.1:
+ workerd@1.20261113.1:
optionalDependencies:
- '@cloudflare/workerd-darwin-64': 1.20261112.1
- '@cloudflare/workerd-darwin-arm64': 1.20261112.1
- '@cloudflare/workerd-linux-64': 1.20261112.1
- '@cloudflare/workerd-linux-arm64': 1.20261112.1
- '@cloudflare/workerd-windows-64': 1.20261112.1
+ '@cloudflare/workerd-darwin-64': 1.20261113.1
+ '@cloudflare/workerd-darwin-arm64': 1.20261113.1
+ '@cloudflare/workerd-linux-64': 1.20261113.1
+ '@cloudflare/workerd-linux-arm64': 1.20261113.1
+ '@cloudflare/workerd-windows-64': 1.20261113.1
- wrangler@4.135.0(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17):
+ wrangler@4.135.0(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17):
dependencies:
'@cloudflare/kv-asset-handler': 0.5.0
'@cloudflare/unenv-preset': 2.16.1(unenv@2.0.0-rc.24)(workerd@1.20260918.1)
@@ -28231,14 +28231,14 @@ snapshots:
unenv: 2.0.0-rc.24
workerd: 1.20260918.1
optionalDependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
fsevents: 2.3.3
transitivePeerDependencies:
- '@types/node'
- bufferutil
- utf-8-validate
- wrangler@4.151.0(@cloudflare/workers-types@5.20261112.1)(@types/node@22.15.17):
+ wrangler@4.151.0(@cloudflare/workers-types@5.20261113.1)(@types/node@22.15.17):
dependencies:
'@cloudflare/kv-asset-handler': 0.5.0
'@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261012.1)
@@ -28249,7 +28249,7 @@ snapshots:
unenv: 2.0.0-rc.24
workerd: 1.20261012.1
optionalDependencies:
- '@cloudflare/workers-types': 5.20261112.1
+ '@cloudflare/workers-types': 5.20261113.1
fsevents: 2.3.3
transitivePeerDependencies:
- '@types/node'
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 452c7f93d0..d7ef55601c 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -151,8 +151,8 @@ catalog:
esbuild: "0.28.2"
"@playwright/test": "1.61.0"
playwright-chromium: "1.61.0"
- "@cloudflare/workers-types": "^5.20261112.1"
- workerd: "1.20261112.1"
+ "@cloudflare/workers-types": "^5.20261113.1"
+ workerd: "1.20261113.1"
jsonc-parser: "3.2.0"
smol-toml: "1.9.0"
msw: "2.14.6"
From 3b1b40832ac323de709001d9cc3823517b988985 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matt=20=E2=80=98TK=E2=80=99=20Taylor?=
Date: Fri, 13 Nov 2026 14:32:42 +0000
Subject: [PATCH 06/30] Fix packages with nested package.json files missing
from package_dependencies (#16864)
Co-authored-by: Pete Bacon Darwin
---
...-nested-package-json-version-resolution.md | 9 +
.../tests/package-dependencies.test.ts | 57 +++++
.../workers-utils/src/package-resolution.ts | 63 ++---
.../tests/package-resolution.test.ts | 219 ++++++++++++++++++
4 files changed, 321 insertions(+), 27 deletions(-)
create mode 100644 .changeset/fix-nested-package-json-version-resolution.md
diff --git a/.changeset/fix-nested-package-json-version-resolution.md b/.changeset/fix-nested-package-json-version-resolution.md
new file mode 100644
index 0000000000..3aa14aaf8d
--- /dev/null
+++ b/.changeset/fix-nested-package-json-version-resolution.md
@@ -0,0 +1,9 @@
+---
+"@cloudflare/codemods": patch
+"@cloudflare/workers-utils": patch
+"wrangler": patch
+---
+
+Fix packages with nested `package.json` files missing from deploy metadata
+
+Packages such as `hono`, `stripe` and `@modelcontextprotocol/sdk` were silently omitted from the package dependency metadata reported during `wrangler deploy` and `wrangler versions upload`. These packages are now included with their installed versions. Autoconfig and codemods also detect their installed versions correctly.
diff --git a/packages/deploy-helpers/tests/package-dependencies.test.ts b/packages/deploy-helpers/tests/package-dependencies.test.ts
index c3fbe343e7..9f757f29a7 100644
--- a/packages/deploy-helpers/tests/package-dependencies.test.ts
+++ b/packages/deploy-helpers/tests/package-dependencies.test.ts
@@ -668,6 +668,63 @@ describe("collectPackageDependencies", () => {
]);
});
+ it("should collect packages whose entry point sits next to a nested package.json", async ({
+ expect,
+ }) => {
+ // Mirrors the layout of `hono`: no `./package.json` export, and a
+ // `dist/cjs/package.json` that only contains `{"type": "commonjs"}`.
+ const pkgPath = path.join(process.cwd(), "node_modules", "hono");
+ const cjsPath = path.join(pkgPath, "dist", "cjs");
+ fs.mkdirSync(cjsPath, { recursive: true });
+ fs.writeFileSync(path.join(cjsPath, "index.js"), "module.exports = {}");
+ fs.writeFileSync(
+ path.join(cjsPath, "package.json"),
+ JSON.stringify({ type: "commonjs" }, null, 2)
+ );
+ fs.writeFileSync(
+ path.join(pkgPath, "package.json"),
+ JSON.stringify(
+ {
+ name: "hono",
+ version: "4.13.18",
+ type: "module",
+ exports: {
+ ".": {
+ import: "./dist/index.js",
+ require: "./dist/cjs/index.js",
+ },
+ },
+ },
+ null,
+ 2
+ )
+ );
+
+ fs.writeFileSync(
+ "package.json",
+ JSON.stringify(
+ {
+ name: "test-project",
+ dependencies: {
+ hono: "^4.13.0",
+ },
+ },
+ null,
+ 2
+ )
+ );
+
+ const result = await collectPackageDependencies(process.cwd());
+
+ expect(result).toEqual([
+ {
+ name: "hono",
+ packageJsonVersion: "^4.13.0",
+ installedVersion: "4.13.18",
+ },
+ ]);
+ });
+
it("should use devDependencies version when duplicate exists in dependencies", async ({
expect,
}) => {
diff --git a/packages/workers-utils/src/package-resolution.ts b/packages/workers-utils/src/package-resolution.ts
index c2eebb5819..8cbeac9bf5 100644
--- a/packages/workers-utils/src/package-resolution.ts
+++ b/packages/workers-utils/src/package-resolution.ts
@@ -78,7 +78,8 @@ export function isPackageInstalled(
* @param projectPath - The path of the project to check
* @param opts - Options
* @param opts.stopAtProjectPath - If `true`, stop walking up at the project's path
- * @returns The installed version string, or `undefined` if the package is not installed
+ * @returns The installed version string, or `undefined` if the package is not
+ * installed or its manifest lacks a name or version
*/
export function getInstalledPackageVersion(
packageName: string,
@@ -94,16 +95,12 @@ export function getInstalledPackageVersion(
}
const lastDir = opts.stopAtProjectPath === true ? projectPath : undefined;
- const packageJsonPath = findFileUp("package.json", packagePath, lastDir);
+ const packageJson = findPackageRootManifest(packagePath, lastDir);
- if (!packageJsonPath) {
+ if (!packageJson) {
return undefined;
}
- const packageJson = parsePackageJSON(
- readFileSync(packageJsonPath),
- packageJsonPath
- );
// The requested package may be installed under an alias (e.g. vite+
// installs `@voidzero-dev/vite-plus-core` under the `vite` alias). In that
// case the resolved package.json belongs to the aliased package, so its
@@ -125,40 +122,52 @@ export function getInstalledPackageVersion(
}
/**
- * Walks up from `startDir` looking for a file named `name`.
- * Stops at `lastDir` (inclusive) if provided, otherwise walks to the filesystem root.
+ * Walks up from `startDir` to find and parse a package's root `package.json`.
+ *
+ * Dual-format packages (e.g. `hono`, `stripe`) often ship nested `package.json`
+ * files such as `dist/cjs/package.json` containing only `{"type": "commonjs"}`.
+ * These tell Node how to load the files in that directory but carry no `name`
+ * or `version`. When the package is resolved through its entry point, the
+ * nearest `package.json` may be one of these markers. Skip nameless manifests
+ * and stop at the first named manifest, returning `undefined` if it has no
+ * version. This also protects symlinked workspace packages resolved outside
+ * `node_modules` from inheriting an ancestor's version. Stop at the installed
+ * package's `node_modules` boundary if no named manifest is found.
*
- * @param name - The filename to search for
* @param startDir - The directory to start searching from
* @param lastDir - If provided, stop searching after reaching this directory
- * @returns The full path to the found file, or `undefined`
+ * @returns The parsed root `package.json`, or `undefined` if none is found
*/
-function findFileUp(
- name: string,
+function findPackageRootManifest(
startDir: string,
lastDir?: string
-): string | undefined {
+): ReturnType | undefined {
let dir = startDir;
- const root = path.parse(dir).root;
while (true) {
- const candidate = path.join(dir, name);
- try {
- if (statSync(candidate).isFile()) {
- return candidate;
+ const packageJsonPath = path.join(dir, "package.json");
+ if (statSync(packageJsonPath, { throwIfNoEntry: false })?.isFile()) {
+ const packageJson = parsePackageJSON(
+ readFileSync(packageJsonPath),
+ packageJsonPath
+ );
+ if (packageJson.name !== undefined) {
+ return packageJson.version !== undefined ? packageJson : undefined;
}
- } catch {}
-
- if (lastDir !== undefined && dir === lastDir) {
- break;
}
const parent = path.dirname(dir);
- if (parent === dir || dir === root) {
- break;
+ // Use the installed directory rather than the manifest's name, which may
+ // be missing or differ from the requested name for npm aliases.
+ if (
+ dir === lastDir ||
+ parent === dir ||
+ path.basename(parent) === "node_modules" ||
+ (path.basename(parent).startsWith("@") &&
+ path.basename(path.dirname(parent)) === "node_modules")
+ ) {
+ return undefined;
}
dir = parent;
}
-
- return undefined;
}
diff --git a/packages/workers-utils/tests/package-resolution.test.ts b/packages/workers-utils/tests/package-resolution.test.ts
index 71578555b4..11d388b85c 100644
--- a/packages/workers-utils/tests/package-resolution.test.ts
+++ b/packages/workers-utils/tests/package-resolution.test.ts
@@ -57,6 +57,48 @@ function createEsmOnlyPackage(name: string, version: string): void {
);
}
+/**
+ * Creates a dual-format package in `node_modules/` under the current directory,
+ * laid out like `hono` or `stripe`: the exports map has no `"./package.json"`
+ * entry, the `require` entry point lives in a subdirectory, and that
+ * subdirectory contains a nested `package.json` marker with only a `type`
+ * field (no `name` or `version`).
+ *
+ * @param name - Package name (supports scoped like `@scope/pkg`)
+ * @param version - Version string to write into the root `package.json`
+ */
+function createPackageWithNestedTypeManifest(
+ name: string,
+ version: string
+): void {
+ const pkgDir = path.join(process.cwd(), "node_modules", name);
+ const cjsDir = path.join(pkgDir, "dist", "cjs");
+ fs.mkdirSync(cjsDir, { recursive: true });
+ fs.writeFileSync(path.join(cjsDir, "index.js"), "module.exports = {}");
+ fs.writeFileSync(
+ path.join(cjsDir, "package.json"),
+ JSON.stringify({ type: "commonjs" }, null, 2)
+ );
+ fs.writeFileSync(
+ path.join(pkgDir, "package.json"),
+ JSON.stringify(
+ {
+ name,
+ version,
+ type: "module",
+ exports: {
+ ".": {
+ import: "./dist/index.js",
+ require: "./dist/cjs/index.js",
+ },
+ },
+ },
+ null,
+ 2
+ )
+ );
+}
+
describe("getPackagePath", () => {
runInTempDir();
@@ -127,6 +169,183 @@ describe("getInstalledPackageVersion", () => {
expect(result).toBe("0.3.0");
});
+ it.for(["nameless-pkg", "@scope/nameless-pkg"])(
+ "should return undefined for %s when its manifest has no name",
+ (packageName, { expect }) => {
+ createCjsPackage(packageName, "1.2.3");
+ fs.writeFileSync(
+ path.join("node_modules", packageName, "package.json"),
+ JSON.stringify({ version: "1.2.3", exports: "./index.js" })
+ );
+ fs.writeFileSync(
+ "package.json",
+ JSON.stringify({ name: "test-project", version: "9.0.0" })
+ );
+
+ expect(
+ getInstalledPackageVersion(packageName, process.cwd())
+ ).toBeUndefined();
+ }
+ );
+
+ it.for(["versionless-pkg", "@scope/versionless-pkg"])(
+ "should return undefined for %s when its manifest has no version",
+ (packageName, { expect }) => {
+ createCjsPackage(packageName, "1.2.3");
+ fs.writeFileSync(
+ path.join("node_modules", packageName, "package.json"),
+ JSON.stringify({ name: packageName, exports: "./index.js" })
+ );
+ fs.writeFileSync(
+ "package.json",
+ JSON.stringify({ name: "test-project", version: "9.0.0" })
+ );
+
+ expect(
+ getInstalledPackageVersion(packageName, process.cwd())
+ ).toBeUndefined();
+ }
+ );
+
+ it.for([
+ { packageName: "workspace-pkg", version: undefined },
+ { packageName: "@scope/workspace-pkg", version: undefined },
+ { packageName: "versioned-workspace-pkg", version: "1.2.3" },
+ ])(
+ "should use the workspace manifest for a symlinked package (%j)",
+ ({ packageName, version }, { expect }) => {
+ const workspaceDir = path.join(process.cwd(), "packages", "foo");
+ const cjsDir = path.join(workspaceDir, "dist", "cjs");
+ fs.mkdirSync(cjsDir, { recursive: true });
+ fs.writeFileSync(path.join(cjsDir, "index.js"), "module.exports = {}");
+ fs.writeFileSync(
+ path.join(cjsDir, "package.json"),
+ JSON.stringify({ type: "commonjs" })
+ );
+ fs.writeFileSync(
+ path.join(workspaceDir, "package.json"),
+ JSON.stringify({
+ name: packageName,
+ version,
+ private: true,
+ exports: "./dist/cjs/index.js",
+ })
+ );
+ fs.writeFileSync(
+ "package.json",
+ JSON.stringify({ name: "monorepo", version: "9.0.0" })
+ );
+ const linkPath = path.join(process.cwd(), "node_modules", packageName);
+ fs.mkdirSync(path.dirname(linkPath), { recursive: true });
+ fs.symlinkSync(workspaceDir, linkPath, "junction");
+
+ expect(getPackagePath(packageName, process.cwd())).toBe(cjsDir);
+ expect(getInstalledPackageVersion(packageName, process.cwd())).toBe(
+ version
+ );
+ }
+ );
+
+ it.for(["anonymous-pkg", "@scope/anonymous-pkg"])(
+ "should not inherit an ancestor version when %s has no name or version",
+ (packageName, { expect }) => {
+ createPackageWithNestedTypeManifest(packageName, "1.2.3");
+ fs.writeFileSync(
+ path.join("node_modules", packageName, "package.json"),
+ JSON.stringify({ exports: "./dist/cjs/index.js" })
+ );
+ fs.writeFileSync(
+ "package.json",
+ JSON.stringify({ name: "test-project", version: "9.0.0" })
+ );
+ if (packageName.startsWith("@")) {
+ fs.writeFileSync(
+ path.join("node_modules", "@scope", "package.json"),
+ JSON.stringify({ name: "scope-parent", version: "8.0.0" })
+ );
+ }
+
+ expect(
+ getInstalledPackageVersion(packageName, process.cwd())
+ ).toBeUndefined();
+ }
+ );
+
+ it("should preserve bundled versions for an alias with nested type markers", ({
+ expect,
+ }) => {
+ createPackageWithNestedTypeManifest("vite", "0.1.0");
+ fs.writeFileSync(
+ path.join("node_modules", "vite", "package.json"),
+ JSON.stringify({
+ name: "@voidzero-dev/vite-plus-core",
+ version: "0.1.0",
+ bundledVersions: { vite: "7.3.0" },
+ exports: "./dist/cjs/index.js",
+ })
+ );
+
+ expect(getInstalledPackageVersion("vite", process.cwd())).toBe("7.3.0");
+ });
+
+ it("should skip a nested manifest with only a version and return the root version", ({
+ expect,
+ }) => {
+ createPackageWithNestedTypeManifest("dual-pkg", "4.0.0");
+ fs.writeFileSync(
+ path.join("node_modules", "dual-pkg", "dist", "cjs", "package.json"),
+ JSON.stringify({ type: "commonjs", version: "1.0.0" })
+ );
+
+ expect(getInstalledPackageVersion("dual-pkg", process.cwd())).toBe("4.0.0");
+ });
+
+ it("should stop at a named nested manifest without a version", ({
+ expect,
+ }) => {
+ createPackageWithNestedTypeManifest("dual-pkg", "4.0.0");
+ fs.writeFileSync(
+ path.join("node_modules", "dual-pkg", "dist", "cjs", "package.json"),
+ JSON.stringify({ type: "commonjs", name: "nested-marker" })
+ );
+
+ expect(
+ getInstalledPackageVersion("dual-pkg", process.cwd())
+ ).toBeUndefined();
+ });
+
+ it("should skip a nested package.json without a name and return the root version", ({
+ expect,
+ }) => {
+ createPackageWithNestedTypeManifest("dual-pkg", "4.13.18");
+
+ const result = getInstalledPackageVersion("dual-pkg", process.cwd());
+
+ expect(result).toBe("4.13.18");
+ });
+
+ it("should skip a nested package.json without a name for a scoped package", ({
+ expect,
+ }) => {
+ createPackageWithNestedTypeManifest("@scope/dual-pkg", "1.32.2");
+
+ const result = getInstalledPackageVersion("@scope/dual-pkg", process.cwd());
+
+ expect(result).toBe("1.32.2");
+ });
+
+ it("should skip a nested package.json without a name when stopping at the project path", ({
+ expect,
+ }) => {
+ createPackageWithNestedTypeManifest("dual-pkg", "2.0.0");
+
+ const result = getInstalledPackageVersion("dual-pkg", process.cwd(), {
+ stopAtProjectPath: true,
+ });
+
+ expect(result).toBe("2.0.0");
+ });
+
it("should return undefined for a non-existent package", ({ expect }) => {
const result = getInstalledPackageVersion(
"nonexistent-package",
From 202e719c997d13b82a453ed63fafa0fec5c2a729 Mon Sep 17 00:00:00 2001
From: Pete Bacon Darwin
Date: Fri, 13 Nov 2026 16:06:20 +0000
Subject: [PATCH 07/30] [miniflare] Retry Chrome startup during quick-action
test warm-up (#16901)
---
packages/miniflare/AGENTS.md | 8 +-
.../test/plugins/browser/index.spec.ts | 40 ++--------
.../plugins/browser/quick-actions.spec.ts | 12 ++-
.../plugins/browser/startup-retry.spec.ts | 76 +++++++++++++++++++
.../miniflare/test/test-shared/browser.ts | 39 ++++++++++
5 files changed, 137 insertions(+), 38 deletions(-)
create mode 100644 packages/miniflare/test/plugins/browser/startup-retry.spec.ts
create mode 100644 packages/miniflare/test/test-shared/browser.ts
diff --git a/packages/miniflare/AGENTS.md b/packages/miniflare/AGENTS.md
index d4fc7e4a97..35b2528f6c 100644
--- a/packages/miniflare/AGENTS.md
+++ b/packages/miniflare/AGENTS.md
@@ -46,7 +46,7 @@ Local dev simulator for Cloudflare Workers, powered by workerd runtime. Main cla
## Testing
- Test files use `.spec.ts` (NOT `.test.ts`)
-- `pool: "forks"`, `maxWorkers: 1` (limits test files to one worker)
+- `vitest.config.mts` is authoritative for the pool, worker count, and timeouts. Test files run in parallel; `concurrent: false` only serializes tests within a file.
- Does NOT extend `vitest.shared.ts` — own full vitest config
- Timeouts: 30s test, 30s hook
- `globals: true`
@@ -55,6 +55,12 @@ Local dev simulator for Cloudflare Workers, powered by workerd runtime. Main cla
- `useServer()` — temp HTTP server with auto-cleanup
- `TestLog` — captures log entries by level
+### Browser tests
+
+- Tests that launch real Chrome should warm it in `beforeAll`, using `CHROME_INSTALL_TIMEOUT` and `retryBrowserStartup()` from `test/test-shared/browser.ts`. The first launch may download Chrome, and even a cached install can exceed Chrome's readiness deadline on a loaded runner. Increasing the hook timeout does not extend that deadline.
+- Check the warm-up response inside the retry callback and include its body in the failure message. Quick actions return launch failures as error responses, so checking only the status hides the error needed to recognize a transient startup failure.
+- Keep retries limited to recognized startup failures. Unrelated warm-up failures and functional assertions must still fail immediately. Dispose any Miniflare instances created for individual warm-up attempts before retrying.
+
## Generated Files
- `src/runtime/config/generated/workerd.ts` — generated Cap'n Proto types, do not edit directly
diff --git a/packages/miniflare/test/plugins/browser/index.spec.ts b/packages/miniflare/test/plugins/browser/index.spec.ts
index 0d36b8e0a8..077972da07 100644
--- a/packages/miniflare/test/plugins/browser/index.spec.ts
+++ b/packages/miniflare/test/plugins/browser/index.spec.ts
@@ -12,11 +12,15 @@ import {
onTestFinished,
describe,
test,
- type TestOptions,
vi,
} from "vitest";
import { CERT, KEY } from "../../../src/http/cert";
import { singleModuleManifest, useDispose, useTmp } from "../../test-shared";
+import {
+ BROWSER_RENDERING_RETRY,
+ CHROME_INSTALL_TIMEOUT,
+ retryBrowserStartup,
+} from "../../test-shared/browser";
import type { MiniflareOptions } from "miniflare";
async function sendMessage(ws: WebSocket, message: unknown) {
@@ -110,23 +114,6 @@ export default {
expect(JSON.parse(responseText)).toEqual({ closingState: 2, closedState: 3 });
});
-const BROWSER_RENDERING_RETRY = {
- retry: {
- condition:
- /Chrome readiness probe .* timed out|Test timed out|Failed to launch (the browser process|local browser)/i,
- count: 3,
- delay: 1_000,
- },
-} satisfies TestOptions;
-
-/**
- * Budget for the one-off Chrome download in {@link warmChromeInstall}.
- *
- * Generous on purpose: a cold CI runner fetches ~150 MB before the first
- * browser can start.
- */
-const CHROME_INSTALL_TIMEOUT = 10 * 60 * 1_000;
-
const BROWSER_WORKER_SCRIPT = () => `
export default {
async fetch(request, env) {
@@ -169,20 +156,7 @@ async function dispatchJson(mf: Miniflare, url: string): Promise {
* means the tests only ever see a complete install.
*/
async function warmChromeInstall(): Promise {
- // The first launch of a fresh install is the slowest, and on a loaded
- // runner it can outlast Chrome's readiness probe. Retry the same failures,
- // as many times, as the tests below do.
- const { condition, count, delay } = BROWSER_RENDERING_RETRY.retry;
- for (let attempt = 0; ; attempt++) {
- try {
- return await launchWarmupBrowser();
- } catch (e) {
- if (attempt >= count || !condition.test(String(e))) {
- throw e;
- }
- await new Promise((resolve) => setTimeout(resolve, delay));
- }
- }
+ await retryBrowserStartup(launchWarmupBrowser);
}
async function launchWarmupBrowser(): Promise {
@@ -214,7 +188,7 @@ async function launchWarmupBrowser(): Promise {
}
}
-// We need to run browser rendering tests in a serial manner to avoid a race condition installing the browser.
+// Keep browser session lifecycle tests serial within this file.
describe("browser rendering", { concurrent: false, timeout: 20_000 }, () => {
beforeAll(warmChromeInstall, CHROME_INSTALL_TIMEOUT);
diff --git a/packages/miniflare/test/plugins/browser/quick-actions.spec.ts b/packages/miniflare/test/plugins/browser/quick-actions.spec.ts
index 383d49c188..7f93d3038b 100644
--- a/packages/miniflare/test/plugins/browser/quick-actions.spec.ts
+++ b/packages/miniflare/test/plugins/browser/quick-actions.spec.ts
@@ -19,6 +19,10 @@ import {
singleModuleManifest,
TestLog,
} from "../../test-shared";
+import {
+ CHROME_INSTALL_TIMEOUT,
+ retryBrowserStartup,
+} from "../../test-shared/browser";
import type { Browser } from "@cloudflare/puppeteer";
import type { AddressInfo } from "node:net";
@@ -64,8 +68,6 @@ const PAGE = `
Top