660855ecd6
Protobuf data model (Template/PrintJob/MaterialProfile/PrintParameters) with codegen targets for TypeBox+TS types (packages/ts-types) and prost-derived Rust structs (packages/rust-types). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
1.3 KiB
Markdown
36 lines
1.3 KiB
Markdown
# continuum-schemas
|
|
|
|
Single source of truth for the Continuum data model. Protobuf definitions in
|
|
`proto/` are compiled into two consumer packages:
|
|
|
|
- `packages/ts-types` — TypeScript types generated via `ts-proto`, plus
|
|
hand-written [TypeBox](https://github.com/sinclairzx81/typebox) schemas
|
|
under `src/schemas/` used for runtime validation in `continuum-backend`'s
|
|
ElysiaJS routes.
|
|
- `packages/rust-types` — a Rust crate (`continuum-rust-types`) that compiles
|
|
the same `.proto` files with `prost-build` (via `build.rs`), producing
|
|
`serde`-derived structs for `continuum-proxy` and `continuum-ai-worker`.
|
|
|
|
## Layout
|
|
|
|
```
|
|
proto/continuum/v1/ canonical .proto message definitions
|
|
packages/ts-types/ TypeBox schemas + generated TS proto types
|
|
packages/rust-types/ prost-generated Rust structs (build.rs codegen)
|
|
```
|
|
|
|
## Build
|
|
|
|
Requires `protoc` on `PATH` and `npm install` run at the repo root first.
|
|
|
|
```
|
|
npm install
|
|
npm run build:ts # protoc + ts-proto -> packages/ts-types/src/generated
|
|
npm run build:rust # cargo build, runs build.rs -> prost-generated structs
|
|
npm run build # both
|
|
```
|
|
|
|
Generated TS output under `packages/ts-types/src/generated` is build-derived
|
|
and gitignored. The Rust crate's generated code lands in `OUT_DIR` per
|
|
standard `prost-build` conventions and is never committed.
|