From 7d266743c464fdeab10c0f785504a97e9e2b53f3 Mon Sep 17 00:00:00 2001 From: nathankim0 Date: Sat, 27 Sep 2025 00:16:07 +0900 Subject: [PATCH 1/2] fix: remove double "Icon" suffix for reserved component names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- generator/generate-svg.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generator/generate-svg.mjs b/generator/generate-svg.mjs index df39ccf3..5f7a8ff7 100644 --- a/generator/generate-svg.mjs +++ b/generator/generate-svg.mjs @@ -35,9 +35,9 @@ const weights = { }; const componentNameMap = { - Circle: 'CircleIcon', - Path: 'PathIcon', - Infinity: 'InfinityIcon', + Circle: 'Circle', + Path: 'Path', + Infinity: 'Infinity', }; // Some duotone colors do not have a color and opacity @@ -90,6 +90,7 @@ const getIconList = () => { 'swap', 'list', 'test-tube', + 'circle', '', ].includes(file) ); From 9743ae50b9ee4cbee37e5caa86e1fa49dde198a5 Mon Sep 17 00:00:00 2001 From: nathankim0 Date: Sat, 27 Sep 2025 09:47:10 +0900 Subject: [PATCH 2/2] fix: apply maintainer's suggested fix for double Icon suffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- generator/generate-svg.mjs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/generator/generate-svg.mjs b/generator/generate-svg.mjs index 5f7a8ff7..3011f1e9 100644 --- a/generator/generate-svg.mjs +++ b/generator/generate-svg.mjs @@ -35,9 +35,9 @@ const weights = { }; const componentNameMap = { - Circle: 'Circle', - Path: 'Path', - Infinity: 'Infinity', + Circle: 'CircleIcon', + Path: 'PathIcon', + Infinity: 'InfinityIcon', }; // Some duotone colors do not have a color and opacity @@ -59,7 +59,7 @@ const generateIconsDefs = async (icon, weight) => { ).replace(RegExp(`${Case.capital(weight)}$`), ''); const tsCode = await transform(svgCode, options, { - componentName: componentNameMap[componentName] || componentName, + componentName, }); return [...tsCode.matchAll(//g)] @@ -140,8 +140,6 @@ ${Object.entries(defs) const generateMainIconFile = (icon) => { const component = Case.pascal(icon); - // const componentFileName = fileNameMap[component] || component; - const componentName = componentNameMap[component] || component; const componentCode = `import { type Icon, type IconProps } from 'phosphor-react-native' import IconBase from "../lib/icon-base"; @@ -151,9 +149,9 @@ const I: Icon = ({...props }: IconProps) => ( ) -/** @deprecated Use ${componentName}Icon */ -export const ${componentName} = I -export { I as ${componentName}Icon }`; +/** @deprecated Use ${component}Icon */ +export const ${componentNameMap[component] || component} = I +export { I as ${component}Icon }`; const filePath = path.join(__dirname, '../src/icons', `${component}.tsx`);