fix: remove double "Icon" suffix for Circle, Path, and Infinity components#80
Closed
nathankim0 wants to merge 2 commits intoduongdev:mainfrom
Closed
fix: remove double "Icon" suffix for Circle, Path, and Infinity components#80nathankim0 wants to merge 2 commits intoduongdev:mainfrom
nathankim0 wants to merge 2 commits intoduongdev:mainfrom
Conversation
The generator was incorrectly appending "Icon" suffix twice for components in componentNameMap (Circle, Path, Infinity), resulting in exports like CircleIconIcon instead of CircleIcon. This fix updates the componentNameMap to not include the "Icon" suffix since it's already added by the generator in the export statements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
Hi @nathankim0 thanks for reporting. |
Author
|
@mrkpatchaa Thank you for the review and suggestion! Your approach is indeed better as it maintains backward compatibility while fixing the double suffix issue. I understand the key changes:
This elegantly solves the problem without breaking existing code that might depend on the current export names. I'll update my PR with your suggested changes. |
Per code review feedback, this approach better maintains backward compatibility while fixing the double suffix issue. Key changes: - Keep componentNameMap with original 'Icon' suffixes - Remove componentNameMap usage from generateIconsDefs - Use componentNameMap only for deprecated exports - New Icon-suffixed exports use the plain component name This ensures: - Backward compatibility for existing code using CircleIcon, PathIcon, InfinityIcon - Fixes the double suffix issue (no more CircleIconIcon) - Cleaner separation between deprecated and new exports 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Merged
Collaborator
|
Thank you @nathankim0 |
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
Sign up for free
to 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.
Summary
This PR fixes a bug in the icon generator that was causing certain icon components to have a double "Icon" suffix in their exports.
Problem
The generator was incorrectly appending "Icon" suffix twice for components defined in
componentNameMap(Circle, Path, Infinity), resulting in:CircleIconIconinstead ofCircleIconPathIconIconinstead ofPathIconInfinityIconIconinstead ofInfinityIconSolution
Updated the
componentNameMapingenerator/generate-svg.mjsto not include the "Icon" suffix, as it's already added by the generator in the export statements.Impact
After regenerating the icons with this fix:
Test plan
npm run generateto regenerate all icons