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

mm.isMatch(path.join(folder.replace(srcFolder, ''), file) is not working properly #43

Closed
diegoazh opened this issue Aug 1, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@diegoazh
Copy link

diegoazh commented Aug 1, 2021

Describe the bug
On commit 554f804ec133a94db99a22eb5f1b110817a214452ce1868738fa5321237ce7a7 the line 81 on cmds/index.js changes from

mm.contains(`${chalk.dim(folder)}/${file}`, exclude)

to

mm.isMatch(path.join(folder.replace(srcFolder, ''), file)

the problem is when the source folder is ./src it replace it for an empty string ('') and micromatch use picomatch under the hood:

image

and as you can see in line 47 of the next image if glob argument is equal to '' it throws an error and brokes the process

image

Ok, the question probably is why it is receiving the empty string on the glob of picomatch, is because in the change mentioned above, the srcFolder is replaced with '' and in the first iteration the variable folder is the default value for the --source argument, I mean ./src, you can check that in the following image

image

To Reproduce
Steps to reproduce the behavior:

Is simple you need a repo with the following structure:

image

and run the following command npx vuepress-jsdoc

Expected behavior
Works normally like as v3.2.0 worked before the mentioned change.

Node (please complete the following information):

  • Node-Version: v14.17.1

Additional context
Add any other context about the problem here.

diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Aug 1, 2021
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
@ph1p ph1p added the bug Something isn't working label Aug 1, 2021
@ph1p
Copy link
Owner

ph1p commented Aug 1, 2021

Thank you! I'll take a look at it as soon as I can (:

@ph1p ph1p closed this as completed in 81e9a71 Aug 1, 2021
@ph1p
Copy link
Owner

ph1p commented Aug 1, 2021

Hopefully it's fixed with the new version 3.6.0. I removed every empty string inside the exclude array. Also I updated some dependencies. Thanks for reporting.

@diegoazh
Copy link
Author

diegoazh commented Aug 3, 2021

I will test the new version the next weekend, thank you!!!

@diegoazh
Copy link
Author

This issue was resolved on the last released version but I have a new issue now 😅

diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Sep 9, 2021
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Nov 23, 2021
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Nov 23, 2021
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Nov 23, 2021
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Nov 23, 2021
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Feb 11, 2022
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
diegoazh added a commit to diegoazh/gmap-vue that referenced this issue Feb 11, 2022
vuepress-jsdoc has an issue with minimatch and picomatch with the src
folder because it replace for an empty string but picomatch throw an
erro if glob is an empty string.
Issue reported: ph1p/vuepress-jsdoc#43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants