react-doctor 0.9.17-dev.fe5ed09 → 0.9.18-dev.9a79847
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 +16 -74
- package/dist/{build-section-divider-jdDJ0_Vv.js → build-section-divider-F18iXtxb.js} +5 -5
- package/dist/{ci-B69AXoJ9.js → ci-CgtjUZEp.js} +24 -14
- package/dist/cli.js +41 -32
- package/dist/constants-DNh19qg9.js +2 -2
- package/dist/{constants-DHn5rUeg.js → constants-_b1h6lxa.js} +7 -5
- package/dist/{design-tfgkvQeX.js → design-CtHsB1nr.js} +4 -4
- package/dist/duplicate-jsx-worker.js +3 -3
- package/dist/{exit-gracefully-DZR14OKB.js → exit-gracefully-D1DuwwPU.js} +6 -6
- package/dist/{handle-error-Bj42p4Sw.js → handle-error-B3AmBrIU.js} +6 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +332 -58
- package/dist/{inspect-CvENw7Ib.js → inspect-BhFj2qyJ.js} +31 -23
- package/dist/{install-BczXj1aK.js → install-3nDOB3hj.js} +10 -10
- package/dist/{install-doctor-script-D2671Liy.js → install-doctor-script-DHJd_h8L.js} +5 -5
- package/dist/{install-github-workflow-CRfLqBmy.js → install-github-workflow-BPUJzESV.js} +21 -8
- package/dist/{install-react-doctor-DFwguFs-.js → install-react-doctor-IU3RmjJs.js} +9 -9
- package/dist/{is-cache-globally-disabled-DDlh_f1u.js → is-cache-globally-disabled-BTTLvugj.js} +4 -4
- package/dist/{jsx-runtime-DcVXAnkV.js → jsx-runtime-BpqeSsvv.js} +6 -6
- package/dist/{print-branded-header-DBVtv5Tr.js → print-branded-header-Cabdds8M.js} +4 -4
- package/dist/{prompt-runtime-scan-url-DbZhGuOm.js → prompt-runtime-scan-url-DqGtnZaE.js} +5 -5
- package/dist/{read-object-file-DB530_Fl.js → read-object-file-OstnyYB2.js} +4 -4
- package/dist/{record-metric-B03OYFof.js → record-metric-CgebwK0K.js} +438 -84
- package/dist/{report-error-BulWOi7r.js → report-error-DYLN3xZA.js} +6 -6
- package/dist/{report-workflow-result-Bu3ua6IL.js → report-workflow-result-BfR_cSwa.js} +8 -7
- package/dist/{should-fail-scan-gate-D2-LV9oP.js → resolve-scan-exit-code-CMj5rx-z.js} +37 -41
- package/dist/{resolve-scope-DpwfVe0L.js → resolve-scope-DlV1G6NB.js} +10 -9
- package/dist/{rules-lsAfRYRW.js → rules-CCbE4U-k.js} +7 -7
- package/dist/{run-scan-app-BKSG5wy7.js → run-scan-app-D8hbdBvF.js} +33 -23
- package/dist/{runtime-scan-BdEQdmNB.js → runtime-scan-BINkjxmp.js} +10 -10
- package/dist/{sanitize-runtime-url-CR1L-ZVf.js → sanitize-runtime-url-B3CaL49D.js} +4 -4
- package/dist/{scan-CSS_HWO-.js → scan-D0JRVcBc.js} +14 -13
- package/dist/{should-skip-prompts-lOJNuSDr.js → should-skip-prompts-BQ6Bv8nf.js} +4 -4
- package/dist/{should-use-tui-DmVzga6l.js → should-use-tui-BxO6yE3o.js} +4 -4
- package/dist/skills/react-doctor/SKILL.md +19 -8
- package/dist/skills/react-doctor/references/explain.md +5 -0
- package/dist/{start-scan-preamble-BPz3nzCQ.js → start-scan-preamble-BbzEgrwo.js} +5 -5
- package/dist/start-scan-preamble.js +3 -3
- package/dist/{telemetry-runtime-Dp_wDVEZ.js → telemetry-runtime-BmL4aFx2.js} +7 -7
- package/dist/{version-BPQK2YWB.js → version-D2xd0HSm.js} +5 -5
- package/dist/{why-i1SnenZb.js → why-CO9Za1ph.js} +4 -4
- package/dist/{with-run-span--F1xHym-.js → with-run-span-CMr4jR2i.js} +6 -6
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
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]="
|
|
3
|
-
import { S as SENTRY_FLUSH_TIMEOUT_MS, u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
5
|
-
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-
|
|
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]="961e9709-190e-555a-bacc-9c1fb5e96b1f")}catch(e){}}();
|
|
3
|
+
import { S as SENTRY_FLUSH_TIMEOUT_MS, u as METRIC } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { Ft as isReactDoctorError, l as getRunId, o as buildSentryScope, t as recordCount } from "./record-metric-CgebwK0K.js";
|
|
5
|
+
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-BmL4aFx2.js";
|
|
6
6
|
import { r as recordRunTraceId, t as getActiveRunTrace } from "./active-run-trace-Dewycxda.js";
|
|
7
7
|
//#region src/cli/utils/report-error.ts
|
|
8
8
|
/**
|
|
@@ -61,5 +61,5 @@ const reportErrorToSentry = async (error) => {
|
|
|
61
61
|
//#endregion
|
|
62
62
|
export { reportErrorToSentry as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=report-error-
|
|
65
|
-
//# debugId=
|
|
64
|
+
//# sourceMappingURL=report-error-DYLN3xZA.js.map
|
|
65
|
+
//# debugId=961e9709-190e-555a-bacc-9c1fb5e96b1f
|
|
@@ -1,8 +1,8 @@
|
|
|
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]="
|
|
3
|
-
import { m as REACT_DOCTOR_CONFIG_PROJECT_NAME, u as METRIC } from "./constants-
|
|
4
|
-
import { t as recordCount } from "./record-metric-
|
|
5
|
-
import { u as isCommandAvailable } from "./install-github-workflow-
|
|
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]="b13bae0a-d507-527f-823c-0f9b564c0bfc")}catch(e){}}();
|
|
3
|
+
import { m as REACT_DOCTOR_CONFIG_PROJECT_NAME, u as METRIC } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { t as recordCount } from "./record-metric-CgebwK0K.js";
|
|
5
|
+
import { u as isCommandAvailable } from "./install-github-workflow-BPUJzESV.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import * as path$1 from "node:path";
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
@@ -274,7 +274,8 @@ const openUrl = (url) => new Promise((resolve) => {
|
|
|
274
274
|
//#region src/cli/utils/report-workflow-result.ts
|
|
275
275
|
const reportWorkflowResult = (workflowSpinner, result, projectRoot) => {
|
|
276
276
|
if (result.status === "failed") {
|
|
277
|
-
workflowSpinner.fail("Couldn't write the GitHub Actions workflow.");
|
|
277
|
+
if (result.error === "no-git-root") workflowSpinner.fail("Couldn't write the GitHub Actions workflow: no git repository found. Run this command from inside a git repository.");
|
|
278
|
+
else workflowSpinner.fail("Couldn't write the GitHub Actions workflow.");
|
|
278
279
|
return false;
|
|
279
280
|
}
|
|
280
281
|
if (result.status === "exists") {
|
|
@@ -288,5 +289,5 @@ const reportWorkflowResult = (workflowSpinner, result, projectRoot) => {
|
|
|
288
289
|
//#endregion
|
|
289
290
|
export { recordGate as a, ACTION_UPGRADE_EVENT as c, INSTALL_AGENTS_PREFERENCE_ID as d, ONBOARDING_EVENT as f, loadAgentInstall as g, detectAvailableAgents as h, readPreference as i, CI_PITCH_EVENT as l, computeDefaultSelectedAgents as m, openUrl as n, runMigrations as o, SETUP_HINT_EVENT as p, isGatePending as r, writePreference as s, reportWorkflowResult as t, HANDOFF_TARGET_PREFERENCE_ID as u };
|
|
290
291
|
|
|
291
|
-
//# sourceMappingURL=report-workflow-result-
|
|
292
|
-
//# debugId=
|
|
292
|
+
//# sourceMappingURL=report-workflow-result-BfR_cSwa.js.map
|
|
293
|
+
//# debugId=b13bae0a-d507-527f-823c-0f9b564c0bfc
|
|
@@ -1,18 +1,18 @@
|
|
|
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]="
|
|
3
|
-
import { E as TRACKED_FILE_FLAGS_GIT_ARGUMENTS, Ft as HTML_FILE_PATTERN, Ht as MAINTAINABILITY_SOURCE_FILE_PATTERN, Jt as OXLINT_NODE_REQUIREMENT, K as resolveReactDoctorCacheDir, Nt as GIT_SHOW_MAX_BUFFER_BYTES, Rt as JSX_FILE_PATTERN, St as ENTERPRISE_CONTACT_URL, Wt as MILLISECONDS_PER_SECOND, _t as DIAGNOSTIC_CATEGORY_BUCKETS, c as HEAD_SHA_GIT_ARGUMENTS, dn as SHARE_BASE_URL, h as REPOSITORY_ROOT_GIT_ARGUMENTS, i as BASELINE_FILES_TEMP_DIR_PREFIX, k as WORKTREE_STATUS_GIT_ARGUMENTS, q as resolveScanConcurrency, u as METRIC, ut as CI_URL, v as SCAN_RESULT_CACHE_FILENAME } from "./constants-
|
|
4
|
-
import { t as isCacheGloballyDisabled } from "./is-cache-globally-disabled-
|
|
5
|
-
import { $ as buildRuleSeverityControls,
|
|
6
|
-
import { t as getTelemetryContext } from "./telemetry-runtime-
|
|
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]="45138e23-1dd9-5b00-bcfe-ecb97fd707c6")}catch(e){}}();
|
|
3
|
+
import { E as TRACKED_FILE_FLAGS_GIT_ARGUMENTS, Ft as HTML_FILE_PATTERN, Ht as MAINTAINABILITY_SOURCE_FILE_PATTERN, Jt as OXLINT_NODE_REQUIREMENT, K as resolveReactDoctorCacheDir, Nt as GIT_SHOW_MAX_BUFFER_BYTES, Rt as JSX_FILE_PATTERN, St as ENTERPRISE_CONTACT_URL, Wt as MILLISECONDS_PER_SECOND, _t as DIAGNOSTIC_CATEGORY_BUCKETS, c as HEAD_SHA_GIT_ARGUMENTS, dn as SHARE_BASE_URL, h as REPOSITORY_ROOT_GIT_ARGUMENTS, i as BASELINE_FILES_TEMP_DIR_PREFIX, k as WORKTREE_STATUS_GIT_ARGUMENTS, q as resolveScanConcurrency, u as METRIC, ut as CI_URL, v as SCAN_RESULT_CACHE_FILENAME } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { t as isCacheGloballyDisabled } from "./is-cache-globally-disabled-BTTLvugj.js";
|
|
5
|
+
import { $ as buildRuleSeverityControls, A as Files, An as mergeAll, B as PerFileLintCacheEnabled, Bt as listSourceFilesCooperative, C as ACTION_INPUT_ENVIRONMENT_VARIABLES, Cn as provideService, Dn as try_, Dt as getRuleMetadata, E as isCiOrCodingAgentEnvironment, En as sync, F as Linter, Ft as isReactDoctorError, G as SidecarLintCacheEnabled, Gt as mergeAndFilterDiagnostics, H as Project, Hn as isDirectory, I as Maintainability, Jt as resolveGithubActionsScoreMetadata, Kt as mergeReactDoctorConfigs, L as NodeResolver, Ln as ParentSpan, Lt as isScanComplete, M as InvocationCaches, Mn as succeed, Mt as highlighter, Nt as isPathInsideDirectory, O as Config, Ot as groupBy, P as LintPartialFailures, Q as buildRuleDocsUrl, Qt as runInspect, R as OxlintConcurrency, Rn as isMonorepoRoot, Sn as provideContext, T as isCiEnvironment, Tn as runSync, U as Reporter, Ut as mapWithConcurrency, V as Progress, Vt as listWorkspacePackages, W as Score, Wn as isFile, Wt as materializeSourceTree, X as atomicWriteJson, Xt as resolveScanTarget, Yt as resolveLintBatchOrdering, Zt as restoreLegacyThrow, _ as VERSION, an as warmDuplicateJsxWorker, at as collectSourceFilesByDirectory, b as isNonInteractiveEnvironment, bn as promise, cn as error, ct as countOptInProjectRuleSelections, d as isJsonModeActive, dn as warn, dt as createOxlintSpawnSlots, et as buildSkippedChecks, fn as Diagnostic, gn as gen, gt as filterSourceFiles, ht as filterPathsOutsideDirectories, j as Git, jt as hashFileContents, k as DIAGNOSTIC_DELTA_IDENTITY, kt as hasPublishedFixRecipe, l as getRunId, lt as createChangedLineMatcher, mn as decodeUnknownSync, mt as filterDiagnosticsForSurface, n as recordDistribution, nn as summarizeDiagnostics, nt as canonicalizeUserRuleKey, on as warmOxlintWorkerPool, ot as computeConfigFingerprint, pt as discoverSupportedSubprojects, q as SupplyChain, qt as remainingDeadlineBudgetMs, r as toSpanAttributes, rt as classifyFileContext, sn as Console, st as computeDiagnosticDelta, t as recordCount, tn as shouldUseMaintainabilityLayer, tt as calculateScore, un as log, ut as createInvocationCaches, v as makeNoopConsole, vn as map, w as detectRunnerOs, wn as runPromise, wt as getDiagnosticRuleIdentity, xn as provide, y as CliInputError, yn as orElseSucceed, yt as fingerprintDiagnosticEvidence, z as OxlintSpawnSlots, zn as yieldToEventLoop, zt as listSourceFiles } from "./record-metric-CgebwK0K.js";
|
|
6
|
+
import { t as getTelemetryContext } from "./telemetry-runtime-BmL4aFx2.js";
|
|
7
7
|
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-CCTgal0O.js";
|
|
8
|
-
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-
|
|
8
|
+
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-F18iXtxb.js";
|
|
9
9
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
10
10
|
import { t as typescriptBinding } from "./_react-doctor_require-typescript-DXQDYeWK.js";
|
|
11
|
-
import { A as runGitAsync, C as isRecord, N as cliLogger, S as getPackageJsonPath, a as installReactDoctorScriptStep, c as spinner, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-
|
|
12
|
-
import { d as detectDefaultBranch, l as prompts, r as installReactDoctorWorkflow, u as isCommandAvailable } from "./install-github-workflow-
|
|
13
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, o as pickBlockingLevel } from "./resolve-scope-
|
|
14
|
-
import { n as resetSentryRunState, r as withRunSpan, t as recordSentryProjectContext } from "./with-run-span
|
|
15
|
-
import { h as detectAvailableAgents, t as reportWorkflowResult } from "./report-workflow-result-
|
|
11
|
+
import { A as runGitAsync, C as isRecord, N as cliLogger, S as getPackageJsonPath, a as installReactDoctorScriptStep, c as spinner, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-DHJd_h8L.js";
|
|
12
|
+
import { d as detectDefaultBranch, l as prompts, r as installReactDoctorWorkflow, u as isCommandAvailable } from "./install-github-workflow-BPUJzESV.js";
|
|
13
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, o as pickBlockingLevel } from "./resolve-scope-DlV1G6NB.js";
|
|
14
|
+
import { n as resetSentryRunState, r as withRunSpan, t as recordSentryProjectContext } from "./with-run-span-CMr4jR2i.js";
|
|
15
|
+
import { h as detectAvailableAgents, t as reportWorkflowResult } from "./report-workflow-result-BfR_cSwa.js";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
17
|
import * as fs$2 from "node:fs";
|
|
18
18
|
import fs, { mkdtempSync, rmSync } from "node:fs";
|
|
@@ -464,6 +464,7 @@ const buildOutcomeAttributes = (input) => {
|
|
|
464
464
|
}),
|
|
465
465
|
...withNamespace("diag", {
|
|
466
466
|
total: summary.totalDiagnosticCount,
|
|
467
|
+
withExplicitContext: result.diagnostics.filter((diagnostic) => Boolean(diagnostic.contextRanges?.length)).length,
|
|
467
468
|
errors: summary.errorCount,
|
|
468
469
|
warnings: summary.warningCount,
|
|
469
470
|
affectedFiles: summary.affectedFileCount,
|
|
@@ -555,6 +556,7 @@ const buildScanAttributes = (input) => {
|
|
|
555
556
|
usedOutputDir: input.usedOutputDir,
|
|
556
557
|
ignoredTagCount: input.ignoredTagCount,
|
|
557
558
|
hasCustomConfig: input.hasCustomConfig,
|
|
559
|
+
customRulesOnly: input.userConfig?.customRulesOnly ?? false,
|
|
558
560
|
rulesConfigured: ruleKeys.length,
|
|
559
561
|
rulesDisabled: ruleKeys.filter((key) => ruleOverrides[key] === "off").length,
|
|
560
562
|
projectAnalysisRuleCount: countOptInProjectRuleSelections(buildRuleSeverityControls(input.userConfig)),
|
|
@@ -597,21 +599,9 @@ const recordRunEvent = (rootSpan, input) => {
|
|
|
597
599
|
} catch {}
|
|
598
600
|
};
|
|
599
601
|
//#endregion
|
|
600
|
-
//#region src/cli/utils/diagnostic-intersects-line-ranges.ts
|
|
601
|
-
const diagnosticIntersectsLineRanges = (diagnostic, lineRanges) => {
|
|
602
|
-
const diagnosticEndLine = Math.max(diagnostic.line, diagnostic.endLine ?? diagnostic.line);
|
|
603
|
-
return lineRanges.some(([rangeStartLine, rangeEndLine]) => diagnostic.line <= rangeEndLine && diagnosticEndLine >= rangeStartLine);
|
|
604
|
-
};
|
|
605
|
-
//#endregion
|
|
606
602
|
//#region src/cli/utils/filter-diagnostics-by-changed-lines.ts
|
|
607
603
|
const filterDiagnosticsByChangedLines = (input) => {
|
|
608
|
-
|
|
609
|
-
for (const entry of input.changedLineRanges) rangesByFile.set(toForwardSlashes(entry.file), entry.ranges);
|
|
610
|
-
return input.diagnostics.filter((diagnostic) => {
|
|
611
|
-
const relativePath = toForwardSlashes(path.isAbsolute(diagnostic.filePath) ? path.relative(input.directory, diagnostic.filePath) : diagnostic.filePath);
|
|
612
|
-
const ranges = rangesByFile.get(relativePath);
|
|
613
|
-
return ranges !== void 0 && diagnosticIntersectsLineRanges(diagnostic, ranges);
|
|
614
|
-
});
|
|
604
|
+
return input.diagnostics.filter(createChangedLineMatcher(input));
|
|
615
605
|
};
|
|
616
606
|
//#endregion
|
|
617
607
|
//#region src/cli/utils/resolve-invocation-oxlint-concurrency.ts
|
|
@@ -733,6 +723,7 @@ const resolveInspectOptions = (inputOptions, userConfig) => {
|
|
|
733
723
|
maxDurationMs: inputOptions.maxDurationMs ?? null,
|
|
734
724
|
baselineReport: inputOptions.baselineReport ?? null,
|
|
735
725
|
baseline: inputOptions.baseline ?? null,
|
|
726
|
+
contextual: inputOptions.contextual ?? false,
|
|
736
727
|
changedLineRanges: inputOptions.changedLineRanges ?? null,
|
|
737
728
|
supplyChainManifestChanged: inputOptions.supplyChainManifestChanged ?? false,
|
|
738
729
|
excludedProjectDirectories: inputOptions.excludedProjectDirectories ?? [],
|
|
@@ -1101,7 +1092,7 @@ const resolveWorkerTelemetry = (resolvedWorkerCount, pinnedConcurrency) => {
|
|
|
1101
1092
|
const silentConsole$2 = makeNoopConsole();
|
|
1102
1093
|
const deriveScope = (options) => {
|
|
1103
1094
|
if (options.baseline || options.baselineReport) return "changed";
|
|
1104
|
-
if (options.changedLineRanges !== null) return "lines";
|
|
1095
|
+
if (options.changedLineRanges !== null) return options.contextual ? "contextual" : "lines";
|
|
1105
1096
|
return options.includePaths.length > 0 ? "files" : "full";
|
|
1106
1097
|
};
|
|
1107
1098
|
const buildRunEventConfig = (options, userConfig, resolvedWorkerCount) => {
|
|
@@ -2223,6 +2214,7 @@ const buildScanResultCacheKey = async (input) => {
|
|
|
2223
2214
|
lintBatchOrdering: resolveLintBatchOrdering(),
|
|
2224
2215
|
baselineRef: input.options.baseline?.ref,
|
|
2225
2216
|
changedLineRanges: input.options.changedLineRanges ?? void 0,
|
|
2217
|
+
contextual: input.options.contextual ?? false,
|
|
2226
2218
|
noScore: input.options.noScore,
|
|
2227
2219
|
isCi: input.options.isCi,
|
|
2228
2220
|
suppressRendering: input.options.suppressRendering,
|
|
@@ -2519,6 +2511,7 @@ const runInspectWithRuntime = async (directory, options, userConfig, hasConfigOv
|
|
|
2519
2511
|
} else if (options.changedLineRanges !== null && isDiffMode) inspectDiagnostics = filterDiagnosticsByChangedLines({
|
|
2520
2512
|
directory,
|
|
2521
2513
|
diagnostics: headDiagnostics,
|
|
2514
|
+
contextual: options.contextual,
|
|
2522
2515
|
changedLineRanges: options.changedLineRanges
|
|
2523
2516
|
});
|
|
2524
2517
|
const baselineDegraded = (Boolean(options.baselineReport) || Boolean(options.baseline) && isDiffMode) && baselineDelta === void 0;
|
|
@@ -2917,8 +2910,8 @@ const resolveProjectChangedLineRanges = (rootDirectory, projectDirectory, ranges
|
|
|
2917
2910
|
const relativeProjectDirectory = resolveProjectRelativeDirectory(rootDirectory, projectDirectory);
|
|
2918
2911
|
if (relativeProjectDirectory === null) return [];
|
|
2919
2912
|
if (relativeProjectDirectory.length === 0) return ranges.map((entry) => ({
|
|
2920
|
-
|
|
2921
|
-
|
|
2913
|
+
...entry,
|
|
2914
|
+
file: toForwardSlashes(entry.file)
|
|
2922
2915
|
}));
|
|
2923
2916
|
const projectPrefix = `${relativeProjectDirectory}/`;
|
|
2924
2917
|
return ranges.flatMap((entry) => {
|
|
@@ -2926,8 +2919,8 @@ const resolveProjectChangedLineRanges = (rootDirectory, projectDirectory, ranges
|
|
|
2926
2919
|
if (!normalizedFilePath.startsWith(projectPrefix)) return [];
|
|
2927
2920
|
const projectRelativePath = normalizedFilePath.slice(projectPrefix.length);
|
|
2928
2921
|
return projectRelativePath.length > 0 ? [{
|
|
2929
|
-
|
|
2930
|
-
|
|
2922
|
+
...entry,
|
|
2923
|
+
file: projectRelativePath
|
|
2931
2924
|
}] : [];
|
|
2932
2925
|
});
|
|
2933
2926
|
};
|
|
@@ -3136,7 +3129,7 @@ const usedDiffAlias = (flags) => flags.diff !== void 0 && flags.diff !== false &
|
|
|
3136
3129
|
const usedScope = (flags) => typeof flags.scope === "string" && flags.scope.length > 0;
|
|
3137
3130
|
const validateIncludeUntrackedScope = (includeUntracked, scope) => {
|
|
3138
3131
|
if (!includeUntracked || scope !== void 0 && scope !== "full") return;
|
|
3139
|
-
throw new CliInputError("--include-untracked requires the files, changed, or
|
|
3132
|
+
throw new CliInputError("--include-untracked requires the files, changed, lines, or contextual scope (via --scope, --diff, or config).");
|
|
3140
3133
|
};
|
|
3141
3134
|
const validateFilePathSelectionFlags = (flags) => {
|
|
3142
3135
|
if (flags.staged || flags.changedFilesFrom !== void 0) throw new CliInputError("Cannot combine file path arguments with --staged or --changed-files-from. Use one file source.");
|
|
@@ -3145,10 +3138,10 @@ const validateFilePathSelectionFlags = (flags) => {
|
|
|
3145
3138
|
if (flags.base !== void 0) throw new CliInputError("Cannot combine file path arguments with --base. The selected files do not need a Git base.");
|
|
3146
3139
|
};
|
|
3147
3140
|
const validateModeFlags = (flags) => {
|
|
3148
|
-
if (flags.baseline && (flags.staged || flags.scope === "lines" || flags.scope === "files")) throw new CliInputError("--baseline requires a full or changed scan; it cannot be combined with --staged.");
|
|
3141
|
+
if (flags.baseline && (flags.staged || flags.scope === "lines" || flags.scope === "contextual" || flags.scope === "files")) throw new CliInputError("--baseline requires a full or changed scan; it cannot be combined with --staged.");
|
|
3149
3142
|
if (usedScope(flags) && usedDiffAlias(flags)) throw new CliInputError("Cannot combine --scope and --diff; --diff is the deprecated alias.");
|
|
3150
3143
|
if (flags.staged && usedDiffAlias(flags)) throw new CliInputError("Cannot combine --staged and --diff; pick one mode.");
|
|
3151
|
-
if (flags.staged && (flags.scope === "full" || flags.scope === "changed")) throw new CliInputError(`Cannot combine --staged with --scope ${flags.scope}; use --scope files or --scope
|
|
3144
|
+
if (flags.staged && (flags.scope === "full" || flags.scope === "changed")) throw new CliInputError(`Cannot combine --staged with --scope ${flags.scope}; use --scope files, --scope lines, or --scope contextual, or drop --scope.`);
|
|
3152
3145
|
if (flags.includeUntracked && flags.staged) throw new CliInputError("Cannot combine --include-untracked with --staged; the git index never holds untracked files.");
|
|
3153
3146
|
if (flags.score && flags.json) throw new CliInputError("Cannot combine --score and --json; pick one output mode.");
|
|
3154
3147
|
if (flags.score && flags.telemetry === false) throw new CliInputError("Cannot combine --score with --no-telemetry; --score prints the score that --no-telemetry disables.");
|
|
@@ -3161,15 +3154,18 @@ const validateModeFlags = (flags) => {
|
|
|
3161
3154
|
//#region src/cli/utils/format-skipped-projects-message.ts
|
|
3162
3155
|
const formatSkippedProjectsMessage = (projectCount) => `${projectCount} ${projectCount === 1 ? "project was" : "projects were"} skipped because the max scan duration was reached.`;
|
|
3163
3156
|
//#endregion
|
|
3164
|
-
//#region src/cli/utils/
|
|
3165
|
-
const
|
|
3166
|
-
if (input.blockingLevel === "none") return
|
|
3167
|
-
if (input.scans.some(({ result }) => hasLintHardFailure(result))) return
|
|
3168
|
-
if (input.diagnosticsAreGateExempt === true) return
|
|
3169
|
-
|
|
3157
|
+
//#region src/cli/utils/resolve-scan-exit-code.ts
|
|
3158
|
+
const resolveScanExitCode = (input) => {
|
|
3159
|
+
if (input.blockingLevel === "none") return 0;
|
|
3160
|
+
if (input.scans.some(({ result }) => hasLintHardFailure(result))) return 1;
|
|
3161
|
+
if (input.diagnosticsAreGateExempt === true) return 0;
|
|
3162
|
+
const diagnostics = filterScansForSurface(input.scans, "ciFailure");
|
|
3163
|
+
if (shouldBlockCi(diagnostics, input.blockingLevel)) return 1;
|
|
3164
|
+
if (diagnostics.some((diagnostic) => diagnostic.severity === "warning")) return input.warningExitCode ?? 0;
|
|
3165
|
+
return 0;
|
|
3170
3166
|
};
|
|
3171
3167
|
//#endregion
|
|
3172
|
-
export { createInvocationInspect as A, hasIncompleteScoreAnalysis as B, detectLaunchableAgents as C, buildHandoffPayload as D, launchCliAgent as E, formatSkippedCheckLabel as F, hasLintHardFailure as G, buildNoScoreMessage as H, formatElapsedTime as I, formatFixRecipeLine as J, buildRulePriorityMap as K, printFooter as L, resolveMergeBaseRef as M, printHeadlessReport as N, collectProjectSourceFiles as O, pluralize as P, printDiagnosticsDump as R, setUpGitHubActions as S, copyToClipboard as T, buildEmptyReportMessage as U, filterDiagnosticsByCategories as V, resolveInvocationOxlintConcurrency as W, formatLearnMoreLine as Y, retryMissingProjectScores as _, validateModeFlags as a, filterScansForSurface as b, partitionProjectScanOutcomes as c, buildCodeFrame as d, resolveProjectScan as f, resolveProjectRelativeDirectory as g, resolveProjectSourceFilePaths as h, validateIncludeUntrackedScope as i, inspect as j, deduplicateProjectScans as k, discoverWorkspacePackages as l, resolveProjectDiffIncludePaths as m, formatSkippedProjectsMessage as n, resolveExcludedProjectDirectories as o, resolveProjectChangedLineRanges as p, buildSortedRuleGroups as q, validateFilePathSelectionFlags as r, projectManifestChanged as s,
|
|
3168
|
+
export { createInvocationInspect as A, hasIncompleteScoreAnalysis as B, detectLaunchableAgents as C, buildHandoffPayload as D, launchCliAgent as E, formatSkippedCheckLabel as F, hasLintHardFailure as G, buildNoScoreMessage as H, formatElapsedTime as I, formatFixRecipeLine as J, buildRulePriorityMap as K, printFooter as L, resolveMergeBaseRef as M, printHeadlessReport as N, collectProjectSourceFiles as O, pluralize as P, printDiagnosticsDump as R, setUpGitHubActions as S, copyToClipboard as T, buildEmptyReportMessage as U, filterDiagnosticsByCategories as V, resolveInvocationOxlintConcurrency as W, formatLearnMoreLine as Y, retryMissingProjectScores as _, validateModeFlags as a, filterScansForSurface as b, partitionProjectScanOutcomes as c, buildCodeFrame as d, resolveProjectScan as f, resolveProjectRelativeDirectory as g, resolveProjectSourceFilePaths as h, validateIncludeUntrackedScope as i, inspect as j, deduplicateProjectScans as k, discoverWorkspacePackages as l, resolveProjectDiffIncludePaths as m, formatSkippedProjectsMessage as n, resolveExcludedProjectDirectories as o, resolveProjectChangedLineRanges as p, buildSortedRuleGroups as q, validateFilePathSelectionFlags as r, projectManifestChanged as s, resolveScanExitCode as t, selectProjects as u, resolveWorkspaceDeadCodeOwner as v, CLI_AGENT_BINARIES as w, countUniqueScannedFiles as x, resolveCliInspectOptions as y, formatDiagnosticSite as z };
|
|
3173
3169
|
|
|
3174
|
-
//# sourceMappingURL=
|
|
3175
|
-
//# debugId=
|
|
3170
|
+
//# sourceMappingURL=resolve-scan-exit-code-CMj5rx-z.js.map
|
|
3171
|
+
//# debugId=45138e23-1dd9-5b00-bcfe-ecb97fd707c6
|
|
@@ -1,9 +1,9 @@
|
|
|
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]="
|
|
3
|
-
import {
|
|
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]="fe51b54f-1cad-55b8-8c59-3c65bed9a04f")}catch(e){}}();
|
|
3
|
+
import { Nt as isPathInsideDirectory, Vn as toCanonicalPath, gt as filterSourceFiles } from "./record-metric-CgebwK0K.js";
|
|
4
4
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
5
|
-
import { N as cliLogger } from "./install-doctor-script-
|
|
6
|
-
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-
|
|
5
|
+
import { N as cliLogger } from "./install-doctor-script-DHJd_h8L.js";
|
|
6
|
+
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-BPUJzESV.js";
|
|
7
7
|
import * as path$1 from "node:path";
|
|
8
8
|
//#region src/cli/utils/open-workflow-pull-request.ts
|
|
9
9
|
const NEW_BRANCH_PREFIX = "react-doctor/add-github-actions";
|
|
@@ -223,7 +223,8 @@ const SCOPE_VALUES = new Set([
|
|
|
223
223
|
"full",
|
|
224
224
|
"files",
|
|
225
225
|
"changed",
|
|
226
|
-
"lines"
|
|
226
|
+
"lines",
|
|
227
|
+
"contextual"
|
|
227
228
|
]);
|
|
228
229
|
const isScopeValue = (value) => SCOPE_VALUES.has(value);
|
|
229
230
|
const coerceDeprecatedDiff = (value) => {
|
|
@@ -252,7 +253,7 @@ const resolveScope = (flags, userConfig) => {
|
|
|
252
253
|
base,
|
|
253
254
|
usedDeprecatedDiff: false
|
|
254
255
|
};
|
|
255
|
-
cliLogger.warn(`Invalid --scope "${flags.scope}". Expected one of: full, files, changed, lines. Ignoring.`);
|
|
256
|
+
cliLogger.warn(`Invalid --scope "${flags.scope}". Expected one of: full, files, changed, lines, contextual. Ignoring.`);
|
|
256
257
|
}
|
|
257
258
|
const flagDiff = coerceDeprecatedDiff(flags.diff);
|
|
258
259
|
if (flagDiff !== void 0) return {
|
|
@@ -266,7 +267,7 @@ const resolveScope = (flags, userConfig) => {
|
|
|
266
267
|
base,
|
|
267
268
|
usedDeprecatedDiff: false
|
|
268
269
|
};
|
|
269
|
-
cliLogger.warn(`Invalid scope "${userConfig.scope}" in config. Expected one of: full, files, changed, lines. Ignoring.`);
|
|
270
|
+
cliLogger.warn(`Invalid scope "${userConfig.scope}" in config. Expected one of: full, files, changed, lines, contextual. Ignoring.`);
|
|
270
271
|
}
|
|
271
272
|
const configDiff = coerceDeprecatedDiff(userConfig?.diff);
|
|
272
273
|
if (configDiff !== void 0) return {
|
|
@@ -333,5 +334,5 @@ const finalizeScope = async ({ requested, diffInfo, skipPrompts, isQuiet }) => {
|
|
|
333
334
|
//#endregion
|
|
334
335
|
export { isValidBlockingLevel as a, openWorkflowPullRequest as c, warnDeprecatedDiff as i, stageWorkflowFile as l, isScopeValue as n, pickBlockingLevel as o, resolveScope as r, resolveBlockingLevel as s, finalizeScope as t };
|
|
335
336
|
|
|
336
|
-
//# sourceMappingURL=resolve-scope-
|
|
337
|
-
//# debugId=
|
|
337
|
+
//# sourceMappingURL=resolve-scope-DlV1G6NB.js.map
|
|
338
|
+
//# debugId=fe51b54f-1cad-55b8-8c59-3c65bed9a04f
|
|
@@ -1,9 +1,9 @@
|
|
|
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]="
|
|
3
|
-
import { dt as COMPILER_CLEANUP_BUCKET, ft as COMPILER_CLEANUP_RULE_KEYS, u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
5
|
-
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-
|
|
6
|
-
import { t as readObjectFile } from "./read-object-file-
|
|
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]="594dfc39-686f-559a-8ced-ea358b2314a2")}catch(e){}}();
|
|
3
|
+
import { dt as COMPILER_CLEANUP_BUCKET, ft as COMPILER_CLEANUP_RULE_KEYS, u as METRIC } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { Et as getEquivalentRuleKeys, Gn as isPlainObject, Ht as loadConfigWithSource, It as isSameRuleKey, Mt as highlighter, Q as buildRuleDocsUrl, in as validateConfigTypes, it as clearConfigCache, t as recordCount } from "./record-metric-CgebwK0K.js";
|
|
5
|
+
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-DHJd_h8L.js";
|
|
6
|
+
import { t as readObjectFile } from "./read-object-file-OstnyYB2.js";
|
|
7
7
|
import * as fs$1 from "node:fs";
|
|
8
8
|
import * as path$1 from "node:path";
|
|
9
9
|
import { REACT_DOCTOR_RULES } from "oxlint-plugin-react-doctor/core";
|
|
@@ -578,5 +578,5 @@ const rulesUnignoreTagAction = async (tag, options) => {
|
|
|
578
578
|
//#endregion
|
|
579
579
|
export { rulesCategoryAction, rulesDisableAction, rulesEnableAction, rulesExplainAction, rulesIgnoreTagAction, rulesListAction, rulesSetAction, rulesUnignoreTagAction };
|
|
580
580
|
|
|
581
|
-
//# sourceMappingURL=rules-
|
|
582
|
-
//# debugId=
|
|
581
|
+
//# sourceMappingURL=rules-CCbE4U-k.js.map
|
|
582
|
+
//# debugId=594dfc39-686f-559a-8ced-ea358b2314a2
|
|
@@ -1,14 +1,14 @@
|
|
|
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]="
|
|
3
|
-
import { D as TUI_REPORT_COMPACT_MAX_ROWS, In as getCategoryImpact, O as TUI_REPORT_DETAIL_WIDTH_FRACTION, _t as DIAGNOSTIC_CATEGORY_BUCKETS, kt as GITHUB_ACTIONS_SETUP_URL, o as CI_TRUST_COMPANIES, u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
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]="0d82de2a-8b97-5d2b-86c6-5cbc4508033a")}catch(e){}}();
|
|
3
|
+
import { D as TUI_REPORT_COMPACT_MAX_ROWS, In as getCategoryImpact, O as TUI_REPORT_DETAIL_WIDTH_FRACTION, _t as DIAGNOSTIC_CATEGORY_BUCKETS, kt as GITHUB_ACTIONS_SETUP_URL, o as CI_TRUST_COMPANIES, u as METRIC } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { Ct as getChangedLineRanges, En as sync, Mn as succeed, Mt as highlighter, On as void_, Q as buildRuleDocsUrl, St as getBaselineDiffPlan, T as isCiEnvironment, Tt as getDiffInfo, U as Reporter, Ut as mapWithConcurrency, V as Progress, Xt as resolveScanTarget, kt as hasPublishedFixRecipe, n as recordDistribution, qt as remainingDeadlineBudgetMs, t as recordCount, tt as calculateScore, wn as runPromise, x as isGitHookEnvironment, zn as yieldToEventLoop } from "./record-metric-CgebwK0K.js";
|
|
5
5
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
6
|
-
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-
|
|
7
|
-
import { i as isReactDoctorWorkflowInstalled } from "./install-github-workflow-
|
|
8
|
-
import { r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-
|
|
9
|
-
import { A as createInvocationInspect, B as hasIncompleteScoreAnalysis, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, F as formatSkippedCheckLabel, G as hasLintHardFailure, H as buildNoScoreMessage, I as formatElapsedTime, J as formatFixRecipeLine, K as buildRulePriorityMap, L as printFooter, M as resolveMergeBaseRef, O as collectProjectSourceFiles, P as pluralize, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, Y as formatLearnMoreLine, _ as retryMissingProjectScores, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, q as buildSortedRuleGroups, s as projectManifestChanged, t as
|
|
10
|
-
import { a as recordGate, f as ONBOARDING_EVENT, n as openUrl, r as isGatePending } from "./report-workflow-result-
|
|
11
|
-
import { a as useExitOnCtrlC, c as Spinner, d as useInput, f as Transform, h as Box, i as import_react, l as useStdout, m as Text, n as registerMountedTuiRenderer, o as terminalSymbols, p as render, r as useStdoutDimensions, s as isPrintableInput, t as require_jsx_runtime, u as useApp } from "./jsx-runtime-
|
|
6
|
+
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-DHJd_h8L.js";
|
|
7
|
+
import { i as isReactDoctorWorkflowInstalled } from "./install-github-workflow-BPUJzESV.js";
|
|
8
|
+
import { r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-DlV1G6NB.js";
|
|
9
|
+
import { A as createInvocationInspect, B as hasIncompleteScoreAnalysis, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, F as formatSkippedCheckLabel, G as hasLintHardFailure, H as buildNoScoreMessage, I as formatElapsedTime, J as formatFixRecipeLine, K as buildRulePriorityMap, L as printFooter, M as resolveMergeBaseRef, O as collectProjectSourceFiles, P as pluralize, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, Y as formatLearnMoreLine, _ as retryMissingProjectScores, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, q as buildSortedRuleGroups, s as projectManifestChanged, t as resolveScanExitCode, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions, z as formatDiagnosticSite } from "./resolve-scan-exit-code-CMj5rx-z.js";
|
|
10
|
+
import { a as recordGate, f as ONBOARDING_EVENT, n as openUrl, r as isGatePending } from "./report-workflow-result-BfR_cSwa.js";
|
|
11
|
+
import { a as useExitOnCtrlC, c as Spinner, d as useInput, f as Transform, h as Box, i as import_react, l as useStdout, m as Text, n as registerMountedTuiRenderer, o as terminalSymbols, p as render, r as useStdoutDimensions, s as isPrintableInput, t as require_jsx_runtime, u as useApp } from "./jsx-runtime-BpqeSsvv.js";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { performance } from "node:perf_hooks";
|
|
14
14
|
import isUnicodeSupported from "is-unicode-supported";
|
|
@@ -48,7 +48,8 @@ const resolveProjectTuiScanScope = (input) => {
|
|
|
48
48
|
baseFiles: baselineBaseFiles,
|
|
49
49
|
headFiles: baselineHeadFiles
|
|
50
50
|
} : void 0,
|
|
51
|
-
|
|
51
|
+
contextual: input.plan.scope === "contextual",
|
|
52
|
+
changedLineRanges: (input.plan.scope === "lines" || input.plan.scope === "contextual") && input.plan.changedLineRanges !== null ? resolveProjectChangedLineRanges(input.rootDirectory, input.projectDirectory, input.plan.changedLineRanges) : void 0,
|
|
52
53
|
supplyChainManifestChanged
|
|
53
54
|
};
|
|
54
55
|
};
|
|
@@ -72,13 +73,14 @@ const resolveTuiScanScope = async (input) => {
|
|
|
72
73
|
const baselineRef = scope === "changed" ? comparisonBaseRef : null;
|
|
73
74
|
const baselineDiffPlan = baselineRef === null ? null : await getBaselineDiffPlan(input.directory, baselineRef);
|
|
74
75
|
const linesBaseRef = diffInfo?.isCurrentChanges ? "HEAD" : comparisonBaseRef;
|
|
75
|
-
const changedLineRanges = scope === "lines" && diffInfo !== null && (diffInfo.isCurrentChanges || linesBaseRef !== null) ? await getChangedLineRanges({
|
|
76
|
+
const changedLineRanges = (scope === "lines" || scope === "contextual") && diffInfo !== null && (diffInfo.isCurrentChanges || linesBaseRef !== null) ? await getChangedLineRanges({
|
|
76
77
|
directory: input.directory,
|
|
77
78
|
baseRef: linesBaseRef ?? void 0,
|
|
78
79
|
files: [...diffInfo.changedFiles],
|
|
79
|
-
includeUntracked
|
|
80
|
+
includeUntracked,
|
|
81
|
+
includeDeletions: scope === "contextual"
|
|
80
82
|
}) : null;
|
|
81
|
-
if (scope === "lines" && changedLineRanges === null) {
|
|
83
|
+
if ((scope === "lines" || scope === "contextual") && changedLineRanges === null) {
|
|
82
84
|
cliLogger.warn("Could not determine changed lines (no base ref or git diff failed); reporting all issues in changed files.");
|
|
83
85
|
cliLogger.break();
|
|
84
86
|
}
|
|
@@ -2217,7 +2219,7 @@ const mountScanApp = async (rootDirectory, shouldRecommendCi, initialProgress) =
|
|
|
2217
2219
|
executePendingActions
|
|
2218
2220
|
};
|
|
2219
2221
|
};
|
|
2220
|
-
const runMountedScan = async (rootDirectory, presentation,
|
|
2222
|
+
const runMountedScan = async (rootDirectory, presentation, gateOptions, executeScan) => {
|
|
2221
2223
|
const { store, pendingActions, mountRenderer, executePendingActions } = await mountScanApp(rootDirectory, presentation.shouldRecommendCi, presentation.initialProgress);
|
|
2222
2224
|
let mountedRenderer = mountRenderer("scan");
|
|
2223
2225
|
recordCount(METRIC.tuiScanInlineShown);
|
|
@@ -2243,9 +2245,9 @@ const runMountedScan = async (rootDirectory, presentation, blockingLevel, execut
|
|
|
2243
2245
|
lintFailureReason: resolveLintFailureReason(completedScan.scans.map(({ result }) => result))
|
|
2244
2246
|
});
|
|
2245
2247
|
await executePendingActions();
|
|
2246
|
-
return {
|
|
2248
|
+
return { exitCode: resolveScanExitCode({
|
|
2249
|
+
...gateOptions,
|
|
2247
2250
|
scans: completedScan.scans,
|
|
2248
|
-
blockingLevel,
|
|
2249
2251
|
diagnosticsAreGateExempt: completedScan.diagnosticsAreGateExempt
|
|
2250
2252
|
}) };
|
|
2251
2253
|
} catch (error) {
|
|
@@ -2265,10 +2267,14 @@ const runSingleProjectScan = async (rootScanTarget, projectDirectory, workspaceP
|
|
|
2265
2267
|
});
|
|
2266
2268
|
if (scopeOptions === null) {
|
|
2267
2269
|
process.stdout.write("No changed source files in the selected project.\n");
|
|
2268
|
-
return {
|
|
2270
|
+
return { exitCode: 0 };
|
|
2269
2271
|
}
|
|
2270
2272
|
const presentation = resolveScanPresentation(input, [projectScan], rootScanTarget.resolvedDirectory);
|
|
2271
|
-
|
|
2273
|
+
const gateOptions = {
|
|
2274
|
+
blockingLevel,
|
|
2275
|
+
warningExitCode: input.warningExitCode
|
|
2276
|
+
};
|
|
2277
|
+
return runMountedScan(projectScan.directory, presentation, gateOptions, async (context) => {
|
|
2272
2278
|
const result = await inspectProject(projectScan.directory, {
|
|
2273
2279
|
...resolveTuiInspectOptions(input, projectScan.config),
|
|
2274
2280
|
...scopeOptions,
|
|
@@ -2341,7 +2347,7 @@ const runMultiProjectScan = async (rootScanTarget, directories, workspaceProject
|
|
|
2341
2347
|
});
|
|
2342
2348
|
if (projectScans.length === 0) {
|
|
2343
2349
|
process.stdout.write("No changed source files in the selected projects.\n");
|
|
2344
|
-
return {
|
|
2350
|
+
return { exitCode: 0 };
|
|
2345
2351
|
}
|
|
2346
2352
|
const projectCount = projectScans.length;
|
|
2347
2353
|
const rootProjectScan = discoveredProjectScans.find((projectScan) => path.resolve(projectScan.directory) === path.resolve(rootDirectory));
|
|
@@ -2351,7 +2357,10 @@ const runMultiProjectScan = async (rootScanTarget, directories, workspaceProject
|
|
|
2351
2357
|
isRootDeadCodeEnabled: input.options?.deadCode ?? rootProjectScan?.config?.deadCode ?? true
|
|
2352
2358
|
});
|
|
2353
2359
|
if (workspaceDeadCodeOwner !== null) recordCount(METRIC.scanWorkspaceMaintainabilityShared, 1, { projectCount: discoveredProjectScans.length });
|
|
2354
|
-
return runMountedScan(rootDirectory, resolveScanPresentation(input, projectScans.map(({ projectScan }) => projectScan), rootDirectory),
|
|
2360
|
+
return runMountedScan(rootDirectory, resolveScanPresentation(input, projectScans.map(({ projectScan }) => projectScan), rootDirectory), {
|
|
2361
|
+
blockingLevel,
|
|
2362
|
+
warningExitCode: input.warningExitCode
|
|
2363
|
+
}, async (context) => {
|
|
2355
2364
|
const startTime = performance.now();
|
|
2356
2365
|
let finishedCount = 0;
|
|
2357
2366
|
recordDistribution(METRIC.scanFeedbackDelay, performance.now() - feedbackStartTime, {
|
|
@@ -2504,15 +2513,16 @@ const runScanApp = async (input) => {
|
|
|
2504
2513
|
configProjects: input.configProjects ?? scanTarget.userConfig?.projects,
|
|
2505
2514
|
share: input.share ?? scanTarget.userConfig?.share ?? true
|
|
2506
2515
|
};
|
|
2516
|
+
if (input.warningExitCode !== void 0) recordCount(METRIC.scanWarningExitCodeConfigured);
|
|
2507
2517
|
const { selectedDirectories, workspaceProjectDirectories } = await resolveProjectSelection(rootDirectory, resolvedInput);
|
|
2508
2518
|
const inspectProject = createInvocationInspect(input.options?.concurrency);
|
|
2509
2519
|
const blockingLevel = resolveBlockingLevel({ blocking: resolvedInput.blocking }, scanTarget.userConfig);
|
|
2510
|
-
if (selectedDirectories.length === 0) return {
|
|
2520
|
+
if (selectedDirectories.length === 0) return { exitCode: 0 };
|
|
2511
2521
|
if (selectedDirectories.length === 1) return runSingleProjectScan(scanTarget, selectedDirectories[0], workspaceProjectDirectories, resolvedInput, scopePlan, blockingLevel, inspectProject);
|
|
2512
2522
|
return runMultiProjectScan(scanTarget, selectedDirectories, workspaceProjectDirectories, resolvedInput, scopePlan, blockingLevel, inspectProject);
|
|
2513
2523
|
};
|
|
2514
2524
|
//#endregion
|
|
2515
2525
|
export { runScanApp };
|
|
2516
2526
|
|
|
2517
|
-
//# sourceMappingURL=run-scan-app-
|
|
2518
|
-
//# debugId=
|
|
2527
|
+
//# sourceMappingURL=run-scan-app-D8hbdBvF.js.map
|
|
2528
|
+
//# debugId=0d82de2a-8b97-5d2b-86c6-5cbc4508033a
|
|
@@ -1,12 +1,12 @@
|
|
|
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]="
|
|
3
|
-
import { u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
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]="59731ecf-a103-566e-bb85-bc41267467cc")}catch(e){}}();
|
|
3
|
+
import { u as METRIC } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { Mt as highlighter, t as recordCount, u as enableJsonMode, y as CliInputError } from "./record-metric-CgebwK0K.js";
|
|
5
5
|
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-CCTgal0O.js";
|
|
6
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
7
|
-
import { n as resetSentryRunState, r as withRunSpan } from "./with-run-span
|
|
8
|
-
import { _ as RUNTIME_SCAN_SNAPSHOT_TIMEOUT_MS, b as RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS, f as RUNTIME_SCAN_PROBE_RELATIVE_PATH, g as RUNTIME_SCAN_SAFE_CDP_PAGE_URLS, h as RUNTIME_SCAN_PROBE_SNAPSHOT_TOKEN_PLACEHOLDER, l as RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES, m as RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER, n as RUNTIME_SCAN_BROWSER_WIDTH_PX, o as RUNTIME_SCAN_MAX_COMPONENT_EVENTS, p as RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER, r as RUNTIME_SCAN_CONTROL_CHARACTERS_PATTERN, s as RUNTIME_SCAN_MAX_RECORDING_DURATION_MS, t as sanitizeRuntimeUrl, v as RUNTIME_SCAN_TRACE_CATEGORIES, y as RUNTIME_SCAN_TRACE_FILE_EXTENSION } from "./sanitize-runtime-url-
|
|
9
|
-
import { r as resolveTuiEnvironment, t as isTuiEnvironmentSupported } from "./should-use-tui-
|
|
6
|
+
import { t as reportErrorToSentry } from "./report-error-DYLN3xZA.js";
|
|
7
|
+
import { n as resetSentryRunState, r as withRunSpan } from "./with-run-span-CMr4jR2i.js";
|
|
8
|
+
import { _ as RUNTIME_SCAN_SNAPSHOT_TIMEOUT_MS, b as RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS, f as RUNTIME_SCAN_PROBE_RELATIVE_PATH, g as RUNTIME_SCAN_SAFE_CDP_PAGE_URLS, h as RUNTIME_SCAN_PROBE_SNAPSHOT_TOKEN_PLACEHOLDER, l as RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES, m as RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER, n as RUNTIME_SCAN_BROWSER_WIDTH_PX, o as RUNTIME_SCAN_MAX_COMPONENT_EVENTS, p as RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER, r as RUNTIME_SCAN_CONTROL_CHARACTERS_PATTERN, s as RUNTIME_SCAN_MAX_RECORDING_DURATION_MS, t as sanitizeRuntimeUrl, v as RUNTIME_SCAN_TRACE_CATEGORIES, y as RUNTIME_SCAN_TRACE_FILE_EXTENSION } from "./sanitize-runtime-url-B3CaL49D.js";
|
|
9
|
+
import { r as resolveTuiEnvironment, t as isTuiEnvironmentSupported } from "./should-use-tui-BxO6yE3o.js";
|
|
10
10
|
import * as fs$1 from "node:fs";
|
|
11
11
|
import * as path$1 from "node:path";
|
|
12
12
|
import * as os$1 from "node:os";
|
|
@@ -720,7 +720,7 @@ const resolveRuntimeScanUrl = async (url) => {
|
|
|
720
720
|
if (url !== void 0) return url;
|
|
721
721
|
if (!isTuiEnvironmentSupported(resolveTuiEnvironment(process.stderr.isTTY === true))) throw new CliInputError("A URL is required outside an interactive terminal. Run `react-doctor scan <url>`.");
|
|
722
722
|
recordCount(METRIC.runtimeScanUrlPromptShown);
|
|
723
|
-
const { promptRuntimeScanUrl } = await import("./prompt-runtime-scan-url-
|
|
723
|
+
const { promptRuntimeScanUrl } = await import("./prompt-runtime-scan-url-DqGtnZaE.js");
|
|
724
724
|
return promptRuntimeScanUrl();
|
|
725
725
|
};
|
|
726
726
|
const runtimeScanAction = async (url, flags) => {
|
|
@@ -767,5 +767,5 @@ const runtimeScanAction = async (url, flags) => {
|
|
|
767
767
|
//#endregion
|
|
768
768
|
export { runtimeScanAction };
|
|
769
769
|
|
|
770
|
-
//# sourceMappingURL=runtime-scan-
|
|
771
|
-
//# debugId=
|
|
770
|
+
//# sourceMappingURL=runtime-scan-BINkjxmp.js.map
|
|
771
|
+
//# debugId=59731ecf-a103-566e-bb85-bc41267467cc
|
|
@@ -1,6 +1,6 @@
|
|
|
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]="
|
|
3
|
-
import { y as CliInputError } from "./record-metric-
|
|
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]="5f998a27-db5d-5420-a684-69bd75062315")}catch(e){}}();
|
|
3
|
+
import { y as CliInputError } from "./record-metric-CgebwK0K.js";
|
|
4
4
|
//#region src/cli/runtime-scan/constants.ts
|
|
5
5
|
const RUNTIME_SCAN_MAX_COMPONENT_EVENTS = 2e3;
|
|
6
6
|
const RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES = 5 * 1024 * 1024;
|
|
@@ -72,5 +72,5 @@ const sanitizeRuntimeUrl = (rawUrl) => {
|
|
|
72
72
|
//#endregion
|
|
73
73
|
export { RUNTIME_SCAN_SNAPSHOT_TIMEOUT_MS as _, RUNTIME_SCAN_LOCAL_DEV_PORTS as a, RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS as b, RUNTIME_SCAN_MAX_SNAPSHOT_BYTES as c, RUNTIME_SCAN_MAX_TRACE_BYTES as d, RUNTIME_SCAN_PROBE_RELATIVE_PATH as f, RUNTIME_SCAN_SAFE_CDP_PAGE_URLS as g, RUNTIME_SCAN_PROBE_SNAPSHOT_TOKEN_PLACEHOLDER as h, RUNTIME_SCAN_LAYOUT_THRASH_RATIO as i, RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES as l, RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER as m, RUNTIME_SCAN_BROWSER_WIDTH_PX as n, RUNTIME_SCAN_MAX_COMPONENT_EVENTS as o, RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER as p, RUNTIME_SCAN_CONTROL_CHARACTERS_PATTERN as r, RUNTIME_SCAN_MAX_RECORDING_DURATION_MS as s, sanitizeRuntimeUrl as t, RUNTIME_SCAN_MAX_STRING_LENGTH as u, RUNTIME_SCAN_TRACE_CATEGORIES as v, RUNTIME_SCAN_TRACE_FILE_EXTENSION as y };
|
|
74
74
|
|
|
75
|
-
//# sourceMappingURL=sanitize-runtime-url-
|
|
76
|
-
//# debugId=
|
|
75
|
+
//# sourceMappingURL=sanitize-runtime-url-B3CaL49D.js.map
|
|
76
|
+
//# debugId=5f998a27-db5d-5420-a684-69bd75062315
|
|
@@ -1,11 +1,11 @@
|
|
|
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]="
|
|
3
|
-
import { u as METRIC } from "./constants-
|
|
4
|
-
import {
|
|
5
|
-
import { i as warnDeprecatedDiff } from "./resolve-scope-
|
|
6
|
-
import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-
|
|
7
|
-
import { a as validateModeFlags, r as validateFilePathSelectionFlags, y as resolveCliInspectOptions } from "./
|
|
8
|
-
import { n as shouldUseTui, r as resolveTuiEnvironment } from "./should-use-tui-
|
|
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]="4504733e-5721-53e0-b4fe-b75b8a273a69")}catch(e){}}();
|
|
3
|
+
import { u as METRIC } from "./constants-_b1h6lxa.js";
|
|
4
|
+
import { Xt as resolveScanTarget, t as recordCount } from "./record-metric-CgebwK0K.js";
|
|
5
|
+
import { i as warnDeprecatedDiff } from "./resolve-scope-DlV1G6NB.js";
|
|
6
|
+
import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-BhFj2qyJ.js";
|
|
7
|
+
import { a as validateModeFlags, r as validateFilePathSelectionFlags, y as resolveCliInspectOptions } from "./resolve-scan-exit-code-CMj5rx-z.js";
|
|
8
|
+
import { n as shouldUseTui, r as resolveTuiEnvironment } from "./should-use-tui-BxO6yE3o.js";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
//#region src/cli/commands/scan.ts
|
|
11
11
|
const runScanCommand = async (input) => {
|
|
@@ -29,20 +29,21 @@ const runScanCommand = async (input) => {
|
|
|
29
29
|
warnDeprecatedFailOn(input.flags, scanTarget.userConfig);
|
|
30
30
|
warnDeprecatedDiff(input.flags, scanTarget.userConfig);
|
|
31
31
|
recordCount(METRIC.cliInvoked, 1, { command: input.invocationCommand });
|
|
32
|
-
const { runScanApp } = await import("./run-scan-app-
|
|
33
|
-
const {
|
|
32
|
+
const { runScanApp } = await import("./run-scan-app-D8hbdBvF.js");
|
|
33
|
+
const { exitCode } = await runScanApp({
|
|
34
34
|
directory: input.directory,
|
|
35
35
|
scanTarget,
|
|
36
36
|
options: resolveCliInspectOptions(input.flags, null),
|
|
37
37
|
projectFlag: input.flags.project,
|
|
38
38
|
skipPrompts: input.flags.yes ?? false,
|
|
39
39
|
blocking: input.flags.blocking ?? input.flags.failOn,
|
|
40
|
-
flags: input.flags
|
|
40
|
+
flags: input.flags,
|
|
41
|
+
warningExitCode: input.flags.warningExitCode
|
|
41
42
|
});
|
|
42
|
-
if (
|
|
43
|
+
if (exitCode !== 0) process.exitCode = exitCode;
|
|
43
44
|
};
|
|
44
45
|
//#endregion
|
|
45
46
|
export { runScanCommand };
|
|
46
47
|
|
|
47
|
-
//# sourceMappingURL=scan-
|
|
48
|
-
//# debugId=
|
|
48
|
+
//# sourceMappingURL=scan-D0JRVcBc.js.map
|
|
49
|
+
//# debugId=4504733e-5721-53e0-b4fe-b75b8a273a69
|
|
@@ -1,10 +1,10 @@
|
|
|
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]="
|
|
3
|
-
import { b as isNonInteractiveEnvironment } from "./record-metric-
|
|
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]="e05ba853-c1e2-59da-9385-24f2b3717705")}catch(e){}}();
|
|
3
|
+
import { b as isNonInteractiveEnvironment } from "./record-metric-CgebwK0K.js";
|
|
4
4
|
//#region src/cli/utils/should-skip-prompts.ts
|
|
5
5
|
const shouldSkipPrompts = (input = {}) => Boolean(input.yes) || Boolean(input.json) || isNonInteractiveEnvironment() || !process.stdin.isTTY;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { shouldSkipPrompts as t };
|
|
8
8
|
|
|
9
|
-
//# sourceMappingURL=should-skip-prompts-
|
|
10
|
-
//# debugId=
|
|
9
|
+
//# sourceMappingURL=should-skip-prompts-BQ6Bv8nf.js.map
|
|
10
|
+
//# debugId=e05ba853-c1e2-59da-9385-24f2b3717705
|