react-doctor 0.9.9 → 0.9.10
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/{build-section-divider-rq_KQONI.js → build-section-divider-BBuZ20p0.js} +22 -103
- package/dist/{ci-BwCh-hUD.js → ci-Cje97GMB.js} +11 -11
- package/dist/cli.js +33 -30
- package/dist/{design-CTL1QpZB.js → design-swBQC07N.js} +4 -4
- package/dist/{exit-gracefully-C7wgCb-s.js → exit-gracefully-GZXxMj5W.js} +7 -6
- package/dist/index.d.ts +9 -1
- package/dist/index.js +159 -159
- package/dist/{inspect-CGCfCxoM.js → inspect-BQapfOJX.js} +16 -16
- package/dist/{install-CdlRGSxJ.js → install-CChowo4Z.js} +8 -8
- package/dist/{install-doctor-script-BEIl1lby.js → install-doctor-script-BM5NC98v.js} +4 -4
- package/dist/{install-github-workflow-Cun64Fxh.js → install-github-workflow-L48jbG9d.js} +6 -6
- package/dist/{install-react-doctor-Bn-dP3rT.js → install-react-doctor-BFp6q3iz.js} +8 -8
- package/dist/lsp.js +2122 -327
- package/dist/{print-branded-header-C9de_0PE.js → print-branded-header-DQn3TZpV.js} +4 -4
- package/dist/{read-object-file-ClOsQUSD.js → read-object-file-BTd_gGow.js} +4 -4
- package/dist/{record-metric-b5KUd2XK.js → record-metric-CuPtdZfm.js} +1654 -295
- package/dist/{report-error-DU6Bxy9R.js → report-error-DemUcOtc.js} +18 -12
- package/dist/{report-workflow-result-CjrL22OD.js → report-workflow-result-W-amAB4Z.js} +5 -5
- package/dist/{resolve-scope-pjSIB8ZY.js → resolve-scope-BGBQcbGi.js} +6 -6
- package/dist/{rules-Ds2rHd-a.js → rules-BsYE5BBb.js} +6 -6
- package/dist/{run-scan-app-D8wBLuwl.js → run-scan-app-CfT3YzbG.js} +10 -10
- package/dist/{scan-CHh6DGmw.js → scan-D8DHxJxj.js} +8 -8
- package/dist/{should-fail-scan-gate-Bif6gnI9.js → should-fail-scan-gate-B5XfdAMg.js} +114 -192
- package/dist/{should-skip-prompts-Q3cS356Z.js → should-skip-prompts-DaBGPwa3.js} +4 -4
- package/dist/{unref-stdin-DTLx8HEf.js → unref-stdin-D0Lq28Bk.js} +112 -5
- package/dist/{version-BrAILQSv.js → version-CyVLelBf.js} +4 -4
- package/dist/{why-DB_XpRpg.js → why-nfPQ3AAq.js} +4 -4
- package/package.json +6 -6
|
@@ -1,43 +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 {
|
|
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]="f486e580-9557-556a-b470-90390c8dfca4")}catch(e){}}();
|
|
3
|
+
import { At as anonymizeInPlace, Fn as scrubSensitivePaths, M as SENTRY_FLUSH_TIMEOUT_MS, Y as CANONICAL_GITHUB_URL, a as isEnvFlagEnabled, cn as highlighter, i as isTelemetryEnabled, jt as anonymizeText, nt as DOCS_URL, o as buildSentryScope } from "./record-metric-CuPtdZfm.js";
|
|
4
|
+
import { c as isExpectedUserError } from "./unref-stdin-D0Lq28Bk.js";
|
|
5
5
|
import * as Sentry from "@sentry/node";
|
|
6
|
-
//#region src/cli/utils/is-env-flag-enabled.ts
|
|
7
|
-
const isEnvFlagEnabled = (value) => value === "1" || value?.toLowerCase() === "true";
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/cli/utils/anonymize-text.ts
|
|
10
|
-
/**
|
|
11
|
-
* Free-text fields can carry both a home-directory path (the OS username) and a
|
|
12
|
-
* secret/email echoed from user code, so run both scrubbers: strip the username
|
|
13
|
-
* from paths, then mask any known credential/PII shape. Shared by the Sentry
|
|
14
|
-
* event scrubber ({@link scrubSentryEvent}) and metric scrubber
|
|
15
|
-
* ({@link scrubSentryMetric}).
|
|
16
|
-
*/
|
|
17
|
-
const anonymizeText = (text) => redactSensitiveText(scrubSensitivePaths(text));
|
|
18
|
-
/**
|
|
19
|
-
* Recursively rewrites every string within an arbitrary value (object / array /
|
|
20
|
-
* primitive) through {@link anonymizeText}, mutating in place. Used to sweep the
|
|
21
|
-
* unstructured corners of a Sentry payload (event contexts/extra/tags, breadcrumb
|
|
22
|
-
* data, span attributes, metric attributes) where a path or secret could hide.
|
|
23
|
-
*/
|
|
24
|
-
const anonymizeInPlace = (value) => {
|
|
25
|
-
if (Array.isArray(value)) {
|
|
26
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
27
|
-
const item = value[index];
|
|
28
|
-
if (typeof item === "string") value[index] = anonymizeText(item);
|
|
29
|
-
else anonymizeInPlace(item);
|
|
30
|
-
}
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (!isPlainObject(value)) return;
|
|
34
|
-
for (const key of Object.keys(value)) {
|
|
35
|
-
const inner = value[key];
|
|
36
|
-
if (typeof inner === "string") value[key] = anonymizeText(inner);
|
|
37
|
-
else anonymizeInPlace(inner);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
6
|
//#region src/cli/utils/scrub-sentry-event.ts
|
|
42
7
|
/**
|
|
43
8
|
* Anonymizes a Sentry event (error or transaction) before it leaves the
|
|
@@ -86,27 +51,6 @@ const scrubSentryEvent = (event) => {
|
|
|
86
51
|
}
|
|
87
52
|
};
|
|
88
53
|
//#endregion
|
|
89
|
-
//#region src/cli/utils/scrub-sentry-metric.ts
|
|
90
|
-
/**
|
|
91
|
-
* Anonymizes a Sentry metric before it leaves the machine, mirroring
|
|
92
|
-
* {@link scrubSentryEvent}. Drops the `server.address` default attribute (the
|
|
93
|
-
* hostname) and scrubs home-directory paths + known secrets/emails from every
|
|
94
|
-
* remaining attribute value (metric names are our own constants, so they're
|
|
95
|
-
* left intact to avoid splitting a series). Returns `null` on any failure so an
|
|
96
|
-
* un-anonymized metric is never sent. Wired into `beforeSendMetric`.
|
|
97
|
-
*/
|
|
98
|
-
const scrubSentryMetric = (metric) => {
|
|
99
|
-
try {
|
|
100
|
-
if (metric.attributes) {
|
|
101
|
-
delete metric.attributes["server.address"];
|
|
102
|
-
anonymizeInPlace(metric.attributes);
|
|
103
|
-
}
|
|
104
|
-
return metric;
|
|
105
|
-
} catch {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
//#endregion
|
|
110
54
|
//#region src/cli/utils/sentry-config.ts
|
|
111
55
|
/**
|
|
112
56
|
* Shared Sentry configuration resolution — release, environment, and tracing
|
|
@@ -127,41 +71,16 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
127
71
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
128
72
|
* standard `SENTRY_RELEASE` override.
|
|
129
73
|
*/
|
|
130
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.
|
|
74
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.10`;
|
|
131
75
|
/**
|
|
132
76
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
133
77
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
134
78
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
135
79
|
*/
|
|
136
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.
|
|
137
|
-
/**
|
|
138
|
-
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
139
|
-
* (set to `0` to disable tracing) and falls back to
|
|
140
|
-
* {@link SENTRY_DEFAULT_TRACES_SAMPLE_RATE}. Invalid / out-of-range values fall
|
|
141
|
-
* back to the default rather than silently disabling tracing.
|
|
142
|
-
*/
|
|
143
|
-
const resolveTracesSampleRate = () => {
|
|
144
|
-
const raw = process.env.SENTRY_TRACES_SAMPLE_RATE;
|
|
145
|
-
if (raw === void 0 || raw.trim() === "") return 1;
|
|
146
|
-
const parsed = Number(raw);
|
|
147
|
-
if (Number.isNaN(parsed) || parsed < 0 || parsed > 1) return 1;
|
|
148
|
-
return parsed;
|
|
149
|
-
};
|
|
80
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.10") ? "development" : "production");
|
|
150
81
|
//#endregion
|
|
151
82
|
//#region src/instrument.ts
|
|
152
83
|
let isInitialized = false;
|
|
153
|
-
let resolvedTracesSampleRate = 0;
|
|
154
|
-
const shouldEnableSentry = () => {
|
|
155
|
-
if (process.argv.includes("--no-score") || process.argv.includes("--no-telemetry")) return false;
|
|
156
|
-
if (process.env.VITEST || process.env.NODE_ENV === "test") return false;
|
|
157
|
-
return true;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Whether performance traces will actually be recorded — Sentry is live and the
|
|
161
|
-
* resolved sample rate is above zero. Used to gate the per-run root span and
|
|
162
|
-
* the Effect→Sentry tracer bridge so they're true no-ops when tracing is off.
|
|
163
|
-
*/
|
|
164
|
-
const isSentryTracingEnabled = () => Sentry.isInitialized() && resolvedTracesSampleRate > 0;
|
|
165
84
|
/**
|
|
166
85
|
* Flushes queued Sentry events (errors + transactions) before the CLI exits, so
|
|
167
86
|
* the success-path transaction is delivered. A no-op when Sentry was never
|
|
@@ -176,9 +95,15 @@ const flushSentry = async () => {
|
|
|
176
95
|
};
|
|
177
96
|
/**
|
|
178
97
|
* Initializes the Sentry Node SDK for CLI crash reporting and performance
|
|
179
|
-
*
|
|
180
|
-
* the SDK's global `uncaughtException` /
|
|
181
|
-
*
|
|
98
|
+
* crash reporting. Invoked as the first statement of the CLI entry
|
|
99
|
+
* (`cli/index.ts`) so the SDK's global `uncaughtException` /
|
|
100
|
+
* `unhandledRejection` handlers are armed before any command runs.
|
|
101
|
+
*
|
|
102
|
+
* Performance tracing is off: spans are exported to Axiom instead (see
|
|
103
|
+
* `telemetry-runtime.ts`), and Effect has a single `Tracer` reference, so the
|
|
104
|
+
* two backends are mutually exclusive. Sentry keeps what it is good at —
|
|
105
|
+
* symbolicated stack traces, issue grouping, and a quotable event id — while
|
|
106
|
+
* crashes carry the Axiom trace id as a tag so an issue pivots into its trace.
|
|
182
107
|
*
|
|
183
108
|
* Exported as a function rather than a bare side-effecting import because the
|
|
184
109
|
* package declares `"sideEffects": false`, which lets the bundler tree-shake
|
|
@@ -190,13 +115,11 @@ const flushSentry = async () => {
|
|
|
190
115
|
* app can't hijack their telemetry.
|
|
191
116
|
*
|
|
192
117
|
* Configuration is environment-overridable for self-hosting and tuning:
|
|
193
|
-
* `SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_RELEASE`,
|
|
194
|
-
* `SENTRY_TRACES_SAMPLE_RATE` (`0` disables tracing), and `SENTRY_DEBUG`.
|
|
118
|
+
* `SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_RELEASE`, and `SENTRY_DEBUG`.
|
|
195
119
|
*/
|
|
196
120
|
const initializeSentry = () => {
|
|
197
|
-
if (isInitialized || !
|
|
121
|
+
if (isInitialized || !isTelemetryEnabled()) return;
|
|
198
122
|
isInitialized = true;
|
|
199
|
-
resolvedTracesSampleRate = isDebugFlagEnabled() ? 1 : resolveTracesSampleRate();
|
|
200
123
|
const { tags, contexts } = buildSentryScope();
|
|
201
124
|
try {
|
|
202
125
|
Sentry.init({
|
|
@@ -204,19 +127,15 @@ const initializeSentry = () => {
|
|
|
204
127
|
release: resolveSentryRelease(),
|
|
205
128
|
environment: resolveSentryEnvironment(),
|
|
206
129
|
sendDefaultPii: false,
|
|
207
|
-
tracesSampleRate:
|
|
130
|
+
tracesSampleRate: 0,
|
|
208
131
|
debug: isEnvFlagEnabled(process.env.SENTRY_DEBUG),
|
|
209
132
|
initialScope: {
|
|
210
133
|
tags,
|
|
211
134
|
contexts
|
|
212
135
|
},
|
|
213
|
-
beforeSend: (event, hint) => isExpectedUserError(hint.originalException) ? null : scrubSentryEvent(event)
|
|
214
|
-
beforeSendTransaction: (event) => scrubSentryEvent(event),
|
|
215
|
-
beforeSendMetric: (metric) => scrubSentryMetric(metric)
|
|
136
|
+
beforeSend: (event, hint) => isExpectedUserError(hint.originalException) ? null : scrubSentryEvent(event)
|
|
216
137
|
});
|
|
217
|
-
} catch {
|
|
218
|
-
resolvedTracesSampleRate = 0;
|
|
219
|
-
}
|
|
138
|
+
} catch {}
|
|
220
139
|
};
|
|
221
140
|
//#endregion
|
|
222
141
|
//#region src/cli/utils/active-scan-abort-registry.ts
|
|
@@ -306,7 +225,7 @@ const buildFooterLinkLines = ({ shareUrl }) => [
|
|
|
306
225
|
const DIVIDER_INDENT = " ";
|
|
307
226
|
const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repeat(resolveMeasureWidth(2))}`);
|
|
308
227
|
//#endregion
|
|
309
|
-
export { initializeSentry as a, flushSentry as i, buildFooterLinkLines as n,
|
|
228
|
+
export { initializeSentry as a, flushSentry as i, buildFooterLinkLines as n, activeScanAbortRegistry as r, buildSectionDivider as t };
|
|
310
229
|
|
|
311
|
-
//# sourceMappingURL=build-section-divider-
|
|
312
|
-
//# debugId=
|
|
230
|
+
//# sourceMappingURL=build-section-divider-BBuZ20p0.js.map
|
|
231
|
+
//# debugId=f486e580-9557-556a-b470-90390c8dfca4
|
|
@@ -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]="
|
|
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]="0905c1ed-726a-5c21-b012-6460d6209b68")}catch(e){}}();
|
|
3
3
|
import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-
|
|
7
|
-
import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-
|
|
8
|
-
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-
|
|
9
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-
|
|
10
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
11
|
-
import { t as printBrandedHeader } from "./print-branded-header-
|
|
4
|
+
import { X as CI_URL, ar as runSync, cn as highlighter, ot as GITHUB_ACTIONS_SETUP_URL, t as recordCount, w as METRIC } from "./record-metric-CuPtdZfm.js";
|
|
5
|
+
import { c as isExpectedUserError } from "./unref-stdin-D0Lq28Bk.js";
|
|
6
|
+
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-DemUcOtc.js";
|
|
7
|
+
import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-BM5NC98v.js";
|
|
8
|
+
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-L48jbG9d.js";
|
|
9
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-BGBQcbGi.js";
|
|
10
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-DaBGPwa3.js";
|
|
11
|
+
import { t as printBrandedHeader } from "./print-branded-header-DQn3TZpV.js";
|
|
12
12
|
import * as path$1 from "node:path";
|
|
13
13
|
import * as fs$1 from "node:fs";
|
|
14
14
|
//#region src/cli/utils/ci/ci-provider.ts
|
|
@@ -7497,5 +7497,5 @@ const ciConfigAction = (options) => runCiCommand("config", runCiConfig, options)
|
|
|
7497
7497
|
//#endregion
|
|
7498
7498
|
export { ciConfigAction, ciInstallAction, ciUpgradeAction };
|
|
7499
7499
|
|
|
7500
|
-
//# sourceMappingURL=ci-
|
|
7501
|
-
//# debugId=
|
|
7500
|
+
//# sourceMappingURL=ci-Cje97GMB.js.map
|
|
7501
|
+
//# debugId=0905c1ed-726a-5c21-b012-6460d6209b68
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +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]="
|
|
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]="c779427c-ed7c-5be4-b123-73410d3af015")}catch(e){}}();
|
|
3
3
|
import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as exitGracefully } from "./exit-gracefully-
|
|
8
|
-
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-
|
|
4
|
+
import { In as setColorEnabled, R as CliInputError, V as isDebugFlagEnabled, X as CI_URL, Y as CANONICAL_GITHUB_URL, cn as highlighter, d as isJsonModeActive, g as VERSION, i as isTelemetryEnabled, m as writeJsonErrorReport } from "./record-metric-CuPtdZfm.js";
|
|
5
|
+
import { c as isExpectedUserError, r as getLastRunTraceId, s as shutdownTelemetry, t as unrefStdin } from "./unref-stdin-D0Lq28Bk.js";
|
|
6
|
+
import { a as initializeSentry, i as flushSentry } from "./build-section-divider-BBuZ20p0.js";
|
|
7
|
+
import { t as exitGracefully } from "./exit-gracefully-GZXxMj5W.js";
|
|
8
|
+
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-DemUcOtc.js";
|
|
9
9
|
import { execFileSync } from "node:child_process";
|
|
10
|
-
import * as Sentry from "@sentry/node";
|
|
11
10
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
|
|
12
11
|
var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13
12
|
/**
|
|
@@ -3121,18 +3120,22 @@ const normalizeHelpInvocation = (argv, knownCommands) => {
|
|
|
3121
3120
|
//#endregion
|
|
3122
3121
|
//#region src/cli/utils/print-debug-trace.ts
|
|
3123
3122
|
/**
|
|
3124
|
-
* The `--debug` end-of-run line, pure so it's testable without
|
|
3123
|
+
* The `--debug` end-of-run line, pure so it's testable without a live exporter.
|
|
3125
3124
|
* Mirrors the crash-reference phrasing in `handle-error.ts` ("mention this when
|
|
3126
3125
|
* reporting") so users learn one habit for both paths. A `null` trace says why,
|
|
3127
3126
|
* so `--debug` never silently does nothing.
|
|
3128
3127
|
*/
|
|
3129
|
-
const buildDebugTraceMessage = (traceId) => traceId === null ? "
|
|
3128
|
+
const buildDebugTraceMessage = (traceId) => traceId === null ? "Trace unavailable for this run (no trace was recorded)." : `Trace (mention this when reporting): ${traceId}`;
|
|
3130
3129
|
/**
|
|
3131
|
-
* Prints the run's
|
|
3130
|
+
* Prints the run's trace id to stderr at the end of a `--debug` run, so
|
|
3132
3131
|
* maintainers can pull the full trace from a pasted id. Runs from the process
|
|
3133
3132
|
* `exit` handler, so it's the last line on both the success path and the error
|
|
3134
3133
|
* funnels (which `process.exit()` before the promise chain could resume).
|
|
3135
3134
|
*
|
|
3135
|
+
* The id now identifies the trace in Axiom rather than Sentry — spans moved
|
|
3136
|
+
* there — and the same id is attached to any Sentry crash report for this run
|
|
3137
|
+
* (see `report-error.ts`), so one pasted id resolves in both.
|
|
3138
|
+
*
|
|
3136
3139
|
* Writes straight to `process.stderr` (not `Console`) for three reasons: the
|
|
3137
3140
|
* exit handler is synchronous, JSON mode patches the global console to no-ops —
|
|
3138
3141
|
* a diagnostic the user explicitly asked for must survive that — and stderr
|
|
@@ -3140,7 +3143,7 @@ const buildDebugTraceMessage = (traceId) => traceId === null ? "Sentry trace una
|
|
|
3140
3143
|
* a diagnostic must never throw out of an exit handler.
|
|
3141
3144
|
*/
|
|
3142
3145
|
const printDebugTrace = () => {
|
|
3143
|
-
if (!
|
|
3146
|
+
if (!isTelemetryEnabled()) return;
|
|
3144
3147
|
try {
|
|
3145
3148
|
process.stderr.write(`${highlighter.dim(buildDebugTraceMessage(getLastRunTraceId()))}\n`);
|
|
3146
3149
|
} catch {}
|
|
@@ -3478,7 +3481,7 @@ ${highlighter.dim("Learn more:")}
|
|
|
3478
3481
|
const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
|
|
3479
3482
|
const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[directory]", "project directory to scan", ".").option("--lint", "enable linting").option("--no-lint", "skip linting").option("--dead-code", "enable dead-code analysis (default)").option("--no-dead-code", "skip dead-code analysis (unused files / exports / dependencies, circular imports)").option("--supply-chain", "enable the dependency supply-chain scan (default)").option("--no-supply-chain", "skip the dependency supply-chain scan (Socket.dev dependency health checks)").option("--verbose", "show every rule and per-file details (default shows top 3 rules)").option("--debug", "force a Sentry trace and print its id at the end (paste it into a bug report)").option("--output-dir <dir>", "directory for the full diagnostics dump (default: a temp folder)").option("--score", "output only the score").option("--json", "output a single structured JSON report (suppresses other output)").option("--json-compact", "with --json, emit compact JSON (no indentation)").option("--json-out <path>", "with --json, write the report to a file instead of stdout").option("--no-cache", "disable all scan caches for this run").option("-y, --yes", "skip prompts, scan all workspace projects").option("--no-parallel", "lint serially with one worker (default: parallel across CPU cores; set the worker count with REACT_DOCTOR_PARALLEL)").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple); overrides the `projects` config field").option("--scope <value>", "how much supported JS/TS and inline HTML script source to scan/report: full (default), files, changed (only new issues vs base), or lines (issues whose source spans touch changed lines)").option("--base <ref>", "base git ref for files/changed/lines scope (auto-detected when omitted)").option("--include-untracked", "with --scope files/changed/lines, also scan ordinary untracked files (respects .gitignore)").addOption(new Option("--diff [base]", "[deprecated] alias for --scope changed (pass `false` to force a full scan)").hideHelp()).addOption(new Option("--changed-files-from <file>", "scan source files listed in a newline-delimited changed-files file").hideHelp()).option("--no-score", "skip the score API, the share URL, and crash reporting").addOption(new Option("--category <category>", "only show diagnostics in a category (repeatable; e.g. Security)").argParser(collectCategoryOption)).option("--no-telemetry", "alias for --no-score (skip the score API, share URL, and crash reporting)").option("--staged", "scan only staged (git index) files for pre-commit hooks (honors --project and config `projects`; exits 0 when nothing is staged)").option("--max-duration <seconds>", MAX_DURATION_OPTION_DESCRIPTION).option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").addOption(new Option("--fail-on <level>", "[deprecated] alias for --blocking <level>").hideHelp()).option("--no-respect-inline-disables", "audit mode: neutralize inline lint suppressions before scanning").option("--warnings", "show warning-severity diagnostics (default)").option("--no-warnings", "hide warning-severity diagnostics (errors only)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderRootHelpEpilog);
|
|
3480
3483
|
program.action(async (directory = ".", flags) => {
|
|
3481
|
-
const { runScanCommand } = await import("./scan-
|
|
3484
|
+
const { runScanCommand } = await import("./scan-D8DHxJxj.js");
|
|
3482
3485
|
return runScanCommand({
|
|
3483
3486
|
directory,
|
|
3484
3487
|
flags,
|
|
@@ -3486,72 +3489,72 @@ program.action(async (directory = ".", flags) => {
|
|
|
3486
3489
|
});
|
|
3487
3490
|
});
|
|
3488
3491
|
program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
|
|
3489
|
-
const { designAction } = await import("./design-
|
|
3492
|
+
const { designAction } = await import("./design-swBQC07N.js");
|
|
3490
3493
|
return designAction(directory ?? ".", command.optsWithGlobals());
|
|
3491
3494
|
});
|
|
3492
3495
|
program.command("why <location>").description("Explain why a rule fired (or why a suppression didn't apply) at a file:line").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple)").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (location, options) => {
|
|
3493
|
-
const { whyAction } = await import("./why-
|
|
3496
|
+
const { whyAction } = await import("./why-nfPQ3AAq.js");
|
|
3494
3497
|
return whyAction(location, options);
|
|
3495
3498
|
});
|
|
3496
3499
|
program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install native non-blocking agent hooks for Claude Code and Cursor").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderInstallHelpEpilog).action(async (options, command) => {
|
|
3497
|
-
const { installAction } = await import("./install-
|
|
3500
|
+
const { installAction } = await import("./install-CChowo4Z.js");
|
|
3498
3501
|
return installAction(options, command);
|
|
3499
3502
|
});
|
|
3500
3503
|
const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
|
|
3501
3504
|
const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
|
|
3502
3505
|
const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
|
|
3503
3506
|
ci.command("install").description("Add a CI workflow that scans every pull request").option(...providerOption).option(...prOption).option("--blocking <level>", "gate level: none (advisory, default), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed (default), files, lines, full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; use the defaults").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderCiHelpEpilog).action(async (_options, command) => {
|
|
3504
|
-
const { ciInstallAction } = await import("./ci-
|
|
3507
|
+
const { ciInstallAction } = await import("./ci-Cje97GMB.js");
|
|
3505
3508
|
return ciInstallAction(command.optsWithGlobals());
|
|
3506
3509
|
});
|
|
3507
3510
|
ci.command("config").description("Change the gate, scan scope, and pull-request reporting").option(...providerOption).option("--blocking <level>", "gate level: none (advisory), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed, files, lines, or full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; print the current settings").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3508
|
-
const { ciConfigAction } = await import("./ci-
|
|
3511
|
+
const { ciConfigAction } = await import("./ci-Cje97GMB.js");
|
|
3509
3512
|
return ciConfigAction(command.optsWithGlobals());
|
|
3510
3513
|
});
|
|
3511
3514
|
ci.command("upgrade").description("Upgrade the CI workflow to the action's current major").option(...providerOption).option(...prOption).option("-y, --yes", "skip prompts").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3512
|
-
const { ciUpgradeAction } = await import("./ci-
|
|
3515
|
+
const { ciUpgradeAction } = await import("./ci-Cje97GMB.js");
|
|
3513
3516
|
return ciUpgradeAction(command.optsWithGlobals());
|
|
3514
3517
|
});
|
|
3515
3518
|
program.command("version").description("show the version with Node and platform info").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async () => {
|
|
3516
|
-
const { versionAction } = await import("./version-
|
|
3519
|
+
const { versionAction } = await import("./version-CyVLelBf.js");
|
|
3517
3520
|
return versionAction();
|
|
3518
3521
|
});
|
|
3519
3522
|
const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
|
|
3520
3523
|
rules.command("list").description("List rules and the severity they run at under your config").option("--category <name>", "only show rules in a category (e.g. Performance)").option("--tag <name>", "only show rules with a tag (e.g. design, test-noise)").option("--framework <name>", "only show rules for a framework (e.g. global, nextjs)").option("--configured", "only show rules your config has changed from the default").option("--json", "output a structured JSON array").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (_options, command) => {
|
|
3521
|
-
const { rulesListAction } = await import("./rules-
|
|
3524
|
+
const { rulesListAction } = await import("./rules-BsYE5BBb.js");
|
|
3522
3525
|
return rulesListAction(command.optsWithGlobals());
|
|
3523
3526
|
});
|
|
3524
3527
|
rules.command("explain <rule>").description("Explain why a rule matters, its current severity, and how to configure it").option("--json", "output a structured JSON object").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3525
|
-
const { rulesExplainAction } = await import("./rules-
|
|
3528
|
+
const { rulesExplainAction } = await import("./rules-BsYE5BBb.js");
|
|
3526
3529
|
return rulesExplainAction(rule, command.optsWithGlobals());
|
|
3527
3530
|
});
|
|
3528
3531
|
rules.command("set <rule> <severity>").description("Set a rule's severity: off, warn, or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, severity, _options, command) => {
|
|
3529
|
-
const { rulesSetAction } = await import("./rules-
|
|
3532
|
+
const { rulesSetAction } = await import("./rules-BsYE5BBb.js");
|
|
3530
3533
|
return rulesSetAction(rule, severity, command.optsWithGlobals());
|
|
3531
3534
|
});
|
|
3532
3535
|
rules.command("enable <rule>").description("Enable a rule at its recommended severity (or pass --severity)").option("--severity <level>", "severity to enable at: warn or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3533
|
-
const { rulesEnableAction } = await import("./rules-
|
|
3536
|
+
const { rulesEnableAction } = await import("./rules-BsYE5BBb.js");
|
|
3534
3537
|
return rulesEnableAction(rule, command.optsWithGlobals());
|
|
3535
3538
|
});
|
|
3536
3539
|
rules.command("disable <rule>").description("Disable a rule so it never runs").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3537
|
-
const { rulesDisableAction } = await import("./rules-
|
|
3540
|
+
const { rulesDisableAction } = await import("./rules-BsYE5BBb.js");
|
|
3538
3541
|
return rulesDisableAction(rule, command.optsWithGlobals());
|
|
3539
3542
|
});
|
|
3540
3543
|
rules.command("category <category> <severity>").description("Set the severity for a whole category (off, warn, error)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (category, severity, _options, command) => {
|
|
3541
|
-
const { rulesCategoryAction } = await import("./rules-
|
|
3544
|
+
const { rulesCategoryAction } = await import("./rules-BsYE5BBb.js");
|
|
3542
3545
|
return rulesCategoryAction(category, severity, command.optsWithGlobals());
|
|
3543
3546
|
});
|
|
3544
3547
|
rules.command("ignore-tag <tag>").description("Skip a whole rule family by tag before linting (e.g. design)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3545
|
-
const { rulesIgnoreTagAction } = await import("./rules-
|
|
3548
|
+
const { rulesIgnoreTagAction } = await import("./rules-BsYE5BBb.js");
|
|
3546
3549
|
return rulesIgnoreTagAction(tag, command.optsWithGlobals());
|
|
3547
3550
|
});
|
|
3548
3551
|
rules.command("unignore-tag <tag>").description("Stop ignoring a tag previously skipped via ignore-tag").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3549
|
-
const { rulesUnignoreTagAction } = await import("./rules-
|
|
3552
|
+
const { rulesUnignoreTagAction } = await import("./rules-BsYE5BBb.js");
|
|
3550
3553
|
return rulesUnignoreTagAction(tag, command.optsWithGlobals());
|
|
3551
3554
|
});
|
|
3552
3555
|
program.command("experimental-lsp", { hidden: false }).description("[experimental] run the React Doctor language server over stdio (for editors)").allowUnknownOption().action(() => {});
|
|
3553
3556
|
program.command("experimental-tui [directory]", { hidden: true }).description("[experimental] interactive, scrollable scan report").option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").option("--no-dead-code", "skip dead-code analysis").option("--no-supply-chain", "skip the dependency supply-chain scan").option("--score", "only print the numeric score (for scripts and CI)").option("--no-score", "skip the score API, the share URL, and crash reporting").option("--no-cache", "disable all scan caches for this run").option("--max-duration <seconds>", MAX_DURATION_OPTION_DESCRIPTION).option("-p, --project <names>", "scan specific workspace projects (comma-separated, or *)").option("-y, --yes", "skip the project prompt and scan every discovered project").action(async (directory = ".", _localOptions, command) => {
|
|
3554
|
-
const { runScanCommand } = await import("./scan-
|
|
3557
|
+
const { runScanCommand } = await import("./scan-D8DHxJxj.js");
|
|
3555
3558
|
return runScanCommand({
|
|
3556
3559
|
directory,
|
|
3557
3560
|
flags: command.optsWithGlobals(),
|
|
@@ -3573,7 +3576,7 @@ if (process.argv.includes("-V") && !strippedArgv.includes("-V")) {
|
|
|
3573
3576
|
applyColorPreference(strippedArgv);
|
|
3574
3577
|
ensureWindowsUtf8Console();
|
|
3575
3578
|
const argv = normalizeHelpInvocation(strippedArgv, knownCommands);
|
|
3576
|
-
Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => program.parseAsync(argv)).then(() => flushSentry()).catch(async (error) => {
|
|
3579
|
+
Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => program.parseAsync(argv)).then(() => Promise.all([flushSentry(), shutdownTelemetry()])).catch(async (error) => {
|
|
3577
3580
|
const isUserError = isExpectedUserError(error);
|
|
3578
3581
|
const sentryEventId = isUserError ? void 0 : await reportErrorToSentry(error);
|
|
3579
3582
|
if (isJsonModeActive()) {
|
|
@@ -3590,4 +3593,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
3590
3593
|
export {};
|
|
3591
3594
|
|
|
3592
3595
|
//# sourceMappingURL=cli.js.map
|
|
3593
|
-
//# debugId=
|
|
3596
|
+
//# debugId=c779427c-ed7c-5be4-b123-73410d3af015
|
|
@@ -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]="2a141417-d7db-5490-8423-762a30d87cc3")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-BQapfOJX.js";
|
|
4
4
|
//#region src/cli/commands/design.ts
|
|
5
5
|
const designAction = async (directory, flags) => inspectAction(directory, {
|
|
6
6
|
...flags,
|
|
@@ -10,5 +10,5 @@ const designAction = async (directory, flags) => inspectAction(directory, {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { designAction };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=design-
|
|
14
|
-
//# debugId=
|
|
13
|
+
//# sourceMappingURL=design-swBQC07N.js.map
|
|
14
|
+
//# debugId=2a141417-d7db-5490-8423-762a30d87cc3
|
|
@@ -1,7 +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 {
|
|
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]="687f3e03-d984-5dc0-af33-8adb48745651")}catch(e){}}();
|
|
3
|
+
import { d as isJsonModeActive, m as writeJsonErrorReport } from "./record-metric-CuPtdZfm.js";
|
|
4
|
+
import { s as shutdownTelemetry } from "./unref-stdin-D0Lq28Bk.js";
|
|
5
|
+
import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, t as buildSectionDivider } from "./build-section-divider-BBuZ20p0.js";
|
|
5
6
|
//#region src/cli/utils/active-tui-renderer.ts
|
|
6
7
|
let activeTuiRenderer = null;
|
|
7
8
|
const registerActiveTuiRenderer = (renderer) => {
|
|
@@ -38,10 +39,10 @@ const exitGracefully = () => {
|
|
|
38
39
|
...buildFooterLinkLines({ shareUrl: null })
|
|
39
40
|
].join("\n"));
|
|
40
41
|
} catch {}
|
|
41
|
-
flushSentry().finally(() => process.exit(130));
|
|
42
|
+
Promise.all([flushSentry(), shutdownTelemetry()]).finally(() => process.exit(130));
|
|
42
43
|
};
|
|
43
44
|
//#endregion
|
|
44
45
|
export { registerActiveTuiRenderer as n, exitGracefully as t };
|
|
45
46
|
|
|
46
|
-
//# sourceMappingURL=exit-gracefully-
|
|
47
|
-
//# debugId=
|
|
47
|
+
//# sourceMappingURL=exit-gracefully-GZXxMj5W.js.map
|
|
48
|
+
//# debugId=687f3e03-d984-5dc0-af33-8adb48745651
|
package/dist/index.d.ts
CHANGED
|
@@ -10702,7 +10702,15 @@ interface JsonReportV3$1 extends Omit<JsonReportV1$1, "schemaVersion" | "project
|
|
|
10702
10702
|
diagnostics: JsonReportDiagnosticV3[];
|
|
10703
10703
|
}
|
|
10704
10704
|
type JsonReport = JsonReportV1$1 | JsonReportV2$1 | JsonReportV3$1; //#endregion
|
|
10705
|
-
//#region src/types/
|
|
10705
|
+
//#region src/types/observability.d.ts
|
|
10706
|
+
/**
|
|
10707
|
+
* Credentials and dataset routing for first-party Axiom telemetry.
|
|
10708
|
+
*
|
|
10709
|
+
* Core never reads these from the environment — the CLI owns the embedded
|
|
10710
|
+
* ingest token and passes it in. That keeps `@react-doctor/api` and any other
|
|
10711
|
+
* programmatic consumer silent by construction: a library that never supplies
|
|
10712
|
+
* options can never ship first-party telemetry.
|
|
10713
|
+
*/
|
|
10706
10714
|
//#endregion
|
|
10707
10715
|
//#region src/project-info/errors.d.ts
|
|
10708
10716
|
/**
|