From d5fbc5d2127d60df40a041a50b401789afcd95af Mon Sep 17 00:00:00 2001 From: jableader Date: Sun, 2 Nov 2025 18:33:51 +1100 Subject: [PATCH] Axiom updates --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 708b641..a1f0a41 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,15 @@ Key axioms - No casts (`as`, angle brackets) and no `any`/`unknown` in app code. Generated files are exempt. - Arrays that are required in OpenAPI are non-nullable in domain types (e.g., `Meal.recipes`). - Disallow runtime type checks in app code; acceptable exceptions: DOM event narrowing, error/env handling in the boundary. +- Let the type system prevent mistakes: encode intent in function signatures. Prefer explicit option objects to loose primitives, make required fields non-optional, and avoid permissive overloads that widen the error surface. +- Navigation is slug-scoped and helper-driven: only use `src/router/links.ts` helpers and named routes. For non-id pages pass `{ slug }` or omit to infer; for id pages pass `id` or `{ id, slug }`. Never build path strings or read slugs from route params in components. Layout - `src/api/` — Typed client and SDK boundary - `src/domain/` — Domain types and decoders - `src/composables/` — Reusable app logic (auth, meals, shopping, pagination, alert) - `src/components/` — UI components and pages -- `src/router/` — Routes and helpers (`parseRouteId`, `parseQueryString`) +- `src/router/` — Routes and helpers (`links.ts` for slug-scoped navigation, plus `parseRouteId`, `parseQueryString`) Testing and tooling - Vitest + MSW under `tests/`