From 5647460b3a12283c32286a71bddae5a34f12b083 Mon Sep 17 00:00:00 2001 From: CFIALeronB <133677161+CFIALeronB@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:11:19 -0500 Subject: [PATCH 1/3] Implementing TS-AppVersion - Installing and configuring TS-AppVersion. - Ensuring seamless extraction of version information. - Verifying compatibility with the TypeScript framework. - Updated Footer version number display. Version number is pulled from TS-AppVersion. #80 --- .prettierignore | 1 + package.json | 2 ++ src/_versions.ts | 30 ++++++++++++------------- src/components/footer/index.tsx | 5 +++-- src/environments/environment.prod.ts | 5 +++++ src/environments/environment.staging.ts | 5 +++++ src/environments/environment.ts | 5 +++++ 7 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 .prettierignore create mode 100644 src/environments/environment.prod.ts create mode 100644 src/environments/environment.staging.ts create mode 100644 src/environments/environment.ts diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ef5adf5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +src/_versions.ts diff --git a/package.json b/package.json index 388e537..6f5b1db 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,8 @@ }, "scripts": { "predeploy": "npm run build", + "prestart": "ts-appversion", + "prebuild": "ts-appversion", "deploy": "gh-pages -d build", "start": "react-scripts start", "build": "react-scripts build", diff --git a/src/_versions.ts b/src/_versions.ts index c1e5775..b248758 100644 --- a/src/_versions.ts +++ b/src/_versions.ts @@ -1,20 +1,18 @@ export interface TsAppVersion { - version: string; - name: string; - description?: string; - versionLong?: string; - versionDate: string; - gitCommitHash?: string; - gitCommitDate?: string; - gitTag?: string; -} - + version: string; + name: string; + description?: string; + versionLong?: string; + versionDate: string; + gitCommitHash?: string; + gitCommitDate?: string; + gitTag?: string; +}; export const versions: TsAppVersion = { - version: "0.2.0", - name: "nachet-frontend", - versionDate: "2023-08-04T06:12:27.197Z", - gitCommitHash: "4c506f3", - versionLong: "0.1.0-4c506f3", + version: '0.1.0', + name: 'nachet-frontend', + versionDate: '2023-12-19T22:10:06.081Z', + gitCommitHash: 'f2a69ed', + versionLong: '0.1.0-f2a69ed', }; - export default versions; diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index 8e83554..99f4b7d 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -1,4 +1,4 @@ -import versions from "../../../src/_versions"; +import { environment } from "../../environments/environment"; import { FooterContainer, FooterWrap, @@ -25,7 +25,8 @@ const Footer: React.FC = (props) => { Developed by AI Lab - Version {versions.version} | UUID: {props.uuid} + {environment.version !== "" ? "Version: " + environment.version : ""}{" "} + | UUID: {props.uuid} Date: Wed, 17 Jan 2024 08:46:02 -0500 Subject: [PATCH 2/3] Updating package.json version number 0.1.0 -> 0.2.0 #80 --- package.json | 2 +- src/_versions.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6f5b1db..e324bcd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nachet-frontend", "homepage": "https://ai-cfia.github.io/nachet-frontend", - "version": "0.1.0", + "version": "0.2.0", "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.16.7", diff --git a/src/_versions.ts b/src/_versions.ts index b248758..4052e4e 100644 --- a/src/_versions.ts +++ b/src/_versions.ts @@ -9,10 +9,10 @@ export interface TsAppVersion { gitTag?: string; }; export const versions: TsAppVersion = { - version: '0.1.0', + version: '0.2.0', name: 'nachet-frontend', - versionDate: '2023-12-19T22:10:06.081Z', - gitCommitHash: 'f2a69ed', - versionLong: '0.1.0-f2a69ed', + versionDate: '2024-01-17T13:44:13.103Z', + gitCommitHash: '5647460', + versionLong: '0.2.0-5647460', }; export default versions; From 71a4da50ab501de6c79af3d89d8c6c41e1020133 Mon Sep 17 00:00:00 2001 From: Leron Bergelson <133677161+CFIALeronB@users.noreply.github.com> Date: Wed, 24 Jan 2024 09:20:57 -0500 Subject: [PATCH 3/3] Add link to Deployment Environment Config Management docs - Updated README.md to include a section linking to the Deployment Environment Configuration Management documentation, providing an overview and guiding users to detailed guidelines for managing environment configurations. --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b87cb00..8006d8e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Getting Started with Create React App -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +This project was bootstrapped with [Create React +App](https://github.com/facebook/create-react-app). ## Available Scripts @@ -17,30 +18,65 @@ You will also see any lint errors in the console. ### `npm test` Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. +See the section about [running +tests](https://facebook.github.io/create-react-app/docs/running-tests) for more +information. ### `npm run build` Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. +It correctly bundles React in production mode and optimizes the build for the +best performance. The build is minified and the filenames include the hashes.\ Your app is ready to be deployed! -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +See the section about +[deployment](https://facebook.github.io/create-react-app/docs/deployment) for +more information. ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can’t go back!** -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. +If you aren’t satisfied with the build tool and configuration choices, you can +`eject` at any time. This command will remove the single build dependency from +your project. -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. +Instead, it will copy all the configuration files and the transitive +dependencies (webpack, Babel, ESLint, etc) right into your project so you have +full control over them. All of the commands except `eject` will still work, but +they will point to the copied scripts so you can tweak them. At this point +you’re on your own. -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. +You don’t have to ever use `eject`. The curated feature set is suitable for +small and middle deployments, and you shouldn’t feel obligated to use this +feature. However we understand that this tool wouldn’t be useful if you +couldn’t customize it when you are ready for it. + +## Deployment Environment Configuration Management + +For managing and configuring different deployment environments (development, +staging, production), we follow a structured approach to ensure consistency and +reliability across all stages of deployment. Detailed guidelines and practices +can be found in our [Deployment Environment Configuration Management +documentation](https://github.com/ai-cfia/dev-rel-docs/blob/103-documentation-request-environment-configuration-guidelines/TypeScript-AppVersion/DEPLOYMENT_ENV_CONFIG_MANAGEMENT.md). + +This documentation covers: + +- Overview and purpose of different environment files (`environment.ts`, +`environment.staging.ts`, `environment.prod.ts`). +- The process for selecting and applying the correct environment configuration +during the build and deployment. +- Best practices for maintaining clear, consistent, and secure configuration +management across all frontend components. + +Refer to this documentation to understand how to effectively manage and utilize +environment configurations in your project. ## Learn More -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). +You can learn more in the [Create React App +documentation](https://facebook.github.io/create-react-app/docs/getting-started). To learn React, check out the [React documentation](https://reactjs.org/).