mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-12-04 17:09:07 +00:00
Moved from a single icons.json file to separate JSON files per icon
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import path from 'path';
|
||||
import icons from '../icons.json' assert { type: 'json' };
|
||||
import { writeFile, getCurrentDirPath } from './helpers.mjs';
|
||||
|
||||
const currentDir = getCurrentDirPath(import.meta.url)
|
||||
|
||||
Object.keys(icons.icons).forEach(iconName => {
|
||||
const icon = {
|
||||
"$schema": "../icon.schema.json",
|
||||
...icons.icons[iconName]
|
||||
};
|
||||
const iconContent = JSON.stringify(icon, null, 2);
|
||||
writeFile(iconContent, 'icons/'+iconName+'.json', path.resolve(currentDir, '..'));
|
||||
});
|
||||
|
||||
Object.keys(icons.categories).forEach(categoryName => {
|
||||
const category = {
|
||||
"$schema": "../category.schema.json",
|
||||
...icons.categories[categoryName]
|
||||
};
|
||||
const categoryContent = JSON.stringify(category, null, 2);
|
||||
writeFile(categoryContent, 'categories/'+categoryName+'.json', path.resolve(currentDir, '..'));
|
||||
});
|
||||
Reference in New Issue
Block a user