Skip to content

Commit a35faaa

Browse files
docs: benefit-focused crate-level rustdoc in Library.rs
Replace technical spec copy with developer-facing value propositions. Remove 50-level analysis checklist where present. Generated-By: PostHog Code Task-Id: 556dae83-2866-4359-85ea-c7d0d818cb34
1 parent b72f87e commit a35faaa

1 file changed

Lines changed: 43 additions & 9 deletions

File tree

Source/Library.rs

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,51 @@
11
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
22
#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
33

4-
//! # Common Crate
4+
//! # Common: Abstract Core Library for Code Editor Land
55
//!
6-
//! Defines the abstract architectural core for the entire application
7-
//! ecosystem. It provides the foundational traits, services, and data transfer
8-
//! objects (DTOs) that constitute the application's public API contract.
6+
//! Every Element in Land depends on Common. It defines the traits, services,
7+
//! and data transfer objects that form the application's public API contract.
8+
//! Mountain implements these traits. Wind and Cocoon consume them.
99
//!
10-
//! This crate enforces a clean separation of concerns by defining "what" an
11-
//! operation does (the service trait, e.g., `FileSystemReader`) separately
12-
//! from "how" it is implemented (the concrete implementation in the `Mountain`
13-
//! crate). This declarative, effects-based architecture ensures that
14-
//! application logic is composable, testable, and maintainable.
10+
//! ## Why Common Exists
11+
//!
12+
//! Common enforces a clean separation between "what the app can do" (traits)
13+
//! and "how it does it" (Mountain's concrete implementations). This means:
14+
//!
15+
//! - You can test business logic without launching Tauri
16+
//! - New backends can implement the same traits
17+
//! - The TypeScript frontend only needs to know the DTO shapes
18+
//!
19+
//! ## Key Abstractions
20+
//!
21+
//! - **ActionEffect**: Declarative effect type executed by Mountain's runtime.
22+
//! Business logic is described as composable effects, not imperative calls.
23+
//! - **Service traits**: FileSystemService, ProcessService, ExtensionService,
24+
//! and 15 more domain-specific contracts.
25+
//! - **DTOs**: Type-safe data objects shared across IPC boundaries (gRPC,
26+
//! Tauri commands, WebSocket).
27+
//! - **Error types**: Structured errors with context for every service domain.
28+
//!
29+
//! ## Module Layout
30+
//!
31+
//! | Module | Contents |
32+
//! |---|---|
33+
//! | `Effect/` | ActionEffect enum, builders, and combinators |
34+
//! | `Environment/` | Capability provider trait (dependency injection) |
35+
//! | `Error/` | Domain-specific error types with context |
36+
//! | `Transport/` | Transport-agnostic communication (gRPC, IPC, WASM) |
37+
//! | `DTO/` | Re-exported data transfer objects from all services |
38+
//! | `Command/` .. `Workspace/` | Service trait definitions (20 domains) |
39+
//!
40+
//! ## Getting Started
41+
//!
42+
//! Common builds as part of the Land monorepo:
43+
//! ```bash
44+
//! cargo build -p Common
45+
//! cargo test -p Common
46+
//! ```
47+
//!
48+
//! Full setup: <https://github.com/CodeEditorLand/Land>
1549
1650
// --- Core Architecture ---
1751
pub mod Effect;

0 commit comments

Comments
 (0)