-
Notifications
You must be signed in to change notification settings - Fork 456
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(cli): Support PNPM when retrieving package dependency information #2959
Conversation
13174e3
to
99d7c53
Compare
Use `pnpnm-lock.yaml` as a signal that `pnpm` is the package manager in use, and use `pnpm list` to discover environmental information in that case.
99d7c53
to
69b13be
Compare
I have tested this locally against repositories that use yarn and pnpm as their package manager. The The project using It doesn't appear that there is explicit test coverage against this class, so I haven't added tests for the changes. Happy to take feedback on this. |
I have run tests locally against |
All sorted, CLA signed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @jamestelfer! Found one small typo, but other than that it's good to go from my point of view 👍
Co-authored-by: Ansgar Mertens <[email protected]>
Thanks @ansgarm for fixing the typo and your review time! Really appreciate getting this small change in! |
I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Related issue
Fixes #2903
Description
pnpm
uses a lock file calledpnpm-lock.yaml
, which can be used as a strong signal about which package manager is in use. There is an upcomingpackageManager
element inpackage.json
that could also be used, but in practice this is not yet widespread.Given the presence of this file, the updated logic switches to use
pnpm list
instead ofnpm list
, and adapts to the updated file structure. I think it is fairly unlikely that apnpm-lock.yaml
file will exist ifpnpm
is not in use, so I've kept this very simple.Further, I haven't made DRY efforts between the two methods, as I wasn't certain how useful that would be. I'm very happy to go further if the reviewers would like me to.
Checklist
Notes on tests:
main
is not clean, but the results betweenmain
and this branch are the same.I'm happy to adjust the PR given feedback on any aspect.