Open sapphi-red opened 6 days ago
will consider adding it, meanwhile do you have any examples of previous work in other glob libraries?
fast-glob uses micromatch
and node-glob uses minimatch
and both does not extend any features related to matching IIUC, so in these cases those libraries can be used.
globby extends some features but does not provide a function like this.
fast-glob uses
micromatch
and node-glob usesminimatch
and both does not extend any features related to matching IIUC, so in these cases those libraries can be used. globby extends some features but does not provide a function like this.
just wondering, what are the exclusive features that you need that tinyglobby
has but picomatch
doesn't? it uses it under the hood. i can try to implement this but it might take a while until i can focus on it
what are the exclusive features that you need that
tinyglobby
has butpicomatch
doesn't?
I think it's mainly braces expansion support.
tinyglobby
supports the same braces expansion picomatch
does, which despite its readme saying it's not supported, in practice it actually supports nearly all usecases except for range increments {01..10..2}
which to be fair i haven't ever seen used in the wild. if range increments are really needed it's probably possible to add it to tinyglobby
though (with the expandRange
picomatch option)
In Vite, when a file is updated, we check whether that file is included in the glob to know whether the file containing a glob has to be updated.
Links to relevant code
https://github.com/vitejs/vite/blob/802839d48335a69eb15f71f2cd816d0b6e4d3556/packages/vite/src/node/plugins/importMetaGlob.ts#L66-L81 https://github.com/vitejs/vite/blob/802839d48335a69eb15f71f2cd816d0b6e4d3556/packages/vite/src/node/plugins/importMetaGlob.ts#L89-L106I guess Vite cannot simply use
picomatch
astinyglobby
has more features. It would be nice iftinyglobby
exposes a function that returns whether a file path matches the glob.