diff --git a/bun.lockb b/bun.lockb index 2d2c226..e96fdef 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 6b35732..6bb66f9 100644 --- a/package.json +++ b/package.json @@ -17,45 +17,45 @@ }, "dependencies": { "@astrojs/check": "0.9.4", - "@astrojs/mdx": "4.0.1", - "@astrojs/netlify": "6.0.0", - "@astrojs/partytown": "^2.1.2", - "@astrojs/starlight": "^0.29.2", - "@astrojs/react": "4.0.0", + "@astrojs/mdx": "4.0.3", + "@astrojs/netlify": "6.0.1", + "@astrojs/partytown": "^2.1.3", + "@astrojs/starlight": "^0.30.4", + "@astrojs/react": "4.1.2", "@astrojs/sitemap": "^3.2.1", - "@astrojs/tailwind": "5.1.3", + "@astrojs/tailwind": "5.1.4", "@mdx-js/mdx": "^3.1.0", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-icons": "^1.3.2", "@radix-ui/themes": "^3.1.6", - "@tailwindcss/typography": "^0.5.15", - "@types/bun": "^1.1.14", - "@types/canvas-confetti": "^1.6.4", - "@types/lodash": "^4.17.13", + "@tailwindcss/typography": "^0.5.16", + "@types/bun": "^1.1.15", + "@types/canvas-confetti": "^1.9.0", + "@types/lodash": "^4.17.14", "@types/prompts": "^2.4.9", - "@types/react": "^18.3.12", - "@types/react-dom": "^18.3.1", + "@types/react": "^19.0.3", + "@types/react-dom": "^19.0.2", "@vercel/og": "^0.6.4", - "astro": "5.0.1", + "astro": "5.1.3", "canvas-confetti": "^1.9.3", "clsx": "^2.1.1", "github-slugger": "^2.0.0", "lodash": "^4.17.21", - "lucide-react": "^0.454.0", + "lucide-react": "^0.469.0", "prettier": "^3.4.2", "prettier-plugin-astro": "^0.14.1", "prettier-plugin-tailwindcss": "^0.6.9", "prompts": "^2.4.2", - "react": "^18.3.1", - "react-dom": "^18.3.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", "rehype-slug": "^6.0.0", "remark-gfm": "^4.0.0", - "tailwindcss": "^3.4.16", + "tailwindcss": "^3.4.17", "typescript": "^5.7.2", - "zod": "^3.23.8" + "zod": "^3.24.1" }, "devDependencies": { - "@types/node": "^22.10.1", - "knip": "^5.39.1" + "@types/node": "^22.10.5", + "knip": "^5.41.1" } } diff --git a/src/components/client/DiceRoller/DiceRoller.tsx b/src/components/client/DiceRoller/DiceRoller.tsx index 8179b7e..6c4740e 100644 --- a/src/components/client/DiceRoller/DiceRoller.tsx +++ b/src/components/client/DiceRoller/DiceRoller.tsx @@ -144,7 +144,7 @@ export function DiceRoller(props: { theme?: ThemeType; button?: boolean }) { return ( {renderButton ? ( - <> +
{ @@ -182,9 +182,9 @@ export function DiceRoller(props: { theme?: ThemeType; button?: boolean }) { {renderDialogContent()} - +
) : ( - <>{renderDialogContent()} +
{renderDialogContent()}
)}
); diff --git a/src/components/client/NothingToShowHere/NothingToShowHere.tsx b/src/components/client/NothingToShowHere/NothingToShowHere.tsx index a421bda..bf6243d 100644 --- a/src/components/client/NothingToShowHere/NothingToShowHere.tsx +++ b/src/components/client/NothingToShowHere/NothingToShowHere.tsx @@ -1,5 +1,6 @@ import { Container, Flex, Text } from "@radix-ui/themes"; import { CircleOff } from "lucide-react"; +import type { JSX } from "react"; import { MDXH1 } from "../MDX/MDX"; export function NothingToShowHere(props: { diff --git a/src/domains/dl/DLAstro.tsx b/src/domains/dl/DLAstro.tsx index 5a3e802..b4eeb4d 100644 --- a/src/domains/dl/DLAstro.tsx +++ b/src/domains/dl/DLAstro.tsx @@ -13,6 +13,10 @@ export const DLAstro = { }) { const creator = await getEntry("creators", props.id); + if (!creator) { + throw new Error("DLAstro.getCreator: Creator not found"); + } + let games: Array> = []; let resources: Array> = []; if (props.includeGames) { @@ -46,6 +50,10 @@ export const DLAstro = { }) { const game = await getEntry("games", props.id); + if (!game) { + throw new Error("DLAstro.getGame: Game not found"); + } + if (props.includeCreator) { const creator = await getEntry("creators", game.data.creator.id); return { game, creator }; @@ -60,6 +68,10 @@ export const DLAstro = { games.map(async (game) => { const creator = await getEntry("creators", game.data.creator.id); + if (!creator) { + throw new Error("DLAstro.getAllGamesWithCreator: Creator not found"); + } + const assets = props.includeAssets ? await getCollection("assets", (item) => { return item.data.game.id === game.id; @@ -82,6 +94,10 @@ export const DLAstro = { }) { const asset = await getEntry("assets", props.id); + if (!asset) { + throw new Error("DLAstro.getAssetWithGameAndCreator: Asset not found"); + } + const game = await getEntry(asset.data.game); const creator = await getEntry(game.data.creator); return { @@ -110,6 +126,10 @@ export const DLAstro = { return element.id.startsWith(idWithoutLocale); }); + if (!resource) { + throw new Error("DLAstro.getResource: Resource not found"); + } + const locales = translations .map((element) => { const language = element.id @@ -153,6 +173,12 @@ export const DLAstro = { resources.map(async (resource) => { const creator = await getEntry("creators", resource.data.creator.id); + if (!creator) { + throw new Error( + "DLAstro.getAllResourcesWithCreator: Creator not found", + ); + } + return { resource, creator, diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 484d1d1..7fc98f8 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -22,6 +22,7 @@ import LogoSrc from "../components/server/Header/logo.png"; import { Colors } from "../domains/colors/colors"; import { getTheme, type ThemeType } from "../domains/utils/getTheme"; import "./index.css"; +import { DLAstro } from "../domains/dl/DLAstro"; type Props = { title: Array | undefined; @@ -48,7 +49,10 @@ const description = const headingFont = props.headingFont; const bodyFont = props.bodyFont; -const songsAndSagas = await getEntry("games", "fari-rpgs/songs-and-sagas"); +// const songsAndSagas = await getEntry("games", "fari-rpgs/songs-and-sagas"); +const songsAndSagas = await DLAstro.getGame({ + id: "fari-rpgs/songs-and-sagas", +}); const fontsAsString = [headingFont, bodyFont] .filter((font) => font !== undefined) @@ -166,7 +170,7 @@ const ogImageUrl = props.withOgImage
{ props.withDefaultBanner && ( - + ) }