Skip to content

Commit 8627e7f

Browse files
docs(Output): Expand README with comprehensive technical documentation
Revert from concise ~55-line benefit-focused format to detailed technical documentation covering: Rest compiler integration architecture, OXC-based compilation pipeline, esbuild vs Rest comparison tables, configuration options, troubleshooting guide, directory structure, and Getting Started section. This expands on the previous benefit-focused rewrite by adding the deep-dive technical content that developers need for understanding the dual-compiler build system, plugin architecture, and artifact management workflows. Re-establishes the README as a comprehensive reference for Output's build orchestration capabilities.
1 parent 86ae0ee commit 8627e7f

1 file changed

Lines changed: 210 additions & 20 deletions

File tree

README.md

Lines changed: 210 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,44 +33,214 @@ Land
3333
</tr>
3434
</table>
3535

36-
3736
---
3837

3938
# **Output**&#x2001;
4039

41-
> **Build processes that produce different artifacts depending on the machine, CI environment, or implicit tool versions make debugging production issues impossible.**
40+
The Build Output & Artifact Management for Land 🏞️
41+
42+
> **Build processes that produce different artifacts depending on the machine,
43+
> CI environment, or implicit tool versions make debugging production issues
44+
> impossible.**
4245
4346
_"Same commit. Same output. Every time."_
4447

