@eui/tools 4.19.2 → 4.19.6

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.6
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ ## 4.19.6 (2022-02-07)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * set dot-prop injected resources for v13 to 6.0.1 - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([27e176a9](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/27e176a96b57b2b57488be4defe39490ec12d07c))
7
+
8
+ * * *
9
+ * * *
10
+ ## 4.19.5 (2022-02-03)
11
+
12
+ ##### Bug Fixes
13
+
14
+ * **other:**
15
+ * pwa project location - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([6b645602](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/6b64560289d1faae81906efab5e840ab48472d2b))
16
+
17
+ * * *
18
+ * * *
19
+ ## 4.19.4 (2022-02-03)
20
+
21
+ ##### Chores
22
+
23
+ * **other:**
24
+ * added pwa injection in angular config - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([d36f21fd](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/d36f21fd0c80a10daed260f09d79b03917ce1322))
25
+
26
+ * * *
27
+ * * *
28
+ ## 4.19.3 (2022-02-02)
29
+
30
+ ##### Chores
31
+
32
+ * **other:**
33
+ * 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))
34
+
35
+ * * *
36
+ * * *
1
37
  ## 4.19.2 (2022-01-25)
2
38
 
3
39
  ##### 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.6",
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
  })
@@ -1120,6 +1120,13 @@ module.exports.registerAngularProjectDef = (project, build = false) => {
1120
1120
  jsonFile['projects'][project.name].architect.serve.configurations[confKey] = serveConf;
1121
1121
  })
1122
1122
  }
1123
+
1124
+ // checking pwa additional injection
1125
+ if (project.build && project.build.pwa) {
1126
+ jsonFile['projects'][project.name].architect.build.options.serviceWorker = true;
1127
+ jsonFile['projects'][project.name].architect.build.options.ngswConfigPath = "ngsw-config.json";
1128
+ jsonFile['projects'][project.name].architect.build.options.assets.push(`apps/${project.name}/src/manifest.webmanifest`);
1129
+ }
1123
1130
  }
1124
1131
 
1125
1132
  tools.writeJsonFileSync(file, jsonFile);
@@ -6,7 +6,7 @@
6
6
  "minimatch": ">=3.0.4",
7
7
  "acorn-globals": ">=6.0.0",
8
8
  "open": ">=7.0.3",
9
- "dot-prop": ">=5.2.0",
9
+ "dot-prop": "6.0.1",
10
10
  "serialize-javascript": ">=3.1.0",
11
11
  "socket.io": ">=2.4.0",
12
12
  "ssri": ">=8.0.1",
@@ -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
  }