Skip to content

CodeEditorLand/Maintain

Maintain

💪🏻

+

🏞️


Maintain 💪🏻

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."

License: CC0-1.0 RustCrates.io RustRust Version Rhai Version

📖 Rust API Documentation

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:

  1. Orchestrate Builds: Provide a central build system for the entire Land ecosystem with configurable build groups.
  2. Enable Scripting: Embed the Rhai scripting language for flexible build logic and custom automation.
  3. Manage Configuration: Offer type-safe TOML and JSON5 editing capabilities for Cargo.toml and other configuration files.
  4. Provide CLI Interface: Deliver a command-line interface for build operations with environment variable resolution.

Key Features 🔐

  • 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.

Core Architecture Principles 🏗️

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

Maintain in the Land Ecosystem 💪🏻 + 🏞️

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.

System Architecture Diagram 🏗️

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
Loading

Project Structure 🗺️

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

Deep Dive & Component Breakdown 🔬

To understand how Maintain's internal components interact to provide the build orchestration functionality, see the following source files:

The source files explain the Rhai scripting integration, TOML/JSON5 editing capabilities, and the build orchestration patterns.


Getting Started 🚀

Installation 📥

To add Maintain as a dependency:

[dependencies]
Maintain = { git = "https://github.com/CodeEditorLand/Maintain.git", branch = "Current" }

Or install the CLI globally:

cargo install Maintain

Key Dependencies:

  • rhai: Embedded scripting engine
  • clap: CLI argument parsing
  • toml_edit: TOML parsing and editing
  • json5: JSON5 configuration support
  • chrono: Date/time handling
  • colored: Colored terminal output
  • log / env_logger: Logging framework

Usage Pattern 🚀

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.sh

As a binary:

Maintain [OPTIONS] [COMMAND]

As a library:

use Maintain::Build;

let Build = Build::new();
Build.execute()?;

See Also


License ⚖️

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.


Changelog 📜

Stay updated with our progress! See CHANGELOG.md for a history of changes specific to Maintain.


Funding & Acknowledgements 🙏🏻

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
Land PlayForm NLnet NGI0 Commons Fund

Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy

About

Maintain 💪🏻 + Land 🏞️

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors

Languages