react-doctor 0.9.10-dev.3bb84fb → 0.9.11-dev.51e198d

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 (27) hide show
  1. package/dist/{build-section-divider-B8hqp04D.js → build-section-divider-Ddw_uug8.js} +7 -7
  2. package/dist/{ci-Dk3DstBG.js → ci-BMegSONn.js} +11 -11
  3. package/dist/cli.js +22 -22
  4. package/dist/{design-Bq-3HXBZ.js → design-BqM5xXaq.js} +4 -4
  5. package/dist/{exit-gracefully-BDgtmBn-.js → exit-gracefully-BUlwv_l9.js} +6 -6
  6. package/dist/index.js +120 -21
  7. package/dist/{inspect-DME2yAzQ.js → inspect-C62I4cFt.js} +15 -15
  8. package/dist/{install-C_qBGcAr.js → install-YaBPQ5oC.js} +8 -8
  9. package/dist/{install-doctor-script-jDURjqWD.js → install-doctor-script-DifzK4IZ.js} +4 -4
  10. package/dist/{install-github-workflow-CVmKpHzY.js → install-github-workflow-BVbQtP5c.js} +6 -6
  11. package/dist/{install-react-doctor-BVWAJ5wa.js → install-react-doctor-Cs1XhzJD.js} +8 -8
  12. package/dist/lsp.js +25 -18
  13. package/dist/{print-branded-header-BdWqKeOv.js → print-branded-header-DnpzuUUq.js} +4 -4
  14. package/dist/{read-object-file-DDgbCE22.js → read-object-file-7s-GWT1i.js} +4 -4
  15. package/dist/{record-metric-DYu6AVaU.js → record-metric-BH7YPKl_.js} +46 -27
  16. package/dist/{report-error-CN1TnQFY.js → report-error-Cks5Vt1h.js} +5 -5
  17. package/dist/{report-workflow-result-B3mNTNry.js → report-workflow-result-wfb2YgOE.js} +5 -5
  18. package/dist/{resolve-scope-CFcIJ6wu.js → resolve-scope-BSCzz3j5.js} +6 -6
  19. package/dist/{rules-C1Q8Eeih.js → rules-DLYMq5Gc.js} +6 -6
  20. package/dist/{run-scan-app-BtiEbRGX.js → run-scan-app-UKpzUV72.js} +10 -10
  21. package/dist/{scan-Dqlls0Ah.js → scan-BA_uaWDP.js} +8 -8
  22. package/dist/{should-fail-scan-gate-BwQnt3yQ.js → should-fail-scan-gate-DL4gKSfD.js} +10 -10
  23. package/dist/{should-skip-prompts-CQuGlo68.js → should-skip-prompts-DZTNlJ_P.js} +4 -4
  24. package/dist/{unref-stdin-WVB8gYib.js → unref-stdin-hgpAG4XZ.js} +4 -4
  25. package/dist/{version-BE2SrOFP.js → version-CZPNYOny.js} +4 -4
  26. package/dist/{why-8fJcz5q1.js → why-io73cU0Q.js} +4 -4
  27. package/package.json +7 -7
@@ -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]="9656acc6-bbcf-502b-bcee-80c850b2f1b3")}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-DYu6AVaU.js";
4
- import { c as isExpectedUserError } from "./unref-stdin-WVB8gYib.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]="f4be7df5-6f4c-5088-a34d-d253495d5aff")}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-BH7YPKl_.js";
4
+ import { c as isExpectedUserError } from "./unref-stdin-hgpAG4XZ.js";
5
5
  import * as Sentry from "@sentry/node";
6
6
  //#region src/cli/utils/scrub-sentry-event.ts
7
7
  /**
@@ -71,13 +71,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
71
71
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
72
72
  * standard `SENTRY_RELEASE` override.
73
73
  */
74
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.10-dev.3bb84fb`;
74
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.11-dev.51e198d`;
75
75
  /**
76
76
  * Deployment environment shown in Sentry's environment filter. Defaults to
77
77
  * `production` for tagged releases and `development` for dev/unbuilt versions,
78
78
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
79
79
  */
80
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.10-dev.3bb84fb") ? "development" : "production");
80
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.11-dev.51e198d") ? "development" : "production");
81
81
  //#endregion
82
82
  //#region src/instrument.ts
83
83
  let isInitialized = false;
@@ -227,5 +227,5 @@ const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repe
227
227
  //#endregion
228
228
  export { initializeSentry as a, flushSentry as i, buildFooterLinkLines as n, activeScanAbortRegistry as r, buildSectionDivider as t };
229
229
 
230
- //# sourceMappingURL=build-section-divider-B8hqp04D.js.map
231
- //# debugId=9656acc6-bbcf-502b-bcee-80c850b2f1b3
230
+ //# sourceMappingURL=build-section-divider-Ddw_uug8.js.map
231
+ //# debugId=f4be7df5-6f4c-5088-a34d-d253495d5aff
@@ -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]="00b94877-7ae4-542d-925a-26466bd4537a")}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]="3ca509bb-c830-50d2-812f-bfa2a6ea43dd")}catch(e){}}();
3
3
  import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.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-DYu6AVaU.js";
