@eui/tools 4.17.7 → 4.18.0

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.
Files changed (59) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +41 -0
  3. package/package.json +1 -1
  4. package/sandbox.js +4 -10
  5. package/scripts/csdr/cli/app.js +21 -10
  6. package/scripts/csdr/cli/skeletons/app-eui10/angular-config.json +20 -0
  7. package/scripts/csdr/cli/skeletons/app-eui10/dependencies-base.json +2 -0
  8. package/scripts/csdr/cli/skeletons/app-eui10/dependencies-composite.json +5 -0
  9. package/scripts/csdr/cli/skeletons/app-eui10/gitignore_TO_REPLACE +63 -0
  10. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/models/user.js +8 -0
  11. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/index.js +5 -0
  12. package/scripts/csdr/cli/skeletons/app-eui10/mock/app/routes/user_routes.js +24 -0
  13. package/scripts/csdr/cli/skeletons/app-eui10/mock/db/db.json +12 -0
  14. package/scripts/csdr/cli/skeletons/app-eui10/mock/server.js +16 -0
  15. package/scripts/csdr/cli/skeletons/app-eui10/package.json +6 -0
  16. package/scripts/csdr/cli/skeletons/app-eui10/scripts.json +5 -0
  17. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-routing.module.ts +18 -0
  18. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app-starter.service.ts +68 -0
  19. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.html +29 -0
  20. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.component.ts +55 -0
  21. package/scripts/csdr/cli/skeletons/app-eui10/src/app/app.module.ts +27 -0
  22. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/components/.gitkeep +0 -0
  23. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/core.module.ts +84 -0
  24. package/scripts/csdr/cli/skeletons/app-eui10/src/app/core/reducers/index.ts +33 -0
  25. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home-routing.module.ts +15 -0
  26. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.html +7 -0
  27. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.component.ts +19 -0
  28. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/home/home.module.ts +18 -0
  29. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.html +7 -0
  30. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page1/page1.component.ts +7 -0
  31. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.html +7 -0
  32. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/components/page2/page2.component.ts +7 -0
  33. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1-routing.module.ts +18 -0
  34. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.html +7 -0
  35. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.component.ts +8 -0
  36. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module1/module1.module.ts +21 -0
  37. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2-routing.module.ts +16 -0
  38. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.html +8 -0
  39. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.component.ts +7 -0
  40. package/scripts/csdr/cli/skeletons/app-eui10/src/app/features/module2/module2.module.ts +17 -0
  41. package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/shared.module.ts +21 -0
  42. package/scripts/csdr/cli/skeletons/app-eui10/src/app/shared/testing/router.mock.ts +18 -0
  43. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/config/env-json-config.json +8 -0
  44. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/en.json +7 -0
  45. package/scripts/csdr/cli/skeletons/app-eui10/src/assets/i18n/fr.json +7 -0
  46. package/scripts/csdr/cli/skeletons/app-eui10/src/config/global.ts +20 -0
  47. package/scripts/csdr/cli/skeletons/app-eui10/src/config/index.ts +8 -0
  48. package/scripts/csdr/cli/skeletons/app-eui10/src/config/modules.ts +4 -0
  49. package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.prod.ts +9 -0
  50. package/scripts/csdr/cli/skeletons/app-eui10/src/environments/environment.ts +9 -0
  51. package/scripts/csdr/cli/skeletons/app-eui10/src/index.html +21 -0
  52. package/scripts/csdr/cli/skeletons/app-eui10/src/styles.scss +1 -0
  53. package/scripts/csdr/cli/skeletons/app-eui10/tslint.json +17 -0
  54. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.component.ts +35 -16
  55. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +50 -9
  56. package/scripts/csdr/metadata/package.js +96 -0
  57. package/scripts/csdr/sync/sync-utils.js +4 -4
  58. package/scripts/utils/build/app/build-app-utils.js +5 -4
  59. package/scripts/utils/pre-build/injection/externals.js +21 -2
