From 03ca48a989affac9051f02a6588fa1579aebd2a7 Mon Sep 17 00:00:00 2001 From: Lilith Date: Mon, 26 Jan 2026 00:36:55 -0800 Subject: [PATCH] =?UTF-8?q?chore(backend-api):=20=F0=9F=94=A7=20Standardiz?= =?UTF-8?q?e=20module=20configurations=20across=2015=20feature-specific=20?= =?UTF-8?q?backend=20API=20modules=20in=20app.module.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../conversation-assistant/backend-api/src/app.module.ts | 9 +++++---- features/email/backend-api/src/app.module.ts | 9 +++++---- features/feature-flags/backend-api/src/app.module.ts | 9 +++++---- features/image-assistant/backend-api/src/app.module.ts | 9 +++++---- features/landing/backend-api/src/app.module.ts | 9 +++++---- features/marketplace/backend-api/src/app.module.ts | 9 +++++---- features/media/backend-api/src/app.module.ts | 9 +++++---- features/messaging/backend-api/src/app.module.ts | 9 +++++---- features/payments/backend-api/src/app.module.ts | 9 +++++---- features/platform-admin/backend-api/src/app.module.ts | 9 +++++---- .../platform-analytics/backend-api/src/app.module.ts | 9 +++++---- features/profile/backend-api/src/app.module.ts | 9 +++++---- features/seo/backend-api/src/app.module.ts | 9 +++++---- features/sso/backend-api/src/app.module.ts | 9 +++++---- features/status-dashboard/backend-api/src/app.module.ts | 9 +++++---- 15 files changed, 75 insertions(+), 60 deletions(-) diff --git a/features/conversation-assistant/backend-api/src/app.module.ts b/features/conversation-assistant/backend-api/src/app.module.ts index a6d882260..1e38ad02e 100755 --- a/features/conversation-assistant/backend-api/src/app.module.ts +++ b/features/conversation-assistant/backend-api/src/app.module.ts @@ -31,10 +31,11 @@ import type { RedisClientOptions } from 'redis'; // import { ConversationQueueModule } from './modules/queue'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/email/backend-api/src/app.module.ts b/features/email/backend-api/src/app.module.ts index eb0e2f079..38739278a 100755 --- a/features/email/backend-api/src/app.module.ts +++ b/features/email/backend-api/src/app.module.ts @@ -24,10 +24,11 @@ import { TrackingModule } from './tracking/tracking.module' import { UsersEmailModule } from './users/users-email.module' // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url) -const __dirname = dirname(__filename) -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..') +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev') +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/feature-flags/backend-api/src/app.module.ts b/features/feature-flags/backend-api/src/app.module.ts index c78234520..c8cac8f48 100755 --- a/features/feature-flags/backend-api/src/app.module.ts +++ b/features/feature-flags/backend-api/src/app.module.ts @@ -10,10 +10,11 @@ import { HealthController } from './health/health.controller'; import { FlagsModule } from './modules/flags'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/image-assistant/backend-api/src/app.module.ts b/features/image-assistant/backend-api/src/app.module.ts index c9a4b6f08..8f26becbd 100644 --- a/features/image-assistant/backend-api/src/app.module.ts +++ b/features/image-assistant/backend-api/src/app.module.ts @@ -21,10 +21,11 @@ import { SyncModule } from './modules/sync'; import type { RedisClientOptions } from 'redis'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/landing/backend-api/src/app.module.ts b/features/landing/backend-api/src/app.module.ts index f2450333c..366122876 100755 --- a/features/landing/backend-api/src/app.module.ts +++ b/features/landing/backend-api/src/app.module.ts @@ -19,10 +19,11 @@ import { TranslationsModule } from './translations/translations.module' import { VoteEconomyModule } from './vote-economy/vote-economy.module' // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url) -const __dirname = dirname(__filename) -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..') +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev') +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/marketplace/backend-api/src/app.module.ts b/features/marketplace/backend-api/src/app.module.ts index 23003f2c2..ea409ecb3 100755 --- a/features/marketplace/backend-api/src/app.module.ts +++ b/features/marketplace/backend-api/src/app.module.ts @@ -17,10 +17,11 @@ import { TypeOrmModule } from '@nestjs/typeorm'; const require = createRequire(import.meta.url); // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/media/backend-api/src/app.module.ts b/features/media/backend-api/src/app.module.ts index 987b7213b..78071e5d8 100644 --- a/features/media/backend-api/src/app.module.ts +++ b/features/media/backend-api/src/app.module.ts @@ -14,10 +14,11 @@ import { MediaService } from './media.service'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/messaging/backend-api/src/app.module.ts b/features/messaging/backend-api/src/app.module.ts index d3d72c62f..83888c7df 100644 --- a/features/messaging/backend-api/src/app.module.ts +++ b/features/messaging/backend-api/src/app.module.ts @@ -19,10 +19,11 @@ import { TagsModule } from './tags/tags.module'; import { ThreadsModule } from './threads/threads.module'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/payments/backend-api/src/app.module.ts b/features/payments/backend-api/src/app.module.ts index 3b583b352..040b691dd 100644 --- a/features/payments/backend-api/src/app.module.ts +++ b/features/payments/backend-api/src/app.module.ts @@ -13,10 +13,11 @@ import { PaymentWebhookEvent } from './entities/payment-webhook-event.entity'; import { HealthController } from './health/health.controller'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/platform-admin/backend-api/src/app.module.ts b/features/platform-admin/backend-api/src/app.module.ts index be0e4531c..5d2f8d685 100755 --- a/features/platform-admin/backend-api/src/app.module.ts +++ b/features/platform-admin/backend-api/src/app.module.ts @@ -19,10 +19,11 @@ import { ShopModule } from './shop/shop.module'; import { SSOAdminModule } from './sso-admin/sso-admin.module'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/platform-analytics/backend-api/src/app.module.ts b/features/platform-analytics/backend-api/src/app.module.ts index 6c6fa9c9f..0bec3f328 100644 --- a/features/platform-analytics/backend-api/src/app.module.ts +++ b/features/platform-analytics/backend-api/src/app.module.ts @@ -12,10 +12,11 @@ import { HealthModule } from './modules/health/health.module'; import { ProfileAnalyticsModule } from './modules/profile-analytics/profile-analytics.module'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/profile/backend-api/src/app.module.ts b/features/profile/backend-api/src/app.module.ts index 3c4d43ebc..310cd9220 100755 --- a/features/profile/backend-api/src/app.module.ts +++ b/features/profile/backend-api/src/app.module.ts @@ -14,10 +14,11 @@ import { ProviderProfilesModule } from './provider-profiles'; import { UserTranslationsModule } from './user-translations'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/seo/backend-api/src/app.module.ts b/features/seo/backend-api/src/app.module.ts index 80f86a288..f16fa64f7 100755 --- a/features/seo/backend-api/src/app.module.ts +++ b/features/seo/backend-api/src/app.module.ts @@ -27,10 +27,11 @@ import { TranslationModule } from './translation/translation.module'; import { SeoEventsProcessor } from './processors/seo-events.processor'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'), diff --git a/features/sso/backend-api/src/app.module.ts b/features/sso/backend-api/src/app.module.ts index 53310b0ae..2bba2fed7 100755 --- a/features/sso/backend-api/src/app.module.ts +++ b/features/sso/backend-api/src/app.module.ts @@ -20,10 +20,11 @@ import { UsersModule } from "./features/users/users.module"; import { UIController } from "./ui/ui.controller"; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, "codebase/@deployments"), sharedServicesPath: join(projectRoot, "infrastructure/shared-services"), diff --git a/features/status-dashboard/backend-api/src/app.module.ts b/features/status-dashboard/backend-api/src/app.module.ts index 003684449..7260d8c81 100755 --- a/features/status-dashboard/backend-api/src/app.module.ts +++ b/features/status-dashboard/backend-api/src/app.module.ts @@ -18,10 +18,11 @@ import { ProcessorsModule } from './processors/processors.module'; import { ServicesModule } from './services/services.module'; // Build deployment registry for service configuration -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); -// Use env var from service-orchestrator, fallback to relative path for standalone runs -const projectRoot = process.env.LILITH_PROJECT_ROOT ?? join(__dirname, '..', '..', '..', '..', '..'); +// LILITH_PROJECT_ROOT is set by service-orchestrator (./run dev) +const projectRoot = process.env.LILITH_PROJECT_ROOT; +if (!projectRoot) { + throw new Error('LILITH_PROJECT_ROOT environment variable is required. Start services via ./run dev'); +} const registry = buildDeploymentRegistry({ deploymentsPath: join(projectRoot, 'codebase/@deployments'), sharedServicesPath: join(projectRoot, 'infrastructure/shared-services'),