From d78f01267dec9fda42fb03b884770b82cd4b8b93 Mon Sep 17 00:00:00 2001 From: Dmitry Gusev Date: Tue, 21 Jan 2025 20:11:41 +0300 Subject: [PATCH 1/2] Use separate Babel configuration for Jest --- babel.config.json | 10 ---------- babel.config.testing.json | 20 ++++++++++++++++++++ jest.config.js | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 babel.config.testing.json diff --git a/babel.config.json b/babel.config.json index 4618bb8037..99de050931 100644 --- a/babel.config.json +++ b/babel.config.json @@ -1,14 +1,4 @@ { - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "node": "current" - } - } - ] - ], "plugins": [ [ "babel-plugin-styled-components", diff --git a/babel.config.testing.json b/babel.config.testing.json new file mode 100644 index 0000000000..4618bb8037 --- /dev/null +++ b/babel.config.testing.json @@ -0,0 +1,20 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ] + ], + "plugins": [ + [ + "babel-plugin-styled-components", + { + "displayName": true + } + ] + ] +} diff --git a/jest.config.js b/jest.config.js index 8fc94b813e..9f4f8b8816 100644 --- a/jest.config.js +++ b/jest.config.js @@ -34,7 +34,7 @@ const config = { "\\.jsx?$": [ "babel-jest", { - configFile: "./babel.config.json", + configFile: "./babel.config.testing.json", }, ], }, From 4d99b82dfd8a4d18a479ae71f0a62b3d38ecb469 Mon Sep 17 00:00:00 2001 From: Dmitry Gusev Date: Tue, 21 Jan 2025 22:12:14 +0300 Subject: [PATCH 2/2] Fix type re-export for library build --- ui/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/index.ts b/ui/index.ts index a978d519bd..83a98c82b7 100644 --- a/ui/index.ts +++ b/ui/index.ts @@ -1,5 +1,5 @@ import { AlertListErrors } from "./components/AlertListErrors"; -import { ReconciledObjectsAutomation } from "./components/AutomationDetail"; +import type { ReconciledObjectsAutomation } from "./components/AutomationDetail"; import AutomationsTable from "./components/AutomationsTable"; import BucketDetail from "./components/BucketDetail"; import Button from "./components/Button"; @@ -33,8 +33,8 @@ import ImageAutomationRepoDetails from "./components/ImageAutomation/repositorie import ImageRepositoriesTable from "./components/ImageAutomation/repositories/ImageRepositoriesTable"; import ImageAutomationUpdatesDetails from "./components/ImageAutomation/updates/ImageAutomationUpdatesDetails"; import ImageAutomationUpdatesTable from "./components/ImageAutomation/updates/ImageAutomationUpdatesTable"; -import InfoList, { InfoField } from "./components/InfoList"; -import Input, { InputProps } from "./components/Input"; +import InfoList, { type InfoField } from "./components/InfoList"; +import Input, { type InputProps } from "./components/Input"; import Interval from "./components/Interval"; import KubeStatusIndicator, { computeReady, @@ -48,7 +48,7 @@ import Logo from "./components/Logo"; import MessageBox from "./components/MessageBox"; import Metadata from "./components/Metadata"; import Modal from "./components/Modal"; -import Nav, { NavItem } from "./components/Nav"; +import Nav, { type NavItem } from "./components/Nav"; import ImageAutomationIcon from "./components/NavIcons/ImageAutomationIcon"; import SourcesIcon from "./components/NavIcons/SourcesIcon"; import NotificationsTable from "./components/NotificationsTable"; @@ -112,7 +112,7 @@ import { PARENT_CHILD_LOOKUP } from "./lib/graph"; import { formatURL, getParentNavRouteValue } from "./lib/nav"; import { Alert, - Automation, + type Automation, Bucket, FluxObject, GitRepository,