react-doctor 0.9.12-dev.bd08406 → 0.9.12-dev.ca30808
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/README.md +6 -0
- package/dist/{build-section-divider-DjX3mmIx.js → build-section-divider-DGcPvzjX.js} +7 -7
- package/dist/{ci-D0OU7_5i.js → ci-DZ9QnUV4.js} +12 -12
- package/dist/cli.js +67 -38
- package/dist/{design-D-9YrV4y.js → design-BlxQroSp.js} +4 -4
- package/dist/{devtools-BiC-AP3B.js → devtools-CC2PAZ85.js} +3 -3
- package/dist/{exit-gracefully-DuS_nzeq.js → exit-gracefully-Dt1ix6Xh.js} +6 -6
- package/dist/{get-east-asian-width-Cglw13G7.js → get-east-asian-width-Bv2TD3Xj.js} +3 -3
- package/dist/{handle-error-BzC_gVSx.js → handle-error-Cslt8b7C.js} +17 -12
- package/dist/index.js +459 -285
- package/dist/{inspect-NIjyNi5S.js → inspect-Dd1qqPJf.js} +38 -29
- package/dist/{install-BcGDtIYv.js → install-DeWeUjqr.js} +9 -9
- package/dist/{install-doctor-script-W-u3DPjZ.js → install-doctor-script-DbKR-GHo.js} +7 -14
- package/dist/{install-github-workflow-DqodeftR.js → install-github-workflow-Bkv_CMdF.js} +10 -6
- package/dist/{install-react-doctor-C3r0K9JP.js → install-react-doctor-DkfLDtWd.js} +8 -8
- package/dist/{jsx-runtime-BXnpEdz3.js → jsx-runtime-DwPH8QhA.js} +7 -7
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-eiCaprox.js → print-branded-header-CFNvp2ey.js} +4 -4
- package/dist/project-analysis-worker.js +53 -52
- package/dist/{prompt-runtime-scan-url-CAZLxZl0.js → prompt-runtime-scan-url-BuXp7_n4.js} +6 -6
- package/dist/{read-object-file-D4DobruV.js → read-object-file-CEbx-anl.js} +4 -4
- package/dist/{record-metric-CECbS8Qh.js → record-metric-BzGcVSov.js} +405 -230
- package/dist/{report-error-Ckftf8UM.js → report-error-ZMTPN93d.js} +5 -5
- package/dist/{report-workflow-result-MtfAsorD.js → report-workflow-result-CKUjTJpB.js} +5 -5
- package/dist/{resolve-scope-IDn0nWJF.js → resolve-scope-BgrQEVtj.js} +8 -10
- package/dist/{rules-6hA6QP9L.js → rules-DizN5gJ6.js} +6 -6
- package/dist/{run-scan-app-DNHg67cm.js → run-scan-app-CjSGMmOE.js} +17 -14
- package/dist/{runtime-scan-Dqqn1kW3.js → runtime-scan-DINB89wl.js} +9 -9
- package/dist/{sanitize-runtime-url-DhYx4VYy.js → sanitize-runtime-url-CFvLC0Vp.js} +4 -4
- package/dist/{scan-DtjqkKaM.js → scan-CEvjogRY.js} +17 -11
- package/dist/{should-fail-scan-gate-CXE70SlM.js → should-fail-scan-gate-gpuv_UOL.js} +19 -12
- package/dist/{should-skip-prompts-DwpFmYZZ.js → should-skip-prompts-F0NaNR8z.js} +4 -4
- package/dist/{should-use-tui-Cze9CmaN.js → should-use-tui-Dve0A4YR.js} +4 -4
- package/dist/{telemetry-runtime-DVy10F6G.js → telemetry-runtime-Bs7DsGaF.js} +55 -7
- package/dist/{unref-stdin-BKT_s38a.js → unref-stdin-SK3WfwxS.js} +3 -3
- package/dist/{version-Cr0PARuU.js → version-DVa-lN1C.js} +4 -4
- package/dist/{why-DnrSKh_M.js → why-BqR3fLtE.js} +4 -4
- package/dist/{with-run-span-BsK0r1ay.js → with-run-span-NbAvibgv.js} +5 -5
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -25,6 +25,12 @@ Run this at your project root to get an audit.
|
|
|
25
25
|
npx react-doctor@latest
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
Pass file paths to scan only the files that another CI step selected.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx react-doctor@latest src/a.tsx src/b.tsx
|
|
32
|
+
```
|
|
33
|
+
|
|
28
34
|
https://github.com/user-attachments/assets/07cc88d9-9589-44c3-aa73-5d603cb1c570
|
|
29
35
|
|
|
30
36
|
### 2. Install for agents
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-
|
|
4
|
-
import { r as isExpectedUserError } from "./telemetry-runtime-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="34d68399-4e64-5d03-9e6b-911657576a32")}catch(e){}}();
|
|
3
|
+
import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-BzGcVSov.js";
|
|
4
|
+
import { r as isExpectedUserError } from "./telemetry-runtime-Bs7DsGaF.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.ca30808`;
|
|
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.ca30808") ? "development" : "production");
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/instrument.ts
|
|
82
82
|
let isInitialized = false;
|
|
@@ -212,5 +212,5 @@ const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repe
|
|
|
212
212
|
//#endregion
|
|
213
213
|
export { initializeSentry as i, buildFooterLinkLines as n, flushSentry as r, buildSectionDivider as t };
|
|
214
214
|
|
|
215
|
-
//# sourceMappingURL=build-section-divider-
|
|
216
|
-
//# debugId=
|
|
215
|
+
//# sourceMappingURL=build-section-divider-DGcPvzjX.js.map
|
|
216
|
+
//# debugId=34d68399-4e64-5d03-9e6b-911657576a32
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="edef111d-bacd-5bdf-9d46-5c90cee1a43e")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { Kt as highlighter, T as METRIC, cr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, tr as CI_URL, zn as runSync } from "./record-metric-
|
|
5
|
-
import { r as isExpectedUserError } from "./telemetry-runtime-
|
|
6
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
7
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
8
|
-
import {
|
|
9
|
-
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-
|
|
10
|
-
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-
|
|
11
|
-
import { t as shouldSkipPrompts } from "./should-skip-prompts-
|
|
12
|
-
import { t as printBrandedHeader } from "./print-branded-header-
|
|
4
|
+
import { Kt as highlighter, T as METRIC, cr as GITHUB_ACTIONS_SETUP_URL, t as recordCount, tr as CI_URL, zn as runSync } from "./record-metric-BzGcVSov.js";
|
|
5
|
+
import { r as isExpectedUserError } from "./telemetry-runtime-Bs7DsGaF.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-Cslt8b7C.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-ZMTPN93d.js";
|
|
8
|
+
import { M as cliLogger, c as spinner, n as findNearestPackageDirectory } from "./install-doctor-script-DbKR-GHo.js";
|
|
9
|
+
import { a as readReactDoctorWorkflow, d as detectDefaultBranch, f as runCommand, l as prompts, n as getReactDoctorWorkflowPath, s as upgradeWorkflowActionToV2, t as buildWorkflowContent } from "./install-github-workflow-Bkv_CMdF.js";
|
|
10
|
+
import { a as isValidBlockingLevel, c as openWorkflowPullRequest, l as stageWorkflowFile, n as isScopeValue } from "./resolve-scope-BgrQEVtj.js";
|
|
11
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-F0NaNR8z.js";
|
|
12
|
+
import { t as printBrandedHeader } from "./print-branded-header-CFNvp2ey.js";
|
|
13
13
|
import * as path$1 from "node:path";
|
|
14
14
|
import * as fs$1 from "node:fs";
|
|
15
15
|
//#region src/cli/utils/ci/ci-provider.ts
|
|
@@ -7498,5 +7498,5 @@ const ciConfigAction = (options) => runCiCommand("config", runCiConfig, options)
|
|
|
7498
7498
|
//#endregion
|
|
7499
7499
|
export { ciConfigAction, ciInstallAction, ciUpgradeAction };
|
|
7500
7500
|
|
|
7501
|
-
//# sourceMappingURL=ci-
|
|
7502
|
-
//# debugId=
|
|
7501
|
+
//# sourceMappingURL=ci-DZ9QnUV4.js.map
|
|
7502
|
+
//# debugId=edef111d-bacd-5bdf-9d46-5c90cee1a43e
|
package/dist/cli.js
CHANGED
|
@@ -1,15 +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]="
|
|
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]="2db05473-003e-52a5-853a-90e4f4f5ac96")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
-
import { H as isDebugFlagEnabled, Kt as highlighter, _ as VERSION, d as isJsonModeActive, er as CANONICAL_GITHUB_URL, gn as setColorEnabled, h as writeJsonErrorReport, i as isTelemetryEnabled, tr as CI_URL, z as CliInputError } from "./record-metric-
|
|
5
|
-
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-
|
|
6
|
-
import { i as initializeSentry, r as flushSentry } from "./build-section-divider-
|
|
7
|
-
import { t as exitGracefully } from "./exit-gracefully-
|
|
8
|
-
import { n as handleUserError, t as handleError } from "./handle-error-
|
|
4
|
+
import { H as isDebugFlagEnabled, Jt as isPathInsideDirectory, Kt as highlighter, Nt as filterSourceFiles, _ as VERSION, d as isJsonModeActive, er as CANONICAL_GITHUB_URL, gn as setColorEnabled, h as writeJsonErrorReport, i as isTelemetryEnabled, tr as CI_URL, xr as isFile, yr as isDirectory, z as CliInputError } from "./record-metric-BzGcVSov.js";
|
|
5
|
+
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-Bs7DsGaF.js";
|
|
6
|
+
import { i as initializeSentry, r as flushSentry } from "./build-section-divider-DGcPvzjX.js";
|
|
7
|
+
import { t as exitGracefully } from "./exit-gracefully-Dt1ix6Xh.js";
|
|
8
|
+
import { n as handleUserError, t as handleError } from "./handle-error-Cslt8b7C.js";
|
|
9
9
|
import { n as getLastRunTraceId } from "./active-run-trace-dlIZeEvb.js";
|
|
10
|
-
import { t as reportErrorToSentry } from "./report-error-
|
|
11
|
-
import { t as
|
|
10
|
+
import { t as reportErrorToSentry } from "./report-error-ZMTPN93d.js";
|
|
11
|
+
import { t as toForwardSlashes } from "./path-format-DnHpmJwG.js";
|
|
12
|
+
import { t as unrefStdin } from "./unref-stdin-SK3WfwxS.js";
|
|
12
13
|
import { execFileSync } from "node:child_process";
|
|
14
|
+
import * as path$1 from "node:path";
|
|
13
15
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
|
|
14
16
|
var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
15
17
|
/**
|
|
@@ -1026,7 +1028,7 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1026
1028
|
var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1027
1029
|
const EventEmitter = __require("node:events").EventEmitter;
|
|
1028
1030
|
const childProcess = __require("node:child_process");
|
|
1029
|
-
const path = __require("node:path");
|
|
1031
|
+
const path$2 = __require("node:path");
|
|
1030
1032
|
const fs = __require("node:fs");
|
|
1031
1033
|
const process$1 = __require("node:process");
|
|
1032
1034
|
const { Argument, humanReadableArgName } = require_argument();
|
|
@@ -1946,9 +1948,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1946
1948
|
".cjs"
|
|
1947
1949
|
];
|
|
1948
1950
|
function findFile(baseDir, baseName) {
|
|
1949
|
-
const localBin = path.resolve(baseDir, baseName);
|
|
1951
|
+
const localBin = path$2.resolve(baseDir, baseName);
|
|
1950
1952
|
if (fs.existsSync(localBin)) return localBin;
|
|
1951
|
-
if (sourceExt.includes(path.extname(baseName))) return void 0;
|
|
1953
|
+
if (sourceExt.includes(path$2.extname(baseName))) return void 0;
|
|
1952
1954
|
const foundExt = sourceExt.find((ext) => fs.existsSync(`${localBin}${ext}`));
|
|
1953
1955
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1954
1956
|
}
|
|
@@ -1963,17 +1965,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1963
1965
|
} catch {
|
|
1964
1966
|
resolvedScriptPath = this._scriptPath;
|
|
1965
1967
|
}
|
|
1966
|
-
executableDir = path.resolve(path.dirname(resolvedScriptPath), executableDir);
|
|
1968
|
+
executableDir = path$2.resolve(path$2.dirname(resolvedScriptPath), executableDir);
|
|
1967
1969
|
}
|
|
1968
1970
|
if (executableDir) {
|
|
1969
1971
|
let localFile = findFile(executableDir, executableFile);
|
|
1970
1972
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1971
|
-
const legacyName = path.basename(this._scriptPath, path.extname(this._scriptPath));
|
|
1973
|
+
const legacyName = path$2.basename(this._scriptPath, path$2.extname(this._scriptPath));
|
|
1972
1974
|
if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
1973
1975
|
}
|
|
1974
1976
|
executableFile = localFile || executableFile;
|
|
1975
1977
|
}
|
|
1976
|
-
launchWithNode = sourceExt.includes(path.extname(executableFile));
|
|
1978
|
+
launchWithNode = sourceExt.includes(path$2.extname(executableFile));
|
|
1977
1979
|
let proc;
|
|
1978
1980
|
if (process$1.platform !== "win32") if (launchWithNode) {
|
|
1979
1981
|
args.unshift(executableFile);
|
|
@@ -2741,7 +2743,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2741
2743
|
* @return {Command}
|
|
2742
2744
|
*/
|
|
2743
2745
|
nameFromFilename(filename) {
|
|
2744
|
-
this._name = path.basename(filename, path.extname(filename));
|
|
2746
|
+
this._name = path$2.basename(filename, path$2.extname(filename));
|
|
2745
2747
|
return this;
|
|
2746
2748
|
}
|
|
2747
2749
|
/**
|
|
@@ -3173,6 +3175,31 @@ const assertNoRemovedFlags = (argv) => {
|
|
|
3173
3175
|
}
|
|
3174
3176
|
};
|
|
3175
3177
|
//#endregion
|
|
3178
|
+
//#region src/cli/utils/resolve-positional-scan-input.ts
|
|
3179
|
+
const resolvePositionalScanInput = (positionalPaths, currentDirectory = process.cwd()) => {
|
|
3180
|
+
const absoluteCurrentDirectory = path$1.resolve(currentDirectory);
|
|
3181
|
+
if (positionalPaths.length === 0) return {
|
|
3182
|
+
directory: absoluteCurrentDirectory,
|
|
3183
|
+
filePaths: void 0
|
|
3184
|
+
};
|
|
3185
|
+
const onlyAbsolutePath = path$1.resolve(absoluteCurrentDirectory, positionalPaths[0]);
|
|
3186
|
+
if (positionalPaths.length === 1 && (isDirectory(onlyAbsolutePath) || !isFile(onlyAbsolutePath) && filterSourceFiles([positionalPaths[0]]).length === 0)) return {
|
|
3187
|
+
directory: positionalPaths[0],
|
|
3188
|
+
filePaths: void 0
|
|
3189
|
+
};
|
|
3190
|
+
const uniqueFilePaths = /* @__PURE__ */ new Set();
|
|
3191
|
+
for (const positionalPath of positionalPaths) {
|
|
3192
|
+
const absolutePath = path$1.resolve(absoluteCurrentDirectory, positionalPath);
|
|
3193
|
+
if (isDirectory(absolutePath)) throw new CliInputError(`Cannot combine the directory "${positionalPath}" with file path arguments. Pass one directory or only file paths.`);
|
|
3194
|
+
if (!isPathInsideDirectory(absolutePath, absoluteCurrentDirectory)) throw new CliInputError(`The file path "${positionalPath}" is outside the current directory. Run React Doctor from a common project root.`);
|
|
3195
|
+
uniqueFilePaths.add(toForwardSlashes(path$1.relative(absoluteCurrentDirectory, absolutePath)));
|
|
3196
|
+
}
|
|
3197
|
+
return {
|
|
3198
|
+
directory: absoluteCurrentDirectory,
|
|
3199
|
+
filePaths: [...uniqueFilePaths]
|
|
3200
|
+
};
|
|
3201
|
+
};
|
|
3202
|
+
//#endregion
|
|
3176
3203
|
//#region src/cli/utils/strip-unknown-cli-flags.ts
|
|
3177
3204
|
const ROOT_FLAG_SPEC = {
|
|
3178
3205
|
longOptionsWithoutValues: new Set([
|
|
@@ -3429,6 +3456,7 @@ ${highlighter.dim("Examples:")}
|
|
|
3429
3456
|
${formatExampleLines([
|
|
3430
3457
|
["react-doctor", "scan the current project"],
|
|
3431
3458
|
["react-doctor ./apps/web", "scan a specific directory"],
|
|
3459
|
+
["react-doctor src/a.tsx src/b.tsx", "scan only selected files"],
|
|
3432
3460
|
["react-doctor scan http://localhost:3000", "profile one interaction in a running React app"],
|
|
3433
3461
|
["react-doctor --scope changed --base main", "scan only new issues vs. main"],
|
|
3434
3462
|
["react-doctor --project modules/a,modules/b", "score each module separately (names or paths)"],
|
|
@@ -3527,85 +3555,85 @@ ${highlighter.dim("Learn more:")}
|
|
|
3527
3555
|
${highlighter.info(CI_URL)}
|
|
3528
3556
|
`;
|
|
3529
3557
|
const collectCategoryOption = (value, previousValues) => [...previousValues ?? [], value];
|
|
3530
|
-
const program = new Command().name("react-doctor").description("Diagnose React codebase health").version(VERSION, "-v, --version", "display the version number").argument("[
|
|
3531
|
-
program.action(async (
|
|
3532
|
-
const { runScanCommand } = await import("./scan-
|
|
3558
|
+
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), 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);
|
|
3559
|
+
program.action(async (positionalPaths = [], flags) => {
|
|
3560
|
+
const { runScanCommand } = await import("./scan-CEvjogRY.js");
|
|
3533
3561
|
return runScanCommand({
|
|
3534
|
-
|
|
3562
|
+
...resolvePositionalScanInput(positionalPaths),
|
|
3535
3563
|
flags,
|
|
3536
3564
|
invocationCommand: "inspect"
|
|
3537
3565
|
});
|
|
3538
3566
|
});
|
|
3539
3567
|
program.command("design [directory]").description("Run only the focused UI design diagnostics").addHelpText("after", renderDesignHelpEpilog).action(async (directory, _options, command) => {
|
|
3540
|
-
const { designAction } = await import("./design-
|
|
3568
|
+
const { designAction } = await import("./design-BlxQroSp.js");
|
|
3541
3569
|
return designAction(directory ?? ".", command.optsWithGlobals());
|
|
3542
3570
|
});
|
|
3543
3571
|
program.command("scan").description("Scan a React interaction in Chrome until you press Enter").argument("[url]", "HTTP(S) URL of the running React app; detects local apps when omitted").option("-f, --format <format>", "report format: text, json, or jsonl", "text").option("--cdp <url>", "reuse Chrome at this remote-debugging endpoint").option("--trace-out <path>", "save the compressed .json.gz DevTools trace at this path").addHelpText("after", renderRuntimeScanHelpEpilog).action(async (url, options) => {
|
|
3544
|
-
const { runtimeScanAction } = await import("./runtime-scan-
|
|
3572
|
+
const { runtimeScanAction } = await import("./runtime-scan-DINB89wl.js");
|
|
3545
3573
|
return runtimeScanAction(url, options);
|
|
3546
3574
|
});
|
|
3547
3575
|
program.command("why <location>").description("Explain why a rule fired (or why a suppression didn't apply) at a file:line").option("--project <name>", "select projects: workspace names or directory paths (comma-separated for multiple)").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (location, options) => {
|
|
3548
|
-
const { whyAction } = await import("./why-
|
|
3576
|
+
const { whyAction } = await import("./why-BqR3fLtE.js");
|
|
3549
3577
|
return whyAction(location, options);
|
|
3550
3578
|
});
|
|
3551
3579
|
program.command("install").alias("setup").description("Install the react-doctor skill into your coding agents and optional git hook").option("-y, --yes", "skip prompts, install for all detected agents").option("--dry-run", "show what would be installed without writing files").option("--agent-hooks", "install end-of-turn agent hooks for Claude Code and Cursor").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderInstallHelpEpilog).action(async (options, command) => {
|
|
3552
|
-
const { installAction } = await import("./install-
|
|
3580
|
+
const { installAction } = await import("./install-DeWeUjqr.js");
|
|
3553
3581
|
return installAction(options, command);
|
|
3554
3582
|
});
|
|
3555
3583
|
const providerOption = ["--provider <name>", "ci provider: github-actions or gitlab-ci (auto-detected by default)"];
|
|
3556
3584
|
const prOption = ["--pr", "open a pull request with the change instead of writing it to the working tree"];
|
|
3557
3585
|
const ci = program.command("ci").description("Set up, upgrade, and configure React Doctor in your CI");
|
|
3558
3586
|
ci.command("install").description("Add a CI workflow that scans every pull request").option(...providerOption).option(...prOption).option("--blocking <level>", "gate level: none (advisory, default), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed (default), files, lines, full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; use the defaults").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addHelpText("after", renderCiHelpEpilog).action(async (_options, command) => {
|
|
3559
|
-
const { ciInstallAction } = await import("./ci-
|
|
3587
|
+
const { ciInstallAction } = await import("./ci-DZ9QnUV4.js");
|
|
3560
3588
|
return ciInstallAction(command.optsWithGlobals());
|
|
3561
3589
|
});
|
|
3562
3590
|
ci.command("config").description("Change the gate, scan scope, and pull-request reporting").option(...providerOption).option("--blocking <level>", "gate level: none (advisory), warning, or error").option("--scope <value>", "what a pull-request scan reports: changed, files, lines, or full").option("--comment", "post a summary comment on each pull request").option("--no-comment", "don't post a summary comment").option("--review-comments", "add inline review comments on changed lines").option("--no-review-comments", "don't add inline review comments").option("--commit-status", "report a commit status with the health score").option("--no-commit-status", "don't report a commit status").option("-y, --yes", "skip prompts; print the current settings").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3563
|
-
const { ciConfigAction } = await import("./ci-
|
|
3591
|
+
const { ciConfigAction } = await import("./ci-DZ9QnUV4.js");
|
|
3564
3592
|
return ciConfigAction(command.optsWithGlobals());
|
|
3565
3593
|
});
|
|
3566
3594
|
ci.command("upgrade").description("Upgrade the CI workflow to the action's current major").option(...providerOption).option(...prOption).option("-y, --yes", "skip prompts").option("-c, --cwd <cwd>", "working directory", process.cwd()).option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async (_options, command) => {
|
|
3567
|
-
const { ciUpgradeAction } = await import("./ci-
|
|
3595
|
+
const { ciUpgradeAction } = await import("./ci-DZ9QnUV4.js");
|
|
3568
3596
|
return ciUpgradeAction(command.optsWithGlobals());
|
|
3569
3597
|
});
|
|
3570
3598
|
program.command("version").description("show the version with Node and platform info").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").action(async () => {
|
|
3571
|
-
const { versionAction } = await import("./version-
|
|
3599
|
+
const { versionAction } = await import("./version-DVa-lN1C.js");
|
|
3572
3600
|
return versionAction();
|
|
3573
3601
|
});
|
|
3574
3602
|
const rules = program.command("rules").description("List, explain, and configure which React Doctor rules run");
|
|
3575
3603
|
rules.command("list").description("List rules and the severity they run at under your config").option("--category <name>", "only show rules in a category (e.g. Performance)").option("--tag <name>", "only show rules with a tag (e.g. design, test-noise)").option("--framework <name>", "only show rules for a framework (e.g. global, nextjs)").option("--configured", "only show rules your config has changed from the default").option("--json", "output a structured JSON array").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (_options, command) => {
|
|
3576
|
-
const { rulesListAction } = await import("./rules-
|
|
3604
|
+
const { rulesListAction } = await import("./rules-DizN5gJ6.js");
|
|
3577
3605
|
return rulesListAction(command.optsWithGlobals());
|
|
3578
3606
|
});
|
|
3579
3607
|
rules.command("explain <rule>").description("Explain why a rule matters, its current severity, and how to configure it").option("--json", "output a structured JSON object").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3580
|
-
const { rulesExplainAction } = await import("./rules-
|
|
3608
|
+
const { rulesExplainAction } = await import("./rules-DizN5gJ6.js");
|
|
3581
3609
|
return rulesExplainAction(rule, command.optsWithGlobals());
|
|
3582
3610
|
});
|
|
3583
3611
|
rules.command("set <rule> <severity>").description("Set a rule's severity: off, warn, or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, severity, _options, command) => {
|
|
3584
|
-
const { rulesSetAction } = await import("./rules-
|
|
3612
|
+
const { rulesSetAction } = await import("./rules-DizN5gJ6.js");
|
|
3585
3613
|
return rulesSetAction(rule, severity, command.optsWithGlobals());
|
|
3586
3614
|
});
|
|
3587
3615
|
rules.command("enable <rule>").description("Enable a rule at its recommended severity (or pass --severity)").option("--severity <level>", "severity to enable at: warn or error").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3588
|
-
const { rulesEnableAction } = await import("./rules-
|
|
3616
|
+
const { rulesEnableAction } = await import("./rules-DizN5gJ6.js");
|
|
3589
3617
|
return rulesEnableAction(rule, command.optsWithGlobals());
|
|
3590
3618
|
});
|
|
3591
3619
|
rules.command("disable <rule>").description("Disable a rule so it never runs").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (rule, _options, command) => {
|
|
3592
|
-
const { rulesDisableAction } = await import("./rules-
|
|
3620
|
+
const { rulesDisableAction } = await import("./rules-DizN5gJ6.js");
|
|
3593
3621
|
return rulesDisableAction(rule, command.optsWithGlobals());
|
|
3594
3622
|
});
|
|
3595
3623
|
rules.command("category <category> <severity>").description("Set the severity for a whole category (off, warn, error)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (category, severity, _options, command) => {
|
|
3596
|
-
const { rulesCategoryAction } = await import("./rules-
|
|
3624
|
+
const { rulesCategoryAction } = await import("./rules-DizN5gJ6.js");
|
|
3597
3625
|
return rulesCategoryAction(category, severity, command.optsWithGlobals());
|
|
3598
3626
|
});
|
|
3599
3627
|
rules.command("ignore-tag <tag>").description("Skip a whole rule family by tag before linting (e.g. design)").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3600
|
-
const { rulesIgnoreTagAction } = await import("./rules-
|
|
3628
|
+
const { rulesIgnoreTagAction } = await import("./rules-DizN5gJ6.js");
|
|
3601
3629
|
return rulesIgnoreTagAction(tag, command.optsWithGlobals());
|
|
3602
3630
|
});
|
|
3603
3631
|
rules.command("unignore-tag <tag>").description("Stop ignoring a tag previously skipped via ignore-tag").option("-c, --cwd <cwd>", "working directory", process.cwd()).action(async (tag, _options, command) => {
|
|
3604
|
-
const { rulesUnignoreTagAction } = await import("./rules-
|
|
3632
|
+
const { rulesUnignoreTagAction } = await import("./rules-DizN5gJ6.js");
|
|
3605
3633
|
return rulesUnignoreTagAction(tag, command.optsWithGlobals());
|
|
3606
3634
|
});
|
|
3607
3635
|
program.command("experimental-tui [directory]", { hidden: true }).description("[experimental] interactive, scrollable scan report").option("--blocking <level>", "severity that fails CI: error (default), warning, or none (advisory)").option("--color", "force colored output").option("--no-color", "disable colored output (also honors NO_COLOR)").addOption(new Option("--no-dead-code").hideHelp()).option("--no-supply-chain", "skip the dependency supply-chain scan").option("--score", "only print the numeric score (for scripts and CI)").option("--no-score", "skip the score API, the share URL, and crash reporting").option("--no-cache", "disable all scan caches for this run").option("--max-duration <seconds>", MAX_DURATION_OPTION_DESCRIPTION).option("-p, --project <names>", "scan specific workspace projects (comma-separated, or *)").option("-y, --yes", "skip the project prompt and scan every discovered project").action(async (directory = ".", _localOptions, command) => {
|
|
3608
|
-
const { runScanCommand } = await import("./scan-
|
|
3636
|
+
const { runScanCommand } = await import("./scan-CEvjogRY.js");
|
|
3609
3637
|
return runScanCommand({
|
|
3610
3638
|
directory,
|
|
3611
3639
|
flags: command.optsWithGlobals(),
|
|
@@ -3635,7 +3663,8 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
3635
3663
|
process.exit(1);
|
|
3636
3664
|
}
|
|
3637
3665
|
if (isUserError) {
|
|
3638
|
-
handleUserError(error);
|
|
3666
|
+
handleUserError(error, { shouldExit: false });
|
|
3667
|
+
await Promise.all([flushSentry(), shutdownTelemetry()]);
|
|
3639
3668
|
return;
|
|
3640
3669
|
}
|
|
3641
3670
|
handleError(error, { sentryEventId });
|
|
@@ -3644,4 +3673,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
3644
3673
|
export {};
|
|
3645
3674
|
|
|
3646
3675
|
//# sourceMappingURL=cli.js.map
|
|
3647
|
-
//# debugId=
|
|
3676
|
+
//# debugId=2db05473-003e-52a5-853a-90e4f4f5ac96
|
|
@@ -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]="e5b2a29d-21de-5730-a0a0-10dd8d756a97")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-Dd1qqPJf.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-BlxQroSp.js.map
|
|
14
|
+
//# debugId=e5b2a29d-21de-5730-a0a0-10dd8d756a97
|
|
@@ -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]="f1b960af-e618-536f-ba25-06c7416b43b4")}catch(e){}}();
|
|
3
3
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
4
|
//#region ../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js
|
|
5
5
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -16999,5 +16999,5 @@ if (await isDevToolsReachable()) {
|
|
|
16999
16999
|
//#endregion
|
|
17000
17000
|
export {};
|
|
17001
17001
|
|
|
17002
|
-
//# sourceMappingURL=devtools-
|
|
17003
|
-
//# debugId=
|
|
17002
|
+
//# sourceMappingURL=devtools-CC2PAZ85.js.map
|
|
17003
|
+
//# debugId=f1b960af-e618-536f-ba25-06c7416b43b4
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-
|
|
4
|
-
import { n as shutdownTelemetry } from "./telemetry-runtime-
|
|
5
|
-
import { n as buildFooterLinkLines, r as flushSentry, t as buildSectionDivider } from "./build-section-divider-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="255bcd10-efa4-5f94-b403-6c4baf957433")}catch(e){}}();
|
|
3
|
+
import { d as isJsonModeActive, m as writeJsonCancellationReport } from "./record-metric-BzGcVSov.js";
|
|
4
|
+
import { n as shutdownTelemetry } from "./telemetry-runtime-Bs7DsGaF.js";
|
|
5
|
+
import { n as buildFooterLinkLines, r as flushSentry, t as buildSectionDivider } from "./build-section-divider-DGcPvzjX.js";
|
|
6
6
|
import { t as activeScanAbortRegistry } from "./active-scan-abort-registry-DwG6tSPy.js";
|
|
7
7
|
//#region src/cli/utils/active-tui-renderer.ts
|
|
8
8
|
let activeTuiRenderer = null;
|
|
@@ -50,5 +50,5 @@ const exitGracefully = () => {
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { registerActiveTuiRenderer as n, exitGracefully as t };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=exit-gracefully-
|
|
54
|
-
//# debugId=
|
|
53
|
+
//# sourceMappingURL=exit-gracefully-Dt1ix6Xh.js.map
|
|
54
|
+
//# debugId=255bcd10-efa4-5f94-b403-6c4baf957433
|
|
@@ -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]="db817079-8f8f-50ee-bae1-5d0182c74255")}catch(e){}}();
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import tty from "node:tty";
|
|
@@ -440,5 +440,5 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
440
440
|
//#endregion
|
|
441
441
|
export { chalk as a, stripAnsi as i, isFullWidth as n, isWide as r, eastAsianWidth as t };
|
|
442
442
|
|
|
443
|
-
//# sourceMappingURL=get-east-asian-width-
|
|
444
|
-
//# debugId=
|
|
443
|
+
//# sourceMappingURL=get-east-asian-width-Bv2TD3Xj.js.map
|
|
444
|
+
//# debugId=db817079-8f8f-50ee-bae1-5d0182c74255
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { $n as CANONICAL_DISCORD_URL, An as gen, Cn as error, Ft as formatErrorChain, It as formatReactDoctorError, Kt as highlighter, T as METRIC, Xt as isReactDoctorError, _ as VERSION, br as isErrnoException, er as CANONICAL_GITHUB_URL, t as recordCount, zn as runSync } from "./record-metric-
|
|
4
|
-
import { a as
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="14074aaa-abab-54cc-8b60-b3d0d233a05b")}catch(e){}}();
|
|
3
|
+
import { $n as CANONICAL_DISCORD_URL, An as gen, Cn as error, Ft as formatErrorChain, It as formatReactDoctorError, Kt as highlighter, T as METRIC, Xt as isReactDoctorError, _ as VERSION, br as isErrnoException, er as CANONICAL_GITHUB_URL, t as recordCount, zn as runSync } from "./record-metric-BzGcVSov.js";
|
|
4
|
+
import { a as isNpmCacheCorruptionError, i as formatNpmCacheCorruptionError, o as formatEnvironmentError, s as isEnvironmentError } from "./telemetry-runtime-Bs7DsGaF.js";
|
|
5
5
|
//#region src/cli/utils/handle-error.ts
|
|
6
6
|
const OTLP_ENDPOINT_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_ENDPOINT";
|
|
7
7
|
const OTLP_AUTH_HEADER_ENVIRONMENT_VARIABLE = "REACT_DOCTOR_OTLP_AUTH_HEADER";
|
|
@@ -85,15 +85,20 @@ const handleError = (error, options = {}) => {
|
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* Renderer for expected, user-actionable failures — a bad `--diff` value,
|
|
88
|
-
* a base branch that isn't fetched,
|
|
89
|
-
* permission-denied. Prints just the (already
|
|
90
|
-
* "Something went wrong", prefilled issue,
|
|
91
|
-
* — because there is no bug to report.
|
|
88
|
+
* a base branch that isn't fetched, environment errors like disk-full or
|
|
89
|
+
* permission-denied, or npm cache corruption. Prints just the (already
|
|
90
|
+
* human-readable) message — no "Something went wrong", prefilled issue,
|
|
91
|
+
* Discord link, or Sentry reference — because there is no bug to report.
|
|
92
92
|
*/
|
|
93
93
|
const handleUserError = (error$1, options = {}) => {
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
|
|
94
|
+
let message = formatErrorForReport(error$1);
|
|
95
|
+
if (isNpmCacheCorruptionError(error$1)) {
|
|
96
|
+
recordCount(METRIC.cliEnvironmentError, 1, { code: "NPX_CACHE_CORRUPTION" });
|
|
97
|
+
message = formatNpmCacheCorruptionError(error$1);
|
|
98
|
+
} else if (isEnvironmentError(error$1)) {
|
|
99
|
+
recordCount(METRIC.cliEnvironmentError, 1, { code: (isErrnoException(error$1) ? error$1.code : void 0) ?? "unknown" });
|
|
100
|
+
message = formatEnvironmentError(error$1);
|
|
101
|
+
}
|
|
97
102
|
runSync(gen(function* () {
|
|
98
103
|
yield* error("");
|
|
99
104
|
yield* error(highlighter.error(message));
|
|
@@ -105,5 +110,5 @@ const handleUserError = (error$1, options = {}) => {
|
|
|
105
110
|
//#endregion
|
|
106
111
|
export { handleUserError as n, handleError as t };
|
|
107
112
|
|
|
108
|
-
//# sourceMappingURL=handle-error-
|
|
109
|
-
//# debugId=
|
|
113
|
+
//# sourceMappingURL=handle-error-Cslt8b7C.js.map
|
|
114
|
+
//# debugId=14074aaa-abab-54cc-8b60-b3d0d233a05b
|