Thinkmill / manypkg

☔️ An umbrella for your monorepo
MIT License
884 stars 48 forks source link

switch to `fast-glob` to remove 6 dependencies #214

Closed benmccann closed 4 weeks ago

benmccann commented 2 months ago

https://npmgraph.js.org/?q=globby - 23 dependencies https://npmgraph.js.org/?q=fast-glob - 17 dependencies

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: ee161c2a69dcac515737b30b1d0f1358e5f6060c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------- | ----- | | @manypkg/tools | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Andarist commented 1 month ago

why a change from fast-glob to tinyglobby? What features do we lose in either case?

benmccann commented 1 month ago

fast-glob has 17 dependencies (https://npmgraph.js.org/?q=fast-glob) whereas tinyglobby has only 2

I'm not sure I understand your question about features. tinyglobby supports all of the features we're using here (and all of the tests pass, which helps demonstrate that). If there's some particular feature that fast-glob has that you think we may use in the future I can check about getting that added to tinyglobby. We can always switch to fast-glob if needed in the future, but right now that seems pretty hypothetical. The use of globbing functionality here is pretty minimal

Andarist commented 1 month ago

Not all glob libraries are compatible in terms of the patterns they support. So I wonder if any user-provided pattern can change meaning with this change. I'm also not to keen on changing this for a library that currently has 67 weekly downloads.

benmccann commented 1 month ago

Not all glob libraries are compatible in terms of the patterns they support. So I wonder if any user-provided pattern can change meaning with this change.

That's a great call out and something I should have mentioned in the PR description. There is a very tiny change here, which is that numerical expansion within braces (e.g. {01..03}) is not supported with this new library. Besides that, all other glob functionality is the same since both globby and tinyglobby use picomatch under the covers for the majority of matching

I'm also not to keen on changing this for a library that currently has 67 weekly downloads.

It is a very new package. However, it has been adopted by a number of projects already. tinyglobby now has over 85,000 downloads / week

benmccann commented 4 weeks ago

Thanks @emmatown! I really appreciate all the reviews. I've updated the PR to stick with fast-glob for now. I'll see if pnpm and yarn might be willing to switch and perhaps we could revisit it later on if so