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

fix(deps): replace noisy deprecated glob@8 with tinyglobby #6094

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

serhalp
Copy link
Contributor

@serhalp serhalp commented Feb 18, 2025

Summary

Installing netlify-cli prints a deprecation warning. Fixes netlify/cli#7029.

I was going to upgrade glob, but then I remembered it's a fairly large library, so why not use this as an opportunity to replace it? See
https://github.com/es-tooling/module-replacements/blob/main/docs/modules/glob.md.

Compare the APIs:

The only differences are option names and option defaults, which I've updated.

Our uses either hardcode patterns or enforce precisely documented user patterns, so we won't hit any of the limitations of tinyglobby.

... Then I also saw we're using fast-glob too, so I replaced that as well.

Related

See also alternative PR upgrading glob instead: #6143.

const untranspiledFiles = await pGlob(`${path}/**/*.ts`)
const untranspiledFiles = await glob(`${path}/**/*.ts`, {
onlyFiles: true,
followSymbolicLinks: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, this glob() call hangs — seemingly because it's traversing the whole filesystem 😬

@@ -10,7 +10,8 @@ export const getTreeFiles = async function (srcPath: string, stat: Stats): Promi

return await glob(`${srcPath}/**`, {
ignore: `${srcPath}/**/node_modules/**`,
nodir: true,
followSymbolicLinks: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding this here and in ./published.ts fixes some tests in tests/main.test.ts that otherwise hang indefinitely (see other comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although even with this change (which I'm not sure is desirable... we do support symlinks I believe) there are three failing (not hanging) tests. To run those locally:

npm run build && nx run @netlify/zip-it-and-ship-it:test:ci -- tests/main.test.ts

serhalp added 3 commits March 17, 2025 16:32
Installing netlify-cli prints a deprecation warning:
netlify/cli#7029.

I was going to upgrade `glob`, but then I remembered it's a fairly large library, so why
not use this as an opportunity to replace it? See
https://github.com/es-tooling/module-replacements/blob/main/docs/modules/glob.md.

Compare the APIs:
- https://github.com/isaacs/node-glob#readme
- https://github.com/SuperchupuDev/tinyglobby?tab=readme-ov-file#api

The only differences are option names, which I've updated.

Our uses either hardcode patterns or enforce precisely documented user patterns, so we
won't hit any of the limitations of tinyglobby.
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.

npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
1 participant