react-doctor 0.9.12-dev.4bf7aff → 0.9.12-dev.557145
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.
- package/dist/{build-section-divider-BrLIB-D7.js → build-section-divider-03Wz07A3.js} +7 -7
- package/dist/{ci-CeH4dHOK.js → ci-BJISp0Lg.js} +12 -12
- package/dist/cli.js +28 -27
- package/dist/{design-Bn2LJDXt.js → design-C85Z6wgY.js} +4 -4
- package/dist/{exit-gracefully-Blo9jwuk.js → exit-gracefully-BtYRR9PK.js} +6 -6
- package/dist/{handle-error-D0BuR0Dc.js → handle-error-CHEoVuek.js} +17 -12
- package/dist/index.js +356 -184
- package/dist/{inspect-Vyb-meG2.js → inspect-vOtCicMw.js} +16 -16
- package/dist/{install-C9V6JQXz.js → install-DGW5St2C.js} +9 -9
- package/dist/{install-doctor-script-0zUKtsMd.js → install-doctor-script-BcPdnCoo.js} +6 -13
- package/dist/{install-github-workflow-D-Z21aVz.js → install-github-workflow-B8pUhQ3R.js} +5 -5
- package/dist/{install-react-doctor-CgT3q6_m.js → install-react-doctor-Dtcyy__y.js} +8 -8
- package/dist/{jsx-runtime-ChVt4rNd.js → jsx-runtime-BdJ4Qkgp.js} +5 -5
- package/dist/{print-branded-header-Cm7L64hl.js → print-branded-header-DcnApzbb.js} +4 -4
- package/dist/project-analysis-worker.js +53 -52
- package/dist/{prompt-runtime-scan-url-2yw6stWR.js → prompt-runtime-scan-url-DO5LWX8q.js} +5 -5
- package/dist/{read-object-file-BLUodl5j.js → read-object-file-nByxIxZd.js} +4 -4
- package/dist/{record-metric-DqNkPvNY.js → record-metric-Bkub8U7Q.js} +302 -129
- package/dist/{report-error-BhxgJ1Bf.js → report-error-DuEpff_7.js} +5 -5
- package/dist/{report-workflow-result-dIw9MVfN.js → report-workflow-result--V0KVZGX.js} +5 -5
- package/dist/{resolve-scope-DSn7782l.js → resolve-scope-ajqqgMdS.js} +6 -6
- package/dist/{rules-DckJBHA1.js → rules-B3Jk5BS6.js} +6 -6
- package/dist/{run-scan-app-C-vd0anS.js → run-scan-app-D7yKEvMi.js} +16 -14
- package/dist/{runtime-scan-CuBMTJYl.js → runtime-scan-CN_fvs6q.js} +9 -9
- package/dist/{sanitize-runtime-url-DiXqYoZR.js → sanitize-runtime-url-CkCpxd4T.js} +4 -4
- package/dist/{scan-CwQkAEFD.js → scan-B2ijGQAP.js} +9 -9
- package/dist/{should-fail-scan-gate-Br2NmugG.js → should-fail-scan-gate-3inPx0Rt.js} +11 -11
- package/dist/{should-skip-prompts-DCHX17OJ.js → should-skip-prompts-BmKdNS3r.js} +4 -4
- package/dist/{should-use-tui-BPf_hyKV.js → should-use-tui-LbXua39D.js} +4 -4
- package/dist/{telemetry-runtime-Dbtes4ZJ.js → telemetry-runtime-pRbw2p6F.js} +55 -7
- package/dist/{version-B0XaCP00.js → version-BWpE-HbU.js} +4 -4
- package/dist/{why-CMvBe6qE.js → why-CyItx1Pg.js} +4 -4
- package/dist/{with-run-span-B1byxVXE.js → with-run-span-mTMAyfjb.js} +5 -5
- package/package.json +5 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-
|
|
4
|
-
import { r as isExpectedUserError } from "./telemetry-runtime-
|
|
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]="6e2dd43c-5807-583f-8967-57dc2a59e007")}catch(e){}}();
|
|
3
|
+
import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-Bkub8U7Q.js";
|
|
4
|
+
import { r as isExpectedUserError } from "./telemetry-runtime-pRbw2p6F.js";
|
|
5
5
|
import * as Sentry from "@sentry/node";
|
|
6
6
|
//#region src/cli/utils/scrub-sentry-event.ts
|
|
7
7
|
/**
|
|
@@ -70,13 +70,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
70
70
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
71
71
|
* standard `SENTRY_RELEASE` override.
|
|
72
72
|
*/
|
|
73
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.12-dev.
|
|
73
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.12-dev.0557145`;
|
|
74
74
|
/**
|
|
75
75
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
76
76
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
77
77
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
78
78
|
*/
|
|
79
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.12-dev.
|
|
79
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.12-dev.0557145") ? "development" : "production");
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/instrument.ts
|
|
82
82
|
let isInitialized = false;
|
|
@@ -212,5 +212,5 @@ const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repe
|
|
|
212
212
|
//#endregion
|
|
213
213
|
export { initializeSentry as i, buildFooterLinkLines as n, flushSentry as r, buildSectionDivider as t };
|
|
214
214
|
|
|
215
|
-
//# sourceMappingURL=build-section-divider-
|
|
216
|
-
//# debugId=
|
|
215
|
+
//# sourceMappingURL=build-section-divider-03Wz07A3.js.map
|
|
216
|
+
//# debugId=6e2dd43c-5807-583f-8967-57dc2a59e007
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="e22f7d55-4a4c-51c6-851a-c89cca46e05a")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { Kt as highlighter, T as METRIC, cr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, tr as CI_URL, zn as runSync } from "./record-metric-
|
|
5
|
-
import { r as isExpectedUserError } from "./telemetry-runtime-
|
|
6
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
7
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
8
|
-
import {
|
|
9
|
-
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-
|
|
10
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-
|
|
11
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
12
|
-
import { t as printBrandedHeader } from "./print-branded-header-
|
|
4
|
+
import { Kt as highlighter, T as METRIC, cr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, tr as CI_URL, zn as runSync } from "./record-metric-Bkub8U7Q.js";
|
|
5
|
+
import { r as isExpectedUserError } from "./telemetry-runtime-pRbw2p6F.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-CHEoVuek.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-DuEpff_7.js";
|
|
8
|
+
import { M as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-BcPdnCoo.js";
|
|
9
|
+
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-B8pUhQ3R.js";
|
|
10
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-ajqqgMdS.js";
|
|
11
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-BmKdNS3r.js";
|
|
12
|
+
import { t as printBrandedHeader } from "./print-branded-header-DcnApzbb.js";
|
|
13
13
|
import * as path$1 from "node:path";
|
|
14
14
|
import * as fs$1 from "node:fs";
|
|
15
15
|
//#region src/cli/utils/ci/ci-provider.ts
|
|
@@ -7498,5 +7498,5 @@ const ciConfigAction = (options) => runCiCommand("config", runCiConfig, options)
|
|
|
7498
7498
|
//#endregion
|
|
7499
7499
|
export { ciConfigAction, ciInstallAction, ciUpgradeAction };
|
|
7500
7500
|
|
|
7501
|
-
//# sourceMappingURL=ci-
|
|
7502
|
-
//# debugId=
|
|
7501
|
+
//# sourceMappingURL=ci-BJISp0Lg.js.map
|
|
7502
|
+
//# debugId=e22f7d55-4a4c-51c6-851a-c89cca46e05a
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f42b1a1f-3941-5a61-bf1b-ea87400b9ec6")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { H as isDebugFlagEnabled, Kt as highlighter, _ as VERSION, d as isJsonModeActive, er as CANONICAL_GITHUB_URL, gn as setColorEnabled, h as writeJsonErrorReport, i as isTelemetryEnabled, tr as CI_URL, z as CliInputError } from "./record-metric-
|
|
5
|
-
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-
|
|
6
|
-
import { i as initializeSentry, r as flushSentry } from "./build-section-divider-
|
|
7
|
-
import { t as exitGracefully } from "./exit-gracefully-
|
|
8
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
4
|
+
import { H as isDebugFlagEnabled, Kt as highlighter, _ as VERSION, d as isJsonModeActive, er as CANONICAL_GITHUB_URL, gn as setColorEnabled, h as writeJsonErrorReport, i as isTelemetryEnabled, tr as CI_URL, z as CliInputError } from "./record-metric-Bkub8U7Q.js";
|
|
5
|
+
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-pRbw2p6F.js";
|
|
6
|
+
import { i as initializeSentry, r as flushSentry } from "./build-section-divider-03Wz07A3.js";
|
|
7
|
+
import { t as exitGracefully } from "./exit-gracefully-BtYRR9PK.js";
|
|
8
|
+
import { n as handleUserError, t as handleError } from "./handle-error-CHEoVuek.js";
|
|
9
9
|
import { n as getLastRunTraceId } from "./active-run-trace-dlIZeEvb.js";
|
|
10
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
10
|
+
import { t as reportErrorToSentry } from "./report-error-DuEpff_7.js";
|
|
11
11
|
import { t as unrefStdin } from "./unref-stdin-BKT_s38a.js";
|
|
12
12
|
import { execFileSync } from "node:child_process";
|
|
13
13
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
|
|
@@ -3529,7 +3529,7 @@ ${highlighter.dim("Learn more:")}
|
|
|
3529
3529
|
const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
|
|
3530
3530
|
const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[directory]", "project directory to scan", ".").option("--lint", "enable linting").option("--no-lint", "skip linting").addOption(new Option("--dead-code").hideHelp()).addOption(new Option("--no-dead-code").hideHelp()).option("--supply-chain", "enable the dependency supply-chain scan (default)").option("--no-supply-chain", "skip the dependency supply-chain scan (Socket.dev dependency health checks)").option("--verbose", "show every rule and per-file details (default shows top 3 rules)").option("--debug", "force a Sentry trace and print its id at the end (paste it into a bug report)").option("--output-dir <dir>", "directory for the full diagnostics dump (default: a temp folder)").option("--score", "output only the score").option("--json", "output a single structured JSON report (suppresses other output)").option("--json-compact", "with --json, emit compact JSON (no indentation)").option("--json-out <path>", "with --json, write the report to a file instead of stdout").option("--no-cache", "disable all scan caches for this run").option("-y, --yes", "skip prompts, scan all workspace projects").option("--no-parallel", "lint serially with one worker (default: parallel across CPU cores; set the worker count with REACT_DOCTOR_PARALLEL)").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple); overrides the `projects` config field").option("--scope <value>", "how much supported JS/TS and inline HTML script source to scan/report: full (default), files, changed (only new issues vs base), or lines (issues whose source spans touch changed lines)").option("--base <ref>", "base git ref for files/changed/lines scope (auto-detected when omitted)").option("--include-untracked", "with --scope files/changed/lines, also scan ordinary untracked files (respects .gitignore)").addOption(new Option("--diff [base]", "[deprecated] alias for --scope changed (pass `false` to force a full scan)").hideHelp()).addOption(new Option("--changed-files-from <file>", "scan source files listed in a newline-delimited changed-files file").hideHelp()).option("--no-score", "skip the score API, the share URL, and crash reporting").addOption(new Option("--category <category>", "only show diagnostics in a category (repeatable; e.g. Security)").argParser(collectCategoryOption)).option("--no-telemetry", "alias for --no-score (skip the score API, share URL, and crash reporting)").option("--staged", "scan only staged (git index) files for pre-commit hooks (honors --project and config `projects`; exits 0 when nothing is staged)").option("--max-duration <seconds>", MAX_DURATION_OPTION_DESCRIPTION).option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").addOption(new Option("--fail-on <level>", "[deprecated] alias for --blocking <level>").hideHelp()).option("--no-respect-inline-disables", "audit mode: neutralize inline lint suppressions before scanning").option("--warnings", "show warning-severity diagnostics (default)").option("--no-warnings", "hide warning-severity diagnostics (errors only)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderRootHelpEpilog);
|
|
3531
3531
|
program.action(async (directory = ".", flags) => {
|
|
3532
|
-
const { runScanCommand } = await import("./scan-
|
|
3532
|
+
const { runScanCommand } = await import("./scan-B2ijGQAP.js");
|
|
3533
3533
|
return runScanCommand({
|
|
3534
3534
|
directory,
|
|
3535
3535
|
flags,
|
|
@@ -3537,75 +3537,75 @@ program.action(async (directory = ".", flags) => {
|
|
|
3537
3537
|
});
|
|
3538
3538
|
});
|
|
3539
3539
|
program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
|
|
3540
|
-
const { designAction } = await import("./design-
|
|
3540
|
+
const { designAction } = await import("./design-C85Z6wgY.js");
|
|
3541
3541
|
return designAction(directory ?? ".", command.optsWithGlobals());
|
|
3542
3542
|
});
|
|
3543
3543
|
program.command("scan").description("Scan a React interaction in Chrome until you press Enter").argument("[url]", "HTTP(S) URL of the running React app; detects local apps when omitted").option("-f, --format <format>", "report format: text, json, or jsonl", "text").option("--cdp <url>", "reuse Chrome at this remote-debugging endpoint").option("--trace-out <path>", "save the compressed .json.gz DevTools trace at this path").addHelpText("after", renderRuntimeScanHelpEpilog).action(async (url, options) => {
|
|
3544
|
-
const { runtimeScanAction } = await import("./runtime-scan-
|
|
3544
|
+
const { runtimeScanAction } = await import("./runtime-scan-CN_fvs6q.js");
|
|
3545
3545
|
return runtimeScanAction(url, options);
|
|
3546
3546
|
});
|
|
3547
3547
|
program.command("why <location>").description("Explain why a rule fired (or why a suppression didn't apply) at a file:line").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple)").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (location, options) => {
|
|
3548
|
-
const { whyAction } = await import("./why-
|
|
3548
|
+
const { whyAction } = await import("./why-CyItx1Pg.js");
|
|
3549
3549
|
return whyAction(location, options);
|
|
3550
3550
|
});
|
|
3551
3551
|
program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install end-of-turn agent hooks for Claude Code and Cursor").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderInstallHelpEpilog).action(async (options, command) => {
|
|
3552
|
-
const { installAction } = await import("./install-
|
|
3552
|
+
const { installAction } = await import("./install-DGW5St2C.js");
|
|
3553
3553
|
return installAction(options, command);
|
|
3554
3554
|
});
|
|
3555
3555
|
const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
|
|
3556
3556
|
const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
|
|
3557
3557
|
const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
|
|
3558
3558
|
ci.command("install").description("Add a CI workflow that scans every pull request").option(...providerOption).option(...prOption).option("--blocking <level>", "gate level: none (advisory, default), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed (default), files, lines, full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; use the defaults").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderCiHelpEpilog).action(async (_options, command) => {
|
|
3559
|
-
const { ciInstallAction } = await import("./ci-
|
|
3559
|
+
const { ciInstallAction } = await import("./ci-BJISp0Lg.js");
|
|
3560
3560
|
return ciInstallAction(command.optsWithGlobals());
|
|
3561
3561
|
});
|
|
3562
3562
|
ci.command("config").description("Change the gate, scan scope, and pull-request reporting").option(...providerOption).option("--blocking <level>", "gate level: none (advisory), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed, files, lines, or full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; print the current settings").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3563
|
-
const { ciConfigAction } = await import("./ci-
|
|
3563
|
+
const { ciConfigAction } = await import("./ci-BJISp0Lg.js");
|
|
3564
3564
|
return ciConfigAction(command.optsWithGlobals());
|
|
3565
3565
|
});
|
|
3566
3566
|
ci.command("upgrade").description("Upgrade the CI workflow to the action's current major").option(...providerOption).option(...prOption).option("-y, --yes", "skip prompts").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3567
|
-
const { ciUpgradeAction } = await import("./ci-
|
|
3567
|
+
const { ciUpgradeAction } = await import("./ci-BJISp0Lg.js");
|
|
3568
3568
|
return ciUpgradeAction(command.optsWithGlobals());
|
|
3569
3569
|
});
|
|
3570
3570
|
program.command("version").description("show the version with Node and platform info").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async () => {
|
|
3571
|
-
const { versionAction } = await import("./version-
|
|
3571
|
+
const { versionAction } = await import("./version-BWpE-HbU.js");
|
|
3572
3572
|
return versionAction();
|
|
3573
3573
|
});
|
|
3574
3574
|
const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
|
|
3575
3575
|
rules.command("list").description("List rules and the severity they run at under your config").option("--category <name>", "only show rules in a category (e.g. Performance)").option("--tag <name>", "only show rules with a tag (e.g. design, test-noise)").option("--framework <name>", "only show rules for a framework (e.g. global, nextjs)").option("--configured", "only show rules your config has changed from the default").option("--json", "output a structured JSON array").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (_options, command) => {
|
|
3576
|
-
const { rulesListAction } = await import("./rules-
|
|
3576
|
+
const { rulesListAction } = await import("./rules-B3Jk5BS6.js");
|
|
3577
3577
|
return rulesListAction(command.optsWithGlobals());
|
|
3578
3578
|
});
|
|
3579
3579
|
rules.command("explain <rule>").description("Explain why a rule matters, its current severity, and how to configure it").option("--json", "output a structured JSON object").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3580
|
-
const { rulesExplainAction } = await import("./rules-
|
|
3580
|
+
const { rulesExplainAction } = await import("./rules-B3Jk5BS6.js");
|
|
3581
3581
|
return rulesExplainAction(rule, command.optsWithGlobals());
|
|
3582
3582
|
});
|
|
3583
3583
|
rules.command("set <rule> <severity>").description("Set a rule's severity: off, warn, or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, severity, _options, command) => {
|
|
3584
|
-
const { rulesSetAction } = await import("./rules-
|
|
3584
|
+
const { rulesSetAction } = await import("./rules-B3Jk5BS6.js");
|
|
3585
3585
|
return rulesSetAction(rule, severity, command.optsWithGlobals());
|
|
3586
3586
|
});
|
|
3587
3587
|
rules.command("enable <rule>").description("Enable a rule at its recommended severity (or pass --severity)").option("--severity <level>", "severity to enable at: warn or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3588
|
-
const { rulesEnableAction } = await import("./rules-
|
|
3588
|
+
const { rulesEnableAction } = await import("./rules-B3Jk5BS6.js");
|
|
3589
3589
|
return rulesEnableAction(rule, command.optsWithGlobals());
|
|
3590
3590
|
});
|
|
3591
3591
|
rules.command("disable <rule>").description("Disable a rule so it never runs").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3592
|
-
const { rulesDisableAction } = await import("./rules-
|
|
3592
|
+
const { rulesDisableAction } = await import("./rules-B3Jk5BS6.js");
|
|
3593
3593
|
return rulesDisableAction(rule, command.optsWithGlobals());
|
|
3594
3594
|
});
|
|
3595
3595
|
rules.command("category <category> <severity>").description("Set the severity for a whole category (off, warn, error)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (category, severity, _options, command) => {
|
|
3596
|
-
const { rulesCategoryAction } = await import("./rules-
|
|
3596
|
+
const { rulesCategoryAction } = await import("./rules-B3Jk5BS6.js");
|
|
3597
3597
|
return rulesCategoryAction(category, severity, command.optsWithGlobals());
|
|
3598
3598
|
});
|
|
3599
3599
|
rules.command("ignore-tag <tag>").description("Skip a whole rule family by tag before linting (e.g. design)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3600
|
-
const { rulesIgnoreTagAction } = await import("./rules-
|
|
3600
|
+
const { rulesIgnoreTagAction } = await import("./rules-B3Jk5BS6.js");
|
|
3601
3601
|
return rulesIgnoreTagAction(tag, command.optsWithGlobals());
|
|
3602
3602
|
});
|
|
3603
3603
|
rules.command("unignore-tag <tag>").description("Stop ignoring a tag previously skipped via ignore-tag").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3604
|
-
const { rulesUnignoreTagAction } = await import("./rules-
|
|
3604
|
+
const { rulesUnignoreTagAction } = await import("./rules-B3Jk5BS6.js");
|
|
3605
3605
|
return rulesUnignoreTagAction(tag, command.optsWithGlobals());
|
|
3606
3606
|
});
|
|
3607
3607
|
program.command("experimental-tui [directory]", { hidden: true }).description("[experimental] interactive, scrollable scan report").option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addOption(new Option("--no-dead-code").hideHelp()).option("--no-supply-chain", "skip the dependency supply-chain scan").option("--score", "only print the numeric score (for scripts and CI)").option("--no-score", "skip the score API, the share URL, and crash reporting").option("--no-cache", "disable all scan caches for this run").option("--max-duration <seconds>", MAX_DURATION_OPTION_DESCRIPTION).option("-p, --project <names>", "scan specific workspace projects (comma-separated, or *)").option("-y, --yes", "skip the project prompt and scan every discovered project").action(async (directory = ".", _localOptions, command) => {
|
|
3608
|
-
const { runScanCommand } = await import("./scan-
|
|
3608
|
+
const { runScanCommand } = await import("./scan-B2ijGQAP.js");
|
|
3609
3609
|
return runScanCommand({
|
|
3610
3610
|
directory,
|
|
3611
3611
|
flags: command.optsWithGlobals(),
|
|
@@ -3635,7 +3635,8 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
3635
3635
|
process.exit(1);
|
|
3636
3636
|
}
|
|
3637
3637
|
if (isUserError) {
|
|
3638
|
-
handleUserError(error);
|
|
3638
|
+
handleUserError(error, { shouldExit: false });
|
|
3639
|
+
await Promise.all([flushSentry(), shutdownTelemetry()]);
|
|
3639
3640
|
return;
|
|
3640
3641
|
}
|
|
3641
3642
|
handleError(error, { sentryEventId });
|
|
@@ -3644,4 +3645,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
3644
3645
|
export {};
|
|
3645
3646
|
|
|
3646
3647
|
//# sourceMappingURL=cli.js.map
|
|
3647
|
-
//# debugId=
|
|
3648
|
+
//# debugId=f42b1a1f-3941-5a61-bf1b-ea87400b9ec6
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { t as inspectAction } from "./inspect-
|
|
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]="e9d2f2ec-9e29-5a05-ad29-c7032d463c86")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-vOtCicMw.js";
|
|
4
4
|
//#region src/cli/commands/design.ts
|
|
5
5
|
const designAction = async (directory, flags) => inspectAction(directory, {
|
|
6
6
|
...flags,
|
|
@@ -10,5 +10,5 @@ const designAction = async (directory, flags) => inspectAction(directory, {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { designAction };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=design-
|
|
14
|
-
//# debugId=
|
|
13
|
+
//# sourceMappingURL=design-C85Z6wgY.js.map
|
|
14
|
+
//# debugId=e9d2f2ec-9e29-5a05-ad29-c7032d463c86
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-
|
|
4
|
-
import { n as shutdownTelemetry } from "./telemetry-runtime-
|
|
5
|
-
import { n as buildFooterLinkLines, r as flushSentry, t as buildSectionDivider } from "./build-section-divider-
|
|
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]="6a639ad8-dc8e-5942-b252-917984d190d2")}catch(e){}}();
|
|
3
|
+
import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-Bkub8U7Q.js";
|
|
4
|
+
import { n as shutdownTelemetry } from "./telemetry-runtime-pRbw2p6F.js";
|
|
5
|
+
import { n as buildFooterLinkLines, r as flushSentry, t as buildSectionDivider } from "./build-section-divider-03Wz07A3.js";
|
|
6
6
|
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-DwG6tSPy.js";
|
|
7
7
|
//#region src/cli/utils/active-tui-renderer.ts
|
|
8
8
|
let activeTuiRenderer = null;
|
|
@@ -50,5 +50,5 @@ const exitGracefully = () => {
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { registerActiveTuiRenderer as n, exitGracefully as t };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=exit-gracefully-
|
|
54
|
-
//# debugId=
|
|
53
|
+
//# sourceMappingURL=exit-gracefully-BtYRR9PK.js.map
|
|
54
|
+
//# debugId=6a639ad8-dc8e-5942-b252-917984d190d2
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { $n as CANONICAL_DISCORD_URL, An as gen, Cn as error, Ft as formatErrorChain, It as formatReactDoctorError, Kt as highlighter, T as METRIC, Xt as isReactDoctorError, _ as VERSION, br as isErrnoException, er as CANONICAL_GITHUB_URL, t as recordCount, zn as runSync } from "./record-metric-
|
|
4
|
-
import { a as
|
|
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]="a8b7c1ad-1c43-58da-9000-becb134c5585")}catch(e){}}();
|
|
3
|
+
import { $n as CANONICAL_DISCORD_URL, An as gen, Cn as error, Ft as formatErrorChain, It as formatReactDoctorError, Kt as highlighter, T as METRIC, Xt as isReactDoctorError, _ as VERSION, br as isErrnoException, er as CANONICAL_GITHUB_URL, t as recordCount, zn as runSync } from "./record-metric-Bkub8U7Q.js";
|
|
4
|
+
import { a as isNpmCacheCorruptionError, i as formatNpmCacheCorruptionError, o as formatEnvironmentError, s as isEnvironmentError } from "./telemetry-runtime-pRbw2p6F.js";
|
|
5
5
|
//#region src/cli/utils/handle-error.ts
|
|
6
6
|
const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
|
|
7
7
|
const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
|
|
@@ -85,15 +85,20 @@ const handleError = (error, options = {}) => {
|
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* Renderer for expected, user-actionable failures — a bad `--diff` value,
|
|
88
|
-
* a base branch that isn't fetched,
|
|
89
|
-
* permission-denied. Prints just the (already
|
|
90
|
-
* "Something went wrong", prefilled issue,
|
|
91
|
-
* — because there is no bug to report.
|
|
88
|
+
* a base branch that isn't fetched, environment errors like disk-full or
|
|
89
|
+
* permission-denied, or npm cache corruption. Prints just the (already
|
|
90
|
+
* human-readable) message — no "Something went wrong", prefilled issue,
|
|
91
|
+
* Discord link, or Sentry reference — because there is no bug to report.
|
|
92
92
|
*/
|
|
93
93
|
const handleUserError = (error$1, options = {}) => {
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
|
|
94
|
+
let message = formatErrorForReport(error$1);
|
|
95
|
+
if (isNpmCacheCorruptionError(error$1)) {
|
|
96
|
+
recordCount(METRIC.cliEnvironmentError, 1, { code: "NPX_CACHE_CORRUPTION" });
|
|
97
|
+
message = formatNpmCacheCorruptionError(error$1);
|
|
98
|
+
} else if (isEnvironmentError(error$1)) {
|
|
99
|
+
recordCount(METRIC.cliEnvironmentError, 1, { code: (isErrnoException(error$1) ? error$1.code : void 0) ?? "unknown" });
|
|
100
|
+
message = formatEnvironmentError(error$1);
|
|
101
|
+
}
|
|
97
102
|
runSync(gen(function* () {
|
|
98
103
|
yield* error("");
|
|
99
104
|
yield* error(highlighter.error(message));
|
|
@@ -105,5 +110,5 @@ const handleUserError = (error$1, options = {}) => {
|
|
|
105
110
|
//#endregion
|
|
106
111
|
export { handleUserError as n, handleError as t };
|
|
107
112
|
|
|
108
|
-
//# sourceMappingURL=handle-error-
|
|
109
|
-
//# debugId=
|
|
113
|
+
//# sourceMappingURL=handle-error-CHEoVuek.js.map
|
|
114
|
+
//# debugId=a8b7c1ad-1c43-58da-9000-becb134c5585
|