]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor: migrate external deep imports to ui-server and broadcast-channel barrels...
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 5 Jul 2026 18:41:58 +0000 (20:41 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2026 18:41:58 +0000 (20:41 +0200)
Migrate the 2 external cross-sub-component deep imports enabled by the barrels introduced in #1952 to route through the barrel index files per the flat parent barrel convention.

Sites migrated (2):
- Bootstrap.ts:61 UIServerFactory — deep → ui-server/index.js
- ChargingStation.ts:114 ChargingStationWorkerBroadcastChannel —
  deep → broadcast-channel/index.js

Sites deliberately NOT migrated (documented in PR body):
- Bootstrap.ts:13 AbstractUIServer (type) — not re-exported; internal
  extension point per the ui-server barrel's `@file` omission list.
- ConfigurationSchema.ts:7 UIServerNet.isHostLiteralWithoutPort —
  UIServerNet not re-exported; internal helper per the omission list.
- AbstractUIService.ts:33 UIServiceWorkerBroadcastChannel (value) —
  adjacent sub-component crossing. Migrating triggers a circular-load
  ReferenceError at test time because the broadcast-channel barrel
  re-exports both concrete channels, transitively pulling
  ChargingStationWorkerBroadcastChannel's charging-station chain back
  through ui-server before class declarations complete.
- UIServiceWorkerBroadcastChannel.ts:1 AbstractUIService (type-only) —
  adjacent sub-component crossing; kept direct for symmetry.

Convention codified: barrels are for CROSS-COMPONENT external
consumers, not for adjacent-sub-component crossings within the same
parent module. Matches the meter-values/index.ts convention.

Quality gates: typecheck clean, lint clean, 2955/2961 tests pass, 0 fail.

Diff: +2/-2 across 2 files.

Follow-up to #1952 (barrel gaps closure). PR-D' from the sequence
tracked in #1950's scope fence.

src/charging-station/Bootstrap.ts
src/charging-station/ChargingStation.ts

index ea25f0e17e63fa61b9f4c47eb8c8e2a8e68fca85..c8828b389eb931bb6479d48cdbe2e18f3b133519 100644 (file)
@@ -58,7 +58,7 @@ import {
 } from '../worker/index.js'
 import { readStateFile, reconstructTemplateIndexes, writeStateFile } from './BootstrapStateUtils.js'
 import { buildTemplateName, waitChargingStationEvents } from './Helpers.js'
-import { UIServerFactory } from './ui-server/UIServerFactory.js'
+import { UIServerFactory } from './ui-server/index.js'
 
 const moduleName = 'Bootstrap'
 
index b974aed47b0d862dd8526a938cb1abae4b80f852..fe4fdcfe94ae11895627c9921a4ff469dfed77c6 100644 (file)
@@ -111,7 +111,7 @@ import {
   watchJsonFile,
 } from '../utils/index.js'
 import { AutomaticTransactionGenerator } from './AutomaticTransactionGenerator.js'
-import { ChargingStationWorkerBroadcastChannel } from './broadcast-channel/ChargingStationWorkerBroadcastChannel.js'
+import { ChargingStationWorkerBroadcastChannel } from './broadcast-channel/index.js'
 import { CoherentMeterValuesManager } from './CoherentMeterValuesManager.js'
 import {
   addConfigurationKey,