()
| 232 | } |
| 233 | |
| 234 | function main() { |
| 235 | const categories = collectComponents(componentMetadata); |
| 236 | const md = generateMarkdown(categories); |
| 237 | fs.mkdirSync(OUTPUT_DIR, { recursive: true }); |
| 238 | fs.writeFileSync(OUTPUT_PATH, md, 'utf8'); |
| 239 | const rootFile = path.join(process.cwd(), OUTPUT_FILENAME); |
| 240 | if (rootFile !== OUTPUT_PATH && fs.existsSync(rootFile)) { |
| 241 | try { |
| 242 | fs.unlinkSync(rootFile); |
| 243 | } catch { |
| 244 | /* ignore */ |
| 245 | } |
| 246 | } |
| 247 | console.log(`Generated ${path.relative(process.cwd(), OUTPUT_PATH)} with dynamic component index.`); |
| 248 | } |
| 249 | |
| 250 | main(); |
no test coverage detected