react-doctor 0.9.13 → 0.9.14-dev.499a020
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/_react-doctor_require-typescript-DXQDYeWK.js +16 -0
- package/dist/{active-run-trace-dlIZeEvb.js → active-run-trace-Dewycxda.js} +3 -3
- package/dist/{active-scan-abort-registry-DwG6tSPy.js → active-scan-abort-registry-CCTgal0O.js} +3 -3
- package/dist/build-section-divider-BsKw6rbA.js +81 -0
- package/dist/{ci-DqnZCnrL.js → ci-Y7ntr_X7.js} +14 -13
- package/dist/cli.js +31 -30
- package/dist/constants-CW_854PH.js +1035 -0
- package/dist/constants-DNh19qg9.js +23 -0
- package/dist/{design-DqUidb1f.js → design-CZbXwzWh.js} +4 -4
- package/dist/{devtools-CC2PAZ85.js → devtools-D20sefkm.js} +3 -3
- package/dist/duplicate-jsx-worker.d.ts +1 -0
- package/dist/duplicate-jsx-worker.js +636 -0
- package/dist/{exit-gracefully-CrpeIbra.js → exit-gracefully-Bq8kCmar.js} +7 -7
- package/dist/fs-utils-C88IbqFa.js +45 -0
- package/dist/{get-east-asian-width-Bv2TD3Xj.js → get-east-asian-width-DRPy7dqz.js} +4 -4
- package/dist/{handle-error-BEYYtsCl.js → handle-error-DkZtH4y1.js} +6 -5
- package/dist/index.d.ts +8511 -8509
- package/dist/index.js +61698 -60577
- package/dist/{inspect-BjMaC5WV.js → inspect-4R70DaBp.js} +38 -27
- package/dist/{install-DxLmASQ5.js → install-DSOkcCn6.js} +10 -9
- package/dist/{install-doctor-script-4EWviJL8.js → install-doctor-script-k5jxcUWB.js} +17 -8
- package/dist/{install-github-workflow-BPznUbbo.js → install-github-workflow-Dh3nS6ms.js} +10 -10
- package/dist/{install-react-doctor-Baq9hjoF.js → install-react-doctor-NmiRJQtp.js} +15 -11
- package/dist/is-cache-globally-disabled-CoHiYz2i.js +10 -0
- package/dist/{jsx-runtime-DvynQ_wu.js → jsx-runtime-B1PPqZBs.js} +11 -10
- package/dist/oxlint-worker.d.ts +1 -0
- package/dist/oxlint-worker.js +225 -0
- package/dist/{path-format-DnHpmJwG.js → path-format-By20mo8A.js} +3 -3
- package/dist/{print-branded-header-DSB6i3kk.js → print-branded-header-ydu9MCpt.js} +4 -4
- package/dist/project-analysis-worker.js +466 -481
- package/dist/{prompt-runtime-scan-url-BibDt9O1.js → prompt-runtime-scan-url-BEFbrKze.js} +6 -6
- package/dist/react-compiler-detection-worker.d.ts +1 -0
- package/dist/react-compiler-detection-worker.js +1029 -0
- package/dist/{read-object-file-DfWpkle4.js → read-object-file-f9AWbDOo.js} +4 -4
- package/dist/{record-metric-Cckscwg_.js → record-metric-BeiisdDK.js} +57476 -57240
- package/dist/{report-error-C1YnoRNl.js → report-error-CwReeGgL.js} +9 -8
- package/dist/{report-workflow-result-IdGRoBFN.js → report-workflow-result-CRhHHcHp.js} +24 -11
- package/dist/{resolve-scope-Bb6fljxd.js → resolve-scope-DsrT6gaf.js} +7 -7
- package/dist/{rules-BcFekwN4.js → rules-Bhk46JNb.js} +8 -7
- package/dist/{run-scan-app-CKHynQx8.js → run-scan-app-B_r_jHg-.js} +30 -23
- package/dist/{runtime-scan-7Y_mbqEa.js → runtime-scan-B6v3G55b.js} +16 -15
- package/dist/{sanitize-runtime-url-DzyBLbi3.js → sanitize-runtime-url-CVRMHksi.js} +5 -5
- package/dist/{scan-DQCwBx6p.js → scan-BJsk-x4c.js} +10 -9
- package/dist/{semver-DFtnEmN-.js → semver-BZIuy1gP.js} +3 -3
- package/dist/{should-fail-scan-gate-BYPsKIde.js → should-fail-scan-gate-B8cvpr6W.js} +1339 -1283
- package/dist/{should-skip-prompts-CKkbB3rC.js → should-skip-prompts-CupUff2k.js} +4 -4
- package/dist/{should-use-tui-Crfoao-l.js → should-use-tui-t0DIGfJ0.js} +4 -4
- package/dist/start-scan-preamble-D0QepYZ_.js +68 -0
- package/dist/start-scan-preamble-DVhXIPc0.d.ts +1 -0
- package/dist/start-scan-preamble.d.ts +1 -0
- package/dist/start-scan-preamble.js +4 -0
- package/dist/{telemetry-runtime-DKJyjz9o.js → telemetry-runtime-DfK-XYFO.js} +154 -5
- package/dist/{unref-stdin-SK3WfwxS.js → unref-stdin-D-NZBFpg.js} +3 -3
- package/dist/unwrap-typescript-expression-CrEPQUWz.js +14 -0
- package/dist/{version-CMkUAGmw.js → version-DpQFTCI_.js} +5 -4
- package/dist/{why-By3I6_Ex.js → why-DA3u09OY.js} +4 -4
- package/dist/{with-run-span-DxFGyW7k.js → with-run-span-DP84SJbD.js} +7 -6
- package/package.json +9 -7
- package/dist/build-section-divider-DELfSn3p.js +0 -216
|
@@ -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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
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]="9cb83742-85f2-5233-8ab4-464a62434c6b")}catch(e){}}();
|
|
3
|
+
import { S as SENTRY_FLUSH_TIMEOUT_MS, u as METRIC } from "./constants-CW_854PH.js";
|
|
4
|
+
import { jt as isReactDoctorError, l as getRunId, o as buildSentryScope, t as recordCount } from "./record-metric-BeiisdDK.js";
|
|
5
|
+
import { i as getSentry, n as shutdownTelemetry, o as isExpectedUserError } from "./telemetry-runtime-DfK-XYFO.js";
|
|
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
|
/**
|
|
9
9
|
* Sends an error to Sentry — enriched with a fresh snapshot of the current run
|
|
@@ -21,7 +21,8 @@ import * as Sentry from "@sentry/node";
|
|
|
21
21
|
* original error.
|
|
22
22
|
*/
|
|
23
23
|
const reportErrorToSentry = async (error) => {
|
|
24
|
-
|
|
24
|
+
const Sentry = await getSentry();
|
|
25
|
+
if (!Sentry?.isInitialized()) return void 0;
|
|
25
26
|
if (isExpectedUserError(error)) return void 0;
|
|
26
27
|
try {
|
|
27
28
|
const { tags, contexts } = buildSentryScope();
|
|
@@ -60,5 +61,5 @@ const reportErrorToSentry = async (error) => {
|
|
|
60
61
|
//#endregion
|
|
61
62
|
export { reportErrorToSentry as t };
|
|
62
63
|
|
|
63
|
-
//# sourceMappingURL=report-error-
|
|
64
|
-
//# debugId=
|
|
64
|
+
//# sourceMappingURL=report-error-CwReeGgL.js.map
|
|
65
|
+
//# debugId=9cb83742-85f2-5233-8ab4-464a62434c6b
|
|
@@ -1,13 +1,23 @@
|
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
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]="ff7dc2f2-8229-519c-966e-fc127db1aff3")}catch(e){}}();
|
|
3
|
+
import { m as REACT_DOCTOR_CONFIG_PROJECT_NAME, u as METRIC } from "./constants-CW_854PH.js";
|
|
4
|
+
import { t as recordCount } from "./record-metric-BeiisdDK.js";
|
|
5
|
+
import { u as isCommandAvailable } from "./install-github-workflow-Dh3nS6ms.js";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
6
7
|
import * as path$1 from "node:path";
|
|
7
|
-
import
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
9
|
-
import
|
|
10
|
-
|
|
10
|
+
import process$1 from "node:process";
|
|
11
|
+
//#region src/cli/utils/create-lazy-require.ts
|
|
12
|
+
const createLazyRequire = (importMetaUrl, specifier) => {
|
|
13
|
+
const requireModule = createRequire(importMetaUrl);
|
|
14
|
+
let cachedModule = null;
|
|
15
|
+
return () => cachedModule ??= requireModule(specifier);
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/cli/utils/load-agent-install.ts
|
|
19
|
+
const loadAgentInstall = createLazyRequire(import.meta.url, "agent-install");
|
|
20
|
+
//#endregion
|
|
11
21
|
//#region src/cli/utils/detect-agents.ts
|
|
12
22
|
const PATH_BINARIES = {
|
|
13
23
|
"claude-code": ["claude"],
|
|
@@ -25,6 +35,7 @@ const detectPathAvailableAgents = () => {
|
|
|
25
35
|
return detected;
|
|
26
36
|
};
|
|
27
37
|
const detectAvailableAgents = async () => {
|
|
38
|
+
const { detectInstalledSkillAgents, getSkillAgentTypes } = loadAgentInstall();
|
|
28
39
|
const detected = new Set([...detectPathAvailableAgents(), ...await detectInstalledSkillAgents()]);
|
|
29
40
|
return getSkillAgentTypes().filter((agent) => agent !== "universal" && detected.has(agent));
|
|
30
41
|
};
|
|
@@ -100,7 +111,9 @@ const migrateCliState = (state) => {
|
|
|
100
111
|
};
|
|
101
112
|
};
|
|
102
113
|
const resolveConfigDir = (options) => options.cwd ?? (process.env["REACT_DOCTOR_CONFIG_DIR"] || void 0);
|
|
103
|
-
const
|
|
114
|
+
const loadConfModule = createLazyRequire(import.meta.url, "conf");
|
|
115
|
+
const loadConf = () => loadConfModule().default;
|
|
116
|
+
const openStore = (options = {}) => new (loadConf())({
|
|
104
117
|
projectName: REACT_DOCTOR_CONFIG_PROJECT_NAME,
|
|
105
118
|
cwd: resolveConfigDir(options)
|
|
106
119
|
});
|
|
@@ -273,7 +286,7 @@ const reportWorkflowResult = (workflowSpinner, result, projectRoot) => {
|
|
|
273
286
|
return true;
|
|
274
287
|
};
|
|
275
288
|
//#endregion
|
|
276
|
-
export { recordGate as a, ACTION_UPGRADE_EVENT as c, INSTALL_AGENTS_PREFERENCE_ID as d, ONBOARDING_EVENT as f, 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 };
|
|
289
|
+
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 };
|
|
277
290
|
|
|
278
|
-
//# sourceMappingURL=report-workflow-result-
|
|
279
|
-
//# debugId=
|
|
291
|
+
//# sourceMappingURL=report-workflow-result-CRhHHcHp.js.map
|
|
292
|
+
//# debugId=ff7dc2f2-8229-519c-966e-fc127db1aff3
|
|
@@ -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 {
|
|
4
|
-
import { t as toForwardSlashes } from "./path-format-
|
|
5
|
-
import {
|
|
6
|
-
import { d as detectDefaultBranch, f as runCommand, l as prompts, 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]="d0bda02a-3bd6-5891-b0fc-07db40557fef")}catch(e){}}();
|
|
3
|
+
import { Fn as toCanonicalPath, ht as filterSourceFiles, kt as isPathInsideDirectory } from "./record-metric-BeiisdDK.js";
|
|
4
|
+
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
5
|
+
import { N as cliLogger } from "./install-doctor-script-k5jxcUWB.js";
|
|
6
|
+
import { d as detectDefaultBranch, f as runCommand, l as prompts, u as isCommandAvailable } from "./install-github-workflow-Dh3nS6ms.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";
|
|
@@ -333,5 +333,5 @@ const finalizeScope = async ({ requested, diffInfo, skipPrompts, isQuiet }) => {
|
|
|
333
333
|
//#endregion
|
|
334
334
|
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
335
|
|
|
336
|
-
//# sourceMappingURL=resolve-scope-
|
|
337
|
-
//# debugId=
|
|
336
|
+
//# sourceMappingURL=resolve-scope-DsrT6gaf.js.map
|
|
337
|
+
//# debugId=d0bda02a-3bd6-5891-b0fc-07db40557fef
|
|
@@ -1,10 +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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
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]="53553998-1f0e-57e3-8d06-dc47e8491ab0")}catch(e){}}();
|
|
3
|
+
import { dt as COMPILER_CLEANUP_BUCKET, ft as COMPILER_CLEANUP_RULE_KEYS, u as METRIC } from "./constants-CW_854PH.js";
|
|
4
|
+
import { $t as validateConfigTypes, Ct as getEquivalentRuleKeys, Mt as isSameRuleKey, Ot as highlighter, Rt as loadConfigWithSource, Z as buildRuleDocsUrl, rt as clearConfigCache, t as recordCount, zn as isPlainObject } from "./record-metric-BeiisdDK.js";
|
|
5
|
+
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-k5jxcUWB.js";
|
|
6
|
+
import { t as readObjectFile } from "./read-object-file-f9AWbDOo.js";
|
|
7
7
|
import * as fs$1 from "node:fs";
|
|
8
|
+
import * as path$1 from "node:path";
|
|
8
9
|
import { REACT_DOCTOR_RULES } from "oxlint-plugin-react-doctor/core";
|
|
9
10
|
import { generateCode, loadFile, writeFile } from "magicast";
|
|
10
11
|
import { getConfigFromVariableDeclaration, getDefaultExportOptions } from "magicast/helpers";
|
|
@@ -577,5 +578,5 @@ const rulesUnignoreTagAction = async (tag, options) => {
|
|
|
577
578
|
//#endregion
|
|
578
579
|
export { rulesCategoryAction, rulesDisableAction, rulesEnableAction, rulesExplainAction, rulesIgnoreTagAction, rulesListAction, rulesSetAction, rulesUnignoreTagAction };
|
|
579
580
|
|
|
580
|
-
//# sourceMappingURL=rules-
|
|
581
|
-
//# debugId=
|
|
581
|
+
//# sourceMappingURL=rules-Bhk46JNb.js.map
|
|
582
|
+
//# debugId=53553998-1f0e-57e3-8d06-dc47e8491ab0
|
|
@@ -1,13 +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 {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { a as
|
|
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]="79b25bff-edf3-569b-8b9f-2a60249b2236")}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-CW_854PH.js";
|
|
4
|
+
import { B as Progress, En as succeed, Gt as resolveScanTarget, H as Reporter, Ht as remainingDeadlineBudgetMs, Nn as yieldToEventLoop, Ot as highlighter, Sn as void_, St as getDiffInfo, T as isCiEnvironment, Tt as hasPublishedFixRecipe, Z as buildRuleDocsUrl, bn as sync, bt as getChangedLineRanges, et as calculateScore, n as recordDistribution, t as recordCount, vn as runPromise, x as isGitHookEnvironment, yt as getBaselineDiffPlan, zt as mapWithConcurrency } from "./record-metric-BeiisdDK.js";
|
|
5
|
+
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
6
|
+
import { N as cliLogger, n as findNearestPackageDirectory } from "./install-doctor-script-k5jxcUWB.js";
|
|
7
|
+
import { i as isReactDoctorWorkflowInstalled } from "./install-github-workflow-Dh3nS6ms.js";
|
|
8
|
+
import { r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-DsrT6gaf.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 shouldFailScanGate, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions, z as formatDiagnosticSite } from "./should-fail-scan-gate-B8cvpr6W.js";
|
|
10
|
+
import { a as recordGate, f as ONBOARDING_EVENT, n as openUrl, r as isGatePending } from "./report-workflow-result-CRhHHcHp.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-B1PPqZBs.js";
|
|
11
12
|
import path from "node:path";
|
|
12
13
|
import { performance } from "node:perf_hooks";
|
|
13
14
|
import isUnicodeSupported from "is-unicode-supported";
|
|
@@ -2064,10 +2065,13 @@ const resolveTuiInspectOptions = (input, config) => {
|
|
|
2064
2065
|
warnings
|
|
2065
2066
|
};
|
|
2066
2067
|
};
|
|
2067
|
-
const
|
|
2068
|
+
const resolveProjectSelection = async (rootDirectory, input) => {
|
|
2068
2069
|
const packages = discoverWorkspacePackages(rootDirectory);
|
|
2069
|
-
|
|
2070
|
-
return
|
|
2070
|
+
const workspaceProjectDirectories = packages.map((workspacePackage) => workspacePackage.directory);
|
|
2071
|
+
return {
|
|
2072
|
+
selectedDirectories: packages.length > 1 && !input.projectFlag && !input.skipPrompts && (input.configProjects ?? []).length === 0 && process.stdin.isTTY === true ? await promptProjectSelection(packages, rootDirectory) : await selectProjects(rootDirectory, input.projectFlag, input.skipPrompts ?? false, input.configProjects),
|
|
2073
|
+
workspaceProjectDirectories
|
|
2074
|
+
};
|
|
2071
2075
|
};
|
|
2072
2076
|
const promptProjectSelection = (packages, rootDirectory) => new Promise((resolve) => {
|
|
2073
2077
|
let disposeRenderer = () => {};
|
|
@@ -2249,8 +2253,9 @@ const runMountedScan = async (rootDirectory, presentation, blockingLevel, execut
|
|
|
2249
2253
|
throw error;
|
|
2250
2254
|
}
|
|
2251
2255
|
};
|
|
2252
|
-
const runSingleProjectScan = async (rootScanTarget, projectDirectory, input, scopePlan, blockingLevel, inspectProject) => {
|
|
2256
|
+
const runSingleProjectScan = async (rootScanTarget, projectDirectory, workspaceProjectDirectories, input, scopePlan, blockingLevel, inspectProject) => {
|
|
2253
2257
|
const projectScan = await resolveProjectScan(rootScanTarget, projectDirectory);
|
|
2258
|
+
const isRootProject = path.resolve(projectScan.directory) === path.resolve(rootScanTarget.resolvedDirectory);
|
|
2254
2259
|
const isSupplyChainEnabled = input.options?.supplyChain ?? projectScan.config?.supplyChain?.enabled ?? true;
|
|
2255
2260
|
const scopeOptions = resolveProjectTuiScanScope({
|
|
2256
2261
|
plan: scopePlan,
|
|
@@ -2273,7 +2278,9 @@ const runSingleProjectScan = async (rootScanTarget, projectDirectory, input, sco
|
|
|
2273
2278
|
uiLayers: {
|
|
2274
2279
|
reporter: reporterLayerForStore(context.store),
|
|
2275
2280
|
progress: progressLayerForStore(context.store)
|
|
2276
|
-
}
|
|
2281
|
+
},
|
|
2282
|
+
excludedProjectDirectories: resolveExcludedProjectDirectories(projectScan.directory, workspaceProjectDirectories),
|
|
2283
|
+
retainExcludedProjectDeadCodeDiagnostics: isRootProject
|
|
2277
2284
|
});
|
|
2278
2285
|
const reportSelection = selectReportDiagnostics({
|
|
2279
2286
|
scan: {
|
|
@@ -2315,7 +2322,7 @@ const runSingleProjectScan = async (rootScanTarget, projectDirectory, input, sco
|
|
|
2315
2322
|
};
|
|
2316
2323
|
});
|
|
2317
2324
|
};
|
|
2318
|
-
const runMultiProjectScan = async (rootScanTarget, directories, input, scopePlan, blockingLevel, inspectProject) => {
|
|
2325
|
+
const runMultiProjectScan = async (rootScanTarget, directories, workspaceProjectDirectories, input, scopePlan, blockingLevel, inspectProject) => {
|
|
2319
2326
|
const feedbackStartTime = performance.now();
|
|
2320
2327
|
const rootDirectory = rootScanTarget.resolvedDirectory;
|
|
2321
2328
|
const discoveredProjectScans = deduplicateProjectScans(await mapWithConcurrency([...directories], 4, (projectDirectory) => resolveProjectScan(rootScanTarget, projectDirectory)));
|
|
@@ -2356,7 +2363,7 @@ const runMultiProjectScan = async (rootScanTarget, directories, input, scopePlan
|
|
|
2356
2363
|
});
|
|
2357
2364
|
context.store.setProgress(`Scanning ${projectCount} projects…`);
|
|
2358
2365
|
await yieldToEventLoop();
|
|
2359
|
-
const
|
|
2366
|
+
const precomputedSourceFiles = scopePlan.scope === "full" ? await collectProjectSourceFiles(rootDirectory, projectScans.map(({ projectScan }) => projectScan.directory)) : null;
|
|
2360
2367
|
const { completedScans, skippedScans } = partitionProjectScanOutcomes(await mapWithConcurrency(projectScans, 4, async ({ projectScan, scopeOptions }) => {
|
|
2361
2368
|
if (input.options?.deadlineEpochMs !== void 0 && remainingDeadlineBudgetMs(input.options.deadlineEpochMs) === 0) {
|
|
2362
2369
|
finishedCount += 1;
|
|
@@ -2380,7 +2387,7 @@ const runMultiProjectScan = async (rootScanTarget, directories, input, scopePlan
|
|
|
2380
2387
|
isCi: isCiEnvironment(),
|
|
2381
2388
|
configOverride: projectScan.config,
|
|
2382
2389
|
configSourceDirectory: projectScan.configSourceDirectory ?? void 0,
|
|
2383
|
-
|
|
2390
|
+
precomputedSourceFiles: precomputedSourceFiles?.get(projectScan.directory),
|
|
2384
2391
|
uiLayers: {
|
|
2385
2392
|
reporter: Reporter.layerNoop,
|
|
2386
2393
|
progress: progressLayerForStore(context.store, {
|
|
@@ -2389,7 +2396,7 @@ const runMultiProjectScan = async (rootScanTarget, directories, input, scopePlan
|
|
|
2389
2396
|
})
|
|
2390
2397
|
},
|
|
2391
2398
|
concurrentScan: true,
|
|
2392
|
-
excludedProjectDirectories:
|
|
2399
|
+
excludedProjectDirectories: resolveExcludedProjectDirectories(projectScan.directory, [...discoveredProjectScans.map((candidateProjectScan) => candidateProjectScan.directory), ...workspaceProjectDirectories]),
|
|
2393
2400
|
retainExcludedProjectDeadCodeDiagnostics: ownsWorkspaceDeadCode
|
|
2394
2401
|
});
|
|
2395
2402
|
finishedCount += 1;
|
|
@@ -2497,15 +2504,15 @@ const runScanApp = async (input) => {
|
|
|
2497
2504
|
configProjects: input.configProjects ?? scanTarget.userConfig?.projects,
|
|
2498
2505
|
share: input.share ?? scanTarget.userConfig?.share ?? true
|
|
2499
2506
|
};
|
|
2500
|
-
const selectedDirectories = await
|
|
2507
|
+
const { selectedDirectories, workspaceProjectDirectories } = await resolveProjectSelection(rootDirectory, resolvedInput);
|
|
2501
2508
|
const inspectProject = createInvocationInspect(input.options?.concurrency);
|
|
2502
2509
|
const blockingLevel = resolveBlockingLevel({ blocking: resolvedInput.blocking }, scanTarget.userConfig);
|
|
2503
2510
|
if (selectedDirectories.length === 0) return { shouldFail: false };
|
|
2504
|
-
if (selectedDirectories.length === 1) return runSingleProjectScan(scanTarget, selectedDirectories[0], resolvedInput, scopePlan, blockingLevel, inspectProject);
|
|
2505
|
-
return runMultiProjectScan(scanTarget, selectedDirectories, resolvedInput, scopePlan, blockingLevel, inspectProject);
|
|
2511
|
+
if (selectedDirectories.length === 1) return runSingleProjectScan(scanTarget, selectedDirectories[0], workspaceProjectDirectories, resolvedInput, scopePlan, blockingLevel, inspectProject);
|
|
2512
|
+
return runMultiProjectScan(scanTarget, selectedDirectories, workspaceProjectDirectories, resolvedInput, scopePlan, blockingLevel, inspectProject);
|
|
2506
2513
|
};
|
|
2507
2514
|
//#endregion
|
|
2508
2515
|
export { runScanApp };
|
|
2509
2516
|
|
|
2510
|
-
//# sourceMappingURL=run-scan-app-
|
|
2511
|
-
//# debugId=
|
|
2517
|
+
//# sourceMappingURL=run-scan-app-B_r_jHg-.js.map
|
|
2518
|
+
//# debugId=79b25bff-edf3-569b-8b9f-2a60249b2236
|
|
@@ -1,15 +1,16 @@
|
|
|
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 {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { r as
|
|
9
|
-
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]="a9e71408-7a6c-5b78-a237-1f30b12d3938")}catch(e){}}();
|
|
3
|
+
import { u as METRIC } from "./constants-CW_854PH.js";
|
|
4
|
+
import { Ot as highlighter, t as recordCount, u as enableJsonMode, y as CliInputError } from "./record-metric-BeiisdDK.js";
|
|
5
|
+
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-CCTgal0O.js";
|
|
6
|
+
import { t as reportErrorToSentry } from "./report-error-CwReeGgL.js";
|
|
7
|
+
import { n as resetSentryRunState, r as withRunSpan } from "./with-run-span-DP84SJbD.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-CVRMHksi.js";
|
|
9
|
+
import { r as resolveTuiEnvironment, t as isTuiEnvironmentSupported } from "./should-use-tui-t0DIGfJ0.js";
|
|
10
10
|
import * as fs$1 from "node:fs";
|
|
11
|
-
import
|
|
11
|
+
import * as path$1 from "node:path";
|
|
12
12
|
import * as os$1 from "node:os";
|
|
13
|
+
import { randomUUID } from "node:crypto";
|
|
13
14
|
import * as fsp from "node:fs/promises";
|
|
14
15
|
import { createGzip } from "node:zlib";
|
|
15
16
|
import { performance } from "node:perf_hooks";
|
|
@@ -448,15 +449,15 @@ const startDevtoolsTrace = async (cdpSession) => {
|
|
|
448
449
|
throw cause;
|
|
449
450
|
}
|
|
450
451
|
};
|
|
451
|
-
const endDevtoolsTrace = async (cdpSession) => {
|
|
452
|
+
const endDevtoolsTrace = async (cdpSession, timeoutMs = RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS) => {
|
|
452
453
|
const traceComplete = new Promise((resolve) => {
|
|
453
454
|
cdpSession.once("Tracing.tracingComplete", resolve);
|
|
454
455
|
});
|
|
455
456
|
let timeoutHandle;
|
|
456
457
|
const traceTimeout = new Promise((_resolve, reject) => {
|
|
457
458
|
timeoutHandle = setTimeout(() => {
|
|
458
|
-
reject(
|
|
459
|
-
},
|
|
459
|
+
reject(new CliInputError("Chrome did not finalize the performance trace within 60 seconds. Record a shorter interaction and retry."));
|
|
460
|
+
}, timeoutMs);
|
|
460
461
|
});
|
|
461
462
|
let stream;
|
|
462
463
|
try {
|
|
@@ -719,7 +720,7 @@ const resolveRuntimeScanUrl = async (url) => {
|
|
|
719
720
|
if (url !== void 0) return url;
|
|
720
721
|
if (!isTuiEnvironmentSupported(resolveTuiEnvironment(process.stderr.isTTY === true))) throw new CliInputError("A URL is required outside an interactive terminal. Run `react-doctor scan <url>`.");
|
|
721
722
|
recordCount(METRIC.runtimeScanUrlPromptShown);
|
|
722
|
-
const { promptRuntimeScanUrl } = await import("./prompt-runtime-scan-url-
|
|
723
|
+
const { promptRuntimeScanUrl } = await import("./prompt-runtime-scan-url-BEFbrKze.js");
|
|
723
724
|
return promptRuntimeScanUrl();
|
|
724
725
|
};
|
|
725
726
|
const runtimeScanAction = async (url, flags) => {
|
|
@@ -766,5 +767,5 @@ const runtimeScanAction = async (url, flags) => {
|
|
|
766
767
|
//#endregion
|
|
767
768
|
export { runtimeScanAction };
|
|
768
769
|
|
|
769
|
-
//# sourceMappingURL=runtime-scan-
|
|
770
|
-
//# debugId=
|
|
770
|
+
//# sourceMappingURL=runtime-scan-B6v3G55b.js.map
|
|
771
|
+
//# debugId=a9e71408-7a6c-5b78-a237-1f30b12d3938
|
|
@@ -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 {
|
|
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]="36b76e13-a933-58d8-8057-116c82cf1f80")}catch(e){}}();
|
|
3
|
+
import { y as CliInputError } from "./record-metric-BeiisdDK.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;
|
|
@@ -26,7 +26,7 @@ const RUNTIME_SCAN_LOCAL_DEV_PORTS = [
|
|
|
26
26
|
];
|
|
27
27
|
const RUNTIME_SCAN_BROWSER_WIDTH_PX = 1440;
|
|
28
28
|
const RUNTIME_SCAN_TRACE_FILE_EXTENSION = ".json.gz";
|
|
29
|
-
const RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS =
|
|
29
|
+
const RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS = 6e4;
|
|
30
30
|
const RUNTIME_SCAN_PROBE_RELATIVE_PATH = "runtime-scan/browser-probe.iife.js";
|
|
31
31
|
const RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER = "__REACT_DOCTOR_RUNTIME_SCAN_CAPTURE__";
|
|
32
32
|
const RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER = "data-react-doctor-runtime-scan-snapshot";
|
|
@@ -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-CVRMHksi.js.map
|
|
76
|
+
//# debugId=36b76e13-a933-58d8-8057-116c82cf1f80
|
|
@@ -1,10 +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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
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]="bc8d14f5-0554-59ca-82ed-2cf3be0973e4")}catch(e){}}();
|
|
3
|
+
import { u as METRIC } from "./constants-CW_854PH.js";
|
|
4
|
+
import { Gt as resolveScanTarget, t as recordCount } from "./record-metric-BeiisdDK.js";
|
|
5
|
+
import { i as warnDeprecatedDiff } from "./resolve-scope-DsrT6gaf.js";
|
|
6
|
+
import { a as validateModeFlags, r as validateFilePathSelectionFlags, y as resolveCliInspectOptions } from "./should-fail-scan-gate-B8cvpr6W.js";
|
|
7
|
+
import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-4R70DaBp.js";
|
|
8
|
+
import { n as shouldUseTui, r as resolveTuiEnvironment } from "./should-use-tui-t0DIGfJ0.js";
|
|
8
9
|
import path from "node:path";
|
|
9
10
|
//#region src/cli/commands/scan.ts
|
|
10
11
|
const runScanCommand = async (input) => {
|
|
@@ -28,7 +29,7 @@ const runScanCommand = async (input) => {
|
|
|
28
29
|
warnDeprecatedFailOn(input.flags, scanTarget.userConfig);
|
|
29
30
|
warnDeprecatedDiff(input.flags, scanTarget.userConfig);
|
|
30
31
|
recordCount(METRIC.cliInvoked, 1, { command: input.invocationCommand });
|
|
31
|
-
const { runScanApp } = await import("./run-scan-app-
|
|
32
|
+
const { runScanApp } = await import("./run-scan-app-B_r_jHg-.js");
|
|
32
33
|
const { shouldFail } = await runScanApp({
|
|
33
34
|
directory: input.directory,
|
|
34
35
|
scanTarget,
|
|
@@ -43,5 +44,5 @@ const runScanCommand = async (input) => {
|
|
|
43
44
|
//#endregion
|
|
44
45
|
export { runScanCommand };
|
|
45
46
|
|
|
46
|
-
//# sourceMappingURL=scan-
|
|
47
|
-
//# debugId=
|
|
47
|
+
//# sourceMappingURL=scan-BJsk-x4c.js.map
|
|
48
|
+
//# debugId=bc8d14f5-0554-59ca-82ed-2cf3be0973e4
|
|
@@ -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]="111b9bd1-44f8-5316-8f94-16884af08c00")}catch(e){}}();
|
|
3
3
|
import { t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
5
5
|
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -3215,5 +3215,5 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3215
3215
|
//#endregion
|
|
3216
3216
|
export { require_picomatch as n, require_semver as t };
|
|
3217
3217
|
|
|
3218
|
-
//# sourceMappingURL=semver-
|
|
3219
|
-
//# debugId=
|
|
3218
|
+
//# sourceMappingURL=semver-BZIuy1gP.js.map
|
|
3219
|
+
//# debugId=111b9bd1-44f8-5316-8f94-16884af08c00
|