globetrotter_typescript/
lib.rs

1#![allow(warnings)]
2
3pub mod config;
4
5#[cfg(feature = "swc")]
6mod ast_swc;
7
8#[cfg(feature = "swc")]
9pub use ast_swc::Error;
10#[cfg(feature = "swc")]
11pub use ast_swc::generate_translations_type_export;
12
13pub use config::OutputConfig;
14
15#[must_use]
16pub fn preamble() -> String {
17    unindent::unindent(&format!(
18        "\
19        //
20        // AUTOGENERATED. DO NOT EDIT.
21        // generated by globetrotter v{}.
22        //
23        ",
24        std::env!("CARGO_PKG_VERSION"),
25    ))
26}
27
28#[cfg(test)]
29pub mod tests {
30    use color_eyre::eyre;
31
32    static INIT: std::sync::Once = std::sync::Once::new();
33
34    /// Initialize test
35    ///
36    /// This ensures `color_eyre` is setup once.
37    pub fn init() {
38        INIT.call_once(|| {
39            color_eyre::install().ok();
40        });
41    }
42}