@eui/tools 4.19.19 → 4.21.1

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 (29) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +27 -0
  3. package/package.json +1 -1
  4. package/sandbox.js +20 -4
  5. package/scripts/csdr/config/angular.js +287 -0
  6. package/scripts/csdr/config/global.js +8 -0
  7. package/scripts/csdr/init/resources/14.x/browserslistrc +6 -0
  8. package/scripts/csdr/init/resources/14.x/resolutions.json +5 -0
  9. package/scripts/csdr/metadata/common.js +21 -0
  10. package/scripts/csdr/metadata/package.js +7 -46
  11. package/scripts/csdr/release/package/common.js +8 -3
  12. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/app.module.ts +52 -0
  13. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/app/core/reducers/index.ts +40 -0
  14. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/global.ts +4 -0
  15. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/index.ts +8 -0
  16. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/config/modules.ts +4 -0
  17. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.dev.ts +9 -0
  18. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.prod.ts +9 -0
  19. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/environments/environment.ts +21 -0
  20. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/favicon.ico +0 -0
  21. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/karma.conf.js +7 -0
  22. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/main.ts +21 -0
  23. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/polyfills.ts +86 -0
  24. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/src/_generated/tst.ts +33 -0
  25. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.app.json +19 -0
  26. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tsconfig.spec.json +9 -0
  27. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui14/tslint.json +17 -0
  28. package/scripts/utils/pre-build/injection/skeletons.js +3 -1
  29. package/scripts/utils/pre-build/projects.js +2 -0
@@ -1 +1 @@
1
- 4.19.19
1
+ 4.21.1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 4.21.1 (2022-03-17)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * disable remove of yarn.lock for pkg build - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([17326a12](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/17326a1248ed34d4fe85e63e9a881fc4924e916a))
7
+
8
+ * * *
9
+ * * *
10
+ ## 4.21.0 (2022-03-15)
11
+
12
+ ##### New Features
13
+
14
+ * **other:**
15
+ * adapted for eUI14 csdr injections - EUI-5739 [EUI-5739](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5739) ([e7e2db68](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/e7e2db689931ef9783e27b64313b3661bf7c05ec))
16
+
17
+ * * *
18
+ * * *
19
+ ## 4.20.0 (2022-03-14)
20
+
21
+ ##### New Features
22
+
23
+ * **other:**
24
+ * split devops-metadata and devops-metadata-locks usage to split commit - race conditions - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([ffc3871b](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/ffc3871b107cb1a9e23d8172e78d89e76a039de0))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 4.19.19 (2022-03-10)
2
29
 
3
30
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "4.19.19",
3
+ "version": "4.21.1",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -680,10 +680,26 @@ const translationUtils = require('./scripts/utils/pre-build/translations/transla
680
680
  // );
681
681
  // })
682
682
 
683
+ // return Promise.resolve()
684
+ // .then(() => {
685
+ // const prjName = 'my-workplace';
686
+ // const prj = configUtils.projects.getCsdrProject(prjName);
687
+
688
+ // return compositeUtils.getDeps(prj, 'DEV');
689
+ // })
690
+
691
+ // return Promise.resolve()
692
+ // .then(() => {
693
+ // const configOptions = configUtils.global.getConfigOptions();
694
+ // console.log(configOptions);
695
+ // })
696
+
683
697
  return Promise.resolve()
684
698
  .then(() => {
685
- const prjName = 'my-workplace';
686
- const prj = configUtils.projects.getCsdrProject(prjName);
687
-
688
- return compositeUtils.getDeps(prj, 'DEV');
699
+ const fileContent = tools.getJsonFileContent(path.join(process.cwd(), 'packages', 'devops-metadata', 'cc-task-centre-eui10-remote-el-ui-versions-metadata.json'));
700
+ let out = '';
701
+ const versions = fileContent.versions.filter(v => v.duration !== undefined).map((v) => {
702
+ out += `${v.date.substring(0,8)},${v.duration/1000}\n`;
703
+ })
704
+ tools.writeFileContent(path.join(process.cwd(), 'extract.txt'), out);
689
705
  })
@@ -344,6 +344,130 @@ const angularProjectDefV13 = {
344
344
  }
345
345
  };
346
346
 
347
+
348
+ const angularProjectDefV14 = {
349
+ "root": "",
350
+ "sourceRoot": "apps/@project.name@/src",
351
+ "projectType": "application",
352
+ "prefix": "app",
353
+ "schematics": {
354
+ "@schematics/angular:component": {
355
+ "style": "scss"
356
+ },
357
+ "@schematics/angular:application": {
358
+ "strict": true
359
+ }
360
+ },
361
+ "architect": {
362
+ "build": {
363
+ "builder": "@angular-devkit/build-angular:browser",
364
+ "options": {
365
+ "outputPath": "apps/@project.name@/dist",
366
+ "index": "apps/@project.name@/src/index.html",
367
+ "main": "apps/@project.name@/src/main.ts",
368
+ "polyfills": "apps/@project.name@/src/polyfills.ts",
369
+ "tsConfig": "apps/@project.name@/tsconfig.app.json",
370
+ "assets": [
371
+ "apps/@project.name@/src/favicon.ico",
372
+ "apps/@project.name@/src/assets",
373
+ {
374
+ "glob": "**/*",
375
+ "input": "node_modules/@eui/core/assets/",
376
+ "output": "./assets"
377
+ }
378
+ ],
379
+ "styles": [
380
+ ]
381
+ },
382
+ "configurations": {
383
+ "production": {
384
+ "fileReplacements": [
385
+ {
386
+ "replace": "apps/@project.name@/src/environments/environment.ts",
387
+ "with": "apps/@project.name@/src/environments/environment.prod.ts"
388
+ }
389
+ ],
390
+ "optimization": false,
391
+ "outputHashing": "all",
392
+ "sourceMap": false,
393
+ "namedChunks": true,
394
+ "aot": true,
395
+ "extractLicenses": true,
396
+ "vendorChunk": false,
397
+ "buildOptimizer": false,
398
+ "budgets": [
399
+ {
400
+ "type": "initial",
401
+ "maximumWarning": "2mb",
402
+ "maximumError": "6mb"
403
+ }
404
+ ]
405
+ },
406
+ "production-optimized": {
407
+ "fileReplacements": [
408
+ {
409
+ "replace": "apps/@project.name@/src/environments/environment.ts",
410
+ "with": "apps/@project.name@/src/environments/environment.prod.ts"
411
+ }
412
+ ],
413
+ "optimization": {
414
+ "scripts": true,
415
+ "styles": {
416
+ "minify": false,
417
+ "inlineCritical": true
418
+ },
419
+ "fonts": true
420
+ },
421
+ "outputHashing": "all",
422
+ "sourceMap": false,
423
+ "namedChunks": true,
424
+ "aot": true,
425
+ "extractLicenses": true,
426
+ "vendorChunk": false,
427
+ "buildOptimizer": true,
428
+ "budgets": [
429
+ {
430
+ "type": "initial",
431
+ "maximumWarning": "2mb",
432
+ "maximumError": "6mb"
433
+ }
434
+ ]
435
+ },
436
+ "development": {
437
+ "buildOptimizer": false,
438
+ "optimization": false,
439
+ "vendorChunk": true,
440
+ "extractLicenses": false,
441
+ "sourceMap": true,
442
+ "namedChunks": true
443
+ }
444
+ },
445
+ "defaultConfiguration": "production"
446
+ },
447
+ "serve": {
448
+ "builder": "@angular-devkit/build-angular:dev-server",
449
+ "options": {
450
+ "browserTarget": "@project.name@:build"
451
+ },
452
+ "configurations": {
453
+ "proxy-mock": {
454
+ "browserTarget": "@project.name@:build",
455
+ "proxyConfig": "apps/@project.name@/proxy-mock.conf.json"
456
+ },
457
+ "production": {
458
+ "browserTarget": "@project.name@:build:production"
459
+ },
460
+ "development": {
461
+ "browserTarget": "@project.name@:build:development"
462
+ }
463
+ },
464
+ "defaultConfiguration": "development"
465
+ }
466
+ }
467
+ };
468
+
469
+
470
+
347
471
  const angularProjectLightDef = {
348
472
  "root": "",
349
473
  "sourceRoot": "apps/@project.name@/src",
@@ -679,6 +803,129 @@ const angularProjectDefFullSkeletonV13 = {
679
803
  }
680
804
  };
681
805
 
806
+ const angularProjectDefFullSkeletonV14 = {
807
+ "root": "",
808
+ "sourceRoot": "apps/@project.name@/src",
809
+ "projectType": "application",
810
+ "prefix": "app",
811
+ "schematics": {
812
+ "@schematics/angular:component": {
813
+ "style": "scss"
814
+ },
815
+ "@schematics/angular:application": {
816
+ "strict": true
817
+ }
818
+ },
819
+ "architect": {
820
+ "build": {
821
+ "builder": "@angular-devkit/build-angular:browser",
822
+ "options": {
823
+ "outputPath": "apps/@project.name@/dist",
824
+ "index": "apps/@project.name@/src/index.html",
825
+ "main": "apps/@project.name@/src/_generated/main.ts",
826
+ "polyfills": "apps/@project.name@/src/_generated/polyfills.ts",
827
+ "tsConfig": "apps/@project.name@/tsconfig.app.json",
828
+ "assets": [
829
+ "apps/@project.name@/src/favicon.ico",
830
+ "apps/@project.name@/src/assets",
831
+ {
832
+ "glob": "**/*",
833
+ "input": "node_modules/@eui/core/assets/",
834
+ "output": "./assets"
835
+ }
836
+ ],
837
+ "styles": [
838
+ ]
839
+ },
840
+ "configurations": {
841
+ "production": {
842
+ "fileReplacements": [
843
+ {
844
+ "replace": "apps/@project.name@/src/_generated/environments/environment.ts",
845
+ "with": "apps/@project.name@/src/_generated/environments/environment.prod.ts"
846
+ }
847
+ ],
848
+ "optimization": false,
849
+ "outputHashing": "all",
850
+ "sourceMap": false,
851
+ "namedChunks": true,
852
+ "aot": true,
853
+ "extractLicenses": true,
854
+ "vendorChunk": false,
855
+ "buildOptimizer": false,
856
+ "budgets": [
857
+ {
858
+ "type": "initial",
859
+ "maximumWarning": "2mb",
860
+ "maximumError": "6mb"
861
+ }
862
+ ]
863
+ },
864
+ "production-optimized-no-openid": {
865
+ "fileReplacements": [
866
+ {
867
+ "replace": "apps/@project.name@/src/_generated/environments/environment.ts",
868
+ "with": "apps/@project.name@/src/_generated/environments/environment.prod.ts"
869
+ }
870
+ ],
871
+ "optimization": {
872
+ "scripts": true,
873
+ "styles": {
874
+ "minify": false,
875
+ "inlineCritical": true
876
+ },
877
+ "fonts": true
878
+ },
879
+ "outputHashing": "all",
880
+ "sourceMap": false,
881
+ "namedChunks": true,
882
+ "aot": true,
883
+ "extractLicenses": true,
884
+ "vendorChunk": false,
885
+ "buildOptimizer": true,
886
+ "budgets": [
887
+ {
888
+ "type": "initial",
889
+ "maximumWarning": "2mb",
890
+ "maximumError": "6mb"
891
+ }
892
+ ]
893
+ },
894
+ "development": {
895
+ "buildOptimizer": false,
896
+ "optimization": false,
897
+ "vendorChunk": true,
898
+ "extractLicenses": false,
899
+ "sourceMap": true,
900
+ "namedChunks": true
901
+ }
902
+ },
903
+ "defaultConfiguration": "production"
904
+ },
905
+ "serve": {
906
+ "builder": "@angular-devkit/build-angular:dev-server",
907
+ "options": {
908
+ "browserTarget": "@project.name@:build"
909
+ },
910
+ "configurations": {
911
+ "proxy-mock": {
912
+ "browserTarget": "@project.name@:build",
913
+ "proxyConfig": "apps/@project.name@/proxy-mock.conf.json"
914
+ },
915
+ "production": {
916
+ "browserTarget": "@project.name@:build:production"
917
+ },
918
+ "development": {
919
+ "browserTarget": "@project.name@:build:development"
920
+ }
921
+ },
922
+ "defaultConfiguration": "development"
923
+ }
924
+ }
925
+ };
926
+
927
+
928
+
682
929
 
683
930
 
