diff --git a/bin/build.js b/bin/build.js index 3b44984a..959eea4a 100644 --- a/bin/build.js +++ b/bin/build.js @@ -123,16 +123,10 @@ function buildIcons (groupName) { createZipArchive(staticDest, '**/*.pdf', staticFolder, `${bundleName}-pdf`) // svgToJs - const customOutputs = [ - { - parser: ({ camelCase, svg }) => `export declare const ${camelCase}: '${svg}'`, - }, - ] const icons = svgToJS({ input: staticDest, banner: `@nrk/core-icons ${groupName} v${version}`, - scale: 16, - customOutputs + scale: 16 }) // Generate iife fse.writeFileSync( @@ -145,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.custom_1) + 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) @@ -160,8 +154,7 @@ function buildIcons (groupName) { const largeIcons = svgToJS({ input: staticLargeDest, banner: `@nrk/core-icons ${groupName} v${version}`, - scale: 16, - customOutputs + scale: 16 }) const npmLargePath = path.join(npmPath, 'large') const largeBundleName = `${bundleName}-large` @@ -177,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.custom_1) + 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) diff --git a/package-lock.json b/package-lock.json index a621be64..d88f4966 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "0.15.2", - "@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", @@ -280,10 +280,11 @@ } }, "node_modules/@nrk/svg-to-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@nrk/svg-to-js/-/svg-to-js-3.0.1.tgz", - "integrity": "sha512-HlIBPHpc2BUkNRf67rcx9S8k/gKe0R1o4328MsIeEltiDth1PHwmsM1SBE9v0CKg81GqSQHb0jdWxGjQ8RfSxg==", - "dev": true + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@nrk/svg-to-js/-/svg-to-js-3.1.0.tgz", + "integrity": "sha512-mJCwu9kUkRvtnfzQzHwXdZZ0qJCo5hKeuXZLXjn5uw/q1ZCwNauhtUyo7cFOxNj2ZN7zKlG94xNlvv9Fl8N4+Q==", + "dev": true, + "license": "MIT" }, "node_modules/@sindresorhus/is": { "version": "3.1.2", @@ -6657,9 +6658,9 @@ } }, "@nrk/svg-to-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@nrk/svg-to-js/-/svg-to-js-3.0.1.tgz", - "integrity": "sha512-HlIBPHpc2BUkNRf67rcx9S8k/gKe0R1o4328MsIeEltiDth1PHwmsM1SBE9v0CKg81GqSQHb0jdWxGjQ8RfSxg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@nrk/svg-to-js/-/svg-to-js-3.1.0.tgz", + "integrity": "sha512-mJCwu9kUkRvtnfzQzHwXdZZ0qJCo5hKeuXZLXjn5uw/q1ZCwNauhtUyo7cFOxNj2ZN7zKlG94xNlvv9Fl8N4+Q==", "dev": true }, "@sindresorhus/is": { diff --git a/package.json b/package.json index 304d63cf..bc277e0d 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ }, "devDependencies": { "@arethetypeswrong/cli": "0.15.2", - "@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",