@cloudflare/vite-plugin 1.49.1 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +344 -278
- package/dist/index.mjs.map +1 -1
- package/dist/{open-PBXRGS4R-7GUxLVbA.mjs → open-PBXRGS4R-MlJKk7qC.mjs} +4 -4
- package/dist/open-PBXRGS4R-MlJKk7qC.mjs.map +1 -0
- package/dist/{package-B6tEDLa5.mjs → package-21IUaIs8.mjs} +2 -2
- package/dist/{package-B6tEDLa5.mjs.map → package-21IUaIs8.mjs.map} +1 -1
- package/package.json +9 -9
- package/dist/open-PBXRGS4R-7GUxLVbA.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import assert from "node:assert";
|
|
|
5
5
|
import { CoreHeaders, CorePaths, DeferredPromise, Log, LogLevel, Miniflare, MiniflareCoreError, Mutex, Request as Request$1, Response as Response$1, buildPublicUrl, coupleWebSocket, getDefaultDevRegistryPath, getNodeCompat, getWorkerRegistry, kUnsafeEphemeralUniqueKey, parseModuleFallbackRequest } from "miniflare";
|
|
6
6
|
import * as wrangler from "wrangler";
|
|
7
7
|
import * as path2 from "node:path";
|
|
8
|
-
import
|
|
8
|
+
import path, { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
9
9
|
import * as util$1 from "node:util";
|
|
10
10
|
import util, { TextEncoder as TextEncoder$1, format, inspect, promisify, styleText } from "node:util";
|
|
11
11
|
import * as vite from "vite";
|
|
@@ -1882,8 +1882,8 @@ __name$4(constructWranglerConfig, "constructWranglerConfig");
|
|
|
1882
1882
|
|
|
1883
1883
|
//#endregion
|
|
1884
1884
|
//#region ../workers-utils/dist/chunk-53IMCORZ.mjs
|
|
1885
|
-
function isDirectory$1(path$
|
|
1886
|
-
return fs2.statSync(path$
|
|
1885
|
+
function isDirectory$1(path$2) {
|
|
1886
|
+
return fs2.statSync(path$2, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
1887
1887
|
}
|
|
1888
1888
|
__name$4(isDirectory$1, "isDirectory");
|
|
1889
1889
|
function removeDir$1(dirPath, { fireAndForget = false } = {}) {
|
|
@@ -1926,7 +1926,7 @@ function getEnv(name) {
|
|
|
1926
1926
|
}
|
|
1927
1927
|
__name$4(getEnv, "getEnv");
|
|
1928
1928
|
function normalizePath$2(p$2) {
|
|
1929
|
-
return p$2 ?
|
|
1929
|
+
return p$2 ? path.normalize(path.join(p$2, ".")) : void 0;
|
|
1930
1930
|
}
|
|
1931
1931
|
__name$4(normalizePath$2, "normalizePath");
|
|
1932
1932
|
function homeDir() {
|
|
@@ -1934,13 +1934,13 @@ function homeDir() {
|
|
|
1934
1934
|
os.homedir(),
|
|
1935
1935
|
getEnv("USERPROFILE"),
|
|
1936
1936
|
getEnv("HOME"),
|
|
1937
|
-
getEnv("HOMEDRIVE") || getEnv("HOMEPATH") ?
|
|
1937
|
+
getEnv("HOMEDRIVE") || getEnv("HOMEPATH") ? path.join(getEnv("HOMEDRIVE") ?? "", getEnv("HOMEPATH") ?? "") : void 0
|
|
1938
1938
|
].find(isNonEmpty));
|
|
1939
1939
|
return normalizePath$2(os.homedir() || getEnv("HOME"));
|
|
1940
1940
|
}
|
|
1941
1941
|
__name$4(homeDir, "homeDir");
|
|
1942
1942
|
function joinToBase(base, segments) {
|
|
1943
|
-
return base ?
|
|
1943
|
+
return base ? path.join(base, ...segments) : void 0;
|
|
1944
1944
|
}
|
|
1945
1945
|
__name$4(joinToBase, "joinToBase");
|
|
1946
1946
|
function tempDir() {
|
|
@@ -1976,7 +1976,7 @@ function baseDir() {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
__name$4(baseDir, "baseDir");
|
|
1978
1978
|
function valOrPath(value, segments) {
|
|
1979
|
-
return value ||
|
|
1979
|
+
return value || path.join(...segments);
|
|
1980
1980
|
}
|
|
1981
1981
|
__name$4(valOrPath, "valOrPath");
|
|
1982
1982
|
function windowsAppData() {
|
|
@@ -2016,10 +2016,10 @@ function xdgCache() {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
__name$4(xdgCache, "xdgCache");
|
|
2018
2018
|
function xdgAppPaths(name) {
|
|
2019
|
-
const segment =
|
|
2019
|
+
const segment = path.parse(name).name;
|
|
2020
2020
|
return {
|
|
2021
|
-
config: /* @__PURE__ */ __name$4(() =>
|
|
2022
|
-
cache: /* @__PURE__ */ __name$4(() =>
|
|
2021
|
+
config: /* @__PURE__ */ __name$4(() => path.join(xdgConfig(), segment), "config"),
|
|
2022
|
+
cache: /* @__PURE__ */ __name$4(() => path.join(xdgCache(), segment), "cache")
|
|
2023
2023
|
};
|
|
2024
2024
|
}
|
|
2025
2025
|
__name$4(xdgAppPaths, "xdgAppPaths");
|
|
@@ -2027,7 +2027,7 @@ function getGlobalConfigPath({ appName = "wrangler", leadingDot = true, useLegac
|
|
|
2027
2027
|
const dirName = `${leadingDot ? "." : ""}${appName}`;
|
|
2028
2028
|
const configDir = xdgAppPaths(dirName).config();
|
|
2029
2029
|
if (useLegacyHomeDir) {
|
|
2030
|
-
const legacyConfigDir =
|
|
2030
|
+
const legacyConfigDir = path.join(os.homedir(), dirName);
|
|
2031
2031
|
if (isDirectory$1(legacyConfigDir)) return legacyConfigDir;
|
|
2032
2032
|
}
|
|
2033
2033
|
return configDir;
|
|
@@ -4404,7 +4404,7 @@ function resolveWranglerConfigPath$1({ config: config$2, script }, options) {
|
|
|
4404
4404
|
deployConfigPath: void 0,
|
|
4405
4405
|
redirected: false
|
|
4406
4406
|
};
|
|
4407
|
-
return findWranglerConfig$2(script !== void 0 ?
|
|
4407
|
+
return findWranglerConfig$2(script !== void 0 ? path.dirname(script) : process.cwd(), options);
|
|
4408
4408
|
}
|
|
4409
4409
|
__name$4(resolveWranglerConfigPath$1, "resolveWranglerConfigPath");
|
|
4410
4410
|
function findWranglerConfig$2(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
|
|
@@ -4435,15 +4435,15 @@ function findRedirectedWranglerConfig$1(cwd, userConfigPath) {
|
|
|
4435
4435
|
const deployConfigFile = readFileSync$1(deployConfigPath);
|
|
4436
4436
|
try {
|
|
4437
4437
|
const deployConfig = parseJSONC$1(deployConfigFile, deployConfigPath);
|
|
4438
|
-
redirectedConfigPath = deployConfig.configPath &&
|
|
4438
|
+
redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
|
|
4439
4439
|
} catch (e) {
|
|
4440
|
-
throw new UserError(`Failed to parse the deploy configuration file at ${
|
|
4440
|
+
throw new UserError(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
|
|
4441
4441
|
cause: e,
|
|
4442
4442
|
telemetryMessage: false
|
|
4443
4443
|
});
|
|
4444
4444
|
}
|
|
4445
4445
|
if (!redirectedConfigPath) throw new UserError(esm_default$2`
|
|
4446
|
-
A deploy configuration file was found at "${
|
|
4446
|
+
A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
|
|
4447
4447
|
But this is not valid - the required "configPath" property was not found.
|
|
4448
4448
|
Instead this file contains:
|
|
4449
4449
|
\`\`\`
|
|
@@ -4451,13 +4451,13 @@ function findRedirectedWranglerConfig$1(cwd, userConfigPath) {
|
|
|
4451
4451
|
\`\`\`
|
|
4452
4452
|
`, { telemetryMessage: false });
|
|
4453
4453
|
if (!existsSync(redirectedConfigPath)) throw new UserError(esm_default$2`
|
|
4454
|
-
There is a deploy configuration at "${
|
|
4455
|
-
But the redirected configuration path it points to, "${
|
|
4454
|
+
There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
|
|
4455
|
+
But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
|
|
4456
4456
|
`, { telemetryMessage: false });
|
|
4457
4457
|
if (userConfigPath) {
|
|
4458
|
-
if (
|
|
4459
|
-
Found both a user configuration file at "${
|
|
4460
|
-
and a deploy configuration file at "${
|
|
4458
|
+
if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG$1) !== deployConfigPath) throw new UserError(esm_default$2`
|
|
4459
|
+
Found both a user configuration file at "${path.relative(".", userConfigPath)}"
|
|
4460
|
+
and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
|
|
4461
4461
|
But these do not share the same base path so it is not clear which should be used.
|
|
4462
4462
|
`, { telemetryMessage: false });
|
|
4463
4463
|
}
|
|
@@ -5649,10 +5649,10 @@ var require_util$5 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
|
|
|
5649
5649
|
if (!isHttpOrHttpsPrefixed(url$2.origin || url$2.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5650
5650
|
const port = url$2.port != null ? url$2.port : url$2.protocol === "https:" ? 443 : 80;
|
|
5651
5651
|
let origin = url$2.origin != null ? url$2.origin : `${url$2.protocol || ""}//${url$2.hostname || ""}:${port}`;
|
|
5652
|
-
let path$
|
|
5652
|
+
let path$2 = url$2.path != null ? url$2.path : `${url$2.pathname || ""}${url$2.search || ""}`;
|
|
5653
5653
|
if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1);
|
|
5654
|
-
if (path$
|
|
5655
|
-
return new URL(`${origin}${path$
|
|
5654
|
+
if (path$2 && path$2[0] !== "/") path$2 = `/${path$2}`;
|
|
5655
|
+
return new URL(`${origin}${path$2}`);
|
|
5656
5656
|
}
|
|
5657
5657
|
if (!isHttpOrHttpsPrefixed(url$2.origin || url$2.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5658
5658
|
return url$2;
|
|
@@ -6527,8 +6527,8 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
6527
6527
|
debugLog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$6, error$2.message);
|
|
6528
6528
|
});
|
|
6529
6529
|
diagnosticsChannel$1.subscribe("undici:client:sendHeaders", (evt) => {
|
|
6530
|
-
const { request: { method, path: path$
|
|
6531
|
-
debugLog("sending request to %s %s%s", method, origin, path$
|
|
6530
|
+
const { request: { method, path: path$2, origin } } = evt;
|
|
6531
|
+
debugLog("sending request to %s %s%s", method, origin, path$2);
|
|
6532
6532
|
});
|
|
6533
6533
|
}
|
|
6534
6534
|
let isTrackingRequestEvents = false;
|
|
@@ -6540,16 +6540,16 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
6540
6540
|
}
|
|
6541
6541
|
isTrackingRequestEvents = true;
|
|
6542
6542
|
diagnosticsChannel$1.subscribe("undici:request:headers", (evt) => {
|
|
6543
|
-
const { request: { method, path: path$
|
|
6544
|
-
debugLog("received response to %s %s%s - HTTP %d", method, origin, path$
|
|
6543
|
+
const { request: { method, path: path$2, origin }, response: { statusCode } } = evt;
|
|
6544
|
+
debugLog("received response to %s %s%s - HTTP %d", method, origin, path$2, statusCode);
|
|
6545
6545
|
});
|
|
6546
6546
|
diagnosticsChannel$1.subscribe("undici:request:trailers", (evt) => {
|
|
6547
|
-
const { request: { method, path: path$
|
|
6548
|
-
debugLog("trailers received from %s %s%s", method, origin, path$
|
|
6547
|
+
const { request: { method, path: path$2, origin } } = evt;
|
|
6548
|
+
debugLog("trailers received from %s %s%s", method, origin, path$2);
|
|
6549
6549
|
});
|
|
6550
6550
|
diagnosticsChannel$1.subscribe("undici:request:error", (evt) => {
|
|
6551
|
-
const { request: { method, path: path$
|
|
6552
|
-
debugLog("request to %s %s%s errored - %s", method, origin, path$
|
|
6551
|
+
const { request: { method, path: path$2, origin }, error: error$2 } = evt;
|
|
6552
|
+
debugLog("request to %s %s%s errored - %s", method, origin, path$2, error$2.message);
|
|
6553
6553
|
});
|
|
6554
6554
|
}
|
|
6555
6555
|
let isTrackingWebSocketEvents = false;
|
|
@@ -6610,10 +6610,10 @@ var require_request$1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
6610
6610
|
}
|
|
6611
6611
|
const kHandler = Symbol("handler");
|
|
6612
6612
|
var Request$6 = class {
|
|
6613
|
-
constructor(origin, { path: path$
|
|
6614
|
-
if (typeof path$
|
|
6615
|
-
else if (path$
|
|
6616
|
-
else if (invalidPathRegex.test(path$
|
|
6613
|
+
constructor(origin, { path: path$2, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
|
|
6614
|
+
if (typeof path$2 !== "string") throw new InvalidArgumentError$35("path must be a string");
|
|
6615
|
+
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");
|
|
6616
|
+
else if (invalidPathRegex.test(path$2)) throw new InvalidArgumentError$35("invalid request path");
|
|
6617
6617
|
if (typeof method !== "string") throw new InvalidArgumentError$35("method must be a string");
|
|
6618
6618
|
else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$2(method)) throw new InvalidArgumentError$35("invalid request method");
|
|
6619
6619
|
if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$35("upgrade must be a string");
|
|
@@ -6654,7 +6654,7 @@ var require_request$1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
6654
6654
|
this.completed = false;
|
|
6655
6655
|
this.aborted = false;
|
|
6656
6656
|
this.upgrade = upgrade$1 || null;
|
|
6657
|
-
this.path = query ? serializePathWithQuery$3(path$
|
|
6657
|
+
this.path = query ? serializePathWithQuery$3(path$2, query) : path$2;
|
|
6658
6658
|
this.origin = origin;
|
|
6659
6659
|
this.protocol = getProtocolFromUrlString(origin);
|
|
6660
6660
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -11253,7 +11253,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
11253
11253
|
* @returns
|
|
11254
11254
|
*/
|
|
11255
11255
|
function writeH1(client, request$2) {
|
|
11256
|
-
const { method, path: path$
|
|
11256
|
+
const { method, path: path$2, host, upgrade: upgrade$1, blocking, reset } = request$2;
|
|
11257
11257
|
let { body, headers, contentLength } = request$2;
|
|
11258
11258
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
11259
11259
|
if (util$22.isFormDataLike(body)) {
|
|
@@ -11299,7 +11299,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
11299
11299
|
if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
|
|
11300
11300
|
if (blocking) socket[kBlocking] = true;
|
|
11301
11301
|
if (socket.setTypeOfService) socket.setTypeOfService(request$2.typeOfService);
|
|
11302
|
-
let header = `${method} ${path$
|
|
11302
|
+
let header = `${method} ${path$2} HTTP/1.1\r\n`;
|
|
11303
11303
|
if (typeof host === "string") header += `host: ${host}\r\n`;
|
|
11304
11304
|
else header += client[kHostHeader$1];
|
|
11305
11305
|
if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
|
|
@@ -11835,7 +11835,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
11835
11835
|
function writeH2(client, request$2) {
|
|
11836
11836
|
const requestTimeout = request$2.bodyTimeout ?? client[kBodyTimeout$1];
|
|
11837
11837
|
const session = client[kHTTP2Session];
|
|
11838
|
-
const { method, path: path$
|
|
11838
|
+
const { method, path: path$2, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
|
|
11839
11839
|
let { body } = request$2;
|
|
11840
11840
|
if (upgrade$1 != null && upgrade$1 !== "websocket") {
|
|
11841
11841
|
util$21.errorRequest(client, request$2, new InvalidArgumentError$30(`Custom upgrade "${upgrade$1}" not supported over HTTP/2`));
|
|
@@ -11888,7 +11888,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
11888
11888
|
}
|
|
11889
11889
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
11890
11890
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
11891
|
-
headers[HTTP2_HEADER_PATH] = path$
|
|
11891
|
+
headers[HTTP2_HEADER_PATH] = path$2;
|
|
11892
11892
|
if (protocol === "ws:" || protocol === "wss:") headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
11893
11893
|
else headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11894
11894
|
stream$2 = session.request(headers, {
|
|
@@ -11930,7 +11930,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm
|
|
|
11930
11930
|
stream$2.setTimeout(requestTimeout);
|
|
11931
11931
|
return true;
|
|
11932
11932
|
}
|
|
11933
|
-
headers[HTTP2_HEADER_PATH] = path$
|
|
11933
|
+
headers[HTTP2_HEADER_PATH] = path$2;
|
|
11934
11934
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11935
11935
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
11936
11936
|
if (body && typeof body.read === "function") body.read(0);
|
|
@@ -13795,8 +13795,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pn
|
|
|
13795
13795
|
}
|
|
13796
13796
|
if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$1);
|
|
13797
13797
|
};
|
|
13798
|
-
const { origin, path: path$
|
|
13799
|
-
opts.path = origin + path$
|
|
13798
|
+
const { origin, path: path$2 = "/", headers = {} } = opts;
|
|
13799
|
+
opts.path = origin + path$2;
|
|
13800
13800
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
13801
13801
|
const { host } = new URL(origin);
|
|
13802
13802
|
headers.host = host;
|
|
@@ -15581,16 +15581,16 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
|
|
|
15581
15581
|
}
|
|
15582
15582
|
return normalizedQp;
|
|
15583
15583
|
}
|
|
15584
|
-
function safeUrl(path$
|
|
15585
|
-
if (typeof path$
|
|
15586
|
-
const pathSegments = path$
|
|
15587
|
-
if (pathSegments.length !== 2) return path$
|
|
15584
|
+
function safeUrl(path$2) {
|
|
15585
|
+
if (typeof path$2 !== "string") return path$2;
|
|
15586
|
+
const pathSegments = path$2.split("?", 3);
|
|
15587
|
+
if (pathSegments.length !== 2) return path$2;
|
|
15588
15588
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
15589
15589
|
qp.sort();
|
|
15590
15590
|
return [...pathSegments, qp.toString()].join("?");
|
|
15591
15591
|
}
|
|
15592
|
-
function matchKey(mockDispatch$1, { path: path$
|
|
15593
|
-
const pathMatch = matchValue$1(mockDispatch$1.path, path$
|
|
15592
|
+
function matchKey(mockDispatch$1, { path: path$2, method, body, headers }) {
|
|
15593
|
+
const pathMatch = matchValue$1(mockDispatch$1.path, path$2);
|
|
15594
15594
|
const methodMatch = matchValue$1(mockDispatch$1.method, method);
|
|
15595
15595
|
const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
|
|
15596
15596
|
const headersMatch = matchHeaders(mockDispatch$1, headers);
|
|
@@ -15608,8 +15608,8 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
|
|
|
15608
15608
|
const basePath = key.query ? serializePathWithQuery$2(key.path, key.query) : key.path;
|
|
15609
15609
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
15610
15610
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
15611
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$
|
|
15612
|
-
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$
|
|
15611
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path$2, ignoreTrailingSlash }) => {
|
|
15612
|
+
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path$2)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path$2), resolvedPath);
|
|
15613
15613
|
});
|
|
15614
15614
|
if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
15615
15615
|
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
|
|
@@ -15652,15 +15652,15 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
|
|
|
15652
15652
|
/**
|
|
15653
15653
|
* @param {string} path Path to remove trailing slash from
|
|
15654
15654
|
*/
|
|
15655
|
-
function removeTrailingSlash(path$
|
|
15656
|
-
while (path$
|
|
15657
|
-
if (path$
|
|
15658
|
-
return path$
|
|
15655
|
+
function removeTrailingSlash(path$2) {
|
|
15656
|
+
while (path$2.endsWith("/")) path$2 = path$2.slice(0, -1);
|
|
15657
|
+
if (path$2.length === 0) path$2 = "/";
|
|
15658
|
+
return path$2;
|
|
15659
15659
|
}
|
|
15660
15660
|
function buildKey$1(opts) {
|
|
15661
|
-
const { path: path$
|
|
15661
|
+
const { path: path$2, method, body, headers, query } = opts;
|
|
15662
15662
|
return {
|
|
15663
|
-
path: path$
|
|
15663
|
+
path: path$2,
|
|
15664
15664
|
method,
|
|
15665
15665
|
body,
|
|
15666
15666
|
headers,
|
|
@@ -16227,10 +16227,10 @@ var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJS$2({ "../
|
|
|
16227
16227
|
});
|
|
16228
16228
|
}
|
|
16229
16229
|
format(pendingInterceptors) {
|
|
16230
|
-
const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$
|
|
16230
|
+
const withPrettyHeaders = pendingInterceptors.map(({ method, path: path$2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
16231
16231
|
Method: method,
|
|
16232
16232
|
Origin: origin,
|
|
16233
|
-
Path: path$
|
|
16233
|
+
Path: path$2,
|
|
16234
16234
|
"Status code": statusCode,
|
|
16235
16235
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
16236
16236
|
Invocations: timesInvoked,
|
|
@@ -16288,8 +16288,8 @@ var require_mock_agent = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnp
|
|
|
16288
16288
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
16289
16289
|
const dispatchOpts = { ...opts };
|
|
16290
16290
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
16291
|
-
const [path$
|
|
16292
|
-
dispatchOpts.path = `${path$
|
|
16291
|
+
const [path$2, searchParams] = dispatchOpts.path.split("?");
|
|
16292
|
+
dispatchOpts.path = `${path$2}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
|
|
16293
16293
|
}
|
|
16294
16294
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
16295
16295
|
}
|
|
@@ -16766,10 +16766,10 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$2({ "../../node_modul
|
|
|
16766
16766
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
16767
16767
|
*/
|
|
16768
16768
|
async loadSnapshots(filePath) {
|
|
16769
|
-
const path$
|
|
16770
|
-
if (!path$
|
|
16769
|
+
const path$2 = filePath || this.#snapshotPath;
|
|
16770
|
+
if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16771
16771
|
try {
|
|
16772
|
-
const data$1 = await readFile(resolve$3(path$
|
|
16772
|
+
const data$1 = await readFile(resolve$3(path$2), "utf8");
|
|
16773
16773
|
const parsed = JSON.parse(data$1);
|
|
16774
16774
|
if (Array.isArray(parsed)) {
|
|
16775
16775
|
this.#snapshots.clear();
|
|
@@ -16777,7 +16777,7 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$2({ "../../node_modul
|
|
|
16777
16777
|
} else this.#snapshots = new Map(Object.entries(parsed));
|
|
16778
16778
|
} catch (error$2) {
|
|
16779
16779
|
if (error$2.code === "ENOENT") this.#snapshots.clear();
|
|
16780
|
-
else throw new UndiciError$1(`Failed to load snapshots from ${path$
|
|
16780
|
+
else throw new UndiciError$1(`Failed to load snapshots from ${path$2}`, { cause: error$2 });
|
|
16781
16781
|
}
|
|
16782
16782
|
}
|
|
16783
16783
|
/**
|
|
@@ -16787,9 +16787,9 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$2({ "../../node_modul
|
|
|
16787
16787
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
16788
16788
|
*/
|
|
16789
16789
|
async saveSnapshots(filePath) {
|
|
16790
|
-
const path$
|
|
16791
|
-
if (!path$
|
|
16792
|
-
const resolvedPath = resolve$3(path$
|
|
16790
|
+
const path$2 = filePath || this.#snapshotPath;
|
|
16791
|
+
if (!path$2) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16792
|
+
const resolvedPath = resolve$3(path$2);
|
|
16793
16793
|
await mkdir(dirname$2(resolvedPath), { recursive: true });
|
|
16794
16794
|
const data$1 = Array.from(this.#snapshots.entries()).map(([hash$1, snapshot]) => ({
|
|
16795
16795
|
hash: hash$1,
|
|
@@ -17363,11 +17363,11 @@ var require_redirect_handler = /* @__PURE__ */ __commonJS$2({ "../../node_module
|
|
|
17363
17363
|
return;
|
|
17364
17364
|
}
|
|
17365
17365
|
const { origin, pathname, search } = util$9.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
17366
|
-
const path$
|
|
17367
|
-
const redirectUrlString = `${origin}${path$
|
|
17366
|
+
const path$2 = search ? `${pathname}${search}` : pathname;
|
|
17367
|
+
const redirectUrlString = `${origin}${path$2}`;
|
|
17368
17368
|
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.`);
|
|
17369
17369
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
17370
|
-
this.opts.path = path$
|
|
17370
|
+
this.opts.path = path$2;
|
|
17371
17371
|
this.opts.origin = origin;
|
|
17372
17372
|
this.opts.query = null;
|
|
17373
17373
|
}
|
|
@@ -22333,10 +22333,10 @@ var require_fetch = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/und
|
|
|
22333
22333
|
const url$2 = requestCurrentURL(request$2);
|
|
22334
22334
|
/** @type {import('../../..').Agent} */
|
|
22335
22335
|
const agent = fetchParams.controller.dispatcher;
|
|
22336
|
-
const path$
|
|
22336
|
+
const path$2 = url$2.pathname + url$2.search;
|
|
22337
22337
|
const hasTrailingQuestionMark = url$2.search.length === 0 && url$2.href[url$2.href.length - url$2.hash.length - 1] === "?";
|
|
22338
22338
|
return new Promise((resolve$4, reject) => agent.dispatch({
|
|
22339
|
-
path: hasTrailingQuestionMark ? `${path$
|
|
22339
|
+
path: hasTrailingQuestionMark ? `${path$2}?` : path$2,
|
|
22340
22340
|
origin: url$2.origin,
|
|
22341
22341
|
method: request$2.method,
|
|
22342
22342
|
body: agent.isMockActive ? request$2.body && (request$2.body.source || request$2.body.stream) : body,
|
|
@@ -23118,9 +23118,9 @@ var require_util$2 = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
|
|
|
23118
23118
|
* path-value = <any CHAR except CTLs or ";">
|
|
23119
23119
|
* @param {string} path
|
|
23120
23120
|
*/
|
|
23121
|
-
function validateCookiePath(path$
|
|
23122
|
-
for (let i$1 = 0; i$1 < path$
|
|
23123
|
-
const code = path$
|
|
23121
|
+
function validateCookiePath(path$2) {
|
|
23122
|
+
for (let i$1 = 0; i$1 < path$2.length; ++i$1) {
|
|
23123
|
+
const code = path$2.charCodeAt(i$1);
|
|
23124
23124
|
if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path");
|
|
23125
23125
|
}
|
|
23126
23126
|
}
|
|
@@ -26248,9 +26248,9 @@ var require_undici = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
|
|
|
26248
26248
|
if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
|
|
26249
26249
|
if (opts && opts.path != null) {
|
|
26250
26250
|
if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
|
|
26251
|
-
let path$
|
|
26252
|
-
if (!opts.path.startsWith("/")) path$
|
|
26253
|
-
url$2 = new URL(util$2.parseOrigin(url$2).origin + path$
|
|
26251
|
+
let path$2 = opts.path;
|
|
26252
|
+
if (!opts.path.startsWith("/")) path$2 = `/${path$2}`;
|
|
26253
|
+
url$2 = new URL(util$2.parseOrigin(url$2).origin + path$2);
|
|
26254
26254
|
} else {
|
|
26255
26255
|
if (!opts) opts = typeof url$2 === "object" ? url$2 : {};
|
|
26256
26256
|
url$2 = util$2.parseURL(url$2);
|
|
@@ -27620,6 +27620,17 @@ var require_update_check = __commonJS$1({ "../../node_modules/.pnpm/update-check
|
|
|
27620
27620
|
return null;
|
|
27621
27621
|
};
|
|
27622
27622
|
} });
|
|
27623
|
+
var ARTIFACTS_EVENT_TYPES = [
|
|
27624
|
+
"cf.artifacts.repo.created",
|
|
27625
|
+
"cf.artifacts.repo.deleted",
|
|
27626
|
+
"cf.artifacts.repo.forked",
|
|
27627
|
+
"cf.artifacts.repo.imported",
|
|
27628
|
+
"cf.artifacts.repo.pushed",
|
|
27629
|
+
"cf.artifacts.repo.cloned",
|
|
27630
|
+
"cf.artifacts.repo.fetched",
|
|
27631
|
+
"cf.artifacts.repo.token.created",
|
|
27632
|
+
"cf.artifacts.repo.token.revoked"
|
|
27633
|
+
];
|
|
27623
27634
|
function getDurableObjectExports(exports$2) {
|
|
27624
27635
|
return partitionExports$1(exports$2)["durable-object"];
|
|
27625
27636
|
}
|
|
@@ -41578,7 +41589,7 @@ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRA
|
|
|
41578
41589
|
var getRegistryPath = getEnvironmentVariableFactory({
|
|
41579
41590
|
variableName: "WRANGLER_REGISTRY_PATH",
|
|
41580
41591
|
defaultValue() {
|
|
41581
|
-
return
|
|
41592
|
+
return path.join(getGlobalConfigPath(), "registry");
|
|
41582
41593
|
}
|
|
41583
41594
|
});
|
|
41584
41595
|
var getD1ExtraLocationChoices = getEnvironmentVariableFactory({ variableName: "WRANGLER_D1_EXTRA_LOCATION_CHOICES" });
|
|
@@ -41617,7 +41628,7 @@ var getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
|
41617
41628
|
});
|
|
41618
41629
|
var getLocalObservabilityEnabledFromEnv = getBooleanEnvironmentVariableFactory({
|
|
41619
41630
|
variableName: "X_LOCAL_OBSERVABILITY",
|
|
41620
|
-
defaultValue:
|
|
41631
|
+
defaultValue: true
|
|
41621
41632
|
});
|
|
41622
41633
|
var getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({
|
|
41623
41634
|
variableName: "X_BROWSER_HEADFUL",
|
|
@@ -41988,7 +41999,7 @@ function isPagesConfig(rawConfig) {
|
|
|
41988
41999
|
}
|
|
41989
42000
|
__name$4(isPagesConfig, "isPagesConfig");
|
|
41990
42001
|
function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {
|
|
41991
|
-
const diagnostics = new Diagnostics(`Processing ${configPath ?
|
|
42002
|
+
const diagnostics = new Diagnostics(`Processing ${configPath ? path.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
|
|
41992
42003
|
const isRedirectedConfig2 = isRedirectedRawConfig$1(rawConfig, configPath, userConfigPath);
|
|
41993
42004
|
if ("legacy_env" in rawConfig) {
|
|
41994
42005
|
if (!isRedirectedConfig2) diagnostics.errors.push(dedent$2`
|
|
@@ -42106,34 +42117,34 @@ function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {
|
|
|
42106
42117
|
else validateOptionalProperty(diagnostics, "build", "watch_dir", watch_dir, "string");
|
|
42107
42118
|
return {
|
|
42108
42119
|
command,
|
|
42109
|
-
watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir2) =>
|
|
42120
|
+
watch_dir: command && configPath ? Array.isArray(watch_dir) ? watch_dir.map((dir2) => path.relative(process.cwd(), path.join(path.dirname(configPath), `${dir2}`))) : path.relative(process.cwd(), path.join(path.dirname(configPath), `${watch_dir}`)) : watch_dir,
|
|
42110
42121
|
cwd
|
|
42111
42122
|
};
|
|
42112
42123
|
}
|
|
42113
42124
|
__name$4(normalizeAndValidateBuild, "normalizeAndValidateBuild");
|
|
42114
42125
|
function normalizeAndValidateMainField(configPath, rawMain) {
|
|
42115
|
-
const configDir =
|
|
42126
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
42116
42127
|
if (rawMain !== void 0) if (typeof rawMain === "string") {
|
|
42117
|
-
const directory =
|
|
42118
|
-
return
|
|
42128
|
+
const directory = path.resolve(configDir);
|
|
42129
|
+
return path.resolve(directory, rawMain);
|
|
42119
42130
|
} else return rawMain;
|
|
42120
42131
|
else return;
|
|
42121
42132
|
}
|
|
42122
42133
|
__name$4(normalizeAndValidateMainField, "normalizeAndValidateMainField");
|
|
42123
42134
|
function normalizeAndValidateBaseDirField(configPath, rawDir) {
|
|
42124
|
-
const configDir =
|
|
42135
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
42125
42136
|
if (rawDir !== void 0) if (typeof rawDir === "string") {
|
|
42126
|
-
const directory =
|
|
42127
|
-
return
|
|
42137
|
+
const directory = path.resolve(configDir);
|
|
42138
|
+
return path.resolve(directory, rawDir);
|
|
42128
42139
|
} else return rawDir;
|
|
42129
42140
|
else return;
|
|
42130
42141
|
}
|
|
42131
42142
|
__name$4(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
|
|
42132
42143
|
function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
|
|
42133
|
-
const configDir =
|
|
42144
|
+
const configDir = path.dirname(configPath ?? "wrangler.toml");
|
|
42134
42145
|
if (rawPagesDir !== void 0) if (typeof rawPagesDir === "string") {
|
|
42135
|
-
const directory =
|
|
42136
|
-
return
|
|
42146
|
+
const directory = path.resolve(configDir);
|
|
42147
|
+
return path.resolve(directory, rawPagesDir);
|
|
42137
42148
|
} else return rawPagesDir;
|
|
42138
42149
|
else return;
|
|
42139
42150
|
}
|
|
@@ -42187,7 +42198,7 @@ function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryP
|
|
|
42187
42198
|
validateOptionalProperty(diagnostics, "site", "entry-point", legacySiteEntryPoint, "string");
|
|
42188
42199
|
deprecated(diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file:
|
|
42189
42200
|
\`\`\`
|
|
42190
|
-
main = "${
|
|
42201
|
+
main = "${path.join(String(legacySiteEntryPoint) || "workers-site", path.extname(String(legacySiteEntryPoint) || "workers-site") ? "" : "index.js")}"
|
|
42191
42202
|
\`\`\``, false, void 0, "warning");
|
|
42192
42203
|
let siteEntryPoint = legacySiteEntryPoint;
|
|
42193
42204
|
if (!mainEntryPoint && !siteEntryPoint) {
|
|
@@ -42200,7 +42211,7 @@ main = "workers-site/index.js"
|
|
|
42200
42211
|
} else if (mainEntryPoint && siteEntryPoint) diagnostics.errors.push(`Don't define both the \`main\` and \`site.entry-point\` fields in your configuration.
|
|
42201
42212
|
They serve the same purpose: to point to the entry-point of your worker.
|
|
42202
42213
|
Delete the deprecated \`site.entry-point\` field from your config.`);
|
|
42203
|
-
if (configPath && siteEntryPoint) siteEntryPoint =
|
|
42214
|
+
if (configPath && siteEntryPoint) siteEntryPoint = path.relative(process.cwd(), path.join(path.dirname(configPath), siteEntryPoint));
|
|
42204
42215
|
return {
|
|
42205
42216
|
bucket,
|
|
42206
42217
|
"entry-point": siteEntryPoint,
|
|
@@ -42232,7 +42243,7 @@ function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapp
|
|
|
42232
42243
|
if (rawMapping === void 0) return;
|
|
42233
42244
|
const mapping = {};
|
|
42234
42245
|
for (const [name, filePath] of Object.entries(rawMapping)) if (isString$2(diagnostics, `${field}['${name}']`, filePath, void 0)) {
|
|
42235
|
-
if (configPath) mapping[name] = configPath ?
|
|
42246
|
+
if (configPath) mapping[name] = configPath ? path.relative(process.cwd(), path.join(path.dirname(configPath), filePath)) : filePath;
|
|
42236
42247
|
}
|
|
42237
42248
|
return mapping;
|
|
42238
42249
|
}
|
|
@@ -42492,15 +42503,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
42492
42503
|
__name$4(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment");
|
|
42493
42504
|
function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {
|
|
42494
42505
|
const tsconfig = inheritable(diagnostics, topLevelEnv, rawEnv, "tsconfig", isString$2, void 0);
|
|
42495
|
-
return configPath && tsconfig ?
|
|
42506
|
+
return configPath && tsconfig ? path.relative(process.cwd(), path.join(path.dirname(configPath), tsconfig)) : tsconfig;
|
|
42496
42507
|
}
|
|
42497
42508
|
__name$4(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig");
|
|
42498
42509
|
var validateAndNormalizeRules = /* @__PURE__ */ __name$4((diagnostics, topLevelEnv, rawEnv, envName) => {
|
|
42499
42510
|
return inheritable(diagnostics, topLevelEnv, rawEnv, "rules", validateRules(envName), []);
|
|
42500
42511
|
}, "validateAndNormalizeRules");
|
|
42512
|
+
var ARTIFACTS_EVENT_TYPE_SET = new Set(ARTIFACTS_EVENT_TYPES);
|
|
42501
42513
|
var validateTriggers = /* @__PURE__ */ __name$4((diagnostics, triggersFieldName, triggersValue) => {
|
|
42502
42514
|
if (triggersValue === void 0 || triggersValue === null) return true;
|
|
42503
|
-
if (typeof triggersValue !== "object") {
|
|
42515
|
+
if (typeof triggersValue !== "object" || Array.isArray(triggersValue)) {
|
|
42504
42516
|
diagnostics.errors.push(`Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify(triggersValue)}.`);
|
|
42505
42517
|
return false;
|
|
42506
42518
|
}
|
|
@@ -42509,7 +42521,49 @@ var validateTriggers = /* @__PURE__ */ __name$4((diagnostics, triggersFieldName,
|
|
|
42509
42521
|
diagnostics.errors.push(`Expected "${triggersFieldName}.crons" to be of type array, but got ${JSON.stringify(triggersValue)}.`);
|
|
42510
42522
|
isValid = false;
|
|
42511
42523
|
}
|
|
42512
|
-
|
|
42524
|
+
if (hasProperty(triggersValue, "events") && !Array.isArray(triggersValue.events)) {
|
|
42525
|
+
diagnostics.errors.push(`Expected "${triggersFieldName}.events" to be of type array, but got ${JSON.stringify(triggersValue)}.`);
|
|
42526
|
+
isValid = false;
|
|
42527
|
+
} else if (hasProperty(triggersValue, "events") && Array.isArray(triggersValue.events)) for (const [eventIndex, event] of triggersValue.events.entries()) {
|
|
42528
|
+
const eventFieldName = `${triggersFieldName}.events[${eventIndex}]`;
|
|
42529
|
+
if (typeof event !== "object" || event === null || Array.isArray(event)) {
|
|
42530
|
+
diagnostics.errors.push(`Expected "${eventFieldName}" to be of type object, but got ${JSON.stringify(event)}.`);
|
|
42531
|
+
isValid = false;
|
|
42532
|
+
continue;
|
|
42533
|
+
}
|
|
42534
|
+
if (!isRequiredProperty(event, "type", "string") || !ARTIFACTS_EVENT_TYPE_SET.has(event.type)) {
|
|
42535
|
+
diagnostics.errors.push(`Expected "${eventFieldName}.type" to be a supported Artifacts event type, but got ${JSON.stringify(event.type)}.`);
|
|
42536
|
+
isValid = false;
|
|
42537
|
+
}
|
|
42538
|
+
if (hasProperty(event, "filter") && event.filter !== void 0) {
|
|
42539
|
+
if (typeof event.filter !== "object" || event.filter === null || Array.isArray(event.filter)) {
|
|
42540
|
+
diagnostics.errors.push(`Expected "${eventFieldName}.filter" to be of type object, but got ${JSON.stringify(event.filter)}.`);
|
|
42541
|
+
isValid = false;
|
|
42542
|
+
} else for (const [filterName, filterValue] of Object.entries(event.filter)) if (filterName !== "namespace" && filterName !== "repo_name" || typeof filterValue !== "string") {
|
|
42543
|
+
diagnostics.errors.push(`Expected "${eventFieldName}.filter" to contain only string "namespace" and "repo_name" fields, but got ${JSON.stringify(event.filter)}.`);
|
|
42544
|
+
isValid = false;
|
|
42545
|
+
break;
|
|
42546
|
+
}
|
|
42547
|
+
}
|
|
42548
|
+
if (!Array.isArray(event.targets) || event.targets.length === 0) {
|
|
42549
|
+
diagnostics.errors.push(`Expected "${eventFieldName}.targets" to be a non-empty array, but got ${JSON.stringify(event.targets)}.`);
|
|
42550
|
+
isValid = false;
|
|
42551
|
+
} else for (const [targetIndex, target$1] of event.targets.entries()) {
|
|
42552
|
+
const targetFieldName = `${eventFieldName}.targets[${targetIndex}]`;
|
|
42553
|
+
if (typeof target$1 !== "object" || target$1 === null || Array.isArray(target$1) || target$1.type !== "workflow" || typeof target$1.workflow_name !== "string" || target$1.workflow_name.length === 0) {
|
|
42554
|
+
diagnostics.errors.push(`Expected "${targetFieldName}" to be a workflow target with a non-empty "workflow_name", but got ${JSON.stringify(target$1)}.`);
|
|
42555
|
+
isValid = false;
|
|
42556
|
+
continue;
|
|
42557
|
+
}
|
|
42558
|
+
validateAdditionalProperties(diagnostics, targetFieldName, Object.keys(target$1), ["type", "workflow_name"]);
|
|
42559
|
+
}
|
|
42560
|
+
validateAdditionalProperties(diagnostics, eventFieldName, Object.keys(event), [
|
|
42561
|
+
"type",
|
|
42562
|
+
"filter",
|
|
42563
|
+
"targets"
|
|
42564
|
+
]);
|
|
42565
|
+
}
|
|
42566
|
+
isValid = validateAdditionalProperties(diagnostics, triggersFieldName, Object.keys(triggersValue), ["crons", "events"]) && isValid;
|
|
42513
42567
|
return isValid;
|
|
42514
42568
|
}, "validateTriggers");
|
|
42515
42569
|
var validateRules = /* @__PURE__ */ __name$4((envName) => (diagnostics, field, envValue, config2) => {
|
|
@@ -42992,9 +43046,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
42992
43046
|
let resolvedBuildContextPath = void 0;
|
|
42993
43047
|
try {
|
|
42994
43048
|
if (isDockerfile(resolvedImage, configPath)) {
|
|
42995
|
-
const baseDir$1 = configPath ?
|
|
42996
|
-
resolvedImage =
|
|
42997
|
-
resolvedBuildContextPath = containerAppOptional.image_build_context ?
|
|
43049
|
+
const baseDir$1 = configPath ? path.dirname(configPath) : process.cwd();
|
|
43050
|
+
resolvedImage = path.resolve(baseDir$1, resolvedImage);
|
|
43051
|
+
resolvedBuildContextPath = containerAppOptional.image_build_context ? path.resolve(baseDir$1, containerAppOptional.image_build_context) : path.dirname(resolvedImage);
|
|
42998
43052
|
}
|
|
42999
43053
|
} catch (err) {
|
|
43000
43054
|
if (err instanceof Error && err.message) diagnostics.errors.push(err.message);
|
|
@@ -44366,8 +44420,8 @@ function isRemoteValid(targetObject, fieldPath, diagnostics) {
|
|
|
44366
44420
|
}
|
|
44367
44421
|
__name$4(isRemoteValid, "isRemoteValid");
|
|
44368
44422
|
function isDockerfile(imagePath, configPath) {
|
|
44369
|
-
const baseDir$1 = configPath ?
|
|
44370
|
-
const maybeDockerfile =
|
|
44423
|
+
const baseDir$1 = configPath ? path.dirname(configPath) : process.cwd();
|
|
44424
|
+
const maybeDockerfile = path.resolve(baseDir$1, imagePath);
|
|
44371
44425
|
if (fs2.existsSync(maybeDockerfile)) {
|
|
44372
44426
|
if (isDirectory$1(maybeDockerfile)) throw new UserError(`${imagePath} is a directory, you should specify a path to the Dockerfile`, { telemetryMessage: false });
|
|
44373
44427
|
return true;
|
|
@@ -44518,10 +44572,10 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
|
|
|
44518
44572
|
__name$4(validateDurableObjectBinding2, "validateDurableObjectBinding");
|
|
44519
44573
|
function getPackagePath(packageName, projectPath) {
|
|
44520
44574
|
try {
|
|
44521
|
-
return
|
|
44575
|
+
return path.dirname(__require$1.resolve(`${packageName}/package.json`, { paths: [projectPath] }));
|
|
44522
44576
|
} catch {}
|
|
44523
44577
|
try {
|
|
44524
|
-
return
|
|
44578
|
+
return path.dirname(__require$1.resolve(packageName, { paths: [projectPath] }));
|
|
44525
44579
|
} catch {}
|
|
44526
44580
|
}
|
|
44527
44581
|
__name$4(getPackagePath, "getPackagePath");
|
|
@@ -44546,14 +44600,14 @@ function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
|
|
|
44546
44600
|
__name$4(getInstalledPackageVersion, "getInstalledPackageVersion");
|
|
44547
44601
|
function findFileUp(name, startDir, lastDir) {
|
|
44548
44602
|
let dir2 = startDir;
|
|
44549
|
-
const root =
|
|
44603
|
+
const root = path.parse(dir2).root;
|
|
44550
44604
|
while (true) {
|
|
44551
|
-
const candidate =
|
|
44605
|
+
const candidate = path.join(dir2, name);
|
|
44552
44606
|
try {
|
|
44553
44607
|
if (statSync(candidate).isFile()) return candidate;
|
|
44554
44608
|
} catch {}
|
|
44555
44609
|
if (lastDir !== void 0 && dir2 === lastDir) break;
|
|
44556
|
-
const parent =
|
|
44610
|
+
const parent = path.dirname(dir2);
|
|
44557
44611
|
if (parent === dir2 || dir2 === root) break;
|
|
44558
44612
|
dir2 = parent;
|
|
44559
44613
|
}
|
|
@@ -44819,7 +44873,7 @@ var process3 = globalThis.process;
|
|
|
44819
44873
|
var { onExit, load: load$1, unload: unload$1 } = signalExitWrap(processOk$1(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
44820
44874
|
function getWranglerHiddenDirPath(projectRoot) {
|
|
44821
44875
|
projectRoot ??= process.cwd();
|
|
44822
|
-
return
|
|
44876
|
+
return path.join(projectRoot, ".wrangler");
|
|
44823
44877
|
}
|
|
44824
44878
|
__name$4(getWranglerHiddenDirPath, "getWranglerHiddenDirPath");
|
|
44825
44879
|
var STALE_WRANGLER_TMP_DIR_MS = 1440 * 60 * 1e3;
|
|
@@ -44836,7 +44890,7 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
|
|
|
44836
44890
|
const cutoff = Date.now() - STALE_WRANGLER_TMP_DIR_MS;
|
|
44837
44891
|
for (const entry of entries) {
|
|
44838
44892
|
if (!entry.isDirectory()) continue;
|
|
44839
|
-
const entryPath =
|
|
44893
|
+
const entryPath = path.join(tmpRoot, entry.name);
|
|
44840
44894
|
try {
|
|
44841
44895
|
if (fs2.statSync(entryPath).mtimeMs < cutoff) removeDirSync$1(entryPath);
|
|
44842
44896
|
} catch {}
|
|
@@ -44844,10 +44898,10 @@ function sweepStaleWranglerTmpDirs(tmpRoot) {
|
|
|
44844
44898
|
}
|
|
44845
44899
|
__name$4(sweepStaleWranglerTmpDirs, "sweepStaleWranglerTmpDirs");
|
|
44846
44900
|
function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
|
|
44847
|
-
const tmpRoot =
|
|
44901
|
+
const tmpRoot = path.join(getWranglerHiddenDirPath(projectRoot), "tmp");
|
|
44848
44902
|
fs2.mkdirSync(tmpRoot, { recursive: true });
|
|
44849
44903
|
sweepStaleWranglerTmpDirs(tmpRoot);
|
|
44850
|
-
const tmpPrefix =
|
|
44904
|
+
const tmpPrefix = path.join(tmpRoot, `${prefix}-`);
|
|
44851
44905
|
const tmpDir = fs2.realpathSync(fs2.mkdtempSync(tmpPrefix));
|
|
44852
44906
|
const cleanupDir = /* @__PURE__ */ __name$4(() => {
|
|
44853
44907
|
if (cleanup) try {
|
|
@@ -45723,7 +45777,7 @@ async function fetchLatestNpmVersion(name, version2) {
|
|
|
45723
45777
|
__name$4(fetchLatestNpmVersion, "fetchLatestNpmVersion");
|
|
45724
45778
|
async function openInBrowser(url2, logger$1) {
|
|
45725
45779
|
try {
|
|
45726
|
-
const { default: open$1 } = await import("./open-PBXRGS4R-
|
|
45780
|
+
const { default: open$1 } = await import("./open-PBXRGS4R-MlJKk7qC.mjs");
|
|
45727
45781
|
(await open$1(url2)).on("error", (err) => {
|
|
45728
45782
|
handleBrowserOpenError(url2, err, logger$1);
|
|
45729
45783
|
});
|
|
@@ -48279,8 +48333,8 @@ const postfixRE = /[?#].*$/;
|
|
|
48279
48333
|
function cleanUrl(url$2) {
|
|
48280
48334
|
return url$2.replace(postfixRE, "");
|
|
48281
48335
|
}
|
|
48282
|
-
function withTrailingSlash(path$
|
|
48283
|
-
return path$
|
|
48336
|
+
function withTrailingSlash(path$2) {
|
|
48337
|
+
return path$2.endsWith("/") ? path$2 : `${path$2}/`;
|
|
48284
48338
|
}
|
|
48285
48339
|
function createRequestHandler(handler) {
|
|
48286
48340
|
return async (req, res, next) => {
|
|
@@ -48919,11 +48973,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
48919
48973
|
for (let i$1 = startIndex; i$1 < x.issues.length; i$1++) if (x.issues[i$1]?.continue === false) return true;
|
|
48920
48974
|
return false;
|
|
48921
48975
|
}
|
|
48922
|
-
function prefixIssues(path$
|
|
48976
|
+
function prefixIssues(path$2, issues) {
|
|
48923
48977
|
return issues.map((iss) => {
|
|
48924
48978
|
var _a$3;
|
|
48925
48979
|
(_a$3 = iss).path ?? (_a$3.path = []);
|
|
48926
|
-
iss.path.unshift(path$
|
|
48980
|
+
iss.path.unshift(path$2);
|
|
48927
48981
|
return iss;
|
|
48928
48982
|
});
|
|
48929
48983
|
}
|
|
@@ -48988,12 +49042,12 @@ function flattenError(error$2, mapper = (issue$2) => issue$2.message) {
|
|
|
48988
49042
|
}
|
|
48989
49043
|
function formatError(error$2, mapper = (issue$2) => issue$2.message) {
|
|
48990
49044
|
const fieldErrors = { _errors: [] };
|
|
48991
|
-
const processError = (error$3, path$
|
|
48992
|
-
for (const issue$2 of error$3.issues) if (issue$2.code === "invalid_union" && issue$2.errors.length) issue$2.errors.map((issues) => processError({ issues }, [...path$
|
|
48993
|
-
else if (issue$2.code === "invalid_key") processError({ issues: issue$2.issues }, [...path$
|
|
48994
|
-
else if (issue$2.code === "invalid_element") processError({ issues: issue$2.issues }, [...path$
|
|
49045
|
+
const processError = (error$3, path$2 = []) => {
|
|
49046
|
+
for (const issue$2 of error$3.issues) if (issue$2.code === "invalid_union" && issue$2.errors.length) issue$2.errors.map((issues) => processError({ issues }, [...path$2, ...issue$2.path]));
|
|
49047
|
+
else if (issue$2.code === "invalid_key") processError({ issues: issue$2.issues }, [...path$2, ...issue$2.path]);
|
|
49048
|
+
else if (issue$2.code === "invalid_element") processError({ issues: issue$2.issues }, [...path$2, ...issue$2.path]);
|
|
48995
49049
|
else {
|
|
48996
|
-
const fullpath = [...path$
|
|
49050
|
+
const fullpath = [...path$2, ...issue$2.path];
|
|
48997
49051
|
if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue$2));
|
|
48998
49052
|
else {
|
|
48999
49053
|
let curr = fieldErrors;
|
|
@@ -55951,7 +56005,7 @@ function resolveWranglerConfigPath({ config: config$2, script }, options) {
|
|
|
55951
56005
|
deployConfigPath: void 0,
|
|
55952
56006
|
redirected: false
|
|
55953
56007
|
};
|
|
55954
|
-
return findWranglerConfig$1(script !== void 0 ?
|
|
56008
|
+
return findWranglerConfig$1(script !== void 0 ? path.dirname(script) : process.cwd(), options);
|
|
55955
56009
|
}
|
|
55956
56010
|
__name$3(resolveWranglerConfigPath, "resolveWranglerConfigPath");
|
|
55957
56011
|
function findWranglerConfig$1(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {
|
|
@@ -55982,15 +56036,15 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
55982
56036
|
const deployConfigFile = readFileSync$1$1(deployConfigPath);
|
|
55983
56037
|
try {
|
|
55984
56038
|
const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);
|
|
55985
|
-
redirectedConfigPath = deployConfig.configPath &&
|
|
56039
|
+
redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);
|
|
55986
56040
|
} catch (e) {
|
|
55987
|
-
throw new UserError$1(`Failed to parse the deploy configuration file at ${
|
|
56041
|
+
throw new UserError$1(`Failed to parse the deploy configuration file at ${path.relative(".", deployConfigPath)}`, {
|
|
55988
56042
|
cause: e,
|
|
55989
56043
|
telemetryMessage: false
|
|
55990
56044
|
});
|
|
55991
56045
|
}
|
|
55992
56046
|
if (!redirectedConfigPath) throw new UserError$1(esm_default$1`
|
|
55993
|
-
A deploy configuration file was found at "${
|
|
56047
|
+
A deploy configuration file was found at "${path.relative(".", deployConfigPath)}".
|
|
55994
56048
|
But this is not valid - the required "configPath" property was not found.
|
|
55995
56049
|
Instead this file contains:
|
|
55996
56050
|
\`\`\`
|
|
@@ -55998,13 +56052,13 @@ function findRedirectedWranglerConfig(cwd, userConfigPath) {
|
|
|
55998
56052
|
\`\`\`
|
|
55999
56053
|
`, { telemetryMessage: false });
|
|
56000
56054
|
if (!existsSync(redirectedConfigPath)) throw new UserError$1(esm_default$1`
|
|
56001
|
-
There is a deploy configuration at "${
|
|
56002
|
-
But the redirected configuration path it points to, "${
|
|
56055
|
+
There is a deploy configuration at "${path.relative(".", deployConfigPath)}".
|
|
56056
|
+
But the redirected configuration path it points to, "${path.relative(".", redirectedConfigPath)}", does not exist.
|
|
56003
56057
|
`, { telemetryMessage: false });
|
|
56004
56058
|
if (userConfigPath) {
|
|
56005
|
-
if (
|
|
56006
|
-
Found both a user configuration file at "${
|
|
56007
|
-
and a deploy configuration file at "${
|
|
56059
|
+
if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) throw new UserError$1(esm_default$1`
|
|
56060
|
+
Found both a user configuration file at "${path.relative(".", userConfigPath)}"
|
|
56061
|
+
and a deploy configuration file at "${path.relative(".", deployConfigPath)}".
|
|
56008
56062
|
But these do not share the same base path so it is not clear which should be used.
|
|
56009
56063
|
`, { telemetryMessage: false });
|
|
56010
56064
|
}
|
|
@@ -56801,9 +56855,9 @@ async function generate({ compatibilityDate, compatibilityFlags = [] }) {
|
|
|
56801
56855
|
modules: true,
|
|
56802
56856
|
script: (await fsp.readFile(require$1.resolve("workerd/worker.mjs"))).toString()
|
|
56803
56857
|
});
|
|
56804
|
-
const path$
|
|
56858
|
+
const path$2 = `http://dummy.com/${compatibilityDate}${compatibilityFlags.length ? `+${compatibilityFlags.join("+")}` : ""}`;
|
|
56805
56859
|
try {
|
|
56806
|
-
const res = await mf.dispatchFetch(path$
|
|
56860
|
+
const res = await mf.dispatchFetch(path$2);
|
|
56807
56861
|
const text = await res.text();
|
|
56808
56862
|
if (!res.ok) throw new Error(text);
|
|
56809
56863
|
return text;
|
|
@@ -56998,8 +57052,8 @@ var __name$2 = (target$1, value) => __defProp$2(target$1, "name", {
|
|
|
56998
57052
|
value,
|
|
56999
57053
|
configurable: true
|
|
57000
57054
|
});
|
|
57001
|
-
function isDirectory(path$1) {
|
|
57002
|
-
return fs2.statSync(path$1, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
57055
|
+
function isDirectory(path$1$1) {
|
|
57056
|
+
return fs2.statSync(path$1$1, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
57003
57057
|
}
|
|
57004
57058
|
__name$2(isDirectory, "isDirectory");
|
|
57005
57059
|
function removeDir(dirPath, { fireAndForget = false } = {}) {
|
|
@@ -62309,15 +62363,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
62309
62363
|
function withTrailingSlash$1(input = "", respectQueryAndFragment) {
|
|
62310
62364
|
if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
|
|
62311
62365
|
if (hasTrailingSlash(input, true)) return input || "/";
|
|
62312
|
-
let path$
|
|
62366
|
+
let path$2 = input;
|
|
62313
62367
|
let fragment = "";
|
|
62314
62368
|
const fragmentIndex = input.indexOf("#");
|
|
62315
62369
|
if (fragmentIndex >= 0) {
|
|
62316
|
-
path$
|
|
62370
|
+
path$2 = input.slice(0, fragmentIndex);
|
|
62317
62371
|
fragment = input.slice(fragmentIndex);
|
|
62318
|
-
if (!path$
|
|
62372
|
+
if (!path$2) return fragment;
|
|
62319
62373
|
}
|
|
62320
|
-
const [s0, ...s] = path$
|
|
62374
|
+
const [s0, ...s] = path$2.split("?");
|
|
62321
62375
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
62322
62376
|
}
|
|
62323
62377
|
function isNonEmptyURL(url$2) {
|
|
@@ -62343,8 +62397,8 @@ const isAbsolute$2 = function(p$2) {
|
|
|
62343
62397
|
//#endregion
|
|
62344
62398
|
//#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
62345
62399
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
62346
|
-
function normalizeSlash(path$
|
|
62347
|
-
return path$
|
|
62400
|
+
function normalizeSlash(path$2) {
|
|
62401
|
+
return path$2.replace(/\\/g, "/");
|
|
62348
62402
|
}
|
|
62349
62403
|
/**
|
|
62350
62404
|
* @typedef ErrnoExceptionFields
|
|
@@ -62464,8 +62518,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
62464
62518
|
* @param {string} [base]
|
|
62465
62519
|
* @param {string} [message]
|
|
62466
62520
|
*/
|
|
62467
|
-
(path$
|
|
62468
|
-
return `Invalid package config ${path$
|
|
62521
|
+
(path$2, base, message) => {
|
|
62522
|
+
return `Invalid package config ${path$2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
62469
62523
|
},
|
|
62470
62524
|
Error
|
|
62471
62525
|
);
|
|
@@ -62495,8 +62549,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
62495
62549
|
* @param {string} base
|
|
62496
62550
|
* @param {boolean} [exactUrl]
|
|
62497
62551
|
*/
|
|
62498
|
-
(path$
|
|
62499
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path$
|
|
62552
|
+
(path$2, base, exactUrl = false) => {
|
|
62553
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path$2}' imported from ${base}`;
|
|
62500
62554
|
},
|
|
62501
62555
|
Error
|
|
62502
62556
|
);
|
|
@@ -62534,8 +62588,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
62534
62588
|
* @param {string} extension
|
|
62535
62589
|
* @param {string} path
|
|
62536
62590
|
*/
|
|
62537
|
-
(extension, path$
|
|
62538
|
-
return `Unknown file extension "${extension}" for ${path$
|
|
62591
|
+
(extension, path$2) => {
|
|
62592
|
+
return `Unknown file extension "${extension}" for ${path$2}`;
|
|
62539
62593
|
},
|
|
62540
62594
|
TypeError
|
|
62541
62595
|
);
|
|
@@ -62692,7 +62746,7 @@ function read(jsonPath, { base, specifier }) {
|
|
|
62692
62746
|
/** @type {string | undefined} */
|
|
62693
62747
|
let string$3;
|
|
62694
62748
|
try {
|
|
62695
|
-
string$3 = fs2.readFileSync(
|
|
62749
|
+
string$3 = fs2.readFileSync(path.toNamespacedPath(jsonPath), "utf8");
|
|
62696
62750
|
} catch (error$2) {
|
|
62697
62751
|
const exception = error$2;
|
|
62698
62752
|
if (exception.code !== "ENOENT") throw exception;
|
|
@@ -62898,15 +62952,15 @@ function emitLegacyIndexDeprecation(url$2, packageJsonUrl, base, main) {
|
|
|
62898
62952
|
const packagePath = fileURLToPath(new URL$1(".", packageJsonUrl));
|
|
62899
62953
|
const basePath = fileURLToPath(base);
|
|
62900
62954
|
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");
|
|
62901
|
-
else if (
|
|
62955
|
+
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");
|
|
62902
62956
|
}
|
|
62903
62957
|
/**
|
|
62904
62958
|
* @param {string} path
|
|
62905
62959
|
* @returns {Stats | undefined}
|
|
62906
62960
|
*/
|
|
62907
|
-
function tryStatSync(path$
|
|
62961
|
+
function tryStatSync(path$2) {
|
|
62908
62962
|
try {
|
|
62909
|
-
return statSync(path$
|
|
62963
|
+
return statSync(path$2);
|
|
62910
62964
|
} catch {}
|
|
62911
62965
|
}
|
|
62912
62966
|
/**
|
|
@@ -63005,7 +63059,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
63005
63059
|
{
|
|
63006
63060
|
const real = realpathSync(filePath);
|
|
63007
63061
|
const { search, hash: hash$1 } = resolved;
|
|
63008
|
-
resolved = pathToFileURL(real + (filePath.endsWith(
|
|
63062
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? "/" : ""));
|
|
63009
63063
|
resolved.search = search;
|
|
63010
63064
|
resolved.hash = hash$1;
|
|
63011
63065
|
}
|
|
@@ -65837,9 +65891,9 @@ function constructHeaders({ headers, headersFile, logger: logger$1 }) {
|
|
|
65837
65891
|
|
|
65838
65892
|
//#endregion
|
|
65839
65893
|
//#region ../workers-shared/utils/configuration/validateURL.ts
|
|
65840
|
-
const extractPathname = (path$
|
|
65841
|
-
if (!path$
|
|
65842
|
-
const url$2 = new URL(`//${path$
|
|
65894
|
+
const extractPathname = (path$2 = "/", includeSearch, includeHash) => {
|
|
65895
|
+
if (!path$2.startsWith("/")) path$2 = `/${path$2}`;
|
|
65896
|
+
const url$2 = new URL(`//${path$2}`, "relative://");
|
|
65843
65897
|
return `${url$2.pathname}${includeSearch ? url$2.search : ""}${includeHash ? url$2.hash : ""}`;
|
|
65844
65898
|
};
|
|
65845
65899
|
const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
|
|
@@ -65898,7 +65952,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
65898
65952
|
lineNumber: i$1 + 1,
|
|
65899
65953
|
message: "No headers specified"
|
|
65900
65954
|
});
|
|
65901
|
-
const [path$
|
|
65955
|
+
const [path$2, pathError] = validateUrl(line, false, true);
|
|
65902
65956
|
if (pathError) {
|
|
65903
65957
|
invalid.push({
|
|
65904
65958
|
line,
|
|
@@ -65909,7 +65963,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
65909
65963
|
skipUntilNextPath = true;
|
|
65910
65964
|
continue;
|
|
65911
65965
|
}
|
|
65912
|
-
const wildcardError = validateNoMultipleWildcards(path$
|
|
65966
|
+
const wildcardError = validateNoMultipleWildcards(path$2);
|
|
65913
65967
|
if (wildcardError) {
|
|
65914
65968
|
invalid.push({
|
|
65915
65969
|
line,
|
|
@@ -65921,7 +65975,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
65921
65975
|
continue;
|
|
65922
65976
|
}
|
|
65923
65977
|
rule = {
|
|
65924
|
-
path: path$
|
|
65978
|
+
path: path$2,
|
|
65925
65979
|
line,
|
|
65926
65980
|
headers: {},
|
|
65927
65981
|
unsetHeaders: []
|
|
@@ -66004,11 +66058,11 @@ function isValidRule(rule) {
|
|
|
66004
66058
|
* `:splat` placeholder, would result in duplicate `:splat` parameters which is
|
|
66005
66059
|
* unsupported.
|
|
66006
66060
|
*/
|
|
66007
|
-
function validateNoMultipleWildcards(path$
|
|
66008
|
-
const wildcardCount = (path$
|
|
66009
|
-
const hasSplatPlaceholder = /:splat(?!\w)/.test(path$
|
|
66010
|
-
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$
|
|
66011
|
-
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$
|
|
66061
|
+
function validateNoMultipleWildcards(path$2) {
|
|
66062
|
+
const wildcardCount = (path$2.match(SPLAT_REGEX) ?? []).length;
|
|
66063
|
+
const hasSplatPlaceholder = /:splat(?!\w)/.test(path$2);
|
|
66064
|
+
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path$2}.`;
|
|
66065
|
+
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path$2}.`;
|
|
66012
66066
|
}
|
|
66013
66067
|
|
|
66014
66068
|
//#endregion
|
|
@@ -66225,13 +66279,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
|
|
|
66225
66279
|
const throwError = (message, Ctor) => {
|
|
66226
66280
|
throw new Ctor(message);
|
|
66227
66281
|
};
|
|
66228
|
-
const checkPath = (path$
|
|
66229
|
-
if (!isString$1(path$
|
|
66230
|
-
if (!path$
|
|
66231
|
-
if (checkPath.isNotRelative(path$
|
|
66282
|
+
const checkPath = (path$2, originalPath, doThrow) => {
|
|
66283
|
+
if (!isString$1(path$2)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
66284
|
+
if (!path$2) return doThrow(`path must not be empty`, TypeError);
|
|
66285
|
+
if (checkPath.isNotRelative(path$2)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
|
|
66232
66286
|
return true;
|
|
66233
66287
|
};
|
|
66234
|
-
const isNotRelative = (path$
|
|
66288
|
+
const isNotRelative = (path$2) => REGEX_TEST_INVALID_PATH.test(path$2);
|
|
66235
66289
|
checkPath.isNotRelative = isNotRelative;
|
|
66236
66290
|
checkPath.convert = (p$2) => p$2;
|
|
66237
66291
|
var Ignore = class {
|
|
@@ -66267,13 +66321,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
|
|
|
66267
66321
|
addPattern(pattern) {
|
|
66268
66322
|
return this.add(pattern);
|
|
66269
66323
|
}
|
|
66270
|
-
_testOne(path$
|
|
66324
|
+
_testOne(path$2, checkUnignored) {
|
|
66271
66325
|
let ignored = false;
|
|
66272
66326
|
let unignored = false;
|
|
66273
66327
|
this._rules.forEach((rule) => {
|
|
66274
66328
|
const { negative } = rule;
|
|
66275
66329
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
|
|
66276
|
-
if (rule.regex.test(path$
|
|
66330
|
+
if (rule.regex.test(path$2)) {
|
|
66277
66331
|
ignored = !negative;
|
|
66278
66332
|
unignored = negative;
|
|
66279
66333
|
}
|
|
@@ -66284,33 +66338,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
|
|
|
66284
66338
|
};
|
|
66285
66339
|
}
|
|
66286
66340
|
_test(originalPath, cache$2, checkUnignored, slices) {
|
|
66287
|
-
const path$
|
|
66288
|
-
checkPath(path$
|
|
66289
|
-
return this._t(path$
|
|
66341
|
+
const path$2 = originalPath && checkPath.convert(originalPath);
|
|
66342
|
+
checkPath(path$2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
66343
|
+
return this._t(path$2, cache$2, checkUnignored, slices);
|
|
66290
66344
|
}
|
|
66291
|
-
_t(path$
|
|
66292
|
-
if (path$
|
|
66293
|
-
if (!slices) slices = path$
|
|
66345
|
+
_t(path$2, cache$2, checkUnignored, slices) {
|
|
66346
|
+
if (path$2 in cache$2) return cache$2[path$2];
|
|
66347
|
+
if (!slices) slices = path$2.split(SLASH);
|
|
66294
66348
|
slices.pop();
|
|
66295
|
-
if (!slices.length) return cache$2[path$
|
|
66349
|
+
if (!slices.length) return cache$2[path$2] = this._testOne(path$2, checkUnignored);
|
|
66296
66350
|
const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
|
|
66297
|
-
return cache$2[path$
|
|
66351
|
+
return cache$2[path$2] = parent.ignored ? parent : this._testOne(path$2, checkUnignored);
|
|
66298
66352
|
}
|
|
66299
|
-
ignores(path$
|
|
66300
|
-
return this._test(path$
|
|
66353
|
+
ignores(path$2) {
|
|
66354
|
+
return this._test(path$2, this._ignoreCache, false).ignored;
|
|
66301
66355
|
}
|
|
66302
66356
|
createFilter() {
|
|
66303
|
-
return (path$
|
|
66357
|
+
return (path$2) => !this.ignores(path$2);
|
|
66304
66358
|
}
|
|
66305
66359
|
filter(paths) {
|
|
66306
66360
|
return makeArray(paths).filter(this.createFilter());
|
|
66307
66361
|
}
|
|
66308
|
-
test(path$
|
|
66309
|
-
return this._test(path$
|
|
66362
|
+
test(path$2) {
|
|
66363
|
+
return this._test(path$2, this._testCache, true);
|
|
66310
66364
|
}
|
|
66311
66365
|
};
|
|
66312
66366
|
const factory = (options) => new Ignore(options);
|
|
66313
|
-
const isPathValid = (path$
|
|
66367
|
+
const isPathValid = (path$2) => checkPath(path$2 && checkPath.convert(path$2), path$2, RETURN_FALSE);
|
|
66314
66368
|
factory.isPathValid = isPathValid;
|
|
66315
66369
|
factory.default = factory;
|
|
66316
66370
|
module.exports = factory;
|
|
@@ -66319,7 +66373,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/ig
|
|
|
66319
66373
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
66320
66374
|
checkPath.convert = makePosix;
|
|
66321
66375
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
66322
|
-
checkPath.isNotRelative = (path$
|
|
66376
|
+
checkPath.isNotRelative = (path$2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path$2) || isNotRelative(path$2);
|
|
66323
66377
|
}
|
|
66324
66378
|
}) });
|
|
66325
66379
|
|
|
@@ -67674,11 +67728,11 @@ var Mime = class {
|
|
|
67674
67728
|
}
|
|
67675
67729
|
return this;
|
|
67676
67730
|
}
|
|
67677
|
-
getType(path$
|
|
67678
|
-
if (typeof path$
|
|
67679
|
-
const last = path$
|
|
67731
|
+
getType(path$2) {
|
|
67732
|
+
if (typeof path$2 !== "string") return null;
|
|
67733
|
+
const last = path$2.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
67680
67734
|
const ext = last.replace(/^.*\./s, "").toLowerCase();
|
|
67681
|
-
const hasPath = last.length < path$
|
|
67735
|
+
const hasPath = last.length < path$2.length;
|
|
67682
67736
|
if (!(ext.length < last.length - 1) && hasPath) return null;
|
|
67683
67737
|
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
|
|
67684
67738
|
}
|
|
@@ -68451,11 +68505,11 @@ const getQueryString = (params) => {
|
|
|
68451
68505
|
};
|
|
68452
68506
|
const getUrl = (config$2, options) => {
|
|
68453
68507
|
const encoder$1 = config$2.ENCODE_PATH || encodeURI;
|
|
68454
|
-
const path$
|
|
68508
|
+
const path$2 = options.url.replace("{api-version}", config$2.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
68455
68509
|
if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
|
|
68456
68510
|
return substring;
|
|
68457
68511
|
});
|
|
68458
|
-
const url$2 = `${config$2.BASE}${path$
|
|
68512
|
+
const url$2 = `${config$2.BASE}${path$2}`;
|
|
68459
68513
|
if (options.query) return `${url$2}${getQueryString(options.query)}`;
|
|
68460
68514
|
return url$2;
|
|
68461
68515
|
};
|
|
@@ -69553,7 +69607,7 @@ function getContainerOptions(options) {
|
|
|
69553
69607
|
return containersConfig.map((container) => {
|
|
69554
69608
|
if (isDockerfile(container.image, configPath)) return {
|
|
69555
69609
|
dockerfile: container.image,
|
|
69556
|
-
image_build_context: container.image_build_context ??
|
|
69610
|
+
image_build_context: container.image_build_context ?? path.dirname(container.image),
|
|
69557
69611
|
image_vars: container.image_vars,
|
|
69558
69612
|
class_name: container.class_name,
|
|
69559
69613
|
image_tag: getDevContainerImageName(container.class_name, containerBuildId)
|
|
@@ -72389,7 +72443,7 @@ var __name$1 = (target$1, value) => __defProp$1(target$1, "name", {
|
|
|
72389
72443
|
});
|
|
72390
72444
|
|
|
72391
72445
|
//#endregion
|
|
72392
|
-
//#region ../workers-auth/dist/chunk-
|
|
72446
|
+
//#region ../workers-auth/dist/chunk-7ZPLVMOI.mjs
|
|
72393
72447
|
var import_undici$2 = require_undici();
|
|
72394
72448
|
var hasWarnedAboutDeprecatedV1ApiToken = false;
|
|
72395
72449
|
function readStoredAuthState(options) {
|
|
@@ -72458,6 +72512,12 @@ function requireApiToken(options) {
|
|
|
72458
72512
|
return credentials;
|
|
72459
72513
|
}
|
|
72460
72514
|
__name$1(requireApiToken, "requireApiToken");
|
|
72515
|
+
var ACCOUNT_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
72516
|
+
function validateAccountId(accountId, source) {
|
|
72517
|
+
if (!ACCOUNT_ID_PATTERN.test(accountId)) throw new UserError(`Invalid account ID "${accountId}" ${source}. Account IDs may only contain alphanumeric characters, hyphens, and underscores.`, { telemetryMessage: "user account id invalid characters" });
|
|
72518
|
+
return accountId;
|
|
72519
|
+
}
|
|
72520
|
+
__name$1(validateAccountId, "validateAccountId");
|
|
72461
72521
|
var getAuthDomainFromEnv = getEnvironmentVariableFactory({
|
|
72462
72522
|
variableName: "WRANGLER_AUTH_DOMAIN",
|
|
72463
72523
|
defaultValue: /* @__PURE__ */ __name$1(() => getCloudflareApiEnvironmentFromEnv() === "staging" ? "dash.staging.cloudflare.com" : "dash.cloudflare.com", "defaultValue")
|
|
@@ -72474,10 +72534,16 @@ var getRevokeUrlFromEnv = getEnvironmentVariableFactory({
|
|
|
72474
72534
|
variableName: "WRANGLER_REVOKE_URL",
|
|
72475
72535
|
defaultValue: /* @__PURE__ */ __name$1(() => `https://${getAuthDomainFromEnv()}/oauth2/revoke`, "defaultValue")
|
|
72476
72536
|
});
|
|
72477
|
-
var
|
|
72537
|
+
var readCloudflareAccountIdFromEnv = getEnvironmentVariableFactory({
|
|
72478
72538
|
variableName: "CLOUDFLARE_ACCOUNT_ID",
|
|
72479
72539
|
deprecatedName: "CF_ACCOUNT_ID"
|
|
72480
72540
|
});
|
|
72541
|
+
function getCloudflareAccountIdFromEnv() {
|
|
72542
|
+
const accountId = readCloudflareAccountIdFromEnv();
|
|
72543
|
+
if (!accountId) return;
|
|
72544
|
+
return validateAccountId(accountId, "set in the `CLOUDFLARE_ACCOUNT_ID` environment variable");
|
|
72545
|
+
}
|
|
72546
|
+
__name$1(getCloudflareAccountIdFromEnv, "getCloudflareAccountIdFromEnv");
|
|
72481
72547
|
var getAccessClientIdFromEnv = getEnvironmentVariableFactory({ variableName: "CLOUDFLARE_ACCESS_CLIENT_ID" });
|
|
72482
72548
|
var getAccessClientSecretFromEnv = getEnvironmentVariableFactory({ variableName: "CLOUDFLARE_ACCESS_CLIENT_SECRET" });
|
|
72483
72549
|
var getCfAuthorizationTokenFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_CF_AUTHORIZATION_TOKEN" });
|
|
@@ -73515,13 +73581,13 @@ function createProfileStore(args) {
|
|
|
73515
73581
|
args.bindings.write(currentBindings);
|
|
73516
73582
|
},
|
|
73517
73583
|
activate(profile, dir$2) {
|
|
73518
|
-
const normalizedDir =
|
|
73584
|
+
const normalizedDir = path.resolve(dir$2);
|
|
73519
73585
|
const currentBindings = args.bindings.read();
|
|
73520
73586
|
currentBindings[normalizedDir] = profile;
|
|
73521
73587
|
args.bindings.write(currentBindings);
|
|
73522
73588
|
},
|
|
73523
73589
|
deactivate(dir$2) {
|
|
73524
|
-
const normalizedDir =
|
|
73590
|
+
const normalizedDir = path.resolve(dir$2);
|
|
73525
73591
|
const currentBindings = args.bindings.read();
|
|
73526
73592
|
const boundProfile = currentBindings[normalizedDir];
|
|
73527
73593
|
if (boundProfile === void 0) {
|
|
@@ -73593,18 +73659,18 @@ function validateProfileName(name) {
|
|
|
73593
73659
|
}
|
|
73594
73660
|
__name$1(validateProfileName, "validateProfileName");
|
|
73595
73661
|
function formatDirectoryForUserError(dir$2) {
|
|
73596
|
-
return
|
|
73662
|
+
return path.relative(process.cwd(), dir$2) || ".";
|
|
73597
73663
|
}
|
|
73598
73664
|
__name$1(formatDirectoryForUserError, "formatDirectoryForUserError");
|
|
73599
73665
|
function getProfileForDirectoryFromBindings(startDir, bindings$1) {
|
|
73600
|
-
const normalizedDir =
|
|
73666
|
+
const normalizedDir = path.resolve(startDir);
|
|
73601
73667
|
const sortedEntries = Object.entries(bindings$1).sort(([a], [b]) => b.length - a.length);
|
|
73602
73668
|
for (const [boundDir, profile] of sortedEntries) {
|
|
73603
73669
|
if (normalizedDir === boundDir) return {
|
|
73604
73670
|
profile,
|
|
73605
73671
|
dir: boundDir
|
|
73606
73672
|
};
|
|
73607
|
-
if (normalizedDir.startsWith(boundDir) && normalizedDir[boundDir.length] ===
|
|
73673
|
+
if (normalizedDir.startsWith(boundDir) && normalizedDir[boundDir.length] === path.sep) return {
|
|
73608
73674
|
profile,
|
|
73609
73675
|
dir: boundDir
|
|
73610
73676
|
};
|
|
@@ -74359,7 +74425,7 @@ function resolveAuthProfileBaseName(profile) {
|
|
|
74359
74425
|
}
|
|
74360
74426
|
__name$1(resolveAuthProfileBaseName, "resolveAuthProfileBaseName");
|
|
74361
74427
|
function getAuthConfigFilePath$2(configPath, profile, extension = "toml") {
|
|
74362
|
-
return
|
|
74428
|
+
return path.join(configPath, USER_AUTH_CONFIG_PATH, `${resolveAuthProfileBaseName(profile)}.${extension}`);
|
|
74363
74429
|
}
|
|
74364
74430
|
__name$1(getAuthConfigFilePath$2, "getAuthConfigFilePath");
|
|
74365
74431
|
var FileCredentialStore = class {
|
|
@@ -74390,7 +74456,7 @@ var FileCredentialStore = class {
|
|
|
74390
74456
|
}
|
|
74391
74457
|
write(config$2) {
|
|
74392
74458
|
const filePath = this.filePath();
|
|
74393
|
-
mkdirSync(
|
|
74459
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
74394
74460
|
writeFileSync(filePath, stringifyFile(this.format, config$2), {
|
|
74395
74461
|
encoding: "utf-8",
|
|
74396
74462
|
mode: 384
|
|
@@ -74455,7 +74521,7 @@ function parseEncryptedEnvelope(raw) {
|
|
|
74455
74521
|
}
|
|
74456
74522
|
__name$1(parseEncryptedEnvelope, "parseEncryptedEnvelope");
|
|
74457
74523
|
function getEncryptedAuthConfigFilePath$2(configPath, profile) {
|
|
74458
|
-
return
|
|
74524
|
+
return path.join(configPath, "config", `${resolveAuthProfileBaseName(profile)}.enc`);
|
|
74459
74525
|
}
|
|
74460
74526
|
__name$1(getEncryptedAuthConfigFilePath$2, "getEncryptedAuthConfigFilePath");
|
|
74461
74527
|
var EncryptedFileCredentialStore = class {
|
|
@@ -74494,7 +74560,7 @@ var EncryptedFileCredentialStore = class {
|
|
|
74494
74560
|
const key = this.ensureKey();
|
|
74495
74561
|
const envelope = encryptString(stringifyFile(this.format, config$2), key);
|
|
74496
74562
|
const encryptedPath = getEncryptedAuthConfigFilePath$2(this.configPath, this.profile);
|
|
74497
|
-
mkdirSync(
|
|
74563
|
+
mkdirSync(path.dirname(encryptedPath), { recursive: true });
|
|
74498
74564
|
writeFileSync(encryptedPath, JSON.stringify(envelope, null, " "), {
|
|
74499
74565
|
encoding: "utf-8",
|
|
74500
74566
|
mode: 384
|
|
@@ -74599,26 +74665,26 @@ function setNpmRunner(fn) {
|
|
|
74599
74665
|
}
|
|
74600
74666
|
__name$1(setNpmRunner, "setNpmRunner");
|
|
74601
74667
|
function getKeyringInstallDir(configPath) {
|
|
74602
|
-
return
|
|
74668
|
+
return path.join(configPath, "native", "keyring");
|
|
74603
74669
|
}
|
|
74604
74670
|
__name$1(getKeyringInstallDir, "getKeyringInstallDir");
|
|
74605
74671
|
function getInstalledBindingPath(installDir) {
|
|
74606
|
-
return
|
|
74672
|
+
return path.join(installDir, "node_modules", "@napi-rs", "keyring");
|
|
74607
74673
|
}
|
|
74608
74674
|
__name$1(getInstalledBindingPath, "getInstalledBindingPath");
|
|
74609
74675
|
function findKeyringBinding(installDir) {
|
|
74610
74676
|
const cached$2 = cachedBindingPathByDir.get(installDir);
|
|
74611
74677
|
if (cached$2 !== void 0) return cached$2;
|
|
74612
74678
|
const lazy$2 = getInstalledBindingPath(installDir);
|
|
74613
|
-
if (existsSync(
|
|
74679
|
+
if (existsSync(path.join(lazy$2, "index.js"))) {
|
|
74614
74680
|
cachedBindingPathByDir.set(installDir, lazy$2);
|
|
74615
74681
|
return lazy$2;
|
|
74616
74682
|
}
|
|
74617
74683
|
try {
|
|
74618
74684
|
const r$1 = npmRunner(["root", "-g"]);
|
|
74619
74685
|
if (r$1.status === 0) {
|
|
74620
|
-
const global$2 =
|
|
74621
|
-
if (existsSync(
|
|
74686
|
+
const global$2 = path.join(r$1.stdout.trim(), "@napi-rs", "keyring");
|
|
74687
|
+
if (existsSync(path.join(global$2, "index.js"))) {
|
|
74622
74688
|
cachedBindingPathByDir.set(installDir, global$2);
|
|
74623
74689
|
return global$2;
|
|
74624
74690
|
}
|
|
@@ -74631,7 +74697,7 @@ __name$1(findKeyringBinding, "findKeyringBinding");
|
|
|
74631
74697
|
function installKeyringBindingSync(installDir) {
|
|
74632
74698
|
const dir$2 = installDir;
|
|
74633
74699
|
mkdirSync(dir$2, { recursive: true });
|
|
74634
|
-
const hostPkgJson =
|
|
74700
|
+
const hostPkgJson = path.join(dir$2, "package.json");
|
|
74635
74701
|
if (!existsSync(hostPkgJson)) writeFileSync(hostPkgJson, JSON.stringify({
|
|
74636
74702
|
private: true,
|
|
74637
74703
|
name: "cloudflare-auth-keyring-host"
|
|
@@ -75060,10 +75126,10 @@ function scrubEncryptedCredentials(options) {
|
|
|
75060
75126
|
__name$1(scrubEncryptedCredentials, "scrubEncryptedCredentials");
|
|
75061
75127
|
|
|
75062
75128
|
//#endregion
|
|
75063
|
-
//#region ../workers-auth/dist/chunk-
|
|
75129
|
+
//#region ../workers-auth/dist/chunk-CEH7NWR7.mjs
|
|
75064
75130
|
function createPreferences(getConfigPath) {
|
|
75065
75131
|
function getUserPreferencesPath() {
|
|
75066
|
-
return
|
|
75132
|
+
return path.resolve(getConfigPath(), "preferences.json");
|
|
75067
75133
|
}
|
|
75068
75134
|
__name$1(getUserPreferencesPath, "getUserPreferencesPath");
|
|
75069
75135
|
function readUserPreferences$2() {
|
|
@@ -75083,7 +75149,7 @@ function createPreferences(getConfigPath) {
|
|
|
75083
75149
|
...update
|
|
75084
75150
|
};
|
|
75085
75151
|
const filePath = getUserPreferencesPath();
|
|
75086
|
-
mkdirSync(
|
|
75152
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
75087
75153
|
writeFileSync(filePath, JSON.stringify(next, null, " "), { encoding: "utf-8" });
|
|
75088
75154
|
}
|
|
75089
75155
|
__name$1(updateUserPreferences$2, "updateUserPreferences");
|
|
@@ -75718,7 +75784,7 @@ function createFileStorage(format$4, getPath) {
|
|
|
75718
75784
|
}, "read"),
|
|
75719
75785
|
write(config$2) {
|
|
75720
75786
|
const configPath = getPath();
|
|
75721
|
-
mkdirSync(
|
|
75787
|
+
mkdirSync(path.dirname(configPath), { recursive: true });
|
|
75722
75788
|
writeFileSync(configPath, stringifyFile(format$4, config$2), {
|
|
75723
75789
|
encoding: "utf-8",
|
|
75724
75790
|
mode: 384
|
|
@@ -75936,7 +76002,7 @@ Alternatively, try running \`${descriptor.commands.login}\` to re-authenticate.`
|
|
|
75936
76002
|
function getActiveAccountId(config$2) {
|
|
75937
76003
|
const temporaryAccount = oauthFlow.getActiveTemporaryAccount();
|
|
75938
76004
|
if (temporaryAccount) return temporaryAccount.account.id;
|
|
75939
|
-
if (config$2.account_id) return config$2.account_id;
|
|
76005
|
+
if (config$2.account_id) return validateAccountId(config$2.account_id, `set as \`account_id\` in your ${descriptor.getConfigFileLabel()} file`);
|
|
75940
76006
|
const envAccountId = getCloudflareAccountIdFromEnv();
|
|
75941
76007
|
if (envAccountId) return envAccountId;
|
|
75942
76008
|
return getAccountFromCache()?.id;
|
|
@@ -76029,7 +76095,7 @@ function createCloudflareProfileStore(ctx) {
|
|
|
76029
76095
|
}
|
|
76030
76096
|
__name$1(encryptedPath, "encryptedPath");
|
|
76031
76097
|
function getProfileConfigDirectory() {
|
|
76032
|
-
return
|
|
76098
|
+
return path.dirname(plaintextPath("default"));
|
|
76033
76099
|
}
|
|
76034
76100
|
__name$1(getProfileConfigDirectory, "getProfileConfigDirectory");
|
|
76035
76101
|
const configs = {
|
|
@@ -76056,7 +76122,7 @@ function createCloudflareProfileStore(ctx) {
|
|
|
76056
76122
|
}
|
|
76057
76123
|
};
|
|
76058
76124
|
function getDirectoryBindingsPath() {
|
|
76059
|
-
return
|
|
76125
|
+
return path.join(getConfigPath(), DIRECTORY_BINDINGS_FILE);
|
|
76060
76126
|
}
|
|
76061
76127
|
__name$1(getDirectoryBindingsPath, "getDirectoryBindingsPath");
|
|
76062
76128
|
return createProfileStore({
|
|
@@ -76072,7 +76138,7 @@ function createCloudflareProfileStore(ctx) {
|
|
|
76072
76138
|
},
|
|
76073
76139
|
write(dirBindings) {
|
|
76074
76140
|
const bindingsPath = getDirectoryBindingsPath();
|
|
76075
|
-
mkdirSync(
|
|
76141
|
+
mkdirSync(path.dirname(bindingsPath), { recursive: true });
|
|
76076
76142
|
writeFileSync(bindingsPath, JSON.stringify(dirBindings, null, " "), "utf-8");
|
|
76077
76143
|
}
|
|
76078
76144
|
}
|
|
@@ -76312,7 +76378,7 @@ function getTemporaryAccountConfigFile$1() {
|
|
|
76312
76378
|
}
|
|
76313
76379
|
__name$1(getTemporaryAccountConfigFile$1, "getTemporaryAccountConfigFile");
|
|
76314
76380
|
function getCfTemporaryAccountConfigPath() {
|
|
76315
|
-
return
|
|
76381
|
+
return path.join(getCfConfigPath(), getTemporaryAccountConfigFile$1());
|
|
76316
76382
|
}
|
|
76317
76383
|
__name$1(getCfTemporaryAccountConfigPath, "getCfTemporaryAccountConfigPath");
|
|
76318
76384
|
function createJsonFileStorage(getPath) {
|
|
@@ -76432,7 +76498,7 @@ function getTemporaryAccountConfigFile() {
|
|
|
76432
76498
|
}
|
|
76433
76499
|
__name$1(getTemporaryAccountConfigFile, "getTemporaryAccountConfigFile");
|
|
76434
76500
|
function getTemporaryPreviewAccountConfigPath() {
|
|
76435
|
-
return
|
|
76501
|
+
return path.join(getGlobalConfigPath(), getTemporaryAccountConfigFile());
|
|
76436
76502
|
}
|
|
76437
76503
|
__name$1(getTemporaryPreviewAccountConfigPath, "getTemporaryPreviewAccountConfigPath");
|
|
76438
76504
|
function createTomlFileStorage(getPath) {
|
|
@@ -76504,7 +76570,7 @@ var require_command_exists$1 = /* @__PURE__ */ __commonJS$2({ "../../node_module
|
|
|
76504
76570
|
var exec = __require$2("child_process").exec;
|
|
76505
76571
|
var execSync = __require$2("child_process").execSync;
|
|
76506
76572
|
var fs$2 = __require$2("fs");
|
|
76507
|
-
var path = __require$2("path");
|
|
76573
|
+
var path$1 = __require$2("path");
|
|
76508
76574
|
var access = fs$2.access;
|
|
76509
76575
|
var accessSync$1 = fs$2.accessSync;
|
|
76510
76576
|
var constants$4 = fs$2.constants || fs$2;
|
|
@@ -76581,8 +76647,8 @@ var require_command_exists$1 = /* @__PURE__ */ __commonJS$2({ "../../node_module
|
|
|
76581
76647
|
};
|
|
76582
76648
|
if (isUsingWindows) cleanInput = function(s) {
|
|
76583
76649
|
if (/[\\]/.test(s)) {
|
|
76584
|
-
var dirname$3 = "\"" + path.dirname(s) + "\"";
|
|
76585
|
-
var basename$2 = "\"" + path.basename(s) + "\"";
|
|
76650
|
+
var dirname$3 = "\"" + path$1.dirname(s) + "\"";
|
|
76651
|
+
var basename$2 = "\"" + path$1.basename(s) + "\"";
|
|
76586
76652
|
return dirname$3 + ":" + basename$2;
|
|
76587
76653
|
}
|
|
76588
76654
|
return "\"" + s + "\"";
|
|
@@ -77396,11 +77462,11 @@ function createWorkerUploadForm(worker, bindings$1, options) {
|
|
|
77396
77462
|
const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
|
|
77397
77463
|
if (modules?.some(({ name }) => name === manifestModuleName) && main.type === "esm") {
|
|
77398
77464
|
assert(modules !== void 0);
|
|
77399
|
-
const subDirs = new Set(modules.map((module$1) =>
|
|
77465
|
+
const subDirs = new Set(modules.map((module$1) => path.posix.dirname(module$1.name)));
|
|
77400
77466
|
for (const subDir of subDirs) {
|
|
77401
77467
|
if (subDir === ".") continue;
|
|
77402
|
-
const relativePath =
|
|
77403
|
-
const filePath =
|
|
77468
|
+
const relativePath = path.posix.relative(subDir, manifestModuleName);
|
|
77469
|
+
const filePath = path.posix.join(subDir, manifestModuleName);
|
|
77404
77470
|
modules.push({
|
|
77405
77471
|
name: filePath,
|
|
77406
77472
|
filePath,
|
|
@@ -77480,7 +77546,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
77480
77546
|
//#endregion
|
|
77481
77547
|
//#region ../remote-bindings/dist/index.mjs
|
|
77482
77548
|
var import_undici = require_undici();
|
|
77483
|
-
var version$2 = "0.0.
|
|
77549
|
+
var version$2 = "0.0.6";
|
|
77484
77550
|
var NoDefaultValueProvided = class extends UserError {
|
|
77485
77551
|
constructor() {
|
|
77486
77552
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|
|
@@ -77925,7 +77991,7 @@ function createRemoteWorkerInit(props) {
|
|
|
77925
77991
|
return {
|
|
77926
77992
|
name: props.name,
|
|
77927
77993
|
main: {
|
|
77928
|
-
name:
|
|
77994
|
+
name: path.basename(props.bundle.path),
|
|
77929
77995
|
filePath: props.bundle.path,
|
|
77930
77996
|
type: props.bundle.type,
|
|
77931
77997
|
content: props.bundle.entrypointSource
|
|
@@ -78394,26 +78460,26 @@ function deepStrictEqual(source, target$1) {
|
|
|
78394
78460
|
//#endregion
|
|
78395
78461
|
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.4/node_modules/fdir/dist/index.mjs
|
|
78396
78462
|
var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
78397
|
-
function cleanPath(path$
|
|
78398
|
-
let normalized = normalize(path$
|
|
78463
|
+
function cleanPath(path$2) {
|
|
78464
|
+
let normalized = normalize(path$2);
|
|
78399
78465
|
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
78400
78466
|
return normalized;
|
|
78401
78467
|
}
|
|
78402
78468
|
const SLASHES_REGEX = /[\\/]/g;
|
|
78403
|
-
function convertSlashes(path$
|
|
78404
|
-
return path$
|
|
78469
|
+
function convertSlashes(path$2, separator) {
|
|
78470
|
+
return path$2.replace(SLASHES_REGEX, separator);
|
|
78405
78471
|
}
|
|
78406
78472
|
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
78407
|
-
function isRootDirectory(path$
|
|
78408
|
-
return path$
|
|
78473
|
+
function isRootDirectory(path$2) {
|
|
78474
|
+
return path$2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$2);
|
|
78409
78475
|
}
|
|
78410
|
-
function normalizePath$1(path$
|
|
78476
|
+
function normalizePath$1(path$2, options) {
|
|
78411
78477
|
const { resolvePaths, normalizePath: normalizePath$1$1, pathSeparator } = options;
|
|
78412
|
-
const pathNeedsCleaning = process.platform === "win32" && path$
|
|
78413
|
-
if (resolvePaths) path$
|
|
78414
|
-
if (normalizePath$1$1 || pathNeedsCleaning) path$
|
|
78415
|
-
if (path$
|
|
78416
|
-
return convertSlashes(path$
|
|
78478
|
+
const pathNeedsCleaning = process.platform === "win32" && path$2.includes("/") || path$2.startsWith(".");
|
|
78479
|
+
if (resolvePaths) path$2 = resolve$1(path$2);
|
|
78480
|
+
if (normalizePath$1$1 || pathNeedsCleaning) path$2 = cleanPath(path$2);
|
|
78481
|
+
if (path$2 === ".") return "";
|
|
78482
|
+
return convertSlashes(path$2[path$2.length - 1] !== pathSeparator ? path$2 + pathSeparator : path$2, pathSeparator);
|
|
78417
78483
|
}
|
|
78418
78484
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
78419
78485
|
return directoryPath + filename;
|
|
@@ -78449,8 +78515,8 @@ const pushDirectory = (directoryPath, paths) => {
|
|
|
78449
78515
|
paths.push(directoryPath || ".");
|
|
78450
78516
|
};
|
|
78451
78517
|
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
78452
|
-
const path$
|
|
78453
|
-
if (filters.every((filter) => filter(path$
|
|
78518
|
+
const path$2 = directoryPath || ".";
|
|
78519
|
+
if (filters.every((filter) => filter(path$2, true))) paths.push(path$2);
|
|
78454
78520
|
};
|
|
78455
78521
|
const empty$2 = () => {};
|
|
78456
78522
|
function build$6(root, options) {
|
|
@@ -78499,26 +78565,26 @@ const empty = () => {};
|
|
|
78499
78565
|
function build$3(options) {
|
|
78500
78566
|
return options.group ? groupFiles : empty;
|
|
78501
78567
|
}
|
|
78502
|
-
const resolveSymlinksAsync = function(path$
|
|
78568
|
+
const resolveSymlinksAsync = function(path$2, state, callback$1) {
|
|
78503
78569
|
const { queue, fs: fs$3, options: { suppressErrors } } = state;
|
|
78504
78570
|
queue.enqueue();
|
|
78505
|
-
fs$3.realpath(path$
|
|
78571
|
+
fs$3.realpath(path$2, (error$2, resolvedPath) => {
|
|
78506
78572
|
if (error$2) return queue.dequeue(suppressErrors ? null : error$2, state);
|
|
78507
78573
|
fs$3.stat(resolvedPath, (error$1$1, stat$1) => {
|
|
78508
78574
|
if (error$1$1) return queue.dequeue(suppressErrors ? null : error$1$1, state);
|
|
78509
|
-
if (stat$1.isDirectory() && isRecursive(path$
|
|
78575
|
+
if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
|
|
78510
78576
|
callback$1(stat$1, resolvedPath);
|
|
78511
78577
|
queue.dequeue(null, state);
|
|
78512
78578
|
});
|
|
78513
78579
|
});
|
|
78514
78580
|
};
|
|
78515
|
-
const resolveSymlinks = function(path$
|
|
78581
|
+
const resolveSymlinks = function(path$2, state, callback$1) {
|
|
78516
78582
|
const { queue, fs: fs$3, options: { suppressErrors } } = state;
|
|
78517
78583
|
queue.enqueue();
|
|
78518
78584
|
try {
|
|
78519
|
-
const resolvedPath = fs$3.realpathSync(path$
|
|
78585
|
+
const resolvedPath = fs$3.realpathSync(path$2);
|
|
78520
78586
|
const stat$1 = fs$3.statSync(resolvedPath);
|
|
78521
|
-
if (stat$1.isDirectory() && isRecursive(path$
|
|
78587
|
+
if (stat$1.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
|
|
78522
78588
|
callback$1(stat$1, resolvedPath);
|
|
78523
78589
|
} catch (e) {
|
|
78524
78590
|
if (!suppressErrors) throw e;
|
|
@@ -78528,16 +78594,16 @@ function build$2(options, isSynchronous) {
|
|
|
78528
78594
|
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
78529
78595
|
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
78530
78596
|
}
|
|
78531
|
-
function isRecursive(path$
|
|
78597
|
+
function isRecursive(path$2, resolved, state) {
|
|
78532
78598
|
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
78533
|
-
let parent = dirname$1(path$
|
|
78599
|
+
let parent = dirname$1(path$2);
|
|
78534
78600
|
let depth$1 = 1;
|
|
78535
78601
|
while (parent !== state.root && depth$1 < 2) {
|
|
78536
78602
|
const resolvedPath = state.symlinks.get(parent);
|
|
78537
78603
|
if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
|
|
78538
78604
|
else parent = dirname$1(parent);
|
|
78539
78605
|
}
|
|
78540
|
-
state.symlinks.set(path$
|
|
78606
|
+
state.symlinks.set(path$2, resolved);
|
|
78541
78607
|
return depth$1 > 1;
|
|
78542
78608
|
}
|
|
78543
78609
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
@@ -78718,19 +78784,19 @@ var Walker = class {
|
|
|
78718
78784
|
const filename = this.joinPath(entry.name, directoryPath);
|
|
78719
78785
|
this.pushFile(filename, files, this.state.counts, filters);
|
|
78720
78786
|
} else if (entry.isDirectory()) {
|
|
78721
|
-
let path$
|
|
78722
|
-
if (exclude && exclude(entry.name, path$
|
|
78723
|
-
this.pushDirectory(path$
|
|
78724
|
-
this.walkDirectory(this.state, path$
|
|
78787
|
+
let path$2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
78788
|
+
if (exclude && exclude(entry.name, path$2)) continue;
|
|
78789
|
+
this.pushDirectory(path$2, paths, filters);
|
|
78790
|
+
this.walkDirectory(this.state, path$2, path$2, depth$1 - 1, this.walk);
|
|
78725
78791
|
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
78726
|
-
let path$
|
|
78727
|
-
this.resolveSymlink(path$
|
|
78792
|
+
let path$2 = joinPathWithBasePath(entry.name, directoryPath);
|
|
78793
|
+
this.resolveSymlink(path$2, this.state, (stat$1, resolvedPath) => {
|
|
78728
78794
|
if (stat$1.isDirectory()) {
|
|
78729
78795
|
resolvedPath = normalizePath$1(resolvedPath, this.state.options);
|
|
78730
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$
|
|
78731
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$
|
|
78796
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
|
|
78797
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth$1 - 1, this.walk);
|
|
78732
78798
|
} else {
|
|
78733
|
-
resolvedPath = useRealPaths ? resolvedPath : path$
|
|
78799
|
+
resolvedPath = useRealPaths ? resolvedPath : path$2;
|
|
78734
78800
|
const filename = basename$1(resolvedPath);
|
|
78735
78801
|
const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
|
|
78736
78802
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
@@ -78895,7 +78961,7 @@ var Builder = class {
|
|
|
78895
78961
|
isMatch = globFn(patterns, ...options);
|
|
78896
78962
|
this.globCache[patterns.join("\0")] = isMatch;
|
|
78897
78963
|
}
|
|
78898
|
-
this.options.filters.push((path$
|
|
78964
|
+
this.options.filters.push((path$2) => isMatch(path$2));
|
|
78899
78965
|
return this;
|
|
78900
78966
|
}
|
|
78901
78967
|
};
|
|
@@ -79109,8 +79175,8 @@ var require_utils = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/pic
|
|
|
79109
79175
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
79110
79176
|
return output;
|
|
79111
79177
|
};
|
|
79112
|
-
exports.basename = (path$
|
|
79113
|
-
const segs = path$
|
|
79178
|
+
exports.basename = (path$2, { windows } = {}) => {
|
|
79179
|
+
const segs = path$2.split(windows ? /[\\/]/ : "/");
|
|
79114
79180
|
const last = segs[segs.length - 1];
|
|
79115
79181
|
if (last === "") return segs[segs.length - 2];
|
|
79116
79182
|
return last;
|
|
@@ -80850,15 +80916,15 @@ function buildRelative(cwd, root) {
|
|
|
80850
80916
|
};
|
|
80851
80917
|
}
|
|
80852
80918
|
const splitPatternOptions = { parts: true };
|
|
80853
|
-
function splitPattern(path$
|
|
80919
|
+
function splitPattern(path$2) {
|
|
80854
80920
|
var _result$parts;
|
|
80855
|
-
const result = import_picomatch.default.scan(path$
|
|
80856
|
-
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$
|
|
80921
|
+
const result = import_picomatch.default.scan(path$2, splitPatternOptions);
|
|
80922
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$2];
|
|
80857
80923
|
}
|
|
80858
80924
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
80859
80925
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
80860
|
-
const escapePosixPath = (path$
|
|
80861
|
-
const escapeWin32Path = (path$
|
|
80926
|
+
const escapePosixPath = (path$2) => path$2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
80927
|
+
const escapeWin32Path = (path$2) => path$2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
80862
80928
|
/**
|
|
80863
80929
|
* Escapes a path's special characters depending on the platform.
|
|
80864
80930
|
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
|
|
@@ -80982,13 +81048,13 @@ function buildCrawler(options, patterns) {
|
|
|
80982
81048
|
if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
|
|
80983
81049
|
const crawler = new Builder({
|
|
80984
81050
|
filters: [debug$7 ? (p$2, isDirectory$2) => {
|
|
80985
|
-
const path$
|
|
80986
|
-
const matches = matcher(path$
|
|
80987
|
-
if (matches) log(`matched ${path$
|
|
81051
|
+
const path$2 = format$4(p$2, isDirectory$2);
|
|
81052
|
+
const matches = matcher(path$2) && !ignore$1(path$2);
|
|
81053
|
+
if (matches) log(`matched ${path$2}`);
|
|
80988
81054
|
return matches;
|
|
80989
81055
|
} : (p$2, isDirectory$2) => {
|
|
80990
|
-
const path$
|
|
80991
|
-
return matcher(path$
|
|
81056
|
+
const path$2 = format$4(p$2, isDirectory$2);
|
|
81057
|
+
return matcher(path$2) && !ignore$1(path$2);
|
|
80992
81058
|
}],
|
|
80993
81059
|
exclude: debug$7 ? (_, p$2) => {
|
|
80994
81060
|
const skipped = excludePredicate(_, p$2);
|
|
@@ -82238,13 +82304,13 @@ const wslDefaultBrowser = async () => {
|
|
|
82238
82304
|
const { stdout: stdout$2 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
|
|
82239
82305
|
return stdout$2.trim();
|
|
82240
82306
|
};
|
|
82241
|
-
const convertWslPathToWindows = async (path$
|
|
82242
|
-
if (/^[a-z]+:\/\//i.test(path$
|
|
82307
|
+
const convertWslPathToWindows = async (path$2) => {
|
|
82308
|
+
if (/^[a-z]+:\/\//i.test(path$2)) return path$2;
|
|
82243
82309
|
try {
|
|
82244
|
-
const { stdout: stdout$2 } = await execFile$1("wslpath", ["-aw", path$
|
|
82310
|
+
const { stdout: stdout$2 } = await execFile$1("wslpath", ["-aw", path$2], { encoding: "utf8" });
|
|
82245
82311
|
return stdout$2.trim();
|
|
82246
82312
|
} catch {
|
|
82247
|
-
return path$
|
|
82313
|
+
return path$2;
|
|
82248
82314
|
}
|
|
82249
82315
|
};
|
|
82250
82316
|
|
|
@@ -82430,8 +82496,8 @@ var is_in_ssh_default = isInSsh;
|
|
|
82430
82496
|
//#endregion
|
|
82431
82497
|
//#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
82432
82498
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
82433
|
-
const __dirname = import.meta.url ?
|
|
82434
|
-
const localXdgOpenPath =
|
|
82499
|
+
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
82500
|
+
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
82435
82501
|
const { platform, arch: arch$1 } = process$1;
|
|
82436
82502
|
const tryEachApp = async (apps$1, opener) => {
|
|
82437
82503
|
if (apps$1.length === 0) return;
|