protocol: generate workspace TypeScript types

This commit is contained in:
2026-06-23 15:08:22 +09:00
parent 746c51c701
commit a13fb6933b
9 changed files with 311 additions and 4 deletions
@@ -0,0 +1,16 @@
#[cfg(feature = "typescript")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = protocol::typescript::generated_typescript_path();
if let Some(parent) = path.parent() {
std::fs::create_dir_all(parent)?;
}
std::fs::write(&path, protocol::typescript::generated_protocol_types())?;
println!("wrote {}", path.display());
Ok(())
}
#[cfg(not(feature = "typescript"))]
fn main() {
eprintln!("enable the `typescript` feature to generate protocol TypeScript bindings");
std::process::exit(2);
}