From 67c763016d16a26fdfffd765ce914abe4341465d Mon Sep 17 00:00:00 2001 From: "T. Narantuya" Date: Sat, 30 Aug 2025 17:11:10 +0900 Subject: [PATCH] Update TypeScript configurations and build process for BFF module - Set entry file in nest-cli.json and disabled output directory deletion. - Updated tsconfig.build.json to extend from tsconfig.base.json and refined compiler options. - Modified tsconfig.json to extend from tsconfig.base.json and removed unnecessary overrides. - Adjusted manage.sh script to build BFF using TypeScript compiler directly. --- apps/bff/nest-cli.json | 6 ++++-- apps/bff/tsconfig.base.json | 24 ++++++++++++++++++++++++ apps/bff/tsconfig.build.json | 15 +++++++-------- apps/bff/tsconfig.json | 20 +++----------------- scripts/dev/manage.sh | 3 ++- 5 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 apps/bff/tsconfig.base.json diff --git a/apps/bff/nest-cli.json b/apps/bff/nest-cli.json index 1a89e095..980a6b52 100644 --- a/apps/bff/nest-cli.json +++ b/apps/bff/nest-cli.json @@ -2,10 +2,12 @@ "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", "sourceRoot": "src", + "entryFile": "main", "compilerOptions": { - "deleteOutDir": true, + "deleteOutDir": false, "watchAssets": true, "assets": ["**/*.prisma"], - "tsConfigPath": "tsconfig.build.json" + "tsConfigPath": "./tsconfig.build.json", + "builder": "tsc" } } diff --git a/apps/bff/tsconfig.base.json b/apps/bff/tsconfig.base.json new file mode 100644 index 00000000..fa694872 --- /dev/null +++ b/apps/bff/tsconfig.base.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES2024", + "lib": ["ES2024"], + "module": "CommonJS", + "moduleResolution": "node", + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictBindCallApply": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": false, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "skipLibCheck": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "strictPropertyInitialization": false + } +} diff --git a/apps/bff/tsconfig.build.json b/apps/bff/tsconfig.build.json index 08dca41f..caf99450 100644 --- a/apps/bff/tsconfig.build.json +++ b/apps/bff/tsconfig.build.json @@ -1,19 +1,18 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "noEmit": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, "incremental": true, "tsBuildInfoFile": "./tsconfig.build.tsbuildinfo", "outDir": "./dist", "sourceMap": true, "declaration": false, - "module": "CommonJS", - "target": "ES2024" + "removeComments": true, + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "test", "**/*.spec.ts"] -} - - +} \ No newline at end of file diff --git a/apps/bff/tsconfig.json b/apps/bff/tsconfig.json index a48a1223..abce7242 100644 --- a/apps/bff/tsconfig.json +++ b/apps/bff/tsconfig.json @@ -1,27 +1,13 @@ { - "extends": "../../tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { - // NestJS overrides - "module": "CommonJS", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - - // Build settings "outDir": "./dist", "baseUrl": "./", "removeComments": true, - "target": "ES2024", - - // Path mappings "paths": { "@/*": ["src/*"] - }, - - // NestJS-specific adjustments - "strictPropertyInitialization": false, // DTOs use decorators, not initializers - "noImplicitOverride": false + } }, "include": ["src/**/*", "test/**/*"], "exclude": ["node_modules", "dist"] -} +} \ No newline at end of file diff --git a/scripts/dev/manage.sh b/scripts/dev/manage.sh index b12843a2..3cfaa21f 100755 --- a/scripts/dev/manage.sh +++ b/scripts/dev/manage.sh @@ -108,7 +108,8 @@ start_apps() { # Build BFF first to ensure dist directory exists for watch mode log "🔨 Building BFF for initial setup..." - pnpm --filter @customer-portal/bff build + cd "$PROJECT_ROOT/apps/bff" && pnpm tsc -p tsconfig.build.json + cd "$PROJECT_ROOT" # Show startup information log "🎯 Starting development applications..."