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(nuxt): scan component dirs case-sensitively #20995

Merged
merged 1 commit into from May 22, 2023

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves #20952

❓ 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)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

On case-insensitive file systems, we were wrongly assuming that the scanned path (e.g. ~/components/global) was the actual path to the file (which might be something like ~/components/Global/Test.vue). This meant we could end up scanning components multiple times, and applying different rules to them.

This PR adds an extra check to ensure that we don't scan a directory for components if that directory differs in case from the pattern we've been given, and additionally prints a warning message:

Nuxi 3.5.1                                                                                                                                                               08:58:36
Nuxt 3.5.1 with Nitro 2.4.1                                                                                                                                              08:58:36
                                                                                                                                                                         08:58:37
  > Local:    http://localhost:3000/ 
  > Network:  http://10.169.66.24:3000/


 WARN  [nuxt] Components not scanned from ~/components/Global. Did you mean to name the directory ~/components/global instead?                                           08:58:38

β„Ή Vite client warmed up in 446ms                                                                                                                                         08:58:39
βœ” Nitro built in 460 ms                                                                                                                                            nitro 08:58:39

We could alternatively respect the case-insensitive match but whichever option we choose will break some potential usage, and it is safer to be case-sensitive as otherwise builds will mysteriously fail in CI after passing locally for users.

πŸ“ Checklist

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

@danielroe danielroe merged commit 3ed0d0f into main May 22, 2023
19 checks passed
@danielroe danielroe deleted the fix/component-scan-case branch May 22, 2023 10:04
@github-actions github-actions bot mentioned this pull request May 22, 2023
This was referenced May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Case sensitivity issue on auto imports generated global components
2 participants