react-doctor 0.9.4-dev.da0647e → 0.9.5-dev.2b8bc5c

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 CHANGED
@@ -13,8 +13,6 @@ React Doctor deterministically scans your codebase and finds issues across state
13
13
 
14
14
  Works across React frameworks and React-enabled sites - Next.js, Vite, Astro, TanStack, React Native, Expo, you name it.
15
15
 
16
- Scans JavaScript, TypeScript, and Astro source files plus JavaScript in standard inline `<script>` blocks in `.html` files.
17
-
18
16
  [Website →](https://react.doctor/docs)
19
17
 
20
18
  ## Install
package/dist/cli.js CHANGED
@@ -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]="3998fe2d-8ab1-5f61-a08c-44bb91d3ff4b")}catch(e){}}();
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]="ee33417e-c94f-5f10-ac59-9d4e202b7c9f")}catch(e){}}();
3
3
  import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-q7NCDQ7-.js";
4
- import { $ as canAnimateOnboarding, $n as isDebugFlagEnabled, $r as provide$1, A as formatSkippedProjectsMessage, An as flushSentry, Ar as getEquivalentRuleKeys, At as buildWorkflowContent, B as colorizeByScore, Bn as writeJsonErrorReport, Br as loadConfigWithSource, Bt as prompts, C as CLI_AGENT_BINARIES, Cn as resolveGitPath, Cr as findLegacyConfig, Ct as recordRunTraceId, D as detectAvailableAgents, Dn as detectDefaultBranch, Dt as warnDeprecatedDiff, E as computeDefaultSelectedAgents, En as writeJsonFile, Er as getBaselineDiffPlan, Et as resolveScope, F as printDiagnosticsDump, Fn as buildSentryScope, Fr as isPathInsideDirectory, Ft as upgradeReactDoctorWorkflowInPlace, G as recordGate, Gn as SENTRY_FLUSH_TIMEOUT_MS, Gr as setColorEnabled, Gt as DOCTOR_PACKAGE_NAME, Hn as VERSION, Hr as messageFromUnknown, Ht as openWorkflowPullRequest, I as printFooter, In as enableJsonMode, Ir as isPlainObject, It as upgradeWorkflowActionToV2, J as ACTION_UPGRADE_EVENT, Jt as hasDoctorScript, K as runMigrations, Kn as STAGED_FILES_TEMP_DIR_PREFIX, Kr as toRelativePath, Kt as findNearestPackageDirectory, L as printSummary, Ln as isJsonModeActive, Lr as isReactDoctorError, Lt as workflowUsesV1Action, M as deduplicateProjectScans, Mn as isExpectedUserError, Mr as hasReactRuntime, Mt as installReactDoctorWorkflow, N as createInvocationInspect, Nn as formatEnvironmentError, Nr as highlighter, Nt as isReactDoctorWorkflowInstalled, O as buildHandoffPayload, On as runCommand, Or as getChangedLineRanges, Ot as isValidBlockingLevel, P as inspect, Pn as isEnvironmentError, Pr as isErrnoException, Pt as readReactDoctorWorkflow, Q as SETUP_HINT_EVENT, Qn as isNonInteractiveEnvironment, Qr as promise, Qt as spinner, Rn as setJsonReportDirectory, Rr as isSameRuleKey, Rt as recordCount, S as detectLaunchableAgents, Sn as readPackageJson, Sr as discoverReactSubprojects, St as getLastRunTraceId, T as launchCliAgent, Tn as runGitRaw, Tr as formatReactDoctorError, Tt as isScopeValue, U as isGatePending, Un as CI_TRUST_COMPANIES, Ur as remainingDeadlineBudgetMs, Ut as stageWorkflowFile, V as hasCompletedOnboarding, Vn as writeJsonReport, Vr as mapWithConcurrency, Vt as unrefStdin, W as readPreference, Wn as METRIC, Wr as resolveScanTarget, Wt as toForwardSlashes, X as HANDOFF_TARGET_PREFERENCE_ID, Xn as WELCOME_EXPLANATION_HOLD_MS, Xr as log, Xt as isSpinnerSilent, Y as CI_PITCH_EVENT, Yr as error, Yt as installReactDoctorScriptStep, Z as INSTALL_AGENTS_PREFERENCE_ID, Zn as CliInputError, Zr as gen, Zt as setSpinnerSilent, _ as filterScansForSurface, _n as getPackageJsonPath, _r as StagedFiles, _t as buildRulePriorityMap, a as shouldFailScanGate, ai as provide, an as HOOK_RELATIVE_PATH, ar as CI_URL, at as computeProjectedScore, b as reportWorkflowResult, bn as packageHasNestedRecordKey, br as clearConfigCache, c as selectProjects, cn as LEGACY_HOOK_RUNNER_RELATIVE_PATH, ct as writeStdout, d as resolveProjectDiffIncludePaths, dn as PRE_COMMIT_CONFIG_FILE, dr as Git, dt as buildCodeFrame, ei as runPromise, et as isOnboardingForced, f as resolveProjectSourceFilePaths, fn as REACT_DOCTOR_COMMAND, g as resolveCliInspectOptions, gn as ensureTrailingNewline, gr as STAGED_FILES_PROJECT_CONFIG_FILENAMES, h as resolveWorkspaceDeadCodeOwner, hn as VITE_PLUS_HOOKS_PATH, hr as SKILL_NAME, ht as resolveMergeBaseRef, i as validateModeFlags, in as HOOK_FILE_NAME, ir as CANONICAL_GITHUB_URL, it as filterDiagnosticsByCategories, j as collectProjectSourceFileCounts, jn as initializeSentry, jt as getReactDoctorWorkflowPath, k as isShareOptedOut, kn as cliLogger, kr as getDiffInfo, kt as resolveBlockingLevel, l as resolveProjectScan, ln as NON_BLOCKING_REACT_DOCTOR_COMMAND, lt as indentMultilineText, m as retryMissingProjectScores, ni as sleep, nr as isCodingAgentEnvironment, nt as shouldRenderHyperlinks, o as projectManifestChanged, on as HUSKY_HOOKS_PATH, or as COMPILER_CLEANUP_BUCKET, ot as formatElapsedTime, p as resolveProjectRelativeDirectory, q as writePreference, qn as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, qr as validateConfigTypes, qt as hasDoctorDependency, r as validateIncludeUntrackedScope, rr as CANONICAL_DISCORD_URL, sn as LEFTHOOK_CONFIG_FILES, sr as COMPILER_CLEANUP_RULE_KEYS, st as printDiagnostics, t as exitGracefully, ti as runSync, tr as isCiOrCodingAgentEnvironment, u as resolveProjectChangedLineRanges, un as OVERCOMMIT_CONFIG_FILE, ur as GITHUB_ACTIONS_SETUP_URL, v as countUniqueScannedFiles, vn as isRecord, vr as buildJsonReport, w as copyToClipboard, wn as runGit, wr as formatErrorChain, wt as finalizeScope, x as openUrl, xn as packageHasRecordKey, xr as detectAiTrainingEnvironment, xt as getActiveRunTrace, y as setUpGitHubActions, yn as packageHasDependency, yr as buildRuleDocsUrl, zn as setJsonReportMode, zr as listWorkspacePackages, zt as recordDistribution } from "./exit-gracefully-BN2OivAV.js";
4
+ import { $ as filterDiagnosticsByCategories, $n as GITHUB_ACTIONS_SETUP_URL, $t as PRE_COMMIT_CONFIG_FILE, A as HANDOFF_TARGET_PREFERENCE_ID, An as VERSION, Ar as loadConfigWithSource, At as openWorkflowPullRequest, B as buildHandoffPayload, Bn as isNonInteractiveEnvironment, Br as log, Bt as spinner, C as isGatePending, Cn as buildSentryScope, Cr as highlighter, Ct as upgradeReactDoctorWorkflowInPlace, D as writePreference, Dn as setJsonReportMode, Dr as isReactDoctorError, Dt as recordDistribution, E as runMigrations, En as setJsonReportDirectory, Er as isPlainObject, Et as recordCount, F as CLI_AGENT_BINARIES, Fn as STAGED_FILES_TEMP_DIR_PREFIX, Fr as setColorEnabled, Ft as hasDoctorDependency, G as inspect, Gn as isCodingAgentEnvironment, H as collectProjectSourceFileCounts, Hn as isDebugFlagEnabled, Hr as provide$1, I as copyToClipboard, In as STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES, Ir as toRelativePath, It as hasDoctorScript, Jn as CI_URL, Jt as HUSKY_HOOKS_PATH, K as printHeadlessReport, Kn as CANONICAL_DISCORD_URL, Kt as HOOK_FILE_NAME, L as launchCliAgent, Lr as validateConfigTypes, Lt as installReactDoctorScriptStep, Mn as METRIC, Mr as messageFromUnknown, Mt as toForwardSlashes, N as SETUP_HINT_EVENT, Nr as remainingDeadlineBudgetMs, Nt as DOCTOR_PACKAGE_NAME, O as ACTION_UPGRADE_EVENT, On as writeJsonErrorReport, Or as isSameRuleKey, Ot as prompts, P as detectLaunchableAgents, Pn as SENTRY_FLUSH_TIMEOUT_MS, Pr as resolveScanTarget, Pt as findNearestPackageDirectory, Qt as OVERCOMMIT_CONFIG_FILE, R as computeDefaultSelectedAgents, Rt as isSpinnerSilent, S as openUrl, Sn as isEnvironmentError, Sr as hasReactRuntime, St as readReactDoctorWorkflow, T as recordGate, Tn as isJsonModeActive, Tr as isPathInsideDirectory, Tt as workflowUsesV1Action, U as deduplicateProjectScans, Ur as runPromise, V as formatSkippedProjectsMessage, Vr as gen, W as createInvocationInspect, Wn as isCiOrCodingAgentEnvironment, Wr as runSync, X as indentMultilineText, Xn as COMPILER_CLEANUP_RULE_KEYS, Xt as LEGACY_HOOK_RUNNER_RELATIVE_PATH, Yn as COMPILER_CLEANUP_BUCKET, Yt as LEFTHOOK_CONFIG_FILES, Z as printDiagnosticsDump, Zt as NON_BLOCKING_REACT_DOCTOR_COMMAND, _ as resolveCliInspectOptions, _n as cliLogger, _t as resolveBlockingLevel, a as shouldFailScanGate, an as getPackageJsonPath, ar as STAGED_FILES_PROJECT_CONFIG_FILENAMES, b as setUpGitHubActions, bn as isExpectedUserError, br as getEquivalentRuleKeys, bt as installReactDoctorWorkflow, c as selectProjects, cn as packageHasNestedRecordKey, cr as buildRuleDocsUrl, d as resolveProjectChangedLineRanges, dn as resolveGitPath, dr as detectAiTrainingEnvironment, dt as recordRunTraceId, en as REACT_DOCTOR_COMMAND, er as Git, et as buildEmptyReportMessage, f as resolveProjectDiffIncludePaths, fn as runGit, fr as discoverReactSubprojects, ft as finalizeScope, g as resolveWorkspaceDeadCodeOwner, gn as runCommand, gr as getBaselineDiffPlan, gt as isValidBlockingLevel, h as retryMissingProjectScores, hn as detectDefaultBranch, hr as formatReactDoctorError, ht as warnDeprecatedDiff, i as validateModeFlags, in as ensureTrailingNewline, ir as SKILL_NAME, j as INSTALL_AGENTS_PREFERENCE_ID, jn as CI_TRUST_COMPANIES, jr as mapWithConcurrency, jt as stageWorkflowFile, k as CI_PITCH_EVENT, kn as writeJsonReport, kr as listWorkspacePackages, kt as unrefStdin, l as buildCodeFrame, ln as packageHasRecordKey, lt as getActiveRunTrace, m as resolveProjectRelativeDirectory, mn as writeJsonFile, mr as formatErrorChain, mt as resolveScope, o as projectManifestChanged, on as isRecord, or as StagedFiles, p as resolveProjectSourceFilePaths, pn as runGitRaw, pr as findLegacyConfig, pt as isScopeValue, qn as CANONICAL_GITHUB_URL, qr as provide, qt as HOOK_RELATIVE_PATH, r as validateIncludeUntrackedScope, rn as VITE_PLUS_HOOKS_PATH, rt as resolveMergeBaseRef, sn as packageHasDependency, sr as buildJsonReport, t as exitGracefully, u as resolveProjectScan, un as readPackageJson, ur as clearConfigCache, ut as getLastRunTraceId, v as filterScansForSurface, vn as flushSentry, vr as getChangedLineRanges, vt as buildWorkflowContent, w as readPreference, wn as enableJsonMode, wr as isErrnoException, wt as upgradeWorkflowActionToV2, x as reportWorkflowResult, xn as formatEnvironmentError, xt as isReactDoctorWorkflowInstalled, y as countUniqueScannedFiles, yn as initializeSentry, yr as getDiffInfo, yt as getReactDoctorWorkflowPath, z as detectAvailableAgents, zn as CliInputError, zr as error, zt as setSpinnerSilent } from "./exit-gracefully-Du1RQd8v.js";
5
5
  import { execFile, execFileSync } from "node:child_process";
6
6
  import * as path$1 from "node:path";
7
7
  import path from "node:path";
@@ -12166,49 +12166,6 @@ const PROJECT_MIGRATIONS = [
12166
12166
  ];
12167
12167
  const runProjectMigrations = (projectRoot, options = {}) => runMigrations(PROJECT_MIGRATIONS, { projectRoot }, options);
12168
12168
  //#endregion
12169
- //#region src/cli/utils/render-welcome.ts
12170
- const HAPPY_FACE_LINES = [
12171
- "┌─────┐",
12172
- "│ ◠ ◠ │",
12173
- "│ ▽ │",
12174
- "└─────┘"
12175
- ];
12176
- const FACE_INDENT = " ";
12177
- const FACE_PREFIX_WIDTH = 2 + (HAPPY_FACE_LINES[0]?.length ?? 0) + 2;
12178
- const clampToColumns = (text, maxColumns) => {
12179
- if (maxColumns <= 0) return "";
12180
- if (text.length <= maxColumns) return text;
12181
- if (maxColumns === 1) return "…";
12182
- return `${text.slice(0, maxColumns - 1).trimEnd()}…`;
12183
- };
12184
- const typeLine = (linePrefix, text, style, charDelayMs) => gen(function* () {
12185
- const characters = [...text];
12186
- for (let length = 1; length <= characters.length; length += 1) {
12187
- yield* writeStdout(`\r${linePrefix}${style(characters.slice(0, length).join(""))}\x1b[K`);
12188
- yield* sleep(charDelayMs);
12189
- }
12190
- });
12191
- const playWelcomeScene = (options = {}) => gen(function* () {
12192
- const speedMultiplier = options.speedMultiplier ?? 1;
12193
- const charDelayMs = 16 / speedMultiplier;
12194
- const interLineDelayMs = 250 / speedMultiplier;
12195
- const explanationHoldMs = WELCOME_EXPLANATION_HOLD_MS / speedMultiplier;
12196
- const face = HAPPY_FACE_LINES.map((line) => highlighter.success(line));
12197
- const mouthPrefix = `${FACE_INDENT}${face[2] ?? ""}${FACE_INDENT}`;
12198
- const terminalColumns = process.stdout.columns;
12199
- const availableTextColumns = terminalColumns && terminalColumns > 0 ? Math.max(0, terminalColumns - FACE_PREFIX_WIDTH - 1) : Number.POSITIVE_INFINITY;
12200
- const greeting = clampToColumns("Welcome to React Doctor", availableTextColumns);
12201
- const tagline = clampToColumns("I diagnose your React code for bugs, security & performance.", availableTextColumns);
12202
- yield* writeStdout(`\n${face.map((line) => `${FACE_INDENT}${line}`).join("\n")}\n`);
12203
- yield* writeStdout("\x1B[3A");
12204
- yield* typeLine(`${FACE_INDENT}${face[1] ?? ""}${FACE_INDENT}`, greeting, (fragment) => highlighter.bold(fragment), charDelayMs);
12205
- yield* sleep(interLineDelayMs);
12206
- yield* writeStdout("\x1B[1B");
12207
- yield* typeLine(mouthPrefix, tagline, (fragment) => highlighter.dim(fragment), charDelayMs);
12208
- yield* sleep(explanationHoldMs);
12209
- yield* writeStdout("\x1B[3A\r\x1B[0J");
12210
- });
12211
- //#endregion
12212
12169
  //#region src/cli/utils/read-changed-files-from.ts
12213
12170
  const isSafeRelativePath = (filePath) => {
12214
12171
  if (filePath.length === 0) return false;
@@ -12235,89 +12192,36 @@ const readChangedFilesFrom = (filePath) => {
12235
12192
  return [...uniqueFiles];
12236
12193
  };
12237
12194
  //#endregion
12238
- //#region src/cli/utils/score-band-label.ts
12239
- const scoreBandLabel = (score) => {
12240
- if (score >= 75) return "Great";
12241
- if (score >= 50) return "OK";
12242
- return "Needs work";
12243
- };
12244
- //#endregion
12245
- //#region src/cli/utils/render-multi-project-summary.ts
12246
- const buildSummaryLine = (entry, longestProjectNameLength) => {
12247
- const paddedName = entry.projectName.padEnd(longestProjectNameLength);
12248
- const nameRendering = entry.score !== null ? colorizeByScore(paddedName, entry.score) : highlighter.dim(paddedName);
12249
- if (entry.score === null) {
12250
- const issueLabel = `${entry.issueCount} ${entry.issueCount === 1 ? "issue" : "issues"}`;
12251
- return ` ${nameRendering} ${highlighter.dim("no score")} ${highlighter.dim(issueLabel)}`;
12252
- }
12253
- const scoreRendering = colorizeByScore(String(entry.score).padStart(3), entry.score);
12254
- const label = colorizeByScore(scoreBandLabel(entry.score), entry.score);
12255
- const issuesParts = [];
12256
- if (entry.errorCount > 0) issuesParts.push(highlighter.error(`${entry.errorCount} ${entry.errorCount === 1 ? "error" : "errors"}`));
12257
- const warningCount = entry.issueCount - entry.errorCount;
12258
- if (warningCount > 0) issuesParts.push(highlighter.warn(`${warningCount} ${warningCount === 1 ? "warning" : "warnings"}`));
12259
- return ` ${nameRendering} ${scoreRendering} ${label} ${issuesParts.length > 0 ? issuesParts.join(highlighter.dim(", ")) : ""}`;
12260
- };
12261
- const findLowestScoredScan = (completedScans) => {
12262
- const scoredScans = completedScans.filter((scan) => scan.result.score !== null);
12263
- if (scoredScans.length === 0) return null;
12264
- return scoredScans.reduce((worst, scan) => scan.result.score.score < worst.result.score.score ? scan : worst);
12265
- };
12266
- const printMultiProjectSummary = (input) => gen(function* () {
12267
- const { completedScans, verbose, isOffline, projectName, totalElapsedMilliseconds } = input;
12268
- const categoryFilters = input.categoryFilters ?? /* @__PURE__ */ new Set();
12269
- const animateRender = !verbose && canAnimateOnboarding(process.stdout);
12270
- const displayDiagnostics = filterDiagnosticsByCategories(filterScansForSurface(completedScans, "cli"), categoryFilters);
12271
- const scoreDiagnostics = new Set(filterScansForSurface(completedScans, "score"));
12272
- const displayedScoreDiagnostics = displayDiagnostics.filter((diagnostic) => scoreDiagnostics.has(diagnostic));
12273
- const projectRootByDiagnostic = /* @__PURE__ */ new WeakMap();
12274
- const frameSourceRootByDiagnostic = /* @__PURE__ */ new WeakMap();
12275
- for (const scan of completedScans) for (const diagnostic of scan.result.diagnostics) {
12276
- projectRootByDiagnostic.set(diagnostic, scan.result.project.rootDirectory);
12277
- frameSourceRootByDiagnostic.set(diagnostic, scan.frameSourceRoot ?? scan.result.project.rootDirectory);
12278
- }
12279
- const resolveDiagnosticSourceRoot = (diagnostic) => projectRootByDiagnostic.get(diagnostic) ?? "";
12280
- const resolveDiagnosticFrameSourceRoot = (diagnostic) => frameSourceRootByDiagnostic.get(diagnostic) ?? resolveDiagnosticSourceRoot(diagnostic);
12281
- const totalScannedFileCount = countUniqueScannedFiles(completedScans.map((scan) => scan.result));
12282
- yield* log(`${highlighter.success("✔")} Scanned ${totalScannedFileCount} ${totalScannedFileCount === 1 ? "file" : "files"} in ${formatElapsedTime(totalElapsedMilliseconds)}`);
12283
- if (displayDiagnostics.length > 0) {
12284
- yield* log("");
12285
- yield* printDiagnostics(displayDiagnostics, verbose, resolveDiagnosticSourceRoot, buildRulePriorityMap(completedScans.map((scan) => scan.result.score)), isCodingAgentEnvironment(), { animateCountUp: animateRender }, shouldRenderHyperlinks(process.stdout), resolveDiagnosticFrameSourceRoot);
12286
- }
12287
- const lowestScoredScan = findLowestScoredScan(completedScans);
12288
- const aggregateScore = lowestScoredScan?.result.score ?? null;
12289
- const totalSourceFileCount = completedScans.reduce((sum, scan) => sum + scan.result.project.sourceFileCount, 0);
12290
- yield* printSummary({
12291
- diagnostics: displayDiagnostics,
12292
- elapsedMilliseconds: totalElapsedMilliseconds,
12293
- scoreResult: aggregateScore,
12294
- potentialScore: lowestScoredScan ? yield* promise(() => computeProjectedScore(displayedScoreDiagnostics, filterScansForSurface([lowestScoredScan], "score"), lowestScoredScan.result.score)) : null,
12295
- totalSourceFileCount,
12296
- noScoreMessage: "Score unavailable.",
12297
- verbose,
12298
- outputDirectory: input.outputDirectory,
12299
- animateProjection: animateRender
12300
- });
12301
- const entries = completedScans.map((scan) => {
12302
- const projectDiagnostics = filterDiagnosticsByCategories(filterScansForSurface([scan], "cli"), categoryFilters);
12303
- const errorCount = projectDiagnostics.filter((diagnostic) => diagnostic.severity === "error").length;
12304
- return {
12305
- projectName: scan.result.project.projectName,
12306
- score: scan.result.score?.score ?? null,
12307
- issueCount: projectDiagnostics.length,
12308
- errorCount
12309
- };
12310
- });
12311
- const longestProjectNameLength = Math.max(...entries.map((entry) => entry.projectName.length));
12312
- yield* log("");
12313
- for (const entry of entries) yield* log(buildSummaryLine(entry, longestProjectNameLength));
12314
- yield* printFooter({
12315
- diagnostics: displayDiagnostics,
12316
- scoreResult: aggregateScore,
12317
- projectName,
12318
- isOffline
12195
+ //#region src/cli/utils/print-completed-scans-headless.ts
12196
+ const printCompletedScansHeadless = (input) => {
12197
+ const surfaceDiagnostics = filterScansForSurface(input.completedScans, input.outputSurface);
12198
+ const diagnostics = filterDiagnosticsByCategories(surfaceDiagnostics, input.categoryFilters);
12199
+ const allDiagnosticCount = input.completedScans.reduce((total, scan) => total + scan.result.diagnostics.length, 0);
12200
+ const scoreResult = input.completedScans.reduce((lowestScore, scan) => {
12201
+ const scanScore = scan.result.score;
12202
+ if (scanScore === null) return lowestScore;
12203
+ if (lowestScore === null || scanScore.score < lowestScore.score) return scanScore;
12204
+ return lowestScore;
12205
+ }, null);
12206
+ const skippedChecks = [...new Set(input.completedScans.flatMap((scan) => scan.result.skippedChecks))];
12207
+ return gen(function* () {
12208
+ yield* printHeadlessReport({
12209
+ diagnostics,
12210
+ elapsedMilliseconds: input.elapsedMilliseconds,
12211
+ emptyStateMessage: buildEmptyReportMessage({
12212
+ categoryFilters: input.categoryFilters,
12213
+ demotedDiagnosticCount: allDiagnosticCount - surfaceDiagnostics.length,
12214
+ outputSurface: input.outputSurface
12215
+ }),
12216
+ noScoreMessage: input.noScoreMessage,
12217
+ projectName: input.projectName,
12218
+ scannedFileCount: countUniqueScannedFiles(input.completedScans.map((scan) => scan.result)),
12219
+ scoreResult: skippedChecks.length > 0 ? null : scoreResult,
12220
+ skippedChecks
12221
+ });
12222
+ if (input.outputDirectory !== void 0 || input.verbose) yield* printDiagnosticsDump(diagnostics, input.outputDirectory, input.verbose);
12319
12223
  });
12320
- });
12224
+ };
12321
12225
  //#endregion
12322
12226
  //#region src/cli/utils/prompt-install-setup.ts
12323
12227
  const SETUP_HINT_GATE = {
@@ -12743,8 +12647,6 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
12743
12647
  });
12744
12648
  return;
12745
12649
  }
12746
- if (!isQuiet) if (!flags.verbose && canAnimateOnboarding(process.stdout)) await runPromise(playWelcomeScene({ speedMultiplier: !isOnboardingForced() && hasCompletedOnboarding() ? 2 : 1 }));
12747
- else runSync(printBrandedHeader);
12748
12650
  const scanOptions = resolveCliInspectOptions(flags, userConfig);
12749
12651
  const inspectProject = createInvocationInspect(scanOptions.concurrency);
12750
12652
  const scanDeadlineEpochMs = scanOptions.maxDurationMs !== void 0 ? Date.now() + scanOptions.maxDurationMs : void 0;
@@ -12924,8 +12826,7 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
12924
12826
  rootDirectory: projectScan.scanDirectory
12925
12827
  }
