Skip to main content

tsh/
lib.rs

1//! Compile a statically checked TypeScript subset to standalone shell source.
2//!
3//! ```
4//! use tsh::{compile_source, CompileOptions, TargetOs};
5//!
6//! let options = CompileOptions { os: TargetOs::Linux, ..Default::default() };
7//! let script = compile_source("hello.tsh", "echo('Hello');", &options)?;
8//! assert!(script.starts_with("#!/usr/bin/env bash"));
9//! # Ok::<(), tsh::CompileError>(())
10//! ```
11pub mod backends;
12pub mod compiler;
13pub mod ir;
14pub mod options;
15pub mod runner;
16pub use compiler::diagnostics::CompileError;
17pub use compiler::{check_file, compile_file, compile_source};
18pub use options::{Comments, CompileOptions, Target, TargetOs};