wrangler 4.85.0 → 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 +7 -7
- package/package.json +11 -11
- package/templates/startDevWorker/ProxyWorker.ts +17 -1
- package/wrangler-dist/ProxyWorker.js +13 -1
- package/wrangler-dist/cli.d.ts +11 -6
- package/wrangler-dist/cli.js +38016 -36127
- 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": [
|
|
@@ -3129,13 +3129,13 @@
|
|
|
3129
3129
|
"additionalProperties": false,
|
|
3130
3130
|
"properties": {
|
|
3131
3131
|
"logpush": {
|
|
3132
|
-
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-
|
|
3132
|
+
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-475511758037888"
|
|
3133
3133
|
},
|
|
3134
3134
|
"observability": {
|
|
3135
|
-
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-
|
|
3135
|
+
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-475511758037888"
|
|
3136
3136
|
},
|
|
3137
3137
|
"limits": {
|
|
3138
|
-
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-
|
|
3138
|
+
"$ref": "#/definitions/interface-769040647-8080-17962-769040647-0-475511758037888"
|
|
3139
3139
|
},
|
|
3140
3140
|
"define": {
|
|
3141
3141
|
"type": "object",
|
|
@@ -4029,7 +4029,7 @@
|
|
|
4029
4029
|
},
|
|
4030
4030
|
"remote": {
|
|
4031
4031
|
"type": "boolean",
|
|
4032
|
-
"description": "
|
|
4032
|
+
"description": "Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote."
|
|
4033
4033
|
}
|
|
4034
4034
|
},
|
|
4035
4035
|
"required": [
|
|
@@ -4189,7 +4189,7 @@
|
|
|
4189
4189
|
},
|
|
4190
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`"
|
|
4191
4191
|
},
|
|
4192
|
-
"interface-769040647-8080-17962-769040647-0-
|
|
4192
|
+
"interface-769040647-8080-17962-769040647-0-475511758037888": {
|
|
4193
4193
|
"type": "object",
|
|
4194
4194
|
"properties": {
|
|
4195
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
59
|
"@cloudflare/unenv-preset": "2.16.1",
|
|
60
|
-
"miniflare": "4.
|
|
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-shared-helpers": "0.1.0",
|
|
147
148
|
"@cloudflare/codemod": "1.1.0",
|
|
148
149
|
"@cloudflare/containers-shared": "0.14.1",
|
|
149
|
-
"@cloudflare/pages-shared": "^0.13.
|
|
150
|
-
"@cloudflare/workers-shared": "0.19.
|
|
151
|
-
"@cloudflare/
|
|
152
|
-
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
150
|
+
"@cloudflare/pages-shared": "^0.13.129",
|
|
151
|
+
"@cloudflare/workers-shared": "0.19.3",
|
|
152
|
+
"@cloudflare/workers-utils": "0.18.0",
|
|
153
153
|
"@cloudflare/workflows-shared": "0.9.1",
|
|
154
|
-
"@cloudflare/workers-
|
|
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": {
|
|
@@ -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;
|
|
@@ -2079,7 +2083,7 @@ interface EnvironmentNonInheritable {
|
|
|
2079
2083
|
binding: string;
|
|
2080
2084
|
/** The Flagship app ID to bind to. */
|
|
2081
2085
|
app_id: string;
|
|
2082
|
-
/**
|
|
2086
|
+
/** Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote. */
|
|
2083
2087
|
remote?: boolean;
|
|
2084
2088
|
}[];
|
|
2085
2089
|
/**
|
|
@@ -2593,11 +2597,11 @@ type Optional<T, K extends keyof T> = Omit<T, K> & Pick<Partial<T>, K>;
|
|
|
2593
2597
|
type FrameworkInfo = {
|
|
2594
2598
|
id: string;
|
|
2595
2599
|
name: string;
|
|
2596
|
-
class: typeof Framework;
|
|
2597
2600
|
} & ({
|
|
2598
2601
|
supported: false;
|
|
2599
2602
|
} | {
|
|
2600
2603
|
supported: true;
|
|
2604
|
+
class: typeof Framework;
|
|
2601
2605
|
frameworkPackageInfo: AutoConfigFrameworkPackageInfo;
|
|
2602
2606
|
});
|
|
2603
2607
|
/**
|
|
@@ -2891,6 +2895,7 @@ declare function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObje
|
|
|
2891
2895
|
} | null, auth?: AsyncHook<CfAccount> | undefined): Promise<{
|
|
2892
2896
|
session: RemoteProxySession;
|
|
2893
2897
|
remoteBindings: Record<string, Binding>;
|
|
2898
|
+
auth?: AsyncHook<CfAccount> | undefined;
|
|
2894
2899
|
} | null>;
|
|
2895
2900
|
|
|
2896
2901
|
declare const LOGGER_LEVELS: {
|