wrangler 4.84.1 → 4.86.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/config-schema.json +13 -7
- package/package.json +14 -14
- package/templates/middleware/middleware-patch-console-prefix.ts +9 -9
- package/templates/startDevWorker/ProxyWorker.ts +17 -1
- package/wrangler-dist/ProxyWorker.js +13 -1
- package/wrangler-dist/cli.d.ts +13 -6
- package/wrangler-dist/cli.js +43124 -41163
- package/wrangler-dist/metafile-cjs.json +1 -1
package/config-schema.json
CHANGED
|
@@ -1218,7 +1218,7 @@
|
|
|
1218
1218
|
},
|
|
1219
1219
|
"remote": {
|
|
1220
1220
|
"type": "boolean",
|
|
1221
|
-
"description": "
|
|
1221
|
+
"description": "Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote."
|
|
1222
1222
|
}
|
|
1223
1223
|
},
|
|
1224
1224
|
"required": [
|
|
@@ -2665,7 +2665,7 @@
|
|
|
2665
2665
|
},
|
|
2666
2666
|
"remote": {
|
|
2667
2667
|
"type": "boolean",
|
|
2668
|
-
"description": "
|
|
2668
|
+
"description": "Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote."
|
|
2669
2669
|
}
|
|
2670
2670
|
},
|
|
2671
2671
|
"required": [
|
|
@@ -2888,6 +2888,12 @@
|
|
|
2888
2888
|
},
|
|
2889
2889
|
"custom_domain": {
|
|
2890
2890
|
"type": "boolean"
|
|
2891
|
+
},
|
|
2892
|
+
"enabled": {
|
|
2893
|
+
"type": "boolean"
|
|
2894
|
+
},
|
|
2895
|
+
"previews_enabled": {
|
|
2896
|
+
"type": "boolean"
|
|
2891
2897
|
}
|
|
2892
2898
|
},
|
|
2893
2899
|
"required": [
|
|
@@ -3123,13 +3129,13 @@
|
|
|
3123
3129
|
"additionalProperties": false,
|
|
3124
3130
|
"properties": {
|
|
3125
3131
|
"logpush": {
|
|
3126
|
-
"$ref": "#/definitions/interface-769040647-
|
|
3132
|
+
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-475511758037888"
|
|
3127
3133
|
},
|
|
3128
3134
|
"observability": {
|
|
3129
|
-
"$ref": "#/definitions/interface-769040647-
|
|
3135
|
+
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-475511758037888"
|
|
3130
3136
|
},
|
|
3131
3137
|
"limits": {
|
|
3132
|
-
"$ref": "#/definitions/interface-769040647-
|
|
3138
|
+
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-475511758037888"
|
|
3133
3139
|
},
|
|
3134
3140
|
"define": {
|
|
3135
3141
|
"type": "object",
|
|
@@ -4023,7 +4029,7 @@
|
|
|
4023
4029
|
},
|
|
4024
4030
|
"remote": {
|
|
4025
4031
|
"type": "boolean",
|
|
4026
|
-
"description": "
|
|
4032
|
+
"description": "Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote."
|
|
4027
4033
|
}
|
|
4028
4034
|
},
|
|
4029
4035
|
"required": [
|
|
@@ -4183,7 +4189,7 @@
|
|
|
4183
4189
|
},
|
|
4184
4190
|
"description": "Configuration for Worker Previews.\n\nThis defines the settings used when creating Preview deployments. Previews are branches of your Worker's main instance used to test features during feature development outside of production.\n\nThe `previews` block contains any intentionally divergent configuration intended solely for Previews, including:\n- All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)\n- Select inheritable properties: `logpush`, `observability`, `limits`"
|
|
4185
4191
|
},
|
|
4186
|
-
"interface-769040647-
|
|
4192
|
+
"interface-769040647-8080-17962-769040647-0-475511758037888": {
|
|
4187
4193
|
"type": "object",
|
|
4188
4194
|
"properties": {
|
|
4189
4195
|
"name": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.86.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assembly",
|
|
@@ -54,18 +54,18 @@
|
|
|
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.
|
|
57
|
+
"workerd": "1.20260426.1",
|
|
58
58
|
"@cloudflare/kv-asset-handler": "0.4.2",
|
|
59
|
-
"@cloudflare/unenv-preset": "2.16.
|
|
60
|
-
"miniflare": "4.
|
|
59
|
+
"@cloudflare/unenv-preset": "2.16.1",
|
|
60
|
+
"miniflare": "4.20260426.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.
|
|
66
|
+
"@cloudflare/workers-types": "^4.20260426.1",
|
|
67
67
|
"@cspotcode/source-map-support": "0.8.1",
|
|
68
|
-
"@netlify/build-info": "^10.
|
|
68
|
+
"@netlify/build-info": "^10.5.1",
|
|
69
69
|
"@sentry/node": "^7.86.0",
|
|
70
70
|
"@sentry/types": "^7.86.0",
|
|
71
71
|
"@sentry/utils": "^7.86.0",
|
|
@@ -144,17 +144,17 @@
|
|
|
144
144
|
"xxhash-wasm": "^1.0.1",
|
|
145
145
|
"yaml": "^2.8.1",
|
|
146
146
|
"yargs": "^17.7.2",
|
|
147
|
-
"@cloudflare/cli": "1.
|
|
147
|
+
"@cloudflare/cli-shared-helpers": "0.1.0",
|
|
148
148
|
"@cloudflare/codemod": "1.1.0",
|
|
149
|
-
"@cloudflare/
|
|
150
|
-
"@cloudflare/
|
|
151
|
-
"@cloudflare/workers-
|
|
152
|
-
"@cloudflare/
|
|
153
|
-
"@cloudflare/
|
|
154
|
-
"@cloudflare/workers-
|
|
149
|
+
"@cloudflare/containers-shared": "0.14.1",
|
|
150
|
+
"@cloudflare/pages-shared": "^0.13.129",
|
|
151
|
+
"@cloudflare/workers-shared": "0.19.3",
|
|
152
|
+
"@cloudflare/workers-utils": "0.18.0",
|
|
153
|
+
"@cloudflare/workflows-shared": "0.9.1",
|
|
154
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
155
155
|
},
|
|
156
156
|
"peerDependencies": {
|
|
157
|
-
"@cloudflare/workers-types": "^4.
|
|
157
|
+
"@cloudflare/workers-types": "^4.20260426.1"
|
|
158
158
|
},
|
|
159
159
|
"peerDependenciesMeta": {
|
|
160
160
|
"@cloudflare/workers-types": {
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import { prefix } from "config:middleware/patch-console-prefix";
|
|
4
4
|
import type { Middleware } from "./common";
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
// Directly patch console methods to add worker prefix.
|
|
7
|
+
// We capture the original method once and replace with a wrapper.
|
|
8
|
+
// This approach allows third-party code to wrap console methods
|
|
9
|
+
(["log", "debug", "info"] as const).forEach((method) => {
|
|
10
|
+
globalThis.console[method] = new Proxy(globalThis.console[method], {
|
|
11
|
+
apply(target, thisArg, argumentsList) {
|
|
12
|
+
return target.apply(thisArg, [prefix, ...argumentsList]);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
const passthrough: Middleware = (request, env, _ctx, middlewareCtx) => {
|
|
@@ -23,6 +23,7 @@ type Request = Parameters<
|
|
|
23
23
|
>[0];
|
|
24
24
|
|
|
25
25
|
const LIVE_RELOAD_PROTOCOL = "WRANGLER_PROXYWORKER_LIVE_RELOAD_PROTOCOL";
|
|
26
|
+
const LIVE_RELOAD_PATHNAME = "/cdn-cgi/live-reload";
|
|
26
27
|
export default {
|
|
27
28
|
fetch(req, env) {
|
|
28
29
|
const singleton = env.DURABLE_OBJECT.idFromName("");
|
|
@@ -161,6 +162,12 @@ export class ProxyWorker implements DurableObject {
|
|
|
161
162
|
res = insertLiveReloadScript(request, res, this.env, proxyData);
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
if (isSseResponse(res)) {
|
|
166
|
+
void sendMessageToProxyController(this.env, {
|
|
167
|
+
type: "sseResponseDetected",
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
164
171
|
deferredResponse.resolve(res);
|
|
165
172
|
})
|
|
166
173
|
.catch((error: Error) => {
|
|
@@ -227,7 +234,16 @@ function isRequestFromProxyController(req: Request, env: Env): boolean {
|
|
|
227
234
|
function isHtmlResponse(res: Response): boolean {
|
|
228
235
|
return res.headers.get("content-type")?.startsWith("text/html") ?? false;
|
|
229
236
|
}
|
|
237
|
+
function isSseResponse(res: Response): boolean {
|
|
238
|
+
return (
|
|
239
|
+
res.headers.get("content-type")?.startsWith("text/event-stream") ?? false
|
|
240
|
+
);
|
|
241
|
+
}
|
|
230
242
|
function isRequestForLiveReloadWebsocket(req: Request): boolean {
|
|
243
|
+
if (new URL(req.url).pathname !== LIVE_RELOAD_PATHNAME) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
|
|
231
247
|
const websocketProtocol = req.headers.get("Sec-WebSocket-Protocol");
|
|
232
248
|
const isWebSocketUpgrade = req.headers.get("Upgrade") === "websocket";
|
|
233
249
|
|
|
@@ -309,7 +325,7 @@ const liveReloadScript = `
|
|
|
309
325
|
function initLiveReload() {
|
|
310
326
|
if (ws) return;
|
|
311
327
|
var origin = (location.protocol === "http:" ? "ws://" : "wss://") + location.host;
|
|
312
|
-
ws = new WebSocket(origin + "
|
|
328
|
+
ws = new WebSocket(origin + "${LIVE_RELOAD_PATHNAME}", "${LIVE_RELOAD_PROTOCOL}");
|
|
313
329
|
ws.onclose = recover;
|
|
314
330
|
ws.onerror = recover;
|
|
315
331
|
ws.onmessage = location.reload.bind(location);
|
|
@@ -24,6 +24,7 @@ function urlFromParts(parts, base = "http://localhost") {
|
|
|
24
24
|
|
|
25
25
|
// templates/startDevWorker/ProxyWorker.ts
|
|
26
26
|
var LIVE_RELOAD_PROTOCOL = "WRANGLER_PROXYWORKER_LIVE_RELOAD_PROTOCOL";
|
|
27
|
+
var LIVE_RELOAD_PATHNAME = "/cdn-cgi/live-reload";
|
|
27
28
|
var ProxyWorker_default = {
|
|
28
29
|
fetch(req, env) {
|
|
29
30
|
const singleton = env.DURABLE_OBJECT.idFromName("");
|
|
@@ -118,6 +119,11 @@ var ProxyWorker = class {
|
|
|
118
119
|
if (isHtmlResponse(res)) {
|
|
119
120
|
res = insertLiveReloadScript(request, res, this.env, proxyData);
|
|
120
121
|
}
|
|
122
|
+
if (isSseResponse(res)) {
|
|
123
|
+
void sendMessageToProxyController(this.env, {
|
|
124
|
+
type: "sseResponseDetected"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
121
127
|
deferredResponse.resolve(res);
|
|
122
128
|
}).catch((error) => {
|
|
123
129
|
const newUserWorkerUrl = this.proxyData && urlFromParts(this.proxyData.userWorkerUrl);
|
|
@@ -155,7 +161,13 @@ function isRequestFromProxyController(req, env) {
|
|
|
155
161
|
function isHtmlResponse(res) {
|
|
156
162
|
return res.headers.get("content-type")?.startsWith("text/html") ?? false;
|
|
157
163
|
}
|
|
164
|
+
function isSseResponse(res) {
|
|
165
|
+
return res.headers.get("content-type")?.startsWith("text/event-stream") ?? false;
|
|
166
|
+
}
|
|
158
167
|
function isRequestForLiveReloadWebsocket(req) {
|
|
168
|
+
if (new URL(req.url).pathname !== LIVE_RELOAD_PATHNAME) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
159
171
|
const websocketProtocol = req.headers.get("Sec-WebSocket-Protocol");
|
|
160
172
|
const isWebSocketUpgrade = req.headers.get("Upgrade") === "websocket";
|
|
161
173
|
return isWebSocketUpgrade && websocketProtocol === LIVE_RELOAD_PROTOCOL;
|
|
@@ -203,7 +215,7 @@ var liveReloadScript = `
|
|
|
203
215
|
function initLiveReload() {
|
|
204
216
|
if (ws) return;
|
|
205
217
|
var origin = (location.protocol === "http:" ? "ws://" : "wss://") + location.host;
|
|
206
|
-
ws = new WebSocket(origin + "
|
|
218
|
+
ws = new WebSocket(origin + "${LIVE_RELOAD_PATHNAME}", "${LIVE_RELOAD_PROTOCOL}");
|
|
207
219
|
ws.onclose = recover;
|
|
208
220
|
ws.onerror = recover;
|
|
209
221
|
ws.onmessage = location.reload.bind(location);
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -383,6 +383,8 @@ type ProxyWorkerIncomingRequestBody = {
|
|
|
383
383
|
type ProxyWorkerOutgoingRequestBody = {
|
|
384
384
|
type: "error";
|
|
385
385
|
error: SerializedError;
|
|
386
|
+
} | {
|
|
387
|
+
type: "sseResponseDetected";
|
|
386
388
|
} | {
|
|
387
389
|
type: "previewTokenExpired";
|
|
388
390
|
proxyData: ProxyData;
|
|
@@ -681,6 +683,8 @@ interface StartDevWorkerInput {
|
|
|
681
683
|
containerEngine?: ContainerEngine$1;
|
|
682
684
|
/** Re-generate your worker types when your Wrangler configuration file changes */
|
|
683
685
|
generateTypes?: boolean;
|
|
686
|
+
/** Whether a Cloudflare Quick Tunnel is active for this dev session */
|
|
687
|
+
tunnel?: boolean;
|
|
684
688
|
};
|
|
685
689
|
legacy?: {
|
|
686
690
|
site?: Hook<Config$1["site"], [Config$1]>;
|
|
@@ -778,7 +782,7 @@ declare function getDurableObjectClassNameToUseSQLiteMap(migrations: Config$1["m
|
|
|
778
782
|
*/
|
|
779
783
|
declare class CacheStorage {
|
|
780
784
|
constructor();
|
|
781
|
-
open(
|
|
785
|
+
open(_cacheName: string): Promise<Cache>;
|
|
782
786
|
get default(): Cache;
|
|
783
787
|
}
|
|
784
788
|
type CacheRequest = any;
|
|
@@ -787,9 +791,9 @@ type CacheResponse = any;
|
|
|
787
791
|
* No-op implementation of Cache
|
|
788
792
|
*/
|
|
789
793
|
declare class Cache {
|
|
790
|
-
delete(
|
|
791
|
-
match(
|
|
792
|
-
put(
|
|
794
|
+
delete(_request: CacheRequest, _options?: CacheQueryOptions): Promise<boolean>;
|
|
795
|
+
match(_request: CacheRequest, _options?: CacheQueryOptions): Promise<CacheResponse | undefined>;
|
|
796
|
+
put(_request: CacheRequest, _response: CacheResponse): Promise<void>;
|
|
793
797
|
}
|
|
794
798
|
type CacheQueryOptions = {
|
|
795
799
|
ignoreMethod?: boolean;
|
|
@@ -827,6 +831,8 @@ type ZoneNameRoute = {
|
|
|
827
831
|
type CustomDomainRoute = {
|
|
828
832
|
pattern: string;
|
|
829
833
|
custom_domain: boolean;
|
|
834
|
+
enabled?: boolean;
|
|
835
|
+
previews_enabled?: boolean;
|
|
830
836
|
};
|
|
831
837
|
type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
832
838
|
/**
|
|
@@ -2077,7 +2083,7 @@ interface EnvironmentNonInheritable {
|
|
|
2077
2083
|
binding: string;
|
|
2078
2084
|
/** The Flagship app ID to bind to. */
|
|
2079
2085
|
app_id: string;
|
|
2080
|
-
/**
|
|
2086
|
+
/** Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote. */
|
|
2081
2087
|
remote?: boolean;
|
|
2082
2088
|
}[];
|
|
2083
2089
|
/**
|
|
@@ -2591,11 +2597,11 @@ type Optional<T, K extends keyof T> = Omit<T, K> & Pick<Partial<T>, K>;
|
|
|
2591
2597
|
type FrameworkInfo = {
|
|
2592
2598
|
id: string;
|
|
2593
2599
|
name: string;
|
|
2594
|
-
class: typeof Framework;
|
|
2595
2600
|
} & ({
|
|
2596
2601
|
supported: false;
|
|
2597
2602
|
} | {
|
|
2598
2603
|
supported: true;
|
|
2604
|
+
class: typeof Framework;
|
|
2599
2605
|
frameworkPackageInfo: AutoConfigFrameworkPackageInfo;
|
|
2600
2606
|
});
|
|
2601
2607
|
/**
|
|
@@ -2889,6 +2895,7 @@ declare function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObje
|
|
|
2889
2895
|
} | null, auth?: AsyncHook<CfAccount> | undefined): Promise<{
|
|
2890
2896
|
session: RemoteProxySession;
|
|
2891
2897
|
remoteBindings: Record<string, Binding>;
|
|
2898
|
+
auth?: AsyncHook<CfAccount> | undefined;
|
|
2892
2899
|
} | null>;
|
|
2893
2900
|
|
|
2894
2901
|
declare const LOGGER_LEVELS: {
|