diff --git a/src/components/frontend/eod/MinesweeperBoard.tsx b/src/components/frontend/eod/MinesweeperBoard.tsx index 8e98f57..1309713 100644 --- a/src/components/frontend/eod/MinesweeperBoard.tsx +++ b/src/components/frontend/eod/MinesweeperBoard.tsx @@ -20,6 +20,7 @@ import { PROFILE_UPDATE_EVENT } from "@/hooks/useGameTick"; import { useSessionExpired } from "@/hooks/useSessionExpired"; import { LoginLink } from "@/components/frontend/auth/LoginLink"; import { cn } from "@/lib/utils"; +import { playClear, playExplosion, playFlag, playReveal, playXp } from "./sounds"; type Phase = "ready" | "playing" | "over"; type GameMode = EodDifficulty | "custom"; diff --git a/src/tools/import/importArmaLibrary.ts b/src/tools/import/importArmaLibrary.ts index 7c19019..292305d 100644 --- a/src/tools/import/importArmaLibrary.ts +++ b/src/tools/import/importArmaLibrary.ts @@ -24,6 +24,8 @@ import { spawnSync } from "child_process"; import { existsSync, mkdirSync, readFileSync } from "fs"; import { dirname, join } from "path"; +import { getPayload } from "payload"; +import config from "@payload-config"; interface CliOpts { catalog?: string[]; @@ -43,8 +45,9 @@ function parseCli(argv: string[]): CliOpts { if (a === "--approve") { opts.approve = true; continue; } if (a === "--dry-run") { opts["dry-run"] = true; continue; } if (a.startsWith("--") && i + 1 < argv.length && !argv[i + 1].startsWith("--")) { - const key = a.slice(2) as keyof CliOpts; - (opts[key] ??= []).push(argv[++i]); + const key = a.slice(2) as Exclude; + const value = argv[++i]; + (opts[key] ??= []).push(value); } } return opts; @@ -135,7 +138,7 @@ function planImport( const ref = iconRef || pictureRef; const paaPath = ref ? resolvePaaPath(ref, lookups.paaRoot) : ""; const pngPath = paaPath - ? convertPaaToPng(lookups.hemtt, paaPath, join(lookups.outDir)) + ? (convertPaaToPng(lookups.hemtt, paaPath, join(lookups.outDir)) ?? "") : ""; const screenshotPath = lookups.screenshots ? (["png", "webp", "jpg"].map((e) => join(lookups.screenshots, clazz + "." + e)).find(existsSync) ?? "") @@ -151,7 +154,7 @@ async function resolveFuelConfig(payload: { find: (args: any) => Promise<{ docs: } async function writeEntry( - payload: { create: (args: { collection: string; data: any }) => Promise; update: (args: { collection: string; id: number; data: any }) => Promise }, + payload: any, plan: ImportPlan, opts: { outDir: string }, fuelId: number, @@ -229,8 +232,7 @@ async function main() { if (dryRun) { console.log(`\nDry run: ${plans.length} would import, 0 applied.`); return; } - const { getPayload } = await import("@payload-config"); - const payload = await getPayload({ config: (await import("@payload-config")).default }); + const payload = await getPayload({ config }); const fuel = await resolveFuelConfig(payload); let ok = 0, err = 0; for (const plan of plans) {