-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add ability to upgrade based on pattern #4610
Conversation
fee1735
to
dcaabe4
Compare
This change will decrease the build size from 9.83 MB to 9.83 MB, a decrease of 1.35 KB (0%)
|
src/package-request.js
Outdated
depReqPatterns = depReqPatterns.filter( | ||
dep => | ||
filterByNames.indexOf(normalizePattern(dep.pattern).name) >= 0 || | ||
(flags && flags.pattern && normalizePattern(dep.pattern).name.includes(flags.pattern)), |
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.
Shouldn't you use micromatch
rather than includes
, which will only search for the substring?
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.
Yeah you're right. Changed now.
dcaabe4
to
2c4f016
Compare
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.
👍
Summary
In PR #4571, upgrade was highlighted to be a candidate for adding a pattern option to allow filtering.
This can be used with the current args or by itself.
Usage:
yarn upgrade --pattern mypattern
yarn upgrade diff-package --pattern mypattern
Test plan
Added test that filter with pattern and with the current args together.