Maintain/Run/mod.rs
1//=============================================================================//
2// File Path: Element/Maintain/Source/Run/mod.rs
3//=============================================================================//
4// Module: Run
5//
6// Brief Description: Development Run Module with Hot-Reload Support.
7//
8// RESPONSIBILITIES:
9// ================
10//
11// Primary:
12// - Orchestrate the development run process with hot-reload
13// - Manage development server lifecycle
14// - Support profile-based development configurations
15// - Enable rapid iteration during development
16//
17// Secondary:
18// - Provide comprehensive logging for run operations
19// - Handle various workbench types (Browser, Wind, Mountain, Electron)
20// - Support environment-specific run configurations
21//
22// ARCHITECTURAL ROLE:
23// ===================
24//
25// Position:
26// - Infrastructure/Development orchestration layer
27// - Development-time tooling
28//
29// Dependencies (What this module requires):
30// - External crates: clap, colored, env_logger, json5, log, serde, serde_json
31// - Internal modules: None
32// - Traits implemented: None
33//
34// Dependents (What depends on this module):
35// - Element/Maintain/Source/Library.rs
36// - Maintain/Debug/Run.sh
37// - Development workflow scripts
38//
39// IMPLEMENTATION DETAILS:
40// =======================
41//
42// Design Patterns:
43// - Configuration object pattern (Argument struct)
44// - Error handling with thiserror
45// - Builder pattern (via clap)
46//
47// Performance Considerations:
48// - Complexity: O(n) - file I/O and process management
49// - Memory usage patterns: Moderate (stores configuration in memory)
50// - Hot path optimizations: None needed (development time)
51//
52// Thread Safety:
53// - Thread-safe: No (not designed for concurrent execution)
54// - Synchronization mechanisms used: None
55//
56// Error Handling:
57// - Error types returned: Error (comprehensive error enum)
58// - Recovery strategies: Process cleanup on error
59//
60// EXAMPLES:
61// =========
62//
63// Example 1: Basic run orchestration
64/// ```rust
65/// use crate::Maintain::Source::Run::Fn;
66/// Fn();
67/// ```
68//
69// Example 2: Using the run orchestrator from command line
70/// ```sh
71/// # Debug run with hot-reload
72/// cargo run --bin Run -- --profile debug-mountain
73///
74/// # Run with specific workbench
75/// ./Maintain/Debug/Run.sh --profile debug-wind
76/// ```
77//
78//=============================================================================//
79// IMPLEMENTATION
80//=============================================================================//
81
82// Module declarations - flattened structure
83pub mod CLI;
84pub mod Constant;
85pub mod Definition;
86pub mod Environment;
87pub mod Error;
88pub mod Fn;
89pub mod Logger;
90pub mod Process;
91pub mod Profile;