684
931
  const angularProjectDefConfiguration = {
@@ -829,6 +1076,38 @@ const angularPackageDefV13 = {
829
1076
  };
830
1077
 
831
1078
 
1079
+ const angularPackageDefV14 = {
1080
+ "root": "@path@/@module.name@",
1081
+ "sourceRoot": "@path@/@module.name@@srcRoot@",
1082
+ "projectType": "library",
1083
+ "prefix": "lib",
1084
+ "architect": {
1085
+ "build": {
1086
+ "builder": "@angular-devkit/build-angular:ng-packagr",
1087
+ "options": {
1088
+ "tsConfig": "@path@/@module.name@/tsconfig.lib.json",
1089
+ "project": "@path@/@module.name@/ng-package.json"
1090
+ },
1091
+ "configurations": {
1092
+ "production": {
1093
+ "tsConfig": "@path@/@module.name@/tsconfig.lib.prod.json"
1094
+ }
1095
+ }
1096
+ },
1097
+ "test": {
1098
+ "builder": "@angular-devkit/build-angular:karma",
1099
+ "options": {
1100
+ "main": "@path@/@module.name@@srcRoot@@srcRootTesting@/test.ts",
1101
+ "tsConfig": "@path@/@module.name@/tsconfig.spec.json",
1102
+ "karmaConfig": "@path@/@module.name@/karma.conf.js"
1103
+ }
1104
+ }
1105
+ }
1106
+ };
1107
+
1108
+
1109
+
1110
+
832
1111
  const angularElementProjectDef = {
833
1112
  "root": "@module.name@/",
834
1113
  "sourceRoot": "@module.name@/src",
@@ -973,6 +1252,10 @@ module.exports.registerAngularPackage = (pkg, isReset) => {
973
1252
  if (pkg.build && pkg.build.euiVersion === '13.x') {
974
1253
  projectDef = JSON.stringify(angularPackageDefV13);
975
1254
  }
1255
+ if (pkg.build && pkg.build.euiVersion === '14.x') {
1256
+ projectDef = JSON.stringify(angularPackageDefV14);
1257
+ }
1258
+
976
1259
 
977
1260
  let srcRoot = '/src', srcRootTesting = '';
978
1261
  if (pkg.build && typeof pkg.build.srcRootDefault === 'boolean' && pkg.build.srcRootDefault === false) {
@@ -1043,6 +1326,8 @@ module.exports.registerAngularProjectDef = (project, build = false) => {
1043
1326
  if (project.csdrFullSkeleton) {
1044
1327
  if (project.build && project.build.euiVersion === '13.x') {
1045
1328
  projectDef = JSON.stringify(angularProjectDefFullSkeletonV13);
1329
+ } else if (project.build && project.build.euiVersion === '14.x') {
1330
+ projectDef = JSON.stringify(angularProjectDefFullSkeletonV14);
1046
1331
  } else {
1047
1332
  projectDef = JSON.stringify(angularProjectDefFullSkeleton);
1048
1333
  }
@@ -1050,6 +1335,8 @@ module.exports.registerAngularProjectDef = (project, build = false) => {
1050
1335
  } else {
1051
1336
  if (project.build && project.build.euiVersion === '13.x') {
1052
1337
  projectDef = JSON.stringify(angularProjectDefV13);
1338
+ } else if (project.build && project.build.euiVersion === '14.x') {
1339
+ projectDef = JSON.stringify(angularProjectDefV14);
1053
1340
  } else {
1054
1341
  if (project.build && project.build.csdrFileReplacement === true) {
1055
1342
  projectDef = JSON.stringify(angularProjectLightDef);
@@ -210,7 +210,9 @@ module.exports.getConfigOptions = () => {
210
210
 
211
211
  let configOptions = {
212
212
  DEVOPS_METADATA_REPOSITORY: null,
213
+ DEVOPS_METADATA_LOCKS_REPOSITORY: null,
213
214
  DEVOPS_METADATA_PATH: null,
215
+ DEVOPS_METADATA_LOCKS_PATH: null,
214
216
  DEVOPS_METADATA_JSON: '.devops-metadata.json',
215
217
  DEVOPS_CONFIG_JSON: '.devops-config.json',
216
218
  ISSUES_MANAGER_HOST: null,
@@ -234,6 +236,12 @@ module.exports.getConfigOptions = () => {
234
236
  if (devopsMetadata.folder) {
235
237
  configOptions.DEVOPS_METADATA_PATH = path.join(process.cwd(), devopsMetadata.folder);
236
238
  }
239
+ if (devopsMetadata.locksRepository) {
240
+ configOptions.DEVOPS_METADATA_LOCKS_REPOSITORY = devopsMetadata.locksRepository;
241
+ }
242
+ if (devopsMetadata.locksFolder) {
243
+ configOptions.DEVOPS_METADATA_LOCKS_PATH = path.join(process.cwd(), devopsMetadata.locksFolder);
244
+ }
237
245
  }
238
246
 
239
247
  // getting issues manager options
@@ -0,0 +1,6 @@
1
+ last 1 Chrome version
2
+ last 1 Firefox version
3
+ last 2 Edge major versions
4
+ last 2 Safari major versions
5
+ last 2 iOS major versions
6
+ Firefox ESR
@@ -0,0 +1,5 @@
1
+ {
2
+ "@types/node": ">=14.14.10",
3
+ "https-proxy-agent": ">=2.2.3",
4
+ "mem": ">=4.3.0 <=8.1.1"
5
+ }
@@ -37,6 +37,27 @@ module.exports.cloneMetadataRepo = () => {
37
37
  }
38
38
 
39
39
 
40
+ module.exports.cloneMetadataLocksRepo = () => {
41
+ const configOptions = configUtils.global.getConfigOptions();
42
+
43
+ tools.logTitle('Cloning devops metadata locks repo');
44
+
45
+ if (dryRun || skipClone) {
46
+ tools.logInfo('DRY-RUN: cloning skipped');
47
+ return Promise.resolve();
48
+
49
+ } else {
50
+ return Promise.resolve()
51
+ .then(() => {
52
+ return gitUtils.cloneRepo(configOptions.DEVOPS_METADATA_LOCKS_REPOSITORY, configOptions.DEVOPS_METADATA_LOCKS_PATH, false, true);
53
+ })
54
+ .catch((e) => {
55
+ throw e;
56
+ })
57
+ }
58
+ }
59
+
60
+
40
61
  module.exports.getDevopsMetadata = () => {
41
62
  const configOptions = configUtils.global.getConfigOptions();
42
63
  const DEVOPS_METADATA_PATH = configOptions.DEVOPS_METADATA_PATH;
@@ -480,48 +480,9 @@ module.exports.getLastMajorVersion = (pkg, major, isMaster) => {
480
480
  }
481
481
  }
482
482
 
483
- module.exports.devopsMetadataToTable = (metadata) => {
484
- tools.logTitle('Generating table from metadata...');
485
-
486
- var content = '';
487
-
488
- content += '<h3>Latest packages status</h3>';
489
- content += '<table><thead><tr>';
490
- content += '<th>PACKAGE</th>';
491
- content += '<th>VERSION</th>';
492
- content += '<th>DATE</th>';
493
- content += '<th>STATUS</th>';
494
- content += '</tr></thead>';
495
- content += '<tbody>';
496
- tools.sortArray(metadata.packages, 'name').forEach((item) => {
497
- content += '<tr>';
498
- content += `<td>${item.name}</td><td>${item.version}</td><td>${item.date}</td><td>${item.status}</td>`
499
- content += '</tr>';
500
- })
501
- content += '</tbody>';
502
- content += '</table>';
503
-
504
- if (metadata.packagesLatestTag && metadata.packagesLatestTag.length !== 0) {
505
- content += '<h3>Latest package tags</h3>';
506
- content += '<table><thead><tr>';
507
- content += '<th>PACKAGE</th>';
508
- content += '<th>VERSION</th>';
509
- content += '<th>DATE</th>';
510
- // content+= '<th>STATUS</th>';
511
- content += '</tr></thead>';
512
- content += '<tbody>';
513
- tools.sortArray(metadata.packagesLatestTag, 'name').forEach((item) => {
514
- content += '<tr>';
515
- content += `<td>${item.name}</td><td>${item.version}</td><td>${item.date}</td>`
516
- content += '</tr>';
517
- })
518
- content += '</tbody>';
519
- content += '</table>';
520
- }
521
483
 
522
- tools.logSuccess();
523
- return content;
524
- }
484
+
485
+
525
486
 
526
487
 
527
488
 
@@ -532,7 +493,7 @@ module.exports.lockPackage = (pkg) => {
532
493
  .then(() => {
533
494
 
534
495
  const configOptions = configUtils.global.getConfigOptions();
535
- const pkgLockFile = path.join(configOptions.DEVOPS_METADATA_PATH, `${pkg.name}-lock.json`);
496
+ const pkgLockFile = path.join(configOptions.DEVOPS_METADATA_LOCKS_PATH, `${pkg.name}-lock.json`);
536
497
 
537
498
  const lockContent = {
538
499
  locked: true,
@@ -546,7 +507,7 @@ module.exports.lockPackage = (pkg) => {
546
507
  return gitUtils.commitAndPush(
547
508
  'master',
548
509
  `chore: locking ${pkg.name}`,
549
- configOptions.DEVOPS_METADATA_PATH
510
+ configOptions.DEVOPS_METADATA_LOCKS_PATH
550
511
  );
551
512
  }
552
513
  })
@@ -565,7 +526,7 @@ module.exports.unlockPackage = (pkg) => {
565
526
  .then(() => {
566
527
 
567
528
  const configOptions = configUtils.global.getConfigOptions();
568
- const pkgLockFile = path.join(configOptions.DEVOPS_METADATA_PATH, `${pkg.name}-lock.json`);
529
+ const pkgLockFile = path.join(configOptions.DEVOPS_METADATA_LOCKS_PATH, `${pkg.name}-lock.json`);
569
530
 
570
531
  tools.remove(pkgLockFile);
571
532
 
@@ -574,7 +535,7 @@ module.exports.unlockPackage = (pkg) => {
574
535
  return gitUtils.commitAndPush(
575
536
  'master',
576
537
  `chore: unlocking ${pkg.name}`,
577
- configOptions.DEVOPS_METADATA_PATH
538
+ configOptions.DEVOPS_METADATA_LOCKS_PATH
578
539
  );
579
540
  }
580
541
  })
@@ -587,7 +548,7 @@ module.exports.unlockPackage = (pkg) => {
587
548
 
588
549
  module.exports.isPackageLocked = (pkg) => {
589
550
  const configOptions = configUtils.global.getConfigOptions();
590
- const pkgLockFile = path.join(configOptions.DEVOPS_METADATA_PATH, `${pkg.name}-lock.json`);
551
+ const pkgLockFile = path.join(configOptions.DEVOPS_METADATA_LOCKS_PATH, `${pkg.name}-lock.json`);
591
552
 
592
553
  if (dryRun) return false;
593
554
 
@@ -82,12 +82,17 @@ module.exports.init = (pkg) => {
82
82
  return metadataUtils.common.cloneMetadataRepo();
83
83
  })
84
84
 
85
- // REMOVE YARN.LOCK
85
+ // CLONE METADATA LOCKS REPO
86
86
  .then(() => {
87
- utils.tools.logInfo('Removing yarn.lock');
88
- return utils.tools.remove(path.join(process.cwd(), 'yarn.lock'));
87
+ return metadataUtils.common.cloneMetadataLocksRepo();
89
88
  })
90
89
 
90
+ // REMOVE YARN.LOCK
91
+ // .then(() => {
92
+ // utils.tools.logInfo('Removing yarn.lock');
93
+ // return utils.tools.remove(path.join(process.cwd(), 'yarn.lock'));
94
+ // })
95
+
91
96
  .catch((e) => {
92
97
  throw e;
93
98
  })
@@ -0,0 +1,52 @@
1
+ // ANGULAR & 3rd PARTIES
2
+ import { NgModule } from '@angular/core';
3
+ import { BrowserModule } from '@angular/platform-browser';
4
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
5
+ import { HttpClientModule } from '@angular/common/http';
6
+ import { StoreModule } from '@ngrx/store';
7
+ import { EffectsModule } from '@ngrx/effects';
8
+ import { StoreDevtoolsModule } from '@ngrx/store-devtools';
9
+ import { TranslateModule } from '@ngx-translate/core';
10
+
11
+ // eUI IMPORTS
12
+ import {
13
+ CoreModule, CoreModuleEffects, translateConfig, EUI_CONFIG_TOKEN,
14
+ } from '@eui/core';
15
+ import { EuiAllModule } from '@eui/components';
16
+
17
+ import { appConfig } from '../config/index';
18
+ import { environment } from '../environments/environment';
19
+
20
+ // APP ROUTES & ROOT COMPONENTS
21
+ import { AppRoutingModule } from '../../app/app-routing.module';
22
+ import { AppComponent } from '../../app/app.component';
23
+
24
+ import { TOKEN, reducerProvider, metaReducers } from './core/reducers/index';
25
+
26
+ // APP ROOT MODULE
27
+ @NgModule({
28
+ imports: [
29
+ BrowserModule,
30
+ BrowserAnimationsModule,
31
+ HttpClientModule,
32
+ StoreModule.forRoot(TOKEN, { metaReducers }),
33
+ StoreDevtoolsModule.instrument({ name: 'CSDR App', maxAge: 150, logOnly: environment.production }),
34
+ EffectsModule.forRoot([...CoreModuleEffects]),
35
+ TranslateModule.forRoot(translateConfig),
36
+ CoreModule.forRoot(),
37
+ AppRoutingModule,
38
+ EuiAllModule,
39
+ ],
40
+ declarations: [
41
+ AppComponent,
42
+ ],
43
+ providers: [
44
+ { provide: EUI_CONFIG_TOKEN, useValue: { appConfig: appConfig, environment: environment } },
45
+ reducerProvider,
46
+ ],
47
+ bootstrap: [
48
+ AppComponent,
49
+ ],
50
+ })
51
+ export class AppModule {
52
+ }
@@ -0,0 +1,40 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ActionReducer, ActionReducerMap, combineReducers, MetaReducer } from '@ngrx/store';
3
+ import * as fromRouter from '@ngrx/router-store';
4
+ import { storeFreeze } from 'ngrx-store-freeze';
5
+ import { reducers as coreReducers, CoreState, localStorageSync } from '@eui/core';
6
+
7
+ export interface AppState extends CoreState {
8
+ router: fromRouter.RouterReducerState<any>;
9
+ }
10
+
11
+ // -----------------
12
+ // ------------ AOT
13
+ export const TOKEN = new InjectionToken<any>('AppReducers');
14
+
15
+ export function getReducers(): ActionReducerMap<AppState, any> {
16
+ return {
17
+ router: fromRouter.routerReducer,
18
+ ...coreReducers,
19
+ };
20
+ }
21
+
22
+ export const reducerProvider = [
23
+ { provide: TOKEN, useFactory: getReducers },
24
+ ];
25
+
26
+ // console.log all actions
27
+ export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
28
+ return (state, action) => {
29
+ const result = reducer(state, action);
30
+ console.groupCollapsed(action.type);
31
+ console.log('prev state', state);
32
+ console.log('action', action);
33
+ console.log('next state', result);
34
+ console.groupEnd();
35
+
36
+ return result;
37
+ };
38
+ }
39
+
40
+ export const metaReducers: MetaReducer<AppState>[] = [logger, localStorageSync, storeFreeze];
@@ -0,0 +1,4 @@
1
+ import { GlobalConfig } from '@eui/core';
2
+
3
+ export const GLOBAL: GlobalConfig = {
4
+ };
@@ -0,0 +1,8 @@
1
+ import { EuiAppConfig } from '@eui/core';
2
+ import { GLOBAL } from './global';
3
+ import { MODULES } from './modules';
4
+
5
+ export const appConfig: EuiAppConfig = {
6
+ global: GLOBAL,
7
+ modules: MODULES,
8
+ };
@@ -0,0 +1,4 @@
1
+ import { ModulesConfig } from '@eui/core';
2
+
3
+ export const MODULES: ModulesConfig = {
4
+ };
@@ -0,0 +1,9 @@
1
+ // activated by running :
2
+ // npm run build -- --configuration=dev
3
+ // OR
4
+ // npm run build-dev
5
+
6
+ export const environment = {
7
+ production: false,
8
+ enableDevToolRedux: true,
9
+ };
@@ -0,0 +1,9 @@
1
+ import { EuiEnvConfig } from '@eui/core';
2
+
3
+ export const environment: EuiEnvConfig = {
4
+ production: true,
5
+ enableDevToolRedux: false,
6
+ envDynamicConfig: {
7
+ uri: 'assets/config/env-json-config.json',
8
+ },
9
+ };
@@ -0,0 +1,21 @@
1
+ // used by serve / when no configuration is provided on the build script
2
+ // run npm run build
3
+
4
+ import { EuiEnvConfig } from '@eui/core';
5
+
6
+ export const environment: EuiEnvConfig = {
7
+ production: false,
8
+ enableDevToolRedux: true,
9
+ envDynamicConfig: {
10
+ uri: 'assets/config/env-json-config.json',
11
+ },
12
+ };
13
+
14
+ /*
15
+ * For easier debugging in development mode, you can import the following file
16
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
17
+ *
18
+ * This import should be commented out in production mode because it will have a negative impact
19
+ * on performance if an error is thrown.
20
+ */
21
+ // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
@@ -0,0 +1,7 @@
1
+ const karmaConfig = require('@eui/tools/karma/karma.conf');
2
+
3
+ module.exports = function (config) {
4
+ config.set(
5
+ karmaConfig.get(config)
6
+ );
7
+ }
@@ -0,0 +1,21 @@
1
+ import { enableProdMode } from '@angular/core';
2
+ import { preInitApp } from '@eui/core';
3
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4
+
5
+ import { AppModule } from './app/app.module';
6
+ import { environment } from './environments/environment';
7
+ import { ApplicationRef } from '@angular/core';
8
+ import { enableDebugTools } from '@angular/platform-browser';
9
+
10
+ if (environment.production) {
11
+ enableProdMode();
12
+ }
13
+ preInitApp(environment).then(() => {
14
+ platformBrowserDynamic().bootstrapModule(AppModule)
15
+ .then(moduleRef => {
16
+ const applicationRef = moduleRef.injector.get(ApplicationRef);
17
+ const componentRef = applicationRef.components[0];
18
+ enableDebugTools(componentRef);
19
+ })
20
+ .catch(err => console.log(err));
21
+ });
@@ -0,0 +1,86 @@
1
+ /**
2
+ * This file includes polyfills needed by Angular and is loaded before the app.
3
+ * You can add your own extra polyfills to this file.
4
+ *
5
+ * This file is divided into 2 sections:
6
+ * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
+ * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
+ * file.
9
+ *
10
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
+ *
14
+ * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15
+ */
16
+
17
+ /***************************************************************************************************
18
+ * BROWSER POLYFILLS
19
+ */
20
+
21
+ /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22
+ // import 'core-js/es6/symbol';
23
+ // import 'core-js/es6/object';
24
+ // import 'core-js/es6/function';
25
+ // import 'core-js/es6/parse-int';
26
+ // import 'core-js/es6/parse-float';
27
+ // import 'core-js/es6/number';
28
+ // import 'core-js/es6/math';
29
+ // import 'core-js/es6/string';
30
+ // import 'core-js/es6/date';
31
+ // import 'core-js/es6/array';
32
+ // import 'core-js/es6/regexp';
33
+ // import 'core-js/es6/map';
34
+ // import 'core-js/es6/weak-map';
35
+ // import 'core-js/es6/set';
36
+
37
+ /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38
+ // import 'classlist.js'; // Run `npm install --save classlist.js`.
39
+
40
+ /** IE10 and IE11 requires the following for the Reflect API. */
41
+ // import 'core-js/es6/reflect';
42
+
43
+ /** Evergreen browsers require these. **/
44
+ // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
45
+ // import 'core-js/es7/reflect';
46
+
47
+ /**
48
+ * Web Animations `@angular/platform-browser/animations`
49
+ * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
50
+ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
51
+ **/
52
+ // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
53
+
54
+ /**
55
+ * By default, zone.js will patch all possible macroTask and DomEvents
56
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
57
+ */
58
+
59
+ // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
60
+ // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
61
+ // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
62
+
63
+ /*
64
+ * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
65
+ * with the following flag, it will bypass `zone.js` patch for IE/Edge
66
+ */
67
+ // (window as any).__Zone_enable_cross_context_check = true;
68
+
69
+ /***************************************************************************************************
70
+ * Zone JS is required by default for Angular itself.
71
+ */
72
+ import 'zone.js/dist/zone'; // Included with Angular CLI.
73
+
74
+ /***************************************************************************************************
75
+ * APPLICATION IMPORTS
76
+ */
77
+
78
+ /**
79
+ * Date, currency, decimal and percent pipes.
80
+ * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
81
+ */
82
+ // import 'intl'; // Run `npm install --save intl`.
83
+ /**
84
+ * Need to import at least one locale-data with intl.
85
+ */
86
+ // import 'intl/locale-data/jsonp/en';
@@ -0,0 +1,33 @@
1
+ // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+ import 'zone.js/dist/long-stack-trace-zone';
4
+ import 'zone.js/dist/proxy.js';
5
+ import 'zone.js/dist/sync-test';
6
+ import 'zone.js/dist/jasmine-patch';
7
+ import 'zone.js/dist/async-test';
8
+ import 'zone.js/dist/fake-async-test';
9
+ import { APP_BASE_HREF } from '@angular/common';
10
+ import { getTestBed } from '@angular/core/testing';
11
+ import {
12
+ BrowserDynamicTestingModule,
13
+ platformBrowserDynamicTesting,
14
+ } from '@angular/platform-browser-dynamic/testing';
15
+
16
+ // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
17
+ declare const __karma__: any;
18
+ declare const require: any;
19
+
20
+ // Prevent Karma from running prematurely.
21
+ __karma__.loaded = function () {};
22
+
23
+ // First, initialize the Angular testing environment.
24
+ getTestBed().initTestEnvironment(
25
+ BrowserDynamicTestingModule,
26
+ platformBrowserDynamicTesting([{ provide: APP_BASE_HREF, useValue: '/' }]),
27
+ );
28
+ // Then we find all the tests.
29
+ const context = require.context('./', true, /\.spec\.ts$/);
30
+ // And load the modules.
31
+ context.keys().map(context);
32
+ // Finally, start Karma to run the tests.
33
+ __karma__.start();
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "types": [],
6
+ "module": "ESNext",
7
+ "target": "ES2016",
8
+ "lib": ["es2020", "dom"]
9
+ },
10
+ "exclude": [
11
+ "test.ts",
12
+ "**/*.spec.ts",
13
+ "_todo/**/*.ts",
14
+ "**/_todo/**/*.ts",
15
+ "src/assets/samples/**/*.ts",
16
+ "dist/assets/samples/**/*.ts"
17
+ ],
18
+ "include": ["**/*.ts"]
19
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "types": ["jasmine", "node"]
6
+ },
7
+ "files": ["src/test.ts", "src/polyfills.ts"],
8
+ "include": ["**/*.spec.ts", "**/*.d.ts"]
9
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tslint.json",
3
+ "rules": {
4
+ "directive-selector": [
5
+ true,
6
+ "attribute",
7
+ "app",
8
+ "camelCase"
9
+ ],
10
+ "component-selector": [
11
+ true,
12
+ "element",
13
+ "app",
14
+ "kebab-case"
15
+ ]
16
+ }
17
+ }
@@ -48,13 +48,15 @@ module.exports.injectCsdrSkeletonEuiShowcaseSources = (project) => {
48
48
 
49
49
  module.exports.injectCsdrFullSkeletonSources = (project, euiVersion) => {
50
50
 
51
- tools.logInfo(`Injecting CSDR full skeleton sources for : ${project.name}`);
51
+ tools.logInfo(`Injecting CSDR full skeleton sources for : ${project.name} - eUI version : ${euiVersion}`);
52
52
 
53
53
  return Promise.resolve()
54
54
  .then(() => {
55
55
  // copying skeleton sources
56
56
  if (euiVersion === '13.x') {
57
57
  tools.copydir(path.join(__dirname, 'app-sources-full-skeleton-eui13'), project.folder, false);
58
+ } else if (euiVersion === '14.x') {
59
+ tools.copydir(path.join(__dirname, 'app-sources-full-skeleton-eui14'), project.folder, false);
58
60
  } else {
59
61
  tools.copydir(path.join(__dirname, 'app-sources-full-skeleton'), project.folder, false);
60
62
  }
@@ -75,6 +75,8 @@ module.exports.preBuild = (project, envTarget, build, configEnvTarget) => {
75
75
  } else if (project.csdrFullSkeleton) {
76
76
  if (project.build && project.build.euiVersion === '13.x') {
77
77
  return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project, '13.x');
78
+ } else if (project.build && project.build.euiVersion === '14.x') {
79
+ return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project, '14.x');
78
80
  } else {
79
81
  return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project);
80
82
  }