|
| 1 | +--- |
| 2 | +title: "Maintain" |
| 3 | +section: "Element" |
| 4 | +order: 25 |
| 5 | +description: |
| 6 | + "The build orchestrator with Rhai scripting and deterministic output." |
| 7 | +--- |
| 8 | + |
| 9 | +# Maintain |
| 10 | + |
| 11 | +Maintain is the build orchestrator for Code Editor Land. It coordinates |
| 12 | +Rest, Output, SideCar, and every other build-time Element into a single |
| 13 | +reproducible pipeline. Build logic is written in Rhai scripts, not shell |
| 14 | +scripts, and every configuration is validated at compile time. |
| 15 | + |
| 16 | +## The Problem |
| 17 | + |
| 18 | +Build pipelines that depend on environment variables, shell conditionals, |
| 19 | +and platform-specific scripts become impossible to debug. A build passes on |
| 20 | +one machine and fails on another because of a missing `$PATH` entry or a |
| 21 | +difference in how `sed` handles newlines on macOS versus Linux. VS Code's |
| 22 | +build system spans Gulp tasks, shell scripts, and Node.js scripts scattered |
| 23 | +across dozens of files. Reproducing a failure requires replicating the exact |
| 24 | +environment, which is rarely documented. |
| 25 | + |
| 26 | +## How Maintain Eliminates It |
| 27 | + |
| 28 | +Maintain replaces shell scripts with Rhai, an embedded scripting language |
| 29 | +designed for Rust applications. Rhai scripts are sandboxed, deterministic, |
| 30 | +and cross-platform by design. They cannot access the file system, network, |
| 31 | +or environment variables unless explicitly granted permission through |
| 32 | +Maintain's capability system. |
| 33 | + |
| 34 | +Build configurations are Rust structs validated at compile time. A typo in |
| 35 | +a configuration key fails the build before any artifact is produced, not |
| 36 | +after twenty minutes of compilation. |
| 37 | + |
| 38 | +Maintain orchestrates the full pipeline: Rest compiles TypeScript, Output |
| 39 | +stores artifacts, SideCar selects binaries. Each step receives typed |
| 40 | +inputs and produces typed outputs. If a step fails, the error message |
| 41 | +identifies the exact input that caused the failure. |
| 42 | + |
| 43 | +## What You Experience |
| 44 | + |
| 45 | +You run a single command and the build either succeeds or fails with a |
| 46 | +clear, actionable error. The same command produces the same result on |
| 47 | +macOS, Linux, and Windows. No environment-specific workarounds. No "works |
| 48 | +on my machine" mysteries. |
| 49 | + |
| 50 | +Build scripts are readable. Rhai's syntax is close to Rust, so anyone who |
| 51 | +can read the application code can read the build logic. |
| 52 | + |
| 53 | +## Key Technologies |
| 54 | + |
| 55 | +Rust, Rhai Scripting, Compile-Time Configuration Validation, Deterministic |
| 56 | +Orchestration, Capability-Based Sandboxing. |
| 57 | + |
| 58 | +## See Also |
| 59 | + |
| 60 | +- [Architecture Overview](/Doc/architecture) |
| 61 | +- [Output](/Doc/output) |
| 62 | +- [Source Code](https://github.com/CodeEditorLand/Maintain) |
0 commit comments