-
Notifications
You must be signed in to change notification settings - Fork 141
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 extension_directories wildcards to always be recursive #5160
base: main
Are you sure you want to change the base?
Fix extension_directories wildcards to always be recursive #5160
Conversation
We detected some changes at packages/*/src and there are no updates in the .changeset. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success2000 tests passing in 903 suites. Report generated by 🧪jest coverage report action from b874496 |
// If a path ends with a single asterisk, modify it to end with a double asterisk. | ||
// This is to support the glob pattern used by chokidar and watch for changes in subfolders. | ||
function fixSingleWildcards(value: string[] | undefined) { | ||
return value?.map((dir) => dir.replace(/\*$/, '**')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this regex also convert a double-asterisk to a triple-asterisk? I think you might want a captured non-asterisk, followed by an asterisk and then end-of-line, as your regex:
return value?.map((dir) => dir.replace(/\*$/, '**')) | |
return value?.map((dir) => dir.replace(/([^\*])\*$/, '$1**')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, this will work for any kind of path type /
or \
I'll add tests to it though :)
9d66cb8
to
b874496
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tophat LGTM! Thanks for the changes.
WHY are these changes introduced?
To improve the handling of custom extension directory paths in app configuration by ensuring proper glob pattern support for watching changes in subfolders.
WHAT is this pull request doing?
Adds functionality to automatically convert single asterisk wildcards (
*
) to double asterisks (**
) in extension directory paths. This ensures proper recursive watching of subdirectories when using chokidar for file watching duringdev
.How to test your changes?
custom_extensions
extension_directories = ['custom_extensions/*']
dev
Measuring impact
Checklist