react-doctor 0.9.12-dev.8c2f03a → 0.9.12-dev.a163de9

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 (45) hide show
  1. package/README.md +27 -0
  2. package/dist/active-run-trace-dlIZeEvb.js +18 -0
  3. package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
  4. package/dist/{build-section-divider-DuozMmwU.js → build-section-divider-DwhI0l-P.js} +8 -22
  5. package/dist/{ci-Bwd2LJZC.js → ci-BM5Bztiz.js} +12 -11
  6. package/dist/cli.js +77 -25
  7. package/dist/{design-Q4Umr_4T.js → design-BJm8XW5q.js} +4 -4
  8. package/dist/{devtools-D8NTVj81.js → devtools-BiC-AP3B.js} +3 -3
  9. package/dist/{exit-gracefully-vUI1H1zC.js → exit-gracefully-cFX-xHhy.js} +15 -9
  10. package/dist/get-east-asian-width-Cglw13G7.js +444 -0
  11. package/dist/{report-error-CAp5cil9.js → handle-error-DBoxwa4Y.js} +6 -61
  12. package/dist/index.d.ts +34 -2
  13. package/dist/index.js +415 -209
  14. package/dist/{inspect-RxIsB8bi.js → inspect-Cj9X2Cuj.js} +21 -19
  15. package/dist/{install-CI0nvC_v.js → install-DJE5tJBN.js} +9 -8
  16. package/dist/{install-doctor-script-BAmTZygh.js → install-doctor-script-Bwy0GRjB.js} +7 -449
  17. package/dist/{install-github-workflow-Dg2sosDx.js → install-github-workflow-CQL9QH8Q.js} +6 -6
  18. package/dist/{install-react-doctor-CIJcnTik.js → install-react-doctor-BC0tbnqe.js} +47 -45
  19. package/dist/{run-scan-app-CeNk17wq.js → jsx-runtime-BGIkB563.js} +280 -2769
  20. package/dist/{print-branded-header-kwnSGrfR.js → print-branded-header-B5xE0DP1.js} +4 -4
  21. package/dist/project-analysis-worker.js +3 -3
  22. package/dist/prompt-runtime-scan-url-G27i97Bd.js +240 -0
  23. package/dist/{read-object-file-m5uVvcBp.js → read-object-file-p5HY4kEb.js} +4 -4
  24. package/dist/{record-metric-DospZkfP.js → record-metric-B0l334ac.js} +419 -192
  25. package/dist/report-error-CxbHpLL8.js +64 -0
  26. package/dist/{report-workflow-result-D0GvvJtT.js → report-workflow-result-Dtn4MVZ_.js} +5 -5
  27. package/dist/{resolve-scope-eXawiGEH.js → resolve-scope-DFSO5zB7.js} +6 -6
  28. package/dist/{rules-C_xYDSz8.js → rules-DEUYP2QZ.js} +6 -6
  29. package/dist/run-scan-app-0v4YCLNw.js +2509 -0
  30. package/dist/runtime-scan/browser-probe.iife.js +855 -0
  31. package/dist/runtime-scan-CrdGMGtp.js +770 -0
  32. package/dist/sanitize-runtime-url-DMNbP5D7.js +76 -0
  33. package/dist/{scan-DIwsgV6M.js → scan-BjmlwnGK.js} +10 -22
  34. package/dist/{should-fail-scan-gate-BWTNIU5h.js → should-fail-scan-gate-DFrfU9H8.js} +23 -114
  35. package/dist/{should-skip-prompts-oK3MwWyB.js → should-skip-prompts-jB7AIlXO.js} +4 -4
  36. package/dist/should-use-tui-DwO2FSvM.js +25 -0
  37. package/dist/skills/improve-threejs/SKILL.md +102 -0
  38. package/dist/skills/performance/SKILL.md +113 -0
  39. package/dist/skills/react-doctor/SKILL.md +6 -0
  40. package/dist/{unref-stdin-BGZVK4sJ.js → telemetry-runtime-EpReAdpc.js} +5 -23
  41. package/dist/unref-stdin-BKT_s38a.js +12 -0
  42. package/dist/{version-9-2T2YQf.js → version-LTrxsytD.js} +4 -4
  43. package/dist/{why-BOiuB_qy.js → why-i7UomrTB.js} +4 -4
  44. package/dist/with-run-span-tKhCINUb.js +110 -0
  45. package/package.json +7 -4
@@ -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]="7fbceb12-b91b-5945-969c-c6bfc4005674")}catch(e){}}();
3
- import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.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]="10224529-8179-5ea2-849f-da7e2f5c7db2")}catch(e){}}();
3
+ import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
4
4
  import { n as require_picomatch, t as require_semver } from "./semver-DFtnEmN-.js";
5
5
  import { createRequire } from "node:module";
6
6
  import * as NodeChildProcess from "node:child_process";
@@ -26,8 +26,8 @@ import { convertToTSX } from "@astrojs/compiler/sync";
26
26
  import { STATUS_CODES } from "node:http";
27
27
  import { gzipSync } from "node:zlib";
28
28
  import { performance as performance$1 } from "node:perf_hooks";
29
- //#region ../core/dist/collect-unplugin-auto-import-global-scopes-Dno9RW5R.js
30
- var import_picomatch = /* @__PURE__ */ __toESM$1(require_picomatch(), 1);
29
+ //#region ../core/dist/collect-unplugin-auto-import-global-scopes-C1E7dTEQ.js
30
+ var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
31
31
  const HTML_FILE_PATTERN = /\.html$/i;
32
32
  const SOURCE_FILE_PATTERN = /\.(?:astro|tsx?|jsx?|mts|mjs|[hH][tT][mM][lL])$/;
33
33
  const GENERATED_BUNDLE_FILE_PATTERN = /\.(iife|umd|global|min)\.m?js$/i;
@@ -311,6 +311,7 @@ const ES_TARGET_YEAR_BY_NAME = {
311
311
  * compiler options — the root config first, then a monorepo base config.
312
312
  */
313
313
  const TSCONFIG_FILENAMES = ["tsconfig.json", "tsconfig.base.json"];
314
+ const DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS = [".react-doctor", "audit-backups"];
314
315
  /**
315
316
  * Project-config files that `StagedFiles.materialize` copies into
316
317
  * the temp directory alongside staged sources so oxlint resolves
@@ -22136,7 +22137,7 @@ Union([
22136
22137
  ]);
22137
22138
  //#endregion
22138
22139
  //#region ../../node_modules/.pnpm/baseline-browser-mapping@2.9.19/node_modules/baseline-browser-mapping/dist/index.cjs
22139
- var require_dist = /* @__PURE__ */ __commonJSMin$1(((exports) => {
22140
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
22140
22141
  const s = {
22141
22142
  chrome: { releases: [
22142
22143
  [
@@ -41386,7 +41387,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin$1(((exports) => {
41386
41387
  }));
41387
41388
  //#endregion
41388
41389
  //#region ../../node_modules/.pnpm/node-releases@2.0.27/node_modules/node-releases/data/processed/envs.json
41389
- var require_envs = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
41390
+ var require_envs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41390
41391
  module.exports = [
41391
41392
  {
41392
41393
  "name": "nodejs",
@@ -44168,7 +44169,7 @@ var require_envs = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44168
44169
  }));
44169
44170
  //#endregion
44170
44171
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/data/browsers.js
44171
- var require_browsers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44172
+ var require_browsers$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44172
44173
  module.exports = {
44173
44174
  A: "ie",
44174
44175
  B: "edge",
@@ -44193,12 +44194,12 @@ var require_browsers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44193
44194
  }));
44194
44195
  //#endregion
44195
44196
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/browsers.js
44196
- var require_browsers = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44197
+ var require_browsers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44197
44198
  module.exports.browsers = require_browsers$1();
44198
44199
  }));
44199
44200
  //#endregion
44200
44201
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/data/browserVersions.js
44201
- var require_browserVersions$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44202
+ var require_browserVersions$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44202
44203
  module.exports = {
44203
44204
  "0": "117",
44204
44205
  "1": "118",
@@ -44450,12 +44451,12 @@ var require_browserVersions$1 = /* @__PURE__ */ __commonJSMin$1(((exports, modul
44450
44451
  }));
44451
44452
  //#endregion
44452
44453
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/browserVersions.js
44453
- var require_browserVersions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44454
+ var require_browserVersions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44454
44455
  module.exports.browserVersions = require_browserVersions$1();
44455
44456
  }));
44456
44457
  //#endregion
44457
44458
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/data/agents.js
44458
- var require_agents$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
44459
+ var require_agents$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44459
44460
  module.exports = {
44460
44461
  A: {
44461
44462
  A: {
@@ -48824,7 +48825,7 @@ var require_agents$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
48824
48825
  }));
48825
48826
  //#endregion
48826
48827
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/agents.js
48827
- var require_agents = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
48828
+ var require_agents = /* @__PURE__ */ __commonJSMin(((exports, module) => {
48828
48829
  const browsers = require_browsers().browsers;
48829
48830
  const versions = require_browserVersions().browserVersions;
48830
48831
  const agentsData = require_agents$1();
@@ -48857,7 +48858,7 @@ var require_agents = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
48857
48858
  }));
48858
48859
  //#endregion
48859
48860
  //#region ../../node_modules/.pnpm/electron-to-chromium@1.5.286/node_modules/electron-to-chromium/versions.js
48860
- var require_versions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
48861
+ var require_versions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
48861
48862
  module.exports = {
48862
48863
  "0.20": "39",
48863
48864
  "0.21": "41",
@@ -49091,7 +49092,7 @@ var require_versions = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49091
49092
  }));
49092
49093
  //#endregion
49093
49094
  //#region ../../node_modules/.pnpm/node-releases@2.0.27/node_modules/node-releases/data/release-schedule/release-schedule.json
49094
- var require_release_schedule = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49095
+ var require_release_schedule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49095
49096
  module.exports = {
49096
49097
  "v0.8": {
49097
49098
  "start": "2012-06-25",
@@ -49248,7 +49249,7 @@ var require_release_schedule = /* @__PURE__ */ __commonJSMin$1(((exports, module
49248
49249
  }));
49249
49250
  //#endregion
49250
49251
  //#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/error.js
49251
- var require_error = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49252
+ var require_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49252
49253
  function BrowserslistError(message) {
49253
49254
  this.name = "BrowserslistError";
49254
49255
  this.message = message;
@@ -49260,7 +49261,7 @@ var require_error = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49260
49261
  }));
49261
49262
  //#endregion
49262
49263
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/lib/statuses.js
49263
- var require_statuses = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49264
+ var require_statuses = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49264
49265
  module.exports = {
49265
49266
  1: "ls",
49266
49267
  2: "rec",
@@ -49273,7 +49274,7 @@ var require_statuses = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49273
49274
  }));
49274
49275
  //#endregion
49275
49276
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/lib/supported.js
49276
- var require_supported = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49277
+ var require_supported = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49277
49278
  module.exports = {
49278
49279
  y: 1,
49279
49280
  n: 2,
@@ -49286,7 +49287,7 @@ var require_supported = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49286
49287
  }));
49287
49288
  //#endregion
49288
49289
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/feature.js
49289
- var require_feature = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49290
+ var require_feature = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49290
49291
  const statuses = require_statuses();
49291
49292
  const supported = require_supported();
49292
49293
  const browsers = require_browsers().browsers;
@@ -49329,7 +49330,7 @@ var require_feature = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49329
49330
  }));
49330
49331
  //#endregion
49331
49332
  //#region ../../node_modules/.pnpm/caniuse-lite@1.0.30001769/node_modules/caniuse-lite/dist/unpacker/region.js
49332
- var require_region = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49333
+ var require_region = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49333
49334
  const browsers = require_browsers().browsers;
49334
49335
  function unpackRegion(packed) {
49335
49336
  return Object.keys(packed).reduce((list, browser) => {
@@ -49348,7 +49349,7 @@ var require_region = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49348
49349
  }));
49349
49350
  //#endregion
49350
49351
  //#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/node.js
49351
- var require_node = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49352
+ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49352
49353
  var feature = require_feature().default;
49353
49354
  var region = require_region().default;
49354
49355
  var fs$2 = __require("fs");
@@ -49641,7 +49642,7 @@ var require_node = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49641
49642
  }));
49642
49643
  //#endregion
49643
49644
  //#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/parse.js
49644
- var require_parse = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49645
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49645
49646
  var AND_REGEXP = /^\s+and\s+(.*)/i;
49646
49647
  var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i;
49647
49648
  function flatten(array) {
@@ -49707,7 +49708,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49707
49708
  }));
49708
49709
  //#endregion
49709
49710
  //#region ../../node_modules/.pnpm/browserslist@4.28.1/node_modules/browserslist/index.js
49710
- var require_browserslist = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
49711
+ var require_browserslist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
49711
49712
  var bbm = require_dist();
49712
49713
  var jsReleases = require_envs();
49713
49714
  var agents = require_agents().agents;
@@ -50729,8 +50730,8 @@ var require_browserslist = /* @__PURE__ */ __commonJSMin$1(((exports, module) =>
50729
50730
  }));
50730
50731
  //#endregion
50731
50732
  //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Brand.js
