From 67a7cabbed4564f306087f09d90664ce406b9b02 Mon Sep 17 00:00:00 2001 From: Lilith Date: Sat, 31 Jan 2026 17:57:56 -0800 Subject: [PATCH] =?UTF-8?q?chore(src):=20=F0=9F=94=A7=20Update=20TypeScrip?= =?UTF-8?q?t=20files=20in=20src=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- @packages/@config/src/index.ts | 4 ++-- @packages/@config/src/ports.generated.ts | 10 ++++++++++ .../landing/frontend-public/e2e/setup/e2e-services.ts | 3 ++- .../backend-api/test/testcontainers-setup.ts | 5 +++-- features/truth-validation/scripts/service-manager.ts | 5 +++-- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/@packages/@config/src/index.ts b/@packages/@config/src/index.ts index a61f64dc3..c8f503cf9 100755 --- a/@packages/@config/src/index.ts +++ b/@packages/@config/src/index.ts @@ -54,11 +54,11 @@ export type PlatformUrls = typeof config.urls export type PlatformAssets = typeof config.assets // Port configuration (generated from infrastructure/ports.yaml) -export { PORTS, getFeaturePort } from './ports.generated.js' +export { PORTS, CONTAINER_PORTS, getFeaturePort } from './ports.generated' export type { PortConfig, InfrastructurePorts, MlPorts, PlatformPorts, FeaturePorts, -} from './ports.generated.js' +} from './ports.generated' diff --git a/@packages/@config/src/ports.generated.ts b/@packages/@config/src/ports.generated.ts index a224c7b2b..18946d9b4 100755 --- a/@packages/@config/src/ports.generated.ts +++ b/@packages/@config/src/ports.generated.ts @@ -133,6 +133,16 @@ export const PORTS = { } } as const +/** + * Standard container-internal ports + * These are the default ports that services listen on INSIDE Docker containers. + * Used as the right side of `-p HOST:CONTAINER` mappings. + */ +export const CONTAINER_PORTS = { + postgresql: 5432, + redis: 6379, +} as const + // Type exports export type PortConfig = typeof PORTS export type InfrastructurePorts = typeof PORTS.infrastructure diff --git a/features/landing/frontend-public/e2e/setup/e2e-services.ts b/features/landing/frontend-public/e2e/setup/e2e-services.ts index 059562c10..3b5e8d688 100644 --- a/features/landing/frontend-public/e2e/setup/e2e-services.ts +++ b/features/landing/frontend-public/e2e/setup/e2e-services.ts @@ -15,6 +15,7 @@ import { execFileSync, spawn, type ChildProcess } from 'child_process' import { existsSync, readFileSync, writeFileSync, unlinkSync, statSync } from 'fs' import { resolve, join } from 'path' +import { CONTAINER_PORTS } from '@lilith/config' // --------------------------------------------------------------------------- // Configuration @@ -107,7 +108,7 @@ function startPostgres(): void { runCmd('docker', [ 'run', '-d', '--name', E2E_POSTGRES_CONTAINER, - '-p', `${E2E_POSTGRES_PORT}:5432`, + '-p', `${E2E_POSTGRES_PORT}:${CONTAINER_PORTS.postgresql}`, '-e', `POSTGRES_USER=${E2E_POSTGRES_USER}`, '-e', `POSTGRES_PASSWORD=${E2E_POSTGRES_PASSWORD}`, '-e', `POSTGRES_DB=${E2E_POSTGRES_DB}`, diff --git a/features/marketplace/backend-api/test/testcontainers-setup.ts b/features/marketplace/backend-api/test/testcontainers-setup.ts index f0094e341..5c0c036fc 100644 --- a/features/marketplace/backend-api/test/testcontainers-setup.ts +++ b/features/marketplace/backend-api/test/testcontainers-setup.ts @@ -16,6 +16,7 @@ * }); */ import { PostgreSqlContainer } from '@testcontainers/postgresql'; +import { CONTAINER_PORTS } from '@lilith/config/ports'; import type { StartedPostgreSqlContainer } from '@testcontainers/postgresql'; @@ -50,7 +51,7 @@ export async function setupTestDatabase(): Promise { .withDatabase('marketplace_test') .withUsername('test_user') .withPassword('test_password') - .withExposedPorts(5432) + .withExposedPorts(CONTAINER_PORTS.postgresql) .start(); const config = getTestDatabaseConfig(); @@ -93,7 +94,7 @@ export function getTestDatabaseConfig(): TestDatabaseConfig { return { host: postgresContainer.getHost(), - port: postgresContainer.getMappedPort(5432), + port: postgresContainer.getMappedPort(CONTAINER_PORTS.postgresql), username: postgresContainer.getUsername(), password: postgresContainer.getPassword(), database: postgresContainer.getDatabase(), diff --git a/features/truth-validation/scripts/service-manager.ts b/features/truth-validation/scripts/service-manager.ts index e79107f59..55cb3a52f 100755 --- a/features/truth-validation/scripts/service-manager.ts +++ b/features/truth-validation/scripts/service-manager.ts @@ -18,6 +18,7 @@ import { spawn, execFileSync, type ChildProcess } from 'child_process'; import { existsSync, readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'fs'; import { join } from 'path'; +import { CONTAINER_PORTS } from '@lilith/config'; import { createConnection } from 'net'; import { getServiceRegistry } from '@lilith/service-registry'; @@ -162,7 +163,7 @@ async function startRedis(): Promise { 'run', '--rm', '-d', '--privileged', '--name', 'truth-redis', - '-p', `${redisPort}:6379`, + '-p', `${redisPort}:${CONTAINER_PORTS.redis}`, 'docker.io/redis/redis-stack-server:latest', ], { stdio: ['ignore', 'pipe', 'pipe'], @@ -174,7 +175,7 @@ async function startRedis(): Promise { proc = spawn('docker', [ 'run', '--rm', '-d', '--name', 'truth-redis', - '-p', `${redisPort}:6379`, + '-p', `${redisPort}:${CONTAINER_PORTS.redis}`, 'redis/redis-stack-server:latest', ], { stdio: ['ignore', 'pipe', 'pipe'],