From: Jérôme Benoit Date: Thu, 19 Mar 2026 15:27:49 +0000 (+0100) Subject: refactor(webui): harmonize barrel usage in types and composables X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=97dde41f2772bf4d8abacec46786205683b42adc;p=e-mobility-charging-stations-simulator.git refactor(webui): harmonize barrel usage in types and composables Add OCPP16AvailabilityType, OCPP16ChargePointStatus, and OCPP16RegistrationStatus to the types barrel. Redirect all direct module imports in tests to use barrels (types/, composables/). --- diff --git a/ui/web/src/types/index.ts b/ui/web/src/types/index.ts index 2eb33c90..e2008a06 100644 --- a/ui/web/src/types/index.ts +++ b/ui/web/src/types/index.ts @@ -11,6 +11,9 @@ export type { Status, } from './ChargingStationType' export { + OCPP16AvailabilityType, + OCPP16ChargePointStatus, + OCPP16RegistrationStatus, OCPP20IdTokenEnumType, OCPP20TransactionEventEnumType, OCPPVersion, diff --git a/ui/web/tests/unit/CSConnector.test.ts b/ui/web/tests/unit/CSConnector.test.ts index 84ecb528..3b204a59 100644 --- a/ui/web/tests/unit/CSConnector.test.ts +++ b/ui/web/tests/unit/CSConnector.test.ts @@ -5,11 +5,11 @@ import { flushPromises, mount } from '@vue/test-utils' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { UIClient } from '@/composables/UIClient' +import type { UIClient } from '@/composables' import CSConnector from '@/components/charging-stations/CSConnector.vue' import { useUIClient } from '@/composables' -import { OCPP16ChargePointStatus } from '@/types/ChargingStationType' +import { OCPP16ChargePointStatus } from '@/types' import { toastMock } from '../setup' import { createConnectorStatus, TEST_HASH_ID, TEST_STATION_ID } from './constants' diff --git a/ui/web/tests/unit/CSData.test.ts b/ui/web/tests/unit/CSData.test.ts index 2d3f4643..b5bbbe1d 100644 --- a/ui/web/tests/unit/CSData.test.ts +++ b/ui/web/tests/unit/CSData.test.ts @@ -5,7 +5,7 @@ import { flushPromises, mount } from '@vue/test-utils' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { UIClient } from '@/composables/UIClient' +import type { UIClient } from '@/composables' import type { ChargingStationData } from '@/types' import CSConnector from '@/components/charging-stations/CSConnector.vue' diff --git a/ui/web/tests/unit/ChargingStationsView.test.ts b/ui/web/tests/unit/ChargingStationsView.test.ts index b57c32fc..9a682d1b 100644 --- a/ui/web/tests/unit/ChargingStationsView.test.ts +++ b/ui/web/tests/unit/ChargingStationsView.test.ts @@ -7,7 +7,7 @@ import { flushPromises, mount } from '@vue/test-utils' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { ref } from 'vue' -import type { UIClient } from '@/composables/UIClient' +import type { UIClient } from '@/composables' import { useUIClient } from '@/composables' import { ResponseStatus } from '@/types' diff --git a/ui/web/tests/unit/StartTransaction.test.ts b/ui/web/tests/unit/StartTransaction.test.ts index 26c4aaf1..4f00c97b 100644 --- a/ui/web/tests/unit/StartTransaction.test.ts +++ b/ui/web/tests/unit/StartTransaction.test.ts @@ -5,7 +5,7 @@ import { flushPromises, mount } from '@vue/test-utils' import { describe, expect, it, vi } from 'vitest' -import type { UIClient } from '@/composables/UIClient' +import type { UIClient } from '@/composables' import StartTransaction from '@/components/actions/StartTransaction.vue' import { useUIClient } from '@/composables' diff --git a/ui/web/tests/unit/constants.ts b/ui/web/tests/unit/constants.ts index 62863338..3a57a109 100644 --- a/ui/web/tests/unit/constants.ts +++ b/ui/web/tests/unit/constants.ts @@ -8,16 +8,14 @@ import { type ChargingStationInfo, type ConnectorStatus, type EvseEntry, + OCPP16AvailabilityType, + OCPP16ChargePointStatus, + OCPP16RegistrationStatus, OCPPVersion, Protocol, ProtocolVersion, type UIServerConfigurationSection, } from '@/types' -import { - OCPP16AvailabilityType, - OCPP16ChargePointStatus, - OCPP16RegistrationStatus, -} from '@/types/ChargingStationType' // ── Shared Test Constants ─────────────────────────────────────────────────────