50732
- var import_semver = /* @__PURE__ */ __toESM$1(require_semver(), 1);
50733
- var import_browserslist = /* @__PURE__ */ __toESM$1(require_browserslist(), 1);
50733
+ var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
50734
+ var import_browserslist = /* @__PURE__ */ __toESM(require_browserslist(), 1);
50734
50735
  /**
50735
50736
  * Returns a `Constructor` that **does not apply any runtime checks** and just
50736
50737
  * returns the provided value.
@@ -60327,6 +60328,72 @@ const warn$1 = (...args) => consoleWith((console) => sync$2(() => {
60327
60328
  }));
60328
60329
  //#endregion
60329
60330
  //#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Cache.js
60331
+ var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
60332
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
60333
+ let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
60334
+ let formatter = (open, close, replace = open) => (input) => {
60335
+ let string = "" + input, index = string.indexOf(close, open.length);
60336
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
60337
+ };
60338
+ let replaceClose = (string, close, replace, index) => {
60339
+ let result = "", cursor = 0;
60340
+ do {
60341
+ result += string.substring(cursor, index) + replace;
60342
+ cursor = index + close.length;
60343
+ index = string.indexOf(close, cursor);
60344
+ } while (~index);
60345
+ return result + string.substring(cursor);
60346
+ };
60347
+ let createColors = (enabled = isColorSupported) => {
60348
+ let f = enabled ? formatter : () => String;
60349
+ return {
60350
+ isColorSupported: enabled,
60351
+ reset: f("\x1B[0m", "\x1B[0m"),
60352
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
60353
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
60354
+ italic: f("\x1B[3m", "\x1B[23m"),
60355
+ underline: f("\x1B[4m", "\x1B[24m"),
60356
+ inverse: f("\x1B[7m", "\x1B[27m"),
60357
+ hidden: f("\x1B[8m", "\x1B[28m"),
60358
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
60359
+ black: f("\x1B[30m", "\x1B[39m"),
60360
+ red: f("\x1B[31m", "\x1B[39m"),
60361
+ green: f("\x1B[32m", "\x1B[39m"),
60362
+ yellow: f("\x1B[33m", "\x1B[39m"),
60363
+ blue: f("\x1B[34m", "\x1B[39m"),
60364
+ magenta: f("\x1B[35m", "\x1B[39m"),
60365
+ cyan: f("\x1B[36m", "\x1B[39m"),
60366
+ white: f("\x1B[37m", "\x1B[39m"),
60367
+ gray: f("\x1B[90m", "\x1B[39m"),
60368
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
60369
+ bgRed: f("\x1B[41m", "\x1B[49m"),
60370
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
60371
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
60372
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
60373
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
60374
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
60375
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
60376
+ blackBright: f("\x1B[90m", "\x1B[39m"),
60377
+ redBright: f("\x1B[91m", "\x1B[39m"),
60378
+ greenBright: f("\x1B[92m", "\x1B[39m"),
60379
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
60380
+ blueBright: f("\x1B[94m", "\x1B[39m"),
60381
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
60382
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
60383
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
60384
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
60385
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
60386
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
60387
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
60388
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
60389
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
60390
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
60391
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
60392
+ };
60393
+ };
60394
+ module.exports = createColors();
60395
+ module.exports.createColors = createColors;
60396
+ })))(), 1);
60330
60397
  /**
60331
60398
  * Caches values loaded by an Effect lookup function.
60332
60399
  *
@@ -62296,34 +62363,13 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
62296
62363
  }
62297
62364
  //#endregion
62298
62365
  //#region ../core/dist/index.js
62299
- var __create = Object.create;
62300
- var __defProp = Object.defineProperty;
62301
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
62302
- var __getOwnPropNames = Object.getOwnPropertyNames;
62303
- var __getProtoOf = Object.getPrototypeOf;
62304
- var __hasOwnProp = Object.prototype.hasOwnProperty;
62305
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
62306
- var __copyProps = (to, from, except, desc) => {
62307
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
62308
- key = keys[i];
62309
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
62310
- get: ((k) => from[k]).bind(null, key),
62311
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
62312
- });
62313
- }
62314
- return to;
62315
- };
62316
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
62317
- value: mod,
62318
- enumerable: true
62319
- }) : target, mod));
62320
62366
  var ProjectNotFoundError = class extends Error {
62321
62367
  name = "ProjectNotFoundError";
62322
62368
  directory;
62323
62369
  kind;
62324
62370
  constructor(directory, options) {
62325
62371
  const kind = options?.kind ?? "no-project";
62326
- super(kind === "missing-path" ? `Scan target "${directory}" does not exist. Check the path and try again.` : `No React project found in ${directory}. Expected a package.json at the directory root or a nested package.json with a React dependency.`, options);
62372
+ super(kind === "missing-path" ? `Scan target "${directory}" does not exist. Check the path and try again.` : `No React or Three.js project found in ${directory}. Expected a package.json at the directory root or a nested package.json with a React or Three.js dependency.`, options);
62327
62373
  this.directory = directory;
62328
62374
  this.kind = kind;
62329
62375
  }
@@ -62357,7 +62403,7 @@ var AmbiguousProjectError = class extends Error {
62357
62403
  directory;
62358
62404
  candidates;
62359
62405
  constructor(directory, candidates, options) {
62360
- super(`Multiple React projects found under ${directory} (${candidates.length} candidates): ${candidates.join(", ")}. Re-run diagnose() with one of those subdirectories, or iterate them yourself.`, options);
62406
+ super(`Multiple React or Three.js projects found under ${directory} (${candidates.length} candidates): ${candidates.join(", ")}. Re-run diagnose() with one of those subdirectories, or iterate them yourself.`, options);
62361
62407
  this.directory = directory;
62362
62408
  this.candidates = candidates;
62363
62409
  }
@@ -63691,15 +63737,29 @@ const detectPreES2023Target = (directory) => {
63691
63737
  }
63692
63738
  return false;
63693
63739
  };
63740
+ const SHADCN_CONFIG_FILE_NAME = "components.json";
63741
+ const detectShadcnUi = (directory) => {
63742
+ if (isFile(path$1$1.join(directory, SHADCN_CONFIG_FILE_NAME))) return true;
63743
+ if (isProjectBoundary(directory)) return false;
63744
+ let ancestorDirectory = path$1$1.dirname(directory);
63745
+ while (ancestorDirectory !== path$1$1.dirname(ancestorDirectory)) {
63746
+ if (isFile(path$1$1.join(ancestorDirectory, SHADCN_CONFIG_FILE_NAME))) return true;
63747
+ if (isProjectBoundary(ancestorDirectory)) return false;
63748
+ ancestorDirectory = path$1$1.dirname(ancestorDirectory);
63749
+ }
63750
+ return false;
63751
+ };
63694
63752
  const FRAMEWORK_PACKAGES = {
63695
63753
  next: "nextjs",
63696
63754
  "@tanstack/react-start": "tanstack-start",
63697
63755
  "@remix-run/react": "remix",
63698
63756
  gatsby: "gatsby",
63699
63757
  astro: "astro",
63758
+ "@astrojs/react": "astro",
63700
63759
  vite: "vite",
63701
63760
  "react-scripts": "cra",
63702
63761
  expo: "expo",
63762
+ "expo-router": "expo",
63703
63763
  "react-native": "react-native"
63704
63764
  };
63705
63765
  const detectFramework = (dependencies) => {
@@ -64191,20 +64251,39 @@ const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
64191
64251
  version: null
64192
64252
  };
64193
64253
  };
64194
- const REACT_DEPENDENCY_NAMES = new Set([
64254
+ const REACT_PROJECT_DEPENDENCY_NAMES = new Set([
64195
64255
  "react",
64256
+ "react-dom",
64196
64257
  "react-native",
64197
64258
  "next",
64198
- "preact"
64259
+ "preact",
64260
+ "expo",
64261
+ "expo-router",
64262
+ "gatsby",
64263
+ "@remix-run/react",
64264
+ "@tanstack/react-start",
64265
+ "react-scripts",
64266
+ "@astrojs/react"
64199
64267
  ]);
64268
+ const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
64269
+ const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [
64270
+ ...REACT_THREE_FIBER_DEPENDENCY_NAMES,
64271
+ "@react-three/drei",
64272
+ "@react-three/rapier",
64273
+ "@react-three/postprocessing",
64274
+ "@react-three/xr",
64275
+ "@react-three/cannon"
64276
+ ];
64277
+ const THREE_DEPENDENCY_NAMES = ["three", ...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES];
64200
64278
  const hasReactDependency = (packageJson) => {
64201
64279
  const allDependencies = {
64202
64280
  ...packageJson.peerDependencies,
64203
64281
  ...packageJson.dependencies,
64204
64282
  ...packageJson.devDependencies
64205
64283
  };
64206
- return Object.keys(allDependencies).some((packageName) => REACT_DEPENDENCY_NAMES.has(packageName));
64284
+ return Object.keys(allDependencies).some((packageName) => REACT_PROJECT_DEPENDENCY_NAMES.has(packageName));
64207
64285
  };
64286
+ const hasSupportedProjectDependency = (packageJson) => hasReactDependency(packageJson) || getDependencySpec(packageJson, "remotion") !== null || THREE_DEPENDENCY_NAMES.some((packageName) => getDependencySpec(packageJson, packageName) !== null);
64208
64287
  const getPreactVersion = (packageJson) => getDependencySpec(packageJson, "preact");
64209
64288
  const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, sourceDirectory = rootDirectory, sourcePackageJson = rootPackageJson, version }) => {
64210
64289
  if (version === null || !isCatalogReference(version)) return version;
@@ -64395,7 +64474,7 @@ const listWorkspacePackages = (rootDirectory) => {
64395
64474
  seenDirectories.add(workspacePackage.directory);
64396
64475
  packages.push(workspacePackage);
64397
64476
  };
64398
- if (hasReactDependency(packageJson)) pushIfNew({
64477
+ if (hasSupportedProjectDependency(packageJson)) pushIfNew({
64399
64478
  name: packageJson.name ?? path$1$1.basename(rootDirectory),
64400
64479
  directory: rootDirectory
64401
64480
  });
@@ -64403,7 +64482,7 @@ const listWorkspacePackages = (rootDirectory) => {
64403
64482
  const directories = resolveWorkspaceDirectories(rootDirectory, pattern);
64404
64483
  for (const workspaceDirectory of directories) {
64405
64484
  const workspacePackageJson = readPackageJson(path$1$1.join(workspaceDirectory, "package.json"));
64406
- if (!hasReactDependency(workspacePackageJson)) continue;
64485
+ if (!hasSupportedProjectDependency(workspacePackageJson)) continue;
64407
64486
  pushIfNew({
64408
64487
  name: workspacePackageJson.name ?? path$1$1.basename(workspaceDirectory),
64409
64488
  directory: workspaceDirectory
@@ -64435,6 +64514,29 @@ const getTanStackQueryVersion = (packageJson) => {
64435
64514
  packageNames: TANSTACK_REACT_QUERY_PACKAGES
64436
64515
  });
64437
64516
  };
64517
+ const hasAnyDependency = (packageJson, packageNames) => {
64518
+ const allDependencies = {
64519
+ ...packageJson.peerDependencies,
64520
+ ...packageJson.dependencies,
64521
+ ...packageJson.devDependencies,
64522
+ ...packageJson.optionalDependencies
64523
+ };
64524
+ return packageNames.some((packageName) => allDependencies[packageName] !== void 0);
64525
+ };
64526
+ const BASE_UI_PACKAGES = ["@base-ui-components/react", "@base-ui/react"];
64527
+ const hasBaseUiDependency = (packageJson) => hasAnyDependency(packageJson, BASE_UI_PACKAGES);
64528
+ const RADIX_UNIFIED_PACKAGE = "radix-ui";
64529
+ const RADIX_PRIMITIVE_PACKAGE_PREFIX = "@radix-ui/react-";
64530
+ const RADIX_NON_PRIMITIVE_PACKAGES = new Set(["@radix-ui/react-icons"]);
64531
+ const hasRadixUiDependency = (packageJson) => {
64532
+ const allDependencies = {
64533
+ ...packageJson.peerDependencies,
64534
+ ...packageJson.dependencies,
64535
+ ...packageJson.devDependencies,
64536
+ ...packageJson.optionalDependencies
64537
+ };
64538
+ return Object.keys(allDependencies).some((packageName) => packageName === RADIX_UNIFIED_PACKAGE || packageName.startsWith(RADIX_PRIMITIVE_PACKAGE_PREFIX) && !RADIX_NON_PRIMITIVE_PACKAGES.has(packageName));
64539
+ };
64438
64540
  const STYLED_COMPONENTS_PACKAGES = ["styled-components"];
64439
64541
  const getStyledComponentsVersion = (packageJson) => {
64440
64542
  return getPreferredDependencyVersion({
@@ -64465,12 +64567,15 @@ const hasI18nDependency = (packageJson) => {
64465
64567
  };
64466
64568
  return I18N_PACKAGES.some((packageName) => allDependencies[packageName] !== void 0);
64467
64569
  };
64570
+ const REACT_ARIA_COMPONENT_PACKAGES = ["react-aria-components"];
64571
+ const TANSTACK_TABLE_PACKAGES = ["@tanstack/react-table"];
64572
+ const TANSTACK_VIRTUAL_PACKAGES = ["@tanstack/react-virtual"];
64573
+ const TANSTACK_FORM_PACKAGES = ["@tanstack/react-form"];
64468
64574
  const REANIMATED_DEPENDENCY_NAME = "react-native-reanimated";
64469
64575
  const MOBX_REACT_PACKAGE_NAME = "mobx-react";
64470
64576
  const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
64471
64577
  const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
64472
64578
  const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
64473
- const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
64474
64579
  const REACT_THREE_FIBER_SECTIONS = [
64475
64580
  "dependencies",
64476
64581
  "peerDependencies",
@@ -64483,8 +64588,6 @@ const THREE_DEPENDENCY_SECTIONS = [
64483
64588
  "optionalDependencies",
64484
64589
  "devDependencies"
64485
64590
  ];
64486
- const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
64487
- const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
64488
64591
  const REACT_ROUTER_DEPENDENCY_NAMES = [
64489
64592
  "@react-router/dev",
64490
64593
  "react-router-dom",
@@ -64658,6 +64761,13 @@ const evaluateManifestFacts = (facts, packageJson, directory, rootDirectory, roo
64658
64761
  });
64659
64762
  if (styledComponentsVersion && shouldReplaceStyledComponentsVersion(facts.styledComponentsVersion, styledComponentsVersion)) facts.styledComponentsVersion = styledComponentsVersion;
64660
64763
  facts.hasI18nLibrary = facts.hasI18nLibrary || hasI18nDependency(packageJson);
64764
+ facts.hasShadcnUi = facts.hasShadcnUi || detectShadcnUi(directory);
64765
+ facts.hasRadixUi = facts.hasRadixUi || hasRadixUiDependency(packageJson);
64766
+ facts.hasBaseUi = facts.hasBaseUi || hasBaseUiDependency(packageJson);
64767
+ facts.hasReactAriaComponents = facts.hasReactAriaComponents || hasAnyDependency(packageJson, REACT_ARIA_COMPONENT_PACKAGES);
64768
+ facts.hasTanstackTable = facts.hasTanstackTable || hasAnyDependency(packageJson, TANSTACK_TABLE_PACKAGES);
64769
+ facts.hasTanstackVirtual = facts.hasTanstackVirtual || hasAnyDependency(packageJson, TANSTACK_VIRTUAL_PACKAGES);
64770
+ facts.hasTanstackForm = facts.hasTanstackForm || hasAnyDependency(packageJson, TANSTACK_FORM_PACKAGES);
64661
64771
  for (const packageName of REACT_THREE_FIBER_DEPENDENCY_NAMES) {
64662
64772
  const version = resolveCatalogBackedDependencyVersion({
64663
64773
  rootDirectory,
@@ -64760,6 +64870,13 @@ const collectWorkspaceFacts = (rootDirectory, rootPackageJson, { collectReactGro
64760
64870
  tanstackQueryVersion: null,
64761
64871
  styledComponentsVersion: null,
64762
64872
  hasI18nLibrary: false,
64873
+ hasShadcnUi: false,
64874
+ hasRadixUi: false,
64875
+ hasBaseUi: false,
64876
+ hasReactAriaComponents: false,
64877
+ hasTanstackTable: false,
64878
+ hasTanstackVirtual: false,
64879
+ hasTanstackForm: false,
64763
64880
  hasReactNativeAwarePackage: false,
64764
64881
  hasReanimatedAwarePackage: false,
64765
64882
  hasSsrDependency: false,
@@ -64985,13 +65102,13 @@ const detectTargetBlankOpenerProtection = (directory, packageJson) => {
64985
65102
  if (browserslistRequirement === "noreferrer" || electronRequirement === "noreferrer") return "noreferrer";
64986
65103
  if (browserslistRequirement === "noopener" || electronRequirement === "noopener") return "noopener";
64987
65104
  };
64988
- const toReactWorkspacePackages = (directories) => {
65105
+ const toSupportedWorkspacePackages = (directories) => {
64989
65106
  const packages = [];
64990
65107
  for (const directory of directories) {
64991
65108
  const packageJsonPath = path$1$1.join(directory, "package.json");
64992
65109
  if (!isFile(packageJsonPath)) continue;
64993
65110
  const packageJson = readPackageJson(packageJsonPath);
64994
- if (!hasReactDependency(packageJson)) continue;
65111
+ if (!hasSupportedProjectDependency(packageJson)) continue;
64995
65112
  const name = packageJson.name ?? path$1$1.basename(directory);
64996
65113
  packages.push({
64997
65114
  name,
@@ -65004,7 +65121,7 @@ const listManifestWorkspacePackages = (rootDirectory) => {
65004
65121
  if (isFile(path$1$1.join(rootDirectory, "package.json"))) return listWorkspacePackages(rootDirectory);
65005
65122
  const patterns = parsePnpmWorkspacePatterns(rootDirectory);
65006
65123
  const nxPatterns = patterns.length > 0 ? [] : getNxWorkspaceDirectories(rootDirectory);
65007
- return toReactWorkspacePackages((patterns.length > 0 ? patterns : nxPatterns).flatMap((pattern) => resolveWorkspaceDirectories(rootDirectory, pattern)));
65124
+ return toSupportedWorkspacePackages((patterns.length > 0 ? patterns : nxPatterns).flatMap((pattern) => resolveWorkspaceDirectories(rootDirectory, pattern)));
65008
65125
  };
65009
65126
  const NON_PROJECT_DIRECTORIES = new Set([
65010
65127
  "AppData",
@@ -65012,7 +65129,7 @@ const NON_PROJECT_DIRECTORIES = new Set([
65012
65129
  "Library"
65013
65130
  ]);
65014
65131
  const MAX_SCAN_DEPTH = 6;
65015
- const discoverReactSubprojectsByFilesystem = (rootDirectory) => {
65132
+ const discoverSupportedSubprojectsByFilesystem = (rootDirectory) => {
65016
65133
  const packages = [];
65017
65134
  const pendingDirectories = [{
65018
65135
  directory: rootDirectory,
@@ -65025,7 +65142,7 @@ const discoverReactSubprojectsByFilesystem = (rootDirectory) => {
65025
65142
  const packageJsonPath = path$1$1.join(currentDirectory, "package.json");
65026
65143
  if (isFile(packageJsonPath)) {
65027
65144
  const packageJson = readPackageJson(packageJsonPath);
65028
- if (hasReactDependency(packageJson)) {
65145
+ if (hasSupportedProjectDependency(packageJson)) {
65029
65146
  const name = packageJson.name ?? path$1$1.basename(currentDirectory);
65030
65147
  packages.push({
65031
65148
  name,
@@ -65045,11 +65162,11 @@ const discoverReactSubprojectsByFilesystem = (rootDirectory) => {
65045
65162
  }
65046
65163
  return packages;
65047
65164
  };
65048
- const discoverReactSubprojects = (rootDirectory) => {
65165
+ const discoverSupportedSubprojects = (rootDirectory) => {
65049
65166
  if (!isDirectory(rootDirectory)) return [];
65050
65167
  const manifestPackages = listManifestWorkspacePackages(rootDirectory);
65051
65168
  if (manifestPackages.length > 0) return manifestPackages;
65052
- return discoverReactSubprojectsByFilesystem(rootDirectory);
65169
+ return discoverSupportedSubprojectsByFilesystem(rootDirectory);
65053
65170
  };
65054
65171
  const cachedProjectInfos = /* @__PURE__ */ new Map();
65055
65172
  /**
@@ -65104,6 +65221,12 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
65104
65221
  remotionVersion: null,
65105
65222
  remotionMajorVersion: null,
65106
65223
  hasI18nLibrary: false,
65224
+ hasRadixUi: false,
65225
+ hasBaseUi: false,
65226
+ hasReactAriaComponents: false,
65227
+ hasTanstackTable: false,
65228
+ hasTanstackVirtual: false,
65229
+ hasTanstackForm: false,
65107
65230
  tanstackQueryVersion: null,
65108
65231
  styledComponentsVersion: null,
65109
65232
  hasThree: false,
@@ -65125,6 +65248,7 @@ const discoverProjectWithoutPackageJson = (directory, options) => {
65125
65248
  shopifyFlashListMajorVersion: null,
65126
65249
  hasReanimated: false,
65127
65250
  reanimatedVersion: null,
65251
+ hasShadcnUi: detectShadcnUi(directory),
65128
65252
  isPreES2023Target: hasOwnTsConfig && detectPreES2023Target(directory),
65129
65253
  isStaticExport: false,
65130
65254
  sourceFileCount
@@ -65287,6 +65411,12 @@ const discoverProject = (directory, options = {}) => {
65287
65411
  hasReactCompilerLintPlugin: detectReactCompilerLintPlugin(directory, packageJson),
65288
65412
  hasTanStackQuery: tanstackQueryVersion !== null,
65289
65413
  hasI18nLibrary: workspaceFacts.hasI18nLibrary,
65414
+ hasRadixUi: workspaceFacts.hasRadixUi,
65415
+ hasBaseUi: workspaceFacts.hasBaseUi,
65416
+ hasReactAriaComponents: workspaceFacts.hasReactAriaComponents,
65417
+ hasTanstackTable: workspaceFacts.hasTanstackTable,
65418
+ hasTanstackVirtual: workspaceFacts.hasTanstackVirtual,
65419
+ hasTanstackForm: workspaceFacts.hasTanstackForm,
65290
65420
  tanstackQueryVersion,
65291
65421
  styledComponentsVersion: workspaceFacts.styledComponentsVersion,
65292
65422
  valtioVersion,
@@ -65313,6 +65443,7 @@ const discoverProject = (directory, options = {}) => {
65313
65443
  shopifyFlashListMajorVersion: shopifyFlashListVersion === null ? null : getLowestDependencyMajor(shopifyFlashListVersion),
65314
65444
  hasReanimated,
65315
65445
  reanimatedVersion,
65446
+ hasShadcnUi: workspaceFacts.hasShadcnUi,
65316
65447
  isPreES2023Target,
65317
65448
  isStaticExport: framework === "nextjs" && detectNextjsStaticExport(workspaceFacts.next.sourceDirectory ?? directory),
65318
65449
  sourceFileCount
@@ -65320,16 +65451,31 @@ const discoverProject = (directory, options = {}) => {
65320
65451
  cachedProjectInfos.set(directory, projectInfo);
65321
65452
  return projectInfo;
65322
65453
  };
65454
+ const REACT_COMPATIBLE_FRAMEWORKS = new Set([
65455
+ "nextjs",
65456
+ "tanstack-start",
65457
+ "cra",
65458
+ "remix",
65459
+ "gatsby",
65460
+ "expo",
65461
+ "react-native",
65462
+ "preact"
65463
+ ]);
65323
65464
  /**
65324
- * A project is worth scanning when it has React/Preact (the framework-
65465
+ * Whether project discovery resolved a React-compatible runtime directly or
65466
+ * through a framework whose runtime is necessarily React-compatible.
65467
+ */
65468
+ const hasReactRuntime = (project) => project.reactVersion !== null || project.preactVersion !== null || REACT_COMPATIBLE_FRAMEWORKS.has(project.framework);
65469
+ /**
65470
+ * A project is worth scanning when it has a supported runtime (the runtime-
65325
65471
  * specific rules apply) OR it simply has source files to lint. The
65326
65472
  * second arm is what lets a plain TypeScript/JavaScript codebase — no
65327
65473
  * React dependency at all — run the framework-agnostic rules
65328
65474
  * (security, architecture, zod, bundle-size, …) instead of hard-failing
65329
- * with "No React dependency". Only a directory with neither React nor a
65330
- * single source file has nothing to analyze.
65475
+ * with "No React dependency". Only a directory with neither a supported
65476
+ * runtime nor a single source file has nothing to analyze.
65331
65477
  */
65332
- const isAnalyzableProject = (project) => project.reactVersion !== null || project.preactVersion !== null || project.sourceFileCount > 0;
65478
+ const isAnalyzableProject = (project) => hasReactRuntime(project) || project.hasThree === true || project.hasRemotion === true || project.sourceFileCount > 0;
65333
65479
  const LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY = {
65334
65480
  "deslop/circular-dependency": "react-doctor/circular-dependency",
65335
65481
  "deslop/unused-dependency": "react-doctor/unused-dependency",
@@ -67503,11 +67649,11 @@ const resolveConfigRootDir = (config, configSourceDirectory) => {
67503
67649
  };
67504
67650
  const resolveDiagnoseTarget = (directory, options = {}) => {
67505
67651
  if (isFile(path$1$1.join(directory, "package.json"))) return directory;
67506
- const reactSubprojects = discoverReactSubprojects(directory);
67507
- if (reactSubprojects.length === 0) return null;
67508
- if (reactSubprojects.length === 1) return reactSubprojects[0].directory;
67652
+ const subprojects = discoverSupportedSubprojects(directory);
67653
+ if (subprojects.length === 0) return null;
67654
+ if (subprojects.length === 1) return subprojects[0].directory;
67509
67655
  if (options.allowAmbiguous === true) return null;
67510
- throw new AmbiguousProjectError(directory, reactSubprojects.map((subproject) => path$1$1.relative(directory, subproject.directory)).toSorted());
67656
+ throw new AmbiguousProjectError(directory, subprojects.map((subproject) => path$1$1.relative(directory, subproject.directory)).toSorted());
67511
67657
  };
67512
67658
  /**
67513
67659
  * The canonical entry-point translation shared by every public shell
@@ -69242,21 +69388,6 @@ function* collectSecurityScanFiles(rootDirectory, excludedDirectories = /* @__PU
69242
69388
  }
69243
69389
  }
69244
69390
  }
69245
- const REACT_COMPATIBLE_FRAMEWORKS = new Set([
69246
- "nextjs",
69247
- "tanstack-start",
69248
- "cra",
69249
- "remix",
69250
- "gatsby",
69251
- "expo",
69252
- "react-native",
69253
- "preact"
69254
- ]);
69255
- /**
69256
- * Whether project discovery resolved a React-compatible runtime directly or
69257
- * through a framework whose runtime is necessarily React-compatible.
69258
- */
69259
- const hasReactRuntime = (project) => project.reactVersion !== null || project.preactVersion !== null || REACT_COMPATIBLE_FRAMEWORKS.has(project.framework);
69260
69391
  const CLIENT_ONLY_FRAMEWORKS = new Set([
69261
69392
  "vite",
69262
69393
  "cra",
@@ -69317,6 +69448,13 @@ const buildCapabilities = (project) => {
69317
69448
  minor: 0
69318
69449
  })) capabilities.add("tailwind:4");
69319
69450
  }
