mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
Added a base category system.
This commit is contained in:
+1191
-18
File diff suppressed because it is too large
Load Diff
+959
-332
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,8 @@
|
||||
"addtags": "babel-node ./scripts/addMissingKeysToTags.js --presets @babel/env",
|
||||
"tags2icons": "babel-node ./scripts/migrateTagsToIcons.js --presets @babel/env",
|
||||
"icons2tags": "babel-node ./scripts/migrateIconsToTags.js --presets @babel/env",
|
||||
"icons2categories": "babel-node ./scripts/migrateIconsToCategories.js --presets @babel/env",
|
||||
"categories2icons": "babel-node ./scripts/migrateCategoriesToIcons.js --presets @babel/env",
|
||||
"generate:changelog": "babel-node ./scripts/generateChangelog.js --presets @babel/env",
|
||||
"checkIcons": "babel-node ./scripts/checkIconsAndCategories.js --presets @babel/env"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import path from 'path';
|
||||
import icons from '../icons.json';
|
||||
import categories from '../categories.json';
|
||||
import { mergeArrays, writeFile } from './helpers';
|
||||
|
||||
Object.keys(categories).forEach(categoryName => {
|
||||
categories[categoryName].forEach(iconName => {
|
||||
mergeArrays(icons.icons[iconName].categories, [categoryName]);
|
||||
});
|
||||
});
|
||||
|
||||
const iconsContent = JSON.stringify(icons, null, 2);
|
||||
|
||||
writeFile(iconsContent, 'icons.json', path.resolve(__dirname, '..'));
|
||||
@@ -0,0 +1,15 @@
|
||||
import path from 'path';
|
||||
import icons from '../icons.json';
|
||||
import { writeFile } from './helpers';
|
||||
|
||||
const newCategories = {};
|
||||
Object.keys(icons.icons).forEach(iconName => {
|
||||
icons.icons[iconName].categories.forEach(categoryName => {
|
||||
newCategories[categoryName] = newCategories[categoryName] || [];
|
||||
newCategories[categoryName].push(iconName);
|
||||
});
|
||||
});
|
||||
|
||||
const categoriesContent = JSON.stringify(newCategories, null, 2);
|
||||
|
||||
writeFile(categoriesContent, 'categories.json', path.resolve(__dirname, '..'));
|
||||
Reference in New Issue
Block a user