baobao-codegen
Shared code generation utilities for Bao CLI generator.
This crate provides language-agnostic abstractions and utilities used by language-specific code generators (e.g., baobao-codegen-rust, baobao-codegen-typescript).
Features
- Code Building - Utilities for generating code (
CodeBuilder,FileBuilder) - Command Tree - Structures for representing command hierarchies (
CommandTree,FlatCommand) - Handler Management - Tools for tracking handler files and detecting orphaned commands
- Import Collection - Dependency and import tracking (
DependencyCollector,ImportCollector) - Naming Conventions - Language-specific naming rules (
NamingConvention) - Traits - Common interfaces for code generators (
LanguageCodegen,TypeMapper)
Usage
This crate is used by language-specific code generators. You typically don't need to use it directly unless you're implementing a new language generator.
use ;
use ;
// Implement LanguageCodegen for a new language
Testing Support
Enable the testing feature for test utilities:
[]
= { = "0.3", = ["testing"] }
License
This project is licensed under the MIT license.