react-doctor 0.9.12-dev.e183c35 → 0.9.12-dev.e1d4c51

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 (34) hide show
  1. package/dist/{build-section-divider-D2kON1gx.js → build-section-divider-BTksty2F.js} +7 -7
  2. package/dist/{ci-BDF4MCw4.js → ci-BkLZiDUN.js} +12 -12
  3. package/dist/cli.js +28 -27
  4. package/dist/{design-5z-_ATHh.js → design-C4t3qkuV.js} +4 -4
  5. package/dist/{exit-gracefully-D-9LC4_A.js → exit-gracefully-LlCvoAEm.js} +6 -6
  6. package/dist/{handle-error-CiH-zHAJ.js → handle-error-Ddm9numu.js} +17 -12
  7. package/dist/index.js +429 -256
  8. package/dist/{inspect-UlnsYEF7.js → inspect-RhrLJRiS.js} +16 -16
  9. package/dist/{install-D3ZEk4sy.js → install-D0M10gBH.js} +9 -9
  10. package/dist/{install-doctor-script-B7P7AJly.js → install-doctor-script-DMNgSbdq.js} +6 -13
  11. package/dist/{install-github-workflow-CfSmkFY0.js → install-github-workflow-C-kf3m11.js} +9 -5
  12. package/dist/{install-react-doctor-B2nUFSke.js → install-react-doctor-CVkqg6sQ.js} +8 -8
  13. package/dist/{jsx-runtime-COe_zui7.js → jsx-runtime-BKEvU07J.js} +5 -5
  14. package/dist/{print-branded-header-DWWSXUyB.js → print-branded-header-s2p-5716.js} +4 -4
  15. package/dist/project-analysis-worker.js +53 -52
  16. package/dist/{prompt-runtime-scan-url-B2VI0Xh9.js → prompt-runtime-scan-url-BJ7B_PCN.js} +5 -5
  17. package/dist/{read-object-file-BmbCMY0Q.js → read-object-file-CnjSaQ9e.js} +4 -4
  18. package/dist/{record-metric-BMWbP8MZ.js → record-metric-C4PUVqp5.js} +375 -201
  19. package/dist/{report-error-6PgTfB1z.js → report-error-FYj7f2vY.js} +5 -5
  20. package/dist/{report-workflow-result-BGcNuwxL.js → report-workflow-result-SdoKQB6n.js} +5 -5
  21. package/dist/{resolve-scope-Bq-uMX-y.js → resolve-scope-ClRg-hd_.js} +6 -6
  22. package/dist/{rules-Cw83jL1c.js → rules-DsN5blEA.js} +6 -6
  23. package/dist/{run-scan-app-CR-bq134.js → run-scan-app-DAO9UeQe.js} +16 -14
  24. package/dist/{runtime-scan-C0Sq0Vsq.js → runtime-scan-n5_rAxCK.js} +9 -9
  25. package/dist/{sanitize-runtime-url-B2iNA5hC.js → sanitize-runtime-url-SX3WyFw4.js} +4 -4
  26. package/dist/{scan-BfuDcKtg.js → scan-3K6Kfp4M.js} +9 -9
  27. package/dist/{should-fail-scan-gate-CGmZKFSQ.js → should-fail-scan-gate-JUANMKVz.js} +11 -11
  28. package/dist/{should-skip-prompts-K3hVW95X.js → should-skip-prompts-DfUwV_qr.js} +4 -4
  29. package/dist/{should-use-tui-Clt-_eNL.js → should-use-tui-DqqNLLQH.js} +4 -4
  30. package/dist/{telemetry-runtime-Cix2Ie97.js → telemetry-runtime-BQjl1WJM.js} +55 -7
  31. package/dist/{version-D3IeIvrP.js → version-CJ_V_OjY.js} +4 -4
  32. package/dist/{why-vS83AKil.js → why-eB_2sMXA.js} +4 -4
  33. package/dist/{with-run-span-DuqJWpuS.js → with-run-span-CCR0PglL.js} +5 -5
  34. package/package.json +5 -4
