gymmonk-schema
v0.67.0
Published
Shared Zod schemas, enums and domain types for GymMonk (fitness SaaS) — single source of truth (SSOT) consumed by gymmonk-backend and gymmonk-web-client.
Maintainers
Readme
gymmonk-schema
Shared Zod schemas, enums and domain types for GymMonk (fitness SaaS).
Single source of truth (SSOT) consumed by both gymmonk-backend and
gymmonk-web-client, so validation, wire types and enums never drift between
the API and the app.
What's inside
- Common (
common.ts) — reusable primitives:objectIdSchema,paginationSchema,optionalTrimmedString,emptyStringToUndefined. - Domain modules (workouts, training library, membership, check-in, …) are
added here as they land, each re-exported through
src/index.ts.
Build & publish (npm-first)
npm install
npm run build # tsc -> dist/
npm publish --access publicprepublishOnly runs build + check (type-check + biome) as the publish gate.
--access public is a CLI flag, not a manifest field.
Consume
In gymmonk-backend and gymmonk-web-client:
npm install gymmonk-schema@<version>
# then delete any nested Zod dup so a single Zod instance is used:
rm -rf node_modules/gymmonk-schema/node_modulesBump the caret pin in each consumer's package.json on every publish (a 0.x
caret locks to the same minor, so npm install won't auto-pick a new minor).
Convention
Mirrors the jansathi schema family (dating-schema, near-me-schema) exactly:
pure ESM, tsc-only build, Zod is a peer dependency (^4.4.0), NodeNext
.js import specifiers, const-object enums fed to z.enum(...).
