The Build System & CI/CD Toolkit for Land 🏞️
Build pipelines that change behavior based on environment variables, implicit tool versions, or undeclared dependencies make debugging production issues impossible. The same commit produces different output on different machines.
"Deterministic builds. Same commit, same output, guaranteed."
Welcome to Maintain, the Rust-based build system and CI/CD toolkit for the Land Code Editor ecosystem. Maintain provides comprehensive build orchestration, Rhai scripting capabilities, and configuration management for TOML and JSON5 files.
Maintain is engineered to:
- Orchestrate Builds: Provide a central build system for the entire Land ecosystem with configurable build groups.
- Enable Scripting: Embed the Rhai scripting language for flexible build logic and custom automation.
- Manage Configuration: Offer type-safe TOML and JSON5 editing capabilities for Cargo.toml and other configuration files.
- Provide CLI Interface: Deliver a command-line interface for build operations with environment variable resolution.
- Rhai Scripting Engine: Embedded Rhai interpreter for flexible build configuration and custom automation logic.
- Configuration Editing: Type-safe TOML and JSON5 editing for Cargo.toml and other configuration files with validation.
- Environment Resolution: Dynamic environment variable handling with scriptable resolvers for build-time configuration.
- CLI Interface: Comprehensive command-line interface with subcommands for build, debug, release, and profile operations.
- Build Orchestration: Central coordination of multi-stage builds across the Land ecosystem.
| Principle | Description | Key Components Involved |
|---|---|---|
| Scriptability | Enable flexible build logic through embedded Rhai scripting with full environment access. | Rhai/ConfigLoader, Rhai/ScriptRunner |
| Type Safety | Provide compile-time checked configuration access with validation for TOML/JSON5. | toml_edit, json5 crates |
| Modularity | Separate concerns between CLI, scripting, and configuration editing components. | CLI.rs, Rhai/, Build/* |
| Environment Awareness | Dynamic resolution of environment variables for flexible build configurations. | EnvironmentResolver.rs |
| Component | Role & Key Responsibilities |
|---|---|
| Build Orchestrator | Central coordination of builds across all Land elements. |
| Scripting Host | Rhai engine for custom build logic and automation. |
| Configuration Manager | TOML/JSON5 editing for Cargo.toml and project configuration. |
| CLI Provider | Command-line interface for developers and CI/CD pipelines. |
This diagram illustrates Maintain's build orchestration architecture.
graph LR
classDef maintain fill:#f9f,stroke:#333,stroke-width:2px;
classDef script fill:#9cf,stroke:#333,stroke-width:1px;
classDef config fill:#ffc,stroke:#333,stroke-width:1px;
subgraph "Maintain 💪🏻 (Build System)"
CLI["CLI Interface"]:::maintain
RhaiEngine["Rhai Script Engine"]:::maintain
ConfigEditor["Config Editor (TOML/JSON5)"]:::maintain
EnvResolver["Environment Resolver"]:::maintain
CLI --> RhaiEngine
CLI --> ConfigEditor
RhaiEngine --> EnvResolver
end
subgraph "Scripts"
DebugSh["Debug.sh"]:::script
DevMountain["Dev-Mountain.sh"]:::script
ReleaseSh["Release.sh"]:::script
end
CLI -.-> DebugSh
CLI -.-> DevMountain
CLI -.-> ReleaseSh
subgraph "Configuration"
CargoTOML["Cargo.toml"]:::config
JSON5Config["*.json5"]:::config
end
ConfigEditor --> CargoTOML
ConfigEditor --> JSON5Config
Element/Maintain/
├── Source/
│ ├── Library.rs # Main entry point
│ └── Build/
│ ├── CLI.rs # Command-line interface with clap
│ ├── Constant.rs # Build constants
│ ├── Definition.rs # Build definitions
│ ├── Fn.rs # Build functions
│ ├── Rhai/ # Rhai scripting engine
│ │ ├── ConfigLoader.rs
│ │ ├── EnvironmentResolver.rs
│ │ └── ScriptRunner.rs
│ └── ...
├── Debug/ # Debug scripts
│ ├── All.sh
│ ├── Build.sh
│ ├── Run.sh
│ └── Wind.sh
├── Debug.sh # Debug mode execution
├── Dev-Mountain.sh # Mountain development mode
├── Profile.sh # Performance profiling
└── Release.sh # Release build
To understand how Maintain's internal components interact to provide the build
orchestration functionality, see the following source files:
Source/Library.rs- Main entry point and module declarationsSource/Build/CLI.rs- Command-line interface with clapSource/Build/Rhai/- Rhai scripting engine integrationConfigLoader.rs- Configuration file loadingEnvironmentResolver.rs- Environment variable resolutionScriptRunner.rs- Script execution engine
The source files explain the Rhai scripting integration, TOML/JSON5 editing capabilities, and the build orchestration patterns.
To add Maintain as a dependency:
[dependencies]
Maintain = { git = "https://github.com/CodeEditorLand/Maintain.git", branch = "Current" }Or install the CLI globally:
cargo install MaintainKey Dependencies:
rhai: Embedded scripting engineclap: CLI argument parsingtoml_edit: TOML parsing and editingjson5: JSON5 configuration supportchrono: Date/time handlingcolored: Colored terminal outputlog/env_logger: Logging framework
Maintain is typically invoked through its included shell scripts:
# Debug build
./Maintain/Debug.sh
# Development mode for Mountain
./Maintain/Dev-Mountain.sh
# Release build
./Maintain/Release.shAs a binary:
Maintain [OPTIONS] [COMMAND]As a library:
use Maintain::Build;
let Build = Build::new();
Build.execute()?;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.
Stay updated with our progress! See
CHANGELOG.md for a
history of changes specific to Maintain.
Maintain 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.
The project is operated by PlayForm, based in Sofia, Bulgaria.
PlayForm acts as the open-source steward for Code Editor Land under the NGI0 Commons Fund grant.
| Land | PlayForm | NLnet | NGI0 Commons Fund |
|---|---|---|---|
|
|
|
|
|
Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy