Output is the build orchestration layer for Land’s TypeScript assets. It wraps
ESBuild with Land-specific transforms, plugin hooks, and polyfill injection,
and supports an optional Rest (OXC-based) compiler pipeline for faster
TypeScript compilation. The result is published as the @codeeditorland/output
npm package consumed by Cocoon (extension host), Sky (UI layer), and Wind
(service layer).
Architecture
Module Map
| Path | Purpose |
|---|---|
Source/ESBuild/Output.ts |
Primary ESBuild compilation pipeline |
Source/ESBuild/Rest/ |
Rest OXC compiler plugin integration |
Source/ESBuild/Microsoft/ |
VS Code source-specific compilation config |
Source/ESBuild/CodeEditorLand/ |
Land-specific compilation config |
Source/ESBuild/Exclude/ |
Exclude patterns for compilation |
Source/Plugin/Apply.ts |
ESBuild plugin for applying transforms |
Source/Plugin/Copy/ |
Asset copying plugin |
Source/Plugin/Transform/ |
Code transform plugins |
Source/Plugin/Polyfill/ |
Polyfill injection plugins |
Source/Plugin/Index.ts |
Plugin registry |
Source/Polyfill/Child/ |
Child process polyfills |
Source/Polyfill/File/ |
File system polyfills |
Source/Polyfill/IPC/ |
IPC polyfills |
Source/Polyfill/Native/ |
Native module polyfills |
Source/Polyfill/Process/ |
Process polyfills |
Source/Polyfill/Shared/ |
Shared polyfill utilities |
Source/Service/CEL/ |
Code Editor Land specific services |
Source/Service/Dev/ |
Development-time services |
Source/Service/Tauri/ |
Tauri-specific services |
Source/Asset/Style/ |
CSS asset management |
Source/Apply/Pipeline.ts |
Apply pipeline orchestration |
Compiler Modes
Output supports two compiler backends.
Default: ESBuild
Optional: Rest OXC
Activated via Compiler=Rest environment variable:
Integration
// Output/ESBuild/Output.ts
const compiler =
process.env.Compiler === "Rest" ? await import("./Rest/RestPlugin") : null;
const plugins = [];
if (compiler) {
plugins.push(compiler.createPlugin());
}
// Standard ESBuild build with optional Rest plugin
Build Pipeline
The Output build pipeline processes VS Code platform code:
flowchart TD
A["1. Input discovery"] --> B["2. Module resolution"]
B --> C["3. Transform application"]
C --> D["4. Bundle compilation"]
D --> E["5. Output packaging"]
1. Input discovery
- Reads from Dependency/Editor/out/ (Stage 1 compiled VS Code)
- Identifies entry points (workbench, extHost files)
2. Module resolution
- Remaps electron imports to Tauri stubs
- Remaps Node.js built-in modules to polyfills
- Resolves Land-specific module paths
3. Transform application
- Polyfill injection (see below)
- Source map chaining
- Platform code markers (CEL:platform)
4. Bundle compilation
- ESBuild compiles to single or multiple output files
- Source maps generated for debugging
5. Output packaging
- Produces @codeeditorland/output package
- Versioned and cached in Output/Target/
Plugin System
Output defines a plugin interface for extending the build pipeline:
export interface OutputPlugin {
name: string;
setup(build: ESBuild.PluginBuild): void;
}
Built-in Plugins
| Plugin | Purpose |
|---|---|
Apply.ts |
Applies Land-specific code transforms |
Copy.ts |
Copies static assets to output directory |
Transform.ts |
TypeScript-to-JavaScript transformation config |
Polyfill/Index.ts |
Polyfill injection orchestration |
RestPlugin.ts |
Rest OXC compiler integration (optional) |
Polyfill Injection
Output injects polyfills during compilation for APIs that don’t exist in the Tauri WebView:
| Polyfill | Target | Replaces |
|---|---|---|
Child/ |
child_process module |
No-op stubs |
File/ |
fs module |
Tauri invoke wrappers |
IPC/ |
ipcRenderer |
Tauri event system |
Native/ |
Native Node modules | No-op stubs |
Process/ |
process global |
Wind Preload shim integration |
Shared/ |
Shared polyfill utilities | Shared initialization |
- Polyfills are injected via ESBuild’s
injectconfiguration - Prepends the polyfill modules to output bundles
Output Layout
After compilation, Output produces the following structure:
Output/Target/
+-- @codeeditorland/output/
+-- index.js # Main entry point
+-- workbench/ # VS Code workbench bundle
| +-- workbench.js
| +-- workbench.css
+-- extHost/ # Extension host bootstrap
| +-- extHost.js
+-- vs/ # VS Code platform code
| +-- base/
| +-- platform/
| +-- workbench/
+-- polyfills/ # Injected polyfill modules
+-- sourcemaps/ # Source maps
+-- package.json # npm package manifest
Related Documentation
- Cocoon - Extension host (Output consumer)
- Sky - UI layer (Output consumer)
- Wind - Service layer (Output consumer)
- Rest - OXC compiler (optional Output backend)
- BuildPipeline - Build pipeline
- Polyfills - Full polyfill documentation
- 🟠 Low-Level Shim - Engine-level prototype hooks
- 🔵 Coverage / Telemetry - Application-level service routing
Project Maintainers: Source Open (Source/[email protected]) | GitHub Repository | Report an Issue
The record this page documents, as the site files it: the six facts the claim is checked against, and the three files the manual names to check it.
WORKING, 06
- FORM:
- BUILD PIPELINE
- WRITTEN IN:
- TYPESCRIPT
- BOUNDARY:
- ESBUILD PLUGIN
- DEPENDS ON:
- REST
- MANUAL:
-
/DOC/OUTPUT - EVIDENCE:
- UNAVAILABLE NO MANIFEST IN THE BUILD
# TRACE / OUTPUT 03 STEPS
- 01
Source/ESBuild/Output.tsTHE ESBUILD OUTPUT - 02
Source/Plugin/Apply.tsTHE APPLY PLUGIN - 03
Polyfill/Index.tsTHE POLYFILLS
SOURCE: /DOC/OUTPUT