refactor: split game renderers into scoped modules

This commit is contained in:
2026-05-19 10:02:29 +07:00 Unverified
parent e47b25b89c
commit 99361e8455
49 changed files with 284 additions and 90 deletions
+2 -2
View File
@@ -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";
+1 -1
View File
@@ -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)}`,