@eui/tools 5.3.61 → 5.3.63

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.
package/.eslintrc.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "ignorePatterns": [
3
+ "projects/**/*"
4
+ ],
5
+ "overrides": [
6
+ {
7
+ "files": [
8
+ "*.js"
9
+ ],
10
+ "extends": "airbnb-base",
11
+ "overrides": [
12
+ ],
13
+ "parserOptions": {
14
+ "ecmaVersion": "latest",
15
+ "sourceType": "module"
16
+ },
17
+ "rules": {
18
+ "@typescript-eslint/ban-ts-comment": "off",
19
+ "@typescript-eslint/ban-types": "error",
20
+ "@typescript-eslint/consistent-type-definitions": "off",
21
+ "@typescript-eslint/dot-notation": "off",
22
+ "@typescript-eslint/explicit-member-accessibility": [
23
+ "off",
24
+ {
25
+ "accessibility": "explicit"
26
+ }
27
+ ],
28
+ "@typescript-eslint/no-require-imports": "error",
29
+ "@typescript-eslint/no-unused-vars": "off",
30
+ "@typescript-eslint/no-var-requires": "error",
31
+ "@typescript-eslint/require-await": "error",
32
+ "brace-style": [
33
+ "error",
34
+ "1tbs"
35
+ ],
36
+ "comma-dangle": [
37
+ "error",
38
+ "always-multiline"
39
+ ],
40
+ "id-blacklist": "off",
41
+ "id-match": "off",
42
+ "no-duplicate-case": "error",
43
+ "no-duplicate-imports": "off",
44
+ "no-invalid-this": "error",
45
+ "no-multiple-empty-lines": [
46
+ "error",
47
+ {
48
+ "max": 1
49
+ }
50
+ ],
51
+ "no-new-func": "error",
52
+ "no-redeclare": "off",
53
+ "@typescript-eslint/no-redeclare": [
54
+ "error"
55
+ ],
56
+ "no-template-curly-in-string": "error",
57
+ "no-underscore-dangle": "off",
58
+ "@typescript-eslint/naming-convention": [
59
+ "error",
60
+ {
61
+ "selector": "enum",
62
+ "format": [
63
+ "PascalCase",
64
+ "UPPER_CASE"
65
+ ]
66
+ }
67
+ ],
68
+ "@typescript-eslint/member-ordering": [
69
+ "error",
70
+ {
71
+ "default": [
72
+ "public-static-field",
73
+ "public-instance-field",
74
+ "private-static-field",
75
+ "private-instance-field",
76
+ "public-constructor",
77
+ "private-constructor",
78
+ "public-instance-method",
79
+ "protected-instance-method",
80
+ "private-instance-method"
81
+ ]
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ {
87
+ "files": [
88
+ "*.html"
89
+ ],
90
+ "extends": [
91
+ "plugin:@angular-eslint/template/recommended"
92
+ ],
93
+ "rules": {}
94
+ }
95
+ ]
96
+ }
@@ -1 +1 @@
1
- 5.3.61
1
+ 5.3.63
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 5.3.63 (2022-09-27)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * added build script for pr scanning of ui - extract release backend (wip) - EUI-6540 EUI-4107 [EUI-6540](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6540) ([5c838419](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/5c8384190339318aaa2532f347c00506f6b68606))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.3.62 (2022-09-26)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * adapted for eUI 15 showcase - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([5f738fd2](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/5f738fd2d86caeb11605a677287d5e2cd1b0bb66))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 5.3.61 (2022-09-26)
2
20
 
3
21
  ##### Chores
@@ -9,6 +9,7 @@ const scriptIndex = args.findIndex(
9
9
  x => x === 'clean-package' ||
10
10
  x === 'clean-all' ||
11
11
  x === 'build-package' ||
12
+ x === 'build-package-pr-scan' ||
12
13
  x === 'build-package-sub' ||
13
14
  x === 'build-element' ||
14
15
  x === 'build-deps' ||
@@ -28,6 +29,7 @@ const scriptIndex = args.findIndex(
28
29
  x === 'csdr-upgrade-deps' ||
29
30
  x === 'csdr-serve-app' ||
30
31
  x === 'release-package' ||
32
+ x === 'release-backend' ||
31
33
  x === 'release-app' ||
32
34
  x === 'generate-translations' ||
33
35
  x === 'csdr-sync' ||
@@ -46,6 +48,7 @@ switch (script) {
46
48
  case 'clean-package':
47
49
  case 'clean-all':
48
50
  case 'build-package':
51
+ case 'build-package-pr-scan':
49
52
  case 'build-package-sub':
50
53
  case 'build-element':
51
54
  case 'build-deps':
@@ -65,6 +68,7 @@ switch (script) {
65
68
  case 'csdr-upgrade-deps':
66
69
  case 'csdr-serve-app':
67
70
  case 'release-package':
71
+ case 'release-backend':
68
72
  case 'release-app':
69
73
  case 'csdr-sync':
70
74
  case 'csdr-cli':
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const buildPackagePrScan = require('../../scripts/csdr/release/package/build-pr-scan');
4
+
5
+ buildPackagePrScan.run();
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const releaseBackend = require('../../scripts/csdr/release/package/release-backend');
4
+
5
+ releaseBackend.run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.3.61",
3
+ "version": "5.3.63",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -328,6 +328,44 @@ const storeBuildMetadata = (pkg, pkgVersion, pkgMetadata, envTarget) => {
328
328
  }
329
329
 
330
330
 
331
+
332
+ module.exports.storeMetadataBackend = (
333
+ pkg, pkgVersion, pkgMetadata, isMaster, duration, envTarget
334
+ ) => {
335
+
336
+ tools.logTitle('Storing Backend metadata...');
337
+
338
+ return Promise.resolve()
339
+
340
+ .then(() => {
341
+ return innerPackageVersions.storeMetadata(pkg, pkgVersion, {}, duration, envTarget);
342
+ })
343
+
344
+ .then(() => {
345
+ if (isMaster) {
346
+ return storeBuildMetadata(pkg, pkgVersion, pkgMetadata, envTarget);
347
+ }
348
+ })
349
+
350
+ .then(() => {
351
+ if (isMaster) {
352
+ return storePipelineMetadata(pkgMetadata);
353
+ }
354
+ })
355
+
356
+ .then(() => {
357
+ tools.logSuccess();
358
+ })
359
+
360
+ .catch((e) => {
361
+ throw e;
362
+ })
363
+ }
364
+
365
+
366
+
367
+
368
+
331
369
  const storePipelineMetadata = (pkgMetadata) => {
332
370
  return Promise.resolve()
333
371
  .then(() => {
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ // GLOBAL
4
+ const path = require('path');
5
+
6
+ // UTILS
7
+ const utils = require('../../../utils');
8
+
9
+ // CSDR RELATED
10
+ const configUtils = require('../../config/config-utils');
11
+
12
+ // INNER MODULES
13
+ const innerCommon = require('./common');
14
+ const innerUi = require('./ui');
15
+
16
+
17
+ module.exports.run = () => {
18
+
19
+ // fetching package from config based on default arg
20
+ const pkg = configUtils.packages.getPackage();
21
+
22
+ // checking if the package can be retrieved from args
23
+ if (!pkg.name) {
24
+ utils.tools.logError('ERROR : "package" NOT PROVIDED as argument !!!');
25
+ process.exit(1);
26
+ }
27
+
28
+ if (pkg.remote) {
29
+ utils.tools.logWarning('Remote UI package - skipping...');
30
+ process.exit(1);
31
+ }
32
+
33
+ return Promise.resolve()
34
+ // LOGGING CURRENT eUI TOOLS VERSION
35
+ .then(() => {
36
+ utils.tools.logVersion();
37
+ })
38
+
39
+ // FOR UI and REMOTES clone metadata repositories
40
+ .then(() => {
41
+ return innerCommon.cloneMetadataReposCentral();
42
+ })
43
+
44
+ // INSTALL dependencies by type
45
+ .then(() => {
46
+ return innerUi.installOnly(pkg);
47
+ })
48
+
49
+ // BUILD PACKAGE
50
+ .then(() => {
51
+ return utils.buildPackage.build(pkg);
52
+ })
53
+
54
+ .catch((e) => {
55
+ console.log(e);
56
+ process.exit(1);
57
+ })
58
+ }
@@ -144,6 +144,19 @@ module.exports.cloneMetadataRepos = () => {
144
144
  }
145
145
 
146
146
 
147
+ module.exports.cloneMetadataReposCentral = () => {
148
+ utils.tools.logBanner('CLONE CENTRAL METADATA REPO');
149
+
150
+ return Promise.resolve()
151
+ .then(() => {
152
+ // cloning metadata repo as further installation is based on historical builds from the past
153
+ return metadataUtils.common.cloneMetadataRepo(true);
154
+ })
155
+ .catch((e) => {
156
+ throw e;
157
+ })
158
+ }
159
+
147
160
 
148
161
  module.exports.preReleaseChecks = (pkg) => {
149
162
  utils.tools.logBanner('PRE-RELEASE checks');
@@ -468,6 +481,28 @@ module.exports.storeMetadata = (pkg, version, pkgMetadata, pkgCompositeDeps, dur
468
481
  }
469
482
 
470
483
 
484
+
485
+ module.exports.storeMetadataBackend = (pkg, version, pkgMetadata, duration, envTarget) => {
486
+ utils.tools.logBanner('STORE BACKEND METADATA');
487
+
488
+ const branches = this.getBranches();
489
+
490
+ return Promise.resolve()
491
+ .then(() => {
492
+ return metadataUtils.package.storeMetadataBackend(
493
+ pkg, version, pkgMetadata,
494
+ branches.isMaster,
495
+ duration,
496
+ envTarget
497
+ );
498
+ })
499
+
500
+ .catch((e) => {
501
+ throw e;
502
+ })
503
+ }
504
+
505
+
471
506
  module.exports.generateDiffReport = (pkg, newVersion) => {
472
507
  utils.tools.logBanner('GENERATE DIFF REPORT');
473
508
 
@@ -0,0 +1,156 @@
1
+ 'use strict';
2
+
3
+ // GLOBAL
4
+ const path = require('path');
5
+
6
+ // UTILS
7
+ const utils = require('../../../utils');
8
+
9
+ // CSDR RELATED
10
+ const configUtils = require('../../config/config-utils');
11
+ const metadataUtils = require('../../metadata/metadata-utils');
12
+
13
+ // INNER MODULES
14
+ const innerCommon = require('./common');
15
+
16
+
17
+ module.exports.run = () => {
18
+
19
+ // fetching package from config based on default arg
20
+ const pkg = configUtils.packages.getPackage();
21
+
22
+ // checking if the package can be retrieved from args
23
+ if (!pkg.name) {
24
+ utils.tools.logError('ERROR : "package" NOT PROVIDED as argument !!!');
25
+ process.exit(1);
26
+ }
27
+
28
+ // Get branches flags
29
+ const branches = innerCommon.getBranches();
30
+
31
+ // Get envTarget (used by remotes)
32
+ const envTarget = innerCommon.getEnvTarget();
33
+
34
+ // Get compositeType (used by remotes)
35
+ const compositeType = innerCommon.getCompositeType();
36
+
37
+
38
+ // local saved vars
39
+ var newVersion, pkgMetadata, pkgCompositeDeps;
40
+
41
+
42
+ return Promise.resolve()
43
+ // LOGGING CURRENT eUI TOOLS VERSION
44
+ .then(() => {
45
+ utils.tools.logVersion();
46
+ })
47
+
48
+ // RELEASE PACKAGE START
49
+ .then(() => {
50
+ return innerCommon.init(pkg);
51
+ })
52
+
53
+ // FETCHING COMMITS METADATA
54
+ .then(() => {
55
+ return metadataUtils.commit.getMetadata(pkg);
56
+ })
57
+ .then((metadata) => {
58
+ pkgMetadata = metadata;
59
+ })
60
+
61
+ // COMMIT METADATA CHECKS
62
+ .then(() => {
63
+ return innerCommon.commitMetadataChecks(pkg);
64
+ })
65
+ .then((metadata) => {
66
+ pkgMetadata = metadata;
67
+ })
68
+
69
+
70
+ // EXECUTING PRE BUILD SCRIPT IF AVAILABLE
71
+ .then(() => {
72
+ return innerCommon.preBuild(pkg);
73
+ })
74
+
75
+
76
+ // BUILD PACKAGE
77
+ .then(() => {
78
+ return utils.buildPackage.build(pkg, branches.isMaster);
79
+ })
80
+
81
+
82
+ // EXECUTING SONAR ANALYSIS
83
+ .then(() => {
84
+ return utils.sonar.run(pkg, branches.isMaster);
85
+ })
86
+
87
+
88
+ // GENERATE and UPDATE new version
89
+ .then(() => {
90
+ return innerCommon.updateVersion(pkg, pkgMetadata, envTarget);
91
+ })
92
+ .then((version) => {
93
+ // storing version for later use
94
+ newVersion = version;
95
+ })
96
+
97
+
98
+ // GENERATE CHANGELOG
99
+ .then(() => {
100
+ return innerCommon.generateChangelog(pkg, newVersion, pkgMetadata);
101
+ })
102
+
103
+
104
+ // EXECUTING GLOBAL POST BUILD
105
+ .then(() => {
106
+ return innerCommon.postBuild(pkg, newVersion);
107
+ })
108
+
109
+
110
+ // PUBLISH PACKAGE
111
+ .then(() => {
112
+ return utils.publish.publish(pkg);
113
+ })
114
+
115
+
116
+ // EXECUTING POST PUBLISH SCRIPT IF AVAILABLE
117
+ .then(() => {
118
+ return utils.publish.postPublish(pkg);
119
+ })
120
+
121
+
122
+ // STORING CENTRALIZED METADATA
123
+ .then(() => {
124
+ // get run duration
125
+ const duration = utils.pipeline.getTimerDuration();
126
+ return innerCommon.storeMetadataBackend(pkg, newVersion, pkgMetadata, duration, envTarget);
127
+ })
128
+
129
+
130
+ // GIT OPERATIONS
131
+ .then(() => {
132
+ return innerCommon.runGitOperations(pkg, newVersion);
133
+ })
134
+
135
+
136
+ // EXPORT ADDITIONAL PIPELINE VARIABLES
137
+ .then(() => {
138
+ return innerCommon.exportPipelineVariables(pkg, compositeType);
139
+ })
140
+
141
+ // SEND SUCCESS NOTIFICATION
142
+ .then(() => {
143
+ return innerCommon.sendSuccessNotification(pkg, newVersion, pkgMetadata)
144
+ .then(() => {
145
+ innerCommon.close(pkg);
146
+ });
147
+ })
148
+
149
+ .catch((e) => {
150
+ return innerCommon.sendErrorNotification(pkg, e, pkgMetadata)
151
+ .then(() => {
152
+ innerCommon.close(pkg);
153
+ process.exit(1);
154
+ });
155
+ })
156
+ }
@@ -45,6 +45,27 @@ module.exports.install = (pkg, isMaster) => {
45
45
  }
46
46
 
47
47
 
48
+ module.exports.installOnly = (pkg) => {
49
+ tools.logBanner('INSTALL');
50
+
51
+ return Promise.resolve()
52
+
53
+ // FETCHING CURRENT PACKAGES & INSTALL
54
+ .then(() => {
55
+ // fetch related project if passed as arguments
56
+ const prj = configUtils.projects.getProject();
57
+
58
+ // install the dependencies for current package build
59
+ return installUtils.buildPackage.installPackage(prj, pkg, false);
60
+ })
61
+
62
+ .catch((e) => {
63
+ throw e;
64
+ })
65
+ }
66
+
67
+
68
+
48
69
  const checkDeps = (pkg) => {
49
70
  tools.logTitle('Checking package internal dependencies');
50
71
 
package/scripts/index.js CHANGED
@@ -126,8 +126,10 @@ module.exports.metadataStats = require('./csdr/metadata/stats');
126
126
  module.exports.realeaseApp = require('./csdr/release/app/release-app');
127
127
  module.exports.releasePackageCommon = require('./csdr/release/package/common');
128
128
  module.exports.releasePackage = require('./csdr/release/package/release-package');
129
+ module.exports.releaseBackend = require('./csdr/release/package/release-backend');
129
130
  module.exports.releasePackageRemote = require('./csdr/release/package/remote');
130
131
  module.exports.releasePackageUi = require('./csdr/release/package/ui');
132
+ module.exports.buildPrScan = require('./csdr/release/package/build-pr-scan');
131
133
 
132
134
  // csdr - sync
133
135
  module.exports.syncUtils = require('./csdr/sync/sync-utils');
@@ -55,7 +55,7 @@ module.exports.injectCsdrFullSkeletonSources = (project, euiVersion) => {
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') {
58
+ } else if (euiVersion === '14.x' || euiVersion === '15.x') {
59
59
  tools.copydir(path.join(__dirname, 'app-sources-full-skeleton-eui14'), project.folder, false);
60
60
  } else {
61
61
  tools.copydir(path.join(__dirname, 'app-sources-full-skeleton'), project.folder, false);
@@ -79,6 +79,8 @@ module.exports.preBuild = (project, envTarget, build, configEnvTarget) => {
79
79
  return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project, '13.x');
80
80
  } else if (project.build && project.build.euiVersion === '14.x') {
81
81
  return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project, '14.x');
82
+ } else if (project.build && project.build.euiVersion === '15.x') {
83
+ return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project, '15.x');
82
84
  } else {
83
85
  return injectionUtils.skeletons.injectCsdrFullSkeletonSources(project);
84
86
  }