Skip to content

Replace fast-glob with tinyglobby#1447

Closed
gameroman wants to merge 6 commits intowebpro-nl:mainfrom
gameroman:tinyglobby
Closed

Replace fast-glob with tinyglobby#1447
gameroman wants to merge 6 commits intowebpro-nl:mainfrom
gameroman:tinyglobby

Conversation

@gameroman
Copy link
Copy Markdown
Contributor

Closes #1446

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jan 6, 2026

Open in StackBlitz

npm i https://pkg.pr.new/knip@1447

commit: 6ef9df8

@webpro
Copy link
Copy Markdown
Member

webpro commented Jan 6, 2026

Thanks for bringing this up again, and the efforts already put in. I'm going to change the title to make it clear that we should really only merge if we can get this right.

@webpro webpro changed the title Replace fast-glob with tinyglobby where possible Replace fast-glob with tinyglobby Jan 6, 2026
@gameroman
Copy link
Copy Markdown
Contributor Author

gameroman commented Jan 6, 2026

looks like there are 4 places where the firstGlob function is used

const isEnabled: IsPluginEnabled = async ({ cwd }) => Boolean(await _firstGlob({ cwd, patterns: ['yarn.lock'] }));

return Boolean(await _firstGlob({ cwd, patterns: defaultConfigPatterns }));

Boolean(await _firstGlob({ cwd, patterns: ['.github/workflows/*.{yml,yaml}'] }));

(await _firstGlob({ cwd, patterns: ['pnpm-lock.yaml', 'pnpm-workspace.yaml'] }))

@gameroman
Copy link
Copy Markdown
Contributor Author

@webpro I removed 2 of the usages and will see if I can deal with the other 2

@gameroman
Copy link
Copy Markdown
Contributor Author

removed another one

@gameroman
Copy link
Copy Markdown
Contributor Author

removed the last one

@silverwind
Copy link
Copy Markdown

silverwind commented Jan 13, 2026

Could use fsPromises.glob as well, given that it's available in Node 22 and greater which matches the minimum version of this module.

@webpro
Copy link
Copy Markdown
Member

webpro commented Jan 13, 2026

Knip requires at least Node.js v18, tinyglobby v12. And I don't expect Knip to reach the fs.glob threshold too soon, as it might be helpful in legacy projects trying to keep up. That said, using built-ins is usually a good idea once we can (but tbh haven't looked into differences here recently).

@silverwind
Copy link
Copy Markdown

Ah sorry, I was looking at the wrong package.json, carry on :D

@gameroman
Copy link
Copy Markdown
Contributor Author

#1462

@gameroman gameroman closed this Jan 18, 2026
@gameroman gameroman deleted the tinyglobby branch January 18, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧩 Replace fast-glob with tinyglobby

3 participants