|
| 1 | +# Dependency Management |
| 2 | + |
| 3 | +This project uses [Renovate](https://docs.renovatebot.com/) to automate dependency updates across the monorepo. This document describes how dependency updates are managed and how to work with the system. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +Renovate automatically: |
| 8 | + |
| 9 | +1. Monitors all dependencies in the monorepo |
| 10 | +2. Creates pull requests for updates |
| 11 | +3. Groups related updates together to reduce PR noise |
| 12 | +4. Automatically merges safe updates |
| 13 | +5. Maintains a dependency dashboard |
| 14 | + |
| 15 | +## Configuration Files |
| 16 | + |
| 17 | +The Renovate configuration is split across several files: |
| 18 | + |
| 19 | +- `renovate.json5` - Main configuration file |
| 20 | +- `.github/renovate-automerge.json5` - Auto-merge settings |
| 21 | +- `.github/renovate-groups.json5` - Package grouping settings |
| 22 | +- `.github/workflows/renovate.yml` - GitHub workflow for self-hosted Renovate |
| 23 | + |
| 24 | +## Update Schedule |
| 25 | + |
| 26 | +Renovate is configured to run: |
| 27 | + |
| 28 | +- Daily at 2:00 AM UTC via GitHub Actions |
| 29 | +- Only creates PRs during off-hours (after 10pm and before 5am on weekdays, and on weekends) |
| 30 | +- Lock file maintenance on Monday mornings |
| 31 | +- Can be triggered manually via GitHub Actions workflow dispatch |
| 32 | + |
| 33 | +## Update Strategy |
| 34 | + |
| 35 | +The system follows these strategies: |
| 36 | + |
| 37 | +1. **Minor and patch updates** are grouped together and auto-merged if tests pass |
| 38 | +2. **Dev dependencies** are automatically merged for minor and patch versions |
| 39 | +3. **Production dependencies** have stricter rules, with only patch versions auto-merged |
| 40 | +4. **Major updates** require manual review and approval |
| 41 | +5. **GitHub Actions** are automatically updated for minor and patch versions |
| 42 | + |
| 43 | +## Package Grouping |
| 44 | + |
| 45 | +Dependencies are grouped into logical categories: |
| 46 | + |
| 47 | +- TypeScript ecosystem (TypeScript, tsconfig, type definitions) |
| 48 | +- Linting and formatting tools (Biome, ESLint, Prettier) |
| 49 | +- Testing tools (Vitest, Jest) |
| 50 | +- Monorepo tooling (Changesets, Turborepo) |
| 51 | +- Internal workspace packages |
| 52 | + |
| 53 | +## Working with Renovate |
| 54 | + |
| 55 | +### Dependency Dashboard |
| 56 | + |
| 57 | +Renovate maintains a dependency dashboard as a pinned issue in the repository. This provides: |
| 58 | + |
| 59 | +- Overview of all pending updates |
| 60 | +- PRs that need attention |
| 61 | +- Rejected/ignored updates |
| 62 | +- Upcoming major updates |
| 63 | + |
| 64 | +### Manual Control |
| 65 | + |
| 66 | +You can influence Renovate behavior: |
| 67 | + |
| 68 | +- Add `renovate:disable` comment in a PR to prevent Renovate from rebasing it |
| 69 | +- Add specific packages to `ignoreDeps` in configuration to prevent updates |
| 70 | +- Use the dashboard to manually trigger specific updates |
| 71 | + |
| 72 | +### Best Practices |
| 73 | + |
| 74 | +1. **Review major updates carefully** - These can contain breaking changes |
| 75 | +2. **Don't modify package.json versions directly** - Let Renovate manage this |
| 76 | +3. **Use the dashboard** to monitor and manage update flow |
| 77 | +4. **Create changeset entries** for dependency updates that affect consumers |
| 78 | + |
| 79 | +## Troubleshooting |
| 80 | + |
| 81 | +If Renovate isn't working as expected: |
| 82 | + |
| 83 | +1. Check the Renovate logs in GitHub Actions |
| 84 | +2. Verify configuration files are valid JSON5 |
| 85 | +3. Look at the dependency dashboard for errors |
| 86 | +4. Run Renovate manually via workflow dispatch with debug logging |
| 87 | + |
| 88 | +## Further Reading |
| 89 | + |
| 90 | +- [Renovate Documentation](https://docs.renovatebot.com/) |
| 91 | +- [Renovate GitHub Action](https://github.com/renovatebot/github-action) |
| 92 | +- [Monorepo Support in Renovate](https://docs.renovatebot.com/getting-started/installing-onboarding/#monorepos) |
0 commit comments