Expand description
§cuenv-cubes
CUE Cubes - code generation and project scaffolding from CUE templates.
This crate provides a code generation system based on CUE Cubes that:
- Uses schema-wrapped code blocks (e.g.,
schema.#TypeScript,schema.#JSON) - Supports managed (always regenerated) and scaffold (generate once) file modes
- Integrates with
cuenv sync cubescommand
§What is a CUE Cube?
A Cube is a CUE-based template that generates multiple project files.
Define your files in CUE with type-safe schemas, then sync them with
cuenv sync cubes.
§Example
schema.#Project & {
name: "my-service"
cube: {
files: {
"package.json": schema.#JSON & {
mode: "managed"
content: """{"name": "my-service"}"""
}
}
}
}Re-exports§
pub use cube::Cube;pub use generator::GenerateOptions;pub use generator::Generator;
Modules§
- config
- Formatter configuration generation
- cube
- CUE Cube loading and evaluation
- formatter
- Code formatting integration
- generator
- File generation engine
Enums§
- Codegen
Error - Errors that can occur during code generation
Type Aliases§
- Result
- Result type for codegen operations