diff --git a/features/analytics/backend-api/scripts/verify-circular-deps.mjs b/features/analytics/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/analytics/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/attributes/backend-api/scripts/verify-circular-deps.mjs b/features/attributes/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/attributes/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/content-moderation/backend-api/scripts/verify-circular-deps.mjs b/features/content-moderation/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/content-moderation/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/conversation-assistant/backend-api/scripts/verify-circular-deps.mjs b/features/conversation-assistant/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/conversation-assistant/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/email/backend-api/scripts/verify-circular-deps.mjs b/features/email/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/email/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/feature-flags/backend-api/scripts/verify-circular-deps.mjs b/features/feature-flags/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/feature-flags/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/image-assistant/backend-api/scripts/verify-circular-deps.mjs b/features/image-assistant/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/image-assistant/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/image-generator/backend-api/scripts/verify-circular-deps.mjs b/features/image-generator/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/image-generator/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/marketplace/backend-api/scripts/verify-circular-deps.mjs b/features/marketplace/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/marketplace/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/media/backend-api/scripts/verify-circular-deps.mjs b/features/media/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/media/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/merchant/backend-api/scripts/verify-circular-deps.mjs b/features/merchant/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/merchant/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/messaging/backend-api/scripts/verify-circular-deps.mjs b/features/messaging/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/messaging/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/payments/backend-api/scripts/verify-circular-deps.mjs b/features/payments/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/payments/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/platform-admin/backend-api/scripts/verify-circular-deps.mjs b/features/platform-admin/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/platform-admin/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/profile/backend-api/scripts/verify-circular-deps.mjs b/features/profile/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/profile/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/seo/backend-api/scripts/verify-circular-deps.mjs b/features/seo/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/seo/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/sso/backend-api/scripts/verify-circular-deps.mjs b/features/sso/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/sso/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/status-dashboard/backend-api/scripts/verify-circular-deps.mjs b/features/status-dashboard/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/status-dashboard/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/ui-dev-tools/backend-api/scripts/verify-circular-deps.mjs b/features/ui-dev-tools/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/ui-dev-tools/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +} diff --git a/features/webmap/backend-api/scripts/verify-circular-deps.mjs b/features/webmap/backend-api/scripts/verify-circular-deps.mjs new file mode 100755 index 000000000..dab3845d8 --- /dev/null +++ b/features/webmap/backend-api/scripts/verify-circular-deps.mjs @@ -0,0 +1,40 @@ +#!/usr/bin/env node +/** + * Verify Circular Dependencies + * + * Safely checks for circular dependency issues by importing the AppModule + * without bootstrapping the application (no server start, no DB connections). + * + * Usage: node scripts/verify-circular-deps.mjs + */ + +import { fileURLToPath } from 'node:url'; +import { dirname, join } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const distPath = join(__dirname, '..', 'dist'); + +// Prevent application from actually starting +process.env.NODE_ENV = 'test'; +process.env.SKIP_BOOTSTRAP = 'true'; + +console.log('šŸ” Checking for circular dependencies...\n'); + +try { + // Import AppModule - this triggers all decorators without starting the app + const appModulePath = join(distPath, 'app.module.js'); + await import(appModulePath); + + console.log('āœ… No circular dependency issues detected'); + console.log(' All modules and entities loaded successfully\n'); + process.exit(0); +} catch (error) { + console.error('āŒ Circular dependency detected!\n'); + console.error('Error:', error.message); + console.error('\nStack trace:'); + console.error(error.stack); + console.error('\nšŸ’” Hint: Look for entities with bidirectional relations.'); + console.error(' Use string references in decorators: @ManyToOne(\'EntityName\', ...)\n'); + process.exit(1); +}