| 239 | } |
| 240 | |
| 241 | function formatComponents(result: ScanResult): string { |
| 242 | const lines: string[] = ["# Components", ""]; |
| 243 | |
| 244 | for (const comp of result.components) { |
| 245 | const markers: string[] = []; |
| 246 | if (comp.isClient) markers.push("client"); |
| 247 | if (comp.isServer) markers.push("server"); |
| 248 | const markerStr = markers.length > 0 ? ` [${markers.join(", ")}]` : ""; |
| 249 | |
| 250 | if (comp.props.length > 0) { |
| 251 | lines.push(`- **${comp.name}**${markerStr} — props: ${comp.props.join(", ")} — \`${comp.file}\``); |
| 252 | } else { |
| 253 | lines.push(`- **${comp.name}**${markerStr} — \`${comp.file}\``); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | lines.push(""); |
| 258 | return lines.join("\n"); |
| 259 | } |
| 260 | |
| 261 | function formatLibs(result: ScanResult): string { |
| 262 | const lines: string[] = ["# Libraries", ""]; |