Skip to content

Commit

Permalink
added the .env files
Browse files Browse the repository at this point in the history
  • Loading branch information
jagankumar-egov committed Sep 24, 2024
1 parent c56be72 commit ed6ccd4
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildWorkbenchUI.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Digit Admin Console Build workflow
on:
push:
branches: [ 'develop','campaign' ,'microplan','master']
branches: [ 'develop','campaign' ,'microplan','master', 'add']
paths:
- 'health/micro-ui/web/micro-ui-internals/**'
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ index.lock
utilities/project-factory/node_modules/*
utilities/egov-bff/node_modules/*
utilities/
/micro-frontends
1 change: 0 additions & 1 deletion health/micro-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.env
.eslintcache

# yarn $
Expand Down
10 changes: 10 additions & 0 deletions health/micro-ui/web/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://health-jagan.digit.org
REACT_APP_PROXY_ASSETS=https://health-jagan.digit.org
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/hcm/workbenchGlobalConfigs.js
REACT_APP_CONTEXT=works
REACT_APP_TENANT=pg
WORKBENCH=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsWorkbenchHCMMZ.js
3 changes: 1 addition & 2 deletions health/micro-ui/web/micro-ui-internals/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
# dotenv environment variables file .env
.env.test
.env*.local

Expand Down
1 change: 0 additions & 1 deletion health/micro-ui/web/micro-ui-internals/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ index.compat.css
index.min.css
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
9 changes: 9 additions & 0 deletions health/micro-ui/web/micro-ui-internals/example/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://health-jagan.digit.org
REACT_APP_PROXY_ASSETS=https://health-jagan.digit.org
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/hcm/workbenchGlobalConfigs.js
REACT_APP_CONTEXT=works
WORKBENCH=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsWorkbenchHCMMZ.js
10 changes: 10 additions & 0 deletions health/micro-ui/web/src/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SKIP_PREFLIGHT_CHECK=true
REACT_APP_USER_TYPE=EMPLOYEE
REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a
REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c
REACT_APP_PROXY_API=https://health-jagan.digit.org
REACT_APP_PROXY_ASSETS=https://health-jagan.digit.org
REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/hcm/workbenchGlobalConfigs.js
REACT_APP_CONTEXT=works
REACT_APP_TENANT=mz
WORKBENCH=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsWorkbenchHCMMZ.js
1 change: 1 addition & 0 deletions health/micro-ui/web/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"dotenv-webpack": "8.1.0",
"css-loader": "5.2.6",
"style-loader": "2.0.0",
"webpack-cli": "4.10.0"
Expand Down
22 changes: 15 additions & 7 deletions health/micro-ui/web/workbench/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const Dotenv = require('dotenv-webpack');

// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
Expand All @@ -21,24 +23,30 @@ module.exports = {
],
},
output: {
filename: "[name].bundle.js",
filename: "[name].[contenthash].bundle.js", // Add contenthash for cache-busting
path: path.resolve(__dirname, "build"),
publicPath: "/workbench-ui/",
},
optimization: {
splitChunks: {
chunks: 'all',
minSize:20000,
maxSize:50000,
enforceSizeThreshold:50000,
minChunks:1,
maxAsyncRequests:30,
maxInitialRequests:30
minSize: 20000,
maxSize: 50000,
enforceSizeThreshold: 50000,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
automaticNameDelimiter: '-',
},
runtimeChunk: 'single', // Create a single runtime bundle
moduleIds: 'deterministic', // Stable module IDs to prevent unnecessary cache invalidation
},
plugins: [
new CleanWebpackPlugin(),
// new BundleAnalyzerPlugin(),
new HtmlWebpackPlugin({ inject: true, template: "public/index.html" }),
new Dotenv({
systemvars: true, // This ensures that system environment variables also override .env values if they exist
}),
],
};
1 change: 0 additions & 1 deletion micro-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.env
.eslintcache

# yarn $
Expand Down
3 changes: 1 addition & 2 deletions micro-ui/web/micro-ui-internals/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
# dotenv environment variables file.env
.env.test
.env*.local

Expand Down
1 change: 0 additions & 1 deletion micro-ui/web/micro-ui-internals/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ index.compat.css
index.min.css
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
6 changes: 4 additions & 2 deletions micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"resolutions": {
"**/@babel/runtime": "7.20.1",
"**/babel-preset-react-app": "10.0.0",
"fast-uri":"2.1.0"
"fast-uri": "2.1.0"
},
"devDependencies": {
"husky": "7.0.4",
Expand All @@ -64,9 +64,11 @@
"*.{js,css,md}": "prettier --write"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.3",
"dotenv": "^16.4.5",
"dotenv-webpack": "^8.1.0",
"lodash": "4.17.21",
"microbundle-crl": "0.13.11",
"@egovernments/digit-ui-react-components": "1.8.3",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
Expand Down
1 change: 1 addition & 0 deletions micro-ui/web/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"web-vitals": "1.1.2",
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"dotenv-webpack": "8.1.0",
"react-query": "3.6.1"
},
"devDependencies": {
Expand Down
22 changes: 15 additions & 7 deletions micro-ui/web/workbench/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const Dotenv = require('dotenv-webpack');

// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
Expand All @@ -21,24 +23,30 @@ module.exports = {
],
},
output: {
filename: "[name].bundle.js",
filename: "[name].[contenthash].bundle.js", // Add contenthash for cache-busting
path: path.resolve(__dirname, "build"),
publicPath: "/workbench-ui/",
},
optimization: {
splitChunks: {
chunks: 'all',
minSize:20000,
maxSize:50000,
enforceSizeThreshold:50000,
minChunks:1,
maxAsyncRequests:30,
maxInitialRequests:30
minSize: 20000,
maxSize: 50000,
enforceSizeThreshold: 50000,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
automaticNameDelimiter: '-',
},
runtimeChunk: 'single', // Create a single runtime bundle
moduleIds: 'deterministic', // Stable module IDs to prevent unnecessary cache invalidation
},
plugins: [
new CleanWebpackPlugin(),
// new BundleAnalyzerPlugin(),
new HtmlWebpackPlugin({ inject: true, template: "public/index.html" }),
new Dotenv({
systemvars: true, // This ensures that system environment variables also override .env values if they exist
}),
],
};

0 comments on commit ed6ccd4

Please sign in to comment.