Skip to main content

Rest/
Library.rs

1#![allow(non_snake_case)]
2
3//! # Rest: JavaScript Bundler for VS Code Platform Code
4//!
5//! Rest compiles VS Code's TypeScript and JavaScript source into optimized
6//! bundles that Cocoon can load at runtime. Built on OXC (Oxidation Compiler)
7//! for native-speed parsing, transformation, and minification.
8//!
9//! ## What Rest Produces
10//!
11//! VS Code's source code is a massive TypeScript/JavaScript codebase. Rest
12//! takes the platform code (workbench, services, platform layers) and bundles
13//! it into self-contained modules that the Cocoon extension host can
14//! `require()`.
15//!
16//! The output lands in the `Output` Element, ready for production use.
17//!
18//! ## Why Not Webpack or esbuild
19//!
20//! Rest uses OXC because it runs at native speed as a Rust library. No Node.js
21//! process needed for bundling. The entire build pipeline stays in Rust.
22//!
23//! ## Modules
24//!
25//! - [`Fn`]: Core bundling functions and OXC integration
26//! - [`Struct`]: Configuration structures and CLI command definitions
27
28#[allow(dead_code)]
29#[tokio::main]
30/// The main entry point for the application.
31///
32/// This function initializes the command structure and executes the
33/// asynchronous function defined within it. The function is marked with the
34/// `#[tokio::main]` attribute to enable asynchronous execution using the Tokio
35/// runtime.
36///
37/// # Panics
38///
39/// This function does not panic.
40///
41/// # Example
42///
43/// ```rust
44/// #[tokio::main]
45/// async fn main() { (Struct::Binary::Command::Struct::Fn().Fn)().await }
46
47/// ```
48async fn main() { (Struct::Binary::Command::Struct::Fn().Fn)().await }
49
50/// Core bundling functions and OXC integration
51pub mod Fn;
52
53/// Configuration structures and CLI command definitions
54pub mod Struct;