@redhat-cloud-services/frontend-components-config 5.0.0-beta.1 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-cloud-services/frontend-components-config",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.1",
4
4
  "description": "Config plugins and settings for RedHat Cloud Services project.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  "homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/config#readme",
22
22
  "dependencies": {
23
23
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8",
24
- "@redhat-cloud-services/frontend-components-config-utilities": "^2.0.0-beta.1",
24
+ "@redhat-cloud-services/frontend-components-config-utilities": "^2.0.1",
25
25
  "assert": "^2.0.0",
26
26
  "axios": "^0.27.2",
27
27
  "babel-loader": "^8.2.5",
package/src/config.js CHANGED
@@ -33,7 +33,9 @@ module.exports = ({
33
33
  useCloud,
34
34
  target,
35
35
  registry,
36
- client = {},
36
+ client = {
37
+ overlay: false,
38
+ },
37
39
  bundlePfModules = false,
38
40
  bounceProd,
39
41
  useAgent,
@@ -58,7 +58,9 @@ describe('should create dummy config with no options', () => {
58
58
  verbose: false,
59
59
  disableDotRule: true,
60
60
  },
61
- client: {},
61
+ client: {
62
+ overlay: false,
63
+ },
62
64
  devMiddleware: {
63
65
  writeToDisk: true,
64
66
  },
@@ -27,7 +27,7 @@ const bundles = Array.from(
27
27
  const app = express();
28
28
  const port = 9999;
29
29
 
30
- const BASE_URL = 'https://raw.githubusercontent.com/RedHatInsights/cloud-services-config/ci-beta/';
30
+ const BASE_URL = 'https://raw.githubusercontent.com/RedHatInsights/chrome-service-backend/main';
31
31
 
32
32
  function getRequestBundle(requestUrl) {
33
33
  const bundle = requestUrl.split('/').pop().split('-').shift();
@@ -35,14 +35,11 @@ function getRequestBundle(requestUrl) {
35
35
  }
36
36
 
37
37
  app.get('*', async (req, res, next) => {
38
- let requestUrl = `${BASE_URL}${req.url.replace(/(\/beta)?\/config/gm, '')}`;
39
- if (requestUrl.includes('insights-navigation.json')) {
40
- requestUrl = requestUrl.replace('insights-navigation.json', 'rhel-navigation.json');
41
- }
42
38
  try {
43
- const schema = await axios.get(requestUrl);
39
+ const reqUrl = BASE_URL + req.url.replace('/api/chrome-service/v1', '');
40
+ const schema = await axios.get(reqUrl);
44
41
  if (req.url.includes('-navigation.json') && bundles.some((bundle) => req.url.includes(bundle))) {
45
- const requestBundle = getRequestBundle(requestUrl);
42
+ const requestBundle = getRequestBundle(req.url);
46
43
  /** handle nav json */
47
44
  const payload = schema.data;
48
45
  payload.navItems = [...payload.navItems, ...navItems.filter(({ href }) => href.includes(requestBundle))];
@@ -69,7 +69,8 @@ async function devScript(argv, cwd) {
69
69
  if (fecConfig.interceptChromeConfig === true) {
70
70
  const interceptorServerPath = resolve(__dirname, './csc-interceptor-server.js');
71
71
  const interceptorServerArgs = [interceptorServerPath];
72
- spawn('node', interceptorServerArgs, {
72
+ // Ensure ipv4 DNS is hit first. Currently there are issues with IPV4
73
+ spawn('NODE_OPTIONS=--dns-result-order=ipv4first node', interceptorServerArgs, {
73
74
  stdio: [process.stdout, process.stdout, process.stdout],
74
75
  cwd,
75
76
  shell: true,
@@ -5,20 +5,22 @@ const fecConfig = require(process.env.FEC_CONFIG_PATH);
5
5
  const isBeta = process.env.BETA === 'true';
6
6
 
7
7
  function parseRegexpURL(url) {
8
- return new RegExp(`${isBeta ? '/beta' : ''}${url.toString()}`);
8
+ return isBeta ? [new RegExp(`/beta${url.toString()}`), new RegExp(`/preview${url.toString()}`)] : new RegExp(url.toString());
9
9
  }
10
10
 
11
11
  function createAppUrl(appUrl) {
12
12
  if (Array.isArray(appUrl)) {
13
- return appUrl.map((url) => {
14
- if (typeof url === 'object') {
15
- return parseRegexpURL(url);
16
- } else if (typeof url === 'string') {
17
- return `${isBeta ? '/beta' : ''}${url}`;
18
- } else {
19
- throw `Invalid appURL format! Expected string or regexp, got ${typeof url}. Check your fec.config.js:appUrl.`;
20
- }
21
- });
13
+ return appUrl
14
+ .map((url) => {
15
+ if (typeof url === 'object') {
16
+ return parseRegexpURL(url);
17
+ } else if (typeof url === 'string') {
18
+ return isBeta ? [`/beta${url}`, `/preview${url}`] : url;
19
+ } else {
20
+ throw `Invalid appURL format! Expected string or regexp, got ${typeof url}. Check your fec.config.js:appUrl.`;
21
+ }
22
+ })
23
+ .flat();
22
24
  } else if (typeof appUrl === 'object') {
23
25
  return parseRegexpURL(appUrl);
24
26
  } else if (typeof appUrl === 'string') {
@@ -36,10 +38,7 @@ const internalProxyRoutes = {
36
38
  ...routes,
37
39
  ...(interceptChromeConfig === true
38
40
  ? {
39
- '/beta/config': {
40
- host: 'http://localhost:9999',
41
- },
42
- '/config': {
41
+ '/api/chrome-service/v1/static': {
43
42
  host: 'http://localhost:9999',
44
43
  },
45
44
  }