How neofinancial/config-dug works
Main Components
a) Core Library Layer:
• Config Dug Core (packages/config-dug)
• Plugin System Architecture
• Configuration Processing Pipeline
b) Plugin Layer:
• AWS Secrets Manager Plugin
• Extension Points for Future Plugins
c) Configuration Sources:
• Config Files (.js, .cjs, .mjs)
• Environment Variables
• External Services (via plugins)
┌─────────────────────────────────────────────┐
• Client Application │
• ┘
• ↓
┌─────────────────────────────────────────────┐
• Config Dug Core │
• ┬──────────────┬───────────────┤
• Parser │ Preprocessor │ Reporter │
• Origins │ Redactor │ Logger │
• ┴──────────────┴───────────────┘
• ↓
┌─────────────────────────────────────────────┐
• Plugin System │
• ┬─────────────────────┤
• AWS Secrets Manager│ Other Plugins │
• ┴─────────────────────┘
• ↓
┌─────────────────────────────────────────────┐
• Configuration Sources │
• ┬──────────────┬──────────────────┤
• Files │Environment │External Services │
• (.js/cjs)│ Variables │ (AWS, etc.) │
• ┴──────────────┴──────────────────┘
Key Interactions to Highlight
a) Configuration Loading Flow:
• How configuration is loaded from different sources
• Processing pipeline (parsing → preprocessing → validation)
• Demonstrate plugin integration points
b) Module Support:
• Support for both ESM and CommonJS
• TypeScript integration
Important Details
• Module type detection system
• Environment-specific configuration handling
• Plugin system architecture
• Error handling and reporting flow
• Configuration validation process
Implementation Notes
• The modular nature of the system
• The plugin architecture's extensibility
• Support for different module systems (ESM/CJS)
• TypeScript integration
• Environment-specific configuration handling