The planner's cards fold to their head: waypoints, the paddle time estimate, the wind and the checklist on the left, the open tour's summary on the right. The title or the chevron folds a card, and the choice is kept in this browser, so a reload finds the rails as they were left. A folded card still says what matters in its head: the checklist what is open, the wind its day, and the time estimate now its total as a badge, in the warning tone while parts of it are unknown. The "planning values" badge and info dot of the estimate go; what the starting values are is said once under its figures. The obstacle entry dialog sits outside the checklist's body, so an obstacle picked on the map still opens with the card folded. The trip totals start folded to their counts and show each type's sums as the row's white badges, each named in its tooltip, an incomplete one marked as at least that much with how many tours it is known for. The info text is shorter. The Tours locale contract counts the 574 general keys the planned cards brought in.
@trek/shared
Single source of truth for TREK's API contracts, expressed as Zod schemas and consumed by both the server (request validation + inferred DTO types) and the client (typed requests/responses).
This package is part of the incremental NestJS + React 19 migration (see the "Brownfield Rewrite" board). It is intentionally dormant until modules start importing it — adding it changes nothing for users.
Rules
- One folder per domain:
src/<domain>/<domain>.schema.ts(+.spec.ts). - Domain-agnostic building blocks live in
src/common/. - A route is only considered migrated once its contract lives here.
- Schemas are the source of truth; server DTOs and client types are inferred from them
(
z.infer<typeof schema>), never hand-duplicated.
Consumption (dev)
Both apps resolve @trek/shared to this package's TypeScript source:
- Server (
tsx): viapathsinserver/tsconfig.json. - Client (
vite): viaresolve.aliasinclient/vite.config.ts(+pathsfor the type-checker).
Production packaging (Docker / workspace wiring) is introduced in card F2, when the server first depends on this package at runtime. Until then prod builds are untouched.
Not yet here
The canonical error envelope is finalised in card F5 (it must match TREK's current Express error responses byte-for-byte), so it is deliberately not invented in F1.