@redhat-cloud-services/frontend-components-config 5.0.0 → 5.0.2
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
package/src/config.js
CHANGED
|
@@ -47,7 +47,7 @@ module.exports = ({
|
|
|
47
47
|
// additional node_modules dirs for searchIgnoredStyles, usefull in monorepo scenario
|
|
48
48
|
nodeModulesDirectories = [],
|
|
49
49
|
} = {}) => {
|
|
50
|
-
const filenameMask = `js/[name].${!_unstableHotReload && useFileHash ? `[
|
|
50
|
+
const filenameMask = `js/[name].${!_unstableHotReload && useFileHash ? `[contenthash].` : ''}js`;
|
|
51
51
|
if (betaEnv) {
|
|
52
52
|
env = `${betaEnv}-beta`;
|
|
53
53
|
console.warn('betaEnv is deprecated in favor of env');
|
|
@@ -165,7 +165,7 @@ module.exports = ({
|
|
|
165
165
|
test: /\.(woff(2)?|ttf|jpg|png|eot|gif|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
166
166
|
type: 'asset/resource',
|
|
167
167
|
generator: {
|
|
168
|
-
filename: '
|
|
168
|
+
filename: 'assets/[name][ext]',
|
|
169
169
|
},
|
|
170
170
|
},
|
|
171
171
|
{
|
package/src/config.test.js
CHANGED
|
@@ -30,10 +30,10 @@ describe('should create dummy config with no options', () => {
|
|
|
30
30
|
|
|
31
31
|
test('output', () => {
|
|
32
32
|
expect(output).toEqual({
|
|
33
|
-
filename: expect.stringMatching(/js\/\[name\]\.\[
|
|
33
|
+
filename: expect.stringMatching(/js\/\[name\]\.\[contenthash\]\.js/),
|
|
34
34
|
path: '/dist',
|
|
35
35
|
publicPath: undefined,
|
|
36
|
-
chunkFilename: expect.stringMatching(/js\/\[name\]\.\[
|
|
36
|
+
chunkFilename: expect.stringMatching(/js\/\[name\]\.\[contenthash\]\.js/),
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -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/
|
|
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
|
|
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(
|
|
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
|
-
|
|
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,
|