1234567891011121314151617181920212223242526272829 |
- #!/usr/bin/env node
- import { buildJsIcons } from '../../.build/build-icons.mjs'
- const componentTemplate = ({
- type,
- name,
- namePascal,
- children
- }) => `\
- import createReactComponent from '../createReactComponent';
- export default createReactComponent('${type}', '${name}', '${namePascal}', ${JSON.stringify(children)});`;
- const indexItemTemplate = ({
- name,
- namePascal
- }) => `export { default as ${namePascal} } from './${namePascal}';`
- const aliasTemplate = ({ fromPascal, toPascal }) => `export { default as Icon${fromPascal} } from './icons/Icon${toPascal}';\n`
- buildJsIcons({
- name: 'icons-react',
- componentTemplate,
- indexItemTemplate,
- aliasTemplate,
- indexFile: 'index.ts',
- pascalCase: true,
- extension: 'ts'
- })
|