69451
+ if (project.hasShadcnUi === true) capabilities.add("shadcn");
69452
+ if (project.hasRadixUi === true) capabilities.add("radix-ui");
69453
+ if (project.hasBaseUi === true) capabilities.add("base-ui");
69454
+ if (project.hasReactAriaComponents === true) capabilities.add("react-aria");
69455
+ if (project.hasTanstackTable === true) capabilities.add("tanstack-table");
69456
+ if (project.hasTanstackVirtual === true) capabilities.add("tanstack-virtual");
69457
+ if (project.hasTanstackForm === true) capabilities.add("tanstack-form");
69320
69458
  if (project.zodVersion !== null) capabilities.add("zod");
69321
69459
  if (project.zodMajorVersion !== null && project.zodMajorVersion >= 4) capabilities.add("zod:4");
69322
69460
  if (project.mobxVersion !== void 0 && project.mobxVersion !== null || project.hasMobxReact === true || project.hasMobxReactLite === true || project.hasMobxStateTree === true || project.hasMobxReactObserver === true) capabilities.add("mobx");
@@ -69494,72 +69632,6 @@ const checkSecurityScanCooperative = async (rootDirectory, options = {}) => {
69494
69632
  }
69495
69633
  return session.diagnostics;
69496
69634
  };
69497
- var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
69498
- let p = process || {}, argv = p.argv || [], env = p.env || {};
69499
- let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
69500
- let formatter = (open, close, replace = open) => (input) => {
69501
- let string = "" + input, index = string.indexOf(close, open.length);
69502
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
69503
- };
69504
- let replaceClose = (string, close, replace, index) => {
69505
- let result = "", cursor = 0;
69506
- do {
69507
- result += string.substring(cursor, index) + replace;
69508
- cursor = index + close.length;
69509
- index = string.indexOf(close, cursor);
69510
- } while (~index);
69511
- return result + string.substring(cursor);
69512
- };
69513
- let createColors = (enabled = isColorSupported) => {
69514
- let f = enabled ? formatter : () => String;
69515
- return {
69516
- isColorSupported: enabled,
69517
- reset: f("\x1B[0m", "\x1B[0m"),
69518
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
69519
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
69520
- italic: f("\x1B[3m", "\x1B[23m"),
69521
- underline: f("\x1B[4m", "\x1B[24m"),
69522
- inverse: f("\x1B[7m", "\x1B[27m"),
69523
- hidden: f("\x1B[8m", "\x1B[28m"),
69524
- strikethrough: f("\x1B[9m", "\x1B[29m"),
69525
- black: f("\x1B[30m", "\x1B[39m"),
69526
- red: f("\x1B[31m", "\x1B[39m"),
69527
- green: f("\x1B[32m", "\x1B[39m"),
69528
- yellow: f("\x1B[33m", "\x1B[39m"),
69529
- blue: f("\x1B[34m", "\x1B[39m"),
69530
- magenta: f("\x1B[35m", "\x1B[39m"),
69531
- cyan: f("\x1B[36m", "\x1B[39m"),
69532
- white: f("\x1B[37m", "\x1B[39m"),
69533
- gray: f("\x1B[90m", "\x1B[39m"),
69534
- bgBlack: f("\x1B[40m", "\x1B[49m"),
69535
- bgRed: f("\x1B[41m", "\x1B[49m"),
69536
- bgGreen: f("\x1B[42m", "\x1B[49m"),
69537
- bgYellow: f("\x1B[43m", "\x1B[49m"),
69538
- bgBlue: f("\x1B[44m", "\x1B[49m"),
69539
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
69540
- bgCyan: f("\x1B[46m", "\x1B[49m"),
69541
- bgWhite: f("\x1B[47m", "\x1B[49m"),
69542
- blackBright: f("\x1B[90m", "\x1B[39m"),
69543
- redBright: f("\x1B[91m", "\x1B[39m"),
69544
- greenBright: f("\x1B[92m", "\x1B[39m"),
69545
- yellowBright: f("\x1B[93m", "\x1B[39m"),
69546
- blueBright: f("\x1B[94m", "\x1B[39m"),
69547
- magentaBright: f("\x1B[95m", "\x1B[39m"),
69548
- cyanBright: f("\x1B[96m", "\x1B[39m"),
69549
- whiteBright: f("\x1B[97m", "\x1B[39m"),
69550
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
69551
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
69552
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
69553
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
69554
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
69555
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
69556
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
69557
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
69558
- };
69559
- };
69560
- module.exports = createColors();
69561
- module.exports.createColors = createColors;
69562
- })))(), 1);
69563
69635
  const highlighter = {
69564
69636
  error: import_picocolors.default.red,
69565
69637
  warn: import_picocolors.default.yellow,
@@ -70975,7 +71047,11 @@ var Git = class Git extends Service()("react-doctor/Git") {
70975
71047
  const symref = yield* runGit(directory, ["symbolic-ref", "refs/remotes/origin/HEAD"]);
70976
71048
  if (symref.status === 0) {
70977
71049
  const trimmed = trimOrNull(symref.stdout);
70978
- if (trimmed !== null) return trimmed.replace("refs/remotes/origin/", "");
71050
+ if (trimmed !== null) {
71051
+ const branchName = trimmed.replace("refs/remotes/origin/", "");
71052
+ const remoteBranch = `origin/${branchName}`;
71053
+ return (yield* branchExists(directory, remoteBranch)) ? remoteBranch : branchName;
71054
+ }
70979
71055
  }
70980
71056
  const candidates = yield* runGit(directory, [
70981
71057
  "for-each-ref",
@@ -70983,7 +71059,10 @@ var Git = class Git extends Service()("react-doctor/Git") {
70983
71059
  ...DEFAULT_BRANCH_CANDIDATES.map((candidate) => `refs/heads/${candidate}`)
70984
71060
  ]);
70985
71061
  if (candidates.status !== 0) return null;
70986
- return trimOrNull(candidates.stdout.split("\n")[0] ?? "");
71062
+ const localBranch = trimOrNull(candidates.stdout.split("\n")[0] ?? "");
71063
+ if (localBranch === null) return null;
71064
+ const remoteBranch = `origin/${localBranch}`;
71065
+ return (yield* branchExists(directory, remoteBranch)) ? remoteBranch : localBranch;
70987
71066
  }).pipe(withSpan("Git.defaultBranch"));
70988
71067
  const branchExists = (directory, branch) => runGit(directory, [
70989
71068
  "rev-parse",
@@ -71482,6 +71561,19 @@ const detectUserLintConfigPaths = (rootDirectory) => {
71482
71561
  return [];
71483
71562
  };
71484
71563
  const DISABLE_DIRECTIVE_PATTERN = /(eslint|oxlint)-disable/;
71564
+ const getBackupRootDirectory = (rootDirectory) => path$1$1.join(rootDirectory, ...DISABLE_DIRECTIVE_BACKUP_DIRECTORY_SEGMENTS);
71565
+ const getBackupPath = (rootDirectory, absolutePath) => {
71566
+ if (!isPathInsideDirectory(absolutePath, rootDirectory)) return null;
71567
+ return path$1$1.join(getBackupRootDirectory(rootDirectory), path$1$1.relative(rootDirectory, absolutePath));
71568
+ };
71569
+ const removeBackupRootIfEmpty = (rootDirectory) => {
71570
+ const backupRootDirectory = getBackupRootDirectory(rootDirectory);
71571
+ if (!walkSourceTreeFiles(backupRootDirectory).next().done) return;
71572
+ fs$1$3.rmSync(backupRootDirectory, {
71573
+ recursive: true,
71574
+ force: true
71575
+ });
71576
+ };
71485
71577
  const neutralizedFileLeases = /* @__PURE__ */ new Map();
71486
71578
  const activeNeutralizationInitializations = /* @__PURE__ */ new Set();
71487
71579
  const directoriesOverlap = (left, right) => {
@@ -71573,8 +71665,50 @@ const collectNeutralizationCandidatePaths = (rootDirectory, discoveredRelativePa
71573
71665
  }
71574
71666
  return candidatePaths;
71575
71667
  };
71668
+ const recoverOrphanedBackups = (rootDirectory) => {
71669
+ const blockedPaths = /* @__PURE__ */ new Set();
71670
+ const backupRootDirectory = getBackupRootDirectory(rootDirectory);
71671
+ for (const { absolutePath: backupPath } of walkSourceTreeFiles(backupRootDirectory)) {
71672
+ const originalPath = path$1$1.join(rootDirectory, path$1$1.relative(backupRootDirectory, backupPath));
71673
+ if (neutralizedFileLeases.has(originalPath)) continue;
71674
+ let backupContent;
71675
+ let currentContent;
71676
+ try {
71677
+ backupContent = fs$1$3.readFileSync(backupPath, "utf-8");
71678
+ currentContent = fs$1$3.readFileSync(originalPath, "utf-8");
71679
+ } catch (error) {
71680
+ process.stderr.write(`[react-doctor] Could not recover ${originalPath}: ${messageFromUnknown(error)}. The backup remains at ${backupPath}.\n`);
71681
+ blockedPaths.add(originalPath);
71682
+ continue;
71683
+ }
71684
+ if (currentContent === backupContent) {
71685
+ try {
71686
+ fs$1$3.rmSync(backupPath);
71687
+ } catch (error) {
71688
+ process.stderr.write(`[react-doctor] Failed to delete stale backup ${backupPath}: ${messageFromUnknown(error)}\n`);
71689
+ blockedPaths.add(originalPath);
71690
+ }
71691
+ continue;
71692
+ }
71693
+ if (currentContent !== neutralizeContent(backupContent)) {
71694
+ process.stderr.write(`[react-doctor] Did not overwrite changed file ${originalPath}. Recover it manually from ${backupPath}.\n`);
71695
+ blockedPaths.add(originalPath);
71696
+ continue;
71697
+ }
71698
+ try {
71699
+ fs$1$3.writeFileSync(originalPath, backupContent);
71700
+ fs$1$3.rmSync(backupPath);
71701
+ } catch (error) {
71702
+ process.stderr.write(`[react-doctor] Failed to restore ${originalPath} from backup: ${messageFromUnknown(error)}\n`);
71703
+ blockedPaths.add(originalPath);
71704
+ }
71705
+ }
71706
+ removeBackupRootIfEmpty(rootDirectory);
71707
+ return blockedPaths;
71708
+ };
71576
71709
  const neutralizeDisableDirectives = async (rootDirectory, includePaths, options = {}) => {
71577
71710
  const resolvedRootDirectory = fs$1$3.realpathSync(rootDirectory);
71711
+ const blockedPaths = /* @__PURE__ */ new Set();
71578
71712
  const leasedPaths = /* @__PURE__ */ new Set();
71579
71713
  let isRestored = false;
71580
71714
  const restore = () => {
@@ -71587,16 +71721,24 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
71587
71721
  if (lease.referenceCount > 0) continue;
71588
71722
  neutralizedFileLeases.delete(absolutePath);
71589
71723
  try {
71590
- fs$1$3.writeFileSync(absolutePath, lease.originalContent);
71724
+ const currentContent = fs$1$3.readFileSync(absolutePath, "utf-8");
71725
+ if (currentContent !== lease.neutralizedContent && currentContent !== lease.originalContent) {
71726
+ process.stderr.write(`[react-doctor] Did not overwrite changed file ${absolutePath}. Recover it manually from ${lease.backupPath}.\n`);
71727
+ continue;
71728
+ }
71729
+ if (currentContent === lease.neutralizedContent) fs$1$3.writeFileSync(absolutePath, lease.originalContent);
71730
+ fs$1$3.rmSync(lease.backupPath, { force: true });
71591
71731
  } catch (error) {
71592
- process.stderr.write(`[react-doctor] Failed to restore inline disable directives in ${absolutePath}: ${messageFromUnknown(error)}\n[react-doctor] Run: git checkout -- ${absolutePath}\n`);
71732
+ process.stderr.write(`[react-doctor] Failed to restore inline disable directives in ${absolutePath}: ${messageFromUnknown(error)}. The backup remains at ${lease.backupPath}.\n`);
71593
71733
  }
71594
71734
  }
71735
+ removeBackupRootIfEmpty(resolvedRootDirectory);
71595
71736
  };
71596
71737
  const onExit = () => restore();
71597
71738
  process.once("exit", onExit);
71598
71739
  const leaseCandidatePath = (absolutePath) => {
71599
71740
  if (leasedPaths.has(absolutePath)) return;
71741
+ if (blockedPaths.has(absolutePath)) return;
71600
71742
  const existingLease = neutralizedFileLeases.get(absolutePath);
71601
71743
  if (existingLease) {
71602
71744
  existingLease.referenceCount += 1;
@@ -71611,9 +71753,20 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
71611
71753
  }
71612
71754
  const neutralizedContent = neutralizeContent(originalContent);
71613
71755
  if (neutralizedContent !== originalContent) {
71756
+ const backupPath = getBackupPath(resolvedRootDirectory, absolutePath);
71757
+ if (backupPath === null) return;
71758
+ try {
71759
+ fs$1$3.mkdirSync(path$1$1.dirname(backupPath), { recursive: true });
71760
+ fs$1$3.writeFileSync(backupPath, originalContent, { flag: "wx" });
71761
+ } catch (error) {
71762
+ process.stderr.write(`[react-doctor] Did not modify ${absolutePath}: ${messageFromUnknown(error)}. Check ${backupPath}.\n`);
71763
+ return;
71764
+ }
71614
71765
  fs$1$3.writeFileSync(absolutePath, neutralizedContent);
71615
71766
  neutralizedFileLeases.set(absolutePath, {
71767
+ backupPath,
71616
71768
  originalContent,
71769
+ neutralizedContent,
71617
71770
  referenceCount: 1
71618
71771
  });
71619
71772
  leasedPaths.add(absolutePath);
@@ -71621,6 +71774,8 @@ const neutralizeDisableDirectives = async (rootDirectory, includePaths, options
71621
71774
  };
71622
71775
  try {
71623
71776
  await withOverlappingInitializationLock(resolvedRootDirectory, async () => {
71777
+ for (const blockedPath of recoverOrphanedBackups(resolvedRootDirectory)) blockedPaths.add(blockedPath);
71778
+ if (options.recoverOnly) return;
71624
71779
  for (const absolutePath of collectNeutralizationCandidatePaths(resolvedRootDirectory, [], includePaths)) if (neutralizedFileLeases.has(absolutePath)) leaseCandidatePath(absolutePath);
71625
71780
  const discoveredRelativePaths = await (options.findFiles ?? findFilesWithDisableDirectives)(resolvedRootDirectory, includePaths);
71626
71781
  for (const absolutePath of collectNeutralizationCandidatePaths(resolvedRootDirectory, discoveredRelativePaths, includePaths)) leaseCandidatePath(absolutePath);
@@ -72876,7 +73031,7 @@ const buildRelatedLocations = (labels, filePath, sourceBuffer) => {
72876
73031
  const isOxlintSpan = (value) => isRecord(value) && typeof value.offset === "number" && typeof value.length === "number" && typeof value.line === "number" && typeof value.column === "number";
72877
73032
  const isOxlintLabel = (value) => isRecord(value) && isOxlintSpan(value.span);
72878
73033
  const isMappableOxlintDiagnostic = (value) => isRecord(value) && typeof value.code === "string" && value.code.length > 0 && typeof value.filename === "string" && value.filename.length > 0 && (value.severity === "warning" || value.severity === "error") && Array.isArray(value.labels) && value.labels.every(isOxlintLabel);
72879
- const isEngineFailureDiagnostic = (value) => !isRecord(value) || typeof value.filename !== "string" || value.filename.length === 0;
73034
+ const isEngineFailureDiagnostic = (value) => !isRecord(value) || typeof value.filename !== "string" || value.filename.length === 0 || typeof value.message === "string" && value.message.startsWith("Error running JS plugin.") && (typeof value.code !== "string" || value.code.length === 0) && Array.isArray(value.labels) && value.labels.length === 0;
72880
73035
  const isOxlintOutput = (value) => isRecord(value) && Array.isArray(value.diagnostics);
72881
73036
  /**
72882
73037
  * Parses one oxlint subprocess's stdout into a flat `Diagnostic[]`.
@@ -73006,6 +73161,46 @@ const buildProfiledNodeArguments = (input) => [
73006
73161
  ...input.heapProfileDirectory ? ["--heap-prof", `--heap-prof-dir=${input.heapProfileDirectory}`] : [],
73007
73162
  ...input.argumentsList
73008
73163
  ];
73164
+ const buildOxlintTimingArguments = (argumentsList) => {
73165
+ const timingArguments = [...argumentsList];
73166
+ const formatFlagIndex = timingArguments.indexOf("--format");
73167
+ if (formatFlagIndex === -1 || formatFlagIndex + 1 >= timingArguments.length) throw new Error("Oxlint timing arguments require a --format value");
73168
+ timingArguments[formatFlagIndex + 1] = "default";
73169
+ timingArguments.push("--debug", "timings", "--quiet");
73170
+ return timingArguments;
73171
+ };
73172
+ const captureOxlintRuleTimings = (input) => new Promise((resolve, reject) => {
73173
+ const timingEnvironment = { ...input.environment };
73174
+ timingEnvironment.REACT_DOCTOR_RULE_TIMINGS_DIR = void 0;
73175
+ const timingChild = spawn(input.nodeBinaryPath, buildOxlintTimingArguments(input.argumentsList), {
73176
+ cwd: input.rootDirectory,
73177
+ env: timingEnvironment,
73178
+ stdio: [
73179
+ "ignore",
73180
+ "pipe",
73181
+ "pipe"
73182
+ ]
73183
+ });
73184
+ const stdoutBuffers = [];
73185
+ const stderrBuffers = [];
73186
+ timingChild.stdout.on("data", (buffer) => stdoutBuffers.push(buffer));
73187
+ timingChild.stderr.on("data", (buffer) => stderrBuffers.push(buffer));
73188
+ timingChild.on("error", reject);
73189
+ timingChild.on("close", (_code, signal) => {
73190
+ if (signal) {
73191
+ reject(/* @__PURE__ */ new Error(`Oxlint timing pass was killed by ${signal}`));
73192
+ return;
73193
+ }
73194
+ const timingOutput = `${Buffer.concat(stdoutBuffers).toString("utf8")}\n${Buffer.concat(stderrBuffers).toString("utf8")}`;
73195
+ if (!timingOutput.includes("Rule timings:")) {
73196
+ resolve();
73197
+ return;
73198
+ }
73199
+ fs$1$3.mkdirSync(input.timingDirectory, { recursive: true });
73200
+ fs$1$3.writeFileSync(path$1$1.join(input.timingDirectory, `oxlint-${timingChild.pid ?? process.pid}.timings.txt`), timingOutput);
73201
+ resolve();
73202
+ });
73203
+ });
73009
73204
  const lowerChildProcessPriority = (processId) => {
73010
73205
  if (processId === void 0) return;
73011
73206
  try {
@@ -73127,7 +73322,18 @@ const spawnOxlint = (args, rootDirectory, nodeBinaryPath, spawnTimeoutMs = OXLIN
73127
73322
  return;
73128
73323
  }
73129
73324
  }
73130
- resolve(output);
73325
+ const timingDirectory = SANITIZED_ENV.REACT_DOCTOR_OXLINT_TIMINGS_DIR;
73326
+ if (timingDirectory === void 0) {
73327
+ resolve(output);
73328
+ return;
73329
+ }
73330
+ captureOxlintRuleTimings({
73331
+ argumentsList: args,
73332
+ environment: SANITIZED_ENV,
73333
+ nodeBinaryPath,
73334
+ rootDirectory,
73335
+ timingDirectory
73336
+ }).then(() => resolve(output), reject);
73131
73337
  });
73132
73338
  });
