wrangler 4.74.0 → 4.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -826,6 +826,24 @@
826
826
  "description": "Binding to Cloudflare Media Transformations\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
827
827
  "default": {}
828
828
  },
829
+ "stream": {
830
+ "type": "object",
831
+ "properties": {
832
+ "binding": {
833
+ "type": "string"
834
+ },
835
+ "remote": {
836
+ "type": "boolean",
837
+ "description": "Whether the Stream binding should be remote or not in local development"
838
+ }
839
+ },
840
+ "required": [
841
+ "binding"
842
+ ],
843
+ "additionalProperties": false,
844
+ "description": "Binding to Cloudflare Stream\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
845
+ "default": {}
846
+ },
829
847
  "version_metadata": {
830
848
  "type": "object",
831
849
  "properties": {
@@ -2089,6 +2107,24 @@
2089
2107
  "description": "Binding to Cloudflare Media Transformations\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
2090
2108
  "default": {}
2091
2109
  },
2110
+ "stream": {
2111
+ "type": "object",
2112
+ "properties": {
2113
+ "binding": {
2114
+ "type": "string"
2115
+ },
2116
+ "remote": {
2117
+ "type": "boolean",
2118
+ "description": "Whether the Stream binding should be remote or not in local development"
2119
+ }
2120
+ },
2121
+ "required": [
2122
+ "binding"
2123
+ ],
2124
+ "additionalProperties": false,
2125
+ "description": "Binding to Cloudflare Stream\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
2126
+ "default": {}
2127
+ },
2092
2128
  "version_metadata": {
2093
2129
  "type": "object",
2094
2130
  "properties": {
package/package.json CHANGED
@@ -1,42 +1,40 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.74.0",
3
+ "version": "4.76.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
- "wrangler",
6
+ "assembly",
7
+ "cli",
7
8
  "cloudflare",
8
- "workers",
9
9
  "cloudflare workers",
10
- "edge",
11
10
  "compute",
11
+ "edge",
12
+ "emscripten",
13
+ "graphql",
14
+ "http",
15
+ "router",
16
+ "rust",
12
17
  "serverless",
13
18
  "serverless application",
14
19
  "serverless module",
20
+ "typescript",
15
21
  "wasm",
16
22
  "web",
17
- "assembly",
18
23
  "webassembly",
19
- "rust",
20
- "emscripten",
21
- "typescript",
22
- "graphql",
23
- "router",
24
- "http",
25
- "cli"
24
+ "workers",
25
+ "wrangler"
26
26
  ],
27
27
  "homepage": "https://github.com/cloudflare/workers-sdk#readme",
28
28
  "bugs": {
29
29
  "url": "https://github.com/cloudflare/workers-sdk/issues"
30
30
  },
31
+ "license": "MIT OR Apache-2.0",
32
+ "author": "wrangler@cloudflare.com",
31
33
  "repository": {
32
34
  "type": "git",
33
35
  "url": "https://github.com/cloudflare/workers-sdk.git",
34
36
  "directory": "packages/wrangler"
35
37
  },
36
- "license": "MIT OR Apache-2.0",
37
- "author": "wrangler@cloudflare.com",
38
- "main": "wrangler-dist/cli.js",
39
- "types": "wrangler-dist/cli.d.ts",
40
38
  "bin": {
41
39
  "wrangler": "./bin/wrangler.js",
42
40
  "wrangler2": "./bin/wrangler.js"
@@ -49,21 +47,23 @@
49
47
  "kv-asset-handler.js",
50
48
  "config-schema.json"
51
49
  ],
50
+ "main": "wrangler-dist/cli.js",
51
+ "types": "wrangler-dist/cli.d.ts",
52
52
  "dependencies": {
53
53
  "blake3-wasm": "2.1.5",
54
54
  "esbuild": "0.27.3",
55
55
  "path-to-regexp": "6.3.0",
56
56
  "unenv": "2.0.0-rc.24",
57
- "workerd": "1.20260312.1",
57
+ "workerd": "1.20260317.1",
58
58
  "@cloudflare/kv-asset-handler": "0.4.2",
59
- "@cloudflare/unenv-preset": "2.15.0",
60
- "miniflare": "4.20260312.1"
59
+ "@cloudflare/unenv-preset": "2.16.0",
60
+ "miniflare": "4.20260317.1"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-s3": "^3.721.0",
64
64
  "@bomb.sh/tab": "^0.0.12",
65
65
  "@cloudflare/types": "6.18.4",
66
- "@cloudflare/workers-types": "^4.20260312.1",
66
+ "@cloudflare/workers-types": "^4.20260317.1",
67
67
  "@cspotcode/source-map-support": "0.8.1",
68
68
  "@netlify/build-info": "^10.2.0",
69
69
  "@sentry/node": "^7.86.0",
@@ -104,7 +104,6 @@
104
104
  "dotenv": "^16.3.1",
105
105
  "dotenv-expand": "^12.0.2",
106
106
  "empathic": "^2.0.0",
107
- "eslint": "^9.39.1",
108
107
  "esprima": "4.0.1",
109
108
  "execa": "^6.1.0",
110
109
  "get-port": "^7.0.0",
@@ -139,7 +138,7 @@
139
138
  "ts-json-schema-generator": "^1.5.0",
140
139
  "tsup": "8.3.0",
141
140
  "typescript": "~5.8.3",
142
- "undici": "7.18.2",
141
+ "undici": "7.24.4",
143
142
  "update-check": "^1.5.4",
144
143
  "vitest": "3.2.4",
145
144
  "vitest-websocket-mock": "^0.4.0",
@@ -148,16 +147,15 @@
148
147
  "yaml": "^2.8.1",
149
148
  "yargs": "^17.7.2",
150
149
  "@cloudflare/cli": "1.2.1",
151
- "@cloudflare/containers-shared": "0.12.0",
152
- "@cloudflare/pages-shared": "^0.13.115",
150
+ "@cloudflare/containers-shared": "0.13.0",
151
+ "@cloudflare/pages-shared": "^0.13.117",
153
152
  "@cloudflare/workers-shared": "0.19.1",
154
153
  "@cloudflare/workers-tsconfig": "0.0.0",
155
- "@cloudflare/workers-utils": "0.12.0",
156
- "@cloudflare/workflows-shared": "0.6.0",
157
- "@cloudflare/eslint-config-shared": "1.2.1"
154
+ "@cloudflare/workers-utils": "0.13.0",
155
+ "@cloudflare/workflows-shared": "0.7.0"
158
156
  },
159
157
  "peerDependencies": {
160
- "@cloudflare/workers-types": "^4.20260312.1"
158
+ "@cloudflare/workers-types": "^4.20260317.1"
161
159
  },
162
160
  "peerDependenciesMeta": {
163
161
  "@cloudflare/workers-types": {
@@ -179,7 +177,6 @@
179
177
  "scripts": {
180
178
  "assert-git-version": "node -r esbuild-register scripts/assert-git-version.ts",
181
179
  "build": "pnpm run clean && pnpm tsup && pnpm run generate-json-schema",
182
- "check:lint": "eslint . --max-warnings=0 --cache",
183
180
  "check:type": "tsc -p ./tsconfig.json && tsc -p ./templates/tsconfig.json",
184
181
  "clean": "node -r esbuild-register ../../tools/clean/clean.ts wrangler-dist miniflare-dist emitted-types",
185
182
  "dev": "pnpm run clean && concurrently -c black,blue --kill-others-on-fail false \"pnpm tsup --watch src --watch ../containers-shared/src --watch ../cli\" \"pnpm run check:type --watch --preserveWatchOutput\"",
@@ -5,10 +5,8 @@ function checkURL(request, init) {
5
5
  request instanceof URL
6
6
  ? request
7
7
  : new URL(
8
- (typeof request === "string"
9
- ? new Request(request, init)
10
- : request
11
- ).url
8
+ (typeof request === "string" ? new Request(request, init) : request)
9
+ .url
12
10
  );
13
11
  if (url.port && url.port !== "443" && url.protocol === "https:") {
14
12
  if (!urls.has(url.toString())) {
@@ -1,6 +1,6 @@
1
1
  declare module "__ENTRY_POINT__" {
2
- import { Middleware } from "./middleware/common";
3
2
  import { WorkerEntrypoint } from "cloudflare:workers";
3
+ import { Middleware } from "./middleware/common";
4
4
 
5
5
  export type WorkerEntrypointConstructor = typeof WorkerEntrypoint;
6
6
 
@@ -24,6 +24,10 @@ import type {
24
24
  const ALLOWED_HOST_HOSTNAMES = ["127.0.0.1", "[::1]", "localhost"];
25
25
  const ALLOWED_ORIGIN_HOSTNAMES = [
26
26
  "devtools.devprod.cloudflare.dev",
27
+ // Workers + Assets (current deployment)
28
+ "cloudflare-devtools.devprod.workers.dev",
29
+ /^[a-z0-9]+-cloudflare-devtools\.devprod\.workers\.dev$/,
30
+ // Cloudflare Pages (legacy deployment)
27
31
  "cloudflare-devtools.pages.dev",
28
32
  /^[a-z0-9]+\.cloudflare-devtools\.pages\.dev$/,
29
33
  "127.0.0.1",
@@ -398,10 +402,18 @@ export class InspectorProxyWorker implements DurableObject {
398
402
  { method: "Runtime.enable", id: this.nextCounter() },
399
403
  runtime
400
404
  );
401
- this.sendRuntimeMessage(
402
- { method: "Debugger.enable", id: this.nextCounter() },
403
- runtime
404
- );
405
+ // Only send Debugger.enable if DevTools is already attached.
406
+ // When DevTools first connects, it sends its own Debugger.enable message.
407
+ // However, on runtime reconnect (e.g., after worker reload), DevTools won't
408
+ // re-send Debugger.enable since it considers the session still active.
409
+ // Without this, Debugger.scriptParsed events won't be emitted on the new
410
+ // runtime connection, breaking source maps, breakpoints, and debugger pausing.
411
+ if (this.websockets.devtools !== undefined) {
412
+ this.sendRuntimeMessage(
413
+ { method: "Debugger.enable", id: this.nextCounter() },
414
+ runtime
415
+ );
416
+ }
405
417
  this.sendRuntimeMessage(
406
418
  { method: "Network.enable", id: this.nextCounter() },
407
419
  runtime
@@ -547,24 +559,31 @@ export class InspectorProxyWorker implements DurableObject {
547
559
  );
548
560
  } else {
549
561
  devtools.addEventListener("message", this.handleDevToolsIncomingMessage);
562
+ const disconnectDevtools = () => {
563
+ if (this.websockets.devtools === devtools) {
564
+ this.websockets.devtools = undefined;
565
+
566
+ // Notify the runtime to disable the debugger when DevTools disconnects.
567
+ if (this.websockets.runtime) {
568
+ this.sendRuntimeMessage({
569
+ id: this.nextCounter(),
570
+ method: "Debugger.disable",
571
+ });
572
+ }
573
+ }
574
+ };
550
575
  devtools.addEventListener("close", (event) => {
551
576
  this.sendDebugLog(
552
577
  "DEVTOOLS WEBSOCKET CLOSED",
553
578
  event.code,
554
579
  event.reason
555
580
  );
556
-
557
- if (this.websockets.devtools === devtools) {
558
- this.websockets.devtools = undefined;
559
- }
581
+ disconnectDevtools();
560
582
  });
561
583
  devtools.addEventListener("error", (event) => {
562
584
  const error = serialiseError(event.error);
563
585
  this.sendDebugLog("DEVTOOLS WEBSOCKET ERROR", error);
564
-
565
- if (this.websockets.devtools === devtools) {
566
- this.websockets.devtools = undefined;
567
- }
586
+ disconnectDevtools();
568
587
  });
569
588
 
570
589
  // Since Wrangler proxies the inspector, reloading Chrome DevTools won't trigger debugger initialisation events (because it's connecting to an extant session).
@@ -46,6 +46,10 @@ function assertNever(_value) {
46
46
  var ALLOWED_HOST_HOSTNAMES = ["127.0.0.1", "[::1]", "localhost"];
47
47
  var ALLOWED_ORIGIN_HOSTNAMES = [
48
48
  "devtools.devprod.cloudflare.dev",
49
+ // Workers + Assets (current deployment)
50
+ "cloudflare-devtools.devprod.workers.dev",
51
+ /^[a-z0-9]+-cloudflare-devtools\.devprod\.workers\.dev$/,
52
+ // Cloudflare Pages (legacy deployment)
49
53
  "cloudflare-devtools.pages.dev",
50
54
  /^[a-z0-9]+\.cloudflare-devtools\.pages\.dev$/,
51
55
  "127.0.0.1",
@@ -286,10 +290,12 @@ var InspectorProxyWorker = class {
286
290
  { method: "Runtime.enable", id: this.nextCounter() },
287
291
  runtime
288
292
  );
289
- this.sendRuntimeMessage(
290
- { method: "Debugger.enable", id: this.nextCounter() },
291
- runtime
292
- );
293
+ if (this.websockets.devtools !== void 0) {
294
+ this.sendRuntimeMessage(
295
+ { method: "Debugger.enable", id: this.nextCounter() },
296
+ runtime
297
+ );
298
+ }
293
299
  this.sendRuntimeMessage(
294
300
  { method: "Network.enable", id: this.nextCounter() },
295
301
  runtime
@@ -401,22 +407,29 @@ var InspectorProxyWorker = class {
401
407
  );
402
408
  } else {
403
409
  devtools.addEventListener("message", this.handleDevToolsIncomingMessage);
410
+ const disconnectDevtools = () => {
411
+ if (this.websockets.devtools === devtools) {
412
+ this.websockets.devtools = void 0;
413
+ if (this.websockets.runtime) {
414
+ this.sendRuntimeMessage({
415
+ id: this.nextCounter(),
416
+ method: "Debugger.disable"
417
+ });
418
+ }
419
+ }
420
+ };
404
421
  devtools.addEventListener("close", (event) => {
405
422
  this.sendDebugLog(
406
423
  "DEVTOOLS WEBSOCKET CLOSED",
407
424
  event.code,
408
425
  event.reason
409
426
  );
410
- if (this.websockets.devtools === devtools) {
411
- this.websockets.devtools = void 0;
412
- }
427
+ disconnectDevtools();
413
428
  });
414
429
  devtools.addEventListener("error", (event) => {
415
430
  const error = serialiseError(event.error);
416
431
  this.sendDebugLog("DEVTOOLS WEBSOCKET ERROR", error);
417
- if (this.websockets.devtools === devtools) {
418
- this.websockets.devtools = void 0;
419
- }
432
+ disconnectDevtools();
420
433
  });
421
434
  this.sendRuntimeMessage({
422
435
  id: this.nextCounter(),
@@ -1810,6 +1810,20 @@ interface EnvironmentNonInheritable {
1810
1810
  /** Whether the Media binding should be remote or not */
1811
1811
  remote?: boolean;
1812
1812
  } | undefined;
1813
+ /**
1814
+ * Binding to Cloudflare Stream
1815
+ *
1816
+ * NOTE: This field is not automatically inherited from the top level environment,
1817
+ * and so must be specified in every named environment.
1818
+ *
1819
+ * @default {}
1820
+ * @nonInheritable
1821
+ */
1822
+ stream: {
1823
+ binding: string;
1824
+ /** Whether the Stream binding should be remote or not in local development */
1825
+ remote?: boolean;
1826
+ } | undefined;
1813
1827
  /**
1814
1828
  * Binding to the Worker Version's metadata
1815
1829
  */
@@ -2827,7 +2841,8 @@ type Teams =
2827
2841
  | "Product: Workflows"
2828
2842
  | "Product: Cloudchamber"
2829
2843
  | "Product: SSL"
2830
- | "Product: WVPC";
2844
+ | "Product: WVPC"
2845
+ | "Product: Tunnels";
2831
2846
 
2832
2847
  /** Convert literal string types like 'foo-bar' to 'FooBar' */
2833
2848
  type PascalCase<S extends string> = string extends S ? string : S extends `${infer T}-${infer U}` ? `${Capitalize<T>}${PascalCase<U>}` : Capitalize<S>;