From 5b169d71314fa7d036d25295bf47d74aa9750da5 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 23 Sep 2026 12:27:16 -0400 Subject: [PATCH] The family list of the Kestrel's Nest, shipped as /family.json and refreshed from the kit at deploy Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG --- deploy/deploy.sh | 4 ++++ src/lib/family.ts | 23 +++++++++++++++++++++++ static/family.json | 21 +++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/lib/family.ts create mode 100644 static/family.json diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 1825b8b..dcfe53d 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -4,6 +4,10 @@ set -euo pipefail HOST="${1:?usage: deploy.sh }" +# The family list is the kit's; a game deploys with the kit's latest copy when the kit is beside it. +KIT_FAMILY="$(dirname "$0")/../../game-kit/family.json" +[ -f "$KIT_FAMILY" ] && cp "$KIT_FAMILY" static/family.json + npm run check npm run check:server npm test diff --git a/src/lib/family.ts b/src/lib/family.ts new file mode 100644 index 0000000..719a5e9 --- /dev/null +++ b/src/lib/family.ts @@ -0,0 +1,23 @@ +// The other games of the Kestrel's Nest, from the family list the kit keeps +// (family.json, one copy shipped with every game), so a player who liked one +// table can find the next. This game is left out of its own list. + +export interface FamilyGame { + slug: string; + name: string; + url: string; + pitch: string; + players: string; + origin: string; +} + +export async function otherGames(self: string): Promise { + try { + const res = await fetch('/family.json', { cache: 'no-cache' }); + if (!res.ok) return []; + const data = (await res.json()) as { games?: FamilyGame[] }; + return (data.games ?? []).filter((g) => g.slug !== self); + } catch { + return []; + } +} diff --git a/static/family.json b/static/family.json new file mode 100644 index 0000000..10d4a2e --- /dev/null +++ b/static/family.json @@ -0,0 +1,21 @@ +{ + "family": "the Kestrel's Nest", + "games": [ + { + "slug": "wizwar", + "name": "Wiz-War", + "url": "https://wizwar.kestrelsnest.social", + "pitch": "Steal treasure. Blast through walls. Outwit your friends.", + "players": "2 to 6", + "origin": "Tom Jolly's board game, sixth edition, 1993" + }, + { + "slug": "waving-hands", + "name": "Waving Hands", + "url": "https://hands.kestrelsnest.social", + "pitch": "Duelling wizards. Two hands each. The right run of gestures is a spell.", + "players": "2 to 12", + "origin": "Richard Bartle's pencil-and-paper duel, 1977" + } + ] +}