mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-14 13:58:21 +00:00
Refactor names
This commit is contained in:
@@ -3,9 +3,9 @@ import path from 'path';
|
||||
import prettier from 'prettier';
|
||||
import { generateComponentName } from './helpers';
|
||||
|
||||
export default function(iconVNodesObject, outputDirectory) {
|
||||
export default function(iconNode, outputDirectory) {
|
||||
|
||||
const icons = Object.keys(iconVNodesObject);
|
||||
const icons = Object.keys(iconNode);
|
||||
const iconsDistDirectory = path.join(outputDirectory, `icons`);
|
||||
|
||||
if (!fs.existsSync(iconsDistDirectory)){
|
||||
@@ -16,7 +16,7 @@ export default function(iconVNodesObject, outputDirectory) {
|
||||
const location = path.join(iconsDistDirectory, `${icon}.js`);
|
||||
const ComponentName = generateComponentName(icon);
|
||||
|
||||
const VNode = JSON.stringify(iconVNodesObject[icon]);
|
||||
const VNode = JSON.stringify(iconNode[icon]);
|
||||
|
||||
const element = `
|
||||
export default [${VNode}]
|
||||
|
||||
@@ -2,7 +2,7 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import renderIconsObject from './render/renderIconsObject';
|
||||
import renderIconVNodes from './render/renderIconVNodes';
|
||||
import renderIconNodes from './render/renderIconNodes';
|
||||
import generateIconFiles from './build/generateIconFiles';
|
||||
import generateExportsFile from './build/generateExportsFile';
|
||||
|
||||
@@ -17,7 +17,7 @@ const svgFiles = fs.readdirSync(IN_DIR).filter(file => path.extname(file) === '.
|
||||
const getSvg = svgFile => fs.readFileSync(path.join(IN_DIR, svgFile));
|
||||
|
||||
const icons = renderIconsObject(svgFiles, getSvg);
|
||||
const iconVNodes = renderIconVNodes(icons);
|
||||
const iconVNodes = renderIconNodes(icons);
|
||||
|
||||
generateIconFiles(iconVNodes, OUTPUT_DIR);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import DEFAULT_ATTRS from './default-attrs.json';
|
||||
import { parseDOM } from 'htmlparser2';
|
||||
|
||||
export default (iconsObject) => {
|
||||
const iconVnodes = {}
|
||||
const iconNodes = {}
|
||||
|
||||
for(const icon in iconsObject) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export default (iconsObject) => {
|
||||
])),
|
||||
];
|
||||
|
||||
iconVnodes[icon] = [
|
||||
iconNodes[icon] = [
|
||||
'svg',
|
||||
{
|
||||
...DEFAULT_ATTRS,
|
||||
@@ -27,6 +27,6 @@ export default (iconsObject) => {
|
||||
]
|
||||
}
|
||||
|
||||
return iconVnodes;
|
||||
return iconNodes;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ const createElement = (tag, attrs, children = []) => {
|
||||
}
|
||||
}
|
||||
|
||||
export default (iconVnode) => createElement(iconVnode);
|
||||
export default (iconNode) => createElement(iconNode);
|
||||
|
||||
Reference in New Issue
Block a user