4548
[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](https://github.com/CodeEditorLand/Land/tree/Current/LICENSE)
4649
[![NPM Version](https://img.shields.io/npm/v/@codeeditorland/output.svg)](https://www.npmjs.com/package/@codeeditorland/output)
47-
[<img src="https://editor.land/Image/esbuild.svg" width="14" alt="esbuild" />](https://esbuild.github.io/)&#x2001;[![esbuild Version](https://img.shields.io/badge/esbuild-0.25.x-blue.svg)](https://esbuild.github.io/)
48-
[<img src="https://editor.land/Image/OXC.svg" width="14" alt="OXC" />](https://oxc.rs/)&#x2001;[![Rest Compiler](https://img.shields.io/badge/Rest-OXC-orange.svg)](https://oxc.rs/)
50+
[![esbuild Version](https://img.shields.io/badge/esbuild-0.25.x-blue.svg)](https://esbuild.github.io/)
51+
[![Rest Compiler](https://img.shields.io/badge/Rest-OXC-orange.svg)](https://oxc.rs/)
52+
53+
Welcome to **Output**, the build output and artifact management package for the
54+
**Land Code Editor**. Output handles the compilation, processing, and
55+
distribution of source code from various dependencies including VSCode,
56+
CodeEditorLand Editor, and the Rest compiler pipeline.
57+
58+
**Output** is engineered to:
4959

50-
Output processes TypeScript from VS Code, Land, and the Rest compiler into fully bundled artifacts through a plugin-routed architecture. Every bundle is deterministic and checksum-verified. The same commit always produces the same output.
60+
1. **Orchestrate Multi-Compiler Builds:** Support both esbuild and Rest
61+
(OXC-based) compilation pipelines with seamless integration.
62+
2. **Manage Build Artifacts:** Organize and deliver optimized JavaScript
63+
artifacts for consumption by `Sky`, `Wind`, and `Cocoon`.
64+
3. **Provide Hybrid Workflows:** Enable incremental migration from esbuild to
65+
Rest through conditional compilation and plugin-based architecture.
66+
4. **Ensure Build Reproducibility:** Maintain consistent output through
67+
deterministic build configurations and artifact verification.
5168

5269
---
5370

54-
## What It Does&#x2001;🔐
71+
## Key Features&#x2001;🔐
5572

56-
- **Deterministic builds.** Same commit always produces the same checksum-verified output.
57-
- **Plugin-routed architecture.** Each source type (VS Code, Land, Rest) takes its own path.
58-
- **Checksum verification.** Every artifact is verified after generation.
73+
- **Dual-Compiler Support:** Seamlessly switch between esbuild (default) and
74+
Rest (OXC-powered) compilers via environment variables.
75+
- **Rest Plugin Integration:** Custom esbuild plugin that intercepts TypeScript
76+
compilation and delegates to the Rest compiler.
77+
- **Source Map Generation:** Full support for development source maps with
78+
configurable generation strategies.
79+
- **Artifact Merging:** Intelligent merging of Rest compiler output with esbuild
80+
bundles for hybrid workflows.
81+
- **Verbose Logging:** Comprehensive build diagnostics with configurable
82+
verbosity levels for troubleshooting.
83+
- **Path Override:** Flexible binary path configuration for Rest compiler
84+
discovery in diverse environments.
5985

6086
---
6187

62-
## Development&#x2001;🛠
88+
## Core Architecture Principles&#x2001;🏗
6389

64-
Output is a component of the Land workspace. Follow the
65-
[Land Repository](https://github.com/CodeEditorLand/Land) instructions to
66-
build and run.
90+
| Principle | Description | Key Components Involved |
91+
| :---------------- | :-------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------- |
92+
| **Compatibility** | Maintain backward compatibility with esbuild while enabling Rest compiler adoption through plugin architecture. | `Source/ESBuild/RestPlugin.ts`, `Source/prepublishOnly.sh` |
93+
| **Modularity** | Separation of concerns between build orchestration, compiler plugins, and artifact management. | `Source/ESBuild/Output.ts`, `Source/ESBuild/RestPlugin.ts` |
94+
| **Performance** | Leverage Rest's OXC-based compiler for 10-100x speedup on TypeScript transpilation tasks. | Rest compiler integration, parallel processing |
95+
| **Flexibility** | Environment-driven configuration enables different build strategies per deployment scenario. | `Compiler` environment variable, `REST_*` variables |
96+
| **Observability** | Comprehensive logging and diagnostics for build process visibility and troubleshooting. | `REST_VERBOSE`, `REST_OPTIONS` configuration |
6797

6898
---
6999

70-
## License&#x2001;⚖️
100+
## Rest Compiler Integration&#x2001;⛱️
101+
102+
The Rest compiler integration enables OXC-based TypeScript compilation as an
103+
alternative or complement to esbuild.
104+
105+
### Overview of OXC-Based Compilation
106+
107+
Rest leverages the **OXC (Oxidation Compiler)** ecosystem, a high-performance
108+
JavaScript/TypeScript toolchain written in Rust. The OXC stack provides:
109+
110+
- **`oxc_parser`**: Ultra-fast JavaScript/TypeScript parser with ESTree
111+
compatibility
112+
- **`oxc_transformer`**: AST transformation engine supporting TypeScript, JSX,
113+
and modern ECMAScript features
114+
- **`oxc_codegen`**: Efficient code generation from AST
115+
- **`oxc_semantic`**: Semantic analysis and symbol table construction
116+
117+
When `Compiler=Rest` is configured, the build pipeline intercepts TypeScript
118+
file processing and delegates to the Rest compiler before merging results back
119+
into the esbuild output stream.
120+
121+
### Build Pipeline Architecture
122+
123+
#### Standard Pipeline (esbuild only)
124+
125+
```
126+
Source/ → esbuild → Configuration/ → Target/
127+
```
128+
129+
#### Rest Compiler Pipeline (hybrid)
130+
131+
```
132+
Source/ → esbuild → Configuration/ → Target/
133+
Dependency/ → Rest → Target/Rest/ → Configuration/ → Target/
134+
```
135+
136+
### Configuration Options
137+
138+
| Variable | Default | Description |
139+
| :----------------- | :----------------- | :------------------------------------------------ |
140+
| `Compiler` | `esbuild` | Compiler to use (`esbuild` or `Rest`) |
141+
| `REST_BINARY_PATH` | auto-detect | Override Rest binary location |
142+
| `REST_OPTIONS` | empty | Additional Rest compiler flags |
143+
| `REST_VERBOSE` | `false` | Enable verbose Rest logging |
144+
| `Dependency` | `Microsoft/VSCode` | Source dependency to process |
145+
| `NODE_ENV` | `production` | Build environment (`development` or `production`) |
146+
147+
### esbuild vs Rest Comparison
148+
149+
| Feature | esbuild | Rest (OXC) |
150+
| :--------------------- | :---------------------- | :------------------------- |
151+
| **Implementation** | Go-based | Rust-based (OXC) |
152+
| **TypeScript Support** | Full | Full |
153+
| **Speed** | Very Fast (10-100x tsc) | Ultra-Fast (parallel, OXC) |
154+
| **Source Maps** | Yes | Yes |
155+
| **Tree Shaking** | Yes | Yes |
156+
| **Plugin System** | Rich ecosystem | Emerging |
157+
| **Best For** | General bundling | TypeScript-heavy projects |
158+
| **Watch Mode** | Yes | Yes (via notify) |
159+
| **Minification** | Yes | Yes (oxc_minifier) |
160+
161+
---
162+
163+
## Deep Dive & Component Breakdown&#x2001;🔬
164+
165+
- **[`Source/ESBuild/Output.ts`](https://github.com/CodeEditorLand/Output/tree/Current/Source/ESBuild/Output.ts)** -
166+
ESBuild configuration with ESM format, Node.js platform, ES Next target, and
167+
conditional Rest plugin integration
168+
- **[`Source/ESBuild/RestPlugin.ts`](https://github.com/CodeEditorLand/Output/tree/Current/Source/ESBuild/RestPlugin.ts)** -
169+
TypeScript file interception, Rest compiler invocation, source map generation,
170+
and fallback to esbuild on errors
171+
- **[`Source/prepublishOnly.sh`](https://github.com/CodeEditorLand/Output/tree/Current/Source/prepublishOnly.sh)** -
172+
Build orchestration script
173+
174+
---
175+
176+
## Directory Structure&#x2001;📁
71177

72-
CC0 1.0 Universal. Public domain. No restrictions.
73-
[LICENSE](https://github.com/CodeEditorLand/Output/tree/Current/LICENSE)
178+
```
179+
Element/Output/
180+
├── Source/
181+
│ ├── ESBuild/
182+
│ │ ├── Output.ts # ESBuild configuration
183+
│ │ └── RestPlugin.ts # Rest compiler plugin
184+
│ ├── prepublishOnly.sh # Build orchestration
185+
│ └── Run.sh # Development watch script
186+
├── Configuration/
187+
│ └── ESBuild/
188+
│ ├── Microsoft/VSCode.js
189+
│ └── CodeEditorLand/Editor.js
190+
├── Target/
191+
│ ├── Rest/ # Rest compiler output (when Compiler=Rest)
192+
│ │ └── Microsoft/
193+
│ │ └── VSCode/
194+
│ └── Microsoft/ # Final merged output
195+
│ └── VSCode/
196+
└── package.json
197+
```
198+
199+
---
200+
201+
## Getting Started&#x2001;🚀
202+
203+
### Installation&#x2001;📥
204+
205+
```sh
206+
pnpm add @codeeditorland/output
207+
```
208+
209+
### Usage&#x2001;🚀
210+
211+
```bash
212+
# Default esbuild build
213+
npm run prepublishOnly
214+
215+
# Rest compiler build
216+
export Compiler=Rest
217+
npm run prepublishOnly
218+
219+
# Development mode with Rest
220+
export NODE_ENV=development
221+
export Compiler=Rest
222+
npm run Run
223+
```
224+
225+
### Troubleshooting
226+
227+
**Rest Binary Not Found:**
228+
229+
```bash
230+
export REST_BINARY_PATH=/usr/local/bin/rest
231+
```
232+
233+
**Compilation Errors — enable verbose logging:**
234+
235+
```bash
236+
export REST_VERBOSE=true
237+
```
238+
239+
**Source Maps Not Generated:**
240+
241+
```bash
242+
export NODE_ENV=development
243+
```
74244

75245
---
76246

@@ -81,12 +251,32 @@ CC0 1.0 Universal. Public domain. No restrictions.
81251
- [Rest](https://github.com/CodeEditorLand/Rest)
82252
- [Cocoon](https://github.com/CodeEditorLand/Cocoon)
83253

254+
---
255+
256+
## License&#x2001;⚖️
257+
258+
This project is released into the public domain under the **Creative Commons CC0
259+
Universal** license. You are free to use, modify, distribute, and build upon
260+
this work for any purpose, without any restrictions. For the full legal text,
261+
see the [`LICENSE`](https://github.com/CodeEditorLand/Land/tree/Current/LICENSE)
262+
file.
263+
264+
---
265+
266+
## Changelog&#x2001;📜
267+
268+
Stay updated with our progress! See [`CHANGELOG.md`](../../CHANGELOG.md) for a
269+
history of changes specific to **Output**.
270+
271+
---
84272

85-
## Funding & Acknowledgements🙏🏻
273+
## Funding \& Acknowledgements&#x2001;🙏🏻
86274

87-
Code Editor Land is funded through the NGI0 Commons Fund, established by NLnet
88-
with financial support from the European Commission's Next Generation Internet
89-
programme, under grant agreement No. 101135429.
275+
**Output** is a core element of the **Land** ecosystem. This project is funded
276+
through [NGI0 Commons Fund](https://NLnet.NL/commonsfund), a fund established by
277+
[NLnet](https://NLnet.NL) with financial support from the European Commission's
278+
[Next Generation Internet](https://ngi.eu) program. Learn more at the
279+
[NLnet project page](https://NLnet.NL/project/Land).
90280

91281
The project is operated by PlayForm, based in Sofia, Bulgaria.
92282

0 commit comments

Comments
 (0)