@eui/tools 6.11.6 → 6.11.7

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.
@@ -1 +1 @@
1
- 6.11.6
1
+ 6.11.7
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.11.7 (2023-04-18)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * routes replacement not overriding local config if provided - MWP-9533 [MWP-9533](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9533) ([931623c5](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/931623c5ce06279ab3325255bc719ea7f5074aaa))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.11.6 (2023-04-18)
2
11
 
3
12
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.11.6",
3
+ "version": "6.11.7",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -275,6 +275,8 @@ const processRoutesConfig = (project, envTarget, build, routesFile, routesFileCo
275
275
  const euiVersionNumber = euiVersion.split('.')[0];
276
276
  const envTargetFinal = getEnvTarget(envTarget, build);
277
277
 
278
+ tools.logInfo(`Processing for envTarget : ${envTargetFinal}`);
279
+
278
280
  // getting the input file definitions of routes for replacements
279
281
  // from tokenized template in config -- allowing to control playground vs normal env (when using the MWP HOST for release)
280
282
  // format :
@@ -287,6 +289,7 @@ const processRoutesConfig = (project, envTarget, build, routesFile, routesFileCo
287
289
  throw 'ROUTES_CONFIG_V2_TEMPLATE_NOT_FOUND';
288
290
  }
289
291
 
292
+
290
293
  routeDefsInputFilename = project.externalRoutesSources.routesFilenameTemplate.replace('@eui.version@', euiVersionNumber);
291
294
  routeDefsInputFilename = routeDefsInputFilename.replace('@env.target@', envTargetFinal);
292
295
 
@@ -303,13 +306,40 @@ const processRoutesConfig = (project, envTarget, build, routesFile, routesFileCo
303
306
 
304
307
  const routeDefsInputJSON = require(path.join(routeDefsInputPath));
305
308
 
309
+ // Merging content with "local" route file defs if existing
310
+
311
+ let mergedRoutes = [];
312
+
313
+ if (envTargetFinal.indexOf('local') > -1) {
314
+ const localRouteDefsInputFilename = `route-defs.${envTargetFinal}.json`;
315
+ const localRouteDefsInputPath = path.join(projectAssetsPath, localRouteDefsInputFilename);
316
+
317
+ if (tools.isFileExists(localRouteDefsInputPath)) {
318
+ tools.logInfo(`Merging local configuration found : ${localRouteDefsInputFilename}`);
319
+ const localRouteDefsInputJSON = require(path.join(localRouteDefsInputPath));
320
+
321
+ routeDefsInputJSON.forEach((route) => {
322
+ const matchedRoute = localRouteDefsInputJSON.filter(newRoute => newRoute.path === route.path)[0];
323
+ if (matchedRoute) {
324
+ tools.logInfo(`-- replacing ${route.path} route entry with overriden local config`);
325
+ tools.logInfo(`-----> ${JSON.stringify(matchedRoute)}`);
326
+ mergedRoutes.push(matchedRoute);
327
+ } else {
328
+ mergedRoutes.push(route);
329
+ }
330
+ });
331
+ }
332
+ } else {
333
+ mergedRoutes = routeDefsInputJSON;
334
+ }
335
+
306
336
  const appRoutes = [],
307
337
  appFeatureLibs = [],
308
338
  finalRemotesDefs = [];
309
339
 
310
340
  // processing each routes found in the routeDefs entry
311
341
 
312
- routeDefsInputJSON.forEach((route) => {
342
+ mergedRoutes.forEach((route) => {
313
343
  tools.logInfo(`Processing route : ${route.path}`);
314
344
 
315
345
  const defRoute = routeDefsBaseJSON.filter((r) => r.path === route.path)[0];