react-doctor 0.2.15-dev.bf4c21e → 0.2.16-dev.2d1ab24

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 (3) hide show
  1. package/dist/cli.js +175 -197
  2. package/dist/index.js +78 -70
  3. package/package.json +4 -4
package/dist/cli.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]="6e59d54f-a063-5355-9b76-f82556f70c89")}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]="e5345c0f-0e42-5045-8127-8f9f7a251f64")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import { execFileSync, spawn, spawnSync } from "node:child_process";
5
5
  import * as Path from "node:path";
@@ -8362,6 +8362,100 @@ const checkReducedMotion = (rootDirectory) => {
8362
8362
  if (result.status === 0) return [];
8363
8363
  return [MISSING_REDUCED_MOTION_DIAGNOSTIC];
8364
8364
  };
8365
+ var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
8366
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
8367
+ 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);
8368
+ let formatter = (open, close, replace = open) => (input) => {
8369
+ let string = "" + input, index = string.indexOf(close, open.length);
8370
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
8371
+ };
8372
+ let replaceClose = (string, close, replace, index) => {
8373
+ let result = "", cursor = 0;
8374
+ do {
8375
+ result += string.substring(cursor, index) + replace;
8376
+ cursor = index + close.length;
8377
+ index = string.indexOf(close, cursor);
8378
+ } while (~index);
8379
+ return result + string.substring(cursor);
8380
+ };
8381
+ let createColors = (enabled = isColorSupported) => {
8382
+ let f = enabled ? formatter : () => String;
8383
+ return {
8384
+ isColorSupported: enabled,
8385
+ reset: f("\x1B[0m", "\x1B[0m"),
8386
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
8387
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
8388
+ italic: f("\x1B[3m", "\x1B[23m"),
8389
+ underline: f("\x1B[4m", "\x1B[24m"),
8390
+ inverse: f("\x1B[7m", "\x1B[27m"),
8391
+ hidden: f("\x1B[8m", "\x1B[28m"),
8392
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
8393
+ black: f("\x1B[30m", "\x1B[39m"),
8394
+ red: f("\x1B[31m", "\x1B[39m"),
8395
+ green: f("\x1B[32m", "\x1B[39m"),
8396
+ yellow: f("\x1B[33m", "\x1B[39m"),
8397
+ blue: f("\x1B[34m", "\x1B[39m"),
8398
+ magenta: f("\x1B[35m", "\x1B[39m"),
8399
+ cyan: f("\x1B[36m", "\x1B[39m"),
8400
+ white: f("\x1B[37m", "\x1B[39m"),
8401
+ gray: f("\x1B[90m", "\x1B[39m"),
8402
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
8403
+ bgRed: f("\x1B[41m", "\x1B[49m"),
8404
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
8405
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
8406
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
8407
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
8408
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
8409
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
8410
+ blackBright: f("\x1B[90m", "\x1B[39m"),
8411
+ redBright: f("\x1B[91m", "\x1B[39m"),
8412
+ greenBright: f("\x1B[92m", "\x1B[39m"),
8413
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
8414
+ blueBright: f("\x1B[94m", "\x1B[39m"),
8415
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
8416
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
8417
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
8418
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
8419
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
8420
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
8421
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
8422
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
8423
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
8424
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
8425
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
8426
+ };
8427
+ };
8428
+ module.exports = createColors();
8429
+ module.exports.createColors = createColors;
8430
+ })))(), 1);
8431
+ const highlighter = {
8432
+ error: import_picocolors.default.red,
8433
+ warn: import_picocolors.default.yellow,
8434
+ info: import_picocolors.default.cyan,
8435
+ success: import_picocolors.default.green,
8436
+ dim: import_picocolors.default.dim,
8437
+ gray: import_picocolors.default.gray,
8438
+ bold: import_picocolors.default.bold
8439
+ };
8440
+ /**
8441
+ * Override picocolors' automatic color detection. picocolors decides
8442
+ * once, at import time, from `NO_COLOR` / `FORCE_COLOR` / `TERM` / TTY.
8443
+ * This lets the CLI honor an explicit `--color` / `--no-color` flag
8444
+ * (clig.dev, Output: "Disable color … if the user requested it") by
8445
+ * swapping in a fresh set of formatters. Call it before any colored
8446
+ * output is produced. Every call site reads `highlighter.<method>` at
8447
+ * call time, so reassigning the properties propagates everywhere.
8448
+ */
8449
+ const setColorEnabled = (enabled) => {
8450
+ const colors = import_picocolors.default.createColors(enabled);
8451
+ highlighter.error = colors.red;
8452
+ highlighter.warn = colors.yellow;
8453
+ highlighter.info = colors.cyan;
8454
+ highlighter.success = colors.green;
8455
+ highlighter.dim = colors.dim;
8456
+ highlighter.gray = colors.gray;
8457
+ highlighter.bold = colors.bold;
8458
+ };
8365
8459
  const computeJsxIncludePaths = (includePaths) => includePaths.length > 0 ? includePaths.filter((filePath) => JSX_FILE_PATTERN.test(filePath)) : void 0;
8366
8460
  const LINGUIST_ATTRIBUTE_PATTERN = /^linguist-(?:vendored|generated)(?:=([a-zA-Z0-9]+))?$/i;
8367
8461
  const FALSY_VALUES = new Set([
@@ -11193,7 +11287,7 @@ const runInspect = (input, hooks = {}) => Effect.gen(function* () {
11193
11287
  reason: null
11194
11288
  });
11195
11289
  const scanConcurrency = yield* OxlintConcurrency;
11196
- const workerCountSuffix = scanConcurrency > 1 ? ` · ${scanConcurrency} workers` : "";
11290
+ const workerCountSuffix = scanConcurrency > 1 ? ` ${highlighter.dim(`[~${scanConcurrency} workers]`)}` : "";
11197
11291
  const scanProgress = yield* progressService.start("Scanning...");
11198
11292
  const scanStartTime = Date.now();
11199
11293
  let lastReportedTotalFileCount = 0;
@@ -11662,100 +11756,6 @@ const getDiffInfo = (directory, explicitBaseBranch) => Effect.runPromise(Effect.
11662
11756
  };
11663
11757
  }).pipe(Effect.provide(Git.layerNode)));
11664
11758
  const filterSourceFiles = (filePaths) => filePaths.filter(isLintableSourceFile);
11665
- var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
11666
- let p = process || {}, argv = p.argv || [], env = p.env || {};
11667
- 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);
11668
- let formatter = (open, close, replace = open) => (input) => {
11669
- let string = "" + input, index = string.indexOf(close, open.length);
11670
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
11671
- };
11672
- let replaceClose = (string, close, replace, index) => {
11673
- let result = "", cursor = 0;
11674
- do {
11675
- result += string.substring(cursor, index) + replace;
11676
- cursor = index + close.length;
11677
- index = string.indexOf(close, cursor);
11678
- } while (~index);
11679
- return result + string.substring(cursor);
11680
- };
11681
- let createColors = (enabled = isColorSupported) => {
11682
- let f = enabled ? formatter : () => String;
11683
- return {
11684
- isColorSupported: enabled,
11685
- reset: f("\x1B[0m", "\x1B[0m"),
11686
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
11687
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
11688
- italic: f("\x1B[3m", "\x1B[23m"),
11689
- underline: f("\x1B[4m", "\x1B[24m"),
11690
- inverse: f("\x1B[7m", "\x1B[27m"),
11691
- hidden: f("\x1B[8m", "\x1B[28m"),
11692
- strikethrough: f("\x1B[9m", "\x1B[29m"),
11693
- black: f("\x1B[30m", "\x1B[39m"),
11694
- red: f("\x1B[31m", "\x1B[39m"),
11695
- green: f("\x1B[32m", "\x1B[39m"),
11696
- yellow: f("\x1B[33m", "\x1B[39m"),
11697
- blue: f("\x1B[34m", "\x1B[39m"),
11698
- magenta: f("\x1B[35m", "\x1B[39m"),
11699
- cyan: f("\x1B[36m", "\x1B[39m"),
11700
- white: f("\x1B[37m", "\x1B[39m"),
11701
- gray: f("\x1B[90m", "\x1B[39m"),
11702
- bgBlack: f("\x1B[40m", "\x1B[49m"),
11703
- bgRed: f("\x1B[41m", "\x1B[49m"),
11704
- bgGreen: f("\x1B[42m", "\x1B[49m"),
11705
- bgYellow: f("\x1B[43m", "\x1B[49m"),
11706
- bgBlue: f("\x1B[44m", "\x1B[49m"),
11707
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
11708
- bgCyan: f("\x1B[46m", "\x1B[49m"),
11709
- bgWhite: f("\x1B[47m", "\x1B[49m"),
11710
- blackBright: f("\x1B[90m", "\x1B[39m"),
11711
- redBright: f("\x1B[91m", "\x1B[39m"),
11712
- greenBright: f("\x1B[92m", "\x1B[39m"),
11713
- yellowBright: f("\x1B[93m", "\x1B[39m"),
11714
- blueBright: f("\x1B[94m", "\x1B[39m"),
11715
- magentaBright: f("\x1B[95m", "\x1B[39m"),
11716
- cyanBright: f("\x1B[96m", "\x1B[39m"),
11717
- whiteBright: f("\x1B[97m", "\x1B[39m"),
11718
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
11719
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
11720
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
11721
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
11722
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
11723
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
11724
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
11725
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
11726
- };
11727
- };
11728
- module.exports = createColors();
11729
- module.exports.createColors = createColors;
11730
- })))(), 1);
11731
- const highlighter = {
11732
- error: import_picocolors.default.red,
11733
- warn: import_picocolors.default.yellow,
11734
- info: import_picocolors.default.cyan,
11735
- success: import_picocolors.default.green,
11736
- dim: import_picocolors.default.dim,
11737
- gray: import_picocolors.default.gray,
11738
- bold: import_picocolors.default.bold
11739
- };
11740
- /**
11741
- * Override picocolors' automatic color detection. picocolors decides
11742
- * once, at import time, from `NO_COLOR` / `FORCE_COLOR` / `TERM` / TTY.
11743
- * This lets the CLI honor an explicit `--color` / `--no-color` flag
11744
- * (clig.dev, Output: "Disable color … if the user requested it") by
11745
- * swapping in a fresh set of formatters. Call it before any colored
11746
- * output is produced. Every call site reads `highlighter.<method>` at
11747
- * call time, so reassigning the properties propagates everywhere.
11748
- */
11749
- const setColorEnabled = (enabled) => {
11750
- const colors = import_picocolors.default.createColors(enabled);
11751
- highlighter.error = colors.red;
11752
- highlighter.warn = colors.yellow;
11753
- highlighter.info = colors.cyan;
11754
- highlighter.success = colors.green;
11755
- highlighter.dim = colors.dim;
11756
- highlighter.gray = colors.gray;
11757
- highlighter.bold = colors.bold;
11758
- };
11759
11759
  /**
11760
11760
  * Canonical URL for a rule's documentation page — its reviewer-tested fix
11761
11761
  * recipe rendered for humans — served at
@@ -11942,7 +11942,7 @@ const makeNoopConsole = () => ({
11942
11942
  });
11943
11943
  //#endregion
11944
11944
  //#region src/cli/utils/version.ts
11945
- const VERSION = "0.2.15-dev.bf4c21e";
11945
+ const VERSION = "0.2.16-dev.2d1ab24";
11946
11946
  //#endregion
11947
11947
  //#region src/cli/utils/json-mode.ts
11948
11948
  let context = null;
@@ -12288,13 +12288,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
12288
12288
  * uploads source-map artifacts under, so stack frames symbolicate. Honors the
12289
12289
  * standard `SENTRY_RELEASE` override.
12290
12290
  */
12291
- const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.2.15-dev.bf4c21e`;
12291
+ const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.2.16-dev.2d1ab24`;
12292
12292
  /**
12293
12293
  * Deployment environment shown in Sentry's environment filter. Defaults to
12294
12294
  * `production` for tagged releases and `development` for dev/unbuilt versions,
12295
12295
  * overridable via the standard `SENTRY_ENVIRONMENT` env var.
12296
12296
  */
12297
- const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.2.15-dev.bf4c21e") ? "development" : "production");
12297
+ const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.2.16-dev.2d1ab24") ? "development" : "production");
12298
12298
  /**
12299
12299
  * Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
12300
12300
  * (set to `0` to disable tracing) and falls back to
@@ -15874,6 +15874,9 @@ const buildCodeFrame = (input) => {
15874
15874
  });
15875
15875
  };
15876
15876
  //#endregion
15877
+ //#region src/cli/utils/build-section-divider.ts
15878
+ const buildSectionDivider = () => highlighter.dim(` ${"─".repeat(60)}`);
15879
+ //#endregion
15877
15880
  //#region src/cli/utils/indent-multiline-text.ts
15878
15881
  const indentMultilineText = (text, linePrefix) => text.split("\n").map((lineText) => `${linePrefix}${lineText}`).join("\n");
15879
15882
  //#endregion
@@ -15956,7 +15959,6 @@ const buildCompactCategoryLine = (categoryGroup) => {
15956
15959
  };
15957
15960
  const TOP_ERROR_DETAIL_INDENT = " ";
15958
15961
  const pickRepresentativeDiagnostic = (ruleDiagnostics) => ruleDiagnostics.find((diagnostic) => diagnostic.line > 0) ?? ruleDiagnostics[0];
15959
- const isErrorRuleGroup = (ruleDiagnostics) => pickRepresentativeDiagnostic(ruleDiagnostics).severity === "error";
15960
15962
  const FRAME_CONTEXT_REACH_LINES = 3;
15961
15963
  const clusterNearbyDiagnostics = (diagnostics) => {
15962
15964
  const byFile = groupBy(diagnostics, (diagnostic) => diagnostic.filePath);
@@ -16007,89 +16009,60 @@ const buildDiagnosticClusterLines = (cluster, resolveSourceRoot, renderCodeFrame
16007
16009
  }
16008
16010
  return lines;
16009
16011
  };
16010
- const buildRuleDetailBlock = (ruleKey, ruleDiagnostics, resolveSourceRoot, renderEverySite) => {
16012
+ const buildRuleDetailBlock = (ruleKey, ruleDiagnostics, resolveSourceRoot, renderEverySite, isAgentEnvironment) => {
16011
16013
  const representative = pickRepresentativeDiagnostic(ruleDiagnostics);
16012
16014
  const { severity } = representative;
16013
16015
  const trailingBadge = formatTrailingSiteBadge(ruleDiagnostics.length);
16014
16016
  const headline = colorizeBySeverity(`${representative.category}: ${representative.title ?? ruleKey}`, severity);
16015
16017
  const lines = [` ${colorizeBySeverity(severity === "error" ? "✗" : "⚠", severity)} ${headline}${trailingBadge}`];
16016
- if (!renderEverySite) for (const explanationLine of wrapTextToWidth(representative.message, 60, { breakLongWords: false })) lines.push(`${TOP_ERROR_DETAIL_INDENT}${explanationLine}`);
16017
- if (representative.help) for (const fixLine of wrapTextToWidth(`→ ${representative.help}`, 60, { breakLongWords: false })) lines.push(highlighter.dim(`${TOP_ERROR_DETAIL_INDENT}${fixLine}`));
16018
- const renderCodeFrame = severity === "error";
16019
- const sites = renderEverySite ? ruleDiagnostics : [representative];
16020
- for (const cluster of clusterNearbyDiagnostics(sites)) lines.push(...buildDiagnosticClusterLines(cluster, resolveSourceRoot, renderCodeFrame));
16021
- return lines;
16022
- };
16023
- const WARNING_DETAIL_INDENT = " ";
16024
- const computeRuleNameColumnWidth = (ruleKeys) => ruleKeys.reduce((widest, ruleKey) => Math.max(widest, ruleKey.length), 36);
16025
- const padRuleNameToColumn = (ruleName, columnWidth) => ruleName.length >= columnWidth ? ruleName : ruleName + " ".repeat(columnWidth - ruleName.length);
16026
- const buildWarningHeaderLine = (ruleKey, siteCount, ruleNameColumnWidth) => {
16027
- const ruleName = formatSiteCountBadge(siteCount).length > 0 ? padRuleNameToColumn(ruleKey, ruleNameColumnWidth) : ruleKey;
16028
- return ` ${highlighter.warn("⚠")} ${ruleName}${formatTrailingSiteBadge(siteCount)}`;
16029
- };
16030
- const buildWarningRuleBlock = (ruleKey, ruleDiagnostics, ruleNameColumnWidth, isAgentEnvironment) => {
16031
- const representative = pickRepresentativeDiagnostic(ruleDiagnostics);
16032
- const lines = [buildWarningHeaderLine(ruleKey, ruleDiagnostics.length, ruleNameColumnWidth)];
16033
- if (!isAgentEnvironment) {
16018
+ if (renderEverySite && !isAgentEnvironment) {
16034
16019
  const learnMoreLine = formatLearnMoreLine(representative);
16035
- if (learnMoreLine) lines.push(`${WARNING_DETAIL_INDENT}${highlighter.info(learnMoreLine)}`);
16020
+ if (learnMoreLine) lines.push(`${TOP_ERROR_DETAIL_INDENT}${highlighter.info(learnMoreLine)}`);
16036
16021
  }
16037
- lines.push(highlighter.gray(indentMultilineText(representative.message, WARNING_DETAIL_INDENT)));
16038
- if (representative.help) lines.push(highlighter.gray(indentMultilineText(`→ ${representative.help}`, WARNING_DETAIL_INDENT)));
16039
- if (isAgentEnvironment) {
16022
+ if (!renderEverySite) for (const explanationLine of wrapTextToWidth(representative.message, 60, { breakLongWords: false })) lines.push(`${TOP_ERROR_DETAIL_INDENT}${explanationLine}`);
16023
+ if (representative.help) for (const fixLine of wrapTextToWidth(`→ ${representative.help}`, 60, { breakLongWords: false })) lines.push(highlighter.dim(`${TOP_ERROR_DETAIL_INDENT}${fixLine}`));
16024
+ if (renderEverySite && isAgentEnvironment) {
16040
16025
  const fixRecipeLine = formatFixRecipeLine(representative);
16041
- if (fixRecipeLine) lines.push(highlighter.gray(`${WARNING_DETAIL_INDENT}${fixRecipeLine}`));
16042
- }
16043
- for (const [filePath, sites] of buildVerboseSiteMap(ruleDiagnostics)) {
16044
- if (sites.length === 0) {
16045
- lines.push(highlighter.gray(`${WARNING_DETAIL_INDENT}${filePath}`));
16046
- continue;
16047
- }
16048
- for (const site of sites) {
16049
- lines.push(highlighter.gray(`${WARNING_DETAIL_INDENT}${filePath}:${site.line}`));
16050
- if (site.suppressionHint) lines.push(highlighter.gray(`${WARNING_DETAIL_INDENT} ↳ ${site.suppressionHint}`));
16051
- }
16026
+ if (fixRecipeLine) lines.push(highlighter.gray(`${TOP_ERROR_DETAIL_INDENT}${fixRecipeLine}`));
16052
16027
  }
16028
+ const renderCodeFrame = severity === "error" || renderEverySite;
16029
+ const sites = renderEverySite ? ruleDiagnostics : [representative];
16030
+ for (const cluster of clusterNearbyDiagnostics(sites)) lines.push(...buildDiagnosticClusterLines(cluster, resolveSourceRoot, renderCodeFrame));
16053
16031
  return lines;
16054
16032
  };
16055
16033
  const selectErrorRuleGroups = (diagnostics, rulePriority) => buildSortedRuleGroups(diagnostics.filter((diagnostic) => diagnostic.severity === "error"), rulePriority);
16056
16034
  const selectTopErrorRuleGroups = (diagnostics, limit, rulePriority) => selectErrorRuleGroups(diagnostics, rulePriority).slice(0, limit);
16057
- const buildMoreRulesLine = (hiddenRuleCount, severityNoun, accent) => {
16058
- const ruleNoun = hiddenRuleCount === 1 ? "rule" : "rules";
16059
- return ` ${highlighter.bold(accent(`+${hiddenRuleCount} more ${ruleNoun}`))} ${highlighter.dim("— run")} ${highlighter.bold(highlighter.info("--verbose"))} ${highlighter.dim(`to view the rest of the ${severityNoun} and details about each`)}`;
16035
+ const buildOverflowSummaryLine = (diagnostics, rulePriority) => {
16036
+ const errorRuleGroups = selectErrorRuleGroups(diagnostics, rulePriority);
16037
+ const shownErrorRuleCount = Math.min(3, errorRuleGroups.length);
16038
+ if (diagnostics.length <= shownErrorRuleCount) return void 0;
16039
+ const hiddenErrorRuleCount = errorRuleGroups.length - shownErrorRuleCount;
16040
+ const warningCount = diagnostics.filter((diagnostic) => diagnostic.severity === "warning").length;
16041
+ const parts = [];
16042
+ if (hiddenErrorRuleCount > 0) {
16043
+ const ruleNoun = hiddenErrorRuleCount === 1 ? "rule" : "rules";
16044
+ parts.push(highlighter.bold(highlighter.error(`+${hiddenErrorRuleCount} more ${ruleNoun}`)));
16045
+ }
16046
+ if (warningCount > 0) {
16047
+ const warningNoun = warningCount === 1 ? "warning" : "warnings";
16048
+ parts.push(highlighter.bold(highlighter.warn(`+${warningCount} optional ${warningNoun}`)));
16049
+ }
16050
+ const command = highlighter.bold(highlighter.info("npx react-doctor@latest --verbose"));
16051
+ return ` ${parts.length > 0 ? `${parts.join(highlighter.dim(" and "))} ${highlighter.dim("— run")}` : highlighter.dim("Run")} ${command} ${highlighter.dim("for details")}`;
16060
16052
  };
16061
16053
  const getTopErrorRuleKeys = (diagnostics, limit, rulePriority) => new Set(selectTopErrorRuleGroups(diagnostics, limit, rulePriority).map(([ruleKey]) => ruleKey));
16062
16054
  const buildTopErrorsLines = (diagnostics, resolveSourceRoot, rulePriority) => {
16063
- const errorRuleGroups = selectErrorRuleGroups(diagnostics, rulePriority);
16064
- const topRuleGroups = errorRuleGroups.slice(0, 3);
16055
+ const topRuleGroups = selectErrorRuleGroups(diagnostics, rulePriority).slice(0, 3);
16065
16056
  if (topRuleGroups.length === 0) return [];
16066
- const hiddenRuleCount = errorRuleGroups.length - topRuleGroups.length;
16067
16057
  const lines = [
16068
- highlighter.dim(` ${"─".repeat(60)}`),
16058
+ buildSectionDivider(),
16069
16059
  ` ${highlighter.bold(`Top ${topRuleGroups.length} ${topRuleGroups.length === 1 ? "error" : "errors"} you should fix`)}`,
16070
16060
  ""
16071
16061
  ];
16072
16062
  for (const [ruleKey, ruleDiagnostics] of topRuleGroups) {
16073
- lines.push(...buildRuleDetailBlock(ruleKey, ruleDiagnostics, resolveSourceRoot, false));
16063
+ lines.push(...buildRuleDetailBlock(ruleKey, ruleDiagnostics, resolveSourceRoot, false, false));
16074
16064
  lines.push("");
16075
16065
  }
16076
- if (hiddenRuleCount > 0) lines.push(buildMoreRulesLine(hiddenRuleCount, "errors", highlighter.error));
16077
- return lines;
16078
- };
16079
- const buildWarningsListLines = (diagnostics, rulePriority) => {
16080
- const warningDiagnostics = diagnostics.filter((diagnostic) => diagnostic.severity === "warning");
16081
- if (warningDiagnostics.length === 0) return [];
16082
- const sortedRuleGroups = buildSortedRuleGroups(warningDiagnostics, rulePriority);
16083
- const shownRuleGroups = sortedRuleGroups.slice(0, 10);
16084
- const hiddenRuleCount = sortedRuleGroups.length - shownRuleGroups.length;
16085
- const ruleNameColumnWidth = computeRuleNameColumnWidth(shownRuleGroups.map(([ruleKey]) => ruleKey));
16086
- const lines = [
16087
- highlighter.dim(` ${"─".repeat(60)}`),
16088
- ` ${highlighter.bold(`${warningDiagnostics.length} ${warningDiagnostics.length === 1 ? "warning" : "warnings"}`)}`,
16089
- ""
16090
- ];
16091
- for (const [ruleKey, ruleDiagnostics] of shownRuleGroups) lines.push(buildWarningHeaderLine(ruleKey, ruleDiagnostics.length, ruleNameColumnWidth));
16092
- if (hiddenRuleCount > 0) lines.push(buildMoreRulesLine(hiddenRuleCount, "warnings", highlighter.warn));
16093
16066
  return lines;
16094
16067
  };
16095
16068
  const buildCategoryBreakdownLines = (diagnostics, rulePriority) => buildCategoryDiagnosticGroups(diagnostics, rulePriority).map(buildCompactCategoryLine);
@@ -16120,14 +16093,11 @@ const printDiagnostics = (diagnostics, isVerbose, sourceRoot, rulePriority, isAg
16120
16093
  const resolveSourceRoot = typeof sourceRoot === "function" ? sourceRoot : () => sourceRoot;
16121
16094
  let detailLines;
16122
16095
  if (!isVerbose) detailLines = buildTopErrorsLines(diagnostics, resolveSourceRoot, rulePriority);
16123
- else {
16124
- const sortedRuleGroups = buildSortedRuleGroups(diagnostics, rulePriority);
16125
- const warningRuleNameColumnWidth = computeRuleNameColumnWidth(sortedRuleGroups.filter(([, ruleDiagnostics]) => !isErrorRuleGroup(ruleDiagnostics)).map(([ruleKey]) => ruleKey));
16126
- detailLines = sortedRuleGroups.flatMap(([ruleKey, ruleDiagnostics]) => {
16127
- return [...isErrorRuleGroup(ruleDiagnostics) ? buildRuleDetailBlock(ruleKey, ruleDiagnostics, resolveSourceRoot, true) : buildWarningRuleBlock(ruleKey, ruleDiagnostics, warningRuleNameColumnWidth, isAgentEnvironment), ""];
16128
- });
16129
- }
16130
- const lines = joinSections(buildCategoryBreakdownLines(diagnostics, rulePriority), buildCountsSummaryLines(diagnostics), detailLines, isVerbose ? [] : buildWarningsListLines(diagnostics, rulePriority));
16096
+ else detailLines = buildSortedRuleGroups(diagnostics, rulePriority).flatMap(([ruleKey, ruleDiagnostics]) => {
16097
+ return [...buildRuleDetailBlock(ruleKey, ruleDiagnostics, resolveSourceRoot, true, isAgentEnvironment), ""];
16098
+ });
16099
+ const overflowLine = isVerbose ? void 0 : buildOverflowSummaryLine(diagnostics, rulePriority);
16100
+ const lines = joinSections(buildCategoryBreakdownLines(diagnostics, rulePriority), buildCountsSummaryLines(diagnostics), detailLines, overflowLine ? [overflowLine] : []);
16131
16101
  for (const line of lines) yield* Console.log(line);
16132
16102
  });
16133
16103
  const formatElapsedTime = (elapsedMilliseconds) => {
@@ -16387,16 +16357,21 @@ const buildShareUrl = (diagnostics, scoreResult, projectName) => {
16387
16357
  if (affectedFileCount > 0) params.set("f", String(affectedFileCount));
16388
16358
  return `${SHARE_BASE_URL}?${params.toString()}`;
16389
16359
  };
16390
- const printVerboseTip = (diagnostics, isVerbose) => Effect.gen(function* () {
16391
- if (isVerbose || diagnostics.length === 0) return;
16392
- const command = highlighter.info("npx react-doctor@latest --verbose");
16393
- const message = diagnostics.some((diagnostic) => diagnostic.severity === "warning") ? `Run ${command} to see each warning explained with its fix` : `Run ${command} to see each issue explained with its fix`;
16394
- yield* Console.log(highlighter.dim(` Tip: ${message}`));
16395
- });
16396
- const printDocsNote = () => Effect.gen(function* () {
16360
+ const printFooter = (input) => Effect.gen(function* () {
16361
+ yield* Console.log("");
16362
+ yield* Console.log(buildSectionDivider());
16397
16363
  yield* Console.log("");
16364
+ if (!input.isOffline) {
16365
+ const shareUrl = buildShareUrl(input.diagnostics, input.scoreResult, input.projectName);
16366
+ yield* Console.log(` ${highlighter.bold("Share:")} ${highlighter.info(shareUrl)}`);
16367
+ yield* Console.log(highlighter.dim(" Tell others how you did on socials"));
16368
+ yield* Console.log("");
16369
+ }
16398
16370
  yield* Console.log(` ${highlighter.bold("Docs:")} ${highlighter.info(DOCS_URL)}`);
16399
- yield* Console.log(highlighter.dim(" Set up CI/CD, suppress rules with a config file, and scan diffs or PRs."));
16371
+ yield* Console.log(highlighter.dim(" Learn more about fixing issues, setting up CI/CD, and configuring rules with a config file"));
16372
+ yield* Console.log("");
16373
+ yield* Console.log(` ${highlighter.bold("GitHub:")} ${highlighter.info(CANONICAL_GITHUB_URL)}`);
16374
+ yield* Console.log(highlighter.dim(" Report issues and star the repository!"));
16400
16375
  });
16401
16376
  const printSummary = (input) => Effect.gen(function* () {
16402
16377
  if (input.scoreResult) {
@@ -16411,12 +16386,6 @@ const printSummary = (input) => Effect.gen(function* () {
16411
16386
  catch: (cause) => cause
16412
16387
  }).pipe(Effect.orElseSucceed(() => null));
16413
16388
  if (diagnosticsDirectory !== null && input.verbose) yield* Console.log(highlighter.gray(` Full diagnostics written to ${diagnosticsDirectory}`));
16414
- if (!input.isOffline) {
16415
- yield* Console.log("");
16416
- const shareUrl = buildShareUrl(input.diagnostics, input.scoreResult, input.projectName);
16417
- yield* Console.log(` ${highlighter.bold("Share:")} ${highlighter.info(shareUrl)}`);
16418
- yield* Console.log("");
16419
- }
16420
16389
  });
16421
16390
  //#endregion
16422
16391
  //#region src/cli/utils/cli-logger.ts
@@ -16769,10 +16738,8 @@ const finalizeAndRender = (input) => Effect.gen(function* () {
16769
16738
  elapsedMilliseconds,
16770
16739
  scoreResult: score,
16771
16740
  potentialScore,
16772
- projectName: project.projectName,
16773
16741
  totalSourceFileCount: lintSourceFileCount,
16774
16742
  noScoreMessage,
16775
- isOffline: !shouldShowShareLink,
16776
16743
  verbose: options.verbose
16777
16744
  });
16778
16745
  if (hasSkippedChecks) {
@@ -16780,8 +16747,12 @@ const finalizeAndRender = (input) => Effect.gen(function* () {
16780
16747
  yield* Console.log("");
16781
16748
  yield* Console.warn(highlighter.warn(` Note: ${skippedLabel} checks failed — score may be incomplete.`));
16782
16749
  }
16783
- yield* printVerboseTip([...surfaceDiagnostics], options.verbose);
16784
- yield* printDocsNote();
16750
+ yield* printFooter({
16751
+ diagnostics: [...surfaceDiagnostics],
16752
+ scoreResult: score,
16753
+ projectName: project.projectName,
16754
+ isOffline: !shouldShowShareLink
16755
+ });
16785
16756
  return buildResult();
16786
16757
  });
16787
16758
  //#endregion
@@ -18232,6 +18203,7 @@ const detectLaunchableAgents = async () => {
18232
18203
  };
18233
18204
  const handoffToAgent = async (input) => {
18234
18205
  if (!input.interactive || input.diagnostics.length === 0) return;
18206
+ cliLogger.break();
18235
18207
  const { handoffTarget } = await prompts({
18236
18208
  type: "select",
18237
18209
  name: "handoffTarget",
@@ -18491,7 +18463,7 @@ const findLowestScoredScan = (completedScans) => {
18491
18463
  return scoredScans.reduce((worst, scan) => scan.result.score.score < worst.result.score.score ? scan : worst);
18492
18464
  };
18493
18465
  const printMultiProjectSummary = (input) => Effect.gen(function* () {
18494
- const { completedScans, userConfig, verbose } = input;
18466
+ const { completedScans, userConfig, verbose, isOffline, projectName } = input;
18495
18467
  const surfaceDiagnostics = filterDiagnosticsForSurface(completedScans.flatMap((scan) => scan.result.diagnostics), "cli", userConfig);
18496
18468
  const projectRootByDiagnostic = /* @__PURE__ */ new WeakMap();
18497
18469
  for (const scan of completedScans) for (const diagnostic of scan.result.diagnostics) projectRootByDiagnostic.set(diagnostic, scan.result.project.rootDirectory);
@@ -18518,10 +18490,8 @@ const printMultiProjectSummary = (input) => Effect.gen(function* () {
18518
18490
  elapsedMilliseconds: completedScans.reduce((sum, scan) => sum + scan.result.elapsedMilliseconds, 0),
18519
18491
  scoreResult: aggregateScore,
18520
18492
  potentialScore: lowestScoredScan ? yield* Effect.promise(() => computeProjectedScore(surfaceDiagnostics, lowestScoredScan.result.diagnostics, lowestScoredScan.result.score)) : null,
18521
- projectName: completedScans.map((scan) => scan.result.project.projectName).join(", "),
18522
18493
  totalSourceFileCount,
18523
18494
  noScoreMessage: "Score unavailable.",
18524
- isOffline: true,
18525
18495
  verbose
18526
18496
  });
18527
18497
  const entries = completedScans.map((scan) => {
@@ -18536,9 +18506,12 @@ const printMultiProjectSummary = (input) => Effect.gen(function* () {
18536
18506
  const longestProjectNameLength = Math.max(...entries.map((entry) => entry.projectName.length));
18537
18507
  yield* Console.log("");
18538
18508
  for (const entry of entries) yield* Console.log(buildSummaryLine(entry, longestProjectNameLength));
18539
- yield* Console.log("");
18540
- yield* printVerboseTip(surfaceDiagnostics, verbose);
18541
- yield* printDocsNote();
18509
+ yield* printFooter({
18510
+ diagnostics: surfaceDiagnostics,
18511
+ scoreResult: aggregateScore,
18512
+ projectName,
18513
+ isOffline
18514
+ });
18542
18515
  });
18543
18516
  //#endregion
18544
18517
  //#region src/cli/utils/prompt-install-setup.ts
@@ -19089,11 +19062,16 @@ const inspectAction = async (directory, flags) => {
19089
19062
  });
19090
19063
  if (!isQuiet && !isMultiProject) cliLogger.break();
19091
19064
  }
19092
- if (!isQuiet && isMultiProject && completedScans.length > 0) await Effect.runPromise(printMultiProjectSummary({
19093
- completedScans,
19094
- userConfig,
19095
- verbose: Boolean(flags.verbose)
19096
- }));
19065
+ if (!isQuiet && isMultiProject && completedScans.length > 0) {
19066
+ const shouldShowShareLink = !scanOptions.noScore && (userConfig?.share ?? true) && !scanOptions.isCi;
19067
+ await Effect.runPromise(printMultiProjectSummary({
19068
+ completedScans,
19069
+ userConfig,
19070
+ verbose: Boolean(flags.verbose),
19071
+ isOffline: !shouldShowShareLink,
19072
+ projectName: path.basename(resolvedDirectory)
19073
+ }));
19074
+ }
19097
19075
  finalizeScans({
19098
19076
  diagnostics: allDiagnostics,
19099
19077
  completedScans,
@@ -20038,4 +20016,4 @@ program.parseAsync(argv).then(() => flushSentry()).catch(async (error) => {
20038
20016
  export {};
20039
20017
 
20040
20018
  //# sourceMappingURL=cli.js.map
20041
- //# debugId=6e59d54f-a063-5355-9b76-f82556f70c89
20019
+ //# debugId=e5345c0f-0e42-5045-8127-8f9f7a251f64
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]="4bb0de05-d610-5389-a78b-f54547ccdc56")}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]="a56b86f0-1c28-52ae-9677-12f5e67df34f")}catch(e){}}();
3
3
  import { createRequire } from "node:module";
4
4
  import * as Schema from "effect/Schema";
5
5
  import * as fs$1 from "node:fs";
@@ -5312,6 +5312,81 @@ const checkReducedMotion = (rootDirectory) => {
5312
5312
  if (result.status === 0) return [];
5313
5313
  return [MISSING_REDUCED_MOTION_DIAGNOSTIC];
5314
5314
  };
5315
+ var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
5316
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
5317
+ 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);
5318
+ let formatter = (open, close, replace = open) => (input) => {
5319
+ let string = "" + input, index = string.indexOf(close, open.length);
5320
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
5321
+ };
5322
+ let replaceClose = (string, close, replace, index) => {
5323
+ let result = "", cursor = 0;
5324
+ do {
5325
+ result += string.substring(cursor, index) + replace;
5326
+ cursor = index + close.length;
5327
+ index = string.indexOf(close, cursor);
5328
+ } while (~index);
5329
+ return result + string.substring(cursor);
5330
+ };
5331
+ let createColors = (enabled = isColorSupported) => {
5332
+ let f = enabled ? formatter : () => String;
5333
+ return {
5334
+ isColorSupported: enabled,
5335
+ reset: f("\x1B[0m", "\x1B[0m"),
5336
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
5337
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
5338
+ italic: f("\x1B[3m", "\x1B[23m"),
5339
+ underline: f("\x1B[4m", "\x1B[24m"),
5340
+ inverse: f("\x1B[7m", "\x1B[27m"),
5341
+ hidden: f("\x1B[8m", "\x1B[28m"),
5342
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
5343
+ black: f("\x1B[30m", "\x1B[39m"),
5344
+ red: f("\x1B[31m", "\x1B[39m"),
5345
+ green: f("\x1B[32m", "\x1B[39m"),
5346
+ yellow: f("\x1B[33m", "\x1B[39m"),
5347
+ blue: f("\x1B[34m", "\x1B[39m"),
5348
+ magenta: f("\x1B[35m", "\x1B[39m"),
5349
+ cyan: f("\x1B[36m", "\x1B[39m"),
5350
+ white: f("\x1B[37m", "\x1B[39m"),
5351
+ gray: f("\x1B[90m", "\x1B[39m"),
5352
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
5353
+ bgRed: f("\x1B[41m", "\x1B[49m"),
5354
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
5355
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
5356
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
5357
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
5358
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
5359
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
5360
+ blackBright: f("\x1B[90m", "\x1B[39m"),
5361
+ redBright: f("\x1B[91m", "\x1B[39m"),
5362
+ greenBright: f("\x1B[92m", "\x1B[39m"),
5363
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
5364
+ blueBright: f("\x1B[94m", "\x1B[39m"),
5365
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
5366
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
5367
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
5368
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
5369
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
5370
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
5371
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
5372
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
5373
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
5374
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
5375
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
5376
+ };
5377
+ };
5378
+ module.exports = createColors();
5379
+ module.exports.createColors = createColors;
5380
+ })))(), 1);
5381
+ const highlighter = {
5382
+ error: import_picocolors.default.red,
5383
+ warn: import_picocolors.default.yellow,
5384
+ info: import_picocolors.default.cyan,
5385
+ success: import_picocolors.default.green,
5386
+ dim: import_picocolors.default.dim,
5387
+ gray: import_picocolors.default.gray,
5388
+ bold: import_picocolors.default.bold
5389
+ };
5315
5390
  const computeJsxIncludePaths = (includePaths) => includePaths.length > 0 ? includePaths.filter((filePath) => JSX_FILE_PATTERN.test(filePath)) : void 0;
