baobao-codegen-typescript

Crates.iobaobao-codegen-typescript
lib.rsbaobao-codegen-typescript
version0.5.0
created_at2025-12-10 13:45:32.943295+00
updated_at2025-12-24 15:35:15.271817+00
descriptionTypeScript code generator for Bao CLI generator
homepagehttps://github.com/roushou/bao
repositoryhttps://github.com/roushou/bao
max_upload_size
id1978040
size181,412
Roushou (roushou)

documentation

README

baobao-codegen-typescript

TypeScript code generator for Bao CLI generator.

This crate generates TypeScript CLI applications using boune, a CLI library targeting Bun runtime.

Usage

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"))?;

Generated 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

License

This project is licensed under the MIT license.

Commit count: 0

cargo fmt