5
- import { c as isExpectedUserError } from "./unref-stdin-WVB8gYib.js";
6
- import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-CN1TnQFY.js";
7
- import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-jDURjqWD.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-CVmKpHzY.js";
9
- import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-CFcIJ6wu.js";
10
- import { t as shouldSkipPrompts } from "./should-skip-prompts-CQuGlo68.js";
11
- import { t as printBrandedHeader } from "./print-branded-header-BdWqKeOv.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-BH7YPKl_.js";
5
+ import { c as isExpectedUserError } from "./unref-stdin-hgpAG4XZ.js";
6
+ import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-Cks5Vt1h.js";
7
+ import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-DifzK4IZ.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-BVbQtP5c.js";
9
+ import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-BSCzz3j5.js";
10
+ import { t as shouldSkipPrompts } from "./should-skip-prompts-DZTNlJ_P.js";
11
+ import { t as printBrandedHeader } from "./print-branded-header-DnpzuUUq.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-Dk3DstBG.js.map
7501
- //# debugId=00b94877-7ae4-542d-925a-26466bd4537a
7500
+ //# sourceMappingURL=ci-BMegSONn.js.map
7501
+ //# debugId=3ca509bb-c830-50d2-812f-bfa2a6ea43dd
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
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 { 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-DYu6AVaU.js";
5
- import { c as isExpectedUserError, r as getLastRunTraceId, s as shutdownTelemetry, t as unrefStdin } from "./unref-stdin-WVB8gYib.js";
6
- import { a as initializeSentry, i as flushSentry } from "./build-section-divider-B8hqp04D.js";
7
- import { t as exitGracefully } from "./exit-gracefully-BDgtmBn-.js";
8
- import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-CN1TnQFY.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-BH7YPKl_.js";
5
+ import { c as isExpectedUserError, r as getLastRunTraceId, s as shutdownTelemetry, t as unrefStdin } from "./unref-stdin-hgpAG4XZ.js";
6
+ import { a as initializeSentry, i as flushSentry } from "./build-section-divider-Ddw_uug8.js";
7
+ import { t as exitGracefully } from "./exit-gracefully-BUlwv_l9.js";
8
+ import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-Cks5Vt1h.js";
9
9
  import { execFileSync } from "node:child_process";
10
10
  //#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
11
11
  var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
@@ -3481,7 +3481,7 @@ ${highlighter.dim("Learn more:")}
3481
3481
  const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
3482
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);
3483
3483
  program.action(async (directory = ".", flags) => {
3484
- const { runScanCommand } = await import("./scan-Dqlls0Ah.js");
3484
+ const { runScanCommand } = await import("./scan-BA_uaWDP.js");
3485
3485
  return runScanCommand({
3486
3486
  directory,
3487
3487
  flags,
@@ -3489,72 +3489,72 @@ program.action(async (directory = ".", flags) => {
3489
3489
  });
3490
3490
  });
3491
3491
  program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
3492
- const { designAction } = await import("./design-Bq-3HXBZ.js");
3492
+ const { designAction } = await import("./design-BqM5xXaq.js");
3493
3493
  return designAction(directory ?? ".", command.optsWithGlobals());
3494
3494
  });
3495
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) => {
3496
- const { whyAction } = await import("./why-8fJcz5q1.js");
3496
+ const { whyAction } = await import("./why-io73cU0Q.js");
3497
3497
  return whyAction(location, options);
3498
3498
  });
3499
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) => {
3500
- const { installAction } = await import("./install-C_qBGcAr.js");
3500
+ const { installAction } = await import("./install-YaBPQ5oC.js");
3501
3501
  return installAction(options, command);
3502
3502
  });
3503
3503
  const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
3504
3504
  const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
3505
3505
  const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
3506
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) => {
3507
- const { ciInstallAction } = await import("./ci-Dk3DstBG.js");
3507
+ const { ciInstallAction } = await import("./ci-BMegSONn.js");
3508
3508
  return ciInstallAction(command.optsWithGlobals());
3509
3509
  });
3510
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) => {
3511
- const { ciConfigAction } = await import("./ci-Dk3DstBG.js");
3511
+ const { ciConfigAction } = await import("./ci-BMegSONn.js");
3512
3512
  return ciConfigAction(command.optsWithGlobals());
3513
3513
  });
3514
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) => {
3515
- const { ciUpgradeAction } = await import("./ci-Dk3DstBG.js");
3515
+ const { ciUpgradeAction } = await import("./ci-BMegSONn.js");
3516
3516
  return ciUpgradeAction(command.optsWithGlobals());
3517
3517
  });
3518
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 () => {
3519
- const { versionAction } = await import("./version-BE2SrOFP.js");
3519
+ const { versionAction } = await import("./version-CZPNYOny.js");
3520
3520
  return versionAction();
3521
3521
  });
3522
3522
  const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
3523
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) => {
3524
- const { rulesListAction } = await import("./rules-C1Q8Eeih.js");
3524
+ const { rulesListAction } = await import("./rules-DLYMq5Gc.js");
3525
3525
  return rulesListAction(command.optsWithGlobals());
3526
3526
  });
3527
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) => {
3528
- const { rulesExplainAction } = await import("./rules-C1Q8Eeih.js");
3528
+ const { rulesExplainAction } = await import("./rules-DLYMq5Gc.js");
3529
3529
  return rulesExplainAction(rule, command.optsWithGlobals());
3530
3530
  });
3531
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) => {
3532
- const { rulesSetAction } = await import("./rules-C1Q8Eeih.js");
3532
+ const { rulesSetAction } = await import("./rules-DLYMq5Gc.js");
3533
3533
  return rulesSetAction(rule, severity, command.optsWithGlobals());
3534
3534
  });
3535
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) => {
3536
- const { rulesEnableAction } = await import("./rules-C1Q8Eeih.js");
3536
+ const { rulesEnableAction } = await import("./rules-DLYMq5Gc.js");
3537
3537
  return rulesEnableAction(rule, command.optsWithGlobals());
3538
3538
  });
3539
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) => {
3540
- const { rulesDisableAction } = await import("./rules-C1Q8Eeih.js");
3540
+ const { rulesDisableAction } = await import("./rules-DLYMq5Gc.js");
3541
3541
  return rulesDisableAction(rule, command.optsWithGlobals());
3542
3542
  });
3543
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) => {
3544
- const { rulesCategoryAction } = await import("./rules-C1Q8Eeih.js");
3544
+ const { rulesCategoryAction } = await import("./rules-DLYMq5Gc.js");
3545
3545
  return rulesCategoryAction(category, severity, command.optsWithGlobals());
3546
3546
  });
3547
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) => {
3548
- const { rulesIgnoreTagAction } = await import("./rules-C1Q8Eeih.js");
3548
+ const { rulesIgnoreTagAction } = await import("./rules-DLYMq5Gc.js");
3549
3549
  return rulesIgnoreTagAction(tag, command.optsWithGlobals());
3550
3550
  });
3551
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) => {
3552
- const { rulesUnignoreTagAction } = await import("./rules-C1Q8Eeih.js");
3552
+ const { rulesUnignoreTagAction } = await import("./rules-DLYMq5Gc.js");
3553
3553
  return rulesUnignoreTagAction(tag, command.optsWithGlobals());
3554
3554
  });
3555
3555
  program.command("experimental-lsp", { hidden: false }).description("[experimental] run the React Doctor language server over stdio (for editors)").allowUnknownOption().action(() => {});
3556
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) => {
3557
- const { runScanCommand } = await import("./scan-Dqlls0Ah.js");
3557
+ const { runScanCommand } = await import("./scan-BA_uaWDP.js");
3558
3558
  return runScanCommand({
3559
3559
  directory,
3560
3560
  flags: command.optsWithGlobals(),
@@ -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]="be7166a4-2060-5704-810a-229138895f59")}catch(e){}}();
3
- import { t as inspectAction } from "./inspect-DME2yAzQ.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]="be04fd27-83ec-566f-b39a-4f925e2456ef")}catch(e){}}();
3
+ import { t as inspectAction } from "./inspect-C62I4cFt.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-Bq-3HXBZ.js.map
14
- //# debugId=be7166a4-2060-5704-810a-229138895f59
13
+ //# sourceMappingURL=design-BqM5xXaq.js.map
14
+ //# debugId=be04fd27-83ec-566f-b39a-4f925e2456ef
@@ -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]="2d8d1477-de50-5185-abaa-c13fac1641bf")}catch(e){}}();
3
- import { d as isJsonModeActive, m as writeJsonErrorReport } from "./record-metric-DYu6AVaU.js";
4
- import { s as shutdownTelemetry } from "./unref-stdin-WVB8gYib.js";
5
- import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, t as buildSectionDivider } from "./build-section-divider-B8hqp04D.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]="cbe8915c-1710-5570-8565-73decaed1ef6")}catch(e){}}();
3
+ import { d as isJsonModeActive, m as writeJsonErrorReport } from "./record-metric-BH7YPKl_.js";
4
+ import { s as shutdownTelemetry } from "./unref-stdin-hgpAG4XZ.js";
5
+ import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, t as buildSectionDivider } from "./build-section-divider-Ddw_uug8.js";
6
6
  //#region src/cli/utils/active-tui-renderer.ts
7
7
  let activeTuiRenderer = null;
8
8
  const registerActiveTuiRenderer = (renderer) => {
@@ -44,5 +44,5 @@ const exitGracefully = () => {
44
44
  //#endregion
45
45
  export { registerActiveTuiRenderer as n, exitGracefully as t };
46
46
 
47
- //# sourceMappingURL=exit-gracefully-BDgtmBn-.js.map
48
- //# debugId=2d8d1477-de50-5185-abaa-c13fac1641bf
47
+ //# sourceMappingURL=exit-gracefully-BUlwv_l9.js.map
48
+ //# debugId=cbe8915c-1710-5570-8565-73decaed1ef6
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="13c8d39c-4ca7-5cec-9008-0d185748c006")}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]="44a04987-7853-5db5-998b-9f38f797adcd")}catch(e){}}();
3
3
  import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, classifySecurityScanFile, collectCrossFileDependencyProbes, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
@@ -63958,7 +63958,7 @@ const SOCKET_FREE_USER_AGENT = "react-doctor-supply-chain";
63958
63958
  const FILE_LINT_CACHE_FILENAME = "file-lint-cache.json";
63959
63959
  const FILE_LINT_CACHE_MAX_FILE_COUNT = 5e4;
63960
63960
  const SIDECAR_LINT_CACHE_FILENAME = "sidecar-lint-cache.json";
63961
- const CORE_PACKAGE_VERSION = "0.9.10";
63961
+ const CORE_PACKAGE_VERSION = "0.9.11";
63962
63962
  const DEAD_CODE_CACHE_FILENAME = "dead-code-cache.json";
63963
63963
  const DEAD_CODE_SUMMARY_CACHE_FILENAME = "dead-code-summaries.json";
63964
63964
  const SUPPLY_CHAIN_PLUGIN = "socket";
@@ -64303,7 +64303,8 @@ const listSourceFilesViaFilesystemCooperative = async (rootDirectory, signal) =>
64303
64303
  const listSourceFilePaths = (rootDirectory) => (listSourceFilesViaGit(rootDirectory) ?? listSourceFilesViaFilesystem(rootDirectory)).sort();
64304
64304
  const listSourceFilePathsCooperative = async (rootDirectory, signal) => (await listSourceFilesViaGitCooperative(rootDirectory, signal) ?? await listSourceFilesViaFilesystemCooperative(rootDirectory, signal)).sort();
64305
64305
  const listSourceFilesWithSize = (rootDirectory) => collectSizedSourceFiles(rootDirectory, listSourceFilePaths(rootDirectory));
64306
- const listSourceFilesCooperative = async (rootDirectory, signal) => (await collectSizedSourceFilesCooperative(rootDirectory, await listSourceFilePathsCooperative(rootDirectory, signal), signal)).map((entry) => entry.path);
64306
+ const listSourceFilesWithSizeCooperative = async (rootDirectory, signal) => collectSizedSourceFilesCooperative(rootDirectory, await listSourceFilePathsCooperative(rootDirectory, signal), signal);
64307
+ const listSourceFilesCooperative = async (rootDirectory, signal) => (await listSourceFilesWithSizeCooperative(rootDirectory, signal)).map((entry) => entry.path);
64307
64308
  const listSourceFiles = (rootDirectory) => listSourceFilesWithSize(rootDirectory).map((entry) => entry.path);
64308
64309
  const countSourceFiles = (rootDirectory) => listSourceFilesWithSize(rootDirectory).length;
64309
64310
  const NEXT_CONFIG_FILENAMES = [
@@ -75403,7 +75404,7 @@ const runOxlint = async (options) => {
75403
75404
  const pluginPath = resolvePluginPath();
75404
75405
  const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
75405
75406
  const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
75406
- const restoreDisableDirectives = respectInlineDisables ? () => {} : await neutralizeDisableDirectives(rootDirectory, includePaths);
75407
+ const restoreDisableDirectives = respectInlineDisables ? () => {} : await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path));
75407
75408
  const configDirectory = NFS.mkdtempSync(Path.join(os.tmpdir(), "react-doctor-oxlintrc-"));