@@ -596,3 +596,99 @@ module.exports.isPackageLocked = (pkg) => {
596
596
 
597
597
  return false;
598
598
  }
599
+
600
+
601
+
602
+ module.exports.syncDevopsMetadata = () => {
603
+ return Promise.resolve()
604
+ .then(() => {
605
+ const pkgsObject = configUtils.packages.getCsdrPackages();
606
+ const pkgs = Object.keys(pkgsObject);
607
+
608
+ const metadataFile = path.join(process.cwd(), 'packages', 'devops-metadata', '.devops-metadata.json');
609
+ const metadata = require(metadataFile);
610
+
611
+ let packages = metadata.packages;
612
+ let packagesLatestTag = metadata.packagesLatestTag;
613
+ let packagesNextTag = metadata.packagesNextTag;
614
+ let packagesPrevTag = metadata.packagesPrevTag;
615
+ let packagesPrevSnapshotsTag = metadata.packagesPrevSnapshotsTag;
616
+
617
+ const getMissingPackages = (inArray) => {
618
+ let outArray = [];
619
+
620
+ pkgs.forEach((p) => {
621
+ const pkgIdx = inArray.findIndex(item => item.name === p);
622
+ if (pkgIdx === -1) {
623
+ outArray.push(p);
624
+ }
625
+ });
626
+
627
+ return outArray;
628
+ }
629
+
630
+ const addPackages = (inArray, pkgsToAdd) => {
631
+ const outArray = inArray;
632
+ pkgsToAdd.forEach((p) => {
633
+ outArray.push({
634
+ name: p,
635
+ version: null,
636
+ date: require('moment')(new Date()).format("YYYYMMDD-HH:mm"),
637
+ status: 'INITIALIZED',
638
+ npmPkg: null
639
+ });
640
+ })
641
+
642
+ return outArray;
643
+ }
644
+
645
+ console.log('processing packages');
646
+ let packagesToAdd = [] = getMissingPackages(packages);
647
+ let packagesLatestTagToAdd = [] = getMissingPackages(packagesLatestTag);
648
+ let packagesNextTagToAdd = [] = getMissingPackages(packagesNextTag);
649
+ let packagesPrevTagToAdd = [] = getMissingPackages(packagesPrevTag);
650
+ let packagesPrevSnapshotsTagToAdd = [] = getMissingPackages(packagesPrevSnapshotsTag);
651
+
652
+ console.log(packagesToAdd.length);
653
+ console.log(packagesLatestTagToAdd.length);
654
+ console.log(packagesNextTagToAdd.length);
655
+ console.log(packagesPrevTagToAdd.length);
656
+ console.log(packagesPrevSnapshotsTagToAdd.length);
657
+
658
+ console.log(`packages before : ${packages.length}`);
659
+ packages = addPackages(packages, packagesToAdd);
660
+ console.log(`packages after : ${packages.length}`);
661
+
662
+ console.log(`packages before : ${packagesLatestTag.length}`);
663
+ packagesLatestTag = addPackages(packagesLatestTag, packagesLatestTagToAdd);
664
+ console.log(`packages after : ${packagesLatestTag.length}`);
665
+
666
+ console.log(`packages before : ${packagesNextTag.length}`);
667
+ packagesNextTag = addPackages(packagesNextTag, packagesNextTagToAdd);
668
+ console.log(`packages after : ${packagesNextTag.length}`);
669
+
670
+ console.log(`packages before : ${packagesPrevTag.length}`);
671
+ packagesPrevTag = addPackages(packagesPrevTag, packagesPrevTagToAdd);
672
+ console.log(`packages after : ${packagesPrevTag.length}`);
673
+
674
+ console.log(`packages before : ${packagesPrevSnapshotsTag.length}`);
675
+ packagesPrevSnapshotsTag = addPackages(packagesPrevSnapshotsTag, packagesPrevSnapshotsTagToAdd);
676
+ console.log(`packages after : ${packagesPrevSnapshotsTag.length}`);
677
+
678
+ metadata.packages = packages;
679
+ metadata.packagesLatestTag = packagesLatestTag;
680
+ metadata.packagesPrevTag = packagesPrevTag;
681
+ metadata.packagesNextTag = packagesNextTag;
682
+ metadata.packagesPrevSnapshotsTag = packagesPrevSnapshotsTag;
683
+
684
+ if (!dryRun) {
685
+ tools.writeJsonFileSync(metadataFile, metadata);
686
+ } else {
687
+ tools.logInfo(`Write metadata on ${metadataFile}`);
688
+ }
689
+ })
690
+
691
+ .catch((e) => {
692
+ throw e;
693
+ })
694
+ }
@@ -16,10 +16,10 @@ module.exports.sync = () => {
16
16
  tools.logInfo('Resetting package.json');
17
17
  return tools.copy(path.join(process.cwd(), '.csdr', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
18
18
  })
19
- // .then(() => {
20
- // tools.logInfo('Removing yarn.lock');
21
- // return tools.remove(path.join(process.cwd(), 'yarn.lock'));
22
- // })
19
+ .then(() => {
20
+ tools.logInfo('Removing yarn.lock');
21
+ return tools.remove(path.join(process.cwd(), 'yarn.lock'));
22
+ })
23
23
  .then(() => {
24
24
  tools.logSuccess();
25
25
  })
@@ -88,10 +88,11 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
88
88
  if (!skipLint) {
89
89
  tools.logSuccess();
90
90
  }
91
- if (!skipLint) {
92
- tools.logInfo(`Styles Linting application...`);
93
- return tools.runScript(`stylelint **/*.scss`, currentProject.paths.angularPath);
94
- }
91
+ // temporary disable for v13 apps
92
+ // if (!skipLint) {
93
+ // tools.logInfo(`Styles Linting application...`);
94
+ // return tools.runScript(`stylelint **/*.scss`, currentProject.paths.angularPath);
95
+ // }
95
96
  })