@@ -1,7 +1,7 @@
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]="1b1cd9c6-c97b-527e-87ad-933fabbb08d7")}catch(e){}}();
3
- import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-BMWbP8MZ.js";
4
- import { r as isExpectedUserError } from "./telemetry-runtime-Cix2Ie97.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]="99ccb1e4-f2eb-559a-b678-db3dc6227e36")}catch(e){}}();
3
+ import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-C4PUVqp5.js";
4
+ import { r as isExpectedUserError } from "./telemetry-runtime-BQjl1WJM.js";
5
5
  import * as Sentry from "@sentry/node";
6
6
  //#region src/cli/utils/scrub-sentry-event.ts
7
7
  /**
@@ -70,13 +70,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
70
70
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
71
71
  * standard `SENTRY_RELEASE` override.
72
72
  */
73
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.12-dev.e183c35`;
73
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.12-dev.e1d4c51`;
74
74
  /**
75
75
  * Deployment environment shown in Sentry's environment filter. Defaults to
76
76
  * `production` for tagged releases and `development` for dev/unbuilt versions,
77
77
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
78
78
  */
79
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.12-dev.e183c35") ? "development" : "production");
79
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.12-dev.e1d4c51") ? "development" : "production");
80
80
  //#endregion
81
81
  //#region src/instrument.ts
82
82
  let isInitialized = false;
@@ -212,5 +212,5 @@ const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repe
212
212
  //#endregion
213
213
  export { initializeSentry as i, buildFooterLinkLines as n, flushSentry as r, buildSectionDivider as t };
214
214
 
215
- //# sourceMappingURL=build-section-divider-D2kON1gx.js.map
216
- //# debugId=1b1cd9c6-c97b-527e-87ad-933fabbb08d7
215
+ //# sourceMappingURL=build-section-divider-BTksty2F.js.map
216
+ //# debugId=99ccb1e4-f2eb-559a-b678-db3dc6227e36
@@ -1,15 +1,15 @@
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]="e9c77810-10a8-5f2a-a697-7bb400fbc468")}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]="7bfddff1-e38a-57be-9bfd-bde4013a5acb")}catch(e){}}();
3
3
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
4
- import { Kt as highlighter, T as METRIC, cr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, tr as CI_URL, zn as runSync } from "./record-metric-BMWbP8MZ.js";
5
- import { r as isExpectedUserError } from "./telemetry-runtime-Cix2Ie97.js";
6
- import { n as handleUserError, t as handleError } from "./handle-error-CiH-zHAJ.js";
7
- import { t as reportErrorToSentry } from "./report-error-6PgTfB1z.js";
8
- import { N as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-B7P7AJly.js";
9
- 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-CfSmkFY0.js";
10
- import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-Bq-uMX-y.js";
11
- import { t as shouldSkipPrompts } from "./should-skip-prompts-K3hVW95X.js";
12
- import { t as printBrandedHeader } from "./print-branded-header-DWWSXUyB.js";
4
+ import { Kt as highlighter, T as METRIC, cr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, tr as CI_URL, zn as runSync } from "./record-metric-C4PUVqp5.js";
5
+ import { r as isExpectedUserError } from "./telemetry-runtime-BQjl1WJM.js";
6
+ import { n as handleUserError, t as handleError } from "./handle-error-Ddm9numu.js";
7
+ import { t as reportErrorToSentry } from "./report-error-FYj7f2vY.js";
8
+ import { M as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-DMNgSbdq.js";
9
+ 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-C-kf3m11.js";
10
+ import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-ClRg-hd_.js";
11
+ import { t as shouldSkipPrompts } from "./should-skip-prompts-DfUwV_qr.js";
12
+ import { t as printBrandedHeader } from "./print-branded-header-s2p-5716.js";
13
13
  import * as path$1 from "node:path";
14
14
  import * as fs$1 from "node:fs";
15
15
  //#region src/cli/utils/ci/ci-provider.ts
@@ -7498,5 +7498,5 @@ const ciConfigAction = (options) => runCiCommand("config", runCiConfig, options)
7498
7498
  //#endregion
7499
7499
  export { ciConfigAction, ciInstallAction, ciUpgradeAction };
7500
7500
 
7501
- //# sourceMappingURL=ci-BDF4MCw4.js.map
7502
- //# debugId=e9c77810-10a8-5f2a-a697-7bb400fbc468
7501
+ //# sourceMappingURL=ci-BkLZiDUN.js.map
7502
+ //# debugId=7bfddff1-e38a-57be-9bfd-bde4013a5acb
package/dist/cli.js CHANGED
@@ -1,13 +1,13 @@
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]="060d9fda-090f-56c0-a01c-3ce99371376f")}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]="f42b1a1f-3941-5a61-bf1b-ea87400b9ec6")}catch(e){}}();
3
3
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
4
- import { H as isDebugFlagEnabled, Kt as highlighter, _ as VERSION, d as isJsonModeActive, er as CANONICAL_GITHUB_URL, gn as setColorEnabled, h as writeJsonErrorReport, i as isTelemetryEnabled, tr as CI_URL, z as CliInputError } from "./record-metric-BMWbP8MZ.js";
5
- import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-Cix2Ie97.js";
6
- import { i as initializeSentry, r as flushSentry } from "./build-section-divider-D2kON1gx.js";
7
- import { t as exitGracefully } from "./exit-gracefully-D-9LC4_A.js";
8
- import { n as handleUserError, t as handleError } from "./handle-error-CiH-zHAJ.js";
4
+ import { H as isDebugFlagEnabled, Kt as highlighter, _ as VERSION, d as isJsonModeActive, er as CANONICAL_GITHUB_URL, gn as setColorEnabled, h as writeJsonErrorReport, i as isTelemetryEnabled, tr as CI_URL, z as CliInputError } from "./record-metric-C4PUVqp5.js";
5
+ import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-BQjl1WJM.js";
6
+ import { i as initializeSentry, r as flushSentry } from "./build-section-divider-BTksty2F.js";
7
+ import { t as exitGracefully } from "./exit-gracefully-LlCvoAEm.js";
8
+ import { n as handleUserError, t as handleError } from "./handle-error-Ddm9numu.js";
9
9
  import { n as getLastRunTraceId } from "./active-run-trace-dlIZeEvb.js";
