@busflow/types
Status: Scaffold — not yet implemented
Purpose
Single source of truth for TypeScript interfaces and Valibot schemas. Schemas validate at runtime; types are inferred — never defined separately.
Design Rules
- Valibot preferred over Zod (tree-shakeable, minimal bundle size)
- Types are always inferred via
v.InferOutput<typeof Schema> - No standalone
typeorinterfacedefinitions — always derive from schemas "sideEffects": falsefor maximum tree-shaking
Key Schemas (planned)
TourSchema/TripSchemaBookingSchema/PassengerSchemaVehicleSchema/DriverSchemaTicketSchema/SeatSchema
Consumers
All apps, all services.
Public API / Entrypoints
.— shared schema/type exports fromsrc/index.ts./graphql— generated GraphQL types./schemas/*— schema-specific imports for narrow consumers
Key Commands
bash
pnpm --filter @busflow/types lint
pnpm --filter @busflow/types cleanRelated Docs
Common Pitfalls
- Do not hand-write TypeScript interfaces that can be inferred from schemas.
- Keep generated GraphQL output separate from domain schemas.