Skip to content

Commit

Permalink
chore(bin): move to /scripts and rely on API for aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
rektdeckard committed Jan 8, 2024
1 parent 21d20a9 commit dad3260
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"./assets"
],
"scripts": {
"fetch": "node ./bin/fetch.js && yarn format",
"fetch": "node ./scripts/fetch.js && yarn format",
"format": "prettier --write ./src/**",
"build": "vite build && tsc --emitDeclarationOnly"
},
Expand Down
10 changes: 5 additions & 5 deletions bin/fetch.js → scripts/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const chalk = require("chalk");
const { Command } = require("commander");

const { version } = require("../package.json");
const { CATEGORY_MAP, ALIASES } = require(".");
const { CATEGORY_MAP } = require(".");

const ICON_API_URL = "https://api.phosphoricons.com";

Expand Down Expand Up @@ -66,10 +66,10 @@ export const icons: ReadonlyArray<IconEntry> = [
{
name: "${icon.name}",
pascal_name: "${pascalize(icon.name)}",${
!!ALIASES[icon.name]
? `alias: { name: "${
ALIASES[icon.name]
}", pascal_name: "${pascalize(ALIASES[icon.name])}" },`
!!icon.alias
? `alias: { name: "${icon.alias}", pascal_name: "${pascalize(
icon.alias
)}" },`
: ""
}
categories: ${categories},
Expand Down
16 changes: 1 addition & 15 deletions bin/index.js → scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,4 @@ const CATEGORY_MAP = {
"Weather & Nature": "WEATHER",
};

const ALIASES = {
"file-dashed": "file-dotted",
"file-magnifying-glass": "file-search",
"folder-dashed": "folder-dotted",
"folder-simple-dashed": "folder-simple-dotted",
infinity: "lemniscate",
pulse: "activity",
seal: "circle-wavy",
"seal-check": "circle-wavy-check",
"seal-question": "circle-wavy-question",
"seal-warning": "circle-wavy-warning",
"text-b": "text-bolder",
};

module.exports = { CATEGORY_MAP, ALIASES };
module.exports = { CATEGORY_MAP };
35 changes: 30 additions & 5 deletions src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export const icons: ReadonlyArray<IconEntry> = [
pascal_name: "ArrowBendDoubleUpLeft",
categories: [IconCategory.ARROWS],
figma_category: FigmaCategory.ARROWS,
tags: ["directional", "pointer", "pointing", "arrowhead"],
tags: ["directional", "pointer", "pointing", "arrowhead", "reply-all"],
published_in: 1.0,
updated_in: 1.0,
},
Expand Down Expand Up @@ -505,7 +505,7 @@ export const icons: ReadonlyArray<IconEntry> = [
pascal_name: "ArrowBendUpLeft",
categories: [IconCategory.ARROWS],
figma_category: FigmaCategory.ARROWS,
tags: ["directional", "pointer", "pointing", "arrowhead"],
tags: ["directional", "pointer", "pointing", "arrowhead", "reply", "re"],
published_in: 1.0,
updated_in: 1.0,
},
Expand All @@ -514,7 +514,7 @@ export const icons: ReadonlyArray<IconEntry> = [
pascal_name: "ArrowBendUpRight",
categories: [IconCategory.ARROWS],
figma_category: FigmaCategory.ARROWS,
tags: ["directional", "pointer", "pointing", "arrowhead"],
tags: ["directional", "pointer", "pointing", "arrowhead", "forward", "fwd"],
published_in: 1.0,
updated_in: 1.0,
},
Expand Down Expand Up @@ -4676,7 +4676,16 @@ export const icons: ReadonlyArray<IconEntry> = [
pascal_name: "Cross",
categories: [IconCategory.DESIGN, IconCategory.COMMUNICATION],
figma_category: FigmaCategory.COMMUNICATION,
tags: ["*new*", "dagger"],
tags: [
"*new*",
"dagger",
"crucifix",
"christ",
"christianity",
"religion",
"worship",
"symbol",
],
published_in: 2.0,
updated_in: 2.0,
},
Expand Down Expand Up @@ -6161,6 +6170,10 @@ export const icons: ReadonlyArray<IconEntry> = [
{
name: "file-search",
pascal_name: "FileSearch",
alias: {
name: "file-magnifying-glass",
pascal_name: "FileMagnifyingGlass",
},
categories: [IconCategory.OFFICE, IconCategory.EDITOR],
figma_category: FigmaCategory.OFFICE,
tags: ["documents", "files", "find", "locate", "browse", "missing"],
Expand Down Expand Up @@ -7941,7 +7954,18 @@ export const icons: ReadonlyArray<IconEntry> = [
pascal_name: "Headset",
categories: [IconCategory.MEDIA, IconCategory.GAMES, IconCategory.OBJECTS],
figma_category: FigmaCategory.MEDIA,
tags: ["music", "audio", "listening", "gaming", "voice chat", "microphone"],
tags: [
"music",
"audio",
"listening",
"gaming",
"voice chat",
"microphone",
"headphones",
"support",
"customer-service",
"call-center",
],
published_in: 1.1,
updated_in: 1.1,
},
Expand Down Expand Up @@ -13626,6 +13650,7 @@ export const icons: ReadonlyArray<IconEntry> = [
"video games",
"rpg",
"gaming",
"war",
],
published_in: 1.1,
updated_in: 1.1,
Expand Down

0 comments on commit dad3260

Please sign in to comment.