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: resolve and include scanDirs within node_modules for auto import #812

Merged
merged 2 commits into from Jan 10, 2023

Conversation

yassilah
Copy link
Contributor

@yassilah yassilah commented Jan 7, 2023

πŸ”— Linked issue

Fixes a Nuxt related issue: nuxt/nuxt#12389
I'm not sure this is the best way to fix it but this should at least allow for fully customizing that exclude array.

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Jan 7, 2023

Codecov Report

Merging #812 (7f0f94f) into main (78808dd) will decrease coverage by 0.01%.
The diff coverage is 80.00%.

❗ Current head 7f0f94f differs from pull request most recent head 65b8fbe. Consider uploading reports for the commit 65b8fbe to get more accurate results

@@            Coverage Diff             @@
##             main     nuxt/framework#812      +/-   ##
==========================================
- Coverage   70.15%   70.14%   -0.02%     
==========================================
  Files          57       57              
  Lines        5234     5238       +4     
  Branches      576      577       +1     
==========================================
+ Hits         3672     3674       +2     
- Misses       1553     1555       +2     
  Partials        9        9              
Impacted Files Coverage Ξ”
src/options.ts 86.50% <80.00%> (-0.46%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@manniL manniL requested a review from pi0 January 7, 2023 15:29
@pi0
Copy link
Member

pi0 commented Jan 9, 2023

Enabling auto imports for all node_modules can both impact performance and increase chances of unwanted auto import behavior.

Similar to Nuxt, we shall explicitly enable auto imports for options.dirs (~layers in nuxt 3)

@yassilah
Copy link
Contributor Author

yassilah commented Jan 9, 2023

Are folders explicitly set in options.dirs included despite options.exclude? e.g. would this still apply the plugin here:

imports: {
    dirs: ['node_modules/foo/composables']
    exclude: [/node_modules/]
}

@pi0 pi0 changed the title fix: empty imports.exclude array by default fix: resolve and include scanDirs within node_modules for auto import Jan 10, 2023
@pi0 pi0 merged commit 4654e59 into unjs:main Jan 10, 2023
@yassilah
Copy link
Contributor Author

Thanks so much for taking the time πŸ’›

pi0 added a commit that referenced this pull request Jan 16, 2023
…rt (#812)

Co-authored-by: Pooya Parsa <pooya@pi0.io>
@yassilah yassilah deleted the fix-default-import-exclude branch January 16, 2023 16:49
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