Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix peer warning message requester #6376

Merged
merged 4 commits into from
Jul 29, 2024
Merged

Conversation

clemyan
Copy link
Member

@clemyan clemyan commented Jul 3, 2024

What's the problem this PR addresses?

When an incompatible peer warning occurs, the warning message shown during install simply uses the first peer requester found but that may not have any relation to the unsatisfied request.

See #6205 (comment) (partial fix)

How did you fix it?

Actually find the first unsatisfied requester, prioritizing root requesters (i.e. direct dependencies).

If an unsatisfied root requester is found, the warning message looks similar to 4.2.2

image

➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ react is listed by your project with version 18.3.1 (pfa021), which doesn't satisfy what reflux and other dependencies request (but they have non-overlapping ranges!).
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: └ Completed

If all root requesters are satisfied, then an unsatisfied requester is found and reported with one of the corresponding root requesters

image

➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ react is listed by your project with version 18.3.1 (pfa021), which doesn't satisfy what reflux (via @local/test-reflux-dependent) and other dependencies request 
(but they have non-overlapping ranges!).
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0000: └ Completed

One concern I had was that it will make the message longer, but we are already way past the common terminal width so I don't think that's a big issue.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit 2a47867 into master Jul 29, 2024
21 of 26 checks passed
@arcanis arcanis deleted the clemyan/peer-warning-requester branch July 29, 2024 11:02
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.

None yet

2 participants