react-doctor 0.9.2-dev.b1352a2 → 0.9.2-dev.c126684
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 +2 -2
- package/dist/cli.js +832 -125
- package/dist/index.d.ts +8 -2
- package/dist/index.js +553 -32
- package/dist/lsp.js +554 -32
- package/package.json +6 -5
package/dist/lsp.js
CHANGED
|
@@ -17,6 +17,7 @@ import { fileURLToPath } from "node:url";
|
|
|
17
17
|
import { parseJSON5 } from "confbox";
|
|
18
18
|
import { createJiti } from "jiti";
|
|
19
19
|
import { ANALYZED_MANIFEST_FILENAMES, DEFAULT_EXTENSIONS } from "deslop-js/analyzed-inputs";
|
|
20
|
+
import { convertToTSX } from "@astrojs/compiler/sync";
|
|
20
21
|
import { gzipSync } from "node:zlib";
|
|
21
22
|
import { CodeActionKind, CodeActionTriggerKind, DidChangeWatchedFilesNotification, DocumentDiagnosticReportKind, FileChangeType, TextDocumentSyncKind, TextDocuments, createConnection } from "vscode-languageserver/node.js";
|
|
22
23
|
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
@@ -10280,7 +10281,7 @@ const Number$4 = globalThis.Number;
|
|
|
10280
10281
|
* @category constructors
|
|
10281
10282
|
* @since 2.0.0
|
|
10282
10283
|
*/
|
|
10283
|
-
const parse = (s) => {
|
|
10284
|
+
const parse$1 = (s) => {
|
|
10284
10285
|
if (s === "NaN") return some(NaN);
|
|
10285
10286
|
if (s === "Infinity") return some(Infinity);
|
|
10286
10287
|
if (s === "-Infinity") return some(-Infinity);
|
|
@@ -14334,12 +14335,12 @@ TaggedError("EncodingError");
|
|
|
14334
14335
|
//#endregion
|
|
14335
14336
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.70/node_modules/effect/dist/internal/schema/annotations.js
|
|
14336
14337
|
/** @internal */
|
|
14337
|
-
function resolve(ast) {
|
|
14338
|
+
function resolve$1(ast) {
|
|
14338
14339
|
return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
|
|
14339
14340
|
}
|
|
14340
14341
|
/** @internal */
|
|
14341
14342
|
function resolveAt(key) {
|
|
14342
|
-
return (ast) => resolve(ast)?.[key];
|
|
14343
|
+
return (ast) => resolve$1(ast)?.[key];
|
|
14343
14344
|
}
|
|
14344
14345
|
/** @internal */
|
|
14345
14346
|
const resolveIdentifier = /* @__PURE__ */ resolveAt("identifier");
|
|
@@ -18091,7 +18092,7 @@ function asSync(parser) {
|
|
|
18091
18092
|
}
|
|
18092
18093
|
const recur$1 = /* @__PURE__ */ memoize((ast) => {
|
|
18093
18094
|
let parser;
|
|
18094
|
-
const astOptions = resolve(ast)?.["parseOptions"];
|
|
18095
|
+
const astOptions = resolve$1(ast)?.["parseOptions"];
|
|
18095
18096
|
if (!ast.context && !ast.encoding && !ast.checks) return (ou, options) => {
|
|
18096
18097
|
parser ??= ast.getParser(recur$1);
|
|
18097
18098
|
if (astOptions) options = {
|
|
@@ -57696,7 +57697,7 @@ var UrlParamsError = class extends TaggedError("UrlParamsError") {};
|
|
|
57696
57697
|
* @category converting
|
|
57697
57698
|
* @since 4.0.0
|
|
57698
57699
|
*/
|
|
57699
|
-
const makeUrl = (url, params, hash) => {
|
|
57700
|
+
const makeUrl$1 = (url, params, hash) => {
|
|
57700
57701
|
try {
|
|
57701
57702
|
const urlInstance = new URL(url, baseUrl());
|
|
57702
57703
|
for (let i = 0; i < params.params.length; i++) {
|
|
@@ -58330,7 +58331,7 @@ const Proto$2 = {
|
|
|
58330
58331
|
const make$10 = (f) => makeWith$1((effect) => flatMap$2(effect, (request) => withFiber((fiber) => {
|
|
58331
58332
|
const scopedController = scopedRequests.get(request);
|
|
58332
58333
|
const controller = scopedController ?? new AbortController();
|
|
58333
|
-
const urlResult = makeUrl(request.url, request.urlParams, getOrUndefined(request.hash));
|
|
58334
|
+
const urlResult = makeUrl$1(request.url, request.urlParams, getOrUndefined(request.hash));
|
|
58334
58335
|
if (isFailure(urlResult)) return fail$4(new HttpClientError({ reason: new InvalidUrlError({
|
|
58335
58336
|
request,
|
|
58336
58337
|
cause: urlResult.failure
|
|
@@ -58769,7 +58770,7 @@ const layer$7 = (loggers, options) => effect(CurrentLoggers, withFiber$1(fnUntra
|
|
|
58769
58770
|
* @since 4.0.0
|
|
58770
58771
|
*/
|
|
58771
58772
|
const policy = /* @__PURE__ */ forever$1.pipe(passthrough$2, /* @__PURE__ */ addDelay((error) => {
|
|
58772
|
-
if (isHttpClientError(error) && error.reason._tag === "StatusCodeError" && error.reason.response.status === 429) return succeed$2(seconds(fromUndefinedOr(error.reason.response.headers["retry-after"]).pipe(flatMap$5(parse), getOrElse$1(() => 5))));
|
|
58773
|
+
if (isHttpClientError(error) && error.reason._tag === "StatusCodeError" && error.reason.response.status === 429) return succeed$2(seconds(fromUndefinedOr(error.reason.response.headers["retry-after"]).pipe(flatMap$5(parse$1), getOrElse$1(() => 5))));
|
|
58773
58774
|
return succeed$2(seconds(1));
|
|
58774
58775
|
}));
|
|
58775
58776
|
/**
|
|
@@ -61411,6 +61412,428 @@ const layer = /* @__PURE__ */ succeed$3(Path$1)({
|
|
|
61411
61412
|
toFileUrl
|
|
61412
61413
|
});
|
|
61413
61414
|
//#endregion
|
|
61415
|
+
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
61416
|
+
var comma = ",".charCodeAt(0);
|
|
61417
|
+
";".charCodeAt(0);
|
|
61418
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
61419
|
+
var intToChar = new Uint8Array(64);
|
|
61420
|
+
var charToInt = new Uint8Array(128);
|
|
61421
|
+
for (let i = 0; i < chars.length; i++) {
|
|
61422
|
+
const c = chars.charCodeAt(i);
|
|
61423
|
+
intToChar[i] = c;
|
|
61424
|
+
charToInt[c] = i;
|
|
61425
|
+
}
|
|
61426
|
+
function decodeInteger(reader, relative) {
|
|
61427
|
+
let value = 0;
|
|
61428
|
+
let shift = 0;
|
|
61429
|
+
let integer = 0;
|
|
61430
|
+
do {
|
|
61431
|
+
integer = charToInt[reader.next()];
|
|
61432
|
+
value |= (integer & 31) << shift;
|
|
61433
|
+
shift += 5;
|
|
61434
|
+
} while (integer & 32);
|
|
61435
|
+
const shouldNegate = value & 1;
|
|
61436
|
+
value >>>= 1;
|
|
61437
|
+
if (shouldNegate) value = -2147483648 | -value;
|
|
61438
|
+
return relative + value;
|
|
61439
|
+
}
|
|
61440
|
+
function hasMoreVlq(reader, max) {
|
|
61441
|
+
if (reader.pos >= max) return false;
|
|
61442
|
+
return reader.peek() !== comma;
|
|
61443
|
+
}
|
|
61444
|
+
var StringReader = class {
|
|
61445
|
+
constructor(buffer) {
|
|
61446
|
+
this.pos = 0;
|
|
61447
|
+
this.buffer = buffer;
|
|
61448
|
+
}
|
|
61449
|
+
next() {
|
|
61450
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
61451
|
+
}
|
|
61452
|
+
peek() {
|
|
61453
|
+
return this.buffer.charCodeAt(this.pos);
|
|
61454
|
+
}
|
|
61455
|
+
indexOf(char) {
|
|
61456
|
+
const { buffer, pos } = this;
|
|
61457
|
+
const idx = buffer.indexOf(char, pos);
|
|
61458
|
+
return idx === -1 ? buffer.length : idx;
|
|
61459
|
+
}
|
|
61460
|
+
};
|
|
61461
|
+
function decode(mappings) {
|
|
61462
|
+
const { length } = mappings;
|
|
61463
|
+
const reader = new StringReader(mappings);
|
|
61464
|
+
const decoded = [];
|
|
61465
|
+
let genColumn = 0;
|
|
61466
|
+
let sourcesIndex = 0;
|
|
61467
|
+
let sourceLine = 0;
|
|
61468
|
+
let sourceColumn = 0;
|
|
61469
|
+
let namesIndex = 0;
|
|
61470
|
+
do {
|
|
61471
|
+
const semi = reader.indexOf(";");
|
|
61472
|
+
const line = [];
|
|
61473
|
+
let sorted = true;
|
|
61474
|
+
let lastCol = 0;
|
|
61475
|
+
genColumn = 0;
|
|
61476
|
+
while (reader.pos < semi) {
|
|
61477
|
+
let seg;
|
|
61478
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
61479
|
+
if (genColumn < lastCol) sorted = false;
|
|
61480
|
+
lastCol = genColumn;
|
|
61481
|
+
if (hasMoreVlq(reader, semi)) {
|
|
61482
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
61483
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
61484
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
61485
|
+
if (hasMoreVlq(reader, semi)) {
|
|
61486
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
61487
|
+
seg = [
|
|
61488
|
+
genColumn,
|
|
61489
|
+
sourcesIndex,
|
|
61490
|
+
sourceLine,
|
|
61491
|
+
sourceColumn,
|
|
61492
|
+
namesIndex
|
|
61493
|
+
];
|
|
61494
|
+
} else seg = [
|
|
61495
|
+
genColumn,
|
|
61496
|
+
sourcesIndex,
|
|
61497
|
+
sourceLine,
|
|
61498
|
+
sourceColumn
|
|
61499
|
+
];
|
|
61500
|
+
} else seg = [genColumn];
|
|
61501
|
+
line.push(seg);
|
|
61502
|
+
reader.pos++;
|
|
61503
|
+
}
|
|
61504
|
+
if (!sorted) sort(line);
|
|
61505
|
+
decoded.push(line);
|
|
61506
|
+
reader.pos = semi + 1;
|
|
61507
|
+
} while (reader.pos <= length);
|
|
61508
|
+
return decoded;
|
|
61509
|
+
}
|
|
61510
|
+
function sort(line) {
|
|
61511
|
+
line.sort(sortComparator$1);
|
|
61512
|
+
}
|
|
61513
|
+
function sortComparator$1(a, b) {
|
|
61514
|
+
return a[0] - b[0];
|
|
61515
|
+
}
|
|
61516
|
+
//#endregion
|
|
61517
|
+
//#region ../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
61518
|
+
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
61519
|
+
/**
|
|
61520
|
+
* Matches the parts of a URL:
|
|
61521
|
+
* 1. Scheme, including ":", guaranteed.
|
|
61522
|
+
* 2. User/password, including "@", optional.
|
|
61523
|
+
* 3. Host, guaranteed.
|
|
61524
|
+
* 4. Port, including ":", optional.
|
|
61525
|
+
* 5. Path, including "/", optional.
|
|
61526
|
+
* 6. Query, including "?", optional.
|
|
61527
|
+
* 7. Hash, including "#", optional.
|
|
61528
|
+
*/
|
|
61529
|
+
const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
61530
|
+
/**
|
|
61531
|
+
* File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
|
|
61532
|
+
* with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
|
|
61533
|
+
*
|
|
61534
|
+
* 1. Host, optional.
|
|
61535
|
+
* 2. Path, which may include "/", guaranteed.
|
|
61536
|
+
* 3. Query, including "?", optional.
|
|
61537
|
+
* 4. Hash, including "#", optional.
|
|
61538
|
+
*/
|
|
61539
|
+
const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
61540
|
+
function isAbsoluteUrl(input) {
|
|
61541
|
+
return schemeRegex.test(input);
|
|
61542
|
+
}
|
|
61543
|
+
function isSchemeRelativeUrl(input) {
|
|
61544
|
+
return input.startsWith("//");
|
|
61545
|
+
}
|
|
61546
|
+
function isAbsolutePath(input) {
|
|
61547
|
+
return input.startsWith("/");
|
|
61548
|
+
}
|
|
61549
|
+
function isFileUrl(input) {
|
|
61550
|
+
return input.startsWith("file:");
|
|
61551
|
+
}
|
|
61552
|
+
function isRelative(input) {
|
|
61553
|
+
return /^[.?#]/.test(input);
|
|
61554
|
+
}
|
|
61555
|
+
function parseAbsoluteUrl(input) {
|
|
61556
|
+
const match = urlRegex.exec(input);
|
|
61557
|
+
return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
|
|
61558
|
+
}
|
|
61559
|
+
function parseFileUrl(input) {
|
|
61560
|
+
const match = fileRegex.exec(input);
|
|
61561
|
+
const path = match[2];
|
|
61562
|
+
return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
|
|
61563
|
+
}
|
|
61564
|
+
function makeUrl(scheme, user, host, port, path, query, hash) {
|
|
61565
|
+
return {
|
|
61566
|
+
scheme,
|
|
61567
|
+
user,
|
|
61568
|
+
host,
|
|
61569
|
+
port,
|
|
61570
|
+
path,
|
|
61571
|
+
query,
|
|
61572
|
+
hash,
|
|
61573
|
+
type: 7
|
|
61574
|
+
};
|
|
61575
|
+
}
|
|
61576
|
+
function parseUrl(input) {
|
|
61577
|
+
if (isSchemeRelativeUrl(input)) {
|
|
61578
|
+
const url = parseAbsoluteUrl("http:" + input);
|
|
61579
|
+
url.scheme = "";
|
|
61580
|
+
url.type = 6;
|
|
61581
|
+
return url;
|
|
61582
|
+
}
|
|
61583
|
+
if (isAbsolutePath(input)) {
|
|
61584
|
+
const url = parseAbsoluteUrl("http://foo.com" + input);
|
|
61585
|
+
url.scheme = "";
|
|
61586
|
+
url.host = "";
|
|
61587
|
+
url.type = 5;
|
|
61588
|
+
return url;
|
|
61589
|
+
}
|
|
61590
|
+
if (isFileUrl(input)) return parseFileUrl(input);
|
|
61591
|
+
if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
|
|
61592
|
+
const url = parseAbsoluteUrl("http://foo.com/" + input);
|
|
61593
|
+
url.scheme = "";
|
|
61594
|
+
url.host = "";
|
|
61595
|
+
url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
61596
|
+
return url;
|
|
61597
|
+
}
|
|
61598
|
+
function stripPathFilename(path) {
|
|
61599
|
+
if (path.endsWith("/..")) return path;
|
|
61600
|
+
const index = path.lastIndexOf("/");
|
|
61601
|
+
return path.slice(0, index + 1);
|
|
61602
|
+
}
|
|
61603
|
+
function mergePaths(url, base) {
|
|
61604
|
+
normalizePath(base, base.type);
|
|
61605
|
+
if (url.path === "/") url.path = base.path;
|
|
61606
|
+
else url.path = stripPathFilename(base.path) + url.path;
|
|
61607
|
+
}
|
|
61608
|
+
/**
|
|
61609
|
+
* The path can have empty directories "//", unneeded parents "foo/..", or current directory
|
|
61610
|
+
* "foo/.". We need to normalize to a standard representation.
|
|
61611
|
+
*/
|
|
61612
|
+
function normalizePath(url, type) {
|
|
61613
|
+
const rel = type <= 4;
|
|
61614
|
+
const pieces = url.path.split("/");
|
|
61615
|
+
let pointer = 1;
|
|
61616
|
+
let positive = 0;
|
|
61617
|
+
let addTrailingSlash = false;
|
|
61618
|
+
for (let i = 1; i < pieces.length; i++) {
|
|
61619
|
+
const piece = pieces[i];
|
|
61620
|
+
if (!piece) {
|
|
61621
|
+
addTrailingSlash = true;
|
|
61622
|
+
continue;
|
|
61623
|
+
}
|
|
61624
|
+
addTrailingSlash = false;
|
|
61625
|
+
if (piece === ".") continue;
|
|
61626
|
+
if (piece === "..") {
|
|
61627
|
+
if (positive) {
|
|
61628
|
+
addTrailingSlash = true;
|
|
61629
|
+
positive--;
|
|
61630
|
+
pointer--;
|
|
61631
|
+
} else if (rel) pieces[pointer++] = piece;
|
|
61632
|
+
continue;
|
|
61633
|
+
}
|
|
61634
|
+
pieces[pointer++] = piece;
|
|
61635
|
+
positive++;
|
|
61636
|
+
}
|
|
61637
|
+
let path = "";
|
|
61638
|
+
for (let i = 1; i < pointer; i++) path += "/" + pieces[i];
|
|
61639
|
+
if (!path || addTrailingSlash && !path.endsWith("/..")) path += "/";
|
|
61640
|
+
url.path = path;
|
|
61641
|
+
}
|
|
61642
|
+
/**
|
|
61643
|
+
* Attempts to resolve `input` URL/path relative to `base`.
|
|
61644
|
+
*/
|
|
61645
|
+
function resolve(input, base) {
|
|
61646
|
+
if (!input && !base) return "";
|
|
61647
|
+
const url = parseUrl(input);
|
|
61648
|
+
let inputType = url.type;
|
|
61649
|
+
if (base && inputType !== 7) {
|
|
61650
|
+
const baseUrl = parseUrl(base);
|
|
61651
|
+
const baseType = baseUrl.type;
|
|
61652
|
+
switch (inputType) {
|
|
61653
|
+
case 1: url.hash = baseUrl.hash;
|
|
61654
|
+
case 2: url.query = baseUrl.query;
|
|
61655
|
+
case 3:
|
|
61656
|
+
case 4: mergePaths(url, baseUrl);
|
|
61657
|
+
case 5:
|
|
61658
|
+
url.user = baseUrl.user;
|
|
61659
|
+
url.host = baseUrl.host;
|
|
61660
|
+
url.port = baseUrl.port;
|
|
61661
|
+
case 6: url.scheme = baseUrl.scheme;
|
|
61662
|
+
}
|
|
61663
|
+
if (baseType > inputType) inputType = baseType;
|
|
61664
|
+
}
|
|
61665
|
+
normalizePath(url, inputType);
|
|
61666
|
+
const queryHash = url.query + url.hash;
|
|
61667
|
+
switch (inputType) {
|
|
61668
|
+
case 2:
|
|
61669
|
+
case 3: return queryHash;
|
|
61670
|
+
case 4: {
|
|
61671
|
+
const path = url.path.slice(1);
|
|
61672
|
+
if (!path) return queryHash || ".";
|
|
61673
|
+
if (isRelative(base || input) && !isRelative(path)) return "./" + path + queryHash;
|
|
61674
|
+
return path + queryHash;
|
|
61675
|
+
}
|
|
61676
|
+
case 5: return url.path + queryHash;
|
|
61677
|
+
default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
|
|
61678
|
+
}
|
|
61679
|
+
}
|
|
61680
|
+
//#endregion
|
|
61681
|
+
//#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
61682
|
+
function stripFilename(path) {
|
|
61683
|
+
if (!path) return "";
|
|
61684
|
+
const index = path.lastIndexOf("/");
|
|
61685
|
+
return path.slice(0, index + 1);
|
|
61686
|
+
}
|
|
61687
|
+
function resolver(mapUrl, sourceRoot) {
|
|
61688
|
+
const from = stripFilename(mapUrl);
|
|
61689
|
+
const prefix = sourceRoot ? sourceRoot + "/" : "";
|
|
61690
|
+
return (source) => resolve(prefix + (source || ""), from);
|
|
61691
|
+
}
|
|
61692
|
+
var COLUMN = 0;
|
|
61693
|
+
var SOURCES_INDEX = 1;
|
|
61694
|
+
var SOURCE_LINE = 2;
|
|
61695
|
+
var SOURCE_COLUMN = 3;
|
|
61696
|
+
var NAMES_INDEX = 4;
|
|
61697
|
+
function maybeSort(mappings, owned) {
|
|
61698
|
+
const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
61699
|
+
if (unsortedIndex === mappings.length) return mappings;
|
|
61700
|
+
if (!owned) mappings = mappings.slice();
|
|
61701
|
+
for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) mappings[i] = sortSegments(mappings[i], owned);
|
|
61702
|
+
return mappings;
|
|
61703
|
+
}
|
|
61704
|
+
function nextUnsortedSegmentLine(mappings, start) {
|
|
61705
|
+
for (let i = start; i < mappings.length; i++) if (!isSorted(mappings[i])) return i;
|
|
61706
|
+
return mappings.length;
|
|
61707
|
+
}
|
|
61708
|
+
function isSorted(line) {
|
|
61709
|
+
for (let j = 1; j < line.length; j++) if (line[j][COLUMN] < line[j - 1][COLUMN]) return false;
|
|
61710
|
+
return true;
|
|
61711
|
+
}
|
|
61712
|
+
function sortSegments(line, owned) {
|
|
61713
|
+
if (!owned) line = line.slice();
|
|
61714
|
+
return line.sort(sortComparator);
|
|
61715
|
+
}
|
|
61716
|
+
function sortComparator(a, b) {
|
|
61717
|
+
return a[COLUMN] - b[COLUMN];
|
|
61718
|
+
}
|
|
61719
|
+
var found = false;
|
|
61720
|
+
function binarySearch(haystack, needle, low, high) {
|
|
61721
|
+
while (low <= high) {
|
|
61722
|
+
const mid = low + (high - low >> 1);
|
|
61723
|
+
const cmp = haystack[mid][COLUMN] - needle;
|
|
61724
|
+
if (cmp === 0) {
|
|
61725
|
+
found = true;
|
|
61726
|
+
return mid;
|
|
61727
|
+
}
|
|
61728
|
+
if (cmp < 0) low = mid + 1;
|
|
61729
|
+
else high = mid - 1;
|
|
61730
|
+
}
|
|
61731
|
+
found = false;
|
|
61732
|
+
return low - 1;
|
|
61733
|
+
}
|
|
61734
|
+
function upperBound(haystack, needle, index) {
|
|
61735
|
+
for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN] !== needle) break;
|
|
61736
|
+
return index;
|
|
61737
|
+
}
|
|
61738
|
+
function lowerBound(haystack, needle, index) {
|
|
61739
|
+
for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN] !== needle) break;
|
|
61740
|
+
return index;
|
|
61741
|
+
}
|
|
61742
|
+
function memoizedState() {
|
|
61743
|
+
return {
|
|
61744
|
+
lastKey: -1,
|
|
61745
|
+
lastNeedle: -1,
|
|
61746
|
+
lastIndex: -1
|
|
61747
|
+
};
|
|
61748
|
+
}
|
|
61749
|
+
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
61750
|
+
const { lastKey, lastNeedle, lastIndex } = state;
|
|
61751
|
+
let low = 0;
|
|
61752
|
+
let high = haystack.length - 1;
|
|
61753
|
+
if (key === lastKey) {
|
|
61754
|
+
if (needle === lastNeedle) {
|
|
61755
|
+
found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;
|
|
61756
|
+
return lastIndex;
|
|
61757
|
+
}
|
|
61758
|
+
if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
|
|
61759
|
+
else high = lastIndex;
|
|
61760
|
+
}
|
|
61761
|
+
state.lastKey = key;
|
|
61762
|
+
state.lastNeedle = needle;
|
|
61763
|
+
return state.lastIndex = binarySearch(haystack, needle, low, high);
|
|
61764
|
+
}
|
|
61765
|
+
function parse(map) {
|
|
61766
|
+
return typeof map === "string" ? JSON.parse(map) : map;
|
|
61767
|
+
}
|
|
61768
|
+
var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)";
|
|
61769
|
+
var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
61770
|
+
var TraceMap = class {
|
|
61771
|
+
constructor(map, mapUrl) {
|
|
61772
|
+
const isString = typeof map === "string";
|
|
61773
|
+
if (!isString && map._decodedMemo) return map;
|
|
61774
|
+
const parsed = parse(map);
|
|
61775
|
+
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
61776
|
+
this.version = version;
|
|
61777
|
+
this.file = file;
|
|
61778
|
+
this.names = names || [];
|
|
61779
|
+
this.sourceRoot = sourceRoot;
|
|
61780
|
+
this.sources = sources;
|
|
61781
|
+
this.sourcesContent = sourcesContent;
|
|
61782
|
+
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
61783
|
+
const resolve = resolver(mapUrl, sourceRoot);
|
|
61784
|
+
this.resolvedSources = sources.map(resolve);
|
|
61785
|
+
const { mappings } = parsed;
|
|
61786
|
+
if (typeof mappings === "string") {
|
|
61787
|
+
this._encoded = mappings;
|
|
61788
|
+
this._decoded = void 0;
|
|
61789
|
+
} else if (Array.isArray(mappings)) {
|
|
61790
|
+
this._encoded = void 0;
|
|
61791
|
+
this._decoded = maybeSort(mappings, isString);
|
|
61792
|
+
} else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
|
|
61793
|
+
else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
|
|
61794
|
+
this._decodedMemo = memoizedState();
|
|
61795
|
+
this._bySources = void 0;
|
|
61796
|
+
this._bySourceMemos = void 0;
|
|
61797
|
+
}
|
|
61798
|
+
};
|
|
61799
|
+
function cast(map) {
|
|
61800
|
+
return map;
|
|
61801
|
+
}
|
|
61802
|
+
function decodedMappings(map) {
|
|
61803
|
+
var _a;
|
|
61804
|
+
return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
|
|
61805
|
+
}
|
|
61806
|
+
function originalPositionFor(map, needle) {
|
|
61807
|
+
let { line, column, bias } = needle;
|
|
61808
|
+
line--;
|
|
61809
|
+
if (line < 0) throw new Error(LINE_GTR_ZERO);
|
|
61810
|
+
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
|
|
61811
|
+
const decoded = decodedMappings(map);
|
|
61812
|
+
if (line >= decoded.length) return OMapping(null, null, null, null);
|
|
61813
|
+
const segments = decoded[line];
|
|
61814
|
+
const index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || 1);
|
|
61815
|
+
if (index === -1) return OMapping(null, null, null, null);
|
|
61816
|
+
const segment = segments[index];
|
|
61817
|
+
if (segment.length === 1) return OMapping(null, null, null, null);
|
|
61818
|
+
const { names, resolvedSources } = map;
|
|
61819
|
+
return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
|
|
61820
|
+
}
|
|
61821
|
+
function OMapping(source, line, column, name) {
|
|
61822
|
+
return {
|
|
61823
|
+
source,
|
|
61824
|
+
line,
|
|
61825
|
+
column,
|
|
61826
|
+
name
|
|
61827
|
+
};
|
|
61828
|
+
}
|
|
61829
|
+
function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
61830
|
+
let index = memoizedBinarySearch(segments, column, memo, line);
|
|
61831
|
+
if (found) index = (bias === -1 ? upperBound : lowerBound)(segments, column, index);
|
|
61832
|
+
else if (bias === -1) index++;
|
|
61833
|
+
if (index === -1 || index === segments.length) return -1;
|
|
61834
|
+
return index;
|
|
61835
|
+
}
|
|
61836
|
+
//#endregion
|
|
61414
61837
|
//#region ../core/dist/index.js
|
|
61415
61838
|
var __create = Object.create;
|
|
61416
61839
|
var __defProp = Object.defineProperty;
|
|
@@ -61480,7 +61903,7 @@ var AmbiguousProjectError = class extends Error {
|
|
|
61480
61903
|
};
|
|
61481
61904
|
const isProjectDiscoveryError = (value) => value instanceof ProjectNotFoundError || value instanceof NoReactDependencyError || value instanceof PackageJsonNotFoundError || value instanceof NotADirectoryError || value instanceof AmbiguousProjectError;
|
|
61482
61905
|
const HTML_FILE_PATTERN = /\.html$/i;
|
|
61483
|
-
const SOURCE_FILE_PATTERN = /\.(?:tsx?|jsx?|mts|mjs|[hH][tT][mM][lL])$/;
|
|
61906
|
+
const SOURCE_FILE_PATTERN = /\.(?:astro|tsx?|jsx?|mts|mjs|[hH][tT][mM][lL])$/;
|
|
61484
61907
|
const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
|
|
61485
61908
|
const GENERATED_SOURCE_DIRECTORY_PATTERN = /(?:^|\/)__generated__\//;
|
|
61486
61909
|
const MINIFIED_SNIFF_BYTES = 65536;
|
|
@@ -62231,6 +62654,7 @@ const FRAMEWORK_PACKAGES = {
|
|
|
62231
62654
|
"@tanstack/react-start": "tanstack-start",
|
|
62232
62655
|
"@remix-run/react": "remix",
|
|
62233
62656
|
gatsby: "gatsby",
|
|
62657
|
+
astro: "astro",
|
|
62234
62658
|
vite: "vite",
|
|
62235
62659
|
"react-scripts": "cra",
|
|
62236
62660
|
expo: "expo",
|
|
@@ -69643,7 +70067,10 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
69643
70067
|
if (argvLengthChars > spawnArgsLengthCap) return yield* foldSpawnFailure(`spawn ENAMETOOLONG (${argvLengthChars} argv chars exceed ${spawnArgsLengthCap})`);
|
|
69644
70068
|
const handle = yield* spawner.spawn(make$1(input.command, [...input.args], {
|
|
69645
70069
|
cwd: input.directory,
|
|
69646
|
-
env: input.
|
|
70070
|
+
env: input.command === "git" ? {
|
|
70071
|
+
...input.env,
|
|
70072
|
+
GIT_DIR: void 0
|
|
70073
|
+
} : input.env,
|
|
69647
70074
|
extendEnv: true
|
|
69648
70075
|
}));
|
|
69649
70076
|
const maxStdoutBytes = input.maxStdoutBytes;
|
|
@@ -69916,7 +70343,7 @@ var Git = class Git extends Service()("react-doctor/Git") {
|
|
|
69916
70343
|
"--diff-filter=ACMR",
|
|
69917
70344
|
"--relative"
|
|
69918
70345
|
]).pipe(map$3((result) => {
|
|
69919
|
-
if (result.status !== 0) return
|
|
70346
|
+
if (result.status !== 0) return null;
|
|
69920
70347
|
return splitNullSeparated(result.stdout);
|
|
69921
70348
|
})),
|
|
69922
70349
|
showStagedContent: (directory, relativePath, options) => runCommand({
|
|
@@ -71004,6 +71431,50 @@ const columnOfUtf8Offset = (sourceBuffer, utf8Offset) => {
|
|
|
71004
71431
|
while (lineStartOffset > 0 && sourceBuffer[lineStartOffset - 1] !== 10) lineStartOffset--;
|
|
71005
71432
|
return sourceBuffer.subarray(lineStartOffset, boundedOffset).toString("utf8").length + 1;
|
|
71006
71433
|
};
|
|
71434
|
+
const utf8OffsetFromSourcePosition = (sourceBuffer, lineNumber, zeroBasedColumn) => {
|
|
71435
|
+
if (lineNumber < 1 || zeroBasedColumn < 0) return null;
|
|
71436
|
+
const sourceLines = sourceBuffer.toString("utf8").split("\n");
|
|
71437
|
+
const sourceLine = sourceLines[lineNumber - 1];
|
|
71438
|
+
if (sourceLine === void 0 || zeroBasedColumn > sourceLine.length) return null;
|
|
71439
|
+
const precedingLines = sourceLines.slice(0, lineNumber - 1).join("\n");
|
|
71440
|
+
return (lineNumber === 1 ? 0 : Buffer.byteLength(precedingLines) + Buffer.byteLength("\n")) + Buffer.byteLength(sourceLine.slice(0, zeroBasedColumn));
|
|
71441
|
+
};
|
|
71442
|
+
const mapPreparedSourceSpan = (span, preparedSourceMap) => {
|
|
71443
|
+
const generatedLine = lineOfUtf8Offset(preparedSourceMap.generatedBuffer, span.offset);
|
|
71444
|
+
const generatedColumn = columnOfUtf8Offset(preparedSourceMap.generatedBuffer, span.offset) - 1;
|
|
71445
|
+
const originalStart = originalPositionFor(preparedSourceMap.traceMap, {
|
|
71446
|
+
line: generatedLine,
|
|
71447
|
+
column: generatedColumn
|
|
71448
|
+
});
|
|
71449
|
+
if (originalStart.source === null || originalStart.line === null || originalStart.column === null) return null;
|
|
71450
|
+
const originalOffset = utf8OffsetFromSourcePosition(preparedSourceMap.sourceBuffer, originalStart.line, originalStart.column);
|
|
71451
|
+
if (originalOffset === null) return null;
|
|
71452
|
+
const generatedSpan = preparedSourceMap.generatedBuffer.subarray(span.offset, span.offset + span.length);
|
|
71453
|
+
return {
|
|
71454
|
+
offset: originalOffset,
|
|
71455
|
+
length: preparedSourceMap.sourceBuffer.subarray(originalOffset, originalOffset + generatedSpan.length).equals(generatedSpan) ? generatedSpan.length : 0,
|
|
71456
|
+
line: originalStart.line,
|
|
71457
|
+
column: originalStart.column + 1
|
|
71458
|
+
};
|
|
71459
|
+
};
|
|
71460
|
+
const mapPreparedSourceLabels = (labels, preparedSourceMap) => {
|
|
71461
|
+
const primaryLabel = labels[0];
|
|
71462
|
+
if (primaryLabel === void 0) return null;
|
|
71463
|
+
const primarySpan = mapPreparedSourceSpan(primaryLabel.span, preparedSourceMap);
|
|
71464
|
+
if (primarySpan === null) return null;
|
|
71465
|
+
const mappedLabels = [{
|
|
71466
|
+
...primaryLabel,
|
|
71467
|
+
span: primarySpan
|
|
71468
|
+
}];
|
|
71469
|
+
for (const relatedLabel of labels.slice(1)) {
|
|
71470
|
+
const relatedSpan = mapPreparedSourceSpan(relatedLabel.span, preparedSourceMap);
|
|
71471
|
+
if (relatedSpan !== null) mappedLabels.push({
|
|
71472
|
+
...relatedLabel,
|
|
71473
|
+
span: relatedSpan
|
|
71474
|
+
});
|
|
71475
|
+
}
|
|
71476
|
+
return mappedLabels;
|
|
71477
|
+
};
|
|
71007
71478
|
const REDACTED_PLACEHOLDER = "<redacted>";
|
|
71008
71479
|
const KEEP_PREFIX = `$1${REDACTED_PLACEHOLDER}`;
|
|
71009
71480
|
const KNOWN_SECRET_RULES = [
|
|
@@ -71748,7 +72219,7 @@ const isOxlintOutput = (value) => isRecord(value) && Array.isArray(value.diagnos
|
|
|
71748
72219
|
* to the first `{`. Raises `OxlintOutputUnparseable` when the
|
|
71749
72220
|
* stdout isn't valid JSON or doesn't carry a `diagnostics` array.
|
|
71750
72221
|
*/
|
|
71751
|
-
const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath) => {
|
|
72222
|
+
const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath) => {
|
|
71752
72223
|
if (!stdout) return [];
|
|
71753
72224
|
const jsonStart = stdout.indexOf("{");
|
|
71754
72225
|
const sanitizedStdout = jsonStart > 0 ? stdout.slice(jsonStart) : stdout;
|
|
@@ -71766,6 +72237,7 @@ const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath)
|
|
|
71766
72237
|
const sourceLinesCache = /* @__PURE__ */ new Map();
|
|
71767
72238
|
const resolveAbsolutePath = (filename) => Path.isAbsolute(filename) ? filename : Path.resolve(rootDirectory || ".", filename);
|
|
71768
72239
|
const resolveMappedSourceFilename = (filename) => sourcePathByLintPath?.get(Path.normalize(resolveAbsolutePath(filename)));
|
|
72240
|
+
const resolvePreparedSourceMap = (filename) => sourceMapByLintPath?.get(Path.normalize(resolveAbsolutePath(filename)));
|
|
71769
72241
|
const resolveSourceFilename = (filename) => resolveMappedSourceFilename(filename) ?? filename;
|
|
71770
72242
|
const readSourceBuffer = (filename) => {
|
|
71771
72243
|
const absolutePath = resolveAbsolutePath(resolveSourceFilename(filename));
|
|
@@ -71797,7 +72269,19 @@ const parseOxlintOutput = (stdout, project, rootDirectory, sourcePathByLintPath)
|
|
|
71797
72269
|
minifiedFileCache.set(absolutePath, minified);
|
|
71798
72270
|
return minified;
|
|
71799
72271
|
};
|
|
71800
|
-
return suppressMemoizationInBailedOutFunctions(parsed.diagnostics.
|
|
72272
|
+
return suppressMemoizationInBailedOutFunctions(parsed.diagnostics.flatMap((diagnostic) => {
|
|
72273
|
+
const preparedSourceMap = resolvePreparedSourceMap(diagnostic.filename);
|
|
72274
|
+
if (preparedSourceMap === void 0) return [diagnostic];
|
|
72275
|
+
const { plugin, rule } = parseRuleCode(diagnostic.code);
|
|
72276
|
+
if (plugin !== "react-doctor" || !reactDoctorPlugin.rules[rule]?.tags?.includes("design")) return [];
|
|
72277
|
+
const labels = mapPreparedSourceLabels(diagnostic.labels, preparedSourceMap);
|
|
72278
|
+
const sourceFilename = resolveMappedSourceFilename(diagnostic.filename);
|
|
72279
|
+
return labels === null || sourceFilename === void 0 ? [] : [{
|
|
72280
|
+
...diagnostic,
|
|
72281
|
+
filename: sourceFilename,
|
|
72282
|
+
labels
|
|
72283
|
+
}];
|
|
72284
|
+
}).filter((diagnostic) => isMappableOxlintDiagnostic(diagnostic) && isLintableSourceFile(resolveSourceFilename(diagnostic.filename)) && !(TYPESCRIPT_DECLARATION_FILE_PATTERN.test(diagnostic.filename) && OXLINT_IGNORED_DECLARATION_DIAGNOSTIC_CODES.has(diagnostic.code)) && !isMinifiedDiagnosticFile(diagnostic.filename) && !shouldSuppressLocalUseHookDiagnostic(diagnostic, rootDirectory) && !shouldSuppressCompilerFindingInWorklet(diagnostic, project, rootDirectory)).map((diagnostic) => {
|
|
71801
72285
|
const { plugin, rule } = parseRuleCode(diagnostic.code);
|
|
71802
72286
|
const primaryLabel = diagnostic.labels[0];
|
|
71803
72287
|
const cleaned = cleanDiagnosticMessage(diagnostic.message, diagnostic.help, plugin, rule, project);
|
|
@@ -72015,7 +72499,7 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
72015
72499
|
* loop with a slimmer config in that case.
|
|
72016
72500
|
*/
|
|
72017
72501
|
const spawnLintBatches = async (input) => {
|
|
72018
|
-
const { baseArgs, fileBatches, rootDirectory, nodeBinaryPath, project, sourcePathByLintPath, onPartialFailure, onFileProgress, spawnTimeoutMs, outputMaxBytes, splitTotalBudgetMs = OXLINT_SPLIT_TOTAL_BUDGET_MS, splitMaxDepth = 8, signal, deadlineEpochMs } = input;
|
|
72502
|
+
const { baseArgs, fileBatches, rootDirectory, nodeBinaryPath, project, sourcePathByLintPath, sourceMapByLintPath, onPartialFailure, onFileProgress, spawnTimeoutMs, outputMaxBytes, splitTotalBudgetMs = OXLINT_SPLIT_TOTAL_BUDGET_MS, splitMaxDepth = 8, signal, deadlineEpochMs } = input;
|
|
72019
72503
|
const resolveSourcePath = (filePath) => {
|
|
72020
72504
|
const absoluteFilePath = Path.isAbsolute(filePath) ? filePath : Path.resolve(rootDirectory, filePath);
|
|
72021
72505
|
return sourcePathByLintPath?.get(Path.normalize(absoluteFilePath)) ?? filePath;
|
|
@@ -72039,7 +72523,7 @@ const spawnLintBatches = async (input) => {
|
|
|
72039
72523
|
}
|
|
72040
72524
|
const batchArgs = [...baseArgs, ...batch];
|
|
72041
72525
|
try {
|
|
72042
|
-
return parseOxlintOutput(await spawnOxlint(batchArgs, rootDirectory, nodeBinaryPath, spawnTimeoutMs, outputMaxBytes, signal), project, rootDirectory, sourcePathByLintPath);
|
|
72526
|
+
return parseOxlintOutput(await spawnOxlint(batchArgs, rootDirectory, nodeBinaryPath, spawnTimeoutMs, outputMaxBytes, signal), project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath);
|
|
72043
72527
|
} catch (error) {
|
|
72044
72528
|
if (!isSplittableReactDoctorError(error)) throw error;
|
|
72045
72529
|
if (isPastDeadline()) {
|
|
@@ -72478,20 +72962,47 @@ const prepareHtmlScriptSource = (sourceBuffer) => {
|
|
|
72478
72962
|
lintBuffer: maskedBuffer ?? sourceBuffer
|
|
72479
72963
|
};
|
|
72480
72964
|
};
|
|
72481
|
-
const
|
|
72965
|
+
const ASTRO_FILE_PATTERN = /\.astro$/;
|
|
72966
|
+
const prepareLintSources = (rootDirectory, temporaryDirectory, candidateFiles) => {
|
|
72482
72967
|
const lintFiles = [];
|
|
72483
72968
|
const sourcePathByLintPath = /* @__PURE__ */ new Map();
|
|
72969
|
+
const sourceMapByLintPath = /* @__PURE__ */ new Map();
|
|
72484
72970
|
const sizeByLintPath = /* @__PURE__ */ new Map();
|
|
72485
72971
|
const htmlSourcesDirectory = Path.join(temporaryDirectory, "html-sources");
|
|
72972
|
+
const astroSourcesDirectory = Path.join(temporaryDirectory, "astro-sources");
|
|
72486
72973
|
let htmlFileIndex = 0;
|
|
72974
|
+
let astroFileIndex = 0;
|
|
72487
72975
|
let hasThreeModuleImport = false;
|
|
72488
72976
|
for (const candidateFile of candidateFiles) {
|
|
72489
|
-
if (!HTML_FILE_PATTERN.test(candidateFile)) {
|
|
72977
|
+
if (!HTML_FILE_PATTERN.test(candidateFile) && !ASTRO_FILE_PATTERN.test(candidateFile)) {
|
|
72490
72978
|
lintFiles.push(candidateFile);
|
|
72491
72979
|
continue;
|
|
72492
72980
|
}
|
|
72493
72981
|
const absoluteSourcePath = Path.isAbsolute(candidateFile) ? candidateFile : Path.resolve(rootDirectory, candidateFile);
|
|
72494
72982
|
const sourceBuffer = NFS.readFileSync(absoluteSourcePath);
|
|
72983
|
+
if (ASTRO_FILE_PATTERN.test(candidateFile)) {
|
|
72984
|
+
const compilerSourcePath = absoluteSourcePath.replaceAll("\\", "/");
|
|
72985
|
+
const convertedSource = convertToTSX(sourceBuffer.toString("utf8"), {
|
|
72986
|
+
filename: compilerSourcePath,
|
|
72987
|
+
sourcemap: "external",
|
|
72988
|
+
includeScripts: true
|
|
72989
|
+
});
|
|
72990
|
+
if (astroFileIndex === 0) NFS.mkdirSync(astroSourcesDirectory, { recursive: true });
|
|
72991
|
+
const lintPath = Path.join(astroSourcesDirectory, `${astroFileIndex}.tsx`);
|
|
72992
|
+
const generatedBuffer = Buffer.from(convertedSource.code);
|
|
72993
|
+
NFS.writeFileSync(lintPath, generatedBuffer);
|
|
72994
|
+
lintFiles.push(candidateFile);
|
|
72995
|
+
lintFiles.push(lintPath);
|
|
72996
|
+
sourcePathByLintPath.set(Path.resolve(lintPath), candidateFile);
|
|
72997
|
+
sourceMapByLintPath.set(Path.resolve(lintPath), {
|
|
72998
|
+
traceMap: new TraceMap(JSON.stringify(convertedSource.map)),
|
|
72999
|
+
generatedBuffer,
|
|
73000
|
+
sourceBuffer
|
|
73001
|
+
});
|
|
73002
|
+
sizeByLintPath.set(lintPath, sourceBuffer.length);
|
|
73003
|
+
astroFileIndex++;
|
|
73004
|
+
continue;
|
|
73005
|
+
}
|
|
72495
73006
|
const { executableScriptBodies, lintBuffer } = prepareHtmlScriptSource(sourceBuffer);
|
|
72496
73007
|
if (htmlFileIndex === 0) NFS.mkdirSync(htmlSourcesDirectory, { recursive: true });
|
|
72497
73008
|
const lintPath = Path.join(htmlSourcesDirectory, `${htmlFileIndex}.astro`);
|
|
@@ -72505,6 +73016,7 @@ const prepareHtmlLintSources = (rootDirectory, temporaryDirectory, candidateFile
|
|
|
72505
73016
|
return {
|
|
72506
73017
|
lintFiles,
|
|
72507
73018
|
sourcePathByLintPath,
|
|
73019
|
+
sourceMapByLintPath,
|
|
72508
73020
|
sizeByLintPath,
|
|
72509
73021
|
hasThreeModuleImport
|
|
72510
73022
|
};
|
|
@@ -72723,10 +73235,10 @@ const runOxlint = async (options) => {
|
|
|
72723
73235
|
rootDirectory,
|
|
72724
73236
|
candidateFiles
|
|
72725
73237
|
});
|
|
72726
|
-
const
|
|
72727
|
-
const lintFiles =
|
|
72728
|
-
const
|
|
72729
|
-
const lintProject = !project.hasThree &&
|
|
73238
|
+
const preparedLintSources = prepareLintSources(rootDirectory, configDirectory, candidateFiles);
|
|
73239
|
+
const lintFiles = preparedLintSources.lintFiles;
|
|
73240
|
+
const hasPreparedFiles = preparedLintSources.sourcePathByLintPath.size > 0;
|
|
73241
|
+
const lintProject = !project.hasThree && preparedLintSources.hasThreeModuleImport ? {
|
|
72730
73242
|
...project,
|
|
72731
73243
|
hasThree: true
|
|
72732
73244
|
} : project;
|
|
@@ -72748,7 +73260,7 @@ const runOxlint = async (options) => {
|
|
|
72748
73260
|
sidecarRuleIdFilter: overrides.sidecarRuleIdFilter
|
|
72749
73261
|
});
|
|
72750
73262
|
const sizeByFile = sizedScanFiles !== null && lintBatchOrdering === "cost" ? new Map(sizedScanFiles.map((entry) => [entry.path, entry.sizeBytes])) : null;
|
|
72751
|
-
if (sizeByFile !== null) for (const [lintPath, sizeBytes] of
|
|
73263
|
+
if (sizeByFile !== null) for (const [lintPath, sizeBytes] of preparedLintSources.sizeByLintPath) sizeByFile.set(lintPath, sizeBytes);
|
|
72752
73264
|
const buildFileBatches = (passBaseArgs, passFiles) => sizeByFile !== null ? planLintBatches({
|
|
72753
73265
|
baseArgs: passBaseArgs,
|
|
72754
73266
|
files: passFiles,
|
|
@@ -72778,7 +73290,8 @@ const runOxlint = async (options) => {
|
|
|
72778
73290
|
rootDirectory,
|
|
72779
73291
|
nodeBinaryPath,
|
|
72780
73292
|
project: lintProject,
|
|
72781
|
-
sourcePathByLintPath:
|
|
73293
|
+
sourcePathByLintPath: preparedLintSources.sourcePathByLintPath,
|
|
73294
|
+
sourceMapByLintPath: preparedLintSources.sourceMapByLintPath,
|
|
72782
73295
|
onPartialFailure: reportPartialFailure,
|
|
72783
73296
|
onAnalyzedFiles: (filePaths) => {
|
|
72784
73297
|
analyzedFiles = filePaths;
|
|
@@ -72813,7 +73326,7 @@ const runOxlint = async (options) => {
|
|
|
72813
73326
|
};
|
|
72814
73327
|
}
|
|
72815
73328
|
};
|
|
72816
|
-
if (perFileLintCacheEnabled && !project.hasReactCompiler && project.hasReactCompilerLintPlugin !== true && extendsPaths.length === 0 && userPlugins.length === 0 && !
|
|
73329
|
+
if (perFileLintCacheEnabled && !project.hasReactCompiler && project.hasReactCompilerLintPlugin !== true && extendsPaths.length === 0 && userPlugins.length === 0 && !hasPreparedFiles) {
|
|
72817
73330
|
const rulesetHash = computeRulesetHash({
|
|
72818
73331
|
config: buildConfig({
|
|
72819
73332
|
extendsPaths: [],
|
|
@@ -72979,7 +73492,8 @@ const runOxlint = async (options) => {
|
|
|
72979
73492
|
rootDirectory,
|
|
72980
73493
|
nodeBinaryPath,
|
|
72981
73494
|
project: lintProject,
|
|
72982
|
-
sourcePathByLintPath:
|
|
73495
|
+
sourcePathByLintPath: preparedLintSources.sourcePathByLintPath,
|
|
73496
|
+
sourceMapByLintPath: preparedLintSources.sourceMapByLintPath,
|
|
72983
73497
|
onPartialFailure,
|
|
72984
73498
|
onAnalyzedFiles: (filePaths) => {
|
|
72985
73499
|
analyzedFiles = filePaths;
|
|
@@ -74328,10 +74842,14 @@ const materializeSourceTree = (input) => gen(function* () {
|
|
|
74328
74842
|
materializedFiles.push(relativePath);
|
|
74329
74843
|
}
|
|
74330
74844
|
yield* sync(() => {
|
|
74331
|
-
for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
|
|
74332
|
-
const sourcePath = path.join(input.directory, configFilename);
|
|
74333
|
-
const targetPath = path.
|
|
74334
|
-
if (
|
|
74845
|
+
for (const subdirectory of ["", ...input.configSubdirectories ?? []]) for (const configFilename of STAGED_FILES_PROJECT_CONFIG_FILENAMES) {
|
|
74846
|
+
const sourcePath = path.join(input.directory, subdirectory, configFilename);
|
|
74847
|
+
const targetPath = path.resolve(resolvedTempDirectory, subdirectory, configFilename);
|
|
74848
|
+
if (!isPathInsideDirectory(targetPath, resolvedTempDirectory)) continue;
|
|
74849
|
+
if (fs.existsSync(sourcePath) && !fs.existsSync(targetPath)) {
|
|
74850
|
+
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
74851
|
+
fs.cpSync(sourcePath, targetPath);
|
|
74852
|
+
}
|
|
74335
74853
|
}
|
|
74336
74854
|
});
|
|
74337
74855
|
return {
|
|
@@ -74352,15 +74870,17 @@ const materializeSourceTree = (input) => gen(function* () {
|
|
|
74352
74870
|
static layerNode = effect(StagedFiles, gen(function* () {
|
|
74353
74871
|
const git = yield* Git;
|
|
74354
74872
|
return StagedFiles.of({
|
|
74355
|
-
discoverSourceFiles: (directory) => git.stagedFilePaths(directory).pipe(map$3((entries) => entries.filter(isLintableSourceFile)), withSpan("StagedFiles.discoverSourceFiles")),
|
|
74356
|
-
materialize: ({ directory, stagedFiles, tempDirectory }) => materializeSourceTree({
|
|
74873
|
+
discoverSourceFiles: (directory) => git.stagedFilePaths(directory).pipe(map$3((entries) => entries === null ? null : entries.filter(isLintableSourceFile)), withSpan("StagedFiles.discoverSourceFiles")),
|
|
74874
|
+
materialize: ({ directory, stagedFiles, tempDirectory, configSubdirectories }) => materializeSourceTree({
|
|
74357
74875
|
directory,
|
|
74358
74876
|
files: stagedFiles,
|
|
74359
74877
|
tempDirectory,
|
|
74878
|
+
configSubdirectories,
|
|
74360
74879
|
readContent: (relativePath) => git.showStagedContent(directory, relativePath, { maxBufferBytes: GIT_SHOW_MAX_BUFFER_BYTES })
|
|
74361
74880
|
}).pipe(map$3((tree) => ({
|
|
74362
74881
|
tempDirectory: tree.tempDirectory,
|
|
74363
74882
|
stagedFiles: tree.materializedFiles,
|
|
74883
|
+
unmaterializedFiles: tree.unmaterializedFiles,
|
|
74364
74884
|
cleanup: tree.cleanup
|
|
74365
74885
|
})), withSpan("StagedFiles.materialize"))
|
|
74366
74886
|
});
|
|
@@ -74375,6 +74895,7 @@ const materializeSourceTree = (input) => gen(function* () {
|
|
|
74375
74895
|
materialize: ({ tempDirectory }) => succeed$2({
|
|
74376
74896
|
tempDirectory,
|
|
74377
74897
|
stagedFiles: snapshot.materializedFiles ?? snapshot.sourceFiles ?? [],
|
|
74898
|
+
unmaterializedFiles: [],
|
|
74378
74899
|
cleanup: () => {}
|
|
74379
74900
|
})
|
|
74380
74901
|
}));
|
|
@@ -76207,6 +76728,7 @@ const METRIC = {
|
|
|
76207
76728
|
cliError: "cli.error",
|
|
76208
76729
|
cliEnvironmentError: "cli.env_error",
|
|
76209
76730
|
stagedSnapshotDivergence: "staged.snapshot_divergence",
|
|
76731
|
+
stagedPerProject: "staged.per_project",
|
|
76210
76732
|
projectDetected: "project.detected",
|
|
76211
76733
|
projectPathSelected: "project.path_selected",
|
|
76212
76734
|
projectConfigSelected: "project.config_selected",
|
|
@@ -76549,5 +77071,5 @@ const startLanguageServer = () => {
|
|
|
76549
77071
|
};
|
|
76550
77072
|
//#endregion
|
|
76551
77073
|
export { startLanguageServer };
|
|
76552
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
76553
|
-
//# debugId=
|
|
77074
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7cb1cf13-9787-536b-856a-49d43fec26a4")}catch(e){}}();
|
|
77075
|
+
//# debugId=7cb1cf13-9787-536b-856a-49d43fec26a4
|