@eui/tools 4.19.1 → 4.19.5

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.1
1
+ 4.19.5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ ## 4.19.5 (2022-02-03)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * 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))
7
+
8
+ * * *
9
+ * * *
10
+ ## 4.19.4 (2022-02-03)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * 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))
16
+
17
+ * * *
18
+ * * *
19
+ ## 4.19.3 (2022-02-02)
20
+
21
+ ##### Chores
22
+
23
+ * **other:**
24
+ * 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))
25
+
26
+ * * *
27
+ * * *
28
+ ## 4.19.2 (2022-01-25)
29
+
30
+ ##### Bug Fixes
31
+
32
+ * **other:**
33
+ * hotfix pipeline metadata issues - added missing v10 pkg skeleton files - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([bb59cdbf](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/bb59cdbf98e13cca49017c6268318c4573bd73b4))
34
+
35
+ * * *
36
+ * * *
1
37
  ## 4.19.1 (2022-01-21)
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.1",
3
+ "version": "4.19.5",
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
  })
@@ -0,0 +1,5 @@
1
+ describe('First test', () => {
2
+ it('should work', () => {
3
+ expect(true).toBe(true);
4
+ });
5
+ });
@@ -0,0 +1 @@
1
+ Hello from <strong>@module.name@-cmp1</strong>
@@ -0,0 +1,25 @@
1
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Cmp1Component } from './cmp1.component';
4
+
5
+ describe('ModuleComponent', () => {
6
+ let component: Cmp1Component;
7
+ let fixture: ComponentFixture<Cmp1Component>;
8
+
9
+ beforeEach(async(() => {
10
+ TestBed.configureTestingModule({
11
+ declarations: [Cmp1Component],
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(Cmp1Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,14 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: '@module.scope.string@-cmp1-component',
5
+ templateUrl: './cmp1.component.html',
6
+ })
7
+ export class Cmp1Component implements OnInit {
8
+
9
+ constructor() { }
10
+
11
+ ngOnInit() {
12
+ }
13
+
14
+ }
@@ -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);
@@ -222,7 +222,7 @@ module.exports.storeMetadata = (
222
222
  if (pkgIdxHOTFIX > -1) {
223
223
  packagesHotfixTag[pkgIdxHOTFIX] = newPackage;
224
224
  } else {
225
- if (!packagesNextTag) {
225
+ if (!packagesHotfixTag) {
226
226
  packagesHotfixTag = [];
227
227
  }
228
228
  packagesHotfixTag.push(newPackage);
@@ -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
  }