(map: CodebaseMapSummary)
| 435 | |
| 436 | /** Render a `CodebaseMapSummary` to pipeable markdown. */ |
| 437 | export function renderMapMarkdown(map: CodebaseMapSummary): string { |
| 438 | const lines: string[] = []; |
| 439 | |
| 440 | lines.push(`# Codebase Map — ${map.project}`); |
| 441 | lines.push(''); |
| 442 | |
| 443 | // Architecture layers |
| 444 | lines.push('## Architecture Layers'); |
| 445 | lines.push(''); |
| 446 | if (map.architecture.layers.length === 0) { |
| 447 | lines.push('_No index data available._'); |
| 448 | } else { |
| 449 | for (const layer of map.architecture.layers) { |
| 450 | let line = `- **${layer.name}** (${layer.fileCount} file${layer.fileCount === 1 ? '' : 's'})`; |
| 451 | if (layer.hubFile) { |
| 452 | const exStr = |
| 453 | layer.hubExports && layer.hubExports.length > 0 |
| 454 | ? ` → ${layer.hubExports.join(', ')}` |
| 455 | : ''; |
| 456 | line += ` — hub: \`${layer.hubFile}\`${exStr}`; |
| 457 | } |
| 458 | lines.push(line); |
| 459 | } |
| 460 | } |
| 461 | lines.push(''); |
| 462 | |
| 463 | // Entrypoints |
| 464 | lines.push('## Entrypoints'); |
| 465 | lines.push(''); |
| 466 | if (map.architecture.entrypoints.length === 0) { |
| 467 | lines.push('_None detected._'); |
| 468 | } else { |
| 469 | for (const ep of map.architecture.entrypoints) { |
| 470 | lines.push(`- \`${ep}\``); |
| 471 | } |
| 472 | } |
| 473 | lines.push(''); |
| 474 | |
| 475 | // Hub Files |
| 476 | lines.push('## Hub Files'); |
| 477 | lines.push(''); |
| 478 | if (map.architecture.hubFiles.length === 0) { |
| 479 | lines.push('_None detected._'); |
| 480 | } else { |
| 481 | for (const hf of map.architecture.hubFiles) { |
| 482 | lines.push(`- \`${hf}\``); |
| 483 | } |
| 484 | } |
| 485 | lines.push(''); |
| 486 | |
| 487 | // Key Interfaces |
| 488 | lines.push('## Key Interfaces'); |
| 489 | lines.push(''); |
| 490 | if (map.architecture.keyInterfaces.length === 0) { |
| 491 | lines.push('_None detected._'); |
| 492 | } else { |
| 493 | for (const ki of map.architecture.keyInterfaces) { |
| 494 | lines.push( |
no outgoing calls
no test coverage detected