96
97
 
97
98
 
@@ -252,16 +252,35 @@ module.exports.remapRoutesByEnvConfig = (project, envTarget, build) => {
252
252
  return;
253
253
  }
254
254
 
255
- // get routes file content and replace tokens
256
255
  let routesFileContent = tools.getFileContent(routesFilePath);
256
+
257
+ // get routes file content and replace tokens
257
258
  routesRemapping.forEach((route) => {
258
259
  tools.logInfo(`checking replacement for : ${JSON.stringify(route)}`);
259
260
  const tokenToSearch = `./features/${route.featureModule}-lib.module#Module`;
260
261
  if (routesFileContent.indexOf(tokenToSearch) > -1) {
261
- tools.logInfo(`token ${tokenToSearch} found...replacing`);
262
+ tools.logInfo(`token ${tokenToSearch} found...replacing by ${route.routeModuleDef}`);
262
263
  routesFileContent = tools.replaceAll(routesFileContent, tokenToSearch, route.routeModuleDef);
263
264
  }
264
265
  })
266
+
267
+ // extra physical routes remapping
268
+ const extraRoutesRemapping = config.extraRoutesRemapping;
269
+ if (!extraRoutesRemapping) {
270
+ tools.logWarning('No extra routes remapping found in current config...skipping');
271
+
272
+ } else {
273
+ tools.logInfo('Extra routes remapping');
274
+ extraRoutesRemapping.forEach((route) => {
275
+ tools.logInfo(`checking replacement ${JSON.stringify(route)}`);
276
+ const tokenToSearch = route.currentRoute;
277
+ if (routesFileContent.indexOf(tokenToSearch) > -1) {
278
+ tools.logInfo(`token ${tokenToSearch} found...replacing by ${route.updatedRoute}`);
279
+ routesFileContent = tools.replaceAll(routesFileContent, tokenToSearch, route.updatedRoute);
280
+ }
281
+ })
282
+ }
283
+
265
284
  return tools.writeFileContent(routesFilePath, routesFileContent);
266
285
  })
267
286
  .then(() => {