Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: escape glob path #9842

Merged
merged 9 commits into from
Aug 29, 2022
Merged

fix: escape glob path #9842

merged 9 commits into from
Aug 29, 2022

Conversation

dominikg
Copy link
Contributor

@dominikg dominikg commented Aug 25, 2022

fix for #9833

Description

escape glob special chars in static path parts of import.meta.glob with fast-glob escape util before executing the glob

Additional context

https://github.com/mrmlnc/fast-glob#escapepathpattern lists the chars that need escaping

One problem was how to split the static part of a resolved alias from the dynamic glob suffix. This was solved by comparing the pattern and the paths char-by-char from the end, finding the first difference.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@dominikg dominikg marked this pull request as draft August 25, 2022 14:51
@dominikg
Copy link
Contributor Author

dominikg commented Aug 25, 2022

edit: this post previously mentioned escaping ^, $ and + not working, but these chars are not the ones needed, see updated issue description for the correct list

@benmccann benmccann added the p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) label Aug 25, 2022
@dominikg dominikg marked this pull request as ready for review August 25, 2022 18:19
@dominikg dominikg marked this pull request as draft August 25, 2022 18:22
@dominikg dominikg marked this pull request as ready for review August 25, 2022 23:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants