react-doctor 0.7.2-dev.e872767 → 0.7.2-dev.fb8ffb0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +40 -88
- package/dist/index.js +37 -85
- package/dist/lsp.js +37 -85
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="91ba16f6-8b1a-5cd9-a5d2-fc0b6fce2508")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as NodeChildProcess from "node:child_process";
|
|
5
5
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -36131,8 +36131,6 @@ const OXLINT_SPAWN_TIMEOUT_MS = 6e4;
|
|
|
36131
36131
|
const NODE_COMPILE_CACHE_DIR_NAME = "node-compile-cache";
|
|
36132
36132
|
const DEAD_CODE_WORKER_TIMEOUT_MS = 12e4;
|
|
36133
36133
|
const OXLINT_SPLIT_TOTAL_BUDGET_MS = 18e4;
|
|
36134
|
-
const ABORT_EXIT_CODES = new Set([134, 3221226505]);
|
|
36135
|
-
const OXLINT_OOM_RESCUE_BUDGET_MS = 6e4;
|
|
36136
36134
|
const DEAD_CODE_PHASE_TIMEOUT_MS = 15e4;
|
|
36137
36135
|
const LINT_PHASE_TIMEOUT_MS = 3e5;
|
|
36138
36136
|
const SCAN_TOTAL_DEADLINE_MS = 9e5;
|
|
@@ -43604,9 +43602,7 @@ const SANITIZED_ENV = buildOxlintChildEnv(process.env);
|
|
|
43604
43602
|
* - `OxlintBatchExceeded { kind: "output-too-large" }` — stdout+stderr
|
|
43605
43603
|
* crossed `OXLINT_OUTPUT_MAX_BYTES`.
|
|
43606
43604
|
* - `OxlintBatchExceeded { kind: "oom" | "killed" }` — child exited
|
|
43607
|
-
* on a signal (SIGABRT → OOM, others → generic kill)
|
|
43608
|
-
* of the abort exit codes Windows reports instead of a signal
|
|
43609
|
-
* (`ABORT_EXIT_CODES` → OOM).
|
|
43605
|
+
* on a signal (SIGABRT → OOM, others → generic kill).
|
|
43610
43606
|
* - `OxlintSpawnFailed { cause }` — `spawn` itself errored, or the
|
|
43611
43607
|
* child exited successfully but printed only stderr.
|
|
43612
43608
|
*
|
|
@@ -43672,7 +43668,7 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
43672
43668
|
clearAbortListener();
|
|
43673
43669
|
reject(new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: error }) }));
|
|
43674
43670
|
});
|
|
43675
|
-
child.on("close", (
|
|
43671
|
+
child.on("close", (_code, signal) => {
|
|
43676
43672
|
clearTimeout(timeoutHandle);
|
|
43677
43673
|
clearAbortListener();
|
|
43678
43674
|
if (didKillForSize) {
|
|
@@ -43682,11 +43678,10 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
43682
43678
|
}) }));
|
|
43683
43679
|
return;
|
|
43684
43680
|
}
|
|
43685
|
-
|
|
43686
|
-
if (signal || isAbortExitCode) {
|
|
43681
|
+
if (signal) {
|
|
43687
43682
|
const stderrOutput = Buffer.concat(stderrBuffers).toString("utf-8").trim();
|
|
43688
|
-
const isOom = signal === "SIGABRT"
|
|
43689
|
-
const detailParts = [
|
|
43683
|
+
const isOom = signal === "SIGABRT";
|
|
43684
|
+
const detailParts = [`killed by ${signal}`];
|
|
43690
43685
|
if (isOom) detailParts.push("try scanning fewer files with --diff");
|
|
43691
43686
|
if (stderrOutput) detailParts.push(stderrOutput);
|
|
43692
43687
|
reject(new ReactDoctorError({ reason: new OxlintBatchExceeded({
|
|
@@ -43729,19 +43724,12 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
43729
43724
|
* (surfaced via `onPartialFailure`) so JSON-mode consumers see WHICH
|
|
43730
43725
|
* files were skipped instead of silently losing them.
|
|
43731
43726
|
*
|
|
43732
|
-
* Parallel runs (concurrency > 1) get
|
|
43733
|
-
*
|
|
43734
|
-
*
|
|
43735
|
-
*
|
|
43736
|
-
*
|
|
43737
|
-
*
|
|
43738
|
-
* propagate.
|
|
43739
|
-
* - Files dropped because oxlint's native binding SIGABRT'd under
|
|
43740
|
-
* memory pressure (`OxlintBatchExceeded { kind: "oom" }`) get one
|
|
43741
|
-
* serial single-file-batch rescue pass: the OOM is usually a function
|
|
43742
|
-
* of N concurrent oxlint allocator arenas, not the file itself, so a
|
|
43743
|
-
* lone process with the machine to itself typically clears it —
|
|
43744
|
-
* turning a partial scan into a complete (if slower) one.
|
|
43727
|
+
* Parallel runs (concurrency > 1) get one extra safety net: if the pass
|
|
43728
|
+
* fails with a resource-exhaustion error that's exclusive to running
|
|
43729
|
+
* many oxlint subprocesses at once (EAGAIN / EMFILE / ENFILE / ENOMEM —
|
|
43730
|
+
* see `isParallelismRelatedSpawnError`), the whole pass replays once
|
|
43731
|
+
* with a single worker. That's the only failure a serial replay can
|
|
43732
|
+
* clear, so every other error class is left to propagate.
|
|
43745
43733
|
*
|
|
43746
43734
|
* Errors that aren't splittable and aren't parallelism-related (oxlint
|
|
43747
43735
|
* config crash, JS plugin resolution failure, etc.) propagate to the
|
|
@@ -43751,16 +43739,13 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
43751
43739
|
const spawnLintBatches = async (input) => {
|
|
43752
43740
|
const { baseArgs, fileBatches, rootDirectory, nodeBinaryPath, project, onPartialFailure, onFileProgress, spawnTimeoutMs, outputMaxBytes, splitTotalBudgetMs = OXLINT_SPLIT_TOTAL_BUDGET_MS, splitMaxDepth = 8, signal, deadlineEpochMs } = input;
|
|
43753
43741
|
const requestedConcurrency = resolveScanConcurrency(input.concurrency ?? 1);
|
|
43754
|
-
|
|
43755
|
-
const
|
|
43756
|
-
const runBatchPass = async (concurrency, passBatches, passOnFileProgress) => {
|
|
43757
|
-
const totalFileCount = passBatches.reduce((sum, batch) => sum + batch.length, 0);
|
|
43742
|
+
const totalFileCount = fileBatches.reduce((sum, batch) => sum + batch.length, 0);
|
|
43743
|
+
const runBatchPass = async (concurrency) => {
|
|
43758
43744
|
const allDiagnostics = [];
|
|
43759
43745
|
const droppedFiles = [];
|
|
43760
|
-
const oomDroppedFiles = [];
|
|
43761
43746
|
const deadlineSkippedFiles = [];
|
|
43747
|
+
const isPastDeadline = () => deadlineEpochMs !== void 0 && remainingDeadlineBudgetMs(deadlineEpochMs) === 0;
|
|
43762
43748
|
let firstDropReason = null;
|
|
43763
|
-
let firstNonOomDropReason = null;
|
|
43764
43749
|
const spawnLintBatch = async (batch, depth, batchState) => {
|
|
43765
43750
|
if (isPastDeadline()) {
|
|
43766
43751
|
deadlineSkippedFiles.push(...batch);
|
|
@@ -43782,14 +43767,12 @@ const spawnLintBatches = async (input) => {
|
|
|
43782
43767
|
const isDepthCapReached = depth >= splitMaxDepth;
|
|
43783
43768
|
if (batch.length <= 1 || isBudgetElapsed || isDepthCapReached) {
|
|
43784
43769
|
droppedFiles.push(...batch);
|
|
43785
|
-
|
|
43786
|
-
|
|
43787
|
-
|
|
43788
|
-
|
|
43789
|
-
|
|
43790
|
-
|
|
43791
|
-
firstDropReason ??= dropReason;
|
|
43792
|
-
if (!isOomDrop) firstNonOomDropReason ??= dropReason;
|
|
43770
|
+
if (firstDropReason === null) {
|
|
43771
|
+
let limitHint = "";
|
|
43772
|
+
if (isDepthCapReached) limitHint = ` (split depth cap of ${splitMaxDepth} levels reached)`;
|
|
43773
|
+
else if (isBudgetElapsed) limitHint = ` (split budget of ${splitTotalBudgetMs / MILLISECONDS_PER_SECOND}s exhausted at depth ${depth})`;
|
|
43774
|
+
firstDropReason = batch.length > 1 ? `${error.message}${limitHint}` : error.message;
|
|
43775
|
+
}
|
|
43793
43776
|
return [];
|
|
43794
43777
|
}
|
|
43795
43778
|
const splitIndex = Math.ceil(batch.length / 2);
|
|
@@ -43799,16 +43782,16 @@ const spawnLintBatches = async (input) => {
|
|
|
43799
43782
|
let startedFileCount = 0;
|
|
43800
43783
|
let scannedFileCount = 0;
|
|
43801
43784
|
let displayedFileCount = 0;
|
|
43802
|
-
const progressTimer =
|
|
43785
|
+
const progressTimer = onFileProgress && totalFileCount > 1 ? setInterval(() => {
|
|
43803
43786
|
const ceiling = Math.min(startedFileCount, totalFileCount - 1);
|
|
43804
43787
|
if (displayedFileCount < ceiling) {
|
|
43805
43788
|
displayedFileCount += 1;
|
|
43806
|
-
|
|
43789
|
+
onFileProgress(displayedFileCount, totalFileCount);
|
|
43807
43790
|
}
|
|
43808
43791
|
}, 50) : null;
|
|
43809
43792
|
progressTimer?.unref?.();
|
|
43810
43793
|
try {
|
|
43811
|
-
const batchResults = await mapWithConcurrency(
|
|
43794
|
+
const batchResults = await mapWithConcurrency(fileBatches, concurrency, async (batch) => {
|
|
43812
43795
|
if (isPastDeadline()) {
|
|
43813
43796
|
deadlineSkippedFiles.push(...batch);
|
|
43814
43797
|
return [];
|
|
@@ -43820,9 +43803,9 @@ const spawnLintBatches = async (input) => {
|
|
|
43820
43803
|
};
|
|
43821
43804
|
const batchDiagnostics = await spawnLintBatch(batch, 0, batchState);
|
|
43822
43805
|
scannedFileCount += batch.length - batchState.deadlineSkippedFileCount;
|
|
43823
|
-
if (
|
|
43806
|
+
if (onFileProgress) {
|
|
43824
43807
|
displayedFileCount = Math.min(Math.max(displayedFileCount, scannedFileCount), totalFileCount);
|
|
43825
|
-
|
|
43808
|
+
onFileProgress(displayedFileCount, totalFileCount);
|
|
43826
43809
|
}
|
|
43827
43810
|
return batchDiagnostics;
|
|
43828
43811
|
});
|
|
@@ -43830,53 +43813,22 @@ const spawnLintBatches = async (input) => {
|
|
|
43830
43813
|
} finally {
|
|
43831
43814
|
if (progressTimer !== null) clearInterval(progressTimer);
|
|
43832
43815
|
}
|
|
43833
|
-
|
|
43834
|
-
|
|
43835
|
-
|
|
43836
|
-
oomDroppedFiles,
|
|
43837
|
-
deadlineSkippedFiles,
|
|
43838
|
-
firstDropReason,
|
|
43839
|
-
firstNonOomDropReason
|
|
43816
|
+
const reportSkippedFiles = (skippedFiles, buildMessage) => {
|
|
43817
|
+
if (skippedFiles.length === 0 || !onPartialFailure) return;
|
|
43818
|
+
onPartialFailure(buildMessage(`${skippedFiles.slice(0, 3).join(", ")}${skippedFiles.length > 3 ? `, +${skippedFiles.length - 3} more` : ""}`));
|
|
43840
43819
|
};
|
|
43820
|
+
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
43821
|
+
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
43822
|
+
reportSkippedFiles(deadlineSkippedFiles, (fileListPreview) => `${deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
43823
|
+
return allDiagnostics;
|
|
43841
43824
|
};
|
|
43842
|
-
let
|
|
43843
|
-
let effectiveConcurrency = requestedConcurrency;
|
|
43825
|
+
let diagnostics;
|
|
43844
43826
|
try {
|
|
43845
|
-
|
|
43827
|
+
diagnostics = await runBatchPass(requestedConcurrency);
|
|
43846
43828
|
} catch (error) {
|
|
43847
43829
|
if (requestedConcurrency <= 1 || !isParallelismRelatedSpawnError(error)) throw error;
|
|
43848
|
-
|
|
43849
|
-
outcome = await runBatchPass(1, fileBatches, onFileProgress);
|
|
43850
|
-
}
|
|
43851
|
-
let { droppedFiles, firstDropReason } = outcome;
|
|
43852
|
-
const diagnostics = outcome.diagnostics;
|
|
43853
|
-
if (outcome.oomDroppedFiles.length > 0 && effectiveConcurrency > 1 && !isPastDeadline()) {
|
|
43854
|
-
rescueDeadlineEpochMs = Date.now() + OXLINT_OOM_RESCUE_BUDGET_MS;
|
|
43855
|
-
const rescuedFiles = /* @__PURE__ */ new Set();
|
|
43856
|
-
let firstRescueFailureReason = null;
|
|
43857
|
-
for (const oomDroppedFile of outcome.oomDroppedFiles) {
|
|
43858
|
-
if (isPastDeadline()) break;
|
|
43859
|
-
try {
|
|
43860
|
-
const rescueOutcome = await runBatchPass(1, [[oomDroppedFile]], void 0);
|
|
43861
|
-
diagnostics.push(...rescueOutcome.diagnostics);
|
|
43862
|
-
if (rescueOutcome.droppedFiles.length > 0 || rescueOutcome.deadlineSkippedFiles.length > 0) firstRescueFailureReason ??= rescueOutcome.firstDropReason;
|
|
43863
|
-
else rescuedFiles.add(oomDroppedFile);
|
|
43864
|
-
} catch (error) {
|
|
43865
|
-
firstRescueFailureReason ??= error instanceof Error ? error.message : String(error);
|
|
43866
|
-
}
|
|
43867
|
-
}
|
|
43868
|
-
rescueDeadlineEpochMs = void 0;
|
|
43869
|
-
droppedFiles = droppedFiles.filter((filePath) => !rescuedFiles.has(filePath));
|
|
43870
|
-
if (droppedFiles.length === 0) firstDropReason = null;
|
|
43871
|
-
else firstDropReason = firstRescueFailureReason ?? outcome.firstNonOomDropReason ?? firstDropReason;
|
|
43830
|
+
diagnostics = await runBatchPass(1);
|
|
43872
43831
|
}
|
|
43873
|
-
const reportSkippedFiles = (skippedFiles, buildMessage) => {
|
|
43874
|
-
if (skippedFiles.length === 0 || !onPartialFailure) return;
|
|
43875
|
-
onPartialFailure(buildMessage(`${skippedFiles.slice(0, 3).join(", ")}${skippedFiles.length > 3 ? `, +${skippedFiles.length - 3} more` : ""}`));
|
|
43876
|
-
};
|
|
43877
|
-
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
43878
|
-
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
43879
|
-
reportSkippedFiles(outcome.deadlineSkippedFiles, (fileListPreview) => `${outcome.deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
43880
43832
|
return dedupeDiagnostics(diagnostics);
|
|
43881
43833
|
};
|
|
43882
43834
|
let didValidate = false;
|
|
@@ -46434,7 +46386,7 @@ const makeNoopConsole = () => ({
|
|
|
46434
46386
|
});
|
|
46435
46387
|
//#endregion
|
|
46436
46388
|
//#region src/cli/utils/version.ts
|
|
46437
|
-
const VERSION = "0.7.2-dev.
|
|
46389
|
+
const VERSION = "0.7.2-dev.fb8ffb0";
|
|
46438
46390
|
//#endregion
|
|
46439
46391
|
//#region src/cli/utils/json-mode.ts
|
|
46440
46392
|
let context = null;
|
|
@@ -46803,13 +46755,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
46803
46755
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
46804
46756
|
* standard `SENTRY_RELEASE` override.
|
|
46805
46757
|
*/
|
|
46806
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.2-dev.
|
|
46758
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.7.2-dev.fb8ffb0`;
|
|
46807
46759
|
/**
|
|
46808
46760
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
46809
46761
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
46810
46762
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
46811
46763
|
*/
|
|
46812
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.2-dev.
|
|
46764
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.7.2-dev.fb8ffb0") ? "development" : "production");
|
|
46813
46765
|
/**
|
|
46814
46766
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
46815
46767
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -64984,4 +64936,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
64984
64936
|
export {};
|
|
64985
64937
|
|
|
64986
64938
|
//# sourceMappingURL=cli.js.map
|
|
64987
|
-
//# debugId=
|
|
64939
|
+
//# debugId=91ba16f6-8b1a-5cd9-a5d2-fc0b6fce2508
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!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]="
|
|
2
|
+
!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]="63c65851-4fa5-5cd1-9337-0f2feefe37ad")}catch(e){}}();
|
|
3
3
|
import { r as __toESM$1, t as __commonJSMin$1 } from "./chunk-N93fKeF6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as NFS from "node:fs";
|
|
@@ -32930,8 +32930,6 @@ const OXLINT_SPAWN_TIMEOUT_MS = 6e4;
|
|
|
32930
32930
|
const NODE_COMPILE_CACHE_DIR_NAME = "node-compile-cache";
|
|
32931
32931
|
const DEAD_CODE_WORKER_TIMEOUT_MS = 12e4;
|
|
32932
32932
|
const OXLINT_SPLIT_TOTAL_BUDGET_MS = 18e4;
|
|
32933
|
-
const ABORT_EXIT_CODES = new Set([134, 3221226505]);
|
|
32934
|
-
const OXLINT_OOM_RESCUE_BUDGET_MS = 6e4;
|
|
32935
32933
|
const DEAD_CODE_PHASE_TIMEOUT_MS = 15e4;
|
|
32936
32934
|
const LINT_PHASE_TIMEOUT_MS = 3e5;
|
|
32937
32935
|
const SCAN_TOTAL_DEADLINE_MS = 9e5;
|
|
@@ -40361,9 +40359,7 @@ const SANITIZED_ENV = buildOxlintChildEnv(process.env);
|
|
|
40361
40359
|
* - `OxlintBatchExceeded { kind: "output-too-large" }` — stdout+stderr
|
|
40362
40360
|
* crossed `OXLINT_OUTPUT_MAX_BYTES`.
|
|
40363
40361
|
* - `OxlintBatchExceeded { kind: "oom" | "killed" }` — child exited
|
|
40364
|
-
* on a signal (SIGABRT → OOM, others → generic kill)
|
|
40365
|
-
* of the abort exit codes Windows reports instead of a signal
|
|
40366
|
-
* (`ABORT_EXIT_CODES` → OOM).
|
|
40362
|
+
* on a signal (SIGABRT → OOM, others → generic kill).
|
|
40367
40363
|
* - `OxlintSpawnFailed { cause }` — `spawn` itself errored, or the
|
|
40368
40364
|
* child exited successfully but printed only stderr.
|
|
40369
40365
|
*
|
|
@@ -40429,7 +40425,7 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
40429
40425
|
clearAbortListener();
|
|
40430
40426
|
reject(new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: error }) }));
|
|
40431
40427
|
});
|
|
40432
|
-
child.on("close", (
|
|
40428
|
+
child.on("close", (_code, signal) => {
|
|
40433
40429
|
clearTimeout(timeoutHandle);
|
|
40434
40430
|
clearAbortListener();
|
|
40435
40431
|
if (didKillForSize) {
|
|
@@ -40439,11 +40435,10 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
40439
40435
|
}) }));
|
|
40440
40436
|
return;
|
|
40441
40437
|
}
|
|
40442
|
-
|
|
40443
|
-
if (signal || isAbortExitCode) {
|
|
40438
|
+
if (signal) {
|
|
40444
40439
|
const stderrOutput = Buffer.concat(stderrBuffers).toString("utf-8").trim();
|
|
40445
|
-
const isOom = signal === "SIGABRT"
|
|
40446
|
-
const detailParts = [
|
|
40440
|
+
const isOom = signal === "SIGABRT";
|
|
40441
|
+
const detailParts = [`killed by ${signal}`];
|
|
40447
40442
|
if (isOom) detailParts.push("try scanning fewer files with --diff");
|
|
40448
40443
|
if (stderrOutput) detailParts.push(stderrOutput);
|
|
40449
40444
|
reject(new ReactDoctorError({ reason: new OxlintBatchExceeded({
|
|
@@ -40486,19 +40481,12 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
40486
40481
|
* (surfaced via `onPartialFailure`) so JSON-mode consumers see WHICH
|
|
40487
40482
|
* files were skipped instead of silently losing them.
|
|
40488
40483
|
*
|
|
40489
|
-
* Parallel runs (concurrency > 1) get
|
|
40490
|
-
*
|
|
40491
|
-
*
|
|
40492
|
-
*
|
|
40493
|
-
*
|
|
40494
|
-
*
|
|
40495
|
-
* propagate.
|
|
40496
|
-
* - Files dropped because oxlint's native binding SIGABRT'd under
|
|
40497
|
-
* memory pressure (`OxlintBatchExceeded { kind: "oom" }`) get one
|
|
40498
|
-
* serial single-file-batch rescue pass: the OOM is usually a function
|
|
40499
|
-
* of N concurrent oxlint allocator arenas, not the file itself, so a
|
|
40500
|
-
* lone process with the machine to itself typically clears it —
|
|
40501
|
-
* turning a partial scan into a complete (if slower) one.
|
|
40484
|
+
* Parallel runs (concurrency > 1) get one extra safety net: if the pass
|
|
40485
|
+
* fails with a resource-exhaustion error that's exclusive to running
|
|
40486
|
+
* many oxlint subprocesses at once (EAGAIN / EMFILE / ENFILE / ENOMEM —
|
|
40487
|
+
* see `isParallelismRelatedSpawnError`), the whole pass replays once
|
|
40488
|
+
* with a single worker. That's the only failure a serial replay can
|
|
40489
|
+
* clear, so every other error class is left to propagate.
|
|
40502
40490
|
*
|
|
40503
40491
|
* Errors that aren't splittable and aren't parallelism-related (oxlint
|
|
40504
40492
|
* config crash, JS plugin resolution failure, etc.) propagate to the
|
|
@@ -40508,16 +40496,13 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
40508
40496
|
const spawnLintBatches = async (input) => {
|
|
40509
40497
|
const { baseArgs, fileBatches, rootDirectory, nodeBinaryPath, project, onPartialFailure, onFileProgress, spawnTimeoutMs, outputMaxBytes, splitTotalBudgetMs = OXLINT_SPLIT_TOTAL_BUDGET_MS, splitMaxDepth = 8, signal, deadlineEpochMs } = input;
|
|
40510
40498
|
const requestedConcurrency = resolveScanConcurrency(input.concurrency ?? 1);
|
|
40511
|
-
|
|
40512
|
-
const
|
|
40513
|
-
const runBatchPass = async (concurrency, passBatches, passOnFileProgress) => {
|
|
40514
|
-
const totalFileCount = passBatches.reduce((sum, batch) => sum + batch.length, 0);
|
|
40499
|
+
const totalFileCount = fileBatches.reduce((sum, batch) => sum + batch.length, 0);
|
|
40500
|
+
const runBatchPass = async (concurrency) => {
|
|
40515
40501
|
const allDiagnostics = [];
|
|
40516
40502
|
const droppedFiles = [];
|
|
40517
|
-
const oomDroppedFiles = [];
|
|
40518
40503
|
const deadlineSkippedFiles = [];
|
|
40504
|
+
const isPastDeadline = () => deadlineEpochMs !== void 0 && remainingDeadlineBudgetMs(deadlineEpochMs) === 0;
|
|
40519
40505
|
let firstDropReason = null;
|
|
40520
|
-
let firstNonOomDropReason = null;
|
|
40521
40506
|
const spawnLintBatch = async (batch, depth, batchState) => {
|
|
40522
40507
|
if (isPastDeadline()) {
|
|
40523
40508
|
deadlineSkippedFiles.push(...batch);
|
|
@@ -40539,14 +40524,12 @@ const spawnLintBatches = async (input) => {
|
|
|
40539
40524
|
const isDepthCapReached = depth >= splitMaxDepth;
|
|
40540
40525
|
if (batch.length <= 1 || isBudgetElapsed || isDepthCapReached) {
|
|
40541
40526
|
droppedFiles.push(...batch);
|
|
40542
|
-
|
|
40543
|
-
|
|
40544
|
-
|
|
40545
|
-
|
|
40546
|
-
|
|
40547
|
-
|
|
40548
|
-
firstDropReason ??= dropReason;
|
|
40549
|
-
if (!isOomDrop) firstNonOomDropReason ??= dropReason;
|
|
40527
|
+
if (firstDropReason === null) {
|
|
40528
|
+
let limitHint = "";
|
|
40529
|
+
if (isDepthCapReached) limitHint = ` (split depth cap of ${splitMaxDepth} levels reached)`;
|
|
40530
|
+
else if (isBudgetElapsed) limitHint = ` (split budget of ${splitTotalBudgetMs / MILLISECONDS_PER_SECOND}s exhausted at depth ${depth})`;
|
|
40531
|
+
firstDropReason = batch.length > 1 ? `${error.message}${limitHint}` : error.message;
|
|
40532
|
+
}
|
|
40550
40533
|
return [];
|
|
40551
40534
|
}
|
|
40552
40535
|
const splitIndex = Math.ceil(batch.length / 2);
|
|
@@ -40556,16 +40539,16 @@ const spawnLintBatches = async (input) => {
|
|
|
40556
40539
|
let startedFileCount = 0;
|
|
40557
40540
|
let scannedFileCount = 0;
|
|
40558
40541
|
let displayedFileCount = 0;
|
|
40559
|
-
const progressTimer =
|
|
40542
|
+
const progressTimer = onFileProgress && totalFileCount > 1 ? setInterval(() => {
|
|
40560
40543
|
const ceiling = Math.min(startedFileCount, totalFileCount - 1);
|
|
40561
40544
|
if (displayedFileCount < ceiling) {
|
|
40562
40545
|
displayedFileCount += 1;
|
|
40563
|
-
|
|
40546
|
+
onFileProgress(displayedFileCount, totalFileCount);
|
|
40564
40547
|
}
|
|
40565
40548
|
}, 50) : null;
|
|
40566
40549
|
progressTimer?.unref?.();
|
|
40567
40550
|
try {
|
|
40568
|
-
const batchResults = await mapWithConcurrency(
|
|
40551
|
+
const batchResults = await mapWithConcurrency(fileBatches, concurrency, async (batch) => {
|
|
40569
40552
|
if (isPastDeadline()) {
|
|
40570
40553
|
deadlineSkippedFiles.push(...batch);
|
|
40571
40554
|
return [];
|
|
@@ -40577,9 +40560,9 @@ const spawnLintBatches = async (input) => {
|
|
|
40577
40560
|
};
|
|
40578
40561
|
const batchDiagnostics = await spawnLintBatch(batch, 0, batchState);
|
|
40579
40562
|
scannedFileCount += batch.length - batchState.deadlineSkippedFileCount;
|
|
40580
|
-
if (
|
|
40563
|
+
if (onFileProgress) {
|
|
40581
40564
|
displayedFileCount = Math.min(Math.max(displayedFileCount, scannedFileCount), totalFileCount);
|
|
40582
|
-
|
|
40565
|
+
onFileProgress(displayedFileCount, totalFileCount);
|
|
40583
40566
|
}
|
|
40584
40567
|
return batchDiagnostics;
|
|
40585
40568
|
});
|
|
@@ -40587,53 +40570,22 @@ const spawnLintBatches = async (input) => {
|
|
|
40587
40570
|
} finally {
|
|
40588
40571
|
if (progressTimer !== null) clearInterval(progressTimer);
|
|
40589
40572
|
}
|
|
40590
|
-
|
|
40591
|
-
|
|
40592
|
-
|
|
40593
|
-
oomDroppedFiles,
|
|
40594
|
-
deadlineSkippedFiles,
|
|
40595
|
-
firstDropReason,
|
|
40596
|
-
firstNonOomDropReason
|
|
40573
|
+
const reportSkippedFiles = (skippedFiles, buildMessage) => {
|
|
40574
|
+
if (skippedFiles.length === 0 || !onPartialFailure) return;
|
|
40575
|
+
onPartialFailure(buildMessage(`${skippedFiles.slice(0, 3).join(", ")}${skippedFiles.length > 3 ? `, +${skippedFiles.length - 3} more` : ""}`));
|
|
40597
40576
|
};
|
|
40577
|
+
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
40578
|
+
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
40579
|
+
reportSkippedFiles(deadlineSkippedFiles, (fileListPreview) => `${deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
40580
|
+
return allDiagnostics;
|
|
40598
40581
|
};
|
|
40599
|
-
let
|
|
40600
|
-
let effectiveConcurrency = requestedConcurrency;
|
|
40582
|
+
let diagnostics;
|
|
40601
40583
|
try {
|
|
40602
|
-
|
|
40584
|
+
diagnostics = await runBatchPass(requestedConcurrency);
|
|
40603
40585
|
} catch (error) {
|
|
40604
40586
|
if (requestedConcurrency <= 1 || !isParallelismRelatedSpawnError(error)) throw error;
|
|
40605
|
-
|
|
40606
|
-
outcome = await runBatchPass(1, fileBatches, onFileProgress);
|
|
40607
|
-
}
|
|
40608
|
-
let { droppedFiles, firstDropReason } = outcome;
|
|
40609
|
-
const diagnostics = outcome.diagnostics;
|
|
40610
|
-
if (outcome.oomDroppedFiles.length > 0 && effectiveConcurrency > 1 && !isPastDeadline()) {
|
|
40611
|
-
rescueDeadlineEpochMs = Date.now() + OXLINT_OOM_RESCUE_BUDGET_MS;
|
|
40612
|
-
const rescuedFiles = /* @__PURE__ */ new Set();
|
|
40613
|
-
let firstRescueFailureReason = null;
|
|
40614
|
-
for (const oomDroppedFile of outcome.oomDroppedFiles) {
|
|
40615
|
-
if (isPastDeadline()) break;
|
|
40616
|
-
try {
|
|
40617
|
-
const rescueOutcome = await runBatchPass(1, [[oomDroppedFile]], void 0);
|
|
40618
|
-
diagnostics.push(...rescueOutcome.diagnostics);
|
|
40619
|
-
if (rescueOutcome.droppedFiles.length > 0 || rescueOutcome.deadlineSkippedFiles.length > 0) firstRescueFailureReason ??= rescueOutcome.firstDropReason;
|
|
40620
|
-
else rescuedFiles.add(oomDroppedFile);
|
|
40621
|
-
} catch (error) {
|
|
40622
|
-
firstRescueFailureReason ??= error instanceof Error ? error.message : String(error);
|
|
40623
|
-
}
|
|
40624
|
-
}
|
|
40625
|
-
rescueDeadlineEpochMs = void 0;
|
|
40626
|
-
droppedFiles = droppedFiles.filter((filePath) => !rescuedFiles.has(filePath));
|
|
40627
|
-
if (droppedFiles.length === 0) firstDropReason = null;
|
|
40628
|
-
else firstDropReason = firstRescueFailureReason ?? outcome.firstNonOomDropReason ?? firstDropReason;
|
|
40587
|
+
diagnostics = await runBatchPass(1);
|
|
40629
40588
|
}
|
|
40630
|
-
const reportSkippedFiles = (skippedFiles, buildMessage) => {
|
|
40631
|
-
if (skippedFiles.length === 0 || !onPartialFailure) return;
|
|
40632
|
-
onPartialFailure(buildMessage(`${skippedFiles.slice(0, 3).join(", ")}${skippedFiles.length > 3 ? `, +${skippedFiles.length - 3} more` : ""}`));
|
|
40633
|
-
};
|
|
40634
|
-
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
40635
|
-
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
40636
|
-
reportSkippedFiles(outcome.deadlineSkippedFiles, (fileListPreview) => `${outcome.deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
40637
40589
|
return dedupeDiagnostics(diagnostics);
|
|
40638
40590
|
};
|
|
40639
40591
|
let didValidate = false;
|
|
@@ -42973,4 +42925,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
42973
42925
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
42974
42926
|
|
|
42975
42927
|
//# sourceMappingURL=index.js.map
|
|
42976
|
-
//# debugId=
|
|
42928
|
+
//# debugId=63c65851-4fa5-5cd1-9337-0f2feefe37ad
|
package/dist/lsp.js
CHANGED
|
@@ -32989,8 +32989,6 @@ const OXLINT_SPAWN_TIMEOUT_MS = 6e4;
|
|
|
32989
32989
|
const NODE_COMPILE_CACHE_DIR_NAME = "node-compile-cache";
|
|
32990
32990
|
const DEAD_CODE_WORKER_TIMEOUT_MS = 12e4;
|
|
32991
32991
|
const OXLINT_SPLIT_TOTAL_BUDGET_MS = 18e4;
|
|
32992
|
-
const ABORT_EXIT_CODES = new Set([134, 3221226505]);
|
|
32993
|
-
const OXLINT_OOM_RESCUE_BUDGET_MS = 6e4;
|
|
32994
32992
|
const DEAD_CODE_PHASE_TIMEOUT_MS = 15e4;
|
|
32995
32993
|
const LINT_PHASE_TIMEOUT_MS = 3e5;
|
|
32996
32994
|
const SCAN_TOTAL_DEADLINE_MS = 9e5;
|
|
@@ -40346,9 +40344,7 @@ const SANITIZED_ENV = buildOxlintChildEnv(process.env);
|
|
|
40346
40344
|
* - `OxlintBatchExceeded { kind: "output-too-large" }` — stdout+stderr
|
|
40347
40345
|
* crossed `OXLINT_OUTPUT_MAX_BYTES`.
|
|
40348
40346
|
* - `OxlintBatchExceeded { kind: "oom" | "killed" }` — child exited
|
|
40349
|
-
* on a signal (SIGABRT → OOM, others → generic kill)
|
|
40350
|
-
* of the abort exit codes Windows reports instead of a signal
|
|
40351
|
-
* (`ABORT_EXIT_CODES` → OOM).
|
|
40347
|
+
* on a signal (SIGABRT → OOM, others → generic kill).
|
|
40352
40348
|
* - `OxlintSpawnFailed { cause }` — `spawn` itself errored, or the
|
|
40353
40349
|
* child exited successfully but printed only stderr.
|
|
40354
40350
|
*
|
|
@@ -40414,7 +40410,7 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
40414
40410
|
clearAbortListener();
|
|
40415
40411
|
reject(new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: error }) }));
|
|
40416
40412
|
});
|
|
40417
|
-
child.on("close", (
|
|
40413
|
+
child.on("close", (_code, signal) => {
|
|
40418
40414
|
clearTimeout(timeoutHandle);
|
|
40419
40415
|
clearAbortListener();
|
|
40420
40416
|
if (didKillForSize) {
|
|
@@ -40424,11 +40420,10 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
|
|
|
40424
40420
|
}) }));
|
|
40425
40421
|
return;
|
|
40426
40422
|
}
|
|
40427
|
-
|
|
40428
|
-
if (signal || isAbortExitCode) {
|
|
40423
|
+
if (signal) {
|
|
40429
40424
|
const stderrOutput = Buffer.concat(stderrBuffers).toString("utf-8").trim();
|
|
40430
|
-
const isOom = signal === "SIGABRT"
|
|
40431
|
-
const detailParts = [
|
|
40425
|
+
const isOom = signal === "SIGABRT";
|
|
40426
|
+
const detailParts = [`killed by ${signal}`];
|
|
40432
40427
|
if (isOom) detailParts.push("try scanning fewer files with --diff");
|
|
40433
40428
|
if (stderrOutput) detailParts.push(stderrOutput);
|
|
40434
40429
|
reject(new ReactDoctorError({ reason: new OxlintBatchExceeded({
|
|
@@ -40471,19 +40466,12 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
40471
40466
|
* (surfaced via `onPartialFailure`) so JSON-mode consumers see WHICH
|
|
40472
40467
|
* files were skipped instead of silently losing them.
|
|
40473
40468
|
*
|
|
40474
|
-
* Parallel runs (concurrency > 1) get
|
|
40475
|
-
*
|
|
40476
|
-
*
|
|
40477
|
-
*
|
|
40478
|
-
*
|
|
40479
|
-
*
|
|
40480
|
-
* propagate.
|
|
40481
|
-
* - Files dropped because oxlint's native binding SIGABRT'd under
|
|
40482
|
-
* memory pressure (`OxlintBatchExceeded { kind: "oom" }`) get one
|
|
40483
|
-
* serial single-file-batch rescue pass: the OOM is usually a function
|
|
40484
|
-
* of N concurrent oxlint allocator arenas, not the file itself, so a
|
|
40485
|
-
* lone process with the machine to itself typically clears it —
|
|
40486
|
-
* turning a partial scan into a complete (if slower) one.
|
|
40469
|
+
* Parallel runs (concurrency > 1) get one extra safety net: if the pass
|
|
40470
|
+
* fails with a resource-exhaustion error that's exclusive to running
|
|
40471
|
+
* many oxlint subprocesses at once (EAGAIN / EMFILE / ENFILE / ENOMEM —
|
|
40472
|
+
* see `isParallelismRelatedSpawnError`), the whole pass replays once
|
|
40473
|
+
* with a single worker. That's the only failure a serial replay can
|
|
40474
|
+
* clear, so every other error class is left to propagate.
|
|
40487
40475
|
*
|
|
40488
40476
|
* Errors that aren't splittable and aren't parallelism-related (oxlint
|
|
40489
40477
|
* config crash, JS plugin resolution failure, etc.) propagate to the
|
|
@@ -40493,16 +40481,13 @@ const isParallelismRelatedSpawnError = (error) => {
|
|
|
40493
40481
|
const spawnLintBatches = async (input) => {
|
|
40494
40482
|
const { baseArgs, fileBatches, rootDirectory, nodeBinaryPath, project, onPartialFailure, onFileProgress, spawnTimeoutMs, outputMaxBytes, splitTotalBudgetMs = OXLINT_SPLIT_TOTAL_BUDGET_MS, splitMaxDepth = 8, signal, deadlineEpochMs } = input;
|
|
40495
40483
|
const requestedConcurrency = resolveScanConcurrency(input.concurrency ?? 1);
|
|
40496
|
-
|
|
40497
|
-
const
|
|
40498
|
-
const runBatchPass = async (concurrency, passBatches, passOnFileProgress) => {
|
|
40499
|
-
const totalFileCount = passBatches.reduce((sum, batch) => sum + batch.length, 0);
|
|
40484
|
+
const totalFileCount = fileBatches.reduce((sum, batch) => sum + batch.length, 0);
|
|
40485
|
+
const runBatchPass = async (concurrency) => {
|
|
40500
40486
|
const allDiagnostics = [];
|
|
40501
40487
|
const droppedFiles = [];
|
|
40502
|
-
const oomDroppedFiles = [];
|
|
40503
40488
|
const deadlineSkippedFiles = [];
|
|
40489
|
+
const isPastDeadline = () => deadlineEpochMs !== void 0 && remainingDeadlineBudgetMs(deadlineEpochMs) === 0;
|
|
40504
40490
|
let firstDropReason = null;
|
|
40505
|
-
let firstNonOomDropReason = null;
|
|
40506
40491
|
const spawnLintBatch = async (batch, depth, batchState) => {
|
|
40507
40492
|
if (isPastDeadline()) {
|
|
40508
40493
|
deadlineSkippedFiles.push(...batch);
|
|
@@ -40524,14 +40509,12 @@ const spawnLintBatches = async (input) => {
|
|
|
40524
40509
|
const isDepthCapReached = depth >= splitMaxDepth;
|
|
40525
40510
|
if (batch.length <= 1 || isBudgetElapsed || isDepthCapReached) {
|
|
40526
40511
|
droppedFiles.push(...batch);
|
|
40527
|
-
|
|
40528
|
-
|
|
40529
|
-
|
|
40530
|
-
|
|
40531
|
-
|
|
40532
|
-
|
|
40533
|
-
firstDropReason ??= dropReason;
|
|
40534
|
-
if (!isOomDrop) firstNonOomDropReason ??= dropReason;
|
|
40512
|
+
if (firstDropReason === null) {
|
|
40513
|
+
let limitHint = "";
|
|
40514
|
+
if (isDepthCapReached) limitHint = ` (split depth cap of ${splitMaxDepth} levels reached)`;
|
|
40515
|
+
else if (isBudgetElapsed) limitHint = ` (split budget of ${splitTotalBudgetMs / MILLISECONDS_PER_SECOND}s exhausted at depth ${depth})`;
|
|
40516
|
+
firstDropReason = batch.length > 1 ? `${error.message}${limitHint}` : error.message;
|
|
40517
|
+
}
|
|
40535
40518
|
return [];
|
|
40536
40519
|
}
|
|
40537
40520
|
const splitIndex = Math.ceil(batch.length / 2);
|
|
@@ -40541,16 +40524,16 @@ const spawnLintBatches = async (input) => {
|
|
|
40541
40524
|
let startedFileCount = 0;
|
|
40542
40525
|
let scannedFileCount = 0;
|
|
40543
40526
|
let displayedFileCount = 0;
|
|
40544
|
-
const progressTimer =
|
|
40527
|
+
const progressTimer = onFileProgress && totalFileCount > 1 ? setInterval(() => {
|
|
40545
40528
|
const ceiling = Math.min(startedFileCount, totalFileCount - 1);
|
|
40546
40529
|
if (displayedFileCount < ceiling) {
|
|
40547
40530
|
displayedFileCount += 1;
|
|
40548
|
-
|
|
40531
|
+
onFileProgress(displayedFileCount, totalFileCount);
|
|
40549
40532
|
}
|
|
40550
40533
|
}, 50) : null;
|
|
40551
40534
|
progressTimer?.unref?.();
|
|
40552
40535
|
try {
|
|
40553
|
-
const batchResults = await mapWithConcurrency(
|
|
40536
|
+
const batchResults = await mapWithConcurrency(fileBatches, concurrency, async (batch) => {
|
|
40554
40537
|
if (isPastDeadline()) {
|
|
40555
40538
|
deadlineSkippedFiles.push(...batch);
|
|
40556
40539
|
return [];
|
|
@@ -40562,9 +40545,9 @@ const spawnLintBatches = async (input) => {
|
|
|
40562
40545
|
};
|
|
40563
40546
|
const batchDiagnostics = await spawnLintBatch(batch, 0, batchState);
|
|
40564
40547
|
scannedFileCount += batch.length - batchState.deadlineSkippedFileCount;
|
|
40565
|
-
if (
|
|
40548
|
+
if (onFileProgress) {
|
|
40566
40549
|
displayedFileCount = Math.min(Math.max(displayedFileCount, scannedFileCount), totalFileCount);
|
|
40567
|
-
|
|
40550
|
+
onFileProgress(displayedFileCount, totalFileCount);
|
|
40568
40551
|
}
|
|
40569
40552
|
return batchDiagnostics;
|
|
40570
40553
|
});
|
|
@@ -40572,53 +40555,22 @@ const spawnLintBatches = async (input) => {
|
|
|
40572
40555
|
} finally {
|
|
40573
40556
|
if (progressTimer !== null) clearInterval(progressTimer);
|
|
40574
40557
|
}
|
|
40575
|
-
|
|
40576
|
-
|
|
40577
|
-
|
|
40578
|
-
oomDroppedFiles,
|
|
40579
|
-
deadlineSkippedFiles,
|
|
40580
|
-
firstDropReason,
|
|
40581
|
-
firstNonOomDropReason
|
|
40558
|
+
const reportSkippedFiles = (skippedFiles, buildMessage) => {
|
|
40559
|
+
if (skippedFiles.length === 0 || !onPartialFailure) return;
|
|
40560
|
+
onPartialFailure(buildMessage(`${skippedFiles.slice(0, 3).join(", ")}${skippedFiles.length > 3 ? `, +${skippedFiles.length - 3} more` : ""}`));
|
|
40582
40561
|
};
|
|
40562
|
+
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
40563
|
+
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
40564
|
+
reportSkippedFiles(deadlineSkippedFiles, (fileListPreview) => `${deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
40565
|
+
return allDiagnostics;
|
|
40583
40566
|
};
|
|
40584
|
-
let
|
|
40585
|
-
let effectiveConcurrency = requestedConcurrency;
|
|
40567
|
+
let diagnostics;
|
|
40586
40568
|
try {
|
|
40587
|
-
|
|
40569
|
+
diagnostics = await runBatchPass(requestedConcurrency);
|
|
40588
40570
|
} catch (error) {
|
|
40589
40571
|
if (requestedConcurrency <= 1 || !isParallelismRelatedSpawnError(error)) throw error;
|
|
40590
|
-
|
|
40591
|
-
outcome = await runBatchPass(1, fileBatches, onFileProgress);
|
|
40592
|
-
}
|
|
40593
|
-
let { droppedFiles, firstDropReason } = outcome;
|
|
40594
|
-
const diagnostics = outcome.diagnostics;
|
|
40595
|
-
if (outcome.oomDroppedFiles.length > 0 && effectiveConcurrency > 1 && !isPastDeadline()) {
|
|
40596
|
-
rescueDeadlineEpochMs = Date.now() + OXLINT_OOM_RESCUE_BUDGET_MS;
|
|
40597
|
-
const rescuedFiles = /* @__PURE__ */ new Set();
|
|
40598
|
-
let firstRescueFailureReason = null;
|
|
40599
|
-
for (const oomDroppedFile of outcome.oomDroppedFiles) {
|
|
40600
|
-
if (isPastDeadline()) break;
|
|
40601
|
-
try {
|
|
40602
|
-
const rescueOutcome = await runBatchPass(1, [[oomDroppedFile]], void 0);
|
|
40603
|
-
diagnostics.push(...rescueOutcome.diagnostics);
|
|
40604
|
-
if (rescueOutcome.droppedFiles.length > 0 || rescueOutcome.deadlineSkippedFiles.length > 0) firstRescueFailureReason ??= rescueOutcome.firstDropReason;
|
|
40605
|
-
else rescuedFiles.add(oomDroppedFile);
|
|
40606
|
-
} catch (error) {
|
|
40607
|
-
firstRescueFailureReason ??= error instanceof Error ? error.message : String(error);
|
|
40608
|
-
}
|
|
40609
|
-
}
|
|
40610
|
-
rescueDeadlineEpochMs = void 0;
|
|
40611
|
-
droppedFiles = droppedFiles.filter((filePath) => !rescuedFiles.has(filePath));
|
|
40612
|
-
if (droppedFiles.length === 0) firstDropReason = null;
|
|
40613
|
-
else firstDropReason = firstRescueFailureReason ?? outcome.firstNonOomDropReason ?? firstDropReason;
|
|
40572
|
+
diagnostics = await runBatchPass(1);
|
|
40614
40573
|
}
|
|
40615
|
-
const reportSkippedFiles = (skippedFiles, buildMessage) => {
|
|
40616
|
-
if (skippedFiles.length === 0 || !onPartialFailure) return;
|
|
40617
|
-
onPartialFailure(buildMessage(`${skippedFiles.slice(0, 3).join(", ")}${skippedFiles.length > 3 ? `, +${skippedFiles.length - 3} more` : ""}`));
|
|
40618
|
-
};
|
|
40619
|
-
const reasonHint = firstDropReason ? ` — first failure: ${firstDropReason}` : "";
|
|
40620
|
-
reportSkippedFiles(droppedFiles, (fileListPreview) => `${droppedFiles.length} file(s) failed to lint and were skipped (${fileListPreview})${reasonHint}`);
|
|
40621
|
-
reportSkippedFiles(outcome.deadlineSkippedFiles, (fileListPreview) => `${outcome.deadlineSkippedFiles.length} file(s) skipped — max scan duration reached before they were linted (${fileListPreview})`);
|
|
40622
40574
|
return dedupeDiagnostics(diagnostics);
|
|
40623
40575
|
};
|
|
40624
40576
|
let didValidate = false;
|
|
@@ -44663,5 +44615,5 @@ const startLanguageServer = () => {
|
|
|
44663
44615
|
};
|
|
44664
44616
|
//#endregion
|
|
44665
44617
|
export { startLanguageServer };
|
|
44666
|
-
!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]="
|
|
44667
|
-
//# debugId=
|
|
44618
|
+
!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]="94aee89d-9f35-5b59-a911-566ac2ef5a0a")}catch(e){}}();
|
|
44619
|
+
//# debugId=94aee89d-9f35-5b59-a911-566ac2ef5a0a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.7.2-dev.
|
|
3
|
+
"version": "0.7.2-dev.fb8ffb0",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
67
|
"yaml": "^2.9.0",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
68
|
+
"deslop-js": "0.7.2",
|
|
69
|
+
"oxlint-plugin-react-doctor": "0.7.2-dev.fb8ffb0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@xterm/headless": "^6.0.0",
|
|
75
75
|
"commander": "^14.0.3",
|
|
76
76
|
"ora": "^9.4.0",
|
|
77
|
-
"@react-doctor/api": "0.7.2",
|
|
78
77
|
"@react-doctor/core": "0.7.2",
|
|
78
|
+
"@react-doctor/api": "0.7.2",
|
|
79
79
|
"@react-doctor/language-server": "0.7.2"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|