Update all outdated dependencies in this Elixir project, handling both safe updates and breaking changes.
Run mix hex.outdated to get a list of all outdated dependencies. Parse the output to identify:
- Safe updates: Dependencies where only the patch or minor version has changed (no major version bump)
- Breaking updates: Dependencies with a major version change (e.g., 1.x.x → 2.x.x)
Run mix deps.update --all to update all dependencies. This will apply updates within the version constraints specified in mix.exs.
For each dependency with a breaking major version change:
-
Update the version constraint in
mix.exsto allow the new major version -
Find the changelog or upgrade guide using this approach:
- First, try
https://hexdocs.pm/{package_name}/changelog.html - If not found, go to the project root at
https://hexdocs.pm/{package_name}and look for:- Links to "Changelog", "CHANGELOG", "Upgrade Guide", or "Migration Guide" in the sidebar navigation
- Any "Upgrading" or "Breaking Changes" sections in the documentation
- Extract the relevant breaking changes between your current version and the target version
- First, try
-
Review breaking changes and apply necessary code modifications
-
Run verification after each breaking change update before moving to the next
After updates, run these commands and fix any issues:
# Compile with warnings as errors
mix compile --warnings-as-errors
# Check formatting
mix format --check-formatted
# Run tests
mix testIf any verification step fails:
- For compile warnings: Fix the warning in the code
- For format issues: Run
mix formatto auto-fix - For test failures: Debug and fix the failing tests
Once all verifications pass:
- Run
mix hex.outdatedagain to confirm all dependencies are up to date - Summarize what was updated, including any breaking changes that required code modifications