-
Notifications
You must be signed in to change notification settings - Fork 17
chore: replace micromatch with picomatch #208
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
base: next
Are you sure you want to change the base?
chore: replace micromatch with picomatch #208
Conversation
🦋 Changeset detectedLatest commit: 95c6164 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
I believe the reason why we switched to
I see the tests are passing with picomatch, which is interesting. I played around a bit with it and it seems like the most interesting use cases of braces (e. g. different extensions like |
I changed this PRs base to be the |
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.
Code-wise I think it's great!
|
||
const positiveExclusionPatterns = | ||
(thereAreExclusions && exclusions.filter((pattern) => !isNegatedGlob(pattern))) || [] | ||
const negativeExclusionPatterns = |
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.
suggestion (non-blocking): since "positive exclusion" and "negative exclusion" aren't commonly understood terms, hence they require some time to understand, perhaps we could instead have "positive exclusion" and "re-inclusion"?
const negativeExclusionPatterns = | |
const reInclusionPatterns = |
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.
Agree. Fixed
020d12d
to
03ebcf0
Compare
03ebcf0
to
dba2c54
Compare
dba2c54
to
95c6164
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.
Thanks! The regression in the lilconfig migration made me a bit worried, could you add some extra tests to packages/steiger/src/shared/globs/create-filter-according-to-globs.spec.ts
relating to brace expansion? Currently there's only one, and it only tests brace expansion in exclusions, I'd like to make sure it also works in inclusions and negated patterns.
Ok, thanks for the review. I'll add more tests later this week. |
Improve glob filtering performance by replacing micromatch with picomatch and decrease node_modules size
234kb vs 83kb
https://node-modules.dev/grid/depth#install=picomatch
https://node-modules.dev/grid/depth#install=micromatch