Welcome to Rest, the Rust-based JavaScript/TypeScript bundler and build system for the Land Code Editor. Rest leverages the OXC (Oxidation Compiler) ecosystem for ultra-fast parsing, transformation, and code generation of JavaScript and TypeScript code, with parallel processing via rayon and intelligent watch mode support.
Rest is engineered to:
- Provide Ultra-Fast Bundling: Utilize OXC's Rust-based compiler for maximum-performance JavaScript/TypeScript transformation with 10-100x speedup over traditional tools.
- Enable Parallel Processing: Leverage rayon for multi-threaded file processing and build group orchestration.
- Support Watch Mode: Implement file system watching via notify for incremental development builds.
- Integrate with Git: Provide Git repository operations for version tracking and change detection.
- OXC Compiler Stack: Leverages the OXC parser, transformer, and codegen for blazing-fast JavaScript/TypeScript transformation.
- Parallel Processing: Multi-threaded file processing using rayon for maximum throughput during builds.
- Watch Mode: File system watching via notify for incremental development builds with automatic recompilation.
- Build Groups: Organized build task grouping for complex project structures with multiple output targets.
- Git Integration: Built-in Git repository operations for version tracking and change detection during builds.
Rest uses the OXC (Oxidation Compiler) ecosystem, a high-performance JavaScript/TypeScript toolchain written in Rust. OXC provides:
oxc_parser: Ultra-fast JavaScript/TypeScript parser with ESTree compatibilityoxc_transformer: AST transformation engine supporting TypeScript, JSX, and modern ECMAScript featuresoxc_codegen: Efficient code generation from ASToxc_minifier: Production-ready minification with tree shakingoxc_semantic: Semantic analysis and symbol table construction
graph LR
classDef input fill:#ddd,stroke:#666,stroke-dasharray: 5 5;
classDef oxc fill:#f9f,stroke:#333,stroke-width:2px;
classDef output fill:#9cf,stroke:#333,stroke-width:2px;
Input[TypeScript Source]:::input --> Parser[OXC Parser]:::oxc
Parser --> AST[Abstract Syntax Tree]:::oxc
AST --> Transformer[OXC Transformer]:::oxc
Transformer --> Semantic[Semantic Analysis]:::oxc
Semantic --> Codegen[OXC Codegen]:::oxc
Codegen --> Output[JavaScript Output]:::output
Rest supports the Compiler environment variable to select the compilation backend:
# Use OXC compiler (default, recommended)
Compiler=OXC cargo run
# OXC provides 10-100x speedup over traditional TypeScript compilerWhen Compiler=OXC is set, Rest uses the OXC-based compilation pipeline in Source/Fn/OXC/.
| Principle | Description | Key Components Involved |
|---|---|---|
| Performance | Utilize Rust and OXC for maximum bundling speed with minimal overhead. | OXC compiler stack, rayon parallel processing |
| Incremental Builds | Support watch mode for efficient development workflows with only changed files rebuilt. | notify file watcher, incremental cache |
| Modularity | Organize builds into groups for clear separation of concerns and output targets. | Build Groups, task orchestration |
| Git Awareness | Integrate with Git for version tracking and change-aware builds. | git2 crate, change detection |
| Component | Role & Key Responsibilities |
|---|---|
| VSCode Source Consumer | Reads and transforms VS Code platform code from Microsoft/VSCode and CodeEditorLand/Editor. |
| Output Producer | Generates bundled JavaScript artifacts consumed by Cocoon and Sky. |
| Build Orchestrator | Coordinates with Maintain for build configuration and execution. |
- Rust 1.75 or higher
- Node.js 18.0 or higher (for NPM integration)
To add Rest to your Rust project:
[dependencies]
Rest = { git = "https://github.com/CodeEditorLand/Rest.git", branch = "Current" }Or install the CLI globally:
cargo install RestFor NPM integration:
pnpm add @codeeditorland/restKey Dependencies:
oxc_*crates: OXC compiler stack for JavaScript/TypeScript transformationrayon: Parallel processing for multi-threaded buildsnotify: File system watching for watch modegit2: Git repository operationsclap: CLI argument parsing
# Run with default options
Rest
# Use OXC compiler (default)
Compiler=OXC Rest
# Watch mode for development
Rest --watch
# Specify entry point
Rest --entry src/index.ts
# Specify output directory
Rest --output distRest is typically invoked through the build system with environment variables:
# Development build with OXC
pnpm cross-env \
NODE_ENV=development \
Bundle=true \
Compile=false \
Compiler=OXC \
pnpm tauri build
# Production build
pnpm cross-env \
NODE_ENV=production \
Bundle=true \
Compiler=OXC \
pnpm tauri buildDevelopment Mode:
# Watch mode with hot reload
Compiler=OXC Rest --watch --entry Source/index.ts --output Target/Production Build:
# Minified production build
Compiler=OXC Rest --minify --entry Source/index.ts --output Target/Build Groups:
# Compile multiple entry points
Compiler=OXC Rest --group config/build-groups.jsonThis diagram illustrates Rest's role in the Land build pipeline.
graph LR
classDef rest fill:#f9f,stroke:#333,stroke-width:2px;
classDef source fill:#ddd,stroke:#666,stroke-dasharray: 5 5;
classDef output fill:#9cf,stroke:#333,stroke-width:2px;
subgraph "Input Sources"
VSCodeSource["VS Code Source"]:::source
SkySource["Sky Source Files"]:::source
end
subgraph "Rest ⛱️ (Bundler)"
OXCCompiler["OXC Compiler"]:::rest
ParallelProc["Parallel Processor (rayon)"]:::rest
WatchMode["Watch Mode (notify)"]:::rest
BuildGroups["Build Groups"]:::rest
OXCCompiler --> ParallelProc
ParallelProc --> BuildGroups
WatchMode -.-> OXCCompiler
end
subgraph "Output"
OutputBundle["Output Bundle"]:::output
end
VSCodeSource --> OXCCompiler
SkySource --> OXCCompiler
BuildGroups --> OutputBundle
To understand how Rest's internal components interact to provide the JavaScript/TypeScript bundling functionality, see the following source files:
-
Source/Fn/OXC/- OXC-based compiler implementationCompiler.rs- Main compiler orchestrationParser.rs- OXC parser wrapperTransformer.rs- AST transformationCodegen.rs- Code generationCompile.rs- Compilation entry pointWatch.rs- File system watching
-
Source/Fn/SWC/- SWC-compatible interface (uses OXC backend)mod.rs- Module exports with legacy code commented out
Source/Fn/Build/- Build group orchestration and task managementSource/Struct/Binary/- CLI command structureSource/Fn/Binary/- Binary command implementations
Source/Fn/Bundle/- Bundle configuration and esbuild integrationSource/Fn/Worker/- Service worker compilation supportSource/Fn/NLS/- Natural Language Support (i18n) bundling
The source files explain the OXC compiler stack integration, parallel processing with rayon, and the build group configuration system.
This project leverages the Depth-Aware Skill System for efficient development workflows. The system adapts skill behavior based on usage frequency, providing quick initial checks and progressively more comprehensive analysis.
- Level 1 (First Run): Quick scan - fastest execution, focused scope
- Level 2 (Second Run): Detailed analysis - broader coverage
- Level 3 (Third Run): Deep dive - comprehensive review
- Level 4 (Fourth+ Run): Strategic analysis - system-wide patterns
For detailed guidance on using the depth-aware skill system, see:
Documentation/SkillSystem.md- Complete system overview.roo/skills/DEPTH-MANAGEMENT.md- Technical management guide
| Task | Command | Depth Level |
|---|---|---|
| Quick emoji check | preformat-readme-emoji |
Level 1 |
| Full documentation scan | postformat-pascalcase |
Level 3 |
| Architecture review | knowledge-element-architecture |
Level 4 |
We welcome contributions! Please see our CONTRIBUTING.md for details on how to get started.
# Clone the repository
git clone https://github.com/CodeEditorLand/Rest.git
cd Rest
# Build the project
cargo build
# Run tests
cargo test
# Run with OXC compiler
Compiler=OXC cargo run- Follow Rust naming conventions (snake_case for functions/variables, PascalCase for types)
- Use
tracingfor diagnostic logging instead ofprintln! - Ensure all public APIs have documentation comments
- Run
cargo fmtandcargo clippybefore submitting PRs
See CHANGELOG.md for a history of changes to this CLI.
This project is released into the public domain under the Creative Commons CC0 Universal license. You are free to use, modify, distribute, and build upon this work for any purpose, without any restrictions. For the full legal text, see the LICENSE file.
Rest is a core element of the Land ecosystem. This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
|
|
|
|
|
Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy