| 52 | } |
| 53 | |
| 54 | function buildIconNames() { |
| 55 | if (!fs.existsSync(ICONS_DIR)) { |
| 56 | throw new Error(`Icons directory not found: ${ICONS_DIR}`); |
| 57 | } |
| 58 | const files = fg.sync('*.svg', {cwd: ICONS_DIR, absolute: false, suppressErrors: true}); |
| 59 | if (files.length === 0) { |
| 60 | throw new Error(`No icon SVG files found in: ${ICONS_DIR}`); |
| 61 | } |
| 62 | const ids = Array.from( |
| 63 | new Set(files.map(f => f.replace(/\.svg$/i, '').replace(/^S2_Icon_(.*?)(Size\d+)?_2.*/, '$1'))) |
| 64 | ).sort((a, b) => a.localeCompare(b)); |
| 65 | return ids; |
| 66 | } |
| 67 | |
| 68 | function buildIllustrationNames() { |
| 69 | if (!fs.existsSync(ILLUSTRATIONS_DIR)) { |