frontend/buildSrc/.
Running Code Generation
Generated Code
API Clients (Orval)
API clients are generated from OpenAPI specifications using Orval.src/api/ - TanStack Query hooks and types for all backend endpoints.
See API Integration for usage details.
MXL Parser and Functions
Themxl-gen.ts script generates TypeScript code for MXL formula parsing and autocomplete support.
Source Files:
- Grammar:
mxl/grammars/formulas.lark - Functions:
mxl/functions.yaml
- Parser:
src/gen/formulas/formulas.parser.ts - Functions:
src/gen/formulas/mxl-functions.ts
- Formula parser for syntax highlighting and validation
- Structured type definitions for all MXL functions
- Type-safe function signatures with overloads
- Helper functions for autocomplete and type checking
Type-Safe Routes
Thetypesafe-routes-gen.ts script generates type-safe route definitions for React Router.
src/gen/routes.ts
This ensures route parameters are type-checked and autocompleted.
Zod Schemas
Theorval-zod-client.ts script generates Zod schemas from OpenAPI specifications for runtime validation.
These schemas are used for form validation and API response validation.
Build System
All generators usevite-node for execution, which provides:
- TypeScript support without compilation
- ES modules support
- Fast execution
Adding New Generators
When adding a new generator:- Create the generator script in
buildSrc/ - Add a corresponding npm script in
package.json - If it should run as part of the main generation, update the
genscript - Document it in this file
Workflow: Backend API Changes
When backend APIs change:-
Backend team updates the OpenAPI schema:
-
Frontend regenerates clients:
- TypeScript will show any breaking changes in your code