Busflow Docs

Internal documentation portal

Skip to content

@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 type or interface definitions — always derive from schemas
  • "sideEffects": false for maximum tree-shaking

Key Schemas (planned)

  • TourSchema / TripSchema
  • BookingSchema / PassengerSchema
  • VehicleSchema / DriverSchema
  • TicketSchema / SeatSchema

Consumers

All apps, all services.

Public API / Entrypoints

  • . — shared schema/type exports from src/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 clean

Common Pitfalls

  • Do not hand-write TypeScript interfaces that can be inferred from schemas.
  • Keep generated GraphQL output separate from domain schemas.

Internal documentation — Busflow