From 3a987adcc348808ed140616ce8f2ec48a595c5c9 Mon Sep 17 00:00:00 2001 From: abhijeetw035 Date: Wed, 2 Apr 2025 02:00:56 +0530 Subject: [PATCH 1/3] fix: update Common-UI submodule reference and ensure CI build stability --- Common-UI | 2 +- package.json | 2 +- scripts/ci-prebuild.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Common-UI b/Common-UI index d12389e2..840fd979 160000 --- a/Common-UI +++ b/Common-UI @@ -1 +1 @@ -Subproject commit d12389e2e433de99af585fef88d452ea137625e3 +Subproject commit 840fd9792f07ca75723ad6b2a2e9f4d35969d416 diff --git a/package.json b/package.json index bde9f61a..995c7cb2 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "prepare": "husky install", "build-dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=development --aot", "build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot", - "build-ci": "chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", + "build-ci": "chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", "build-test": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=test --aot" }, "lint-staged": { diff --git a/scripts/ci-prebuild.js b/scripts/ci-prebuild.js index 2a185f17..93c910ba 100644 --- a/scripts/ci-prebuild.js +++ b/scripts/ci-prebuild.js @@ -39,7 +39,9 @@ const environmentTemplate = fs.readFileSync( const defaultEnvValues = { COMMON_API_BASE: '', - ADMIN_API_BASE: '' + ADMIN_API_BASE: '', + FHIR_API_BASE: '', + SESSION_STORAGE_ENC_KEY: '' }; // Generate output data From 69c81d34c9321e08b785b6727a7b8d84ced64353 Mon Sep 17 00:00:00 2001 From: abhijeetw035 Date: Wed, 2 Apr 2025 09:39:46 +0530 Subject: [PATCH 2/3] fix(scripts): Ensure environment.ts is created before running build steps --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 995c7cb2..eb7284dd 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "lint": "ng lint", "prepare": "husky install", "build-dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=development --aot", - "build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot", - "build-ci": "chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", - "build-test": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=test --aot" + "build-prod": "touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot", + "build-ci": "touch src/environments/environment.ts && chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", + "build-test": "touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=test --aot" }, "lint-staged": { "src/**/*.{ts,html}": [ From 516e3fdce05b0d9a1fcb7ab47491c241afa29760 Mon Sep 17 00:00:00 2001 From: abhijeetw035 Date: Wed, 2 Apr 2025 10:55:30 +0530 Subject: [PATCH 3/3] Update Angular build configs(file replacements) and ensure env file exists in scripts --- angular.json | 17 ++++++++++++++--- package.json | 8 ++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/angular.json b/angular.json index 49b02536..53f378fa 100644 --- a/angular.json +++ b/angular.json @@ -52,8 +52,13 @@ } ], "outputHashing": "all", - "optimization": true - + "optimization": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] }, "development": { "buildOptimizer": false, @@ -61,7 +66,13 @@ "vendorChunk": true, "extractLicenses": false, "sourceMap": true, - "namedChunks": true + "namedChunks": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] }, "ci": { "budgets": [ diff --git a/package.json b/package.json index eb7284dd..2bb8c1ab 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "test": "ng test", "lint": "ng lint", "prepare": "husky install", - "build-dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=development --aot", - "build-prod": "touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot", - "build-ci": "touch src/environments/environment.ts && chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", - "build-test": "touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=test --aot" + "build-dev": "(test -f src/environments/environment.ts || touch src/environments/environment.ts) && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=development --aot", + "build-prod": "(test -f src/environments/environment.ts || touch src/environments/environment.ts) && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot", + "build-ci": "(test -f src/environments/environment.ts || touch src/environments/environment.ts) && chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot", + "build-test": "(test -f src/environments/environment.ts || touch src/environments/environment.ts) && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=test --aot" }, "lint-staged": { "src/**/*.{ts,html}": [