@eui/tools 4.19.2 → 4.19.3

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
- 4.19.2
1
+ 4.19.3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 4.19.3 (2022-02-02)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * added pathsMapping replacement for v10 remotes config - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([6e5651cf](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/6e5651cfcf2533ced316b5e04650d65f88520185))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 4.19.2 (2022-01-25)
2
11
 
3
12
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "4.19.2",
3
+ "version": "4.19.3",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -631,10 +631,22 @@ const notificationUtils = require('./scripts/utils/notification/notification-uti
631
631
  // tools.logBanner('this is the content of the banner');
632
632
  // })
633
633
 
634
+ // return Promise.resolve()
635
+ // .then(() => {
636
+ // const prjName = 'eui-showcase-ux';
637
+ // const prj = configUtils.projects.getCsdrProject(prjName);
638
+
639
+ // return compositeUtils.getDeps(prj, 'TST');
640
+ // })
641
+
642
+
643
+ const prjName = 'my-workplace';
644
+ const prj = configUtils.projects.getCsdrProject(prjName);
645
+
634
646
  return Promise.resolve()
647
+ // .then(() => {
648
+ // return injectionUtils.externals.injectExternalAppSources(prj);
649
+ // })
635
650
  .then(() => {
636
- const prjName = 'eui-showcase-ux';
637
- const prj = configUtils.projects.getCsdrProject(prjName);
638
-
639
- return compositeUtils.getDeps(prj, 'TST');
651
+ return injectionUtils.externals.remapRoutesByEnvConfig(prj, 'DEV', true);
640
652
  })
@@ -256,11 +256,14 @@ module.exports.remapRoutesByEnvConfig = (project, envTarget, build) => {
256
256
 
257
257
  // get routes file content and replace tokens
258
258
  routesRemapping.forEach((route) => {
259
- tools.logInfo(`checking replacement for : ${JSON.stringify(route)}`);
259
+ tools.logInfo(`\nchecking replacement for : ${JSON.stringify(route)}`);
260
260
  const tokenToSearch = `./features/${route.featureModule}-lib.module#Module`;
261
+ tools.logInfo(`Searching token : ${tokenToSearch}`);
261
262
  if (routesFileContent.indexOf(tokenToSearch) > -1) {
262
263
  tools.logInfo(`token ${tokenToSearch} found...replacing by ${route.routeModuleDef}`);
263
264
  routesFileContent = tools.replaceAll(routesFileContent, tokenToSearch, route.routeModuleDef);
265
+ } else {
266
+ tools.logWarning(`token ${tokenToSearch} NOT FOUND`);
264
267
  }
265
268
  })
266
269
 
@@ -277,6 +280,54 @@ module.exports.remapRoutesByEnvConfig = (project, envTarget, build) => {
277
280
  if (routesFileContent.indexOf(tokenToSearch) > -1) {
278
281
  tools.logInfo(`token ${tokenToSearch} found...replacing by ${route.updatedRoute}`);
279
282
  routesFileContent = tools.replaceAll(routesFileContent, tokenToSearch, route.updatedRoute);
283
+ } else {
284
+ tools.logWarning(`token ${tokenToSearch} NOT FOUND`);
285
+ }
286
+ })
287
+ }
288
+
289
+ // checking paths mapping (new method for v10 remotes)
290
+ const pathsMapping = config.pathsMapping;
291
+ if (!pathsMapping) {
292
+ tools.logWarning('No pathsMapping found in current config...skipping');
293
+
294
+ } else {
295
+ tools.logInfo('Paths mappings for v10 remotes activation');
296
+ pathsMapping.forEach((pathMapping) => {
297
+ tools.logInfo(`Checking path: ${pathMapping.path}`);
298
+ const placeholderToSearch = `// ${pathMapping.path}-placeholder`;
299
+
300
+ if (routesFileContent.indexOf(placeholderToSearch) > -1) {
301
+ tools.logInfo(`path placeholder: "${placeholderToSearch}" found...replacing`);
302
+
303
+ let placeholderContent = '';
304
+ if (pathMapping.data) {
305
+ placeholderContent += 'data:{';
306
+ if (pathMapping.data.featureName) {
307
+ placeholderContent += `featureName: "${pathMapping.data.featureName}"`;
308
+ }
309
+ if (pathMapping.data.moduleId) {
310
+ placeholderContent += `, moduleId: "${pathMapping.data.moduleId}"`;
311
+ }
312
+ if (pathMapping.data.elementTag) {
313
+ placeholderContent += `, elementTag: "${pathMapping.data.elementTag}"`;
314
+ }
315
+ if (pathMapping.data.iframe) {
316
+ placeholderContent += `, iframe: ${pathMapping.data.iframe}`;
317
+ }
318
+ placeholderContent += '}';
319
+ }
320
+ if (pathMapping.loadChildren) {
321
+ placeholderContent += `, loadChildren: "${pathMapping.loadChildren}"`;
322
+ }
323
+
324
+ tools.logInfo('Generated content for route: ');
325
+ console.log(placeholderContent);
326
+
327
+ routesFileContent = tools.replaceAll(routesFileContent, placeholderToSearch, placeholderContent);
328
+
329
+ } else {
330
+ tools.logWarning(`token ${placeholderToSearch} NOT FOUND`);
280
331
  }
281
332
  })
282
333
  }