react-doctor 0.9.12-dev.ffc2d14 → 0.9.13-dev.1239043
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-C09RcJrc.js} +8 -22
- package/dist/{ci-DVVsf25h.js → ci-CUgNjCr-.js} +12 -11
- package/dist/cli.js +116 -35
- package/dist/{design-Y1pcA2uj.js → design-CX2j8ubS.js} +4 -4
- package/dist/{devtools-D8NTVj81.js → devtools-CC2PAZ85.js} +3 -3
- package/dist/{exit-gracefully-DnXGONjj.js → exit-gracefully-cGJM2g3O.js} +15 -9
- package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
- package/dist/{report-error-MGKyeIns.js → handle-error-BCI-Nv3P.js} +18 -68
- package/dist/index.d.ts +32 -0
- package/dist/index.js +628 -301
- package/dist/{inspect-g3_lzs3l.js → inspect-Dq5krKWG.js} +41 -29
- package/dist/{install-02Lq6wKC.js → install-C0aiZKgf.js} +9 -8
- package/dist/{install-doctor-script-DmEWQpVJ.js → install-doctor-script-CaTIms0r.js} +7 -449
- package/dist/{install-github-workflow-Dx6Pl9Wl.js → install-github-workflow-DjPgXVqg.js} +10 -6
- package/dist/{install-react-doctor-CMCXgenA.js → install-react-doctor-C-PVDWXv.js} +8 -8
- package/dist/{run-scan-app-CDDu7P32.js → jsx-runtime-D_A4d39v.js} +280 -2774
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-kbvWYuGv.js → print-branded-header-Dz0SwyHQ.js} +4 -4
- package/dist/project-analysis-worker.js +59 -54
- package/dist/prompt-runtime-scan-url-BXdY2Opw.js +240 -0
- package/dist/{read-object-file-Cwhr9OIi.js → read-object-file-CmMGK1uu.js} +4 -4
- package/dist/{record-metric-CFfsgcVs.js → record-metric-B6T_Ej33.js} +592 -250
- package/dist/report-error-DwL3b99q.js +64 -0
- package/dist/{report-workflow-result-DGg9xopH.js → report-workflow-result-5PueDIAr.js} +5 -5
- package/dist/{resolve-scope-CXS-5jLR.js → resolve-scope-CTlLl7e6.js} +8 -10
- package/dist/{rules-CThlosPx.js → rules-DEbHKRag.js} +6 -6
- package/dist/run-scan-app-D3huvmXJ.js +2517 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-CHFAEYg3.js +770 -0
- package/dist/sanitize-runtime-url-Bbq40iIp.js +76 -0
- package/dist/scan-C7sCm7wi.js +47 -0
- package/dist/{should-fail-scan-gate-C0Bo5Gqy.js → should-fail-scan-gate-CfG_ppAV.js} +50 -117
- package/dist/{should-skip-prompts-BqrtVX4G.js → should-skip-prompts-BuNtAVEs.js} +4 -4
- package/dist/should-use-tui-B-lCjXVG.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-BF83aBFL.js} +55 -25
- package/dist/unref-stdin-SK3WfwxS.js +12 -0
- package/dist/{version-S-8vvWFi.js → version-C27gr4Qj.js} +4 -4
- package/dist/{why-DXfx0oL9.js → why-CYRkZ2VY.js} +4 -4
- package/dist/with-run-span-CdsXSJgE.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]="a848d2ef-3d8d-5de6-8dea-5b757aa38c3e")}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, 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-B6T_Ej33.js";
|
|
4
|
+
import { n as shutdownTelemetry, r as isExpectedUserError } from "./telemetry-runtime-BF83aBFL.js";
|
|
5
|
+
import { r as flushSentry } from "./build-section-divider-C09RcJrc.js";
|
|
6
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BCI-Nv3P.js";
|
|
7
|
+
import { t as reportErrorToSentry } from "./report-error-DwL3b99q.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-CaTIms0r.js";
|
|
10
|
+
import { a as readReactDoctorWorkflow, c as workflowUsesV1Action, i as isReactDoctorWorkflowInstalled, l as prompts, s as upgradeWorkflowActionToV2 } from "./install-github-workflow-DjPgXVqg.js";
|
|
11
|
+
import { c as openWorkflowPullRequest, i as warnDeprecatedDiff, l as stageWorkflowFile, r as resolveScope, s as resolveBlockingLevel, t as finalizeScope } from "./resolve-scope-CTlLl7e6.js";
|
|
12
|
+
import { t as shouldSkipPrompts } from "./should-skip-prompts-BuNtAVEs.js";
|
|
13
|
+
import { A as createInvocationInspect, C as detectLaunchableAgents, D as buildHandoffPayload, E as launchCliAgent, M as resolveMergeBaseRef, N as printHeadlessReport, O as collectProjectSourceFileCounts, R as printDiagnosticsDump, S as setUpGitHubActions, T as copyToClipboard, U as buildEmptyReportMessage, V as filterDiagnosticsByCategories, _ as retryMissingProjectScores, a as validateModeFlags, b as filterScansForSurface, c as partitionProjectScanOutcomes, d as buildCodeFrame, f as resolveProjectScan, g as resolveProjectRelativeDirectory, h as resolveProjectSourceFilePaths, i as validateIncludeUntrackedScope, j as inspect, k as deduplicateProjectScans, l as discoverWorkspacePackages, m as resolveProjectDiffIncludePaths, n as formatSkippedProjectsMessage, o as resolveExcludedProjectDirectories, p as resolveProjectChangedLineRanges, s as projectManifestChanged, t as shouldFailScanGate, u as selectProjects, v as resolveWorkspaceDeadCodeOwner, w as CLI_AGENT_BINARIES, x as countUniqueScannedFiles, y as resolveCliInspectOptions } from "./should-fail-scan-gate-CfG_ppAV.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-5PueDIAr.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-C-PVDWXv.js";
|
|
16
|
+
import { t as readObjectFile } from "./read-object-file-CmMGK1uu.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;
|
|
@@ -1114,7 +1116,7 @@ const buildProjectInspectOptions = ({ context, projectScan, projectScanPlan, own
|
|
|
1114
1116
|
configSourceDirectory: projectScan.configSourceDirectory ?? void 0,
|
|
1115
1117
|
suppressRendering: context.isMultiProject,
|
|
1116
1118
|
concurrentScan: context.isMultiProject,
|
|
1117
|
-
excludedProjectDirectories: context.projectScans.
|
|
1119
|
+
excludedProjectDirectories: resolveExcludedProjectDirectories(scanDirectory, [...context.projectScans.map((candidateProjectScan) => candidateProjectScan.directory), ...context.workspaceProjectDirectories]),
|
|
1118
1120
|
retainExcludedProjectDeadCodeDiagnostics: ownsWorkspaceDeadCode,
|
|
1119
1121
|
baseline: context.baselineRef !== null && projectScanPlan.projectBaselineBaseFiles !== null && projectScanPlan.projectBaselineHeadFiles !== null ? {
|
|
1120
1122
|
ref: context.baselineRef,
|
|
@@ -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;
|
|
@@ -1259,16 +1261,18 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1259
1261
|
});
|
|
1260
1262
|
return;
|
|
1261
1263
|
}
|
|
1264
|
+
const workspaceProjectDirectories = discoverWorkspacePackages(resolvedDirectory).map((workspacePackage) => workspacePackage.directory);
|
|
1262
1265
|
const projectDirectories = await selectProjects(resolvedDirectory, flags.project, skipPrompts, userConfig?.projects);
|
|
1263
1266
|
const projectSelectionCompletedTime = performance.now();
|
|
1264
|
-
|
|
1265
|
-
|
|
1267
|
+
const hasPositionalFileSelection = selectedFilePaths !== void 0;
|
|
1268
|
+
let providedFilesDiffInfo = hasPositionalFileSelection ? buildFileSelectionDiffInfo(selectedFilePaths) : flags.changedFilesFrom ? buildFileSelectionDiffInfo(readChangedFilesFrom(path$1.resolve(flags.changedFilesFrom))) : null;
|
|
1269
|
+
if (providedFilesDiffInfo !== null && requestedDirectory !== resolvedDirectory) {
|
|
1266
1270
|
const relativeProjectDirectory = resolveProjectRelativeDirectory(requestedDirectory, resolvedDirectory);
|
|
1267
1271
|
if (relativeProjectDirectory) {
|
|
1268
1272
|
const projectPrefix = `${relativeProjectDirectory}/`;
|
|
1269
|
-
|
|
1270
|
-
...
|
|
1271
|
-
changedFiles:
|
|
1273
|
+
providedFilesDiffInfo = {
|
|
1274
|
+
...providedFilesDiffInfo,
|
|
1275
|
+
changedFiles: providedFilesDiffInfo.changedFiles.flatMap((filePath) => {
|
|
1272
1276
|
return filePath.startsWith(projectPrefix) ? [filePath.slice(projectPrefix.length)] : [];
|
|
1273
1277
|
})
|
|
1274
1278
|
};
|
|
@@ -1276,7 +1280,11 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1276
1280
|
}
|
|
1277
1281
|
const requestedScope = resolveScope(flags, userConfig);
|
|
1278
1282
|
const includeUntracked = flags.includeUntracked ?? false;
|
|
1279
|
-
const scopeRequest =
|
|
1283
|
+
const scopeRequest = hasPositionalFileSelection ? {
|
|
1284
|
+
scope: "files",
|
|
1285
|
+
base: void 0,
|
|
1286
|
+
usedDeprecatedDiff: false
|
|
1287
|
+
} : requestedScope.scope === void 0 && providedFilesDiffInfo !== null ? {
|
|
1280
1288
|
...requestedScope,
|
|
1281
1289
|
scope: "changed"
|
|
1282
1290
|
} : requestedScope;
|
|
@@ -1284,8 +1292,8 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1284
1292
|
scanStartupSpinner = !isQuiet ? spinner("Scanning...").start() : null;
|
|
1285
1293
|
if (scanStartupSpinner !== null) recordDistribution(METRIC.scanFeedbackDelay, performance.now() - projectSelectionCompletedTime, { unit: "millisecond" });
|
|
1286
1294
|
const wantsDiffMode = scopeRequest.scope !== void 0 && scopeRequest.scope !== "full";
|
|
1287
|
-
const shouldDetectDiff =
|
|
1288
|
-
const diffInfo =
|
|
1295
|
+
const shouldDetectDiff = providedFilesDiffInfo === null && (wantsDiffMode || scopeRequest.scope === void 0 && !skipPrompts && !isQuiet);
|
|
1296
|
+
const diffInfo = providedFilesDiffInfo ?? (shouldDetectDiff ? await getDiffInfo(resolvedDirectory, scopeRequest.base, includeUntracked) : null);
|
|
1289
1297
|
scanStartupSpinner?.stop();
|
|
1290
1298
|
scanStartupSpinner = null;
|
|
1291
1299
|
const scope = await finalizeScope({
|
|
@@ -1296,7 +1304,7 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1296
1304
|
});
|
|
1297
1305
|
scanStartupSpinner = !isQuiet ? spinner("Scanning...").start() : null;
|
|
1298
1306
|
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;
|
|
1307
|
+
const comparisonBaseRef = isDiffMode && diffInfo && !diffInfo.isCurrentChanges && !hasPositionalFileSelection ? diffInfo.baseSha ? await resolveMergeBaseRef(resolvedDirectory, diffInfo.baseSha) : diffInfo.diffBaseRef ?? await resolveMergeBaseRef(resolvedDirectory, diffInfo.baseBranch) : null;
|
|
1300
1308
|
const baselineRef = scope === "changed" ? comparisonBaseRef : null;
|
|
1301
1309
|
const baselineDiffPlan = baselineRef === null ? null : await getBaselineDiffPlan(resolvedDirectory, baselineRef);
|
|
1302
1310
|
const linesBaseRef = diffInfo?.isCurrentChanges ? "HEAD" : comparisonBaseRef;
|
|
@@ -1314,7 +1322,10 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1314
1322
|
}
|
|
1315
1323
|
setJsonReportMode(baselineRef ? "baseline" : isDiffMode ? "diff" : "full");
|
|
1316
1324
|
if (isDiffMode && diffInfo && !isQuiet) {
|
|
1317
|
-
if (
|
|
1325
|
+
if (hasPositionalFileSelection) {
|
|
1326
|
+
const fileLabel = diffInfo.changedFiles.length === 1 ? "file" : "files";
|
|
1327
|
+
cliLogger.log(`Scanning ${diffInfo.changedFiles.length} selected ${fileLabel}`);
|
|
1328
|
+
} else if (diffInfo.isCurrentChanges) cliLogger.log("Scanning uncommitted changes");
|
|
1318
1329
|
else {
|
|
1319
1330
|
const currentBranchLabel = diffInfo.currentBranch ?? "(detached HEAD)";
|
|
1320
1331
|
cliLogger.log(`Scanning changes: ${highlighter.info(currentBranchLabel)} → ${highlighter.info(diffInfo.baseBranch)}`);
|
|
@@ -1344,6 +1355,7 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1344
1355
|
workspaceDeadCodeOwner,
|
|
1345
1356
|
precomputedSourceFileCounts: isMultiProject && !isDiffMode ? await collectProjectSourceFileCounts(resolvedDirectory, projectScans.map((projectScan) => projectScan.directory)) : null,
|
|
1346
1357
|
projectScans,
|
|
1358
|
+
workspaceProjectDirectories,
|
|
1347
1359
|
baselineRef,
|
|
1348
1360
|
scope,
|
|
1349
1361
|
changedLineRanges
|
|
@@ -1440,5 +1452,5 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
|
|
|
1440
1452
|
//#endregion
|
|
1441
1453
|
export { warnDeprecatedFailOn as n, runProjectMigrations as r, inspectAction as t };
|
|
1442
1454
|
|
|
1443
|
-
//# sourceMappingURL=inspect-
|
|
1444
|
-
//# debugId=
|
|
1455
|
+
//# sourceMappingURL=inspect-Dq5krKWG.js.map
|
|
1456
|
+
//# debugId=a848d2ef-3d8d-5de6-8dea-5b757aa38c3e
|
|
@@ -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]="1ec9c2fd-d101-59b4-b11c-283c3e91bcba")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, t as recordCount, zn as runSync } from "./record-metric-B6T_Ej33.js";
|
|
4
|
+
import { r as isExpectedUserError } from "./telemetry-runtime-BF83aBFL.js";
|
|
5
|
+
import { n as handleUserError, t as handleError } from "./handle-error-BCI-Nv3P.js";
|
|
6
|
+
import { t as reportErrorToSentry } from "./report-error-DwL3b99q.js";
|
|
7
|
+
import { t as printBrandedHeader } from "./print-branded-header-Dz0SwyHQ.js";
|
|
8
|
+
import { n as runInstallReactDoctor } from "./install-react-doctor-C-PVDWXv.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-C0aiZKgf.js.map
|
|
33
|
+
//# debugId=1ec9c2fd-d101-59b4-b11c-283c3e91bcba
|