For glob patterns with a fixed prefix, fsWalk will now no longer traverse directories whose contents obviously cannot match, because the directory path doesn't match the fixed prefix of the pattern.
For example, previously, globbing for .spago/p/tailrec-6.1.0/**/*.purs would traverse every directory (apart from those in a .gitignore, although in the case of globbing for something in .spago, that's not of much help).
Now only directories whose relative path starts with .spago/p/tailrec-6.1.0 would be recursed into.
To determine the longest fixed prefix of a glob pattern, i used the scan function from picomatch, which is already a dependency of micromatch.
[ ] Added the change to the "Unreleased" section of the changelog
[ ] Added a test for the contribution (if applicable)
P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 😊
Description of the change
For glob patterns with a fixed prefix, fsWalk will now no longer traverse directories whose contents obviously cannot match, because the directory path doesn't match the fixed prefix of the pattern.
For example, previously, globbing for
.spago/p/tailrec-6.1.0/**/*.purs
would traverse every directory (apart from those in a .gitignore, although in the case of globbing for something in .spago, that's not of much help). Now only directories whose relative path starts with.spago/p/tailrec-6.1.0
would be recursed into.To determine the longest fixed prefix of a glob pattern, i used the scan function from
picomatch
, which is already a dependency of micromatch.Fix #1243 as per https://github.com/purescript/spago/issues/1243#issuecomment-2211732428
Checklist:
P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 😊