The minor and patch group of #3108 without MikroORM: 7.2.9 refuses to set the OAuth client reference from its client_id (the Postgres probe fails on OauthTokens.insertToken and OauthConsents.upsertGrant), so MikroORM stays on 7.2.8 and with it better-sqlite3 and kysely, which it pins exactly. mapbox-gl 3.33 shapes right-to-left text itself and removed setRTLTextPlugin, so the engine registers nothing any more and @mapbox/mapbox-gl-rtl-text, its Vite alias and the registration guard go. The WebAssembly module it loads instead comes from api.mapbox.com, which the CSP already allows. jsdom 31 and isomorphic-dompurify 4 move together, since the sanitizer needs jsdom 31. jsdom is also a root devDependency now: listed only in the client, npm nests it under client/ where vitest's built-in jsdom environment does not find it. dotenv 18 is loaded through `import 'dotenv/config'` only, which stays quiet. Closes #3108, closes #3109, closes #3110, closes #3112
@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.