chore(backend-api): 🔧 Standardize module configurations across 15 feature-specific backend API modules in app.module.ts

This commit is contained in:
Lilith 2026-01-26 00:36:55 -08:00
parent 1a0144f78b
commit 03ca48a989
15 changed files with 75 additions and 60 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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"),

View file

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