@cloudflare/vite-plugin 1.37.0 → 1.37.1
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
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-15";
|
|
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
|
|
@@ -39601,15 +39626,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
39601
39626
|
function withTrailingSlash$1(input = "", respectQueryAndFragment) {
|
|
39602
39627
|
if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
|
|
39603
39628
|
if (hasTrailingSlash(input, true)) return input || "/";
|
|
39604
|
-
let path$
|
|
39629
|
+
let path$2 = input;
|
|
39605
39630
|
let fragment = "";
|
|
39606
39631
|
const fragmentIndex = input.indexOf("#");
|
|
39607
39632
|
if (fragmentIndex >= 0) {
|
|
39608
|
-
path$
|
|
39633
|
+
path$2 = input.slice(0, fragmentIndex);
|
|
39609
39634
|
fragment = input.slice(fragmentIndex);
|
|
39610
|
-
if (!path$
|
|
39635
|
+
if (!path$2) return fragment;
|
|
39611
39636
|
}
|
|
39612
|
-
const [s0, ...s] = path$
|
|
39637
|
+
const [s0, ...s] = path$2.split("?");
|
|
39613
39638
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
39614
39639
|
}
|
|
39615
39640
|
function isNonEmptyURL(url) {
|
|
@@ -39635,8 +39660,8 @@ const isAbsolute$1 = function(p$1) {
|
|
|
39635
39660
|
//#endregion
|
|
39636
39661
|
//#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
39637
39662
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
39638
|
-
function normalizeSlash(path$
|
|
39639
|
-
return path$
|
|
39663
|
+
function normalizeSlash(path$2) {
|
|
39664
|
+
return path$2.replace(/\\/g, "/");
|
|
39640
39665
|
}
|
|
39641
39666
|
/**
|
|
39642
39667
|
* @typedef ErrnoExceptionFields
|
|
@@ -39756,8 +39781,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
39756
39781
|
* @param {string} [base]
|
|
39757
39782
|
* @param {string} [message]
|
|
39758
39783
|
*/
|
|
39759
|
-
(path$
|
|
39760
|
-
return `Invalid package config ${path$
|
|
39784
|
+
(path$2, base, message) => {
|
|
39785
|
+
return `Invalid package config ${path$2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
39761
39786
|
},
|
|
39762
39787
|
Error
|
|
39763
39788
|
);
|
|
@@ -39787,8 +39812,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
39787
39812
|
* @param {string} base
|
|
39788
39813
|
* @param {boolean} [exactUrl]
|
|
39789
39814
|
*/
|
|
39790
|
-
(path$
|
|
39791
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path$
|
|
39815
|
+
(path$2, base, exactUrl = false) => {
|
|
39816
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path$2}' imported from ${base}`;
|
|
39792
39817
|
},
|
|
39793
39818
|
Error
|
|
39794
39819
|
);
|
|
@@ -39826,8 +39851,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
39826
39851
|
* @param {string} extension
|
|
39827
39852
|
* @param {string} path
|
|
39828
39853
|
*/
|
|
39829
|
-
(extension, path$
|
|
39830
|
-
return `Unknown file extension "${extension}" for ${path$
|
|
39854
|
+
(extension, path$2) => {
|
|
39855
|
+
return `Unknown file extension "${extension}" for ${path$2}`;
|
|
39831
39856
|
},
|
|
39832
39857
|
TypeError
|
|
39833
39858
|
);
|
|
@@ -39984,7 +40009,7 @@ function read(jsonPath, { base, specifier }) {
|
|
|
39984
40009
|
/** @type {string | undefined} */
|
|
39985
40010
|
let string;
|
|
39986
40011
|
try {
|
|
39987
|
-
string = fs.readFileSync(
|
|
40012
|
+
string = fs.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
|
39988
40013
|
} catch (error) {
|
|
39989
40014
|
const exception = error;
|
|
39990
40015
|
if (exception.code !== "ENOENT") throw exception;
|
|
@@ -40190,15 +40215,15 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
40190
40215
|
const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
|
|
40191
40216
|
const basePath = fileURLToPath(base);
|
|
40192
40217
|
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 (
|
|
40218
|
+
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
40219
|
}
|
|
40195
40220
|
/**
|
|
40196
40221
|
* @param {string} path
|
|
40197
40222
|
* @returns {Stats | undefined}
|
|
40198
40223
|
*/
|
|
40199
|
-
function tryStatSync(path$
|
|
40224
|
+
function tryStatSync(path$2) {
|
|
40200
40225
|
try {
|
|
40201
|
-
return statSync(path$
|
|
40226
|
+
return statSync(path$2);
|
|
40202
40227
|
} catch {}
|
|
40203
40228
|
}
|
|
40204
40229
|
/**
|
|
@@ -40297,7 +40322,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
40297
40322
|
{
|
|
40298
40323
|
const real = realpathSync(filePath);
|
|
40299
40324
|
const { search, hash } = resolved;
|
|
40300
|
-
resolved = pathToFileURL(real + (filePath.endsWith(
|
|
40325
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
|
|
40301
40326
|
resolved.search = search;
|
|
40302
40327
|
resolved.hash = hash;
|
|
40303
40328
|
}
|
|
@@ -42677,9 +42702,9 @@ function constructHeaders({ headers, headersFile, logger }) {
|
|
|
42677
42702
|
|
|
42678
42703
|
//#endregion
|
|
42679
42704
|
//#region ../workers-shared/utils/configuration/validateURL.ts
|
|
42680
|
-
const extractPathname = (path$
|
|
42681
|
-
if (!path$
|
|
42682
|
-
const url = new URL(`//${path$
|
|
42705
|
+
const extractPathname = (path$2 = "/", includeSearch, includeHash) => {
|
|
42706
|
+
if (!path$2.startsWith("/")) path$2 = `/${path$2}`;
|
|
42707
|
+
const url = new URL(`//${path$2}`, "relative://");
|
|
42683
42708
|
return `${url.pathname}${includeSearch ? url.search : ""}${includeHash ? url.hash : ""}`;
|
|
42684
42709
|
};
|
|
42685
42710
|
const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
|
|
@@ -42738,7 +42763,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
42738
42763
|
lineNumber: i$1 + 1,
|
|
42739
42764
|
message: "No headers specified"
|
|
42740
42765
|
});
|
|
42741
|
-
const [path$
|
|
42766
|
+
const [path$2, pathError] = validateUrl(line, false, true);
|
|
42742
42767
|
if (pathError) {
|
|
42743
42768
|
invalid.push({
|
|
42744
42769
|
line,
|
|
@@ -42749,7 +42774,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
42749
42774
|
skipUntilNextPath = true;
|
|
42750
42775
|
continue;
|
|
42751
42776
|
}
|
|
42752
|
-
const wildcardError = validateNoMultipleWildcards(path$
|
|
42777
|
+
const wildcardError = validateNoMultipleWildcards(path$2);
|
|
42753
42778
|
if (wildcardError) {
|
|
42754
42779
|
invalid.push({
|
|
42755
42780
|
line,
|
|
@@ -42761,7 +42786,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
42761
42786
|
continue;
|
|
42762
42787
|
}
|
|
42763
42788
|
rule = {
|
|
42764
|
-
path: path$
|
|
42789
|
+
path: path$2,
|
|
42765
42790
|
line,
|
|
42766
42791
|
headers: {},
|
|
42767
42792
|
unsetHeaders: []
|
|
@@ -42844,11 +42869,11 @@ function isValidRule(rule) {
|
|
|
42844
42869
|
* `:splat` placeholder, would result in duplicate `:splat` parameters which is
|
|
42845
42870
|
* unsupported.
|
|
42846
42871
|
*/
|
|
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$
|
|
42872
|
+
function validateNoMultipleWildcards(path$2) {
|
|
42873
|
+
const wildcardCount = (path$2.match(SPLAT_REGEX) ?? []).length;
|
|
42874
|
+
const hasSplatPlaceholder = /:splat(?!\w)/.test(path$2);
|
|
42875
|
+
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$2}.`;
|
|
42876
|
+
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
42877
|
}
|
|
42853
42878
|
|
|
42854
42879
|
//#endregion
|
|
@@ -43065,13 +43090,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43065
43090
|
const throwError = (message, Ctor) => {
|
|
43066
43091
|
throw new Ctor(message);
|
|
43067
43092
|
};
|
|
43068
|
-
const checkPath = (path$
|
|
43069
|
-
if (!isString$1(path$
|
|
43070
|
-
if (!path$
|
|
43071
|
-
if (checkPath.isNotRelative(path$
|
|
43093
|
+
const checkPath = (path$2, originalPath, doThrow) => {
|
|
43094
|
+
if (!isString$1(path$2)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
43095
|
+
if (!path$2) return doThrow(`path must not be empty`, TypeError);
|
|
43096
|
+
if (checkPath.isNotRelative(path$2)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
|
|
43072
43097
|
return true;
|
|
43073
43098
|
};
|
|
43074
|
-
const isNotRelative = (path$
|
|
43099
|
+
const isNotRelative = (path$2) => REGEX_TEST_INVALID_PATH.test(path$2);
|
|
43075
43100
|
checkPath.isNotRelative = isNotRelative;
|
|
43076
43101
|
checkPath.convert = (p$1) => p$1;
|
|
43077
43102
|
var Ignore = class {
|
|
@@ -43107,13 +43132,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43107
43132
|
addPattern(pattern) {
|
|
43108
43133
|
return this.add(pattern);
|
|
43109
43134
|
}
|
|
43110
|
-
_testOne(path$
|
|
43135
|
+
_testOne(path$2, checkUnignored) {
|
|
43111
43136
|
let ignored = false;
|
|
43112
43137
|
let unignored = false;
|
|
43113
43138
|
this._rules.forEach((rule) => {
|
|
43114
43139
|
const { negative } = rule;
|
|
43115
43140
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
|
|
43116
|
-
if (rule.regex.test(path$
|
|
43141
|
+
if (rule.regex.test(path$2)) {
|
|
43117
43142
|
ignored = !negative;
|
|
43118
43143
|
unignored = negative;
|
|
43119
43144
|
}
|
|
@@ -43124,33 +43149,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43124
43149
|
};
|
|
43125
43150
|
}
|
|
43126
43151
|
_test(originalPath, cache$2, checkUnignored, slices) {
|
|
43127
|
-
const path$
|
|
43128
|
-
checkPath(path$
|
|
43129
|
-
return this._t(path$
|
|
43152
|
+
const path$2 = originalPath && checkPath.convert(originalPath);
|
|
43153
|
+
checkPath(path$2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
43154
|
+
return this._t(path$2, cache$2, checkUnignored, slices);
|
|
43130
43155
|
}
|
|
43131
|
-
_t(path$
|
|
43132
|
-
if (path$
|
|
43133
|
-
if (!slices) slices = path$
|
|
43156
|
+
_t(path$2, cache$2, checkUnignored, slices) {
|
|
43157
|
+
if (path$2 in cache$2) return cache$2[path$2];
|
|
43158
|
+
if (!slices) slices = path$2.split(SLASH);
|
|
43134
43159
|
slices.pop();
|
|
43135
|
-
if (!slices.length) return cache$2[path$
|
|
43160
|
+
if (!slices.length) return cache$2[path$2] = this._testOne(path$2, checkUnignored);
|
|
43136
43161
|
const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
|
|
43137
|
-
return cache$2[path$
|
|
43162
|
+
return cache$2[path$2] = parent.ignored ? parent : this._testOne(path$2, checkUnignored);
|
|
43138
43163
|
}
|
|
43139
|
-
ignores(path$
|
|
43140
|
-
return this._test(path$
|
|
43164
|
+
ignores(path$2) {
|
|
43165
|
+
return this._test(path$2, this._ignoreCache, false).ignored;
|
|
43141
43166
|
}
|
|
43142
43167
|
createFilter() {
|
|
43143
|
-
return (path$
|
|
43168
|
+
return (path$2) => !this.ignores(path$2);
|
|
43144
43169
|
}
|
|
43145
43170
|
filter(paths) {
|
|
43146
43171
|
return makeArray(paths).filter(this.createFilter());
|
|
43147
43172
|
}
|
|
43148
|
-
test(path$
|
|
43149
|
-
return this._test(path$
|
|
43173
|
+
test(path$2) {
|
|
43174
|
+
return this._test(path$2, this._testCache, true);
|
|
43150
43175
|
}
|
|
43151
43176
|
};
|
|
43152
43177
|
const factory = (options) => new Ignore(options);
|
|
43153
|
-
const isPathValid = (path$
|
|
43178
|
+
const isPathValid = (path$2) => checkPath(path$2 && checkPath.convert(path$2), path$2, RETURN_FALSE);
|
|
43154
43179
|
factory.isPathValid = isPathValid;
|
|
43155
43180
|
factory.default = factory;
|
|
43156
43181
|
module.exports = factory;
|
|
@@ -43159,7 +43184,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
43159
43184
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
43160
43185
|
checkPath.convert = makePosix;
|
|
43161
43186
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
43162
|
-
checkPath.isNotRelative = (path$
|
|
43187
|
+
checkPath.isNotRelative = (path$2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$2) || isNotRelative(path$2);
|
|
43163
43188
|
}
|
|
43164
43189
|
}) });
|
|
43165
43190
|
|
|
@@ -44514,11 +44539,11 @@ var Mime = class {
|
|
|
44514
44539
|
}
|
|
44515
44540
|
return this;
|
|
44516
44541
|
}
|
|
44517
|
-
getType(path$
|
|
44518
|
-
if (typeof path$
|
|
44519
|
-
const last = path$
|
|
44542
|
+
getType(path$2) {
|
|
44543
|
+
if (typeof path$2 !== "string") return null;
|
|
44544
|
+
const last = path$2.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
44520
44545
|
const ext = last.replace(/^.*\./s, "").toLowerCase();
|
|
44521
|
-
const hasPath = last.length < path$
|
|
44546
|
+
const hasPath = last.length < path$2.length;
|
|
44522
44547
|
if (!(ext.length < last.length - 1) && hasPath) return null;
|
|
44523
44548
|
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
|
|
44524
44549
|
}
|
|
@@ -44852,8 +44877,8 @@ function getErrorMap() {
|
|
|
44852
44877
|
//#endregion
|
|
44853
44878
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
44854
44879
|
const makeIssue = (params) => {
|
|
44855
|
-
const { data: data$1, path: path$
|
|
44856
|
-
const fullPath = [...path$
|
|
44880
|
+
const { data: data$1, path: path$2, errorMaps, issueData } = params;
|
|
44881
|
+
const fullPath = [...path$2, ...issueData.path || []];
|
|
44857
44882
|
const fullIssue = {
|
|
44858
44883
|
...issueData,
|
|
44859
44884
|
path: fullPath
|
|
@@ -44965,11 +44990,11 @@ var errorUtil;
|
|
|
44965
44990
|
//#endregion
|
|
44966
44991
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
44967
44992
|
var ParseInputLazyPath = class {
|
|
44968
|
-
constructor(parent, value, path$
|
|
44993
|
+
constructor(parent, value, path$2, key) {
|
|
44969
44994
|
this._cachedPath = [];
|
|
44970
44995
|
this.parent = parent;
|
|
44971
44996
|
this.data = value;
|
|
44972
|
-
this._path = path$
|
|
44997
|
+
this._path = path$2;
|
|
44973
44998
|
this._key = key;
|
|
44974
44999
|
}
|
|
44975
45000
|
get path() {
|
|
@@ -49001,11 +49026,11 @@ const getQueryString = (params) => {
|
|
|
49001
49026
|
};
|
|
49002
49027
|
const getUrl = (config, options) => {
|
|
49003
49028
|
const encoder$1 = config.ENCODE_PATH || encodeURI;
|
|
49004
|
-
const path$
|
|
49029
|
+
const path$2 = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
49005
49030
|
if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
|
|
49006
49031
|
return substring;
|
|
49007
49032
|
});
|
|
49008
|
-
const url = `${config.BASE}${path$
|
|
49033
|
+
const url = `${config.BASE}${path$2}`;
|
|
49009
49034
|
if (options.query) return `${url}${getQueryString(options.query)}`;
|
|
49010
49035
|
return url;
|
|
49011
49036
|
};
|
|
@@ -50020,7 +50045,7 @@ function getContainerOptions(options) {
|
|
|
50020
50045
|
return containersConfig.map((container) => {
|
|
50021
50046
|
if (isDockerfile(container.image, configPath)) return {
|
|
50022
50047
|
dockerfile: container.image,
|
|
50023
|
-
image_build_context: container.image_build_context ??
|
|
50048
|
+
image_build_context: container.image_build_context ?? path.dirname(container.image),
|
|
50024
50049
|
image_vars: container.image_vars,
|
|
50025
50050
|
class_name: container.class_name,
|
|
50026
50051
|
image_tag: getDevContainerImageName(container.class_name, containerBuildId)
|
|
@@ -50036,26 +50061,26 @@ function getContainerOptions(options) {
|
|
|
50036
50061
|
//#endregion
|
|
50037
50062
|
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.3/node_modules/fdir/dist/index.mjs
|
|
50038
50063
|
var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
50039
|
-
function cleanPath(path$
|
|
50040
|
-
let normalized = normalize(path$
|
|
50064
|
+
function cleanPath(path$2) {
|
|
50065
|
+
let normalized = normalize(path$2);
|
|
50041
50066
|
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
50042
50067
|
return normalized;
|
|
50043
50068
|
}
|
|
50044
50069
|
const SLASHES_REGEX = /[\\/]/g;
|
|
50045
|
-
function convertSlashes(path$
|
|
50046
|
-
return path$
|
|
50070
|
+
function convertSlashes(path$2, separator) {
|
|
50071
|
+
return path$2.replace(SLASHES_REGEX, separator);
|
|
50047
50072
|
}
|
|
50048
50073
|
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
50049
|
-
function isRootDirectory(path$
|
|
50050
|
-
return path$
|
|
50074
|
+
function isRootDirectory(path$2) {
|
|
50075
|
+
return path$2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$2);
|
|
50051
50076
|
}
|
|
50052
|
-
function normalizePath$1(path$
|
|
50077
|
+
function normalizePath$1(path$2, options) {
|
|
50053
50078
|
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$
|
|
50079
|
+
const pathNeedsCleaning = process.platform === "win32" && path$2.includes("/") || path$2.startsWith(".");
|
|
50080
|
+
if (resolvePaths) path$2 = resolve$1(path$2);
|
|
50081
|
+
if (normalizePath$1$1 || pathNeedsCleaning) path$2 = cleanPath(path$2);
|
|
50082
|
+
if (path$2 === ".") return "";
|
|
50083
|
+
return convertSlashes(path$2[path$2.length - 1] !== pathSeparator ? path$2 + pathSeparator : path$2, pathSeparator);
|
|
50059
50084
|
}
|
|
50060
50085
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
50061
50086
|
return directoryPath + filename;
|
|
@@ -50091,8 +50116,8 @@ const pushDirectory = (directoryPath, paths) => {
|
|
|
50091
50116
|
paths.push(directoryPath || ".");
|
|
50092
50117
|
};
|
|
50093
50118
|
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
50094
|
-
const path$
|
|
50095
|
-
if (filters.every((filter) => filter(path$
|
|
50119
|
+
const path$2 = directoryPath || ".";
|
|
50120
|
+
if (filters.every((filter) => filter(path$2, true))) paths.push(path$2);
|
|
50096
50121
|
};
|
|
50097
50122
|
const empty$2 = () => {};
|
|
50098
50123
|
function build$6(root, options) {
|
|
@@ -50141,26 +50166,26 @@ const empty = () => {};
|
|
|
50141
50166
|
function build$3(options) {
|
|
50142
50167
|
return options.group ? groupFiles : empty;
|
|
50143
50168
|
}
|
|
50144
|
-
const resolveSymlinksAsync = function(path$
|
|
50169
|
+
const resolveSymlinksAsync = function(path$2, state, callback$1) {
|
|
50145
50170
|
const { queue, fs: fs$3, options: { suppressErrors } } = state;
|
|
50146
50171
|
queue.enqueue();
|
|
50147
|
-
fs$3.realpath(path$
|
|
50172
|
+
fs$3.realpath(path$2, (error, resolvedPath) => {
|
|
50148
50173
|
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
50149
50174
|
fs$3.stat(resolvedPath, (error$1, stat) => {
|
|
50150
50175
|
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
50151
|
-
if (stat.isDirectory() && isRecursive(path$
|
|
50176
|
+
if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
|
|
50152
50177
|
callback$1(stat, resolvedPath);
|
|
50153
50178
|
queue.dequeue(null, state);
|
|
50154
50179
|
});
|
|
50155
50180
|
});
|
|
50156
50181
|
};
|
|
50157
|
-
const resolveSymlinks = function(path$
|
|
50182
|
+
const resolveSymlinks = function(path$2, state, callback$1) {
|
|
50158
50183
|
const { queue, fs: fs$3, options: { suppressErrors } } = state;
|
|
50159
50184
|
queue.enqueue();
|
|
50160
50185
|
try {
|
|
50161
|
-
const resolvedPath = fs$3.realpathSync(path$
|
|
50186
|
+
const resolvedPath = fs$3.realpathSync(path$2);
|
|
50162
50187
|
const stat = fs$3.statSync(resolvedPath);
|
|
50163
|
-
if (stat.isDirectory() && isRecursive(path$
|
|
50188
|
+
if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
|
|
50164
50189
|
callback$1(stat, resolvedPath);
|
|
50165
50190
|
} catch (e) {
|
|
50166
50191
|
if (!suppressErrors) throw e;
|
|
@@ -50170,16 +50195,16 @@ function build$2(options, isSynchronous) {
|
|
|
50170
50195
|
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
50171
50196
|
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
50172
50197
|
}
|
|
50173
|
-
function isRecursive(path$
|
|
50198
|
+
function isRecursive(path$2, resolved, state) {
|
|
50174
50199
|
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
50175
|
-
let parent = dirname$1(path$
|
|
50200
|
+
let parent = dirname$1(path$2);
|
|
50176
50201
|
let depth$1 = 1;
|
|
50177
50202
|
while (parent !== state.root && depth$1 < 2) {
|
|
50178
50203
|
const resolvedPath = state.symlinks.get(parent);
|
|
50179
50204
|
if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
|
|
50180
50205
|
else parent = dirname$1(parent);
|
|
50181
50206
|
}
|
|
50182
|
-
state.symlinks.set(path$
|
|
50207
|
+
state.symlinks.set(path$2, resolved);
|
|
50183
50208
|
return depth$1 > 1;
|
|
50184
50209
|
}
|
|
50185
50210
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
@@ -50360,19 +50385,19 @@ var Walker = class {
|
|
|
50360
50385
|
const filename = this.joinPath(entry.name, directoryPath);
|
|
50361
50386
|
this.pushFile(filename, files, this.state.counts, filters);
|
|
50362
50387
|
} else if (entry.isDirectory()) {
|
|
50363
|
-
let path$
|
|
50364
|
-
if (exclude && exclude(entry.name, path$
|
|
50365
|
-
this.pushDirectory(path$
|
|
50366
|
-
this.walkDirectory(this.state, path$
|
|
50388
|
+
let path$2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
50389
|
+
if (exclude && exclude(entry.name, path$2)) continue;
|
|
50390
|
+
this.pushDirectory(path$2, paths, filters);
|
|
50391
|
+
this.walkDirectory(this.state, path$2, path$2, depth$1 - 1, this.walk);
|
|
50367
50392
|
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
50368
|
-
let path$
|
|
50369
|
-
this.resolveSymlink(path$
|
|
50393
|
+
let path$2 = joinPathWithBasePath(entry.name, directoryPath);
|
|
50394
|
+
this.resolveSymlink(path$2, this.state, (stat, resolvedPath) => {
|
|
50370
50395
|
if (stat.isDirectory()) {
|
|
50371
50396
|
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$
|
|
50397
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
|
|
50398
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth$1 - 1, this.walk);
|
|
50374
50399
|
} else {
|
|
50375
|
-
resolvedPath = useRealPaths ? resolvedPath : path$
|
|
50400
|
+
resolvedPath = useRealPaths ? resolvedPath : path$2;
|
|
50376
50401
|
const filename = basename(resolvedPath);
|
|
50377
50402
|
const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
|
|
50378
50403
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
@@ -50537,7 +50562,7 @@ var Builder = class {
|
|
|
50537
50562
|
isMatch = globFn(patterns, ...options);
|
|
50538
50563
|
this.globCache[patterns.join("\0")] = isMatch;
|
|
50539
50564
|
}
|
|
50540
|
-
this.options.filters.push((path$
|
|
50565
|
+
this.options.filters.push((path$2) => isMatch(path$2));
|
|
50541
50566
|
return this;
|
|
50542
50567
|
}
|
|
50543
50568
|
};
|
|
@@ -50748,8 +50773,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
50748
50773
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
50749
50774
|
return output;
|
|
50750
50775
|
};
|
|
50751
|
-
exports.basename = (path$
|
|
50752
|
-
const segs = path$
|
|
50776
|
+
exports.basename = (path$2, { windows } = {}) => {
|
|
50777
|
+
const segs = path$2.split(windows ? /[\\/]/ : "/");
|
|
50753
50778
|
const last = segs[segs.length - 1];
|
|
50754
50779
|
if (last === "") return segs[segs.length - 2];
|
|
50755
50780
|
return last;
|
|
@@ -52284,15 +52309,15 @@ function buildRelative(cwd, root) {
|
|
|
52284
52309
|
};
|
|
52285
52310
|
}
|
|
52286
52311
|
const splitPatternOptions = { parts: true };
|
|
52287
|
-
function splitPattern(path$1) {
|
|
52312
|
+
function splitPattern(path$1$1) {
|
|
52288
52313
|
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];
|
|
52314
|
+
const result = import_picomatch.default.scan(path$1$1, splitPatternOptions);
|
|
52315
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1$1];
|
|
52291
52316
|
}
|
|
52292
52317
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
52293
52318
|
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, "\\$&");
|
|
52319
|
+
const escapePosixPath = (path$1$1) => path$1$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
52320
|
+
const escapeWin32Path = (path$1$1) => path$1$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
52296
52321
|
/**
|
|
52297
52322
|
* Escapes a path's special characters depending on the platform.
|
|
52298
52323
|
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
|
|
@@ -52327,7 +52352,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
52327
52352
|
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
52328
52353
|
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
52329
52354
|
const escapedCwd = escapePath(cwd);
|
|
52330
|
-
if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
|
|
52355
|
+
if (path$1.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
|
|
52331
52356
|
else result = posix.normalize(result);
|
|
52332
52357
|
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
52333
52358
|
const parts = splitPattern(result);
|
|
@@ -52386,15 +52411,15 @@ function processPatterns({ patterns = ["**/*"], ignore: ignore$1 = [], expandDir
|
|
|
52386
52411
|
}
|
|
52387
52412
|
function formatPaths(paths, relative$2) {
|
|
52388
52413
|
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);
|
|
52414
|
+
const path$1$1 = paths[i$1];
|
|
52415
|
+
paths[i$1] = relative$2(path$1$1);
|
|
52391
52416
|
}
|
|
52392
52417
|
return paths;
|
|
52393
52418
|
}
|
|
52394
52419
|
function normalizeCwd(cwd) {
|
|
52395
52420
|
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
52396
52421
|
if (cwd instanceof URL) return fileURLToPath$1(cwd).replace(BACKSLASHES, "/");
|
|
52397
|
-
return path.resolve(cwd).replace(BACKSLASHES, "/");
|
|
52422
|
+
return path$1.resolve(cwd).replace(BACKSLASHES, "/");
|
|
52398
52423
|
}
|
|
52399
52424
|
function getCrawler(patterns, inputOptions = {}) {
|
|
52400
52425
|
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
@@ -52439,9 +52464,9 @@ function getCrawler(patterns, inputOptions = {}) {
|
|
|
52439
52464
|
const formatExclude = options.absolute ? format$2 : buildFormat(cwd, props.root, true);
|
|
52440
52465
|
const fdirOptions = {
|
|
52441
52466
|
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}`);
|
|
52467
|
+
const path$1$1 = format$2(p$1, isDirectory$1);
|
|
52468
|
+
const matches = matcher(path$1$1);
|
|
52469
|
+
if (matches) log(`matched ${path$1$1}`);
|
|
52445
52470
|
return matches;
|
|
52446
52471
|
} : (p$1, isDirectory$1) => matcher(format$2(p$1, isDirectory$1))],
|
|
52447
52472
|
exclude: options.debug ? (_, p$1) => {
|
|
@@ -52869,7 +52894,8 @@ function handleWebSocket(httpServer, miniflare, entryWorkerName) {
|
|
|
52869
52894
|
httpServer.on("upgrade", async (request$2, socket, head) => {
|
|
52870
52895
|
socket.on("error", () => socket.destroy());
|
|
52871
52896
|
const rawHost = request$2.headers.host ?? UNKNOWN_HOST;
|
|
52872
|
-
const
|
|
52897
|
+
const protocol = getForwardedProto(request$2) ?? "http:";
|
|
52898
|
+
const base = /^https?:\/\//i.test(rawHost) ? rawHost : `${protocol}//${rawHost}`;
|
|
52873
52899
|
const url = new URL(request$2.url ?? "", base);
|
|
52874
52900
|
const isViteRequest = request$2.headers["sec-websocket-protocol"]?.startsWith("vite");
|
|
52875
52901
|
const isSandboxRequest = hasSandboxOrigin(url.origin);
|
|
@@ -53433,13 +53459,13 @@ const wslDefaultBrowser = async () => {
|
|
|
53433
53459
|
const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
|
|
53434
53460
|
return stdout.trim();
|
|
53435
53461
|
};
|
|
53436
|
-
const convertWslPathToWindows = async (path$
|
|
53437
|
-
if (/^[a-z]+:\/\//i.test(path$
|
|
53462
|
+
const convertWslPathToWindows = async (path$2) => {
|
|
53463
|
+
if (/^[a-z]+:\/\//i.test(path$2)) return path$2;
|
|
53438
53464
|
try {
|
|
53439
|
-
const { stdout } = await execFile$1("wslpath", ["-aw", path$
|
|
53465
|
+
const { stdout } = await execFile$1("wslpath", ["-aw", path$2], { encoding: "utf8" });
|
|
53440
53466
|
return stdout.trim();
|
|
53441
53467
|
} catch {
|
|
53442
|
-
return path$
|
|
53468
|
+
return path$2;
|
|
53443
53469
|
}
|
|
53444
53470
|
};
|
|
53445
53471
|
|
|
@@ -53625,8 +53651,8 @@ var is_in_ssh_default = isInSsh;
|
|
|
53625
53651
|
//#endregion
|
|
53626
53652
|
//#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
53627
53653
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
53628
|
-
const __dirname = import.meta.url ?
|
|
53629
|
-
const localXdgOpenPath =
|
|
53654
|
+
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
53655
|
+
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
53630
53656
|
const { platform, arch: arch$1 } = process$1;
|
|
53631
53657
|
const tryEachApp = async (apps$1, opener) => {
|
|
53632
53658
|
if (apps$1.length === 0) return;
|
|
@@ -53849,22 +53875,16 @@ const shortcutsPlugin = createPlugin("shortcuts", (ctx) => {
|
|
|
53849
53875
|
async configureServer(viteDevServer) {
|
|
53850
53876
|
if (!isCustomShortcutsSupported) return;
|
|
53851
53877
|
assertIsNotPreview(ctx);
|
|
53852
|
-
|
|
53853
|
-
addExplorerShortcut(viteDevServer);
|
|
53854
|
-
addTunnelShortcut(viteDevServer, ctx);
|
|
53878
|
+
addShortcuts(viteDevServer, ctx);
|
|
53855
53879
|
},
|
|
53856
53880
|
async configurePreviewServer(vitePreviewServer) {
|
|
53857
53881
|
if (!isCustomShortcutsSupported) return;
|
|
53858
53882
|
assertIsPreview(ctx);
|
|
53859
|
-
|
|
53860
|
-
addExplorerShortcut(vitePreviewServer);
|
|
53861
|
-
addTunnelShortcut(vitePreviewServer, ctx);
|
|
53883
|
+
addShortcuts(vitePreviewServer, ctx);
|
|
53862
53884
|
}
|
|
53863
53885
|
};
|
|
53864
53886
|
});
|
|
53865
|
-
function
|
|
53866
|
-
const workerConfigs = ctx.allWorkerConfigs;
|
|
53867
|
-
if (workerConfigs.length === 0) return;
|
|
53887
|
+
function addShortcuts(server, ctx) {
|
|
53868
53888
|
if (!process.stdin.isTTY) return;
|
|
53869
53889
|
const registryPath = getDefaultDevRegistryPath();
|
|
53870
53890
|
const printBindingsShortcut = {
|
|
@@ -53872,6 +53892,7 @@ function addBindingsShortcut(server, ctx) {
|
|
|
53872
53892
|
description: "list configured Cloudflare bindings",
|
|
53873
53893
|
action: (viteServer) => {
|
|
53874
53894
|
viteServer.config.logger.info("");
|
|
53895
|
+
const workerConfigs = ctx.allWorkerConfigs;
|
|
53875
53896
|
for (const workerConfig of workerConfigs) {
|
|
53876
53897
|
const bindings = wrangler.unstable_convertConfigBindingsToStartWorkerBindings(workerConfig);
|
|
53877
53898
|
wrangler.unstable_printBindings(bindings, workerConfig.tail_consumers, workerConfig.streaming_tail_consumers, workerConfig.containers, {
|
|
@@ -53884,15 +53905,6 @@ function addBindingsShortcut(server, ctx) {
|
|
|
53884
53905
|
}
|
|
53885
53906
|
}
|
|
53886
53907
|
};
|
|
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
53908
|
const openExplorerShortcut = {
|
|
53897
53909
|
key: "e",
|
|
53898
53910
|
description: "open local explorer",
|
|
@@ -53908,16 +53920,7 @@ function addExplorerShortcut(server) {
|
|
|
53908
53920
|
});
|
|
53909
53921
|
}
|
|
53910
53922
|
};
|
|
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: [{
|
|
53923
|
+
const toggleTunnelShortcut = {
|
|
53921
53924
|
key: "t",
|
|
53922
53925
|
description: "start or close tunnel",
|
|
53923
53926
|
action: () => {
|
|
@@ -53926,13 +53929,29 @@ function addTunnelShortcut(server, ctx) {
|
|
|
53926
53929
|
server.config.logger.error(import_picocolors.default.red(`Error: ${message}`));
|
|
53927
53930
|
});
|
|
53928
53931
|
}
|
|
53929
|
-
}
|
|
53932
|
+
};
|
|
53933
|
+
const extendTunnelExpiryShortcut = {
|
|
53930
53934
|
key: "a",
|
|
53931
53935
|
description: "extend tunnel by 1 hour",
|
|
53932
53936
|
action: () => {
|
|
53933
53937
|
extendTunnelExpiry();
|
|
53934
53938
|
}
|
|
53935
|
-
}
|
|
53939
|
+
};
|
|
53940
|
+
const bindCLIShortcuts = server.bindCLIShortcuts.bind(server);
|
|
53941
|
+
server.bindCLIShortcuts = (options) => {
|
|
53942
|
+
if (server.httpServer && process.stdin.isTTY && !process.env.CI && options?.print) {
|
|
53943
|
+
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}`));
|
|
53944
|
+
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}`));
|
|
53945
|
+
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"}`));
|
|
53946
|
+
}
|
|
53947
|
+
bindCLIShortcuts(options);
|
|
53948
|
+
};
|
|
53949
|
+
server.bindCLIShortcuts({ customShortcuts: [
|
|
53950
|
+
printBindingsShortcut,
|
|
53951
|
+
openExplorerShortcut,
|
|
53952
|
+
toggleTunnelShortcut,
|
|
53953
|
+
extendTunnelExpiryShortcut
|
|
53954
|
+
] });
|
|
53936
53955
|
}
|
|
53937
53956
|
|
|
53938
53957
|
//#endregion
|