How hkdobrev/run-if-changed works
Main Components Identification
a. Git Hook Integration Layer
• Supported Git hooks (post-commit, post-checkout, post-merge, post-rewrite)
• This is the entry point of the system
b. Core Processing Components
• Configuration Manager (configLoad.js)
• File Change Detection System (gitChangedFilesSinceLastHead.js)
• Pattern Matching Engine (resolveMatchingPatterns.js)
• Command Execution System (runCommands.js)
Specific Design Elements
Use these visual elements:
• Blue rectangles for core components
• Green diamonds for decision points
• Yellow rectangles for external integrations (Git, npm/yarn commands)
Component Relationships
Git Hooks → File Change Detection → Pattern Matching → Command Execution
↑ ↓
Configuration Manager ←----------------------------------------'
Important Details
a. Configuration Sources:
• Multiple possible config file locations
• Cosmiconfig integration
b. File Processing:
• Git diff operations
• Pattern matching logic
• Command resolution
c. External Integration Points:
• Git hooks system
• Package managers (npm, yarn, etc.)
• Build tools