mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-01-17 20:58:34 +01:00
32 lines
819 B
JavaScript
32 lines
819 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs'
|
|
|
|
const componentTemplate = ({
|
|
type,
|
|
name,
|
|
namePascal,
|
|
children
|
|
}) => `\
|
|
import createReactNativeComponent from '../createReactNativeComponent';
|
|
export default createReactNativeComponent('${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-native',
|
|
componentTemplate,
|
|
indexItemTemplate,
|
|
aliasTemplate,
|
|
indexFile: 'index.ts',
|
|
pascalCase: true,
|
|
extension: 'ts'
|
|
})
|
|
|
|
buildIconsList('icons-react-native')
|