10
- import { t as reportErrorToSentry } from "./report-error-6PgTfB1z.js";
10
+ import { t as reportErrorToSentry } from "./report-error-FYj7f2vY.js";
11
11
  import { t as unrefStdin } from "./unref-stdin-BKT_s38a.js";
12
12
  import { execFileSync } from "node:child_process";
13
13
  //#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
@@ -3529,7 +3529,7 @@ ${highlighter.dim("Learn more:")}
3529
3529
  const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
3530
3530
  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").addOption(new Option("--dead-code").hideHelp()).addOption(new Option("--no-dead-code").hideHelp()).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);
3531
3531
  program.action(async (directory = ".", flags) => {
3532
- const { runScanCommand } = await import("./scan-BfuDcKtg.js");
3532
+ const { runScanCommand } = await import("./scan-3K6Kfp4M.js");
3533
3533
  return runScanCommand({
3534
3534
  directory,
3535
3535
  flags,
@@ -3537,75 +3537,75 @@ program.action(async (directory = ".", flags) => {
3537
3537
  });
3538
3538
  });
3539
3539
  program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
3540
- const { designAction } = await import("./design-5z-_ATHh.js");
3540
+ const { designAction } = await import("./design-C4t3qkuV.js");
3541
3541
  return designAction(directory ?? ".", command.optsWithGlobals());
3542
3542
  });
3543
3543
  program.command("scan").description("Scan a React interaction in Chrome until you press Enter").argument("[url]", "HTTP(S) URL of the running React app; detects local apps when omitted").option("-f, --format <format>", "report format: text, json, or jsonl", "text").option("--cdp <url>", "reuse Chrome at this remote-debugging endpoint").option("--trace-out <path>", "save the compressed .json.gz DevTools trace at this path").addHelpText("after", renderRuntimeScanHelpEpilog).action(async (url, options) => {
3544
- const { runtimeScanAction } = await import("./runtime-scan-C0Sq0Vsq.js");
3544
+ const { runtimeScanAction } = await import("./runtime-scan-n5_rAxCK.js");
3545
3545
  return runtimeScanAction(url, options);
3546
3546
  });
3547
3547
  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) => {
3548
- const { whyAction } = await import("./why-vS83AKil.js");
3548
+ const { whyAction } = await import("./why-eB_2sMXA.js");
3549
3549
  return whyAction(location, options);
3550
3550
  });
3551
3551
  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 end-of-turn 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) => {
3552
- const { installAction } = await import("./install-D3ZEk4sy.js");
3552
+ const { installAction } = await import("./install-D0M10gBH.js");
3553
3553
  return installAction(options, command);
3554
3554
  });
3555
3555
  const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
3556
3556
  const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
3557
3557
  const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
3558
3558
  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) => {
3559
- const { ciInstallAction } = await import("./ci-BDF4MCw4.js");
3559
+ const { ciInstallAction } = await import("./ci-BkLZiDUN.js");
3560
3560
  return ciInstallAction(command.optsWithGlobals());
3561
3561
  });
3562
3562
  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) => {
3563
- const { ciConfigAction } = await import("./ci-BDF4MCw4.js");
3563
+ const { ciConfigAction } = await import("./ci-BkLZiDUN.js");
3564
3564
  return ciConfigAction(command.optsWithGlobals());
3565
3565
  });
3566
3566
  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) => {
3567
- const { ciUpgradeAction } = await import("./ci-BDF4MCw4.js");
3567
+ const { ciUpgradeAction } = await import("./ci-BkLZiDUN.js");
3568
3568
  return ciUpgradeAction(command.optsWithGlobals());
3569
3569
  });
3570
3570
  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 () => {
3571
- const { versionAction } = await import("./version-D3IeIvrP.js");
3571
+ const { versionAction } = await import("./version-CJ_V_OjY.js");
3572
3572
  return versionAction();
3573
3573
  });
3574
3574
  const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
3575
3575
  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) => {
3576
- const { rulesListAction } = await import("./rules-Cw83jL1c.js");
3576
+ const { rulesListAction } = await import("./rules-DsN5blEA.js");
3577
3577
  return rulesListAction(command.optsWithGlobals());
3578
3578
  });
3579
3579
  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) => {
3580
- const { rulesExplainAction } = await import("./rules-Cw83jL1c.js");
3580
+ const { rulesExplainAction } = await import("./rules-DsN5blEA.js");
3581
3581
  return rulesExplainAction(rule, command.optsWithGlobals());
3582
3582
  });
3583
3583
  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) => {
3584
- const { rulesSetAction } = await import("./rules-Cw83jL1c.js");
3584
+ const { rulesSetAction } = await import("./rules-DsN5blEA.js");
3585
3585
  return rulesSetAction(rule, severity, command.optsWithGlobals());
3586
3586
  });
3587
3587
  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) => {
3588
- const { rulesEnableAction } = await import("./rules-Cw83jL1c.js");
3588
+ const { rulesEnableAction } = await import("./rules-DsN5blEA.js");
3589
3589
  return rulesEnableAction(rule, command.optsWithGlobals());
3590
3590
  });
3591
3591
  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) => {
3592
- const { rulesDisableAction } = await import("./rules-Cw83jL1c.js");
3592
+ const { rulesDisableAction } = await import("./rules-DsN5blEA.js");
3593
3593
  return rulesDisableAction(rule, command.optsWithGlobals());
3594
3594
  });
3595
3595
  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) => {
3596
- const { rulesCategoryAction } = await import("./rules-Cw83jL1c.js");
3596
+ const { rulesCategoryAction } = await import("./rules-DsN5blEA.js");
3597
3597
  return rulesCategoryAction(category, severity, command.optsWithGlobals());
3598
3598
  });
