From 6703682a4a0a5564dfa4b58adc7602b0b0a2e9f3 Mon Sep 17 00:00:00 2001 From: muraterennar Date: Tue, 24 Dec 2024 19:17:16 +0300 Subject: [PATCH] muraterennar/branch-mate#8|add-versioning-to-project --- angular.json | 19 +++++++++++++++++-- package.json | 4 +++- src/app/app.component.html | 18 +++++++++++------- src/app/app.component.ts | 2 ++ src/environments/environment.development.ts | 4 ++++ src/environments/environment.production.ts | 4 ++++ src/environments/environment.ts | 4 ++++ src/index.html | 2 +- 8 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 src/environments/environment.development.ts create mode 100644 src/environments/environment.production.ts create mode 100644 src/environments/environment.ts diff --git a/angular.json b/angular.json index 489bca7..00d56c6 100644 --- a/angular.json +++ b/angular.json @@ -51,12 +51,27 @@ "maximumError": "5MB" } ], - "outputHashing": "all" + "outputHashing": "all", + "sourceMap": false, + "optimization": true, + "extractLicenses": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.production.ts" + } + ] }, "development": { "optimization": false, "extractLicenses": false, - "sourceMap": true + "sourceMap": true, + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.development.ts" + } + ] } }, "defaultConfiguration": "production" diff --git a/package.json b/package.json index e9da126..ba3f778 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --configuration development", + "start:production": "ng serve --configuration production", + "start:development" : "ng serve --configuration development", "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test" diff --git a/src/app/app.component.html b/src/app/app.component.html index fa85576..7b98051 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,4 +1,14 @@ -
+
+ +
+ v{{version}} + +
+

Branch

@@ -7,12 +17,6 @@

- -
Username:
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ef577db..38d5e05 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,6 +7,7 @@ import {CommonModule} from '@angular/common'; import {CustomButtonTypes} from './core/components/custom-button/custom-button-types'; import {Icons} from './core/constants/icons'; import {BranchData} from './core/models/branch-data'; +import {environment} from '../environments/environment'; @Component({ selector: 'app-root', @@ -26,6 +27,7 @@ export class AppComponent implements OnInit { branchNameValue: string = ''; commitMessageValue: string = ''; prTitle: string = ''; + version: string = environment?.version; constructor(private themeService: ThemeService, private formBuilder: FormBuilder) { this.createForm(); diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts new file mode 100644 index 0000000..3005e6e --- /dev/null +++ b/src/environments/environment.development.ts @@ -0,0 +1,4 @@ +export const environment = { + production: false, + version: '1.0.0', +}; diff --git a/src/environments/environment.production.ts b/src/environments/environment.production.ts new file mode 100644 index 0000000..cc93d0d --- /dev/null +++ b/src/environments/environment.production.ts @@ -0,0 +1,4 @@ +export const environment = { + production: true, + version: '1.0.0', +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..3005e6e --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,4 @@ +export const environment = { + production: false, + version: '1.0.0', +}; diff --git a/src/index.html b/src/index.html index e007f4c..a361fed 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,7 @@ - +