- Notifications
You must be signed in to change notification settings - Fork941
fix\!: pattern exclusion not working correctly with negation patterns#10031
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
…le preserving wildcard functionality
GiladShoham approved these changesOct 9, 2025
4eac30b
intomaster 11 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
Description
This PR fixes a bug where pattern exclusion with
\!
(negation) wasn't working correctly for new (non-exported) components.Problem
Pattern exclusion was broken for new components that haven't been exported yet. Even when using the full component ID with scope, the exclusion didn't work. For example:
\!scope/comp1
should exclude the component, but it didn't**, \!scope/comp1
should match all except comp1, but comp1 was still includedThe root cause was specific to new components:
legacyId.toString()
returns justcomp1
(without scope)id.toStringWithoutVersion()
returnsscope/comp1
(with scope)['comp1', 'scope/comp1']
to multimatch\!scope/comp1
was applied, it excludedscope/comp1
but NOTcomp1
comp1
wasn't excluded, multimatch returned it, and the component was incorrectly includedNote: For exported components, both IDs include the scope, so the exclusion worked correctly.
Solution
The fix removes the legacy ID format from pattern matching, using only the harmony ID format (with scope) consistently for all components. This ensures exclusion patterns work correctly for both new and exported components.
Implementation
This is a clean solution - just 3 lines of logic that fixes the exclusion functionality.
Testing
\!scope/comp1
- excludes comp1 ✓**, \!scope/comp1
- matches all except comp1 ✓\!**/comp1
- excludes comp1 using wildcard ✓Breaking Change
Multiple component patterns without scope
"comp1, comp2, comp3"
worked for new components"scope/comp1, scope/comp2, scope/comp3"
"**/comp1, **/comp2, **/comp3"
Note: Single component patterns like
"comp1"
(without comma) still work regardless, because they use the workspace/scoperesolveComponentId
method instead of multimatch.Trade-off (not a breaking change)
Single component patterns without scope
\!comp1
(without scope) still don't work (this didn't work before either)\!scope/comp1
\!**/comp1
Why this is actually better