fix(convert-signal-inputs): handle input name overlap in template #263
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.
I used the signal inputs generator on a big project recently and ran into trouble with cases like this:
In cases where:
The template was being updated incorrectly, e.g:
NOTE: I noticed there where two different regexes being used for the template based on whether it was a templateUrl or inline. One was simpler and I assume was mistaking left un-updated whilst the other one had been updated to something more complex. I have updated both to use the same updated regex now, but wanted to make a note in case something intentional was happening here
This updates the RegExp to handle the cases I mentioned, break down from ChatGPT who gets credit for writing the actual regex: