Files
bun.sh/test/regression
Claude Bot 40c12d9ae6 fix(install): improve peer dependency warning messages
Previously, peer dependency warnings were unhelpful:
  warn: incorrect peer dependency "react@17.0.0"

This didn't tell users:
1. Which package requires the peer dependency
2. What version was expected
3. Why the installed version doesn't satisfy the requirement
4. How to trace the dependency that caused this

Now, warnings show the FULL dependency path and all relevant information:
  warn: (root) > @testing-library/react > react-dom has unmet peer dependency react@17.0.2 (found 17.0.0)

This is MORE helpful than pnpm's tree-style format because:
- Shows the complete dependency path in a single scannable line
- Uses ">" arrows to clearly show the dependency chain
- Includes "(root)" to show where the chain starts
- Shows both the expected version and what was found

Changes:
- Added `getPackageIdForDependencyId` helper to find the owning package
- Added `getDependencyPath` helper to trace dependency chain to root
- Added `emitUnmetPeerDependencyWarning` helper to reduce code duplication
- Updated tests to validate new warning format

Closes #26076

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:46:44 +00:00
..