react-native-reusables icon indicating copy to clipboard operation
react-native-reusables copied to clipboard

[ FEATURE ] Automate Lucide Icon additions

Open stephendpmurphy opened this issue 6 months ago • 6 comments

Is your feature request related to a problem? Please describe. To remove a bit of the leg work of adding a new icon it would nice if part of the CLI was essentially a helper that takes the Icon name and creates the necessary lib/icons/*.ts file with the wrapped export.

Describe the solution you'd like Add a new icon command alongside add which takes Lucid icon names as an argument and creates the necessary .ts file.

Describe alternatives you've considered Currently using a script like this to automate the creation

#!/bin/bash

if [ -z "$1" ]; then
  echo "Usage: addIcon.sh <iconName>"
  exit 1
fi

iconName=$1

# Create the new icon file under `lib/icons`
iconPath="src/lib/icons/${iconName}.ts"
touch $iconPath

# Write the icon content
echo "import {${iconName}} from 'lucide-react-native';" >> $iconPath
echo "import {iconWithClassName} from './iconWithClassName';" >> $iconPath
echo "iconWithClassName(${iconName});" >> $iconPath
echo "export {${iconName}};" >> $iconPath

Additional context I've always been interested in creating a node based CLI script and would be happy to tackle this addition if that would be OK.

stephendpmurphy avatar Aug 05 '24 18:08 stephendpmurphy