Skip to main content

fresh/
lib.rs

1#![deny(clippy::let_underscore_must_use)]
2
3// Editor library - exposes all core modules for testing
4
5pub mod i18n;
6
7// Initialize i18n with empty directory (no compile-time code generation)
8// All translations are provided by the runtime backend
9rust_i18n::i18n!(
10    "locales-empty",
11    fallback = "en",
12    backend = i18n::runtime_backend::RuntimeBackend::new()
13);
14
15// Core types and config are always available (needed for schema generation)
16pub mod config;
17pub mod partial_config;
18pub mod plugin_schemas;
19pub mod types;
20
21// Runtime-only modules (require the "runtime" feature)
22#[cfg(feature = "runtime")]
23pub mod config_io;
24#[cfg(feature = "runtime")]
25pub mod init_script;
26#[cfg(feature = "runtime")]
27pub mod state;
28#[cfg(feature = "runtime")]
29pub mod workspace;
30
31// Core modules - always available (pure Rust, no platform dependencies)
32// Submodules within primitives that need ratatui/syntect are internally gated
33pub mod model;
34pub mod primitives;
35
36// Runtime-only modules (heavy dependencies, platform-specific)
37#[cfg(feature = "runtime")]
38pub mod app;
39#[cfg(feature = "runtime")]
40pub mod input;
41#[cfg(feature = "runtime")]
42pub mod services;
43
44// Session persistence (client-server architecture)
45#[cfg(feature = "runtime")]
46pub mod client;
47#[cfg(feature = "runtime")]
48pub mod server;
49
50// View module - available for runtime, WASM, and dev-bins (schema generation)
51// Most submodules are runtime-only, but theme types are always available
52#[cfg(any(feature = "runtime", feature = "wasm", feature = "dev-bins"))]
53pub mod view;
54
55// Plugin widget runtime — declarative widget tree mounted by plugins
56// via MountWidgetPanel/UpdateWidgetPanel/UnmountWidgetPanel. Pure Rust,
57// no UI dependencies, so always available.
58pub mod widgets;
59
60// GUI mode - native window with wgpu rendering
61#[cfg(feature = "gui")]
62pub mod gui;
63
64// WASM-specific modules
65#[cfg(feature = "wasm")]
66pub mod wasm;
67
68// Test-only observation API. Compiled with the `runtime` feature so the
69// terminal binary's library form exposes it for integration tests, but
70// never reachable from production call sites — see test_api.rs and
71// docs/internal/e2e-test-migration-design.md.
72#[cfg(feature = "runtime")]
73pub mod test_api;