chore(src): 🔧 Update TypeScript files in src directory

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Lilith 2026-01-31 17:57:56 -08:00
parent 6a63e1b532
commit 67a7cabbed
5 changed files with 20 additions and 7 deletions

View file

@ -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'

View file

@ -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

View file

@ -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}`,

View file

@ -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<TestDatabaseConfig> {
.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(),

View file

@ -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<ChildProcess | null> {
'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<ChildProcess | null> {
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'],