@cloudflare/vite-plugin 1.39.0 → 1.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -18,13 +18,14 @@ import { Buffer as Buffer$1 } from "node:buffer";
|
|
|
18
18
|
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
19
19
|
import * as fsp from "node:fs/promises";
|
|
20
20
|
import fs, { constants as constants$1 } from "node:fs/promises";
|
|
21
|
+
import * as timersPromises from "node:timers/promises";
|
|
21
22
|
import { getCloudflarePreset, nonPrefixedNodeModules } from "@cloudflare/unenv-preset";
|
|
22
23
|
import process$1 from "node:process";
|
|
23
24
|
import v8 from "node:v8";
|
|
24
25
|
import { defineEnv } from "unenv";
|
|
25
|
-
import * as nativeFs
|
|
26
|
-
import
|
|
27
|
-
import
|
|
26
|
+
import * as nativeFs from "fs";
|
|
27
|
+
import { readdir, readdirSync, realpath, realpathSync as realpathSync$1, stat, statSync as statSync$1 } from "fs";
|
|
28
|
+
import { basename, dirname as dirname$1, isAbsolute as isAbsolute$1, normalize, posix, relative as relative$1, resolve as resolve$1, sep } from "path";
|
|
28
29
|
import { fileURLToPath as fileURLToPath$1 } from "url";
|
|
29
30
|
import { createRequire as createRequire$1 } from "module";
|
|
30
31
|
import { WebSocketServer } from "ws";
|
|
@@ -1503,7 +1504,7 @@ async function assertWranglerVersion() {
|
|
|
1503
1504
|
* The default compatibility date to use when the user omits one.
|
|
1504
1505
|
* This value is injected at build time and remains fixed for each release.
|
|
1505
1506
|
*/
|
|
1506
|
-
const DEFAULT_COMPAT_DATE = "2026-
|
|
1507
|
+
const DEFAULT_COMPAT_DATE = "2026-06-01";
|
|
1507
1508
|
|
|
1508
1509
|
//#endregion
|
|
1509
1510
|
//#region ../../node_modules/.pnpm/@remix-run+node-fetch-server@0.8.0/node_modules/@remix-run/node-fetch-server/dist/node-fetch-server.js
|
|
@@ -5227,10 +5228,10 @@ var require_util$5 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
5227
5228
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5228
5229
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
5229
5230
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
5230
|
-
let path
|
|
5231
|
+
let path = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
5231
5232
|
if (origin[origin.length - 1] === "/") origin = origin.slice(0, origin.length - 1);
|
|
5232
|
-
if (path
|
|
5233
|
-
return new URL(`${origin}${path
|
|
5233
|
+
if (path && path[0] !== "/") path = `/${path}`;
|
|
5234
|
+
return new URL(`${origin}${path}`);
|
|
5234
5235
|
}
|
|
5235
5236
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) throw new InvalidArgumentError$36("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
5236
5237
|
return url;
|
|
@@ -6105,8 +6106,8 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
6105
6106
|
debugLog("connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version$2, error.message);
|
|
6106
6107
|
});
|
|
6107
6108
|
diagnosticsChannel$1.subscribe("undici:client:sendHeaders", (evt) => {
|
|
6108
|
-
const { request: { method, path
|
|
6109
|
-
debugLog("sending request to %s %s%s", method, origin, path
|
|
6109
|
+
const { request: { method, path, origin } } = evt;
|
|
6110
|
+
debugLog("sending request to %s %s%s", method, origin, path);
|
|
6110
6111
|
});
|
|
6111
6112
|
}
|
|
6112
6113
|
let isTrackingRequestEvents = false;
|
|
@@ -6118,16 +6119,16 @@ var require_diagnostics = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
6118
6119
|
}
|
|
6119
6120
|
isTrackingRequestEvents = true;
|
|
6120
6121
|
diagnosticsChannel$1.subscribe("undici:request:headers", (evt) => {
|
|
6121
|
-
const { request: { method, path
|
|
6122
|
-
debugLog("received response to %s %s%s - HTTP %d", method, origin, path
|
|
6122
|
+
const { request: { method, path, origin }, response: { statusCode } } = evt;
|
|
6123
|
+
debugLog("received response to %s %s%s - HTTP %d", method, origin, path, statusCode);
|
|
6123
6124
|
});
|
|
6124
6125
|
diagnosticsChannel$1.subscribe("undici:request:trailers", (evt) => {
|
|
6125
|
-
const { request: { method, path
|
|
6126
|
-
debugLog("trailers received from %s %s%s", method, origin, path
|
|
6126
|
+
const { request: { method, path, origin } } = evt;
|
|
6127
|
+
debugLog("trailers received from %s %s%s", method, origin, path);
|
|
6127
6128
|
});
|
|
6128
6129
|
diagnosticsChannel$1.subscribe("undici:request:error", (evt) => {
|
|
6129
|
-
const { request: { method, path
|
|
6130
|
-
debugLog("request to %s %s%s errored - %s", method, origin, path
|
|
6130
|
+
const { request: { method, path, origin }, error } = evt;
|
|
6131
|
+
debugLog("request to %s %s%s errored - %s", method, origin, path, error.message);
|
|
6131
6132
|
});
|
|
6132
6133
|
}
|
|
6133
6134
|
let isTrackingWebSocketEvents = false;
|
|
@@ -6180,10 +6181,10 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
6180
6181
|
const invalidPathRegex = /[^\u0021-\u00ff]/;
|
|
6181
6182
|
const kHandler = Symbol("handler");
|
|
6182
6183
|
var Request$6 = class {
|
|
6183
|
-
constructor(origin, { path
|
|
6184
|
-
if (typeof path
|
|
6185
|
-
else if (path
|
|
6186
|
-
else if (invalidPathRegex.test(path
|
|
6184
|
+
constructor(origin, { path, method, body, headers, query, idempotent, blocking, upgrade: upgrade$1, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
|
|
6185
|
+
if (typeof path !== "string") throw new InvalidArgumentError$35("path must be a string");
|
|
6186
|
+
else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") throw new InvalidArgumentError$35("path must be an absolute URL or start with a slash");
|
|
6187
|
+
else if (invalidPathRegex.test(path)) throw new InvalidArgumentError$35("invalid request path");
|
|
6187
6188
|
if (typeof method !== "string") throw new InvalidArgumentError$35("method must be a string");
|
|
6188
6189
|
else if (normalizedMethodRecords$1[method] === void 0 && !isValidHTTPToken$2(method)) throw new InvalidArgumentError$35("invalid request method");
|
|
6189
6190
|
if (upgrade$1 && typeof upgrade$1 !== "string") throw new InvalidArgumentError$35("upgrade must be a string");
|
|
@@ -6224,7 +6225,7 @@ var require_request$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
6224
6225
|
this.completed = false;
|
|
6225
6226
|
this.aborted = false;
|
|
6226
6227
|
this.upgrade = upgrade$1 || null;
|
|
6227
|
-
this.path = query ? serializePathWithQuery$3(path
|
|
6228
|
+
this.path = query ? serializePathWithQuery$3(path, query) : path;
|
|
6228
6229
|
this.origin = origin;
|
|
6229
6230
|
this.protocol = getProtocolFromUrlString(origin);
|
|
6230
6231
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -6784,7 +6785,7 @@ var require_connect = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
6784
6785
|
|
|
6785
6786
|
//#endregion
|
|
6786
6787
|
//#region ../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/utils.js
|
|
6787
|
-
var require_utils$
|
|
6788
|
+
var require_utils$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/utils.js": ((exports) => {
|
|
6788
6789
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6789
6790
|
exports.enumToMap = enumToMap;
|
|
6790
6791
|
function enumToMap(obj, filter = [], exceptions = []) {
|
|
@@ -6801,7 +6802,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/u
|
|
|
6801
6802
|
var require_constants$4 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/llhttp/constants.js": ((exports) => {
|
|
6802
6803
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6803
6804
|
exports.SPECIAL_HEADERS = exports.MINOR = exports.MAJOR = exports.HTAB_SP_VCHAR_OBS_TEXT = exports.QUOTED_STRING = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.HEX = exports.URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.STATUSES_HTTP = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.HEADER_STATE = exports.FINISH = exports.STATUSES = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
|
|
6804
|
-
const utils_1 = require_utils$
|
|
6805
|
+
const utils_1 = require_utils$2();
|
|
6805
6806
|
exports.ERROR = {
|
|
6806
6807
|
OK: 0,
|
|
6807
6808
|
INTERNAL: 1,
|
|
@@ -10707,7 +10708,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
10707
10708
|
* @returns
|
|
10708
10709
|
*/
|
|
10709
10710
|
function writeH1(client, request$2) {
|
|
10710
|
-
const { method, path
|
|
10711
|
+
const { method, path, host, upgrade: upgrade$1, blocking, reset } = request$2;
|
|
10711
10712
|
let { body, headers, contentLength } = request$2;
|
|
10712
10713
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
10713
10714
|
if (util$23.isFormDataLike(body)) {
|
|
@@ -10752,7 +10753,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
10752
10753
|
if (client[kMaxRequests$1] && socket[kCounter$1]++ >= client[kMaxRequests$1]) socket[kReset$1] = true;
|
|
10753
10754
|
if (blocking) socket[kBlocking] = true;
|
|
10754
10755
|
if (socket.setTypeOfService) socket.setTypeOfService(request$2.typeOfService);
|
|
10755
|
-
let header = `${method} ${path
|
|
10756
|
+
let header = `${method} ${path} HTTP/1.1\r\n`;
|
|
10756
10757
|
if (typeof host === "string") header += `host: ${host}\r\n`;
|
|
10757
10758
|
else header += client[kHostHeader$1];
|
|
10758
10759
|
if (upgrade$1) header += `connection: upgrade\r\nupgrade: ${upgrade$1}\r\n`;
|
|
@@ -11288,7 +11289,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11288
11289
|
function writeH2(client, request$2) {
|
|
11289
11290
|
const requestTimeout = request$2.bodyTimeout ?? client[kBodyTimeout$1];
|
|
11290
11291
|
const session = client[kHTTP2Session];
|
|
11291
|
-
const { method, path
|
|
11292
|
+
const { method, path, host, upgrade: upgrade$1, expectContinue, signal, protocol, headers: reqHeaders } = request$2;
|
|
11292
11293
|
let { body } = request$2;
|
|
11293
11294
|
if (upgrade$1 != null && upgrade$1 !== "websocket") {
|
|
11294
11295
|
util$22.errorRequest(client, request$2, new InvalidArgumentError$30(`Custom upgrade "${upgrade$1}" not supported over HTTP/2`));
|
|
@@ -11341,7 +11342,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11341
11342
|
}
|
|
11342
11343
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
11343
11344
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
11344
|
-
headers[HTTP2_HEADER_PATH] = path
|
|
11345
|
+
headers[HTTP2_HEADER_PATH] = path;
|
|
11345
11346
|
if (protocol === "ws:" || protocol === "wss:") headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
11346
11347
|
else headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11347
11348
|
stream$2 = session.request(headers, {
|
|
@@ -11383,7 +11384,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
11383
11384
|
stream$2.setTimeout(requestTimeout);
|
|
11384
11385
|
return true;
|
|
11385
11386
|
}
|
|
11386
|
-
headers[HTTP2_HEADER_PATH] = path
|
|
11387
|
+
headers[HTTP2_HEADER_PATH] = path;
|
|
11387
11388
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
11388
11389
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
11389
11390
|
if (body && typeof body.read === "function") body.read(0);
|
|
@@ -13209,8 +13210,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
13209
13210
|
}
|
|
13210
13211
|
if (onHeaders) onHeaders.call(this, statusCode, data$1, resume$1);
|
|
13211
13212
|
};
|
|
13212
|
-
const { origin, path
|
|
13213
|
-
opts.path = origin + path
|
|
13213
|
+
const { origin, path = "/", headers = {} } = opts;
|
|
13214
|
+
opts.path = origin + path;
|
|
13214
13215
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
13215
13216
|
const { host } = new URL(origin);
|
|
13216
13217
|
headers.host = host;
|
|
@@ -14994,16 +14995,16 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
14994
14995
|
}
|
|
14995
14996
|
return normalizedQp;
|
|
14996
14997
|
}
|
|
14997
|
-
function safeUrl(path
|
|
14998
|
-
if (typeof path
|
|
14999
|
-
const pathSegments = path
|
|
15000
|
-
if (pathSegments.length !== 2) return path
|
|
14998
|
+
function safeUrl(path) {
|
|
14999
|
+
if (typeof path !== "string") return path;
|
|
15000
|
+
const pathSegments = path.split("?", 3);
|
|
15001
|
+
if (pathSegments.length !== 2) return path;
|
|
15001
15002
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
15002
15003
|
qp.sort();
|
|
15003
15004
|
return [...pathSegments, qp.toString()].join("?");
|
|
15004
15005
|
}
|
|
15005
|
-
function matchKey(mockDispatch$1, { path
|
|
15006
|
-
const pathMatch = matchValue$1(mockDispatch$1.path, path
|
|
15006
|
+
function matchKey(mockDispatch$1, { path, method, body, headers }) {
|
|
15007
|
+
const pathMatch = matchValue$1(mockDispatch$1.path, path);
|
|
15007
15008
|
const methodMatch = matchValue$1(mockDispatch$1.method, method);
|
|
15008
15009
|
const bodyMatch = typeof mockDispatch$1.body !== "undefined" ? matchValue$1(mockDispatch$1.body, body) : true;
|
|
15009
15010
|
const headersMatch = matchHeaders(mockDispatch$1, headers);
|
|
@@ -15021,8 +15022,8 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15021
15022
|
const basePath = key.query ? serializePathWithQuery$2(key.path, key.query) : key.path;
|
|
15022
15023
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
15023
15024
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
15024
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path
|
|
15025
|
-
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path
|
|
15025
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path, ignoreTrailingSlash }) => {
|
|
15026
|
+
return ignoreTrailingSlash ? matchValue$1(removeTrailingSlash(safeUrl(path)), resolvedPathWithoutTrailingSlash) : matchValue$1(safeUrl(path), resolvedPath);
|
|
15026
15027
|
});
|
|
15027
15028
|
if (matchedMockDispatches.length === 0) throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
15028
15029
|
matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue$1(method, key.method));
|
|
@@ -15065,15 +15066,15 @@ var require_mock_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15065
15066
|
/**
|
|
15066
15067
|
* @param {string} path Path to remove trailing slash from
|
|
15067
15068
|
*/
|
|
15068
|
-
function removeTrailingSlash(path
|
|
15069
|
-
while (path
|
|
15070
|
-
if (path
|
|
15071
|
-
return path
|
|
15069
|
+
function removeTrailingSlash(path) {
|
|
15070
|
+
while (path.endsWith("/")) path = path.slice(0, -1);
|
|
15071
|
+
if (path.length === 0) path = "/";
|
|
15072
|
+
return path;
|
|
15072
15073
|
}
|
|
15073
15074
|
function buildKey$1(opts) {
|
|
15074
|
-
const { path
|
|
15075
|
+
const { path, method, body, headers, query } = opts;
|
|
15075
15076
|
return {
|
|
15076
|
-
path
|
|
15077
|
+
path,
|
|
15077
15078
|
method,
|
|
15078
15079
|
body,
|
|
15079
15080
|
headers,
|
|
@@ -15640,10 +15641,10 @@ var require_pending_interceptors_formatter = /* @__PURE__ */ __commonJS$1({ "../
|
|
|
15640
15641
|
});
|
|
15641
15642
|
}
|
|
15642
15643
|
format(pendingInterceptors) {
|
|
15643
|
-
const withPrettyHeaders = pendingInterceptors.map(({ method, path
|
|
15644
|
+
const withPrettyHeaders = pendingInterceptors.map(({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
15644
15645
|
Method: method,
|
|
15645
15646
|
Origin: origin,
|
|
15646
|
-
Path: path
|
|
15647
|
+
Path: path,
|
|
15647
15648
|
"Status code": statusCode,
|
|
15648
15649
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
15649
15650
|
Invocations: timesInvoked,
|
|
@@ -15701,8 +15702,8 @@ var require_mock_agent = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
15701
15702
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
15702
15703
|
const dispatchOpts = { ...opts };
|
|
15703
15704
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
15704
|
-
const [path
|
|
15705
|
-
dispatchOpts.path = `${path
|
|
15705
|
+
const [path, searchParams] = dispatchOpts.path.split("?");
|
|
15706
|
+
dispatchOpts.path = `${path}?${normalizeSearchParams(searchParams, acceptNonStandardSearchParameters)}`;
|
|
15706
15707
|
}
|
|
15707
15708
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
15708
15709
|
}
|
|
@@ -16179,10 +16180,10 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16179
16180
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
16180
16181
|
*/
|
|
16181
16182
|
async loadSnapshots(filePath) {
|
|
16182
|
-
const path
|
|
16183
|
-
if (!path
|
|
16183
|
+
const path = filePath || this.#snapshotPath;
|
|
16184
|
+
if (!path) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16184
16185
|
try {
|
|
16185
|
-
const data$1 = await readFile(resolve$3(path
|
|
16186
|
+
const data$1 = await readFile(resolve$3(path), "utf8");
|
|
16186
16187
|
const parsed = JSON.parse(data$1);
|
|
16187
16188
|
if (Array.isArray(parsed)) {
|
|
16188
16189
|
this.#snapshots.clear();
|
|
@@ -16190,7 +16191,7 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16190
16191
|
} else this.#snapshots = new Map(Object.entries(parsed));
|
|
16191
16192
|
} catch (error) {
|
|
16192
16193
|
if (error.code === "ENOENT") this.#snapshots.clear();
|
|
16193
|
-
else throw new UndiciError$1(`Failed to load snapshots from ${path
|
|
16194
|
+
else throw new UndiciError$1(`Failed to load snapshots from ${path}`, { cause: error });
|
|
16194
16195
|
}
|
|
16195
16196
|
}
|
|
16196
16197
|
/**
|
|
@@ -16200,9 +16201,9 @@ var require_snapshot_recorder = /* @__PURE__ */ __commonJS$1({ "../../node_modul
|
|
|
16200
16201
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
16201
16202
|
*/
|
|
16202
16203
|
async saveSnapshots(filePath) {
|
|
16203
|
-
const path
|
|
16204
|
-
if (!path
|
|
16205
|
-
const resolvedPath = resolve$3(path
|
|
16204
|
+
const path = filePath || this.#snapshotPath;
|
|
16205
|
+
if (!path) throw new InvalidArgumentError$6("Snapshot path is required");
|
|
16206
|
+
const resolvedPath = resolve$3(path);
|
|
16206
16207
|
await mkdir(dirname$2(resolvedPath), { recursive: true });
|
|
16207
16208
|
const data$1 = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
16208
16209
|
hash,
|
|
@@ -16769,11 +16770,11 @@ var require_redirect_handler = /* @__PURE__ */ __commonJS$1({ "../../node_module
|
|
|
16769
16770
|
return;
|
|
16770
16771
|
}
|
|
16771
16772
|
const { origin, pathname, search } = util$10.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
16772
|
-
const path
|
|
16773
|
-
const redirectUrlString = `${origin}${path
|
|
16773
|
+
const path = search ? `${pathname}${search}` : pathname;
|
|
16774
|
+
const redirectUrlString = `${origin}${path}`;
|
|
16774
16775
|
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.`);
|
|
16775
16776
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
16776
|
-
this.opts.path = path
|
|
16777
|
+
this.opts.path = path;
|
|
16777
16778
|
this.opts.origin = origin;
|
|
16778
16779
|
this.opts.query = null;
|
|
16779
16780
|
}
|
|
@@ -21731,10 +21732,10 @@ var require_fetch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/und
|
|
|
21731
21732
|
const url = requestCurrentURL(request$2);
|
|
21732
21733
|
/** @type {import('../../..').Agent} */
|
|
21733
21734
|
const agent = fetchParams.controller.dispatcher;
|
|
21734
|
-
const path
|
|
21735
|
+
const path = url.pathname + url.search;
|
|
21735
21736
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
21736
21737
|
return new Promise((resolve$4, reject) => agent.dispatch({
|
|
21737
|
-
path: hasTrailingQuestionMark ? `${path
|
|
21738
|
+
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
21738
21739
|
origin: url.origin,
|
|
21739
21740
|
method: request$2.method,
|
|
21740
21741
|
body: agent.isMockActive ? request$2.body && (request$2.body.source || request$2.body.stream) : body,
|
|
@@ -22516,9 +22517,9 @@ var require_util$2 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
22516
22517
|
* path-value = <any CHAR except CTLs or ";">
|
|
22517
22518
|
* @param {string} path
|
|
22518
22519
|
*/
|
|
22519
|
-
function validateCookiePath(path
|
|
22520
|
-
for (let i$1 = 0; i$1 < path
|
|
22521
|
-
const code = path
|
|
22520
|
+
function validateCookiePath(path) {
|
|
22521
|
+
for (let i$1 = 0; i$1 < path.length; ++i$1) {
|
|
22522
|
+
const code = path.charCodeAt(i$1);
|
|
22522
22523
|
if (code < 32 || code === 127 || code === 59) throw new Error("Invalid cookie path");
|
|
22523
22524
|
}
|
|
22524
22525
|
}
|
|
@@ -25626,9 +25627,9 @@ var require_undici = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/un
|
|
|
25626
25627
|
if (opts != null && typeof opts !== "object") throw new InvalidArgumentError("invalid opts");
|
|
25627
25628
|
if (opts && opts.path != null) {
|
|
25628
25629
|
if (typeof opts.path !== "string") throw new InvalidArgumentError("invalid opts.path");
|
|
25629
|
-
let path
|
|
25630
|
-
if (!opts.path.startsWith("/")) path
|
|
25631
|
-
url = new URL(util$3.parseOrigin(url).origin + path
|
|
25630
|
+
let path = opts.path;
|
|
25631
|
+
if (!opts.path.startsWith("/")) path = `/${path}`;
|
|
25632
|
+
url = new URL(util$3.parseOrigin(url).origin + path);
|
|
25632
25633
|
} else {
|
|
25633
25634
|
if (!opts) opts = typeof url === "object" ? url : {};
|
|
25634
25635
|
url = util$3.parseURL(url);
|
|
@@ -26470,6 +26471,799 @@ var require_command_exists = __commonJS({ "../../node_modules/.pnpm/command-exis
|
|
|
26470
26471
|
var require_command_exists2 = __commonJS({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports$1, module$1) {
|
|
26471
26472
|
module$1.exports = require_command_exists();
|
|
26472
26473
|
} });
|
|
26474
|
+
var require_ini = __commonJS({ "../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports$1) {
|
|
26475
|
+
exports$1.parse = exports$1.decode = decode;
|
|
26476
|
+
exports$1.stringify = exports$1.encode = encode$2;
|
|
26477
|
+
exports$1.safe = safe;
|
|
26478
|
+
exports$1.unsafe = unsafe;
|
|
26479
|
+
var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
|
|
26480
|
+
function encode$2(obj, opt) {
|
|
26481
|
+
var children = [];
|
|
26482
|
+
var out = "";
|
|
26483
|
+
if (typeof opt === "string") opt = {
|
|
26484
|
+
section: opt,
|
|
26485
|
+
whitespace: false
|
|
26486
|
+
};
|
|
26487
|
+
else {
|
|
26488
|
+
opt = opt || {};
|
|
26489
|
+
opt.whitespace = opt.whitespace === true;
|
|
26490
|
+
}
|
|
26491
|
+
var separator = opt.whitespace ? " = " : "=";
|
|
26492
|
+
Object.keys(obj).forEach(function(k, _2, __) {
|
|
26493
|
+
var val = obj[k];
|
|
26494
|
+
if (val && Array.isArray(val)) val.forEach(function(item) {
|
|
26495
|
+
out += safe(k + "[]") + separator + safe(item) + "\n";
|
|
26496
|
+
});
|
|
26497
|
+
else if (val && typeof val === "object") children.push(k);
|
|
26498
|
+
else out += safe(k) + separator + safe(val) + eol;
|
|
26499
|
+
});
|
|
26500
|
+
if (opt.section && out.length) out = "[" + safe(opt.section) + "]" + eol + out;
|
|
26501
|
+
children.forEach(function(k, _2, __) {
|
|
26502
|
+
var nk = dotSplit(k).join("\\.");
|
|
26503
|
+
var section = (opt.section ? opt.section + "." : "") + nk;
|
|
26504
|
+
var child = encode$2(obj[k], {
|
|
26505
|
+
section,
|
|
26506
|
+
whitespace: opt.whitespace
|
|
26507
|
+
});
|
|
26508
|
+
if (out.length && child.length) out += eol;
|
|
26509
|
+
out += child;
|
|
26510
|
+
});
|
|
26511
|
+
return out;
|
|
26512
|
+
}
|
|
26513
|
+
__name(encode$2, "encode");
|
|
26514
|
+
function dotSplit(str) {
|
|
26515
|
+
return str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) {
|
|
26516
|
+
return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "");
|
|
26517
|
+
});
|
|
26518
|
+
}
|
|
26519
|
+
__name(dotSplit, "dotSplit");
|
|
26520
|
+
function decode(str) {
|
|
26521
|
+
var out = {};
|
|
26522
|
+
var p$1 = out;
|
|
26523
|
+
var section = null;
|
|
26524
|
+
var re$5 = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
|
|
26525
|
+
str.split(/[\r\n]+/g).forEach(function(line, _2, __) {
|
|
26526
|
+
if (!line || line.match(/^\s*[;#]/)) return;
|
|
26527
|
+
var match = line.match(re$5);
|
|
26528
|
+
if (!match) return;
|
|
26529
|
+
if (match[1] !== void 0) {
|
|
26530
|
+
section = unsafe(match[1]);
|
|
26531
|
+
if (section === "__proto__") {
|
|
26532
|
+
p$1 = {};
|
|
26533
|
+
return;
|
|
26534
|
+
}
|
|
26535
|
+
p$1 = out[section] = out[section] || {};
|
|
26536
|
+
return;
|
|
26537
|
+
}
|
|
26538
|
+
var key = unsafe(match[2]);
|
|
26539
|
+
if (key === "__proto__") return;
|
|
26540
|
+
var value = match[3] ? unsafe(match[4]) : true;
|
|
26541
|
+
switch (value) {
|
|
26542
|
+
case "true":
|
|
26543
|
+
case "false":
|
|
26544
|
+
case "null": value = JSON.parse(value);
|
|
26545
|
+
}
|
|
26546
|
+
if (key.length > 2 && key.slice(-2) === "[]") {
|
|
26547
|
+
key = key.substring(0, key.length - 2);
|
|
26548
|
+
if (key === "__proto__") return;
|
|
26549
|
+
if (!p$1[key]) p$1[key] = [];
|
|
26550
|
+
else if (!Array.isArray(p$1[key])) p$1[key] = [p$1[key]];
|
|
26551
|
+
}
|
|
26552
|
+
if (Array.isArray(p$1[key])) p$1[key].push(value);
|
|
26553
|
+
else p$1[key] = value;
|
|
26554
|
+
});
|
|
26555
|
+
Object.keys(out).filter(function(k, _2, __) {
|
|
26556
|
+
if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) return false;
|
|
26557
|
+
var parts = dotSplit(k);
|
|
26558
|
+
var p2 = out;
|
|
26559
|
+
var l = parts.pop();
|
|
26560
|
+
var nl = l.replace(/\\\./g, ".");
|
|
26561
|
+
parts.forEach(function(part, _3, __2) {
|
|
26562
|
+
if (part === "__proto__") return;
|
|
26563
|
+
if (!p2[part] || typeof p2[part] !== "object") p2[part] = {};
|
|
26564
|
+
p2 = p2[part];
|
|
26565
|
+
});
|
|
26566
|
+
if (p2 === out && nl === l) return false;
|
|
26567
|
+
p2[nl] = out[k];
|
|
26568
|
+
return true;
|
|
26569
|
+
}).forEach(function(del, _2, __) {
|
|
26570
|
+
delete out[del];
|
|
26571
|
+
});
|
|
26572
|
+
return out;
|
|
26573
|
+
}
|
|
26574
|
+
__name(decode, "decode");
|
|
26575
|
+
function isQuoted(val) {
|
|
26576
|
+
return val.charAt(0) === "\"" && val.slice(-1) === "\"" || val.charAt(0) === "'" && val.slice(-1) === "'";
|
|
26577
|
+
}
|
|
26578
|
+
__name(isQuoted, "isQuoted");
|
|
26579
|
+
function safe(val) {
|
|
26580
|
+
return typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#");
|
|
26581
|
+
}
|
|
26582
|
+
__name(safe, "safe");
|
|
26583
|
+
function unsafe(val, doUnesc) {
|
|
26584
|
+
val = (val || "").trim();
|
|
26585
|
+
if (isQuoted(val)) {
|
|
26586
|
+
if (val.charAt(0) === "'") val = val.substr(1, val.length - 2);
|
|
26587
|
+
try {
|
|
26588
|
+
val = JSON.parse(val);
|
|
26589
|
+
} catch (_2) {}
|
|
26590
|
+
} else {
|
|
26591
|
+
var esc = false;
|
|
26592
|
+
var unesc = "";
|
|
26593
|
+
for (var i$1 = 0, l = val.length; i$1 < l; i$1++) {
|
|
26594
|
+
var c = val.charAt(i$1);
|
|
26595
|
+
if (esc) {
|
|
26596
|
+
if ("\\;#".indexOf(c) !== -1) unesc += c;
|
|
26597
|
+
else unesc += "\\" + c;
|
|
26598
|
+
esc = false;
|
|
26599
|
+
} else if (";#".indexOf(c) !== -1) break;
|
|
26600
|
+
else if (c === "\\") esc = true;
|
|
26601
|
+
else unesc += c;
|
|
26602
|
+
}
|
|
26603
|
+
if (esc) unesc += "\\";
|
|
26604
|
+
return unesc.trim();
|
|
26605
|
+
}
|
|
26606
|
+
return val;
|
|
26607
|
+
}
|
|
26608
|
+
__name(unsafe, "unsafe");
|
|
26609
|
+
} });
|
|
26610
|
+
var require_strip_json_comments = __commonJS({ "../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports$1, module$1) {
|
|
26611
|
+
var singleComment = 1;
|
|
26612
|
+
var multiComment = 2;
|
|
26613
|
+
function stripWithoutWhitespace() {
|
|
26614
|
+
return "";
|
|
26615
|
+
}
|
|
26616
|
+
__name(stripWithoutWhitespace, "stripWithoutWhitespace");
|
|
26617
|
+
function stripWithWhitespace(str, start, end) {
|
|
26618
|
+
return str.slice(start, end).replace(/\S/g, " ");
|
|
26619
|
+
}
|
|
26620
|
+
__name(stripWithWhitespace, "stripWithWhitespace");
|
|
26621
|
+
module$1.exports = function(str, opts) {
|
|
26622
|
+
opts = opts || {};
|
|
26623
|
+
var currentChar;
|
|
26624
|
+
var nextChar;
|
|
26625
|
+
var insideString = false;
|
|
26626
|
+
var insideComment = false;
|
|
26627
|
+
var offset = 0;
|
|
26628
|
+
var ret = "";
|
|
26629
|
+
var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
|
|
26630
|
+
for (var i$1 = 0; i$1 < str.length; i$1++) {
|
|
26631
|
+
currentChar = str[i$1];
|
|
26632
|
+
nextChar = str[i$1 + 1];
|
|
26633
|
+
if (!insideComment && currentChar === "\"") {
|
|
26634
|
+
if (!(str[i$1 - 1] === "\\" && str[i$1 - 2] !== "\\")) insideString = !insideString;
|
|
26635
|
+
}
|
|
26636
|
+
if (insideString) continue;
|
|
26637
|
+
if (!insideComment && currentChar + nextChar === "//") {
|
|
26638
|
+
ret += str.slice(offset, i$1);
|
|
26639
|
+
offset = i$1;
|
|
26640
|
+
insideComment = singleComment;
|
|
26641
|
+
i$1++;
|
|
26642
|
+
} else if (insideComment === singleComment && currentChar + nextChar === "\r\n") {
|
|
26643
|
+
i$1++;
|
|
26644
|
+
insideComment = false;
|
|
26645
|
+
ret += strip(str, offset, i$1);
|
|
26646
|
+
offset = i$1;
|
|
26647
|
+
continue;
|
|
26648
|
+
} else if (insideComment === singleComment && currentChar === "\n") {
|
|
26649
|
+
insideComment = false;
|
|
26650
|
+
ret += strip(str, offset, i$1);
|
|
26651
|
+
offset = i$1;
|
|
26652
|
+
} else if (!insideComment && currentChar + nextChar === "/*") {
|
|
26653
|
+
ret += str.slice(offset, i$1);
|
|
26654
|
+
offset = i$1;
|
|
26655
|
+
insideComment = multiComment;
|
|
26656
|
+
i$1++;
|
|
26657
|
+
continue;
|
|
26658
|
+
} else if (insideComment === multiComment && currentChar + nextChar === "*/") {
|
|
26659
|
+
i$1++;
|
|
26660
|
+
insideComment = false;
|
|
26661
|
+
ret += strip(str, offset, i$1 + 1);
|
|
26662
|
+
offset = i$1 + 1;
|
|
26663
|
+
continue;
|
|
26664
|
+
}
|
|
26665
|
+
}
|
|
26666
|
+
return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
|
|
26667
|
+
};
|
|
26668
|
+
} });
|
|
26669
|
+
var require_utils$1 = __commonJS({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$1) {
|
|
26670
|
+
var fs3 = __require$1("fs");
|
|
26671
|
+
var ini = require_ini();
|
|
26672
|
+
var path5 = __require$1("path");
|
|
26673
|
+
var stripJsonComments = require_strip_json_comments();
|
|
26674
|
+
var parse$10 = exports$1.parse = function(content) {
|
|
26675
|
+
if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content));
|
|
26676
|
+
return ini.parse(content);
|
|
26677
|
+
};
|
|
26678
|
+
var file$1 = exports$1.file = function() {
|
|
26679
|
+
var args = [].slice.call(arguments).filter(function(arg) {
|
|
26680
|
+
return arg != null;
|
|
26681
|
+
});
|
|
26682
|
+
for (var i$1 in args) if ("string" !== typeof args[i$1]) return;
|
|
26683
|
+
var file2 = path5.join.apply(null, args);
|
|
26684
|
+
try {
|
|
26685
|
+
return fs3.readFileSync(file2, "utf-8");
|
|
26686
|
+
} catch (err) {
|
|
26687
|
+
return;
|
|
26688
|
+
}
|
|
26689
|
+
};
|
|
26690
|
+
exports$1.json = function() {
|
|
26691
|
+
var content = file$1.apply(null, arguments);
|
|
26692
|
+
return content ? parse$10(content) : null;
|
|
26693
|
+
};
|
|
26694
|
+
exports$1.env = function(prefix, env2) {
|
|
26695
|
+
env2 = env2 || process.env;
|
|
26696
|
+
var obj = {};
|
|
26697
|
+
var l = prefix.length;
|
|
26698
|
+
for (var k in env2) if (k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
|
|
26699
|
+
var keypath = k.substring(l).split("__");
|
|
26700
|
+
var _emptyStringIndex;
|
|
26701
|
+
while ((_emptyStringIndex = keypath.indexOf("")) > -1) keypath.splice(_emptyStringIndex, 1);
|
|
26702
|
+
var cursor = obj;
|
|
26703
|
+
keypath.forEach(/* @__PURE__ */ __name(function _buildSubObj(_subkey, i$1) {
|
|
26704
|
+
if (!_subkey || typeof cursor !== "object") return;
|
|
26705
|
+
if (i$1 === keypath.length - 1) cursor[_subkey] = env2[k];
|
|
26706
|
+
if (cursor[_subkey] === void 0) cursor[_subkey] = {};
|
|
26707
|
+
cursor = cursor[_subkey];
|
|
26708
|
+
}, "_buildSubObj"));
|
|
26709
|
+
}
|
|
26710
|
+
return obj;
|
|
26711
|
+
};
|
|
26712
|
+
exports$1.find = function() {
|
|
26713
|
+
var rel = path5.join.apply(null, [].slice.call(arguments));
|
|
26714
|
+
function find2(start, rel2) {
|
|
26715
|
+
var file2 = path5.join(start, rel2);
|
|
26716
|
+
try {
|
|
26717
|
+
fs3.statSync(file2);
|
|
26718
|
+
return file2;
|
|
26719
|
+
} catch (err) {
|
|
26720
|
+
if (path5.dirname(start) !== start) return find2(path5.dirname(start), rel2);
|
|
26721
|
+
}
|
|
26722
|
+
}
|
|
26723
|
+
__name(find2, "find");
|
|
26724
|
+
return find2(process.cwd(), rel);
|
|
26725
|
+
};
|
|
26726
|
+
} });
|
|
26727
|
+
var require_deep_extend = __commonJS({ "../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports$1, module$1) {
|
|
26728
|
+
function isSpecificValue(val) {
|
|
26729
|
+
return val instanceof Buffer || val instanceof Date || val instanceof RegExp ? true : false;
|
|
26730
|
+
}
|
|
26731
|
+
__name(isSpecificValue, "isSpecificValue");
|
|
26732
|
+
function cloneSpecificValue(val) {
|
|
26733
|
+
if (val instanceof Buffer) {
|
|
26734
|
+
var x = Buffer.alloc ? Buffer.alloc(val.length) : new Buffer(val.length);
|
|
26735
|
+
val.copy(x);
|
|
26736
|
+
return x;
|
|
26737
|
+
} else if (val instanceof Date) return new Date(val.getTime());
|
|
26738
|
+
else if (val instanceof RegExp) return new RegExp(val);
|
|
26739
|
+
else throw new Error("Unexpected situation");
|
|
26740
|
+
}
|
|
26741
|
+
__name(cloneSpecificValue, "cloneSpecificValue");
|
|
26742
|
+
function deepCloneArray(arr) {
|
|
26743
|
+
var clone = [];
|
|
26744
|
+
arr.forEach(function(item, index) {
|
|
26745
|
+
if (typeof item === "object" && item !== null) if (Array.isArray(item)) clone[index] = deepCloneArray(item);
|
|
26746
|
+
else if (isSpecificValue(item)) clone[index] = cloneSpecificValue(item);
|
|
26747
|
+
else clone[index] = deepExtend({}, item);
|
|
26748
|
+
else clone[index] = item;
|
|
26749
|
+
});
|
|
26750
|
+
return clone;
|
|
26751
|
+
}
|
|
26752
|
+
__name(deepCloneArray, "deepCloneArray");
|
|
26753
|
+
function safeGetProperty(object, property) {
|
|
26754
|
+
return property === "__proto__" ? void 0 : object[property];
|
|
26755
|
+
}
|
|
26756
|
+
__name(safeGetProperty, "safeGetProperty");
|
|
26757
|
+
var deepExtend = module$1.exports = function() {
|
|
26758
|
+
if (arguments.length < 1 || typeof arguments[0] !== "object") return false;
|
|
26759
|
+
if (arguments.length < 2) return arguments[0];
|
|
26760
|
+
var target$1 = arguments[0];
|
|
26761
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
26762
|
+
var val, src$1;
|
|
26763
|
+
args.forEach(function(obj) {
|
|
26764
|
+
if (typeof obj !== "object" || obj === null || Array.isArray(obj)) return;
|
|
26765
|
+
Object.keys(obj).forEach(function(key) {
|
|
26766
|
+
src$1 = safeGetProperty(target$1, key);
|
|
26767
|
+
val = safeGetProperty(obj, key);
|
|
26768
|
+
if (val === target$1) return;
|
|
26769
|
+
else if (typeof val !== "object" || val === null) {
|
|
26770
|
+
target$1[key] = val;
|
|
26771
|
+
return;
|
|
26772
|
+
} else if (Array.isArray(val)) {
|
|
26773
|
+
target$1[key] = deepCloneArray(val);
|
|
26774
|
+
return;
|
|
26775
|
+
} else if (isSpecificValue(val)) {
|
|
26776
|
+
target$1[key] = cloneSpecificValue(val);
|
|
26777
|
+
return;
|
|
26778
|
+
} else if (typeof src$1 !== "object" || src$1 === null || Array.isArray(src$1)) {
|
|
26779
|
+
target$1[key] = deepExtend({}, val);
|
|
26780
|
+
return;
|
|
26781
|
+
} else {
|
|
26782
|
+
target$1[key] = deepExtend(src$1, val);
|
|
26783
|
+
return;
|
|
26784
|
+
}
|
|
26785
|
+
});
|
|
26786
|
+
});
|
|
26787
|
+
return target$1;
|
|
26788
|
+
};
|
|
26789
|
+
} });
|
|
26790
|
+
var require_minimist = __commonJS({ "../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports$1, module$1) {
|
|
26791
|
+
module$1.exports = function(args, opts) {
|
|
26792
|
+
if (!opts) opts = {};
|
|
26793
|
+
var flags = {
|
|
26794
|
+
bools: {},
|
|
26795
|
+
strings: {},
|
|
26796
|
+
unknownFn: null
|
|
26797
|
+
};
|
|
26798
|
+
if (typeof opts["unknown"] === "function") flags.unknownFn = opts["unknown"];
|
|
26799
|
+
if (typeof opts["boolean"] === "boolean" && opts["boolean"]) flags.allBools = true;
|
|
26800
|
+
else [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
|
|
26801
|
+
flags.bools[key2] = true;
|
|
26802
|
+
});
|
|
26803
|
+
var aliases = {};
|
|
26804
|
+
Object.keys(opts.alias || {}).forEach(function(key2) {
|
|
26805
|
+
aliases[key2] = [].concat(opts.alias[key2]);
|
|
26806
|
+
aliases[key2].forEach(function(x) {
|
|
26807
|
+
aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
|
|
26808
|
+
return x !== y;
|
|
26809
|
+
}));
|
|
26810
|
+
});
|
|
26811
|
+
});
|
|
26812
|
+
[].concat(opts.string).filter(Boolean).forEach(function(key2) {
|
|
26813
|
+
flags.strings[key2] = true;
|
|
26814
|
+
if (aliases[key2]) flags.strings[aliases[key2]] = true;
|
|
26815
|
+
});
|
|
26816
|
+
var defaults = opts["default"] || {};
|
|
26817
|
+
var argv$1 = { _: [] };
|
|
26818
|
+
Object.keys(flags.bools).forEach(function(key2) {
|
|
26819
|
+
setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
|
|
26820
|
+
});
|
|
26821
|
+
var notFlags = [];
|
|
26822
|
+
if (args.indexOf("--") !== -1) {
|
|
26823
|
+
notFlags = args.slice(args.indexOf("--") + 1);
|
|
26824
|
+
args = args.slice(0, args.indexOf("--"));
|
|
26825
|
+
}
|
|
26826
|
+
function argDefined(key2, arg2) {
|
|
26827
|
+
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
|
|
26828
|
+
}
|
|
26829
|
+
__name(argDefined, "argDefined");
|
|
26830
|
+
function setArg(key2, val, arg2) {
|
|
26831
|
+
if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
|
|
26832
|
+
if (flags.unknownFn(arg2) === false) return;
|
|
26833
|
+
}
|
|
26834
|
+
var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
|
|
26835
|
+
setKey(argv$1, key2.split("."), value2);
|
|
26836
|
+
(aliases[key2] || []).forEach(function(x) {
|
|
26837
|
+
setKey(argv$1, x.split("."), value2);
|
|
26838
|
+
});
|
|
26839
|
+
}
|
|
26840
|
+
__name(setArg, "setArg");
|
|
26841
|
+
function setKey(obj, keys, value2) {
|
|
26842
|
+
var o = obj;
|
|
26843
|
+
for (var i2 = 0; i2 < keys.length - 1; i2++) {
|
|
26844
|
+
var key2 = keys[i2];
|
|
26845
|
+
if (isConstructorOrProto(o, key2)) return;
|
|
26846
|
+
if (o[key2] === void 0) o[key2] = {};
|
|
26847
|
+
if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) o[key2] = {};
|
|
26848
|
+
if (o[key2] === Array.prototype) o[key2] = [];
|
|
26849
|
+
o = o[key2];
|
|
26850
|
+
}
|
|
26851
|
+
var key2 = keys[keys.length - 1];
|
|
26852
|
+
if (isConstructorOrProto(o, key2)) return;
|
|
26853
|
+
if (o === Object.prototype || o === Number.prototype || o === String.prototype) o = {};
|
|
26854
|
+
if (o === Array.prototype) o = [];
|
|
26855
|
+
if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") o[key2] = value2;
|
|
26856
|
+
else if (Array.isArray(o[key2])) o[key2].push(value2);
|
|
26857
|
+
else o[key2] = [o[key2], value2];
|
|
26858
|
+
}
|
|
26859
|
+
__name(setKey, "setKey");
|
|
26860
|
+
function aliasIsBoolean(key2) {
|
|
26861
|
+
return aliases[key2].some(function(x) {
|
|
26862
|
+
return flags.bools[x];
|
|
26863
|
+
});
|
|
26864
|
+
}
|
|
26865
|
+
__name(aliasIsBoolean, "aliasIsBoolean");
|
|
26866
|
+
for (var i$1 = 0; i$1 < args.length; i$1++) {
|
|
26867
|
+
var arg = args[i$1];
|
|
26868
|
+
if (/^--.+=/.test(arg)) {
|
|
26869
|
+
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
26870
|
+
var key = m[1];
|
|
26871
|
+
var value = m[2];
|
|
26872
|
+
if (flags.bools[key]) value = value !== "false";
|
|
26873
|
+
setArg(key, value, arg);
|
|
26874
|
+
} else if (/^--no-.+/.test(arg)) {
|
|
26875
|
+
var key = arg.match(/^--no-(.+)/)[1];
|
|
26876
|
+
setArg(key, false, arg);
|
|
26877
|
+
} else if (/^--.+/.test(arg)) {
|
|
26878
|
+
var key = arg.match(/^--(.+)/)[1];
|
|
26879
|
+
var next = args[i$1 + 1];
|
|
26880
|
+
if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
26881
|
+
setArg(key, next, arg);
|
|
26882
|
+
i$1++;
|
|
26883
|
+
} else if (/^(true|false)$/.test(next)) {
|
|
26884
|
+
setArg(key, next === "true", arg);
|
|
26885
|
+
i$1++;
|
|
26886
|
+
} else setArg(key, flags.strings[key] ? "" : true, arg);
|
|
26887
|
+
} else if (/^-[^-]+/.test(arg)) {
|
|
26888
|
+
var letters = arg.slice(1, -1).split("");
|
|
26889
|
+
var broken = false;
|
|
26890
|
+
for (var j = 0; j < letters.length; j++) {
|
|
26891
|
+
var next = arg.slice(j + 2);
|
|
26892
|
+
if (next === "-") {
|
|
26893
|
+
setArg(letters[j], next, arg);
|
|
26894
|
+
continue;
|
|
26895
|
+
}
|
|
26896
|
+
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
|
|
26897
|
+
setArg(letters[j], next.split("=")[1], arg);
|
|
26898
|
+
broken = true;
|
|
26899
|
+
break;
|
|
26900
|
+
}
|
|
26901
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
26902
|
+
setArg(letters[j], next, arg);
|
|
26903
|
+
broken = true;
|
|
26904
|
+
break;
|
|
26905
|
+
}
|
|
26906
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
26907
|
+
setArg(letters[j], arg.slice(j + 2), arg);
|
|
26908
|
+
broken = true;
|
|
26909
|
+
break;
|
|
26910
|
+
} else setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
|
|
26911
|
+
}
|
|
26912
|
+
var key = arg.slice(-1)[0];
|
|
26913
|
+
if (!broken && key !== "-") if (args[i$1 + 1] && !/^(-|--)[^-]/.test(args[i$1 + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
26914
|
+
setArg(key, args[i$1 + 1], arg);
|
|
26915
|
+
i$1++;
|
|
26916
|
+
} else if (args[i$1 + 1] && /^(true|false)$/.test(args[i$1 + 1])) {
|
|
26917
|
+
setArg(key, args[i$1 + 1] === "true", arg);
|
|
26918
|
+
i$1++;
|
|
26919
|
+
} else setArg(key, flags.strings[key] ? "" : true, arg);
|
|
26920
|
+
} else {
|
|
26921
|
+
if (!flags.unknownFn || flags.unknownFn(arg) !== false) argv$1._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
|
|
26922
|
+
if (opts.stopEarly) {
|
|
26923
|
+
argv$1._.push.apply(argv$1._, args.slice(i$1 + 1));
|
|
26924
|
+
break;
|
|
26925
|
+
}
|
|
26926
|
+
}
|
|
26927
|
+
}
|
|
26928
|
+
Object.keys(defaults).forEach(function(key2) {
|
|
26929
|
+
if (!hasKey(argv$1, key2.split("."))) {
|
|
26930
|
+
setKey(argv$1, key2.split("."), defaults[key2]);
|
|
26931
|
+
(aliases[key2] || []).forEach(function(x) {
|
|
26932
|
+
setKey(argv$1, x.split("."), defaults[key2]);
|
|
26933
|
+
});
|
|
26934
|
+
}
|
|
26935
|
+
});
|
|
26936
|
+
if (opts["--"]) {
|
|
26937
|
+
argv$1["--"] = new Array();
|
|
26938
|
+
notFlags.forEach(function(key2) {
|
|
26939
|
+
argv$1["--"].push(key2);
|
|
26940
|
+
});
|
|
26941
|
+
} else notFlags.forEach(function(key2) {
|
|
26942
|
+
argv$1._.push(key2);
|
|
26943
|
+
});
|
|
26944
|
+
return argv$1;
|
|
26945
|
+
};
|
|
26946
|
+
function hasKey(obj, keys) {
|
|
26947
|
+
var o = obj;
|
|
26948
|
+
keys.slice(0, -1).forEach(function(key2) {
|
|
26949
|
+
o = o[key2] || {};
|
|
26950
|
+
});
|
|
26951
|
+
return keys[keys.length - 1] in o;
|
|
26952
|
+
}
|
|
26953
|
+
__name(hasKey, "hasKey");
|
|
26954
|
+
function isNumber(x) {
|
|
26955
|
+
if (typeof x === "number") return true;
|
|
26956
|
+
if (/^0x[0-9a-f]+$/i.test(x)) return true;
|
|
26957
|
+
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
26958
|
+
}
|
|
26959
|
+
__name(isNumber, "isNumber");
|
|
26960
|
+
function isConstructorOrProto(obj, key) {
|
|
26961
|
+
return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
|
|
26962
|
+
}
|
|
26963
|
+
__name(isConstructorOrProto, "isConstructorOrProto");
|
|
26964
|
+
} });
|
|
26965
|
+
var require_rc = __commonJS({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports$1, module$1) {
|
|
26966
|
+
var cc = require_utils$1();
|
|
26967
|
+
var join2 = __require$1("path").join;
|
|
26968
|
+
var deepExtend = require_deep_extend();
|
|
26969
|
+
var etc = "/etc";
|
|
26970
|
+
var win = process.platform === "win32";
|
|
26971
|
+
var home = win ? process.env.USERPROFILE : process.env.HOME;
|
|
26972
|
+
module$1.exports = function(name, defaults, argv$1, parse$10) {
|
|
26973
|
+
if ("string" !== typeof name) throw new Error("rc(name): name *must* be string");
|
|
26974
|
+
if (!argv$1) argv$1 = require_minimist()(process.argv.slice(2));
|
|
26975
|
+
defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
|
|
26976
|
+
parse$10 = parse$10 || cc.parse;
|
|
26977
|
+
var env$1 = cc.env(name + "_");
|
|
26978
|
+
var configs = [defaults];
|
|
26979
|
+
var configFiles = [];
|
|
26980
|
+
function addConfigFile(file$1) {
|
|
26981
|
+
if (configFiles.indexOf(file$1) >= 0) return;
|
|
26982
|
+
var fileConfig = cc.file(file$1);
|
|
26983
|
+
if (fileConfig) {
|
|
26984
|
+
configs.push(parse$10(fileConfig));
|
|
26985
|
+
configFiles.push(file$1);
|
|
26986
|
+
}
|
|
26987
|
+
}
|
|
26988
|
+
__name(addConfigFile, "addConfigFile");
|
|
26989
|
+
if (!win) [join2(etc, name, "config"), join2(etc, name + "rc")].forEach(addConfigFile);
|
|
26990
|
+
if (home) [
|
|
26991
|
+
join2(home, ".config", name, "config"),
|
|
26992
|
+
join2(home, ".config", name),
|
|
26993
|
+
join2(home, "." + name, "config"),
|
|
26994
|
+
join2(home, "." + name + "rc")
|
|
26995
|
+
].forEach(addConfigFile);
|
|
26996
|
+
addConfigFile(cc.find("." + name + "rc"));
|
|
26997
|
+
if (env$1.config) addConfigFile(env$1.config);
|
|
26998
|
+
if (argv$1.config) addConfigFile(argv$1.config);
|
|
26999
|
+
return deepExtend.apply(null, configs.concat([
|
|
27000
|
+
env$1,
|
|
27001
|
+
argv$1,
|
|
27002
|
+
configFiles.length ? {
|
|
27003
|
+
configs: configFiles,
|
|
27004
|
+
config: configFiles[configFiles.length - 1]
|
|
27005
|
+
} : void 0
|
|
27006
|
+
]));
|
|
27007
|
+
};
|
|
27008
|
+
} });
|
|
27009
|
+
var require_registry_url = __commonJS({ "../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports$1, module$1) {
|
|
27010
|
+
module$1.exports = function(scope) {
|
|
27011
|
+
var rc = require_rc()("npm", { registry: "https://registry.npmjs.org/" });
|
|
27012
|
+
var url = rc[scope + ":registry"] || rc.registry;
|
|
27013
|
+
return url.slice(-1) === "/" ? url : url + "/";
|
|
27014
|
+
};
|
|
27015
|
+
} });
|
|
27016
|
+
var require_safe_buffer = __commonJS({ "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports$1, module$1) {
|
|
27017
|
+
var buffer$1 = __require$1("buffer");
|
|
27018
|
+
var Buffer2 = buffer$1.Buffer;
|
|
27019
|
+
function copyProps(src$1, dst) {
|
|
27020
|
+
for (var key in src$1) dst[key] = src$1[key];
|
|
27021
|
+
}
|
|
27022
|
+
__name(copyProps, "copyProps");
|
|
27023
|
+
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) module$1.exports = buffer$1;
|
|
27024
|
+
else {
|
|
27025
|
+
copyProps(buffer$1, exports$1);
|
|
27026
|
+
exports$1.Buffer = SafeBuffer;
|
|
27027
|
+
}
|
|
27028
|
+
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
27029
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
27030
|
+
}
|
|
27031
|
+
__name(SafeBuffer, "SafeBuffer");
|
|
27032
|
+
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
27033
|
+
copyProps(Buffer2, SafeBuffer);
|
|
27034
|
+
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
27035
|
+
if (typeof arg === "number") throw new TypeError("Argument must not be a number");
|
|
27036
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
27037
|
+
};
|
|
27038
|
+
SafeBuffer.alloc = function(size, fill$2, encoding) {
|
|
27039
|
+
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
27040
|
+
var buf = Buffer2(size);
|
|
27041
|
+
if (fill$2 !== void 0) if (typeof encoding === "string") buf.fill(fill$2, encoding);
|
|
27042
|
+
else buf.fill(fill$2);
|
|
27043
|
+
else buf.fill(0);
|
|
27044
|
+
return buf;
|
|
27045
|
+
};
|
|
27046
|
+
SafeBuffer.allocUnsafe = function(size) {
|
|
27047
|
+
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
27048
|
+
return Buffer2(size);
|
|
27049
|
+
};
|
|
27050
|
+
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
27051
|
+
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
27052
|
+
return buffer$1.SlowBuffer(size);
|
|
27053
|
+
};
|
|
27054
|
+
} });
|
|
27055
|
+
var require_base64 = __commonJS({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports$1, module$1) {
|
|
27056
|
+
var safeBuffer = require_safe_buffer().Buffer;
|
|
27057
|
+
function decodeBase64(base64$1) {
|
|
27058
|
+
return safeBuffer.from(base64$1, "base64").toString("utf8");
|
|
27059
|
+
}
|
|
27060
|
+
__name(decodeBase64, "decodeBase64");
|
|
27061
|
+
function encodeBase64(string) {
|
|
27062
|
+
return safeBuffer.from(string, "utf8").toString("base64");
|
|
27063
|
+
}
|
|
27064
|
+
__name(encodeBase64, "encodeBase64");
|
|
27065
|
+
module$1.exports = {
|
|
27066
|
+
decodeBase64,
|
|
27067
|
+
encodeBase64
|
|
27068
|
+
};
|
|
27069
|
+
} });
|
|
27070
|
+
var require_registry_auth_token = __commonJS({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports$1, module$1) {
|
|
27071
|
+
var url = __require$1("url");
|
|
27072
|
+
var base64$1 = require_base64();
|
|
27073
|
+
var decodeBase64 = base64$1.decodeBase64;
|
|
27074
|
+
var encodeBase64 = base64$1.encodeBase64;
|
|
27075
|
+
var tokenKey = ":_authToken";
|
|
27076
|
+
var userKey = ":username";
|
|
27077
|
+
var passwordKey = ":_password";
|
|
27078
|
+
module$1.exports = function() {
|
|
27079
|
+
var checkUrl;
|
|
27080
|
+
var options;
|
|
27081
|
+
if (arguments.length >= 2) {
|
|
27082
|
+
checkUrl = arguments[0];
|
|
27083
|
+
options = arguments[1];
|
|
27084
|
+
} else if (typeof arguments[0] === "string") checkUrl = arguments[0];
|
|
27085
|
+
else options = arguments[0];
|
|
27086
|
+
options = options || {};
|
|
27087
|
+
options.npmrc = options.npmrc || require_rc()("npm", { registry: "https://registry.npmjs.org/" });
|
|
27088
|
+
checkUrl = checkUrl || options.npmrc.registry;
|
|
27089
|
+
return getRegistryAuthInfo(checkUrl, options) || getLegacyAuthInfo(options.npmrc);
|
|
27090
|
+
};
|
|
27091
|
+
function getRegistryAuthInfo(checkUrl, options) {
|
|
27092
|
+
var parsed = url.parse(checkUrl, false, true);
|
|
27093
|
+
var pathname;
|
|
27094
|
+
while (pathname !== "/" && parsed.pathname !== pathname) {
|
|
27095
|
+
pathname = parsed.pathname || "/";
|
|
27096
|
+
var authInfo = getAuthInfoForUrl("//" + parsed.host + pathname.replace(/\/$/, ""), options.npmrc);
|
|
27097
|
+
if (authInfo) return authInfo;
|
|
27098
|
+
if (!options.recursive) return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(url.resolve(checkUrl, "."), options);
|
|
27099
|
+
parsed.pathname = url.resolve(normalizePath$2(pathname), "..") || "/";
|
|
27100
|
+
}
|
|
27101
|
+
}
|
|
27102
|
+
__name(getRegistryAuthInfo, "getRegistryAuthInfo");
|
|
27103
|
+
function getLegacyAuthInfo(npmrc) {
|
|
27104
|
+
if (npmrc._auth) return {
|
|
27105
|
+
token: npmrc._auth,
|
|
27106
|
+
type: "Basic"
|
|
27107
|
+
};
|
|
27108
|
+
}
|
|
27109
|
+
__name(getLegacyAuthInfo, "getLegacyAuthInfo");
|
|
27110
|
+
function normalizePath$2(path5) {
|
|
27111
|
+
return path5[path5.length - 1] === "/" ? path5 : path5 + "/";
|
|
27112
|
+
}
|
|
27113
|
+
__name(normalizePath$2, "normalizePath");
|
|
27114
|
+
function getAuthInfoForUrl(regUrl, npmrc) {
|
|
27115
|
+
var bearerAuth = getBearerToken(npmrc[regUrl + tokenKey] || npmrc[regUrl + "/" + tokenKey]);
|
|
27116
|
+
if (bearerAuth) return bearerAuth;
|
|
27117
|
+
var basicAuth = getTokenForUsernameAndPassword(npmrc[regUrl + userKey] || npmrc[regUrl + "/" + userKey], npmrc[regUrl + passwordKey] || npmrc[regUrl + "/" + passwordKey]);
|
|
27118
|
+
if (basicAuth) return basicAuth;
|
|
27119
|
+
}
|
|
27120
|
+
__name(getAuthInfoForUrl, "getAuthInfoForUrl");
|
|
27121
|
+
function getBearerToken(tok) {
|
|
27122
|
+
if (!tok) return;
|
|
27123
|
+
return {
|
|
27124
|
+
token: tok.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
|
|
27125
|
+
return process.env[envVar];
|
|
27126
|
+
}),
|
|
27127
|
+
type: "Bearer"
|
|
27128
|
+
};
|
|
27129
|
+
}
|
|
27130
|
+
__name(getBearerToken, "getBearerToken");
|
|
27131
|
+
function getTokenForUsernameAndPassword(username, password) {
|
|
27132
|
+
if (!username || !password) return;
|
|
27133
|
+
var pass = decodeBase64(password.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
|
|
27134
|
+
return process.env[envVar];
|
|
27135
|
+
}));
|
|
27136
|
+
return {
|
|
27137
|
+
token: encodeBase64(username + ":" + pass),
|
|
27138
|
+
type: "Basic",
|
|
27139
|
+
password: pass,
|
|
27140
|
+
username
|
|
27141
|
+
};
|
|
27142
|
+
}
|
|
27143
|
+
__name(getTokenForUsernameAndPassword, "getTokenForUsernameAndPassword");
|
|
27144
|
+
} });
|
|
27145
|
+
var require_update_check = __commonJS({ "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports$1, module$1) {
|
|
27146
|
+
var { URL: URL2 } = __require$1("url");
|
|
27147
|
+
var { join: join2 } = __require$1("path");
|
|
27148
|
+
var fs3 = __require$1("fs");
|
|
27149
|
+
var { promisify: promisify$3 } = __require$1("util");
|
|
27150
|
+
var { tmpdir } = __require$1("os");
|
|
27151
|
+
var registryUrl = require_registry_url();
|
|
27152
|
+
var writeFile$1 = promisify$3(fs3.writeFile);
|
|
27153
|
+
var mkdir$1 = promisify$3(fs3.mkdir);
|
|
27154
|
+
var readFile$1 = promisify$3(fs3.readFile);
|
|
27155
|
+
var compareVersions = /* @__PURE__ */ __name((a, b) => a.localeCompare(b, "en-US", { numeric: true }), "compareVersions");
|
|
27156
|
+
var encode$2 = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode");
|
|
27157
|
+
var getFile = /* @__PURE__ */ __name(async (details, distTag) => {
|
|
27158
|
+
const subDir = join2(tmpdir(), "update-check");
|
|
27159
|
+
if (!fs3.existsSync(subDir)) await mkdir$1(subDir);
|
|
27160
|
+
let name = `${details.name}-${distTag}.json`;
|
|
27161
|
+
if (details.scope) name = `${details.scope}-${name}`;
|
|
27162
|
+
return join2(subDir, name);
|
|
27163
|
+
}, "getFile");
|
|
27164
|
+
var evaluateCache = /* @__PURE__ */ __name(async (file$1, time, interval) => {
|
|
27165
|
+
if (fs3.existsSync(file$1)) {
|
|
27166
|
+
const content = await readFile$1(file$1, "utf8");
|
|
27167
|
+
const { lastUpdate, latest } = JSON.parse(content);
|
|
27168
|
+
if (lastUpdate + interval > time) return {
|
|
27169
|
+
shouldCheck: false,
|
|
27170
|
+
latest
|
|
27171
|
+
};
|
|
27172
|
+
}
|
|
27173
|
+
return {
|
|
27174
|
+
shouldCheck: true,
|
|
27175
|
+
latest: null
|
|
27176
|
+
};
|
|
27177
|
+
}, "evaluateCache");
|
|
27178
|
+
var updateCache = /* @__PURE__ */ __name(async (file$1, latest, lastUpdate) => {
|
|
27179
|
+
await writeFile$1(file$1, JSON.stringify({
|
|
27180
|
+
latest,
|
|
27181
|
+
lastUpdate
|
|
27182
|
+
}), "utf8");
|
|
27183
|
+
}, "updateCache");
|
|
27184
|
+
var loadPackage = /* @__PURE__ */ __name((url, authInfo) => new Promise((resolve$4, reject) => {
|
|
27185
|
+
const options = {
|
|
27186
|
+
host: url.hostname,
|
|
27187
|
+
path: url.pathname,
|
|
27188
|
+
port: url.port,
|
|
27189
|
+
headers: { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" },
|
|
27190
|
+
timeout: 2e3
|
|
27191
|
+
};
|
|
27192
|
+
if (authInfo) options.headers.authorization = `${authInfo.type} ${authInfo.token}`;
|
|
27193
|
+
const { get } = url.protocol === "https:" ? __require$1("https") : __require$1("http");
|
|
27194
|
+
get(options, (response) => {
|
|
27195
|
+
const { statusCode } = response;
|
|
27196
|
+
if (statusCode !== 200) {
|
|
27197
|
+
const error = /* @__PURE__ */ new Error(`Request failed with code ${statusCode}`);
|
|
27198
|
+
error.code = statusCode;
|
|
27199
|
+
reject(error);
|
|
27200
|
+
response.resume();
|
|
27201
|
+
return;
|
|
27202
|
+
}
|
|
27203
|
+
let rawData = "";
|
|
27204
|
+
response.setEncoding("utf8");
|
|
27205
|
+
response.on("data", (chunk) => {
|
|
27206
|
+
rawData += chunk;
|
|
27207
|
+
});
|
|
27208
|
+
response.on("end", () => {
|
|
27209
|
+
try {
|
|
27210
|
+
resolve$4(JSON.parse(rawData));
|
|
27211
|
+
} catch (e2) {
|
|
27212
|
+
reject(e2);
|
|
27213
|
+
}
|
|
27214
|
+
});
|
|
27215
|
+
}).on("error", reject).on("timeout", reject);
|
|
27216
|
+
}), "loadPackage");
|
|
27217
|
+
var getMostRecent = /* @__PURE__ */ __name(async ({ full, scope }, distTag) => {
|
|
27218
|
+
const regURL = registryUrl(scope);
|
|
27219
|
+
const url = new URL2(full, regURL);
|
|
27220
|
+
let spec = null;
|
|
27221
|
+
try {
|
|
27222
|
+
spec = await loadPackage(url);
|
|
27223
|
+
} catch (err) {
|
|
27224
|
+
if (err.code && String(err.code).startsWith(4)) spec = await loadPackage(url, require_registry_auth_token()(regURL, { recursive: true }));
|
|
27225
|
+
else throw err;
|
|
27226
|
+
}
|
|
27227
|
+
const version$2 = spec["dist-tags"][distTag];
|
|
27228
|
+
if (!version$2) throw new Error(`Distribution tag ${distTag} is not available`);
|
|
27229
|
+
return version$2;
|
|
27230
|
+
}, "getMostRecent");
|
|
27231
|
+
var defaultConfig = {
|
|
27232
|
+
interval: 36e5,
|
|
27233
|
+
distTag: "latest"
|
|
27234
|
+
};
|
|
27235
|
+
var getDetails = /* @__PURE__ */ __name((name) => {
|
|
27236
|
+
const spec = { full: encode$2(name) };
|
|
27237
|
+
if (name.includes("/")) {
|
|
27238
|
+
const parts = name.split("/");
|
|
27239
|
+
spec.scope = parts[0];
|
|
27240
|
+
spec.name = parts[1];
|
|
27241
|
+
} else {
|
|
27242
|
+
spec.scope = null;
|
|
27243
|
+
spec.name = name;
|
|
27244
|
+
}
|
|
27245
|
+
return spec;
|
|
27246
|
+
}, "getDetails");
|
|
27247
|
+
module$1.exports = async (pkg, config) => {
|
|
27248
|
+
if (typeof pkg !== "object") throw new Error("The first parameter should be your package.json file content");
|
|
27249
|
+
const details = getDetails(pkg.name);
|
|
27250
|
+
const time = Date.now();
|
|
27251
|
+
const { distTag, interval } = Object.assign({}, defaultConfig, config);
|
|
27252
|
+
const file$1 = await getFile(details, distTag);
|
|
27253
|
+
let latest = null;
|
|
27254
|
+
let shouldCheck = true;
|
|
27255
|
+
({shouldCheck, latest} = await evaluateCache(file$1, time, interval));
|
|
27256
|
+
if (shouldCheck) {
|
|
27257
|
+
latest = await getMostRecent(details, distTag);
|
|
27258
|
+
await updateCache(file$1, latest, time);
|
|
27259
|
+
}
|
|
27260
|
+
if (compareVersions(pkg.version, latest) === -1) return {
|
|
27261
|
+
latest,
|
|
27262
|
+
fromCache: !shouldCheck
|
|
27263
|
+
};
|
|
27264
|
+
return null;
|
|
27265
|
+
};
|
|
27266
|
+
} });
|
|
26473
27267
|
var defaultWranglerConfig = {
|
|
26474
27268
|
configPath: void 0,
|
|
26475
27269
|
userConfigPath: void 0,
|
|
@@ -26507,6 +27301,8 @@ var defaultWranglerConfig = {
|
|
|
26507
27301
|
vectorize: [],
|
|
26508
27302
|
ai_search_namespaces: [],
|
|
26509
27303
|
ai_search: [],
|
|
27304
|
+
web_search: void 0,
|
|
27305
|
+
agent_memory: [],
|
|
26510
27306
|
hyperdrive: [],
|
|
26511
27307
|
workflows: [],
|
|
26512
27308
|
secrets_store_secrets: [],
|
|
@@ -30182,7 +30978,10 @@ var getC3CommandFromEnv = getEnvironmentVariableFactory({
|
|
|
30182
30978
|
defaultValue: /* @__PURE__ */ __name(() => "create cloudflare", "defaultValue")
|
|
30183
30979
|
});
|
|
30184
30980
|
var getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_METRICS" });
|
|
30185
|
-
var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
|
|
30981
|
+
var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
|
|
30982
|
+
variableName: "WRANGLER_SEND_ERROR_REPORTS",
|
|
30983
|
+
defaultValue: false
|
|
30984
|
+
});
|
|
30186
30985
|
var getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory({
|
|
30187
30986
|
variableName: "WRANGLER_API_ENVIRONMENT",
|
|
30188
30987
|
defaultValue: /* @__PURE__ */ __name(() => "production", "defaultValue"),
|
|
@@ -30552,6 +31351,8 @@ var friendlyBindingNames = {
|
|
|
30552
31351
|
vectorize: "Vectorize Index",
|
|
30553
31352
|
ai_search_namespaces: "AI Search Namespace",
|
|
30554
31353
|
ai_search: "AI Search Instance",
|
|
31354
|
+
web_search: "Web Search",
|
|
31355
|
+
agent_memory: "Agent Memory",
|
|
30555
31356
|
hyperdrive: "Hyperdrive Config",
|
|
30556
31357
|
r2_buckets: "R2 Bucket",
|
|
30557
31358
|
logfwdr: "logfwdr",
|
|
@@ -30603,6 +31404,8 @@ var bindingTypeFriendlyNames = {
|
|
|
30603
31404
|
vectorize: "Vectorize Index",
|
|
30604
31405
|
ai_search_namespace: "AI Search Namespace",
|
|
30605
31406
|
ai_search: "AI Search Instance",
|
|
31407
|
+
web_search: "Web Search",
|
|
31408
|
+
agent_memory: "Agent Memory",
|
|
30606
31409
|
hyperdrive: "Hyperdrive Config",
|
|
30607
31410
|
service: "Worker",
|
|
30608
31411
|
fetcher: "Service Binding",
|
|
@@ -31079,6 +31882,8 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
31079
31882
|
vectorize: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vectorize", validateBindingArray(envName, validateVectorizeBinding), []),
|
|
31080
31883
|
ai_search_namespaces: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai_search_namespaces", validateBindingArray(envName, validateAISearchNamespaceBinding), []),
|
|
31081
31884
|
ai_search: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai_search", validateBindingArray(envName, validateAISearchBinding), []),
|
|
31885
|
+
web_search: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "web_search", validateNamedSimpleBinding(envName), void 0),
|
|
31886
|
+
agent_memory: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "agent_memory", validateBindingArray(envName, validateAgentMemoryBinding), []),
|
|
31082
31887
|
hyperdrive: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "hyperdrive", validateBindingArray(envName, validateHyperdriveBinding), []),
|
|
31083
31888
|
services: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "services", validateBindingArray(envName, validateServiceBinding), []),
|
|
31084
31889
|
analytics_engine_datasets: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "analytics_engine_datasets", validateBindingArray(envName, validateAnalyticsEngineBinding), []),
|
|
@@ -31546,6 +32351,8 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
31546
32351
|
"ai",
|
|
31547
32352
|
"ai_search_namespace",
|
|
31548
32353
|
"ai_search",
|
|
32354
|
+
"web_search",
|
|
32355
|
+
"agent_memory",
|
|
31549
32356
|
"kv_namespace",
|
|
31550
32357
|
"durable_object_namespace",
|
|
31551
32358
|
"d1_database",
|
|
@@ -32054,6 +32861,28 @@ var validateAISearchBinding = /* @__PURE__ */ __name((diagnostics, field, value)
|
|
|
32054
32861
|
]);
|
|
32055
32862
|
return isValid2;
|
|
32056
32863
|
}, "validateAISearchBinding");
|
|
32864
|
+
var validateAgentMemoryBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
32865
|
+
if (typeof value !== "object" || value === null) {
|
|
32866
|
+
diagnostics.errors.push(`"agent_memory" bindings should be objects, but got ${JSON.stringify(value)}`);
|
|
32867
|
+
return false;
|
|
32868
|
+
}
|
|
32869
|
+
let isValid2 = true;
|
|
32870
|
+
if (!isRequiredProperty(value, "binding", "string")) {
|
|
32871
|
+
diagnostics.errors.push(`"${field}" bindings should have a string "binding" field but got ${JSON.stringify(value)}.`);
|
|
32872
|
+
isValid2 = false;
|
|
32873
|
+
}
|
|
32874
|
+
if (!isRequiredProperty(value, "namespace", "string")) {
|
|
32875
|
+
diagnostics.errors.push(`"${field}" bindings must have a "namespace" field but got ${JSON.stringify(value)}.`);
|
|
32876
|
+
isValid2 = false;
|
|
32877
|
+
}
|
|
32878
|
+
if (!isRemoteValid(value, field, diagnostics)) isValid2 = false;
|
|
32879
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
32880
|
+
"binding",
|
|
32881
|
+
"namespace",
|
|
32882
|
+
"remote"
|
|
32883
|
+
]);
|
|
32884
|
+
return isValid2;
|
|
32885
|
+
}, "validateAgentMemoryBinding");
|
|
32057
32886
|
var validateHyperdriveBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
32058
32887
|
if (typeof value !== "object" || value === null) {
|
|
32059
32888
|
diagnostics.errors.push(`"hyperdrive" bindings should be objects, but got ${JSON.stringify(value)}`);
|
|
@@ -32364,13 +33193,19 @@ var validatePipelineBinding = /* @__PURE__ */ __name((diagnostics, field, value)
|
|
|
32364
33193
|
diagnostics.errors.push(`"${field}" bindings must have a string "binding" field but got ${JSON.stringify(value)}.`);
|
|
32365
33194
|
isValid2 = false;
|
|
32366
33195
|
}
|
|
32367
|
-
|
|
32368
|
-
|
|
33196
|
+
const hasStream = isOptionalProperty(value, "stream", "string");
|
|
33197
|
+
const hasPipeline = isOptionalProperty(value, "pipeline", "string");
|
|
33198
|
+
const v = value;
|
|
33199
|
+
if (hasStream && v.stream);
|
|
33200
|
+
else if (hasPipeline && v.pipeline) diagnostics.warnings.push(`The "pipeline" field in "${field}" bindings is deprecated. Use "stream" instead.`);
|
|
33201
|
+
else {
|
|
33202
|
+
diagnostics.errors.push(`"${field}" bindings must have a string "stream" field but got ${JSON.stringify(value)}.`);
|
|
32369
33203
|
isValid2 = false;
|
|
32370
33204
|
}
|
|
32371
33205
|
if (!isRemoteValid(value, field, diagnostics)) isValid2 = false;
|
|
32372
33206
|
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
32373
33207
|
"binding",
|
|
33208
|
+
"stream",
|
|
32374
33209
|
"pipeline",
|
|
32375
33210
|
"remote"
|
|
32376
33211
|
]);
|
|
@@ -32821,7 +33656,9 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
32821
33656
|
artifacts: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
32822
33657
|
flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
32823
33658
|
vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
32824
|
-
vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
33659
|
+
vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
33660
|
+
web_search: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
33661
|
+
agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
32825
33662
|
};
|
|
32826
33663
|
function getBindingLocalSupport(type) {
|
|
32827
33664
|
if (type in BINDING_LOCAL_SUPPORT) return BINDING_LOCAL_SUPPORT[type];
|
|
@@ -33241,15 +34078,7 @@ Please ensure you have write permissions to: ${cacheDir}`, { telemetryMessage: "
|
|
|
33241
34078
|
__name(downloadCloudflared, "downloadCloudflared");
|
|
33242
34079
|
async function downloadAndExtractTarball(response, expectedChecksum, binPath, cacheDir) {
|
|
33243
34080
|
const tempTarPath = join(cacheDir, "cloudflared.tgz");
|
|
33244
|
-
|
|
33245
|
-
if (expectedChecksum) {
|
|
33246
|
-
const actualSha256 = sha256Hex(buffer$1);
|
|
33247
|
-
if (actualSha256 !== expectedChecksum) throw new UserError(`[cloudflared] SHA256 mismatch for downloaded cloudflared tarball.
|
|
33248
|
-
|
|
33249
|
-
Expected: ${expectedChecksum}
|
|
33250
|
-
Actual: ${actualSha256}`, { telemetryMessage: "tunnel cloudflared tarball checksum mismatch" });
|
|
33251
|
-
}
|
|
33252
|
-
writeFileSync(tempTarPath, buffer$1);
|
|
34081
|
+
writeFileSync(tempTarPath, Buffer.from(await response.arrayBuffer()));
|
|
33253
34082
|
try {
|
|
33254
34083
|
execFileSync("tar", [
|
|
33255
34084
|
"-xzf",
|
|
@@ -33259,6 +34088,13 @@ Actual: ${actualSha256}`, { telemetryMessage: "tunnel cloudflared tarball chec
|
|
|
33259
34088
|
], { stdio: "ignore" });
|
|
33260
34089
|
const extractedPath = join(cacheDir, "cloudflared");
|
|
33261
34090
|
if (extractedPath !== binPath && existsSync(extractedPath)) renameSync(extractedPath, binPath);
|
|
34091
|
+
if (expectedChecksum) {
|
|
34092
|
+
const actualSha256 = sha256Hex(readFileSync(binPath));
|
|
34093
|
+
if (actualSha256 !== expectedChecksum) throw new UserError(`[cloudflared] SHA256 mismatch for downloaded cloudflared binary.
|
|
34094
|
+
|
|
34095
|
+
Expected: ${expectedChecksum}
|
|
34096
|
+
Actual: ${actualSha256}`, { telemetryMessage: "tunnel cloudflared extracted binary checksum mismatch" });
|
|
34097
|
+
}
|
|
33262
34098
|
} finally {
|
|
33263
34099
|
try {
|
|
33264
34100
|
if (existsSync(tempTarPath)) unlinkSync(tempTarPath);
|
|
@@ -33533,6 +34369,27 @@ The local dev server started at ${origin.href}.
|
|
|
33533
34369
|
return new Error(errorMessage);
|
|
33534
34370
|
}
|
|
33535
34371
|
__name(createTunnelStartupError, "createTunnelStartupError");
|
|
34372
|
+
var import_update_check = __toESM(require_update_check());
|
|
34373
|
+
var UPDATE_CHECK_TIMEOUT_MS = 3e3;
|
|
34374
|
+
var TIMED_OUT = Symbol("timed_out");
|
|
34375
|
+
async function fetchLatestNpmVersion(name, version$2) {
|
|
34376
|
+
let result = null;
|
|
34377
|
+
try {
|
|
34378
|
+
result = await Promise.race([(0, import_update_check.default)({
|
|
34379
|
+
name,
|
|
34380
|
+
version: version$2
|
|
34381
|
+
}, { distTag: version$2.startsWith("0.0.0") ? "beta" : "latest" }), timersPromises.setTimeout(UPDATE_CHECK_TIMEOUT_MS, TIMED_OUT, { ref: false })]);
|
|
34382
|
+
} catch {
|
|
34383
|
+
return { status: "failed" };
|
|
34384
|
+
}
|
|
34385
|
+
if (result === TIMED_OUT) return { status: "failed" };
|
|
34386
|
+
if (result === null) return { status: "up-to-date" };
|
|
34387
|
+
return {
|
|
34388
|
+
status: "update-available",
|
|
34389
|
+
latest: result.latest
|
|
34390
|
+
};
|
|
34391
|
+
}
|
|
34392
|
+
__name(fetchLatestNpmVersion, "fetchLatestNpmVersion");
|
|
33536
34393
|
|
|
33537
34394
|
//#endregion
|
|
33538
34395
|
//#region ../../node_modules/.pnpm/get-port@7.1.0/node_modules/get-port/index.js
|
|
@@ -35499,6 +36356,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
|
|
|
35499
36356
|
}
|
|
35500
36357
|
dispose() {
|
|
35501
36358
|
const tunnel = this.#tunnel;
|
|
36359
|
+
const wasTunnelStarted = this.#origin !== void 0;
|
|
35502
36360
|
this.#abortController?.abort();
|
|
35503
36361
|
this.#origin = void 0;
|
|
35504
36362
|
this.#publicUrls = void 0;
|
|
@@ -35507,7 +36365,7 @@ Add \`${QUICK_TUNNEL_ALLOWED_HOST}\` to \`preview.allowedHosts\` in your Vite co
|
|
|
35507
36365
|
this.#hasWarnedAboutSse = false;
|
|
35508
36366
|
debuglog("Disposing tunnel...");
|
|
35509
36367
|
if (tunnel) tunnel.dispose();
|
|
35510
|
-
this.#logger.info(" ➜ Tunnel closed");
|
|
36368
|
+
if (wasTunnelStarted) this.#logger.info(" ➜ Tunnel closed");
|
|
35511
36369
|
}
|
|
35512
36370
|
disposeOnExit() {
|
|
35513
36371
|
try {
|
|
@@ -35761,8 +36619,8 @@ const postfixRE = /[?#].*$/;
|
|
|
35761
36619
|
function cleanUrl(url) {
|
|
35762
36620
|
return url.replace(postfixRE, "");
|
|
35763
36621
|
}
|
|
35764
|
-
function withTrailingSlash(path
|
|
35765
|
-
return path
|
|
36622
|
+
function withTrailingSlash(path) {
|
|
36623
|
+
return path.endsWith("/") ? path : `${path}/`;
|
|
35766
36624
|
}
|
|
35767
36625
|
function createRequestHandler(handler) {
|
|
35768
36626
|
return async (req, res, next) => {
|
|
@@ -37384,7 +38242,7 @@ function getLineInfo(input, offset) {
|
|
|
37384
38242
|
cur = nextBreak;
|
|
37385
38243
|
}
|
|
37386
38244
|
}
|
|
37387
|
-
var defaultOptions = {
|
|
38245
|
+
var defaultOptions$1 = {
|
|
37388
38246
|
ecmaVersion: null,
|
|
37389
38247
|
sourceType: "script",
|
|
37390
38248
|
onInsertedSemicolon: null,
|
|
@@ -37406,9 +38264,9 @@ var defaultOptions = {
|
|
|
37406
38264
|
preserveParens: false
|
|
37407
38265
|
};
|
|
37408
38266
|
var warnedAboutEcmaVersion = false;
|
|
37409
|
-
function getOptions(opts) {
|
|
38267
|
+
function getOptions$1(opts) {
|
|
37410
38268
|
var options = {};
|
|
37411
|
-
for (var opt in defaultOptions) options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];
|
|
38269
|
+
for (var opt in defaultOptions$1) options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions$1[opt];
|
|
37412
38270
|
if (options.ecmaVersion === "latest") options.ecmaVersion = 1e8;
|
|
37413
38271
|
else if (options.ecmaVersion == null) {
|
|
37414
38272
|
if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
|
|
@@ -37448,7 +38306,7 @@ function functionFlags(async, generator) {
|
|
|
37448
38306
|
}
|
|
37449
38307
|
var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5;
|
|
37450
38308
|
var Parser = function Parser$2(options, input, startPos) {
|
|
37451
|
-
this.options = options = getOptions(options);
|
|
38309
|
+
this.options = options = getOptions$1(options);
|
|
37452
38310
|
this.sourceFile = options.sourceFile;
|
|
37453
38311
|
this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
|
|
37454
38312
|
var reserved = "";
|
|
@@ -41233,7 +42091,7 @@ var version$1 = "8.16.0";
|
|
|
41233
42091
|
Parser.acorn = {
|
|
41234
42092
|
Parser,
|
|
41235
42093
|
version: version$1,
|
|
41236
|
-
defaultOptions,
|
|
42094
|
+
defaultOptions: defaultOptions$1,
|
|
41237
42095
|
Position,
|
|
41238
42096
|
SourceLocation,
|
|
41239
42097
|
getLineInfo,
|
|
@@ -41264,15 +42122,15 @@ function hasTrailingSlash(input = "", respectQueryAndFragment) {
|
|
|
41264
42122
|
function withTrailingSlash$1(input = "", respectQueryAndFragment) {
|
|
41265
42123
|
if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
|
|
41266
42124
|
if (hasTrailingSlash(input, true)) return input || "/";
|
|
41267
|
-
let path
|
|
42125
|
+
let path = input;
|
|
41268
42126
|
let fragment = "";
|
|
41269
42127
|
const fragmentIndex = input.indexOf("#");
|
|
41270
42128
|
if (fragmentIndex >= 0) {
|
|
41271
|
-
path
|
|
42129
|
+
path = input.slice(0, fragmentIndex);
|
|
41272
42130
|
fragment = input.slice(fragmentIndex);
|
|
41273
|
-
if (!path
|
|
42131
|
+
if (!path) return fragment;
|
|
41274
42132
|
}
|
|
41275
|
-
const [s0, ...s] = path
|
|
42133
|
+
const [s0, ...s] = path.split("?");
|
|
41276
42134
|
return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
|
|
41277
42135
|
}
|
|
41278
42136
|
function isNonEmptyURL(url) {
|
|
@@ -41291,15 +42149,15 @@ const protocolRelative = Symbol.for("ufo:protocolRelative");
|
|
|
41291
42149
|
//#endregion
|
|
41292
42150
|
//#region ../../node_modules/.pnpm/pathe@2.0.1/node_modules/pathe/dist/shared/pathe.BLwDEnA5.mjs
|
|
41293
42151
|
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
41294
|
-
const isAbsolute$
|
|
42152
|
+
const isAbsolute$2 = function(p$1) {
|
|
41295
42153
|
return _IS_ABSOLUTE_RE.test(p$1);
|
|
41296
42154
|
};
|
|
41297
42155
|
|
|
41298
42156
|
//#endregion
|
|
41299
42157
|
//#region ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
|
|
41300
42158
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
41301
|
-
function normalizeSlash(path
|
|
41302
|
-
return path
|
|
42159
|
+
function normalizeSlash(path) {
|
|
42160
|
+
return path.replace(/\\/g, "/");
|
|
41303
42161
|
}
|
|
41304
42162
|
/**
|
|
41305
42163
|
* @typedef ErrnoExceptionFields
|
|
@@ -41419,8 +42277,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
41419
42277
|
* @param {string} [base]
|
|
41420
42278
|
* @param {string} [message]
|
|
41421
42279
|
*/
|
|
41422
|
-
(path
|
|
41423
|
-
return `Invalid package config ${path
|
|
42280
|
+
(path, base, message) => {
|
|
42281
|
+
return `Invalid package config ${path}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
41424
42282
|
},
|
|
41425
42283
|
Error
|
|
41426
42284
|
);
|
|
@@ -41450,8 +42308,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
41450
42308
|
* @param {string} base
|
|
41451
42309
|
* @param {boolean} [exactUrl]
|
|
41452
42310
|
*/
|
|
41453
|
-
(path
|
|
41454
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path
|
|
42311
|
+
(path, base, exactUrl = false) => {
|
|
42312
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path}' imported from ${base}`;
|
|
41455
42313
|
},
|
|
41456
42314
|
Error
|
|
41457
42315
|
);
|
|
@@ -41489,8 +42347,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
41489
42347
|
* @param {string} extension
|
|
41490
42348
|
* @param {string} path
|
|
41491
42349
|
*/
|
|
41492
|
-
(extension, path
|
|
41493
|
-
return `Unknown file extension "${extension}" for ${path
|
|
42350
|
+
(extension, path) => {
|
|
42351
|
+
return `Unknown file extension "${extension}" for ${path}`;
|
|
41494
42352
|
},
|
|
41495
42353
|
TypeError
|
|
41496
42354
|
);
|
|
@@ -41859,9 +42717,9 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
41859
42717
|
* @param {string} path
|
|
41860
42718
|
* @returns {Stats | undefined}
|
|
41861
42719
|
*/
|
|
41862
|
-
function tryStatSync(path
|
|
42720
|
+
function tryStatSync(path) {
|
|
41863
42721
|
try {
|
|
41864
|
-
return statSync(path
|
|
42722
|
+
return statSync(path);
|
|
41865
42723
|
} catch {}
|
|
41866
42724
|
}
|
|
41867
42725
|
/**
|
|
@@ -42301,8 +43159,8 @@ function packageResolve(specifier, base, conditions) {
|
|
|
42301
43159
|
/** @type {string} */
|
|
42302
43160
|
let lastPath;
|
|
42303
43161
|
do {
|
|
42304
|
-
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
42305
|
-
if (!stat || !stat.isDirectory()) {
|
|
43162
|
+
const stat$1 = tryStatSync(packageJsonPath.slice(0, -13));
|
|
43163
|
+
if (!stat$1 || !stat$1.isDirectory()) {
|
|
42306
43164
|
lastPath = packageJsonPath;
|
|
42307
43165
|
packageJsonUrl = new URL$1((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl);
|
|
42308
43166
|
packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
@@ -42419,7 +43277,7 @@ function _resolve(id, options = {}) {
|
|
|
42419
43277
|
if (/(node|data|http|https):/.test(id)) return id;
|
|
42420
43278
|
if (BUILTIN_MODULES.has(id)) return "node:" + id;
|
|
42421
43279
|
if (id.startsWith("file://")) id = fileURLToPath$2(id);
|
|
42422
|
-
if (isAbsolute$
|
|
43280
|
+
if (isAbsolute$2(id)) try {
|
|
42423
43281
|
if (statSync(id).isFile()) return pathToFileURL$1(id);
|
|
42424
43282
|
} catch (error) {
|
|
42425
43283
|
if (error?.code !== "ENOENT") throw error;
|
|
@@ -44349,9 +45207,9 @@ function constructHeaders({ headers, headersFile, logger }) {
|
|
|
44349
45207
|
|
|
44350
45208
|
//#endregion
|
|
44351
45209
|
//#region ../workers-shared/utils/configuration/validateURL.ts
|
|
44352
|
-
const extractPathname = (path
|
|
44353
|
-
if (!path
|
|
44354
|
-
const url = new URL(`//${path
|
|
45210
|
+
const extractPathname = (path = "/", includeSearch, includeHash) => {
|
|
45211
|
+
if (!path.startsWith("/")) path = `/${path}`;
|
|
45212
|
+
const url = new URL(`//${path}`, "relative://");
|
|
44355
45213
|
return `${url.pathname}${includeSearch ? url.search : ""}${includeHash ? url.hash : ""}`;
|
|
44356
45214
|
};
|
|
44357
45215
|
const URL_REGEX = /^https:\/\/+(?<host>[^/]+)\/?(?<path>.*)/;
|
|
@@ -44410,7 +45268,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
44410
45268
|
lineNumber: i$1 + 1,
|
|
44411
45269
|
message: "No headers specified"
|
|
44412
45270
|
});
|
|
44413
|
-
const [path
|
|
45271
|
+
const [path, pathError] = validateUrl(line, false, true);
|
|
44414
45272
|
if (pathError) {
|
|
44415
45273
|
invalid.push({
|
|
44416
45274
|
line,
|
|
@@ -44421,7 +45279,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
44421
45279
|
skipUntilNextPath = true;
|
|
44422
45280
|
continue;
|
|
44423
45281
|
}
|
|
44424
|
-
const wildcardError = validateNoMultipleWildcards(path
|
|
45282
|
+
const wildcardError = validateNoMultipleWildcards(path);
|
|
44425
45283
|
if (wildcardError) {
|
|
44426
45284
|
invalid.push({
|
|
44427
45285
|
line,
|
|
@@ -44433,7 +45291,7 @@ function parseHeaders(input, { maxRules = MAX_HEADER_RULES, maxLineLength = MAX_
|
|
|
44433
45291
|
continue;
|
|
44434
45292
|
}
|
|
44435
45293
|
rule = {
|
|
44436
|
-
path
|
|
45294
|
+
path,
|
|
44437
45295
|
line,
|
|
44438
45296
|
headers: {},
|
|
44439
45297
|
unsetHeaders: []
|
|
@@ -44516,11 +45374,11 @@ function isValidRule(rule) {
|
|
|
44516
45374
|
* `:splat` placeholder, would result in duplicate `:splat` parameters which is
|
|
44517
45375
|
* unsupported.
|
|
44518
45376
|
*/
|
|
44519
|
-
function validateNoMultipleWildcards(path
|
|
44520
|
-
const wildcardCount = (path
|
|
44521
|
-
const hasSplatPlaceholder = /:splat(?!\w)/.test(path
|
|
44522
|
-
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path
|
|
44523
|
-
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path
|
|
45377
|
+
function validateNoMultipleWildcards(path) {
|
|
45378
|
+
const wildcardCount = (path.match(SPLAT_REGEX) ?? []).length;
|
|
45379
|
+
const hasSplatPlaceholder = /:splat(?!\w)/.test(path);
|
|
45380
|
+
if (wildcardCount > 1) return `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path}.`;
|
|
45381
|
+
if (wildcardCount > 0 && hasSplatPlaceholder) return `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path}.`;
|
|
44524
45382
|
}
|
|
44525
45383
|
|
|
44526
45384
|
//#endregion
|
|
@@ -44737,13 +45595,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
44737
45595
|
const throwError = (message, Ctor) => {
|
|
44738
45596
|
throw new Ctor(message);
|
|
44739
45597
|
};
|
|
44740
|
-
const checkPath = (path
|
|
44741
|
-
if (!isString$1(path
|
|
44742
|
-
if (!path
|
|
44743
|
-
if (checkPath.isNotRelative(path
|
|
45598
|
+
const checkPath = (path, originalPath, doThrow) => {
|
|
45599
|
+
if (!isString$1(path)) return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
45600
|
+
if (!path) return doThrow(`path must not be empty`, TypeError);
|
|
45601
|
+
if (checkPath.isNotRelative(path)) return doThrow(`path should be a \`path.relative()\`d string, but got "${originalPath}"`, RangeError);
|
|
44744
45602
|
return true;
|
|
44745
45603
|
};
|
|
44746
|
-
const isNotRelative = (path
|
|
45604
|
+
const isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
|
|
44747
45605
|
checkPath.isNotRelative = isNotRelative;
|
|
44748
45606
|
checkPath.convert = (p$1) => p$1;
|
|
44749
45607
|
var Ignore = class {
|
|
@@ -44779,13 +45637,13 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
44779
45637
|
addPattern(pattern) {
|
|
44780
45638
|
return this.add(pattern);
|
|
44781
45639
|
}
|
|
44782
|
-
_testOne(path
|
|
45640
|
+
_testOne(path, checkUnignored) {
|
|
44783
45641
|
let ignored = false;
|
|
44784
45642
|
let unignored = false;
|
|
44785
45643
|
this._rules.forEach((rule) => {
|
|
44786
45644
|
const { negative } = rule;
|
|
44787
45645
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) return;
|
|
44788
|
-
if (rule.regex.test(path
|
|
45646
|
+
if (rule.regex.test(path)) {
|
|
44789
45647
|
ignored = !negative;
|
|
44790
45648
|
unignored = negative;
|
|
44791
45649
|
}
|
|
@@ -44796,33 +45654,33 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
44796
45654
|
};
|
|
44797
45655
|
}
|
|
44798
45656
|
_test(originalPath, cache$2, checkUnignored, slices) {
|
|
44799
|
-
const path
|
|
44800
|
-
checkPath(path
|
|
44801
|
-
return this._t(path
|
|
45657
|
+
const path = originalPath && checkPath.convert(originalPath);
|
|
45658
|
+
checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
45659
|
+
return this._t(path, cache$2, checkUnignored, slices);
|
|
44802
45660
|
}
|
|
44803
|
-
_t(path
|
|
44804
|
-
if (path
|
|
44805
|
-
if (!slices) slices = path
|
|
45661
|
+
_t(path, cache$2, checkUnignored, slices) {
|
|
45662
|
+
if (path in cache$2) return cache$2[path];
|
|
45663
|
+
if (!slices) slices = path.split(SLASH);
|
|
44806
45664
|
slices.pop();
|
|
44807
|
-
if (!slices.length) return cache$2[path
|
|
45665
|
+
if (!slices.length) return cache$2[path] = this._testOne(path, checkUnignored);
|
|
44808
45666
|
const parent = this._t(slices.join(SLASH) + SLASH, cache$2, checkUnignored, slices);
|
|
44809
|
-
return cache$2[path
|
|
45667
|
+
return cache$2[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
|
|
44810
45668
|
}
|
|
44811
|
-
ignores(path
|
|
44812
|
-
return this._test(path
|
|
45669
|
+
ignores(path) {
|
|
45670
|
+
return this._test(path, this._ignoreCache, false).ignored;
|
|
44813
45671
|
}
|
|
44814
45672
|
createFilter() {
|
|
44815
|
-
return (path
|
|
45673
|
+
return (path) => !this.ignores(path);
|
|
44816
45674
|
}
|
|
44817
45675
|
filter(paths) {
|
|
44818
45676
|
return makeArray(paths).filter(this.createFilter());
|
|
44819
45677
|
}
|
|
44820
|
-
test(path
|
|
44821
|
-
return this._test(path
|
|
45678
|
+
test(path) {
|
|
45679
|
+
return this._test(path, this._testCache, true);
|
|
44822
45680
|
}
|
|
44823
45681
|
};
|
|
44824
45682
|
const factory = (options) => new Ignore(options);
|
|
44825
|
-
const isPathValid = (path
|
|
45683
|
+
const isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
|
|
44826
45684
|
factory.isPathValid = isPathValid;
|
|
44827
45685
|
factory.default = factory;
|
|
44828
45686
|
module.exports = factory;
|
|
@@ -44831,7 +45689,7 @@ var require_ignore = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ig
|
|
|
44831
45689
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
44832
45690
|
checkPath.convert = makePosix;
|
|
44833
45691
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
44834
|
-
checkPath.isNotRelative = (path
|
|
45692
|
+
checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
|
|
44835
45693
|
}
|
|
44836
45694
|
}) });
|
|
44837
45695
|
|
|
@@ -46186,11 +47044,11 @@ var Mime = class {
|
|
|
46186
47044
|
}
|
|
46187
47045
|
return this;
|
|
46188
47046
|
}
|
|
46189
|
-
getType(path
|
|
46190
|
-
if (typeof path
|
|
46191
|
-
const last = path
|
|
47047
|
+
getType(path) {
|
|
47048
|
+
if (typeof path !== "string") return null;
|
|
47049
|
+
const last = path.replace(/^.*[/\\]/s, "").toLowerCase();
|
|
46192
47050
|
const ext = last.replace(/^.*\./s, "").toLowerCase();
|
|
46193
|
-
const hasPath = last.length < path
|
|
47051
|
+
const hasPath = last.length < path.length;
|
|
46194
47052
|
if (!(ext.length < last.length - 1) && hasPath) return null;
|
|
46195
47053
|
return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
|
|
46196
47054
|
}
|
|
@@ -46524,8 +47382,8 @@ function getErrorMap() {
|
|
|
46524
47382
|
//#endregion
|
|
46525
47383
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
46526
47384
|
const makeIssue = (params) => {
|
|
46527
|
-
const { data: data$1, path
|
|
46528
|
-
const fullPath = [...path
|
|
47385
|
+
const { data: data$1, path, errorMaps, issueData } = params;
|
|
47386
|
+
const fullPath = [...path, ...issueData.path || []];
|
|
46529
47387
|
const fullIssue = {
|
|
46530
47388
|
...issueData,
|
|
46531
47389
|
path: fullPath
|
|
@@ -46637,11 +47495,11 @@ var errorUtil;
|
|
|
46637
47495
|
//#endregion
|
|
46638
47496
|
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
46639
47497
|
var ParseInputLazyPath = class {
|
|
46640
|
-
constructor(parent, value, path
|
|
47498
|
+
constructor(parent, value, path, key) {
|
|
46641
47499
|
this._cachedPath = [];
|
|
46642
47500
|
this.parent = parent;
|
|
46643
47501
|
this.data = value;
|
|
46644
|
-
this._path = path
|
|
47502
|
+
this._path = path;
|
|
46645
47503
|
this._key = key;
|
|
46646
47504
|
}
|
|
46647
47505
|
get path() {
|
|
@@ -50692,11 +51550,11 @@ const getQueryString = (params) => {
|
|
|
50692
51550
|
};
|
|
50693
51551
|
const getUrl = (config, options) => {
|
|
50694
51552
|
const encoder$1 = config.ENCODE_PATH || encodeURI;
|
|
50695
|
-
const path
|
|
51553
|
+
const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
50696
51554
|
if (options.path?.hasOwnProperty(group)) return encoder$1(String(options.path[group]));
|
|
50697
51555
|
return substring;
|
|
50698
51556
|
});
|
|
50699
|
-
const url = `${config.BASE}${path
|
|
51557
|
+
const url = `${config.BASE}${path}`;
|
|
50700
51558
|
if (options.query) return `${url}${getQueryString(options.query)}`;
|
|
50701
51559
|
return url;
|
|
50702
51560
|
};
|
|
@@ -51761,28 +52619,28 @@ function getContainerOptions(options) {
|
|
|
51761
52619
|
}
|
|
51762
52620
|
|
|
51763
52621
|
//#endregion
|
|
51764
|
-
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.
|
|
52622
|
+
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.4/node_modules/fdir/dist/index.mjs
|
|
51765
52623
|
var __require = /* @__PURE__ */ createRequire$1(import.meta.url);
|
|
51766
|
-
function cleanPath(path
|
|
51767
|
-
let normalized = normalize(path
|
|
52624
|
+
function cleanPath(path) {
|
|
52625
|
+
let normalized = normalize(path);
|
|
51768
52626
|
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
51769
52627
|
return normalized;
|
|
51770
52628
|
}
|
|
51771
52629
|
const SLASHES_REGEX = /[\\/]/g;
|
|
51772
|
-
function convertSlashes(path
|
|
51773
|
-
return path
|
|
52630
|
+
function convertSlashes(path, separator) {
|
|
52631
|
+
return path.replace(SLASHES_REGEX, separator);
|
|
51774
52632
|
}
|
|
51775
52633
|
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
51776
|
-
function isRootDirectory(path
|
|
51777
|
-
return path
|
|
52634
|
+
function isRootDirectory(path) {
|
|
52635
|
+
return path === "/" || WINDOWS_ROOT_DIR_REGEX.test(path);
|
|
51778
52636
|
}
|
|
51779
|
-
function normalizePath$1(path
|
|
52637
|
+
function normalizePath$1(path, options) {
|
|
51780
52638
|
const { resolvePaths, normalizePath: normalizePath$1$1, pathSeparator } = options;
|
|
51781
|
-
const pathNeedsCleaning = process.platform === "win32" && path
|
|
51782
|
-
if (resolvePaths) path
|
|
51783
|
-
if (normalizePath$1$1 || pathNeedsCleaning) path
|
|
51784
|
-
if (path
|
|
51785
|
-
return convertSlashes(path
|
|
52639
|
+
const pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith(".");
|
|
52640
|
+
if (resolvePaths) path = resolve$1(path);
|
|
52641
|
+
if (normalizePath$1$1 || pathNeedsCleaning) path = cleanPath(path);
|
|
52642
|
+
if (path === ".") return "";
|
|
52643
|
+
return convertSlashes(path[path.length - 1] !== pathSeparator ? path + pathSeparator : path, pathSeparator);
|
|
51786
52644
|
}
|
|
51787
52645
|
function joinPathWithBasePath(filename, directoryPath) {
|
|
51788
52646
|
return directoryPath + filename;
|
|
@@ -51818,8 +52676,8 @@ const pushDirectory = (directoryPath, paths) => {
|
|
|
51818
52676
|
paths.push(directoryPath || ".");
|
|
51819
52677
|
};
|
|
51820
52678
|
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
51821
|
-
const path
|
|
51822
|
-
if (filters.every((filter) => filter(path
|
|
52679
|
+
const path = directoryPath || ".";
|
|
52680
|
+
if (filters.every((filter) => filter(path, true))) paths.push(path);
|
|
51823
52681
|
};
|
|
51824
52682
|
const empty$2 = () => {};
|
|
51825
52683
|
function build$6(root, options) {
|
|
@@ -51868,27 +52726,27 @@ const empty = () => {};
|
|
|
51868
52726
|
function build$3(options) {
|
|
51869
52727
|
return options.group ? groupFiles : empty;
|
|
51870
52728
|
}
|
|
51871
|
-
const resolveSymlinksAsync = function(path
|
|
52729
|
+
const resolveSymlinksAsync = function(path, state, callback$1) {
|
|
51872
52730
|
const { queue, fs: fs$2, options: { suppressErrors } } = state;
|
|
51873
52731
|
queue.enqueue();
|
|
51874
|
-
fs$2.realpath(path
|
|
52732
|
+
fs$2.realpath(path, (error, resolvedPath) => {
|
|
51875
52733
|
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
51876
|
-
fs$2.stat(resolvedPath, (error$1, stat) => {
|
|
52734
|
+
fs$2.stat(resolvedPath, (error$1, stat$1) => {
|
|
51877
52735
|
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
51878
|
-
if (stat.isDirectory() && isRecursive(path
|
|
51879
|
-
callback$1(stat, resolvedPath);
|
|
52736
|
+
if (stat$1.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
52737
|
+
callback$1(stat$1, resolvedPath);
|
|
51880
52738
|
queue.dequeue(null, state);
|
|
51881
52739
|
});
|
|
51882
52740
|
});
|
|
51883
52741
|
};
|
|
51884
|
-
const resolveSymlinks = function(path
|
|
52742
|
+
const resolveSymlinks = function(path, state, callback$1) {
|
|
51885
52743
|
const { queue, fs: fs$2, options: { suppressErrors } } = state;
|
|
51886
52744
|
queue.enqueue();
|
|
51887
52745
|
try {
|
|
51888
|
-
const resolvedPath = fs$2.realpathSync(path
|
|
51889
|
-
const stat = fs$2.statSync(resolvedPath);
|
|
51890
|
-
if (stat.isDirectory() && isRecursive(path
|
|
51891
|
-
callback$1(stat, resolvedPath);
|
|
52746
|
+
const resolvedPath = fs$2.realpathSync(path);
|
|
52747
|
+
const stat$1 = fs$2.statSync(resolvedPath);
|
|
52748
|
+
if (stat$1.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
52749
|
+
callback$1(stat$1, resolvedPath);
|
|
51892
52750
|
} catch (e) {
|
|
51893
52751
|
if (!suppressErrors) throw e;
|
|
51894
52752
|
}
|
|
@@ -51897,16 +52755,16 @@ function build$2(options, isSynchronous) {
|
|
|
51897
52755
|
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
51898
52756
|
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
51899
52757
|
}
|
|
51900
|
-
function isRecursive(path
|
|
52758
|
+
function isRecursive(path, resolved, state) {
|
|
51901
52759
|
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
51902
|
-
let parent = dirname$1(path
|
|
52760
|
+
let parent = dirname$1(path);
|
|
51903
52761
|
let depth$1 = 1;
|
|
51904
52762
|
while (parent !== state.root && depth$1 < 2) {
|
|
51905
52763
|
const resolvedPath = state.symlinks.get(parent);
|
|
51906
52764
|
if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
|
|
51907
52765
|
else parent = dirname$1(parent);
|
|
51908
52766
|
}
|
|
51909
|
-
state.symlinks.set(path
|
|
52767
|
+
state.symlinks.set(path, resolved);
|
|
51910
52768
|
return depth$1 > 1;
|
|
51911
52769
|
}
|
|
51912
52770
|
function isRecursiveUsingRealPaths(resolved, state) {
|
|
@@ -52062,7 +52920,7 @@ var Walker = class {
|
|
|
52062
52920
|
symlinks: /* @__PURE__ */ new Map(),
|
|
52063
52921
|
visited: [""].slice(0, 0),
|
|
52064
52922
|
controller: new Aborter(),
|
|
52065
|
-
fs: options.fs || nativeFs
|
|
52923
|
+
fs: options.fs || nativeFs
|
|
52066
52924
|
};
|
|
52067
52925
|
this.joinPath = build$7(this.root, options);
|
|
52068
52926
|
this.pushDirectory = build$6(this.root, options);
|
|
@@ -52087,19 +52945,19 @@ var Walker = class {
|
|
|
52087
52945
|
const filename = this.joinPath(entry.name, directoryPath);
|
|
52088
52946
|
this.pushFile(filename, files, this.state.counts, filters);
|
|
52089
52947
|
} else if (entry.isDirectory()) {
|
|
52090
|
-
let path
|
|
52091
|
-
if (exclude && exclude(entry.name, path
|
|
52092
|
-
this.pushDirectory(path
|
|
52093
|
-
this.walkDirectory(this.state, path
|
|
52948
|
+
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
52949
|
+
if (exclude && exclude(entry.name, path)) continue;
|
|
52950
|
+
this.pushDirectory(path, paths, filters);
|
|
52951
|
+
this.walkDirectory(this.state, path, path, depth$1 - 1, this.walk);
|
|
52094
52952
|
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
52095
|
-
let path
|
|
52096
|
-
this.resolveSymlink(path
|
|
52097
|
-
if (stat.isDirectory()) {
|
|
52953
|
+
let path = joinPathWithBasePath(entry.name, directoryPath);
|
|
52954
|
+
this.resolveSymlink(path, this.state, (stat$1, resolvedPath) => {
|
|
52955
|
+
if (stat$1.isDirectory()) {
|
|
52098
52956
|
resolvedPath = normalizePath$1(resolvedPath, this.state.options);
|
|
52099
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path
|
|
52100
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path
|
|
52957
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
|
52958
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth$1 - 1, this.walk);
|
|
52101
52959
|
} else {
|
|
52102
|
-
resolvedPath = useRealPaths ? resolvedPath : path
|
|
52960
|
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
52103
52961
|
const filename = basename(resolvedPath);
|
|
52104
52962
|
const directoryPath$1 = normalizePath$1(dirname$1(resolvedPath), this.state.options);
|
|
52105
52963
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
@@ -52264,16 +53122,17 @@ var Builder = class {
|
|
|
52264
53122
|
isMatch = globFn(patterns, ...options);
|
|
52265
53123
|
this.globCache[patterns.join("\0")] = isMatch;
|
|
52266
53124
|
}
|
|
52267
|
-
this.options.filters.push((path
|
|
53125
|
+
this.options.filters.push((path) => isMatch(path));
|
|
52268
53126
|
return this;
|
|
52269
53127
|
}
|
|
52270
53128
|
};
|
|
52271
53129
|
|
|
52272
53130
|
//#endregion
|
|
52273
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
52274
|
-
var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.
|
|
53131
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
53132
|
+
var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js": ((exports, module) => {
|
|
52275
53133
|
const WIN_SLASH = "\\\\/";
|
|
52276
53134
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
53135
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
52277
53136
|
/**
|
|
52278
53137
|
* Posix glob regex
|
|
52279
53138
|
*/
|
|
@@ -52326,6 +53185,7 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
52326
53185
|
* POSIX Bracket Regex
|
|
52327
53186
|
*/
|
|
52328
53187
|
const POSIX_REGEX_SOURCE$1 = {
|
|
53188
|
+
__proto__: null,
|
|
52329
53189
|
alnum: "a-zA-Z0-9",
|
|
52330
53190
|
alpha: "a-zA-Z",
|
|
52331
53191
|
ascii: "\\x00-\\x7F",
|
|
@@ -52342,6 +53202,7 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
52342
53202
|
xdigit: "A-Fa-f0-9"
|
|
52343
53203
|
};
|
|
52344
53204
|
module.exports = {
|
|
53205
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
52345
53206
|
MAX_LENGTH: 1024 * 64,
|
|
52346
53207
|
POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
|
|
52347
53208
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -52435,8 +53296,8 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
52435
53296
|
}) });
|
|
52436
53297
|
|
|
52437
53298
|
//#endregion
|
|
52438
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
52439
|
-
var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.
|
|
53299
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
|
|
53300
|
+
var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js": ((exports) => {
|
|
52440
53301
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
52441
53302
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
52442
53303
|
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
@@ -52475,8 +53336,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
52475
53336
|
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
52476
53337
|
return output;
|
|
52477
53338
|
};
|
|
52478
|
-
exports.basename = (path
|
|
52479
|
-
const segs = path
|
|
53339
|
+
exports.basename = (path, { windows } = {}) => {
|
|
53340
|
+
const segs = path.split(windows ? /[\\/]/ : "/");
|
|
52480
53341
|
const last = segs[segs.length - 1];
|
|
52481
53342
|
if (last === "") return segs[segs.length - 2];
|
|
52482
53343
|
return last;
|
|
@@ -52484,8 +53345,8 @@ var require_utils = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
52484
53345
|
}) });
|
|
52485
53346
|
|
|
52486
53347
|
//#endregion
|
|
52487
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
52488
|
-
var require_scan = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.
|
|
53348
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
|
|
53349
|
+
var require_scan = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js": ((exports, module) => {
|
|
52489
53350
|
const utils$3 = require_utils();
|
|
52490
53351
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
52491
53352
|
const isPathSeparator = (code) => {
|
|
@@ -52772,8 +53633,8 @@ var require_scan = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pico
|
|
|
52772
53633
|
}) });
|
|
52773
53634
|
|
|
52774
53635
|
//#endregion
|
|
52775
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
52776
|
-
var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.
|
|
53636
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
|
|
53637
|
+
var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js": ((exports, module) => {
|
|
52777
53638
|
const constants$3 = require_constants();
|
|
52778
53639
|
const utils$2 = require_utils();
|
|
52779
53640
|
/**
|
|
@@ -52800,6 +53661,177 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
52800
53661
|
const syntaxError = (type, char) => {
|
|
52801
53662
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
52802
53663
|
};
|
|
53664
|
+
const splitTopLevel = (input) => {
|
|
53665
|
+
const parts = [];
|
|
53666
|
+
let bracket = 0;
|
|
53667
|
+
let paren = 0;
|
|
53668
|
+
let quote = 0;
|
|
53669
|
+
let value = "";
|
|
53670
|
+
let escaped = false;
|
|
53671
|
+
for (const ch of input) {
|
|
53672
|
+
if (escaped === true) {
|
|
53673
|
+
value += ch;
|
|
53674
|
+
escaped = false;
|
|
53675
|
+
continue;
|
|
53676
|
+
}
|
|
53677
|
+
if (ch === "\\") {
|
|
53678
|
+
value += ch;
|
|
53679
|
+
escaped = true;
|
|
53680
|
+
continue;
|
|
53681
|
+
}
|
|
53682
|
+
if (ch === "\"") {
|
|
53683
|
+
quote = quote === 1 ? 0 : 1;
|
|
53684
|
+
value += ch;
|
|
53685
|
+
continue;
|
|
53686
|
+
}
|
|
53687
|
+
if (quote === 0) {
|
|
53688
|
+
if (ch === "[") bracket++;
|
|
53689
|
+
else if (ch === "]" && bracket > 0) bracket--;
|
|
53690
|
+
else if (bracket === 0) {
|
|
53691
|
+
if (ch === "(") paren++;
|
|
53692
|
+
else if (ch === ")" && paren > 0) paren--;
|
|
53693
|
+
else if (ch === "|" && paren === 0) {
|
|
53694
|
+
parts.push(value);
|
|
53695
|
+
value = "";
|
|
53696
|
+
continue;
|
|
53697
|
+
}
|
|
53698
|
+
}
|
|
53699
|
+
}
|
|
53700
|
+
value += ch;
|
|
53701
|
+
}
|
|
53702
|
+
parts.push(value);
|
|
53703
|
+
return parts;
|
|
53704
|
+
};
|
|
53705
|
+
const isPlainBranch = (branch) => {
|
|
53706
|
+
let escaped = false;
|
|
53707
|
+
for (const ch of branch) {
|
|
53708
|
+
if (escaped === true) {
|
|
53709
|
+
escaped = false;
|
|
53710
|
+
continue;
|
|
53711
|
+
}
|
|
53712
|
+
if (ch === "\\") {
|
|
53713
|
+
escaped = true;
|
|
53714
|
+
continue;
|
|
53715
|
+
}
|
|
53716
|
+
if (/[?*+@!()[\]{}]/.test(ch)) return false;
|
|
53717
|
+
}
|
|
53718
|
+
return true;
|
|
53719
|
+
};
|
|
53720
|
+
const normalizeSimpleBranch = (branch) => {
|
|
53721
|
+
let value = branch.trim();
|
|
53722
|
+
let changed = true;
|
|
53723
|
+
while (changed === true) {
|
|
53724
|
+
changed = false;
|
|
53725
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
53726
|
+
value = value.slice(2, -1);
|
|
53727
|
+
changed = true;
|
|
53728
|
+
}
|
|
53729
|
+
}
|
|
53730
|
+
if (!isPlainBranch(value)) return;
|
|
53731
|
+
return value.replace(/\\(.)/g, "$1");
|
|
53732
|
+
};
|
|
53733
|
+
const hasRepeatedCharPrefixOverlap = (branches) => {
|
|
53734
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
53735
|
+
for (let i$1 = 0; i$1 < values.length; i$1++) for (let j = i$1 + 1; j < values.length; j++) {
|
|
53736
|
+
const a = values[i$1];
|
|
53737
|
+
const b = values[j];
|
|
53738
|
+
const char = a[0];
|
|
53739
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
|
|
53740
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
|
|
53741
|
+
}
|
|
53742
|
+
return false;
|
|
53743
|
+
};
|
|
53744
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
53745
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
|
|
53746
|
+
let bracket = 0;
|
|
53747
|
+
let paren = 0;
|
|
53748
|
+
let quote = 0;
|
|
53749
|
+
let escaped = false;
|
|
53750
|
+
for (let i$1 = 1; i$1 < pattern.length; i$1++) {
|
|
53751
|
+
const ch = pattern[i$1];
|
|
53752
|
+
if (escaped === true) {
|
|
53753
|
+
escaped = false;
|
|
53754
|
+
continue;
|
|
53755
|
+
}
|
|
53756
|
+
if (ch === "\\") {
|
|
53757
|
+
escaped = true;
|
|
53758
|
+
continue;
|
|
53759
|
+
}
|
|
53760
|
+
if (ch === "\"") {
|
|
53761
|
+
quote = quote === 1 ? 0 : 1;
|
|
53762
|
+
continue;
|
|
53763
|
+
}
|
|
53764
|
+
if (quote === 1) continue;
|
|
53765
|
+
if (ch === "[") {
|
|
53766
|
+
bracket++;
|
|
53767
|
+
continue;
|
|
53768
|
+
}
|
|
53769
|
+
if (ch === "]" && bracket > 0) {
|
|
53770
|
+
bracket--;
|
|
53771
|
+
continue;
|
|
53772
|
+
}
|
|
53773
|
+
if (bracket > 0) continue;
|
|
53774
|
+
if (ch === "(") {
|
|
53775
|
+
paren++;
|
|
53776
|
+
continue;
|
|
53777
|
+
}
|
|
53778
|
+
if (ch === ")") {
|
|
53779
|
+
paren--;
|
|
53780
|
+
if (paren === 0) {
|
|
53781
|
+
if (requireEnd === true && i$1 !== pattern.length - 1) return;
|
|
53782
|
+
return {
|
|
53783
|
+
type: pattern[0],
|
|
53784
|
+
body: pattern.slice(2, i$1),
|
|
53785
|
+
end: i$1
|
|
53786
|
+
};
|
|
53787
|
+
}
|
|
53788
|
+
}
|
|
53789
|
+
}
|
|
53790
|
+
};
|
|
53791
|
+
const getStarExtglobSequenceOutput = (pattern) => {
|
|
53792
|
+
let index = 0;
|
|
53793
|
+
const chars$1 = [];
|
|
53794
|
+
while (index < pattern.length) {
|
|
53795
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
53796
|
+
if (!match || match.type !== "*") return;
|
|
53797
|
+
const branches = splitTopLevel(match.body).map((branch$1) => branch$1.trim());
|
|
53798
|
+
if (branches.length !== 1) return;
|
|
53799
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
53800
|
+
if (!branch || branch.length !== 1) return;
|
|
53801
|
+
chars$1.push(branch);
|
|
53802
|
+
index += match.end + 1;
|
|
53803
|
+
}
|
|
53804
|
+
if (chars$1.length < 1) return;
|
|
53805
|
+
return `${chars$1.length === 1 ? utils$2.escapeRegex(chars$1[0]) : `[${chars$1.map((ch) => utils$2.escapeRegex(ch)).join("")}]`}*`;
|
|
53806
|
+
};
|
|
53807
|
+
const repeatedExtglobRecursion = (pattern) => {
|
|
53808
|
+
let depth$1 = 0;
|
|
53809
|
+
let value = pattern.trim();
|
|
53810
|
+
let match = parseRepeatedExtglob(value);
|
|
53811
|
+
while (match) {
|
|
53812
|
+
depth$1++;
|
|
53813
|
+
value = match.body.trim();
|
|
53814
|
+
match = parseRepeatedExtglob(value);
|
|
53815
|
+
}
|
|
53816
|
+
return depth$1;
|
|
53817
|
+
};
|
|
53818
|
+
const analyzeRepeatedExtglob = (body, options) => {
|
|
53819
|
+
if (options.maxExtglobRecursion === false) return { risky: false };
|
|
53820
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants$3.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
53821
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
53822
|
+
if (branches.length > 1) {
|
|
53823
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
|
|
53824
|
+
}
|
|
53825
|
+
for (const branch of branches) {
|
|
53826
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
53827
|
+
if (safeOutput) return {
|
|
53828
|
+
risky: true,
|
|
53829
|
+
safeOutput
|
|
53830
|
+
};
|
|
53831
|
+
if (repeatedExtglobRecursion(branch) > max) return { risky: true };
|
|
53832
|
+
}
|
|
53833
|
+
return { risky: false };
|
|
53834
|
+
};
|
|
52803
53835
|
/**
|
|
52804
53836
|
* Parse the given input string.
|
|
52805
53837
|
* @param {String} input
|
|
@@ -52929,6 +53961,8 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
52929
53961
|
token.prev = prev;
|
|
52930
53962
|
token.parens = state.parens;
|
|
52931
53963
|
token.output = state.output;
|
|
53964
|
+
token.startIndex = state.index;
|
|
53965
|
+
token.tokensIndex = tokens.length;
|
|
52932
53966
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
52933
53967
|
increment("parens");
|
|
52934
53968
|
push({
|
|
@@ -52945,6 +53979,30 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
52945
53979
|
extglobs.push(token);
|
|
52946
53980
|
};
|
|
52947
53981
|
const extglobClose = (token) => {
|
|
53982
|
+
const literal$1 = input.slice(token.startIndex, state.index + 1);
|
|
53983
|
+
const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
|
|
53984
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
53985
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR$1) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
53986
|
+
const open$1 = tokens[token.tokensIndex];
|
|
53987
|
+
open$1.type = "text";
|
|
53988
|
+
open$1.value = literal$1;
|
|
53989
|
+
open$1.output = safeOutput || utils$2.escapeRegex(literal$1);
|
|
53990
|
+
for (let i$1 = token.tokensIndex + 1; i$1 < tokens.length; i$1++) {
|
|
53991
|
+
tokens[i$1].value = "";
|
|
53992
|
+
tokens[i$1].output = "";
|
|
53993
|
+
delete tokens[i$1].suffix;
|
|
53994
|
+
}
|
|
53995
|
+
state.output = token.output + open$1.output;
|
|
53996
|
+
state.backtrack = true;
|
|
53997
|
+
push({
|
|
53998
|
+
type: "paren",
|
|
53999
|
+
extglob: true,
|
|
54000
|
+
value,
|
|
54001
|
+
output: ""
|
|
54002
|
+
});
|
|
54003
|
+
decrement("parens");
|
|
54004
|
+
return;
|
|
54005
|
+
}
|
|
52948
54006
|
let output = token.close + (opts.capture ? ")" : "");
|
|
52949
54007
|
let rest;
|
|
52950
54008
|
if (token.type === "negate") {
|
|
@@ -53631,8 +54689,8 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/pic
|
|
|
53631
54689
|
}) });
|
|
53632
54690
|
|
|
53633
54691
|
//#endregion
|
|
53634
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
53635
|
-
var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.
|
|
54692
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
|
|
54693
|
+
var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
|
|
53636
54694
|
const scan = require_scan();
|
|
53637
54695
|
const parse = require_parse();
|
|
53638
54696
|
const utils$1 = require_utils();
|
|
@@ -53841,6 +54899,14 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
53841
54899
|
* Compile a regular expression from the `state` object returned by the
|
|
53842
54900
|
* [parse()](#parse) method.
|
|
53843
54901
|
*
|
|
54902
|
+
* ```js
|
|
54903
|
+
* const picomatch = require('picomatch');
|
|
54904
|
+
* const state = picomatch.parse('*.js');
|
|
54905
|
+
* // picomatch.compileRe(state[, options]);
|
|
54906
|
+
*
|
|
54907
|
+
* console.log(picomatch.compileRe(state));
|
|
54908
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
54909
|
+
* ```
|
|
53844
54910
|
* @param {Object} `state`
|
|
53845
54911
|
* @param {Object} `options`
|
|
53846
54912
|
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
@@ -53864,10 +54930,10 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
53864
54930
|
*
|
|
53865
54931
|
* ```js
|
|
53866
54932
|
* const picomatch = require('picomatch');
|
|
53867
|
-
*
|
|
53868
|
-
* // picomatch.compileRe(state[, options]);
|
|
54933
|
+
* // picomatch.makeRe(state[, options]);
|
|
53869
54934
|
*
|
|
53870
|
-
*
|
|
54935
|
+
* const result = picomatch.makeRe('*.js');
|
|
54936
|
+
* console.log(result);
|
|
53871
54937
|
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
53872
54938
|
* ```
|
|
53873
54939
|
* @param {String} `state` The object returned from the `.parse` method.
|
|
@@ -53924,8 +54990,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
53924
54990
|
}) });
|
|
53925
54991
|
|
|
53926
54992
|
//#endregion
|
|
53927
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
53928
|
-
var require_picomatch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.
|
|
54993
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js
|
|
54994
|
+
var require_picomatch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js": ((exports, module) => {
|
|
53929
54995
|
const pico = require_picomatch$1();
|
|
53930
54996
|
const utils = require_utils();
|
|
53931
54997
|
function picomatch$1(glob, options, returnState = false) {
|
|
@@ -53940,38 +55006,39 @@ var require_picomatch = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
53940
55006
|
}) });
|
|
53941
55007
|
|
|
53942
55008
|
//#endregion
|
|
53943
|
-
//#region ../../node_modules/.pnpm/tinyglobby@0.2.
|
|
55009
|
+
//#region ../../node_modules/.pnpm/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.mjs
|
|
53944
55010
|
var import_picomatch = /* @__PURE__ */ __toESM$1(require_picomatch(), 1);
|
|
53945
55011
|
const isReadonlyArray = Array.isArray;
|
|
55012
|
+
const BACKSLASHES = /\\/g;
|
|
53946
55013
|
const isWin = process.platform === "win32";
|
|
53947
55014
|
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
53948
55015
|
function getPartialMatcher(patterns, options = {}) {
|
|
53949
55016
|
const patternsCount = patterns.length;
|
|
53950
55017
|
const patternsParts = Array(patternsCount);
|
|
53951
55018
|
const matchers = Array(patternsCount);
|
|
53952
|
-
|
|
53953
|
-
for (
|
|
55019
|
+
let i$1, j;
|
|
55020
|
+
for (i$1 = 0; i$1 < patternsCount; i$1++) {
|
|
53954
55021
|
const parts = splitPattern(patterns[i$1]);
|
|
53955
55022
|
patternsParts[i$1] = parts;
|
|
53956
55023
|
const partsCount = parts.length;
|
|
53957
55024
|
const partMatchers = Array(partsCount);
|
|
53958
|
-
for (
|
|
55025
|
+
for (j = 0; j < partsCount; j++) partMatchers[j] = (0, import_picomatch.default)(parts[j], options);
|
|
53959
55026
|
matchers[i$1] = partMatchers;
|
|
53960
55027
|
}
|
|
53961
55028
|
return (input) => {
|
|
53962
55029
|
const inputParts = input.split("/");
|
|
53963
55030
|
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
53964
|
-
for (
|
|
55031
|
+
for (i$1 = 0; i$1 < patternsCount; i$1++) {
|
|
53965
55032
|
const patternParts = patternsParts[i$1];
|
|
53966
55033
|
const matcher = matchers[i$1];
|
|
53967
55034
|
const inputPatternCount = inputParts.length;
|
|
53968
55035
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
53969
|
-
|
|
55036
|
+
j = 0;
|
|
53970
55037
|
while (j < minParts) {
|
|
53971
55038
|
const part = patternParts[j];
|
|
53972
55039
|
if (part.includes("/")) return true;
|
|
53973
55040
|
if (!matcher[j](inputParts[j])) break;
|
|
53974
|
-
if (
|
|
55041
|
+
if (!options.noglobstar && part === "**") return true;
|
|
53975
55042
|
j++;
|
|
53976
55043
|
}
|
|
53977
55044
|
if (j === inputPatternCount) return true;
|
|
@@ -53985,7 +55052,7 @@ const isRoot = isWin ? (p$1) => WIN32_ROOT_DIR.test(p$1) : (p$1) => p$1 === "/";
|
|
|
53985
55052
|
function buildFormat(cwd, root, absolute$1) {
|
|
53986
55053
|
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
53987
55054
|
if (absolute$1) {
|
|
53988
|
-
const start =
|
|
55055
|
+
const start = cwd.length + +!isRoot(cwd);
|
|
53989
55056
|
return (p$1, isDir) => p$1.slice(start, isDir ? -1 : void 0) || ".";
|
|
53990
55057
|
}
|
|
53991
55058
|
const prefix = root.slice(cwd.length + 1);
|
|
@@ -54006,20 +55073,19 @@ function buildRelative(cwd, root) {
|
|
|
54006
55073
|
}
|
|
54007
55074
|
return (p$1) => {
|
|
54008
55075
|
const result = posix.relative(cwd, `${root}/${p$1}`);
|
|
54009
|
-
|
|
54010
|
-
return result || ".";
|
|
55076
|
+
return p$1[p$1.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
|
|
54011
55077
|
};
|
|
54012
55078
|
}
|
|
54013
55079
|
const splitPatternOptions = { parts: true };
|
|
54014
|
-
function splitPattern(path
|
|
55080
|
+
function splitPattern(path) {
|
|
54015
55081
|
var _result$parts;
|
|
54016
|
-
const result = import_picomatch.default.scan(path
|
|
54017
|
-
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path
|
|
55082
|
+
const result = import_picomatch.default.scan(path, splitPatternOptions);
|
|
55083
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path];
|
|
54018
55084
|
}
|
|
54019
55085
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
54020
55086
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
54021
|
-
const escapePosixPath = (path
|
|
54022
|
-
const escapeWin32Path = (path
|
|
55087
|
+
const escapePosixPath = (path) => path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
55088
|
+
const escapeWin32Path = (path) => path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
54023
55089
|
/**
|
|
54024
55090
|
* Escapes a path's special characters depending on the platform.
|
|
54025
55091
|
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
|
|
@@ -54046,28 +55112,31 @@ function isDynamicPattern(pattern, options) {
|
|
|
54046
55112
|
function log(...tasks) {
|
|
54047
55113
|
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
|
|
54048
55114
|
}
|
|
55115
|
+
function ensureStringArray(value) {
|
|
55116
|
+
return typeof value === "string" ? [value] : value !== null && value !== void 0 ? value : [];
|
|
55117
|
+
}
|
|
54049
55118
|
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
54050
55119
|
const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
54051
|
-
|
|
54052
|
-
|
|
55120
|
+
function normalizePattern(pattern, opts, props, isIgnore) {
|
|
55121
|
+
var _PARENT_DIRECTORY$exe;
|
|
55122
|
+
const cwd = opts.cwd;
|
|
54053
55123
|
let result = pattern;
|
|
54054
|
-
if (pattern.
|
|
54055
|
-
if (
|
|
55124
|
+
if (pattern[pattern.length - 1] === "/") result = pattern.slice(0, -1);
|
|
55125
|
+
if (result[result.length - 1] !== "*" && opts.expandDirectories) result += "/**";
|
|
54056
55126
|
const escapedCwd = escapePath(cwd);
|
|
54057
|
-
|
|
54058
|
-
|
|
54059
|
-
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
55127
|
+
result = isAbsolute$1(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
|
|
55128
|
+
const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0];
|
|
54060
55129
|
const parts = splitPattern(result);
|
|
54061
|
-
if (
|
|
54062
|
-
const n$1 = (
|
|
55130
|
+
if (parentDir) {
|
|
55131
|
+
const n$1 = (parentDir.length + 1) / 3;
|
|
54063
55132
|
let i$1 = 0;
|
|
54064
55133
|
const cwdParts = escapedCwd.split("/");
|
|
54065
55134
|
while (i$1 < n$1 && parts[i$1 + n$1] === cwdParts[cwdParts.length + i$1 - n$1]) {
|
|
54066
55135
|
result = result.slice(0, (n$1 - i$1 - 1) * 3) + result.slice((n$1 - i$1) * 3 + parts[i$1 + n$1].length + 1) || ".";
|
|
54067
55136
|
i$1++;
|
|
54068
55137
|
}
|
|
54069
|
-
const potentialRoot = posix.join(cwd,
|
|
54070
|
-
if (
|
|
55138
|
+
const potentialRoot = posix.join(cwd, parentDir.slice(i$1 * 3));
|
|
55139
|
+
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
|
|
54071
55140
|
props.root = potentialRoot;
|
|
54072
55141
|
props.depthOffset = -n$1 + i$1;
|
|
54073
55142
|
}
|
|
@@ -54083,7 +55152,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
54083
55152
|
newCommonPath.pop();
|
|
54084
55153
|
break;
|
|
54085
55154
|
}
|
|
54086
|
-
if (part !== props.commonPath[i$1] || isDynamicPattern(part)
|
|
55155
|
+
if (i$1 === parts.length - 1 || part !== props.commonPath[i$1] || isDynamicPattern(part)) break;
|
|
54087
55156
|
newCommonPath.push(part);
|
|
54088
55157
|
}
|
|
54089
55158
|
props.depthOffset = newCommonPath.length;
|
|
@@ -54092,135 +55161,150 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
54092
55161
|
}
|
|
54093
55162
|
return result;
|
|
54094
55163
|
}
|
|
54095
|
-
function processPatterns(
|
|
54096
|
-
if (typeof patterns === "string") patterns = [patterns];
|
|
54097
|
-
if (typeof ignore$1 === "string") ignore$1 = [ignore$1];
|
|
55164
|
+
function processPatterns(options, patterns, props) {
|
|
54098
55165
|
const matchPatterns = [];
|
|
54099
55166
|
const ignorePatterns = [];
|
|
54100
|
-
for (const pattern of ignore
|
|
55167
|
+
for (const pattern of options.ignore) {
|
|
54101
55168
|
if (!pattern) continue;
|
|
54102
|
-
if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern,
|
|
55169
|
+
if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, options, props, true));
|
|
54103
55170
|
}
|
|
54104
55171
|
for (const pattern of patterns) {
|
|
54105
55172
|
if (!pattern) continue;
|
|
54106
|
-
if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern,
|
|
54107
|
-
else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1),
|
|
55173
|
+
if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, options, props, false));
|
|
55174
|
+
else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
|
|
54108
55175
|
}
|
|
54109
55176
|
return {
|
|
54110
55177
|
match: matchPatterns,
|
|
54111
55178
|
ignore: ignorePatterns
|
|
54112
55179
|
};
|
|
54113
55180
|
}
|
|
54114
|
-
function
|
|
54115
|
-
|
|
54116
|
-
const path$1 = paths[i$1];
|
|
54117
|
-
paths[i$1] = relative$2(path$1);
|
|
54118
|
-
}
|
|
54119
|
-
return paths;
|
|
54120
|
-
}
|
|
54121
|
-
function normalizeCwd(cwd) {
|
|
54122
|
-
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
54123
|
-
if (cwd instanceof URL) return fileURLToPath$1(cwd).replace(BACKSLASHES, "/");
|
|
54124
|
-
return path.resolve(cwd).replace(BACKSLASHES, "/");
|
|
54125
|
-
}
|
|
54126
|
-
function getCrawler(patterns, inputOptions = {}) {
|
|
54127
|
-
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
54128
|
-
...inputOptions,
|
|
54129
|
-
debug: true
|
|
54130
|
-
} : inputOptions;
|
|
54131
|
-
const cwd = normalizeCwd(options.cwd);
|
|
54132
|
-
if (options.debug) log("globbing with:", {
|
|
54133
|
-
patterns,
|
|
54134
|
-
options,
|
|
54135
|
-
cwd
|
|
54136
|
-
});
|
|
54137
|
-
if (Array.isArray(patterns) && patterns.length === 0) return [{
|
|
54138
|
-
sync: () => [],
|
|
54139
|
-
withPromise: async () => []
|
|
54140
|
-
}, false];
|
|
55181
|
+
function buildCrawler(options, patterns) {
|
|
55182
|
+
const cwd = options.cwd;
|
|
54141
55183
|
const props = {
|
|
54142
55184
|
root: cwd,
|
|
54143
|
-
commonPath: null,
|
|
54144
55185
|
depthOffset: 0
|
|
54145
55186
|
};
|
|
54146
|
-
const processed = processPatterns(
|
|
54147
|
-
...options,
|
|
54148
|
-
patterns
|
|
54149
|
-
}, cwd, props);
|
|
55187
|
+
const processed = processPatterns(options, patterns, props);
|
|
54150
55188
|
if (options.debug) log("internal processing patterns:", processed);
|
|
55189
|
+
const { absolute: absolute$1, caseSensitiveMatch: caseSensitiveMatch$1, debug: debug$7, dot, followSymbolicLinks, onlyDirectories } = options;
|
|
55190
|
+
const root = props.root.replace(BACKSLASHES, "");
|
|
54151
55191
|
const matchOptions = {
|
|
54152
|
-
dot
|
|
55192
|
+
dot,
|
|
54153
55193
|
nobrace: options.braceExpansion === false,
|
|
54154
|
-
nocase:
|
|
55194
|
+
nocase: !caseSensitiveMatch$1,
|
|
54155
55195
|
noextglob: options.extglob === false,
|
|
54156
55196
|
noglobstar: options.globstar === false,
|
|
54157
55197
|
posix: true
|
|
54158
55198
|
};
|
|
54159
|
-
const matcher = (0, import_picomatch.default)(processed.match,
|
|
54160
|
-
...matchOptions,
|
|
54161
|
-
ignore: processed.ignore
|
|
54162
|
-
});
|
|
55199
|
+
const matcher = (0, import_picomatch.default)(processed.match, matchOptions);
|
|
54163
55200
|
const ignore$1 = (0, import_picomatch.default)(processed.ignore, matchOptions);
|
|
54164
55201
|
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
54165
|
-
const format$2 = buildFormat(cwd,
|
|
54166
|
-
const
|
|
54167
|
-
const
|
|
54168
|
-
|
|
54169
|
-
|
|
54170
|
-
|
|
54171
|
-
|
|
55202
|
+
const format$2 = buildFormat(cwd, root, absolute$1);
|
|
55203
|
+
const excludeFormatter = absolute$1 ? format$2 : buildFormat(cwd, root, true);
|
|
55204
|
+
const excludePredicate = (_, p$1) => {
|
|
55205
|
+
const relativePath = excludeFormatter(p$1, true);
|
|
55206
|
+
return relativePath !== "." && !partialMatcher(relativePath) || ignore$1(relativePath);
|
|
55207
|
+
};
|
|
55208
|
+
let maxDepth;
|
|
55209
|
+
if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset);
|
|
55210
|
+
const crawler = new Builder({
|
|
55211
|
+
filters: [debug$7 ? (p$1, isDirectory$1) => {
|
|
55212
|
+
const path = format$2(p$1, isDirectory$1);
|
|
55213
|
+
const matches = matcher(path) && !ignore$1(path);
|
|
55214
|
+
if (matches) log(`matched ${path}`);
|
|
54172
55215
|
return matches;
|
|
54173
|
-
} : (p$1, isDirectory$1) =>
|
|
54174
|
-
|
|
54175
|
-
|
|
54176
|
-
|
|
54177
|
-
|
|
54178
|
-
|
|
55216
|
+
} : (p$1, isDirectory$1) => {
|
|
55217
|
+
const path = format$2(p$1, isDirectory$1);
|
|
55218
|
+
return matcher(path) && !ignore$1(path);
|
|
55219
|
+
}],
|
|
55220
|
+
exclude: debug$7 ? (_, p$1) => {
|
|
55221
|
+
const skipped = excludePredicate(_, p$1);
|
|
55222
|
+
log(`${skipped ? "skipped" : "crawling"} ${p$1}`);
|
|
54179
55223
|
return skipped;
|
|
54180
|
-
} :
|
|
54181
|
-
|
|
54182
|
-
return relativePath !== "." && !partialMatcher(relativePath) || ignore$1(relativePath);
|
|
54183
|
-
},
|
|
54184
|
-
fs: options.fs ? {
|
|
54185
|
-
readdir: options.fs.readdir || nativeFs.readdir,
|
|
54186
|
-
readdirSync: options.fs.readdirSync || nativeFs.readdirSync,
|
|
54187
|
-
realpath: options.fs.realpath || nativeFs.realpath,
|
|
54188
|
-
realpathSync: options.fs.realpathSync || nativeFs.realpathSync,
|
|
54189
|
-
stat: options.fs.stat || nativeFs.stat,
|
|
54190
|
-
statSync: options.fs.statSync || nativeFs.statSync
|
|
54191
|
-
} : void 0,
|
|
55224
|
+
} : excludePredicate,
|
|
55225
|
+
fs: options.fs,
|
|
54192
55226
|
pathSeparator: "/",
|
|
54193
|
-
relativePaths:
|
|
54194
|
-
|
|
55227
|
+
relativePaths: !absolute$1,
|
|
55228
|
+
resolvePaths: absolute$1,
|
|
55229
|
+
includeBasePath: absolute$1,
|
|
55230
|
+
resolveSymlinks: followSymbolicLinks,
|
|
55231
|
+
excludeSymlinks: !followSymbolicLinks,
|
|
55232
|
+
excludeFiles: onlyDirectories,
|
|
55233
|
+
includeDirs: onlyDirectories || !options.onlyFiles,
|
|
55234
|
+
maxDepth,
|
|
54195
55235
|
signal: options.signal
|
|
55236
|
+
}).crawl(root);
|
|
55237
|
+
if (options.debug) log("internal properties:", {
|
|
55238
|
+
...props,
|
|
55239
|
+
root
|
|
55240
|
+
});
|
|
55241
|
+
return [crawler, cwd !== root && !absolute$1 && buildRelative(cwd, root)];
|
|
55242
|
+
}
|
|
55243
|
+
function formatPaths(paths, mapper) {
|
|
55244
|
+
if (mapper) for (let i$1 = paths.length - 1; i$1 >= 0; i$1--) paths[i$1] = mapper(paths[i$1]);
|
|
55245
|
+
return paths;
|
|
55246
|
+
}
|
|
55247
|
+
const defaultOptions = {
|
|
55248
|
+
caseSensitiveMatch: true,
|
|
55249
|
+
cwd: process.cwd(),
|
|
55250
|
+
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
55251
|
+
expandDirectories: true,
|
|
55252
|
+
followSymbolicLinks: true,
|
|
55253
|
+
onlyFiles: true
|
|
55254
|
+
};
|
|
55255
|
+
function getOptions(options) {
|
|
55256
|
+
const opts = {
|
|
55257
|
+
...defaultOptions,
|
|
55258
|
+
...options
|
|
54196
55259
|
};
|
|
54197
|
-
|
|
54198
|
-
|
|
54199
|
-
|
|
54200
|
-
|
|
54201
|
-
|
|
54202
|
-
|
|
54203
|
-
|
|
54204
|
-
|
|
54205
|
-
|
|
54206
|
-
}
|
|
54207
|
-
if (
|
|
54208
|
-
|
|
54209
|
-
|
|
54210
|
-
|
|
54211
|
-
|
|
54212
|
-
|
|
54213
|
-
|
|
54214
|
-
const
|
|
54215
|
-
|
|
55260
|
+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd)).replace(BACKSLASHES, "/");
|
|
55261
|
+
opts.ignore = ensureStringArray(opts.ignore);
|
|
55262
|
+
opts.fs && (opts.fs = {
|
|
55263
|
+
readdir: opts.fs.readdir || readdir,
|
|
55264
|
+
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
55265
|
+
realpath: opts.fs.realpath || realpath,
|
|
55266
|
+
realpathSync: opts.fs.realpathSync || realpathSync$1,
|
|
55267
|
+
stat: opts.fs.stat || stat,
|
|
55268
|
+
statSync: opts.fs.statSync || statSync$1
|
|
55269
|
+
});
|
|
55270
|
+
if (opts.debug) log("globbing with options:", opts);
|
|
55271
|
+
return opts;
|
|
55272
|
+
}
|
|
55273
|
+
function getCrawler(globInput, inputOptions = {}) {
|
|
55274
|
+
var _ref;
|
|
55275
|
+
if (globInput && (inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
55276
|
+
const isModern = isReadonlyArray(globInput) || typeof globInput === "string";
|
|
55277
|
+
const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*");
|
|
55278
|
+
const options = getOptions(isModern ? inputOptions : globInput);
|
|
55279
|
+
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
|
|
54216
55280
|
}
|
|
54217
|
-
function globSync(
|
|
54218
|
-
|
|
54219
|
-
|
|
54220
|
-
|
|
54221
|
-
|
|
54222
|
-
|
|
54223
|
-
|
|
55281
|
+
function globSync(globInput, options) {
|
|
55282
|
+
const [crawler, relative$2] = getCrawler(globInput, options);
|
|
55283
|
+
return crawler ? formatPaths(crawler.sync(), relative$2) : [];
|
|
55284
|
+
}
|
|
55285
|
+
|
|
55286
|
+
//#endregion
|
|
55287
|
+
//#region src/update-check.ts
|
|
55288
|
+
let updateCheckPromise;
|
|
55289
|
+
/**
|
|
55290
|
+
* Checks if a newer version of `@cloudflare/vite-plugin` is available on npm.
|
|
55291
|
+
*
|
|
55292
|
+
* The result is memoised so the check is only performed once per process
|
|
55293
|
+
* lifetime — callers can invoke this freely without worrying about redundant
|
|
55294
|
+
* network requests.
|
|
55295
|
+
*
|
|
55296
|
+
* @returns A discriminated result indicating whether an update is available,
|
|
55297
|
+
* the package is already up-to-date, or the check failed
|
|
55298
|
+
*/
|
|
55299
|
+
function checkForNpmUpdate() {
|
|
55300
|
+
return updateCheckPromise ??= (async () => {
|
|
55301
|
+
try {
|
|
55302
|
+
const pkg = (await import("../package.json", { with: { type: "json" } })).default;
|
|
55303
|
+
return fetchLatestNpmVersion(pkg.name, pkg.version);
|
|
55304
|
+
} catch {
|
|
55305
|
+
return { status: "failed" };
|
|
55306
|
+
}
|
|
55307
|
+
})();
|
|
54224
55308
|
}
|
|
54225
55309
|
|
|
54226
55310
|
//#endregion
|
|
@@ -54550,6 +55634,7 @@ async function getPreviewMiniflareOptions(ctx, vitePreviewServer) {
|
|
|
54550
55634
|
* A Miniflare logger that forwards messages onto a Vite logger.
|
|
54551
55635
|
*/
|
|
54552
55636
|
var ViteMiniflareLogger = class extends Log {
|
|
55637
|
+
#warnedCompatibilityDateFallback = false;
|
|
54553
55638
|
logger;
|
|
54554
55639
|
constructor(config) {
|
|
54555
55640
|
super(miniflareLogLevelFromViteLogLevel(config.logLevel));
|
|
@@ -54562,6 +55647,18 @@ var ViteMiniflareLogger = class extends Log {
|
|
|
54562
55647
|
case LogLevel.INFO: return this.logger.info(message);
|
|
54563
55648
|
}
|
|
54564
55649
|
}
|
|
55650
|
+
warn(message) {
|
|
55651
|
+
if (!message.startsWith("The latest compatibility date supported by")) {
|
|
55652
|
+
this.logger.warn(message);
|
|
55653
|
+
return;
|
|
55654
|
+
}
|
|
55655
|
+
if (this.#warnedCompatibilityDateFallback) return;
|
|
55656
|
+
this.#warnedCompatibilityDateFallback = true;
|
|
55657
|
+
checkForNpmUpdate().then((result) => {
|
|
55658
|
+
if (result.status !== "update-available") return;
|
|
55659
|
+
this.logger.warn(`${message}\nFeatures enabled by your requested compatibility date may not be available.\nUpgrade to \`@cloudflare/vite-plugin@${result.latest}\` to remove this warning.`);
|
|
55660
|
+
});
|
|
55661
|
+
}
|
|
54565
55662
|
logReady() {}
|
|
54566
55663
|
};
|
|
54567
55664
|
function miniflareLogLevelFromViteLogLevel(level = "info") {
|
|
@@ -55161,13 +56258,13 @@ const wslDefaultBrowser = async () => {
|
|
|
55161
56258
|
const { stdout } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
|
|
55162
56259
|
return stdout.trim();
|
|
55163
56260
|
};
|
|
55164
|
-
const convertWslPathToWindows = async (path
|
|
55165
|
-
if (/^[a-z]+:\/\//i.test(path
|
|
56261
|
+
const convertWslPathToWindows = async (path) => {
|
|
56262
|
+
if (/^[a-z]+:\/\//i.test(path)) return path;
|
|
55166
56263
|
try {
|
|
55167
|
-
const { stdout } = await execFile$1("wslpath", ["-aw", path
|
|
56264
|
+
const { stdout } = await execFile$1("wslpath", ["-aw", path], { encoding: "utf8" });
|
|
55168
56265
|
return stdout.trim();
|
|
55169
56266
|
} catch {
|
|
55170
|
-
return path
|
|
56267
|
+
return path;
|
|
55171
56268
|
}
|
|
55172
56269
|
};
|
|
55173
56270
|
|