Skip to content

Commit

Permalink
update: Updated svgr cli to v8 (#2930)
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh authored Jun 5, 2024
1 parent 2cd6b1a commit 677170a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 168 deletions.
5 changes: 4 additions & 1 deletion @navikt/aksel-icons/config/index-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ const path = require("path");

const defaultIndexTemplate = (paths) => {
const exportEntries = paths.map((filePath) => {
const basename = path.basename(filePath, path.extname(filePath));
const basename = path.basename(
filePath.originalPath,
path.extname(filePath.originalPath),
);
return `export { default as ${basename}Icon } from './${basename}'`;
});

Expand Down
5 changes: 3 additions & 2 deletions @navikt/aksel-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"!**/*.tsbuildinfo"
],
"scripts": {
"create-icons": "svgr --no-prettier --silent --index-template config/index-template.js --out-dir src icons && prettier --write ./src",
"create-icons": "svgr --no-prettier --silent --index-template config/index-template.js --out-dir src icons && yarn prettier --write ./src",
"parse-svg": "node -e 'require(\"./config/parse-svg.js\").main()'",
"copy": "copyfiles util/* src",
"update-metadata": "node config/metadata.js",
Expand All @@ -68,7 +68,7 @@
"test:watch": "vitest watch"
},
"devDependencies": {
"@svgr/cli": "6.5.1",
"@svgr/cli": "8.1.0",
"adm-zip": "^0.5.10",
"concurrently": "7.2.1",
"copyfiles": "^2.4.1",
Expand All @@ -79,6 +79,7 @@
"js-yaml": "^4.1.0",
"lodash.camelcase": "4.3.0",
"lodash.startcase": "4.4.0",
"prettier": "3.1.1",
"react": "^18.0.0",
"rehype-parse": "8.0.4",
"tsc-alias": "1.8.8",
Expand Down
Loading

0 comments on commit 677170a

Please sign in to comment.