75408
75409
  const configPath = Path.join(configDirectory, "oxlintrc.json");
75409
75410
  try {
@@ -75436,8 +75437,8 @@ const runOxlint = async (options) => {
75436
75437
  ...sharedArgs
75437
75438
  ];
75438
75439
  await yieldToEventLoop();
75439
- const sizedScanFiles = includePaths === void 0 ? listSourceFilesWithSize(rootDirectory) : null;
75440
- const candidateFiles = includePaths !== void 0 ? includePaths : (sizedScanFiles ?? []).map((entry) => entry.path);
75440
+ const sizedScanFiles = options.precomputedSourceFiles ?? (includePaths === void 0 ? listSourceFilesWithSize(rootDirectory) : null);
75441
+ const candidateFiles = sizedScanFiles === null ? includePaths ?? [] : sizedScanFiles.map((entry) => entry.path);
75441
75442
  const projectIndexModuleSources = includePaths === void 0 && options.deadlineEpochMs === void 0 ? await collectProjectIndexModuleSources(rootDirectory, candidateFiles) : void 0;
75442
75443
  unpluginAutoImportGlobalScopes = collectUnpluginAutoImportGlobalScopes({
75443
75444
  rootDirectory,
@@ -75817,6 +75818,7 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
75817
75818
  rootDirectory: input.rootDirectory,
75818
75819
  project: input.project,
75819
75820
  includePaths: input.includePaths ? [...input.includePaths] : void 0,
75821
+ precomputedSourceFiles: input.precomputedSourceFiles,
75820
75822
  nodeBinaryPath: input.nodeBinaryPath,
75821
75823
  customRulesOnly: input.customRulesOnly,
75822
75824
  respectInlineDisables: input.respectInlineDisables,
@@ -76614,22 +76616,23 @@ const runInspect = (input, hooks = {}) => gen(function* () {
76614
76616
  const relativeFilePath = toNormalizedRelativePath(diagnostic.filePath, scanDirectory);
76615
76617
  return excludedProjectRelativePaths.some((excludedRelativePath) => relativeFilePath === excludedRelativePath || relativeFilePath.startsWith(`${excludedRelativePath}/`));
76616
76618
  };
76617
- const precomputedSourceFiles = input.suppressScanSummary === true || excludedProjectDirectories.length > 0 ? yield* filesService.listSourceFilesCooperative({
76619
+ const shouldListSourceFiles = input.precomputedSourceFiles === void 0 && (input.suppressScanSummary === true || excludedProjectDirectories.length > 0);
76620
+ const precomputedSourceFilePaths = input.precomputedSourceFiles?.map((sourceFile) => sourceFile.path) ?? (shouldListSourceFiles ? yield* filesService.listSourceFilesCooperative({
76618
76621
  rootDirectory: scanDirectory,
76619
76622
  signal: input.signal
76620
- }) : null;
76621
- const includedPrecomputedSourceFiles = precomputedSourceFiles !== null && excludedProjectDirectories.length > 0 ? filterPathsOutsideDirectories({
76623
+ }) : null);
76624
+ const includedPrecomputedSourceFilePaths = precomputedSourceFilePaths !== null && excludedProjectDirectories.length > 0 ? filterPathsOutsideDirectories({
76622
76625
  rootDirectory: scanDirectory,
76623
- relativePaths: precomputedSourceFiles,
76626
+ relativePaths: precomputedSourceFilePaths,
76624
76627
  excludedDirectories: excludedProjectDirectories
76625
- }) : precomputedSourceFiles;
76626
- const sourceFileCount = excludedProjectDirectories.length > 0 ? includedPrecomputedSourceFiles?.length : input.precomputedSourceFileCount ?? includedPrecomputedSourceFiles?.length;
76628
+ }) : precomputedSourceFilePaths;
76629
+ const sourceFileCount = excludedProjectDirectories.length > 0 ? includedPrecomputedSourceFilePaths?.length : input.precomputedSourceFiles?.length ?? input.precomputedSourceFileCount ?? includedPrecomputedSourceFilePaths?.length;
76627
76630
  const project = yield* projectService.discover({
76628
76631
  directory: scanDirectory,
76629
76632
  sourceFileCount
76630
76633
  });
76631
76634
  if (!isAnalyzableProject(project)) return yield* new ReactDoctorError({ reason: new NoReactDependency({ directory: scanDirectory }) });
76632
- const deadCodeSourceFileCount = input.retainExcludedProjectDeadCodeDiagnostics === true && precomputedSourceFiles !== null ? precomputedSourceFiles.length : project.sourceFileCount;
76635
+ const deadCodeSourceFileCount = input.retainExcludedProjectDeadCodeDiagnostics === true && precomputedSourceFilePaths !== null ? precomputedSourceFilePaths.length : project.sourceFileCount;
76633
76636
  const [repo, sha, defaultBranch] = yield* all([
76634
76637
  gitService.githubRepo(scanDirectory).pipe(orElseSucceed(() => null)),
76635
76638
  gitService.headSha(scanDirectory).pipe(orElseSucceed(() => null)),
@@ -76640,13 +76643,16 @@ const runInspect = (input, hooks = {}) => gen(function* () {
76640
76643
  directory: scanDirectory,
76641
76644
  repo
76642
76645
  }).pipe(orElseSucceed(() => null)) : succeed$2(null));
76643
- let lintIncludePaths = (input.skipExplicitIncludePathFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths])) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, includedPrecomputedSourceFiles ?? void 0);
76646
+ let lintIncludePaths = (input.skipExplicitIncludePathFilter ? input.includePaths.length > 0 ? [...input.includePaths] : void 0 : computeExplicitLintIncludePaths([...input.includePaths])) ?? resolveLintIncludePaths(scanDirectory, resolvedConfig.config, includedPrecomputedSourceFilePaths ?? void 0);
76644
76647
  if (excludedProjectDirectories.length > 0) lintIncludePaths = filterPathsOutsideDirectories({
76645
76648
  rootDirectory: scanDirectory,
76646
- relativePaths: lintIncludePaths ?? includedPrecomputedSourceFiles ?? (yield* filesService.listSourceFiles(scanDirectory)),
76649
+ relativePaths: lintIncludePaths ?? includedPrecomputedSourceFilePaths ?? (yield* filesService.listSourceFiles(scanDirectory)),
76647
76650
  excludedDirectories: excludedProjectDirectories
76648
76651
  });
76649
- const fallbackScannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? includedPrecomputedSourceFiles ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => Path.resolve(scanDirectory, relativePath)) : [];
76652
+ const suppliedSourceFiles = input.precomputedSourceFiles;
76653
+ const includedPrecomputedSourceFilePathSet = suppliedSourceFiles === void 0 || input.includePaths.length > 0 ? null : new Set(lintIncludePaths ?? includedPrecomputedSourceFilePaths ?? []);
76654
+ const precomputedLintSourceFiles = includedPrecomputedSourceFilePathSet === null || suppliedSourceFiles === void 0 ? void 0 : suppliedSourceFiles.filter((sourceFile) => includedPrecomputedSourceFilePathSet.has(sourceFile.path));
76655
+ const fallbackScannedFilePaths = input.suppressScanSummary ? (lintIncludePaths ?? includedPrecomputedSourceFilePaths ?? (yield* filesService.listSourceFiles(scanDirectory))).map((relativePath) => Path.resolve(scanDirectory, relativePath)) : [];
76650
76656
  const beforeLint = hooks.beforeLint ?? NO_HOOKS.beforeLint;
76651
76657
  const afterLint = hooks.afterLint ?? NO_HOOKS.afterLint;
76652
76658
  yield* beforeLint(project);
@@ -76779,6 +76785,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
76779
76785
  rootDirectory: scanDirectory,
76780
76786
  project,
76781
76787
  includePaths: lintIncludePaths ?? void 0,
76788
+ precomputedSourceFiles: precomputedLintSourceFiles,
76782
76789
  nodeBinaryPath: input.nodeBinaryPath,
76783
76790
  customRulesOnly: input.customRulesOnly,
76784
76791
  respectInlineDisables: input.respectInlineDisables,
@@ -77375,6 +77382,39 @@ const getDiffInfo = (directory, explicitBaseBranch, includeUntracked) => runProm
77375
77382
  };
77376
77383
  }).pipe(provide(Git.layerNode)));
77377
77384
  const filterSourceFiles = (filePaths) => filePaths.filter(isLintableSourceFile);
77385
+ const collectSourceFilesByDirectory = async (rootDirectory, projectDirectories, signal) => {
77386
+ const resolvedRootDirectory = Path.resolve(rootDirectory);
77387
+ const sourceFilesByDirectory = /* @__PURE__ */ new Map();
77388
+ const projectDirectoryByRelativePath = /* @__PURE__ */ new Map();
77389
+ for (const projectDirectory of projectDirectories) {
77390
+ const resolvedProjectDirectory = Path.resolve(projectDirectory);
77391
+ const relativeDirectory = Path.relative(resolvedRootDirectory, resolvedProjectDirectory);
77392
+ if (Path.isAbsolute(relativeDirectory) || relativeDirectory === ".." || relativeDirectory.startsWith(`..${Path.sep}`)) continue;
77393
+ sourceFilesByDirectory.set(resolvedProjectDirectory, []);
77394
+ projectDirectoryByRelativePath.set(relativeDirectory.replaceAll(Path.sep, "/"), resolvedProjectDirectory);
77395
+ }
77396
+ const sourceFiles = await listSourceFilesWithSizeCooperative(resolvedRootDirectory, signal);
77397
+ for (const sourceFile of sourceFiles) {
77398
+ let relativeDirectory = Path.posix.dirname(sourceFile.path);
77399
+ while (true) {
77400
+ const normalizedRelativeDirectory = relativeDirectory === "." ? "" : relativeDirectory;
77401
+ const projectDirectory = projectDirectoryByRelativePath.get(normalizedRelativeDirectory);
77402
+ if (projectDirectory !== void 0) {
77403
+ const projectRelativePath = Path.posix.relative(normalizedRelativeDirectory, sourceFile.path);
77404
+ const projectSourceFiles = sourceFilesByDirectory.get(projectDirectory);
77405
+ if (projectSourceFiles === void 0) break;
77406
+ projectSourceFiles.push({
77407
+ path: projectRelativePath,
77408
+ sizeBytes: sourceFile.sizeBytes
77409
+ });
77410
+ break;
77411
+ }
77412
+ if (relativeDirectory === ".") break;
77413
+ relativeDirectory = Path.posix.dirname(relativeDirectory);
77414
+ }
77415
+ }
77416
+ return sourceFilesByDirectory;
77417
+ };
77378
77418
  const createLintPhaseAbortError = () => new ReactDoctorError({ reason: new OxlintSpawnFailed({ cause: "lint phase aborted" }) });