3599
3599
  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) => {
3600
- const { rulesIgnoreTagAction } = await import("./rules-Cw83jL1c.js");
3600
+ const { rulesIgnoreTagAction } = await import("./rules-DsN5blEA.js");
3601
3601
  return rulesIgnoreTagAction(tag, command.optsWithGlobals());
3602
3602
  });
3603
3603
  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) => {
3604
- const { rulesUnignoreTagAction } = await import("./rules-Cw83jL1c.js");
3604
+ const { rulesUnignoreTagAction } = await import("./rules-DsN5blEA.js");
3605
3605
  return rulesUnignoreTagAction(tag, command.optsWithGlobals());
3606
3606
  });
3607
3607
  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)").addOption(new Option("--no-dead-code").hideHelp()).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) => {
3608
- const { runScanCommand } = await import("./scan-BfuDcKtg.js");
3608
+ const { runScanCommand } = await import("./scan-3K6Kfp4M.js");
3609
3609
  return runScanCommand({
3610
3610
  directory,
3611
3611
  flags: command.optsWithGlobals(),
@@ -3635,7 +3635,8 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
3635
3635
  process.exit(1);
3636
3636
  }
3637
3637
  if (isUserError) {
3638
- handleUserError(error);
3638
+ handleUserError(error, { shouldExit: false });
3639
+ await Promise.all([flushSentry(), shutdownTelemetry()]);
3639
3640
  return;
3640
3641
  }
3641
3642
  handleError(error, { sentryEventId });
@@ -3644,4 +3645,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
3644
3645
  export {};
3645
3646
 
3646
3647
  //# sourceMappingURL=cli.js.map
3647
- //# debugId=060d9fda-090f-56c0-a01c-3ce99371376f
3648
+ //# debugId=f42b1a1f-3941-5a61-bf1b-ea87400b9ec6
@@ -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]="fe0a3178-d42b-5fd4-96d1-a37d26c97c6b")}catch(e){}}();
3
- import { t as inspectAction } from "./inspect-UlnsYEF7.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]="67f51b65-e710-5bed-91d0-11fa45a8ff25")}catch(e){}}();
3
+ import { t as inspectAction } from "./inspect-RhrLJRiS.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-5z-_ATHh.js.map
14
- //# debugId=fe0a3178-d42b-5fd4-96d1-a37d26c97c6b
13
+ //# sourceMappingURL=design-C4t3qkuV.js.map
14
+ //# debugId=67f51b65-e710-5bed-91d0-11fa45a8ff25
@@ -1,8 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="10fe0b4b-43e7-54f5-90b8-a65125da197e")}catch(e){}}();
3
- import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-BMWbP8MZ.js";
4
- import { n as shutdownTelemetry } from "./telemetry-runtime-Cix2Ie97.js";
5
- import { n as buildFooterLinkLines, r as flushSentry, t as buildSectionDivider } from "./build-section-divider-D2kON1gx.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]="b812b813-056b-5f00-bfaf-5517954f098a")}catch(e){}}();
3
+ import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-C4PUVqp5.js";
4
+ import { n as shutdownTelemetry } from "./telemetry-runtime-BQjl1WJM.js";
5
+ import { n as buildFooterLinkLines, r as flushSentry, t as buildSectionDivider } from "./build-section-divider-BTksty2F.js";
6
6
  import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-DwG6tSPy.js";
7
7
  //#region src/cli/utils/active-tui-renderer.ts
8
8
  let activeTuiRenderer = null;
@@ -50,5 +50,5 @@ const exitGracefully = () => {
50
50
  //#endregion
51
51
  export { registerActiveTuiRenderer as n, exitGracefully as t };
52
52
 
53
- //# sourceMappingURL=exit-gracefully-D-9LC4_A.js.map
54
- //# debugId=10fe0b4b-43e7-54f5-90b8-a65125da197e
53
+ //# sourceMappingURL=exit-gracefully-LlCvoAEm.js.map
54
+ //# debugId=b812b813-056b-5f00-bfaf-5517954f098a
@@ -1,7 +1,7 @@
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]="cffa3e8d-52f9-5f99-9686-e1e103e4ad6f")}catch(e){}}();
3
- import { $n as CANONICAL_DISCORD_URL, An as gen, Cn as error, Ft as formatErrorChain, It as formatReactDoctorError, Kt as highlighter, T as METRIC, Xt as isReactDoctorError, _ as VERSION, br as isErrnoException, er as CANONICAL_GITHUB_URL, t as recordCount, zn as runSync } from "./record-metric-BMWbP8MZ.js";
4
- import { a as isEnvironmentError, i as formatEnvironmentError } from "./telemetry-runtime-Cix2Ie97.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]="efd5006b-2098-5c82-bbcd-70777ac9ab39")}catch(e){}}();
3
+ import { $n as CANONICAL_DISCORD_URL, An as gen, Cn as error, Ft as formatErrorChain, It as formatReactDoctorError, Kt as highlighter, T as METRIC, Xt as isReactDoctorError, _ as VERSION, br as isErrnoException, er as CANONICAL_GITHUB_URL, t as recordCount, zn as runSync } from "./record-metric-C4PUVqp5.js";
4
+ import { a as isNpmCacheCorruptionError, i as formatNpmCacheCorruptionError, o as formatEnvironmentError, s as isEnvironmentError } from "./telemetry-runtime-BQjl1WJM.js";
5
5
  //#region src/cli/utils/handle-error.ts
6
6
  const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
7
7
  const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
@@ -85,15 +85,20 @@ const handleError = (error, options = {}) => {
85
85
  };
86
86
  /**
87
87
  * Renderer for expected, user-actionable failures — a bad `--diff` value,
88
- * a base branch that isn't fetched, or environment errors like disk-full or
89
- * permission-denied. Prints just the (already human-readable) message — no
90
- * "Something went wrong", prefilled issue, Discord link, or Sentry reference
91
- * — because there is no bug to report.
88
+ * a base branch that isn't fetched, environment errors like disk-full or
89
+ * permission-denied, or npm cache corruption. Prints just the (already
90
+ * human-readable) message — no "Something went wrong", prefilled issue,
91
+ * Discord link, or Sentry reference — because there is no bug to report.
92
92
  */
93
93
  const handleUserError = (error$1, options = {}) => {
94
- const isEnvError = isEnvironmentError(error$1);
95
- if (isEnvError) recordCount(METRIC.cliEnvironmentError, 1, { code: (isErrnoException(error$1) ? error$1.code : void 0) ?? "unknown" });
96
- const message = isEnvError ? formatEnvironmentError(error$1) : formatErrorForReport(error$1);
94
+ let message = formatErrorForReport(error$1);
95
+ if (isNpmCacheCorruptionError(error$1)) {
96
+ recordCount(METRIC.cliEnvironmentError, 1, { code: "NPX_CACHE_CORRUPTION" });
97
+ message = formatNpmCacheCorruptionError(error$1);
98
+ } else if (isEnvironmentError(error$1)) {
99
+ recordCount(METRIC.cliEnvironmentError, 1, { code: (isErrnoException(error$1) ? error$1.code : void 0) ?? "unknown" });
100
+ message = formatEnvironmentError(error$1);
101
+ }
97
102
  runSync(gen(function* () {
98
103
  yield* error("");
99
104
  yield* error(highlighter.error(message));
@@ -105,5 +110,5 @@ const handleUserError = (error$1, options = {}) => {
105
110
  //#endregion
106
111
  export { handleUserError as n, handleError as t };
107
112
 
108
- //# sourceMappingURL=handle-error-CiH-zHAJ.js.map
109
- //# debugId=cffa3e8d-52f9-5f99-9686-e1e103e4ad6f
113
+ //# sourceMappingURL=handle-error-Ddm9numu.js.map
114
+ //# debugId=efd5006b-2098-5c82-bbcd-70777ac9ab39