@sledorze/cairn 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/dist/cli.js +1011 -526
- package/dist/cli.js.map +1 -1
- package/dist/core/Config.d.ts +1 -1
- package/dist/core/Config.d.ts.map +1 -1
- package/dist/core/Config.js +1 -1
- package/dist/core/Config.js.map +1 -1
- package/dist/core/hashing.d.ts +3 -0
- package/dist/core/hashing.d.ts.map +1 -0
- package/dist/core/hashing.js +16 -0
- package/dist/core/hashing.js.map +1 -0
- package/dist/core/links/Anchors.d.ts +30 -0
- package/dist/core/links/Anchors.d.ts.map +1 -0
- package/dist/core/links/Anchors.js +119 -0
- package/dist/core/links/Anchors.js.map +1 -0
- package/dist/core/links/MarkdownLinks.bench.d.ts.map +1 -0
- package/dist/core/links/MarkdownLinks.bench.js.map +1 -0
- package/dist/core/links/MarkdownLinks.d.ts +121 -0
- package/dist/core/links/MarkdownLinks.d.ts.map +1 -0
- package/dist/core/links/MarkdownLinks.js +228 -0
- package/dist/core/links/MarkdownLinks.js.map +1 -0
- package/dist/core/links/RefStore.d.ts +32 -0
- package/dist/core/links/RefStore.d.ts.map +1 -0
- package/dist/core/links/RefStore.js +60 -0
- package/dist/core/links/RefStore.js.map +1 -0
- package/dist/core/links/markdownFences.d.ts +10 -0
- package/dist/core/links/markdownFences.d.ts.map +1 -0
- package/dist/core/links/markdownFences.js +51 -0
- package/dist/core/links/markdownFences.js.map +1 -0
- package/dist/core/paths.d.ts +8 -0
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +13 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/sidecar.d.ts +45 -0
- package/dist/core/sidecar.d.ts.map +1 -0
- package/dist/core/sidecar.js +83 -0
- package/dist/core/sidecar.js.map +1 -0
- package/dist/core/{DocSummaries.d.ts → summaries/DocSummaries.d.ts} +0 -2
- package/dist/core/summaries/DocSummaries.d.ts.map +1 -0
- package/dist/core/{DocSummaries.js → summaries/DocSummaries.js} +6 -8
- package/dist/core/summaries/DocSummaries.js.map +1 -0
- package/dist/core/summaries/StampStore.d.ts +19 -0
- package/dist/core/summaries/StampStore.d.ts.map +1 -0
- package/dist/core/summaries/StampStore.js +34 -0
- package/dist/core/summaries/StampStore.js.map +1 -0
- package/dist/core/summaries/SummaryTree.bench.d.ts.map +1 -0
- package/dist/core/{SummaryTree.bench.js → summaries/SummaryTree.bench.js} +2 -1
- package/dist/core/summaries/SummaryTree.bench.js.map +1 -0
- package/dist/core/summaries/SummaryTree.d.ts.map +1 -0
- package/dist/core/{SummaryTree.js → summaries/SummaryTree.js} +4 -3
- package/dist/core/summaries/SummaryTree.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/program/JsonReport.d.ts +2 -2
- package/dist/program/JsonReport.d.ts.map +1 -1
- package/dist/program/JsonReport.js +2 -2
- package/dist/program/JsonReport.js.map +1 -1
- package/dist/program/{CheckLinks.d.ts → links/CheckLinks.d.ts} +9 -4
- package/dist/program/links/CheckLinks.d.ts.map +1 -0
- package/dist/program/links/CheckLinks.js +243 -0
- package/dist/program/links/CheckLinks.js.map +1 -0
- package/dist/program/links/CheckRefs.d.ts +47 -0
- package/dist/program/links/CheckRefs.d.ts.map +1 -0
- package/dist/program/links/CheckRefs.js +151 -0
- package/dist/program/links/CheckRefs.js.map +1 -0
- package/dist/program/summaries/CheckSummaries.bench.d.ts.map +1 -0
- package/dist/program/{CheckSummaries.bench.js → summaries/CheckSummaries.bench.js} +6 -4
- package/dist/program/summaries/CheckSummaries.bench.js.map +1 -0
- package/dist/program/{CheckSummaries.d.ts → summaries/CheckSummaries.d.ts} +7 -7
- package/dist/program/summaries/CheckSummaries.d.ts.map +1 -0
- package/dist/program/{CheckSummaries.js → summaries/CheckSummaries.js} +13 -12
- package/dist/program/summaries/CheckSummaries.js.map +1 -0
- package/package.json +3 -2
- package/dist/core/DocSummaries.d.ts.map +0 -1
- package/dist/core/DocSummaries.js.map +0 -1
- package/dist/core/MarkdownLinks.bench.d.ts.map +0 -1
- package/dist/core/MarkdownLinks.bench.js.map +0 -1
- package/dist/core/MarkdownLinks.d.ts +0 -51
- package/dist/core/MarkdownLinks.d.ts.map +0 -1
- package/dist/core/MarkdownLinks.js +0 -115
- package/dist/core/MarkdownLinks.js.map +0 -1
- package/dist/core/StampStore.d.ts +0 -47
- package/dist/core/StampStore.d.ts.map +0 -1
- package/dist/core/StampStore.js +0 -90
- package/dist/core/StampStore.js.map +0 -1
- package/dist/core/SummaryTree.bench.d.ts.map +0 -1
- package/dist/core/SummaryTree.bench.js.map +0 -1
- package/dist/core/SummaryTree.d.ts.map +0 -1
- package/dist/core/SummaryTree.js.map +0 -1
- package/dist/program/CheckLinks.d.ts.map +0 -1
- package/dist/program/CheckLinks.js +0 -122
- package/dist/program/CheckLinks.js.map +0 -1
- package/dist/program/CheckSummaries.bench.d.ts.map +0 -1
- package/dist/program/CheckSummaries.bench.js.map +0 -1
- package/dist/program/CheckSummaries.d.ts.map +0 -1
- package/dist/program/CheckSummaries.js.map +0 -1
- /package/dist/core/{MarkdownLinks.bench.d.ts → links/MarkdownLinks.bench.d.ts} +0 -0
- /package/dist/core/{MarkdownLinks.bench.js → links/MarkdownLinks.bench.js} +0 -0
- /package/dist/core/{SummaryTree.bench.d.ts → summaries/SummaryTree.bench.d.ts} +0 -0
- /package/dist/core/{SummaryTree.d.ts → summaries/SummaryTree.d.ts} +0 -0
- /package/dist/program/{CheckSummaries.bench.d.ts → summaries/CheckSummaries.bench.d.ts} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1147,14 +1147,14 @@ var require_util = __commonJS({
|
|
|
1147
1147
|
}
|
|
1148
1148
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
1149
1149
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
1150
|
-
let
|
|
1150
|
+
let path14 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
1151
1151
|
if (origin[origin.length - 1] === "/") {
|
|
1152
1152
|
origin = origin.slice(0, origin.length - 1);
|
|
1153
1153
|
}
|
|
1154
|
-
if (
|
|
1155
|
-
|
|
1154
|
+
if (path14 && path14[0] !== "/") {
|
|
1155
|
+
path14 = `/${path14}`;
|
|
1156
1156
|
}
|
|
1157
|
-
return new URL(`${origin}${
|
|
1157
|
+
return new URL(`${origin}${path14}`);
|
|
1158
1158
|
}
|
|
1159
1159
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
1160
1160
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -2025,9 +2025,9 @@ var require_diagnostics = __commonJS({
|
|
|
2025
2025
|
"undici:client:sendHeaders",
|
|
2026
2026
|
(evt) => {
|
|
2027
2027
|
const {
|
|
2028
|
-
request: { method, path:
|
|
2028
|
+
request: { method, path: path14, origin }
|
|
2029
2029
|
} = evt;
|
|
2030
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
2030
|
+
debugLog("sending request to %s %s%s", method, origin, path14);
|
|
2031
2031
|
}
|
|
2032
2032
|
);
|
|
2033
2033
|
}
|
|
@@ -2045,14 +2045,14 @@ var require_diagnostics = __commonJS({
|
|
|
2045
2045
|
"undici:request:headers",
|
|
2046
2046
|
(evt) => {
|
|
2047
2047
|
const {
|
|
2048
|
-
request: { method, path:
|
|
2048
|
+
request: { method, path: path14, origin },
|
|
2049
2049
|
response: { statusCode }
|
|
2050
2050
|
} = evt;
|
|
2051
2051
|
debugLog(
|
|
2052
2052
|
"received response to %s %s%s - HTTP %d",
|
|
2053
2053
|
method,
|
|
2054
2054
|
origin,
|
|
2055
|
-
|
|
2055
|
+
path14,
|
|
2056
2056
|
statusCode
|
|
2057
2057
|
);
|
|
2058
2058
|
}
|
|
@@ -2061,23 +2061,23 @@ var require_diagnostics = __commonJS({
|
|
|
2061
2061
|
"undici:request:trailers",
|
|
2062
2062
|
(evt) => {
|
|
2063
2063
|
const {
|
|
2064
|
-
request: { method, path:
|
|
2064
|
+
request: { method, path: path14, origin }
|
|
2065
2065
|
} = evt;
|
|
2066
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
2066
|
+
debugLog("trailers received from %s %s%s", method, origin, path14);
|
|
2067
2067
|
}
|
|
2068
2068
|
);
|
|
2069
2069
|
diagnosticsChannel.subscribe(
|
|
2070
2070
|
"undici:request:error",
|
|
2071
2071
|
(evt) => {
|
|
2072
2072
|
const {
|
|
2073
|
-
request: { method, path:
|
|
2073
|
+
request: { method, path: path14, origin },
|
|
2074
2074
|
error: error2
|
|
2075
2075
|
} = evt;
|
|
2076
2076
|
debugLog(
|
|
2077
2077
|
"request to %s %s%s errored - %s",
|
|
2078
2078
|
method,
|
|
2079
2079
|
origin,
|
|
2080
|
-
|
|
2080
|
+
path14,
|
|
2081
2081
|
error2.message
|
|
2082
2082
|
);
|
|
2083
2083
|
}
|
|
@@ -2232,7 +2232,7 @@ var require_request = __commonJS({
|
|
|
2232
2232
|
};
|
|
2233
2233
|
var Request = class {
|
|
2234
2234
|
constructor(origin, {
|
|
2235
|
-
path:
|
|
2235
|
+
path: path14,
|
|
2236
2236
|
method,
|
|
2237
2237
|
body,
|
|
2238
2238
|
headers,
|
|
@@ -2249,11 +2249,11 @@ var require_request = __commonJS({
|
|
|
2249
2249
|
maxRedirections,
|
|
2250
2250
|
typeOfService
|
|
2251
2251
|
}, handler) {
|
|
2252
|
-
if (typeof
|
|
2252
|
+
if (typeof path14 !== "string") {
|
|
2253
2253
|
throw new InvalidArgumentError("path must be a string");
|
|
2254
|
-
} else if (
|
|
2254
|
+
} else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.startsWith("https://")) && method !== "CONNECT") {
|
|
2255
2255
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
2256
|
-
} else if (invalidPathRegex.test(
|
|
2256
|
+
} else if (invalidPathRegex.test(path14)) {
|
|
2257
2257
|
throw new InvalidArgumentError("invalid request path");
|
|
2258
2258
|
}
|
|
2259
2259
|
if (typeof method !== "string") {
|
|
@@ -2328,7 +2328,7 @@ var require_request = __commonJS({
|
|
|
2328
2328
|
this.completed = false;
|
|
2329
2329
|
this.aborted = false;
|
|
2330
2330
|
this.upgrade = upgrade || null;
|
|
2331
|
-
this.path = query ? serializePathWithQuery(
|
|
2331
|
+
this.path = query ? serializePathWithQuery(path14, query) : path14;
|
|
2332
2332
|
this.origin = origin;
|
|
2333
2333
|
this.protocol = getProtocolFromUrlString(origin);
|
|
2334
2334
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" || method === "QUERY" : idempotent;
|
|
@@ -7394,7 +7394,7 @@ var require_client_h1 = __commonJS({
|
|
|
7394
7394
|
}
|
|
7395
7395
|
}
|
|
7396
7396
|
function writeH1(client, request3) {
|
|
7397
|
-
const { method, path:
|
|
7397
|
+
const { method, path: path14, host, upgrade, blocking, reset: reset2 } = request3;
|
|
7398
7398
|
let { body, headers, contentLength } = request3;
|
|
7399
7399
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
7400
7400
|
if (util.isFormDataLike(body)) {
|
|
@@ -7462,7 +7462,7 @@ var require_client_h1 = __commonJS({
|
|
|
7462
7462
|
socket[kBlocking] = true;
|
|
7463
7463
|
}
|
|
7464
7464
|
setTypeOfService(socket, request3);
|
|
7465
|
-
let header = `${method} ${
|
|
7465
|
+
let header = `${method} ${path14} HTTP/1.1\r
|
|
7466
7466
|
`;
|
|
7467
7467
|
if (typeof host === "string") {
|
|
7468
7468
|
header += `host: ${host}\r
|
|
@@ -8471,7 +8471,7 @@ var require_client_h2 = __commonJS({
|
|
|
8471
8471
|
const headersTimeout = request3.headersTimeout ?? client[kHeadersTimeout];
|
|
8472
8472
|
const bodyTimeout = request3.bodyTimeout ?? client[kBodyTimeout];
|
|
8473
8473
|
const session = client[kHTTP2Session];
|
|
8474
|
-
const { method, path:
|
|
8474
|
+
const { method, path: path14, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request3;
|
|
8475
8475
|
if (upgrade != null && upgrade !== "websocket") {
|
|
8476
8476
|
util.errorRequest(client, request3, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
8477
8477
|
return false;
|
|
@@ -8534,7 +8534,7 @@ var require_client_h2 = __commonJS({
|
|
|
8534
8534
|
}
|
|
8535
8535
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
8536
8536
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
8537
|
-
headers[HTTP2_HEADER_PATH] =
|
|
8537
|
+
headers[HTTP2_HEADER_PATH] = path14;
|
|
8538
8538
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
8539
8539
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
8540
8540
|
} else {
|
|
@@ -8556,7 +8556,7 @@ var require_client_h2 = __commonJS({
|
|
|
8556
8556
|
setupUpgradeStream(stream2, state);
|
|
8557
8557
|
return true;
|
|
8558
8558
|
}
|
|
8559
|
-
headers[HTTP2_HEADER_PATH] =
|
|
8559
|
+
headers[HTTP2_HEADER_PATH] = path14;
|
|
8560
8560
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
8561
8561
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
8562
8562
|
let body = state.body;
|
|
@@ -11151,10 +11151,10 @@ var require_proxy_agent = __commonJS({
|
|
|
11151
11151
|
};
|
|
11152
11152
|
const {
|
|
11153
11153
|
origin,
|
|
11154
|
-
path:
|
|
11154
|
+
path: path14 = "/",
|
|
11155
11155
|
headers = {}
|
|
11156
11156
|
} = opts;
|
|
11157
|
-
opts.path = origin +
|
|
11157
|
+
opts.path = origin + path14;
|
|
11158
11158
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
11159
11159
|
const { host } = new URL(origin);
|
|
11160
11160
|
headers.host = host;
|
|
@@ -13399,20 +13399,20 @@ var require_mock_utils = __commonJS({
|
|
|
13399
13399
|
}
|
|
13400
13400
|
return normalizedQp;
|
|
13401
13401
|
}
|
|
13402
|
-
function safeUrl(
|
|
13403
|
-
if (typeof
|
|
13404
|
-
return
|
|
13402
|
+
function safeUrl(path14) {
|
|
13403
|
+
if (typeof path14 !== "string") {
|
|
13404
|
+
return path14;
|
|
13405
13405
|
}
|
|
13406
|
-
const pathSegments =
|
|
13406
|
+
const pathSegments = path14.split("?", 3);
|
|
13407
13407
|
if (pathSegments.length !== 2) {
|
|
13408
|
-
return
|
|
13408
|
+
return path14;
|
|
13409
13409
|
}
|
|
13410
13410
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
13411
13411
|
qp.sort();
|
|
13412
13412
|
return [...pathSegments, qp.toString()].join("?");
|
|
13413
13413
|
}
|
|
13414
|
-
function matchKey(mockDispatch2, { path:
|
|
13415
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
13414
|
+
function matchKey(mockDispatch2, { path: path14, method, body, headers }) {
|
|
13415
|
+
const pathMatch = matchValue(mockDispatch2.path, path14);
|
|
13416
13416
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
13417
13417
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
13418
13418
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -13437,8 +13437,8 @@ var require_mock_utils = __commonJS({
|
|
|
13437
13437
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
13438
13438
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
13439
13439
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
13440
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
13441
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
13440
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path14, ignoreTrailingSlash }) => {
|
|
13441
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path14)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path14), resolvedPath);
|
|
13442
13442
|
});
|
|
13443
13443
|
if (matchedMockDispatches.length === 0) {
|
|
13444
13444
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -13477,19 +13477,19 @@ var require_mock_utils = __commonJS({
|
|
|
13477
13477
|
mockDispatches.splice(index2, 1);
|
|
13478
13478
|
}
|
|
13479
13479
|
}
|
|
13480
|
-
function removeTrailingSlash(
|
|
13481
|
-
while (
|
|
13482
|
-
|
|
13480
|
+
function removeTrailingSlash(path14) {
|
|
13481
|
+
while (path14.endsWith("/")) {
|
|
13482
|
+
path14 = path14.slice(0, -1);
|
|
13483
13483
|
}
|
|
13484
|
-
if (
|
|
13485
|
-
|
|
13484
|
+
if (path14.length === 0) {
|
|
13485
|
+
path14 = "/";
|
|
13486
13486
|
}
|
|
13487
|
-
return
|
|
13487
|
+
return path14;
|
|
13488
13488
|
}
|
|
13489
13489
|
function buildKey(opts) {
|
|
13490
|
-
const { path:
|
|
13490
|
+
const { path: path14, method, body, headers, query } = opts;
|
|
13491
13491
|
return {
|
|
13492
|
-
path:
|
|
13492
|
+
path: path14,
|
|
13493
13493
|
method,
|
|
13494
13494
|
body,
|
|
13495
13495
|
headers,
|
|
@@ -14219,10 +14219,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
14219
14219
|
}
|
|
14220
14220
|
format(pendingInterceptors) {
|
|
14221
14221
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
14222
|
-
({ method, path:
|
|
14222
|
+
({ method, path: path14, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
14223
14223
|
Method: method,
|
|
14224
14224
|
Origin: origin,
|
|
14225
|
-
Path:
|
|
14225
|
+
Path: path14,
|
|
14226
14226
|
"Status code": statusCode,
|
|
14227
14227
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
14228
14228
|
Invocations: timesInvoked,
|
|
@@ -14304,9 +14304,9 @@ var require_mock_agent = __commonJS({
|
|
|
14304
14304
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
14305
14305
|
const dispatchOpts = { ...opts };
|
|
14306
14306
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
14307
|
-
const [
|
|
14307
|
+
const [path14, searchParams] = dispatchOpts.path.split("?");
|
|
14308
14308
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
14309
|
-
dispatchOpts.path = `${
|
|
14309
|
+
dispatchOpts.path = `${path14}?${normalizedSearchParams}`;
|
|
14310
14310
|
}
|
|
14311
14311
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
14312
14312
|
}
|
|
@@ -14722,12 +14722,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14722
14722
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
14723
14723
|
*/
|
|
14724
14724
|
async loadSnapshots(filePath) {
|
|
14725
|
-
const
|
|
14726
|
-
if (!
|
|
14725
|
+
const path14 = filePath || this.#snapshotPath;
|
|
14726
|
+
if (!path14) {
|
|
14727
14727
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
14728
14728
|
}
|
|
14729
14729
|
try {
|
|
14730
|
-
const data = await readFile3(resolve5(
|
|
14730
|
+
const data = await readFile3(resolve5(path14), "utf8");
|
|
14731
14731
|
const parsed = JSON.parse(data);
|
|
14732
14732
|
if (Array.isArray(parsed)) {
|
|
14733
14733
|
this.#snapshots.clear();
|
|
@@ -14741,7 +14741,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14741
14741
|
if (error2.code === "ENOENT") {
|
|
14742
14742
|
this.#snapshots.clear();
|
|
14743
14743
|
} else {
|
|
14744
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
14744
|
+
throw new UndiciError(`Failed to load snapshots from ${path14}`, { cause: error2 });
|
|
14745
14745
|
}
|
|
14746
14746
|
}
|
|
14747
14747
|
}
|
|
@@ -14752,11 +14752,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14752
14752
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
14753
14753
|
*/
|
|
14754
14754
|
async saveSnapshots(filePath) {
|
|
14755
|
-
const
|
|
14756
|
-
if (!
|
|
14755
|
+
const path14 = filePath || this.#snapshotPath;
|
|
14756
|
+
if (!path14) {
|
|
14757
14757
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
14758
14758
|
}
|
|
14759
|
-
const resolvedPath = resolve5(
|
|
14759
|
+
const resolvedPath = resolve5(path14);
|
|
14760
14760
|
await mkdir2(dirname4(resolvedPath), { recursive: true });
|
|
14761
14761
|
const data = Array.from(this.#snapshots.entries()).map(([hash3, snapshot]) => ({
|
|
14762
14762
|
hash: hash3,
|
|
@@ -15378,15 +15378,15 @@ var require_redirect_handler = __commonJS({
|
|
|
15378
15378
|
return;
|
|
15379
15379
|
}
|
|
15380
15380
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
15381
|
-
const
|
|
15382
|
-
const redirectUrlString = `${origin}${
|
|
15381
|
+
const path14 = search ? `${pathname}${search}` : pathname;
|
|
15382
|
+
const redirectUrlString = `${origin}${path14}`;
|
|
15383
15383
|
for (const historyUrl of this.history) {
|
|
15384
15384
|
if (historyUrl.toString() === redirectUrlString) {
|
|
15385
15385
|
throw new InvalidArgumentError(`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.`);
|
|
15386
15386
|
}
|
|
15387
15387
|
}
|
|
15388
15388
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, removeContentHeaders, this.opts.origin !== origin, this.stripHeadersOnRedirect, this.stripHeadersOnCrossOriginRedirect);
|
|
15389
|
-
this.opts.path =
|
|
15389
|
+
this.opts.path = path14;
|
|
15390
15390
|
this.opts.origin = origin;
|
|
15391
15391
|
this.opts.query = null;
|
|
15392
15392
|
}
|
|
@@ -17183,13 +17183,13 @@ var require_cache_handler = __commonJS({
|
|
|
17183
17183
|
if (url.origin !== requestUrl.origin) {
|
|
17184
17184
|
continue;
|
|
17185
17185
|
}
|
|
17186
|
-
const
|
|
17187
|
-
if (invalidatedPaths.has(
|
|
17186
|
+
const path14 = `${url.pathname}${url.search}`;
|
|
17187
|
+
if (invalidatedPaths.has(path14)) {
|
|
17188
17188
|
continue;
|
|
17189
17189
|
}
|
|
17190
|
-
invalidatedPaths.add(
|
|
17190
|
+
invalidatedPaths.add(path14);
|
|
17191
17191
|
try {
|
|
17192
|
-
this.#store.delete({ ...this.#cacheKey, path:
|
|
17192
|
+
this.#store.delete({ ...this.#cacheKey, path: path14 })?.catch?.(noop);
|
|
17193
17193
|
} catch {
|
|
17194
17194
|
}
|
|
17195
17195
|
}
|
|
@@ -21819,13 +21819,13 @@ var require_fetch = __commonJS({
|
|
|
21819
21819
|
function dispatch({ body }) {
|
|
21820
21820
|
const url = requestCurrentURL(request3);
|
|
21821
21821
|
const agent = fetchParams.controller.dispatcher;
|
|
21822
|
-
const
|
|
21822
|
+
const path14 = url.pathname + url.search;
|
|
21823
21823
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
21824
21824
|
return dispatchWithProtocolPreference(body);
|
|
21825
21825
|
function dispatchWithProtocolPreference(body2, allowH2) {
|
|
21826
21826
|
return new Promise((resolve5, reject) => agent.dispatch(
|
|
21827
21827
|
{
|
|
21828
|
-
path: hasTrailingQuestionMark ? `${
|
|
21828
|
+
path: hasTrailingQuestionMark ? `${path14}?` : path14,
|
|
21829
21829
|
origin: url.origin,
|
|
21830
21830
|
method: request3.method,
|
|
21831
21831
|
body: agent.isMockActive ? request3.body && (request3.body.source || request3.body.stream) : body2,
|
|
@@ -22737,9 +22737,9 @@ var require_util4 = __commonJS({
|
|
|
22737
22737
|
}
|
|
22738
22738
|
}
|
|
22739
22739
|
}
|
|
22740
|
-
function validateCookiePath(
|
|
22741
|
-
for (let i = 0; i <
|
|
22742
|
-
const code =
|
|
22740
|
+
function validateCookiePath(path14) {
|
|
22741
|
+
for (let i = 0; i < path14.length; ++i) {
|
|
22742
|
+
const code = path14.charCodeAt(i);
|
|
22743
22743
|
if (code < 32 || // exclude CTLs (0-31)
|
|
22744
22744
|
code > 126 || // exclude non-ascii and DEL
|
|
22745
22745
|
code === 59) {
|
|
@@ -26057,11 +26057,11 @@ var require_undici = __commonJS({
|
|
|
26057
26057
|
if (typeof opts.path !== "string") {
|
|
26058
26058
|
throw new InvalidArgumentError("invalid opts.path");
|
|
26059
26059
|
}
|
|
26060
|
-
let
|
|
26060
|
+
let path14 = opts.path;
|
|
26061
26061
|
if (!opts.path.startsWith("/")) {
|
|
26062
|
-
|
|
26062
|
+
path14 = `/${path14}`;
|
|
26063
26063
|
}
|
|
26064
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
26064
|
+
url = new URL(util.parseOrigin(url).origin + path14);
|
|
26065
26065
|
} else {
|
|
26066
26066
|
if (!opts) {
|
|
26067
26067
|
opts = typeof url === "object" ? url : {};
|
|
@@ -31131,20 +31131,20 @@ var require_compiler = __commonJS({
|
|
|
31131
31131
|
obj[lastKey] = value3;
|
|
31132
31132
|
}
|
|
31133
31133
|
function setPath(node) {
|
|
31134
|
-
var
|
|
31135
|
-
var quotedPath =
|
|
31134
|
+
var path14 = node.value;
|
|
31135
|
+
var quotedPath = path14.map(quoteDottedString).join(".");
|
|
31136
31136
|
var off = node.offset;
|
|
31137
31137
|
if (assignedPaths.has(quotedPath)) {
|
|
31138
|
-
genError("Cannot redefine existing key '" +
|
|
31138
|
+
genError("Cannot redefine existing key '" + path14 + "'.", off);
|
|
31139
31139
|
}
|
|
31140
31140
|
assignedPaths.add(quotedPath);
|
|
31141
31141
|
explicitTablePaths.add(quotedPath);
|
|
31142
|
-
context4 = deepRef(data,
|
|
31143
|
-
currentPath =
|
|
31142
|
+
context4 = deepRef(data, path14, createTable(), off);
|
|
31143
|
+
currentPath = path14;
|
|
31144
31144
|
}
|
|
31145
31145
|
function addTableArray(node) {
|
|
31146
|
-
var
|
|
31147
|
-
var quotedPath =
|
|
31146
|
+
var path14 = node.value;
|
|
31147
|
+
var quotedPath = path14.map(quoteDottedString).join(".");
|
|
31148
31148
|
var off = node.offset;
|
|
31149
31149
|
if (valueAssignments.has(quotedPath)) {
|
|
31150
31150
|
genError("Cannot append to statically defined array '" + quotedPath + "'.", off);
|
|
@@ -31156,14 +31156,14 @@ var require_compiler = __commonJS({
|
|
|
31156
31156
|
if (isSameOrSubPath(p, quotedPath)) valueAssignments.delete(p);
|
|
31157
31157
|
});
|
|
31158
31158
|
assignedPaths.add(quotedPath);
|
|
31159
|
-
context4 = deepRef(data,
|
|
31160
|
-
currentPath =
|
|
31159
|
+
context4 = deepRef(data, path14, createTableArray(), off);
|
|
31160
|
+
currentPath = path14;
|
|
31161
31161
|
if (context4 instanceof Array) {
|
|
31162
31162
|
var newObj = createTable();
|
|
31163
31163
|
context4.push(newObj);
|
|
31164
31164
|
context4 = newObj;
|
|
31165
31165
|
} else {
|
|
31166
|
-
genError("Cannot redefine existing key '" +
|
|
31166
|
+
genError("Cannot redefine existing key '" + path14 + "'.", off);
|
|
31167
31167
|
}
|
|
31168
31168
|
}
|
|
31169
31169
|
function deepRef(start, keys3, value3, off) {
|
|
@@ -31227,8 +31227,8 @@ var require_compiler = __commonJS({
|
|
|
31227
31227
|
function makeFullPath(keys3) {
|
|
31228
31228
|
return pathKey(currentPath.concat(keys3));
|
|
31229
31229
|
}
|
|
31230
|
-
function isSameOrSubPath(
|
|
31231
|
-
return
|
|
31230
|
+
function isSameOrSubPath(path14, prefix) {
|
|
31231
|
+
return path14 === prefix || path14.indexOf(prefix + ".") === 0;
|
|
31232
31232
|
}
|
|
31233
31233
|
}
|
|
31234
31234
|
module.exports = {
|
|
@@ -31329,17 +31329,17 @@ var require_visit = __commonJS({
|
|
|
31329
31329
|
visit.BREAK = BREAK;
|
|
31330
31330
|
visit.SKIP = SKIP;
|
|
31331
31331
|
visit.REMOVE = REMOVE;
|
|
31332
|
-
function visit_(key, node, visitor,
|
|
31333
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
31332
|
+
function visit_(key, node, visitor, path14) {
|
|
31333
|
+
const ctrl = callVisitor(key, node, visitor, path14);
|
|
31334
31334
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
31335
|
-
replaceNode(key,
|
|
31336
|
-
return visit_(key, ctrl, visitor,
|
|
31335
|
+
replaceNode(key, path14, ctrl);
|
|
31336
|
+
return visit_(key, ctrl, visitor, path14);
|
|
31337
31337
|
}
|
|
31338
31338
|
if (typeof ctrl !== "symbol") {
|
|
31339
31339
|
if (identity2.isCollection(node)) {
|
|
31340
|
-
|
|
31340
|
+
path14 = Object.freeze(path14.concat(node));
|
|
31341
31341
|
for (let i = 0; i < node.items.length; ++i) {
|
|
31342
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
31342
|
+
const ci = visit_(i, node.items[i], visitor, path14);
|
|
31343
31343
|
if (typeof ci === "number")
|
|
31344
31344
|
i = ci - 1;
|
|
31345
31345
|
else if (ci === BREAK)
|
|
@@ -31350,13 +31350,13 @@ var require_visit = __commonJS({
|
|
|
31350
31350
|
}
|
|
31351
31351
|
}
|
|
31352
31352
|
} else if (identity2.isPair(node)) {
|
|
31353
|
-
|
|
31354
|
-
const ck = visit_("key", node.key, visitor,
|
|
31353
|
+
path14 = Object.freeze(path14.concat(node));
|
|
31354
|
+
const ck = visit_("key", node.key, visitor, path14);
|
|
31355
31355
|
if (ck === BREAK)
|
|
31356
31356
|
return BREAK;
|
|
31357
31357
|
else if (ck === REMOVE)
|
|
31358
31358
|
node.key = null;
|
|
31359
|
-
const cv = visit_("value", node.value, visitor,
|
|
31359
|
+
const cv = visit_("value", node.value, visitor, path14);
|
|
31360
31360
|
if (cv === BREAK)
|
|
31361
31361
|
return BREAK;
|
|
31362
31362
|
else if (cv === REMOVE)
|
|
@@ -31377,17 +31377,17 @@ var require_visit = __commonJS({
|
|
|
31377
31377
|
visitAsync.BREAK = BREAK;
|
|
31378
31378
|
visitAsync.SKIP = SKIP;
|
|
31379
31379
|
visitAsync.REMOVE = REMOVE;
|
|
31380
|
-
async function visitAsync_(key, node, visitor,
|
|
31381
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
31380
|
+
async function visitAsync_(key, node, visitor, path14) {
|
|
31381
|
+
const ctrl = await callVisitor(key, node, visitor, path14);
|
|
31382
31382
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
31383
|
-
replaceNode(key,
|
|
31384
|
-
return visitAsync_(key, ctrl, visitor,
|
|
31383
|
+
replaceNode(key, path14, ctrl);
|
|
31384
|
+
return visitAsync_(key, ctrl, visitor, path14);
|
|
31385
31385
|
}
|
|
31386
31386
|
if (typeof ctrl !== "symbol") {
|
|
31387
31387
|
if (identity2.isCollection(node)) {
|
|
31388
|
-
|
|
31388
|
+
path14 = Object.freeze(path14.concat(node));
|
|
31389
31389
|
for (let i = 0; i < node.items.length; ++i) {
|
|
31390
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
31390
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path14);
|
|
31391
31391
|
if (typeof ci === "number")
|
|
31392
31392
|
i = ci - 1;
|
|
31393
31393
|
else if (ci === BREAK)
|
|
@@ -31398,13 +31398,13 @@ var require_visit = __commonJS({
|
|
|
31398
31398
|
}
|
|
31399
31399
|
}
|
|
31400
31400
|
} else if (identity2.isPair(node)) {
|
|
31401
|
-
|
|
31402
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
31401
|
+
path14 = Object.freeze(path14.concat(node));
|
|
31402
|
+
const ck = await visitAsync_("key", node.key, visitor, path14);
|
|
31403
31403
|
if (ck === BREAK)
|
|
31404
31404
|
return BREAK;
|
|
31405
31405
|
else if (ck === REMOVE)
|
|
31406
31406
|
node.key = null;
|
|
31407
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
31407
|
+
const cv = await visitAsync_("value", node.value, visitor, path14);
|
|
31408
31408
|
if (cv === BREAK)
|
|
31409
31409
|
return BREAK;
|
|
31410
31410
|
else if (cv === REMOVE)
|
|
@@ -31431,23 +31431,23 @@ var require_visit = __commonJS({
|
|
|
31431
31431
|
}
|
|
31432
31432
|
return visitor;
|
|
31433
31433
|
}
|
|
31434
|
-
function callVisitor(key, node, visitor,
|
|
31434
|
+
function callVisitor(key, node, visitor, path14) {
|
|
31435
31435
|
if (typeof visitor === "function")
|
|
31436
|
-
return visitor(key, node,
|
|
31436
|
+
return visitor(key, node, path14);
|
|
31437
31437
|
if (identity2.isMap(node))
|
|
31438
|
-
return visitor.Map?.(key, node,
|
|
31438
|
+
return visitor.Map?.(key, node, path14);
|
|
31439
31439
|
if (identity2.isSeq(node))
|
|
31440
|
-
return visitor.Seq?.(key, node,
|
|
31440
|
+
return visitor.Seq?.(key, node, path14);
|
|
31441
31441
|
if (identity2.isPair(node))
|
|
31442
|
-
return visitor.Pair?.(key, node,
|
|
31442
|
+
return visitor.Pair?.(key, node, path14);
|
|
31443
31443
|
if (identity2.isScalar(node))
|
|
31444
|
-
return visitor.Scalar?.(key, node,
|
|
31444
|
+
return visitor.Scalar?.(key, node, path14);
|
|
31445
31445
|
if (identity2.isAlias(node))
|
|
31446
|
-
return visitor.Alias?.(key, node,
|
|
31446
|
+
return visitor.Alias?.(key, node, path14);
|
|
31447
31447
|
return void 0;
|
|
31448
31448
|
}
|
|
31449
|
-
function replaceNode(key,
|
|
31450
|
-
const parent =
|
|
31449
|
+
function replaceNode(key, path14, node) {
|
|
31450
|
+
const parent = path14[path14.length - 1];
|
|
31451
31451
|
if (identity2.isCollection(parent)) {
|
|
31452
31452
|
parent.items[key] = node;
|
|
31453
31453
|
} else if (identity2.isPair(parent)) {
|
|
@@ -32057,10 +32057,10 @@ var require_Collection = __commonJS({
|
|
|
32057
32057
|
var createNode = require_createNode();
|
|
32058
32058
|
var identity2 = require_identity();
|
|
32059
32059
|
var Node2 = require_Node();
|
|
32060
|
-
function collectionFromPath(schema,
|
|
32060
|
+
function collectionFromPath(schema, path14, value3) {
|
|
32061
32061
|
let v = value3;
|
|
32062
|
-
for (let i =
|
|
32063
|
-
const k =
|
|
32062
|
+
for (let i = path14.length - 1; i >= 0; --i) {
|
|
32063
|
+
const k = path14[i];
|
|
32064
32064
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
32065
32065
|
const a = [];
|
|
32066
32066
|
a[k] = v;
|
|
@@ -32079,7 +32079,7 @@ var require_Collection = __commonJS({
|
|
|
32079
32079
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
32080
32080
|
});
|
|
32081
32081
|
}
|
|
32082
|
-
var isEmptyPath = (
|
|
32082
|
+
var isEmptyPath = (path14) => path14 == null || typeof path14 === "object" && !!path14[Symbol.iterator]().next().done;
|
|
32083
32083
|
var Collection = class extends Node2.NodeBase {
|
|
32084
32084
|
constructor(type, schema) {
|
|
32085
32085
|
super(type);
|
|
@@ -32109,11 +32109,11 @@ var require_Collection = __commonJS({
|
|
|
32109
32109
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
32110
32110
|
* that already exists in the map.
|
|
32111
32111
|
*/
|
|
32112
|
-
addIn(
|
|
32113
|
-
if (isEmptyPath(
|
|
32112
|
+
addIn(path14, value3) {
|
|
32113
|
+
if (isEmptyPath(path14))
|
|
32114
32114
|
this.add(value3);
|
|
32115
32115
|
else {
|
|
32116
|
-
const [key, ...rest] =
|
|
32116
|
+
const [key, ...rest] = path14;
|
|
32117
32117
|
const node = this.get(key, true);
|
|
32118
32118
|
if (identity2.isCollection(node))
|
|
32119
32119
|
node.addIn(rest, value3);
|
|
@@ -32127,8 +32127,8 @@ var require_Collection = __commonJS({
|
|
|
32127
32127
|
* Removes a value from the collection.
|
|
32128
32128
|
* @returns `true` if the item was found and removed.
|
|
32129
32129
|
*/
|
|
32130
|
-
deleteIn(
|
|
32131
|
-
const [key, ...rest] =
|
|
32130
|
+
deleteIn(path14) {
|
|
32131
|
+
const [key, ...rest] = path14;
|
|
32132
32132
|
if (rest.length === 0)
|
|
32133
32133
|
return this.delete(key);
|
|
32134
32134
|
const node = this.get(key, true);
|
|
@@ -32142,8 +32142,8 @@ var require_Collection = __commonJS({
|
|
|
32142
32142
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
32143
32143
|
* `true` (collections are always returned intact).
|
|
32144
32144
|
*/
|
|
32145
|
-
getIn(
|
|
32146
|
-
const [key, ...rest] =
|
|
32145
|
+
getIn(path14, keepScalar) {
|
|
32146
|
+
const [key, ...rest] = path14;
|
|
32147
32147
|
const node = this.get(key, true);
|
|
32148
32148
|
if (rest.length === 0)
|
|
32149
32149
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -32161,8 +32161,8 @@ var require_Collection = __commonJS({
|
|
|
32161
32161
|
/**
|
|
32162
32162
|
* Checks if the collection includes a value with the key `key`.
|
|
32163
32163
|
*/
|
|
32164
|
-
hasIn(
|
|
32165
|
-
const [key, ...rest] =
|
|
32164
|
+
hasIn(path14) {
|
|
32165
|
+
const [key, ...rest] = path14;
|
|
32166
32166
|
if (rest.length === 0)
|
|
32167
32167
|
return this.has(key);
|
|
32168
32168
|
const node = this.get(key, true);
|
|
@@ -32172,8 +32172,8 @@ var require_Collection = __commonJS({
|
|
|
32172
32172
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
32173
32173
|
* boolean to add/remove the item from the set.
|
|
32174
32174
|
*/
|
|
32175
|
-
setIn(
|
|
32176
|
-
const [key, ...rest] =
|
|
32175
|
+
setIn(path14, value3) {
|
|
32176
|
+
const [key, ...rest] = path14;
|
|
32177
32177
|
if (rest.length === 0) {
|
|
32178
32178
|
this.set(key, value3);
|
|
32179
32179
|
} else {
|
|
@@ -34688,9 +34688,9 @@ var require_Document = __commonJS({
|
|
|
34688
34688
|
this.contents.add(value3);
|
|
34689
34689
|
}
|
|
34690
34690
|
/** Adds a value to the document. */
|
|
34691
|
-
addIn(
|
|
34691
|
+
addIn(path14, value3) {
|
|
34692
34692
|
if (assertCollection(this.contents))
|
|
34693
|
-
this.contents.addIn(
|
|
34693
|
+
this.contents.addIn(path14, value3);
|
|
34694
34694
|
}
|
|
34695
34695
|
/**
|
|
34696
34696
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -34765,14 +34765,14 @@ var require_Document = __commonJS({
|
|
|
34765
34765
|
* Removes a value from the document.
|
|
34766
34766
|
* @returns `true` if the item was found and removed.
|
|
34767
34767
|
*/
|
|
34768
|
-
deleteIn(
|
|
34769
|
-
if (Collection.isEmptyPath(
|
|
34768
|
+
deleteIn(path14) {
|
|
34769
|
+
if (Collection.isEmptyPath(path14)) {
|
|
34770
34770
|
if (this.contents == null)
|
|
34771
34771
|
return false;
|
|
34772
34772
|
this.contents = null;
|
|
34773
34773
|
return true;
|
|
34774
34774
|
}
|
|
34775
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
34775
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path14) : false;
|
|
34776
34776
|
}
|
|
34777
34777
|
/**
|
|
34778
34778
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -34787,10 +34787,10 @@ var require_Document = __commonJS({
|
|
|
34787
34787
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
34788
34788
|
* `true` (collections are always returned intact).
|
|
34789
34789
|
*/
|
|
34790
|
-
getIn(
|
|
34791
|
-
if (Collection.isEmptyPath(
|
|
34790
|
+
getIn(path14, keepScalar) {
|
|
34791
|
+
if (Collection.isEmptyPath(path14))
|
|
34792
34792
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
34793
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
34793
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path14, keepScalar) : void 0;
|
|
34794
34794
|
}
|
|
34795
34795
|
/**
|
|
34796
34796
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -34801,10 +34801,10 @@ var require_Document = __commonJS({
|
|
|
34801
34801
|
/**
|
|
34802
34802
|
* Checks if the document includes a value at `path`.
|
|
34803
34803
|
*/
|
|
34804
|
-
hasIn(
|
|
34805
|
-
if (Collection.isEmptyPath(
|
|
34804
|
+
hasIn(path14) {
|
|
34805
|
+
if (Collection.isEmptyPath(path14))
|
|
34806
34806
|
return this.contents !== void 0;
|
|
34807
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
34807
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path14) : false;
|
|
34808
34808
|
}
|
|
34809
34809
|
/**
|
|
34810
34810
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -34821,13 +34821,13 @@ var require_Document = __commonJS({
|
|
|
34821
34821
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
34822
34822
|
* boolean to add/remove the item from the set.
|
|
34823
34823
|
*/
|
|
34824
|
-
setIn(
|
|
34825
|
-
if (Collection.isEmptyPath(
|
|
34824
|
+
setIn(path14, value3) {
|
|
34825
|
+
if (Collection.isEmptyPath(path14)) {
|
|
34826
34826
|
this.contents = value3;
|
|
34827
34827
|
} else if (this.contents == null) {
|
|
34828
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
34828
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path14), value3);
|
|
34829
34829
|
} else if (assertCollection(this.contents)) {
|
|
34830
|
-
this.contents.setIn(
|
|
34830
|
+
this.contents.setIn(path14, value3);
|
|
34831
34831
|
}
|
|
34832
34832
|
}
|
|
34833
34833
|
/**
|
|
@@ -36787,9 +36787,9 @@ var require_cst_visit = __commonJS({
|
|
|
36787
36787
|
visit.BREAK = BREAK;
|
|
36788
36788
|
visit.SKIP = SKIP;
|
|
36789
36789
|
visit.REMOVE = REMOVE;
|
|
36790
|
-
visit.itemAtPath = (cst,
|
|
36790
|
+
visit.itemAtPath = (cst, path14) => {
|
|
36791
36791
|
let item = cst;
|
|
36792
|
-
for (const [field, index2] of
|
|
36792
|
+
for (const [field, index2] of path14) {
|
|
36793
36793
|
const tok = item?.[field];
|
|
36794
36794
|
if (tok && "items" in tok) {
|
|
36795
36795
|
item = tok.items[index2];
|
|
@@ -36798,23 +36798,23 @@ var require_cst_visit = __commonJS({
|
|
|
36798
36798
|
}
|
|
36799
36799
|
return item;
|
|
36800
36800
|
};
|
|
36801
|
-
visit.parentCollection = (cst,
|
|
36802
|
-
const parent = visit.itemAtPath(cst,
|
|
36803
|
-
const field =
|
|
36801
|
+
visit.parentCollection = (cst, path14) => {
|
|
36802
|
+
const parent = visit.itemAtPath(cst, path14.slice(0, -1));
|
|
36803
|
+
const field = path14[path14.length - 1][0];
|
|
36804
36804
|
const coll = parent?.[field];
|
|
36805
36805
|
if (coll && "items" in coll)
|
|
36806
36806
|
return coll;
|
|
36807
36807
|
throw new Error("Parent collection not found");
|
|
36808
36808
|
};
|
|
36809
|
-
function _visit(
|
|
36810
|
-
let ctrl = visitor(item,
|
|
36809
|
+
function _visit(path14, item, visitor) {
|
|
36810
|
+
let ctrl = visitor(item, path14);
|
|
36811
36811
|
if (typeof ctrl === "symbol")
|
|
36812
36812
|
return ctrl;
|
|
36813
36813
|
for (const field of ["key", "value"]) {
|
|
36814
36814
|
const token = item[field];
|
|
36815
36815
|
if (token && "items" in token) {
|
|
36816
36816
|
for (let i = 0; i < token.items.length; ++i) {
|
|
36817
|
-
const ci = _visit(Object.freeze(
|
|
36817
|
+
const ci = _visit(Object.freeze(path14.concat([[field, i]])), token.items[i], visitor);
|
|
36818
36818
|
if (typeof ci === "number")
|
|
36819
36819
|
i = ci - 1;
|
|
36820
36820
|
else if (ci === BREAK)
|
|
@@ -36825,10 +36825,10 @@ var require_cst_visit = __commonJS({
|
|
|
36825
36825
|
}
|
|
36826
36826
|
}
|
|
36827
36827
|
if (typeof ctrl === "function" && field === "key")
|
|
36828
|
-
ctrl = ctrl(item,
|
|
36828
|
+
ctrl = ctrl(item, path14);
|
|
36829
36829
|
}
|
|
36830
36830
|
}
|
|
36831
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
36831
|
+
return typeof ctrl === "function" ? ctrl(item, path14) : ctrl;
|
|
36832
36832
|
}
|
|
36833
36833
|
exports.visit = visit;
|
|
36834
36834
|
}
|
|
@@ -38581,7 +38581,7 @@ var require_dist = __commonJS({
|
|
|
38581
38581
|
|
|
38582
38582
|
// dist/cli.js
|
|
38583
38583
|
import * as fs3 from "node:fs";
|
|
38584
|
-
import * as
|
|
38584
|
+
import * as path13 from "node:path";
|
|
38585
38585
|
|
|
38586
38586
|
// node_modules/.pnpm/effect@4.0.0-beta.100/node_modules/effect/dist/Pipeable.js
|
|
38587
38587
|
var pipeArguments = (self, args2) => {
|
|
@@ -39154,8 +39154,8 @@ var CIRCULAR = "[Circular]";
|
|
|
39154
39154
|
function formatPropertyKey(name) {
|
|
39155
39155
|
return typeof name === "string" ? JSON.stringify(name) : String(name);
|
|
39156
39156
|
}
|
|
39157
|
-
function formatPath(
|
|
39158
|
-
return
|
|
39157
|
+
function formatPath(path14) {
|
|
39158
|
+
return path14.map((key) => `[${formatPropertyKey(key)}]`).join("");
|
|
39159
39159
|
}
|
|
39160
39160
|
function formatDate(date7) {
|
|
39161
39161
|
try {
|
|
@@ -45784,9 +45784,9 @@ var Pointer = class extends Base {
|
|
|
45784
45784
|
* The issue that occurred.
|
|
45785
45785
|
*/
|
|
45786
45786
|
issue;
|
|
45787
|
-
constructor(
|
|
45787
|
+
constructor(path14, issue) {
|
|
45788
45788
|
super();
|
|
45789
|
-
this.path =
|
|
45789
|
+
this.path = path14;
|
|
45790
45790
|
this.issue = issue;
|
|
45791
45791
|
}
|
|
45792
45792
|
};
|
|
@@ -45992,50 +45992,50 @@ function makeFormatterStandardSchemaV1(options) {
|
|
|
45992
45992
|
function getExpectedMessage(expected, actual) {
|
|
45993
45993
|
return `Expected ${expected}, got ${actual}`;
|
|
45994
45994
|
}
|
|
45995
|
-
function toDefaultIssues(issue,
|
|
45995
|
+
function toDefaultIssues(issue, path14, leafHook, checkHook) {
|
|
45996
45996
|
switch (issue._tag) {
|
|
45997
45997
|
case "Filter": {
|
|
45998
45998
|
const message = checkHook(issue);
|
|
45999
45999
|
if (message !== void 0) {
|
|
46000
46000
|
return [{
|
|
46001
|
-
path:
|
|
46001
|
+
path: path14,
|
|
46002
46002
|
message
|
|
46003
46003
|
}];
|
|
46004
46004
|
}
|
|
46005
46005
|
switch (issue.issue._tag) {
|
|
46006
46006
|
case "InvalidValue":
|
|
46007
46007
|
return [{
|
|
46008
|
-
path:
|
|
46008
|
+
path: path14,
|
|
46009
46009
|
message: getExpectedMessage(formatCheck(issue.filter), format(issue.actual))
|
|
46010
46010
|
}];
|
|
46011
46011
|
default:
|
|
46012
|
-
return toDefaultIssues(issue.issue,
|
|
46012
|
+
return toDefaultIssues(issue.issue, path14, leafHook, checkHook);
|
|
46013
46013
|
}
|
|
46014
46014
|
}
|
|
46015
46015
|
case "Encoding":
|
|
46016
|
-
return toDefaultIssues(issue.issue,
|
|
46016
|
+
return toDefaultIssues(issue.issue, path14, leafHook, checkHook);
|
|
46017
46017
|
case "Pointer":
|
|
46018
|
-
return toDefaultIssues(issue.issue, [...
|
|
46018
|
+
return toDefaultIssues(issue.issue, [...path14, ...issue.path], leafHook, checkHook);
|
|
46019
46019
|
case "Composite":
|
|
46020
|
-
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2,
|
|
46020
|
+
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2, path14, leafHook, checkHook));
|
|
46021
46021
|
case "AnyOf": {
|
|
46022
46022
|
const message = findMessage(issue);
|
|
46023
46023
|
if (issue.issues.length === 0) {
|
|
46024
46024
|
if (message !== void 0) return [{
|
|
46025
|
-
path:
|
|
46025
|
+
path: path14,
|
|
46026
46026
|
message
|
|
46027
46027
|
}];
|
|
46028
46028
|
const expected = getExpectedMessage(getExpected(issue.ast), format(issue.actual));
|
|
46029
46029
|
return [{
|
|
46030
|
-
path:
|
|
46030
|
+
path: path14,
|
|
46031
46031
|
message: expected
|
|
46032
46032
|
}];
|
|
46033
46033
|
}
|
|
46034
|
-
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2,
|
|
46034
|
+
return issue.issues.flatMap((issue2) => toDefaultIssues(issue2, path14, leafHook, checkHook));
|
|
46035
46035
|
}
|
|
46036
46036
|
default:
|
|
46037
46037
|
return [{
|
|
46038
|
-
path:
|
|
46038
|
+
path: path14,
|
|
46039
46039
|
message: leafHook(issue)
|
|
46040
46040
|
}];
|
|
46041
46041
|
}
|
|
@@ -46057,9 +46057,9 @@ var defaultFormatter = /* @__PURE__ */ makeFormatterDefault();
|
|
|
46057
46057
|
function formatDefaultIssue(issue) {
|
|
46058
46058
|
let out = issue.message;
|
|
46059
46059
|
if (issue.path && issue.path.length > 0) {
|
|
46060
|
-
const
|
|
46060
|
+
const path14 = formatPath(issue.path);
|
|
46061
46061
|
out += `
|
|
46062
|
-
at ${
|
|
46062
|
+
at ${path14}`;
|
|
46063
46063
|
}
|
|
46064
46064
|
return out;
|
|
46065
46065
|
}
|
|
@@ -50037,8 +50037,8 @@ var FileSystem = /* @__PURE__ */ Service("effect/platform/FileSystem");
|
|
|
50037
50037
|
var make19 = (impl) => FileSystem.of({
|
|
50038
50038
|
...impl,
|
|
50039
50039
|
[TypeId28]: TypeId28,
|
|
50040
|
-
exists: (
|
|
50041
|
-
readFileString: (
|
|
50040
|
+
exists: (path14) => pipe(impl.access(path14), as3(true), catchTag3("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail6(e))),
|
|
50041
|
+
readFileString: (path14, encoding) => flatMap5(impl.readFile(path14), (_) => try_3({
|
|
50042
50042
|
try: () => new TextDecoder(encoding).decode(_),
|
|
50043
50043
|
catch: (cause) => badArgument({
|
|
50044
50044
|
module: "FileSystem",
|
|
@@ -50047,8 +50047,8 @@ var make19 = (impl) => FileSystem.of({
|
|
|
50047
50047
|
cause
|
|
50048
50048
|
})
|
|
50049
50049
|
})),
|
|
50050
|
-
stream: fnUntraced2(function* (
|
|
50051
|
-
const file4 = yield* impl.open(
|
|
50050
|
+
stream: fnUntraced2(function* (path14, options) {
|
|
50051
|
+
const file4 = yield* impl.open(path14, {
|
|
50052
50052
|
flag: "r"
|
|
50053
50053
|
});
|
|
50054
50054
|
if (options?.offset) {
|
|
@@ -50071,11 +50071,11 @@ var make19 = (impl) => FileSystem.of({
|
|
|
50071
50071
|
}
|
|
50072
50072
|
}))));
|
|
50073
50073
|
}, unwrap4),
|
|
50074
|
-
sink: (
|
|
50074
|
+
sink: (path14, options) => pipe(impl.open(path14, {
|
|
50075
50075
|
flag: "w",
|
|
50076
50076
|
...options
|
|
50077
50077
|
}), map7((file4) => forEach3((_) => file4.writeAll(_))), unwrap3),
|
|
50078
|
-
writeFileString: (
|
|
50078
|
+
writeFileString: (path14, data, options) => flatMap5(try_3({
|
|
50079
50079
|
try: () => new TextEncoder().encode(data),
|
|
50080
50080
|
catch: (cause) => badArgument({
|
|
50081
50081
|
module: "FileSystem",
|
|
@@ -50083,31 +50083,31 @@ var make19 = (impl) => FileSystem.of({
|
|
|
50083
50083
|
description: "could not encode string",
|
|
50084
50084
|
cause
|
|
50085
50085
|
})
|
|
50086
|
-
}), (_) => impl.writeFile(
|
|
50086
|
+
}), (_) => impl.writeFile(path14, _, options))
|
|
50087
50087
|
});
|
|
50088
|
-
var notFound = (method,
|
|
50088
|
+
var notFound = (method, path14) => systemError({
|
|
50089
50089
|
module: "FileSystem",
|
|
50090
50090
|
method,
|
|
50091
50091
|
_tag: "NotFound",
|
|
50092
50092
|
description: "No such file or directory",
|
|
50093
|
-
pathOrDescriptor:
|
|
50093
|
+
pathOrDescriptor: path14
|
|
50094
50094
|
});
|
|
50095
50095
|
var makeNoop = (fileSystem) => FileSystem.of({
|
|
50096
50096
|
[TypeId28]: TypeId28,
|
|
50097
|
-
access(
|
|
50098
|
-
return fail6(notFound("access",
|
|
50097
|
+
access(path14) {
|
|
50098
|
+
return fail6(notFound("access", path14));
|
|
50099
50099
|
},
|
|
50100
|
-
chmod(
|
|
50101
|
-
return fail6(notFound("chmod",
|
|
50100
|
+
chmod(path14) {
|
|
50101
|
+
return fail6(notFound("chmod", path14));
|
|
50102
50102
|
},
|
|
50103
|
-
chown(
|
|
50104
|
-
return fail6(notFound("chown",
|
|
50103
|
+
chown(path14) {
|
|
50104
|
+
return fail6(notFound("chown", path14));
|
|
50105
50105
|
},
|
|
50106
|
-
copy(
|
|
50107
|
-
return fail6(notFound("copy",
|
|
50106
|
+
copy(path14) {
|
|
50107
|
+
return fail6(notFound("copy", path14));
|
|
50108
50108
|
},
|
|
50109
|
-
copyFile(
|
|
50110
|
-
return fail6(notFound("copyFile",
|
|
50109
|
+
copyFile(path14) {
|
|
50110
|
+
return fail6(notFound("copyFile", path14));
|
|
50111
50111
|
},
|
|
50112
50112
|
glob(pattern) {
|
|
50113
50113
|
return fail6(notFound("glob", pattern));
|
|
@@ -50115,8 +50115,8 @@ var makeNoop = (fileSystem) => FileSystem.of({
|
|
|
50115
50115
|
exists() {
|
|
50116
50116
|
return succeed6(false);
|
|
50117
50117
|
},
|
|
50118
|
-
link(
|
|
50119
|
-
return fail6(notFound("link",
|
|
50118
|
+
link(path14) {
|
|
50119
|
+
return fail6(notFound("link", path14));
|
|
50120
50120
|
},
|
|
50121
50121
|
makeDirectory() {
|
|
50122
50122
|
return die2("not implemented");
|
|
@@ -50133,23 +50133,23 @@ var makeNoop = (fileSystem) => FileSystem.of({
|
|
|
50133
50133
|
makeTempFileScoped() {
|
|
50134
50134
|
return die2("not implemented");
|
|
50135
50135
|
},
|
|
50136
|
-
open(
|
|
50137
|
-
return fail6(notFound("open",
|
|
50136
|
+
open(path14) {
|
|
50137
|
+
return fail6(notFound("open", path14));
|
|
50138
50138
|
},
|
|
50139
|
-
readDirectory(
|
|
50140
|
-
return fail6(notFound("readDirectory",
|
|
50139
|
+
readDirectory(path14) {
|
|
50140
|
+
return fail6(notFound("readDirectory", path14));
|
|
50141
50141
|
},
|
|
50142
|
-
readFile(
|
|
50143
|
-
return fail6(notFound("readFile",
|
|
50142
|
+
readFile(path14) {
|
|
50143
|
+
return fail6(notFound("readFile", path14));
|
|
50144
50144
|
},
|
|
50145
|
-
readFileString(
|
|
50146
|
-
return fail6(notFound("readFileString",
|
|
50145
|
+
readFileString(path14) {
|
|
50146
|
+
return fail6(notFound("readFileString", path14));
|
|
50147
50147
|
},
|
|
50148
|
-
readLink(
|
|
50149
|
-
return fail6(notFound("readLink",
|
|
50148
|
+
readLink(path14) {
|
|
50149
|
+
return fail6(notFound("readLink", path14));
|
|
50150
50150
|
},
|
|
50151
|
-
realPath(
|
|
50152
|
-
return fail6(notFound("realPath",
|
|
50151
|
+
realPath(path14) {
|
|
50152
|
+
return fail6(notFound("realPath", path14));
|
|
50153
50153
|
},
|
|
50154
50154
|
remove() {
|
|
50155
50155
|
return void_5;
|
|
@@ -50157,32 +50157,32 @@ var makeNoop = (fileSystem) => FileSystem.of({
|
|
|
50157
50157
|
rename(oldPath) {
|
|
50158
50158
|
return fail6(notFound("rename", oldPath));
|
|
50159
50159
|
},
|
|
50160
|
-
sink(
|
|
50161
|
-
return fail9(notFound("sink",
|
|
50160
|
+
sink(path14) {
|
|
50161
|
+
return fail9(notFound("sink", path14));
|
|
50162
50162
|
},
|
|
50163
|
-
stat(
|
|
50164
|
-
return fail6(notFound("stat",
|
|
50163
|
+
stat(path14) {
|
|
50164
|
+
return fail6(notFound("stat", path14));
|
|
50165
50165
|
},
|
|
50166
|
-
stream(
|
|
50167
|
-
return fail10(notFound("stream",
|
|
50166
|
+
stream(path14) {
|
|
50167
|
+
return fail10(notFound("stream", path14));
|
|
50168
50168
|
},
|
|
50169
50169
|
symlink(fromPath) {
|
|
50170
50170
|
return fail6(notFound("symlink", fromPath));
|
|
50171
50171
|
},
|
|
50172
|
-
truncate(
|
|
50173
|
-
return fail6(notFound("truncate",
|
|
50172
|
+
truncate(path14) {
|
|
50173
|
+
return fail6(notFound("truncate", path14));
|
|
50174
50174
|
},
|
|
50175
|
-
utimes(
|
|
50176
|
-
return fail6(notFound("utimes",
|
|
50175
|
+
utimes(path14) {
|
|
50176
|
+
return fail6(notFound("utimes", path14));
|
|
50177
50177
|
},
|
|
50178
|
-
watch(
|
|
50179
|
-
return fail10(notFound("watch",
|
|
50178
|
+
watch(path14) {
|
|
50179
|
+
return fail10(notFound("watch", path14));
|
|
50180
50180
|
},
|
|
50181
|
-
writeFile(
|
|
50182
|
-
return fail6(notFound("writeFile",
|
|
50181
|
+
writeFile(path14) {
|
|
50182
|
+
return fail6(notFound("writeFile", path14));
|
|
50183
50183
|
},
|
|
50184
|
-
writeFileString(
|
|
50185
|
-
return fail6(notFound("writeFileString",
|
|
50184
|
+
writeFileString(path14) {
|
|
50185
|
+
return fail6(notFound("writeFileString", path14));
|
|
50186
50186
|
},
|
|
50187
50187
|
...fileSystem
|
|
50188
50188
|
});
|
|
@@ -50202,15 +50202,15 @@ __export(Path_exports, {
|
|
|
50202
50202
|
});
|
|
50203
50203
|
var TypeId29 = "~effect/platform/Path";
|
|
50204
50204
|
var Path = /* @__PURE__ */ Service("effect/Path");
|
|
50205
|
-
function normalizeStringPosix(
|
|
50205
|
+
function normalizeStringPosix(path14, allowAboveRoot) {
|
|
50206
50206
|
let res = "";
|
|
50207
50207
|
let lastSegmentLength = 0;
|
|
50208
50208
|
let lastSlash = -1;
|
|
50209
50209
|
let dots = 0;
|
|
50210
50210
|
let code;
|
|
50211
|
-
for (let i = 0; i <=
|
|
50212
|
-
if (i <
|
|
50213
|
-
code =
|
|
50211
|
+
for (let i = 0; i <= path14.length; ++i) {
|
|
50212
|
+
if (i < path14.length) {
|
|
50213
|
+
code = path14.charCodeAt(i);
|
|
50214
50214
|
} else if (code === 47) {
|
|
50215
50215
|
break;
|
|
50216
50216
|
} else {
|
|
@@ -50252,9 +50252,9 @@ function normalizeStringPosix(path12, allowAboveRoot) {
|
|
|
50252
50252
|
}
|
|
50253
50253
|
} else {
|
|
50254
50254
|
if (res.length > 0) {
|
|
50255
|
-
res += "/" +
|
|
50255
|
+
res += "/" + path14.slice(lastSlash + 1, i);
|
|
50256
50256
|
} else {
|
|
50257
|
-
res =
|
|
50257
|
+
res = path14.slice(lastSlash + 1, i);
|
|
50258
50258
|
}
|
|
50259
50259
|
lastSegmentLength = i - lastSlash - 1;
|
|
50260
50260
|
}
|
|
@@ -50313,21 +50313,21 @@ var resolve2 = function resolve3() {
|
|
|
50313
50313
|
let resolvedAbsolute = false;
|
|
50314
50314
|
let cwd = void 0;
|
|
50315
50315
|
for (let i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
50316
|
-
let
|
|
50316
|
+
let path14;
|
|
50317
50317
|
if (i >= 0) {
|
|
50318
|
-
|
|
50318
|
+
path14 = arguments[i];
|
|
50319
50319
|
} else {
|
|
50320
50320
|
const process2 = globalThis.process;
|
|
50321
50321
|
if (cwd === void 0 && "process" in globalThis && typeof process2 === "object" && process2 !== null && typeof process2.cwd === "function") {
|
|
50322
50322
|
cwd = process2.cwd();
|
|
50323
50323
|
}
|
|
50324
|
-
|
|
50324
|
+
path14 = cwd;
|
|
50325
50325
|
}
|
|
50326
|
-
if (
|
|
50326
|
+
if (path14.length === 0) {
|
|
50327
50327
|
continue;
|
|
50328
50328
|
}
|
|
50329
|
-
resolvedPath =
|
|
50330
|
-
resolvedAbsolute =
|
|
50329
|
+
resolvedPath = path14 + "/" + resolvedPath;
|
|
50330
|
+
resolvedAbsolute = path14.charCodeAt(0) === 47;
|
|
50331
50331
|
}
|
|
50332
50332
|
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
|
|
50333
50333
|
if (resolvedAbsolute) {
|
|
@@ -50379,18 +50379,18 @@ function encodePathChars(filepath) {
|
|
|
50379
50379
|
var posixImpl = /* @__PURE__ */ Path.of({
|
|
50380
50380
|
[TypeId29]: TypeId29,
|
|
50381
50381
|
resolve: resolve2,
|
|
50382
|
-
normalize(
|
|
50383
|
-
if (
|
|
50384
|
-
const isAbsolute2 =
|
|
50385
|
-
const trailingSeparator =
|
|
50386
|
-
|
|
50387
|
-
if (
|
|
50388
|
-
if (
|
|
50389
|
-
if (isAbsolute2) return "/" +
|
|
50390
|
-
return
|
|
50382
|
+
normalize(path14) {
|
|
50383
|
+
if (path14.length === 0) return ".";
|
|
50384
|
+
const isAbsolute2 = path14.charCodeAt(0) === 47;
|
|
50385
|
+
const trailingSeparator = path14.charCodeAt(path14.length - 1) === 47;
|
|
50386
|
+
path14 = normalizeStringPosix(path14, !isAbsolute2);
|
|
50387
|
+
if (path14.length === 0 && !isAbsolute2) path14 = ".";
|
|
50388
|
+
if (path14.length > 0 && trailingSeparator) path14 += "/";
|
|
50389
|
+
if (isAbsolute2) return "/" + path14;
|
|
50390
|
+
return path14;
|
|
50391
50391
|
},
|
|
50392
|
-
isAbsolute(
|
|
50393
|
-
return
|
|
50392
|
+
isAbsolute(path14) {
|
|
50393
|
+
return path14.length > 0 && path14.charCodeAt(0) === 47;
|
|
50394
50394
|
},
|
|
50395
50395
|
join() {
|
|
50396
50396
|
if (arguments.length === 0) {
|
|
@@ -50481,14 +50481,14 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50481
50481
|
return to.slice(toStart);
|
|
50482
50482
|
}
|
|
50483
50483
|
},
|
|
50484
|
-
dirname(
|
|
50485
|
-
if (
|
|
50486
|
-
let code =
|
|
50484
|
+
dirname(path14) {
|
|
50485
|
+
if (path14.length === 0) return ".";
|
|
50486
|
+
let code = path14.charCodeAt(0);
|
|
50487
50487
|
const hasRoot = code === 47;
|
|
50488
50488
|
let end = -1;
|
|
50489
50489
|
let matchedSlash = true;
|
|
50490
|
-
for (let i =
|
|
50491
|
-
code =
|
|
50490
|
+
for (let i = path14.length - 1; i >= 1; --i) {
|
|
50491
|
+
code = path14.charCodeAt(i);
|
|
50492
50492
|
if (code === 47) {
|
|
50493
50493
|
if (!matchedSlash) {
|
|
50494
50494
|
end = i;
|
|
@@ -50500,19 +50500,19 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50500
50500
|
}
|
|
50501
50501
|
if (end === -1) return hasRoot ? "/" : ".";
|
|
50502
50502
|
if (hasRoot && end === 1) return "//";
|
|
50503
|
-
return
|
|
50503
|
+
return path14.slice(0, end);
|
|
50504
50504
|
},
|
|
50505
|
-
basename(
|
|
50505
|
+
basename(path14, ext) {
|
|
50506
50506
|
let start = 0;
|
|
50507
50507
|
let end = -1;
|
|
50508
50508
|
let matchedSlash = true;
|
|
50509
50509
|
let i;
|
|
50510
|
-
if (ext !== void 0 && ext.length > 0 && ext.length <=
|
|
50511
|
-
if (ext.length ===
|
|
50510
|
+
if (ext !== void 0 && ext.length > 0 && ext.length <= path14.length) {
|
|
50511
|
+
if (ext.length === path14.length && ext === path14) return "";
|
|
50512
50512
|
let extIdx = ext.length - 1;
|
|
50513
50513
|
let firstNonSlashEnd = -1;
|
|
50514
|
-
for (i =
|
|
50515
|
-
const code =
|
|
50514
|
+
for (i = path14.length - 1; i >= 0; --i) {
|
|
50515
|
+
const code = path14.charCodeAt(i);
|
|
50516
50516
|
if (code === 47) {
|
|
50517
50517
|
if (!matchedSlash) {
|
|
50518
50518
|
start = i + 1;
|
|
@@ -50536,11 +50536,11 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50536
50536
|
}
|
|
50537
50537
|
}
|
|
50538
50538
|
if (start === end) end = firstNonSlashEnd;
|
|
50539
|
-
else if (end === -1) end =
|
|
50540
|
-
return
|
|
50539
|
+
else if (end === -1) end = path14.length;
|
|
50540
|
+
return path14.slice(start, end);
|
|
50541
50541
|
} else {
|
|
50542
|
-
for (i =
|
|
50543
|
-
if (
|
|
50542
|
+
for (i = path14.length - 1; i >= 0; --i) {
|
|
50543
|
+
if (path14.charCodeAt(i) === 47) {
|
|
50544
50544
|
if (!matchedSlash) {
|
|
50545
50545
|
start = i + 1;
|
|
50546
50546
|
break;
|
|
@@ -50551,17 +50551,17 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50551
50551
|
}
|
|
50552
50552
|
}
|
|
50553
50553
|
if (end === -1) return "";
|
|
50554
|
-
return
|
|
50554
|
+
return path14.slice(start, end);
|
|
50555
50555
|
}
|
|
50556
50556
|
},
|
|
50557
|
-
extname(
|
|
50557
|
+
extname(path14) {
|
|
50558
50558
|
let startDot = -1;
|
|
50559
50559
|
let startPart = 0;
|
|
50560
50560
|
let end = -1;
|
|
50561
50561
|
let matchedSlash = true;
|
|
50562
50562
|
let preDotState = 0;
|
|
50563
|
-
for (let i =
|
|
50564
|
-
const code =
|
|
50563
|
+
for (let i = path14.length - 1; i >= 0; --i) {
|
|
50564
|
+
const code = path14.charCodeAt(i);
|
|
50565
50565
|
if (code === 47) {
|
|
50566
50566
|
if (!matchedSlash) {
|
|
50567
50567
|
startPart = i + 1;
|
|
@@ -50588,7 +50588,7 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50588
50588
|
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
50589
50589
|
return "";
|
|
50590
50590
|
}
|
|
50591
|
-
return
|
|
50591
|
+
return path14.slice(startDot, end);
|
|
50592
50592
|
},
|
|
50593
50593
|
format: function format4(pathObject) {
|
|
50594
50594
|
if (pathObject === null || typeof pathObject !== "object") {
|
|
@@ -50596,7 +50596,7 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50596
50596
|
}
|
|
50597
50597
|
return _format("/", pathObject);
|
|
50598
50598
|
},
|
|
50599
|
-
parse(
|
|
50599
|
+
parse(path14) {
|
|
50600
50600
|
const ret = {
|
|
50601
50601
|
root: "",
|
|
50602
50602
|
dir: "",
|
|
@@ -50604,8 +50604,8 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50604
50604
|
ext: "",
|
|
50605
50605
|
name: ""
|
|
50606
50606
|
};
|
|
50607
|
-
if (
|
|
50608
|
-
let code =
|
|
50607
|
+
if (path14.length === 0) return ret;
|
|
50608
|
+
let code = path14.charCodeAt(0);
|
|
50609
50609
|
const isAbsolute2 = code === 47;
|
|
50610
50610
|
let start;
|
|
50611
50611
|
if (isAbsolute2) {
|
|
@@ -50618,10 +50618,10 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50618
50618
|
let startPart = 0;
|
|
50619
50619
|
let end = -1;
|
|
50620
50620
|
let matchedSlash = true;
|
|
50621
|
-
let i =
|
|
50621
|
+
let i = path14.length - 1;
|
|
50622
50622
|
let preDotState = 0;
|
|
50623
50623
|
for (; i >= start; --i) {
|
|
50624
|
-
code =
|
|
50624
|
+
code = path14.charCodeAt(i);
|
|
50625
50625
|
if (code === 47) {
|
|
50626
50626
|
if (!matchedSlash) {
|
|
50627
50627
|
startPart = i + 1;
|
|
@@ -50644,20 +50644,20 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
50644
50644
|
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
50645
50645
|
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
50646
50646
|
if (end !== -1) {
|
|
50647
|
-
if (startPart === 0 && isAbsolute2) ret.base = ret.name =
|
|
50648
|
-
else ret.base = ret.name =
|
|
50647
|
+
if (startPart === 0 && isAbsolute2) ret.base = ret.name = path14.slice(1, end);
|
|
50648
|
+
else ret.base = ret.name = path14.slice(startPart, end);
|
|
50649
50649
|
}
|
|
50650
50650
|
} else {
|
|
50651
50651
|
if (startPart === 0 && isAbsolute2) {
|
|
50652
|
-
ret.name =
|
|
50653
|
-
ret.base =
|
|
50652
|
+
ret.name = path14.slice(1, startDot);
|
|
50653
|
+
ret.base = path14.slice(1, end);
|
|
50654
50654
|
} else {
|
|
50655
|
-
ret.name =
|
|
50656
|
-
ret.base =
|
|
50655
|
+
ret.name = path14.slice(startPart, startDot);
|
|
50656
|
+
ret.base = path14.slice(startPart, end);
|
|
50657
50657
|
}
|
|
50658
|
-
ret.ext =
|
|
50658
|
+
ret.ext = path14.slice(startDot, end);
|
|
50659
50659
|
}
|
|
50660
|
-
if (startPart > 0) ret.dir =
|
|
50660
|
+
if (startPart > 0) ret.dir = path14.slice(0, startPart - 1);
|
|
50661
50661
|
else if (isAbsolute2) ret.dir = "/";
|
|
50662
50662
|
return ret;
|
|
50663
50663
|
},
|
|
@@ -50827,7 +50827,7 @@ import * as NodeChildProcess from "node:child_process";
|
|
|
50827
50827
|
import { PassThrough } from "node:stream";
|
|
50828
50828
|
|
|
50829
50829
|
// node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.100_effect@4.0.0-beta.100/node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
50830
|
-
var handleErrnoException = (module, method) => (err, [
|
|
50830
|
+
var handleErrnoException = (module, method) => (err, [path14]) => {
|
|
50831
50831
|
let reason = "Unknown";
|
|
50832
50832
|
switch (err.code) {
|
|
50833
50833
|
case "ENOENT":
|
|
@@ -50856,7 +50856,7 @@ var handleErrnoException = (module, method) => (err, [path12]) => {
|
|
|
50856
50856
|
_tag: reason,
|
|
50857
50857
|
module,
|
|
50858
50858
|
method,
|
|
50859
|
-
pathOrDescriptor:
|
|
50859
|
+
pathOrDescriptor: path14,
|
|
50860
50860
|
syscall: err.syscall,
|
|
50861
50861
|
cause: err
|
|
50862
50862
|
});
|
|
@@ -50975,11 +50975,11 @@ var toPlatformError = (method, error2, command) => {
|
|
|
50975
50975
|
};
|
|
50976
50976
|
var make23 = /* @__PURE__ */ gen4(function* () {
|
|
50977
50977
|
const fs4 = yield* FileSystem;
|
|
50978
|
-
const
|
|
50978
|
+
const path14 = yield* Path;
|
|
50979
50979
|
const resolveWorkingDirectory = fnUntraced2(function* (options) {
|
|
50980
50980
|
if (isUndefined(options.cwd)) return void 0;
|
|
50981
50981
|
yield* fs4.access(options.cwd);
|
|
50982
|
-
return
|
|
50982
|
+
return path14.resolve(options.cwd);
|
|
50983
50983
|
});
|
|
50984
50984
|
const resolveEnvironment = (options) => {
|
|
50985
50985
|
return options.extendEnv ? {
|
|
@@ -52484,10 +52484,10 @@ function makeReducer2(combiner2) {
|
|
|
52484
52484
|
}
|
|
52485
52485
|
|
|
52486
52486
|
// node_modules/.pnpm/effect@4.0.0-beta.100/node_modules/effect/dist/internal/errors.js
|
|
52487
|
-
function errorWithPath(message,
|
|
52488
|
-
if (
|
|
52487
|
+
function errorWithPath(message, path14) {
|
|
52488
|
+
if (path14.length > 0) {
|
|
52489
52489
|
message += `
|
|
52490
|
-
at ${formatPath(
|
|
52490
|
+
at ${formatPath(path14)}`;
|
|
52491
52491
|
}
|
|
52492
52492
|
return new Error(message);
|
|
52493
52493
|
}
|
|
@@ -52779,7 +52779,7 @@ function finiteNumberContext(ctx) {
|
|
|
52779
52779
|
constraint: finiteNumberConstraint
|
|
52780
52780
|
};
|
|
52781
52781
|
}
|
|
52782
|
-
function reportChecks(report, checks,
|
|
52782
|
+
function reportChecks(report, checks, path14) {
|
|
52783
52783
|
function visit(check3, covered) {
|
|
52784
52784
|
const arbitrary = check3.annotations?.arbitrary;
|
|
52785
52785
|
const nextCovered = covered || arbitrary?.constraint !== void 0 || arbitrary?.candidate !== void 0;
|
|
@@ -52792,7 +52792,7 @@ function reportChecks(report, checks, path12) {
|
|
|
52792
52792
|
const description = typeof meta === "object" && meta !== null && "_tag" in meta && typeof meta._tag === "string" ? meta._tag : check3.annotations?.identifier ?? check3.annotations?.expected;
|
|
52793
52793
|
report.warnings.push({
|
|
52794
52794
|
_tag: "OpaqueFilter",
|
|
52795
|
-
path:
|
|
52795
|
+
path: path14,
|
|
52796
52796
|
...description === void 0 ? {} : {
|
|
52797
52797
|
description
|
|
52798
52798
|
}
|
|
@@ -52803,37 +52803,37 @@ function reportChecks(report, checks, path12) {
|
|
|
52803
52803
|
}
|
|
52804
52804
|
function collectReport(ast, report) {
|
|
52805
52805
|
const stack = /* @__PURE__ */ new WeakSet();
|
|
52806
|
-
function visit(ast2,
|
|
52806
|
+
function visit(ast2, path14) {
|
|
52807
52807
|
if (stack.has(ast2)) {
|
|
52808
52808
|
return;
|
|
52809
52809
|
}
|
|
52810
52810
|
stack.add(ast2);
|
|
52811
|
-
reportChecks(report, ast2.checks,
|
|
52811
|
+
reportChecks(report, ast2.checks, path14);
|
|
52812
52812
|
switch (ast2._tag) {
|
|
52813
52813
|
case "Declaration":
|
|
52814
|
-
ast2.typeParameters.forEach((tp) => visit(tp,
|
|
52814
|
+
ast2.typeParameters.forEach((tp) => visit(tp, path14));
|
|
52815
52815
|
break;
|
|
52816
52816
|
case "Arrays": {
|
|
52817
52817
|
for (const [i, type] of [...ast2.elements, ...ast2.rest].entries()) {
|
|
52818
|
-
visit(type, [...
|
|
52818
|
+
visit(type, [...path14, i]);
|
|
52819
52819
|
}
|
|
52820
52820
|
break;
|
|
52821
52821
|
}
|
|
52822
52822
|
case "Objects":
|
|
52823
|
-
ast2.propertySignatures.forEach((ps) => visit(ps.type, [...
|
|
52823
|
+
ast2.propertySignatures.forEach((ps) => visit(ps.type, [...path14, ps.name]));
|
|
52824
52824
|
ast2.indexSignatures.forEach((is3) => {
|
|
52825
|
-
visit(is3.parameter,
|
|
52826
|
-
visit(is3.type,
|
|
52825
|
+
visit(is3.parameter, path14);
|
|
52826
|
+
visit(is3.type, path14);
|
|
52827
52827
|
});
|
|
52828
52828
|
break;
|
|
52829
52829
|
case "Union":
|
|
52830
|
-
ast2.types.forEach((type) => visit(type,
|
|
52830
|
+
ast2.types.forEach((type) => visit(type, path14));
|
|
52831
52831
|
break;
|
|
52832
52832
|
case "TemplateLiteral":
|
|
52833
|
-
ast2.parts.forEach((part, i) => visit(toEncoded(part), [...
|
|
52833
|
+
ast2.parts.forEach((part, i) => visit(toEncoded(part), [...path14, i]));
|
|
52834
52834
|
break;
|
|
52835
52835
|
case "Suspend":
|
|
52836
|
-
visit(ast2.thunk(),
|
|
52836
|
+
visit(ast2.thunk(), path14);
|
|
52837
52837
|
break;
|
|
52838
52838
|
}
|
|
52839
52839
|
stack.delete(ast2);
|
|
@@ -52900,26 +52900,26 @@ function filterLayer(ast, checks, normalBase, terminalBase) {
|
|
|
52900
52900
|
});
|
|
52901
52901
|
}
|
|
52902
52902
|
var memoized = /* @__PURE__ */ memoize((ast) => recur(ast, []));
|
|
52903
|
-
function recur(ast,
|
|
52903
|
+
function recur(ast, path14) {
|
|
52904
52904
|
const annotation = resolve(ast)?.toArbitrary;
|
|
52905
52905
|
if (annotation) {
|
|
52906
|
-
const typeParameters = isDeclaration(ast) ? ast.typeParameters.map((tp) => recur(tp,
|
|
52906
|
+
const typeParameters = isDeclaration(ast) ? ast.typeParameters.map((tp) => recur(tp, path14)) : [];
|
|
52907
52907
|
const checks = collectChecks(ast.checks);
|
|
52908
52908
|
const derive = (lazyNormal) => (fc, ctx, nextCtx, recursionStack) => normalizeDerivation(annotation(makeTypeParameters(typeParameters, fc, resetContext(ctx), recursionStack, lazyNormal))(fc, nextCtx), typeParameters.length > 0)[lazyNormal ? "terminal" : "arbitrary"];
|
|
52909
52909
|
return filterLayer(ast, checks, derive(false), derive(true));
|
|
52910
52910
|
}
|
|
52911
52911
|
if (ast.checks) {
|
|
52912
52912
|
const checks = collectChecks(ast.checks);
|
|
52913
|
-
const lawc = recur(replaceChecks(ast, void 0),
|
|
52913
|
+
const lawc = recur(replaceChecks(ast, void 0), path14);
|
|
52914
52914
|
return filterLayer(ast, checks, (fc, _ctx, nextCtx, recursionStack) => lawc(fc, nextCtx, recursionStack), (fc, _ctx, nextCtx, recursionStack) => lawc.terminal(fc, nextCtx, recursionStack));
|
|
52915
52915
|
}
|
|
52916
|
-
return base(ast,
|
|
52916
|
+
return base(ast, path14);
|
|
52917
52917
|
}
|
|
52918
|
-
function base(ast,
|
|
52918
|
+
function base(ast, path14) {
|
|
52919
52919
|
switch (ast._tag) {
|
|
52920
52920
|
case "Never":
|
|
52921
52921
|
case "Declaration":
|
|
52922
|
-
throw errorWithPath(`Unsupported AST ${ast._tag}`,
|
|
52922
|
+
throw errorWithPath(`Unsupported AST ${ast._tag}`, path14);
|
|
52923
52923
|
case "Null":
|
|
52924
52924
|
return same((fc) => fc.constant(null));
|
|
52925
52925
|
case "Void":
|
|
@@ -52956,20 +52956,20 @@ function base(ast, path12) {
|
|
|
52956
52956
|
case "ObjectKeyword":
|
|
52957
52957
|
return same((fc) => fc.oneof(fc.object(), fc.array(fc.anything())));
|
|
52958
52958
|
case "Enum":
|
|
52959
|
-
return recur(enumsToLiterals(ast),
|
|
52959
|
+
return recur(enumsToLiterals(ast), path14);
|
|
52960
52960
|
case "TemplateLiteral": {
|
|
52961
|
-
const parts = ast.parts.map((part, i) => recur(toEncoded(part), [...
|
|
52961
|
+
const parts = ast.parts.map((part, i) => recur(toEncoded(part), [...path14, i]));
|
|
52962
52962
|
return same((fc, ctx, recursionStack) => fc.tuple(...parts.map((part) => part(fc, finiteNumberContext(ctx), recursionStack))).map((segments) => segments.map((segment) => globalThis.String(segment)).join("")));
|
|
52963
52963
|
}
|
|
52964
52964
|
case "Arrays": {
|
|
52965
52965
|
const elements = ast.elements.map((ast2, i) => ({
|
|
52966
52966
|
ast: ast2,
|
|
52967
|
-
arbitrary: recur(ast2, [...
|
|
52967
|
+
arbitrary: recur(ast2, [...path14, i])
|
|
52968
52968
|
}));
|
|
52969
52969
|
const len = ast.elements.length;
|
|
52970
52970
|
const rest = ast.rest.map((ast2, i) => ({
|
|
52971
52971
|
ast: ast2,
|
|
52972
|
-
arbitrary: recur(ast2, [...
|
|
52972
|
+
arbitrary: recur(ast2, [...path14, len + i])
|
|
52973
52973
|
}));
|
|
52974
52974
|
const terminal = (fc, ctx, recursionStack) => {
|
|
52975
52975
|
const reset2 = resetContext(ctx);
|
|
@@ -53069,12 +53069,12 @@ function base(ast, path12) {
|
|
|
53069
53069
|
case "Objects": {
|
|
53070
53070
|
const propertySignatures = ast.propertySignatures.map((ps) => ({
|
|
53071
53071
|
ps,
|
|
53072
|
-
arbitrary: recur(ps.type, [...
|
|
53072
|
+
arbitrary: recur(ps.type, [...path14, ps.name])
|
|
53073
53073
|
}));
|
|
53074
53074
|
const indexSignatures = ast.indexSignatures.map((is3) => ({
|
|
53075
53075
|
is: is3,
|
|
53076
|
-
parameter: recur(is3.parameter,
|
|
53077
|
-
type: recur(is3.type,
|
|
53076
|
+
parameter: recur(is3.parameter, path14),
|
|
53077
|
+
type: recur(is3.type, path14)
|
|
53078
53078
|
}));
|
|
53079
53079
|
const terminal = (fc, ctx, recursionStack) => {
|
|
53080
53080
|
const reset2 = resetContext(ctx);
|
|
@@ -53177,7 +53177,7 @@ function base(ast, path12) {
|
|
|
53177
53177
|
}, terminal);
|
|
53178
53178
|
}
|
|
53179
53179
|
case "Union": {
|
|
53180
|
-
const types = ast.types.map((ast2) => recur(ast2,
|
|
53180
|
+
const types = ast.types.map((ast2) => recur(ast2, path14));
|
|
53181
53181
|
const terminal = (fc, ctx, recursionStack) => oneOf(fc, types.map((type) => type.terminal(fc, ctx, recursionStack)).filter(isNotUndefined));
|
|
53182
53182
|
return makeLazy((fc, ctx, recursionStack) => {
|
|
53183
53183
|
const arbitraries = types.map((type) => type(fc, ctx, recursionStack));
|
|
@@ -53197,7 +53197,7 @@ function base(ast, path12) {
|
|
|
53197
53197
|
case "Suspend": {
|
|
53198
53198
|
const memo2 = arbitraryMemoMap.get(ast);
|
|
53199
53199
|
if (memo2) return memo2;
|
|
53200
|
-
const get6 = memoizeThunk(() => recur(ast.thunk(),
|
|
53200
|
+
const get6 = memoizeThunk(() => recur(ast.thunk(), path14));
|
|
53201
53201
|
const out = makeLazy((fc, ctx, recursionStack) => {
|
|
53202
53202
|
const recursion = getSuspendRecursion(fc, ast);
|
|
53203
53203
|
const nextCtx = {
|
|
@@ -53207,7 +53207,7 @@ function base(ast, path12) {
|
|
|
53207
53207
|
const nextStack = recursionStack.includes(ast) ? recursionStack : [...recursionStack, ast];
|
|
53208
53208
|
const terminal = get6().terminal(fc, nextCtx, nextStack);
|
|
53209
53209
|
if (terminal === void 0) {
|
|
53210
|
-
throw errorWithPath("Unable to derive an arbitrary for a recursive schema without a finite generation path",
|
|
53210
|
+
throw errorWithPath("Unable to derive an arbitrary for a recursive schema without a finite generation path", path14);
|
|
53211
53211
|
}
|
|
53212
53212
|
return fc.oneof(recursion, terminal, fc.constant(null).chain(() => get6()(fc, nextCtx, nextStack)));
|
|
53213
53213
|
}, (fc, ctx, recursionStack) => {
|
|
@@ -53506,14 +53506,14 @@ var recur2 = /* @__PURE__ */ memoize((ast) => {
|
|
|
53506
53506
|
var toEquivalence = /* @__PURE__ */ memoize((ast) => {
|
|
53507
53507
|
return recur3(ast, []);
|
|
53508
53508
|
});
|
|
53509
|
-
function recur3(ast,
|
|
53509
|
+
function recur3(ast, path14) {
|
|
53510
53510
|
const annotation = resolve(ast)?.["toEquivalence"];
|
|
53511
53511
|
if (annotation) {
|
|
53512
|
-
return annotation(isDeclaration(ast) ? ast.typeParameters.map((tp) => recur3(tp,
|
|
53512
|
+
return annotation(isDeclaration(ast) ? ast.typeParameters.map((tp) => recur3(tp, path14)) : []);
|
|
53513
53513
|
}
|
|
53514
53514
|
switch (ast._tag) {
|
|
53515
53515
|
case "Never":
|
|
53516
|
-
throw errorWithPath(`Unsupported AST ${ast._tag}`,
|
|
53516
|
+
throw errorWithPath(`Unsupported AST ${ast._tag}`, path14);
|
|
53517
53517
|
case "Declaration":
|
|
53518
53518
|
case "Null":
|
|
53519
53519
|
case "Undefined":
|
|
@@ -53532,9 +53532,9 @@ function recur3(ast, path12) {
|
|
|
53532
53532
|
case "TemplateLiteral":
|
|
53533
53533
|
return equals;
|
|
53534
53534
|
case "Arrays": {
|
|
53535
|
-
const elements = ast.elements.map((e, i) => recur3(e, [...
|
|
53535
|
+
const elements = ast.elements.map((e, i) => recur3(e, [...path14, i]));
|
|
53536
53536
|
const len = ast.elements.length;
|
|
53537
|
-
const rest = ast.rest.map((r, i) => recur3(r, [...
|
|
53537
|
+
const rest = ast.rest.map((r, i) => recur3(r, [...path14, len + i]));
|
|
53538
53538
|
return make2((a, b) => {
|
|
53539
53539
|
if (!Array.isArray(a) || !Array.isArray(b)) {
|
|
53540
53540
|
return false;
|
|
@@ -53569,8 +53569,8 @@ function recur3(ast, path12) {
|
|
|
53569
53569
|
if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) {
|
|
53570
53570
|
return equals;
|
|
53571
53571
|
}
|
|
53572
|
-
const propertySignatures = ast.propertySignatures.map((ps) => recur3(ps.type, [...
|
|
53573
|
-
const indexSignatures = ast.indexSignatures.map((is3) => recur3(is3.type,
|
|
53572
|
+
const propertySignatures = ast.propertySignatures.map((ps) => recur3(ps.type, [...path14, ps.name]));
|
|
53573
|
+
const indexSignatures = ast.indexSignatures.map((is3) => recur3(is3.type, path14));
|
|
53574
53574
|
return make2((a, b) => {
|
|
53575
53575
|
if (!isObject(a) || !isObject(b)) {
|
|
53576
53576
|
return false;
|
|
@@ -53611,13 +53611,13 @@ function recur3(ast, path12) {
|
|
|
53611
53611
|
for (let i = 0; i < candidates.length; i++) {
|
|
53612
53612
|
const is3 = types[i];
|
|
53613
53613
|
if (is3(a) && is3(b)) {
|
|
53614
|
-
return recur3(candidates[i],
|
|
53614
|
+
return recur3(candidates[i], path14)(a, b);
|
|
53615
53615
|
}
|
|
53616
53616
|
}
|
|
53617
53617
|
return false;
|
|
53618
53618
|
});
|
|
53619
53619
|
case "Suspend": {
|
|
53620
|
-
const get6 = memoizeThunk(() => recur3(ast.thunk(),
|
|
53620
|
+
const get6 = memoizeThunk(() => recur3(ast.thunk(), path14));
|
|
53621
53621
|
return make2((a, b) => get6()(a, b));
|
|
53622
53622
|
}
|
|
53623
53623
|
}
|
|
@@ -54559,10 +54559,10 @@ function get5(oldValue, newValue) {
|
|
|
54559
54559
|
const len2 = newValue.length;
|
|
54560
54560
|
const shared = Math.min(len1, len2);
|
|
54561
54561
|
for (let i = 0; i < shared; i++) {
|
|
54562
|
-
const
|
|
54562
|
+
const path14 = `/${i}`;
|
|
54563
54563
|
const patch = get5(oldValue[i], newValue[i]);
|
|
54564
54564
|
for (const op of patch) {
|
|
54565
|
-
prefixPathInPlace(op,
|
|
54565
|
+
prefixPathInPlace(op, path14);
|
|
54566
54566
|
patches.push(op);
|
|
54567
54567
|
}
|
|
54568
54568
|
}
|
|
@@ -54587,25 +54587,25 @@ function get5(oldValue, newValue) {
|
|
|
54587
54587
|
const allKeys = Array.from(/* @__PURE__ */ new Set([...keys1, ...keys22])).sort();
|
|
54588
54588
|
for (const key of allKeys) {
|
|
54589
54589
|
const esc = escapeToken(key);
|
|
54590
|
-
const
|
|
54590
|
+
const path14 = `/${esc}`;
|
|
54591
54591
|
const hasKey1 = Object.hasOwn(oldValue, key);
|
|
54592
54592
|
const hasKey2 = Object.hasOwn(newValue, key);
|
|
54593
54593
|
if (hasKey1 && hasKey2) {
|
|
54594
54594
|
const patch = get5(oldValue[key], newValue[key]);
|
|
54595
54595
|
for (const op of patch) {
|
|
54596
|
-
prefixPathInPlace(op,
|
|
54596
|
+
prefixPathInPlace(op, path14);
|
|
54597
54597
|
patches.push(op);
|
|
54598
54598
|
}
|
|
54599
54599
|
} else if (!hasKey1 && hasKey2) {
|
|
54600
54600
|
patches.push({
|
|
54601
54601
|
op: "add",
|
|
54602
|
-
path:
|
|
54602
|
+
path: path14,
|
|
54603
54603
|
value: newValue[key]
|
|
54604
54604
|
});
|
|
54605
54605
|
} else if (hasKey1 && !hasKey2) {
|
|
54606
54606
|
patches.push({
|
|
54607
54607
|
op: "remove",
|
|
54608
|
-
path:
|
|
54608
|
+
path: path14
|
|
54609
54609
|
});
|
|
54610
54610
|
}
|
|
54611
54611
|
}
|
|
@@ -54951,8 +54951,8 @@ var OptionalNode = class {
|
|
|
54951
54951
|
var PathNode = class {
|
|
54952
54952
|
_tag = "PathNode";
|
|
54953
54953
|
path;
|
|
54954
|
-
constructor(
|
|
54955
|
-
this.path =
|
|
54954
|
+
constructor(path14) {
|
|
54955
|
+
this.path = path14;
|
|
54956
54956
|
}
|
|
54957
54957
|
};
|
|
54958
54958
|
var CheckNode = class {
|
|
@@ -55198,24 +55198,24 @@ var recur4 = /* @__PURE__ */ memoize((node) => {
|
|
|
55198
55198
|
return {
|
|
55199
55199
|
_tag: "LensNode",
|
|
55200
55200
|
get: (s) => {
|
|
55201
|
-
const
|
|
55201
|
+
const path14 = node.path;
|
|
55202
55202
|
let out = s;
|
|
55203
|
-
for (let i = 0, n =
|
|
55204
|
-
out = out[
|
|
55203
|
+
for (let i = 0, n = path14.length; i < n; i++) {
|
|
55204
|
+
out = out[path14[i]];
|
|
55205
55205
|
}
|
|
55206
55206
|
return out;
|
|
55207
55207
|
},
|
|
55208
55208
|
set: (a, s) => {
|
|
55209
|
-
const
|
|
55209
|
+
const path14 = node.path;
|
|
55210
55210
|
const out = cloneShallow(s);
|
|
55211
55211
|
let current = out;
|
|
55212
55212
|
let i = 0;
|
|
55213
|
-
for (; i <
|
|
55214
|
-
const key =
|
|
55213
|
+
for (; i < path14.length - 1; i++) {
|
|
55214
|
+
const key = path14[i];
|
|
55215
55215
|
current[key] = cloneShallow(current[key]);
|
|
55216
55216
|
current = current[key];
|
|
55217
55217
|
}
|
|
55218
|
-
const finalKey =
|
|
55218
|
+
const finalKey = path14[i];
|
|
55219
55219
|
current[finalKey] = a;
|
|
55220
55220
|
return out;
|
|
55221
55221
|
}
|
|
@@ -57542,10 +57542,10 @@ var RunExecution = class RunExecution2 {
|
|
|
57542
57542
|
}
|
|
57543
57543
|
return failures;
|
|
57544
57544
|
}
|
|
57545
|
-
static mergePaths(offsetPath,
|
|
57546
|
-
if (offsetPath.length === 0) return
|
|
57545
|
+
static mergePaths(offsetPath, path14) {
|
|
57546
|
+
if (offsetPath.length === 0) return path14;
|
|
57547
57547
|
const offsetItems = offsetPath.split(":");
|
|
57548
|
-
const remainingItems =
|
|
57548
|
+
const remainingItems = path14.split(":");
|
|
57549
57549
|
const middle = +offsetItems[offsetItems.length - 1] + +remainingItems[0];
|
|
57550
57550
|
return [
|
|
57551
57551
|
...offsetItems.slice(0, offsetItems.length - 1),
|
|
@@ -57732,15 +57732,15 @@ function* lazyToss(generator, seed, random2, examples) {
|
|
|
57732
57732
|
function produce(producer) {
|
|
57733
57733
|
return producer();
|
|
57734
57734
|
}
|
|
57735
|
-
function pathWalk(
|
|
57735
|
+
function pathWalk(path14, initialProducers, shrink) {
|
|
57736
57736
|
const producers = initialProducers;
|
|
57737
|
-
const segments =
|
|
57737
|
+
const segments = path14.split(":").map((text2) => +text2);
|
|
57738
57738
|
if (segments.length === 0) return producers.map(produce);
|
|
57739
|
-
if (!segments.every((v) => !Number.isNaN(v))) throw new Error(`Unable to replay, got invalid path=${
|
|
57739
|
+
if (!segments.every((v) => !Number.isNaN(v))) throw new Error(`Unable to replay, got invalid path=${path14}`);
|
|
57740
57740
|
let values2 = producers.drop(segments[0]).map(produce);
|
|
57741
57741
|
for (const s of segments.slice(1)) {
|
|
57742
57742
|
const valueToShrink = values2.getNthOrLast(0);
|
|
57743
|
-
if (valueToShrink === null) throw new Error(`Unable to replay, got wrong path=${
|
|
57743
|
+
if (valueToShrink === null) throw new Error(`Unable to replay, got wrong path=${path14}`);
|
|
57744
57744
|
values2 = shrink(valueToShrink).drop(s);
|
|
57745
57745
|
}
|
|
57746
57746
|
return values2;
|
|
@@ -63046,9 +63046,9 @@ function webSegment(constraints = {}) {
|
|
|
63046
63046
|
});
|
|
63047
63047
|
}
|
|
63048
63048
|
function segmentsToPathMapper(segments) {
|
|
63049
|
-
let
|
|
63050
|
-
for (let index2 = 0; index2 !== segments.length; ++index2)
|
|
63051
|
-
return
|
|
63049
|
+
let path14 = "";
|
|
63050
|
+
for (let index2 = 0; index2 !== segments.length; ++index2) path14 += "/" + segments[index2];
|
|
63051
|
+
return path14;
|
|
63052
63052
|
}
|
|
63053
63053
|
function segmentsToPathUnmapper(value3) {
|
|
63054
63054
|
if (typeof value3 !== "string") throw new Error("Incompatible value received: type");
|
|
@@ -63084,8 +63084,8 @@ function webQueryParameters(constraints = {}) {
|
|
|
63084
63084
|
return buildUriQueryOrFragmentArbitrary(constraints.size);
|
|
63085
63085
|
}
|
|
63086
63086
|
function partsToUrlMapper(data) {
|
|
63087
|
-
const [scheme, authority,
|
|
63088
|
-
return `${scheme}://${authority}${
|
|
63087
|
+
const [scheme, authority, path14] = data;
|
|
63088
|
+
return `${scheme}://${authority}${path14}${data[3] === null ? "" : `?${data[3]}`}${data[4] === null ? "" : `#${data[4]}`}`;
|
|
63089
63089
|
}
|
|
63090
63090
|
var UrlSplitRegex = /^([[A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)([^?#]*)(\?[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?(#[A-Za-z0-9\-._~!$&'()*+,;=:@/?%]*)?$/;
|
|
63091
63091
|
function partsToUrlUnmapper(value3) {
|
|
@@ -63094,13 +63094,13 @@ function partsToUrlUnmapper(value3) {
|
|
|
63094
63094
|
if (m === null) throw new Error("Incompatible value received");
|
|
63095
63095
|
const scheme = m[1];
|
|
63096
63096
|
const authority = m[2];
|
|
63097
|
-
const
|
|
63097
|
+
const path14 = m[3];
|
|
63098
63098
|
const query = m[4];
|
|
63099
63099
|
const fragments = m[5];
|
|
63100
63100
|
return [
|
|
63101
63101
|
scheme,
|
|
63102
63102
|
authority,
|
|
63103
|
-
|
|
63103
|
+
path14,
|
|
63104
63104
|
query !== void 0 ? query.substring(1) : null,
|
|
63105
63105
|
fragments !== void 0 ? fragments.substring(1) : null
|
|
63106
63106
|
];
|
|
@@ -64816,9 +64816,9 @@ function pushTokens(tokens, regexSource, unicodeMode, groups) {
|
|
|
64816
64816
|
tokens.push(currentDisjunction);
|
|
64817
64817
|
}
|
|
64818
64818
|
}
|
|
64819
|
-
function tokenizeRegex(
|
|
64820
|
-
const unicodeMode = safeIndexOf([...
|
|
64821
|
-
const regexSource =
|
|
64819
|
+
function tokenizeRegex(regex2) {
|
|
64820
|
+
const unicodeMode = safeIndexOf([...regex2.flags], "u") !== -1;
|
|
64821
|
+
const regexSource = regex2.source;
|
|
64822
64822
|
const tokens = [];
|
|
64823
64823
|
pushTokens(tokens, regexSource, unicodeMode, {
|
|
64824
64824
|
lastIndex: 0,
|
|
@@ -64831,9 +64831,9 @@ function getPropertySpec(astNode) {
|
|
|
64831
64831
|
if (astNode.binary || astNode.shorthand) return astNode.canonicalValue;
|
|
64832
64832
|
return `${astNode.canonicalName}=${astNode.canonicalValue}`;
|
|
64833
64833
|
}
|
|
64834
|
-
function appendRangesForRegex(
|
|
64834
|
+
function appendRangesForRegex(regex2, from, to, ranges) {
|
|
64835
64835
|
let currentRangeStart = -1;
|
|
64836
|
-
for (let cp2 = from; cp2 <= to; ++cp2) if (
|
|
64836
|
+
for (let cp2 = from; cp2 <= to; ++cp2) if (regex2.test(safeStringFromCodePoint$1(cp2))) {
|
|
64837
64837
|
if (currentRangeStart === -1) currentRangeStart = cp2;
|
|
64838
64838
|
} else if (currentRangeStart !== -1) {
|
|
64839
64839
|
const rangeEnd = cp2 - 1;
|
|
@@ -64843,10 +64843,10 @@ function appendRangesForRegex(regex, from, to, ranges) {
|
|
|
64843
64843
|
if (currentRangeStart !== -1) ranges.push(currentRangeStart === to ? [to] : [currentRangeStart, to]);
|
|
64844
64844
|
}
|
|
64845
64845
|
function extractRangesForProperty(propertySpec, negative) {
|
|
64846
|
-
const
|
|
64846
|
+
const regex2 = new RegExp(`^\\${negative ? "P" : "p"}{${propertySpec}}$`, "u");
|
|
64847
64847
|
const ranges = [];
|
|
64848
|
-
appendRangesForRegex(
|
|
64849
|
-
appendRangesForRegex(
|
|
64848
|
+
appendRangesForRegex(regex2, 0, 55295, ranges);
|
|
64849
|
+
appendRangesForRegex(regex2, 57344, 1114111, ranges);
|
|
64850
64850
|
return ranges;
|
|
64851
64851
|
}
|
|
64852
64852
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -65011,18 +65011,18 @@ function toMatchingArbitrary(astNode, constraints, flags) {
|
|
|
65011
65011
|
throw raiseUnsupportedASTNode(astNode);
|
|
65012
65012
|
}
|
|
65013
65013
|
}
|
|
65014
|
-
function stringMatching(
|
|
65015
|
-
for (const flag of
|
|
65014
|
+
function stringMatching(regex2, constraints = {}) {
|
|
65015
|
+
for (const flag of regex2.flags) if (flag !== "d" && flag !== "g" && flag !== "m" && flag !== "s" && flag !== "u") throw new SError(`Unable to use "stringMatching" against a regex using the flag ${flag}`);
|
|
65016
65016
|
const maxLength = constraints.maxLength;
|
|
65017
65017
|
const sanitizedConstraints = {
|
|
65018
65018
|
size: constraints.size,
|
|
65019
65019
|
maxLength
|
|
65020
65020
|
};
|
|
65021
65021
|
const flags = {
|
|
65022
|
-
multiline:
|
|
65023
|
-
dotAll:
|
|
65022
|
+
multiline: regex2.multiline,
|
|
65023
|
+
dotAll: regex2.dotAll
|
|
65024
65024
|
};
|
|
65025
|
-
let regexRootToken = addMissingDotStar(tokenizeRegex(
|
|
65025
|
+
let regexRootToken = addMissingDotStar(tokenizeRegex(regex2));
|
|
65026
65026
|
if (maxLength !== void 0) regexRootToken = clampRegexAst(regexRootToken, maxLength);
|
|
65027
65027
|
const baseArbitrary = toMatchingArbitrary(regexRootToken, sanitizedConstraints, flags);
|
|
65028
65028
|
if (maxLength !== void 0) return baseArbitrary.filter((s) => [...s].length <= maxLength);
|
|
@@ -68460,7 +68460,7 @@ var Proto6 = {
|
|
|
68460
68460
|
};
|
|
68461
68461
|
}
|
|
68462
68462
|
};
|
|
68463
|
-
var identityPath = (
|
|
68463
|
+
var identityPath = (path14) => path14;
|
|
68464
68464
|
function makeProvider(state, load) {
|
|
68465
68465
|
const self = Object.create(Proto6);
|
|
68466
68466
|
self.state = state;
|
|
@@ -68473,7 +68473,7 @@ function makeSource(get6, transform4) {
|
|
|
68473
68473
|
get: get6,
|
|
68474
68474
|
transform: transform4
|
|
68475
68475
|
};
|
|
68476
|
-
return makeProvider(state, (
|
|
68476
|
+
return makeProvider(state, (path14) => state.get(state.transform(path14)));
|
|
68477
68477
|
}
|
|
68478
68478
|
function make31(get6) {
|
|
68479
68479
|
return makeSource(get6, identityPath);
|
|
@@ -68488,7 +68488,7 @@ function fromEnv(options) {
|
|
|
68488
68488
|
};
|
|
68489
68489
|
const preserveEmptyStrings = options?.preserveEmptyStrings === true;
|
|
68490
68490
|
const trie = buildEnvTrie(env);
|
|
68491
|
-
return make31((
|
|
68491
|
+
return make31((path14) => succeed6(nodeAtEnv(trie, env, path14, preserveEmptyStrings)));
|
|
68492
68492
|
}
|
|
68493
68493
|
function buildEnvTrie(env) {
|
|
68494
68494
|
const trie = {};
|
|
@@ -68504,10 +68504,10 @@ function buildEnvTrie(env) {
|
|
|
68504
68504
|
return trie;
|
|
68505
68505
|
}
|
|
68506
68506
|
var NUMERIC_INDEX = /^(0|[1-9][0-9]*)$/;
|
|
68507
|
-
function nodeAtEnv(trie, env,
|
|
68508
|
-
const key =
|
|
68507
|
+
function nodeAtEnv(trie, env, path14, preserveEmptyStrings) {
|
|
68508
|
+
const key = path14.map(String).join("_");
|
|
68509
68509
|
const leafValue = emptyStringAsMissing(env[key], preserveEmptyStrings);
|
|
68510
|
-
const trieNode = trieNodeAt(trie,
|
|
68510
|
+
const trieNode = trieNodeAt(trie, path14);
|
|
68511
68511
|
const children = trieNode?.children ? Object.keys(trieNode.children) : [];
|
|
68512
68512
|
if (children.length === 0) {
|
|
68513
68513
|
return leafValue === void 0 ? void 0 : makeValue(leafValue);
|
|
@@ -68519,10 +68519,10 @@ function nodeAtEnv(trie, env, path12, preserveEmptyStrings) {
|
|
|
68519
68519
|
}
|
|
68520
68520
|
return makeRecord(new Set(children), leafValue);
|
|
68521
68521
|
}
|
|
68522
|
-
function trieNodeAt(root,
|
|
68523
|
-
if (
|
|
68522
|
+
function trieNodeAt(root, path14) {
|
|
68523
|
+
if (path14.length === 0) return root;
|
|
68524
68524
|
let node = root;
|
|
68525
|
-
for (const seg of
|
|
68525
|
+
for (const seg of path14) {
|
|
68526
68526
|
node = node?.children?.[String(seg)];
|
|
68527
68527
|
if (!node) return void 0;
|
|
68528
68528
|
}
|
|
@@ -68633,7 +68633,7 @@ var handleBadArgument = (method) => (err) => badArgument({
|
|
|
68633
68633
|
});
|
|
68634
68634
|
var access2 = /* @__PURE__ */ (() => {
|
|
68635
68635
|
const nodeAccess = /* @__PURE__ */ effectify(NFS.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
68636
|
-
return (
|
|
68636
|
+
return (path14, options) => {
|
|
68637
68637
|
let mode = NFS.constants.F_OK;
|
|
68638
68638
|
if (options?.readable) {
|
|
68639
68639
|
mode |= NFS.constants.R_OK;
|
|
@@ -68641,7 +68641,7 @@ var access2 = /* @__PURE__ */ (() => {
|
|
|
68641
68641
|
if (options?.writable) {
|
|
68642
68642
|
mode |= NFS.constants.W_OK;
|
|
68643
68643
|
}
|
|
68644
|
-
return nodeAccess(
|
|
68644
|
+
return nodeAccess(path14, mode);
|
|
68645
68645
|
};
|
|
68646
68646
|
})();
|
|
68647
68647
|
var copy2 = /* @__PURE__ */ (() => {
|
|
@@ -68658,11 +68658,11 @@ var copyFile2 = /* @__PURE__ */ (() => {
|
|
|
68658
68658
|
})();
|
|
68659
68659
|
var chmod2 = /* @__PURE__ */ (() => {
|
|
68660
68660
|
const nodeChmod = /* @__PURE__ */ effectify(NFS.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
|
|
68661
|
-
return (
|
|
68661
|
+
return (path14, mode) => nodeChmod(path14, mode);
|
|
68662
68662
|
})();
|
|
68663
68663
|
var chown2 = /* @__PURE__ */ (() => {
|
|
68664
68664
|
const nodeChown = /* @__PURE__ */ effectify(NFS.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
|
|
68665
|
-
return (
|
|
68665
|
+
return (path14, uid, gid) => nodeChown(path14, uid, gid);
|
|
68666
68666
|
})();
|
|
68667
68667
|
var glob2 = /* @__PURE__ */ (() => {
|
|
68668
68668
|
const nodeGlob = /* @__PURE__ */ effectify(NFS.glob, /* @__PURE__ */ handleErrnoException("FileSystem", "glob"), /* @__PURE__ */ handleBadArgument("glob"));
|
|
@@ -68677,7 +68677,7 @@ var link3 = /* @__PURE__ */ (() => {
|
|
|
68677
68677
|
})();
|
|
68678
68678
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
68679
68679
|
const nodeMkdir = /* @__PURE__ */ effectify(NFS.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
68680
|
-
return (
|
|
68680
|
+
return (path14, options) => nodeMkdir(path14, {
|
|
68681
68681
|
recursive: options?.recursive ?? false,
|
|
68682
68682
|
mode: options?.mode
|
|
68683
68683
|
});
|
|
@@ -68693,7 +68693,7 @@ var makeTempDirectoryFactory = (method) => {
|
|
|
68693
68693
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
68694
68694
|
var removeFactory = (method) => {
|
|
68695
68695
|
const nodeRm = effectify(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
68696
|
-
return (
|
|
68696
|
+
return (path14, options) => nodeRm(path14, {
|
|
68697
68697
|
recursive: options?.recursive ?? false,
|
|
68698
68698
|
force: options?.force ?? false
|
|
68699
68699
|
});
|
|
@@ -68709,7 +68709,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
68709
68709
|
var openFactory = (method) => {
|
|
68710
68710
|
const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
68711
68711
|
const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
68712
|
-
return (
|
|
68712
|
+
return (path14, options) => pipe(acquireRelease2(nodeOpen(path14, options?.flag ?? "r", options?.mode), (fd) => orDie3(nodeClose(fd))), map7((fd) => makeFile(FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
|
|
68713
68713
|
};
|
|
68714
68714
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
68715
68715
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -68850,17 +68850,17 @@ var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
|
68850
68850
|
recursive: true
|
|
68851
68851
|
})));
|
|
68852
68852
|
})();
|
|
68853
|
-
var readDirectory = (
|
|
68854
|
-
try: () => NFS.promises.readdir(
|
|
68855
|
-
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [
|
|
68853
|
+
var readDirectory = (path14, options) => tryPromise2({
|
|
68854
|
+
try: () => NFS.promises.readdir(path14, options),
|
|
68855
|
+
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path14])
|
|
68856
68856
|
});
|
|
68857
|
-
var readFile2 = (
|
|
68857
|
+
var readFile2 = (path14) => callback2((resume, signal) => {
|
|
68858
68858
|
try {
|
|
68859
|
-
NFS.readFile(
|
|
68859
|
+
NFS.readFile(path14, {
|
|
68860
68860
|
signal
|
|
68861
68861
|
}, (err, data) => {
|
|
68862
68862
|
if (err) {
|
|
68863
|
-
resume(fail6(handleErrnoException("FileSystem", "readFile")(err, [
|
|
68863
|
+
resume(fail6(handleErrnoException("FileSystem", "readFile")(err, [path14])));
|
|
68864
68864
|
} else {
|
|
68865
68865
|
resume(succeed6(data));
|
|
68866
68866
|
}
|
|
@@ -68871,11 +68871,11 @@ var readFile2 = (path12) => callback2((resume, signal) => {
|
|
|
68871
68871
|
});
|
|
68872
68872
|
var readLink = /* @__PURE__ */ (() => {
|
|
68873
68873
|
const nodeReadLink = /* @__PURE__ */ effectify(NFS.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
|
|
68874
|
-
return (
|
|
68874
|
+
return (path14) => nodeReadLink(path14);
|
|
68875
68875
|
})();
|
|
68876
68876
|
var realPath = /* @__PURE__ */ (() => {
|
|
68877
68877
|
const nodeRealPath = /* @__PURE__ */ effectify(NFS.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
|
|
68878
|
-
return (
|
|
68878
|
+
return (path14) => nodeRealPath(path14);
|
|
68879
68879
|
})();
|
|
68880
68880
|
var rename2 = /* @__PURE__ */ (() => {
|
|
68881
68881
|
const nodeRename = /* @__PURE__ */ effectify(NFS.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
|
|
@@ -68899,35 +68899,35 @@ var makeFileInfo = (stat3) => ({
|
|
|
68899
68899
|
});
|
|
68900
68900
|
var stat2 = /* @__PURE__ */ (() => {
|
|
68901
68901
|
const nodeStat = /* @__PURE__ */ effectify(NFS.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
68902
|
-
return (
|
|
68902
|
+
return (path14) => map7(nodeStat(path14), makeFileInfo);
|
|
68903
68903
|
})();
|
|
68904
68904
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
68905
68905
|
const nodeSymlink = /* @__PURE__ */ effectify(NFS.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
68906
|
-
return (target,
|
|
68906
|
+
return (target, path14) => nodeSymlink(target, path14);
|
|
68907
68907
|
})();
|
|
68908
68908
|
var truncate3 = /* @__PURE__ */ (() => {
|
|
68909
68909
|
const nodeTruncate = /* @__PURE__ */ effectify(NFS.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
68910
|
-
return (
|
|
68910
|
+
return (path14, length) => nodeTruncate(path14, length !== void 0 ? Number(length) : void 0);
|
|
68911
68911
|
})();
|
|
68912
68912
|
var utimes2 = /* @__PURE__ */ (() => {
|
|
68913
68913
|
const nodeUtimes = /* @__PURE__ */ effectify(NFS.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
68914
|
-
return (
|
|
68914
|
+
return (path14, atime, mtime) => nodeUtimes(path14, atime, mtime);
|
|
68915
68915
|
})();
|
|
68916
|
-
var watchNode = (
|
|
68917
|
-
const watcher = NFS.watch(
|
|
68916
|
+
var watchNode = (path14) => callback3((queue) => acquireRelease2(sync3(() => {
|
|
68917
|
+
const watcher = NFS.watch(path14, {
|
|
68918
68918
|
recursive: true
|
|
68919
|
-
}, (event,
|
|
68920
|
-
if (!
|
|
68919
|
+
}, (event, path15) => {
|
|
68920
|
+
if (!path15) return;
|
|
68921
68921
|
switch (event) {
|
|
68922
68922
|
case "rename": {
|
|
68923
|
-
runFork2(matchEffect3(stat2(
|
|
68923
|
+
runFork2(matchEffect3(stat2(path15), {
|
|
68924
68924
|
onSuccess: (_) => offer(queue, {
|
|
68925
68925
|
_tag: "Create",
|
|
68926
|
-
path:
|
|
68926
|
+
path: path15
|
|
68927
68927
|
}),
|
|
68928
68928
|
onFailure: (_) => offer(queue, {
|
|
68929
68929
|
_tag: "Remove",
|
|
68930
|
-
path:
|
|
68930
|
+
path: path15
|
|
68931
68931
|
})
|
|
68932
68932
|
}));
|
|
68933
68933
|
return;
|
|
@@ -68935,7 +68935,7 @@ var watchNode = (path12) => callback3((queue) => acquireRelease2(sync3(() => {
|
|
|
68935
68935
|
case "change": {
|
|
68936
68936
|
offerUnsafe(queue, {
|
|
68937
68937
|
_tag: "Update",
|
|
68938
|
-
path:
|
|
68938
|
+
path: path15
|
|
68939
68939
|
});
|
|
68940
68940
|
return;
|
|
68941
68941
|
}
|
|
@@ -68946,7 +68946,7 @@ var watchNode = (path12) => callback3((queue) => acquireRelease2(sync3(() => {
|
|
|
68946
68946
|
module: "FileSystem",
|
|
68947
68947
|
_tag: "Unknown",
|
|
68948
68948
|
method: "watch",
|
|
68949
|
-
pathOrDescriptor:
|
|
68949
|
+
pathOrDescriptor: path14,
|
|
68950
68950
|
cause: error2
|
|
68951
68951
|
})));
|
|
68952
68952
|
});
|
|
@@ -68955,16 +68955,16 @@ var watchNode = (path12) => callback3((queue) => acquireRelease2(sync3(() => {
|
|
|
68955
68955
|
});
|
|
68956
68956
|
return watcher;
|
|
68957
68957
|
}), (watcher) => sync3(() => watcher.close())));
|
|
68958
|
-
var watch2 = (backend,
|
|
68959
|
-
var writeFile2 = (
|
|
68958
|
+
var watch2 = (backend, path14) => stat2(path14).pipe(map7((stat3) => backend.pipe(flatMap((_) => _.register(path14, stat3)), getOrElse(() => watchNode(path14)))), unwrap4);
|
|
68959
|
+
var writeFile2 = (path14, data, options) => callback2((resume, signal) => {
|
|
68960
68960
|
try {
|
|
68961
|
-
NFS.writeFile(
|
|
68961
|
+
NFS.writeFile(path14, data, {
|
|
68962
68962
|
signal,
|
|
68963
68963
|
flag: options?.flag,
|
|
68964
68964
|
mode: options?.mode
|
|
68965
68965
|
}, (err) => {
|
|
68966
68966
|
if (err) {
|
|
68967
|
-
resume(fail6(handleErrnoException("FileSystem", "writeFile")(err, [
|
|
68967
|
+
resume(fail6(handleErrnoException("FileSystem", "writeFile")(err, [path14])));
|
|
68968
68968
|
} else {
|
|
68969
68969
|
resume(void_5);
|
|
68970
68970
|
}
|
|
@@ -68997,8 +68997,8 @@ var makeFileSystem = /* @__PURE__ */ map7(/* @__PURE__ */ serviceOption2(WatchBa
|
|
|
68997
68997
|
symlink: symlink2,
|
|
68998
68998
|
truncate: truncate3,
|
|
68999
68999
|
utimes: utimes2,
|
|
69000
|
-
watch(
|
|
69001
|
-
return watch2(backend,
|
|
69000
|
+
watch(path14) {
|
|
69001
|
+
return watch2(backend, path14);
|
|
69002
69002
|
},
|
|
69003
69003
|
writeFile: writeFile2
|
|
69004
69004
|
}));
|
|
@@ -69139,8 +69139,8 @@ var fromFileUrl2 = (url) => try_3({
|
|
|
69139
69139
|
cause
|
|
69140
69140
|
})
|
|
69141
69141
|
});
|
|
69142
|
-
var toFileUrl2 = (
|
|
69143
|
-
try: () => NodeUrl.pathToFileURL(
|
|
69142
|
+
var toFileUrl2 = (path14) => try_3({
|
|
69143
|
+
try: () => NodeUrl.pathToFileURL(path14),
|
|
69144
69144
|
catch: (cause) => new BadArgument({
|
|
69145
69145
|
module: "Path",
|
|
69146
69146
|
method: "toFileUrl",
|
|
@@ -69728,8 +69728,8 @@ var choice = (choices) => {
|
|
|
69728
69728
|
};
|
|
69729
69729
|
var path = (pathType, mustExist) => makePrimitive2("Path", fnUntraced2(function* (value3) {
|
|
69730
69730
|
const fs4 = yield* FileSystem;
|
|
69731
|
-
const
|
|
69732
|
-
const absolutePath =
|
|
69731
|
+
const path14 = yield* Path;
|
|
69732
|
+
const absolutePath = path14.isAbsolute(value3) ? value3 : path14.resolve(value3);
|
|
69733
69733
|
const exists2 = yield* mapError3(fs4.exists(absolutePath), (error2) => `Failed to check path existence: ${error2.message}`);
|
|
69734
69734
|
if (mustExist === true && !exists2) {
|
|
69735
69735
|
return yield* fail6(`Path does not exist: ${absolutePath}`);
|
|
@@ -69748,8 +69748,8 @@ var path = (pathType, mustExist) => makePrimitive2("Path", fnUntraced2(function*
|
|
|
69748
69748
|
var redacted = /* @__PURE__ */ makePrimitive2("Redacted", (value3) => succeed6(make9(value3)));
|
|
69749
69749
|
var fileText = /* @__PURE__ */ makePrimitive2("FileText", /* @__PURE__ */ fnUntraced2(function* (filePath) {
|
|
69750
69750
|
const fs4 = yield* FileSystem;
|
|
69751
|
-
const
|
|
69752
|
-
const absolutePath =
|
|
69751
|
+
const path14 = yield* Path;
|
|
69752
|
+
const absolutePath = path14.isAbsolute(filePath) ? filePath : path14.resolve(filePath);
|
|
69753
69753
|
const exists2 = yield* mapError3(fs4.exists(absolutePath), (error2) => `Failed to check file existence: ${error2.message}`);
|
|
69754
69754
|
if (!exists2) {
|
|
69755
69755
|
return yield* fail6(`File does not exist: ${absolutePath}`);
|
|
@@ -74244,20 +74244,20 @@ var withSubcommands = /* @__PURE__ */ dual(2, (self, subcommands) => {
|
|
|
74244
74244
|
}
|
|
74245
74245
|
});
|
|
74246
74246
|
});
|
|
74247
|
-
const handle = fnUntraced2(function* (input,
|
|
74247
|
+
const handle = fnUntraced2(function* (input, path14) {
|
|
74248
74248
|
const internal = input;
|
|
74249
74249
|
const selectedSubcommand = internal[SubcommandStateSymbol];
|
|
74250
74250
|
if (selectedSubcommand) {
|
|
74251
74251
|
const child = byName.get(selectedSubcommand.name);
|
|
74252
74252
|
if (!child) {
|
|
74253
74253
|
return yield* new ShowHelp({
|
|
74254
|
-
commandPath:
|
|
74254
|
+
commandPath: path14,
|
|
74255
74255
|
errors: []
|
|
74256
74256
|
});
|
|
74257
74257
|
}
|
|
74258
|
-
return yield* child.handle(selectedSubcommand.result, [...
|
|
74258
|
+
return yield* child.handle(selectedSubcommand.result, [...path14, child.name]).pipe(provideService2(impl.service, input));
|
|
74259
74259
|
}
|
|
74260
|
-
return yield* impl.handle(input,
|
|
74260
|
+
return yield* impl.handle(input, path14);
|
|
74261
74261
|
});
|
|
74262
74262
|
return makeCommand({
|
|
74263
74263
|
name: impl.name,
|
|
@@ -74362,7 +74362,7 @@ var mapHandler = (self, f) => {
|
|
|
74362
74362
|
const impl = toImpl(self);
|
|
74363
74363
|
return makeCommand({
|
|
74364
74364
|
...impl,
|
|
74365
|
-
handle: (input,
|
|
74365
|
+
handle: (input, path14) => f(impl.handle(input, path14), input)
|
|
74366
74366
|
});
|
|
74367
74367
|
};
|
|
74368
74368
|
var provide6 = /* @__PURE__ */ dual((args2) => isCommand(args2[0]), (self, layer14, options) => mapHandler(self, (handler, input) => provide4(handler, typeof layer14 === "function" ? layer14(input) : layer14, options)));
|
|
@@ -74518,10 +74518,9 @@ var runWith2 = (command, config) => {
|
|
|
74518
74518
|
|
|
74519
74519
|
// dist/config.js
|
|
74520
74520
|
import * as fs from "node:fs";
|
|
74521
|
-
import * as
|
|
74521
|
+
import * as path6 from "node:path";
|
|
74522
74522
|
|
|
74523
|
-
// dist/core/DocSummaries.js
|
|
74524
|
-
import { hash as hashHex } from "node:crypto";
|
|
74523
|
+
// dist/core/summaries/DocSummaries.js
|
|
74525
74524
|
var DEFAULT_NAMING = {
|
|
74526
74525
|
dirSummary: "_SUMMARY.md",
|
|
74527
74526
|
fileSummarySuffix: ".summary.md"
|
|
@@ -74535,9 +74534,8 @@ var countLines = (content) => {
|
|
|
74535
74534
|
}
|
|
74536
74535
|
return lines2.length;
|
|
74537
74536
|
};
|
|
74538
|
-
var isSummaryFile = (
|
|
74539
|
-
var summaryPathFor = (
|
|
74540
|
-
var hashContent = (content) => hashHex("sha256", content, "hex");
|
|
74537
|
+
var isSummaryFile = (path14, naming = DEFAULT_NAMING) => path14.endsWith(naming.fileSummarySuffix);
|
|
74538
|
+
var summaryPathFor = (path14, naming = DEFAULT_NAMING) => path14.replace(/\.md$/, naming.fileSummarySuffix);
|
|
74541
74539
|
var stripSourceHash = (summaryContent) => {
|
|
74542
74540
|
if (!HASH_RE.test(summaryContent)) {
|
|
74543
74541
|
return summaryContent;
|
|
@@ -74661,11 +74659,17 @@ var compile = (pattern) => {
|
|
|
74661
74659
|
}
|
|
74662
74660
|
return new RegExp(`^${re}$`);
|
|
74663
74661
|
};
|
|
74664
|
-
var matchesGlob = (
|
|
74665
|
-
var matchesAny = (
|
|
74662
|
+
var matchesGlob = (path14, pattern) => globToRegExp(pattern).test(path14);
|
|
74663
|
+
var matchesAny = (path14, patterns) => patterns.some((pattern) => matchesGlob(path14, pattern));
|
|
74666
74664
|
|
|
74667
74665
|
// dist/core/paths.js
|
|
74666
|
+
import * as nodePath from "node:path";
|
|
74667
|
+
var path5 = nodePath.posix;
|
|
74668
74668
|
var toPosix = (p) => p.replaceAll("\\", "/");
|
|
74669
|
+
var isWithinBase = (candidate, base2) => {
|
|
74670
|
+
const rel = path5.relative(base2, candidate);
|
|
74671
|
+
return !rel.startsWith("..") && !path5.isAbsolute(rel);
|
|
74672
|
+
};
|
|
74669
74673
|
|
|
74670
74674
|
// dist/config.js
|
|
74671
74675
|
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -74678,13 +74682,13 @@ var parseRcJson = (text2, file4) => {
|
|
|
74678
74682
|
}
|
|
74679
74683
|
};
|
|
74680
74684
|
var readRawConfig = (cwd, explicitPath) => {
|
|
74681
|
-
const candidates = explicitPath ? [
|
|
74685
|
+
const candidates = explicitPath ? [path6.resolve(cwd, explicitPath)] : CONFIG_FILENAMES.map((f) => path6.join(cwd, f));
|
|
74682
74686
|
for (const file4 of candidates) {
|
|
74683
74687
|
if (fs.existsSync(file4)) {
|
|
74684
74688
|
return { file: file4, raw: parseRcJson(fs.readFileSync(file4, "utf8"), file4) };
|
|
74685
74689
|
}
|
|
74686
74690
|
}
|
|
74687
|
-
const pkgPath =
|
|
74691
|
+
const pkgPath = path6.join(cwd, "package.json");
|
|
74688
74692
|
if (fs.existsSync(pkgPath)) {
|
|
74689
74693
|
const pkg = parseRcJson(fs.readFileSync(pkgPath, "utf8"), pkgPath);
|
|
74690
74694
|
if (isRecord(pkg) && isRecord(pkg["cairn"])) {
|
|
@@ -74694,7 +74698,7 @@ var readRawConfig = (cwd, explicitPath) => {
|
|
|
74694
74698
|
return null;
|
|
74695
74699
|
};
|
|
74696
74700
|
var resolveExtendsTarget = (cwd, specifier, fromFile, visited, acc) => {
|
|
74697
|
-
const resolved =
|
|
74701
|
+
const resolved = path6.isAbsolute(specifier) ? specifier : path6.resolve(path6.dirname(fromFile), specifier);
|
|
74698
74702
|
if (!fs.existsSync(resolved)) {
|
|
74699
74703
|
throw new Error(`cairn: invalid config in ${fromFile}: extends target not found: ${specifier} (resolved to ${resolved})`);
|
|
74700
74704
|
}
|
|
@@ -74739,13 +74743,13 @@ var expandOne = (cwd, pattern) => {
|
|
|
74739
74743
|
continue;
|
|
74740
74744
|
}
|
|
74741
74745
|
if (!hasGlob(segment)) {
|
|
74742
|
-
next.push(
|
|
74746
|
+
next.push(path6.join(dir2, segment));
|
|
74743
74747
|
continue;
|
|
74744
74748
|
}
|
|
74745
74749
|
const re = globToRegExp(segment);
|
|
74746
74750
|
for (const entry of readDirsSafe(dir2)) {
|
|
74747
74751
|
if (re.test(entry)) {
|
|
74748
|
-
next.push(
|
|
74752
|
+
next.push(path6.join(dir2, entry));
|
|
74749
74753
|
}
|
|
74750
74754
|
}
|
|
74751
74755
|
}
|
|
@@ -74771,7 +74775,7 @@ var readDirsSafe = (dir2) => {
|
|
|
74771
74775
|
var descendantDirs = (dir2) => {
|
|
74772
74776
|
const out = [];
|
|
74773
74777
|
for (const name of readDirsSafe(dir2)) {
|
|
74774
|
-
const child =
|
|
74778
|
+
const child = path6.join(dir2, name);
|
|
74775
74779
|
out.push(child, ...descendantDirs(child));
|
|
74776
74780
|
}
|
|
74777
74781
|
return out;
|
|
@@ -74788,7 +74792,7 @@ var expandRoots = (cwd, patterns) => {
|
|
|
74788
74792
|
|
|
74789
74793
|
// dist/init/generate.js
|
|
74790
74794
|
import * as fs2 from "node:fs";
|
|
74791
|
-
import * as
|
|
74795
|
+
import * as path7 from "node:path";
|
|
74792
74796
|
|
|
74793
74797
|
// dist/init/content.js
|
|
74794
74798
|
var CONVENTION_BODY = `# Documentation summary convention
|
|
@@ -74950,7 +74954,7 @@ var AGENTS_START = "<!-- cairn:start -->";
|
|
|
74950
74954
|
var AGENTS_END = "<!-- cairn:end -->";
|
|
74951
74955
|
var rootsToGlobs = (roots) => roots.map((r) => `${r.replace(/\/+$/, "")}/**`);
|
|
74952
74956
|
var ensureDir = (file4) => {
|
|
74953
|
-
fs2.mkdirSync(
|
|
74957
|
+
fs2.mkdirSync(path7.dirname(file4), { recursive: true });
|
|
74954
74958
|
};
|
|
74955
74959
|
var write2 = (file4, content, written) => {
|
|
74956
74960
|
ensureDir(file4);
|
|
@@ -74981,7 +74985,7 @@ var skillFile = () => [
|
|
|
74981
74985
|
SKILL_BODY
|
|
74982
74986
|
].join("\n");
|
|
74983
74987
|
var upsertAgentsBlock = (cwd, written) => {
|
|
74984
|
-
const file4 =
|
|
74988
|
+
const file4 = path7.join(cwd, "AGENTS.md");
|
|
74985
74989
|
const block = `${AGENTS_START}
|
|
74986
74990
|
|
|
74987
74991
|
${CONVENTION_BODY.trimEnd()}
|
|
@@ -75009,7 +75013,7 @@ ${block}
|
|
|
75009
75013
|
written.push(file4);
|
|
75010
75014
|
};
|
|
75011
75015
|
var upsertClaudeMdImport = (cwd, written, skipped) => {
|
|
75012
|
-
const file4 =
|
|
75016
|
+
const file4 = path7.join(cwd, "CLAUDE.md");
|
|
75013
75017
|
const block = `${AGENTS_START}
|
|
75014
75018
|
@AGENTS.md
|
|
75015
75019
|
${AGENTS_END}`;
|
|
@@ -75047,17 +75051,17 @@ var runInit = ({ agent, cwd, roots }) => {
|
|
|
75047
75051
|
const doCopilot = agent === "copilot" || agent === "all";
|
|
75048
75052
|
const doAgents = agent === "agents" || agent === "opencode" || agent === "all";
|
|
75049
75053
|
if (doClaude) {
|
|
75050
|
-
write2(
|
|
75051
|
-
write2(
|
|
75054
|
+
write2(path7.join(cwd, ".claude/rules/docs-summaries.md"), claudeRule(globs), written);
|
|
75055
|
+
write2(path7.join(cwd, ".claude/skills/cairn/SKILL.md"), skillFile(), written);
|
|
75052
75056
|
upsertClaudeMdImport(cwd, written, skipped);
|
|
75053
75057
|
}
|
|
75054
75058
|
if (doCopilot) {
|
|
75055
|
-
write2(
|
|
75059
|
+
write2(path7.join(cwd, ".github/instructions/docs-summaries.instructions.md"), copilotInstructions(globs), written);
|
|
75056
75060
|
}
|
|
75057
75061
|
if (doAgents || doClaude || doCopilot) {
|
|
75058
75062
|
upsertAgentsBlock(cwd, written);
|
|
75059
75063
|
}
|
|
75060
|
-
const rc =
|
|
75064
|
+
const rc = path7.join(cwd, ".cairnrc.json");
|
|
75061
75065
|
if (fs2.existsSync(rc)) {
|
|
75062
75066
|
skipped.push(rc);
|
|
75063
75067
|
} else {
|
|
@@ -75071,7 +75075,7 @@ var DocsFs = class extends Context_exports.Service()("DocsFs") {
|
|
|
75071
75075
|
};
|
|
75072
75076
|
var DocsFsLive = Layer_exports.effect(DocsFs, Effect_exports.gen(function* () {
|
|
75073
75077
|
const fs4 = yield* FileSystem_exports.FileSystem;
|
|
75074
|
-
const
|
|
75078
|
+
const path14 = yield* Path_exports.Path;
|
|
75075
75079
|
const STAT_CONCURRENCY = 32;
|
|
75076
75080
|
const listFiles = (roots) => Effect_exports.gen(function* () {
|
|
75077
75081
|
const out = [];
|
|
@@ -75082,7 +75086,7 @@ var DocsFsLive = Layer_exports.effect(DocsFs, Effect_exports.gen(function* () {
|
|
|
75082
75086
|
}
|
|
75083
75087
|
const entries3 = yield* fs4.readDirectory(root, { recursive: true });
|
|
75084
75088
|
const abses = yield* Effect_exports.forEach(entries3, (entry) => {
|
|
75085
|
-
const abs2 =
|
|
75089
|
+
const abs2 = path14.join(root, entry);
|
|
75086
75090
|
return fs4.stat(abs2).pipe(Effect_exports.map((info2) => info2.type === "File" ? abs2 : null));
|
|
75087
75091
|
}, { concurrency: STAT_CONCURRENCY });
|
|
75088
75092
|
for (const abs2 of abses) {
|
|
@@ -75098,7 +75102,7 @@ var DocsFsLive = Layer_exports.effect(DocsFs, Effect_exports.gen(function* () {
|
|
|
75098
75102
|
sizeBytes: Number(info2.size)
|
|
75099
75103
|
})), Effect_exports.orDie);
|
|
75100
75104
|
const writeFile3 = (abs2, content) => Effect_exports.gen(function* () {
|
|
75101
|
-
yield* fs4.makeDirectory(
|
|
75105
|
+
yield* fs4.makeDirectory(path14.dirname(abs2), { recursive: true });
|
|
75102
75106
|
yield* fs4.writeFileString(abs2, content);
|
|
75103
75107
|
}).pipe(Effect_exports.orDie);
|
|
75104
75108
|
return {
|
|
@@ -75111,16 +75115,184 @@ var DocsFsLive = Layer_exports.effect(DocsFs, Effect_exports.gen(function* () {
|
|
|
75111
75115
|
};
|
|
75112
75116
|
}));
|
|
75113
75117
|
|
|
75114
|
-
// dist/program/CheckLinks.js
|
|
75115
|
-
import * as
|
|
75118
|
+
// dist/program/links/CheckLinks.js
|
|
75119
|
+
import * as nodePath3 from "node:path";
|
|
75116
75120
|
|
|
75117
|
-
//
|
|
75118
|
-
|
|
75119
|
-
|
|
75121
|
+
// node_modules/.pnpm/github-slugger@2.0.0/node_modules/github-slugger/regex.js
|
|
75122
|
+
var regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;
|
|
75123
|
+
|
|
75124
|
+
// node_modules/.pnpm/github-slugger@2.0.0/node_modules/github-slugger/index.js
|
|
75125
|
+
var own = Object.hasOwnProperty;
|
|
75126
|
+
var BananaSlug = class {
|
|
75127
|
+
/**
|
|
75128
|
+
* Create a new slug class.
|
|
75129
|
+
*/
|
|
75130
|
+
constructor() {
|
|
75131
|
+
this.occurrences;
|
|
75132
|
+
this.reset();
|
|
75133
|
+
}
|
|
75134
|
+
/**
|
|
75135
|
+
* Generate a unique slug.
|
|
75136
|
+
*
|
|
75137
|
+
* Tracks previously generated slugs: repeated calls with the same value
|
|
75138
|
+
* will result in different slugs.
|
|
75139
|
+
* Use the `slug` function to get same slugs.
|
|
75140
|
+
*
|
|
75141
|
+
* @param {string} value
|
|
75142
|
+
* String of text to slugify
|
|
75143
|
+
* @param {boolean} [maintainCase=false]
|
|
75144
|
+
* Keep the current case, otherwise make all lowercase
|
|
75145
|
+
* @return {string}
|
|
75146
|
+
* A unique slug string
|
|
75147
|
+
*/
|
|
75148
|
+
slug(value3, maintainCase) {
|
|
75149
|
+
const self = this;
|
|
75150
|
+
let result3 = slug(value3, maintainCase === true);
|
|
75151
|
+
const originalSlug = result3;
|
|
75152
|
+
while (own.call(self.occurrences, result3)) {
|
|
75153
|
+
self.occurrences[originalSlug]++;
|
|
75154
|
+
result3 = originalSlug + "-" + self.occurrences[originalSlug];
|
|
75155
|
+
}
|
|
75156
|
+
self.occurrences[result3] = 0;
|
|
75157
|
+
return result3;
|
|
75158
|
+
}
|
|
75159
|
+
/**
|
|
75160
|
+
* Reset - Forget all previous slugs
|
|
75161
|
+
*
|
|
75162
|
+
* @return void
|
|
75163
|
+
*/
|
|
75164
|
+
reset() {
|
|
75165
|
+
this.occurrences = /* @__PURE__ */ Object.create(null);
|
|
75166
|
+
}
|
|
75167
|
+
};
|
|
75168
|
+
function slug(value3, maintainCase) {
|
|
75169
|
+
if (typeof value3 !== "string") return "";
|
|
75170
|
+
if (!maintainCase) value3 = value3.toLowerCase();
|
|
75171
|
+
return value3.replace(regex, "").replace(/ /g, "-");
|
|
75172
|
+
}
|
|
75173
|
+
|
|
75174
|
+
// dist/core/links/markdownFences.js
|
|
75175
|
+
var fenceOpenMarker = (line) => {
|
|
75176
|
+
const trimmed = line.trimStart();
|
|
75177
|
+
if (trimmed.startsWith("```")) {
|
|
75178
|
+
return "```";
|
|
75179
|
+
}
|
|
75180
|
+
if (trimmed.startsWith("~~~")) {
|
|
75181
|
+
return "~~~";
|
|
75182
|
+
}
|
|
75183
|
+
return null;
|
|
75184
|
+
};
|
|
75185
|
+
var isFenceClose = (line, marker) => line.trim() === marker;
|
|
75186
|
+
var maskFencedCode = (content) => {
|
|
75187
|
+
const lines2 = content.split("\n");
|
|
75188
|
+
let i = 0;
|
|
75189
|
+
while (i < lines2.length) {
|
|
75190
|
+
const marker = fenceOpenMarker(lines2[i] ?? "");
|
|
75191
|
+
if (marker === null) {
|
|
75192
|
+
i += 1;
|
|
75193
|
+
continue;
|
|
75194
|
+
}
|
|
75195
|
+
let j = i + 1;
|
|
75196
|
+
while (j < lines2.length && !isFenceClose(lines2[j] ?? "", marker)) {
|
|
75197
|
+
j += 1;
|
|
75198
|
+
}
|
|
75199
|
+
const end = j < lines2.length ? j : lines2.length - 1;
|
|
75200
|
+
for (let k = i; k <= end; k += 1) {
|
|
75201
|
+
lines2[k] = " ".repeat((lines2[k] ?? "").length);
|
|
75202
|
+
}
|
|
75203
|
+
i = end + 1;
|
|
75204
|
+
}
|
|
75205
|
+
return lines2.join("\n");
|
|
75206
|
+
};
|
|
75207
|
+
|
|
75208
|
+
// dist/core/links/Anchors.js
|
|
75209
|
+
var ATX_RE = /^(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/;
|
|
75210
|
+
var SETEXT_RE = /^(=+|-+)[ \t]*$/;
|
|
75211
|
+
var HTML_ANCHOR_RE = /<a\s+(?:[^>]*?\s)?(?:name|id)=["']([^"']+)["']/gi;
|
|
75212
|
+
var HEADING_LINK_RE = /!?\[([^\]]*)\]\([^)\s]+(?:\s+"[^"]*")?\)/g;
|
|
75213
|
+
var ENTITY_MAP = {
|
|
75214
|
+
amp: "&",
|
|
75215
|
+
apos: "'",
|
|
75216
|
+
gt: ">",
|
|
75217
|
+
lt: "<",
|
|
75218
|
+
quot: '"'
|
|
75219
|
+
};
|
|
75220
|
+
var decodeEntities = (text2) => text2.replaceAll(/&(#x?[0-9a-f]+|[a-z]+);/gi, (whole, body) => {
|
|
75221
|
+
if (body.startsWith("#")) {
|
|
75222
|
+
const codePoint = body[1]?.toLowerCase() === "x" ? Number.parseInt(body.slice(2), 16) : Math.trunc(Number(body.slice(1)));
|
|
75223
|
+
return Number.isFinite(codePoint) ? String.fromCodePoint(codePoint) : whole;
|
|
75224
|
+
}
|
|
75225
|
+
return ENTITY_MAP[body.toLowerCase()] ?? whole;
|
|
75226
|
+
});
|
|
75227
|
+
var flattenInlineLinks = (headingText) => headingText.replaceAll(HEADING_LINK_RE, (_whole, text2) => text2);
|
|
75228
|
+
var extractHeadingTexts = (masked) => {
|
|
75229
|
+
const lines2 = masked.split("\n");
|
|
75230
|
+
const headings2 = [];
|
|
75231
|
+
for (const [i, line] of lines2.entries()) {
|
|
75232
|
+
const atx = ATX_RE.exec(line ?? "");
|
|
75233
|
+
if (atx) {
|
|
75234
|
+
headings2.push(atx[2] ?? "");
|
|
75235
|
+
continue;
|
|
75236
|
+
}
|
|
75237
|
+
if (i > 0 && SETEXT_RE.test(line ?? "")) {
|
|
75238
|
+
const prev = lines2[i - 1] ?? "";
|
|
75239
|
+
if (prev.trim() !== "" && !ATX_RE.test(prev) && !SETEXT_RE.test(prev)) {
|
|
75240
|
+
headings2.push(prev.trim());
|
|
75241
|
+
}
|
|
75242
|
+
}
|
|
75243
|
+
}
|
|
75244
|
+
return headings2;
|
|
75245
|
+
};
|
|
75246
|
+
var extractAnchors = (content) => {
|
|
75247
|
+
const masked = maskFencedCode(content);
|
|
75248
|
+
const slugger = new BananaSlug();
|
|
75249
|
+
const anchors = /* @__PURE__ */ new Set();
|
|
75250
|
+
for (const raw of extractHeadingTexts(masked)) {
|
|
75251
|
+
const flattened = decodeEntities(flattenInlineLinks(raw));
|
|
75252
|
+
anchors.add(slugger.slug(flattened));
|
|
75253
|
+
}
|
|
75254
|
+
for (const match8 of masked.matchAll(HTML_ANCHOR_RE)) {
|
|
75255
|
+
if (match8[1]) {
|
|
75256
|
+
anchors.add(match8[1]);
|
|
75257
|
+
}
|
|
75258
|
+
}
|
|
75259
|
+
return anchors;
|
|
75260
|
+
};
|
|
75261
|
+
var normalizeAnchor = (anchor) => {
|
|
75262
|
+
try {
|
|
75263
|
+
return decodeURIComponent(anchor);
|
|
75264
|
+
} catch {
|
|
75265
|
+
return anchor;
|
|
75266
|
+
}
|
|
75267
|
+
};
|
|
75268
|
+
var LINE_ANCHOR_RE = /^L(\d+)(?:-L(\d+))?$/;
|
|
75269
|
+
var parseLineAnchor = (anchor) => {
|
|
75270
|
+
const match8 = LINE_ANCHOR_RE.exec(anchor);
|
|
75271
|
+
if (!match8) {
|
|
75272
|
+
return null;
|
|
75273
|
+
}
|
|
75274
|
+
const start = Number(match8[1]);
|
|
75275
|
+
const end = match8[2] === void 0 ? start : Number(match8[2]);
|
|
75276
|
+
return start >= 1 && end >= start ? { end, start } : null;
|
|
75277
|
+
};
|
|
75278
|
+
var isValidLineAnchor = (range2, lineCount) => range2.end <= lineCount;
|
|
75279
|
+
var MAX_LISTED_ANCHORS = 8;
|
|
75280
|
+
var describeAnchors = (anchors) => {
|
|
75281
|
+
if (anchors.size === 0) {
|
|
75282
|
+
return "target has no headings or anchors";
|
|
75283
|
+
}
|
|
75284
|
+
const list = [...anchors];
|
|
75285
|
+
const shown = list.slice(0, MAX_LISTED_ANCHORS);
|
|
75286
|
+
const suffix = list.length > MAX_LISTED_ANCHORS ? `, and ${list.length - MAX_LISTED_ANCHORS} more` : "";
|
|
75287
|
+
return `available anchors: ${shown.join(", ")}${suffix}`;
|
|
75288
|
+
};
|
|
75289
|
+
|
|
75290
|
+
// dist/core/links/MarkdownLinks.js
|
|
75291
|
+
import * as nodePath2 from "node:path";
|
|
75292
|
+
var path8 = nodePath2.posix;
|
|
75120
75293
|
var LINK_RE = /!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
|
|
75121
|
-
var FENCED_CODE_RE = /(^|\n)[ \t]*(```|~~~)[\s\S]*?\n[ \t]*\2[ \t]*(?=\n|$)/g;
|
|
75122
75294
|
var INLINE_CODE_RE = /`[^`\n]*`/g;
|
|
75123
|
-
var stripCode = (content) => content
|
|
75295
|
+
var stripCode = (content) => maskFencedCode(content).replaceAll(INLINE_CODE_RE, (block) => " ".repeat(block.length));
|
|
75124
75296
|
var LINK_DEF_RE = /^[ \t]*\[([^\]]+)\]:[ \t]*<?([^>\s]+)>?/gm;
|
|
75125
75297
|
var extractLinks = (content) => {
|
|
75126
75298
|
const links = [];
|
|
@@ -75136,13 +75308,29 @@ var extractLinkDefinitions = (content) => {
|
|
|
75136
75308
|
}
|
|
75137
75309
|
return defs;
|
|
75138
75310
|
};
|
|
75311
|
+
var captureGroupStart = (match8) => (match8.index ?? 0) + match8[0].indexOf("[") + 1;
|
|
75312
|
+
var extractLinksPreservingText = (original, masked) => {
|
|
75313
|
+
const links = [];
|
|
75314
|
+
for (const match8 of masked.matchAll(LINK_RE)) {
|
|
75315
|
+
const textStart = captureGroupStart(match8);
|
|
75316
|
+
const textLength = match8[1]?.length ?? 0;
|
|
75317
|
+
links.push({ target: match8[2] ?? "", text: original.slice(textStart, textStart + textLength) });
|
|
75318
|
+
}
|
|
75319
|
+
return links;
|
|
75320
|
+
};
|
|
75321
|
+
var extractLinkDefinitionsPreservingLabel = (original, masked) => {
|
|
75322
|
+
const defs = [];
|
|
75323
|
+
for (const match8 of masked.matchAll(LINK_DEF_RE)) {
|
|
75324
|
+
const labelStart = captureGroupStart(match8);
|
|
75325
|
+
const labelLength = match8[1]?.length ?? 0;
|
|
75326
|
+
defs.push({ label: original.slice(labelStart, labelStart + labelLength), target: match8[2] ?? "" });
|
|
75327
|
+
}
|
|
75328
|
+
return defs;
|
|
75329
|
+
};
|
|
75139
75330
|
var isCheckableTarget = (target) => {
|
|
75140
75331
|
if (!target) {
|
|
75141
75332
|
return false;
|
|
75142
75333
|
}
|
|
75143
|
-
if (target.startsWith("#")) {
|
|
75144
|
-
return false;
|
|
75145
|
-
}
|
|
75146
75334
|
if (target.startsWith("//")) {
|
|
75147
75335
|
return false;
|
|
75148
75336
|
}
|
|
@@ -75151,11 +75339,45 @@ var isCheckableTarget = (target) => {
|
|
|
75151
75339
|
}
|
|
75152
75340
|
return true;
|
|
75153
75341
|
};
|
|
75154
|
-
var
|
|
75342
|
+
var parseTarget = (target) => {
|
|
75343
|
+
const hashIdx = target.indexOf("#");
|
|
75344
|
+
const rawPath = hashIdx === -1 ? target : target.slice(0, hashIdx);
|
|
75345
|
+
const queryIdx = rawPath.indexOf("?");
|
|
75346
|
+
return {
|
|
75347
|
+
anchor: hashIdx === -1 ? null : target.slice(hashIdx + 1),
|
|
75348
|
+
path: queryIdx === -1 ? rawPath : rawPath.slice(0, queryIdx)
|
|
75349
|
+
};
|
|
75350
|
+
};
|
|
75351
|
+
var stripAnchor = (target) => parseTarget(target).path;
|
|
75352
|
+
var extractReferences = (content) => {
|
|
75353
|
+
const masked = stripCode(content);
|
|
75354
|
+
const candidates = [
|
|
75355
|
+
...extractLinks(masked),
|
|
75356
|
+
...extractLinkDefinitions(masked).map((def) => ({ target: def.target, text: "" }))
|
|
75357
|
+
];
|
|
75358
|
+
const seen = /* @__PURE__ */ new Set();
|
|
75359
|
+
const refs = [];
|
|
75360
|
+
for (const link4 of candidates) {
|
|
75361
|
+
if (!isCheckableTarget(link4.target)) {
|
|
75362
|
+
continue;
|
|
75363
|
+
}
|
|
75364
|
+
const { anchor, path: target } = parseTarget(link4.target);
|
|
75365
|
+
if (target === "") {
|
|
75366
|
+
continue;
|
|
75367
|
+
}
|
|
75368
|
+
const key = `${target}#${anchor ?? ""}`;
|
|
75369
|
+
if (seen.has(key)) {
|
|
75370
|
+
continue;
|
|
75371
|
+
}
|
|
75372
|
+
seen.add(key);
|
|
75373
|
+
refs.push({ anchor, target });
|
|
75374
|
+
}
|
|
75375
|
+
return refs;
|
|
75376
|
+
};
|
|
75155
75377
|
var buildBasenameIndex = (absPaths) => {
|
|
75156
75378
|
const index2 = /* @__PURE__ */ new Map();
|
|
75157
75379
|
for (const abs2 of absPaths) {
|
|
75158
|
-
const base2 =
|
|
75380
|
+
const base2 = path8.basename(abs2);
|
|
75159
75381
|
const bucket = index2.get(base2);
|
|
75160
75382
|
if (bucket) {
|
|
75161
75383
|
bucket.push(abs2);
|
|
@@ -75166,57 +75388,78 @@ var buildBasenameIndex = (absPaths) => {
|
|
|
75166
75388
|
return index2;
|
|
75167
75389
|
};
|
|
75168
75390
|
var toRelative = (fromDir, toAbs) => {
|
|
75169
|
-
const rel =
|
|
75391
|
+
const rel = path8.relative(fromDir, toAbs).split(path8.sep).join("/");
|
|
75170
75392
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
75171
75393
|
};
|
|
75172
75394
|
var suggestFix = ({ fromDir, index: index2, target }) => {
|
|
75173
|
-
const base2 =
|
|
75395
|
+
const base2 = path8.basename(stripAnchor(target));
|
|
75174
75396
|
const candidates = index2.get(base2);
|
|
75175
75397
|
if (!candidates || candidates.length !== 1) {
|
|
75176
75398
|
return null;
|
|
75177
75399
|
}
|
|
75178
75400
|
return toRelative(fromDir, candidates[0] ?? "");
|
|
75179
75401
|
};
|
|
75180
|
-
var checkContent = ({ content, existsAbs, fileAbs, index: index2 }) => {
|
|
75181
|
-
const fromDir =
|
|
75402
|
+
var checkContent = ({ content, existsAbs, fileAbs, index: index2, inRoots = () => true }) => {
|
|
75403
|
+
const fromDir = path8.dirname(fileAbs);
|
|
75182
75404
|
const broken = [];
|
|
75405
|
+
const pending = [];
|
|
75183
75406
|
const masked = stripCode(content);
|
|
75184
75407
|
const candidates = [
|
|
75185
|
-
...
|
|
75408
|
+
...extractLinksPreservingText(content, masked),
|
|
75186
75409
|
// Reference-style definitions are checked by their target too.
|
|
75187
|
-
...
|
|
75410
|
+
...extractLinkDefinitionsPreservingLabel(content, masked).map((def) => ({
|
|
75411
|
+
target: def.target,
|
|
75412
|
+
text: `[${def.label}]`
|
|
75413
|
+
}))
|
|
75188
75414
|
];
|
|
75415
|
+
let sourceAnchors = null;
|
|
75416
|
+
const getSourceAnchors = () => sourceAnchors ??= extractAnchors(content);
|
|
75189
75417
|
for (const link4 of candidates) {
|
|
75190
75418
|
if (!isCheckableTarget(link4.target)) {
|
|
75191
75419
|
continue;
|
|
75192
75420
|
}
|
|
75193
|
-
const rel =
|
|
75194
|
-
if (
|
|
75421
|
+
const { anchor, path: rel } = parseTarget(link4.target);
|
|
75422
|
+
if (rel === "") {
|
|
75423
|
+
if (anchor !== null && !getSourceAnchors().has(anchor)) {
|
|
75424
|
+
broken.push({
|
|
75425
|
+
detail: describeAnchors(getSourceAnchors()),
|
|
75426
|
+
reason: "anchor",
|
|
75427
|
+
target: link4.target,
|
|
75428
|
+
text: link4.text
|
|
75429
|
+
});
|
|
75430
|
+
}
|
|
75195
75431
|
continue;
|
|
75196
75432
|
}
|
|
75197
|
-
const abs2 =
|
|
75433
|
+
const abs2 = path8.resolve(fromDir, rel);
|
|
75198
75434
|
if (existsAbs(abs2)) {
|
|
75435
|
+
if (anchor !== null) {
|
|
75436
|
+
pending.push({ anchor, fromDir, target: link4.target, targetAbs: abs2, text: link4.text });
|
|
75437
|
+
}
|
|
75438
|
+
continue;
|
|
75439
|
+
}
|
|
75440
|
+
if (!inRoots(abs2)) {
|
|
75441
|
+
pending.push({ anchor, fromDir, target: link4.target, targetAbs: abs2, text: link4.text });
|
|
75199
75442
|
continue;
|
|
75200
75443
|
}
|
|
75201
75444
|
const suggestion = index2 ? suggestFix({ fromDir, index: index2, target: link4.target }) : null;
|
|
75202
|
-
broken.push(suggestion ? { suggestion, target: link4.target, text: link4.text } : { target: link4.target, text: link4.text });
|
|
75445
|
+
broken.push(suggestion ? { reason: "path", suggestion, target: link4.target, text: link4.text } : { reason: "path", target: link4.target, text: link4.text });
|
|
75203
75446
|
}
|
|
75204
|
-
return broken;
|
|
75447
|
+
return { broken, pending };
|
|
75205
75448
|
};
|
|
75206
75449
|
|
|
75207
75450
|
// dist/program/locale.js
|
|
75208
75451
|
var pick3 = (locale, values2) => values2[locale];
|
|
75209
75452
|
var enOnly = (value3) => ({ en: value3, fr: value3 });
|
|
75210
75453
|
|
|
75211
|
-
// dist/program/CheckLinks.js
|
|
75212
|
-
var
|
|
75454
|
+
// dist/program/links/CheckLinks.js
|
|
75455
|
+
var path9 = nodePath3.posix;
|
|
75213
75456
|
var withAncestors = (files) => {
|
|
75214
75457
|
const set4 = new Set(files);
|
|
75215
75458
|
for (const file4 of files) {
|
|
75216
|
-
let dir2 =
|
|
75459
|
+
let dir2 = path9.dirname(file4);
|
|
75217
75460
|
while (!set4.has(dir2)) {
|
|
75218
75461
|
set4.add(dir2);
|
|
75219
|
-
const parent =
|
|
75462
|
+
const parent = path9.dirname(dir2);
|
|
75220
75463
|
if (parent === dir2) {
|
|
75221
75464
|
break;
|
|
75222
75465
|
}
|
|
@@ -75264,24 +75507,110 @@ var formatLinkReport = (result3, options = {}) => {
|
|
|
75264
75507
|
for (const { file: file4, links } of result3.broken) {
|
|
75265
75508
|
lines2.push(` ${file4}`);
|
|
75266
75509
|
for (const link4 of links) {
|
|
75267
|
-
|
|
75268
|
-
lines2.push(` \u2717 [${link4.text}](${link4.target})${hint}`);
|
|
75510
|
+
lines2.push(` \u2717 [${link4.text}](${link4.target})${linkHint(locale, link4)}`);
|
|
75269
75511
|
}
|
|
75270
75512
|
}
|
|
75271
75513
|
return lines2;
|
|
75272
75514
|
};
|
|
75273
|
-
var
|
|
75515
|
+
var linkHint = (locale, link4) => {
|
|
75516
|
+
if (link4.suggestion !== void 0) {
|
|
75517
|
+
return pick3(locale, { en: ` \u2192 suggestion: ${link4.suggestion}`, fr: ` \u2192 suggestion : ${link4.suggestion}` });
|
|
75518
|
+
}
|
|
75519
|
+
const detail = link4.detail !== void 0 ? ` \u2014 ${link4.detail}` : "";
|
|
75520
|
+
if (link4.reason === "anchor") {
|
|
75521
|
+
return pick3(locale, { en: ` (heading/anchor not found${detail})`, fr: ` (ancre introuvable${detail})` });
|
|
75522
|
+
}
|
|
75523
|
+
if (link4.reason === "line") {
|
|
75524
|
+
return pick3(locale, { en: ` (line number out of range${detail})`, fr: ` (num\xE9ro de ligne hors limites${detail})` });
|
|
75525
|
+
}
|
|
75526
|
+
return pick3(locale, { en: " (no unique target)", fr: " (aucune cible unique)" });
|
|
75527
|
+
};
|
|
75528
|
+
var resolvePendingCheck = ({ base: base2, existsCache, contentCache, anchorCache, dfs, index: index2, item, known }) => Effect_exports.gen(function* () {
|
|
75529
|
+
let exists2 = existsCache.get(item.targetAbs);
|
|
75530
|
+
if (exists2 === void 0) {
|
|
75531
|
+
if (known.has(item.targetAbs)) {
|
|
75532
|
+
exists2 = true;
|
|
75533
|
+
} else if (isWithinBase(item.targetAbs, base2)) {
|
|
75534
|
+
exists2 = yield* dfs.exists(item.targetAbs);
|
|
75535
|
+
} else {
|
|
75536
|
+
exists2 = false;
|
|
75537
|
+
}
|
|
75538
|
+
existsCache.set(item.targetAbs, exists2);
|
|
75539
|
+
}
|
|
75540
|
+
if (!exists2) {
|
|
75541
|
+
const suggestion = suggestFix({ fromDir: item.fromDir, index: index2, target: item.target });
|
|
75542
|
+
return suggestion ? { reason: "path", suggestion, target: item.target, text: item.text } : { reason: "path", target: item.target, text: item.text };
|
|
75543
|
+
}
|
|
75544
|
+
if (item.anchor === null) {
|
|
75545
|
+
return null;
|
|
75546
|
+
}
|
|
75547
|
+
let content = contentCache.get(item.targetAbs);
|
|
75548
|
+
if (content === void 0) {
|
|
75549
|
+
content = yield* dfs.readFile(item.targetAbs).pipe(Effect_exports.catchDefect(() => Effect_exports.succeed(null)));
|
|
75550
|
+
contentCache.set(item.targetAbs, content);
|
|
75551
|
+
}
|
|
75552
|
+
if (content === null) {
|
|
75553
|
+
return null;
|
|
75554
|
+
}
|
|
75555
|
+
const normalized = normalizeAnchor(item.anchor);
|
|
75556
|
+
const lineRange = parseLineAnchor(normalized);
|
|
75557
|
+
if (lineRange) {
|
|
75558
|
+
const lineCount = content.split("\n").length;
|
|
75559
|
+
if (isValidLineAnchor(lineRange, lineCount)) {
|
|
75560
|
+
return null;
|
|
75561
|
+
}
|
|
75562
|
+
const detail = `target has ${lineCount} line${lineCount === 1 ? "" : "s"}`;
|
|
75563
|
+
return { detail, reason: "line", target: item.target, text: item.text };
|
|
75564
|
+
}
|
|
75565
|
+
if (!item.targetAbs.toLowerCase().endsWith(".md")) {
|
|
75566
|
+
return null;
|
|
75567
|
+
}
|
|
75568
|
+
let anchors = anchorCache.get(item.targetAbs);
|
|
75569
|
+
if (!anchors) {
|
|
75570
|
+
anchors = extractAnchors(content);
|
|
75571
|
+
anchorCache.set(item.targetAbs, anchors);
|
|
75572
|
+
}
|
|
75573
|
+
return anchors.has(normalized) ? null : { detail: describeAnchors(anchors), reason: "anchor", target: item.target, text: item.text };
|
|
75574
|
+
});
|
|
75575
|
+
var checkLinks = ({ base: base2, fix, ignore: ignore4 = [], roots }) => Effect_exports.gen(function* () {
|
|
75274
75576
|
const dfs = yield* DocsFs;
|
|
75275
75577
|
const allFiles = yield* dfs.listFiles(roots);
|
|
75276
75578
|
const index2 = buildBasenameIndex(allFiles);
|
|
75277
75579
|
const known = withAncestors(allFiles);
|
|
75278
75580
|
const existsAbs = (p) => known.has(p);
|
|
75581
|
+
const inRoots = (p) => roots.some((root) => p === root || p.startsWith(`${root}/`));
|
|
75279
75582
|
const mdFiles = allFiles.filter((file4) => file4.endsWith(".md") && !matchesAny(file4, ignore4));
|
|
75583
|
+
const scans = [];
|
|
75584
|
+
for (const file4 of mdFiles) {
|
|
75585
|
+
const content = yield* dfs.readFile(file4);
|
|
75586
|
+
const { broken: syncBroken, pending } = checkContent({ content, existsAbs, fileAbs: file4, inRoots, index: index2 });
|
|
75587
|
+
scans.push({ content, file: file4, pending, resolvedExtra: [], syncBroken });
|
|
75588
|
+
}
|
|
75589
|
+
const existsCache = /* @__PURE__ */ new Map();
|
|
75590
|
+
const contentCache = /* @__PURE__ */ new Map();
|
|
75591
|
+
const anchorCache = /* @__PURE__ */ new Map();
|
|
75592
|
+
for (const scan of scans) {
|
|
75593
|
+
for (const item of scan.pending) {
|
|
75594
|
+
const result3 = yield* resolvePendingCheck({
|
|
75595
|
+
anchorCache,
|
|
75596
|
+
base: base2,
|
|
75597
|
+
contentCache,
|
|
75598
|
+
dfs,
|
|
75599
|
+
existsCache,
|
|
75600
|
+
index: index2,
|
|
75601
|
+
item,
|
|
75602
|
+
known
|
|
75603
|
+
});
|
|
75604
|
+
if (result3) {
|
|
75605
|
+
scan.resolvedExtra.push(result3);
|
|
75606
|
+
}
|
|
75607
|
+
}
|
|
75608
|
+
}
|
|
75280
75609
|
const broken = [];
|
|
75281
75610
|
let fixed = 0;
|
|
75282
|
-
for (const
|
|
75283
|
-
let content =
|
|
75284
|
-
const links =
|
|
75611
|
+
for (const scan of scans) {
|
|
75612
|
+
let content = scan.content;
|
|
75613
|
+
const links = [...scan.syncBroken, ...scan.resolvedExtra];
|
|
75285
75614
|
if (links.length === 0) {
|
|
75286
75615
|
continue;
|
|
75287
75616
|
}
|
|
@@ -75298,18 +75627,195 @@ var checkLinks = ({ fix, ignore: ignore4 = [], roots }) => Effect_exports.gen(fu
|
|
|
75298
75627
|
}
|
|
75299
75628
|
}
|
|
75300
75629
|
if (changed) {
|
|
75301
|
-
yield* dfs.writeFile(
|
|
75630
|
+
yield* dfs.writeFile(scan.file, content);
|
|
75302
75631
|
}
|
|
75303
75632
|
if (remaining.length > 0) {
|
|
75304
|
-
broken.push({ file:
|
|
75633
|
+
broken.push({ file: scan.file, links: remaining });
|
|
75305
75634
|
}
|
|
75306
75635
|
}
|
|
75307
75636
|
return { broken, checked: mdFiles.length, fixed };
|
|
75308
75637
|
});
|
|
75309
75638
|
|
|
75310
|
-
// dist/
|
|
75311
|
-
import * as
|
|
75312
|
-
|
|
75639
|
+
// dist/program/links/CheckRefs.js
|
|
75640
|
+
import * as nodePath5 from "node:path";
|
|
75641
|
+
|
|
75642
|
+
// dist/core/sidecar.js
|
|
75643
|
+
import * as nodePath4 from "node:path";
|
|
75644
|
+
var path10 = nodePath4.posix;
|
|
75645
|
+
var META_DIR = ".cairn";
|
|
75646
|
+
var metaRootFor = (base2) => path10.join(base2, META_DIR);
|
|
75647
|
+
var isSidecarPath = (candidate, metaRoot) => candidate === metaRoot || candidate.startsWith(`${metaRoot}/`);
|
|
75648
|
+
var sidecarPathFor = (nodeAtPath, layout, namespace) => {
|
|
75649
|
+
const rel = path10.relative(layout.base, nodeAtPath);
|
|
75650
|
+
if (rel.startsWith("..") || path10.isAbsolute(rel)) {
|
|
75651
|
+
throw new Error(`sidecarPathFor: "${nodeAtPath}" is not under base "${layout.base}"`);
|
|
75652
|
+
}
|
|
75653
|
+
const root = namespace === void 0 ? layout.metaRoot : path10.join(layout.metaRoot, namespace);
|
|
75654
|
+
return `${path10.join(root, rel)}.json`;
|
|
75655
|
+
};
|
|
75656
|
+
var nodePathForSidecar = (sidecarPath, layout) => {
|
|
75657
|
+
if (!isSidecarPath(sidecarPath, layout.metaRoot) || !sidecarPath.endsWith(".json")) {
|
|
75658
|
+
return null;
|
|
75659
|
+
}
|
|
75660
|
+
const rel = path10.relative(layout.metaRoot, sidecarPath);
|
|
75661
|
+
if (rel.startsWith("..")) {
|
|
75662
|
+
return null;
|
|
75663
|
+
}
|
|
75664
|
+
return path10.join(layout.base, rel.slice(0, -".json".length));
|
|
75665
|
+
};
|
|
75666
|
+
var makeSidecarCodec = (schema) => {
|
|
75667
|
+
const decode2 = Schema_exports.decodeUnknownResult(schema);
|
|
75668
|
+
return {
|
|
75669
|
+
parse: (content) => {
|
|
75670
|
+
let json2;
|
|
75671
|
+
try {
|
|
75672
|
+
json2 = JSON.parse(content);
|
|
75673
|
+
} catch {
|
|
75674
|
+
return null;
|
|
75675
|
+
}
|
|
75676
|
+
const decoded = decode2(json2);
|
|
75677
|
+
return Result_exports.isSuccess(decoded) ? decoded.success : null;
|
|
75678
|
+
},
|
|
75679
|
+
serialize: (record3) => `${JSON.stringify(record3, null, 2)}
|
|
75680
|
+
`
|
|
75681
|
+
};
|
|
75682
|
+
};
|
|
75683
|
+
|
|
75684
|
+
// dist/core/links/RefStore.js
|
|
75685
|
+
var REFS_DIR = "refs";
|
|
75686
|
+
var RefRecordSchema = Schema_exports.Struct({
|
|
75687
|
+
anchor: Schema_exports.optionalKey(Schema_exports.String),
|
|
75688
|
+
hash: Schema_exports.String,
|
|
75689
|
+
target: Schema_exports.String
|
|
75690
|
+
});
|
|
75691
|
+
var RefsRecordSchema = Schema_exports.Struct({
|
|
75692
|
+
refs: Schema_exports.Array(RefRecordSchema)
|
|
75693
|
+
});
|
|
75694
|
+
var refsCodec = makeSidecarCodec(RefsRecordSchema);
|
|
75695
|
+
var serializeRefs = refsCodec.serialize;
|
|
75696
|
+
var parseRefs = refsCodec.parse;
|
|
75697
|
+
var refsSidecarPathFor = (docAtPath, layout) => sidecarPathFor(docAtPath, layout, REFS_DIR);
|
|
75698
|
+
|
|
75699
|
+
// dist/core/hashing.js
|
|
75700
|
+
import { hash as hashHex } from "node:crypto";
|
|
75701
|
+
var hashContent = (content) => hashHex("sha256", content, "hex");
|
|
75702
|
+
|
|
75703
|
+
// dist/program/links/CheckRefs.js
|
|
75704
|
+
var path11 = nodePath5.posix;
|
|
75705
|
+
var refsExitCode = (result3) => result3.stale.length > 0 ? 1 : 0;
|
|
75706
|
+
var resolveReferenceContent = ({ base: base2, dfs, targetAbs }) => Effect_exports.gen(function* () {
|
|
75707
|
+
if (!isWithinBase(targetAbs, base2)) {
|
|
75708
|
+
return null;
|
|
75709
|
+
}
|
|
75710
|
+
const exists2 = yield* dfs.exists(targetAbs);
|
|
75711
|
+
if (!exists2) {
|
|
75712
|
+
return null;
|
|
75713
|
+
}
|
|
75714
|
+
return yield* dfs.readFile(targetAbs).pipe(Effect_exports.catchDefect(() => Effect_exports.succeed(null)));
|
|
75715
|
+
});
|
|
75716
|
+
var listMdFiles = (roots) => Effect_exports.gen(function* () {
|
|
75717
|
+
const dfs = yield* DocsFs;
|
|
75718
|
+
const allFiles = yield* dfs.listFiles(roots);
|
|
75719
|
+
return allFiles.filter((f) => f.endsWith(".md"));
|
|
75720
|
+
});
|
|
75721
|
+
var toRecord = (ref, hash3) => ref.anchor === null ? { hash: hash3, target: ref.target } : { anchor: ref.anchor, hash: hash3, target: ref.target };
|
|
75722
|
+
var stampRefs = ({ base: base2, roots }) => Effect_exports.gen(function* () {
|
|
75723
|
+
const dfs = yield* DocsFs;
|
|
75724
|
+
const layout = { base: base2, metaRoot: metaRootFor(base2) };
|
|
75725
|
+
const mdFiles = yield* listMdFiles(roots);
|
|
75726
|
+
let stamped = 0;
|
|
75727
|
+
for (const file4 of mdFiles) {
|
|
75728
|
+
const content = yield* dfs.readFile(file4);
|
|
75729
|
+
const fromDir = path11.dirname(file4);
|
|
75730
|
+
const records = [];
|
|
75731
|
+
for (const ref of extractReferences(content)) {
|
|
75732
|
+
const targetAbs = path11.resolve(fromDir, ref.target);
|
|
75733
|
+
const targetContent = yield* resolveReferenceContent({ base: base2, dfs, targetAbs });
|
|
75734
|
+
if (targetContent !== null) {
|
|
75735
|
+
records.push(toRecord(ref, hashContent(targetContent)));
|
|
75736
|
+
}
|
|
75737
|
+
}
|
|
75738
|
+
if (records.length > 0) {
|
|
75739
|
+
yield* dfs.writeFile(refsSidecarPathFor(file4, layout), serializeRefs({ refs: records }));
|
|
75740
|
+
stamped += 1;
|
|
75741
|
+
}
|
|
75742
|
+
}
|
|
75743
|
+
return { stamped };
|
|
75744
|
+
});
|
|
75745
|
+
var checkRefs = ({ base: base2, roots }) => Effect_exports.gen(function* () {
|
|
75746
|
+
const dfs = yield* DocsFs;
|
|
75747
|
+
const layout = { base: base2, metaRoot: metaRootFor(base2) };
|
|
75748
|
+
const mdFiles = yield* listMdFiles(roots);
|
|
75749
|
+
const stale = [];
|
|
75750
|
+
let checked = 0;
|
|
75751
|
+
for (const file4 of mdFiles) {
|
|
75752
|
+
const sidecarPath = refsSidecarPathFor(file4, layout);
|
|
75753
|
+
const sidecarExists = yield* dfs.exists(sidecarPath);
|
|
75754
|
+
if (!sidecarExists) {
|
|
75755
|
+
continue;
|
|
75756
|
+
}
|
|
75757
|
+
const recorded = parseRefs(yield* dfs.readFile(sidecarPath));
|
|
75758
|
+
if (recorded === null) {
|
|
75759
|
+
continue;
|
|
75760
|
+
}
|
|
75761
|
+
checked += 1;
|
|
75762
|
+
const fromDir = path11.dirname(file4);
|
|
75763
|
+
const drifted = [];
|
|
75764
|
+
for (const record3 of recorded.refs) {
|
|
75765
|
+
const targetAbs = path11.resolve(fromDir, record3.target);
|
|
75766
|
+
const targetContent = yield* resolveReferenceContent({ base: base2, dfs, targetAbs });
|
|
75767
|
+
if (targetContent === null) {
|
|
75768
|
+
continue;
|
|
75769
|
+
}
|
|
75770
|
+
const currentHash = hashContent(targetContent);
|
|
75771
|
+
if (currentHash !== record3.hash) {
|
|
75772
|
+
drifted.push(record3.anchor === void 0 ? { currentHash, recordedHash: record3.hash, target: record3.target } : { anchor: record3.anchor, currentHash, recordedHash: record3.hash, target: record3.target });
|
|
75773
|
+
}
|
|
75774
|
+
}
|
|
75775
|
+
if (drifted.length > 0) {
|
|
75776
|
+
stale.push({ file: file4, refs: drifted });
|
|
75777
|
+
}
|
|
75778
|
+
}
|
|
75779
|
+
return { checked, stale };
|
|
75780
|
+
});
|
|
75781
|
+
var formatRefsReport = (result3, options = {}) => {
|
|
75782
|
+
const locale = options.locale ?? "en";
|
|
75783
|
+
const lines2 = [];
|
|
75784
|
+
if (result3.stale.length === 0) {
|
|
75785
|
+
lines2.push(pick3(locale, {
|
|
75786
|
+
en: `\u2705 References OK (${result3.checked} tracked doc(s)).`,
|
|
75787
|
+
fr: `\u2705 R\xE9f\xE9rences OK (${result3.checked} document(s) suivi(s)).`
|
|
75788
|
+
}));
|
|
75789
|
+
return lines2;
|
|
75790
|
+
}
|
|
75791
|
+
const total = result3.stale.reduce((n, f) => n + f.refs.length, 0);
|
|
75792
|
+
lines2.push(pick3(locale, {
|
|
75793
|
+
en: `\u26A0\uFE0F ${total} possibly stale reference(s):`,
|
|
75794
|
+
fr: `\u26A0\uFE0F ${total} r\xE9f\xE9rence(s) possiblement obsol\xE8te(s) :`
|
|
75795
|
+
}));
|
|
75796
|
+
for (const { file: file4, refs } of result3.stale) {
|
|
75797
|
+
lines2.push(` ${file4}`);
|
|
75798
|
+
for (const ref of refs) {
|
|
75799
|
+
const anchorSuffix = ref.anchor !== void 0 ? `#${ref.anchor}` : "";
|
|
75800
|
+
lines2.push(` ~ ${ref.target}${anchorSuffix} (${ref.recordedHash.slice(0, 8)} \u2192 ${ref.currentHash.slice(0, 8)})`);
|
|
75801
|
+
}
|
|
75802
|
+
}
|
|
75803
|
+
return lines2;
|
|
75804
|
+
};
|
|
75805
|
+
|
|
75806
|
+
// dist/core/summaries/StampStore.js
|
|
75807
|
+
var STAMP_VERSION = 1;
|
|
75808
|
+
var StampRecordSchema = Schema_exports.Struct({
|
|
75809
|
+
sha256: Schema_exports.String,
|
|
75810
|
+
version: Schema_exports.Number
|
|
75811
|
+
});
|
|
75812
|
+
var stampCodec = makeSidecarCodec(StampRecordSchema);
|
|
75813
|
+
var serializeStamp = stampCodec.serialize;
|
|
75814
|
+
var parseStamp = stampCodec.parse;
|
|
75815
|
+
|
|
75816
|
+
// dist/core/summaries/SummaryTree.js
|
|
75817
|
+
import * as nodePath6 from "node:path";
|
|
75818
|
+
var path12 = nodePath6.posix;
|
|
75313
75819
|
var DIR_SUMMARY = DEFAULT_NAMING.dirSummary;
|
|
75314
75820
|
var EMPTY_STAMPS = /* @__PURE__ */ new Map();
|
|
75315
75821
|
var DEFAULT_THRESHOLD_LINES2 = 30;
|
|
@@ -75322,7 +75828,7 @@ var resolveLinks = (content, dir2) => {
|
|
|
75322
75828
|
}
|
|
75323
75829
|
const rel = stripAnchor(target);
|
|
75324
75830
|
if (rel) {
|
|
75325
|
-
set4.add(
|
|
75831
|
+
set4.add(path12.resolve(dir2, rel));
|
|
75326
75832
|
}
|
|
75327
75833
|
}
|
|
75328
75834
|
return set4;
|
|
@@ -75340,8 +75846,8 @@ var nodeExpectedHash = ({ files, inputs, kind, path: nodeAtPath }) => {
|
|
|
75340
75846
|
if (kind === "file") {
|
|
75341
75847
|
return hashContent(files.get(inputs[0] ?? "") ?? "");
|
|
75342
75848
|
}
|
|
75343
|
-
const dir2 =
|
|
75344
|
-
const manifest = inputs.map((input) => `${
|
|
75849
|
+
const dir2 = path12.dirname(nodeAtPath);
|
|
75850
|
+
const manifest = inputs.map((input) => `${path12.relative(dir2, input)}:${hashContent(files.get(input) ?? "")}`).toSorted().join("\n");
|
|
75345
75851
|
return hashContent(manifest);
|
|
75346
75852
|
};
|
|
75347
75853
|
var planSummaries = ({ files, ignore: ignore4 = [], naming = DEFAULT_NAMING, requireDirSummaries = true, roots, stamps = EMPTY_STAMPS, thresholdLines = DEFAULT_THRESHOLD_LINES2 }) => {
|
|
@@ -75380,10 +75886,10 @@ var planSummaries = ({ files, ignore: ignore4 = [], naming = DEFAULT_NAMING, req
|
|
|
75380
75886
|
const inScope = (d) => roots.some((r) => d === r || d.startsWith(`${r}/`));
|
|
75381
75887
|
const dirs = /* @__PURE__ */ new Set();
|
|
75382
75888
|
for (const doc of sourceDocs) {
|
|
75383
|
-
let d =
|
|
75889
|
+
let d = path12.dirname(doc);
|
|
75384
75890
|
while (inScope(d)) {
|
|
75385
75891
|
dirs.add(d);
|
|
75386
|
-
const parent =
|
|
75892
|
+
const parent = path12.dirname(d);
|
|
75387
75893
|
if (parent === d) {
|
|
75388
75894
|
break;
|
|
75389
75895
|
}
|
|
@@ -75392,7 +75898,7 @@ var planSummaries = ({ files, ignore: ignore4 = [], naming = DEFAULT_NAMING, req
|
|
|
75392
75898
|
}
|
|
75393
75899
|
const docsByParent = /* @__PURE__ */ new Map();
|
|
75394
75900
|
for (const doc of sourceDocs) {
|
|
75395
|
-
const parent =
|
|
75901
|
+
const parent = path12.dirname(doc);
|
|
75396
75902
|
const bucket = docsByParent.get(parent);
|
|
75397
75903
|
if (bucket) {
|
|
75398
75904
|
bucket.push(doc);
|
|
@@ -75402,7 +75908,7 @@ var planSummaries = ({ files, ignore: ignore4 = [], naming = DEFAULT_NAMING, req
|
|
|
75402
75908
|
}
|
|
75403
75909
|
const dirsByParent = /* @__PURE__ */ new Map();
|
|
75404
75910
|
for (const d of dirs) {
|
|
75405
|
-
const parent =
|
|
75911
|
+
const parent = path12.dirname(d);
|
|
75406
75912
|
const bucket = dirsByParent.get(parent);
|
|
75407
75913
|
if (bucket) {
|
|
75408
75914
|
bucket.push(d);
|
|
@@ -75416,9 +75922,9 @@ var planSummaries = ({ files, ignore: ignore4 = [], naming = DEFAULT_NAMING, req
|
|
|
75416
75922
|
const childDirs = dirsByParent.get(dir2) ?? [];
|
|
75417
75923
|
const inputs = [
|
|
75418
75924
|
...childDocs.map((doc) => isBig(doc) ? summaryPathFor(doc, naming) : doc),
|
|
75419
|
-
...childDirs.map((sub) =>
|
|
75925
|
+
...childDirs.map((sub) => path12.join(sub, naming.dirSummary))
|
|
75420
75926
|
];
|
|
75421
|
-
const dsp =
|
|
75927
|
+
const dsp = path12.join(dir2, naming.dirSummary);
|
|
75422
75928
|
const expectedHash = nodeExpectedHash({ files, inputs, kind: "dir", path: dsp });
|
|
75423
75929
|
const recordedHash = recorded(dsp);
|
|
75424
75930
|
const exists2 = files.has(dsp);
|
|
@@ -75455,49 +75961,7 @@ var findOrphans = ({ files, ignore: ignore4, naming, nodes, requireDirSummaries
|
|
|
75455
75961
|
};
|
|
75456
75962
|
var isManagedSummaryPath = (p, naming, requireDirSummaries) => isSummaryFile(p, naming) || requireDirSummaries && isDirSummary(p, naming);
|
|
75457
75963
|
|
|
75458
|
-
// dist/
|
|
75459
|
-
import * as nodePath4 from "node:path";
|
|
75460
|
-
var path10 = nodePath4.posix;
|
|
75461
|
-
var META_DIR = ".cairn";
|
|
75462
|
-
var STAMP_VERSION = 1;
|
|
75463
|
-
var StampRecordSchema = Schema_exports.Struct({
|
|
75464
|
-
sha256: Schema_exports.String,
|
|
75465
|
-
version: Schema_exports.Number
|
|
75466
|
-
});
|
|
75467
|
-
var decodeStamp = Schema_exports.decodeUnknownResult(StampRecordSchema);
|
|
75468
|
-
var serializeStamp = (record3) => `${JSON.stringify(record3, null, 2)}
|
|
75469
|
-
`;
|
|
75470
|
-
var parseStamp = (content) => {
|
|
75471
|
-
let json2;
|
|
75472
|
-
try {
|
|
75473
|
-
json2 = JSON.parse(content);
|
|
75474
|
-
} catch {
|
|
75475
|
-
return null;
|
|
75476
|
-
}
|
|
75477
|
-
const decoded = decodeStamp(json2);
|
|
75478
|
-
return Result_exports.isSuccess(decoded) ? decoded.success : null;
|
|
75479
|
-
};
|
|
75480
|
-
var metaRootFor = (base2) => path10.join(base2, META_DIR);
|
|
75481
|
-
var isSidecarPath = (candidate, metaRoot) => candidate === metaRoot || candidate.startsWith(`${metaRoot}/`);
|
|
75482
|
-
var sidecarPathFor = (nodeAtPath, layout) => {
|
|
75483
|
-
const rel = path10.relative(layout.base, nodeAtPath);
|
|
75484
|
-
if (rel.startsWith("..") || path10.isAbsolute(rel)) {
|
|
75485
|
-
throw new Error(`sidecarPathFor: "${nodeAtPath}" is not under base "${layout.base}"`);
|
|
75486
|
-
}
|
|
75487
|
-
return `${path10.join(layout.metaRoot, rel)}.json`;
|
|
75488
|
-
};
|
|
75489
|
-
var nodePathForSidecar = (sidecarPath, layout) => {
|
|
75490
|
-
if (!isSidecarPath(sidecarPath, layout.metaRoot) || !sidecarPath.endsWith(".json")) {
|
|
75491
|
-
return null;
|
|
75492
|
-
}
|
|
75493
|
-
const rel = path10.relative(layout.metaRoot, sidecarPath);
|
|
75494
|
-
if (rel.startsWith("..")) {
|
|
75495
|
-
return null;
|
|
75496
|
-
}
|
|
75497
|
-
return path10.join(layout.base, rel.slice(0, -".json".length));
|
|
75498
|
-
};
|
|
75499
|
-
|
|
75500
|
-
// dist/program/CheckSummaries.js
|
|
75964
|
+
// dist/program/summaries/CheckSummaries.js
|
|
75501
75965
|
var EMPTY_STAMPS2 = /* @__PURE__ */ new Map();
|
|
75502
75966
|
var layoutFor = (base2) => ({ base: base2, metaRoot: metaRootFor(base2) });
|
|
75503
75967
|
var toPlanArgs = (files, args2, stamps = EMPTY_STAMPS2) => ({
|
|
@@ -75718,6 +76182,7 @@ var explainOption = Flag_exports.boolean("explain").pipe(Flag_exports.withDescri
|
|
|
75718
76182
|
var jsonOption = Flag_exports.boolean("json").pipe(Flag_exports.withDescription("Machine-readable combined report: { summaries, links, exitCode }."));
|
|
75719
76183
|
var linksOnlyOption = Flag_exports.boolean("links-only").pipe(Flag_exports.withDescription("Check only Markdown links."));
|
|
75720
76184
|
var summariesOnlyOption = Flag_exports.boolean("summaries-only").pipe(Flag_exports.withDescription("Check only summary freshness."));
|
|
76185
|
+
var refsOption = Flag_exports.boolean("refs").pipe(Flag_exports.withDescription(`Opt-in (issue #39 Scenario I, v1/whole-file): with --stamp, record each doc's real reference targets' content hashes into .cairn/**; without --stamp, report any whose target content has drifted since \u2014 "may be stale," distinct from a broken link.`));
|
|
75721
76186
|
var configPathOption = Flag_exports.string("config").pipe(Flag_exports.withDescription("Path to a config file (default: .cairnrc.json / .cairnrc / package.json#cairn)."), Flag_exports.optional);
|
|
75722
76187
|
var thresholdOption = Flag_exports.integer("threshold").pipe(Flag_exports.withDescription("Line count above which a file needs a summary (overrides config)."), Flag_exports.optional);
|
|
75723
76188
|
var localeOption = Flag_exports.choice("locale", LOCALES).pipe(Flag_exports.withDescription("Report language (overrides config)."), Flag_exports.optional);
|
|
@@ -75742,6 +76207,11 @@ var runCheck = Effect_exports.fn("runCheck")(function* (parsed) {
|
|
|
75742
76207
|
yield* Effect_exports.sync(() => process.exitCode = 1);
|
|
75743
76208
|
return;
|
|
75744
76209
|
}
|
|
76210
|
+
if (parsed.json && parsed.refs) {
|
|
76211
|
+
yield* Console_exports.log(JSON.stringify({ error: "--json cannot be combined with --refs yet" }));
|
|
76212
|
+
yield* Effect_exports.sync(() => process.exitCode = 1);
|
|
76213
|
+
return;
|
|
76214
|
+
}
|
|
75745
76215
|
const absRoots = expandRoots(cwd, config.roots);
|
|
75746
76216
|
const summaryArgs = {
|
|
75747
76217
|
base: cwd,
|
|
@@ -75761,7 +76231,7 @@ var runCheck = Effect_exports.fn("runCheck")(function* (parsed) {
|
|
|
75761
76231
|
}));
|
|
75762
76232
|
}
|
|
75763
76233
|
if (config.checks.links && !parsed.summariesOnly) {
|
|
75764
|
-
const links = yield* checkLinks({ fix: parsed.fix, ignore: config.ignore, roots: absRoots });
|
|
76234
|
+
const links = yield* checkLinks({ base: cwd, fix: parsed.fix, ignore: config.ignore, roots: absRoots });
|
|
75765
76235
|
linksResult = links;
|
|
75766
76236
|
if (!parsed.json) {
|
|
75767
76237
|
yield* Console_exports.log(formatLinkReport(links, { locale }).join("\n"));
|
|
@@ -75819,6 +76289,20 @@ var runCheck = Effect_exports.fn("runCheck")(function* (parsed) {
|
|
|
75819
76289
|
code = Math.max(code, summaryExitCode(summaries));
|
|
75820
76290
|
}
|
|
75821
76291
|
}
|
|
76292
|
+
if (parsed.refs) {
|
|
76293
|
+
const refsArgs = { base: cwd, roots: absRoots };
|
|
76294
|
+
if (parsed.stamp) {
|
|
76295
|
+
const result3 = yield* stampRefs(refsArgs);
|
|
76296
|
+
yield* Console_exports.log(pick3(locale, {
|
|
76297
|
+
en: `\u{1F517} Stamped ${result3.stamped} doc(s)' reference hash(es) (.cairn/** sidecar).`,
|
|
76298
|
+
fr: `\u{1F517} ${result3.stamped} document(s) tamponn\xE9(s) (hachage des r\xE9f\xE9rences, fichier annexe .cairn/**).`
|
|
76299
|
+
}));
|
|
76300
|
+
} else {
|
|
76301
|
+
const result3 = yield* checkRefs(refsArgs);
|
|
76302
|
+
yield* Console_exports.log(formatRefsReport(result3, { locale }).join("\n"));
|
|
76303
|
+
code = Math.max(code, refsExitCode(result3));
|
|
76304
|
+
}
|
|
76305
|
+
}
|
|
75822
76306
|
if (parsed.json) {
|
|
75823
76307
|
const report = buildJsonReport({ links: linksResult, summaries: summariesResult });
|
|
75824
76308
|
yield* Console_exports.log(JSON.stringify(report, null, 2));
|
|
@@ -75837,6 +76321,7 @@ var checkConfigShape = {
|
|
|
75837
76321
|
locale: localeOption,
|
|
75838
76322
|
migrateStamps: migrateStampsOption,
|
|
75839
76323
|
prune: pruneOption,
|
|
76324
|
+
refs: refsOption,
|
|
75840
76325
|
root: rootOption,
|
|
75841
76326
|
roots: rootsArgs,
|
|
75842
76327
|
stamp: stampOption,
|
|
@@ -75872,7 +76357,7 @@ var runConfigCommand = Effect_exports.fn("runConfig")(function* ({ config: confi
|
|
|
75872
76357
|
});
|
|
75873
76358
|
var configCommand = Command_exports.make("config", { config: configPathOption, locale: localeOption, path: configPathArg, root: rootOption, threshold: thresholdOption }, runConfigCommand).pipe(Command_exports.withDescription(`Print the resolved config, which file it came from, and expanded roots (debug "why aren't my docs checked").`));
|
|
75874
76359
|
var cairn = Command_exports.make("cairn", checkConfigShape, runCheck).pipe(Command_exports.withSubcommands([checkCommand, initCommand, configCommand]));
|
|
75875
|
-
var packageJsonPath =
|
|
76360
|
+
var packageJsonPath = path13.join(import.meta.dirname, "..", "package.json");
|
|
75876
76361
|
var { version: version2 } = JSON.parse(fs3.readFileSync(packageJsonPath, "utf8"));
|
|
75877
76362
|
cairn.pipe(Command_exports.run({ version: version2 }), Effect_exports.tapErrorTag("CairnConfigError", (error2) => Console_exports.error(error2.message)), Effect_exports.provide(DocsFsLive), Effect_exports.provide(NodeServices_exports.layer), NodeRuntime_exports.runMain);
|
|
75878
76363
|
/*! Bundled license information:
|