mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-10 13:18:25 +00:00
closes #5043 Agent: claude Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
17 lines
595 B
TypeScript
17 lines
595 B
TypeScript
// Fails the build when an `icons/*` subpath has type declarations but no runtime file.
|
|
import { existsSync, readdirSync } from 'node:fs';
|
|
|
|
const declarations = readdirSync('dist/types/icons').filter((file) => file.endsWith('.d.ts'));
|
|
|
|
const missing = declarations.flatMap((file) => {
|
|
const name = file.replace(/\.d\.ts$/, '');
|
|
return [`dist/esm/icons/${name}.mjs`, `dist/cjs/icons/${name}.js`].filter(
|
|
(runtimeFile) => !existsSync(runtimeFile),
|
|
);
|
|
});
|
|
|
|
if (missing.length > 0) {
|
|
console.error(`Missing runtime files for icon subpaths:\n${missing.join('\n')}`);
|
|
process.exit(1);
|
|
}
|