dependency-management.mdβ’1.98 kB
# Dependency Management Strategy
## Syncpack Choice Rationale
### Why Syncpack?
We chose `syncpack` over alternatives like npm workspaces or lerna for the following reasons:
**1. Version Consistency Focus**
- Primary goal: Ensure consistent dependency versions across all package.json files
- Prevents version conflicts between devDependencies and dependencies
- Lightweight approach focused specifically on version alignment
**2. Integration with Existing Workflow**
- Works with existing npm structure without requiring workspace migration
- Minimal configuration overhead
- Integrates cleanly with wireit build system
**3. Comparison with Alternatives**
| Tool | Purpose | Complexity | Our Need |
|------|---------|------------|----------|
| **syncpack** | Version consistency | Low | β
Perfect fit |
| npm workspaces | Full monorepo management | High | β Overkill |
| lerna | Full monorepo tooling | High | β Too complex |
| rush | Enterprise monorepo | Very High | β Excessive |
**4. Dependency Footprint Analysis**
While syncpack adds ~220 transitive dependencies, most are shared:
- `commander` - CLI framework (needed for syncpack CLI)
- `fast-check` - Property testing (syncpack's internal testing)
- `effect` - Functional programming (syncpack's internal architecture)
These are development-only dependencies that don't affect runtime bundle size.
### Usage Guidelines
**Check for version mismatches:**
```bash
npm run syncpack:check
```
**Fix version mismatches:**
```bash
npm run syncpack:fix
```
**Integrate into CI:**
The `npm run check` command now includes syncpack validation via wireit dependency.
### Future Considerations
If the project evolves into a true monorepo with multiple packages:
- Consider migrating to npm workspaces
- Evaluate lerna for more complex inter-package dependency management
- Keep syncpack for version consistency validation
For now, syncpack provides the exact functionality we need without unnecessary complexity.