How thumuss/utpm works
Main Components
a) Core Components:
• CLI Interface (Entry Point)
• Command Processor
• Package Manager Core
• File System Interface
• State Management
• Configuration Handler
b) Command Modules:
• Workspace Management
• Package Management
• Generation Utilities
┌─ User Interface Layer ─────────────────────┐
• CLI Interface (src/main.rs) │
• ┬─────────────────────────┘
• ↓
┌─ Command Layer ──────────────────────────────┐
• ┌─ Workspace Commands ─┐ ┌─ Package Commands ┐│
• Create │ │ - List ││
• Link │ │ - Tree ││
• Install │ │ - Unlink ││
• Add │ │ - Bulk Delete ││
• ┘ └──────────────────┘ │
• ┬──────────────────────────┘
• ↓
┌─ Core Layer ────────────────────────────────┐
• ┌─ Utils ──────────┐ ┌─ State Management ─┐ │
• Paths │ │ - Package State │ │
• Specs │ │ - Config State │ │
• Macros │ └──────────────────┘ │ │
• ┘ │
• ┬──────────────────────────┘
• ↓
┌─ External Interface Layer ──────────────────┐
• File System │
• Remote Package Registry │
• Typst Universe Integration │
• ┘
Important Elements to Highlight
a) Data Flow:
• Command flow from CLI to specific command handlers
• Package management operations
• State management interactions
b) Key Interactions:
• Package creation and management workflow
• Dependency resolution process
• Remote package registry communication
Implementation Details to Note
• Command structure follows a modular approach (src/commands/)
• Utility functions are centralized (src/utils/)
• State management is handled separately (src/utils/state.rs)
• CI/CD integration exists (.github/workflows/)
This design reflects the current state of UTPM while allowing for the planned features mentioned in the README, such as automated publication to Typst Universe.