react-doctor 0.9.9 → 0.9.10-dev.27a39de

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.
Files changed (28) hide show
  1. package/dist/{build-section-divider-rq_KQONI.js → build-section-divider-CNiJjeDe.js} +22 -103
  2. package/dist/{ci-BwCh-hUD.js → ci-CuWsakTj.js} +11 -11
  3. package/dist/cli.js +33 -30
  4. package/dist/{design-CTL1QpZB.js → design-BSKWQXBy.js} +4 -4
  5. package/dist/{exit-gracefully-C7wgCb-s.js → exit-gracefully-BclyGg_q.js} +7 -6
  6. package/dist/index.d.ts +9 -1
  7. package/dist/index.js +159 -159
  8. package/dist/{inspect-CGCfCxoM.js → inspect-BZx09uPZ.js} +16 -16
  9. package/dist/{install-CdlRGSxJ.js → install-ZWuhAWQE.js} +8 -8
  10. package/dist/{install-doctor-script-BEIl1lby.js → install-doctor-script-DmWC51TH.js} +4 -4
  11. package/dist/{install-github-workflow-Cun64Fxh.js → install-github-workflow-B_3-SNxE.js} +6 -6
  12. package/dist/{install-react-doctor-Bn-dP3rT.js → install-react-doctor-DNoeqkzq.js} +8 -8
  13. package/dist/lsp.js +2122 -327
  14. package/dist/{print-branded-header-C9de_0PE.js → print-branded-header-1rKTZeCu.js} +4 -4
  15. package/dist/{read-object-file-ClOsQUSD.js → read-object-file-qJl0_zQn.js} +4 -4
  16. package/dist/{record-metric-b5KUd2XK.js → record-metric-Cdqt5Ap3.js} +1654 -295
  17. package/dist/{report-error-DU6Bxy9R.js → report-error-CWdzTO39.js} +18 -12
  18. package/dist/{report-workflow-result-CjrL22OD.js → report-workflow-result-CPu88rum.js} +5 -5
  19. package/dist/{resolve-scope-pjSIB8ZY.js → resolve-scope-BsFLek-x.js} +6 -6
  20. package/dist/{rules-Ds2rHd-a.js → rules-Bo3Q3wQp.js} +6 -6
  21. package/dist/{run-scan-app-D8wBLuwl.js → run-scan-app-DJrqd1mR.js} +10 -10
  22. package/dist/{scan-CHh6DGmw.js → scan-Bg0iJFfk.js} +8 -8
  23. package/dist/{should-fail-scan-gate-Bif6gnI9.js → should-fail-scan-gate-BB_spOAA.js} +114 -192
  24. package/dist/{should-skip-prompts-Q3cS356Z.js → should-skip-prompts-CnukxPv0.js} +4 -4
  25. package/dist/{unref-stdin-DTLx8HEf.js → unref-stdin-Bsw57mR2.js} +112 -5
  26. package/dist/{version-BrAILQSv.js → version-CFaOM-r8.js} +4 -4
  27. package/dist/{why-DB_XpRpg.js → why-YX7k5are.js} +4 -4
  28. 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]="06e4b6f8-462c-50f8-b9dd-7090f8152dff")}catch(e){}}();
