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

💡 Replace fast-glob by tinyglobby #768

Open
Jayllyz opened this issue Aug 24, 2024 · 5 comments
Open

💡 Replace fast-glob by tinyglobby #768

Jayllyz opened this issue Aug 24, 2024 · 5 comments
Labels
feature request Feature request

Comments

@Jayllyz
Copy link

Jayllyz commented Aug 24, 2024

Suggest an idea for this project

Most of knip deps come from fast-glob.

https://npmgraph.js.org/?q=knip

https://bundlephobia.com/package/fast-glob vs https://bundlephobia.com/package/tinyglobby

repo: https://github.com/SuperchupuDev/tinyglobby

see: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/glob.md

@Jayllyz Jayllyz added the feature request Feature request label Aug 24, 2024
@webpro
Copy link
Collaborator

webpro commented Aug 25, 2024

Interesting. At first glance, only one feature seem to be missing: a way to stop searching when one match is found:

const firstGlob = async ({ cwd, patterns }: BaseGlobOptions) => {
const stream = fg.globStream(patterns.map(removeProductionSuffix), { cwd, ignore: GLOBAL_IGNORE_PATTERNS });
for await (const entry of stream) {
return entry;
}
};

@webpro
Copy link
Collaborator

webpro commented Aug 27, 2024

Related: #678 (would be great if an alternative contains the fix)

@SuperchupuDev
Copy link

SuperchupuDev commented Aug 30, 2024

just tested and it looks like tinyglobby does not have the bug described in #678

image

@webpro
Copy link
Collaborator

webpro commented Aug 31, 2024

Thanks @SuperchupuDev! Now I'd be even happier to start using tinyglobby. Even though the globStream feature is currently used only once in this codebase, I do like to have it available (planning to use it more). Does not have to be part of tinyglobby. For sure I'll keep an eye on tinyglobby, thanks for building it!

@SuperchupuDev
Copy link

Thanks! The problem with globStream is that I have to wait until fdir adds support for streams, there's an open issue from years ago

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

No branches or pull requests

3 participants