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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .changeset/bright-trees-explain.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/bump-undici-7-28-0.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/bump-ws-8-21-0.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/cf-vite-build-verb.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/cf-wrangler-build-delegate.md

This file was deleted.

14 changes: 0 additions & 14 deletions .changeset/chubby-things-cheat.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changeset/dependabot-update-14331.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/deploy-helpers-provision-bindings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/deploy-helpers": patch
---

Move resource provisioning into deploy helpers

Worker deploy and versions upload now share the deploy helpers implementation for provisioning bindings, reducing Wrangler-specific callback wiring while preserving existing behavior.
5 changes: 0 additions & 5 deletions .changeset/fancy-crabs-occur.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/fix-d1-auto-provisioned-binding-subcommands.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/fix-no-bundle-find-additional-modules.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/fix-sourcemap-crash-invalid-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

Prevent `wrangler dev` crash when source-mapping a truncated error chunk

When a worker logs many errors in quick succession, the stderr chunks received by `wrangler dev` can be truncated mid-stack-frame, leaving a call site with an invalid column number. The source map library throws in that case, which was crashing the wrangler process entirely. The error is now caught and the original (un-source-mapped) text is returned instead.
8 changes: 8 additions & 0 deletions .changeset/fix-workflows-uint8array-step-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"miniflare": patch
"wrangler": patch
---

Fix `Uint8Array` step outputs in local Workflows being persisted with the full backing `ArrayBuffer`

A `Uint8Array` returned from a Workflows step under `wrangler dev` was serialised together with its full underlying `ArrayBuffer`, causing a raw `SQLITE_TOOBIG` error at view sizes well below the documented 1MiB step-output limit. For example, a 200KB view sliced from an 800KB buffer (a common pattern from `crypto.getRandomValues` or `arr.slice(...)` on a larger pool) would fail. The view's bytes are now copied to a tight buffer before persistence, bringing local behaviour in line with production. Fixes #14101.
8 changes: 8 additions & 0 deletions .changeset/move-worker-name-to-workers-utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"wrangler": minor
"@cloudflare/workers-utils": minor
---

Move `unstable_getWorkerNameFromProject` from wrangler to `@cloudflare/workers-utils`

The `unstable_getWorkerNameFromProject` export has been removed from the `wrangler` package. This function is now available as `getWorkerNameFromProject` (without the `unstable_` prefix) from `@cloudflare/workers-utils`. If you were importing this function from `wrangler`, update your import to use `@cloudflare/workers-utils` instead.
9 changes: 0 additions & 9 deletions .changeset/typed-service-binding-dev-plugin.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/vite-plugin-vitest4-resolve-external.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/whoami-temporary-account-hint.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wise-planets-stare.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/workers-utils-package-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/workers-utils": minor
---

Add PackageManager type and constants

Added the `PackageManager` interface and package manager constants (`NpmPackageManager`, `PnpmPackageManager`, `YarnPackageManager`, `BunPackageManager`).
7 changes: 0 additions & 7 deletions .changeset/wrangler-experimental-cf-build-output.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/wrangler-remove-experimental-autoconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": minor
---

Remove experimental autoconfig exports

The experimental autoconfig exports (`experimental_getDetailsForAutoConfig`, `experimental_runAutoConfig`, `experimental_AutoConfigFramework`) have been removed. This logic has been moved to the `@cloudflare/autoconfig` package (without the `experimental_` prefixes since the package itself is pre-v1).
52 changes: 52 additions & 0 deletions packages/autoconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@cloudflare/autoconfig",
"version": "0.1.0",
"description": "Framework autoconfig detection and configuration for Cloudflare Workers",
"license": "MIT OR Apache-2.0",
"files": [
"dist"
],
"type": "module",
"sideEffects": false,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"build": "tsup",
"check:type": "tsc -p ./tsconfig.json",
"dev": "tsup --watch",
"test": "vitest",
"test:ci": "vitest run"
},
"dependencies": {
"@cloudflare/cli-shared-helpers": "workspace:*",
"@cloudflare/workers-utils": "workspace:*"
},
"devDependencies": {
"@cloudflare/codemod": "workspace:*",
"@cloudflare/workers-tsconfig": "workspace:*",
"@netlify/build-info": "^10.5.1",
"@types/esprima": "^4.0.3",
"@types/node": "catalog:default",
"chalk": "catalog:default",
"empathic": "^2.0.0",
"esprima": "4.0.1",
"recast": "0.23.11",
"semiver": "^1.1.0",
"ts-dedent": "^2.2.0",
"tsup": "8.3.0",
"typescript": "catalog:default",
"vitest": "catalog:default"
},
"volta": {
"extends": "../../package.json"
},
"workers-sdk": {
"prerelease": true
}
}
12 changes: 12 additions & 0 deletions packages/autoconfig/scripts/deps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Dependencies that _are not_ bundled along with @cloudflare/autoconfig.
*
* These must be explicitly documented with a reason why they cannot be bundled.
* This list is validated by `tools/deployments/validate-package-dependencies.ts`.
*/
export const EXTERNAL_DEPENDENCIES = [
// Published workspace packages that consumers must install alongside autoconfig.
// They are kept external to share a single copy with wrangler and other SDK tools.
"@cloudflare/cli-shared-helpers",
"@cloudflare/workers-utils",
];
107 changes: 107 additions & 0 deletions packages/autoconfig/src/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/**
* Logger interface for autoconfig output.
* Callers provide their own implementation (e.g., wrapping `console` or a custom logger).
*/
export interface AutoConfigLogger {
/** Logs informational output. */
log(...args: unknown[]): void;
/** Logs an informational message. */
info(...args: unknown[]): void;
/** Logs a warning message. */
warn(...args: unknown[]): void;
/** Logs a debug-level message (may be suppressed in production). */
debug(...args: unknown[]): void;
/** Logs an error message. */
error(...args: unknown[]): void;
}

/**
* Dialog interface for interactive prompts.
* Callers provide their own implementation (e.g., using `prompts`, `inquirer`, or a custom UI).
*/
export interface AutoConfigDialogs {
/**
* Asks a yes/no confirmation question.
*
* @param text - The question to display
* @param options - Optional defaults and fallback behavior
* @returns `true` if confirmed, `false` otherwise
*/
confirm(
text: string,
options?: { defaultValue?: boolean; fallbackValue?: boolean }
): Promise<boolean>;

/**
* Prompts the user for a text input.
*
* @param text - The prompt message
* @param options - Optional default value and validation function
* @returns The user-provided string
*/
prompt(
text: string,
options?: {
defaultValue?: string;
validate?: (
value: string
) => boolean | string | Promise<boolean | string>;
}
): Promise<string>;

/**
* Presents a selection list to the user.
*
* @param text - The prompt message
* @param options - Available choices and optional default selection
* @returns The selected value
*/
select(
text: string,
options: {
choices: Array<{
title: string;
value: string;
description?: string;
}>;
defaultOption?: number;
}
): Promise<string>;
}

/**
* Context object that provides external dependencies to the autoconfig system.
*
* Callers must provide implementations for `logger` and `dialogs`.
* All other fields are optional and allow callers to customize behavior
* (e.g., error reporting, command execution, CI detection).
*/
export interface AutoConfigContext {
/** Logger used for all autoconfig output. */
logger: AutoConfigLogger;
/** Dialogs used for interactive prompts. */
dialogs: AutoConfigDialogs;
/**
* Runs a shell command in the given directory.
*
* @param command - The shell command string to execute
* @param cwd - The working directory for the command
* @param label - A short label for logging (e.g., "[build]")
* @returns A promise that resolves when the command completes
*/
runCommand: (command: string, cwd: string, label: string) => Promise<void>;
/**
* Returns `true` if running in a non-interactive or CI environment.
* Defaults to `() => false` if not provided.
*
* @returns Whether the current environment is non-interactive
*/
isNonInteractiveOrCI?: () => boolean;
/**
* Returns a cache folder path used for detecting cached project state,
* or `undefined` if not available.
*
* @returns The cache folder path, or `undefined`
*/
getCacheFolder?: () => string | undefined;
}
Loading
Loading