Expand description
Shared code generation utilities for Bao CLI generator.
This crate provides language-agnostic abstractions and utilities
used by language-specific code generators (e.g., bao-codegen-rust).
Structs§
- Code
Builder - Fluent API for building code with proper indentation.
- Command
Info - Info about a command for code generation
- Context
Field Info - Info about a context field for code generation
- Dependency
Collector - Tracks package dependencies with versions and features.
- Dependency
Spec - Specification for a package dependency.
- File
Builder - Composable file builder that combines import collection with code generation.
- Flat
Command - Flattened command info for easier processing.
- Generate
Result - Result of code generation
- Handler
Paths - Manages handler file paths for a code generator.
- Import
Collector - Tracks imports and deduplicates them.
- Naming
Convention - Language-specific naming conventions.
- Pool
Config Info - Pool configuration for code generation
- Preview
File - A generated file for preview
- Sqlite
Config Info - SQLite-specific configuration for code generation
Enums§
- Indent
- Indentation style for generated code.
Traits§
- Command
Visitor - Visitor trait for command tree traversal.
- Language
Codegen - Trait for language-specific code generators.
- Type
Mapper - Trait for mapping schema types to language-specific type strings.
Functions§
- collect_
handler_ paths - Collect all handler paths from a schema.
- collect_
leaf_ handler_ paths - Collect only leaf handler paths (actual handler files, not parent directories).
- flatten_
commands - Walk all commands in a schema and return a flat list.
- leaf_
commands - Get only leaf commands (commands without subcommands).
- parent_
commands - Get only parent commands (commands with subcommands).
- walk_
commands - Walk all commands with a visitor.