Skip to main content

Crate CommonLibrary

Crate CommonLibrary 

Source
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

ModuleContents
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 Common

Full setup: https://github.com/CodeEditorLand/Land

Modules§

Command
Command Service
Configuration
Configuration Service
CustomEditor
CustomEditor Service
DTO
Global DTO Module
Debug
Debug Service
Diagnostic
Diagnostic Service
Document
Document Service
Effect
Effect Module
Environment
Environment Module
Error
Error Module
ExtensionManagement
ExtensionManagement Service
FileSystem
FileSystem Service
IPC
IPC Service
Keybinding
Keybinding Service
LanguageFeature
LanguageFeature Service
Output
Output Service
Search
Search Service
Secret
Secret Service
SourceControlManagement
SourceControlManagement Service
StatusBar
StatusBar Service
Storage
Storage Service
Synchronization
Synchronization Service
Terminal
Terminal Service
Testing
Testing Service
Transport
Transport Layer
TreeView
TreeView Service
UserInterface
UserInterface Service
Utility
Common Utility Module
Webview
Webview Service
Workspace
Workspace Service