How sverweij/dependency-cruiser works
Main Components
The system should be organized into these primary components:
a. Core Processing Pipeline:
• Extract Module (src/extract/): Handles dependency extraction from source files
• Validate Module (src/validate/): Processes validation rules
• Enrich Module (src/enrich/): Enhances dependency information
• Report Module (src/report/): Generates various output formats
b. Supporting Systems:
• Configuration Management (src/config-utl/)
• Cache System (src/cache/)
• CLI Interface (src/cli/)
• Graph Utilities (src/graph-utl/)
Component Relationships
[CLI Interface] → [Config Management] → [Core Pipeline]
• ↓
[Source Files] → [Extract] → [Validate] → [Enrich] → [Report] → [Output]
• ↑ ↑ ↑ ↑
• [Cache System]─────┘ |
• [Graph Utilities]─────────────┘
Detailed Component Breakdown
Extract Module:
• Parsers (acorn, swc, typescript)
• Resolution logic
• Transpiler support
Validate Module:
• Rule engine
• Pattern matching
• Dependency validation
Enrich Module:
• Metrics calculation
• Dependency analysis
• Graph enhancement
Report Module:
• Multiple format generators (dot, html, json, etc.)
• Visualization helpers
• Output formatting
Integration Points
Clear interfaces between:
• CLI and configuration management
• Extract module and various parsers
• Report module and output formats
• Cache system and core pipeline