refactor: split game renderers into scoped modules
This commit is contained in:
@@ -2,7 +2,7 @@ import { join } from "node:path";
|
||||
|
||||
import { $, write } from "bun";
|
||||
|
||||
import { libraryRaw } from "@/assets/icons";
|
||||
import { libraryRaw } from "@/games/genshin/assets/icons";
|
||||
|
||||
function toJsx(
|
||||
name: string,
|
||||
@@ -44,7 +44,7 @@ function toJsx(
|
||||
`;
|
||||
}
|
||||
|
||||
const target = join(__dirname, "../src/assets/icons-library.tsx");
|
||||
const target = join(__dirname, "../src/games/genshin/assets/icons-library.tsx");
|
||||
write(
|
||||
target,
|
||||
`import { SVGProps } from "react";
|
||||
|
||||
@@ -30,7 +30,7 @@ fetch("https://gi.yatta.moe/api/v2/en/avatar")
|
||||
).filter((e) => e[1]),
|
||||
);
|
||||
log`crawling complete`;
|
||||
const target = join(__dirname, "../src/lib/namecards.ts");
|
||||
const target = join(__dirname, "../src/games/genshin/data/namecards.ts");
|
||||
await write(
|
||||
target,
|
||||
`// GENERATED BY util/genNamecardRelation\n\nexport const CharacterNamecardMap: Record<string, number> = ${JSON.stringify(map)}`,
|
||||
|
||||
Reference in New Issue
Block a user