-
Notifications
You must be signed in to change notification settings - Fork 315
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
npm: Prepare to re-use parsePackage()
from outside of Npm
#9323
Conversation
191e933
to
fb55fa1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9323 +/- ##
=========================================
Coverage 67.45% 67.45%
Complexity 1200 1200
=========================================
Files 241 241
Lines 8498 8500 +2
Branches 904 904
=========================================
+ Hits 5732 5734 +2
Misses 2402 2402
Partials 364 364
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fb55fa1
to
8409ba2
Compare
8409ba2
to
b8b7c75
Compare
parsePackage()
from outside of Npm
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.
Note that I stopped reviewing at the second commit as I believe it needs to be reworked, and all further changes build upon it.
I've commented on your comments. It'd be great to get some more hint why / in what direction it shall be re-worked. |
e7139a9
to
06f5aa5
Compare
06f5aa5
to
0744817
Compare
This way `getRemotePackageDetails()` doesn't throw anymore which enables further simplifications. Also the code gets aligned with the code in `Yarn`. Signed-off-by: Frank Viernau <[email protected]>
All implementations of `getRemotePackageDetails()` by now return `null` in case of a failure instead of throwing. Remove `runCatching()`, because it is not needed anymore. Signed-off-by: Frank Viernau <[email protected]>
Prepare for re-using this function from current child classes of `Npm`, once they get refactored to not inherit from `Npm` anymore. Signed-off-by: Frank Viernau <[email protected]>
0744817
to
33aeb8d
Compare
Move all logger dependencies from
parsePackage()
to the callers, to avoid the need for passing the logger when moving this function outside ofNpm
. And finally perform the move. This prepares for removing the inheritance in node package managers.Part of #9261.