Skip to content

Commit

Permalink
Declare the icons "as const" instead of strings (#303)
Browse files Browse the repository at this point in the history
* Declare the icons as consts instead of strings, making them all unique.

* chore: Update @nrk/svg-to-js to v3.1.0

* fix: Use dtsLiteral from svg-to-js instead of custom parser

---------

Co-authored-by: Skjalg Teig <[email protected]>
  • Loading branch information
torgeilo and skjalgepalg authored Aug 21, 2024
1 parent 074b81b commit 4a32acd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function buildIcons (groupName) {
// Generate js and mjs with types for icons and logos
fse.writeFileSync(path.join(npmPath, `${bundleName}.js`), icons.cjs)
fse.writeFileSync(path.join(npmPath, `${bundleName}.mjs`), icons.esm)
fse.writeFileSync(path.join(npmPath, `${bundleName}.d.ts`), icons.dts)
fse.writeFileSync(path.join(npmPath, `${bundleName}.d.ts`), icons.dtsLiteral)

// Generate jsx and mjsx with types for icons and logos
fse.writeFileSync(path.join(npmJsxFolder, npmPath, `${bundleName}.js`), icons.cjsx)
Expand Down Expand Up @@ -170,7 +170,7 @@ function buildIcons (groupName) {
// Generate js and mjs with types for icons and logos
fse.writeFileSync(path.join(npmLargePath, `${largeBundleName}.js`), largeIcons.cjs)
fse.writeFileSync(path.join(npmLargePath, `${largeBundleName}.mjs`), largeIcons.esm)
fse.writeFileSync(path.join(npmLargePath, `${largeBundleName}.d.ts`), largeIcons.dts)
fse.writeFileSync(path.join(npmLargePath, `${largeBundleName}.d.ts`), largeIcons.dtsLiteral)

// Generate jsx and mjsx with types for icons and logos
fse.writeFileSync(path.join(npmJsxFolder, npmLargePath, `${largeBundleName}.js`), largeIcons.cjsx)
Expand Down
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.15.4",
"@nrk/svg-to-js": "3.0.1",
"@nrk/svg-to-js": "3.1.0",
"@types/fs-extra": "11.0.4",
"archiver": "6.0.1",
"chokidar-cli": "3.0.0",
Expand Down

0 comments on commit 4a32acd

Please sign in to comment.