Skip to content

Commit

Permalink
fix(lucide-svg): correct pascal to kebab conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
y-nk committed Dec 1, 2023
1 parent 282c45e commit 3612ca5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lucide-svg/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const {
...configs
} = lucide

console.log({ icons })

const { window } = new JSDOM(``);
globalThis.document = window.document

Expand All @@ -21,7 +23,11 @@ rmSync('./dist', {
mkdirSync('./dist')

for (const [key, val] of Object.entries(configs)) {
const fileName = `${kebab(key).slice(1)}.svg`
const iconName = kebab(key)
.slice(1)
.replace(/([a-z])([0-9])/g, '$1-$2')

const fileName = `${iconName}.svg`
const fileContent = createElement(val).outerHTML

writeFileSync(`./dist/${fileName}`, fileContent, 'utf-8')
Expand Down
2 changes: 1 addition & 1 deletion lucide-svg/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lucide-svg",
"type": "module",
"version": "1.0.0",
"version": "1.1.0",
"description": "Generic render of lucide components as single svg files",
"homepage": "https://github.com/y-nk/nonorepo/tree/main/lucide-svg",
"keywords": [
Expand Down

0 comments on commit 3612ca5

Please sign in to comment.