tenniscommon
v1.1.50
Published
Types for Tennis application
Downloads
261
Readme
tenniscommon — Project Summary
tenniscommon is a shared TypeScript domain library used across the Tennis application ecosystem. It centralizes the interfaces/types, validation schemas, utility helpers, and initial/default data + stats factories so both:
- tennisClient (Next.js frontend) and
- tennisServer (Node.js / Express API backend)
consume the same source of truth for data shapes and validation rules.
What it provides
The library is organized by feature/domain (for example: general, player, opponent, matchplay, tournament, training, spending, performance, chat). Each domain typically contains:
- Interfaces & unions for strong typing across client/server
- Zod validation for runtime input validation (useful for API boundaries and form validation)
- Initial data / stats creators to generate safe “empty/default” objects for new records and dashboards
- Exports via index files so consumers can import per-domain
Build & distribution
Because it’s consumed by both Node.js and Next.js, tenniscommon is built in two module formats:
- CommonJS (CJS) output in
dist/cjs - ES Modules (ESM) output in
dist/esm - Type declarations in
dist/types
This allows modern ESM tooling (like Next.js) and traditional Node.js CommonJS usage to both work cleanly from the same package.
