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(import-dir): Ignore file extensions | Ignore .test files #746

Merged
merged 3 commits into from Jun 24, 2020
Merged

fix(import-dir): Ignore file extensions | Ignore .test files #746

merged 3 commits into from Jun 24, 2020

Conversation

dac09
Copy link
Collaborator

@dac09 dac09 commented Jun 24, 2020

What does it do?
Fixes redwood dir importer babel plugin to:

  • remove extensions
  • not import test files

Community Discussion Reference

@peterp
Copy link
Contributor

peterp commented Jun 24, 2020

WOW 🤩 , Thank you!

Comment on lines 61 to 64
const filePathWithoutExtension = path.join(
parsedPath.dir,
parsedPath.name
)
Copy link
Contributor

Choose a reason for hiding this comment

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

node imports paths are normalized across operating systems, so I don't think we need to use path.join() here, instead .join('/') should be enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 Change coming up

@dac09
Copy link
Collaborator Author

dac09 commented Jun 24, 2020

It might be a good idea to update the default scaffold to use the dir-import instead of importAll too - not sure where this is though!

@peterp
Copy link
Contributor

peterp commented Jun 24, 2020

It might be a good idea to update the default scaffold to use the dir-import instead of importAll too

You're right, it's probably time, and then we can remove importAll.macro from the api side!

That needs to be done over here: https://github.com/redwoodjs/create-redwood-app/blob/main/api/src/functions/graphql.js

@peterp peterp added this to the next release milestone Jun 24, 2020
@peterp peterp merged commit 008c166 into redwoodjs:main Jun 24, 2020
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.

None yet

2 participants