12926
12828
  },
12927
- config: projectScan.projectConfig,
12928
- frameSourceRoot: projectTempDirectory
12829
+ config: projectScan.projectConfig
12929
12830
  };
12930
12831
  };
12931
12832
  const stagedBatch = await runProjectScanBatch({
@@ -12938,27 +12839,22 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
12938
12839
  throw error;
12939
12840
  });
12940
12841
  const completedScans = stagedBatch.completedScans;
12941
- try {
12942
- reportSkippedProjects({
12943
- skippedProjects,
12944
- isQuiet
12945
- });
12946
- if (!isQuiet && isMultiProject && completedScans.length > 0) {
12947
- const showShareLink = !isShareOptedOut(completedScans, scanOptions.noScore) && !scanOptions.isCi;
12948
- await runPromise(printMultiProjectSummary({
12949
- completedScans,
12950
- categoryFilters,
12951
- verbose: Boolean(flags.verbose),
12952
- outputDirectory: flags.outputDir,
12953
- isOffline: !showShareLink,
12954
- projectName: path$1.basename(resolvedDirectory),
12955
- totalElapsedMilliseconds: stagedBatch.elapsedMilliseconds
12956
- }));
12957
- }
12958
- if (flags.outputDir && isMultiProject && isQuiet) await runPromise(printDiagnosticsDump(filterDiagnosticsByCategories(filterScansForSurface(completedScans, scanOptions.outputSurface ?? "cli"), categoryFilters), flags.outputDir, false, "stderr"));
12959
- } finally {
12960
- snapshot.cleanup();
12961
- }
12842
+ snapshot.cleanup();
12843
+ reportSkippedProjects({
12844
+ skippedProjects,
12845
+ isQuiet
12846
+ });
12847
+ if (!isQuiet && isMultiProject && completedScans.length > 0) await runPromise(printCompletedScansHeadless({
12848
+ categoryFilters,
12849
+ completedScans,
12850
+ elapsedMilliseconds: stagedBatch.elapsedMilliseconds,
12851
+ noScoreMessage: "Score unavailable.",
12852
+ outputDirectory: flags.outputDir,
12853
+ outputSurface: scanOptions.outputSurface ?? "cli",
12854
+ projectName: path$1.basename(resolvedDirectory),
12855
+ verbose: Boolean(flags.verbose)
12856
+ }));
12857
+ if (flags.outputDir && isMultiProject && isQuiet) await runPromise(printDiagnosticsDump(filterDiagnosticsByCategories(filterScansForSurface(completedScans, scanOptions.outputSurface ?? "cli"), categoryFilters), flags.outputDir, false, "stderr"));
12962
12858
  finalizeScans({
12963
12859
  completedScans,
12964
12860
  skippedProjects,
@@ -13121,18 +13017,16 @@ const inspectAction = async (directory, flags, invocationCommand = "inspect") =>
13121
13017
  skippedProjects,
13122
13018
  isQuiet
13123
13019
  });
