chore(workspace): gate dead-code with knip production mode

Turn on production-mode knip plus an autofix run in pre-commit and the
`pnpm dead-code` script, document the `/** @internal */` convention for
test-only exports in AGENTS.md, annotate test-only exports across the
CLI with that JSDoc, and drop dead exports/wrappers the new gate
surfaced (e.g. `cli-project.ts`, `lookerRuntimeSourceToFileAdapterSource`,
`createLocalScanEnrichmentProvidersFromConfig`,
`PGLITE_OWNER_PROCESS_BACKEND_CAPABILITIES`, stale type re-exports).
Replace the loose `ignoreIssues` allowlist in `knip.json` with explicit
production entries so cross-package barrel leaks are caught.
This commit is contained in:
Andrey Avtomonov 2026-05-21 11:35:41 +02:00
parent ac3885b652
commit b690e6988b
71 changed files with 211 additions and 279 deletions

View file

@ -444,17 +444,20 @@ export function renderContextBuildView(
const ESC_K_RE = new RegExp(`${ESC.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\[K`, 'g');
const ANSI_RE = /\x1b\[[0-9;]*m/g;
/** @internal */
export function extractProgressMessage(chunk: string): string | null {
const cleaned = chunk.replace(/^\r/, '').replace(ESC_K_RE, '').replace(/\n$/, '').trim();
const match = cleaned.match(/^\[(\d+)%\]\s*(.+)$/);
return match ? `[${match[1]}%] ${match[2]}` : null;
}
/** @internal */
export function parseScanSummary(output: string): string | null {
const match = output.match(/(\d+) changes? across (\d+) tables?/);
return match ? `${match[2]} tables` : null;
}
/** @internal */
export function parseIngestSummary(output: string): string | null {
const savedMemory = output.match(/Saved memory: (.+)/);
if (savedMemory) return savedMemory[1];
@ -560,6 +563,7 @@ function collectSourceProgress(targets: ContextBuildTargetState[]): ContextBuild
});
}
/** @internal */
export function viewStateFromSourceProgress(
sources: ContextBuildSourceProgressUpdate[],
now: number,