···11+#!/bin/bash
22+33+# Get all staged files
44+staged_files=$(git diff --cached --name-only --diff-filter=ACM)
55+if [ -z "$staged_files" ]; then
66+ echo "No staged files found."
77+ exit 0
88+fi
99+1010+echo "📦 staged files:"
1111+echo "$staged_files" | sed 's/^/ /'
1212+1313+# Format all staged files that deno can handle
1414+formattable=$(echo "$staged_files" | grep -E '\.(ts|tsx|js|jsx|json|jsonc)$' || true)
1515+1616+if [ -n "$formattable" ]; then
1717+ echo "🎨 deno fmt..."
1818+ echo "$formattable" | xargs deno fmt
1919+2020+ # Re-stage formatted files
2121+ echo "$formattable" | xargs git add
2222+ echo " ✓ formatted and re-staged files"
2323+fi
2424+2525+# Type check TypeScript files
2626+checkable=$(echo "$staged_files" | grep -E '\.(ts|tsx)$' || true)
2727+if [ -n "$checkable" ] && [ "$SKIP_DENO_CHECK" != "1" ]; then
2828+ failed=0
2929+ echo "🧹 deno lint..."
3030+ if echo "$checkable" | xargs deno lint --fix; then
3131+ echo " ✓ lint passed"
3232+ else
3333+ echo "lint failed; skip with SKIP_DENO_CHECK=1 git commit"
3434+ echo "skip: SKIP_DENO_CHECK=1 git commit"
3535+ failed=1
3636+ fi
3737+ echo "🔧 deno check..."
3838+ if deno check; then
3939+ echo " ✓ type check passed"
4040+ else
4141+ echo "type check failed; skip with SKIP_DENO_CHECK=1 git commit"
4242+ failed=1
4343+ fi
4444+4545+ [[ $failed -ne 0 ]] && exit 1
4646+fi
4747+echo "🚀 All checks passed!"
4848+exit 0
+7
readme.org
···19192020* Development
21212222+Run the pwa+server with:
2323+2224#+BEGIN_SRC bash
2325$ deno run dev
2426#+END_SRC
···3840- docker compose for deployment with self-hosted KV
39414042See [[./devlog.org]] for design and architecture information.
4343+4444+* Contributing
4545+4646+- run ~git config core.hooksPath .githooks~ to install pre-commit hooks for lint/fmt
4747+- not really open to contributions right now, come back later.
41484249* License & Copyright
4350
+3-3
src/types/branded-id.ts
···33import { z } from "zod/v4";
4455/** result from a branded id maker invocation */
66-export interface BrandedIdResult<T extends string, Z extends z.ZodType> {
66+export interface BrandedId<T extends string, Z extends z.ZodType> {
77 generator: () => T;
88 validator: (i?: unknown) => i is T;
99 parser: (i?: unknown) => T;
···1111}
12121313/** given a branded id maker, return the branded id type */
1414-export type inferBrandedId<T> = T extends BrandedIdResult<infer U, infer _> ? U
1414+export type inferBrandedId<T> = T extends BrandedId<infer U, infer _> ? U
1515 : never;
16161717/**
···5151 validator,
5252 parser,
5353 schema,
5454- } satisfies BrandedIdResult<BrandType, typeof schema>;
5454+ } satisfies BrandedId<BrandType, typeof schema>;
5555}