-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(dev,proxy,prod): ent-3643 chrome local run, proxy, build
* babel, moved to independent config from package * build, empty module, plugins for html, dotenv replace * cspell, ouia keyword added * docs, local run descriptions, debugging updated * dotenv, locale path, port, build branch * eslint, json extensions are now required * jest, adjust coverage based on fed mod file adds * public, index.html apply esi instead of dotenv params * scripts, remove original dev chrome, clean up post, proxy * spandx, proxy routing clean up * src, fed module file adds, component dev checks removed * tests, integration-like tests updated * webpack, dev, proxy, prod configs
- Loading branch information
Showing
39 changed files
with
1,571 additions
and
4,761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
GENERATE_SOURCEMAP=true | ||
|
||
REACT_APP_ENV=production | ||
REACT_APP_UI_VERSION=${UI_VERSION} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,7 @@ | ||
HTTPS=true | ||
BROWSER=none | ||
PORT=5001 | ||
UI_DEPLOY_PATH_PREFIX=/beta | ||
DEV_PORT=443 | ||
DEV_BRANCH=ci-stable | ||
|
||
REACT_APP_ENV=review | ||
|
||
REACT_APP_INCLUDE_CONTENT_HEADER='<esi:include src="${UI_DEPLOY_PATH_PREFIX}/apps/chrome/snippets/head.html" />' | ||
REACT_APP_INCLUDE_CONTENT_BODY='<esi:include src="${UI_DEPLOY_PATH_PREFIX}/apps/chrome/snippets/body.html" />' | ||
|
||
REACT_APP_CONFIG_SERVICE_LOCALES=/locales/locales.json | ||
REACT_APP_CONFIG_SERVICE_LOCALES_PATH=/locales/{{lng}}.json | ||
|
||
REACT_APP_SERVICES_RHSM_VERSION=/api/rhsm-subscriptions/v1/version | ||
REACT_APP_SERVICES_RHSM_REPORT=/api/rhsm-subscriptions/v1/tally/products/ | ||
REACT_APP_SERVICES_RHSM_CAPACITY=/api/rhsm-subscriptions/v1/capacity/products/ | ||
REACT_APP_SERVICES_RHSM_INVENTORY=/api/rhsm-subscriptions/v1/hosts/products/ | ||
REACT_APP_SERVICES_RHSM_INVENTORY_GUESTS=/api/rhsm-subscriptions/v1/hosts/{0}/guests | ||
REACT_APP_SERVICES_RHSM_INVENTORY_SUBSCRIPTIONS=/api/rhsm-subscriptions/v1/subscriptions/products/ | ||
REACT_APP_SERVICES_RHSM_OPTIN=/api/rhsm-subscriptions/v1/opt-in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ | |
"import/extensions": [ | ||
"error", | ||
{ | ||
"json": "never" | ||
"json": "always" | ||
} | ||
], | ||
"import/first": 0, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ['react-app'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Used as an empty module to save bundle size | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const { join, resolve } = require('path'); | ||
const webpack = require('webpack'); | ||
const CopyPlugin = require('copy-webpack-plugin'); | ||
const fedModulePlugin = require('@redhat-cloud-services/frontend-components-config/federated-modules'); | ||
const { setupWebpackDotenvFilesForEnv } = require('./build.dotenv'); | ||
|
||
const setHtmlPlugin = () => ({ | ||
title: process.env.REACT_APP_UI_DISPLAY_NAME, | ||
template: join(process.env._BUILD_STATIC_DIR, 'index.html') | ||
}); | ||
|
||
const setReplacePlugin = () => [ | ||
{ | ||
pattern: /%([A-Z_]+)%/g, | ||
replacement: (match, $1) => process.env?.[$1] || match | ||
} | ||
]; | ||
|
||
const setCommonPlugins = () => { | ||
const { NODE_ENV } = process.env; | ||
const DIST_DIR = process.env._BUILD_DIST_DIR; | ||
const DOTENV_ENV = process.env.REACT_APP_ENV; | ||
const RELATIVE_DIRNAME = process.env._BUILD_RELATIVE_DIRNAME; | ||
const STATIC_DIR = process.env._BUILD_STATIC_DIR; | ||
|
||
const plugins = [ | ||
...setupWebpackDotenvFilesForEnv({ directory: RELATIVE_DIRNAME, env: DOTENV_ENV }), | ||
new CopyPlugin({ | ||
patterns: [{ from: join(STATIC_DIR, 'locales'), to: join(DIST_DIR, 'locales'), noErrorOnMissing: true }] | ||
}), | ||
fedModulePlugin({ root: RELATIVE_DIRNAME }) | ||
]; | ||
|
||
// Save 20kb of bundle size in prod | ||
if (NODE_ENV === 'production') { | ||
plugins.push(new webpack.NormalModuleReplacementPlugin(/redux-logger/, resolve(__dirname, './build.empty.js'))); | ||
} | ||
|
||
return plugins; | ||
}; | ||
|
||
module.exports = { | ||
setCommonPlugins, | ||
setHtmlPlugin, | ||
setReplacePlugin | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
"openapi", | ||
"openshift", | ||
"optin", | ||
"ouia", | ||
"patternfly", | ||
"pendo", | ||
"perpage", | ||
|
Oops, something went wrong.