@cloudflare/vite-plugin 1.37.0 → 1.37.2
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/dist/index.mjs +490 -332
- package/dist/index.mjs.map +1 -1
- package/dist/{package-DxUBcJd6.mjs → package-Ccdu_a9K.mjs} +2 -2
- package/dist/{package-DxUBcJd6.mjs.map → package-Ccdu_a9K.mjs.map} +1 -1
- package/dist/workers/runner-worker/module-runner.js +1 -1
- package/dist/workers/vite-proxy-worker/index.js +1 -0
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import assert from "node:assert";
|
|
|
3
3
|
import { CoreHeaders, CorePaths, Log, LogLevel, Miniflare, Request as Request$1, Response as Response$1, buildPublicUrl, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
|
|
4
4
|
import * as wrangler from "wrangler";
|
|
5
5
|
import * as nodePath from "node:path";
|
|
6
|
-
import
|
|
6
|
+
import path, { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
7
7
|
import * as util$1 from "node:util";
|
|
8
8
|
import { format, inspect, promisify } from "node:util";
|
|
9
9
|
import * as vite from "vite";
|
|
@@ -24,7 +24,7 @@ import v8 from "node:v8";
|
|
|
24
24
|
import { defineEnv } from "unenv";
|
|
25
25
|
import * as nativeFs$1 from "fs";
|
|
26
26
|
import nativeFs from "fs";
|
|
27
|
-
import path, { basename, dirname as dirname$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
|
|
27
|
+
import path$1, { basename, dirname as dirname$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
|
|
28
28
|
import { fileURLToPath as fileURLToPath$1 } from "url";
|
|
29
29
|
import { createRequire as createRequire$1 } from "module";
|
|
30
30
|
import { WebSocketServer } from "ws";
|
|
@@ -1503,7 +1503,7 @@ async function assertWranglerVersion() {
|
|
|
1503
1503
|
* The default compatibility date to use when the user omits one.
|
|
1504
1504
|
* This value is injected at build time and remains fixed for each release.
|
|
1505
1505
|
*/
|
|
1506
|
-
const DEFAULT_COMPAT_DATE = "2026-05-
|
|
1506
|
+
const DEFAULT_COMPAT_DATE = "2026-05-19";
|
|
1507
1507
|
|
|
1508
1508
|
//#endregion
|
|
1509
1509
|
//#region ../../node_modules/.pnpm/@remix-run+node-fetch-server@0.8.0/node_modules/@remix-run/node-fetch-server/dist/node-fetch-server.js
|
|
@@ -1997,7 +1997,7 @@ var MetricsRegistry = class {
|
|
|
1997
1997
|
};
|
|
1998
1998
|
|
|
1999
1999
|
//#endregion
|
|
2000
|
-
//#region ../workers-utils/dist/chunk-
|
|
2000
|
+
//#region ../workers-utils/dist/chunk-GMTGAG26.mjs
|
|
2001
2001
|
var UserError = class extends Error {
|
|
2002
2002
|
static {
|
|
2003
2003
|
__name(this, "UserError");
|
|
@@ -4330,7 +4330,7 @@ function resolveWranglerConfigPath({ config, script }, options) {
|
|
|
4330
4330
|
deployConfigPath: void 0,
|
|
4331
4331
|
redirected: false
|
|
4332
4332
|
};
|
|
4333
|
-
return findWranglerConfig$1(script !== void 0 ?
|
|
4333
|
+
return findWranglerConfig$1(script !== void 0 ? path.dirname(script) : process.cwd(), options);
|
|
4334
4334
|
}
|
|
4335
4335
|
__name(resolveWranglerConfigPath, "resolveWranglerConfigPath");
|
|
4336
4336
|
function findWranglerConfig$1(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
|
|
@@ -4361,15 +4361,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
4361
4361
|
const deployConfigFile = readFileSync$1(deployConfigPath);
|
|
4362
4362
|
try {
|
|
4363
4363
|
const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
|
|
4364
|
-
redirectedConfigPath = deployConfig.configPath &&
|
|
4364
|
+
redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
|
|
4365
4365
|
} catch (e) {
|
|
4366
|
-
throw new UserError(`Failed to parse the deploy configuration file at ${
|
|
4366
|
+
throw new UserError(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
|
|
4367
4367
|
cause: e,
|
|
4368
4368
|
telemetryMessage: false
|
|
4369
4369
|
});
|
|
4370
4370
|
}
|
|
4371
4371
|
if (!redirectedConfigPath) throw new UserError(esm_default`
|
|
4372
|
-
A deploy configuration file was found at "${
|
|
4372
|
+
A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
|
|
4373
4373
|
But this is not valid - the required "configPath" property was not found.
|
|
4374
4374
|
Instead this file contains:
|
|
4375
4375
|
\`\`\`
|
|
@@ -4377,13 +4377,13 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
4377
4377
|
\`\`\`
|
|
4378
4378
|
`, { telemetryMessage: false });
|
|
4379
4379
|
if (!existsSync(redirectedConfigPath)) throw new UserError(esm_default`
|
|
4380
|
-
There is a deploy configuration at "${
|
|
4381
|
-
But the redirected configuration path it points to, "${
|
|
4380
|
+
There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
|
|
4381
|
+
But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
|
|
4382
4382
|
`, { telemetryMessage: false });
|
|
4383
4383
|
if (userConfigPath) {
|
|
4384
|
-
if (
|
|
4385
|
-
Found both a user configuration file at "${
|
|
4386
|
-
and a deploy configuration file at "${
|
|
4384
|
+
if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError(esm_default`
|
|
4385
|
+
Found both a user configuration file at "${path.relative(".", userConfigPath)}"
|
|
4386
|
+
and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
|
|
4387
4387
|
But these do not share the same base path so it is not clear which should be used.
|
|
4388
4388
|
`, { telemetryMessage: false });
|
|
4389
4389
|
}
|
|
@@ -4394,8 +4394,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
4394
4394
|
};
|
|
4395
4395
|
}
|
|
4396
4396
|
__name(findRedirectedWranglerConfig, "findRedirectedWranglerConfig");
|
|
4397
|
+
function isRedirectedConfig(config) {
|
|
4398
|
+
return config.configPath !== void 0 && config.configPath !== config.userConfigPath;
|
|
4399
|
+
}
|
|
4400
|
+
__name(isRedirectedConfig, "isRedirectedConfig");
|
|
4397
4401
|
function isRedirectedRawConfig(rawConfig, configPath, userConfigPath) {
|
|
4398
|
-
return
|
|
4402
|
+
return isRedirectedConfig({
|
|
4403
|
+
configPath,
|
|
4404
|
+
userConfigPath
|
|
4405
|
+
});
|
|
4399
4406
|
}
|
|
4400
4407
|
__name(isRedirectedRawConfig, "isRedirectedRawConfig");
|
|
4401
4408
|
function configFormat(configPath) {
|
|
@@ -5592,10 +5599,10 @@ var require_util$5 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
5592
5599
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5593
5600
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
5594
5601
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
5595
|
-
let path$
|
|
5602
|
+
let path$2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
5596
5603
|
if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1);
|
|
5597
|
-
if (path$
|
|
5598
|
-
return new URL(`${origin}${path$
|
|
5604
|
+
if (path$2 && path$2[0] !== "/") path$2 = `/${path$2}`;
|
|
5605
|
+
return new URL(`${origin}${path$2}`);
|
|
5599
5606
|
}
|
|
5600
5607
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5601
5608
|
return url;
|
|
@@ -6470,8 +6477,8 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
6470
6477
|
debugLog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$2, error.message);
|
|
6471
6478
|
});
|
|
6472
6479
|
diagnosticsChannel$1.subscribe("undici:client:sendHeaders", (evt) => {
|
|
6473
|
-
const { request: { method, path: path$
|
|
6474
|
-
debugLog("sending request to %s %s%s", method, origin, path$
|
|
6480
|
+
const { request: { method, path: path$2, origin } } = evt;
|
|
6481
|
+
debugLog("sending request to %s %s%s", method, origin, path$2);
|
|
6475
6482
|
});
|
|
6476
6483
|
}
|
|
6477
6484
|
let isTrackingRequestEvents = false;
|
|
@@ -6483,16 +6490,16 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
6483
6490
|
}
|
|
6484
6491
|
isTrackingRequestEvents = true;
|
|
6485
6492
|
diagnosticsChannel$1.subscribe("undici:request:headers", (evt) => {
|
|
6486
|
-
const { request: { method, path: path$
|
|
6487
|
-
debugLog("received response to %s %s%s - HTTP %d", method, origin, path$
|
|
6493
|
+
const { request: { method, path: path$2, origin }, response: { statusCode } } = evt;
|
|
6494
|
+
debugLog("received response to %s %s%s - HTTP %d", method, origin, path$2, statusCode);
|
|
6488
6495
|
});
|
|
6489
6496
|
diagnosticsChannel$1.subscribe("undici:request:trailers", (evt) => {
|
|
6490
|
-
const { request: { method, path: path$
|
|
6491
|
-
debugLog("trailers received from %s %s%s", method, origin, path$
|
|
6497
|
+
const { request: { method, path: path$2, origin } } = evt;
|
|
6498
|
+
debugLog("trailers received from %s %s%s", method, origin, path$2);
|
|
6492
6499
|
});
|
|
6493
6500
|
diagnosticsChannel$1.subscribe("undici:request:error", (evt) => {
|
|
6494
|
-
const { request: { method, path: path$
|
|
6495
|
-
debugLog("request to %s %s%s errored - %s", method, origin, path$
|
|
6501
|
+
const { request: { method, path: path$2, origin }, error } = evt;
|
|
6502
|
+
debugLog("request to %s %s%s errored - %s", method, origin, path$2, error.message);
|
|
6496
6503
|
});
|
|
6497
6504
|
}
|
|
6498
6505
|
let isTrackingWebSocketEvents = false;
|
|
@@ -6545,10 +6552,10 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
6545
6552
|
const invalidPathRegex = /[^\u0021-\u00ff]/;
|
|
6546
6553
|
const kHandler = Symbol("handler");
|
|
6547
6554
|
var Request$6 = class {
|
|
6548
|
-
constructor(origin, { path: path$
|
|
6549
|
-
if (typeof path$
|
|
6550
|
-
else if (path$
|
|
6551
|
-
else if (invalidPathRegex.test(path$
|
|
6555
|
+
constructor(origin, { path: path$2, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
|
|
6556
|
+
if (typeof path$2 !== "string") throw new InvalidArgumentError$35("path must be a string");
|
|
6557
|
+
else if (path$2[0] !== "/" && !(path$2.startsWith("http://") || path$2.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$35("path must be an absolute URL or start with a slash");
|
|
6558
|
+
else if (invalidPathRegex.test(path$2)) throw new InvalidArgumentError$35("invalid request path");
|
|
6552
6559
|
if (typeof method !== "string") throw new InvalidArgumentError$35("method must be a string");
|
|
6553
6560
|
else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$2(method)) throw new InvalidArgumentError$35("invalid request method");
|
|
6554
6561
|
if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$35("upgrade must be a string");
|
|
@@ -6589,7 +6596,7 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
6589
6596
|
this.completed = false;
|
|
6590
6597
|
this.aborted = false;
|
|
6591
6598
|
this.upgrade = upgrade$1 || null;
|
|
6592
|
-
this.path = query ? serializePathWithQuery$3(path$
|
|
6599
|
+
this.path = query ? serializePathWithQuery$3(path$2, query) : path$2;
|
|
6593
6600
|
this.origin = origin;
|
|
6594
6601
|
this.protocol = getProtocolFromUrlString(origin);
|
|
6595
6602
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -11072,7 +11079,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11072
11079
|
* @returns
|
|
11073
11080
|
*/
|
|
11074
11081
|
function writeH1(client, request$2) {
|
|
11075
|
-
const { method, path: path$
|
|
11082
|
+
const { method, path: path$2, host, upgrade: upgrade$1, blocking, reset } = request$2;
|
|
11076
11083
|
let { body, headers, contentLength } = request$2;
|
|
11077
11084
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
11078
11085
|
if (util$23.isFormDataLike(body)) {
|
|
@@ -11117,7 +11124,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11117
11124
|
if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
|
|
11118
11125
|
if (blocking) socket[kBlocking] = true;
|
|
11119
11126
|
if (socket.setTypeOfService) socket.setTypeOfService(request$2.typeOfService);
|
|
11120
|
-
let header = `${method} ${path$
|
|
11127
|
+
let header = `${method} ${path$2} HTTP/1.1\r\n`;
|
|
11121
11128
|
if (typeof host === "string") header += `host: ${host}\r\n`;
|
|
11122
11129
|
else header += client[kHostHeader$1];
|
|
11123
11130
|
if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
|
|
@@ -11653,7 +11660,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11653
11660
|
function writeH2(client, request$2) {
|
|
11654
11661
|
const requestTimeout = request$2.bodyTimeout ?? client[kBodyTimeout$1];
|
|
11655
11662
|
const session = client[kHTTP2Session];
|
|
11656
|
-
const { method, path: path$
|
|
11663
|
+
const { method, path: path$2, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
|
|
11657
11664
|
let { body } = request$2;
|
|
11658
11665
|
if (upgrade$1 != null && upgrade$1 !== "websocket") {
|
|
11659
11666
|
util$22.errorRequest(client, request$2, new InvalidArgumentError$30(`Custom upgrade "${upgrade$1}" not supported over HTTP/2`));
|
|
@@ -11706,7 +11713,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11706
11713
|
}
|
|
11707
11714
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
11708
11715
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
11709
|
-
headers[HTTP2_HEADER_PATH] = path$
|
|
11716
|
+
headers[HTTP2_HEADER_PATH] = path$2;
|
|
11710
11717
|
if (protocol === "ws:" || protocol === "wss:") headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
11711
11718
|
else headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11712
11719
|
stream$2 = session.request(headers, {
|
|
@@ -11748,7 +11755,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11748
11755
|
stream$2.setTimeout(requestTimeout);
|
|
11749
11756
|
return true;
|
|
11750
11757
|
}
|
|
11751
|
-
headers[HTTP2_HEADER_PATH] = path$
|
|
11758
|
+
headers[HTTP2_HEADER_PATH] = path$2;
|
|
11752
11759
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11753
11760
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
11754
11761
|
if (body && typeof body.read === "function") body.read(0);
|
|
@@ -13574,8 +13581,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
13574
13581
|
}
|
|
13575
13582
|
if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$1);
|
|
13576
13583
|
};
|
|
13577
|
-
const { origin, path: path$
|
|
13578
|
-
opts.path = origin + path$
|
|
13584
|
+
const { origin, path: path$2 = "/", headers = {} } = opts;
|
|
13585
|
+
opts.path = origin + path$2;
|
|
13579
13586
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
13580
13587
|
const { host } = new URL(origin);
|
|
13581
13588
|
headers.host = host;
|
|
@@ -15359,16 +15366,16 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15359
15366
|
}
|
|
15360
15367
|
return normalizedQp;
|
|
15361
15368
|
}
|
|
15362
|
-
function safeUrl(path$
|
|
15363
|
-
if (typeof path$
|
|
15364
|
-
const pathSegments = path$
|
|
15365
|
-
if (pathSegments.length !== 2) return path$
|
|
15369
|
+
function safeUrl(path$2) {
|
|
15370
|
+
if (typeof path$2 !== "string") return path$2;
|
|
15371
|
+
const pathSegments = path$2.split("?", 3);
|
|
15372
|
+
if (pathSegments.length !== 2) return path$2;
|
|
15366
15373
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
15367
15374
|
qp.sort();
|
|
15368
15375
|
return [...pathSegments, qp.toString()].join("?");
|
|
15369
15376
|
}
|
|
15370
|
-
function matchKey(mockDispatch$1, { path: path$
|
|
15371
|
-
const pathMatch = matchValue$1(mockDispatch$1.path, path$
|
|
15377
|
+
function matchKey(mockDispatch$1, { path: path$2, method, body, headers }) {
|
|
15378
|
+
const pathMatch = matchValue$1(mockDispatch$1.path, path$2);
|
|
15372
15379
|
const methodMatch = matchValue$1(mockDispatch$1.method, method);
|
|
15373
15380
|
const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
|
|
15374
15381
|
const headersMatch = matchHeaders(mockDispatch$1, headers);
|
|
@@ -15386,8 +15393,8 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15386
15393
|
const basePath = key.query ? serializePathWithQuery$2(key.path, key.query) : key.path;
|
|
15387
15394
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
15388
15395
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
15389
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$
|
|
15390
|
-
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$
|
|
15396
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$2, ignoreTrailingSlash }) => {
|
|
15397
|
+
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$2)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$2), resolvedPath);
|
|
15391
15398
|
});
|
|
15392
15399
|
if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
15393
15400
|
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
|
|
@@ -15430,15 +15437,15 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15430
15437
|
/**
|
|
15431
15438
|
* @param {string} path Path to remove trailing slash from
|
|
15432
15439
|
*/
|
|
15433
|
-
function removeTrailingSlash(path$
|
|
15434
|
-
while (path$
|
|
15435
|
-
if (path$
|
|
15436
|
-
return path$
|
|
15440
|
+
function removeTrailingSlash(path$2) {
|
|
15441
|
+
while (path$2.endsWith("/")) path$2 = path$2.slice(0, -1);
|
|
15442
|
+
if (path$2.length === 0) path$2 = "/";
|
|
15443
|
+
return path$2;
|
|
15437
15444
|
}
|
|
15438
15445
|
function buildKey$1(opts) {
|
|
15439
|
-
const { path: path$
|
|
15446
|
+
const { path: path$2, method, body, headers, query } = opts;
|
|
15440
15447
|
return {
|
|
15441
|
-
path: path$
|
|
15448
|
+
path: path$2,
|
|
15442
15449
|
method,
|
|
15443
15450
|
body,
|
|
15444
15451
|
headers,
|
|
@@ -16005,10 +16012,10 @@ var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJS$1({ "../
|
|
|
16005
16012
|
});
|
|
16006
16013
|
}
|
|
16007
16014
|
format(pendingInterceptors) {
|
|
16008
|
-
const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$
|
|
16015
|
+
const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
16009
16016
|
Method: method,
|
|
16010
16017
|
Origin: origin,
|
|
16011
|
-
Path: path$
|
|
16018
|
+
Path: path$2,
|
|
16012
16019
|
"Status code": statusCode,
|
|
16013
16020
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
16014
16021
|
Invocations: timesInvoked,
|
|
@@ -16066,8 +16073,8 @@ var require_mock_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
16066
16073
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
16067
16074
|
const dispatchOpts = { ...opts };
|
|
16068
16075
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
16069
|
-
const [path$
|
|
16070
|
-
dispatchOpts.path = `${path$
|
|
16076
|
+
const [path$2, searchParams] = dispatchOpts.path.split("?");
|
|
16077
|
+
dispatchOpts.path = `${path$2}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
|
|
16071
16078
|
}
|
|
16072
16079
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
16073
16080
|
}
|
|
@@ -16544,10 +16551,10 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16544
16551
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
16545
16552
|
*/
|
|
16546
16553
|
async loadSnapshots(filePath) {
|
|
16547
|
-
const path$
|
|
16548
|
-
if (!path$
|
|
16554
|
+
const path$2 = filePath || this.#snapshotPath;
|
|
16555
|
+
if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16549
16556
|
try {
|
|
16550
|
-
const data$1 = await readFile(resolve$3(path$
|
|
16557
|
+
const data$1 = await readFile(resolve$3(path$2), "utf8");
|
|
16551
16558
|
const parsed = JSON.parse(data$1);
|
|
16552
16559
|
if (Array.isArray(parsed)) {
|
|
16553
16560
|
this.#snapshots.clear();
|
|
@@ -16555,7 +16562,7 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16555
16562
|
} else this.#snapshots = new Map(Object.entries(parsed));
|
|
16556
16563
|
} catch (error) {
|
|
16557
16564
|
if (error.code === "ENOENT") this.#snapshots.clear();
|
|
16558
|
-
else throw new UndiciError$1(`Failed to load snapshots from ${path$
|
|
16565
|
+
else throw new UndiciError$1(`Failed to load snapshots from ${path$2}`, { cause: error });
|
|
16559
16566
|
}
|
|
16560
16567
|
}
|
|
16561
16568
|
/**
|
|
@@ -16565,9 +16572,9 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16565
16572
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
16566
16573
|
*/
|
|
16567
16574
|
async saveSnapshots(filePath) {
|
|
16568
|
-
const path$
|
|
16569
|
-
if (!path$
|
|
16570
|
-
const resolvedPath = resolve$3(path$
|
|
16575
|
+
const path$2 = filePath || this.#snapshotPath;
|
|
16576
|
+
if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16577
|
+
const resolvedPath = resolve$3(path$2);
|
|
16571
16578
|
await mkdir(dirname$2(resolvedPath), { recursive: true });
|
|
16572
16579
|
const data$1 = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
16573
16580
|
hash,
|
|
@@ -17134,11 +17141,11 @@ var require_redirect_handler = /* @__PURE__ */ __commonJS$1({ "../../node_module
|
|
|
17134
17141
|
return;
|
|
17135
17142
|
}
|
|
17136
17143
|
const { origin, pathname, search } = util$10.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
17137
|
-
const path$
|
|
17138
|
-
const redirectUrlString = `${origin}${path$
|
|
17144
|
+
const path$2 = search ? `${pathname}${search}` : pathname;
|
|
17145
|
+
const redirectUrlString = `${origin}${path$2}`;
|
|
17139
17146
|
for (const historyUrl of this.history) if (historyUrl.toString() === redirectUrlString) throw new InvalidArgumentError$3(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
17140
17147
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
17141
|
-
this.opts.path = path$
|
|
17148
|
+
this.opts.path = path$2;
|
|
17142
17149
|
this.opts.origin = origin;
|
|
17143
17150
|
this.opts.query = null;
|
|
17144
17151
|
}
|
|
@@ -22096,10 +22103,10 @@ var require_fetch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/und
|
|
|
22096
22103
|
const url = requestCurrentURL(request$2);
|
|
22097
22104
|
/** @type {import('../../..').Agent} */
|
|
22098
22105
|
const agent = fetchParams.controller.dispatcher;
|
|
22099
|
-
const path$
|
|
22106
|
+
const path$2 = url.pathname + url.search;
|
|
22100
22107
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
22101
22108
|
return new Promise((resolve$4, reject) => agent.dispatch({
|
|
22102
|
-
path: hasTrailingQuestionMark ? `${path$
|
|
22109
|
+
path: hasTrailingQuestionMark ? `${path$2}?` : path$2,
|
|
22103
22110
|
origin: url.origin,
|
|
22104
22111
|
method: request$2.method,
|
|
22105
22112
|
body: agent.isMockActive ? request$2.body && (request$2.body.source || request$2.body.stream) : body,
|
|
@@ -22881,9 +22888,9 @@ var require_util$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
22881
22888
|
* path-value = <any CHAR except CTLs or ";">
|
|
22882
22889
|
* @param {string} path
|
|
22883
22890
|
*/
|
|
22884
|
-
function validateCookiePath(path$
|
|
22885
|
-
for (let i$1 = 0; i$1 < path$
|
|
22886
|
-
const code = path$
|
|
22891
|
+
function validateCookiePath(path$2) {
|
|
22892
|
+
for (let i$1 = 0; i$1 < path$2.length; ++i$1) {
|
|
22893
|
+
const code = path$2.charCodeAt(i$1);
|
|
22887
22894
|
if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path");
|
|
22888
22895
|
}
|
|
22889
22896
|
}
|
|
@@ -25991,9 +25998,9 @@ var require_undici = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
25991
25998
|
if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
|
|
25992
25999
|
if (opts && opts.path != null) {
|
|
25993
26000
|
if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
|
|
25994
|
-
let path$
|
|
25995
|
-
if (!opts.path.startsWith("/")) path$
|
|
25996
|
-
url = new URL(util$3.parseOrigin(url).origin + path$
|
|
26001
|
+
let path$2 = opts.path;
|
|
26002
|
+
if (!opts.path.startsWith("/")) path$2 = `/${path$2}`;
|
|
26003
|
+
url = new URL(util$3.parseOrigin(url).origin + path$2);
|
|
25997
26004
|
} else {
|
|
25998
26005
|
if (!opts) opts = typeof url === "object" ? url : {};
|
|
25999
26006
|
url = util$3.parseURL(url);
|
|
@@ -30369,7 +30376,7 @@ __reExport(mod_esm_exports, __toESM(require_mod_cjs3(), 1));
|
|
|
30369
30376
|
var mod_esm_default = import_mod_cjs.default;
|
|
30370
30377
|
function getGlobalWranglerConfigPath() {
|
|
30371
30378
|
const configDir = mod_esm_default(".wrangler").config();
|
|
30372
|
-
const legacyConfigDir =
|
|
30379
|
+
const legacyConfigDir = path.join(os.homedir(), ".wrangler");
|
|
30373
30380
|
if (isDirectory(legacyConfigDir)) return legacyConfigDir;
|
|
30374
30381
|
else return configDir;
|
|
30375
30382
|
}
|
|
@@ -30465,7 +30472,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRA
|
|
|
30465
30472
|
var getRegistryPath = getEnvironmentVariableFactory({
|
|
30466
30473
|
variableName: "WRANGLER_REGISTRY_PATH",
|
|
30467
30474
|
defaultValue() {
|
|
30468
|
-
return
|
|
30475
|
+
return path.join(getGlobalWranglerConfigPath(), "registry");
|
|
30469
30476
|
}
|
|
30470
30477
|
});
|
|
30471
30478
|
var getD1ExtraLocationChoices = getEnvironmentVariableFactory({ variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES" });
|
|
@@ -30877,7 +30884,7 @@ function isPagesConfig(rawConfig) {
|
|
|
30877
30884
|
}
|
|
30878
30885
|
__name(isPagesConfig, "isPagesConfig");
|
|
30879
30886
|
function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
|
|
30880
|
-
const diagnostics = new Diagnostics(`Processing ${configPath ?
|
|
30887
|
+
const diagnostics = new Diagnostics(`Processing ${configPath ? path.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
|
|
30881
30888
|
validateOptionalProperty(diagnostics, "", "legacy_env", rawConfig.legacy_env, "boolean");
|
|
30882
30889
|
validateOptionalProperty(diagnostics, "", "send_metrics", rawConfig.send_metrics, "boolean");
|
|
30883
30890
|
validateOptionalProperty(diagnostics, "", "keep_vars", rawConfig.keep_vars, "boolean");
|
|
@@ -30887,9 +30894,9 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
|
|
|
30887
30894
|
if (useServiceEnvironments) diagnostics.warnings.push("Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION.");
|
|
30888
30895
|
const isDispatchNamespace = typeof args["dispatch-namespace"] === "string" && args["dispatch-namespace"].trim() !== "";
|
|
30889
30896
|
const topLevelEnv = normalizeAndValidateEnvironment(diagnostics, configPath, rawConfig, isDispatchNamespace, preserveOriginalMain);
|
|
30890
|
-
const
|
|
30897
|
+
const isRedirectedConfig2 = isRedirectedRawConfig(rawConfig, configPath, userConfigPath);
|
|
30891
30898
|
const definedEnvironments = Object.keys(rawConfig.env ?? {});
|
|
30892
|
-
if (
|
|
30899
|
+
if (isRedirectedConfig2 && definedEnvironments.length > 0) diagnostics.errors.push(dedent`
|
|
30893
30900
|
Redirected configurations cannot include environments but the following have been found:\n${definedEnvironments.map((env$1) => ` - ${env$1}`).join("\n")}
|
|
30894
30901
|
|
|
30895
30902
|
|
|
@@ -30900,7 +30907,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
|
|
|
30900
30907
|
const envName = args.env ?? getCloudflareEnv();
|
|
30901
30908
|
assert(envName === void 0 || typeof envName === "string");
|
|
30902
30909
|
let activeEnv = topLevelEnv;
|
|
30903
|
-
if (envName) if (
|
|
30910
|
+
if (envName) if (isRedirectedConfig2) {
|
|
30904
30911
|
if (!isPagesConfig(rawConfig) && rawConfig.targetEnvironment && rawConfig.targetEnvironment !== envName) {
|
|
30905
30912
|
const via = args.env !== void 0 ? "via the `--env/-e` CLI argument" : "via the CLOUDFLARE_ENV environment variable";
|
|
30906
30913
|
throw new Error(dedent`
|
|
@@ -30932,9 +30939,9 @@ Consider adding an environment configuration section to the ${configFileName(con
|
|
|
30932
30939
|
const config = {
|
|
30933
30940
|
configPath,
|
|
30934
30941
|
userConfigPath,
|
|
30935
|
-
topLevelName:
|
|
30936
|
-
definedEnvironments:
|
|
30937
|
-
targetEnvironment:
|
|
30942
|
+
topLevelName: isRedirectedConfig2 ? rawConfig.topLevelName : rawConfig.name,
|
|
30943
|
+
definedEnvironments: isRedirectedConfig2 ? rawConfig.definedEnvironments : definedEnvironments,
|
|
30944
|
+
targetEnvironment: isRedirectedConfig2 ? rawConfig.targetEnvironment : envName,
|
|
30938
30945
|
pages_build_output_dir: normalizeAndValidatePagesBuildOutputDir(configPath, rawConfig.pages_build_output_dir),
|
|
30939
30946
|
legacy_env: !useServiceEnvironments,
|
|
30940
30947
|
send_metrics: rawConfig.send_metrics,
|
|
@@ -30981,34 +30988,34 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
|
|
|
30981
30988
|
else validateOptionalProperty(diagnostics, "build", "watch_dir", watch_dir, "string");
|
|
30982
30989
|
return {
|
|
30983
30990
|
command,
|
|
30984
|
-
watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) =>
|
|
30991
|
+
watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir) => path.relative(process.cwd(), path.join(path.dirname(configPath), `${dir}`))) : path.relative(process.cwd(), path.join(path.dirname(configPath), `${watch_dir}`)) : watch_dir,
|
|
30985
30992
|
cwd
|
|
30986
30993
|
};
|
|
30987
30994
|
}
|
|
30988
30995
|
__name(normalizeAndValidateBuild, "normalizeAndValidateBuild");
|
|
30989
30996
|
function normalizeAndValidateMainField(configPath, rawMain) {
|
|
30990
|
-
const configDir =
|
|
30997
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
30991
30998
|
if (rawMain !== void 0) if (typeof rawMain === "string") {
|
|
30992
|
-
const directory =
|
|
30993
|
-
return
|
|
30999
|
+
const directory = path.resolve(configDir);
|
|
31000
|
+
return path.resolve(directory, rawMain);
|
|
30994
31001
|
} else return rawMain;
|
|
30995
31002
|
else return;
|
|
30996
31003
|
}
|
|
30997
31004
|
__name(normalizeAndValidateMainField, "normalizeAndValidateMainField");
|
|
30998
31005
|
function normalizeAndValidateBaseDirField(configPath, rawDir) {
|
|
30999
|
-
const configDir =
|
|
31006
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
31000
31007
|
if (rawDir !== void 0) if (typeof rawDir === "string") {
|
|
31001
|
-
const directory =
|
|
31002
|
-
return
|
|
31008
|
+
const directory = path.resolve(configDir);
|
|
31009
|
+
return path.resolve(directory, rawDir);
|
|
31003
31010
|
} else return rawDir;
|
|
31004
31011
|
else return;
|
|
31005
31012
|
}
|
|
31006
31013
|
__name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
|
|
31007
31014
|
function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
|
|
31008
|
-
const configDir =
|
|
31015
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
31009
31016
|
if (rawPagesDir !== void 0) if (typeof rawPagesDir === "string") {
|
|
31010
|
-
const directory =
|
|
31011
|
-
return
|
|
31017
|
+
const directory = path.resolve(configDir);
|
|
31018
|
+
return path.resolve(directory, rawPagesDir);
|
|
31012
31019
|
} else return rawPagesDir;
|
|
31013
31020
|
else return;
|
|
31014
31021
|
}
|
|
@@ -31061,7 +31068,7 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
|
|
|
31061
31068
|
validateOptionalProperty(diagnostics, "site", "entry-point", rawConfig.site["entry-point"], "string");
|
|
31062
31069
|
deprecated(diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
|
|
31063
31070
|
\`\`\`
|
|
31064
|
-
main = "${
|
|
31071
|
+
main = "${path.join(String(rawConfig.site["entry-point"]) || "workers-site", path.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js")}"
|
|
31065
31072
|
\`\`\``, false, void 0, "warning");
|
|
31066
31073
|
let siteEntryPoint = rawConfig.site["entry-point"];
|
|
31067
31074
|
if (!mainEntryPoint && !siteEntryPoint) {
|
|
@@ -31074,7 +31081,7 @@ main = "workers-site/index.js"
|
|
|
31074
31081
|
} else if (mainEntryPoint && siteEntryPoint) diagnostics.errors.push(`Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
|
|
31075
31082
|
They serve the same purpose: to point to the entry-point of your worker.
|
|
31076
31083
|
Delete the deprecated \`site.entry-point\` field from your config.`);
|
|
31077
|
-
if (configPath && siteEntryPoint) siteEntryPoint =
|
|
31084
|
+
if (configPath && siteEntryPoint) siteEntryPoint = path.relative(process.cwd(), path.join(path.dirname(configPath), siteEntryPoint));
|
|
31078
31085
|
return {
|
|
31079
31086
|
bucket,
|
|
31080
31087
|
"entry-point": siteEntryPoint,
|
|
@@ -31106,7 +31113,7 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
|
|
|
31106
31113
|
if (rawMapping === void 0) return;
|
|
31107
31114
|
const mapping = {};
|
|
31108
31115
|
for (const [name, filePath] of Object.entries(rawMapping)) if (isString$2(diagnostics, `${field}['${name}']`, filePath, void 0)) {
|
|
31109
|
-
if (configPath) mapping[name] = configPath ?
|
|
31116
|
+
if (configPath) mapping[name] = configPath ? path.relative(process.cwd(), path.join(path.dirname(configPath), filePath)) : filePath;
|
|
31110
31117
|
}
|
|
31111
31118
|
return mapping;
|
|
31112
31119
|
}
|
|
@@ -31354,7 +31361,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
31354
31361
|
__name(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
|
|
31355
31362
|
function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
|
|
31356
31363
|
const tsconfig = inheritable(diagnostics, topLevelEnv, rawEnv, "tsconfig", isString$2, void 0);
|
|
31357
|
-
return configPath && tsconfig ?
|
|
31364
|
+
return configPath && tsconfig ? path.relative(process.cwd(), path.join(path.dirname(configPath), tsconfig)) : tsconfig;
|
|
31358
31365
|
}
|
|
31359
31366
|
__name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
|
|
31360
31367
|
var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv, rawEnv, envName) => {
|
|
@@ -31831,9 +31838,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
31831
31838
|
let resolvedBuildContextPath = void 0;
|
|
31832
31839
|
try {
|
|
31833
31840
|
if (isDockerfile(resolvedImage, configPath)) {
|
|
31834
|
-
const baseDir = configPath ?
|
|
31835
|
-
resolvedImage =
|
|
31836
|
-
resolvedBuildContextPath = containerAppOptional.image_build_context ?
|
|
31841
|
+
const baseDir = configPath ? path.dirname(configPath) : process.cwd();
|
|
31842
|
+
resolvedImage = path.resolve(baseDir, resolvedImage);
|
|
31843
|
+
resolvedBuildContextPath = containerAppOptional.image_build_context ? path.resolve(baseDir, containerAppOptional.image_build_context) : path.dirname(resolvedImage);
|
|
31837
31844
|
}
|
|
31838
31845
|
} catch (err) {
|
|
31839
31846
|
if (err instanceof Error && err.message) diagnostics.errors.push(err.message);
|
|
@@ -32972,8 +32979,8 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
|
|
|
32972
32979
|
}
|
|
32973
32980
|
__name(isRemoteValid, "isRemoteValid");
|
|
32974
32981
|
function isDockerfile(imagePath, configPath) {
|
|
32975
|
-
const baseDir = configPath ?
|
|
32976
|
-
const maybeDockerfile =
|
|
32982
|
+
const baseDir = configPath ? path.dirname(configPath) : process.cwd();
|
|
32983
|
+
const maybeDockerfile = path.resolve(baseDir, imagePath);
|
|
32977
32984
|
if (fs.existsSync(maybeDockerfile)) {
|
|
32978
32985
|
if (isDirectory(maybeDockerfile)) throw new UserError(`${imagePath} is a directory, you should specify a path to the Dockerfile`, { telemetryMessage: false });
|
|
32979
32986
|
return true;
|
|
@@ -33977,6 +33984,9 @@ function warnIfQuickTunnelSseResponse(contentType) {
|
|
|
33977
33984
|
function extendTunnelExpiry() {
|
|
33978
33985
|
tunnelManager?.extendExpiry();
|
|
33979
33986
|
}
|
|
33987
|
+
function isTunnelOpen() {
|
|
33988
|
+
return tunnelManager?.isOpen() ?? false;
|
|
33989
|
+
}
|
|
33980
33990
|
async function toggleTunnel(server, ctx) {
|
|
33981
33991
|
if (!tunnelManager) return;
|
|
33982
33992
|
if (tunnelManager.isOpen()) {
|
|
@@ -34203,15 +34213,16 @@ const postfixRE = /[?#].*$/;
|
|
|
34203
34213
|
function cleanUrl(url) {
|
|
34204
34214
|
return url.replace(postfixRE, "");
|
|
34205
34215
|
}
|
|
34206
|
-
function withTrailingSlash(path$
|
|
34207
|
-
return path$
|
|
34216
|
+
function withTrailingSlash(path$2) {
|
|
34217
|
+
return path$2.endsWith("/") ? path$2 : `${path$2}/`;
|
|
34208
34218
|
}
|
|
34209
34219
|
function createRequestHandler(handler) {
|
|
34210
34220
|
return async (req, res, next) => {
|
|
34211
34221
|
let request$2;
|
|
34212
34222
|
try {
|
|
34213
34223
|
if (req.originalUrl) req.url = req.originalUrl;
|
|
34214
|
-
|
|
34224
|
+
const protocol = getForwardedProto(req);
|
|
34225
|
+
request$2 = createRequest(req, res, protocol ? { protocol } : void 0);
|
|
34215
34226
|
let response = await handler(toMiniflareRequest(request$2), req);
|
|
34216
34227
|
if (req.httpVersionMajor === 2) {
|
|
34217
34228
|
response = new Response$1(response.body, response);
|
|
@@ -34244,6 +34255,20 @@ function toMiniflareRequest(request$2) {
|
|
|
34244
34255
|
});
|
|
34245
34256
|
}
|
|
34246
34257
|
const isRolldown = "rolldownVersion" in vite;
|
|
34258
|
+
/**
|
|
34259
|
+
* Parses the `X-Forwarded-Proto` header from an incoming Node.js request.
|
|
34260
|
+
*
|
|
34261
|
+
* If multiple proxies are in the chain, the header may be a comma-separated
|
|
34262
|
+
* list — the left-most value is the original client-facing protocol.
|
|
34263
|
+
* Returns `undefined` if the header is missing or holds an unsupported value.
|
|
34264
|
+
*/
|
|
34265
|
+
function getForwardedProto(req) {
|
|
34266
|
+
const raw = req.headers["x-forwarded-proto"];
|
|
34267
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
34268
|
+
if (!value) return;
|
|
34269
|
+
const first = value.split(",")[0]?.trim().toLowerCase();
|
|
34270
|
+
if (first === "http" || first === "https") return `${first}:`;
|
|
34271
|
+
}
|
|
34247
34272
|
|
|
34248
34273
|
//#endregion
|
|
34249
34274
|
//#region src/export-types.ts
|
|
@@ -34615,7 +34640,7 @@ function writeDeployConfig(resolvedPluginConfig, resolvedViteConfig) {
|
|
|
34615
34640
|
}
|
|
34616
34641
|
|
|
34617
34642
|
//#endregion
|
|
34618
|
-
//#region ../../node_modules/.pnpm/acorn@8.
|
|
34643
|
+
//#region ../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs
|
|
34619
34644
|
var astralIdentifierCodes = [
|
|
34620
34645
|
509,
|
|
34621
34646
|
0,
|
|
@@ -34647,8 +34672,8 @@ var astralIdentifierCodes = [
|
|
|
34647
34672
|
4,
|
|
34648
34673
|
318,
|
|
34649
34674
|
1,
|
|
34650
|
-
|
|
34651
|
-
|
|
34675
|
+
78,
|
|
34676
|
+
5,
|
|
34652
34677
|
71,
|
|
34653
34678
|
10,
|
|
34654
34679
|
50,
|
|
@@ -34793,7 +34818,9 @@ var astralIdentifierCodes = [
|
|
|
34793
34818
|
10,
|
|
34794
34819
|
47,
|
|
34795
34820
|
15,
|
|
34796
|
-
|
|
34821
|
+
199,
|
|
34822
|
+
7,
|
|
34823
|
+
137,
|
|
34797
34824
|
9,
|
|
34798
34825
|
54,
|
|
34799
34826
|
7,
|
|
@@ -34825,7 +34852,9 @@ var astralIdentifierCodes = [
|
|
|
34825
34852
|
4,
|
|
34826
34853
|
9,
|
|
34827
34854
|
9,
|
|
34828
|
-
|
|
34855
|
+
55,
|
|
34856
|
+
9,
|
|
34857
|
+
266,
|
|
34829
34858
|
3,
|
|
34830
34859
|
10,
|
|
34831
34860
|
1,
|
|
@@ -34925,7 +34954,15 @@ var astralIdentifierCodes = [
|
|
|
34925
34954
|
1,
|
|
34926
34955
|
2,
|
|
34927
34956
|
9,
|
|
34928
|
-
|
|
34957
|
+
233,
|
|
34958
|
+
0,
|
|
34959
|
+
3,
|
|
34960
|
+
0,
|
|
34961
|
+
8,
|
|
34962
|
+
1,
|
|
34963
|
+
6,
|
|
34964
|
+
0,
|
|
34965
|
+
475,
|
|
34929
34966
|
6,
|
|
34930
34967
|
110,
|
|
34931
34968
|
6,
|
|
@@ -35035,7 +35072,9 @@ var astralIdentifierStartCodes = [
|
|
|
35035
35072
|
21,
|
|
35036
35073
|
11,
|
|
35037
35074
|
25,
|
|
35038
|
-
|
|
35075
|
+
7,
|
|
35076
|
+
25,
|
|
35077
|
+
39,
|
|
35039
35078
|
55,
|
|
35040
35079
|
7,
|
|
35041
35080
|
1,
|
|
@@ -35080,8 +35119,8 @@ var astralIdentifierStartCodes = [
|
|
|
35080
35119
|
7,
|
|
35081
35120
|
1,
|
|
35082
35121
|
17,
|
|
35083
|
-
|
|
35084
|
-
|
|
35122
|
+
5,
|
|
35123
|
+
57,
|
|
35085
35124
|
28,
|
|
35086
35125
|
11,
|
|
35087
35126
|
0,
|
|
@@ -35265,7 +35304,9 @@ var astralIdentifierStartCodes = [
|
|
|
35265
35304
|
31,
|
|
35266
35305
|
15,
|
|
35267
35306
|
0,
|
|
35268
|
-
|
|
35307
|
+
24,
|
|
35308
|
+
43,
|
|
35309
|
+
261,
|
|
35269
35310
|
18,
|
|
35270
35311
|
16,
|
|
35271
35312
|
0,
|
|
@@ -35313,7 +35354,11 @@ var astralIdentifierStartCodes = [
|
|
|
35313
35354
|
44,
|
|
35314
35355
|
212,
|
|
35315
35356
|
63,
|
|
35316
|
-
|
|
35357
|
+
33,
|
|
35358
|
+
24,
|
|
35359
|
+
3,
|
|
35360
|
+
24,
|
|
35361
|
+
45,
|
|
35317
35362
|
74,
|
|
35318
35363
|
6,
|
|
35319
35364
|
0,
|
|
@@ -35323,13 +35368,15 @@ var astralIdentifierStartCodes = [
|
|
|
35323
35368
|
1,
|
|
35324
35369
|
2,
|
|
35325
35370
|
0,
|
|
35326
|
-
|
|
35327
|
-
|
|
35328
|
-
|
|
35329
|
-
|
|
35371
|
+
15,
|
|
35372
|
+
4,
|
|
35373
|
+
10,
|
|
35374
|
+
7381,
|
|
35330
35375
|
42,
|
|
35331
|
-
|
|
35332
|
-
|
|
35376
|
+
31,
|
|
35377
|
+
98,
|
|
35378
|
+
114,
|
|
35379
|
+
8702,
|
|
35333
35380
|
3,
|
|
35334
35381
|
2,
|
|
35335
35382
|
6,
|
|
@@ -35437,7 +35484,19 @@ var astralIdentifierStartCodes = [
|
|
|
35437
35484
|
29,
|
|
35438
35485
|
3,
|
|
35439
35486
|
0,
|
|
35440
|
-
|
|
35487
|
+
208,
|
|
35488
|
+
30,
|
|
35489
|
+
2,
|
|
35490
|
+
2,
|
|
35491
|
+
2,
|
|
35492
|
+
1,
|
|
35493
|
+
2,
|
|
35494
|
+
6,
|
|
35495
|
+
3,
|
|
35496
|
+
4,
|
|
35497
|
+
10,
|
|
35498
|
+
1,
|
|
35499
|
+
225,
|
|
35441
35500
|
6,
|
|
35442
35501
|
2,
|
|
35443
35502
|
3,
|
|
@@ -35520,12 +35579,10 @@ var astralIdentifierStartCodes = [
|
|
|
35520
35579
|
4421,
|
|
35521
35580
|
42719,
|
|
35522
35581
|
33,
|
|
35523
|
-
|
|
35524
|
-
|
|
35525
|
-
|
|
35582
|
+
4381,
|
|
35583
|
+
3,
|
|
35584
|
+
5773,
|
|
35526
35585
|
3,
|
|
35527
|
-
5761,
|
|
35528
|
-
15,
|
|
35529
35586
|
7472,
|
|
35530
35587
|
16,
|
|
35531
35588
|
621,
|
|
@@ -35534,10 +35591,10 @@ var astralIdentifierStartCodes = [
|
|
|
35534
35591
|
1507,
|
|
35535
35592
|
4938,
|
|
35536
35593
|
6,
|
|
35537
|
-
|
|
35594
|
+
8489
|
|
35538
35595
|
];
|
|
35539
|
-
var nonASCIIidentifierChars = "
|
|
35540
|
-
var nonASCIIidentifierStartChars = "
|
|
35596
|
+
var nonASCIIidentifierChars = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
35597
|
+
var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
35541
35598
|
var reservedWords = {
|
|
35542
35599
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
35543
35600
|
5: "class enum extends super const export import",
|
|
@@ -35840,6 +35897,7 @@ function getOptions(opts) {
|
|
|
35840
35897
|
};
|
|
35841
35898
|
}
|
|
35842
35899
|
if (isArray(options.onComment)) options.onComment = pushComment(options, options.onComment);
|
|
35900
|
+
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction) throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
35843
35901
|
return options;
|
|
35844
35902
|
}
|
|
35845
35903
|
function pushComment(options, array) {
|
|
@@ -35855,7 +35913,7 @@ function pushComment(options, array) {
|
|
|
35855
35913
|
array.push(comment);
|
|
35856
35914
|
};
|
|
35857
35915
|
}
|
|
35858
|
-
var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
35916
|
+
var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_CLASS_FIELD_INIT = 512, SCOPE_SWITCH = 1024, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
35859
35917
|
function functionFlags(async, generator) {
|
|
35860
35918
|
return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
|
|
35861
35919
|
}
|
|
@@ -35900,7 +35958,7 @@ var Parser = function Parser$2(options, input, startPos) {
|
|
|
35900
35958
|
this.undefinedExports = Object.create(null);
|
|
35901
35959
|
if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") this.skipLineComment(2);
|
|
35902
35960
|
this.scopeStack = [];
|
|
35903
|
-
this.enterScope(SCOPE_TOP);
|
|
35961
|
+
this.enterScope(this.options.sourceType === "commonjs" ? SCOPE_FUNCTION : SCOPE_TOP);
|
|
35904
35962
|
this.regexpState = null;
|
|
35905
35963
|
this.privateNameStack = [];
|
|
35906
35964
|
};
|
|
@@ -35909,10 +35967,12 @@ var prototypeAccessors = {
|
|
|
35909
35967
|
inGenerator: { configurable: true },
|
|
35910
35968
|
inAsync: { configurable: true },
|
|
35911
35969
|
canAwait: { configurable: true },
|
|
35970
|
+
allowReturn: { configurable: true },
|
|
35912
35971
|
allowSuper: { configurable: true },
|
|
35913
35972
|
allowDirectSuper: { configurable: true },
|
|
35914
35973
|
treatFunctionsAsVar: { configurable: true },
|
|
35915
35974
|
allowNewDotTarget: { configurable: true },
|
|
35975
|
+
allowUsing: { configurable: true },
|
|
35916
35976
|
inClassStaticBlock: { configurable: true }
|
|
35917
35977
|
};
|
|
35918
35978
|
Parser.prototype.parse = function parse$10() {
|
|
@@ -35924,24 +35984,26 @@ prototypeAccessors.inFunction.get = function() {
|
|
|
35924
35984
|
return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
|
|
35925
35985
|
};
|
|
35926
35986
|
prototypeAccessors.inGenerator.get = function() {
|
|
35927
|
-
return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0
|
|
35987
|
+
return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0;
|
|
35928
35988
|
};
|
|
35929
35989
|
prototypeAccessors.inAsync.get = function() {
|
|
35930
|
-
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0
|
|
35990
|
+
return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
|
|
35931
35991
|
};
|
|
35932
35992
|
prototypeAccessors.canAwait.get = function() {
|
|
35933
35993
|
for (var i$1 = this.scopeStack.length - 1; i$1 >= 0; i$1--) {
|
|
35934
|
-
var
|
|
35935
|
-
if (
|
|
35936
|
-
if (
|
|
35994
|
+
var flags = this.scopeStack[i$1].flags;
|
|
35995
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) return false;
|
|
35996
|
+
if (flags & SCOPE_FUNCTION) return (flags & SCOPE_ASYNC) > 0;
|
|
35937
35997
|
}
|
|
35938
35998
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
35939
35999
|
};
|
|
36000
|
+
prototypeAccessors.allowReturn.get = function() {
|
|
36001
|
+
if (this.inFunction) return true;
|
|
36002
|
+
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) return true;
|
|
36003
|
+
return false;
|
|
36004
|
+
};
|
|
35940
36005
|
prototypeAccessors.allowSuper.get = function() {
|
|
35941
|
-
|
|
35942
|
-
var flags = ref$1.flags;
|
|
35943
|
-
var inClassFieldInit = ref$1.inClassFieldInit;
|
|
35944
|
-
return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod;
|
|
36006
|
+
return (this.currentThisScope().flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod;
|
|
35945
36007
|
};
|
|
35946
36008
|
prototypeAccessors.allowDirectSuper.get = function() {
|
|
35947
36009
|
return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
|
|
@@ -35950,10 +36012,17 @@ prototypeAccessors.treatFunctionsAsVar.get = function() {
|
|
|
35950
36012
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
35951
36013
|
};
|
|
35952
36014
|
prototypeAccessors.allowNewDotTarget.get = function() {
|
|
35953
|
-
var
|
|
35954
|
-
|
|
35955
|
-
|
|
35956
|
-
|
|
36015
|
+
for (var i$1 = this.scopeStack.length - 1; i$1 >= 0; i$1--) {
|
|
36016
|
+
var flags = this.scopeStack[i$1].flags;
|
|
36017
|
+
if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW)) return true;
|
|
36018
|
+
}
|
|
36019
|
+
return false;
|
|
36020
|
+
};
|
|
36021
|
+
prototypeAccessors.allowUsing.get = function() {
|
|
36022
|
+
var flags = this.currentScope().flags;
|
|
36023
|
+
if (flags & SCOPE_SWITCH) return false;
|
|
36024
|
+
if (!this.inModule && flags & SCOPE_TOP) return false;
|
|
36025
|
+
return true;
|
|
35957
36026
|
};
|
|
35958
36027
|
prototypeAccessors.inClassStaticBlock.get = function() {
|
|
35959
36028
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
|
@@ -36079,7 +36148,7 @@ pp$8.parseTopLevel = function(node) {
|
|
|
36079
36148
|
}
|
|
36080
36149
|
this.adaptDirectivePrologue(node.body);
|
|
36081
36150
|
this.next();
|
|
36082
|
-
node.sourceType = this.options.sourceType;
|
|
36151
|
+
node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
|
|
36083
36152
|
return this.finishNode(node, "Program");
|
|
36084
36153
|
};
|
|
36085
36154
|
var loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" };
|
|
@@ -36087,15 +36156,17 @@ pp$8.isLet = function(context) {
|
|
|
36087
36156
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return false;
|
|
36088
36157
|
skipWhiteSpace.lastIndex = this.pos;
|
|
36089
36158
|
var skip = skipWhiteSpace.exec(this.input);
|
|
36090
|
-
var next = this.pos + skip[0].length, nextCh = this.
|
|
36159
|
+
var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
|
|
36091
36160
|
if (nextCh === 91 || nextCh === 92) return true;
|
|
36092
36161
|
if (context) return false;
|
|
36093
|
-
if (nextCh === 123
|
|
36094
|
-
if (isIdentifierStart(nextCh
|
|
36095
|
-
var
|
|
36096
|
-
|
|
36097
|
-
|
|
36098
|
-
|
|
36162
|
+
if (nextCh === 123) return true;
|
|
36163
|
+
if (isIdentifierStart(nextCh)) {
|
|
36164
|
+
var start = next;
|
|
36165
|
+
do
|
|
36166
|
+
next += nextCh <= 65535 ? 1 : 2;
|
|
36167
|
+
while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)));
|
|
36168
|
+
if (nextCh === 92) return true;
|
|
36169
|
+
var ident = this.input.slice(start, next);
|
|
36099
36170
|
if (!keywordRelationalOperator.test(ident)) return true;
|
|
36100
36171
|
}
|
|
36101
36172
|
return false;
|
|
@@ -36105,7 +36176,38 @@ pp$8.isAsyncFunction = function() {
|
|
|
36105
36176
|
skipWhiteSpace.lastIndex = this.pos;
|
|
36106
36177
|
var skip = skipWhiteSpace.exec(this.input);
|
|
36107
36178
|
var next = this.pos + skip[0].length, after;
|
|
36108
|
-
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.
|
|
36179
|
+
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92));
|
|
36180
|
+
};
|
|
36181
|
+
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
36182
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) return false;
|
|
36183
|
+
skipWhiteSpace.lastIndex = this.pos;
|
|
36184
|
+
var skip = skipWhiteSpace.exec(this.input);
|
|
36185
|
+
var next = this.pos + skip[0].length;
|
|
36186
|
+
if (lineBreak.test(this.input.slice(this.pos, next))) return false;
|
|
36187
|
+
if (isAwaitUsing) {
|
|
36188
|
+
var usingEndPos = next + 5, after;
|
|
36189
|
+
if (this.input.slice(next, usingEndPos) !== "using" || usingEndPos === this.input.length || isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) || after === 92) return false;
|
|
36190
|
+
skipWhiteSpace.lastIndex = usingEndPos;
|
|
36191
|
+
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
36192
|
+
next = usingEndPos + skipAfterUsing[0].length;
|
|
36193
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) return false;
|
|
36194
|
+
}
|
|
36195
|
+
var ch = this.fullCharCodeAt(next);
|
|
36196
|
+
if (!isIdentifierStart(ch) && ch !== 92) return false;
|
|
36197
|
+
var idStart = next;
|
|
36198
|
+
do
|
|
36199
|
+
next += ch <= 65535 ? 1 : 2;
|
|
36200
|
+
while (isIdentifierChar(ch = this.fullCharCodeAt(next)));
|
|
36201
|
+
if (ch === 92) return true;
|
|
36202
|
+
var id = this.input.slice(idStart, next);
|
|
36203
|
+
if (keywordRelationalOperator.test(id) || isFor && id === "of") return false;
|
|
36204
|
+
return true;
|
|
36205
|
+
};
|
|
36206
|
+
pp$8.isAwaitUsing = function(isFor) {
|
|
36207
|
+
return this.isUsingKeyword(true, isFor);
|
|
36208
|
+
};
|
|
36209
|
+
pp$8.isUsing = function(isFor) {
|
|
36210
|
+
return this.isUsingKeyword(false, isFor);
|
|
36109
36211
|
};
|
|
36110
36212
|
pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
36111
36213
|
var starttype = this.type, node = this.startNode(), kind;
|
|
@@ -36158,6 +36260,18 @@ pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
|
36158
36260
|
this.next();
|
|
36159
36261
|
return this.parseFunctionStatement(node, true, !context);
|
|
36160
36262
|
}
|
|
36263
|
+
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
36264
|
+
if (usingKind) {
|
|
36265
|
+
if (!this.allowUsing) this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
36266
|
+
if (usingKind === "await using") {
|
|
36267
|
+
if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
|
|
36268
|
+
this.next();
|
|
36269
|
+
}
|
|
36270
|
+
this.next();
|
|
36271
|
+
this.parseVar(node, false, usingKind);
|
|
36272
|
+
this.semicolon();
|
|
36273
|
+
return this.finishNode(node, "VariableDeclaration");
|
|
36274
|
+
}
|
|
36161
36275
|
var maybeName = this.value, expr = this.parseExpression();
|
|
36162
36276
|
if (starttype === types$1$1.name && expr.type === "Identifier" && this.eat(types$1$1.colon)) return this.parseLabeledStatement(node, maybeName, expr, context);
|
|
36163
36277
|
else return this.parseExpressionStatement(node, expr);
|
|
@@ -36215,16 +36329,21 @@ pp$8.parseForStatement = function(node) {
|
|
|
36215
36329
|
this.next();
|
|
36216
36330
|
this.parseVar(init$1, true, kind);
|
|
36217
36331
|
this.finishNode(init$1, "VariableDeclaration");
|
|
36218
|
-
|
|
36219
|
-
if (this.options.ecmaVersion >= 9) if (this.type === types$1$1._in) {
|
|
36220
|
-
if (awaitAt > -1) this.unexpected(awaitAt);
|
|
36221
|
-
} else node.await = awaitAt > -1;
|
|
36222
|
-
return this.parseForIn(node, init$1);
|
|
36223
|
-
}
|
|
36224
|
-
if (awaitAt > -1) this.unexpected(awaitAt);
|
|
36225
|
-
return this.parseFor(node, init$1);
|
|
36332
|
+
return this.parseForAfterInit(node, init$1, awaitAt);
|
|
36226
36333
|
}
|
|
36227
36334
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
36335
|
+
var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
36336
|
+
if (usingKind) {
|
|
36337
|
+
var init$2 = this.startNode();
|
|
36338
|
+
this.next();
|
|
36339
|
+
if (usingKind === "await using") {
|
|
36340
|
+
if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
|
|
36341
|
+
this.next();
|
|
36342
|
+
}
|
|
36343
|
+
this.parseVar(init$2, true, usingKind);
|
|
36344
|
+
this.finishNode(init$2, "VariableDeclaration");
|
|
36345
|
+
return this.parseForAfterInit(node, init$2, awaitAt);
|
|
36346
|
+
}
|
|
36228
36347
|
var containsEsc = this.containsEsc;
|
|
36229
36348
|
var refDestructuringErrors = new DestructuringErrors();
|
|
36230
36349
|
var initPos = this.start;
|
|
@@ -36245,6 +36364,16 @@ pp$8.parseForStatement = function(node) {
|
|
|
36245
36364
|
if (awaitAt > -1) this.unexpected(awaitAt);
|
|
36246
36365
|
return this.parseFor(node, init);
|
|
36247
36366
|
};
|
|
36367
|
+
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
36368
|
+
if ((this.type === types$1$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
|
|
36369
|
+
if (this.options.ecmaVersion >= 9) if (this.type === types$1$1._in) {
|
|
36370
|
+
if (awaitAt > -1) this.unexpected(awaitAt);
|
|
36371
|
+
} else node.await = awaitAt > -1;
|
|
36372
|
+
return this.parseForIn(node, init);
|
|
36373
|
+
}
|
|
36374
|
+
if (awaitAt > -1) this.unexpected(awaitAt);
|
|
36375
|
+
return this.parseFor(node, init);
|
|
36376
|
+
};
|
|
36248
36377
|
pp$8.parseFunctionStatement = function(node, isAsync$2, declarationPosition) {
|
|
36249
36378
|
this.next();
|
|
36250
36379
|
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync$2);
|
|
@@ -36257,7 +36386,7 @@ pp$8.parseIfStatement = function(node) {
|
|
|
36257
36386
|
return this.finishNode(node, "IfStatement");
|
|
36258
36387
|
};
|
|
36259
36388
|
pp$8.parseReturnStatement = function(node) {
|
|
36260
|
-
if (!this.
|
|
36389
|
+
if (!this.allowReturn) this.raise(this.start, "'return' outside of function");
|
|
36261
36390
|
this.next();
|
|
36262
36391
|
if (this.eat(types$1$1.semi) || this.insertSemicolon()) node.argument = null;
|
|
36263
36392
|
else {
|
|
@@ -36272,7 +36401,7 @@ pp$8.parseSwitchStatement = function(node) {
|
|
|
36272
36401
|
node.cases = [];
|
|
36273
36402
|
this.expect(types$1$1.braceL);
|
|
36274
36403
|
this.labels.push(switchLabel);
|
|
36275
|
-
this.enterScope(
|
|
36404
|
+
this.enterScope(SCOPE_SWITCH);
|
|
36276
36405
|
var cur;
|
|
36277
36406
|
for (var sawDefault = false; this.type !== types$1$1.braceR;) if (this.type === types$1$1._case || this.type === types$1$1._default) {
|
|
36278
36407
|
var isCase = this.type === types$1$1._case;
|
|
@@ -36431,6 +36560,7 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
36431
36560
|
this.parseVarId(decl, kind);
|
|
36432
36561
|
if (this.eat(types$1$1.eq)) decl.init = this.parseMaybeAssign(isFor);
|
|
36433
36562
|
else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) this.unexpected();
|
|
36563
|
+
else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1$1._in && !this.isContextual("of")) this.raise(this.lastTokEnd, "Missing initializer in " + kind + " declaration");
|
|
36434
36564
|
else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1$1._in || this.isContextual("of")))) this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
36435
36565
|
else decl.init = null;
|
|
36436
36566
|
node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
|
|
@@ -36439,7 +36569,7 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
36439
36569
|
return node;
|
|
36440
36570
|
};
|
|
36441
36571
|
pp$8.parseVarId = function(decl, kind) {
|
|
36442
|
-
decl.id = this.parseBindingAtom();
|
|
36572
|
+
decl.id = kind === "using" || kind === "await using" ? this.parseIdent() : this.parseBindingAtom();
|
|
36443
36573
|
this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
|
|
36444
36574
|
};
|
|
36445
36575
|
var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
|
|
@@ -36566,11 +36696,9 @@ pp$8.parseClassField = function(field) {
|
|
|
36566
36696
|
if (checkKeyName(field, "constructor")) this.raise(field.key.start, "Classes can't have a field named 'constructor'");
|
|
36567
36697
|
else if (field.static && checkKeyName(field, "prototype")) this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
|
|
36568
36698
|
if (this.eat(types$1$1.eq)) {
|
|
36569
|
-
|
|
36570
|
-
var inClassFieldInit = scope.inClassFieldInit;
|
|
36571
|
-
scope.inClassFieldInit = true;
|
|
36699
|
+
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
|
|
36572
36700
|
field.value = this.parseMaybeAssign();
|
|
36573
|
-
|
|
36701
|
+
this.exitScope();
|
|
36574
36702
|
} else field.value = null;
|
|
36575
36703
|
this.semicolon();
|
|
36576
36704
|
return this.finishNode(field, "PropertyDefinition");
|
|
@@ -36666,6 +36794,7 @@ pp$8.parseExport = function(node, exports$1) {
|
|
|
36666
36794
|
else this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
|
|
36667
36795
|
node.specifiers = [];
|
|
36668
36796
|
node.source = null;
|
|
36797
|
+
if (this.options.ecmaVersion >= 16) node.attributes = [];
|
|
36669
36798
|
} else {
|
|
36670
36799
|
node.declaration = null;
|
|
36671
36800
|
node.specifiers = this.parseExportSpecifiers(exports$1);
|
|
@@ -36681,6 +36810,7 @@ pp$8.parseExport = function(node, exports$1) {
|
|
|
36681
36810
|
if (spec.local.type === "Literal") this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
36682
36811
|
}
|
|
36683
36812
|
node.source = null;
|
|
36813
|
+
if (this.options.ecmaVersion >= 16) node.attributes = [];
|
|
36684
36814
|
}
|
|
36685
36815
|
this.semicolon();
|
|
36686
36816
|
}
|
|
@@ -37528,7 +37658,7 @@ pp$5.parseLiteral = function(value) {
|
|
|
37528
37658
|
var node = this.startNode();
|
|
37529
37659
|
node.value = value;
|
|
37530
37660
|
node.raw = this.input.slice(this.start, this.end);
|
|
37531
|
-
if (node.raw.charCodeAt(node.raw.length - 1) === 110) node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
|
|
37661
|
+
if (node.raw.charCodeAt(node.raw.length - 1) === 110) node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, "");
|
|
37532
37662
|
this.next();
|
|
37533
37663
|
return this.finishNode(node, "Literal");
|
|
37534
37664
|
};
|
|
@@ -37703,9 +37833,10 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
|
|
|
37703
37833
|
return this.finishNode(prop, "Property");
|
|
37704
37834
|
};
|
|
37705
37835
|
pp$5.parseGetterSetter = function(prop) {
|
|
37706
|
-
|
|
37836
|
+
var kind = prop.key.name;
|
|
37707
37837
|
this.parsePropertyName(prop);
|
|
37708
37838
|
prop.value = this.parseMethod(false);
|
|
37839
|
+
prop.kind = kind;
|
|
37709
37840
|
var paramCount = prop.kind === "get" ? 0 : 1;
|
|
37710
37841
|
if (prop.value.params.length !== paramCount) {
|
|
37711
37842
|
var start = prop.value.start;
|
|
@@ -37720,9 +37851,9 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync$2, star
|
|
|
37720
37851
|
prop.kind = "init";
|
|
37721
37852
|
} else if (this.options.ecmaVersion >= 6 && this.type === types$1$1.parenL) {
|
|
37722
37853
|
if (isPattern) this.unexpected();
|
|
37723
|
-
prop.kind = "init";
|
|
37724
37854
|
prop.method = true;
|
|
37725
37855
|
prop.value = this.parseMethod(isGenerator, isAsync$2);
|
|
37856
|
+
prop.kind = "init";
|
|
37726
37857
|
} else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && this.type !== types$1$1.comma && this.type !== types$1$1.braceR && this.type !== types$1$1.eq) {
|
|
37727
37858
|
if (isGenerator || isAsync$2) this.unexpected();
|
|
37728
37859
|
this.parseGetterSetter(prop);
|
|
@@ -37730,12 +37861,12 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync$2, star
|
|
|
37730
37861
|
if (isGenerator || isAsync$2) this.unexpected();
|
|
37731
37862
|
this.checkUnreserved(prop.key);
|
|
37732
37863
|
if (prop.key.name === "await" && !this.awaitIdentPos) this.awaitIdentPos = startPos;
|
|
37733
|
-
prop.kind = "init";
|
|
37734
37864
|
if (isPattern) prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
|
|
37735
37865
|
else if (this.type === types$1$1.eq && refDestructuringErrors) {
|
|
37736
37866
|
if (refDestructuringErrors.shorthandAssign < 0) refDestructuringErrors.shorthandAssign = this.start;
|
|
37737
37867
|
prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
|
|
37738
37868
|
} else prop.value = this.copyNode(prop.key);
|
|
37869
|
+
prop.kind = "init";
|
|
37739
37870
|
prop.shorthand = true;
|
|
37740
37871
|
} else this.unexpected();
|
|
37741
37872
|
};
|
|
@@ -37845,7 +37976,7 @@ pp$5.checkUnreserved = function(ref$1) {
|
|
|
37845
37976
|
var name = ref$1.name;
|
|
37846
37977
|
if (this.inGenerator && name === "yield") this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator");
|
|
37847
37978
|
if (this.inAsync && name === "await") this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function");
|
|
37848
|
-
if (this.currentThisScope().
|
|
37979
|
+
if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments") this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer");
|
|
37849
37980
|
if (this.inClassStaticBlock && (name === "arguments" || name === "await")) this.raise(start, "Cannot use " + name + " in class static initialization block");
|
|
37850
37981
|
if (this.keywords.test(name)) this.raise(start, "Unexpected keyword '" + name + "'");
|
|
37851
37982
|
if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) return;
|
|
@@ -37908,6 +38039,7 @@ var pp$4 = Parser.prototype;
|
|
|
37908
38039
|
pp$4.raise = function(pos, message) {
|
|
37909
38040
|
var loc = getLineInfo(this.input, pos);
|
|
37910
38041
|
message += " (" + loc.line + ":" + loc.column + ")";
|
|
38042
|
+
if (this.sourceFile) message += " in " + this.sourceFile;
|
|
37911
38043
|
var err = new SyntaxError(message);
|
|
37912
38044
|
err.pos = pos;
|
|
37913
38045
|
err.loc = loc;
|
|
@@ -37924,7 +38056,6 @@ var Scope = function Scope$1(flags) {
|
|
|
37924
38056
|
this.var = [];
|
|
37925
38057
|
this.lexical = [];
|
|
37926
38058
|
this.functions = [];
|
|
37927
|
-
this.inClassFieldInit = false;
|
|
37928
38059
|
};
|
|
37929
38060
|
pp$3.enterScope = function(flags) {
|
|
37930
38061
|
this.scopeStack.push(new Scope(flags));
|
|
@@ -37969,13 +38100,13 @@ pp$3.currentScope = function() {
|
|
|
37969
38100
|
pp$3.currentVarScope = function() {
|
|
37970
38101
|
for (var i$1 = this.scopeStack.length - 1;; i$1--) {
|
|
37971
38102
|
var scope = this.scopeStack[i$1];
|
|
37972
|
-
if (scope.flags & SCOPE_VAR) return scope;
|
|
38103
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) return scope;
|
|
37973
38104
|
}
|
|
37974
38105
|
};
|
|
37975
38106
|
pp$3.currentThisScope = function() {
|
|
37976
38107
|
for (var i$1 = this.scopeStack.length - 1;; i$1--) {
|
|
37977
38108
|
var scope = this.scopeStack[i$1];
|
|
37978
|
-
if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) return scope;
|
|
38109
|
+
if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && !(scope.flags & SCOPE_ARROW)) return scope;
|
|
37979
38110
|
}
|
|
37980
38111
|
};
|
|
37981
38112
|
var Node = function Node$1(parser, pos, loc) {
|
|
@@ -38011,7 +38142,7 @@ pp$2.copyNode = function(node) {
|
|
|
38011
38142
|
for (var prop in node) newNode[prop] = node[prop];
|
|
38012
38143
|
return newNode;
|
|
38013
38144
|
};
|
|
38014
|
-
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
|
|
38145
|
+
var scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";
|
|
38015
38146
|
var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
|
|
38016
38147
|
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
|
|
38017
38148
|
var ecma11BinaryProperties = ecma10BinaryProperties;
|
|
@@ -39017,12 +39148,15 @@ pp.readToken = function(code) {
|
|
|
39017
39148
|
if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) return this.readWord();
|
|
39018
39149
|
return this.getTokenFromCode(code);
|
|
39019
39150
|
};
|
|
39020
|
-
pp.
|
|
39021
|
-
var code = this.input.charCodeAt(
|
|
39151
|
+
pp.fullCharCodeAt = function(pos) {
|
|
39152
|
+
var code = this.input.charCodeAt(pos);
|
|
39022
39153
|
if (code <= 55295 || code >= 56320) return code;
|
|
39023
|
-
var next = this.input.charCodeAt(
|
|
39154
|
+
var next = this.input.charCodeAt(pos + 1);
|
|
39024
39155
|
return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888;
|
|
39025
39156
|
};
|
|
39157
|
+
pp.fullCharCodeAtPos = function() {
|
|
39158
|
+
return this.fullCharCodeAt(this.pos);
|
|
39159
|
+
};
|
|
39026
39160
|
pp.skipBlockComment = function() {
|
|
39027
39161
|
var startLoc = this.options.onComment && this.curPosition();
|
|
39028
39162
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -39566,7 +39700,7 @@ pp.readWord = function() {
|
|
|
39566
39700
|
if (this.keywords.test(word)) type = keywords[word];
|
|
39567
39701
|
return this.finishToken(type, word);
|
|
39568
39702
|
};
|
|
39569
|
-
var version$1 = "8.
|
|
39703
|
+
var version$1 = "8.16.0";
|
|
39570
39704
|
Parser.acorn = {
|
|
39571
39705
|
Parser,
|
|
39572
39706
|
version: version$1,
|
|
@@ -39601,15 +39735,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
39601
39735
|
function withTrailingSlash$1(input = "", respectQueryAndFragment) {
|
|
39602
39736
|
if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
|
|
39603
39737
|
if (hasTrailingSlash(input, true)) return input || "/";
|
|
39604
|
-
let path$
|
|
39738
|
+
let path$2 = input;
|
|
39605
39739
|
let fragment = "";
|
|
39606
39740
|
const fragmentIndex = input.indexOf("#");
|
|
39607
39741
|
if (fragmentIndex >= 0) {
|
|
39608
|
-
path$
|
|
39742
|
+
path$2 = input.slice(0, fragmentIndex);
|
|
39609
39743
|
fragment = input.slice(fragmentIndex);
|
|
39610
|
-
if (!path$
|
|
39744
|
+
if (!path$2) return fragment;
|
|
39611
39745
|
}
|
|
39612
|
-
const [s0, ...s] = path$
|
|
39746
|
+
const [s0, ...s] = path$2.split("?");
|
|
39613
39747
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
39614
39748
|
}
|
|
39615
39749
|
function isNonEmptyURL(url) {
|
|
@@ -39635,8 +39769,8 @@ const isAbsolute$1 = function(p$1) {
|
|
|
39635
39769
|
//#endregion
|
|
39636
39770
|
//#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
39637
39771
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
39638
|
-
function normalizeSlash(path$
|
|
39639
|
-
return path$
|
|
39772
|
+
function normalizeSlash(path$2) {
|
|
39773
|
+
return path$2.replace(/\\/g, "/");
|
|
39640
39774
|
}
|
|
39641
39775
|
/**
|
|
39642
39776
|
* @typedef ErrnoExceptionFields
|
|
@@ -39756,8 +39890,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
39756
39890
|
* @param {string} [base]
|
|
39757
39891
|
* @param {string} [message]
|
|
39758
39892
|
*/
|
|
39759
|
-
(path$
|
|
39760
|
-
return `Invalid package config ${path$
|
|
39893
|
+
(path$2, base, message) => {
|
|
39894
|
+
return `Invalid package config ${path$2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
39761
39895
|
},
|
|
39762
39896
|
Error
|
|
39763
39897
|
);
|
|
@@ -39787,8 +39921,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
39787
39921
|
* @param {string} base
|
|
39788
39922
|
* @param {boolean} [exactUrl]
|
|
39789
39923
|
*/
|
|
39790
|
-
(path$
|
|
39791
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path$
|
|
39924
|
+
(path$2, base, exactUrl = false) => {
|
|
39925
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path$2}' imported from ${base}`;
|
|
39792
39926
|
},
|
|
39793
39927
|
Error
|
|
39794
39928
|
);
|
|
@@ -39826,8 +39960,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
39826
39960
|
* @param {string} extension
|
|
39827
39961
|
* @param {string} path
|
|
39828
39962
|
*/
|
|
39829
|
-
(extension, path$
|
|
39830
|
-
return `Unknown file extension "${extension}" for ${path$
|
|
39963
|
+
(extension, path$2) => {
|
|
39964
|
+
return `Unknown file extension "${extension}" for ${path$2}`;
|
|
39831
39965
|
},
|
|
39832
39966
|
TypeError
|
|
39833
39967
|
);
|
|
@@ -39984,7 +40118,7 @@ function read(jsonPath, { base, specifier }) {
|
|
|
39984
40118
|
/** @type {string | undefined} */
|
|
39985
40119
|
let string;
|
|
39986
40120
|
try {
|
|
39987
|
-
string = fs.readFileSync(
|
|
40121
|
+
string = fs.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
|
39988
40122
|
} catch (error) {
|
|
39989
40123
|
const exception = error;
|
|
39990
40124
|
if (exception.code !== "ENOENT") throw exception;
|
|
@@ -40190,15 +40324,15 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
40190
40324
|
const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
|
|
40191
40325
|
const basePath = fileURLToPath(base);
|
|
40192
40326
|
if (!main) process$1.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
40193
|
-
else if (
|
|
40327
|
+
else if (path.resolve(packagePath, main) !== urlPath) process$1.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
40194
40328
|
}
|
|
40195
40329
|
/**
|
|
40196
40330
|
* @param {string} path
|
|
40197
40331
|
* @returns {Stats | undefined}
|
|
40198
40332
|
*/
|
|
40199
|
-
function tryStatSync(path$
|
|
40333
|
+
function tryStatSync(path$2) {
|
|
40200
40334
|
try {
|
|
40201
|
-
return statSync(path$
|
|
40335
|
+
return statSync(path$2);
|
|
40202
40336
|
} catch {}
|
|
40203
40337
|
}
|
|
40204
40338
|
/**
|
|
@@ -40297,7 +40431,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
40297
40431
|
{
|
|
40298
40432
|
const real = realpathSync(filePath);
|
|
40299
40433
|
const { search, hash } = resolved;
|
|
40300
|
-
resolved = pathToFileURL(real + (filePath.endsWith(
|
|
40434
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
|
|
40301
40435
|
resolved.search = search;
|
|
40302
40436
|
resolved.hash = hash;
|
|
40303
40437
|
}
|
|
@@ -42677,9 +42811,9 @@ function constructHeaders({ headers, headersFile, logger }) {
|
|
|
42677
42811
|
|
|
42678
42812
|
//#endregion
|
|
42679
42813
|
//#region ../workers-shared/utils/configuration/validateURL.ts
|
|
42680
|
-
const extractPathname = (path$
|
|
42681
|
-
if (!path$
|
|
42682
|
-
const url = new URL(`//${path$
|
|
42814
|
+
const extractPathname = (path$2 = "/", includeSearch, includeHash) => {
|
|
42815
|
+
if (!path$2.startsWith("/")) path$2 = `/${path$2}`;
|
|
42816
|
+
const url = new URL(`//${path$2}`, "relative://");
|
|
42683
42817
|
return `${url.pathname}${includeSearch ? url.search : ""}${includeHash ? url.hash : ""}`;
|
|
42684
42818
|
};
|
|
42685
42819
|
const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
|
|
@@ -42738,7 +42872,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
42738
42872
|
lineNumber: i$1 + 1,
|
|
42739
42873
|
message: "No headers specified"
|
|
42740
42874
|
});
|
|
42741
|
-
const [path$
|
|
42875
|
+
const [path$2, pathError] = validateUrl(line, false, true);
|
|
42742
42876
|
if (pathError) {
|
|
42743
42877
|
invalid.push({
|
|
42744
42878
|
line,
|
|
@@ -42749,7 +42883,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
42749
42883
|
skipUntilNextPath = true;
|
|
42750
42884
|
continue;
|
|
42751
42885
|
}
|
|
42752
|
-
const wildcardError = validateNoMultipleWildcards(path$
|
|
42886
|
+
const wildcardError = validateNoMultipleWildcards(path$2);
|
|
42753
42887
|
if (wildcardError) {
|
|
42754
42888
|
invalid.push({
|
|
42755
42889
|
line,
|
|
@@ -42761,7 +42895,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
42761
42895
|
continue;
|
|
42762
42896
|
}
|
|
42763
42897
|
rule = {
|
|
42764
|
-
path: path$
|
|
42898
|
+
path: path$2,
|
|
42765
42899
|
line,
|
|
42766
42900
|
headers: {},
|
|
42767
42901
|
unsetHeaders: []
|
|
@@ -42844,11 +42978,11 @@ function isValidRule(rule) {
|
|
|
42844
42978
|
* `:splat` placeholder, would result in duplicate `:splat` parameters which is
|
|
42845
42979
|
* unsupported.
|
|
42846
42980
|
*/
|
|
42847
|
-
function validateNoMultipleWildcards(path$
|
|
42848
|
-
const wildcardCount = (path$
|
|
42849
|
-
const hasSplatPlaceholder = /:splat(?!\w)/.test(path$
|
|
42850
|
-
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$
|
|
42851
|
-
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$
|
|
42981
|
+
function validateNoMultipleWildcards(path$2) {
|
|
42982
|
+
const wildcardCount = (path$2.match(SPLAT_REGEX) ?? []).length;
|
|
42983
|
+
const hasSplatPlaceholder = /:splat(?!\w)/.test(path$2);
|
|
42984
|
+
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$2}.`;
|
|
42985
|
+
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$2}.`;
|
|
42852
42986
|
}
|
|
42853
42987
|
|
|
42854
42988
|
//#endregion
|
|
@@ -43065,13 +43199,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43065
43199
|
const throwError = (message, Ctor) => {
|
|
43066
43200
|
throw new Ctor(message);
|
|
43067
43201
|
};
|
|
43068
|
-
const checkPath = (path$
|
|
43069
|
-
if (!isString$1(path$
|
|
43070
|
-
if (!path$
|
|
43071
|
-
if (checkPath.isNotRelative(path$
|
|
43202
|
+
const checkPath = (path$2, originalPath, doThrow) => {
|
|
43203
|
+
if (!isString$1(path$2)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
43204
|
+
if (!path$2) return doThrow(`path must not be empty`, TypeError);
|
|
43205
|
+
if (checkPath.isNotRelative(path$2)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
|
|
43072
43206
|
return true;
|
|
43073
43207
|
};
|
|
43074
|
-
const isNotRelative = (path$
|
|
43208
|
+
const isNotRelative = (path$2) => REGEX_TEST_INVALID_PATH.test(path$2);
|
|
43075
43209
|
checkPath.isNotRelative = isNotRelative;
|
|
43076
43210
|
checkPath.convert = (p$1) => p$1;
|
|
43077
43211
|
var Ignore = class {
|
|
@@ -43107,13 +43241,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43107
43241
|
addPattern(pattern) {
|
|
43108
43242
|
return this.add(pattern);
|
|
43109
43243
|
}
|
|
43110
|
-
_testOne(path$
|
|
43244
|
+
_testOne(path$2, checkUnignored) {
|
|
43111
43245
|
let ignored = false;
|
|
43112
43246
|
let unignored = false;
|
|
43113
43247
|
this._rules.forEach((rule) => {
|
|
43114
43248
|
const { negative } = rule;
|
|
43115
43249
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
|
|
43116
|
-
if (rule.regex.test(path$
|
|
43250
|
+
if (rule.regex.test(path$2)) {
|
|
43117
43251
|
ignored = !negative;
|
|
43118
43252
|
unignored = negative;
|
|
43119
43253
|
}
|
|
@@ -43124,33 +43258,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43124
43258
|
};
|
|
43125
43259
|
}
|
|
43126
43260
|
_test(originalPath, cache$2, checkUnignored, slices) {
|
|
43127
|
-
const path$
|
|
43128
|
-
checkPath(path$
|
|
43129
|
-
return this._t(path$
|
|
43261
|
+
const path$2 = originalPath && checkPath.convert(originalPath);
|
|
43262
|
+
checkPath(path$2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
43263
|
+
return this._t(path$2, cache$2, checkUnignored, slices);
|
|
43130
43264
|
}
|
|
43131
|
-
_t(path$
|
|
43132
|
-
if (path$
|
|
43133
|
-
if (!slices) slices = path$
|
|
43265
|
+
_t(path$2, cache$2, checkUnignored, slices) {
|
|
43266
|
+
if (path$2 in cache$2) return cache$2[path$2];
|
|
43267
|
+
if (!slices) slices = path$2.split(SLASH);
|
|
43134
43268
|
slices.pop();
|
|
43135
|
-
if (!slices.length) return cache$2[path$
|
|
43269
|
+
if (!slices.length) return cache$2[path$2] = this._testOne(path$2, checkUnignored);
|
|
43136
43270
|
const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
|
|
43137
|
-
return cache$2[path$
|
|
43271
|
+
return cache$2[path$2] = parent.ignored ? parent : this._testOne(path$2, checkUnignored);
|
|
43138
43272
|
}
|
|
43139
|
-
ignores(path$
|
|
43140
|
-
return this._test(path$
|
|
43273
|
+
ignores(path$2) {
|
|
43274
|
+
return this._test(path$2, this._ignoreCache, false).ignored;
|
|
43141
43275
|
}
|
|
43142
43276
|
createFilter() {
|
|
43143
|
-
return (path$
|
|
43277
|
+
return (path$2) => !this.ignores(path$2);
|
|
43144
43278
|
}
|
|
43145
43279
|
filter(paths) {
|
|
43146
43280
|
return makeArray(paths).filter(this.createFilter());
|
|
43147
43281
|
}
|
|
43148
|
-
test(path$
|
|
43149
|
-
return this._test(path$
|
|
43282
|
+
test(path$2) {
|
|
43283
|
+
return this._test(path$2, this._testCache, true);
|
|
43150
43284
|
}
|
|
43151
43285
|
};
|
|
43152
43286
|
const factory = (options) => new Ignore(options);
|
|
43153
|
-
const isPathValid = (path$
|
|
43287
|
+
const isPathValid = (path$2) => checkPath(path$2 && checkPath.convert(path$2), path$2, RETURN_FALSE);
|
|
43154
43288
|
factory.isPathValid = isPathValid;
|
|
43155
43289
|
factory.default = factory;
|
|
43156
43290
|
module.exports = factory;
|
|
@@ -43159,7 +43293,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43159
43293
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
43160
43294
|
checkPath.convert = makePosix;
|
|
43161
43295
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
43162
|
-
checkPath.isNotRelative = (path$
|
|
43296
|
+
checkPath.isNotRelative = (path$2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$2) || isNotRelative(path$2);
|
|
43163
43297
|
}
|
|
43164
43298
|
}) });
|
|
43165
43299
|
|
|
@@ -44514,11 +44648,11 @@ var Mime = class {
|
|
|
44514
44648
|
}
|
|
44515
44649
|
return this;
|
|
44516
44650
|
}
|
|
44517
|
-
getType(path$
|
|
44518
|
-
if (typeof path$
|
|
44519
|
-
const last = path$
|
|
44651
|
+
getType(path$2) {
|
|
44652
|
+
if (typeof path$2 !== "string") return null;
|
|
44653
|
+
const last = path$2.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
44520
44654
|
const ext = last.replace(/^.*\./s, "").toLowerCase();
|
|
44521
|
-
const hasPath = last.length < path$
|
|
44655
|
+
const hasPath = last.length < path$2.length;
|
|
44522
44656
|
if (!(ext.length < last.length - 1) && hasPath) return null;
|
|
44523
44657
|
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
|
|
44524
44658
|
}
|
|
@@ -44852,8 +44986,8 @@ function getErrorMap() {
|
|
|
44852
44986
|
//#endregion
|
|
44853
44987
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
44854
44988
|
const makeIssue = (params) => {
|
|
44855
|
-
const { data: data$1, path: path$
|
|
44856
|
-
const fullPath = [...path$
|
|
44989
|
+
const { data: data$1, path: path$2, errorMaps, issueData } = params;
|
|
44990
|
+
const fullPath = [...path$2, ...issueData.path || []];
|
|
44857
44991
|
const fullIssue = {
|
|
44858
44992
|
...issueData,
|
|
44859
44993
|
path: fullPath
|
|
@@ -44965,11 +45099,11 @@ var errorUtil;
|
|
|
44965
45099
|
//#endregion
|
|
44966
45100
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
44967
45101
|
var ParseInputLazyPath = class {
|
|
44968
|
-
constructor(parent, value, path$
|
|
45102
|
+
constructor(parent, value, path$2, key) {
|
|
44969
45103
|
this._cachedPath = [];
|
|
44970
45104
|
this.parent = parent;
|
|
44971
45105
|
this.data = value;
|
|
44972
|
-
this._path = path$
|
|
45106
|
+
this._path = path$2;
|
|
44973
45107
|
this._key = key;
|
|
44974
45108
|
}
|
|
44975
45109
|
get path() {
|
|
@@ -49001,11 +49135,11 @@ const getQueryString = (params) => {
|
|
|
49001
49135
|
};
|
|
49002
49136
|
const getUrl = (config, options) => {
|
|
49003
49137
|
const encoder$1 = config.ENCODE_PATH || encodeURI;
|
|
49004
|
-
const path$
|
|
49138
|
+
const path$2 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
49005
49139
|
if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
|
|
49006
49140
|
return substring;
|
|
49007
49141
|
});
|
|
49008
|
-
const url = `${config.BASE}${path$
|
|
49142
|
+
const url = `${config.BASE}${path$2}`;
|
|
49009
49143
|
if (options.query) return `${url}${getQueryString(options.query)}`;
|
|
49010
49144
|
return url;
|
|
49011
49145
|
};
|
|
@@ -49772,12 +49906,39 @@ const isDockerRunning = async (dockerPath) => {
|
|
|
49772
49906
|
}
|
|
49773
49907
|
return true;
|
|
49774
49908
|
};
|
|
49775
|
-
/**
|
|
49776
|
-
|
|
49777
|
-
|
|
49778
|
-
|
|
49909
|
+
/**
|
|
49910
|
+
* Verifies that Docker is installed and the daemon is running.
|
|
49911
|
+
*
|
|
49912
|
+
* @throws {UserError} If the Docker CLI cannot be reached.
|
|
49913
|
+
*
|
|
49914
|
+
* @param options - Docker verification options.
|
|
49915
|
+
*/
|
|
49916
|
+
const verifyDockerInstalled = async ({ dockerPath, numberOfContainers, isDev = true, isDryRun = false }) => {
|
|
49917
|
+
if (!await isDockerRunning(dockerPath)) throw new UserError(getFailedToRunDockerErrorMessage({
|
|
49918
|
+
numberOfContainers,
|
|
49919
|
+
isDev,
|
|
49920
|
+
isDryRun
|
|
49921
|
+
}), { telemetryMessage: false });
|
|
49779
49922
|
};
|
|
49780
49923
|
/**
|
|
49924
|
+
* Builds the user-facing error message shown when Docker cannot be reached.
|
|
49925
|
+
*
|
|
49926
|
+
* @param options - Docker verification options.
|
|
49927
|
+
*
|
|
49928
|
+
* @returns The formatted error message string.
|
|
49929
|
+
*/
|
|
49930
|
+
function getFailedToRunDockerErrorMessage({ numberOfContainers, isDev, isDryRun }) {
|
|
49931
|
+
const headline = `The Docker CLI is needed to build the configured ${numberOfContainers !== 1 ? "images" : "image"} before ${isDev ? "running dev" : `deploying${isDryRun ? " (even in dry-run mode)" : ""}`} but could not be launched.`;
|
|
49932
|
+
let daemonHint;
|
|
49933
|
+
if (process.platform === "darwin") daemonHint = "open the Docker Desktop app or run `open -a Docker`";
|
|
49934
|
+
else if (process.platform === "win32") daemonHint = "open the Docker Desktop app";
|
|
49935
|
+
else daemonHint = "run `sudo systemctl start docker`";
|
|
49936
|
+
return `${headline}\n${`To fix this, try the following:
|
|
49937
|
+
- If Docker is not installed, download it from https://docs.docker.com/get-started/get-docker/
|
|
49938
|
+
- If Docker is installed but the daemon is not running,\n ${daemonHint}.\n - If you use an alternative Docker-compatible CLI (e.g. Podman),
|
|
49939
|
+
set the WRANGLER_DOCKER_BIN environment variable to its path and DOCKER_HOST to its socket.`}\n\nNote: Other container tooling that is compatible with the Docker CLI and engine may work, but is not yet guaranteed to do so.\n\n${isDev ? "To suppress this error if you do not intend on triggering any container instances, set dev.enable_containers to false in your Wrangler config or pass --enable-containers=false." : "If you cannot run Docker locally, you can still deploy your Worker by passing --containers-rollout=none. This will not deploy or update your Container."}`;
|
|
49940
|
+
}
|
|
49941
|
+
/**
|
|
49781
49942
|
* Kills and removes any containers which come from the given image tag
|
|
49782
49943
|
*/
|
|
49783
49944
|
const cleanupContainers = (dockerPath, imageTags) => {
|
|
@@ -49947,7 +50108,10 @@ async function prepareContainerImagesForDev(args) {
|
|
|
49947
50108
|
const { dockerPath, containerOptions, onContainerImagePreparationStart, onContainerImagePreparationEnd } = args;
|
|
49948
50109
|
let aborted = false;
|
|
49949
50110
|
if (process.platform === "win32") throw new UserError("Local development with containers is currently not supported on Windows. You should use WSL instead. You can also set `enable_containers` to false if you do not need to develop the container part of your application.", { telemetryMessage: false });
|
|
49950
|
-
await verifyDockerInstalled(
|
|
50111
|
+
await verifyDockerInstalled({
|
|
50112
|
+
dockerPath,
|
|
50113
|
+
numberOfContainers: containerOptions.length
|
|
50114
|
+
});
|
|
49951
50115
|
for (const options of containerOptions) {
|
|
49952
50116
|
if ("dockerfile" in options) {
|
|
49953
50117
|
const build$8 = await buildImage(dockerPath, options);
|
|
@@ -50020,7 +50184,7 @@ function getContainerOptions(options) {
|
|
|
50020
50184
|
return containersConfig.map((container) => {
|
|
50021
50185
|
if (isDockerfile(container.image, configPath)) return {
|
|
50022
50186
|
dockerfile: container.image,
|
|
50023
|
-
image_build_context: container.image_build_context ??
|
|
50187
|
+
image_build_context: container.image_build_context ?? path.dirname(container.image),
|
|
50024
50188
|
image_vars: container.image_vars,
|
|
50025
50189
|
class_name: container.class_name,
|
|
50026
50190
|
image_tag: getDevContainerImageName(container.class_name, containerBuildId)
|
|
@@ -50036,26 +50200,26 @@ function getContainerOptions(options) {
|
|
|
50036
50200
|
//#endregion
|
|
50037
50201
|
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.3/node_modules/fdir/dist/index.mjs
|
|
50038
50202
|
var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
50039
|
-
function cleanPath(path$
|
|
50040
|
-
let normalized = normalize(path$
|
|
50203
|
+
function cleanPath(path$2) {
|
|
50204
|
+
let normalized = normalize(path$2);
|
|
50041
50205
|
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
50042
50206
|
return normalized;
|
|
50043
50207
|
}
|
|
50044
50208
|
const SLASHES_REGEX = /[\\/]/g;
|
|
50045
|
-
function convertSlashes(path$
|
|
50046
|
-
return path$
|
|
50209
|
+
function convertSlashes(path$2, separator) {
|
|
50210
|
+
return path$2.replace(SLASHES_REGEX, separator);
|
|
50047
50211
|
}
|
|
50048
50212
|
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
50049
|
-
function isRootDirectory(path$
|
|
50050
|
-
return path$
|
|
50213
|
+
function isRootDirectory(path$2) {
|
|
50214
|
+
return path$2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$2);
|
|
50051
50215
|
}
|
|
50052
|
-
function normalizePath$1(path$
|
|
50216
|
+
function normalizePath$1(path$2, options) {
|
|
50053
50217
|
const { resolvePaths, normalizePath: normalizePath$1$1, pathSeparator } = options;
|
|
50054
|
-
const pathNeedsCleaning = process.platform === "win32" && path$
|
|
50055
|
-
if (resolvePaths) path$
|
|
50056
|
-
if (normalizePath$1$1 || pathNeedsCleaning) path$
|
|
50057
|
-
if (path$
|
|
50058
|
-
return convertSlashes(path$
|
|
50218
|
+
const pathNeedsCleaning = process.platform === "win32" && path$2.includes("/") || path$2.startsWith(".");
|
|
50219
|
+
if (resolvePaths) path$2 = resolve$1(path$2);
|
|
50220
|
+
if (normalizePath$1$1 || pathNeedsCleaning) path$2 = cleanPath(path$2);
|
|
50221
|
+
if (path$2 === ".") return "";
|
|
50222
|
+
return convertSlashes(path$2[path$2.length - 1] !== pathSeparator ? path$2 + pathSeparator : path$2, pathSeparator);
|
|
50059
50223
|
}
|
|
50060
50224
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
50061
50225
|
return directoryPath + filename;
|
|
@@ -50091,8 +50255,8 @@ const pushDirectory = (directoryPath, paths) => {
|
|
|
50091
50255
|
paths.push(directoryPath || ".");
|
|
50092
50256
|
};
|
|
50093
50257
|
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
50094
|
-
const path$
|
|
50095
|
-
if (filters.every((filter) => filter(path$
|
|
50258
|
+
const path$2 = directoryPath || ".";
|
|
50259
|
+
if (filters.every((filter) => filter(path$2, true))) paths.push(path$2);
|
|
50096
50260
|
};
|
|
50097
50261
|
const empty$2 = () => {};
|
|
50098
50262
|
function build$6(root, options) {
|
|
@@ -50141,26 +50305,26 @@ const empty = () => {};
|
|
|
50141
50305
|
function build$3(options) {
|
|
50142
50306
|
return options.group ? groupFiles : empty;
|
|
50143
50307
|
}
|
|
50144
|
-
const resolveSymlinksAsync = function(path$
|
|
50308
|
+
const resolveSymlinksAsync = function(path$2, state, callback$1) {
|
|
50145
50309
|
const { queue, fs: fs$3, options: { suppressErrors } } = state;
|
|
50146
50310
|
queue.enqueue();
|
|
50147
|
-
fs$3.realpath(path$
|
|
50311
|
+
fs$3.realpath(path$2, (error, resolvedPath) => {
|
|
50148
50312
|
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
50149
50313
|
fs$3.stat(resolvedPath, (error$1, stat) => {
|
|
50150
50314
|
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
50151
|
-
if (stat.isDirectory() && isRecursive(path$
|
|
50315
|
+
if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
|
|
50152
50316
|
callback$1(stat, resolvedPath);
|
|
50153
50317
|
queue.dequeue(null, state);
|
|
50154
50318
|
});
|
|
50155
50319
|
});
|
|
50156
50320
|
};
|
|
50157
|
-
const resolveSymlinks = function(path$
|
|
50321
|
+
const resolveSymlinks = function(path$2, state, callback$1) {
|
|
50158
50322
|
const { queue, fs: fs$3, options: { suppressErrors } } = state;
|
|
50159
50323
|
queue.enqueue();
|
|
50160
50324
|
try {
|
|
50161
|
-
const resolvedPath = fs$3.realpathSync(path$
|
|
50325
|
+
const resolvedPath = fs$3.realpathSync(path$2);
|
|
50162
50326
|
const stat = fs$3.statSync(resolvedPath);
|
|
50163
|
-
if (stat.isDirectory() && isRecursive(path$
|
|
50327
|
+
if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
|
|
50164
50328
|
callback$1(stat, resolvedPath);
|
|
50165
50329
|
} catch (e) {
|
|
50166
50330
|
if (!suppressErrors) throw e;
|
|
@@ -50170,16 +50334,16 @@ function build$2(options, isSynchronous) {
|
|
|
50170
50334
|
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
50171
50335
|
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
50172
50336
|
}
|
|
50173
|
-
function isRecursive(path$
|
|
50337
|
+
function isRecursive(path$2, resolved, state) {
|
|
50174
50338
|
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
50175
|
-
let parent = dirname$1(path$
|
|
50339
|
+
let parent = dirname$1(path$2);
|
|
50176
50340
|
let depth$1 = 1;
|
|
50177
50341
|
while (parent !== state.root && depth$1 < 2) {
|
|
50178
50342
|
const resolvedPath = state.symlinks.get(parent);
|
|
50179
50343
|
if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
|
|
50180
50344
|
else parent = dirname$1(parent);
|
|
50181
50345
|
}
|
|
50182
|
-
state.symlinks.set(path$
|
|
50346
|
+
state.symlinks.set(path$2, resolved);
|
|
50183
50347
|
return depth$1 > 1;
|
|
50184
50348
|
}
|
|
50185
50349
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
@@ -50360,19 +50524,19 @@ var Walker = class {
|
|
|
50360
50524
|
const filename = this.joinPath(entry.name, directoryPath);
|
|
50361
50525
|
this.pushFile(filename, files, this.state.counts, filters);
|
|
50362
50526
|
} else if (entry.isDirectory()) {
|
|
50363
|
-
let path$
|
|
50364
|
-
if (exclude && exclude(entry.name, path$
|
|
50365
|
-
this.pushDirectory(path$
|
|
50366
|
-
this.walkDirectory(this.state, path$
|
|
50527
|
+
let path$2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
50528
|
+
if (exclude && exclude(entry.name, path$2)) continue;
|
|
50529
|
+
this.pushDirectory(path$2, paths, filters);
|
|
50530
|
+
this.walkDirectory(this.state, path$2, path$2, depth$1 - 1, this.walk);
|
|
50367
50531
|
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
50368
|
-
let path$
|
|
50369
|
-
this.resolveSymlink(path$
|
|
50532
|
+
let path$2 = joinPathWithBasePath(entry.name, directoryPath);
|
|
50533
|
+
this.resolveSymlink(path$2, this.state, (stat, resolvedPath) => {
|
|
50370
50534
|
if (stat.isDirectory()) {
|
|
50371
50535
|
resolvedPath = normalizePath$1(resolvedPath, this.state.options);
|
|
50372
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$
|
|
50373
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$
|
|
50536
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
|
|
50537
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth$1 - 1, this.walk);
|
|
50374
50538
|
} else {
|
|
50375
|
-
resolvedPath = useRealPaths ? resolvedPath : path$
|
|
50539
|
+
resolvedPath = useRealPaths ? resolvedPath : path$2;
|
|
50376
50540
|
const filename = basename(resolvedPath);
|
|
50377
50541
|
const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
|
|
50378
50542
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
@@ -50537,7 +50701,7 @@ var Builder = class {
|
|
|
50537
50701
|
isMatch = globFn(patterns, ...options);
|
|
50538
50702
|
this.globCache[patterns.join("\0")] = isMatch;
|
|
50539
50703
|
}
|
|
50540
|
-
this.options.filters.push((path$
|
|
50704
|
+
this.options.filters.push((path$2) => isMatch(path$2));
|
|
50541
50705
|
return this;
|
|
50542
50706
|
}
|
|
50543
50707
|
};
|
|
@@ -50748,8 +50912,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
50748
50912
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
50749
50913
|
return output;
|
|
50750
50914
|
};
|
|
50751
|
-
exports.basename = (path$
|
|
50752
|
-
const segs = path$
|
|
50915
|
+
exports.basename = (path$2, { windows } = {}) => {
|
|
50916
|
+
const segs = path$2.split(windows ? /[\\/]/ : "/");
|
|
50753
50917
|
const last = segs[segs.length - 1];
|
|
50754
50918
|
if (last === "") return segs[segs.length - 2];
|
|
50755
50919
|
return last;
|
|
@@ -52284,15 +52448,15 @@ function buildRelative(cwd, root) {
|
|
|
52284
52448
|
};
|
|
52285
52449
|
}
|
|
52286
52450
|
const splitPatternOptions = { parts: true };
|
|
52287
|
-
function splitPattern(path$1) {
|
|
52451
|
+
function splitPattern(path$1$1) {
|
|
52288
52452
|
var _result$parts;
|
|
52289
|
-
const result = import_picomatch.default.scan(path$1, splitPatternOptions);
|
|
52290
|
-
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
52453
|
+
const result = import_picomatch.default.scan(path$1$1, splitPatternOptions);
|
|
52454
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1$1];
|
|
52291
52455
|
}
|
|
52292
52456
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
52293
52457
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
52294
|
-
const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
52295
|
-
const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
52458
|
+
const escapePosixPath = (path$1$1) => path$1$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
52459
|
+
const escapeWin32Path = (path$1$1) => path$1$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
52296
52460
|
/**
|
|
52297
52461
|
* Escapes a path's special characters depending on the platform.
|
|
52298
52462
|
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
|
|
@@ -52327,7 +52491,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
52327
52491
|
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
52328
52492
|
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
52329
52493
|
const escapedCwd = escapePath(cwd);
|
|
52330
|
-
if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
|
|
52494
|
+
if (path$1.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
|
|
52331
52495
|
else result = posix.normalize(result);
|
|
52332
52496
|
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
52333
52497
|
const parts = splitPattern(result);
|
|
@@ -52386,15 +52550,15 @@ function processPatterns({ patterns = ["**/*"], ignore: ignore$1 = [], expandDir
|
|
|
52386
52550
|
}
|
|
52387
52551
|
function formatPaths(paths, relative$2) {
|
|
52388
52552
|
for (let i$1 = paths.length - 1; i$1 >= 0; i$1--) {
|
|
52389
|
-
const path$1 = paths[i$1];
|
|
52390
|
-
paths[i$1] = relative$2(path$1);
|
|
52553
|
+
const path$1$1 = paths[i$1];
|
|
52554
|
+
paths[i$1] = relative$2(path$1$1);
|
|
52391
52555
|
}
|
|
52392
52556
|
return paths;
|
|
52393
52557
|
}
|
|
52394
52558
|
function normalizeCwd(cwd) {
|
|
52395
52559
|
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
52396
52560
|
if (cwd instanceof URL) return fileURLToPath$1(cwd).replace(BACKSLASHES, "/");
|
|
52397
|
-
return path.resolve(cwd).replace(BACKSLASHES, "/");
|
|
52561
|
+
return path$1.resolve(cwd).replace(BACKSLASHES, "/");
|
|
52398
52562
|
}
|
|
52399
52563
|
function getCrawler(patterns, inputOptions = {}) {
|
|
52400
52564
|
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
@@ -52439,9 +52603,9 @@ function getCrawler(patterns, inputOptions = {}) {
|
|
|
52439
52603
|
const formatExclude = options.absolute ? format$2 : buildFormat(cwd, props.root, true);
|
|
52440
52604
|
const fdirOptions = {
|
|
52441
52605
|
filters: [options.debug ? (p$1, isDirectory$1) => {
|
|
52442
|
-
const path$1 = format$2(p$1, isDirectory$1);
|
|
52443
|
-
const matches = matcher(path$1);
|
|
52444
|
-
if (matches) log(`matched ${path$1}`);
|
|
52606
|
+
const path$1$1 = format$2(p$1, isDirectory$1);
|
|
52607
|
+
const matches = matcher(path$1$1);
|
|
52608
|
+
if (matches) log(`matched ${path$1$1}`);
|
|
52445
52609
|
return matches;
|
|
52446
52610
|
} : (p$1, isDirectory$1) => matcher(format$2(p$1, isDirectory$1))],
|
|
52447
52611
|
exclude: options.debug ? (_, p$1) => {
|
|
@@ -52869,7 +53033,8 @@ function handleWebSocket(httpServer, miniflare, entryWorkerName) {
|
|
|
52869
53033
|
httpServer.on("upgrade", async (request$2, socket, head) => {
|
|
52870
53034
|
socket.on("error", () => socket.destroy());
|
|
52871
53035
|
const rawHost = request$2.headers.host ?? UNKNOWN_HOST;
|
|
52872
|
-
const
|
|
53036
|
+
const protocol = getForwardedProto(request$2) ?? "http:";
|
|
53037
|
+
const base = /^https?:\/\//i.test(rawHost) ? rawHost : `${protocol}//${rawHost}`;
|
|
52873
53038
|
const url = new URL(request$2.url ?? "", base);
|
|
52874
53039
|
const isViteRequest = request$2.headers["sec-websocket-protocol"]?.startsWith("vite");
|
|
52875
53040
|
const isSandboxRequest = hasSandboxOrigin(url.origin);
|
|
@@ -53433,13 +53598,13 @@ const wslDefaultBrowser = async () => {
|
|
|
53433
53598
|
const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
|
|
53434
53599
|
return stdout.trim();
|
|
53435
53600
|
};
|
|
53436
|
-
const convertWslPathToWindows = async (path$
|
|
53437
|
-
if (/^[a-z]+:\/\//i.test(path$
|
|
53601
|
+
const convertWslPathToWindows = async (path$2) => {
|
|
53602
|
+
if (/^[a-z]+:\/\//i.test(path$2)) return path$2;
|
|
53438
53603
|
try {
|
|
53439
|
-
const { stdout } = await execFile$1("wslpath", ["-aw", path$
|
|
53604
|
+
const { stdout } = await execFile$1("wslpath", ["-aw", path$2], { encoding: "utf8" });
|
|
53440
53605
|
return stdout.trim();
|
|
53441
53606
|
} catch {
|
|
53442
|
-
return path$
|
|
53607
|
+
return path$2;
|
|
53443
53608
|
}
|
|
53444
53609
|
};
|
|
53445
53610
|
|
|
@@ -53625,8 +53790,8 @@ var is_in_ssh_default = isInSsh;
|
|
|
53625
53790
|
//#endregion
|
|
53626
53791
|
//#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
53627
53792
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
53628
|
-
const __dirname = import.meta.url ?
|
|
53629
|
-
const localXdgOpenPath =
|
|
53793
|
+
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
53794
|
+
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
53630
53795
|
const { platform, arch: arch$1 } = process$1;
|
|
53631
53796
|
const tryEachApp = async (apps$1, opener) => {
|
|
53632
53797
|
if (apps$1.length === 0) return;
|
|
@@ -53849,22 +54014,16 @@ const shortcutsPlugin = createPlugin("shortcuts", (ctx) => {
|
|
|
53849
54014
|
async configureServer(viteDevServer) {
|
|
53850
54015
|
if (!isCustomShortcutsSupported) return;
|
|
53851
54016
|
assertIsNotPreview(ctx);
|
|
53852
|
-
|
|
53853
|
-
addExplorerShortcut(viteDevServer);
|
|
53854
|
-
addTunnelShortcut(viteDevServer, ctx);
|
|
54017
|
+
addShortcuts(viteDevServer, ctx);
|
|
53855
54018
|
},
|
|
53856
54019
|
async configurePreviewServer(vitePreviewServer) {
|
|
53857
54020
|
if (!isCustomShortcutsSupported) return;
|
|
53858
54021
|
assertIsPreview(ctx);
|
|
53859
|
-
|
|
53860
|
-
addExplorerShortcut(vitePreviewServer);
|
|
53861
|
-
addTunnelShortcut(vitePreviewServer, ctx);
|
|
54022
|
+
addShortcuts(vitePreviewServer, ctx);
|
|
53862
54023
|
}
|
|
53863
54024
|
};
|
|
53864
54025
|
});
|
|
53865
|
-
function
|
|
53866
|
-
const workerConfigs = ctx.allWorkerConfigs;
|
|
53867
|
-
if (workerConfigs.length === 0) return;
|
|
54026
|
+
function addShortcuts(server, ctx) {
|
|
53868
54027
|
if (!process.stdin.isTTY) return;
|
|
53869
54028
|
const registryPath = getDefaultDevRegistryPath();
|
|
53870
54029
|
const printBindingsShortcut = {
|
|
@@ -53872,6 +54031,7 @@ function addBindingsShortcut(server, ctx) {
|
|
|
53872
54031
|
description: "list configured Cloudflare bindings",
|
|
53873
54032
|
action: (viteServer) => {
|
|
53874
54033
|
viteServer.config.logger.info("");
|
|
54034
|
+
const workerConfigs = ctx.allWorkerConfigs;
|
|
53875
54035
|
for (const workerConfig of workerConfigs) {
|
|
53876
54036
|
const bindings = wrangler.unstable_convertConfigBindingsToStartWorkerBindings(workerConfig);
|
|
53877
54037
|
wrangler.unstable_printBindings(bindings, workerConfig.tail_consumers, workerConfig.streaming_tail_consumers, workerConfig.containers, {
|
|
@@ -53884,15 +54044,6 @@ function addBindingsShortcut(server, ctx) {
|
|
|
53884
54044
|
}
|
|
53885
54045
|
}
|
|
53886
54046
|
};
|
|
53887
|
-
const bindCLIShortcuts = server.bindCLIShortcuts.bind(server);
|
|
53888
|
-
server.bindCLIShortcuts = (options) => {
|
|
53889
|
-
if (server.httpServer && process.stdin.isTTY && !process.env.CI && options?.print) server.config.logger.info(import_picocolors.default.dim(import_picocolors.default.green(" ➜")) + import_picocolors.default.dim(" press ") + import_picocolors.default.bold(`${printBindingsShortcut.key} + enter`) + import_picocolors.default.dim(` to ${printBindingsShortcut.description}`));
|
|
53890
|
-
bindCLIShortcuts(options);
|
|
53891
|
-
};
|
|
53892
|
-
server.bindCLIShortcuts({ customShortcuts: [printBindingsShortcut] });
|
|
53893
|
-
}
|
|
53894
|
-
function addExplorerShortcut(server) {
|
|
53895
|
-
if (!process.stdin.isTTY) return;
|
|
53896
54047
|
const openExplorerShortcut = {
|
|
53897
54048
|
key: "e",
|
|
53898
54049
|
description: "open local explorer",
|
|
@@ -53908,16 +54059,7 @@ function addExplorerShortcut(server) {
|
|
|
53908
54059
|
});
|
|
53909
54060
|
}
|
|
53910
54061
|
};
|
|
53911
|
-
const
|
|
53912
|
-
server.bindCLIShortcuts = (options) => {
|
|
53913
|
-
if (server.httpServer && process.stdin.isTTY && !process.env.CI && options?.print) server.config.logger.info(import_picocolors.default.dim(import_picocolors.default.green(" ➜")) + import_picocolors.default.dim(" press ") + import_picocolors.default.bold(`${openExplorerShortcut.key} + enter`) + import_picocolors.default.dim(` to ${openExplorerShortcut.description}`));
|
|
53914
|
-
bindCLIShortcuts(options);
|
|
53915
|
-
};
|
|
53916
|
-
server.bindCLIShortcuts({ customShortcuts: [openExplorerShortcut] });
|
|
53917
|
-
}
|
|
53918
|
-
function addTunnelShortcut(server, ctx) {
|
|
53919
|
-
if (!process.stdin.isTTY) return;
|
|
53920
|
-
server.bindCLIShortcuts({ customShortcuts: [{
|
|
54062
|
+
const toggleTunnelShortcut = {
|
|
53921
54063
|
key: "t",
|
|
53922
54064
|
description: "start or close tunnel",
|
|
53923
54065
|
action: () => {
|
|
@@ -53926,13 +54068,29 @@ function addTunnelShortcut(server, ctx) {
|
|
|
53926
54068
|
server.config.logger.error(import_picocolors.default.red(`Error: ${message}`));
|
|
53927
54069
|
});
|
|
53928
54070
|
}
|
|
53929
|
-
}
|
|
54071
|
+
};
|
|
54072
|
+
const extendTunnelExpiryShortcut = {
|
|
53930
54073
|
key: "a",
|
|
53931
54074
|
description: "extend tunnel by 1 hour",
|
|
53932
54075
|
action: () => {
|
|
53933
54076
|
extendTunnelExpiry();
|
|
53934
54077
|
}
|
|
53935
|
-
}
|
|
54078
|
+
};
|
|
54079
|
+
const bindCLIShortcuts = server.bindCLIShortcuts.bind(server);
|
|
54080
|
+
server.bindCLIShortcuts = (options) => {
|
|
54081
|
+
if (server.httpServer && process.stdin.isTTY && !process.env.CI && options?.print) {
|
|
54082
|
+
if (ctx.allWorkerConfigs.length > 0) server.config.logger.info(import_picocolors.default.dim(import_picocolors.default.green(" ➜")) + import_picocolors.default.dim(" press ") + import_picocolors.default.bold(`${printBindingsShortcut.key} + enter`) + import_picocolors.default.dim(` to ${printBindingsShortcut.description}`));
|
|
54083
|
+
server.config.logger.info(import_picocolors.default.dim(import_picocolors.default.green(" ➜")) + import_picocolors.default.dim(" press ") + import_picocolors.default.bold(`${openExplorerShortcut.key} + enter`) + import_picocolors.default.dim(` to ${openExplorerShortcut.description}`));
|
|
54084
|
+
server.config.logger.info(import_picocolors.default.dim(import_picocolors.default.green(" ➜")) + import_picocolors.default.dim(" press ") + import_picocolors.default.bold(`${toggleTunnelShortcut.key} + enter`) + import_picocolors.default.dim(` to ${isTunnelOpen() ? "close tunnel" : "start tunnel"}`));
|
|
54085
|
+
}
|
|
54086
|
+
bindCLIShortcuts(options);
|
|
54087
|
+
};
|
|
54088
|
+
server.bindCLIShortcuts({ customShortcuts: [
|
|
54089
|
+
printBindingsShortcut,
|
|
54090
|
+
openExplorerShortcut,
|
|
54091
|
+
toggleTunnelShortcut,
|
|
54092
|
+
extendTunnelExpiryShortcut
|
|
54093
|
+
] });
|
|
53936
54094
|
}
|
|
53937
54095
|
|
|
53938
54096
|
//#endregion
|