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

gitignore support #92

Open
benmccann opened this issue Feb 19, 2025 · 4 comments
Open

gitignore support #92

benmccann opened this issue Feb 19, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@benmccann
Copy link
Contributor

from nitrojs/nitro#3108 (comment):

it has a big difference from globby where it does not have integration with npm ignore to auto support gitignore and other repo ignore paths (gitignore patterns are not same as glob ignore patterns, and they are relative to git root)

@SuperchupuDev
Copy link
Owner

i feel like #32 could probably work for these use cases

@pi0
Copy link

pi0 commented Feb 19, 2025

Thanks for the issue and quick replies.

nagated support would be cool however gitignore and glob ignore patterns are different (gitignore patterns are absolute paths relative to git root like /test/* which need to be translated to <glob_base>/**, I assume there are be more diff like this)

For the context of my experience, With unjs/mkdist#265 I tried to workaround, however, regressions like unjs/unbuild#472 happened which finally had to do completely ignore gitignore story (unjs/mkdist#279)

If supporting gitignore feels out of this project scope, I can understand, however it feel like a really missing part to make tinyglobby full replacement of globby

@SuperchupuDev
Copy link
Owner

supporting a globby option is not out of the scope of this project, but i'm not sure how feasible it would be to implement it without adding any more dependencies (minimal dependencies is the other goal of this project). so i'm open to adding it as long as no new deps are introduced (even if the gitignore feature is used by many, it's still a really low % of usages compared to total globby usages (i have not verified this but i remember it being this way))

@Torathion
Copy link
Contributor

Torathion commented Feb 20, 2025

We were already talking about it in #70 . globby uses ignore for its gitignore option while also handling everything itself.

But it's essentially: check for option -> find gitignore file -> parse file content -> use ignore for each line inside the gitignore file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants