backport wax 0.6 fixes to turborepo-wax (#7089)
### Description
Merges upstream wax updates and updates to be compatible. Wax went
through a number of changes between when we pulled it in and now, the
most important commit of which being
https://github.com/olson-sean-k/wax/commit/76afaa120ea58f14f16fec28fd5d1de6737d3d7f
which replaces the filtering logic to handle an edge case around
directory pruning. For more context, see
https://github.com/olson-sean-k/wax/issues/49. I opted to just cherry
pick everything we were missing since trying to pull out just that
commit would be messy and cause us to diverge even more from upstream.
After this PR we should be pretty much aligned, to the point where it
may be worth using upstream again if we can land two changes:
- https://github.com/olson-sean-k/wax/pull/56
-
https://github.com/vercel/turbo/pull/7089/commits/da2b2699f84e3b8ef4a78dc55dbbbd1a9f3ade1c
Probably should just do this commit by commit and ignore the wax cherry
picks. Interesting ones below:
-
https://github.com/vercel/turbo/pull/7089/commits/8322cb73a26cdc68cf25d4d5c72e94271bde89d5:
upgrading wax means we can get rid of our special case handling for
invariant globs (ie paths). it also splits out the large iterator into a
few smaller functions and uses `tracing::instrument` instead of manually
creating spans.
-
https://github.com/vercel/turbo/pull/7089/commits/adc4e3da3fad617499729a65fa08b70fc89dd1d6:
wax's new walking behaviour was not compatible with the way we glob. we
rewrite all the globs to be absolute which caused issues in our tests.
this commit fixes that, adds a test in wax for it, and fixes all of our
turborepo-globwalk tests
-
https://github.com/vercel/turbo/pull/7089/commits/de9f481b99d5f30d0e8f45d57a3abe5da3c1136b
is related, we need to strip out the absolute marker before traversing
to depth `n` otherwise absolute and relative globs would behave
differently
-
https://github.com/vercel/turbo/pull/7089/commits/714c0bb781bb1504a73c07913ba27b8da88bc956
there were a few trait changes, so just make sure to import the correct
one
-
https://github.com/vercel/turbo/pull/7089/commits/da2b2699f84e3b8ef4a78dc55dbbbd1a9f3ade1c
wax ignores broken symlinks because walkdir ignores broken symlinks.
this change handles those and yields them as expected, fixing the final
tests
### Testing Instructions
Existing CI should suffice
Closes TURBO-2139
---------
Co-authored-by: Sean Olson <olson.sean.k@gmail.com>