3
- import { D as SENTRY_FLUSH_TIMEOUT_MS, I as isDebugFlagEnabled, On as scrubSensitivePaths, U as CANONICAL_GITHUB_URL, X as DOCS_URL, en as highlighter, i as buildSentryScope, on as isPlainObject, yn as redactSensitiveText } from "./record-metric-b5KUd2XK.js";
4
- import { o as isExpectedUserError } from "./unref-stdin-DTLx8HEf.js";
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]="9694f280-1bfd-5ab7-8c94-8f971d7630bc")}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-Cdqt5Ap3.js";
4
+ import { c as isExpectedUserError } from "./unref-stdin-Bsw57mR2.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.9`;
74
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.10-dev.27a39de`;
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.9") ? "development" : "production");
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-dev.27a39de") ? "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
- * tracing. Invoked as the first statement of the CLI entry (`cli/index.ts`) so
180
- * the SDK's global `uncaughtException` / `unhandledRejection` handlers and OTel
181
- * auto-instrumentation are armed before any command runs.
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 || !shouldEnableSentry()) return;
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: resolvedTracesSampleRate,
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, isSentryTracingEnabled as o, activeScanAbortRegistry as r, buildSectionDivider as t };
228
+ export { initializeSentry as a, flushSentry as i, buildFooterLinkLines as n, activeScanAbortRegistry as r, buildSectionDivider as t };
310
229
 
311
- //# sourceMappingURL=build-section-divider-rq_KQONI.js.map
312
- //# debugId=06e4b6f8-462c-50f8-b9dd-7090f8152dff
230
+ //# sourceMappingURL=build-section-divider-CNiJjeDe.js.map
231
+ //# debugId=9694f280-1bfd-5ab7-8c94-8f971d7630bc
@@ -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]="f3e38226-c677-554f-843a-df9d0b3fec5a")}catch(e){}}();
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]="e0364d26-3958-5247-bbf8-5f77b6e41a6e")}catch(e){}}();
3
3
  import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.js";
4
- import { W as CI_URL, Yn as runSync, en as highlighter, et as GITHUB_ACTIONS_SETUP_URL, t as recordCount, y as METRIC } from "./record-metric-b5KUd2XK.js";
5
- import { o as isExpectedUserError } from "./unref-stdin-DTLx8HEf.js";
6
- import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-DU6Bxy9R.js";
7
- import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-BEIl1lby.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-Cun64Fxh.js";
9
- import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-pjSIB8ZY.js";
10
- import { t as shouldSkipPrompts } from "./should-skip-prompts-Q3cS356Z.js";
11
- import { t as printBrandedHeader } from "./print-branded-header-C9de_0PE.js";
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-Cdqt5Ap3.js";
5
+ import { c as isExpectedUserError } from "./unref-stdin-Bsw57mR2.js";
6
+ import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-CWdzTO39.js";
7
+ import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-DmWC51TH.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-B_3-SNxE.js";
9
+ import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-BsFLek-x.js";
10
+ import { t as shouldSkipPrompts } from "./should-skip-prompts-CnukxPv0.js";
11
+ import { t as printBrandedHeader } from "./print-branded-header-1rKTZeCu.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-BwCh-hUD.js.map
7501
- //# debugId=f3e38226-c677-554f-843a-df9d0b3fec5a
7500
+ //# sourceMappingURL=ci-CuWsakTj.js.map
7501
+ //# debugId=e0364d26-3958-5247-bbf8-5f77b6e41a6e
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]="d2821496-7d1e-5e21-b186-142795117cf0")}catch(e){}}();
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 { I as isDebugFlagEnabled, N as CliInputError, U as CANONICAL_GITHUB_URL, W as CI_URL, en as highlighter, f as writeJsonErrorReport, kn as setColorEnabled, l as isJsonModeActive, m as VERSION } from "./record-metric-b5KUd2XK.js";
5
- import { a as initializeSentry, i as flushSentry } from "./build-section-divider-rq_KQONI.js";
6
- import { o as isExpectedUserError, r as getLastRunTraceId, t as unrefStdin } from "./unref-stdin-DTLx8HEf.js";
7
- import { t as exitGracefully } from "./exit-gracefully-C7wgCb-s.js";
8
- import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-DU6Bxy9R.js";
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-Cdqt5Ap3.js";
5
+ import { c as isExpectedUserError, r as getLastRunTraceId, s as shutdownTelemetry, t as unrefStdin } from "./unref-stdin-Bsw57mR2.js";
6
+ import { a as initializeSentry, i as flushSentry } from "./build-section-divider-CNiJjeDe.js";
7
+ import { t as exitGracefully } from "./exit-gracefully-BclyGg_q.js";
8
+ import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-CWdzTO39.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 the Sentry SDK.
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 ? "Sentry trace unavailable for this run (no trace was recorded)." : `Sentry trace (mention this when reporting): ${traceId}`;
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 Sentry trace id to stderr at the end of a `--debug` run, so
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 (!Sentry.isInitialized()) return;
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-CHh6DGmw.js");
3484
+ const { runScanCommand } = await import("./scan-Bg0iJFfk.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-CTL1QpZB.js");
3492
+ const { designAction } = await import("./design-BSKWQXBy.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-DB_XpRpg.js");
3496
+ const { whyAction } = await import("./why-YX7k5are.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-CdlRGSxJ.js");
3500
+ const { installAction } = await import("./install-ZWuhAWQE.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-BwCh-hUD.js");
3507
+ const { ciInstallAction } = await import("./ci-CuWsakTj.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-BwCh-hUD.js");
3511
+ const { ciConfigAction } = await import("./ci-CuWsakTj.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-BwCh-hUD.js");
3515
+ const { ciUpgradeAction } = await import("./ci-CuWsakTj.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-BrAILQSv.js");
3519
+ const { versionAction } = await import("./version-CFaOM-r8.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-Ds2rHd-a.js");
3524
+ const { rulesListAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3528
+ const { rulesExplainAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3532
+ const { rulesSetAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3536
+ const { rulesEnableAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3540
+ const { rulesDisableAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3544
+ const { rulesCategoryAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3548
+ const { rulesIgnoreTagAction } = await import("./rules-Bo3Q3wQp.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-Ds2rHd-a.js");
3552
+ const { rulesUnignoreTagAction } = await import("./rules-Bo3Q3wQp.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-CHh6DGmw.js");
3557
+ const { runScanCommand } = await import("./scan-Bg0iJFfk.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=d2821496-7d1e-5e21-b186-142795117cf0
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]="89da1a3f-5d17-5b6a-99ab-4f497068de70")}catch(e){}}();
3
- import { t as inspectAction } from "./inspect-CGCfCxoM.js";
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]="33eb7883-e873-5885-9904-ce3acaa878a4")}catch(e){}}();
3
+ import { t as inspectAction } from "./inspect-BZx09uPZ.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-CTL1QpZB.js.map
14
- //# debugId=89da1a3f-5d17-5b6a-99ab-4f497068de70
13
+ //# sourceMappingURL=design-BSKWQXBy.js.map
14
+ //# debugId=33eb7883-e873-5885-9904-ce3acaa878a4
@@ -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]="1160a1f2-8174-5ea6-850e-b13a5c9aadc8")}catch(e){}}();
3
- import { f as writeJsonErrorReport, l as isJsonModeActive } from "./record-metric-b5KUd2XK.js";
4
- import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, t as buildSectionDivider } from "./build-section-divider-rq_KQONI.js";
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]="de426cb6-a397-50ab-938c-11633ef12251")}catch(e){}}();
3
+ import { d as isJsonModeActive, m as writeJsonErrorReport } from "./record-metric-Cdqt5Ap3.js";
4
+ import { s as shutdownTelemetry } from "./unref-stdin-Bsw57mR2.js";
5
+ import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, t as buildSectionDivider } from "./build-section-divider-CNiJjeDe.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-C7wgCb-s.js.map
47
- //# debugId=1160a1f2-8174-5ea6-850e-b13a5c9aadc8
47
+ //# sourceMappingURL=exit-gracefully-BclyGg_q.js.map
48
+ //# debugId=de426cb6-a397-50ab-938c-11633ef12251
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/prompts.d.ts
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
  /**