mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
* cleanup scripts * Move helpers to package * Fixes scripts * Fix scripts * Formatting * Fix helpers import paths * Remove lucide-figma * Rename helpers package * Fix build * formatting * Adjust main build-icons file * Add export casing * Adds `exportModuleNameCasing` fro lab project * format files * Bump package version @lucide/build-icons * Revert changes in icons * Revert changes in PR yml * Fix lint issues * Fix site build * fix lint errors * Attempt fix linting * Fix lint errors
26 lines
726 B
JavaScript
26 lines
726 B
JavaScript
import path from 'path';
|
|
import { getCurrentDirPath, readAllMetadata, readSvgDirectory, writeFile } from '@lucide/helpers';
|
|
|
|
const currentDir = getCurrentDirPath(import.meta.url);
|
|
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
|
const icons = readAllMetadata(ICONS_DIR);
|
|
|
|
const svgFiles = readSvgDirectory(ICONS_DIR);
|
|
|
|
const iconNames = svgFiles.map((icon) => icon.split('.')[0]);
|
|
|
|
iconNames.forEach((iconName) => {
|
|
if (typeof icons[iconName] === 'undefined') {
|
|
const iconContent = JSON.stringify(
|
|
{
|
|
$schema: '../icon.schema.json',
|
|
tags: [],
|
|
categories: [],
|
|
},
|
|
null,
|
|
2,
|
|
);
|
|
writeFile(iconContent, `${iconName}.json`, path.resolve(currentDir, '..'));
|
|
}
|
|
});
|