13124
- if (!isQuiet && isMultiProject && completedScans.length > 0) {
13125
- const showShareLink = !isShareOptedOut(completedScans, scanOptions.noScore) && !scanOptions.isCi;
13126
- await runPromise(printMultiProjectSummary({
13127
- completedScans,
13128
- categoryFilters,
13129
- verbose: Boolean(flags.verbose),
13130
- outputDirectory: flags.outputDir,
13131
- isOffline: !showShareLink,
13132
- projectName: path$1.basename(resolvedDirectory),
13133
- totalElapsedMilliseconds: projectBatch.elapsedMilliseconds
13134
- }));
13135
- }
13020
+ if (!isQuiet && isMultiProject && completedScans.length > 0) await runPromise(printCompletedScansHeadless({
13021
+ categoryFilters,
13022
+ completedScans,
13023
+ elapsedMilliseconds: projectBatch.elapsedMilliseconds,
13024
+ noScoreMessage: "Score unavailable.",
13025
+ outputDirectory: flags.outputDir,
13026
+ outputSurface: scanOptions.outputSurface ?? "cli",
13027
+ projectName: path$1.basename(resolvedDirectory),
13028
+ verbose: Boolean(flags.verbose)
13029
+ }));
13136
13030
  const selectedSurfaceDiagnostics = filterDiagnosticsByCategories(filterScansForSurface(completedScans, scanOptions.outputSurface ?? "cli"), categoryFilters);
13137
13031
  const didScansWriteDump = isMultiProject ? !isQuiet && completedScans.length > 0 : completedScans.length > 0;
13138
13032
  if (flags.outputDir && !didScansWriteDump) await runPromise(printDiagnosticsDump(selectedSurfaceDiagnostics, flags.outputDir, false, isQuiet ? "stderr" : "stdout"));
@@ -13252,7 +13146,7 @@ const runScanCommand = async (input) => {
13252
13146
  warnDeprecatedFailOn(input.flags, scanTarget.userConfig);
13253
13147
  warnDeprecatedDiff(input.flags, scanTarget.userConfig);
13254
13148
  recordCount(METRIC.cliInvoked, 1, { command: input.invocationCommand });
13255
- const { runScanApp } = await import("./run-scan-app-_1xMQtKK.js");
13149
+ const { runScanApp } = await import("./run-scan-app-ukc4pcdk.js");
13256
13150
  const { shouldFail } = await runScanApp({
13257
13151
  directory: input.directory,
13258
13152
  scanTarget,
@@ -14380,4 +14274,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
14380
14274
  export {};
14381
14275
 
14382
14276
  //# sourceMappingURL=cli.js.map
14383
- //# debugId=3998fe2d-8ab1-5f61-a08c-44bb91d3ff4b
14277
+ //# debugId=ee33417e-c94f-5f10-ac59-9d4e202b7c9f