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

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.0",
3
+ "version": "5.0.0",
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.0",
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,
@@ -42,6 +44,8 @@ module.exports = ({
42
44
  cacheConfig = {},
43
45
  _unstableHotReload = false,
44
46
  resolve = {},
47
+ // additional node_modules dirs for searchIgnoredStyles, usefull in monorepo scenario
48
+ nodeModulesDirectories = [],
45
49
  } = {}) => {
46
50
  const filenameMask = `js/[name].${!_unstableHotReload && useFileHash ? `[fullhash].` : ''}js`;
47
51
  if (betaEnv) {
@@ -175,7 +179,9 @@ module.exports = ({
175
179
  ...resolve,
176
180
  extensions: ['.ts', '.tsx', '.mjs', '.js', '.scss', ...(resolve.extensions, [])],
177
181
  alias: {
178
- ...(bundlePfModules ? {} : searchIgnoredStyles(rootFolder)),
182
+ ...(bundlePfModules
183
+ ? {}
184
+ : searchIgnoredStyles(rootFolder, ...(Array.isArray(nodeModulesDirectories) ? nodeModulesDirectories : [nodeModulesDirectories]))),
179
185
  ...resolve.alias,
180
186
  },
181
187
  fallback: {
@@ -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
  },
@@ -7,19 +7,19 @@ describe('plugins generations, no option', () => {
7
7
  const enabledPlugins = plugins({ rootFolder: '/foo/bar' });
8
8
 
9
9
  it('should generate plugins', () => {
10
- expect(enabledPlugins.length).toBe(5);
10
+ expect(enabledPlugins.length).toBe(4);
11
11
  });
12
12
 
13
13
  it('should generate plugins with sourceMaps', () => {
14
14
  const enabledPlugins = plugins({ generateSourceMaps: true, rootFolder: '/foo/bar' });
15
- expect(enabledPlugins.length).toBe(6);
15
+ expect(enabledPlugins.length).toBe(5);
16
16
  });
17
17
  });
18
18
 
19
19
  describe('TS for plugins', () => {
20
20
  const pluginsWithTs = plugins({ generateSourceMaps: true, rootFolder: path.resolve(__dirname, '../../../') });
21
- it('should have TSForkPlugin and 7 plugins in todal', () => {
22
- expect(pluginsWithTs).toHaveLength(7);
21
+ it('should have TSForkPlugin and 6 plugins in todal', () => {
22
+ expect(pluginsWithTs).toHaveLength(6);
23
23
  });
24
24
  });
25
25
 
@@ -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') {