react-doctor 0.9.22-dev.e468c6f → 0.9.22-dev.ec45ff9
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-CxquCOYK.js → build-section-divider-BjoMRSay.js} +4 -4
- package/dist/{ci-B4mtVc-c.js → ci-Rhhvl7uT.js} +12 -12
- package/dist/cli.js +23 -23
- package/dist/{design-BM6TGbFH.js → design-C5BQaJUn.js} +4 -4
- package/dist/{exit-gracefully-CUGaLi4F.js → exit-gracefully-BxFRFqPQ.js} +6 -6
- package/dist/{handle-error-CG3D41Vh.js → handle-error-BnEcoXcw.js} +5 -5
- package/dist/index.js +81 -21
- package/dist/{inspect-D-CPR_45.js → inspect-CrcIovH2.js} +15 -15
- package/dist/{install-DH8NGj6J.js → install-DIHCDDtX.js} +9 -9
- package/dist/{install-doctor-script-DNsrTMAN.js → install-doctor-script-CcM2cToW.js} +4 -4
- package/dist/{install-github-workflow-Dwbhz4Ie.js → install-github-workflow-BUaLt5mn.js} +5 -5
- package/dist/{install-react-doctor-CbaxnAd7.js → install-react-doctor-BnaGEio4.js} +8 -8
- package/dist/{jsx-runtime-6FiYholT.js → jsx-runtime-CKOQW4i4.js} +5 -5
- package/dist/{print-branded-header-BInuNRuu.js → print-branded-header-COh3X3He.js} +4 -4
- package/dist/{prompt-runtime-scan-url-C6X4JD_K.js → prompt-runtime-scan-url-lBPap3oz.js} +5 -5
- package/dist/{read-object-file-BUFoDFmn.js → read-object-file-sQUp7PMm.js} +4 -4
- package/dist/{record-metric-DyC3pVhz.js → record-metric-3hs8M2Pf.js} +73 -24
- package/dist/{report-error-94wHhwfJ.js → report-error-CtR7ISJa.js} +5 -5
- package/dist/{report-workflow-result-ID7Hld7R.js → report-workflow-result-C68s63w1.js} +5 -5
- package/dist/{resolve-scan-exit-code--p_tQCbx.js → resolve-scan-exit-code-DrC3xu0y.js} +39 -28
- package/dist/{resolve-scope-bYp84RdE.js → resolve-scope-Cq7AJdtO.js} +6 -6
- package/dist/{rules-B2-rRkNl.js → rules-BesJjxty.js} +6 -6
- package/dist/{run-scan-app-DL3_OYBB.js → run-scan-app-CfsLjIjZ.js} +10 -10
- package/dist/{runtime-scan-B5orrUKv.js → runtime-scan-DA2v7tXp.js} +9 -9
- package/dist/{sanitize-runtime-url-D_ODuw2I.js → sanitize-runtime-url-C9P8617N.js} +4 -4
- package/dist/{scan-BdM3bDAU.js → scan-BTjqJfRl.js} +9 -9
- package/dist/{should-skip-prompts-DLxdYV0L.js → should-skip-prompts-DjIiPcs_.js} +4 -4
- package/dist/{should-use-tui-cnY5YQlY.js → should-use-tui-Cd3om7tH.js} +4 -4
- package/dist/skills/react-doctor/references/explain.md +5 -0
- package/dist/{telemetry-runtime-BvalYKRt.js → telemetry-runtime-JrDTvdnm.js} +6 -6
- package/dist/{version-CN0HCSsI.js → version-osih6Dt3.js} +4 -4
- package/dist/{why-DoPhVMMc.js → why-BJLqu_nm.js} +4 -4
- package/dist/{with-run-span-BCXC9w-J.js → with-run-span-DJ74_coc.js} +5 -5
- package/package.json +2 -2
|
@@ -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]="
|
|
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]="ec894c92-f12b-552e-82ac-0cf9df220e67")}catch(e){}}();
|
|
3
3
|
import { bt as DOCS_URL, lt as CANONICAL_GITHUB_URL } from "./constants-lt2tTZjE.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Nt as highlighter } from "./record-metric-3hs8M2Pf.js";
|
|
5
5
|
//#region src/cli/utils/resolve-measure-width.ts
|
|
6
6
|
const resolveClampedWidth = (input) => {
|
|
7
7
|
const terminalColumns = process.stdout.columns;
|
|
@@ -77,5 +77,5 @@ const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repe
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { buildFooterLinkLines as n, buildSectionDivider as t };
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=build-section-divider-
|
|
81
|
-
//# debugId=
|
|
80
|
+
//# sourceMappingURL=build-section-divider-BjoMRSay.js.map
|
|
81
|
+
//# debugId=ec894c92-f12b-552e-82ac-0cf9df220e67
|
|
@@ -1,16 +1,16 @@
|
|
|
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]="b0328259-cf7e-5ae5-8380-4ecb2a48dadb")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { kt as GITHUB_ACTIONS_SETUP_URL, u as METRIC, ut as CI_URL } from "./constants-lt2tTZjE.js";
|
|
5
|
-
import {
|
|
6
|
-
import { o as isExpectedUserError } from "./telemetry-runtime-
|
|
7
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
8
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
9
|
-
import { N as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-
|
|
10
|
-
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-
|
|
11
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-
|
|
12
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
13
|
-
import { t as printBrandedHeader } from "./print-branded-header-
|
|
5
|
+
import { En as runSync, Nt as highlighter, _t as findGitRepositoryRoot, t as recordCount } from "./record-metric-3hs8M2Pf.js";
|
|
6
|
+
import { o as isExpectedUserError } from "./telemetry-runtime-JrDTvdnm.js";
|
|
7
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BnEcoXcw.js";
|
|
8
|
+
import { t as reportErrorToSentry } from "./report-error-CtR7ISJa.js";
|
|
9
|
+
import { N as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-CcM2cToW.js";
|
|
10
|
+
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-BUaLt5mn.js";
|
|
11
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-Cq7AJdtO.js";
|
|
12
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-DjIiPcs_.js";
|
|
13
|
+
import { t as printBrandedHeader } from "./print-branded-header-COh3X3He.js";
|
|
14
14
|
import * as fs$1 from "node:fs";
|
|
15
15
|
import * as path$1 from "node:path";
|
|
16
16
|
//#region src/cli/utils/ci/ci-provider.ts
|
|
@@ -7509,5 +7509,5 @@ const ciConfigAction = (options) => runCiCommand("config", runCiConfig, options)
|
|
|
7509
7509
|
//#endregion
|
|
7510
7510
|
export { ciConfigAction, ciInstallAction, ciUpgradeAction };
|
|
7511
7511
|
|
|
7512
|
-
//# sourceMappingURL=ci-
|
|
7513
|
-
//# debugId=
|
|
7512
|
+
//# sourceMappingURL=ci-Rhhvl7uT.js.map
|
|
7513
|
+
//# debugId=b0328259-cf7e-5ae5-8380-4ecb2a48dadb
|
package/dist/cli.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { lt as CANONICAL_GITHUB_URL, ut as CI_URL } from "./constants-lt2tTZjE.js";
|
|
5
5
|
import "./start-scan-preamble-CQy0CKXS.js";
|
|
6
|
-
import {
|
|
7
|
-
import { a as initializeSentry, n as shutdownTelemetry, o as isExpectedUserError, r as flushSentry } from "./telemetry-runtime-
|
|
8
|
-
import { t as exitGracefully } from "./exit-gracefully-
|
|
9
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
6
|
+
import { Gn as isFile, Nt as highlighter, Pt as isPathInsideDirectory, S as isDebugFlagEnabled, Un as isDirectory, _ as VERSION, d as isJsonModeActive, gt as filterSourceFiles, h as writeJsonErrorReport, i as isTelemetryEnabled, tn as setColorEnabled, y as CliInputError } from "./record-metric-3hs8M2Pf.js";
|
|
7
|
+
import { a as initializeSentry, n as shutdownTelemetry, o as isExpectedUserError, r as flushSentry } from "./telemetry-runtime-JrDTvdnm.js";
|
|
8
|
+
import { t as exitGracefully } from "./exit-gracefully-BxFRFqPQ.js";
|
|
9
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BnEcoXcw.js";
|
|
10
10
|
import { n as getLastRunTraceId } from "./active-run-trace-Dewycxda.js";
|
|
11
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
11
|
+
import { t as reportErrorToSentry } from "./report-error-CtR7ISJa.js";
|
|
12
12
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
13
13
|
import { t as unrefStdin } from "./unref-stdin-D-NZBFpg.js";
|
|
14
14
|
import * as path$1 from "node:path";
|
|
@@ -3569,7 +3569,7 @@ ${highlighter.dim("Learn more:")}
|
|
|
3569
3569
|
const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
|
|
3570
3570
|
const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[paths...]", "one project directory or source file paths 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), lines (issues whose source spans touch changed lines), or contextual (issues in modified rule contexts)").option("--base <ref>", "base git ref for files/changed/lines/contextual scope (auto-detected when omitted)").option("--baseline <report.json>", "report only new issues compared with a saved JSON report").option("--include-untracked", "with --scope files/changed/lines/contextual, 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)").option("--warning-exit-code <code>", "exit code for non-blocking warnings (2-255). Ignored with --blocking none or --score", parseWarningExitCode).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);
|
|
3571
3571
|
program.action(async (positionalPaths = [], flags) => {
|
|
3572
|
-
const { runScanCommand } = await import("./scan-
|
|
3572
|
+
const { runScanCommand } = await import("./scan-BTjqJfRl.js");
|
|
3573
3573
|
return runScanCommand({
|
|
3574
3574
|
...resolvePositionalScanInput(positionalPaths),
|
|
3575
3575
|
flags,
|
|
@@ -3577,75 +3577,75 @@ program.action(async (positionalPaths = [], flags) => {
|
|
|
3577
3577
|
});
|
|
3578
3578
|
});
|
|
3579
3579
|
program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
|
|
3580
|
-
const { designAction } = await import("./design-
|
|
3580
|
+
const { designAction } = await import("./design-C5BQaJUn.js");
|
|
3581
3581
|
return designAction(directory ?? ".", command.optsWithGlobals());
|
|
3582
3582
|
});
|
|
3583
3583
|
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) => {
|
|
3584
|
-
const { runtimeScanAction } = await import("./runtime-scan-
|
|
3584
|
+
const { runtimeScanAction } = await import("./runtime-scan-DA2v7tXp.js");
|
|
3585
3585
|
return runtimeScanAction(url, options);
|
|
3586
3586
|
});
|
|
3587
3587
|
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) => {
|
|
3588
|
-
const { whyAction } = await import("./why-
|
|
3588
|
+
const { whyAction } = await import("./why-BJLqu_nm.js");
|
|
3589
3589
|
return whyAction(location, options);
|
|
3590
3590
|
});
|
|
3591
3591
|
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) => {
|
|
3592
|
-
const { installAction } = await import("./install-
|
|
3592
|
+
const { installAction } = await import("./install-DIHCDDtX.js");
|
|
3593
3593
|
return installAction(options, command);
|
|
3594
3594
|
});
|
|
3595
3595
|
const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
|
|
3596
3596
|
const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
|
|
3597
3597
|
const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
|
|
3598
3598
|
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) => {
|
|
3599
|
-
const { ciInstallAction } = await import("./ci-
|
|
3599
|
+
const { ciInstallAction } = await import("./ci-Rhhvl7uT.js");
|
|
3600
3600
|
return ciInstallAction(command.optsWithGlobals());
|
|
3601
3601
|
});
|
|
3602
3602
|
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, contextual, 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) => {
|
|
3603
|
-
const { ciConfigAction } = await import("./ci-
|
|
3603
|
+
const { ciConfigAction } = await import("./ci-Rhhvl7uT.js");
|
|
3604
3604
|
return ciConfigAction(command.optsWithGlobals());
|
|
3605
3605
|
});
|
|
3606
3606
|
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) => {
|
|
3607
|
-
const { ciUpgradeAction } = await import("./ci-
|
|
3607
|
+
const { ciUpgradeAction } = await import("./ci-Rhhvl7uT.js");
|
|
3608
3608
|
return ciUpgradeAction(command.optsWithGlobals());
|
|
3609
3609
|
});
|
|
3610
3610
|
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 () => {
|
|
3611
|
-
const { versionAction } = await import("./version-
|
|
3611
|
+
const { versionAction } = await import("./version-osih6Dt3.js");
|
|
3612
3612
|
return versionAction();
|
|
3613
3613
|
});
|
|
3614
3614
|
const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
|
|
3615
3615
|
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) => {
|
|
3616
|
-
const { rulesListAction } = await import("./rules-
|
|
3616
|
+
const { rulesListAction } = await import("./rules-BesJjxty.js");
|
|
3617
3617
|
return rulesListAction(command.optsWithGlobals());
|
|
3618
3618
|
});
|
|
3619
3619
|
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) => {
|
|
3620
|
-
const { rulesExplainAction } = await import("./rules-
|
|
3620
|
+
const { rulesExplainAction } = await import("./rules-BesJjxty.js");
|
|
3621
3621
|
return rulesExplainAction(rule, command.optsWithGlobals());
|
|
3622
3622
|
});
|
|
3623
3623
|
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) => {
|
|
3624
|
-
const { rulesSetAction } = await import("./rules-
|
|
3624
|
+
const { rulesSetAction } = await import("./rules-BesJjxty.js");
|
|
3625
3625
|
return rulesSetAction(rule, severity, command.optsWithGlobals());
|
|
3626
3626
|
});
|
|
3627
3627
|
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) => {
|
|
3628
|
-
const { rulesEnableAction } = await import("./rules-
|
|
3628
|
+
const { rulesEnableAction } = await import("./rules-BesJjxty.js");
|
|
3629
3629
|
return rulesEnableAction(rule, command.optsWithGlobals());
|
|
3630
3630
|
});
|
|
3631
3631
|
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) => {
|
|
3632
|
-
const { rulesDisableAction } = await import("./rules-
|
|
3632
|
+
const { rulesDisableAction } = await import("./rules-BesJjxty.js");
|
|
3633
3633
|
return rulesDisableAction(rule, command.optsWithGlobals());
|
|
3634
3634
|
});
|
|
3635
3635
|
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) => {
|
|
3636
|
-
const { rulesCategoryAction } = await import("./rules-
|
|
3636
|
+
const { rulesCategoryAction } = await import("./rules-BesJjxty.js");
|
|
3637
3637
|
return rulesCategoryAction(category, severity, command.optsWithGlobals());
|
|
3638
3638
|
});
|
|
3639
3639
|
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) => {
|
|
3640
|
-
const { rulesIgnoreTagAction } = await import("./rules-
|
|
3640
|
+
const { rulesIgnoreTagAction } = await import("./rules-BesJjxty.js");
|
|
3641
3641
|
return rulesIgnoreTagAction(tag, command.optsWithGlobals());
|
|
3642
3642
|
});
|
|
3643
3643
|
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) => {
|
|
3644
|
-
const { rulesUnignoreTagAction } = await import("./rules-
|
|
3644
|
+
const { rulesUnignoreTagAction } = await import("./rules-BesJjxty.js");
|
|
3645
3645
|
return rulesUnignoreTagAction(tag, command.optsWithGlobals());
|
|
3646
3646
|
});
|
|
3647
3647
|
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("--warning-exit-code <code>", "exit code for non-blocking warnings (2-255). Ignored with --blocking none or --score", parseWarningExitCode).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) => {
|
|
3648
|
-
const { runScanCommand } = await import("./scan-
|
|
3648
|
+
const { runScanCommand } = await import("./scan-BTjqJfRl.js");
|
|
3649
3649
|
return runScanCommand({
|
|
3650
3650
|
directory,
|
|
3651
3651
|
flags: command.optsWithGlobals(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="b9794235-ae57-5caa-8676-4201ee5b53bb")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-CrcIovH2.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-C5BQaJUn.js.map
|
|
14
|
+
//# debugId=b9794235-ae57-5caa-8676-4201ee5b53bb
|
|
@@ -1,9 +1,9 @@
|
|
|
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, r as flushSentry } 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]="3288747d-2908-5a95-995c-f5d7dedf3554")}catch(e){}}();
|
|
3
|
+
import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-3hs8M2Pf.js";
|
|
4
|
+
import { n as shutdownTelemetry, r as flushSentry } from "./telemetry-runtime-JrDTvdnm.js";
|
|
5
5
|
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-CCTgal0O.js";
|
|
6
|
-
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-
|
|
6
|
+
import { n as buildFooterLinkLines, t as buildSectionDivider } from "./build-section-divider-BjoMRSay.js";
|
|
7
7
|
//#region src/cli/utils/active-tui-renderer.ts
|
|
8
8
|
let activeTuiRenderer = null;
|
|
9
9
|
const registerActiveTuiRenderer = (renderer) => {
|
|
@@ -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-BxFRFqPQ.js.map
|
|
54
|
+
//# debugId=3288747d-2908-5a95-995c-f5d7dedf3554
|
|
@@ -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]="
|
|
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]="962f8d2f-efb5-57f7-b7a8-9a7757c5698e")}catch(e){}}();
|
|
3
3
|
import { ct as CANONICAL_DISCORD_URL, lt as CANONICAL_GITHUB_URL, u as METRIC } from "./constants-lt2tTZjE.js";
|
|
4
|
-
import {
|
|
5
|
-
import { c as isNpmCacheCorruptionError, l as formatEnvironmentError, s as formatNpmCacheCorruptionError, u as isEnvironmentError } from "./telemetry-runtime-
|
|
4
|
+
import { En as runSync, It as isReactDoctorError, Nt as highlighter, Wn as isErrnoException, _ as VERSION, _n as gen, bt as formatErrorChain, ln as error, t as recordCount, xt as formatReactDoctorError } from "./record-metric-3hs8M2Pf.js";
|
|
5
|
+
import { c as isNpmCacheCorruptionError, l as formatEnvironmentError, s as formatNpmCacheCorruptionError, u as isEnvironmentError } from "./telemetry-runtime-JrDTvdnm.js";
|
|
6
6
|
//#region src/cli/utils/handle-error.ts
|
|
7
7
|
const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
|
|
8
8
|
const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
|
|
@@ -111,5 +111,5 @@ const handleUserError = (error$1, options = {}) => {
|
|
|
111
111
|
//#endregion
|
|
112
112
|
export { handleUserError as n, handleError as t };
|
|
113
113
|
|
|
114
|
-
//# sourceMappingURL=handle-error-
|
|
115
|
-
//# debugId=
|
|
114
|
+
//# sourceMappingURL=handle-error-BnEcoXcw.js.map
|
|
115
|
+
//# debugId=962f8d2f-efb5-57f7-b7a8-9a7757c5698e
|
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]="
|
|
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]="4aa6d167-b90d-5f92-a4a9-bdc74620b171")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as fs$1$2 from "node:fs";
|
|
@@ -19,7 +19,7 @@ import * as net from "node:net";
|
|
|
19
19
|
import { parseSync } from "oxc-parser";
|
|
20
20
|
import * as fs$1$1 from "node:fs/promises";
|
|
21
21
|
import { ResolverFactory } from "oxc-resolver";
|
|
22
|
-
import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_BRIDGE_RULES, REACT_COMPILER_RULES, REACT_DOCTOR_OPT_IN_PROJECT_RULE_IDS, REACT_DOCTOR_PROJECT_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, atomicWriteFile, classifySecurityScanFile, collectCrossFileDependencyProbes, getDiagnosticContextPath, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
|
|
22
|
+
import { ALL_REACT_DOCTOR_RULE_KEYS, CROSS_FILE_DEPENDENCY_COLLECTORS, CROSS_FILE_RULE_IDS, EXTERNAL_RULES, FRAMEWORK_SPECIFIC_RULE_KEYS, FRAMEWORK_TOKENS, MOTION_LIBRARY_PACKAGES, REACT_COMPILER_BRIDGE_RULES, REACT_COMPILER_RULES, REACT_DOCTOR_OPT_IN_PROJECT_RULE_IDS, REACT_DOCTOR_PROJECT_RULES, REACT_DOCTOR_RULES, REACT_DOCTOR_RULE_REGISTRY, REACT_DOCTOR_SCAN_RULES, atomicWriteFile, classifySecurityScanFile, collectCrossFileDependencyProbes, getDiagnosticContextPath, resetManifestCaches, shouldReadSecurityScanContent } from "oxlint-plugin-react-doctor/core";
|
|
23
23
|
import { parseJSON5, parseJSONC } from "confbox";
|
|
24
24
|
import { createJiti } from "jiti";
|
|
25
25
|
import { PassThrough } from "node:stream";
|
|
@@ -68986,11 +68986,22 @@ for (const [legacyRuleKey, nativeRuleKey] of Object.entries(LEGACY_RULE_KEY_TO_N
|
|
|
68986
68986
|
NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.set(nativeRuleKey, aliases);
|
|
68987
68987
|
}
|
|
68988
68988
|
const getLegacyRuleKeysForNative = (ruleKey) => NATIVE_RULE_KEY_TO_LEGACY_RULE_KEYS.get(ruleKey) ?? [];
|
|
68989
|
+
const REACT_DOCTOR_RULE_KEY_PREFIX = "react-doctor/";
|
|
68989
68990
|
const canonicalizeRuleKey = (ruleKey) => {
|
|
68990
68991
|
const nativeRuleKey = LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY[ruleKey];
|
|
68991
68992
|
return typeof nativeRuleKey === "string" ? nativeRuleKey : ruleKey;
|
|
68992
68993
|
};
|
|
68993
68994
|
const isReactDoctorShortIdOf = (bareRuleKey, qualifiedRuleKey) => !bareRuleKey.includes("/") && qualifiedRuleKey === `react-doctor/${bareRuleKey}`;
|
|
68995
|
+
/**
|
|
68996
|
+
* Canonicalizes a rule key as users write it in config: a legacy alias
|
|
68997
|
+
* (`react/jsx-key`) maps to its native key, and a bare short id (`no-eval`)
|
|
68998
|
+
* qualifies as `react-doctor/<id>` — mirroring `isSameRuleKey`'s matching —
|
|
68999
|
+
* so telemetry groups every spelling of one rule under one key.
|
|
69000
|
+
*/
|
|
69001
|
+
const canonicalizeUserRuleKey = (ruleKey) => {
|
|
69002
|
+
const nativeRuleKey = canonicalizeRuleKey(ruleKey);
|
|
69003
|
+
return nativeRuleKey.includes("/") ? nativeRuleKey : `${REACT_DOCTOR_RULE_KEY_PREFIX}${nativeRuleKey}`;
|
|
69004
|
+
};
|
|
68994
69005
|
const isSameRuleKey = (candidateRuleKey, targetRuleKey) => {
|
|
68995
69006
|
const canonicalCandidate = canonicalizeRuleKey(candidateRuleKey);
|
|
68996
69007
|
const canonicalTarget = canonicalizeRuleKey(targetRuleKey);
|
|
@@ -70321,6 +70332,13 @@ const DEFAULT_SURFACE_EXCLUDED_TAGS = {
|
|
|
70321
70332
|
ciFailure: ["design"]
|
|
70322
70333
|
};
|
|
70323
70334
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
70335
|
+
const KNOWN_RULE_KEYS = new Set([...ALL_REACT_DOCTOR_RULE_KEYS, ...EXTERNAL_RULES.map((rule) => rule.key)]);
|
|
70336
|
+
const BUNDLED_RULE_NAMESPACES = new Set([...KNOWN_RULE_KEYS].flatMap(getEquivalentRuleKeys).map((key) => key.slice(0, key.lastIndexOf("/"))));
|
|
70337
|
+
const getUnknownBundledRuleKeys = (rules) => Object.keys(rules ?? {}).filter((key) => {
|
|
70338
|
+
const canonicalKey = canonicalizeUserRuleKey(key);
|
|
70339
|
+
const namespace = canonicalKey.slice(0, canonicalKey.lastIndexOf("/"));
|
|
70340
|
+
return BUNDLED_RULE_NAMESPACES.has(namespace) && !KNOWN_RULE_KEYS.has(canonicalKey);
|
|
70341
|
+
});
|
|
70324
70342
|
const VALID_RULE_SEVERITIES = [
|
|
70325
70343
|
"error",
|
|
70326
70344
|
"warn",
|
|
@@ -70505,6 +70523,7 @@ const validateConfigTypes = (config) => {
|
|
|
70505
70523
|
applyFieldValidator(config, validated, "surfaces", validateSurfacesField);
|
|
70506
70524
|
for (const fieldName of SEVERITY_FIELD_NAMES) applyFieldValidator(config, validated, fieldName, (value) => validateSeverityMap(fieldName, value, fieldName === "categories"));
|
|
70507
70525
|
applyFieldValidator(config, validated, "plugins", (value) => validateStringArrayField("plugins", value));
|
|
70526
|
+
for (const ruleKey of getUnknownBundledRuleKeys(validated.rules)) warnConfigIssue(`config field "rules.${ruleKey}" is not a known bundled rule; this override has no effect. Run "react-doctor rules list" to find its rule ID.`);
|
|
70508
70527
|
return validated;
|
|
70509
70528
|
};
|
|
70510
70529
|
const warn = (message) => {
|
|
@@ -72657,15 +72676,23 @@ const createSecurityScanSession = (rootDirectory, options) => {
|
|
|
72657
72676
|
const rule = entry.rule;
|
|
72658
72677
|
const scan = rule.scan;
|
|
72659
72678
|
if (typeof scan !== "function") return [];
|
|
72679
|
+
const explicitRuleOverride = resolveRuleSeverityOverride({ ruleKey: entry.key }, options.severityControls);
|
|
72680
|
+
const severityOverride = explicitRuleOverride ?? resolveRuleSeverityOverride({
|
|
72681
|
+
ruleKey: entry.key,
|
|
72682
|
+
category: "Security"
|
|
72683
|
+
}, options.severityControls);
|
|
72684
|
+
if (severityOverride === "off") return [];
|
|
72660
72685
|
if (!shouldEnableRuleByDefaultStatus({
|
|
72661
72686
|
defaultEnabled: rule.defaultEnabled,
|
|
72662
72687
|
includeTagDefaults: options.includeTagDefaults === true,
|
|
72663
|
-
hasIncludedTags: includedTags.size > 0
|
|
72688
|
+
hasIncludedTags: includedTags.size > 0,
|
|
72689
|
+
hasExplicitOverride: explicitRuleOverride !== void 0
|
|
72664
72690
|
})) return [];
|
|
72665
72691
|
if (!shouldEnableRule(rule.requires, rule.tags, capabilities, ignoredTags, rule.disabledWhen, includedTags)) return [];
|
|
72666
72692
|
return [{
|
|
72667
72693
|
entry,
|
|
72668
72694
|
scan,
|
|
72695
|
+
severityOverride,
|
|
72669
72696
|
committedFilesOnly: rule.committedFilesOnly === true
|
|
72670
72697
|
}];
|
|
72671
72698
|
});
|
|
@@ -72683,10 +72710,13 @@ const createSecurityScanSession = (rootDirectory, options) => {
|
|
|
72683
72710
|
};
|
|
72684
72711
|
const scanFileByRule = function* (file) {
|
|
72685
72712
|
if (file === null) return;
|
|
72686
|
-
for (const { entry, scan, committedFilesOnly } of enabledScanRules) {
|
|
72713
|
+
for (const { entry, scan, severityOverride, committedFilesOnly } of enabledScanRules) {
|
|
72687
72714
|
for (const finding of scan(file)) {
|
|
72688
72715
|
if (committedFilesOnly && isFileGitIgnored(file)) continue;
|
|
72689
|
-
const diagnostic = buildSecurityScanDiagnostic(finding
|
|
72716
|
+
const diagnostic = buildSecurityScanDiagnostic(severityOverride === void 0 ? finding : {
|
|
72717
|
+
...finding,
|
|
72718
|
+
severity: severityOverride
|
|
72719
|
+
}, entry, file.relativePath);
|
|
72690
72720
|
const key = `${diagnostic.rule}:${diagnostic.filePath}:${diagnostic.line}:${diagnostic.column}:${diagnostic.message}`;
|
|
72691
72721
|
if (seen.has(key)) continue;
|
|
72692
72722
|
seen.add(key);
|
|
@@ -74462,7 +74492,7 @@ const normalizeConfigForHash = (config) => {
|
|
|
74462
74492
|
if (Array.isArray(clone?.jsPlugins)) clone.jsPlugins = clone.jsPlugins.map((_, index) => `<plugin:${index}>`);
|
|
74463
74493
|
return clone;
|
|
74464
74494
|
};
|
|
74465
|
-
const computeRulesetHash = (input) => crypto.createHash("sha1").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").update("\0").update(input.respectInlineDisables ? "respect-inline-disables" : "audit-mode").digest("hex");
|
|
74495
|
+
const computeRulesetHash = (input) => crypto.createHash("sha1").update("project-bulk-suppressions-isolated\0").update(JSON.stringify(normalizeConfigForHash(input.config))).update("\0").update([...input.toolchainVersions].join("\0")).update("\0").update([...input.ignorePatterns].join("\n")).update("\0").update(input.tsconfigContent ?? "").update("\0").update(input.respectInlineDisables ? "respect-inline-disables" : "audit-mode").digest("hex");
|
|
74466
74496
|
/**
|
|
74467
74497
|
* Loads a plugin module via the local require resolver and extracts
|
|
74468
74498
|
* `(name, ruleNames)` from either `module.exports.meta + rules` or
|
|
@@ -76613,33 +76643,58 @@ const spawnLintBatches = async (input) => {
|
|
|
76613
76643
|
}
|
|
76614
76644
|
const batchArgs = [...baseArgs, ...batch];
|
|
76615
76645
|
try {
|
|
76616
|
-
const spawnBatch = () => {
|
|
76646
|
+
const spawnBatch = async () => {
|
|
76617
76647
|
const effectiveSpawnTimeoutMs = resolveSpawnTimeoutMs();
|
|
76618
76648
|
if (effectiveSpawnTimeoutMs === 0) {
|
|
76619
76649
|
deadlineSkippedFiles.push(...batch);
|
|
76620
76650
|
batchState.deadlineSkippedFileCount += batch.length;
|
|
76621
|
-
return
|
|
76651
|
+
return null;
|
|
76652
|
+
}
|
|
76653
|
+
const onStart = () => {
|
|
76654
|
+
if (batchState.didStart) return;
|
|
76655
|
+
batchState.didStart = true;
|
|
76656
|
+
startedFileCount += batchState.initialFileCount;
|
|
76657
|
+
reportBatchStarted(passBatches.length);
|
|
76658
|
+
};
|
|
76659
|
+
let argumentsList = batchArgs;
|
|
76660
|
+
if (input.workingDirectory !== void 0) {
|
|
76661
|
+
const selectedFiles = (await spawnOxlint([
|
|
76662
|
+
...baseArgs,
|
|
76663
|
+
"--debug",
|
|
76664
|
+
"files",
|
|
76665
|
+
...batch
|
|
76666
|
+
], rootDirectory, nodeBinaryPath, effectiveSpawnTimeoutMs, outputMaxBytes, signal, onStart)).split(/\r?\n/).filter(Boolean).map((filePath) => path$1$1.resolve(rootDirectory, filePath));
|
|
76667
|
+
if (selectedFiles.length === 0) return JSON.stringify({ diagnostics: [] });
|
|
76668
|
+
argumentsList = [
|
|
76669
|
+
...baseArgs,
|
|
76670
|
+
"--no-ignore",
|
|
76671
|
+
...selectedFiles
|
|
76672
|
+
];
|
|
76622
76673
|
}
|
|
76623
76674
|
return runOxlintJob({
|
|
76624
|
-
argumentsList
|
|
76625
|
-
rootDirectory,
|
|
76675
|
+
argumentsList,
|
|
76676
|
+
rootDirectory: input.workingDirectory ?? rootDirectory,
|
|
76626
76677
|
nodeBinaryPath,
|
|
76627
76678
|
spawnTimeoutMs: effectiveSpawnTimeoutMs ?? 6e4,
|
|
76628
76679
|
outputMaxBytes: outputMaxBytes ?? 52428800,
|
|
76629
76680
|
maxWorkers: requestedConcurrency,
|
|
76630
76681
|
filesystemCacheEpoch: input.spawnSlots?.filesystemCacheEpoch ?? null,
|
|
76631
76682
|
abortSignal: signal,
|
|
76632
|
-
onStart
|
|
76633
|
-
if (batchState.didStart) return;
|
|
76634
|
-
batchState.didStart = true;
|
|
76635
|
-
startedFileCount += batchState.initialFileCount;
|
|
76636
|
-
reportBatchStarted(passBatches.length);
|
|
76637
|
-
}
|
|
76683
|
+
onStart
|
|
76638
76684
|
});
|
|
76639
76685
|
};
|
|
76640
76686
|
const stdout = input.spawnSlots === void 0 ? await spawnBatch() : await input.spawnSlots.run(spawnBatch, signal);
|
|
76641
76687
|
if (stdout === null) return [];
|
|
76642
|
-
|
|
76688
|
+
const diagnostics = parseOxlintOutput(stdout, project, rootDirectory, sourcePathByLintPath, sourceMapByLintPath, input.diagnosticContextDirectory);
|
|
76689
|
+
if (input.workingDirectory === void 0) return diagnostics;
|
|
76690
|
+
return diagnostics.map((diagnostic) => ({
|
|
76691
|
+
...diagnostic,
|
|
76692
|
+
filePath: toNormalizedRelativePath(diagnostic.filePath, rootDirectory),
|
|
76693
|
+
...diagnostic.relatedLocations ? { relatedLocations: diagnostic.relatedLocations.map((location) => ({
|
|
76694
|
+
...location,
|
|
76695
|
+
filePath: toNormalizedRelativePath(location.filePath, rootDirectory)
|
|
76696
|
+
})) } : {}
|
|
76697
|
+
}));
|
|
76643
76698
|
} catch (error) {
|
|
76644
76699
|
if (!isSplittableReactDoctorError(error)) throw error;
|
|
76645
76700
|
if (isPastDeadline()) {
|
|
@@ -77367,6 +77422,7 @@ const runOxlint = async (options) => {
|
|
|
77367
77422
|
const restoreDisableDirectives = await neutralizeDisableDirectives(rootDirectory, includePaths ?? options.precomputedSourceFiles?.map((sourceFile) => sourceFile.path), { recoverOnly: respectInlineDisables });
|
|
77368
77423
|
const configDirectory = fs$1$2.mkdtempSync(path$1$1.join(os.tmpdir(), "react-doctor-oxlintrc-"));
|
|
77369
77424
|
const configPath = path$1$1.join(configDirectory, "oxlintrc.json");
|
|
77425
|
+
const workingDirectory = fs$1$2.existsSync(path$1$1.join(rootDirectory, "oxlint-suppressions.json")) ? configDirectory : void 0;
|
|
77370
77426
|
try {
|
|
77371
77427
|
const diagnosticContextDirectory = path$1$1.join(configDirectory, "contexts");
|
|
77372
77428
|
fs$1$2.mkdirSync(diagnosticContextDirectory);
|
|
@@ -77376,7 +77432,7 @@ const runOxlint = async (options) => {
|
|
|
77376
77432
|
if (project.hasTypeScript) {
|
|
77377
77433
|
const tsconfigRelativePath = resolveTsConfigRelativePath(rootDirectory);
|
|
77378
77434
|
if (tsconfigRelativePath) {
|
|
77379
|
-
sharedArgs.push("--tsconfig", tsconfigRelativePath);
|
|
77435
|
+
sharedArgs.push("--tsconfig", path$1$1.resolve(rootDirectory, tsconfigRelativePath));
|
|
77380
77436
|
try {
|
|
77381
77437
|
tsconfigContent = fs$1$2.readFileSync(path$1$1.resolve(rootDirectory, tsconfigRelativePath), "utf8");
|
|
77382
77438
|
} catch {
|
|
@@ -77465,6 +77521,7 @@ const runOxlint = async (options) => {
|
|
|
77465
77521
|
return spawnLintBatches({
|
|
77466
77522
|
baseArgs: passBaseArgs,
|
|
77467
77523
|
fileBatches: passFileBatches,
|
|
77524
|
+
workingDirectory,
|
|
77468
77525
|
rootDirectory,
|
|
77469
77526
|
nodeBinaryPath,
|
|
77470
77527
|
project: lintProject,
|
|
@@ -77693,6 +77750,7 @@ const runOxlint = async (options) => {
|
|
|
77693
77750
|
const runBatches = () => spawnLintBatches({
|
|
77694
77751
|
baseArgs,
|
|
77695
77752
|
fileBatches,
|
|
77753
|
+
workingDirectory,
|
|
77696
77754
|
rootDirectory,
|
|
77697
77755
|
nodeBinaryPath,
|
|
77698
77756
|
project: lintProject,
|
|
@@ -78684,7 +78742,8 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
78684
78742
|
return filteredDiagnostic === null ? none() : some(filteredDiagnostic);
|
|
78685
78743
|
})));
|
|
78686
78744
|
const applyPerElementPipeline = (rawStream) => filterPerElementPipeline(rawStream).pipe(tap((diagnostic) => reporterService.emit(diagnostic)));
|
|
78687
|
-
const
|
|
78745
|
+
const severityControls = buildRuleSeverityControls(resolvedConfig.config);
|
|
78746
|
+
const pnpmHardeningSeverity = resolveRuleSeverityOverride({ ruleKey: "react-doctor/require-pnpm-hardening" }, severityControls);
|
|
78688
78747
|
const envCollected = yield* runCollect(applyPerElementPipeline(fromIterable$1(isDiffMode ? [] : [
|
|
78689
78748
|
...checkReducedMotion(scanDirectory),
|
|
78690
78749
|
...pnpmHardeningSeverity === "warn" || pnpmHardeningSeverity === "error" ? checkPnpmHardening(scanDirectory) : [],
|
|
@@ -78696,6 +78755,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
78696
78755
|
let didSecurityScanReachDeadline = false;
|
|
78697
78756
|
const securityScanFiber = yield* forkChild(runCollect(applyPerElementPipeline(isDiffMode ? empty$4 : unwrap(tryPromise((signal) => checkSecurityScanCooperative(scanDirectory, {
|
|
78698
78757
|
project,
|
|
78758
|
+
severityControls,
|
|
78699
78759
|
ignoredTags: input.ignoredTags,
|
|
78700
78760
|
includedTags: input.includedTags,
|
|
78701
78761
|
includeTagDefaults: input.includeTagDefaults,
|
|
@@ -78743,7 +78803,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
78743
78803
|
const maintainabilityPhaseTimeoutMs = yield* DeadCodePhaseTimeoutMs;
|
|
78744
78804
|
const workerCountSuffix = scanConcurrency > 1 ? ` ${highlighter.dim(`[~${scanConcurrency} workers]`)}` : "";
|
|
78745
78805
|
const projectCapabilities = getCapabilities(project);
|
|
78746
|
-
const projectRuleSelections = resolveProjectRuleSelections(
|
|
78806
|
+
const projectRuleSelections = resolveProjectRuleSelections(severityControls).filter((selection) => {
|
|
78747
78807
|
const rule = REACT_DOCTOR_RULE_REGISTRY[selection.ruleId];
|
|
78748
78808
|
return rule !== void 0 && shouldEnableRule(rule.requires, rule.tags, projectCapabilities, input.ignoredTags, rule.disabledWhen, input.includedTags) && (selection.ruleId === "duplicate-jsx-subtree" ? input.runDeadCode : !isDiffMode) && (showWarnings || projectRuleSelectionsMaySurfaceWhenWarningsAreHidden([selection]));
|
|
78749
78809
|
});
|
|
@@ -79750,4 +79810,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
79750
79810
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
79751
79811
|
|
|
79752
79812
|
//# sourceMappingURL=index.js.map
|
|
79753
|
-
//# debugId=
|
|
79813
|
+
//# debugId=4aa6d167-b90d-5f92-a4a9-bdc74620b171
|
|
@@ -1,19 +1,19 @@
|
|
|
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]="f7c9458d-4918-5385-9893-6989b3e68e1f")}catch(e){}}();
|
|
3
3
|
import { N as discardPrefetchedGitCommands, T as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, lt as CANONICAL_GITHUB_URL, u as METRIC, w as STAGED_FILES_TEMP_DIR_PREFIX, xn as STAGED_FILES_PROJECT_CONFIG_FILENAMES } from "./constants-lt2tTZjE.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as shutdownTelemetry, o as isExpectedUserError, r as flushSentry } from "./telemetry-runtime-
|
|
6
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
7
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
4
|
+
import { Ct as getChangedLineRanges, D as isCodingAgentEnvironment, E as isCiOrCodingAgentEnvironment, Ht as listWorkspacePackages, Jt as remainingDeadlineBudgetMs, K as StagedFiles, Kn as isPlainObject, Mn as provide, Nt as highlighter, S as isDebugFlagEnabled, Sn as provide$1, St as getBaselineDiffPlan, Tn as runPromise, Tt as getDiffInfo, Vn as messageFromUnknown, Wn as isErrnoException, Wt as mapWithConcurrency, Z as buildJsonReport, Zt as resolveScanTarget, _ as VERSION, _n as gen, f as setJsonReportDirectory, ft as detectAiTrainingEnvironment, g as writeJsonReport, h as writeJsonErrorReport, hn as decodeUnknownSync, in as toRelativePath, j as Git, jt as hasSupportedFrameworkOrLibrary, mn as JsonReport, n as recordDistribution, p as setJsonReportMode, pt as discoverSupportedSubprojects, t as recordCount, u as enableJsonMode, vt as findLegacyConfig, y as CliInputError } from "./record-metric-3hs8M2Pf.js";
|
|
5
|
+
import { n as shutdownTelemetry, o as isExpectedUserError, r as flushSentry } from "./telemetry-runtime-JrDTvdnm.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BnEcoXcw.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-CtR7ISJa.js";
|
|
8
8
|
import { t as toForwardSlashes } from "./path-format-By20mo8A.js";
|
|
9
|
-
import { N as cliLogger, c as spinner, i as hasDoctorScript, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-
|
|
10
|
-
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-
|
|
11
|
-
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-
|
|
12
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
13
|
-
import { A as createInvocationInspect, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, M as resolveMergeBaseRef, N as printHeadlessReport, O as collectProjectSourceFiles, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, W as resolveInvocationOxlintConcurrency, _ as retryMissingProjectScores, a as validateModeFlags, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, g as resolveProjectRelativeDirectory, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, j as inspect, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, s as projectManifestChanged, t as resolveScanExitCode, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions } from "./resolve-scan-exit-code
|
|
14
|
-
import { a as recordGate, g as loadAgentInstall, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-
|
|
15
|
-
import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithOutdatedReactDoctorHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-
|
|
16
|
-
import { t as readObjectFile } from "./read-object-file-
|
|
9
|
+
import { N as cliLogger, c as spinner, i as hasDoctorScript, j as runGitRaw, k as runGit, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-CcM2cToW.js";
|
|
10
|
+
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-BUaLt5mn.js";
|
|
11
|
+
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-Cq7AJdtO.js";
|
|
12
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-DjIiPcs_.js";
|
|
13
|
+
import { A as createInvocationInspect, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, M as resolveMergeBaseRef, N as printHeadlessReport, O as collectProjectSourceFiles, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, W as resolveInvocationOxlintConcurrency, _ as retryMissingProjectScores, a as validateModeFlags, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, g as resolveProjectRelativeDirectory, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, j as inspect, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, s as projectManifestChanged, t as resolveScanExitCode, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions } from "./resolve-scan-exit-code-DrC3xu0y.js";
|
|
14
|
+
import { a as recordGate, g as loadAgentInstall, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-C68s63w1.js";
|
|
15
|
+
import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithOutdatedReactDoctorHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-BnaGEio4.js";
|
|
16
|
+
import { t as readObjectFile } from "./read-object-file-sQUp7PMm.js";
|
|
17
17
|
import * as fs$1 from "node:fs";
|
|
18
18
|
import fs from "node:fs";
|
|
19
19
|
import * as path$1 from "node:path";
|
|
@@ -1528,5 +1528,5 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect", se
|
|
|
1528
1528
|
//#endregion
|
|
1529
1529
|
export { warnDeprecatedFailOn as n, runProjectMigrations as r, inspectAction as t };
|
|
1530
1530
|
|
|
1531
|
-
//# sourceMappingURL=inspect-
|
|
1532
|
-
//# debugId=
|
|
1531
|
+
//# sourceMappingURL=inspect-CrcIovH2.js.map
|
|
1532
|
+
//# debugId=f7c9458d-4918-5385-9893-6989b3e68e1f
|
|
@@ -1,12 +1,12 @@
|
|
|
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]="87319ef2-462e-5d00-b704-482958894e8a")}catch(e){}}();
|
|
3
3
|
import { u as METRIC } from "./constants-lt2tTZjE.js";
|
|
4
|
-
import {
|
|
5
|
-
import { o 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 { t as printBrandedHeader } from "./print-branded-header-
|
|
9
|
-
import { n as runInstallReactDoctor } from "./install-react-doctor-
|
|
4
|
+
import { En as runSync, t as recordCount } from "./record-metric-3hs8M2Pf.js";
|
|
5
|
+
import { o as isExpectedUserError } from "./telemetry-runtime-JrDTvdnm.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BnEcoXcw.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-CtR7ISJa.js";
|
|
8
|
+
import { t as printBrandedHeader } from "./print-branded-header-COh3X3He.js";
|
|
9
|
+
import { n as runInstallReactDoctor } from "./install-react-doctor-BnaGEio4.js";
|
|
10
10
|
//#region src/cli/commands/install.ts
|
|
11
11
|
const installAction = async (options, command) => {
|
|
12
12
|
recordCount(METRIC.cliInvoked, 1, { command: "install" });
|
|
@@ -30,5 +30,5 @@ const installAction = async (options, command) => {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
export { installAction };
|
|
32
32
|
|
|
33
|
-
//# sourceMappingURL=install-
|
|
34
|
-
//# debugId=
|
|
33
|
+
//# sourceMappingURL=install-DIHCDDtX.js.map
|
|
34
|
+
//# debugId=87319ef2-462e-5d00-b704-482958894e8a
|