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,6 +1,6 @@
|
||||
const { promises: fs } = require("fs");
|
||||
const outlineStroke = require("svg-outline-stroke");
|
||||
const { parse, stringify } = require("svgson");
|
||||
const { promises: fs } = require('fs');
|
||||
const outlineStroke = require('svg-outline-stroke');
|
||||
const { parse, stringify } = require('svgson');
|
||||
|
||||
const inputDir = `./icons/`;
|
||||
const outputDir = `./converted_icons/`;
|
||||
@@ -8,19 +8,16 @@ const outputDir = `./converted_icons/`;
|
||||
async function init() {
|
||||
try {
|
||||
const files = await fs.readdir(inputDir);
|
||||
for (let file of files) {
|
||||
for (const file of files) {
|
||||
const icon = await fs.readFile(`${inputDir}${file}`);
|
||||
const scaled = await parse(icon.toString(), {
|
||||
transformNode: transformForward
|
||||
transformNode: transformForward,
|
||||
});
|
||||
const outlined = await outlineStroke(stringify(scaled));
|
||||
const outlinedWithoutAttrs = await parse(outlined, {
|
||||
transformNode: transformBackwards
|
||||
transformNode: transformBackwards,
|
||||
});
|
||||
await fs.writeFile(
|
||||
`${outputDir}${file}`,
|
||||
stringify(outlinedWithoutAttrs)
|
||||
);
|
||||
await fs.writeFile(`${outputDir}${file}`, stringify(outlinedWithoutAttrs));
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@@ -30,25 +27,25 @@ async function init() {
|
||||
init();
|
||||
|
||||
function transformForward(node) {
|
||||
if (node.name === "svg") {
|
||||
if (node.name === 'svg') {
|
||||
return {
|
||||
...node,
|
||||
attributes: {
|
||||
...node.attributes,
|
||||
width: 960,
|
||||
height: 960
|
||||
}
|
||||
height: 960,
|
||||
},
|
||||
};
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
function transformBackwards(node) {
|
||||
if (node.name === "svg") {
|
||||
if (node.name === 'svg') {
|
||||
const { width, height, ...attributes } = node.attributes;
|
||||
return {
|
||||
...node,
|
||||
attributes
|
||||
attributes,
|
||||
};
|
||||
}
|
||||
return node;
|
||||
|
||||
Reference in New Issue
Block a user