| Crates.io | baobao-codegen-typescript |
| lib.rs | baobao-codegen-typescript |
| version | 0.5.0 |
| created_at | 2025-12-10 13:45:32.943295+00 |
| updated_at | 2025-12-24 15:35:15.271817+00 |
| description | TypeScript code generator for Bao CLI generator |
| homepage | https://github.com/roushou/bao |
| repository | https://github.com/roushou/bao |
| max_upload_size | |
| id | 1978040 |
| size | 181,412 |
TypeScript code generator for Bao CLI generator.
This crate generates TypeScript CLI applications using boune, a CLI library targeting Bun runtime.
This crate is used internally by the baobao CLI tool. You typically don't need to use it directly.
use baobao_codegen_typescript::Generator;
use baobao_codegen::LanguageCodegen;
use baobao_manifest::Manifest;
use std::path::Path;
let manifest = Manifest::from_file("bao.toml")?;
let generator = Generator::new(&manifest);
// Preview files without writing
let files = generator.preview();
// Generate files to disk
let result = generator.generate(Path::new("output"))?;
The generator produces a TypeScript CLI project:
output/
├── src/
│ ├── cli.ts # Main CLI setup with boune
│ ├── context.ts # Shared context (database pools, HTTP clients)
│ ├── index.ts # Entry point
│ ├── commands/ # Command definitions
│ │ └── *.ts
│ └── handlers/ # Handler stubs for implementation
│ └── *.ts
├── package.json
├── tsconfig.json
├── bao.toml
└── .gitignore
This project is licensed under the MIT license.