wrangler 0.0.0-e8a2a1d9 → 0.0.0-e8aaa3930
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/README.md +26 -38
- package/bin/wrangler.js +0 -28
- package/config-schema.json +3297 -0
- package/package.json +69 -103
- package/templates/checked-fetch.js +1 -1
- package/templates/facade.d.ts +7 -5
- package/templates/gitignore +2 -4
- package/templates/init-tests/test-vitest-new-worker.js +1 -1
- package/templates/init-tests/test-vitest-new-worker.ts +3 -3
- package/templates/middleware/loader-modules.ts +92 -95
- package/templates/middleware/loader-sw.ts +4 -3
- package/templates/middleware/middleware-ensure-req-body-drained.ts +18 -0
- package/templates/middleware/middleware-miniflare3-json-error.ts +0 -1
- package/templates/middleware/middleware-mock-analytics-engine.d.ts +3 -0
- package/templates/middleware/middleware-mock-analytics-engine.ts +30 -0
- package/templates/middleware/middleware-patch-console-prefix.d.ts +3 -0
- package/templates/middleware/middleware-patch-console-prefix.ts +21 -0
- package/templates/middleware/middleware-scheduled.ts +15 -1
- package/templates/middleware/middleware-serve-static-assets.ts +7 -7
- package/templates/pages-dev-pipeline.ts +2 -1
- package/templates/pages-template-plugin.ts +2 -2
- package/templates/pages-template-worker.ts +1 -1
- package/templates/startDevWorker/InspectorProxyWorker.ts +17 -5
- package/templates/startDevWorker/ProxyWorker.ts +148 -64
- package/templates/tsconfig.init.json +4 -87
- package/wrangler-dist/InspectorProxyWorker.js +4 -0
- package/wrangler-dist/InspectorProxyWorker.js.map +1 -1
- package/wrangler-dist/ProxyWorker.js +103 -48
- package/wrangler-dist/ProxyWorker.js.map +1 -1
- package/wrangler-dist/cli.d.ts +3983 -787
- package/wrangler-dist/cli.js +151565 -142032
- package/Cloudflare_CA.pem +0 -18
- package/templates/middleware/middleware-d1-beta.d.ts +0 -3
- package/templates/middleware/middleware-multiworker-dev.d.ts +0 -4
- package/templates/middleware/middleware-multiworker-dev.ts +0 -68
- package/wrangler-dist/wasm-sync.wasm +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/// <reference path="middleware-serve-static-assets.d.ts"/>
|
|
2
2
|
|
|
3
|
+
import manifest from "__STATIC_CONTENT_MANIFEST";
|
|
3
4
|
import {
|
|
4
5
|
getAssetFromKV,
|
|
5
|
-
NotFoundError,
|
|
6
6
|
MethodNotAllowedError,
|
|
7
|
+
NotFoundError,
|
|
7
8
|
serveSinglePageApp,
|
|
8
9
|
} from "@cloudflare/kv-asset-handler";
|
|
10
|
+
import { cacheControl, spaMode } from "config:middleware/serve-static-assets";
|
|
11
|
+
import type { Middleware } from "./common";
|
|
9
12
|
import type { Options } from "@cloudflare/kv-asset-handler";
|
|
10
|
-
import { spaMode, cacheControl } from "config:middleware/serve-static-assets";
|
|
11
13
|
import type * as kvAssetHandler from "@cloudflare/kv-asset-handler";
|
|
12
|
-
import manifest from "__STATIC_CONTENT_MANIFEST";
|
|
13
|
-
const ASSET_MANIFEST = JSON.parse(manifest);
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const ASSET_MANIFEST = JSON.parse(manifest);
|
|
16
16
|
|
|
17
|
-
const staticAssets: Middleware = async (request, env,
|
|
17
|
+
const staticAssets: Middleware = async (request, env, ctx, middlewareCtx) => {
|
|
18
18
|
let options: Partial<Options> = {
|
|
19
19
|
ASSET_MANIFEST,
|
|
20
20
|
ASSET_NAMESPACE: env.__STATIC_CONTENT,
|
|
@@ -27,7 +27,7 @@ const staticAssets: Middleware = async (request, env, _ctx, middlewareCtx) => {
|
|
|
27
27
|
{
|
|
28
28
|
request,
|
|
29
29
|
waitUntil(promise) {
|
|
30
|
-
return
|
|
30
|
+
return ctx.waitUntil(promise);
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
options
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @ts-ignore entry point will get replaced
|
|
2
2
|
import worker from "__ENTRY_POINT__";
|
|
3
|
+
import { isRoutingRuleMatch } from "./pages-dev-util";
|
|
4
|
+
|
|
3
5
|
// @ts-ignore entry point will get replaced
|
|
4
6
|
export * from "__ENTRY_POINT__";
|
|
5
|
-
import { isRoutingRuleMatch } from "./pages-dev-util";
|
|
6
7
|
|
|
7
8
|
// @ts-ignore routes are injected
|
|
8
9
|
const routes = __ROUTES__;
|
|
@@ -41,14 +41,14 @@ type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
|
41
41
|
declare type PagesFunction<
|
|
42
42
|
Env = unknown,
|
|
43
43
|
P extends string = string,
|
|
44
|
-
Data extends Record<string, unknown> = Record<string, unknown
|
|
44
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
45
45
|
> = (context: EventContext<Env, P, Data>) => Response | Promise<Response>;
|
|
46
46
|
|
|
47
47
|
declare type PagesPluginFunction<
|
|
48
48
|
Env = unknown,
|
|
49
49
|
P extends string = string,
|
|
50
50
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
51
|
-
PluginArgs = unknown
|
|
51
|
+
PluginArgs = unknown,
|
|
52
52
|
> = (
|
|
53
53
|
context: EventPluginContext<Env, P, Data, PluginArgs>
|
|
54
54
|
) => Response | Promise<Response>;
|
|
@@ -29,7 +29,7 @@ type EventContext<Env, P extends string, Data> = {
|
|
|
29
29
|
declare type PagesFunction<
|
|
30
30
|
Env = unknown,
|
|
31
31
|
P extends string = string,
|
|
32
|
-
Data extends Record<string, unknown> = Record<string, unknown
|
|
32
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
33
33
|
> = (context: EventContext<Env, P, Data>) => Response | Promise<Response>;
|
|
34
34
|
/* end @cloudflare/workers-types */
|
|
35
35
|
|
|
@@ -5,10 +5,6 @@ import {
|
|
|
5
5
|
DevToolsCommandResponses,
|
|
6
6
|
DevToolsEvent,
|
|
7
7
|
DevToolsEvents,
|
|
8
|
-
type InspectorProxyWorkerIncomingWebSocketMessage,
|
|
9
|
-
type InspectorProxyWorkerOutgoingRequestBody,
|
|
10
|
-
type InspectorProxyWorkerOutgoingWebsocketMessage,
|
|
11
|
-
type ProxyData,
|
|
12
8
|
serialiseError,
|
|
13
9
|
} from "../../src/api/startDevWorker/events";
|
|
14
10
|
import {
|
|
@@ -18,6 +14,12 @@ import {
|
|
|
18
14
|
MaybePromise,
|
|
19
15
|
urlFromParts,
|
|
20
16
|
} from "../../src/api/startDevWorker/utils";
|
|
17
|
+
import type {
|
|
18
|
+
InspectorProxyWorkerIncomingWebSocketMessage,
|
|
19
|
+
InspectorProxyWorkerOutgoingRequestBody,
|
|
20
|
+
InspectorProxyWorkerOutgoingWebsocketMessage,
|
|
21
|
+
ProxyData,
|
|
22
|
+
} from "../../src/api/startDevWorker/events";
|
|
21
23
|
|
|
22
24
|
const ALLOWED_HOST_HOSTNAMES = ["127.0.0.1", "[::1]", "localhost"];
|
|
23
25
|
const ALLOWED_ORIGIN_HOSTNAMES = [
|
|
@@ -58,7 +60,10 @@ function isDevToolsEvent<Method extends DevToolsEvents["method"]>(
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
export class InspectorProxyWorker implements DurableObject {
|
|
61
|
-
constructor(
|
|
63
|
+
constructor(
|
|
64
|
+
_state: DurableObjectState,
|
|
65
|
+
readonly env: Env
|
|
66
|
+
) {}
|
|
62
67
|
|
|
63
68
|
websockets: {
|
|
64
69
|
proxyController?: WebSocket;
|
|
@@ -291,6 +296,13 @@ export class InspectorProxyWorker implements DurableObject {
|
|
|
291
296
|
|
|
292
297
|
this.sendDebugLog("NEW RUNTIME WEBSOCKET", runtimeWebSocketUrl);
|
|
293
298
|
|
|
299
|
+
// Make sure DevTools re-fetches script contents,
|
|
300
|
+
// and uses the newly created execution context
|
|
301
|
+
this.sendDevToolsMessage({
|
|
302
|
+
method: "Runtime.executionContextsCleared",
|
|
303
|
+
params: undefined,
|
|
304
|
+
});
|
|
305
|
+
|
|
294
306
|
const upgrade = await fetch(runtimeWebSocketUrl, {
|
|
295
307
|
headers: {
|
|
296
308
|
...this.proxyData.headers,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
createDeferred,
|
|
3
|
+
DeferredPromise,
|
|
4
|
+
urlFromParts,
|
|
5
|
+
} from "../../src/api/startDevWorker/utils";
|
|
2
6
|
import type {
|
|
7
|
+
ProxyData,
|
|
3
8
|
ProxyWorkerIncomingRequestBody,
|
|
4
9
|
ProxyWorkerOutgoingRequestBody,
|
|
5
|
-
ProxyData,
|
|
6
10
|
} from "../../src/api/startDevWorker/events";
|
|
7
|
-
import {
|
|
8
|
-
DeferredPromise,
|
|
9
|
-
createDeferred,
|
|
10
|
-
} from "../../src/api/startDevWorker/utils";
|
|
11
11
|
|
|
12
12
|
interface Env {
|
|
13
13
|
PROXY_CONTROLLER: Fetcher;
|
|
@@ -33,10 +33,14 @@ export default {
|
|
|
33
33
|
} as ExportedHandler<Env, unknown, ProxyWorkerIncomingRequestBody>;
|
|
34
34
|
|
|
35
35
|
export class ProxyWorker implements DurableObject {
|
|
36
|
-
constructor(
|
|
36
|
+
constructor(
|
|
37
|
+
readonly state: DurableObjectState,
|
|
38
|
+
readonly env: Env
|
|
39
|
+
) {}
|
|
37
40
|
|
|
38
41
|
proxyData?: ProxyData;
|
|
39
42
|
requestQueue = new Map<Request, DeferredPromise<Response>>();
|
|
43
|
+
requestRetryQueue = new Map<Request, DeferredPromise<Response>>();
|
|
40
44
|
|
|
41
45
|
fetch(request: Request) {
|
|
42
46
|
if (isRequestForLiveReloadWebsocket(request)) {
|
|
@@ -94,27 +98,50 @@ export class ProxyWorker implements DurableObject {
|
|
|
94
98
|
return new Response(null, { status: 204 });
|
|
95
99
|
}
|
|
96
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Process requests that are being retried first, then process newer requests.
|
|
103
|
+
* Requests that are being retried are, by definition, older than requests which haven't been processed yet.
|
|
104
|
+
* We don't need to be more accurate than this re ordering, since the requests are being fired off synchronously.
|
|
105
|
+
*/
|
|
106
|
+
*getOrderedQueue() {
|
|
107
|
+
yield* this.requestRetryQueue;
|
|
108
|
+
yield* this.requestQueue;
|
|
109
|
+
}
|
|
110
|
+
|
|
97
111
|
processQueue() {
|
|
98
|
-
const { proxyData } = this; //
|
|
112
|
+
const { proxyData } = this; // store proxyData at the moment this function was called
|
|
99
113
|
if (proxyData === undefined) return;
|
|
100
114
|
|
|
101
|
-
for (const [request, deferredResponse] of this.
|
|
115
|
+
for (const [request, deferredResponse] of this.getOrderedQueue()) {
|
|
116
|
+
this.requestRetryQueue.delete(request);
|
|
102
117
|
this.requestQueue.delete(request);
|
|
103
118
|
|
|
104
|
-
const
|
|
119
|
+
const outerUrl = new URL(request.url);
|
|
105
120
|
const headers = new Headers(request.headers);
|
|
106
121
|
|
|
107
122
|
// override url parts for proxying
|
|
123
|
+
const userWorkerUrl = new URL(request.url);
|
|
108
124
|
Object.assign(userWorkerUrl, proxyData.userWorkerUrl);
|
|
109
125
|
|
|
110
126
|
// set request.url in the UserWorker
|
|
111
|
-
const innerUrl =
|
|
112
|
-
|
|
127
|
+
const innerUrl = urlFromParts(
|
|
128
|
+
proxyData.userWorkerInnerUrlOverrides ?? {},
|
|
129
|
+
request.url
|
|
130
|
+
);
|
|
113
131
|
headers.set("MF-Original-URL", innerUrl.href);
|
|
114
132
|
headers.set("MF-Disable-Pretty-Error", "true"); // disables the UserWorker miniflare instance from rendering the pretty error -- instead the ProxyWorker miniflare instance will intercept the json error response and render the pretty error page
|
|
115
133
|
|
|
134
|
+
// Preserve client `Accept-Encoding`, rather than using Worker's default
|
|
135
|
+
// of `Accept-Encoding: br, gzip`
|
|
136
|
+
const encoding = request.cf?.clientAcceptEncoding;
|
|
137
|
+
if (encoding !== undefined) headers.set("Accept-Encoding", encoding);
|
|
138
|
+
|
|
139
|
+
rewriteUrlRelatedHeaders(headers, outerUrl, innerUrl);
|
|
140
|
+
|
|
116
141
|
// merge proxyData headers with the request headers
|
|
117
142
|
for (const [key, value] of Object.entries(proxyData.headers ?? {})) {
|
|
143
|
+
if (value === undefined) continue;
|
|
144
|
+
|
|
118
145
|
if (key.toLowerCase() === "cookie") {
|
|
119
146
|
const existing = request.headers.get("cookie") ?? "";
|
|
120
147
|
headers.set("cookie", `${existing};${value}`);
|
|
@@ -123,10 +150,12 @@ export class ProxyWorker implements DurableObject {
|
|
|
123
150
|
}
|
|
124
151
|
}
|
|
125
152
|
|
|
126
|
-
// explicitly NOT await-ing this promise, we are in a loop and want to process the whole queue quickly
|
|
127
|
-
// if we decide to await, we should include a timeout (~100ms) in case the user worker has long-running/parellel requests
|
|
153
|
+
// explicitly NOT await-ing this promise, we are in a loop and want to process the whole queue quickly + synchronously
|
|
128
154
|
void fetch(userWorkerUrl, new Request(request, { headers }))
|
|
129
155
|
.then((res) => {
|
|
156
|
+
res = new Response(res.body, res);
|
|
157
|
+
rewriteUrlRelatedHeaders(res.headers, innerUrl, outerUrl);
|
|
158
|
+
|
|
130
159
|
if (isHtmlResponse(res)) {
|
|
131
160
|
res = insertLiveReloadScript(request, res, this.env, proxyData);
|
|
132
161
|
}
|
|
@@ -137,17 +166,55 @@ export class ProxyWorker implements DurableObject {
|
|
|
137
166
|
// errors here are network errors or from response post-processing
|
|
138
167
|
// to catch only network errors, use the 2nd param of the fetch.then()
|
|
139
168
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
169
|
+
// we have crossed an async boundary, so proxyData may have changed
|
|
170
|
+
// if proxyData.userWorkerUrl has changed, it means there is a new downstream UserWorker
|
|
171
|
+
// and that this error is stale since it was for a request to the old UserWorker
|
|
172
|
+
// so here we construct a newUserWorkerUrl so we can compare it to the (old) userWorkerUrl
|
|
173
|
+
const newUserWorkerUrl =
|
|
174
|
+
this.proxyData && urlFromParts(this.proxyData.userWorkerUrl);
|
|
175
|
+
|
|
176
|
+
// only report errors if the downstream proxy has NOT changed
|
|
177
|
+
if (userWorkerUrl.href === newUserWorkerUrl?.href) {
|
|
178
|
+
void sendMessageToProxyController(this.env, {
|
|
179
|
+
type: "error",
|
|
180
|
+
error: {
|
|
181
|
+
name: error.name,
|
|
182
|
+
message: error.message,
|
|
183
|
+
stack: error.stack,
|
|
184
|
+
cause: error.cause,
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
deferredResponse.reject(error);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// if the request can be retried (subset of idempotent requests which have no body), requeue it
|
|
192
|
+
else if (request.method === "GET" || request.method === "HEAD") {
|
|
193
|
+
this.requestRetryQueue.set(request, deferredResponse);
|
|
194
|
+
// we would only end up here if the downstream UserWorker is chang*ing*
|
|
195
|
+
// i.e. we are in a `pause`d state and expecting a `play` message soon
|
|
196
|
+
// this request will be processed (retried) when the `play` message arrives
|
|
197
|
+
// for that reason, we do not need to call `this.processQueue` here
|
|
198
|
+
// (but, also, it can't hurt to call it since it bails when
|
|
199
|
+
// in a `pause`d state i.e. `this.proxyData` is undefined)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// if the request cannot be retried, respond with 503 Service Unavailable
|
|
203
|
+
// important to note, this is not an (unexpected) error -- it is an acceptable flow of local development
|
|
204
|
+
// it would be incorrect to retry non-idempotent requests
|
|
205
|
+
// and would require cloning all body streams to avoid stream reuse (which is inefficient but not out of the question in the future)
|
|
206
|
+
// this is a good enough UX for now since it solves the most common GET use-case
|
|
207
|
+
else {
|
|
208
|
+
deferredResponse.resolve(
|
|
209
|
+
new Response(
|
|
210
|
+
"Your worker restarted mid-request. Please try sending the request again. Only GET or HEAD requests are retried automatically.",
|
|
211
|
+
{
|
|
212
|
+
status: 503,
|
|
213
|
+
headers: { "Retry-After": "0" },
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
);
|
|
217
|
+
}
|
|
151
218
|
});
|
|
152
219
|
}
|
|
153
220
|
}
|
|
@@ -166,25 +233,14 @@ function isRequestForLiveReloadWebsocket(req: Request): boolean {
|
|
|
166
233
|
return isWebSocketUpgrade && websocketProtocol === LIVE_RELOAD_PROTOCOL;
|
|
167
234
|
}
|
|
168
235
|
|
|
169
|
-
|
|
236
|
+
function sendMessageToProxyController(
|
|
170
237
|
env: Env,
|
|
171
|
-
message: ProxyWorkerOutgoingRequestBody
|
|
172
|
-
retries = 3
|
|
238
|
+
message: ProxyWorkerOutgoingRequestBody
|
|
173
239
|
) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
179
|
-
} catch (cause) {
|
|
180
|
-
if (retries > 0) {
|
|
181
|
-
return sendMessageToProxyController(env, message, retries - 1);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// no point sending an error message if we can't send this message
|
|
185
|
-
|
|
186
|
-
throw cause;
|
|
187
|
-
}
|
|
240
|
+
return env.PROXY_CONTROLLER.fetch("http://dummy", {
|
|
241
|
+
method: "POST",
|
|
242
|
+
body: JSON.stringify(message),
|
|
243
|
+
});
|
|
188
244
|
}
|
|
189
245
|
|
|
190
246
|
function insertLiveReloadScript(
|
|
@@ -222,31 +278,59 @@ function insertLiveReloadScript(
|
|
|
222
278
|
websocketUrl.protocol =
|
|
223
279
|
websocketUrl.protocol === "http:" ? "ws:" : "wss:";
|
|
224
280
|
|
|
225
|
-
end.append(
|
|
226
|
-
`
|
|
227
|
-
<script>
|
|
228
|
-
(function() {
|
|
229
|
-
var ws;
|
|
230
|
-
function recover() {
|
|
231
|
-
ws = null;
|
|
232
|
-
setTimeout(initLiveReload, 100);
|
|
233
|
-
}
|
|
234
|
-
function initLiveReload() {
|
|
235
|
-
if (ws) return;
|
|
236
|
-
var origin = (location.protocol === "http:" ? "ws://" : "wss://") + location.host;
|
|
237
|
-
ws = new WebSocket(origin + "/cdn-cgi/live-reload", "${LIVE_RELOAD_PROTOCOL}");
|
|
238
|
-
ws.onclose = recover;
|
|
239
|
-
ws.onerror = recover;
|
|
240
|
-
ws.onmessage = location.reload.bind(location);
|
|
241
|
-
}
|
|
242
|
-
})();
|
|
243
|
-
</script>
|
|
244
|
-
`,
|
|
245
|
-
{ html: true }
|
|
246
|
-
);
|
|
281
|
+
end.append(liveReloadScript, { html: true });
|
|
247
282
|
}
|
|
248
283
|
},
|
|
249
284
|
});
|
|
250
285
|
|
|
251
286
|
return htmlRewriter.transform(response);
|
|
252
287
|
}
|
|
288
|
+
|
|
289
|
+
const liveReloadScript = `
|
|
290
|
+
<script defer type="application/javascript">
|
|
291
|
+
(function() {
|
|
292
|
+
var ws;
|
|
293
|
+
function recover() {
|
|
294
|
+
ws = null;
|
|
295
|
+
setTimeout(initLiveReload, 100);
|
|
296
|
+
}
|
|
297
|
+
function initLiveReload() {
|
|
298
|
+
if (ws) return;
|
|
299
|
+
var origin = (location.protocol === "http:" ? "ws://" : "wss://") + location.host;
|
|
300
|
+
ws = new WebSocket(origin + "/cdn-cgi/live-reload", "${LIVE_RELOAD_PROTOCOL}");
|
|
301
|
+
ws.onclose = recover;
|
|
302
|
+
ws.onerror = recover;
|
|
303
|
+
ws.onmessage = location.reload.bind(location);
|
|
304
|
+
}
|
|
305
|
+
initLiveReload();
|
|
306
|
+
})();
|
|
307
|
+
</script>
|
|
308
|
+
`;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Rewrite references to URLs in request/response headers.
|
|
312
|
+
*
|
|
313
|
+
* This function is used to map the URLs in headers like Origin and Access-Control-Allow-Origin
|
|
314
|
+
* so that this proxy is transparent to the Client Browser and User Worker.
|
|
315
|
+
*/
|
|
316
|
+
function rewriteUrlRelatedHeaders(headers: Headers, from: URL, to: URL) {
|
|
317
|
+
const setCookie = headers.getAll("Set-Cookie");
|
|
318
|
+
headers.delete("Set-Cookie");
|
|
319
|
+
headers.forEach((value, key) => {
|
|
320
|
+
if (typeof value === "string" && value.includes(from.host)) {
|
|
321
|
+
headers.set(
|
|
322
|
+
key,
|
|
323
|
+
value.replaceAll(from.origin, to.origin).replaceAll(from.host, to.host)
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
for (const cookie of setCookie) {
|
|
328
|
+
headers.append(
|
|
329
|
+
"Set-Cookie",
|
|
330
|
+
cookie.replace(
|
|
331
|
+
new RegExp(`Domain=${from.hostname}($|;|,)`),
|
|
332
|
+
`Domain=${to.hostname}$1`
|
|
333
|
+
)
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -1,105 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
3
|
"target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
4
|
"lib": [
|
|
16
5
|
"es2021"
|
|
17
6
|
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
|
|
18
|
-
"jsx": "react" /* Specify what JSX code is generated. */,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
22
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
23
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
24
|
-
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
25
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
26
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
27
|
-
|
|
28
|
-
/* Modules */
|
|
29
|
-
"module": "es2022" /* Specify what module code is generated. */,
|
|
30
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
31
|
-
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
32
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
33
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
34
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
35
|
-
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
7
|
+
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
|
8
|
+
"module": "ESNext" /* Specify what module code is generated. */,
|
|
9
|
+
"moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
36
10
|
"types": [
|
|
37
11
|
"@cloudflare/workers-types"
|
|
38
12
|
] /* Specify type package names to be included without being referenced in a source file. */,
|
|
39
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
40
13
|
"resolveJsonModule": true /* Enable importing .json files */,
|
|
41
|
-
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
42
|
-
|
|
43
|
-
/* JavaScript Support */
|
|
44
14
|
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
|
|
45
|
-
"checkJs": false /* Enable error reporting in type-checked JavaScript files. */,
|
|
46
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
47
|
-
|
|
48
|
-
/* Emit */
|
|
49
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
50
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
51
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
52
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
53
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
54
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
55
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
56
15
|
"noEmit": true /* Disable emitting files from a compilation. */,
|
|
57
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
58
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
59
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
60
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
61
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
62
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
63
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
64
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
65
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
66
|
-
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
67
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
68
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
69
|
-
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
70
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
71
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
72
|
-
|
|
73
|
-
/* Interop Constraints */
|
|
74
16
|
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
|
|
75
17
|
"allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
|
|
76
|
-
// "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
|
|
77
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
78
|
-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
79
|
-
|
|
80
|
-
/* Type Checking */
|
|
81
18
|
"strict": true /* Enable all strict type-checking options. */,
|
|
82
|
-
|
|
83
|
-
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
84
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
85
|
-
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
86
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
87
|
-
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
88
|
-
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
89
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
90
|
-
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
91
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
92
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
93
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
94
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
95
|
-
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
96
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
97
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
98
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
99
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
100
|
-
|
|
101
|
-
/* Completeness */
|
|
102
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
103
20
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
104
21
|
}
|
|
105
22
|
}
|
|
@@ -216,6 +216,10 @@ var InspectorProxyWorker = class {
|
|
|
216
216
|
);
|
|
217
217
|
runtimeWebSocketUrl.protocol = this.proxyData.userWorkerUrl.protocol;
|
|
218
218
|
this.sendDebugLog("NEW RUNTIME WEBSOCKET", runtimeWebSocketUrl);
|
|
219
|
+
this.sendDevToolsMessage({
|
|
220
|
+
method: "Runtime.executionContextsCleared",
|
|
221
|
+
params: void 0
|
|
222
|
+
});
|
|
219
223
|
const upgrade = await fetch(runtimeWebSocketUrl, {
|
|
220
224
|
headers: {
|
|
221
225
|
...this.proxyData.headers,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../templates/startDevWorker/InspectorProxyWorker.ts", "../src/api/startDevWorker/events.ts", "../src/api/startDevWorker/utils.ts"],
|
|
4
|
-
"mappings": ";AAAA,OAAOA,aAAY;;;
|
|
4
|
+
"mappings": ";AAAA,OAAOA,aAAY;;;ACiIZ,SAAS,eAAe,GAA6B;AAC3D,MAAI,aAAa,OAAO;AACvB,WAAO;AAAA,MACN,SAAS,EAAE;AAAA,MACX,MAAM,EAAE;AAAA,MACR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