Skip to content

Commit

Permalink
feat(scripts): output const icons in codegen script
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer authored and rektdeckard committed Jan 22, 2024
1 parent dd1d952 commit 8e886e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions scripts/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ async function main() {
let fileString = `\
import { IconEntry, IconCategory, FigmaCategory } from "./types";
export const icons: ReadonlyArray<IconEntry> = [
export type PhosphorIcon = typeof icons[number]
export const icons = <const>[
`;

console.log(res.data.icons);
Expand Down Expand Up @@ -103,7 +105,7 @@ export const icons: ReadonlyArray<IconEntry> = [
});

fileString += `
];
] satisfies readonly IconEntry[];
`;

try {
Expand Down
6 changes: 3 additions & 3 deletions src/icons.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { IconEntry, IconCategory, FigmaCategory } from "./types";

export type PhosphorIcon = typeof icons[number]
export type PhosphorIcon = (typeof icons)[number];

export const icons = <const>[
export const icons = (<const>[
{
name: "address-book",
pascal_name: "AddressBook",
Expand Down Expand Up @@ -16808,4 +16808,4 @@ export const icons = <const>[
published_in: 1.0,
updated_in: 1.0,
},
] satisfies ReadonlyArray<IconEntry>;
]) satisfies readonly IconEntry[];

0 comments on commit 8e886e9

Please sign in to comment.