wrangler 4.73.0 → 4.75.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.73.0",
3
+ "version": "4.75.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -54,16 +54,16 @@
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
59
  "@cloudflare/unenv-preset": "2.15.0",
60
- "miniflare": "4.20260312.0"
60
+ "miniflare": "4.20260317.0"
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",
@@ -139,7 +139,7 @@
139
139
  "ts-json-schema-generator": "^1.5.0",
140
140
  "tsup": "8.3.0",
141
141
  "typescript": "~5.8.3",
142
- "undici": "7.18.2",
142
+ "undici": "7.24.4",
143
143
  "update-check": "^1.5.4",
144
144
  "vitest": "3.2.4",
145
145
  "vitest-websocket-mock": "^0.4.0",
@@ -148,16 +148,16 @@
148
148
  "yaml": "^2.8.1",
149
149
  "yargs": "^17.7.2",
150
150
  "@cloudflare/cli": "1.2.1",
151
- "@cloudflare/containers-shared": "0.11.0",
151
+ "@cloudflare/containers-shared": "0.12.0",
152
152
  "@cloudflare/eslint-config-shared": "1.2.1",
153
- "@cloudflare/pages-shared": "^0.13.114",
154
153
  "@cloudflare/workers-shared": "0.19.1",
154
+ "@cloudflare/pages-shared": "^0.13.116",
155
155
  "@cloudflare/workers-tsconfig": "0.0.0",
156
156
  "@cloudflare/workers-utils": "0.12.0",
157
157
  "@cloudflare/workflows-shared": "0.6.0"
158
158
  },
159
159
  "peerDependencies": {
160
- "@cloudflare/workers-types": "^4.20260312.1"
160
+ "@cloudflare/workers-types": "^4.20260317.1"
161
161
  },
162
162
  "peerDependenciesMeta": {
163
163
  "@cloudflare/workers-types": {
@@ -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())) {
@@ -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(),
@@ -169,8 +169,8 @@ interface PagesDeployOptions {
169
169
  */
170
170
  declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, sourceMaps, args, }: PagesDeployOptions): Promise<{
171
171
  deploymentResponse: {
172
- id: string;
173
172
  url: string;
173
+ id: string;
174
174
  environment: "production" | "preview";
175
175
  build_config: {
176
176
  build_command: string;
@@ -2442,6 +2442,7 @@ type ConfigurationOptions = {
2442
2442
  workerName: string;
2443
2443
  dryRun: boolean;
2444
2444
  packageManager: PackageManager;
2445
+ isWorkspaceRoot: boolean;
2445
2446
  };
2446
2447
  type PackageJsonScriptsOverrides = {
2447
2448
  preview?: string;
@@ -2483,6 +2484,8 @@ type AutoConfigDetailsBase = {
2483
2484
  outputDir: string;
2484
2485
  /** The detected package manager for the project */
2485
2486
  packageManager: PackageManager;
2487
+ /** Whether the current path is at the root of a workspace */
2488
+ isWorkspaceRoot?: boolean;
2486
2489
  };
2487
2490
  type AutoConfigDetailsForConfiguredProject = Optional<AutoConfigDetailsBase, "framework" | "outputDir"> & {
2488
2491
  configured: true;
@@ -2824,7 +2827,8 @@ type Teams =
2824
2827
  | "Product: Workflows"
2825
2828
  | "Product: Cloudchamber"
2826
2829
  | "Product: SSL"
2827
- | "Product: WVPC";
2830
+ | "Product: WVPC"
2831
+ | "Product: Tunnels";
2828
2832
 
2829
2833
  /** Convert literal string types like 'foo-bar' to 'FooBar' */
2830
2834
  type PascalCase<S extends string> = string extends S ? string : S extends `${infer T}-${infer U}` ? `${Capitalize<T>}${PascalCase<U>}` : Capitalize<S>;