mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
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>