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

Add ability to upgrade based on pattern #4610

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

philquinn
Copy link
Contributor

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.

@buildsize
Copy link

buildsize bot commented Oct 1, 2017

This change will decrease the build size from 9.83 MB to 9.83 MB, a decrease of 1.35 KB (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 848.67 KB 848.44 KB -245 bytes (0%)
yarn-[version].js 3.74 MB 3.74 MB -382 bytes (0%)
yarn-legacy-[version].js 3.79 MB 3.79 MB -382 bytes (0%)
yarn-v[version].tar.gz 854.4 KB 854.2 KB -209 bytes (0%)
yarn_[version]all.deb 645.47 KB 645.31 KB -162 bytes (0%)

depReqPatterns = depReqPatterns.filter(
dep =>
filterByNames.indexOf(normalizePattern(dep.pattern).name) >= 0 ||
(flags && flags.pattern && normalizePattern(dep.pattern).name.includes(flags.pattern)),
Copy link
Member

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?

Copy link
Contributor Author

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.

@arcanis arcanis self-assigned this Oct 3, 2017
Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@arcanis arcanis merged commit 4a0898e into yarnpkg:master Oct 4, 2017
joaolucasl pushed a commit to joaolucasl/yarn that referenced this pull request Oct 27, 2017
This was referenced Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants