Skip to content

fix: pnpm why -r --parseable#10595

Merged
zkochan merged 3 commits intomainfrom
fix/8100
Feb 26, 2026
Merged

fix: pnpm why -r --parseable#10595
zkochan merged 3 commits intomainfrom
fix/8100

Conversation

@zkochan
Copy link
Member

@zkochan zkochan commented Feb 11, 2026

close #8100

@zkochan zkochan marked this pull request as ready for review February 26, 2026 00:38
Copilot AI review requested due to automatic review settings February 26, 2026 00:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in pnpm why -r --parseable where dependents were missing when multiple workspace packages share the same dependency. The issue occurred because when a shared dependency appeared in the results both as a dependency and as a root package, it would be duplicated or omitted incorrectly.

Changes:

  • Modified the deduplication logic in renderParseable to track root packages that have already been output
  • Added conditional spreading to prevent duplicate output of root package information
  • Added comprehensive test coverage for the fix including short format, long format, and edge cases

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
reviewing/list/src/renderParseable.ts Fixed deduplication logic to properly track and conditionally output root packages when they appear both as dependencies and in the search results
reviewing/list/test/index.ts Added three new test cases covering shared dependencies in parseable output (short and long format, plus unrelated package exclusion)
.changeset/fix-why-parseable-dedup.md Added changeset documenting the bug fix with minor spelling issue

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"pnpm": patch
---

Fix `pnpm why -r --parseable` missing dependents when multiple workspace packages share the same dependency [#8100](https://github.com/pnpm/pnpm/issues/8100).
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: "dependants" should be "dependents" (American English spelling is preferred in technical documentation).

Copilot uses AI. Check for mistakes.
@zkochan zkochan merged commit dcd16c7 into main Feb 26, 2026
12 of 13 checks passed
@zkochan zkochan deleted the fix/8100 branch February 26, 2026 01:00
zkochan added a commit that referenced this pull request Mar 7, 2026
zkochan added a commit that referenced this pull request Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"pnpm why" doesn't work properly

2 participants