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

feat: remove scoped package / when pattern without / #1168

Merged

Conversation

magicdawn
Copy link
Contributor

image

the reason for the screenshot is that minimatch treats / as a directory.
and if we want to update a scoped package, we must use a explicit slash like *keyword*/*subkeyword*

a solution may be:
if provided pattern does not include a slash, and the dep is a scoped package with a slash.
then replace / with _, so @scope/name turns to @scope_name, so that * can finally match the "slash"

an other solution may be, split the @scope/name and let split partial to match pattern,
like

(!pattern.includes('/') &&
              dependencyName.includes('/') &&
              dependencyName.split('/').some(partial => minimatch(partial, pattern)))

Copy link
Owner

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

Looks great!

@raineorshine raineorshine merged commit 7bab8bb into raineorshine:main Jul 22, 2022
10 checks passed
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.

None yet

2 participants