Updated categories with new icons + upgraded scripts to use pnpm and mjs scripts

This commit is contained in:
Karsa
2022-11-07 11:34:40 +01:00
parent 17ccaeea75
commit 04ada85c0f
11 changed files with 2502 additions and 111 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh
yarn checkIcons
pnpm run checkIcons
<<<<<<< HEAD
exit $?
=======
+307 -20
View File
@@ -1,7 +1,10 @@
{
"accessibility": [
"accessibility",
"baby",
"contrast",
"ear",
"ear-off",
"eye",
"eye-off",
"glasses",
@@ -28,6 +31,9 @@
"bookmark-plus",
"building",
"building-2",
"cake",
"clipboard-signature",
"cog",
"contact",
"cookie",
"credit-card",
@@ -69,6 +75,7 @@
"smile",
"star",
"tag",
"tags",
"thumbs-down",
"thumbs-up",
"ticket",
@@ -79,6 +86,7 @@
"twitter",
"user",
"user-check",
"user-cog",
"user-minus",
"user-plus",
"user-x",
@@ -88,9 +96,16 @@
"vibrate",
"vibrate-off",
"wallet",
"webhook",
"wrench",
"youtube"
],
"animals": [
"bone",
"cat",
"dog",
"egg"
],
"arrows": [
"arrow-big-down",
"arrow-big-left",
@@ -107,6 +122,7 @@
"arrow-right-circle",
"arrow-up",
"arrow-up-circle",
"arrow-up-down",
"arrow-up-left",
"arrow-up-right",
"chevron-down",
@@ -137,8 +153,14 @@
"download-cloud",
"external-link",
"fast-forward",
"file-down",
"file-input",
"file-output",
"file-up",
"folder-down",
"folder-input",
"folder-output",
"folder-up",
"history",
"import",
"inspect",
@@ -227,30 +249,38 @@
"trending-down",
"trending-up"
],
"code": [
"scroll"
],
"coding": [
"binary",
"bitcoin",
"bot",
"box",
"boxes",
"bug",
"cloud-cog",
"code",
"code-2",
"codepen",
"codesandbox",
"command",
"component",
"curly-braces",
"diff",
"file-code",
"file-diff",
"file-digit",
"file-json",
"file-json-2",
"file-terminal",
"function-square",
"git-branch",
"git-branch-plus",
"git-commit",
"git-compare",
"git-fork",
"git-merge",
"git-pull-request",
"git-pull-request-closed",
"git-pull-request-draft",
"github",
"gitlab",
"indent",
@@ -260,12 +290,16 @@
"network",
"option",
"outdent",
"plug",
"plug-2",
"qr-code",
"regex",
"rocket",
"scroll",
"shield",
"terminal",
"terminal-square",
"webhook",
"wrench"
],
"communication": [
@@ -273,6 +307,7 @@
"camera-off",
"mic",
"mic-off",
"newspaper",
"phone",
"phone-call",
"phone-forwarded",
@@ -284,6 +319,9 @@
"screen-share-off",
"send",
"slack",
"smile-plus",
"sticker",
"sticky-note",
"switch-camera",
"video",
"video-off",
@@ -376,9 +414,11 @@
"pencil",
"pointer",
"text-cursor",
"wand"
"wand",
"wand-2"
],
"design": [
"axis-3d",
"box-select",
"brush",
"component",
@@ -386,6 +426,11 @@
"crop",
"dribbble",
"figma",
"file-axis-3d",
"flip-horizontal",
"flip-horizontal-2",
"flip-vertical",
"flip-vertical-2",
"frame",
"framer",
"grab",
@@ -412,34 +457,50 @@
"pen-tool",
"pencil",
"pipette",
"rectangle-horizontal",
"rectangle-vertical",
"rotate-3d",
"rotate-ccw",
"rotate-cw",
"ruler",
"scale-3d",
"scaling",
"scissors",
"slice",
"spline",
"view",
"wand",
"wand-2",
"zoom-in",
"zoom-out"
],
"development": [
"book",
"book-open",
"book-open-check",
"bot",
"box",
"boxes",
"bug",
"cloud-cog",
"codepen",
"codesandbox",
"component",
"curly-braces",
"diff",
"file-diff",
"flag-triangle-left",
"flag-triangle-right",
"function-square",
"git-branch",
"git-branch-plus",
"git-commit",
"git-compare",
"git-fork",
"git-merge",
"git-pull-request",
"git-pull-request-closed",
"git-pull-request-draft",
"github",
"gitlab",
"hard-drive",
@@ -447,12 +508,15 @@
"milestone",
"network",
"package",
"package-2",
"package-check",
"package-minus",
"package-open",
"package-plus",
"package-search",
"package-x",
"plug",
"plug-2",
"pocket",
"puzzle",
"qr-code",
@@ -461,12 +525,15 @@
"rss",
"scroll",
"server",
"server-cog",
"server-crash",
"server-off",
"slack",
"terminal",
"terminal-square",
"trello"
"toy-brick",
"trello",
"webhook"
],
"devices": [
"airplay",
@@ -497,10 +564,12 @@
"gamepad-2",
"hard-drive",
"headphones",
"joystick",
"keyboard",
"laptop",
"laptop-2",
"mic",
"mic-2",
"mic-off",
"monitor",
"monitor-off",
@@ -513,15 +582,19 @@
"phone-missed",
"phone-off",
"phone-outgoing",
"plug",
"plug-2",
"plug-zap",
"printer",
"radio",
"radio-receiver",
"scan",
"scan-face",
"scan-line",
"screen-share",
"screen-share-off",
"server",
"server-cog",
"server-crash",
"server-off",
"smartphone",
@@ -531,6 +604,7 @@
"tablet",
"tv",
"tv-2",
"usb",
"vibrate",
"vibrate-off",
"video",
@@ -543,40 +617,107 @@
"zap-off"
],
"emoji": [
"angry",
"annoyed",
"frown",
"hand-metal",
"heart",
"heart-crack",
"heart-handshake",
"laugh",
"meh",
"party-popper",
"smile",
"smile-plus",
"star"
],
"files": [
"archive",
"archive-restore",
"curly-braces",
"diff",
"download",
"download-cloud",
"file",
"file-archive",
"file-audio",
"file-audio-2",
"file-axis-3d",
"file-badge",
"file-badge-2",
"file-bar-chart",
"file-bar-chart-2",
"file-box",
"file-check",
"file-check-2",
"file-clock",
"file-code",
"file-cog",
"file-cog-2",
"file-diff",
"file-digit",
"file-down",
"file-edit",
"file-heart",
"file-image",
"file-input",
"file-json",
"file-json-2",
"file-key",
"file-key-2",
"file-line-chart",
"file-lock",
"file-lock-2",
"file-minus",
"file-minus-2",
"file-output",
"file-pie-chart",
"file-plus",
"file-plus-2",
"file-question",
"file-scan",
"file-search",
"file-search-2",
"file-signature",
"file-spreadsheet",
"file-symlink",
"file-terminal",
"file-text",
"file-type",
"file-type-2",
"file-up",
"file-video",
"file-video-2",
"file-volume",
"file-volume-2",
"file-warning",
"file-x",
"file-x-2",
"files",
"folder",
"folder-archive",
"folder-check",
"folder-clock",
"folder-closed",
"folder-cog",
"folder-cog-2",
"folder-down",
"folder-edit",
"folder-heart",
"folder-input",
"folder-key",
"folder-lock",
"folder-minus",
"folder-open",
"folder-output",
"folder-plus",
"folder-search",
"folder-search-2",
"folder-symlink",
"folder-tree",
"folder-up",
"folder-x",
"folders",
"headphones",
"image",
"image-minus",
@@ -584,33 +725,76 @@
"image-plus",
"import",
"music",
"music-2",
"music-3",
"music-4",
"package",
"package-2",
"package-search",
"paperclip",
"pie-chart",
"sheet",
"table",
"table-2",
"trash",
"trash-2",
"upload",
"upload-cloud"
],
"food-beverage": [
"apple",
"banana",
"bean",
"bean-off",
"beer",
"cake",
"candy",
"candy-off",
"carrot",
"chef-hat",
"cherry",
"citrus",
"coffee",
"cookie",
"croissant",
"cup-soda",
"dna-off",
"drumstick",
"egg",
"egg-fried",
"egg-off",
"glass-water",
"grape",
"hop",
"hop-off",
"ice-cream",
"martini",
"microwave",
"milk",
"milk-off",
"nut",
"nut-off",
"pizza",
"refrigerator",
"utensils",
"utensils-crossed"
"utensils-crossed",
"vegan",
"wheat",
"wheat-off",
"wine",
"wine-off"
],
"furniture": [
"armchair",
"bed",
"bed-double",
"bed-single",
"lamp",
"lamp-ceiling",
"lamp-desk",
"lamp-floor",
"lamp-wall-down",
"lamp-wall-up",
"rocking-chair",
"sofa"
],
@@ -620,7 +804,9 @@
"beaker",
"book",
"book-open",
"book-open-check",
"box",
"boxes",
"clover",
"coins",
"compass",
@@ -636,6 +822,7 @@
"feather",
"flame",
"flask-conical",
"flask-conical-off",
"flask-round",
"flower",
"gamepad",
@@ -646,6 +833,7 @@
"headphones",
"heart",
"hourglass",
"joystick",
"milestone",
"mountain",
"puzzle",
@@ -659,19 +847,19 @@
"sword",
"swords",
"target",
"toy-brick",
"trophy",
"twitch",
"venetian-mask",
"wand"
"wand",
"wand-2"
],
"health": [
"accessibility",
"activity",
"cigarette",
"cigarette-off",
"fingerprint",
"heart",
"life-buoy",
"siren"
"home": [
"air-vent",
"fan",
"refrigerator",
"shower-head",
"usb"
],
"layout": [
"align-center-horizontal",
@@ -739,6 +927,15 @@
"forward",
"inbox",
"mail",
"mail-check",
"mail-minus",
"mail-open",
"mail-plus",
"mail-question",
"mail-search",
"mail-warning",
"mail-x",
"mails",
"paperclip",
"reply",
"reply-all",
@@ -749,6 +946,7 @@
"maps": [
"anchor",
"compass",
"dumbbell",
"fuel",
"gavel",
"globe",
@@ -794,7 +992,23 @@
"x-square"
],
"medical": [
"siren"
"accessibility",
"activity",
"bone",
"cigarette",
"cigarette-off",
"dna",
"dna-off",
"ear",
"ear-off",
"fingerprint",
"heart",
"heart-pulse",
"life-buoy",
"microscope",
"siren",
"stethoscope",
"syringe"
],
"money": [
"banknote",
@@ -841,9 +1055,15 @@
"loader",
"loader-2",
"megaphone",
"megaphone-off",
"mic",
"mic-2",
"mic-off",
"music",
"music-2",
"music-3",
"music-4",
"newspaper",
"pause",
"pause-circle",
"pause-octagon",
@@ -864,6 +1084,7 @@
"stop-circle",
"tv",
"tv-2",
"usb",
"volume",
"volume-1",
"volume-2",
@@ -913,18 +1134,26 @@
"bell-plus",
"bell-ring",
"check",
"check-check",
"check-circle",
"check-circle-2",
"check-square",
"file-warning",
"help-circle",
"info",
"megaphone",
"megaphone-off",
"shield-alert",
"smile-plus",
"vibrate",
"x",
"x-octagon",
"x-square"
],
"people": [
"baby",
"person-standing"
],
"photography": [
"album",
"aperture",
@@ -940,6 +1169,10 @@
"film",
"flashlight",
"flashlight-off",
"flip-horizontal",
"flip-horizontal-2",
"flip-vertical",
"flip-vertical-2",
"focus",
"frame",
"image",
@@ -960,6 +1193,7 @@
"video-off",
"view",
"wand",
"wand-2",
"zap",
"zap-off",
"zoom-in",
@@ -968,7 +1202,11 @@
"science": [
"beaker",
"flask-conical",
"flask-round"
"flask-conical-off",
"flask-round",
"microscope",
"stethoscope",
"syringe"
],
"seasons": [
"flower-2",
@@ -977,7 +1215,13 @@
"sun"
],
"security": [
"file-key",
"file-key-2",
"file-lock",
"file-lock-2",
"fingerprint",
"folder-key",
"folder-lock",
"heart-handshake",
"key",
"lock",
@@ -997,12 +1241,16 @@
"arrow-right-circle",
"arrow-up-circle",
"box",
"boxes",
"check-circle",
"check-circle-2",
"check-square",
"circle",
"circle-dot",
"circle-ellipsis",
"circle-slashed",
"cross",
"diamond",
"divide-circle",
"divide-square",
"function-square",
@@ -1016,6 +1264,8 @@
"play-circle",
"plus-circle",
"plus-square",
"rectangle-horizontal",
"rectangle-vertical",
"square",
"star",
"stop-circle",
@@ -1047,26 +1297,37 @@
"radio",
"rss",
"scan",
"scan-face",
"scan-line",
"search",
"share",
"share-2",
"slack",
"smile-plus",
"star",
"star-half",
"star-off",
"sticker",
"sticky-note",
"thumbs-down",
"thumbs-up",
"twitch",
"twitter",
"verified",
"webhook",
"youtube"
],
"sports": [
"dumbbell",
"medal",
"trophy"
],
"sustainability": [
"flower",
"flower-2",
"leaf",
"recycle"
"recycle",
"vegan"
],
"text": [
"align-center",
@@ -1084,7 +1345,10 @@
"clipboard",
"clipboard-check",
"clipboard-copy",
"clipboard-edit",
"clipboard-list",
"clipboard-signature",
"clipboard-type",
"clipboard-x",
"code",
"code-2",
@@ -1098,9 +1362,18 @@
"expand",
"external-link",
"file-text",
"file-type",
"file-type-2",
"form-input",
"grid",
"hash",
"heading",
"heading-1",
"heading-2",
"heading-3",
"heading-4",
"heading-5",
"heading-6",
"help-circle",
"highlighter",
"image",
@@ -1146,6 +1419,7 @@
"subscript",
"superscript",
"table",
"table-2",
"text-cursor",
"text-cursor-input",
"type",
@@ -1168,11 +1442,14 @@
"calendar",
"calendar-check",
"calendar-check-2",
"calendar-clock",
"calendar-days",
"calendar-heart",
"calendar-minus",
"calendar-off",
"calendar-plus",
"calendar-range",
"calendar-search",
"calendar-x",
"calendar-x-2",
"clock",
@@ -1188,6 +1465,8 @@
"clock-7",
"clock-8",
"clock-9",
"file-clock",
"folder-clock",
"history",
"hourglass",
"sunrise",
@@ -1220,6 +1499,7 @@
"fuel",
"luggage",
"plane",
"sailboat",
"ticket",
"train",
"truck"
@@ -1230,7 +1510,11 @@
"bath",
"cigarette",
"cigarette-off",
"concierge-bell",
"luggage",
"plane",
"sailboat",
"shower-head",
"utensils",
"utensils-crossed"
],
@@ -1241,11 +1525,13 @@
"cloud-hail",
"cloud-lightning",
"cloud-moon",
"cloud-moon-rain",
"cloud-off",
"cloud-rain",
"cloud-rain-wind",
"cloud-snow",
"cloud-sun",
"cloud-sun-rain",
"cloudy",
"droplet",
"droplets",
@@ -1256,6 +1542,7 @@
"sun",
"sun-dim",
"sun-medium",
"sun-snow",
"sunrise",
"sunset",
"thermometer",
@@ -1268,4 +1555,4 @@
"zap",
"zap-off"
]
}
}
+2132 -44
View File
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -17,10 +17,11 @@
"generate:supersprite": "node ./scripts/generateSuperSVG.mjs",
"optimize": "node ./scripts/optimizeSvgs.mjs",
"addtags": "node ./scripts/addMissingKeysToTags.mjs",
"tags2icons": "node ./scripts/migrateTagsToIcons.js --presets @babel/env",
"icons2tags": "node ./scripts/migrateIconsToTags.js --presets @babel/env",
"icons2categories": "node ./scripts/migrateIconsToCategories.js --presets @babel/env",
"categories2icons": "node ./scripts/migrateCategoriesToIcons.js --presets @babel/env",
"checkIcons": "node scripts/checkIconsAndCategories.mjs --presets @babel/env",
"tags2icons": "node scripts/migrateTagsToIcons.mjs --presets @babel/env",
"icons2tags": "node scripts/migrateIconsToTags.mjs --presets @babel/env",
"icons2categories": "node scripts/migrateIconsToCategories.mjs --presets @babel/env",
"categories2icons": "node scripts/migrateCategoriesToIcons.mjs --presets @babel/env",
"generate:changelog": "node ./scripts/generateChangelog.mjs",
"postinstall": "husky install"
},
@@ -1,8 +1,9 @@
import path from 'path';
import icons from '../icons.json';
import {readSvgDirectory} from './helpers';
import icons from '../icons.json' assert { type: 'json' };
import { readSvgDirectory, getCurrentDirPath } from './helpers.mjs';
const ICONS_DIR = path.resolve(__dirname, '../icons');
const currentDir = getCurrentDirPath(import.meta.url)
const ICONS_DIR = path.resolve(currentDir, '../icons');
console.log(`Read all icons`);
-14
View File
@@ -1,14 +0,0 @@
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, '..'));
+16
View File
@@ -0,0 +1,16 @@
import path from 'path';
import icons from '../icons.json' assert { type: 'json' };
import categories from '../categories.json' assert { type: 'json' };
import { mergeArrays, writeFile, getCurrentDirPath } from './helpers.mjs';
const currentDir = getCurrentDirPath(import.meta.url)
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(currentDir, '..'));
-15
View File
@@ -1,15 +0,0 @@
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, '..'));
+25
View File
@@ -0,0 +1,25 @@
import path from 'path';
import icons from '../icons.json' assert { type: 'json' };
import { writeFile, getCurrentDirPath } from './helpers.mjs';
const currentDir = getCurrentDirPath(import.meta.url)
const newCategories = {};
Object.keys(icons.icons).forEach(iconName => {
icons.icons[iconName].categories.forEach(categoryName => {
newCategories[categoryName] = newCategories[categoryName] || [];
newCategories[categoryName].push(iconName);
});
});
const ordered = Object.keys(newCategories).sort().reduce(
(obj, key) => {
obj[key] = newCategories[key];
return obj;
},
{}
);
const categoriesContent = JSON.stringify(ordered, null, 2);
writeFile(categoriesContent, 'categories.json', path.resolve(currentDir, '..'));
@@ -1,9 +1,10 @@
import path from 'path';
import tags from '../tags.json';
import icons from '../icons.json';
import { readSvgDirectory, writeFile, mergeArrays } from './helpers';
import tags from '../tags.json' assert { type: 'json' };
import icons from '../icons.json' assert { type: 'json' };
import { readSvgDirectory, writeFile, mergeArrays, getCurrentDirPath } from './helpers.mjs';
const ICONS_DIR = path.resolve(__dirname, '../icons');
const currentDir = getCurrentDirPath(import.meta.url)
const ICONS_DIR = path.resolve(currentDir, '../icons');
console.log(`Read all icons`);
@@ -40,4 +41,4 @@ const newTags = iconList.reduce((acc, { name, icon, tags }) => {
const tagsContent = JSON.stringify(newTags, null, 2);
writeFile(tagsContent, 'tags.json', path.resolve(__dirname, '..'));
writeFile(tagsContent, 'tags.json', path.resolve(currentDir, '..'));
@@ -1,9 +1,10 @@
import path from 'path';
import tags from '../tags.json';
import icons from '../icons.json';
import { readSvgDirectory, writeFile, mergeArrays } from './helpers';
import tags from '../tags.json' assert { type: 'json' };
import icons from '../icons.json' assert { type: 'json' };
import { readSvgDirectory, writeFile, mergeArrays, getCurrentDirPath } from './helpers.mjs';
const ICONS_DIR = path.resolve(__dirname, '../icons');
const currentDir = getCurrentDirPath(import.meta.url)
const ICONS_DIR = path.resolve(currentDir, '../icons');
console.log(`Read all icons`);
@@ -43,4 +44,4 @@ newIcons.icons = iconList.reduce((acc, { name, icon, tags }) => {
const iconsContent = JSON.stringify(newIcons, null, 2);
writeFile(iconsContent, 'icons.json', path.resolve(__dirname, '..'));
writeFile(iconsContent, 'icons.json', path.resolve(currentDir, '..'));