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

[Feature] Implement verbose output that lets us track down peer dependency issues at a whole #6643

Open
2 tasks
vbjay opened this issue Jan 1, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@vbjay
Copy link

vbjay commented Jan 1, 2025

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

A clear and concise description of what workflow is meant to be improved.

I like the command yarn explain peer-requirments. The problem I see is if I want to get all the issues together I need to run the command with each problem code. Building the report so I can see all the packages that have peer dependency issues and even filter to the ones that have the ✓ or the ✘ values would help.

Describe the solution you'd like

A clear and concise description of what you want to happen. Consider that Yarn is used
by many people, and your particular use case might not make sense to implement in the core.

See https://gist.github.com/vbjay/0b5880b84089204e8abaf7f2c46675d0 for a PowerShell implementation. Being able to pass arguments to the command that provides a cross platform way and not a PowerShell script but something like --detailed and --problems and --why arguments to the command.

  • --detailed output for each line the line and then indent with the output of yarn explain peer-requirements [code]. Provide the details of why that line exists.
  • --detailed --problems like above but only use the lines that would show the red ✘.
  • --why to append yarn why [packageID] on all the distinct packages found in the details of yarn explain peer-requirements [code] or in the combined output generated from using --detailed.

Describe the drawbacks of your solution

This section is important not only to identify future issues, but also for us to see whether
you thought through your request. When filling it, ask yourself what are the problems we could
have maintaining what you propose. How often will it break?

The commands do take time to run especially if not filtering to only bad lines.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered,
and why you think they wouldn't be good enough. Start by: why not make it a plugin?

  • Update PowerShell script to be cross platform and run on linux and windows and... 👎 because of requiring external dependency of PowerShell
  • Provide Bash, PowerShell examples in yarn documentation showing how to do a larger deep dive with starter scripts that can be modified to allow the developer to get what they want. 👍 for cross platform and allowing users to define what they want 👎 to keep maintained
@vbjay vbjay added the enhancement New feature or request label Jan 1, 2025
@vbjay
Copy link
Author

vbjay commented Jan 2, 2025

After running a command like .\Generate-YarnPeerDetails.ps1 -Run |Out-File -Encoding utf8 -FilePath .\tmp.txt

grep -oP '(?<=does not provide )\S*(?=\.)' ./tmp.txt | sort --uniq

can pull the distinct packages which can help you generate why calls and such. Like the following

grep -oP '(?<=does not provide )\S*(?=\.)' ./tmp.txt | sort --uniq |sed -E 's/(\S*)/yarn why \1/' >why.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant