Lucide 0.15.0 (#272)
* add configs
* Add vue components
* Add documentation
* add alpha release version
* improve npm ignore files
* add tests
* Make style and class attrs work
* 📦 bump version
* Add Icon suffix for component names
* bump version
* Add icon component example
* remove space
* add new build strategy
* Write a better intro
* add other node design
* fix
* add new default template
* add tempalte
* improve code
* small improvements
* small improvements
* move files
* Connect lucide with lucide-react
* Add support for vue
* Add licenses to packages
* Fix tests
* refactor build scripts
* Minor code fixes
* update homepage readme
* Update footer text
* Add a better introduction to packages
* Split up in tempaltes
* Add new types build file
* Setup workflow file
* update readme
* update
* Fix build
* remove debug code
* Add check if svgs have duplicated children
* Add check if their are no children
* small fixes
* last fixes in the build
* Move script to packages folder
* Fix tests and add types for lucide
* Add rule to package.json
* add types in build
* add npm ignore
* update package.jsons
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import getArgumentOptions from 'minimist';
|
||||
import getArgumentOptions from 'minimist'; // eslint-disable-line import/no-extraneous-dependencies
|
||||
|
||||
import renderIconsObject from './render/renderIconsObject';
|
||||
import renderIconNodes from './render/renderIconNodes';
|
||||
import generateIconFiles from './build/generateIconFiles';
|
||||
import generateExportsFile from './build/generateExportsFile';
|
||||
import { readSvgDirectory } from './helpers';
|
||||
|
||||
/* eslint-disable import/no-dynamic-require */
|
||||
import { readSvgDirectory } from './helpers';
|
||||
|
||||
const cliArguments = getArgumentOptions(process.argv.slice(2));
|
||||
|
||||
@@ -23,26 +20,14 @@ if (!fs.existsSync(OUTPUT_DIR)) {
|
||||
|
||||
const svgFiles = readSvgDirectory(ICONS_DIR);
|
||||
|
||||
const icons = renderIconsObject(svgFiles, ICONS_DIR);
|
||||
const icons = renderIconsObject(svgFiles, ICONS_DIR, cliArguments.renderUniqueKey);
|
||||
|
||||
const iconVNodes = renderIconNodes(icons, cliArguments);
|
||||
|
||||
const defaultIconFileTemplate = ({ componentName, node }) => `
|
||||
const ${componentName} = ${node};
|
||||
|
||||
export default ${componentName};
|
||||
`;
|
||||
|
||||
const iconFileTemplate = cliArguments.templateSrc
|
||||
? require(cliArguments.templateSrc).default
|
||||
: defaultIconFileTemplate;
|
||||
const defaultIconFileTemplate = './templates/defaultIconFileTemplate';
|
||||
// eslint-disable-next-line import/no-dynamic-require
|
||||
const iconFileTemplate = require(cliArguments.templateSrc || defaultIconFileTemplate).default;
|
||||
|
||||
// Generates iconsNodes files for each icon
|
||||
generateIconFiles(iconVNodes, OUTPUT_DIR, iconFileTemplate);
|
||||
generateIconFiles(icons, OUTPUT_DIR, iconFileTemplate, { showLog: !cliArguments.silent });
|
||||
|
||||
// Generates entry files for the compiler filled with icons exports
|
||||
generateExportsFile(
|
||||
path.join(SRC_DIR, 'icons/index.js'),
|
||||
path.join(OUTPUT_DIR, 'icons'),
|
||||
iconVNodes,
|
||||
);
|
||||
generateExportsFile(path.join(SRC_DIR, 'icons/index.js'), path.join(OUTPUT_DIR, 'icons'), icons);
|
||||
|
||||
Reference in New Issue
Block a user