Files
lucide/packages/lab/scripts/buildLib.mts
Eric Fennis 1502285072 fix(@lucide/lab): Fix lab build (#4618)
* chore(lab): Adjust build scripts

* add check workflow

* Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* update gitignore

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-07-31 09:11:20 +02:00

21 lines
733 B
TypeScript

import path from 'path';
import { readSvgDirectory, getCurrentDirPath } from '@lucide/helpers';
import readSvgs from './readSvgs.mts';
import generateIconNodes from './generateIconNodes.mts';
import copyIcons from './copyIcons.mts';
import pkg from '../package.json' with { type: 'json' };
const currentDir = getCurrentDirPath(import.meta.url);
const PACKAGE_DIR = path.resolve(currentDir, '../');
const ICONS_DIR = path.join(PACKAGE_DIR, '../../lab');
const license = `@license ${pkg.name} v${pkg.version} - ${pkg.license}`;
const svgFiles = await readSvgDirectory(ICONS_DIR);
const svgs = await readSvgs(svgFiles, ICONS_DIR);
await Promise.all([generateIconNodes(svgs, PACKAGE_DIR), copyIcons(svgs, PACKAGE_DIR, license)]);