berry icon indicating copy to clipboard operation
berry copied to clipboard

Add warnings option for explain peer-requirements

Open BasixKOR opened this issue 1 year ago • 5 comments

What's the problem this PR addresses?

Adresses #6329.

...

How did you fix it?

Add an option called --warnings and changed the behaviour of explainPeerRequirements to not print met peer requirements when the option is enabled,

...

Checklist

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

BasixKOR avatar Aug 21 '24 08:08 BasixKOR

Some notes:

  • I don't mind bikeshedding on a flag name or variable name, please suggest better names as you see fit.
  • Do you think it is suitable to show warnings-only by default? I personally think it's reasonable but I kept it disabled by default since that would be a breaking change.

BasixKOR avatar Aug 21 '24 11:08 BasixKOR

As I have said in https://github.com/yarnpkg/berry/issues/6329#issuecomment-2184931696, the problem with this approach is that the flag is simply ignored in yarn explain peer-requirements --warnings p00000 and that can be confusing.

I don't mind it as a short-term solution but I think we still need to figure out a long-term solution

clemyan avatar Aug 23 '24 05:08 clemyan

Thanks for the reference to #6329, I've updated the issue I opened to point there. While I do agree showing the unmet peer requirements would be more desirable it would be a breaqking change. I think adding this flag for the meantime makes sense as long as we can work on the solution for (potential) Yarn v5.

BasixKOR avatar Aug 26 '24 06:08 BasixKOR

Any progress on the PR ? Current messages in peer-requirements are much less helpful than in yarn v1.

mklemarczyk avatar Jul 30 '25 23:07 mklemarczyk

I should spend more time and add some tests to my PRs but I haven't gotten around to do so. Thanks for the reminder.

BasixKOR avatar Aug 26 '25 10:08 BasixKOR