From 1c0d763f701eda526e6277a4d1c2153fce9e9edc Mon Sep 17 00:00:00 2001 From: SMAH1 Date: Sun, 4 Apr 2021 09:34:14 +0430 Subject: [PATCH] Delete buildIconsIndex.js --- .../lucide-angular/scripts/buildIconsIndex.js | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 packages/lucide-angular/scripts/buildIconsIndex.js diff --git a/packages/lucide-angular/scripts/buildIconsIndex.js b/packages/lucide-angular/scripts/buildIconsIndex.js deleted file mode 100644 index 84a6cc483..000000000 --- a/packages/lucide-angular/scripts/buildIconsIndex.js +++ /dev/null @@ -1,39 +0,0 @@ -import path from 'path'; - -import { - writeFile, - resetFile, - appendFile, - readSvgDirectory, -} from '../../../scripts/helpers'; - -const TARGET_DIR = path.join(__dirname, '../projects/lucide-angular/build'); -const ICONS_DIR = path.resolve(__dirname, '../../../icons'); -const TYPES_FILE_NAME = 'icons-index.ts'; - -// Generates header of d.ts file include some types and functions -const typeDefinitions = `\ -export type IconNode = readonly [string, object]; -export type IconData = readonly [string, object, IconNode[] ]; - -export declare const icons: { [key: string]: IconData }; - -// Generated icons -`; - -resetFile(TYPES_FILE_NAME, TARGET_DIR); -writeFile(typeDefinitions, TYPES_FILE_NAME, TARGET_DIR); - -const svgFiles = readSvgDirectory(ICONS_DIR); - -svgFiles.forEach(svgFile => { - const kebab = path.basename(svgFile, '.svg'); - - appendFile( - `export * from './icons/${kebab}';\n`, - TYPES_FILE_NAME, - TARGET_DIR, - ); -}); - -console.log(`Generated ${TYPES_FILE_NAME} file with`, svgFiles.length, 'icons');