-
Notifications
You must be signed in to change notification settings - Fork 69
fix(deps): replace glob usage with fast-glob #6384
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
base: main
Are you sure you want to change the base?
Conversation
8983e60
to
be136d8
Compare
cwd: baseDir, | ||
}) | ||
|
||
result.push(...resolved) | ||
// esbuild expects relative paths, but tinyglobby uses `posix.normalize()` which strips leading `./` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credit to @serhalp for figuring this one out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is about tinyglobby (from my other PR), but here we're switching to fast-glob.
AFAICT from reading the fast-glob source and tests, this shouldn't be needed, I think. I wonder if this is resulting in ././foo
which happens to still work fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's figure out if that's the case and avoid the duplicated segments if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this code the test included_files with multiple glob stars are correctly resolved before passing to esbuild
fails because lang/en.json
is missing the leading ./
. I'll update the comment though.
"filter-obj": "^6.0.0", | ||
"find-up": "^7.0.0", | ||
"glob": "^8.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anyone else reviewing this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for taking this over! Just one callout
@@ -17,8 +17,7 @@ export const getSideFiles = async function (functionPath: string, stat: Stats): | |||
const paths = await glob(`${functionPath}/**`, { | |||
absolute: true, | |||
cwd: functionPath, | |||
ignore: `**/node_modules/**`, | |||
nodir: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 fast-glob onlyFiles
is true
by default, I see: https://github.com/mrmlnc/fast-glob?tab=readme-ov-file#onlyfiles
cwd: baseDir, | ||
}) | ||
|
||
result.push(...resolved) | ||
// esbuild expects relative paths, but tinyglobby uses `posix.normalize()` which strips leading `./` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is about tinyglobby (from my other PR), but here we're switching to fast-glob.
AFAICT from reading the fast-glob source and tests, this shouldn't be needed, I think. I wonder if this is resulting in ././foo
which happens to still work fine?
Summary
This work started off with remaking #6143 (i.e. upgrading glob to the highest version we can support) but turned into simply trying to remove the package from our dependencies instead with the aim of reducing our package size.
For us to review and ship your PR efficiently, please perform the following steps:
we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
something that`s on fire 🔥 (e.g. incident related), you can skip this step.
your code follows our style guide and passes our tests.
A picture of a cute animal (not mandatory, but encouraged)