wrangler 4.99.0 → 4.101.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/bin/cf-wrangler.js +115 -0
- package/package.json +31 -19
- package/templates/startDevWorker/InspectorProxyWorker.ts +19 -5
- package/wrangler-dist/InspectorProxyWorker.js +10 -4
- package/wrangler-dist/cli.d.ts +316 -273
- package/wrangler-dist/cli.js +213004 -194764
- package/wrangler-dist/experimental-config.d.mts +1516 -0
- package/wrangler-dist/experimental-config.d.mts.map +1 -0
- package/wrangler-dist/experimental-config.mjs +208 -0
- package/wrangler-dist/experimental-config.mjs.map +1 -0
- package/wrangler-dist/metafile-cjs.json +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `cf-wrangler` delegate binary. Runs wrangler's bundled dev server
|
|
3
|
+
// in-process; the parent tool owns the Node runtime (version, flags).
|
|
4
|
+
//
|
|
5
|
+
// Dispatches on the leading verb. Only `dev` exists today; an unknown
|
|
6
|
+
// or missing verb exits 2, which the parent uses to feature-detect
|
|
7
|
+
// support.
|
|
8
|
+
const {
|
|
9
|
+
ArgParseError,
|
|
10
|
+
parseCfWranglerArgs,
|
|
11
|
+
runCfWranglerDev,
|
|
12
|
+
} = require("../wrangler-dist/cli.js");
|
|
13
|
+
|
|
14
|
+
const argv = process.argv.slice(2);
|
|
15
|
+
const verb = argv[0];
|
|
16
|
+
|
|
17
|
+
if (verb !== "dev") {
|
|
18
|
+
process.stderr.write(
|
|
19
|
+
`Error: unknown subcommand "${verb ?? ""}".\n` +
|
|
20
|
+
`Usage: cf-wrangler dev [args]\n`
|
|
21
|
+
);
|
|
22
|
+
process.exit(2);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let parsed;
|
|
26
|
+
try {
|
|
27
|
+
parsed = parseCfWranglerArgs(argv.slice(1));
|
|
28
|
+
} catch (err) {
|
|
29
|
+
if (err instanceof ArgParseError) {
|
|
30
|
+
process.stderr.write(`Error: ${err.message}\n`);
|
|
31
|
+
process.exit(2);
|
|
32
|
+
}
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Build wrangler dev's full (yargs-derived) options object. Every field
|
|
37
|
+
// must be present; we set the four accepted flags plus `wrangler dev`'s
|
|
38
|
+
// defaults and leave everything else `undefined`, which makes wrangler's
|
|
39
|
+
// ConfigController resolve those exactly as `wrangler dev` would (config
|
|
40
|
+
// discovery, containers, inspector port, interactive hotkeys, ...).
|
|
41
|
+
// `--local` forces local execution; left unset it preserves per-resource
|
|
42
|
+
// `remote = true` bindings. There is no whole-worker remote dev (no
|
|
43
|
+
// `--remote`).
|
|
44
|
+
const options = {
|
|
45
|
+
_: [],
|
|
46
|
+
$0: "",
|
|
47
|
+
env: parsed.mode,
|
|
48
|
+
port: parsed.port,
|
|
49
|
+
host: parsed.host,
|
|
50
|
+
local: parsed.local,
|
|
51
|
+
remote: false,
|
|
52
|
+
latest: true,
|
|
53
|
+
noBundle: false,
|
|
54
|
+
testScheduled: false,
|
|
55
|
+
processEntrypoint: false,
|
|
56
|
+
experimentalAutoCreate: false,
|
|
57
|
+
types: false,
|
|
58
|
+
disableDevRegistry: false,
|
|
59
|
+
config: undefined,
|
|
60
|
+
script: undefined,
|
|
61
|
+
name: undefined,
|
|
62
|
+
accountId: undefined,
|
|
63
|
+
forceLocal: undefined,
|
|
64
|
+
compatibilityDate: undefined,
|
|
65
|
+
compatibilityFlags: undefined,
|
|
66
|
+
ip: undefined,
|
|
67
|
+
inspectorPort: undefined,
|
|
68
|
+
inspectorIp: undefined,
|
|
69
|
+
v: undefined,
|
|
70
|
+
cwd: undefined,
|
|
71
|
+
localProtocol: undefined,
|
|
72
|
+
httpsKeyPath: undefined,
|
|
73
|
+
httpsCertPath: undefined,
|
|
74
|
+
assets: undefined,
|
|
75
|
+
site: undefined,
|
|
76
|
+
siteInclude: undefined,
|
|
77
|
+
siteExclude: undefined,
|
|
78
|
+
persist: undefined,
|
|
79
|
+
persistTo: undefined,
|
|
80
|
+
routes: undefined,
|
|
81
|
+
localUpstream: undefined,
|
|
82
|
+
upstreamProtocol: undefined,
|
|
83
|
+
var: undefined,
|
|
84
|
+
define: undefined,
|
|
85
|
+
alias: undefined,
|
|
86
|
+
jsxFactory: undefined,
|
|
87
|
+
jsxFragment: undefined,
|
|
88
|
+
tsconfig: undefined,
|
|
89
|
+
minify: undefined,
|
|
90
|
+
legacyEnv: undefined,
|
|
91
|
+
logLevel: undefined,
|
|
92
|
+
showInteractiveDevSession: undefined,
|
|
93
|
+
liveReload: undefined,
|
|
94
|
+
bundle: undefined,
|
|
95
|
+
additionalModules: undefined,
|
|
96
|
+
enablePagesAssetsServiceBinding: undefined,
|
|
97
|
+
d1Databases: undefined,
|
|
98
|
+
experimentalProvision: undefined,
|
|
99
|
+
enableIpc: undefined,
|
|
100
|
+
nodeCompat: undefined,
|
|
101
|
+
enableContainers: undefined,
|
|
102
|
+
dockerPath: undefined,
|
|
103
|
+
containerEngine: undefined,
|
|
104
|
+
tunnel: undefined,
|
|
105
|
+
tunnelName: undefined,
|
|
106
|
+
envFile: undefined,
|
|
107
|
+
onReady: undefined,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
runCfWranglerDev(options)
|
|
111
|
+
.then((code) => process.exit(code))
|
|
112
|
+
.catch((err) => {
|
|
113
|
+
process.stderr.write(`${(err && err.stack) || err}\n`);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.101.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assembly",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"directory": "packages/wrangler"
|
|
37
37
|
},
|
|
38
38
|
"bin": {
|
|
39
|
+
"cf-wrangler": "./bin/cf-wrangler.js",
|
|
39
40
|
"wrangler": "./bin/wrangler.js",
|
|
40
41
|
"wrangler2": "./bin/wrangler.js"
|
|
41
42
|
},
|
|
@@ -49,21 +50,32 @@
|
|
|
49
50
|
],
|
|
50
51
|
"main": "wrangler-dist/cli.js",
|
|
51
52
|
"types": "wrangler-dist/cli.d.ts",
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./wrangler-dist/cli.d.ts",
|
|
56
|
+
"default": "./wrangler-dist/cli.js"
|
|
57
|
+
},
|
|
58
|
+
"./experimental-config": {
|
|
59
|
+
"types": "./wrangler-dist/experimental-config.d.mts",
|
|
60
|
+
"import": "./wrangler-dist/experimental-config.mjs"
|
|
61
|
+
},
|
|
62
|
+
"./package.json": "./package.json"
|
|
63
|
+
},
|
|
52
64
|
"dependencies": {
|
|
53
65
|
"blake3-wasm": "2.1.5",
|
|
54
66
|
"esbuild": "0.27.3",
|
|
55
67
|
"path-to-regexp": "6.3.0",
|
|
56
68
|
"unenv": "2.0.0-rc.24",
|
|
57
|
-
"workerd": "1.
|
|
69
|
+
"workerd": "1.20260616.1",
|
|
58
70
|
"@cloudflare/unenv-preset": "2.16.1",
|
|
59
71
|
"@cloudflare/kv-asset-handler": "0.5.0",
|
|
60
|
-
"miniflare": "4.
|
|
72
|
+
"miniflare": "4.20260616.0"
|
|
61
73
|
},
|
|
62
74
|
"devDependencies": {
|
|
63
75
|
"@aws-sdk/client-s3": "^3.721.0",
|
|
64
76
|
"@bomb.sh/tab": "^0.0.12",
|
|
65
77
|
"@cloudflare/types": "6.18.4",
|
|
66
|
-
"@cloudflare/workers-types": "^4.
|
|
78
|
+
"@cloudflare/workers-types": "^4.20260616.1",
|
|
67
79
|
"@cspotcode/source-map-support": "0.8.1",
|
|
68
80
|
"@netlify/build-info": "^10.5.1",
|
|
69
81
|
"@sentry/node": "^7.86.0",
|
|
@@ -73,7 +85,6 @@
|
|
|
73
85
|
"@types/esprima": "^4.0.3",
|
|
74
86
|
"@types/glob-to-regexp": "^0.4.1",
|
|
75
87
|
"@types/javascript-time-ago": "^2.0.3",
|
|
76
|
-
"@types/json-diff": "^1.0.3",
|
|
77
88
|
"@types/mime": "^3.0.4",
|
|
78
89
|
"@types/minimatch": "^5.1.2",
|
|
79
90
|
"@types/node": "22.15.17",
|
|
@@ -89,17 +100,17 @@
|
|
|
89
100
|
"@webcontainer/env": "^1.1.0",
|
|
90
101
|
"am-i-vibing": "^0.4.0",
|
|
91
102
|
"capnweb": "0.5.0",
|
|
92
|
-
"chalk": "
|
|
103
|
+
"chalk": "5.3.0",
|
|
93
104
|
"chokidar": "^4.0.1",
|
|
94
105
|
"ci-info": "4.4.0",
|
|
95
106
|
"cli-table3": "^0.6.3",
|
|
96
107
|
"cloudflare": "^5.2.0",
|
|
97
108
|
"cmd-shim": "^4.1.0",
|
|
98
|
-
"command-exists": "
|
|
109
|
+
"command-exists": "1.2.9",
|
|
99
110
|
"concurrently": "^8.2.2",
|
|
100
111
|
"date-fns": "^4.1.0",
|
|
101
112
|
"devtools-protocol": "^0.0.1182435",
|
|
102
|
-
"dotenv": "
|
|
113
|
+
"dotenv": "16.3.1",
|
|
103
114
|
"dotenv-expand": "^12.0.2",
|
|
104
115
|
"empathic": "^2.0.0",
|
|
105
116
|
"esprima": "4.0.1",
|
|
@@ -109,7 +120,6 @@
|
|
|
109
120
|
"https-proxy-agent": "7.0.2",
|
|
110
121
|
"itty-time": "^1.0.6",
|
|
111
122
|
"javascript-time-ago": "^2.5.4",
|
|
112
|
-
"json-diff": "^1.0.6",
|
|
113
123
|
"jsonc-parser": "3.2.0",
|
|
114
124
|
"md5-file": "5.0.0",
|
|
115
125
|
"mime": "^3.0.0",
|
|
@@ -130,12 +140,12 @@
|
|
|
130
140
|
"shell-quote": "^1.8.1",
|
|
131
141
|
"signal-exit": "3.0.7",
|
|
132
142
|
"smol-toml": "1.5.2",
|
|
133
|
-
"source-map": "^0.6.1",
|
|
134
143
|
"supports-color": "^9.2.2",
|
|
135
144
|
"timeago.js": "4.0.2",
|
|
136
145
|
"tree-kill": "1.2.2",
|
|
137
146
|
"ts-dedent": "^2.2.0",
|
|
138
147
|
"ts-json-schema-generator": "^1.5.0",
|
|
148
|
+
"tsdown": "0.16.3",
|
|
139
149
|
"tsup": "8.3.0",
|
|
140
150
|
"typescript": "5.8.3",
|
|
141
151
|
"undici": "7.24.8",
|
|
@@ -145,19 +155,21 @@
|
|
|
145
155
|
"xxhash-wasm": "^1.0.1",
|
|
146
156
|
"yaml": "^2.8.1",
|
|
147
157
|
"yargs": "^17.7.2",
|
|
148
|
-
"
|
|
158
|
+
"zod": "^4.4.3",
|
|
159
|
+
"@cloudflare/cli-shared-helpers": "0.1.8",
|
|
149
160
|
"@cloudflare/codemod": "1.1.0",
|
|
161
|
+
"@cloudflare/config": "0.0.0",
|
|
162
|
+
"@cloudflare/deploy-helpers": "0.2.0",
|
|
150
163
|
"@cloudflare/containers-shared": "0.15.1",
|
|
151
|
-
"@cloudflare/
|
|
152
|
-
"@cloudflare/pages-shared": "^0.13.144",
|
|
153
|
-
"@cloudflare/workers-auth": "0.1.1",
|
|
164
|
+
"@cloudflare/pages-shared": "^0.13.146",
|
|
154
165
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
155
|
-
"@cloudflare/workers-
|
|
156
|
-
"@cloudflare/
|
|
157
|
-
"@cloudflare/workers-
|
|
166
|
+
"@cloudflare/workers-auth": "0.3.0",
|
|
167
|
+
"@cloudflare/workers-shared": "0.19.6",
|
|
168
|
+
"@cloudflare/workers-utils": "0.23.1",
|
|
169
|
+
"@cloudflare/workflows-shared": "0.11.1"
|
|
158
170
|
},
|
|
159
171
|
"peerDependencies": {
|
|
160
|
-
"@cloudflare/workers-types": "^4.
|
|
172
|
+
"@cloudflare/workers-types": "^4.20260616.1"
|
|
161
173
|
},
|
|
162
174
|
"peerDependenciesMeta": {
|
|
163
175
|
"@cloudflare/workers-types": {
|
|
@@ -178,7 +190,7 @@
|
|
|
178
190
|
},
|
|
179
191
|
"scripts": {
|
|
180
192
|
"assert-git-version": "node -r esbuild-register scripts/assert-git-version.ts",
|
|
181
|
-
"build": "pnpm run clean && pnpm tsup && pnpm run generate-json-schema",
|
|
193
|
+
"build": "pnpm run clean && pnpm tsup && pnpm tsdown && pnpm run generate-json-schema",
|
|
182
194
|
"check:type": "tsc -p ./tsconfig.json && tsc -p ./templates/tsconfig.json",
|
|
183
195
|
"clean": "node -r esbuild-register ../../tools/clean/clean.ts wrangler-dist miniflare-dist emitted-types",
|
|
184
196
|
"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\"",
|
|
@@ -414,10 +414,16 @@ export class InspectorProxyWorker implements DurableObject {
|
|
|
414
414
|
runtime
|
|
415
415
|
);
|
|
416
416
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
417
|
+
// Only enable the Network domain when DevTools is attached. Otherwise the
|
|
418
|
+
// runtime streams a Network.dataReceived per response body chunk into a
|
|
419
|
+
// buffer that is never drained without a client (headless `wrangler dev`),
|
|
420
|
+
// flooding the inspector until the dev server stops accepting connections.
|
|
421
|
+
if (this.websockets.devtools !== undefined) {
|
|
422
|
+
this.sendRuntimeMessage(
|
|
423
|
+
{ method: "Network.enable", id: this.nextCounter() },
|
|
424
|
+
runtime
|
|
425
|
+
);
|
|
426
|
+
}
|
|
421
427
|
|
|
422
428
|
clearInterval(this.runtimeKeepAliveInterval);
|
|
423
429
|
this.runtimeKeepAliveInterval = setInterval(() => {
|
|
@@ -563,12 +569,20 @@ export class InspectorProxyWorker implements DurableObject {
|
|
|
563
569
|
if (this.websockets.devtools === devtools) {
|
|
564
570
|
this.websockets.devtools = undefined;
|
|
565
571
|
|
|
566
|
-
// Notify the runtime to disable the
|
|
572
|
+
// Notify the runtime to disable the Debugger and Network domains when
|
|
573
|
+
// DevTools disconnects. Without disabling Network the runtime keeps
|
|
574
|
+
// streaming Network.dataReceived into runtimeMessageBuffer, which is no
|
|
575
|
+
// longer drained once devtools is undefined, reintroducing the same
|
|
576
|
+
// headless flood this proxy otherwise avoids.
|
|
567
577
|
if (this.websockets.runtime) {
|
|
568
578
|
this.sendRuntimeMessage({
|
|
569
579
|
id: this.nextCounter(),
|
|
570
580
|
method: "Debugger.disable",
|
|
571
581
|
});
|
|
582
|
+
this.sendRuntimeMessage({
|
|
583
|
+
id: this.nextCounter(),
|
|
584
|
+
method: "Network.disable",
|
|
585
|
+
});
|
|
572
586
|
}
|
|
573
587
|
}
|
|
574
588
|
};
|
|
@@ -297,10 +297,12 @@ var InspectorProxyWorker = class {
|
|
|
297
297
|
runtime
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
this.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
if (this.websockets.devtools !== void 0) {
|
|
301
|
+
this.sendRuntimeMessage(
|
|
302
|
+
{ method: "Network.enable", id: this.nextCounter() },
|
|
303
|
+
runtime
|
|
304
|
+
);
|
|
305
|
+
}
|
|
304
306
|
clearInterval(this.runtimeKeepAliveInterval);
|
|
305
307
|
this.runtimeKeepAliveInterval = setInterval(() => {
|
|
306
308
|
this.sendRuntimeMessage(
|
|
@@ -416,6 +418,10 @@ var InspectorProxyWorker = class {
|
|
|
416
418
|
id: this.nextCounter(),
|
|
417
419
|
method: "Debugger.disable"
|
|
418
420
|
});
|
|
421
|
+
this.sendRuntimeMessage({
|
|
422
|
+
id: this.nextCounter(),
|
|
423
|
+
method: "Network.disable"
|
|
424
|
+
});
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
427
|
};
|