diff --git a/.build/build-icons.mjs b/.build/build-icons.mjs index 61397c556..6fc54f9c7 100644 --- a/.build/build-icons.mjs +++ b/.build/build-icons.mjs @@ -95,3 +95,20 @@ export const buildJsIcons = ({ fs.writeFileSync(path.resolve(DIST_DIR, `./src/aliases.ts`), aliasesStr || `export {};`, 'utf-8') } +export const buildIconsList = (name) => { + const DIST_DIR = path.resolve(PACKAGES_DIR, name); + const allIcons = getAllIcons(false, true) + + let index = [] + Object.entries(allIcons).forEach(([type, icons]) => { + icons.forEach((icon, i) => { + process.stdout.write(`Building \`${name}\` ${type} ${i}/${icons.length}: ${icon.name.padEnd(42)}\r`) + + const iconName = `${icon.name}${type !== 'outline' ? `-${type}` : ''}` + + index.push(iconName) + }) + }) + + fs.writeFileSync(path.resolve(DIST_DIR, `./src/icons-list.ts`), `export default ${JSON.stringify(index, null, 2)};`, 'utf-8') +} diff --git a/packages/icons-preact/.gitignore b/packages/icons-preact/.gitignore index 500cce193..76ea8e161 100644 --- a/packages/icons-preact/.gitignore +++ b/packages/icons-preact/.gitignore @@ -1 +1,2 @@ -src/aliases.ts \ No newline at end of file +src/aliases.ts +src/icons-list.ts diff --git a/packages/icons-preact/build.mjs b/packages/icons-preact/build.mjs index 2acd47761..e9f97e833 100644 --- a/packages/icons-preact/build.mjs +++ b/packages/icons-preact/build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { buildJsIcons } from '../../.build/build-icons.mjs' +import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs' const componentTemplate = ({ type, @@ -27,3 +27,5 @@ buildJsIcons({ indexFile: 'index.ts', extension: 'ts' }) + +buildIconsList('icons-preact') diff --git a/packages/icons-preact/src/tabler-icons-preact.ts b/packages/icons-preact/src/tabler-icons-preact.ts index 4db406fd6..f9bebeabb 100644 --- a/packages/icons-preact/src/tabler-icons-preact.ts +++ b/packages/icons-preact/src/tabler-icons-preact.ts @@ -1,5 +1,6 @@ export * from './icons/index'; export * as icons from './icons/index'; +export * as iconsList from './icons-list'; export * from './aliases'; export { default as createReactComponent } from './createPreactComponent'; diff --git a/packages/icons-react-native/.gitignore b/packages/icons-react-native/.gitignore index 500cce193..76ea8e161 100644 --- a/packages/icons-react-native/.gitignore +++ b/packages/icons-react-native/.gitignore @@ -1 +1,2 @@ -src/aliases.ts \ No newline at end of file +src/aliases.ts +src/icons-list.ts diff --git a/packages/icons-react-native/build.mjs b/packages/icons-react-native/build.mjs index 39b51579f..b42b40fa6 100644 --- a/packages/icons-react-native/build.mjs +++ b/packages/icons-react-native/build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { buildJsIcons } from '../../.build/build-icons.mjs' +import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs' const componentTemplate = ({ type, @@ -27,3 +27,5 @@ buildJsIcons({ pascalCase: true, extension: 'ts' }) + +buildIconsList('icons-react-native') diff --git a/packages/icons-react-native/src/tabler-icons-react-native.ts b/packages/icons-react-native/src/tabler-icons-react-native.ts index 3105ceed9..b752717ed 100644 --- a/packages/icons-react-native/src/tabler-icons-react-native.ts +++ b/packages/icons-react-native/src/tabler-icons-react-native.ts @@ -1,5 +1,6 @@ export * from './icons/index'; export * as icons from './icons/index'; +export * as iconsList from './icons-list'; export * from './aliases'; export { default as createReactComponent } from './createReactNativeComponent'; diff --git a/packages/icons-react/.gitignore b/packages/icons-react/.gitignore index 500cce193..76ea8e161 100644 --- a/packages/icons-react/.gitignore +++ b/packages/icons-react/.gitignore @@ -1 +1,2 @@ -src/aliases.ts \ No newline at end of file +src/aliases.ts +src/icons-list.ts diff --git a/packages/icons-react/build.mjs b/packages/icons-react/build.mjs index f74839ffe..ca309648b 100644 --- a/packages/icons-react/build.mjs +++ b/packages/icons-react/build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { buildJsIcons } from '../../.build/build-icons.mjs' +import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs' const componentTemplate = ({ type, @@ -27,3 +27,5 @@ buildJsIcons({ pascalCase: true, extension: 'ts' }) + +buildIconsList('icons-react') diff --git a/packages/icons-react/src/tabler-icons-react.ts b/packages/icons-react/src/tabler-icons-react.ts index 7e25359a5..3b81af393 100644 --- a/packages/icons-react/src/tabler-icons-react.ts +++ b/packages/icons-react/src/tabler-icons-react.ts @@ -1,5 +1,6 @@ export * from './icons/index'; export * as icons from './icons/index'; +export * as iconsList from './icons-list'; export * from './aliases'; export { default as createReactComponent } from './createReactComponent'; diff --git a/packages/icons-solidjs/.gitignore b/packages/icons-solidjs/.gitignore index 500cce193..76ea8e161 100644 --- a/packages/icons-solidjs/.gitignore +++ b/packages/icons-solidjs/.gitignore @@ -1 +1,2 @@ -src/aliases.ts \ No newline at end of file +src/aliases.ts +src/icons-list.ts diff --git a/packages/icons-solidjs/build.mjs b/packages/icons-solidjs/build.mjs index 40925df64..b649135c9 100644 --- a/packages/icons-solidjs/build.mjs +++ b/packages/icons-solidjs/build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { buildJsIcons } from '../../.build/build-icons.mjs' +import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs' const componentTemplate = ({ type, @@ -27,3 +27,5 @@ buildJsIcons({ extension: 'ts', indexFile: 'index.ts' }) + +buildIconsList('icons-solidjs') diff --git a/packages/icons-solidjs/src/tabler-icons-solidjs.ts b/packages/icons-solidjs/src/tabler-icons-solidjs.ts index 2f290599d..e32913f95 100644 --- a/packages/icons-solidjs/src/tabler-icons-solidjs.ts +++ b/packages/icons-solidjs/src/tabler-icons-solidjs.ts @@ -1,5 +1,6 @@ export * from './icons/index'; export * as icons from './icons/index'; +export * as iconsList from './icons-list'; export * from './aliases'; export { default as createSolidComponent } from './createSolidComponent'; diff --git a/packages/icons-svelte/.gitignore b/packages/icons-svelte/.gitignore index c7de4a0fd..bf11120f6 100644 --- a/packages/icons-svelte/.gitignore +++ b/packages/icons-svelte/.gitignore @@ -1,3 +1,4 @@ src/icons/*.svelte .svelte-kit -src/aliases.ts \ No newline at end of file +src/aliases.ts +src/icons-list.ts diff --git a/packages/icons-svelte/build.mjs b/packages/icons-svelte/build.mjs index 40ff0c509..1fa745236 100644 --- a/packages/icons-svelte/build.mjs +++ b/packages/icons-svelte/build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { buildJsIcons } from '../../.build/build-icons.mjs' +import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs' import { readFileSync, writeFileSync } from 'fs' import { getAllIcons, toPascalCase } from '../../.build/helpers.mjs' @@ -72,3 +72,4 @@ buildJsIcons({ }) updatePackageJson() +buildIconsList('icons-svelte') diff --git a/packages/icons-svelte/src/tabler-icons-svelte.ts b/packages/icons-svelte/src/tabler-icons-svelte.ts index 9e3981e16..838dfb79f 100644 --- a/packages/icons-svelte/src/tabler-icons-svelte.ts +++ b/packages/icons-svelte/src/tabler-icons-svelte.ts @@ -1,5 +1,6 @@ export * from "./icons/index.js"; export * as icons from "./icons/index.js"; +export * as iconsList from './icons-list'; export * from "./aliases.js"; export { default as defaultAttributes } from './defaultAttributes' diff --git a/packages/icons-vue/.gitignore b/packages/icons-vue/.gitignore index 500cce193..76ea8e161 100644 --- a/packages/icons-vue/.gitignore +++ b/packages/icons-vue/.gitignore @@ -1 +1,2 @@ -src/aliases.ts \ No newline at end of file +src/aliases.ts +src/icons-list.ts diff --git a/packages/icons-vue/build.mjs b/packages/icons-vue/build.mjs index d2f534550..69204da59 100644 --- a/packages/icons-vue/build.mjs +++ b/packages/icons-vue/build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { buildJsIcons } from '../../.build/build-icons.mjs' +import { buildJsIcons, buildIconsList } from '../../.build/build-icons.mjs' const componentTemplate = ({ type, @@ -26,3 +26,5 @@ buildJsIcons({ extension: 'ts', indexFile: 'index.ts', }) + +buildIconsList('icons-vue') diff --git a/packages/icons-vue/src/tabler-icons-vue.ts b/packages/icons-vue/src/tabler-icons-vue.ts index d22dec4a1..c6f0ca93d 100644 --- a/packages/icons-vue/src/tabler-icons-vue.ts +++ b/packages/icons-vue/src/tabler-icons-vue.ts @@ -1,5 +1,6 @@ export * from './icons/index'; export * as icons from './icons/index'; +export * as iconsList from './icons-list'; export * from './aliases'; export { default as createVueComponent } from './createVueComponent';