react-doctor 0.9.12-dev.ffc2d14 → 0.9.13-dev.d030b11
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 +33 -0
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-BuOtLrzK.js → build-section-divider-Dhl7C8kp.js} +8 -22
- package/dist/{ci-DVVsf25h.js → ci-CPJtbXo4.js} +12 -11
- package/dist/cli.js +116 -35
- package/dist/{design-Y1pcA2uj.js → design-CI6oM-NB.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-CC2PAZ85.js} +3 -3
- package/dist/{exit-gracefully-DnXGONjj.js → exit-gracefully-Zhbpfy2i.js} +15 -9
- package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
- package/dist/{report-error-MGKyeIns.js → handle-error-LYTGcmFr.js} +18 -68
- package/dist/index.d.ts +32 -0
- package/dist/index.js +593 -286
- package/dist/{inspect-g3_lzs3l.js → inspect-BZ-i49rK.js} +38 -28
- package/dist/{install-02Lq6wKC.js → install-Cf-tjrbB.js} +9 -8
- package/dist/{install-doctor-script-DmEWQpVJ.js → install-doctor-script-BGdm_niA.js} +7 -449
- package/dist/{install-github-workflow-Dx6Pl9Wl.js → install-github-workflow-CwcDLQCy.js} +10 -6
- package/dist/{install-react-doctor-CMCXgenA.js → install-react-doctor-DcJ90NzQ.js} +8 -8
- package/dist/{run-scan-app-CDDu7P32.js → jsx-runtime-Cq-_Fvkx.js} +280 -2774
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-kbvWYuGv.js → print-branded-header-DM0JRJnn.js} +4 -4
- package/dist/project-analysis-worker.js +59 -54
- package/dist/prompt-runtime-scan-url-BpHApg0d.js +240 -0
- package/dist/{read-object-file-Cwhr9OIi.js → read-object-file-DMUSluLA.js} +4 -4
- package/dist/{record-metric-CFfsgcVs.js → record-metric-BRc98SXW.js} +556 -235
- package/dist/report-error-BpWTkd5U.js +64 -0
- package/dist/{report-workflow-result-DGg9xopH.js → report-workflow-result-DXSpYstq.js} +5 -5
- package/dist/{resolve-scope-CXS-5jLR.js → resolve-scope-CJXv5ePP.js} +8 -10
- package/dist/{rules-CThlosPx.js → rules-CZk5ywQe.js} +6 -6
- package/dist/run-scan-app-BtY0jXpd.js +2511 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-iztAEKV3.js +770 -0
- package/dist/sanitize-runtime-url-DbrHDuC1.js +76 -0
- package/dist/scan-GPvogJT-.js +47 -0
- package/dist/{should-fail-scan-gate-C0Bo5Gqy.js → should-fail-scan-gate-Uk7rJiMQ.js} +20 -112
- package/dist/{should-skip-prompts-BqrtVX4G.js → should-skip-prompts-DzpvkZcL.js} +4 -4
- package/dist/should-use-tui-CH5oI2Vu.js +25 -0
- package/dist/skills/improve-threejs/SKILL.md +102 -0
- package/dist/skills/performance/SKILL.md +113 -0
- package/dist/skills/react-doctor/SKILL.md +6 -0
- package/dist/{unref-stdin-BxyvqsOy.js → telemetry-runtime-hAsPFFEx.js} +55 -25
- package/dist/unref-stdin-SK3WfwxS.js +12 -0
- package/dist/{version-S-8vvWFi.js → version-BiWDQQgs.js} +4 -4
- package/dist/{why-DXfx0oL9.js → why-B8sLOroq.js} +4 -4
- package/dist/with-run-span-BWmpgEhA.js +110 -0
- package/package.json +9 -6
- package/dist/scan-4I1mvxBO.js +0 -53
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { a as
|
|
14
|
-
import {
|
|
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]="d1ba2641-218a-5071-809f-2d83edf67d93")}catch(e){}}();
|
|
3
|
+
import { An as gen, At as discoverSupportedSubprojects, Bt as getDiffInfo, Cr as messageFromUnknown, F as STAGED_FILES_TEMP_DIR_PREFIX, Fn as provide$1, Gn as provide, H as isDebugFlagEnabled, I as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, Jt as isPathInsideDirectory, K as isCiOrCodingAgentEnvironment, Kt as highlighter, Lt as getBaselineDiffPlan, Pt as findLegacyConfig, Rn as runPromise, Rt as getChangedLineRanges, Sr as isPlainObject, T as METRIC, Wt as hasSupportedFrameworkOrLibrary, X as Git, _ as VERSION, _r as STAGED_FILES_PROJECT_CONFIG_FILENAMES, br as isErrnoException, er as CANONICAL_GITHUB_URL, f as setJsonReportDirectory, fn as resolveScanTarget, g as writeJsonReport, h as writeJsonErrorReport, ht as buildJsonReport, in as mapWithConcurrency, kt as detectAiTrainingEnvironment, n as recordDistribution, nn as listWorkspacePackages, p as setJsonReportMode, q as isCodingAgentEnvironment, sn as remainingDeadlineBudgetMs, t as recordCount, u as enableJsonMode, ut as StagedFiles, yn as toRelativePath, z as CliInputError } from "./record-metric-BRc98SXW.js";
|
|
4
|
+
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-hAsPFFEx.js";
|
|
5
|
+
import { r as flushSentry } from "./build-section-divider-Dhl7C8kp.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-LYTGcmFr.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-BpWTkd5U.js";
|
|
8
|
+
import { t as toForwardSlashes } from "./path-format-DnHpmJwG.js";
|
|
9
|
+
import { A as runGitRaw, M as cliLogger, c as spinner, i as hasDoctorScript, n as findNearestPackageDirectory, o as isSpinnerSilent, s as setSpinnerSilent } from "./install-doctor-script-BGdm_niA.js";
|
|
10
|
+
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-CwcDLQCy.js";
|
|
11
|
+
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-CJXv5ePP.js";
|
|
12
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-DzpvkZcL.js";
|
|
13
|
+
import { A as inspect, B as filterDiagnosticsByCategories, C as CLI_AGENT_BINARIES, D as collectProjectSourceFileCounts, E as buildHandoffPayload, H as buildEmptyReportMessage, L as printDiagnosticsDump, M as printHeadlessReport, O as deduplicateProjectScans, S as detectLaunchableAgents, T as launchCliAgent, _ as resolveWorkspaceDeadCodeOwner, a as validateModeFlags, b as countUniqueScannedFiles, d as resolveProjectScan, f as resolveProjectChangedLineRanges, g as retryMissingProjectScores, h as resolveProjectRelativeDirectory, i as validateIncludeUntrackedScope, j as resolveMergeBaseRef, k as createInvocationInspect, l as selectProjects, m as resolveProjectSourceFilePaths, n as formatSkippedProjectsMessage, o as projectManifestChanged, p as resolveProjectDiffIncludePaths, s as partitionProjectScanOutcomes, t as shouldFailScanGate, u as buildCodeFrame, v as resolveCliInspectOptions, w as copyToClipboard, x as setUpGitHubActions, y as filterScansForSurface } from "./should-fail-scan-gate-Uk7rJiMQ.js";
|
|
14
|
+
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-DXSpYstq.js";
|
|
15
|
+
import { a as askUpgradeActionVersion, c as recordCiPromptDecision, i as installReactDoctorAgentHooks, l as hasHandledActionUpgrade, o as askAddToGitHubActions, r as findAgentsWithOutdatedReactDoctorHooks, s as hasHandledCiPrompt, t as getSkillSourceDirectory, u as recordActionUpgradeDecision } from "./install-react-doctor-DcJ90NzQ.js";
|
|
16
|
+
import { t as readObjectFile } from "./read-object-file-DMUSluLA.js";
|
|
15
17
|
import * as path$1 from "node:path";
|
|
16
18
|
import * as fs$1 from "node:fs";
|
|
17
19
|
import { tmpdir } from "node:os";
|
|
@@ -1093,11 +1095,11 @@ const runStagedInspect = async (input) => {
|
|
|
1093
1095
|
};
|
|
1094
1096
|
//#endregion
|
|
1095
1097
|
//#region src/cli/commands/inspect.ts
|
|
1096
|
-
const
|
|
1098
|
+
const buildFileSelectionDiffInfo = (filePaths) => ({
|
|
1097
1099
|
currentBranch: process.env.GITHUB_HEAD_REF?.trim() || null,
|
|
1098
1100
|
baseBranch: process.env.GITHUB_BASE_REF?.trim() || "pull request target",
|
|
1099
1101
|
baseSha: process.env.REACT_DOCTOR_BASE_SHA?.trim() || void 0,
|
|
1100
|
-
changedFiles,
|
|
1102
|
+
changedFiles: [...filePaths],
|
|
1101
1103
|
isCurrentChanges: false
|
|
1102
1104
|
});
|
|
1103
1105
|
const hasScanDeadlineExpired = (scanDeadlineEpochMs) => scanDeadlineEpochMs !== void 0 && remainingDeadlineBudgetMs(scanDeadlineEpochMs) === 0;
|
|
@@ -1184,7 +1186,7 @@ const maybeMigrateLegacyConfig = async (requestedDirectory, { isQuiet, isStaged
|
|
|
1184
1186
|
if (!(!isQuiet && !isStaged && process.stdout.isTTY === true && !isCiOrCodingAgentEnvironment())) return;
|
|
1185
1187
|
await runProjectMigrations(requestedDirectory);
|
|
1186
1188
|
};
|
|
1187
|
-
const inspectAction = async (directory, flags, invocationCommand = "inspect") => {
|
|
1189
|
+
const inspectAction = async (directory, flags, invocationCommand = "inspect", selectedFilePaths) => {
|
|
1188
1190
|
const isScoreOnly = Boolean(flags.score);
|
|
1189
1191
|
const isJsonMode = Boolean(flags.json);
|
|
1190
1192
|
const isQuiet = isScoreOnly || isJsonMode;
|
|
@@ -1261,14 +1263,15 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1261
1263
|
}
|
|
1262
1264
|
const projectDirectories = await selectProjects(resolvedDirectory, flags.project, skipPrompts, userConfig?.projects);
|
|
1263
1265
|
const projectSelectionCompletedTime = performance.now();
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
+
const hasPositionalFileSelection = selectedFilePaths !== void 0;
|
|
1267
|
+
let providedFilesDiffInfo = hasPositionalFileSelection ? buildFileSelectionDiffInfo(selectedFilePaths) : flags.changedFilesFrom ? buildFileSelectionDiffInfo(readChangedFilesFrom(path$1.resolve(flags.changedFilesFrom))) : null;
|
|
1268
|
+
if (providedFilesDiffInfo !== null && requestedDirectory !== resolvedDirectory) {
|
|
1266
1269
|
const relativeProjectDirectory = resolveProjectRelativeDirectory(requestedDirectory, resolvedDirectory);
|
|
1267
1270
|
if (relativeProjectDirectory) {
|
|
1268
1271
|
const projectPrefix = `${relativeProjectDirectory}/`;
|
|
1269
|
-
|
|
1270
|
-
...
|
|
1271
|
-
changedFiles:
|
|
1272
|
+
providedFilesDiffInfo = {
|
|
1273
|
+
...providedFilesDiffInfo,
|
|
1274
|
+
changedFiles: providedFilesDiffInfo.changedFiles.flatMap((filePath) => {
|
|
1272
1275
|
return filePath.startsWith(projectPrefix) ? [filePath.slice(projectPrefix.length)] : [];
|
|
1273
1276
|
})
|
|
1274
1277
|
};
|
|
@@ -1276,7 +1279,11 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1276
1279
|
}
|
|
1277
1280
|
const requestedScope = resolveScope(flags, userConfig);
|
|
1278
1281
|
const includeUntracked = flags.includeUntracked ?? false;
|
|
1279
|
-
const scopeRequest =
|
|
1282
|
+
const scopeRequest = hasPositionalFileSelection ? {
|
|
1283
|
+
scope: "files",
|
|
1284
|
+
base: void 0,
|
|
1285
|
+
usedDeprecatedDiff: false
|
|
1286
|
+
} : requestedScope.scope === void 0 && providedFilesDiffInfo !== null ? {
|
|
1280
1287
|
...requestedScope,
|
|
1281
1288
|
scope: "changed"
|
|
1282
1289
|
} : requestedScope;
|
|
@@ -1284,8 +1291,8 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1284
1291
|
scanStartupSpinner = !isQuiet ? spinner("Scanning...").start() : null;
|
|
1285
1292
|
if (scanStartupSpinner !== null) recordDistribution(METRIC.scanFeedbackDelay, performance.now() - projectSelectionCompletedTime, { unit: "millisecond" });
|
|
1286
1293
|
const wantsDiffMode = scopeRequest.scope !== void 0 && scopeRequest.scope !== "full";
|
|
1287
|
-
const shouldDetectDiff =
|
|
1288
|
-
const diffInfo =
|
|
1294
|
+
const shouldDetectDiff = providedFilesDiffInfo === null && (wantsDiffMode || scopeRequest.scope === void 0 && !skipPrompts && !isQuiet);
|
|
1295
|
+
const diffInfo = providedFilesDiffInfo ?? (shouldDetectDiff ? await getDiffInfo(resolvedDirectory, scopeRequest.base, includeUntracked) : null);
|
|
1289
1296
|
scanStartupSpinner?.stop();
|
|
1290
1297
|
scanStartupSpinner = null;
|
|
1291
1298
|
const scope = await finalizeScope({
|
|
@@ -1296,7 +1303,7 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1296
1303
|
});
|
|
1297
1304
|
scanStartupSpinner = !isQuiet ? spinner("Scanning...").start() : null;
|
|
1298
1305
|
const isDiffMode = scope !== "full";
|
|
1299
|
-
const comparisonBaseRef = isDiffMode && diffInfo && !diffInfo.isCurrentChanges ? diffInfo.baseSha ? await resolveMergeBaseRef(resolvedDirectory, diffInfo.baseSha) : diffInfo.diffBaseRef ?? await resolveMergeBaseRef(resolvedDirectory, diffInfo.baseBranch) : null;
|
|
1306
|
+
const comparisonBaseRef = isDiffMode && diffInfo && !diffInfo.isCurrentChanges && !hasPositionalFileSelection ? diffInfo.baseSha ? await resolveMergeBaseRef(resolvedDirectory, diffInfo.baseSha) : diffInfo.diffBaseRef ?? await resolveMergeBaseRef(resolvedDirectory, diffInfo.baseBranch) : null;
|
|
1300
1307
|
const baselineRef = scope === "changed" ? comparisonBaseRef : null;
|
|
1301
1308
|
const baselineDiffPlan = baselineRef === null ? null : await getBaselineDiffPlan(resolvedDirectory, baselineRef);
|
|
1302
1309
|
const linesBaseRef = diffInfo?.isCurrentChanges ? "HEAD" : comparisonBaseRef;
|
|
@@ -1314,7 +1321,10 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1314
1321
|
}
|
|
1315
1322
|
setJsonReportMode(baselineRef ? "baseline" : isDiffMode ? "diff" : "full");
|
|
1316
1323
|
if (isDiffMode && diffInfo && !isQuiet) {
|
|
1317
|
-
if (
|
|
1324
|
+
if (hasPositionalFileSelection) {
|
|
1325
|
+
const fileLabel = diffInfo.changedFiles.length === 1 ? "file" : "files";
|
|
1326
|
+
cliLogger.log(`Scanning ${diffInfo.changedFiles.length} selected ${fileLabel}`);
|
|
1327
|
+
} else if (diffInfo.isCurrentChanges) cliLogger.log("Scanning uncommitted changes");
|
|
1318
1328
|
else {
|
|
1319
1329
|
const currentBranchLabel = diffInfo.currentBranch ?? "(detached HEAD)";
|
|
1320
1330
|
cliLogger.log(`Scanning changes: ${highlighter.info(currentBranchLabel)} → ${highlighter.info(diffInfo.baseBranch)}`);
|
|
@@ -1440,5 +1450,5 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1440
1450
|
//#endregion
|
|
1441
1451
|
export { warnDeprecatedFailOn as n, runProjectMigrations as r, inspectAction as t };
|
|
1442
1452
|
|
|
1443
|
-
//# sourceMappingURL=inspect-
|
|
1444
|
-
//# debugId=
|
|
1453
|
+
//# sourceMappingURL=inspect-BZ-i49rK.js.map
|
|
1454
|
+
//# debugId=d1ba2641-218a-5071-809f-2d83edf67d93
|
|
@@ -1,10 +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]="
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
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]="e07e826a-d813-515a-8538-8152231ef87c")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, t as recordCount, zn as runSync } from "./record-metric-BRc98SXW.js";
|
|
4
|
+
import { r as isExpectedUserError } from "./telemetry-runtime-hAsPFFEx.js";
|
|
5
|
+
import { n as handleUserError, t as handleError } from "./handle-error-LYTGcmFr.js";
|
|
6
|
+
import { t as reportErrorToSentry } from "./report-error-BpWTkd5U.js";
|
|
7
|
+
import { t as printBrandedHeader } from "./print-branded-header-DM0JRJnn.js";
|
|
8
|
+
import { n as runInstallReactDoctor } from "./install-react-doctor-DcJ90NzQ.js";
|
|
8
9
|
//#region src/cli/commands/install.ts
|
|
9
10
|
const installAction = async (options, command) => {
|
|
10
11
|
recordCount(METRIC.cliInvoked, 1, { command: "install" });
|
|
@@ -28,5 +29,5 @@ const installAction = async (options, command) => {
|
|
|
28
29
|
//#endregion
|
|
29
30
|
export { installAction };
|
|
30
31
|
|
|
31
|
-
//# sourceMappingURL=install-
|
|
32
|
-
//# debugId=
|
|
32
|
+
//# sourceMappingURL=install-Cf-tjrbB.js.map
|
|
33
|
+
//# debugId=e07e826a-d813-515a-8538-8152231ef87c
|