react-doctor 0.9.12-dev.0b670aa → 0.9.12-dev.1971506
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 +27 -0
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-CJ7k-BvF.js → build-section-divider-dzVqU6Fr.js} +8 -22
- package/dist/{ci-Dannv-cF.js → ci-tO6eKsPx.js} +12 -11
- package/dist/cli.js +76 -24
- package/dist/{design-9x5DReyL.js → design-BOr8ASzl.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-BiC-AP3B.js} +3 -3
- package/dist/{exit-gracefully-ti2wONpM.js → exit-gracefully-B4JO2DSi.js} +15 -9
- package/dist/get-east-asian-width-Cglw13G7.js +444 -0
- package/dist/{report-error-BlOAg03W.js → handle-error-JVQU0Pxy.js} +6 -61
- package/dist/index.d.ts +2 -2
- package/dist/index.js +61 -43
- package/dist/{inspect-C3itFiEW.js → inspect-CBkHe9dS.js} +17 -16
- package/dist/{install-CjIJL6S5.js → install-DG3MH36X.js} +9 -8
- package/dist/{install-doctor-script-0sdZ4SY8.js → install-doctor-script-DaB6kssK.js} +6 -441
- package/dist/{install-github-workflow-DQ8_lhAW.js → install-github-workflow-CHs4pPvZ.js} +6 -6
- package/dist/{install-react-doctor-DRG8hdL4.js → install-react-doctor-D4Z6xm2T.js} +8 -8
- package/dist/{run-scan-app-Cgn4ELJF.js → jsx-runtime-5ph9KX7N.js} +280 -2769
- package/dist/{print-branded-header-Dc1KdrcV.js → print-branded-header-BRA02Uik.js} +4 -4
- package/dist/prompt-runtime-scan-url-1IvWhRJ0.js +240 -0
- package/dist/{read-object-file-rblJxHxN.js → read-object-file-CacQMaGw.js} +4 -4
- package/dist/{record-metric-Dgg2b2LG.js → record-metric-DcBAbVVs.js} +115 -76
- package/dist/report-error-Cj58fOLO.js +64 -0
- package/dist/{report-workflow-result-Dp4dCUxw.js → report-workflow-result-DadOSgvV.js} +5 -5
- package/dist/{resolve-scope-CbeXgE9z.js → resolve-scope-pqK2skSv.js} +6 -6
- package/dist/{rules-ClDrNCc3.js → rules-IBWoSmK_.js} +6 -6
- package/dist/run-scan-app-JphzszIp.js +2508 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-BSMwOS9F.js +770 -0
- package/dist/sanitize-runtime-url-BN8oyAb7.js +76 -0
- package/dist/{scan-Caa_ogFB.js → scan-1Hakw1J4.js} +10 -22
- package/dist/{should-fail-scan-gate-BGzNJApW.js → should-fail-scan-gate-CwBjVudY.js} +23 -114
- package/dist/{should-skip-prompts-Bbl0ToUI.js → should-skip-prompts-CtQ-6r7T.js} +4 -4
- package/dist/should-use-tui-BLBNwhU6.js +25 -0
- package/dist/skills/performance/SKILL.md +113 -0
- package/dist/skills/react-doctor/SKILL.md +6 -0
- package/dist/{unref-stdin-C7d7_3va.js → telemetry-runtime-BxsPVkMH.js} +5 -23
- package/dist/unref-stdin-BKT_s38a.js +12 -0
- package/dist/{version-Bjql-CLM.js → version-5WSKTaCF.js} +4 -4
- package/dist/{why-BqG2EML8.js → why-DHTN2DPT.js} +4 -4
- package/dist/with-run-span-Kn-I23fJ.js +110 -0
- package/package.json +8 -6
|
@@ -0,0 +1,76 @@
|
|
|
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]="2b600ab6-05a5-5abc-9871-df826100ff2a")}catch(e){}}();
|
|
3
|
+
import { z as CliInputError } from "./record-metric-DcBAbVVs.js";
|
|
4
|
+
//#region src/cli/runtime-scan/constants.ts
|
|
5
|
+
const RUNTIME_SCAN_MAX_COMPONENT_EVENTS = 2e3;
|
|
6
|
+
const RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES = 5 * 1024 * 1024;
|
|
7
|
+
const RUNTIME_SCAN_MAX_SNAPSHOT_BYTES = RUNTIME_SCAN_MAX_SNAPSHOT_PAYLOAD_BYTES - 64 * 1024;
|
|
8
|
+
Math.floor(RUNTIME_SCAN_MAX_SNAPSHOT_BYTES / 3);
|
|
9
|
+
const RUNTIME_SCAN_MAX_TRACE_BYTES = 512 * 1024 * 1024;
|
|
10
|
+
const RUNTIME_SCAN_MAX_STRING_LENGTH = 4096;
|
|
11
|
+
const RUNTIME_SCAN_LAYOUT_THRASH_RATIO = .25;
|
|
12
|
+
const RUNTIME_SCAN_MAX_RECORDING_DURATION_MS = 300 * 1e3;
|
|
13
|
+
const RUNTIME_SCAN_SNAPSHOT_TIMEOUT_MS = 1e4;
|
|
14
|
+
const RUNTIME_SCAN_LOCAL_DEV_PORTS = [
|
|
15
|
+
1234,
|
|
16
|
+
...Array.from({ length: 11 }, (_unusedValue, portOffset) => 3e3 + portOffset),
|
|
17
|
+
...Array.from({ length: 11 }, (_unusedValue, portOffset) => 4e3 + portOffset),
|
|
18
|
+
4173,
|
|
19
|
+
4200,
|
|
20
|
+
4321,
|
|
21
|
+
...Array.from({ length: 11 }, (_unusedValue, portOffset) => 5e3 + portOffset),
|
|
22
|
+
...Array.from({ length: 11 }, (_unusedValue, portOffset) => 5173 + portOffset),
|
|
23
|
+
...Array.from({ length: 11 }, (_unusedValue, portOffset) => 8e3 + portOffset),
|
|
24
|
+
...Array.from({ length: 11 }, (_unusedValue, portOffset) => 8080 + portOffset),
|
|
25
|
+
8888
|
|
26
|
+
];
|
|
27
|
+
const RUNTIME_SCAN_BROWSER_WIDTH_PX = 1440;
|
|
28
|
+
const RUNTIME_SCAN_TRACE_FILE_EXTENSION = ".json.gz";
|
|
29
|
+
const RUNTIME_SCAN_TRACING_COMPLETE_TIMEOUT_MS = 1e4;
|
|
30
|
+
const RUNTIME_SCAN_PROBE_RELATIVE_PATH = "runtime-scan/browser-probe.iife.js";
|
|
31
|
+
const RUNTIME_SCAN_PROBE_SNAPSHOT_BINDING_NAME_PLACEHOLDER = "__REACT_DOCTOR_RUNTIME_SCAN_CAPTURE__";
|
|
32
|
+
const RUNTIME_SCAN_PROBE_SNAPSHOT_ATTRIBUTE_NAME_PLACEHOLDER = "data-react-doctor-runtime-scan-snapshot";
|
|
33
|
+
const RUNTIME_SCAN_PROBE_SNAPSHOT_TOKEN_PLACEHOLDER = "__REACT_DOCTOR_RUNTIME_SCAN_TOKEN__";
|
|
34
|
+
const RUNTIME_SCAN_SAFE_CDP_PAGE_URLS = [
|
|
35
|
+
"about:blank",
|
|
36
|
+
"chrome://newtab/",
|
|
37
|
+
"chrome://new-tab-page/"
|
|
38
|
+
];
|
|
39
|
+
const RUNTIME_SCAN_CONTROL_CHARACTERS_PATTERN = /[\u0000-\u001f\u007f-\u009f]/g;
|
|
40
|
+
const RUNTIME_SCAN_TRACE_CATEGORIES = [
|
|
41
|
+
"-*",
|
|
42
|
+
"blink.console",
|
|
43
|
+
"blink.user_timing",
|
|
44
|
+
"devtools.timeline",
|
|
45
|
+
"disabled-by-default-devtools.timeline",
|
|
46
|
+
"disabled-by-default-devtools.timeline.invalidationTracking",
|
|
47
|
+
"disabled-by-default-devtools.timeline.frame",
|
|
48
|
+
"disabled-by-default-devtools.timeline.stack",
|
|
49
|
+
"disabled-by-default-v8.cpu_profiler",
|
|
50
|
+
"disabled-by-default-v8.cpu_profiler.hires",
|
|
51
|
+
"latencyInfo",
|
|
52
|
+
"loading",
|
|
53
|
+
"v8",
|
|
54
|
+
"v8.execute"
|
|
55
|
+
];
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/cli/runtime-scan/sanitize-runtime-url.ts
|
|
58
|
+
const sanitizeRuntimeUrl = (rawUrl) => {
|
|
59
|
+
let parsedUrl;
|
|
60
|
+
try {
|
|
61
|
+
parsedUrl = new URL(rawUrl);
|
|
62
|
+
} catch {
|
|
63
|
+
throw new CliInputError(`Expected an absolute http(s) URL, received "${rawUrl}".`);
|
|
64
|
+
}
|
|
65
|
+
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") throw new CliInputError(`Expected an http(s) URL, received "${parsedUrl.protocol}".`);
|
|
66
|
+
parsedUrl.username = "";
|
|
67
|
+
parsedUrl.password = "";
|
|
68
|
+
parsedUrl.search = "";
|
|
69
|
+
parsedUrl.hash = "";
|
|
70
|
+
return parsedUrl.href;
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
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
|
+
|
|
75
|
+
//# sourceMappingURL=sanitize-runtime-url-BN8oyAb7.js.map
|
|
76
|
+
//# debugId=2b600ab6-05a5-5abc-9871-df826100ff2a
|
|
@@ -1,29 +1,17 @@
|
|
|
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 { i as warnDeprecatedDiff } from "./resolve-scope-
|
|
5
|
-
import { _ as resolveCliInspectOptions, i as validateModeFlags } from "./should-fail-scan-gate-
|
|
6
|
-
import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-
|
|
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]="1959cd05-d41f-5d2a-ad29-421bbb1d7aa6")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, fn as resolveScanTarget, t as recordCount } from "./record-metric-DcBAbVVs.js";
|
|
4
|
+
import { i as warnDeprecatedDiff } from "./resolve-scope-pqK2skSv.js";
|
|
5
|
+
import { _ as resolveCliInspectOptions, i as validateModeFlags } from "./should-fail-scan-gate-CwBjVudY.js";
|
|
6
|
+
import { n as warnDeprecatedFailOn, r as runProjectMigrations, t as inspectAction } from "./inspect-CBkHe9dS.js";
|
|
7
|
+
import { n as shouldUseTui, r as resolveTuiEnvironment } from "./should-use-tui-BLBNwhU6.js";
|
|
7
8
|
import path from "node:path";
|
|
8
|
-
//#region src/cli/utils/should-use-tui.ts
|
|
9
|
-
const shouldUseTui = (input) => {
|
|
10
|
-
if (input.isNonInteractiveEnvironment || !input.stdinIsTty || !input.stdoutIsTty || !input.supportsRawMode || input.nodeMajorVersion < 22 || input.terminalName === "dumb") return false;
|
|
11
|
-
const flags = input.flags;
|
|
12
|
-
return !(flags.score === true || flags.json === true || flags.jsonCompact === true || flags.jsonOut !== void 0 || flags.staged === true || flags.changedFilesFrom !== void 0);
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
9
|
//#region src/cli/commands/scan.ts
|
|
16
10
|
const runScanCommand = async (input) => {
|
|
17
11
|
if (input.flags.cache === false) process.env.REACT_DOCTOR_NO_CACHE = "1";
|
|
18
|
-
const nodeMajorVersion = Number(process.versions.node.split(".")[0]);
|
|
19
12
|
if (!shouldUseTui({
|
|
20
13
|
flags: input.flags,
|
|
21
|
-
|
|
22
|
-
nodeMajorVersion,
|
|
23
|
-
stdinIsTty: process.stdin.isTTY === true,
|
|
24
|
-
stdoutIsTty: process.stdout.isTTY === true,
|
|
25
|
-
supportsRawMode: typeof process.stdin.setRawMode === "function",
|
|
26
|
-
terminalName: process.env.TERM
|
|
14
|
+
...resolveTuiEnvironment()
|
|
27
15
|
})) {
|
|
28
16
|
await inspectAction(input.directory, input.flags, input.invocationCommand);
|
|
29
17
|
return;
|
|
@@ -34,7 +22,7 @@ const runScanCommand = async (input) => {
|
|
|
34
22
|
warnDeprecatedFailOn(input.flags, scanTarget.userConfig);
|
|
35
23
|
warnDeprecatedDiff(input.flags, scanTarget.userConfig);
|
|
36
24
|
recordCount(METRIC.cliInvoked, 1, { command: input.invocationCommand });
|
|
37
|
-
const { runScanApp } = await import("./run-scan-app-
|
|
25
|
+
const { runScanApp } = await import("./run-scan-app-JphzszIp.js");
|
|
38
26
|
const { shouldFail } = await runScanApp({
|
|
39
27
|
directory: input.directory,
|
|
40
28
|
scanTarget,
|
|
@@ -49,5 +37,5 @@ const runScanCommand = async (input) => {
|
|
|
49
37
|
//#endregion
|
|
50
38
|
export { runScanCommand };
|
|
51
39
|
|
|
52
|
-
//# sourceMappingURL=scan-
|
|
53
|
-
//# debugId=
|
|
40
|
+
//# sourceMappingURL=scan-1Hakw1J4.js.map
|
|
41
|
+
//# debugId=1959cd05-d41f-5d2a-ad29-421bbb1d7aa6
|
|
@@ -1,12 +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 { $ as
|
|
4
|
-
import {
|
|
5
|
-
import { n as buildFooterLinkLines,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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]="a8e6be79-6965-51bf-a039-f1163c3f025c")}catch(e){}}();
|
|
3
|
+
import { $ as Linter, A as SCAN_RESULT_CACHE_FILENAME, An as gen, At as discoverSupportedSubprojects, B as isNonInteractiveEnvironment, Bn as sync, Cn as error, Ct as collectSourceFileCountsByDirectory, Dn as Diagnostic, Dt as createNodeReadFileLinesSync, En as warn, Et as countOptInProjectRuleSelections, Fn as provide, G as isCiEnvironment, Gt as hashFileContents, Ht as groupBy, In as provideContext, J as Config, Jt as isPathInsideDirectory, K as isCiOrCodingAgentEnvironment, Kn as succeed, Kt as highlighter, Ln as provideService, Mn as map, Mt as filterPathsOutsideDirectories, Nn as orElseSucceed, Nt as filterSourceFiles, On as decodeUnknownSync, Ot as createOxlintSpawnSlots, Pn as promise, Q as LintPartialFailures, Qt as isScanComplete, Rn as runPromise, S as BASELINE_FILES_TEMP_DIR_PREFIX, Sn as Console, T as METRIC, Tn as log, Tt as computeDiagnosticDelta, U as ACTION_INPUT_ENVIRONMENT_VARIABLES, Ut as hasPublishedFixRecipe, Vn as try_, W as detectRunnerOs, Wn as mergeAll, X as Git, Xt as isReactDoctorError, Y as Files, Zn as ParentSpan, _ as VERSION, _n as shouldUseMaintainabilityLayer, _t as buildRuleSeverityControls, an as materializeSourceTree, ar as DIAGNOSTIC_CATEGORY_BUCKETS, at as Progress, bt as canonicalizeUserRuleKey, cn as resolveGithubActionsScoreMetadata, ct as Score, d as isJsonModeActive, dn as resolveScanConcurrency, dr as JSX_DUPLICATION_SOURCE_FILE_PATTERN, dt as SupplyChain, en as listSourceFiles, et as Maintainability, fn as resolveScanTarget, fr as JSX_FILE_PATTERN, gt as buildRuleDocsUrl, hr as SHARE_BASE_URL, in as mapWithConcurrency, it as PerFileLintCacheEnabled, jt as filterDiagnosticsForSurface, l as getRunId, ln as resolveLintBatchOrdering, lr as GIT_SHOW_MAX_BUFFER_BYTES, lt as SidecarLintCacheEnabled, mn as runInspect, mr as OXLINT_NODE_REQUIREMENT, mt as atomicWriteJson, n as recordDistribution, nn as listWorkspacePackages, nt as OxlintConcurrency, on as mergeReactDoctorConfigs, ot as Project, pn as restoreLegacyThrow, pr as MILLISECONDS_PER_SECOND, qt as isMonorepoRoot, r as toSpanAttributes, rt as OxlintSpawnSlots, sn as remainingDeadlineBudgetMs, sr as ENTERPRISE_CONTACT_URL, st as Reporter, t as recordCount, tn as listSourceFilesCooperative, tr as CI_URL, tt as NodeResolver, un as resolveReactDoctorCacheDir, ur as HTML_FILE_PATTERN, v as makeNoopConsole, vn as summarizeDiagnostics, vt as buildSkippedChecks, wt as computeConfigFingerprint, xn as yieldToEventLoop, xr as isFile, xt as classifyFileContext, yr as isDirectory, yt as calculateScore, z as CliInputError, zn as runSync, zt as getDiagnosticRuleIdentity } from "./record-metric-DcBAbVVs.js";
|
|
4
|
+
import { t as getTelemetryContext } from "./telemetry-runtime-BxsPVkMH.js";
|
|
5
|
+
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-dzVqU6Fr.js";
|
|
6
|
+
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-DwG6tSPy.js";
|
|
7
|
+
import { A as runGit, C as getPackageJsonPath, N as cliLogger, a as installReactDoctorScriptStep, c as spinner, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent, w as isRecord } from "./install-doctor-script-DaB6kssK.js";
|
|
8
|
+
import { d as detectDefaultBranch, l as prompts, r as installReactDoctorWorkflow, u as isCommandAvailable } from "./install-github-workflow-CHs4pPvZ.js";
|
|
9
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, o as pickBlockingLevel, u as toForwardSlashes } from "./resolve-scope-pqK2skSv.js";
|
|
10
|
+
import { n as resetSentryRunState, r as withRunSpan, t as recordSentryProjectContext } from "./with-run-span-Kn-I23fJ.js";
|
|
11
|
+
import { h as detectAvailableAgents, t as reportWorkflowResult } from "./report-workflow-result-DadOSgvV.js";
|
|
10
12
|
import { createRequire } from "node:module";
|
|
11
13
|
import { spawn } from "node:child_process";
|
|
12
14
|
import * as path$1 from "node:path";
|
|
@@ -102,107 +104,6 @@ const buildRuntimeLayers = (input) => {
|
|
|
102
104
|
return input.oxlintSpawnSlots === void 0 ? layersWithConcurrency : mergeAll(layersWithConcurrency, succeed(OxlintSpawnSlots, input.oxlintSpawnSlots));
|
|
103
105
|
};
|
|
104
106
|
//#endregion
|
|
105
|
-
//#region src/cli/utils/with-run-span.ts
|
|
106
|
-
/**
|
|
107
|
-
* Ends the run span without letting a telemetry failure change the run's
|
|
108
|
-
* outcome — the invariant every other emit site here already holds.
|
|
109
|
-
*
|
|
110
|
-
* The failure path is the reason this matters most: a throw from `end` there
|
|
111
|
-
* would replace the user's original scan error, so a project-config mistake
|
|
112
|
-
* could surface as an exporter stack trace, be reclassified as a crash, and get
|
|
113
|
-
* reported as one.
|
|
114
|
-
*/
|
|
115
|
-
const endSpanSafely = (span, exit) => {
|
|
116
|
-
try {
|
|
117
|
-
span.end(BigInt(Date.now()) * NANOSECONDS_PER_MILLISECOND, exit);
|
|
118
|
-
} catch {}
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Clears the module-level run-scoped telemetry state — the current scanned
|
|
122
|
-
* project and the active run trace. `inspect()` calls this at the start of every
|
|
123
|
-
* run and again after a clean one, so a prior or just-finished scan can't attach
|
|
124
|
-
* its project tags / trace to a later run or to a non-scan error (e.g.
|
|
125
|
-
* inspectAction's post-loop finalize/handoff steps). A thrown scan error skips
|
|
126
|
-
* the post-run reset, leaving the state for the command catch to attribute and
|
|
127
|
-
* link the crash. Concurrent batch members (`concurrentScan`) never touch this
|
|
128
|
-
* state — they neither write nor reset it. Safe to call when telemetry is off
|
|
129
|
-
* (the refs are read only when an event is built).
|
|
130
|
-
*/
|
|
131
|
-
const resetSentryRunState = () => {
|
|
132
|
-
setSentryProjectInfo(null);
|
|
133
|
-
setActiveRunTrace(null);
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Runs an inspect invocation inside a root span so each `react-doctor` run is a
|
|
137
|
-
* first-class trace with timing and the run snapshot as attributes. The span is
|
|
138
|
-
* handed to `run` so the scan's Effect spans parent under it and so the wide
|
|
139
|
-
* event can be stamped onto it once the outcome is known.
|
|
140
|
-
*
|
|
141
|
-
* A no-op pass-through when telemetry is off (`--no-telemetry`, tests, or an
|
|
142
|
-
* unconfigured build) — `run` receives `undefined` and no span is created, so
|
|
143
|
-
* there's no added exit latency.
|
|
144
|
-
*
|
|
145
|
-
* The span is created against the shared telemetry context rather than a
|
|
146
|
-
* freshly-provided layer, so it lives in the same tracer as the scan program's
|
|
147
|
-
* spans; see `telemetry-runtime.ts` for why that matters. It is started and
|
|
148
|
-
* ended manually because the body it wraps is a promise-returning imperative
|
|
149
|
-
* function, not an Effect — the same shape the Sentry inactive span had.
|
|
150
|
-
*
|
|
151
|
-
* While the span runs, its trace context is recorded as the active run trace so
|
|
152
|
-
* `reportErrorToSentry` can attach a crash thrown during the scan back to this
|
|
153
|
-
* trace (errors surface in the command catch, after the span has ended).
|
|
154
|
-
*
|
|
155
|
-
* A `concurrentScan` (one member of the CLI's multi-project pool) still gets its
|
|
156
|
-
* own root span, but skips recording the active run trace — the module-level
|
|
157
|
-
* handle has single-scan semantics, and overlapping writers would link a crash
|
|
158
|
-
* to an arbitrary sibling's trace.
|
|
159
|
-
*/
|
|
160
|
-
const withRunSpan = async (run, options = {}) => {
|
|
161
|
-
const telemetryContext = getTelemetryContext();
|
|
162
|
-
if (telemetryContext === null) return run(void 0);
|
|
163
|
-
const { tags } = buildSentryScope();
|
|
164
|
-
const command = typeof tags.command === "string" ? tags.command : "inspect";
|
|
165
|
-
let rootSpan;
|
|
166
|
-
try {
|
|
167
|
-
rootSpan = runSync(makeSpan(`react-doctor ${command}`, { attributes: toSpanAttributes(tags) }).pipe(provideContext(telemetryContext)));
|
|
168
|
-
} catch {
|
|
169
|
-
return run(void 0);
|
|
170
|
-
}
|
|
171
|
-
recordRunTraceId(rootSpan.traceId);
|
|
172
|
-
if (options.concurrentScan !== true) setActiveRunTrace({
|
|
173
|
-
traceId: rootSpan.traceId,
|
|
174
|
-
spanId: rootSpan.spanId,
|
|
175
|
-
sampled: rootSpan.sampled
|
|
176
|
-
});
|
|
177
|
-
try {
|
|
178
|
-
const result = await run(rootSpan);
|
|
179
|
-
endSpanSafely(rootSpan, void_);
|
|
180
|
-
return result;
|
|
181
|
-
} catch (error) {
|
|
182
|
-
endSpanSafely(rootSpan, fail(error));
|
|
183
|
-
throw error;
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* Records the scanned project (discovered in the `beforeLint` hook): remembers
|
|
188
|
-
* it for the lazy Sentry error-capture path (`buildSentryScope` folds it into
|
|
189
|
-
* exception events) and for per-emit metric attributes, and sets it on the run's
|
|
190
|
-
* root span so the trace carries the project shape too. Always cheap — the span
|
|
191
|
-
* attributes are skipped when `rootSpan` is absent (telemetry off), and storing
|
|
192
|
-
* the info is a plain assignment.
|
|
193
|
-
*
|
|
194
|
-
* A `concurrentScan` only sets the span attributes: the module-level project ref
|
|
195
|
-
* has single-scan semantics, and overlapping writers would stamp events and
|
|
196
|
-
* metrics with an arbitrary sibling's project. Wide events keep full attribution
|
|
197
|
-
* (they ride the span); per-emit metrics simply omit the project shape during a
|
|
198
|
-
* concurrent batch (absent, never wrong).
|
|
199
|
-
*/
|
|
200
|
-
const recordSentryProjectContext = (projectInfo, rootSpan, options = {}) => {
|
|
201
|
-
if (options.concurrentScan !== true) setSentryProjectInfo(projectInfo);
|
|
202
|
-
if (rootSpan === void 0) return;
|
|
203
|
-
for (const [key, value] of Object.entries(toSpanAttributes(buildSentryProjectContext(projectInfo).tags))) rootSpan.attribute(key, value);
|
|
204
|
-
};
|
|
205
|
-
//#endregion
|
|
206
107
|
//#region src/cli/utils/diagnostic-grouping.ts
|
|
207
108
|
const buildRulePriorityMap = (scores) => {
|
|
208
109
|
const rulePriority = /* @__PURE__ */ new Map();
|
|
@@ -500,6 +401,13 @@ const TOOLCHAIN_PACKAGE_SPECIFIERS = [
|
|
|
500
401
|
"eslint-plugin-react-hooks/package.json"
|
|
501
402
|
];
|
|
502
403
|
const bundledRequire = createRequire(import.meta.url);
|
|
404
|
+
const RULE_PLUGIN_CONTENT_FINGERPRINT = (() => {
|
|
405
|
+
try {
|
|
406
|
+
return `oxlint-plugin-react-doctor#fingerprint=${hashFileContents(bundledRequire.resolve("oxlint-plugin-react-doctor")) ?? "unreadable"}`;
|
|
407
|
+
} catch {
|
|
408
|
+
return "oxlint-plugin-react-doctor#fingerprint=unresolved";
|
|
409
|
+
}
|
|
410
|
+
})();
|
|
503
411
|
const normalizeForStableJson = (value) => {
|
|
504
412
|
if (value === null) return null;
|
|
505
413
|
if (value === void 0) return void 0;
|
|
@@ -691,7 +599,7 @@ const fileFingerprint = (filePath) => {
|
|
|
691
599
|
return null;
|
|
692
600
|
}
|
|
693
601
|
};
|
|
694
|
-
const
|
|
602
|
+
const resolveScanResultToolchainFingerprint = (nodeBinaryPath) => {
|
|
695
603
|
const fingerprints = [];
|
|
696
604
|
if (nodeBinaryPath !== null) fingerprints.push(nodeBinaryPath === process.execPath ? `node=${process.version}` : `node=${fileFingerprint(nodeBinaryPath) ?? "unreadable"}`);
|
|
697
605
|
for (const specifier of TOOLCHAIN_PACKAGE_SPECIFIERS) try {
|
|
@@ -701,6 +609,7 @@ const resolveToolchainFingerprint = (nodeBinaryPath) => {
|
|
|
701
609
|
} catch {
|
|
702
610
|
fingerprints.push(`${specifier}=missing`);
|
|
703
611
|
}
|
|
612
|
+
fingerprints.push(RULE_PLUGIN_CONTENT_FINGERPRINT);
|
|
704
613
|
return fingerprints;
|
|
705
614
|
};
|
|
706
615
|
const buildScanResultCacheKey = (input) => {
|
|
@@ -717,7 +626,7 @@ const buildScanResultCacheKey = (input) => {
|
|
|
717
626
|
dotenvFingerprint: resolveDotenvFingerprint(input.projectDirectory),
|
|
718
627
|
reactDoctorVersion: input.version,
|
|
719
628
|
nodeVersion: process.version,
|
|
720
|
-
toolchainFingerprint:
|
|
629
|
+
toolchainFingerprint: resolveScanResultToolchainFingerprint(input.nodeBinaryPath),
|
|
721
630
|
configFingerprint: computeConfigFingerprint(input.projectDirectory, input.version),
|
|
722
631
|
hasConfigOverride: input.hasConfigOverride,
|
|
723
632
|
configSourceDirectory: input.configSourceDirectory,
|
|
@@ -2970,7 +2879,7 @@ const buildCodeFrame = (input) => {
|
|
|
2970
2879
|
const discoverWorkspacePackages = (rootDirectory) => {
|
|
2971
2880
|
const hasRootPackageJson = isFile(path$1.join(rootDirectory, "package.json"));
|
|
2972
2881
|
const packages = listWorkspacePackages(rootDirectory);
|
|
2973
|
-
if (packages.length === 0 && (!hasRootPackageJson || isMonorepoRoot(rootDirectory))) return
|
|
2882
|
+
if (packages.length === 0 && (!hasRootPackageJson || isMonorepoRoot(rootDirectory))) return discoverSupportedSubprojects(rootDirectory);
|
|
2974
2883
|
return packages;
|
|
2975
2884
|
};
|
|
2976
2885
|
const selectProjects = async (rootDirectory, projectFlag, skipPrompts, configProjects) => {
|
|
@@ -3088,5 +2997,5 @@ const shouldFailScanGate = (input) => {
|
|
|
3088
2997
|
//#endregion
|
|
3089
2998
|
export { resolveMergeBaseRef as A, buildNoScoreMessage as B, copyToClipboard as C, deduplicateProjectScans as D, collectProjectSourceFileCounts as E, printFooter as F, formatFixRecipeLine as G, hasLintHardFailure as H, printDiagnosticsDump as I, formatLearnMoreLine as K, formatDiagnosticSite as L, pluralize as M, formatSkippedCheckLabel as N, createInvocationInspect as O, formatElapsedTime as P, hasIncompleteScoreAnalysis as R, CLI_AGENT_BINARIES as S, buildHandoffPayload as T, buildRulePriorityMap as U, buildEmptyReportMessage as V, buildSortedRuleGroups as W, resolveCliInspectOptions as _, projectManifestChanged as a, setUpGitHubActions as b, selectProjects as c, resolveProjectChangedLineRanges as d, resolveProjectDiffIncludePaths as f, resolveWorkspaceDeadCodeOwner as g, retryMissingProjectScores as h, validateModeFlags as i, printHeadlessReport as j, inspect as k, buildCodeFrame as l, resolveProjectRelativeDirectory as m, formatSkippedProjectsMessage as n, partitionProjectScanOutcomes as o, resolveProjectSourceFilePaths as p, validateIncludeUntrackedScope as r, discoverWorkspacePackages as s, shouldFailScanGate as t, resolveProjectScan as u, filterScansForSurface as v, launchCliAgent as w, detectLaunchableAgents as x, countUniqueScannedFiles as y, filterDiagnosticsByCategories as z };
|
|
3090
2999
|
|
|
3091
|
-
//# sourceMappingURL=should-fail-scan-gate-
|
|
3092
|
-
//# debugId=
|
|
3000
|
+
//# sourceMappingURL=should-fail-scan-gate-CwBjVudY.js.map
|
|
3001
|
+
//# debugId=a8e6be79-6965-51bf-a039-f1163c3f025c
|
|
@@ -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 {
|
|
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]="ed758f0c-b026-5891-b495-b44b050664a8")}catch(e){}}();
|
|
3
|
+
import { B as isNonInteractiveEnvironment } from "./record-metric-DcBAbVVs.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-CtQ-6r7T.js.map
|
|
10
|
+
//# debugId=ed758f0c-b026-5891-b495-b44b050664a8
|
|
@@ -0,0 +1,25 @@
|
|
|
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]="ebd91d87-154d-59fb-9fae-4b3200faf527")}catch(e){}}();
|
|
3
|
+
import { B as isNonInteractiveEnvironment } from "./record-metric-DcBAbVVs.js";
|
|
4
|
+
//#region src/cli/utils/resolve-tui-environment.ts
|
|
5
|
+
const resolveTuiEnvironment = (outputIsTty = process.stdout.isTTY === true) => ({
|
|
6
|
+
isNonInteractiveEnvironment: isNonInteractiveEnvironment(),
|
|
7
|
+
nodeMajorVersion: Number(process.versions.node.split(".")[0]),
|
|
8
|
+
outputIsTty,
|
|
9
|
+
stdinIsTty: process.stdin.isTTY === true,
|
|
10
|
+
supportsRawMode: typeof process.stdin.setRawMode === "function",
|
|
11
|
+
terminalName: process.env.TERM
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/cli/utils/should-use-tui.ts
|
|
15
|
+
const isTuiEnvironmentSupported = (input) => !input.isNonInteractiveEnvironment && input.stdinIsTty && input.outputIsTty && input.supportsRawMode && input.nodeMajorVersion >= 22 && input.terminalName !== "dumb";
|
|
16
|
+
const shouldUseTui = (input) => {
|
|
17
|
+
if (!isTuiEnvironmentSupported(input)) return false;
|
|
18
|
+
const flags = input.flags;
|
|
19
|
+
return !(flags.score === true || flags.json === true || flags.jsonCompact === true || flags.jsonOut !== void 0 || flags.staged === true || flags.changedFilesFrom !== void 0);
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { shouldUseTui as n, resolveTuiEnvironment as r, isTuiEnvironmentSupported as t };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=should-use-tui-BLBNwhU6.js.map
|
|
25
|
+
//# debugId=ebd91d87-154d-59fb-9fae-4b3200faf527
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance
|
|
3
|
+
description: Diagnose React runtime performance with React Doctor traces, live render outlines, Long Animation Frames, interaction timing, and component render evidence. Use when invoked as `/performance` for a slow interaction, unexpected re-renders, or a measured before-and-after comparison.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Diagnose React runtime performance
|
|
8
|
+
|
|
9
|
+
Measure one reproducible interaction, connect browser work to React renders, and report only conclusions supported by the trace.
|
|
10
|
+
|
|
11
|
+
## Define the interaction
|
|
12
|
+
|
|
13
|
+
Before recording:
|
|
14
|
+
|
|
15
|
+
1. Identify the target URL
|
|
16
|
+
2. Write the exact actions to reproduce
|
|
17
|
+
3. Choose the expected result
|
|
18
|
+
4. Confirm whether authentication is required
|
|
19
|
+
|
|
20
|
+
Use a production build when available. Development builds add framework work that can distort render and script timings. If you must measure a development build, label that limitation in the report.
|
|
21
|
+
|
|
22
|
+
## Record the trace
|
|
23
|
+
|
|
24
|
+
Run the scan in an interactive terminal:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx react-doctor@latest scan http://localhost:3000 --format json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
React Doctor opens an isolated Chrome profile. Perform the planned interaction while purple outlines identify rendered components. Press Enter after the interaction settles; recordings stop automatically after five minutes.
|
|
31
|
+
|
|
32
|
+
Interactive users can omit the URL and choose a detected localhost app or enter another URL. Agents must always pass the explicit URL so automated runs never wait for input.
|
|
33
|
+
|
|
34
|
+
For an authenticated session, connect through the Chrome DevTools Protocol (CDP):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx react-doctor@latest scan https://app.example.com \
|
|
38
|
+
--cdp http://127.0.0.1:9222 \
|
|
39
|
+
--format json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use a dedicated debug profile for CDP because Chrome tracing is browser-wide. Sign in, close every non-blank tab, and then start the scan. React Doctor closes leftover blank tabs before tracing. Never request cookies, copy a browser profile, or close an externally managed browser.
|
|
43
|
+
|
|
44
|
+
The compressed `.json.gz` trace can contain URLs, source paths, and application behavior. Keep it local unless an upload is explicitly approved.
|
|
45
|
+
|
|
46
|
+
## Read the report
|
|
47
|
+
|
|
48
|
+
Evaluate the report in this order:
|
|
49
|
+
|
|
50
|
+
1. **Capture support**: confirm React detection, build type, React tracks, and Long Animation Frame support
|
|
51
|
+
2. **User impact**: inspect the worst interaction, total blocking duration, Largest Contentful Paint (LCP), and Cumulative Layout Shift (CLS)
|
|
52
|
+
3. **Browser work**: inspect long frames and script hotspots for event handling, JavaScript, style, layout, and paint cost
|
|
53
|
+
4. **React work**: inspect component render count, total self time, and maximum self time
|
|
54
|
+
5. **Capture limits**: read every warning, especially dropped event counts
|
|
55
|
+
|
|
56
|
+
Follow these interpretation rules:
|
|
57
|
+
|
|
58
|
+
- A high render count is evidence, not a defect. Pair it with duration and user impact
|
|
59
|
+
- Generated chunk names identify browser work, not the owning source component
|
|
60
|
+
- A slow interaction can be browser-bound even when every component render is cheap
|
|
61
|
+
- Repeated Event Timing records with one interaction identifier represent one interaction
|
|
62
|
+
- Dropped component events make hotspot totals incomplete
|
|
63
|
+
- Use purple labels to identify the active subtree, then use recorded timings to set severity
|
|
64
|
+
|
|
65
|
+
## Connect measurements to source
|
|
66
|
+
|
|
67
|
+
Search the repository for measured component display names and event handlers. Confirm that each candidate runs in the recorded flow before reporting it.
|
|
68
|
+
|
|
69
|
+
Open the DevTools trace when the summary cannot explain a long frame. Correlate the interaction timestamp with script tasks, style or layout work, React tracks, and paint. Do not infer causality from neighboring timestamps alone.
|
|
70
|
+
|
|
71
|
+
## Report findings
|
|
72
|
+
|
|
73
|
+
Use this structure:
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
## Flow tested
|
|
77
|
+
|
|
78
|
+
tested_url, build_type, and exact_interaction
|
|
79
|
+
|
|
80
|
+
## Verdict
|
|
81
|
+
|
|
82
|
+
one_evidence_backed_paragraph
|
|
83
|
+
|
|
84
|
+
## Evidence
|
|
85
|
+
|
|
86
|
+
| Signal | Measurement | Interpretation |
|
|
87
|
+
| ----------------- | ---------------------------: | --------------- |
|
|
88
|
+
| Worst interaction | duration_ms | measured_cause |
|
|
89
|
+
| Total blocking | duration_ms | measured_scope |
|
|
90
|
+
| Top component | render_count and duration_ms | measured_impact |
|
|
91
|
+
|
|
92
|
+
## Findings
|
|
93
|
+
|
|
94
|
+
1. `path/to/component.tsx:42`: measured_problem, evidence, and smallest_fix
|
|
95
|
+
|
|
96
|
+
## Limits
|
|
97
|
+
|
|
98
|
+
capture_warnings, missing_support, or environmental_caveats
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Do not pad the report with static lint findings. Include source findings only when runtime evidence connects them to the tested flow.
|
|
102
|
+
|
|
103
|
+
## Validate a fix
|
|
104
|
+
|
|
105
|
+
Do not edit code unless code changes are requested. After a fix:
|
|
106
|
+
|
|
107
|
+
1. Rebuild with the same mode
|
|
108
|
+
2. Record the same interaction at the same viewport
|
|
109
|
+
3. Run three before and three after samples when timing variance could change the conclusion
|
|
110
|
+
4. Compare medians for interaction, blocking, and component duration
|
|
111
|
+
5. Confirm behavior and accessibility did not regress
|
|
112
|
+
|
|
113
|
+
Reject improvements that only move work outside the recorded window or disable useful behavior.
|
|
@@ -22,6 +22,12 @@ Run `npx react-doctor@latest --verbose` (the default `--scope full`) to scan the
|
|
|
22
22
|
|
|
23
23
|
Run `npx react-doctor@latest design --verbose`. This selects only design-tagged UI composition, typography, interaction, accessibility, and motion rules, including focused rules that remain opt-in during a general health scan.
|
|
24
24
|
|
|
25
|
+
## For runtime performance problems:
|
|
26
|
+
|
|
27
|
+
Run `npx react-doctor@latest scan <url> --format json` in an interactive terminal. React Doctor opens an isolated system Chrome profile, records a DevTools trace while the user reproduces the slow interaction, and flashes purple outlines with component names as React renders. It stops when they press Enter. Read the structured summary first, then inspect the returned local `.json.gz` trace for CPU, browser, and React component evidence.
|
|
28
|
+
|
|
29
|
+
If the user needs their authenticated browser state, use `--cdp <remote-debugging-url>`. This requires Chrome to already be running with remote debugging. Never ask for cookies or copy the user's browser profile. Treat the trace as sensitive local application data and never upload it without explicit permission.
|
|
30
|
+
|
|
25
31
|
## /doctor — full local triage workflow
|
|
26
32
|
|
|
27
33
|
When the user types `/doctor`, says "run react doctor", or asks for a full triage / cleanup pass (not just a regression check), fetch the canonical local-triage playbook and follow every step in it:
|
|
@@ -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]="4027805c-3296-5050-9804-742b478424a4")}catch(e){}}();
|
|
3
|
+
import { $t as layerObservability, Cr as messageFromUnknown, Jn as makeUnsafe, Rn as runPromise, Un as buildWithScope, Xn as void_, Xt as isReactDoctorError, Yt as isProjectDiscoveryError, _ as VERSION, br as isErrnoException, i as isTelemetryEnabled, kn as make, qn as close, z as CliInputError, zn as runSync } from "./record-metric-DcBAbVVs.js";
|
|
4
4
|
//#region src/cli/utils/is-environment-error.ts
|
|
5
5
|
const ENVIRONMENT_ERROR_CODES = new Set([
|
|
6
6
|
"EACCES",
|
|
@@ -197,25 +197,7 @@ const shutdownTelemetry = async () => {
|
|
|
197
197
|
return pendingShutdown;
|
|
198
198
|
};
|
|
199
199
|
//#endregion
|
|
200
|
-
|
|
201
|
-
let activeRunTrace = null;
|
|
202
|
-
const setActiveRunTrace = (trace) => {
|
|
203
|
-
activeRunTrace = trace;
|
|
204
|
-
};
|
|
205
|
-
const getActiveRunTrace = () => activeRunTrace;
|
|
206
|
-
let lastRunTraceId = null;
|
|
207
|
-
const recordRunTraceId = (traceId) => {
|
|
208
|
-
lastRunTraceId = traceId;
|
|
209
|
-
};
|
|
210
|
-
const getLastRunTraceId = () => lastRunTraceId;
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region src/cli/utils/unref-stdin.ts
|
|
213
|
-
const unrefStdin = () => {
|
|
214
|
-
if (process.stdin.isTTY) return;
|
|
215
|
-
process.stdin.unref?.();
|
|
216
|
-
};
|
|
217
|
-
//#endregion
|
|
218
|
-
export { setActiveRunTrace as a, isExpectedUserError as c, recordRunTraceId as i, formatEnvironmentError as l, getActiveRunTrace as n, getTelemetryContext as o, getLastRunTraceId as r, shutdownTelemetry as s, unrefStdin as t, isEnvironmentError as u };
|
|
200
|
+
export { isEnvironmentError as a, formatEnvironmentError as i, shutdownTelemetry as n, isExpectedUserError as r, getTelemetryContext as t };
|
|
219
201
|
|
|
220
|
-
//# sourceMappingURL=
|
|
221
|
-
//# debugId=
|
|
202
|
+
//# sourceMappingURL=telemetry-runtime-BxsPVkMH.js.map
|
|
203
|
+
//# debugId=4027805c-3296-5050-9804-742b478424a4
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/cli/utils/unref-stdin.ts
|
|
2
|
+
|
|
3
|
+
!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]="bb265729-ea99-5b37-b53e-561ac78da6ac")}catch(e){}}();
|
|
4
|
+
const unrefStdin = () => {
|
|
5
|
+
if (process.stdin.isTTY) return;
|
|
6
|
+
process.stdin.unref?.();
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { unrefStdin as t };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=unref-stdin-BKT_s38a.js.map
|
|
12
|
+
//# debugId=bb265729-ea99-5b37-b53e-561ac78da6ac
|
|
@@ -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]="44b3b423-2322-578b-bd64-32766502a2ba")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, _ as VERSION, t as recordCount } from "./record-metric-DcBAbVVs.js";
|
|
4
4
|
//#region src/cli/commands/version.ts
|
|
5
5
|
/**
|
|
6
6
|
* oclif-style version line. 12-factor CLI Apps (#3, "What version am I
|
|
@@ -17,5 +17,5 @@ const versionAction = () => {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { versionAction };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=version-
|
|
21
|
-
//# debugId=
|
|
20
|
+
//# sourceMappingURL=version-5WSKTaCF.js.map
|
|
21
|
+
//# debugId=44b3b423-2322-578b-bd64-32766502a2ba
|
|
@@ -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 { t as inspectAction } from "./inspect-
|
|
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]="a073dd2c-2d75-5039-a285-d6709931d600")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-CBkHe9dS.js";
|
|
4
4
|
//#region src/cli/commands/why.ts
|
|
5
5
|
/**
|
|
6
6
|
* `why <file:line>` — explains why a rule fired (or why a suppression didn't
|
|
@@ -17,5 +17,5 @@ const whyAction = async (location, options) => {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { whyAction };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=why-
|
|
21
|
-
//# debugId=
|
|
20
|
+
//# sourceMappingURL=why-DHTN2DPT.js.map
|
|
21
|
+
//# debugId=a073dd2c-2d75-5039-a285-d6709931d600
|