From 5a725320ccd7254f025af1216cfa067a32613f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B8egh?= Date: Sat, 6 May 2023 14:22:38 +0200 Subject: [PATCH] fix(IconPrimary): correct ts file extension usage (#2289) --- packages/dnb-eufemia/rollup.config.js | 8 ++++---- .../scripts/postbuild/__tests__/postbuild.test.ts | 4 +--- .../prebuild/tasks/__tests__/convertSvgToJsx.test.tsx | 2 +- .../src/components/icon-primary/IconPrimary.js | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/dnb-eufemia/rollup.config.js b/packages/dnb-eufemia/rollup.config.js index 9f845bdc416..6fa4eab0077 100644 --- a/packages/dnb-eufemia/rollup.config.js +++ b/packages/dnb-eufemia/rollup.config.js @@ -15,13 +15,13 @@ import branchName from 'current-git-branch' const excludes = [ { name: 'dnbIcons', - global: [path.resolve('./src/icons/dnb/primary_icons.ts')], - external: '../../icons/dnb/primary_icons.ts', + global: [path.resolve('./src/icons/dnb/primary_icons')], + external: '../../icons/dnb/primary_icons', }, { name: 'dnbIcons', - global: [path.resolve('./src/icons/dnb/primary_icons_medium.ts')], - external: '../../icons/dnb/primary_icons_medium.ts', + global: [path.resolve('./src/icons/dnb/primary_icons_medium')], + external: '../../icons/dnb/primary_icons_medium', }, ] diff --git a/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts b/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts index a75fc015718..4c1efcd7c28 100644 --- a/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts +++ b/packages/dnb-eufemia/scripts/postbuild/__tests__/postbuild.test.ts @@ -278,9 +278,7 @@ describe('rollup build', () => { ) expect(content).toContain(`import*as `) expect(content).toContain(` from"react-dom";`) - expect(content).toContain( - ` from"../icons/dnb/primary_icons.ts";` - ) + expect(content).toContain(` from"../icons/dnb/primary_icons";`) } } break diff --git a/packages/dnb-eufemia/scripts/prebuild/tasks/__tests__/convertSvgToJsx.test.tsx b/packages/dnb-eufemia/scripts/prebuild/tasks/__tests__/convertSvgToJsx.test.tsx index 8bb884b4603..3a397d338f4 100644 --- a/packages/dnb-eufemia/scripts/prebuild/tasks/__tests__/convertSvgToJsx.test.tsx +++ b/packages/dnb-eufemia/scripts/prebuild/tasks/__tests__/convertSvgToJsx.test.tsx @@ -52,7 +52,7 @@ describe('run convertSvgToJsx to convert ES6 to ES5', () => { it('has to have a primary_icons file', async () => { const index = await import( - path.resolve(__dirname, 'test-files/dist/dnb/primary_icons.ts') + path.resolve(__dirname, 'test-files/dist/dnb/primary_icons') ) expect(index).toMatchSnapshot() }) diff --git a/packages/dnb-eufemia/src/components/icon-primary/IconPrimary.js b/packages/dnb-eufemia/src/components/icon-primary/IconPrimary.js index 5447b47424c..cca654ff84d 100644 --- a/packages/dnb-eufemia/src/components/icon-primary/IconPrimary.js +++ b/packages/dnb-eufemia/src/components/icon-primary/IconPrimary.js @@ -16,8 +16,8 @@ import DefaultIcon, { } from '../icon/Icon' // NB: The path reflects the rollup.config.js -> external: '../../icons/dnb/primary_icons' -import * as primary_icons from '../../icons/dnb/primary_icons.ts' -import * as primary_icons_medium from '../../icons/dnb/primary_icons_medium.ts' +import * as primary_icons from '../../icons/dnb/primary_icons' +import * as primary_icons_medium from '../../icons/dnb/primary_icons_medium' const icons = { ...primary_icons, ...primary_icons_medium }