react-doctor 0.9.12-dev.8c2f03a → 0.9.12-dev.ffc2d14
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-DuozMmwU.js → build-section-divider-BuOtLrzK.js} +7 -7
- package/dist/{ci-Bwd2LJZC.js → ci-DVVsf25h.js} +11 -11
- package/dist/cli.js +25 -25
- package/dist/{design-Q4Umr_4T.js → design-Y1pcA2uj.js} +4 -4
- package/dist/{exit-gracefully-vUI1H1zC.js → exit-gracefully-DnXGONjj.js} +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +61 -43
- package/dist/{inspect-RxIsB8bi.js → inspect-g3_lzs3l.js} +20 -19
- package/dist/{install-CI0nvC_v.js → install-02Lq6wKC.js} +8 -8
- package/dist/{install-doctor-script-BAmTZygh.js → install-doctor-script-DmEWQpVJ.js} +4 -4
- package/dist/{install-github-workflow-Dg2sosDx.js → install-github-workflow-Dx6Pl9Wl.js} +6 -6
- package/dist/{install-react-doctor-CIJcnTik.js → install-react-doctor-CMCXgenA.js} +47 -45
- package/dist/{print-branded-header-kwnSGrfR.js → print-branded-header-kbvWYuGv.js} +4 -4
- package/dist/{read-object-file-m5uVvcBp.js → read-object-file-Cwhr9OIi.js} +4 -4
- package/dist/{record-metric-DospZkfP.js → record-metric-CFfsgcVs.js} +99 -73
- package/dist/{report-error-CAp5cil9.js → report-error-MGKyeIns.js} +5 -5
- package/dist/{report-workflow-result-D0GvvJtT.js → report-workflow-result-DGg9xopH.js} +5 -5
- package/dist/{resolve-scope-eXawiGEH.js → resolve-scope-CXS-5jLR.js} +6 -6
- package/dist/{rules-C_xYDSz8.js → rules-CThlosPx.js} +6 -6
- package/dist/{run-scan-app-CeNk17wq.js → run-scan-app-CDDu7P32.js} +15 -10
- package/dist/{scan-DIwsgV6M.js → scan-4I1mvxBO.js} +8 -8
- package/dist/{should-fail-scan-gate-BWTNIU5h.js → should-fail-scan-gate-C0Bo5Gqy.js} +21 -13
- package/dist/{should-skip-prompts-oK3MwWyB.js → should-skip-prompts-BqrtVX4G.js} +4 -4
- package/dist/{unref-stdin-BGZVK4sJ.js → unref-stdin-BxyvqsOy.js} +4 -4
- package/dist/{version-9-2T2YQf.js → version-S-8vvWFi.js} +4 -4
- package/dist/{why-BOiuB_qy.js → why-DXfx0oL9.js} +4 -4
- package/package.json +6 -6
|
@@ -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_GITHUB_URL, Gt as highlighter, M as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, ar as DOCS_URL, dt as anonymizeInPlace, ft as anonymizeText, i as isTelemetryEnabled, mn as scrubSensitivePaths, o as buildSentryScope } from "./record-metric-
|
|
4
|
-
import { c as isExpectedUserError } from "./unref-stdin-
|
|
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]="ff8627c6-5f03-5fe5-a91d-f5e949ae42d5")}catch(e){}}();
|
|
3
|
+
import { $n as CANONICAL_GITHUB_URL, Gt as highlighter, M as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, ar as DOCS_URL, dt as anonymizeInPlace, ft as anonymizeText, i as isTelemetryEnabled, mn as scrubSensitivePaths, o as buildSentryScope } from "./record-metric-CFfsgcVs.js";
|
|
4
|
+
import { c as isExpectedUserError } from "./unref-stdin-BxyvqsOy.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.ffc2d14`;
|
|
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.ffc2d14") ? "development" : "production");
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/instrument.ts
|
|
82
82
|
let isInitialized = false;
|
|
@@ -226,5 +226,5 @@ const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repe
|
|
|
226
226
|
//#endregion
|
|
227
227
|
export { initializeSentry as a, flushSentry as i, buildFooterLinkLines as n, activeScanAbortRegistry as r, buildSectionDivider as t };
|
|
228
228
|
|
|
229
|
-
//# sourceMappingURL=build-section-divider-
|
|
230
|
-
//# debugId=
|
|
229
|
+
//# sourceMappingURL=build-section-divider-BuOtLrzK.js.map
|
|
230
|
+
//# debugId=ff8627c6-5f03-5fe5-a91d-f5e949ae42d5
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="153b668c-5c8c-59f7-80bf-8d1633675ebd")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { Gt as highlighter, Rn as runSync, er as CI_URL, sr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, w as METRIC } from "./record-metric-
|
|
5
|
-
import { c as isExpectedUserError } from "./unref-stdin-
|
|
6
|
-
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-
|
|
7
|
-
import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-
|
|
8
|
-
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-
|
|
9
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-
|
|
10
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
11
|
-
import { t as printBrandedHeader } from "./print-branded-header-
|
|
4
|
+
import { Gt as highlighter, Rn as runSync, er as CI_URL, sr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, w as METRIC } from "./record-metric-CFfsgcVs.js";
|
|
5
|
+
import { c as isExpectedUserError } from "./unref-stdin-BxyvqsOy.js";
|
|
6
|
+
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-MGKyeIns.js";
|
|
7
|
+
import { L as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-DmEWQpVJ.js";
|
|
8
|
+
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-Dx6Pl9Wl.js";
|
|
9
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-CXS-5jLR.js";
|
|
10
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-BqrtVX4G.js";
|
|
11
|
+
import { t as printBrandedHeader } from "./print-branded-header-kbvWYuGv.js";
|
|
12
12
|
import * as path$1 from "node:path";
|
|
13
13
|
import * as fs$1 from "node:fs";
|
|
14
14
|
//#region src/cli/utils/ci/ci-provider.ts
|
|
@@ -7497,5 +7497,5 @@ const ciConfigAction = (options) => runCiCommand("config", runCiConfig, options)
|
|
|
7497
7497
|
//#endregion
|
|
7498
7498
|
export { ciConfigAction, ciInstallAction, ciUpgradeAction };
|
|
7499
7499
|
|
|
7500
|
-
//# sourceMappingURL=ci-
|
|
7501
|
-
//# debugId=
|
|
7500
|
+
//# sourceMappingURL=ci-DVVsf25h.js.map
|
|
7501
|
+
//# debugId=153b668c-5c8c-59f7-80bf-8d1633675ebd
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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]="03462e9a-cc61-5815-b641-9bce568efeb2")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { $n as CANONICAL_GITHUB_URL, Gt as highlighter, R as CliInputError, V as isDebugFlagEnabled, d as isJsonModeActive, er as CI_URL, g as VERSION, hn as setColorEnabled, i as isTelemetryEnabled, m as writeJsonErrorReport } from "./record-metric-
|
|
5
|
-
import { c as isExpectedUserError, r as getLastRunTraceId, s as shutdownTelemetry, t as unrefStdin } from "./unref-stdin-
|
|
6
|
-
import { a as initializeSentry, i as flushSentry } from "./build-section-divider-
|
|
7
|
-
import { t as exitGracefully } from "./exit-gracefully-
|
|
8
|
-
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-
|
|
4
|
+
import { $n as CANONICAL_GITHUB_URL, Gt as highlighter, R as CliInputError, V as isDebugFlagEnabled, d as isJsonModeActive, er as CI_URL, g as VERSION, hn as setColorEnabled, i as isTelemetryEnabled, m as writeJsonErrorReport } from "./record-metric-CFfsgcVs.js";
|
|
5
|
+
import { c as isExpectedUserError, r as getLastRunTraceId, s as shutdownTelemetry, t as unrefStdin } from "./unref-stdin-BxyvqsOy.js";
|
|
6
|
+
import { a as initializeSentry, i as flushSentry } from "./build-section-divider-BuOtLrzK.js";
|
|
7
|
+
import { t as exitGracefully } from "./exit-gracefully-DnXGONjj.js";
|
|
8
|
+
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-MGKyeIns.js";
|
|
9
9
|
import { execFileSync } from "node:child_process";
|
|
10
10
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
|
|
11
11
|
var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -3481,7 +3481,7 @@ ${highlighter.dim("Learn more:")}
|
|
|
3481
3481
|
const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
|
|
3482
3482
|
const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[directory]", "project directory to scan", ".").option("--lint", "enable linting").option("--no-lint", "skip linting").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);
|
|
3483
3483
|
program.action(async (directory = ".", flags) => {
|
|
3484
|
-
const { runScanCommand } = await import("./scan-
|
|
3484
|
+
const { runScanCommand } = await import("./scan-4I1mvxBO.js");
|
|
3485
3485
|
return runScanCommand({
|
|
3486
3486
|
directory,
|
|
3487
3487
|
flags,
|
|
@@ -3489,71 +3489,71 @@ program.action(async (directory = ".", flags) => {
|
|
|
3489
3489
|
});
|
|
3490
3490
|
});
|
|
3491
3491
|
program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
|
|
3492
|
-
const { designAction } = await import("./design-
|
|
3492
|
+
const { designAction } = await import("./design-Y1pcA2uj.js");
|
|
3493
3493
|
return designAction(directory ?? ".", command.optsWithGlobals());
|
|
3494
3494
|
});
|
|
3495
3495
|
program.command("why <location>").description("Explain why a rule fired (or why a suppression didn't apply) at a file:line").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple)").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (location, options) => {
|
|
3496
|
-
const { whyAction } = await import("./why-
|
|
3496
|
+
const { whyAction } = await import("./why-DXfx0oL9.js");
|
|
3497
3497
|
return whyAction(location, options);
|
|
3498
3498
|
});
|
|
3499
|
-
program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install
|
|
3500
|
-
const { installAction } = await import("./install-
|
|
3499
|
+
program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install 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) => {
|
|
3500
|
+
const { installAction } = await import("./install-02Lq6wKC.js");
|
|
3501
3501
|
return installAction(options, command);
|
|
3502
3502
|
});
|
|
3503
3503
|
const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
|
|
3504
3504
|
const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
|
|
3505
3505
|
const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
|
|
3506
3506
|
ci.command("install").description("Add a CI workflow that scans every pull request").option(...providerOption).option(...prOption).option("--blocking <level>", "gate level: none (advisory, default), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed (default), files, lines, full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; use the defaults").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderCiHelpEpilog).action(async (_options, command) => {
|
|
3507
|
-
const { ciInstallAction } = await import("./ci-
|
|
3507
|
+
const { ciInstallAction } = await import("./ci-DVVsf25h.js");
|
|
3508
3508
|
return ciInstallAction(command.optsWithGlobals());
|
|
3509
3509
|
});
|
|
3510
3510
|
ci.command("config").description("Change the gate, scan scope, and pull-request reporting").option(...providerOption).option("--blocking <level>", "gate level: none (advisory), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed, files, lines, or full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; print the current settings").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3511
|
-
const { ciConfigAction } = await import("./ci-
|
|
3511
|
+
const { ciConfigAction } = await import("./ci-DVVsf25h.js");
|
|
3512
3512
|
return ciConfigAction(command.optsWithGlobals());
|
|
3513
3513
|
});
|
|
3514
3514
|
ci.command("upgrade").description("Upgrade the CI workflow to the action's current major").option(...providerOption).option(...prOption).option("-y, --yes", "skip prompts").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3515
|
-
const { ciUpgradeAction } = await import("./ci-
|
|
3515
|
+
const { ciUpgradeAction } = await import("./ci-DVVsf25h.js");
|
|
3516
3516
|
return ciUpgradeAction(command.optsWithGlobals());
|
|
3517
3517
|
});
|
|
3518
3518
|
program.command("version").description("show the version with Node and platform info").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async () => {
|
|
3519
|
-
const { versionAction } = await import("./version-
|
|
3519
|
+
const { versionAction } = await import("./version-S-8vvWFi.js");
|
|
3520
3520
|
return versionAction();
|
|
3521
3521
|
});
|
|
3522
3522
|
const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
|
|
3523
3523
|
rules.command("list").description("List rules and the severity they run at under your config").option("--category <name>", "only show rules in a category (e.g. Performance)").option("--tag <name>", "only show rules with a tag (e.g. design, test-noise)").option("--framework <name>", "only show rules for a framework (e.g. global, nextjs)").option("--configured", "only show rules your config has changed from the default").option("--json", "output a structured JSON array").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (_options, command) => {
|
|
3524
|
-
const { rulesListAction } = await import("./rules-
|
|
3524
|
+
const { rulesListAction } = await import("./rules-CThlosPx.js");
|
|
3525
3525
|
return rulesListAction(command.optsWithGlobals());
|
|
3526
3526
|
});
|
|
3527
3527
|
rules.command("explain <rule>").description("Explain why a rule matters, its current severity, and how to configure it").option("--json", "output a structured JSON object").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3528
|
-
const { rulesExplainAction } = await import("./rules-
|
|
3528
|
+
const { rulesExplainAction } = await import("./rules-CThlosPx.js");
|
|
3529
3529
|
return rulesExplainAction(rule, command.optsWithGlobals());
|
|
3530
3530
|
});
|
|
3531
3531
|
rules.command("set <rule> <severity>").description("Set a rule's severity: off, warn, or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, severity, _options, command) => {
|
|
3532
|
-
const { rulesSetAction } = await import("./rules-
|
|
3532
|
+
const { rulesSetAction } = await import("./rules-CThlosPx.js");
|
|
3533
3533
|
return rulesSetAction(rule, severity, command.optsWithGlobals());
|
|
3534
3534
|
});
|
|
3535
3535
|
rules.command("enable <rule>").description("Enable a rule at its recommended severity (or pass --severity)").option("--severity <level>", "severity to enable at: warn or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3536
|
-
const { rulesEnableAction } = await import("./rules-
|
|
3536
|
+
const { rulesEnableAction } = await import("./rules-CThlosPx.js");
|
|
3537
3537
|
return rulesEnableAction(rule, command.optsWithGlobals());
|
|
3538
3538
|
});
|
|
3539
3539
|
rules.command("disable <rule>").description("Disable a rule so it never runs").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3540
|
-
const { rulesDisableAction } = await import("./rules-
|
|
3540
|
+
const { rulesDisableAction } = await import("./rules-CThlosPx.js");
|
|
3541
3541
|
return rulesDisableAction(rule, command.optsWithGlobals());
|
|
3542
3542
|
});
|
|
3543
3543
|
rules.command("category <category> <severity>").description("Set the severity for a whole category (off, warn, error)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (category, severity, _options, command) => {
|
|
3544
|
-
const { rulesCategoryAction } = await import("./rules-
|
|
3544
|
+
const { rulesCategoryAction } = await import("./rules-CThlosPx.js");
|
|
3545
3545
|
return rulesCategoryAction(category, severity, command.optsWithGlobals());
|
|
3546
3546
|
});
|
|
3547
3547
|
rules.command("ignore-tag <tag>").description("Skip a whole rule family by tag before linting (e.g. design)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3548
|
-
const { rulesIgnoreTagAction } = await import("./rules-
|
|
3548
|
+
const { rulesIgnoreTagAction } = await import("./rules-CThlosPx.js");
|
|
3549
3549
|
return rulesIgnoreTagAction(tag, command.optsWithGlobals());
|
|
3550
3550
|
});
|
|
3551
3551
|
rules.command("unignore-tag <tag>").description("Stop ignoring a tag previously skipped via ignore-tag").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3552
|
-
const { rulesUnignoreTagAction } = await import("./rules-
|
|
3552
|
+
const { rulesUnignoreTagAction } = await import("./rules-CThlosPx.js");
|
|
3553
3553
|
return rulesUnignoreTagAction(tag, command.optsWithGlobals());
|
|
3554
3554
|
});
|
|
3555
3555
|
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) => {
|
|
3556
|
-
const { runScanCommand } = await import("./scan-
|
|
3556
|
+
const { runScanCommand } = await import("./scan-4I1mvxBO.js");
|
|
3557
3557
|
return runScanCommand({
|
|
3558
3558
|
directory,
|
|
3559
3559
|
flags: command.optsWithGlobals(),
|
|
@@ -3592,4 +3592,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
3592
3592
|
export {};
|
|
3593
3593
|
|
|
3594
3594
|
//# sourceMappingURL=cli.js.map
|
|
3595
|
-
//# debugId=
|
|
3595
|
+
//# debugId=03462e9a-cc61-5815-b641-9bce568efeb2
|
|
@@ -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]="45a8bc44-05f9-51c0-899c-aaf1945ac0b6")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-g3_lzs3l.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-Y1pcA2uj.js.map
|
|
14
|
+
//# debugId=45a8bc44-05f9-51c0-899c-aaf1945ac0b6
|
|
@@ -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 writeJsonErrorReport } from "./record-metric-
|
|
4
|
-
import { s as shutdownTelemetry } from "./unref-stdin-
|
|
5
|
-
import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, 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]="654dda0c-0454-5d61-87ec-a5f31789a4c8")}catch(e){}}();
|
|
3
|
+
import { d as isJsonModeActive, m as writeJsonErrorReport } from "./record-metric-CFfsgcVs.js";
|
|
4
|
+
import { s as shutdownTelemetry } from "./unref-stdin-BxyvqsOy.js";
|
|
5
|
+
import { i as flushSentry, n as buildFooterLinkLines, r as activeScanAbortRegistry, t as buildSectionDivider } from "./build-section-divider-BuOtLrzK.js";
|
|
6
6
|
//#region src/cli/utils/active-tui-renderer.ts
|
|
7
7
|
let activeTuiRenderer = null;
|
|
8
8
|
const registerActiveTuiRenderer = (renderer) => {
|
|
@@ -44,5 +44,5 @@ const exitGracefully = () => {
|
|
|
44
44
|
//#endregion
|
|
45
45
|
export { registerActiveTuiRenderer as n, exitGracefully as t };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=exit-gracefully-
|
|
48
|
-
//# debugId=
|
|
47
|
+
//# sourceMappingURL=exit-gracefully-DnXGONjj.js.map
|
|
48
|
+
//# debugId=654dda0c-0454-5d61-87ec-a5f31789a4c8
|
package/dist/index.d.ts
CHANGED
|
@@ -10717,8 +10717,8 @@ type JsonReport = JsonReportV1$1 | JsonReportV2$1 | JsonReportV3$1; //#endregion
|
|
|
10717
10717
|
* Distinguishes the two situations that both surface as "no project here", so
|
|
10718
10718
|
* the rendered message matches reality:
|
|
10719
10719
|
*
|
|
10720
|
-
* - `no-project` (default): the path exists but has no
|
|
10721
|
-
* `package.json` at the root and no discoverable nested React subproject.
|
|
10720
|
+
* - `no-project` (default): the path exists but has no supported project — no
|
|
10721
|
+
* `package.json` at the root and no discoverable nested React or Three.js subproject.
|
|
10722
10722
|
* - `missing-path`: the resolved scan target does not exist on disk at all
|
|
10723
10723
|
* (a typo, a stale temp path, a monorepo subdir that isn't present). The
|
|
10724
10724
|
* generic "expected a package.json" guidance is misleading here, so point
|
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]="3404885b-ce22-59ed-b773-5398b6af4974")}catch(e){}}();
|
|
3
3
|
import { i as __toESM$1, r as __require, t as __commonJSMin$1 } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as path$1$1 from "node:path";
|
|
@@ -64290,7 +64290,7 @@ var ProjectNotFoundError = class extends Error {
|
|
|
64290
64290
|
kind;
|
|
64291
64291
|
constructor(directory, options) {
|
|
64292
64292
|
const kind = options?.kind ?? "no-project";
|
|
64293
|
-
super(kind === "missing-path" ? `Scan target "${directory}" does not exist. Check the path and try again.` : `No React project found in ${directory}. Expected a package.json at the directory root or a nested package.json with a React dependency.`, options);
|
|
64293
|
+
super(kind === "missing-path" ? `Scan target "${directory}" does not exist. Check the path and try again.` : `No React or Three.js project found in ${directory}. Expected a package.json at the directory root or a nested package.json with a React or Three.js dependency.`, options);
|
|
64294
64294
|
this.directory = directory;
|
|
64295
64295
|
this.kind = kind;
|
|
64296
64296
|
}
|
|
@@ -64324,7 +64324,7 @@ var AmbiguousProjectError = class extends Error {
|
|
|
64324
64324
|
directory;
|
|
64325
64325
|
candidates;
|
|
64326
64326
|
constructor(directory, candidates, options) {
|
|
64327
|
-
super(`Multiple React projects found under ${directory} (${candidates.length} candidates): ${candidates.join(", ")}. Re-run diagnose() with one of those subdirectories, or iterate them yourself.`, options);
|
|
64327
|
+
super(`Multiple React or Three.js projects found under ${directory} (${candidates.length} candidates): ${candidates.join(", ")}. Re-run diagnose() with one of those subdirectories, or iterate them yourself.`, options);
|
|
64328
64328
|
this.directory = directory;
|
|
64329
64329
|
this.candidates = candidates;
|
|
64330
64330
|
}
|
|
@@ -65670,9 +65670,11 @@ const FRAMEWORK_PACKAGES = {
|
|
|
65670
65670
|
"@remix-run/react": "remix",
|
|
65671
65671
|
gatsby: "gatsby",
|
|
65672
65672
|
astro: "astro",
|
|
65673
|
+
"@astrojs/react": "astro",
|
|
65673
65674
|
vite: "vite",
|
|
65674
65675
|
"react-scripts": "cra",
|
|
65675
65676
|
expo: "expo",
|
|
65677
|
+
"expo-router": "expo",
|
|
65676
65678
|
"react-native": "react-native"
|
|
65677
65679
|
};
|
|
65678
65680
|
const detectFramework = (dependencies) => {
|
|
@@ -66164,20 +66166,39 @@ const getDependencyDeclaration = ({ packageJson, packageName, sections }) => {
|
|
|
66164
66166
|
version: null
|
|
66165
66167
|
};
|
|
66166
66168
|
};
|
|
66167
|
-
const
|
|
66169
|
+
const REACT_PROJECT_DEPENDENCY_NAMES = new Set([
|
|
66168
66170
|
"react",
|
|
66171
|
+
"react-dom",
|
|
66169
66172
|
"react-native",
|
|
66170
66173
|
"next",
|
|
66171
|
-
"preact"
|
|
66174
|
+
"preact",
|
|
66175
|
+
"expo",
|
|
66176
|
+
"expo-router",
|
|
66177
|
+
"gatsby",
|
|
66178
|
+
"@remix-run/react",
|
|
66179
|
+
"@tanstack/react-start",
|
|
66180
|
+
"react-scripts",
|
|
66181
|
+
"@astrojs/react"
|
|
66172
66182
|
]);
|
|
66183
|
+
const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
|
|
66184
|
+
const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [
|
|
66185
|
+
...REACT_THREE_FIBER_DEPENDENCY_NAMES,
|
|
66186
|
+
"@react-three/drei",
|
|
66187
|
+
"@react-three/rapier",
|
|
66188
|
+
"@react-three/postprocessing",
|
|
66189
|
+
"@react-three/xr",
|
|
66190
|
+
"@react-three/cannon"
|
|
66191
|
+
];
|
|
66192
|
+
const THREE_DEPENDENCY_NAMES = ["three", ...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES];
|
|
66173
66193
|
const hasReactDependency = (packageJson) => {
|
|
66174
66194
|
const allDependencies = {
|
|
66175
66195
|
...packageJson.peerDependencies,
|
|
66176
66196
|
...packageJson.dependencies,
|
|
66177
66197
|
...packageJson.devDependencies
|
|
66178
66198
|
};
|
|
66179
|
-
return Object.keys(allDependencies).some((packageName) =>
|
|
66199
|
+
return Object.keys(allDependencies).some((packageName) => REACT_PROJECT_DEPENDENCY_NAMES.has(packageName));
|
|
66180
66200
|
};
|
|
66201
|
+
const hasSupportedProjectDependency = (packageJson) => hasReactDependency(packageJson) || getDependencySpec(packageJson, "remotion") !== null || THREE_DEPENDENCY_NAMES.some((packageName) => getDependencySpec(packageJson, packageName) !== null);
|
|
66181
66202
|
const getPreactVersion = (packageJson) => getDependencySpec(packageJson, "preact");
|
|
66182
66203
|
const resolveCatalogBackedDependencyVersion = ({ rootDirectory, rootPackageJson, packageName, sourceDirectory = rootDirectory, sourcePackageJson = rootPackageJson, version }) => {
|
|
66183
66204
|
if (version === null || !isCatalogReference(version)) return version;
|
|
@@ -66368,7 +66389,7 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
66368
66389
|
seenDirectories.add(workspacePackage.directory);
|
|
66369
66390
|
packages.push(workspacePackage);
|
|
66370
66391
|
};
|
|
66371
|
-
if (
|
|
66392
|
+
if (hasSupportedProjectDependency(packageJson)) pushIfNew({
|
|
66372
66393
|
name: packageJson.name ?? path$1$1.basename(rootDirectory),
|
|
66373
66394
|
directory: rootDirectory
|
|
66374
66395
|
});
|
|
@@ -66376,7 +66397,7 @@ const listWorkspacePackages = (rootDirectory) => {
|
|
|
66376
66397
|
const directories = resolveWorkspaceDirectories(rootDirectory, pattern);
|
|
66377
66398
|
for (const workspaceDirectory of directories) {
|
|
66378
66399
|
const workspacePackageJson = readPackageJson(path$1$1.join(workspaceDirectory, "package.json"));
|
|
66379
|
-
if (!
|
|
66400
|
+
if (!hasSupportedProjectDependency(workspacePackageJson)) continue;
|
|
66380
66401
|
pushIfNew({
|
|
66381
66402
|
name: workspacePackageJson.name ?? path$1$1.basename(workspaceDirectory),
|
|
66382
66403
|
directory: workspaceDirectory
|
|
@@ -66443,7 +66464,6 @@ const MOBX_REACT_PACKAGE_NAME = "mobx-react";
|
|
|
66443
66464
|
const MOBX_REACT_LITE_PACKAGE_NAME = "mobx-react-lite";
|
|
66444
66465
|
const MOBX_STATE_TREE_PACKAGE_NAME = "mobx-state-tree";
|
|
66445
66466
|
const MOBX_REACT_OBSERVER_PACKAGE_NAME = "mobx-react-observer";
|
|
66446
|
-
const REACT_THREE_FIBER_DEPENDENCY_NAMES = ["@react-three/fiber", "react-three-fiber"];
|
|
66447
66467
|
const REACT_THREE_FIBER_SECTIONS = [
|
|
66448
66468
|
"dependencies",
|
|
66449
66469
|
"peerDependencies",
|
|
@@ -66456,8 +66476,6 @@ const THREE_DEPENDENCY_SECTIONS = [
|
|
|
66456
66476
|
"optionalDependencies",
|
|
66457
66477
|
"devDependencies"
|
|
66458
66478
|
];
|
|
66459
|
-
const REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_DEPENDENCY_NAMES, "@react-three/drei"];
|
|
66460
|
-
const THREE_DEPENDENCY_NAMES = [...REACT_THREE_FIBER_ECOSYSTEM_DEPENDENCY_NAMES, "three"];
|
|
66461
66479
|
const REACT_ROUTER_DEPENDENCY_NAMES = [
|
|
66462
66480
|
"@react-router/dev",
|
|
66463
66481
|
"react-router-dom",
|
|
@@ -66961,13 +66979,13 @@ const detectTargetBlankOpenerProtection = (directory, packageJson) => {
|
|
|
66961
66979
|
if (browserslistRequirement === "noreferrer" || electronRequirement === "noreferrer") return "noreferrer";
|
|
66962
66980
|
if (browserslistRequirement === "noopener" || electronRequirement === "noopener") return "noopener";
|
|
66963
66981
|
};
|
|
66964
|
-
const
|
|
66982
|
+
const toSupportedWorkspacePackages = (directories) => {
|
|
66965
66983
|
const packages = [];
|
|
66966
66984
|
for (const directory of directories) {
|
|
66967
66985
|
const packageJsonPath = path$1$1.join(directory, "package.json");
|
|
66968
66986
|
if (!isFile(packageJsonPath)) continue;
|
|
66969
66987
|
const packageJson = readPackageJson(packageJsonPath);
|
|
66970
|
-
if (!
|
|
66988
|
+
if (!hasSupportedProjectDependency(packageJson)) continue;
|
|
66971
66989
|
const name = packageJson.name ?? path$1$1.basename(directory);
|
|
66972
66990
|
packages.push({
|
|
66973
66991
|
name,
|
|
@@ -66980,7 +66998,7 @@ const listManifestWorkspacePackages = (rootDirectory) => {
|
|
|
66980
66998
|
if (isFile(path$1$1.join(rootDirectory, "package.json"))) return listWorkspacePackages(rootDirectory);
|
|
66981
66999
|
const patterns = parsePnpmWorkspacePatterns(rootDirectory);
|
|
66982
67000
|
const nxPatterns = patterns.length > 0 ? [] : getNxWorkspaceDirectories(rootDirectory);
|
|
66983
|
-
return
|
|
67001
|
+
return toSupportedWorkspacePackages((patterns.length > 0 ? patterns : nxPatterns).flatMap((pattern) => resolveWorkspaceDirectories(rootDirectory, pattern)));
|
|
66984
67002
|
};
|
|
66985
67003
|
const NON_PROJECT_DIRECTORIES = new Set([
|
|
66986
67004
|
"AppData",
|
|
@@ -66988,7 +67006,7 @@ const NON_PROJECT_DIRECTORIES = new Set([
|
|
|
66988
67006
|
"Library"
|
|
66989
67007
|
]);
|
|
66990
67008
|
const MAX_SCAN_DEPTH = 6;
|
|
66991
|
-
const
|
|
67009
|
+
const discoverSupportedSubprojectsByFilesystem = (rootDirectory) => {
|
|
66992
67010
|
const packages = [];
|
|
66993
67011
|
const pendingDirectories = [{
|
|
66994
67012
|
directory: rootDirectory,
|
|
@@ -67001,7 +67019,7 @@ const discoverReactSubprojectsByFilesystem = (rootDirectory) => {
|
|
|
67001
67019
|
const packageJsonPath = path$1$1.join(currentDirectory, "package.json");
|
|
67002
67020
|
if (isFile(packageJsonPath)) {
|
|
67003
67021
|
const packageJson = readPackageJson(packageJsonPath);
|
|
67004
|
-
if (
|
|
67022
|
+
if (hasSupportedProjectDependency(packageJson)) {
|
|
67005
67023
|
const name = packageJson.name ?? path$1$1.basename(currentDirectory);
|
|
67006
67024
|
packages.push({
|
|
67007
67025
|
name,
|
|
@@ -67021,11 +67039,11 @@ const discoverReactSubprojectsByFilesystem = (rootDirectory) => {
|
|
|
67021
67039
|
}
|
|
67022
67040
|
return packages;
|
|
67023
67041
|
};
|
|
67024
|
-
const
|
|
67042
|
+
const discoverSupportedSubprojects = (rootDirectory) => {
|
|
67025
67043
|
if (!isDirectory(rootDirectory)) return [];
|
|
67026
67044
|
const manifestPackages = listManifestWorkspacePackages(rootDirectory);
|
|
67027
67045
|
if (manifestPackages.length > 0) return manifestPackages;
|
|
67028
|
-
return
|
|
67046
|
+
return discoverSupportedSubprojectsByFilesystem(rootDirectory);
|
|
67029
67047
|
};
|
|
67030
67048
|
const cachedProjectInfos = /* @__PURE__ */ new Map();
|
|
67031
67049
|
const clearProjectCache = () => {
|
|
@@ -67300,16 +67318,31 @@ const discoverProject = (directory, options = {}) => {
|
|
|
67300
67318
|
cachedProjectInfos.set(directory, projectInfo);
|
|
67301
67319
|
return projectInfo;
|
|
67302
67320
|
};
|
|
67321
|
+
const REACT_COMPATIBLE_FRAMEWORKS = new Set([
|
|
67322
|
+
"nextjs",
|
|
67323
|
+
"tanstack-start",
|
|
67324
|
+
"cra",
|
|
67325
|
+
"remix",
|
|
67326
|
+
"gatsby",
|
|
67327
|
+
"expo",
|
|
67328
|
+
"react-native",
|
|
67329
|
+
"preact"
|
|
67330
|
+
]);
|
|
67303
67331
|
/**
|
|
67304
|
-
*
|
|
67332
|
+
* Whether project discovery resolved a React-compatible runtime directly or
|
|
67333
|
+
* through a framework whose runtime is necessarily React-compatible.
|
|
67334
|
+
*/
|
|
67335
|
+
const hasReactRuntime = (project) => project.reactVersion !== null || project.preactVersion !== null || REACT_COMPATIBLE_FRAMEWORKS.has(project.framework);
|
|
67336
|
+
/**
|
|
67337
|
+
* A project is worth scanning when it has a supported runtime (the runtime-
|
|
67305
67338
|
* specific rules apply) OR it simply has source files to lint. The
|
|
67306
67339
|
* second arm is what lets a plain TypeScript/JavaScript codebase — no
|
|
67307
67340
|
* React dependency at all — run the framework-agnostic rules
|
|
67308
67341
|
* (security, architecture, zod, bundle-size, …) instead of hard-failing
|
|
67309
|
-
* with "No React dependency". Only a directory with neither
|
|
67310
|
-
* single source file has nothing to analyze.
|
|
67342
|
+
* with "No React dependency". Only a directory with neither a supported
|
|
67343
|
+
* runtime nor a single source file has nothing to analyze.
|
|
67311
67344
|
*/
|
|
67312
|
-
const isAnalyzableProject = (project) => project.
|
|
67345
|
+
const isAnalyzableProject = (project) => hasReactRuntime(project) || project.hasThree === true || project.hasRemotion === true || project.sourceFileCount > 0;
|
|
67313
67346
|
const LEGACY_RULE_KEY_TO_NATIVE_RULE_KEY = {
|
|
67314
67347
|
"deslop/circular-dependency": "react-doctor/circular-dependency",
|
|
67315
67348
|
"deslop/unused-dependency": "react-doctor/unused-dependency",
|
|
@@ -69227,11 +69260,11 @@ const resolveConfigRootDir = (config, configSourceDirectory) => {
|
|
|
69227
69260
|
};
|
|
69228
69261
|
const resolveDiagnoseTarget = (directory, options = {}) => {
|
|
69229
69262
|
if (isFile(path$1$1.join(directory, "package.json"))) return directory;
|
|
69230
|
-
const
|
|
69231
|
-
if (
|
|
69232
|
-
if (
|
|
69263
|
+
const subprojects = discoverSupportedSubprojects(directory);
|
|
69264
|
+
if (subprojects.length === 0) return null;
|
|
69265
|
+
if (subprojects.length === 1) return subprojects[0].directory;
|
|
69233
69266
|
if (options.allowAmbiguous === true) return null;
|
|
69234
|
-
throw new AmbiguousProjectError(directory,
|
|
69267
|
+
throw new AmbiguousProjectError(directory, subprojects.map((subproject) => path$1$1.relative(directory, subproject.directory)).toSorted());
|
|
69235
69268
|
};
|
|
69236
69269
|
/**
|
|
69237
69270
|
* The canonical entry-point translation shared by every public shell
|
|
@@ -70966,21 +70999,6 @@ function* collectSecurityScanFiles(rootDirectory, excludedDirectories = /* @__PU
|
|
|
70966
70999
|
}
|
|
70967
71000
|
}
|
|
70968
71001
|
}
|
|
70969
|
-
const REACT_COMPATIBLE_FRAMEWORKS = new Set([
|
|
70970
|
-
"nextjs",
|
|
70971
|
-
"tanstack-start",
|
|
70972
|
-
"cra",
|
|
70973
|
-
"remix",
|
|
70974
|
-
"gatsby",
|
|
70975
|
-
"expo",
|
|
70976
|
-
"react-native",
|
|
70977
|
-
"preact"
|
|
70978
|
-
]);
|
|
70979
|
-
/**
|
|
70980
|
-
* Whether project discovery resolved a React-compatible runtime directly or
|
|
70981
|
-
* through a framework whose runtime is necessarily React-compatible.
|
|
70982
|
-
*/
|
|
70983
|
-
const hasReactRuntime = (project) => project.reactVersion !== null || project.preactVersion !== null || REACT_COMPATIBLE_FRAMEWORKS.has(project.framework);
|
|
70984
71002
|
const CLIENT_ONLY_FRAMEWORKS = new Set([
|
|
70985
71003
|
"vite",
|
|
70986
71004
|
"cra",
|
|
@@ -74505,7 +74523,7 @@ const buildRelatedLocations = (labels, filePath, sourceBuffer) => {
|
|
|
74505
74523
|
const isOxlintSpan = (value) => isRecord(value) && typeof value.offset === "number" && typeof value.length === "number" && typeof value.line === "number" && typeof value.column === "number";
|
|
74506
74524
|
const isOxlintLabel = (value) => isRecord(value) && isOxlintSpan(value.span);
|
|
74507
74525
|
const isMappableOxlintDiagnostic = (value) => isRecord(value) && typeof value.code === "string" && value.code.length > 0 && typeof value.filename === "string" && value.filename.length > 0 && (value.severity === "warning" || value.severity === "error") && Array.isArray(value.labels) && value.labels.every(isOxlintLabel);
|
|
74508
|
-
const isEngineFailureDiagnostic = (value) => !isRecord(value) || typeof value.filename !== "string" || value.filename.length === 0;
|
|
74526
|
+
const isEngineFailureDiagnostic = (value) => !isRecord(value) || typeof value.filename !== "string" || value.filename.length === 0 || typeof value.message === "string" && value.message.startsWith("Error running JS plugin.") && (typeof value.code !== "string" || value.code.length === 0) && Array.isArray(value.labels) && value.labels.length === 0;
|
|
74509
74527
|
const isOxlintOutput = (value) => isRecord(value) && Array.isArray(value.diagnostics);
|
|
74510
74528
|
/**
|
|
74511
74529
|
* Parses one oxlint subprocess's stdout into a flat `Diagnostic[]`.
|
|
@@ -77864,4 +77882,4 @@ const toJsonReport = (result, options) => buildJsonReport({
|
|
|
77864
77882
|
export { AmbiguousProjectError, NoReactDependencyError, NotADirectoryError, PackageJsonNotFoundError, ProjectNotFoundError, ReactDoctorError, buildJsonReport, buildJsonReportError, clearCaches, defineConfig, diagnose, filterSourceFiles, getDiffInfo, hasReactRuntime, isProjectDiscoveryError, isReactDoctorError, summarizeDiagnostics, toJsonReport };
|
|
77865
77883
|
|
|
77866
77884
|
//# sourceMappingURL=index.js.map
|
|
77867
|
-
//# debugId=
|
|
77885
|
+
//# debugId=3404885b-ce22-59ed-b773-5398b6af4974
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { $n as CANONICAL_GITHUB_URL, F as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, G as isCiOrCodingAgentEnvironment, Gt as highlighter, It as getBaselineDiffPlan, K as isCodingAgentEnvironment, Ln as runPromise, Lt as getChangedLineRanges, Nt as findLegacyConfig, Ot as detectAiTrainingEnvironment, P as STAGED_FILES_TEMP_DIR_PREFIX, Pn as provide$1, R as CliInputError, Sr as messageFromUnknown, Ut as hasSupportedFrameworkOrLibrary, V as isDebugFlagEnabled, Wn as provide, Y as Git, dn as resolveScanTarget, f as setJsonReportDirectory, g as VERSION, gr as STAGED_FILES_PROJECT_CONFIG_FILENAMES, h as writeJsonReport, kn as gen, kt as
|
|
4
|
-
import { c as isExpectedUserError, s as shutdownTelemetry } from "./unref-stdin-
|
|
5
|
-
import { i as flushSentry } from "./build-section-divider-
|
|
6
|
-
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-
|
|
7
|
-
import { F as runGitRaw, L as cliLogger, c as spinner, i as hasDoctorScript, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-
|
|
8
|
-
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-
|
|
9
|
-
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope, u as toForwardSlashes } from "./resolve-scope-
|
|
10
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
11
|
-
import { A as resolveMergeBaseRef, C as copyToClipboard, D as deduplicateProjectScans, E as collectProjectSourceFileCounts, I as printDiagnosticsDump, O as createInvocationInspect, S as CLI_AGENT_BINARIES, T as buildHandoffPayload, V as buildEmptyReportMessage, _ as resolveCliInspectOptions, a as projectManifestChanged, b as setUpGitHubActions, c as selectProjects, d as resolveProjectChangedLineRanges, f as resolveProjectDiffIncludePaths, g as resolveWorkspaceDeadCodeOwner, h as retryMissingProjectScores, i as validateModeFlags, j as printHeadlessReport, k as inspect, l as buildCodeFrame, m as resolveProjectRelativeDirectory, n as formatSkippedProjectsMessage, o as partitionProjectScanOutcomes, p as resolveProjectSourceFilePaths, r as validateIncludeUntrackedScope, t as shouldFailScanGate, u as resolveProjectScan, v as filterScansForSurface, w as launchCliAgent, x as detectLaunchableAgents, y as countUniqueScannedFiles, z as filterDiagnosticsByCategories } from "./should-fail-scan-gate-
|
|
12
|
-
import { a as recordGate, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-
|
|
13
|
-
import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as
|
|
14
|
-
import { t as readObjectFile } from "./read-object-file-
|
|
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]="af0fd5ec-ce34-5937-847d-1030d5a8d5cb")}catch(e){}}();
|
|
3
|
+
import { $n as CANONICAL_GITHUB_URL, F as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, G as isCiOrCodingAgentEnvironment, Gt as highlighter, It as getBaselineDiffPlan, K as isCodingAgentEnvironment, Ln as runPromise, Lt as getChangedLineRanges, Nt as findLegacyConfig, Ot as detectAiTrainingEnvironment, P as STAGED_FILES_TEMP_DIR_PREFIX, Pn as provide$1, R as CliInputError, Sr as messageFromUnknown, Ut as hasSupportedFrameworkOrLibrary, V as isDebugFlagEnabled, Wn as provide, Y as Git, dn as resolveScanTarget, f as setJsonReportDirectory, g as VERSION, gr as STAGED_FILES_PROJECT_CONFIG_FILENAMES, h as writeJsonReport, kn as gen, kt as discoverSupportedSubprojects, lt as StagedFiles, m as writeJsonErrorReport, mt as buildJsonReport, n as recordDistribution, on as remainingDeadlineBudgetMs, p as setJsonReportMode, qt as isPathInsideDirectory, rn as mapWithConcurrency, t as recordCount, tn as listWorkspacePackages, u as enableJsonMode, vn as toRelativePath, w as METRIC, xr as isPlainObject, yr as isErrnoException, zt as getDiffInfo } from "./record-metric-CFfsgcVs.js";
|
|
4
|
+
import { c as isExpectedUserError, s as shutdownTelemetry } from "./unref-stdin-BxyvqsOy.js";
|
|
5
|
+
import { i as flushSentry } from "./build-section-divider-BuOtLrzK.js";
|
|
6
|
+
import { n as handleError, r as handleUserError, t as reportErrorToSentry } from "./report-error-MGKyeIns.js";
|
|
7
|
+
import { F as runGitRaw, L as cliLogger, c as spinner, i as hasDoctorScript, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-DmEWQpVJ.js";
|
|
8
|
+
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-Dx6Pl9Wl.js";
|
|
9
|
+
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope, u as toForwardSlashes } from "./resolve-scope-CXS-5jLR.js";
|
|
10
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-BqrtVX4G.js";
|
|
11
|
+
import { A as resolveMergeBaseRef, C as copyToClipboard, D as deduplicateProjectScans, E as collectProjectSourceFileCounts, I as printDiagnosticsDump, O as createInvocationInspect, S as CLI_AGENT_BINARIES, T as buildHandoffPayload, V as buildEmptyReportMessage, _ as resolveCliInspectOptions, a as projectManifestChanged, b as setUpGitHubActions, c as selectProjects, d as resolveProjectChangedLineRanges, f as resolveProjectDiffIncludePaths, g as resolveWorkspaceDeadCodeOwner, h as retryMissingProjectScores, i as validateModeFlags, j as printHeadlessReport, k as inspect, l as buildCodeFrame, m as resolveProjectRelativeDirectory, n as formatSkippedProjectsMessage, o as partitionProjectScanOutcomes, p as resolveProjectSourceFilePaths, r as validateIncludeUntrackedScope, t as shouldFailScanGate, u as resolveProjectScan, v as filterScansForSurface, w as launchCliAgent, x as detectLaunchableAgents, y as countUniqueScannedFiles, z as filterDiagnosticsByCategories } from "./should-fail-scan-gate-C0Bo5Gqy.js";
|
|
12
|
+
import { a as recordGate, i as readPreference, o as runMigrations, p as SETUP_HINT_EVENT, r as isGatePending, s as writePreference, u as HANDOFF_TARGET_PREFERENCE_ID } from "./report-workflow-result-DGg9xopH.js";
|
|
13
|
+
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-CMCXgenA.js";
|
|
14
|
+
import { t as readObjectFile } from "./read-object-file-Cwhr9OIi.js";
|
|
15
15
|
import * as path$1 from "node:path";
|
|
16
16
|
import * as fs$1 from "node:fs";
|
|
17
17
|
import { tmpdir } from "node:os";
|
|
@@ -315,17 +315,18 @@ const PROJECT_MIGRATIONS = [
|
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
317
|
id: "agent-hooks-sh-to-mjs",
|
|
318
|
+
version: 2,
|
|
318
319
|
scope: "project",
|
|
319
320
|
run: ({ projectRoot }) => {
|
|
320
321
|
if (projectRoot === void 0) return false;
|
|
321
|
-
const agents =
|
|
322
|
+
const agents = findAgentsWithOutdatedReactDoctorHooks(projectRoot);
|
|
322
323
|
if (agents.length === 0) return false;
|
|
323
324
|
installReactDoctorAgentHooks({
|
|
324
325
|
projectRoot,
|
|
325
326
|
agents
|
|
326
327
|
});
|
|
327
|
-
cliLogger.success(`
|
|
328
|
-
cliLogger.dim("
|
|
328
|
+
cliLogger.success(`Moved React Doctor agent hooks to end-of-turn checks (${agents.join(", ")})`);
|
|
329
|
+
cliLogger.dim(" Hooks now scan changed and untracked files once when the agent stops. Review and commit the change.");
|
|
329
330
|
cliLogger.break();
|
|
330
331
|
return true;
|
|
331
332
|
}
|
|
@@ -474,7 +475,7 @@ const buildDiagnosticIssueUrl = (input) => {
|
|
|
474
475
|
const findOwningProjectDirectory = (rootDirectory, filePath) => {
|
|
475
476
|
const absoluteFile = path$1.isAbsolute(filePath) ? filePath : path$1.resolve(rootDirectory, filePath);
|
|
476
477
|
const workspacePackages = listWorkspacePackages(rootDirectory);
|
|
477
|
-
const candidates = workspacePackages.length > 0 ? workspacePackages :
|
|
478
|
+
const candidates = workspacePackages.length > 0 ? workspacePackages : discoverSupportedSubprojects(rootDirectory);
|
|
478
479
|
if (candidates.length === 0) return rootDirectory;
|
|
479
480
|
let bestMatch = null;
|
|
480
481
|
for (const candidate of candidates) {
|
|
@@ -1439,5 +1440,5 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1439
1440
|
//#endregion
|
|
1440
1441
|
export { warnDeprecatedFailOn as n, runProjectMigrations as r, inspectAction as t };
|
|
1441
1442
|
|
|
1442
|
-
//# sourceMappingURL=inspect-
|
|
1443
|
-
//# debugId=
|
|
1443
|
+
//# sourceMappingURL=inspect-g3_lzs3l.js.map
|
|
1444
|
+
//# debugId=af0fd5ec-ce34-5937-847d-1030d5a8d5cb
|