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: replace minimatch with micromatch #83

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

curbengh
Copy link

@curbengh curbengh commented Aug 5, 2019

micromatch is a replacement of minimatch. It supports multiple patterns in an array, without the need of string-to-array conversion, along with other globbing features.

Depends on Node 8 or above.

More details: hexojs/hexo#3538

@codecov
Copy link

codecov bot commented Aug 5, 2019

Codecov Report

Merging #83 into master will decrease coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
- Coverage   94.73%   94.56%   -0.18%     
==========================================
  Files           5        5              
  Lines         190      184       -6     
==========================================
- Hits          180      174       -6     
  Misses         10       10
Impacted Files Coverage Δ
lib/concatJS.js 97.4% <ø> (ø) ⬆️
lib/optimizeCSS.js 100% <100%> (ø) ⬆️
lib/optimizeHTML.js 77.27% <100%> (-1.9%) ⬇️
lib/optimizeImage.js 97.14% <100%> (ø) ⬆️
lib/optimizeJS.js 90.9% <100%> (-0.76%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d974eb3...e23c9eb. Read the comment docs.

@curbengh
Copy link
Author

curbengh commented Aug 5, 2019

matchBase/basename option in micromatch only works with globbing pattern without slashes (e.g. '*.min.js'), so pattern like 'src/**/*' would only works when "basename" option is disabled.

One way to work around it is to let user customize the micromatch option,
see lint-staged/lint-staged#179
https://github.com/curbengh/hexo-yam/blob/7d06de7e7920b536083f4b5e9b93375ee57ea120/lib/filter.js#L27-L30

Alternatively, we could also detect whether the pattern contains a slash and disable "basename" accordingly.

@chenzhutian
Copy link
Owner

hey there are some conflicts, can you please have a see?
Also, can you update the readme for using micromatch?

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