After cloning the repository execute:
npm install
Install TypeScript
npm install -g typescript
And we are ready to go!
- Place the SVG files in the
[root]/svgs
directory. - Rename files to PascalCase without numbers, spaces or any other special chracters. For many files check batch renaming below.
- Execute
npm run build
, further details in Build process - Verify the Icon in any of your projects and
- Open a PR!
node scripts --typescript svgs src
Which generates react components in TypeScript in the folder src
, and finally:
TypeScript files are transpiled by executing the command tsc
, which is configured by the files tsconfig.json.
Batch rename files by replacing values as shown in the command below.
# verify the command initially
for file in *; do echo mv $file ${file//OLD_VALUE/NEW_VALUE}; done
# remove `echo` and execute it to apply changes
for file in *; do mv $file ${file//OLD_VALUE/NEW_VALUE}; done
How to fix a SVG using Inkscape
- Open the SVG in inkscape.
- Make the changes.
- (Important) Crop to selection, hotkey CTRL + SHIFT + R and Save.
Using the open source Inkscape you can automate removal of canvas which doesn't contain the icon. (Or you can manually do that as described above.)
foreach ($file in $files){
inkscape --verb=FitCanvasToDrawing --verb=FileSave --verb=FileQuit ".\$file"
}