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: handle path negations when scanning public assets #2250

Merged
merged 6 commits into from
Mar 13, 2024
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 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

Discovered while triaging issue with nuxt/nuxt#26203, we basically weren't handling ignore patterns beginning with ! if they did not also start with !*. (They would end up as part of a directory name.)

πŸ“ Checklist

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

@pi0
Copy link
Member

pi0 commented Mar 12, 2024

Would you mind to add regression test to fixture?

@danielroe
Copy link
Member Author

danielroe commented Mar 12, 2024

Will do πŸ’Ή

Investigating it actually seems that fast-glob does not support negative patterns within ignore (upstream issue). That is a pretty big issue, IMHO.

What do you think about custom ignore patterns per publicAssets dir? In Nuxt, we never want to ignore any build output in dist/client/_nuxt but want the user to be able to ignore patterns in their ~/public directory, for example.

Alternatively, investigating another approach ...

@danielroe danielroe self-assigned this Mar 12, 2024
@danielroe danielroe requested a review from pi0 March 12, 2024 23:38
@danielroe danielroe added the bug Something isn't working label Mar 12, 2024
@danielroe
Copy link
Member Author

Okay, I think we're good to go here, using include rather than ignore patterns allows us to support negated ignore patterns without breaking current behaviour.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Nice changes!

@pi0 pi0 merged commit 0b4b5c2 into main Mar 13, 2024
5 checks passed
@pi0 pi0 deleted the fix/negation branch March 13, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants