chore/deno-template-cherrypick #6

Merged
erik merged 2 commits from chore/deno-template-cherrypick into main 2026-05-18 21:58:45 +00:00
Owner
No description provided.
Cherry-pick conventions, tooling, and structure from tfks/template-deno
to align trippin with the house Deno project template.

- pre-commit hook (.githooks/pre-commit) running deno fmt --check + lint
- modular justfile: top-level + test.just + migrate.just + docker.just,
  with new setup/validate/release/agent-*/fjx-install recipes
- strict TypeScript (noUncheckedIndexedAccess deferred — ~150 latent
  errors to address in a follow-up change)
- fmt.semiColons: false + proseWrap: preserve; reformat all of src/
- coverage block in deno.json + scripts/coverage-{summary,check}.ts
- fast-check + @std/assert deps; src/fuzz/ starter
- Dockerfile (Fresh build) + .dockerignore
- .forgejo/ workflows + fjx cache gitignore entries
- src/scripts/k6/baseline.js (excluded from deno check)
- rename CLAUDE.md → AGENTS.md (CLAUDE.md as symlink); .env.example → env.example
- update AGENTS.md dev-commands table and TESTING.md to new recipe names
chore: enable noUncheckedIndexedAccess and fix latent errors
Some checks failed
Validate / validate (pull_request) Failing after 4s
1afc478f6d
Turn on noUncheckedIndexedAccess in deno.json and patch the ~150 errors
it surfaced. The fixes are mechanical and runtime-erased (`!` and
`!.field`); no behavior change.

Patterns applied:
- Fresh route params (ctx.params.X): file-system router guarantees presence
- INSERT RETURNING id rows (rows[0]!.id / rows[0]![0]): single-row invariant
- Manual length === 0 guard (rows.length === 0 → rows[0]!): TS doesn't narrow
- Typed-array numeric loops (pixels[i]!): in-range by construction
- Turf coordinate tuples (point[0]!, point[1]!): always [lon, lat]
- Regex required capture groups (m[1]!): always captured when match succeeds

Verification:
- deno check src/ — clean
- just check — green
- deno test src/lib/curation/ src/lib/web-components/map-control-host.test.ts
  src/lib/pois/upload.test.ts — 31 passed (image-processing math intact)

Adds wiki/strict-typescript.md documenting the patterns and anti-patterns
so the conventions don't have to be rediscovered.
erik merged commit 6cf2127daa into main 2026-05-18 21:58:45 +00:00
erik deleted branch chore/deno-template-cherrypick 2026-05-18 21:58:45 +00:00
Sign in to join this conversation.
No description provided.