Skip to content

Commit f474c38

Browse files
docs(Maintain): expand README with comprehensive documentation
Add extensive documentation to the Maintain component README including: Key Features section detailing Rhai scripting, configuration editing, and CLI capabilities; Core Architecture Principles table covering Scriptability, Type Safety, Modularity, and Environment Awareness; Land Ecosystem role mapping with Build Orchestrator, Scripting Host, Configuration Manager, and CLI Provider; Mermaid architecture diagram; Project Structure directory tree; Deep Dive section with source file references; Getting Started guide with installation instructions and usage patterns; expanded license explanation; and changelog reference. Aligns with broader docs initiative to provide comprehensive onboarding documentation for the build system component.
1 parent cbcb6b3 commit f474c38

1 file changed

Lines changed: 189 additions & 23 deletions

File tree

README.md

Lines changed: 189 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,85 @@ Land
3737
</tr>
3838
</table>
3939

40-
4140
---
4241

4342
# **Maintain**&#x2001;💪🏻
4443

45-
> **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.**
44+
The Build System & CI/CD Toolkit for Land 🏞️
45+
46+
> **Build pipelines that change behavior based on environment variables,
47+
> implicit tool versions, or undeclared dependencies make debugging production
48+
> issues impossible. The same commit produces different output on different
49+
> machines.**
4650
4751
_"Deterministic builds. Same commit, same output, guaranteed."_
4852

4953
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](https://github.com/CodeEditorLand/Maintain/tree/Current/LICENSE)
50-
[![Crates.io](https://img.shields.io/crates/v/Maintain.svg)](https://crates.io/crates/Maintain)
51-
[![Rust Version](https://img.shields.io/badge/Rust-1.75+-orange.svg)](https://www.rust-lang.org/)
54+
[<img src="https://editor.land/Image/Rust.svg" width="14" alt="Rust" />](https://www.rust-lang.org/)&#x2001;[![Crates.io](https://img.shields.io/crates/v/Maintain.svg)](https://crates.io/crates/Maintain)
55+
[<img src="https://editor.land/Image/Rust.svg" width="14" alt="Rust" />](https://www.rust-lang.org/)&#x2001;[![Rust Version](https://img.shields.io/badge/Rust-1.75+-orange.svg)](https://www.rust-lang.org/)
5256
[![Rhai Version](https://img.shields.io/badge/Rhai-latest-blue.svg)](https://rhai.rs/)
5357

54-
Maintain builds the entire Land ecosystem with Rhai scripting for flexible build logic, compile-time validated TOML and JSON5 configurations, and deterministic artifact generation. GritQL queries handle automated refactoring across the codebase. The same commit always produces the same output across all machines.
58+
📖
59+
**[Rust API Documentation](https://Rust.Documentation.Editor.Land/Maintain/)**
60+
61+
Welcome to **Maintain**, the Rust-based build system and CI/CD toolkit for the
62+
**Land Code Editor** ecosystem. Maintain provides comprehensive build
63+
orchestration, Rhai scripting capabilities, and configuration management for
64+
TOML and JSON5 files.
65+
66+
**Maintain** is engineered to:
67+
68+
1. **Orchestrate Builds:** Provide a central build system for the entire Land
69+
ecosystem with configurable build groups.
70+
2. **Enable Scripting:** Embed the Rhai scripting language for flexible build
71+
logic and custom automation.
72+
3. **Manage Configuration:** Offer type-safe TOML and JSON5 editing capabilities
73+
for Cargo.toml and other configuration files.
74+
4. **Provide CLI Interface:** Deliver a command-line interface for build
75+
operations with environment variable resolution.
76+
77+
---
78+
79+
## Key Features&#x2001;🔐
5580

56-
📖 **[Rust API Documentation](https://Rust.Documentation.Maintain.Editor.Land/)**
81+
- **Rhai Scripting Engine:** Embedded Rhai interpreter for flexible build
82+
configuration and custom automation logic.
83+
- **Configuration Editing:** Type-safe TOML and JSON5 editing for Cargo.toml and
84+
other configuration files with validation.
85+
- **Environment Resolution:** Dynamic environment variable handling with
86+
scriptable resolvers for build-time configuration.
87+
- **CLI Interface:** Comprehensive command-line interface with subcommands for
88+
build, debug, release, and profile operations.
89+
- **Build Orchestration:** Central coordination of multi-stage builds across the
90+
Land ecosystem.
5791

5892
---
5993

60-
## What It Does&#x2001;🔐
94+
## Core Architecture Principles&#x2001;🏗️
6195

62-
- **Rhai scripting.** Flexible build logic without shell script fragility.
63-
- **Deterministic output.** Same commit, same artifacts, across all machines and CI environments.
64-
- **GritQL refactoring.** Automated codebase-wide refactoring with structural pattern matching.
65-
- **Compile-time config.** TOML and JSON5 configurations validated at build time.
96+
| Principle | Description | Key Components Involved |
97+
| :------------------------ | :---------------------------------------------------------------------------------------- | :--------------------------------------- |
98+
| **Scriptability** | Enable flexible build logic through embedded Rhai scripting with full environment access. | `Rhai/ConfigLoader`, `Rhai/ScriptRunner` |
99+
| **Type Safety** | Provide compile-time checked configuration access with validation for TOML/JSON5. | `toml_edit`, `json5` crates |
100+
| **Modularity** | Separate concerns between CLI, scripting, and configuration editing components. | `CLI.rs`, `Rhai/`, `Build/*` |
101+
| **Environment Awareness** | Dynamic resolution of environment variables for flexible build configurations. | `EnvironmentResolver.rs` |
66102

67103
---
68104

69-
## In the Ecosystem&#x2001;💪🏻 + 🏞️
105+
## `Maintain` in the Land Ecosystem&#x2001;💪🏻 + 🏞️
106+
107+
| Component | Role & Key Responsibilities |
108+
| :------------------------ | :----------------------------------------------------------- |
109+
| **Build Orchestrator** | Central coordination of builds across all Land elements. |
110+
| **Scripting Host** | Rhai engine for custom build logic and automation. |
111+
| **Configuration Manager** | TOML/JSON5 editing for Cargo.toml and project configuration. |
112+
| **CLI Provider** | Command-line interface for developers and CI/CD pipelines. |
113+
114+
---
115+
116+
## System Architecture Diagram&#x2001;🏗️
117+
118+
This diagram illustrates `Maintain`'s build orchestration architecture.
70119

71120
```mermaid
72121
graph LR
@@ -106,18 +155,114 @@ ConfigEditor --> JSON5Config
106155

107156
---
108157

109-
## Development&#x2001;🛠
158+
## Project Structure&#x2001;🗺
110159

111-
Maintain is a component of the Land workspace. Follow the
112-
[Land Repository](https://github.com/CodeEditorLand/Land) instructions to
113-
build and run.
160+
```
161+
Element/Maintain/
162+
├── Source/
163+
│ ├── Library.rs # Main entry point
164+
│ └── Build/
165+
│ ├── CLI.rs # Command-line interface with clap
166+
│ ├── Constant.rs # Build constants
167+
│ ├── Definition.rs # Build definitions
168+
│ ├── Fn.rs # Build functions
169+
│ ├── Rhai/ # Rhai scripting engine
170+
│ │ ├── ConfigLoader.rs
171+
│ │ ├── EnvironmentResolver.rs
172+
│ │ └── ScriptRunner.rs
173+
│ └── ...
174+
├── Debug/ # Debug scripts
175+
│ ├── All.sh
176+
│ ├── Build.sh
177+
│ ├── Run.sh
178+
│ └── Wind.sh
179+
├── Debug.sh # Debug mode execution
180+
├── Dev-Mountain.sh # Mountain development mode
181+
├── Profile.sh # Performance profiling
182+
└── Release.sh # Release build
183+
```
114184

115185
---
116186

117-
## License&#x2001;⚖️
187+
## Deep Dive & Component Breakdown&#x2001;🔬
188+
189+
To understand how `Maintain`'s internal components interact to provide the build
190+
orchestration functionality, see the following source files:
191+
192+
- **[`Source/Library.rs`](https://github.com/CodeEditorLand/Maintain/tree/Current/Source/Library.rs)** -
193+
Main entry point and module declarations
194+
- **[`Source/Build/CLI.rs`](https://github.com/CodeEditorLand/Maintain/tree/Current/Source/Build/CLI.rs)** -
195+
Command-line interface with clap
196+
- **[`Source/Build/Rhai/`](https://github.com/CodeEditorLand/Maintain/tree/Current/Source/Build/Rhai/)** -
197+
Rhai scripting engine integration
198+
- [`ConfigLoader.rs`](https://github.com/CodeEditorLand/Maintain/tree/Current/Source/Build/Rhai/ConfigLoader.rs) -
199+
Configuration file loading
200+
- [`EnvironmentResolver.rs`](https://github.com/CodeEditorLand/Maintain/tree/Current/Source/Build/Rhai/EnvironmentResolver.rs) -
201+
Environment variable resolution
202+
- [`ScriptRunner.rs`](https://github.com/CodeEditorLand/Maintain/tree/Current/Source/Build/Rhai/ScriptRunner.rs) -
203+
Script execution engine
118204

119-
CC0 1.0 Universal. Public domain. No restrictions.
120-
[LICENSE](https://github.com/CodeEditorLand/Maintain/tree/Current/LICENSE)
205+
The source files explain the Rhai scripting integration, TOML/JSON5 editing
206+
capabilities, and the build orchestration patterns.
207+
208+
---
209+
210+
## Getting Started&#x2001;🚀
211+
212+
### Installation&#x2001;📥
213+
214+
To add `Maintain` as a dependency:
215+
216+
```toml
217+
[dependencies]
218+
Maintain = { git = "https://github.com/CodeEditorLand/Maintain.git", branch = "Current" }
219+
```
220+
221+
Or install the CLI globally:
222+
223+
```sh
224+
cargo install Maintain
225+
```
226+
227+
**Key Dependencies:**
228+
229+
- `rhai`: Embedded scripting engine
230+
- `clap`: CLI argument parsing
231+
- `toml_edit`: TOML parsing and editing
232+
- `json5`: JSON5 configuration support
233+
- `chrono`: Date/time handling
234+
- `colored`: Colored terminal output
235+
- `log` / `env_logger`: Logging framework
236+
237+
### Usage Pattern&#x2001;🚀
238+
239+
`Maintain` is typically invoked through its included shell scripts:
240+
241+
```sh
242+
# Debug build
243+
./Maintain/Debug.sh
244+
245+
# Development mode for Mountain
246+
./Maintain/Dev-Mountain.sh
247+
248+
# Release build
249+
./Maintain/Release.sh
250+
```
251+
252+
As a binary:
253+
254+
```sh
255+
Maintain [OPTIONS] [COMMAND]
256+
```
257+
258+
As a library:
259+
260+
```rust
261+
use Maintain::Build;
262+
263+
let Build = Build::new();
264+
Build.execute()?;
265+
```
121266

122267
---
123268

@@ -130,12 +275,33 @@ CC0 1.0 Universal. Public domain. No restrictions.
130275
- [Rest](https://github.com/CodeEditorLand/Rest)
131276
- [Output](https://github.com/CodeEditorLand/Output)
132277

278+
---
279+
280+
## License&#x2001;⚖️
281+
282+
This project is released into the public domain under the **Creative Commons CC0
283+
Universal** license. You are free to use, modify, distribute, and build upon
284+
this work for any purpose, without any restrictions. For the full legal text,
285+
see the [`LICENSE`](https://github.com/CodeEditorLand/Maintain/tree/Current/)
286+
file.
287+
288+
---
289+
290+
## Changelog&#x2001;📜
291+
292+
Stay updated with our progress! See
293+
[`CHANGELOG.md`](https://github.com/CodeEditorLand/Maintain/tree/Current/) for a
294+
history of changes specific to **Maintain**.
295+
296+
---
133297

134-
## Funding & Acknowledgements🙏🏻
298+
## Funding \& Acknowledgements&#x2001;🙏🏻
135299

136-
Code Editor Land is funded through the NGI0 Commons Fund, established by NLnet
137-
with financial support from the European Commission's Next Generation Internet
138-
programme, under grant agreement No. 101135429.
300+
**Maintain** is a core element of the **Land** ecosystem. This project is funded
301+
through [NGI0 Commons Fund](https://NLnet.NL/commonsfund), a fund established by
302+
[NLnet](https://NLnet.NL) with financial support from the European Commission's
303+
[Next Generation Internet](https://ngi.eu) program. Learn more at the
304+
[NLnet project page](https://NLnet.NL/project/Land).
139305

140306
The project is operated by PlayForm, based in Sofia, Bulgaria.
141307

0 commit comments

Comments
 (0)