-
Notifications
You must be signed in to change notification settings - Fork 63
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
chore: Remove direct dependency on inflight via glob #769
Conversation
@@ -305,7 +305,7 @@ function loadSchema(apiResourcePath) { | |||
} | |||
if (fs.pathExistsSync(schemaDirectory) && fs.lstatSync(schemaDirectory).isDirectory()) { | |||
// search recursively for graphql schema files inside `schema` directory | |||
const schemas = glob.sync([path.join(schemaDirectory, '**/*.graphql')]); | |||
const schemas = globby.sync([path.join(schemaDirectory, '**/*.graphql')].map((path) => path.replace(/\\/g, '/'))); |
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.
I believe we used node's built-in path
to enforce the correct path parsing & separator in another context. I can't find the reference, but maybe @dpilch remembers?
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 is what I used to switch the separators:
.relative(opsGenDirectory, generatedFileName) | |
// ensure posix path separators are used | |
.split(path.win32.sep) | |
.join(path.posix.sep); |
Description of changes
glob
module that is not maintained actively withglobby
that is claimed to be much faster and is well maintained. Refer glob's author note in it's repo that recommends globbyglobby
equivaltents.yarn.lock
will still haveinflight
but we don't use it in directly in our source code viaglob
.globby
does not support back slashes in patterns, so we need to normalize the patterns to use forward slashes. We have unit tests for windows for these cases.Codegen Paramaters Changed or Added
Issue #, if available
Description of how you validated changes
Unit and E2E tests
Checklist
yarn test
passespath
) behave differently on windows.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.