/** * manifest analyze command * * Analyzes generated projection code bundle sizes per entity, command, * and store adapter. Runs the projection generator to produce artifacts * and reports their sizes (raw + minified estimate). Flags IR definitions * that result in disproportionately large generated output. * * The minified size is an approximation: comments and excess whitespace * are stripped. It is not a full production build (no tree-shaking or * minification by a real bundler) but it gives a useful relative metric * for comparing IR entities against each other. */ export type AnalyzeFormat = 'text' | 'json'; export interface AnalyzeOptions { /** Source file (.manifest or .ir.json) or directory */ source?: string; /** Projection to analyze (default: nextjs) */ projection?: string; /** Output format */ format?: AnalyzeFormat; /** Size threshold in bytes to flag an entity/command as "large" (default: 10240 = 10KB) */ flagThreshold?: number; /** Emit structured JSON to stdout */ json?: boolean; } export interface ArtifactSize { /** Artifact id from the projection */ id: string; /** Suggested file path */ pathHint?: string; /** Entity this artifact maps to, if any */ entity?: string; /** Command this artifact maps to, if any */ command?: string; /** Raw byte size of generated code */ rawSize: number; /** Estimated minified size (whitespace + comments stripped) */ minifiedSize: number; /** Number of lines in raw output */ lineCount: number; /** Whether this artifact exceeds the flag threshold */ flagged: boolean; } export interface EntityReport { name: string; totalRawSize: number; totalMinifiedSize: number; artifactCount: number; commandCount: number; propertyCount: number; flagged: boolean; artifacts: ArtifactSize[]; } export interface CommandReport { name: string; entity: string; totalRawSize: number; totalMinifiedSize: number; artifactCount: number; guardCount: number; mutationCount: number; flagged: boolean; artifacts: ArtifactSize[]; } export interface StoreReport { entity: string; target: string; totalRawSize: number; totalMinifiedSize: number; artifactCount: number; flagged: boolean; artifacts: ArtifactSize[]; } export interface AnalyzeReport { projection: string; source: string; totalRawSize: number; totalMinifiedSize: number; entityCount: number; commandCount: number; storeCount: number; flaggedCount: number; entities: EntityReport[]; commands: CommandReport[]; stores: StoreReport[]; globalArtifacts: ArtifactSize[]; flags: Array<{ type: 'entity' | 'command' | 'store'; name: string; rawSize: number; threshold: number; }>; } export type AnalyzeResult = AnalyzeReport; export declare function analyzeCommand(options?: AnalyzeOptions): Promise; //# sourceMappingURL=analyze.d.ts.map