Skip to content

fix: explain peer-default dependencies in why#7168

Open
StantonMatt wants to merge 1 commit into
yarnpkg:masterfrom
StantonMatt:stanton/fix-why-peer-default
Open

fix: explain peer-default dependencies in why#7168
StantonMatt wants to merge 1 commit into
yarnpkg:masterfrom
StantonMatt:stanton/fix-why-peer-default

Conversation

@StantonMatt
Copy link
Copy Markdown

@StantonMatt StantonMatt commented Jun 3, 2026

Closes #7159.

yarn why currently skips any dependency whose ident is also listed in peerDependencies, which hides real peer-with-default dependency edges. In the issue reproduction, @siteimprove/alfa-cypress declares cypress in both dependencies and peerDependencies, so yarn why cypress reports nothing unless --peers is set.

This keeps the default behavior of hiding injected virtual peer provisions, but no longer hides regular dependency edges just because the package also has a peer declaration for the same ident.

Verification:

  • TEST_BINARY=scripts/run-yarn.js node scripts/run-yarn.js workspace acceptance-tests test:integration packages/acceptance-tests/pkg-tests-specs/sources/commands/why.test.ts --runInBand
  • YARN_IGNORE_PATH=1 node scripts/run-yarn.js why cypress in a clone of Siteimprove/alfa-integrations now prints @siteimprove/alfa-cypress -> cypress
  • YARN_IGNORE_PATH=1 node scripts/run-yarn.js why -R yauzl in the same clone now includes the Cypress branch
  • node scripts/run-yarn.js test:lint
  • node scripts/run-yarn.js typecheck:all
  • node scripts/run-yarn.js version check
  • git diff --check

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
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.

[Bug?]: yarn why is sometimes not seeing actual dependencies

1 participant