5316
5391
  const LINGUIST_ATTRIBUTE_PATTERN = /^linguist-(?:vendored|generated)(?:=([a-zA-Z0-9]+))?$/i;
5317
5392
  const FALSY_VALUES = new Set([
@@ -8146,7 +8221,7 @@ const runInspect = (input, hooks = {}) => Effect.gen(function* () {
8146
8221
  reason: null
8147
8222
  });
8148
8223
  const scanConcurrency = yield* OxlintConcurrency;
8149
- const workerCountSuffix = scanConcurrency > 1 ? ` · ${scanConcurrency} workers` : "";
8224
+ const workerCountSuffix = scanConcurrency > 1 ? ` ${highlighter.dim(`[~${scanConcurrency} workers]`)}` : "";
8150
8225
  const scanProgress = yield* progressService.start("Scanning...");
8151
8226
  const scanStartTime = Date.now();
8152
8227
  let lastReportedTotalFileCount = 0;
@@ -8591,73 +8666,6 @@ const getDiffInfo = (directory, explicitBaseBranch) => Effect.runPromise(Effect.
8591
8666
  };
8592
8667
  }).pipe(Effect.provide(Git.layerNode)));
8593
8668
  const filterSourceFiles = (filePaths) => filePaths.filter(isLintableSourceFile);
8594
- var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
8595
- let p = process || {}, argv = p.argv || [], env = p.env || {};
8596
- 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);
8597
- let formatter = (open, close, replace = open) => (input) => {
8598
- let string = "" + input, index = string.indexOf(close, open.length);
8599
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
8600
- };
8601
- let replaceClose = (string, close, replace, index) => {
8602
- let result = "", cursor = 0;
8603
- do {
8604
- result += string.substring(cursor, index) + replace;
8605
- cursor = index + close.length;
8606
- index = string.indexOf(close, cursor);
8607
- } while (~index);
8608
- return result + string.substring(cursor);
8609
- };
8610
- let createColors = (enabled = isColorSupported) => {
8611
- let f = enabled ? formatter : () => String;
8612
- return {
8613
- isColorSupported: enabled,
8614
- reset: f("\x1B[0m", "\x1B[0m"),
8615
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
8616
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
8617
- italic: f("\x1B[3m", "\x1B[23m"),
8618
- underline: f("\x1B[4m", "\x1B[24m"),
8619
- inverse: f("\x1B[7m", "\x1B[27m"),
8620
- hidden: f("\x1B[8m", "\x1B[28m"),
8621
- strikethrough: f("\x1B[9m", "\x1B[29m"),
8622
- black: f("\x1B[30m", "\x1B[39m"),
8623
- red: f("\x1B[31m", "\x1B[39m"),
8624
- green: f("\x1B[32m", "\x1B[39m"),
8625
- yellow: f("\x1B[33m", "\x1B[39m"),
8626
- blue: f("\x1B[34m", "\x1B[39m"),
8627
- magenta: f("\x1B[35m", "\x1B[39m"),
8628
- cyan: f("\x1B[36m", "\x1B[39m"),
8629
- white: f("\x1B[37m", "\x1B[39m"),
8630
- gray: f("\x1B[90m", "\x1B[39m"),
8631
- bgBlack: f("\x1B[40m", "\x1B[49m"),
8632
- bgRed: f("\x1B[41m", "\x1B[49m"),
8633
- bgGreen: f("\x1B[42m", "\x1B[49m"),
8634
- bgYellow: f("\x1B[43m", "\x1B[49m"),
8635
- bgBlue: f("\x1B[44m", "\x1B[49m"),
8636
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
8637
- bgCyan: f("\x1B[46m", "\x1B[49m"),
8638
- bgWhite: f("\x1B[47m", "\x1B[49m"),
8639
- blackBright: f("\x1B[90m", "\x1B[39m"),
8640
- redBright: f("\x1B[91m", "\x1B[39m"),
8641
- greenBright: f("\x1B[92m", "\x1B[39m"),
8642
- yellowBright: f("\x1B[93m", "\x1B[39m"),
8643
- blueBright: f("\x1B[94m", "\x1B[39m"),
8644
- magentaBright: f("\x1B[95m", "\x1B[39m"),
8645
- cyanBright: f("\x1B[96m", "\x1B[39m"),
8646
- whiteBright: f("\x1B[97m", "\x1B[39m"),
8647
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
8648
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
8649
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
8650
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
8651
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
8652
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
8653
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
8654
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
8655
- };
8656
- };
8657
- module.exports = createColors();
8658
- module.exports.createColors = createColors;
8659
- })))(), 1);
8660
- import_picocolors.default.red, import_picocolors.default.yellow, import_picocolors.default.cyan, import_picocolors.default.green, import_picocolors.default.dim, import_picocolors.default.gray, import_picocolors.default.bold;
8661
8669
  /**
8662
8670
  * Back-compat alias: the streaming pipeline holds its caches in
8663
8671
  * per-pipeline closures that are garbage-collected when the pipeline
@@ -8734,4 +8742,4 @@ const toJsonReport = (result, options) => buildJsonReport({
8734
8742
  export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, diagnose, filterSourceFiles, getDiffInfo, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
8735
8743
 
8736
8744
  //# sourceMappingURL=index.js.map
8737
- //# debugId=4bb0de05-d610-5389-a78b-f54547ccdc56
8745
+ //# debugId=a56b86f0-1c28-52ae-9677-12f5e67df34f
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-doctor",
3
- "version": "0.2.15-dev.bf4c21e",
3
+ "version": "0.2.16-dev.2d1ab24",
4
4
  "description": "Diagnose and fix React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -63,7 +63,7 @@
63
63
  "oxlint": "^1.66.0",
64
64
  "prompts": "^2.4.2",
65
65
  "typescript": ">=5.0.4 <7",
66
- "oxlint-plugin-react-doctor": "0.2.15-dev.bf4c21e"
66
+ "oxlint-plugin-react-doctor": "0.2.16-dev.2d1ab24"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/babel__code-frame": "^7.27.0",
@@ -71,8 +71,8 @@
71
71
  "@xterm/headless": "^6.0.0",
72
72
  "commander": "^14.0.3",
73
73
  "ora": "^9.4.0",
74
- "@react-doctor/core": "0.2.15",
75
- "@react-doctor/api": "0.2.15"
74
+ "@react-doctor/core": "0.2.16",
75
+ "@react-doctor/api": "0.2.16"
76
76
  },
77
77
  "engines": {
78
78
  "node": "^20.19.0 || >=22.12.0"