73133
73339
  const PARALLELISM_EXHAUSTION_ERROR_CODES = new Set([
@@ -73932,7 +74138,7 @@ const runOxlint = async (options) => {
73932
74138
  const pluginPath = resolvePluginPath();
73933
74139
  const extendsPaths = (adoptExistingLintConfig && !customRulesOnly ? detectUserLintConfigPaths(rootDirectory) : []).filter(canOxlintExtendConfig);
73934
74140
  const userPlugins = includedTags.size > 0 ? [] : resolveUserPlugins(userConfig?.plugins, configSourceDirectory);
73935
- const restoreDisableDirectives = respectInlineDisables ? () => {} : await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path));
74141
+ const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
73936
74142
  const configDirectory = fs$1$3.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
73937
74143
  const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
73938
74144
  try {
@@ -76397,6 +76603,7 @@ const METRIC = {
76397
76603
  ciConfigured: "ci.configured",
76398
76604
  rulesChanged: "rules.changed",
76399
76605
  rulesQueried: "rules.queried",
76606
+ runtimeScanUrlPromptShown: "runtime_scan.url_prompt_shown",
76400
76607
  tuiCompactReportShown: "tui.compact_report_shown",
76401
76608
  tuiFindingNavigated: "tui.finding_navigated",
76402
76609
  tuiIssueStreamShown: "tui.issue_stream_shown",
@@ -76450,7 +76657,7 @@ const makeNoopConsole = () => ({
76450
76657
  });
76451
76658
  //#endregion
76452
76659
  //#region src/cli/utils/version.ts
76453
- const VERSION = "0.9.12-dev.8c2f03a";
76660
+ const VERSION = "0.9.12-dev.a163de9";
76454
76661
  //#endregion
76455
76662
  //#region src/cli/utils/json-mode.ts
76456
76663
  let context = null;
@@ -76488,13 +76695,14 @@ const installSilentConsole = () => {
76488
76695
  "trace"
76489
76696
  ]) target[key] = source[key];
76490
76697
  };
76491
- const enableJsonMode = ({ compact, directory, outputFile }) => {
76698
+ const enableJsonMode = ({ compact, directory, outputFile, writeCancellationError }) => {
76492
76699
  context = {
76493
76700
  compact,
76494
76701
  directory,
76495
76702
  startTime: performance$1.now(),
76496
76703
  mode: "full",
76497
- outputFile: null
76704
+ outputFile: null,
76705
+ writeCancellationError
76498
76706
  };
76499
76707
  installSilentConsole();
76500
76708
  if (outputFile) {
@@ -76533,6 +76741,13 @@ const writeJsonErrorReport = (error, sentryEventId) => {
76533
76741
  process.stdout.write(INTERNAL_ERROR_JSON_FALLBACK);
76534
76742
  }
76535
76743
  };
76744
+ const writeJsonCancellationReport = () => {
76745
+ if (context?.writeCancellationError !== void 0) {
76746
+ context.writeCancellationError();
76747
+ return;
76748
+ }
76749
+ writeJsonErrorReport(/* @__PURE__ */ new Error("Scan cancelled by user (SIGINT/SIGTERM)"));
76750
+ };
76536
76751
  //#endregion
76537
76752
  //#region src/cli/utils/run-id.ts
76538
76753
  let cachedRunId;
@@ -76541,10 +76756,14 @@ const getRunId = () => {
76541
76756
  return cachedRunId;
76542
76757
  };
76543
76758
  //#endregion
76759
+ //#region src/cli/utils/scrub-run-arguments.ts
76760
+ const scrubRunArguments = (argumentsList) => anonymizeText(argumentsList.map((argument) => argument.replace(/^((?:--[^=]+=)?)(?:https?|wss?):\/\/.+$/i, "$1<url>")).join(" "));
76761
+ //#endregion
76544
76762
  //#region src/cli/utils/build-run-context.ts
76545
76763
  const ROOT_SUBCOMMANDS = new Set([
76546
76764
  "design",
76547
76765
  "install",
76766
+ "scan",
76548
76767
  "setup"
76549
76768
  ]);
76550
76769
  const detectInvokedVia = () => {
@@ -76585,7 +76804,7 @@ const buildRunContext = () => {
76585
76804
  runId: getRunId(),
76586
76805
  origin: detectOrigin(),
76587
76806
  command: detectCommand(userArguments),
76588
- argv: scrubSensitivePaths(userArguments.join(" ")),
76807
+ argv: scrubRunArguments(userArguments),
76589
76808
  cwd: scrubSensitivePaths(process.cwd()),
76590
76809
  node: process.version,
76591
76810
  nodeMajor: detectNodeMajor(),
@@ -76615,33 +76834,41 @@ const buildRunContext = () => {
76615
76834
  * omits `projectName` and `rootDirectory`, the two identifying fields, so the
76616
76835
  * project can't be tied back to a specific company/repo.
76617
76836
  */
76618
- const buildSentryProjectContext = (projectInfo) => ({
76619
- tags: {
76620
- "project.framework": projectInfo.framework,
76621
- "project.reactMajor": projectInfo.reactMajorVersion,
76622
- "project.typescript": projectInfo.hasTypeScript,
76623
- "project.reactCompiler": projectInfo.hasReactCompiler,
76624
- "project.expo": projectInfo.expoVersion !== null,
76625
- "project.reactNative": projectInfo.hasReactNativeWorkspace
76626
- },
76627
- context: {
76628
- framework: projectInfo.framework,
76629
- reactVersion: projectInfo.reactVersion,
76630
- reactMajorVersion: projectInfo.reactMajorVersion,
76631
- hasTypeScript: projectInfo.hasTypeScript,
76632
- hasReactCompiler: projectInfo.hasReactCompiler,
76633
- tanstackQueryVersion: projectInfo.tanstackQueryVersion,
76634
- mobxVersion: projectInfo.mobxVersion,
76635
- styledComponentsVersion: projectInfo.styledComponentsVersion,
76636
- tailwindVersion: projectInfo.tailwindVersion,
76637
- zodVersion: projectInfo.zodVersion,
76638
- preactVersion: projectInfo.preactVersion,
76639
- hasReactNativeWorkspace: projectInfo.hasReactNativeWorkspace,
76640
- expoVersion: projectInfo.expoVersion,
76641
- hasReanimated: projectInfo.hasReanimated,
76642
- sourceFileCount: projectInfo.sourceFileCount
76643
- }
76644
- });
76837
+ const buildSentryProjectContext = (projectInfo) => {
76838
+ const capabilities = buildCapabilities(projectInfo);
76839
+ const supportedRuntimes = [];
76840
+ if (capabilities.has("react")) supportedRuntimes.push("react");
76841
+ if (capabilities.has("three")) supportedRuntimes.push("three");
76842
+ if (capabilities.has("remotion")) supportedRuntimes.push("remotion");
76843
+ return {
76844
+ tags: {
76845
+ "project.framework": projectInfo.framework,
76846
+ "project.runtime": supportedRuntimes.join("+") || "unknown",
76847
+ "project.reactMajor": projectInfo.reactMajorVersion,
76848
+ "project.typescript": projectInfo.hasTypeScript,
76849
+ "project.reactCompiler": projectInfo.hasReactCompiler,
76850
+ "project.expo": projectInfo.expoVersion !== null,
76851
+ "project.reactNative": projectInfo.hasReactNativeWorkspace
76852
+ },
76853
+ context: {
76854
+ framework: projectInfo.framework,
76855
+ reactVersion: projectInfo.reactVersion,
76856
+ reactMajorVersion: projectInfo.reactMajorVersion,
76857
+ hasTypeScript: projectInfo.hasTypeScript,
76858
+ hasReactCompiler: projectInfo.hasReactCompiler,
76859
+ tanstackQueryVersion: projectInfo.tanstackQueryVersion,
76860
+ mobxVersion: projectInfo.mobxVersion,
76861
+ styledComponentsVersion: projectInfo.styledComponentsVersion,
76862
+ tailwindVersion: projectInfo.tailwindVersion,
76863
+ zodVersion: projectInfo.zodVersion,
76864
+ preactVersion: projectInfo.preactVersion,
76865
+ hasReactNativeWorkspace: projectInfo.hasReactNativeWorkspace,
76866
+ expoVersion: projectInfo.expoVersion,
76867
+ hasReanimated: projectInfo.hasReanimated,
76868
+ sourceFileCount: projectInfo.sourceFileCount
76869
+ }
76870
+ };
76871
+ };
76645
76872
  let currentProjectInfo = null;
76646
76873
  const setSentryProjectInfo = (projectInfo) => {
76647
76874
  currentProjectInfo = projectInfo;
@@ -76772,7 +76999,7 @@ const recordDistribution = (name, value, options = {}) => {
76772
76999
  } catch {}
76773
77000
  };
76774
77001
  //#endregion
76775
- export { Maintainability as $, CANONICAL_GITHUB_URL as $n, listSourceFiles as $t, SCAN_RESULT_CACHE_MAX_HASHED_FILE_SIZE_BYTES as A, makeSpan$1 as An, filterDiagnosticsForSurface as At, isGitHookEnvironment as B, try_ as Bn, getEquivalentRuleKeys as Bt, GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS as C, info as Cn, toCanonicalPath as Cr, computeConfigFingerprint as Ct, REACT_DOCTOR_CONFIG_PROJECT_NAME as D, decodeUnknownSync as Dn, createOxlintSpawnSlots as Dt, NANOSECONDS_PER_MILLISECOND as E, Diagnostic as En, createNodeReadFileLinesSync as Et, STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES as F, provideContext as Fn, formatReactDoctorError as Ft, isCiOrCodingAgentEnvironment as G, succeed$3 as Gn, highlighter as Gt, ACTION_INPUT_ENVIRONMENT_VARIABLES as H, buildWithScope as Hn, hasPublishedFixRecipe as Ht, TUI_REPORT_COMPACT_MAX_ROWS as I, provideService as In, getBaselineDiffPlan as It, Files as J, fail$5 as Jn, isProjectDiscoveryError as Jt, isCodingAgentEnvironment as K, close as Kn, isMonorepoRoot as Kt, TUI_REPORT_DETAIL_WIDTH_FRACTION as L, runPromise as Ln, getChangedLineRanges as Lt, SENTRY_FLUSH_TIMEOUT_MS as M, orElseSucceed as Mn, filterSourceFiles as Mt, SENTRY_RELEASE_PREFIX as N, promise as Nn, findLegacyConfig as Nt, RUN_GIT_MAX_BUFFER_BYTES as O, make$30 as On, detectAiTrainingEnvironment as Ot, STAGED_FILES_TEMP_DIR_PREFIX as P, provide as Pn, formatErrorChain as Pt, Linter as Q, CANONICAL_DISCORD_URL as Qn, layerObservability as Qt, CliInputError as R, runSync as Rn, getDiagnosticRuleIdentity as Rt, CI_TRUST_COMPANIES as S, error as Sn, messageFromUnknown as Sr, collectSourceFileCountsByDirectory as St, MINIMUM_VTE_VERSION_FOR_HYPERLINKS as T, warn$1 as Tn, countOptInProjectRuleSelections as Tt, detectRunnerOs as U, mergeAll$1 as Un, hasSupportedFrameworkOrLibrary as Ut, isDebugFlagEnabled as V, void_ as Vn, groupBy as Vt, isCiEnvironment as W, provide$2 as Wn, hashFileContents as Wt, LEGACY_CONFIG_FILENAME as X, ParentSpan as Xn, isSameRuleKey as Xt, Git as Y, void_$1 as Yn, isReactDoctorError as Yt, LintPartialFailures as Z, AXIOM_DEFAULT_DOMAIN as Zn, isScanComplete as Zt, makeNoopConsole as _, summarizeDiagnostics as _n, getCategoryImpact as _r, buildSkippedChecks as _t, isEnvFlagEnabled as a, mergeReactDoctorConfigs as an, DOCS_URL as ar, Project as at, AXIOM_TRACES_DATASET as b, yieldToEventLoop as bn, isFile as br, classifyFileContext as bt, setSentryProjectInfo as c, resolveLintBatchOrdering as cn, GIT_SHOW_MAX_BUFFER_BYTES as cr, SidecarLintCacheEnabled as ct, isJsonModeActive as d, resolveScanTarget as dn, JSX_FILE_PATTERN as dr, anonymizeInPlace as dt, listSourceFilesCooperative as en, CI_URL as er, NodeResolver as et, setJsonReportDirectory as f, restoreLegacyThrow as fn, MILLISECONDS_PER_SECOND as fr, anonymizeText as ft, VERSION as g, shouldUseMaintainabilityLayer as gn, STAGED_FILES_PROJECT_CONFIG_FILENAMES as gr, buildRuleSeverityControls as gt, writeJsonReport as h, setColorEnabled as hn, SKILL_NAME as hr, buildRuleDocsUrl as ht, isTelemetryEnabled as i, materializeSourceTree as in, DIAGNOSTIC_CATEGORY_BUCKETS as ir, Progress as it, SENTRY_DSN as j, map$3 as jn, filterPathsOutsideDirectories as jt, SCAN_RESULT_CACHE_FILENAME as k, gen as kn, discoverReactSubprojects as kt, getRunId as l, resolveReactDoctorCacheDir as ln, HTML_FILE_PATTERN as lr, StagedFiles as lt, writeJsonErrorReport as m, scrubSensitivePaths as mn, SHARE_BASE_URL as mr, buildJsonReport as mt, recordDistribution as n, loadConfigWithSource as nn, COMPILER_CLEANUP_RULE_KEYS as nr, OxlintSpawnSlots as nt, buildSentryScope as o, remainingDeadlineBudgetMs as on, ENTERPRISE_CONTACT_URL as or, Reporter as ot, setJsonReportMode as p, runInspect as pn, OXLINT_NODE_REQUIREMENT as pr, atomicWriteJson as pt, Config as q, makeUnsafe$5 as qn, isPathInsideDirectory as qt, toSpanAttributes as r, mapWithConcurrency as rn, CONFIG_SCHEMA_URL as rr, PerFileLintCacheEnabled as rt, buildSentryProjectContext as s, resolveGithubActionsScoreMetadata as sn, GITHUB_ACTIONS_SETUP_URL as sr, Score as st, recordCount as t, listWorkspacePackages as tn, COMPILER_CLEANUP_BUCKET as tr, OxlintConcurrency as tt, enableJsonMode as u, resolveScanConcurrency as un, JSX_DUPLICATION_SOURCE_FILE_PATTERN as ur, SupplyChain as ut, AXIOM_INGEST_TOKEN as v, toRelativePath as vn, isDirectory as vr, calculateScore as vt, METRIC as w, log as wn, computeDiagnosticDelta as wt, BASELINE_FILES_TEMP_DIR_PREFIX as x, Console as xn, isPlainObject as xr, clearConfigCache as xt, AXIOM_METRICS_DATASET as y, validateConfigTypes as yn, isErrnoException as yr, canonicalizeUserRuleKey as yt, isNonInteractiveEnvironment as z, sync as zn, getDiffInfo as zt };
77002
+ export { Linter as $, CANONICAL_DISCORD_URL as $n, layerObservability as $t, SCAN_RESULT_CACHE_FILENAME as A, gen as An, discoverSupportedSubprojects as At, isNonInteractiveEnvironment as B, sync as Bn, getDiffInfo as Bt, CI_TRUST_COMPANIES as C, error as Cn, messageFromUnknown as Cr, collectSourceFileCountsByDirectory as Ct, NANOSECONDS_PER_MILLISECOND as D, Diagnostic as Dn, createNodeReadFileLinesSync as Dt, MINIMUM_VTE_VERSION_FOR_HYPERLINKS as E, warn$1 as En, countOptInProjectRuleSelections as Et, STAGED_FILES_TEMP_DIR_PREFIX as F, provide as Fn, formatErrorChain as Ft, isCiEnvironment as G, provide$2 as Gn, hashFileContents as Gt, isDebugFlagEnabled as H, void_ as Hn, groupBy as Ht, STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES as I, provideContext as In, formatReactDoctorError as It, Config as J, makeUnsafe$5 as Jn, isPathInsideDirectory as Jt, isCiOrCodingAgentEnvironment as K, succeed$3 as Kn, highlighter as Kt, TUI_REPORT_COMPACT_MAX_ROWS as L, provideService as Ln, getBaselineDiffPlan as Lt, SENTRY_DSN as M, map$3 as Mn, filterPathsOutsideDirectories as Mt, SENTRY_FLUSH_TIMEOUT_MS as N, orElseSucceed as Nn, filterSourceFiles as Nt, REACT_DOCTOR_CONFIG_PROJECT_NAME as O, decodeUnknownSync as On, createOxlintSpawnSlots as Ot, SENTRY_RELEASE_PREFIX as P, promise as Pn, findLegacyConfig as Pt, LintPartialFailures as Q, AXIOM_DEFAULT_DOMAIN as Qn, isScanComplete as Qt, TUI_REPORT_DETAIL_WIDTH_FRACTION as R, runPromise as Rn, getChangedLineRanges as Rt, BASELINE_FILES_TEMP_DIR_PREFIX as S, Console as Sn, isPlainObject as Sr, clearConfigCache as St, METRIC as T, log as Tn, computeDiagnosticDelta as Tt, ACTION_INPUT_ENVIRONMENT_VARIABLES as U, buildWithScope as Un, hasPublishedFixRecipe as Ut, isGitHookEnvironment as V, try_ as Vn, getEquivalentRuleKeys as Vt, detectRunnerOs as W, mergeAll$1 as Wn, hasSupportedFrameworkOrLibrary as Wt, Git as X, void_$1 as Xn, isReactDoctorError as Xt, Files as Y, fail$5 as Yn, isProjectDiscoveryError as Yt, LEGACY_CONFIG_FILENAME as Z, ParentSpan as Zn, isSameRuleKey as Zt, VERSION as _, shouldUseMaintainabilityLayer as _n, STAGED_FILES_PROJECT_CONFIG_FILENAMES as _r, buildRuleSeverityControls as _t, isEnvFlagEnabled as a, materializeSourceTree as an, DIAGNOSTIC_CATEGORY_BUCKETS as ar, Progress as at, AXIOM_METRICS_DATASET as b, validateConfigTypes as bn, isErrnoException as br, canonicalizeUserRuleKey as bt, setSentryProjectInfo as c, resolveGithubActionsScoreMetadata as cn, GITHUB_ACTIONS_SETUP_URL as cr, Score as ct, isJsonModeActive as d, resolveScanConcurrency as dn, JSX_DUPLICATION_SOURCE_FILE_PATTERN as dr, SupplyChain as dt, listSourceFiles as en, CANONICAL_GITHUB_URL as er, Maintainability as et, setJsonReportDirectory as f, resolveScanTarget as fn, JSX_FILE_PATTERN as fr, anonymizeInPlace as ft, writeJsonReport as g, setColorEnabled as gn, SKILL_NAME as gr, buildRuleDocsUrl as gt, writeJsonErrorReport as h, scrubSensitivePaths as hn, SHARE_BASE_URL as hr, buildJsonReport as ht, isTelemetryEnabled as i, mapWithConcurrency as in, CONFIG_SCHEMA_URL as ir, PerFileLintCacheEnabled as it, SCAN_RESULT_CACHE_MAX_HASHED_FILE_SIZE_BYTES as j, makeSpan$1 as jn, filterDiagnosticsForSurface as jt, RUN_GIT_MAX_BUFFER_BYTES as k, make$30 as kn, detectAiTrainingEnvironment as kt, getRunId as l, resolveLintBatchOrdering as ln, GIT_SHOW_MAX_BUFFER_BYTES as lr, SidecarLintCacheEnabled as lt, writeJsonCancellationReport as m, runInspect as mn, OXLINT_NODE_REQUIREMENT as mr, atomicWriteJson as mt, recordDistribution as n, listWorkspacePackages as nn, COMPILER_CLEANUP_BUCKET as nr, OxlintConcurrency as nt, buildSentryScope as o, mergeReactDoctorConfigs as on, DOCS_URL as or, Project as ot, setJsonReportMode as p, restoreLegacyThrow as pn, MILLISECONDS_PER_SECOND as pr, anonymizeText as pt, isCodingAgentEnvironment as q, close as qn, isMonorepoRoot as qt, toSpanAttributes as r, loadConfigWithSource as rn, COMPILER_CLEANUP_RULE_KEYS as rr, OxlintSpawnSlots as rt, buildSentryProjectContext as s, remainingDeadlineBudgetMs as sn, ENTERPRISE_CONTACT_URL as sr, Reporter as st, recordCount as t, listSourceFilesCooperative as tn, CI_URL as tr, NodeResolver as tt, enableJsonMode as u, resolveReactDoctorCacheDir as un, HTML_FILE_PATTERN as ur, StagedFiles as ut, makeNoopConsole as v, summarizeDiagnostics as vn, getCategoryImpact as vr, buildSkippedChecks as vt, GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS as w, info as wn, toCanonicalPath as wr, computeConfigFingerprint as wt, AXIOM_TRACES_DATASET as x, yieldToEventLoop as xn, isFile as xr, classifyFileContext as xt, AXIOM_INGEST_TOKEN as y, toRelativePath as yn, isDirectory as yr, calculateScore as yt, CliInputError as z, runSync as zn, getDiagnosticRuleIdentity as zt };
76776
77003
 
76777
- //# sourceMappingURL=record-metric-DospZkfP.js.map
76778
- //# debugId=7fbceb12-b91b-5945-969c-c6bfc4005674
77004
+ //# sourceMappingURL=record-metric-B0l334ac.js.map
77005
+ //# debugId=10224529-8179-5ea2-849f-da7e2f5c7db2