Expand description
§Common: Abstract Core Library for Code Editor Land
Every Element in Land depends on Common. It defines the traits, services, and data transfer objects that form the application’s public API contract. Mountain implements these traits. Wind and Cocoon consume them.
§Why Common Exists
Common enforces a clean separation between “what the app can do” (traits) and “how it does it” (Mountain’s concrete implementations). This means:
- You can test business logic without launching Tauri
- New backends can implement the same traits
- The TypeScript frontend only needs to know the DTO shapes
§Key Abstractions
- ActionEffect: Declarative effect type executed by Mountain’s runtime. Business logic is described as composable effects, not imperative calls.
- Service traits: FileSystemService, ProcessService, ExtensionService, and 15 more domain-specific contracts.
- DTOs: Type-safe data objects shared across IPC boundaries (gRPC, Tauri commands, WebSocket).
- Error types: Structured errors with context for every service domain.
§Module Layout
| Module | Contents |
|---|---|
Effect/ | ActionEffect enum, builders, and combinators |
Environment/ | Capability provider trait (dependency injection) |
Error/ | Domain-specific error types with context |
Transport/ | Transport-agnostic communication (gRPC, IPC, WASM) |
DTO/ | Re-exported data transfer objects from all services |
Command/ .. Workspace/ | Service trait definitions (20 domains) |
§Getting Started
Common builds as part of the Land monorepo:
cargo build -p Common
cargo test -p CommonFull setup: https://github.com/CodeEditorLand/Land
Modules§
- Command
- Command Service
- Configuration
- Configuration Service
- Custom
Editor - CustomEditor Service
- DTO
- Global DTO Module
- Debug
- Debug Service
- Diagnostic
- Diagnostic Service
- Document
- Document Service
- Effect
- Effect Module
- Environment
- Environment Module
- Error
- Error Module
- Extension
Management - ExtensionManagement Service
- File
System - FileSystem Service
- IPC
- IPC Service
- Keybinding
- Keybinding Service
- Language
Feature - LanguageFeature Service
- Output
- Output Service
- Search
- Search Service
- Secret
- Secret Service
- Source
Control Management - SourceControlManagement Service
- Status
Bar - StatusBar Service
- Storage
- Storage Service
- Synchronization
- Synchronization Service
- Terminal
- Terminal Service
- Testing
- Testing Service
- Transport
- Transport Layer
- Tree
View - TreeView Service
- User
Interface - UserInterface Service
- Utility
- Common Utility Module
- Webview
- Webview Service
- Workspace
- Workspace Service