77379
77419
  const createOxlintSpawnSlots = (concurrency) => createWorkerSlots({
77380
77420
  slotCount: resolveScanConcurrency(concurrency),
@@ -77462,6 +77502,60 @@ const mergeReactDoctorConfigs = (baseConfig, overrideConfig) => {
77462
77502
  };
77463
77503
  //#endregion
77464
77504
  //#region ../api/dist/index.js
77505
+ const resolveProjectGroupRoot = (projectDirectory) => {
77506
+ try {
77507
+ return isMonorepoRoot(projectDirectory) ? projectDirectory : findMonorepoRoot(projectDirectory);
77508
+ } catch {
77509
+ return null;
77510
+ }
77511
+ };
77512
+ const containsNestedProjectDirectories = (projectDirectories) => projectDirectories.some((projectDirectory, projectIndex) => projectDirectories.some((candidateDirectory, candidateIndex) => candidateIndex !== projectIndex && isPathInsideDirectory(candidateDirectory, projectDirectory)));
77513
+ const resolveCommonAncestorDirectory = (projectDirectories) => {
77514
+ let commonDirectory = projectDirectories[0];
77515
+ for (const projectDirectory of projectDirectories.slice(1)) while (commonDirectory !== projectDirectory && !isPathInsideDirectory(projectDirectory, commonDirectory)) commonDirectory = Path.dirname(commonDirectory);
77516
+ return commonDirectory;
77517
+ };
77518
+ const collectGroupSourceFiles = async (projectDirectories) => {
77519
+ if (projectDirectories.length === 1 || containsNestedProjectDirectories(projectDirectories)) return /* @__PURE__ */ new Map();
77520
+ try {
77521
+ return await collectSourceFilesByDirectory(resolveCommonAncestorDirectory(projectDirectories), projectDirectories);
77522
+ } catch {
77523
+ return /* @__PURE__ */ new Map();
77524
+ }
77525
+ };
77526
+ const compareProjectPlanEntries = (leftEntry, rightEntry) => {
77527
+ const leftSourceFileCount = leftEntry.precomputedSourceFiles?.length;
77528
+ const rightSourceFileCount = rightEntry.precomputedSourceFiles?.length;
77529
+ if (leftSourceFileCount === rightSourceFileCount) return leftEntry.originalIndex - rightEntry.originalIndex;
77530
+ if (leftSourceFileCount === void 0) return 1;
77531
+ if (rightSourceFileCount === void 0) return -1;
77532
+ return rightSourceFileCount - leftSourceFileCount;
77533
+ };
77534
+ const buildDiagnoseProjectPlan = async (projects) => {
77535
+ const projectDirectoriesByRootDirectory = /* @__PURE__ */ new Map();
77536
+ for (const project of projects) {
77537
+ const projectDirectory = Path.resolve(project.directory);
77538
+ const rootDirectory = resolveProjectGroupRoot(projectDirectory);
77539
+ if (rootDirectory === null) continue;
77540
+ const projectDirectories = projectDirectoriesByRootDirectory.get(rootDirectory);
77541
+ if (projectDirectories === void 0) projectDirectoriesByRootDirectory.set(rootDirectory, [projectDirectory]);
77542
+ else projectDirectories.push(projectDirectory);
77543
+ }
77544
+ const groupedSourceFiles = await Promise.all([...projectDirectoriesByRootDirectory.values()].map(collectGroupSourceFiles));
77545
+ const sourceFilesByDirectory = /* @__PURE__ */ new Map();
77546
+ for (const sourceFilesByProjectDirectory of groupedSourceFiles) for (const [projectDirectory, sourceFiles] of sourceFilesByProjectDirectory) {
77547
+ if (sourceFiles.length === 0) continue;
77548
+ sourceFilesByDirectory.set(projectDirectory, sourceFiles);
77549
+ }
77550
+ return projects.map((projectDefinition, originalIndex) => {
77551
+ const precomputedSourceFiles = sourceFilesByDirectory.get(Path.resolve(projectDefinition.directory));
77552
+ return {
77553
+ originalIndex,
77554
+ projectDefinition,
77555
+ ...precomputedSourceFiles === void 0 ? {} : { precomputedSourceFiles }
77556
+ };
77557
+ }).toSorted(compareProjectPlanEntries);
77558
+ };
77465
77559
  let didWarnAiTraining = false;
77466
77560
  const warnIfAiTrainingEnvironment = () => {
77467
77561
  if (didWarnAiTraining || detectAiTrainingEnvironment() === null) return;
@@ -77478,12 +77572,13 @@ const buildDiagnoseLayer = (input) => {
77478
77572
  });
77479
77573
  return mergeAll$1(Project.layerNode, configLayer, input.shouldRunDeadCode ? DeadCode.layerNode : DeadCode.layerOf([]), Files.layerNode, Git.layerNode, input.shouldRunLint ? Linter.layerOxlint : Linter.layerOf([]), LintPartialFailures.layerLive, succeed$3(OxlintConcurrency, input.oxlintConcurrency), succeed$3(OxlintSpawnSlots, input.oxlintSpawnSlots), Progress.layerNoop, Reporter.layerNoop, Score.layerHttp, input.config?.supplyChain?.enabled !== false ? SupplyChain.layerNode : SupplyChain.layerOf([]));
77480
77574
  };
77481
- const buildInspectProgram = (scanTarget, options, configOverride) => {
77575
+ const buildInspectProgram = (scanTarget, options, configOverride, precomputedSourceFiles) => {
77482
77576
  const effectiveConfig = configOverride ?? scanTarget.userConfig;
77483
77577
  const includePaths = options.includePaths ?? [];
77484
77578
  const shouldRunDeadCode = resolveShouldRunDeadCode(options, effectiveConfig);
77485
77579
  return runInspect({
77486
77580
  directory: scanTarget.resolvedDirectory,
77581
+ precomputedSourceFiles,
77487
77582
  includePaths,
77488
77583
  customRulesOnly: effectiveConfig?.customRulesOnly ?? false,
77489
77584
  respectInlineDisables: options.respectInlineDisables ?? effectiveConfig?.respectInlineDisables ?? true,
@@ -77539,7 +77634,7 @@ const findWorstScore = (projectResults) => {
77539
77634
  }
77540
77635
  return worstResult;
77541
77636
  };
77542
- const diagnoseProject = async (projectDefinition, baseOptions, batchConfig, oxlintConcurrency, oxlintSpawnSlots) => {
77637
+ const diagnoseProject = async (projectDefinition, baseOptions, batchConfig, oxlintConcurrency, oxlintSpawnSlots, precomputedSourceFiles) => {
77543
77638
  const startTime = globalThis.performance.now();
77544
77639
  try {
77545
77640
  const scanTarget = await resolveScanTarget(projectDefinition.directory);
@@ -77552,7 +77647,8 @@ const diagnoseProject = async (projectDefinition, baseOptions, batchConfig, oxli
77552
77647
  };
77553
77648
  const shouldRunLint = resolveShouldRunLint(mergedOptions, effectiveConfig);
77554
77649
  const shouldRunDeadCode = resolveShouldRunDeadCode(mergedOptions, effectiveConfig);
77555
- const program = buildInspectProgram(scanTarget, mergedOptions, effectiveConfig ?? void 0);
77650
+ const canReusePrecomputedSourceFiles = Path.resolve(projectDefinition.directory) === Path.resolve(scanTarget.resolvedDirectory);
77651
+ const program = buildInspectProgram(scanTarget, mergedOptions, effectiveConfig ?? void 0, canReusePrecomputedSourceFiles ? precomputedSourceFiles : void 0);
77556
77652
  const didOverridePlugins = batchConfig?.plugins !== void 0 || projectConfig?.plugins !== void 0;
77557
77653
  const layer = buildDiagnoseLayer(didOverrideConfig ? {
77558
77654
  config: effectiveConfig,
@@ -77590,7 +77686,10 @@ const diagnoseProjectBatch = async (input) => {
77590
77686
  const { projects, concurrency, config: batchConfig, ...baseOptions } = input;
77591
77687
  const oxlintConcurrency = runSync(OxlintConcurrency);
77592
77688
  const oxlintSpawnSlots = createOxlintSpawnSlots(oxlintConcurrency);
77593
- const projectResults = await mapWithConcurrency(projects, concurrency ?? 4, (projectDefinition) => diagnoseProject(projectDefinition, baseOptions, batchConfig, oxlintConcurrency, oxlintSpawnSlots));
77689
+ const projectResults = (await mapWithConcurrency(await buildDiagnoseProjectPlan(projects), concurrency ?? 4, async (projectPlanEntry) => ({
77690
+ originalIndex: projectPlanEntry.originalIndex,
77691
+ result: await diagnoseProject(projectPlanEntry.projectDefinition, baseOptions, batchConfig, oxlintConcurrency, oxlintSpawnSlots, projectPlanEntry.precomputedSourceFiles)
77692
+ }))).toSorted((leftProject, rightProject) => leftProject.originalIndex - rightProject.originalIndex).map((completedProject) => completedProject.result);
77594
77693
  const succeededProjects = projectResults.filter((projectResult) => projectResult.ok);
77595
77694
  return {
77596
77695
  projects: projectResults,
@@ -77635,4 +77734,4 @@ const toJsonReport = (result, options) => buildJsonReport({
77635
77734
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
77636
77735
 
77637
77736
  //# sourceMappingURL=index.js.map
77638
- //# debugId=13c8d39c-4ca7-5cec-9008-0d185748c006
77737
+ //# debugId=44a04987-7853-5db5-998b-9f38f797adcd
@@ -1,17 +1,17 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b3ed8de1-f2f3-52fa-baf6-6daac0bd1b81")}catch(e){}}();
3
- import { Cn as mapWithConcurrency, Dn as remainingDeadlineBudgetMs, En as messageFromUnknown, F as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, G as isCiOrCodingAgentEnvironment, Gt as discoverReactSubprojects, K as isCodingAgentEnvironment, Mn as resolveScanTarget, Nt as buildJsonReport, Ot as StagedFiles, P as STAGED_FILES_TEMP_DIR_PREFIX, Qt as getBaselineDiffPlan, R as CliInputError, Tt as STAGED_FILES_PROJECT_CONFIG_FILENAMES, V as isDebugFlagEnabled, Wt as detectAiTrainingEnvironment, Xn as gen, Y as CANONICAL_GITHUB_URL, Yt as findLegacyConfig, cn as highlighter, ct as Git, dr as provide, en as getChangedLineRanges, f as setJsonReportDirectory, g as VERSION, h as writeJsonReport, ir as runPromise, m as writeJsonErrorReport, mn as isPlainObject, n as recordDistribution, nn as getDiffInfo, on as hasReactRuntime, p as setJsonReportMode, pn as isPathInsideDirectory, t as recordCount, tr as provide$1, u as enableJsonMode, un as isErrnoException, w as METRIC, xn as listWorkspacePackages, zn as toRelativePath } from "./record-metric-DYu6AVaU.js";
4
- import { c as isExpectedUserError, s as shutdownTelemetry } from "./unref-stdin-WVB8gYib.js";
5
- import { i as flushSentry } from "./build-section-divider-B8hqp04D.js";
6
- import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-CN1TnQFY.js";
7
- import { F as runGitRaw, L as cliLogger, c as spinner, i as hasDoctorScript, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-jDURjqWD.js";
8
- import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-CVmKpHzY.js";
9
- import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope, u as toForwardSlashes } from "./resolve-scope-CFcIJ6wu.js";
10
- import { t as shouldSkipPrompts } from "./should-skip-prompts-CQuGlo68.js";
11
- import { A as resolveMergeBaseRef, B as buildEmptyReportMessage, C as copyToClipboard, D as deduplicateProjectScans, E as collectProjectSourceFileCounts, F as printDiagnosticsDump, O as createInvocationInspect, R as filterDiagnosticsByCategories, S as CLI_AGENT_BINARIES, T as buildHandoffPayload, _ as resolveCliInspectOptions, a as projectManifestChanged, b as setUpGitHubActions, c as selectProjects, d as resolveProjectChangedLineRanges, f as resolveProjectDiffIncludePaths, g as resolveWorkspaceDeadCodeOwner, h as retryMissingProjectScores, i as validateModeFlags, j as printHeadlessReport, k as inspect, l as buildCodeFrame, m as resolveProjectRelativeDirectory, n as formatSkippedProjectsMessage, o as partitionProjectScanOutcomes, p as resolveProjectSourceFilePaths, r as validateIncludeUntrackedScope, t as shouldFailScanGate, u as resolveProjectScan, v as filterScansForSurface, w as launchCliAgent, x as detectLaunchableAgents, y as countUniqueScannedFiles } from "./should-fail-scan-gate-BwQnt3yQ.js";
12
- import { a as recordGate, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-B3mNTNry.js";
13
- import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithLegacyShellHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-BVWAJ5wa.js";
14
- import { t as readObjectFile } from "./read-object-file-DDgbCE22.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]="8281f4cd-fb1c-52dc-9a69-1a477a495deb")}catch(e){}}();
3
+ import { Cn as mapWithConcurrency, Dn as remainingDeadlineBudgetMs, En as messageFromUnknown, F as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, G as isCiOrCodingAgentEnvironment, Gt as discoverReactSubprojects, K as isCodingAgentEnvironment, Mn as resolveScanTarget, Nt as buildJsonReport, Ot as StagedFiles, P as STAGED_FILES_TEMP_DIR_PREFIX, Qt as getBaselineDiffPlan, R as CliInputError, Tt as STAGED_FILES_PROJECT_CONFIG_FILENAMES, V as isDebugFlagEnabled, Wt as detectAiTrainingEnvironment, Xn as gen, Y as CANONICAL_GITHUB_URL, Yt as findLegacyConfig, cn as highlighter, ct as Git, dr as provide, en as getChangedLineRanges, f as setJsonReportDirectory, g as VERSION, h as writeJsonReport, ir as runPromise, m as writeJsonErrorReport, mn as isPlainObject, n as recordDistribution, nn as getDiffInfo, on as hasReactRuntime, p as setJsonReportMode, pn as isPathInsideDirectory, t as recordCount, tr as provide$1, u as enableJsonMode, un as isErrnoException, w as METRIC, xn as listWorkspacePackages, zn as toRelativePath } from "./record-metric-BH7YPKl_.js";
4
+ import { c as isExpectedUserError, s as shutdownTelemetry } from "./unref-stdin-hgpAG4XZ.js";
5
+ import { i as flushSentry } from "./build-section-divider-Ddw_uug8.js";
6
+ import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-Cks5Vt1h.js";
7
+ import { F as runGitRaw, L as cliLogger, c as spinner, i as hasDoctorScript, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-DifzK4IZ.js";
8
+ import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-BVbQtP5c.js";
9
+ import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope, u as toForwardSlashes } from "./resolve-scope-BSCzz3j5.js";
10
+ import { t as shouldSkipPrompts } from "./should-skip-prompts-DZTNlJ_P.js";
11
+ import { A as resolveMergeBaseRef, B as buildEmptyReportMessage, C as copyToClipboard, D as deduplicateProjectScans, E as collectProjectSourceFileCounts, F as printDiagnosticsDump, O as createInvocationInspect, R as filterDiagnosticsByCategories, S as CLI_AGENT_BINARIES, T as buildHandoffPayload, _ as resolveCliInspectOptions, a as projectManifestChanged, b as setUpGitHubActions, c as selectProjects, d as resolveProjectChangedLineRanges, f as resolveProjectDiffIncludePaths, g as resolveWorkspaceDeadCodeOwner, h as retryMissingProjectScores, i as validateModeFlags, j as printHeadlessReport, k as inspect, l as buildCodeFrame, m as resolveProjectRelativeDirectory, n as formatSkippedProjectsMessage, o as partitionProjectScanOutcomes, p as resolveProjectSourceFilePaths, r as validateIncludeUntrackedScope, t as shouldFailScanGate, u as resolveProjectScan, v as filterScansForSurface, w as launchCliAgent, x as detectLaunchableAgents, y as countUniqueScannedFiles } from "./should-fail-scan-gate-DL4gKSfD.js";
12
+ import { a as recordGate, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-wfb2YgOE.js";
13
+ import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithLegacyShellHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-Cs1XhzJD.js";
14
+ import { t as readObjectFile } from "./read-object-file-7s-GWT1i.js";
15
15
  import * as path$1 from "node:path";
16
16
  import * as fs$1 from "node:fs";
17
17
  import { tmpdir } from "node:os";
@@ -1439,5 +1439,5 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
1439
1439
  //#endregion
1440
1440
  export { warnDeprecatedFailOn as n, runProjectMigrations as r, inspectAction as t };
1441
1441
 
1442
- //# sourceMappingURL=inspect-DME2yAzQ.js.map
1443
- //# debugId=b3ed8de1-f2f3-52fa-baf6-6daac0bd1b81
1442
+ //# sourceMappingURL=inspect-C62I4cFt.js.map
1443
+ //# debugId=8281f4cd-fb1c-52dc-9a69-1a477a495deb
@@ -1,10 +1,10 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c97bfab3-9158-54b6-aed4-b29155b32f10")}catch(e){}}();
3
- import { ar as runSync, t as recordCount, w as METRIC } from "./record-metric-DYu6AVaU.js";
4
- import { c as isExpectedUserError } from "./unref-stdin-WVB8gYib.js";
5
- import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-CN1TnQFY.js";
6
- import { t as printBrandedHeader } from "./print-branded-header-BdWqKeOv.js";
7
- import { n as runInstallReactDoctor } from "./install-react-doctor-BVWAJ5wa.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]="83a3c724-fcfb-5efa-bd75-1e4d073c1387")}catch(e){}}();
3
+ import { ar as runSync, t as recordCount, w as METRIC } from "./record-metric-BH7YPKl_.js";
4
+ import { c as isExpectedUserError } from "./unref-stdin-hgpAG4XZ.js";
5
+ import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-Cks5Vt1h.js";
6
+ import { t as printBrandedHeader } from "./print-branded-header-DnpzuUUq.js";
7
+ import { n as runInstallReactDoctor } from "./install-react-doctor-Cs1XhzJD.js";
8
8
  //#region src/cli/commands/install.ts
9
9
  const installAction = async (options, command) => {
10
10
  recordCount(METRIC.cliInvoked, 1, { command: "install" });
@@ -28,5 +28,5 @@ const installAction = async (options, command) => {
28
28
  //#endregion
29
29
  export { installAction };
30
30
 
31
- //# sourceMappingURL=install-C_qBGcAr.js.map
32
- //# debugId=c97bfab3-9158-54b6-aed4-b29155b32f10
31
+ //# sourceMappingURL=install-YaBPQ5oC.js.map
32
+ //# debugId=83a3c724-fcfb-5efa-bd75-1e4d073c1387