@eui/tools 6.13.16 → 6.14.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.
@@ -1 +1 @@
1
- 6.13.16
1
+ 6.14.0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.14.0 (2023-12-04)
2
+
3
+ ##### New Features
4
+
5
+ * **other:**
6
+ * enable projects group release feature - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([5bcce1af](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/5bcce1afa8b2e4bef28fa8e6d77e2b9f887edfb0))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.13.16 (2023-11-29)
2
11
 
3
12
  ##### Bug Fixes
@@ -6,7 +6,8 @@ const chalk = require('chalk');
6
6
  const args = process.argv.slice(2);
7
7
 
8
8
  const scriptIndex = args.findIndex(
9
- x => x === 'clean-package' ||
9
+ (x) =>
10
+ x === 'clean-package' ||
10
11
  x === 'clean-all' ||
11
12
  x === 'audit-package' ||
12
13
  x === 'build-package' ||
@@ -38,6 +39,7 @@ const scriptIndex = args.findIndex(
38
39
  x === 'release-package' ||
39
40
  x === 'release-backend' ||
40
41
  x === 'release-app' ||
42
+ x === 'release-app-group' ||
41
43
  x === 'generate-translations' ||
42
44
  x === 'csdr-sync' ||
43
45
  x === 'csdr-cli' ||
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const releaseApp = require('../../scripts/csdr/release/app/release-app-group');
4
+
5
+ releaseApp.run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.13.16",
3
+ "version": "6.14.0",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -1,100 +1,101 @@
1
1
  'use strict';
2
2
 
3
- // GLOBAL
4
- const inquirer = require('inquirer');
5
-
6
- // CONSTANTS
7
- const constants = require('./constants');
8
-
9
-
10
3
  module.exports.prompt = () => {
4
+ console.log(
5
+ 'WARNING: discontinued, use init-interactive for creating PKG / REMOTES, note that this should be executed by SUPPORT TEAM ONLY!'
6
+ );
7
+ throw new Error('SCRIPT_DISCONTINUED');
8
+ };
11
9
 
12
- return Promise.resolve()
13
- .then(() => {
14
- return inquirer.prompt([
15
- {
16
- type: 'list',
17
- name: 'pkgType',
18
- message: 'Select a package type :',
19
- choices: [
20
- { name: 'Frontend - Angular library', value: constants.CONFIG_OPTIONS.pkgType.FRONTEND },
21
- { name: 'Backend - SpringBoot micro-service', value: constants.CONFIG_OPTIONS.pkgType.BACKEND },
22
- ],
23
- default: constants.DEFAULT_CONFIG.pkgType,
24
- validate: function (value) {
25
- if (value.length) {
26
- return true;
27
- }
28
- }
29
- },
30
- {
31
- name: 'pkgGroupId',
32
- type: 'input',
33
- message: 'Enter the Maven groupId :',
34
- default: constants.DEFAULT_CONFIG.pkgGroupId,
35
- when: function (answers) {
36
- return (answers.pkgType === constants.CONFIG_OPTIONS.pkgType.BACKEND);
37
- }
38
- },
39
- {
40
- type: 'list',
41
- name: 'pkgFrontendType',
42
- message: 'Select a frontend type :',
43
- choices: [
44
- { name: 'Default Angular library', value: constants.CONFIG_OPTIONS.pkgFrontendType.DEFAULT },
45
- { name: 'Remote element micro-frontend', value: constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE },
46
- ],
47
- default: constants.DEFAULT_CONFIG.pkgFrontendType,
48
- when: function (answers) {
49
- return (answers.pkgType === constants.CONFIG_OPTIONS.pkgType.FRONTEND);
50
- },
51
- validate: function (value) {
52
- if (value.length) {
53
- return true;
54
- }
55
- }
56
- },
10
+ // module.exports.prompt = () => {
57
11
 
58
- {
59
- name: 'pkgScope',
60
- type: 'input',
61
- message: 'Enter the package scope :',
62
- default: constants.DEFAULT_CONFIG.pkgScope
63
- },
64
- {
65
- name: 'pkgName',
66
- type: 'input',
67
- message: 'Enter the package name :',
68
- default: constants.DEFAULT_CONFIG.pkgName
69
- },
70
- {
71
- name: 'isCsdrRepo',
72
- type: 'confirm',
73
- message: 'Is the repository within CSDR git project ?',
74
- default: constants.DEFAULT_CONFIG.isCsdrRepo,
75
- when: function (answers) {
76
- return (
77
- answers.pkgType === constants.CONFIG_OPTIONS.pkgType.FRONTEND &&
78
- answers.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.DEFAULT
79
- );
80
- }
81
- },
82
- {
83
- name: 'externalRepoName',
84
- type: 'input',
85
- message: 'Enter the project CITnet project name where the repository is located :',
86
- default: constants.DEFAULT_CONFIG.externalRepoName,
87
- when: function (answers) {
88
- return (
89
- answers.isCsdrRepo === false
90
- );
91
- }
92
- },
93
- ]);
94
- })
12
+ // const inquirer = require('inquirer');
13
+ // const constants = require('./constants');
14
+ // return Promise.resolve()
15
+ // .then(() => {
16
+ // return inquirer.prompt([
17
+ // {
18
+ // type: 'list',
19
+ // name: 'pkgType',
20
+ // message: 'Select a package type :',
21
+ // choices: [
22
+ // { name: 'Frontend - Angular library', value: constants.CONFIG_OPTIONS.pkgType.FRONTEND },
23
+ // { name: 'Backend - SpringBoot micro-service', value: constants.CONFIG_OPTIONS.pkgType.BACKEND },
24
+ // ],
25
+ // default: constants.DEFAULT_CONFIG.pkgType,
26
+ // validate: function (value) {
27
+ // if (value.length) {
28
+ // return true;
29
+ // }
30
+ // }
31
+ // },
32
+ // {
33
+ // name: 'pkgGroupId',
34
+ // type: 'input',
35
+ // message: 'Enter the Maven groupId :',
36
+ // default: constants.DEFAULT_CONFIG.pkgGroupId,
37
+ // when: function (answers) {
38
+ // return (answers.pkgType === constants.CONFIG_OPTIONS.pkgType.BACKEND);
39
+ // }
40
+ // },
41
+ // {
42
+ // type: 'list',
43
+ // name: 'pkgFrontendType',
44
+ // message: 'Select a frontend type :',
45
+ // choices: [
46
+ // { name: 'Default Angular library', value: constants.CONFIG_OPTIONS.pkgFrontendType.DEFAULT },
47
+ // { name: 'Remote element micro-frontend', value: constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE },
48
+ // ],
49
+ // default: constants.DEFAULT_CONFIG.pkgFrontendType,
50
+ // when: function (answers) {
51
+ // return (answers.pkgType === constants.CONFIG_OPTIONS.pkgType.FRONTEND);
52
+ // },
53
+ // validate: function (value) {
54
+ // if (value.length) {
55
+ // return true;
56
+ // }
57
+ // }
58
+ // },
95
59
 
96
- .catch((e) => {
97
- throw e;
98
- })
99
- }
60
+ // {
61
+ // name: 'pkgScope',
62
+ // type: 'input',
63
+ // message: 'Enter the package scope :',
64
+ // default: constants.DEFAULT_CONFIG.pkgScope
65
+ // },
66
+ // {
67
+ // name: 'pkgName',
68
+ // type: 'input',
69
+ // message: 'Enter the package name :',
70
+ // default: constants.DEFAULT_CONFIG.pkgName
71
+ // },
72
+ // {
73
+ // name: 'isCsdrRepo',
74
+ // type: 'confirm',
75
+ // message: 'Is the repository within CSDR git project ?',
76
+ // default: constants.DEFAULT_CONFIG.isCsdrRepo,
77
+ // when: function (answers) {
78
+ // return (
79
+ // answers.pkgType === constants.CONFIG_OPTIONS.pkgType.FRONTEND &&
80
+ // answers.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.DEFAULT
81
+ // );
82
+ // }
83
+ // },
84
+ // {
85
+ // name: 'externalRepoName',
86
+ // type: 'input',
87
+ // message: 'Enter the project CITnet project name where the repository is located :',
88
+ // default: constants.DEFAULT_CONFIG.externalRepoName,
89
+ // when: function (answers) {
90
+ // return (
91
+ // answers.isCsdrRepo === false
92
+ // );
93
+ // }
94
+ // },
95
+ // ]);
96
+ // })
100
97
 
98
+ // .catch((e) => {
99
+ // throw e;
100
+ // })
101
+ // }
@@ -168,7 +168,7 @@ module.exports.getConfig = () => {
168
168
 
169
169
 
170
170
 
171
- module.exports.updateConfig = (args = { project, packages, packagesBranches, remotes, reset}) => {
171
+ module.exports.updateConfig = (args = { project, projects, packages, packagesBranches, remotes, reset}) => {
172
172
  tools.logInfo('Updating euirc config');
173
173
  console.log(args);
174
174
 
@@ -178,40 +178,51 @@ module.exports.updateConfig = (args = { project, packages, packagesBranches, rem
178
178
 
179
179
  if (!tools.isFileExists(configFile) || args.reset) {
180
180
  newConfig.projects = [];
181
- if (args.project && args.project !== 'NONE') {
182
- newConfig.projects.push(args.project);
183
- }
184
- newConfig.packages = [];
185
- if (args.packages) {
186
- newConfig.packages = args.packages;
187
- }
188
- newConfig.packagesBranches = [];
189
- if (args.packagesBranches) {
190
- newConfig.packagesBranches = args.packagesBranches;
191
- }
192
- newConfig.remotes = [];
193
- if (args.remotes) {
194
- newConfig.remotes = args.remotes;
181
+
182
+ if (args.projects) {
183
+ newConfig.projects = args.projects;
184
+
185
+ } else {
186
+ if (args.project && args.project !== 'NONE') {
187
+ newConfig.projects.push(args.project);
188
+ }
189
+ newConfig.packages = [];
190
+ if (args.packages) {
191
+ newConfig.packages = args.packages;
192
+ }
193
+ newConfig.packagesBranches = [];
194
+ if (args.packagesBranches) {
195
+ newConfig.packagesBranches = args.packagesBranches;
196
+ }
197
+ newConfig.remotes = [];
198
+ if (args.remotes) {
199
+ newConfig.remotes = args.remotes;
200
+ }
195
201
  }
196
202
 
197
203
  } else {
198
204
  newConfig = require(configFile);
199
205
 
200
- if (args.project && args.project !== 'NONE') {
201
- if (newConfig.projects.indexOf(args.project) < 0) {
202
- newConfig.projects.push(args.project);
206
+ if (args.projects) {
207
+ newConfig.projects = args.projects;
208
+
209
+ } else {
210
+ if (args.project && args.project !== 'NONE') {
211
+ if (newConfig.projects.indexOf(args.project) < 0) {
212
+ newConfig.projects.push(args.project);
213
+ }
203
214
  }
204
- }
205
215
 
206
- if (args.packages) {
207
- newConfig.packages = tools.removeArrayDuplicates([...newConfig.packages || [], ...args.packages]);
208
- }
209
- if (args.packagesBranches) {
210
- newConfig.packagesBranches = tools.removeArrayDuplicates([...newConfig.packagesBranches || [], ...args.packagesBranches]);
211
- }
216
+ if (args.packages) {
217
+ newConfig.packages = tools.removeArrayDuplicates([...newConfig.packages || [], ...args.packages]);
218
+ }
219
+ if (args.packagesBranches) {
220
+ newConfig.packagesBranches = tools.removeArrayDuplicates([...newConfig.packagesBranches || [], ...args.packagesBranches]);
221
+ }
212
222
 
213
- if (args.remotes) {
214
- newConfig.remotes = tools.removeArrayDuplicates([...newConfig.remotes || [], ...args.remotes]);
223
+ if (args.remotes) {
224
+ newConfig.remotes = tools.removeArrayDuplicates([...newConfig.remotes || [], ...args.remotes]);
225
+ }
215
226
  }
216
227
  }
217
228
 
@@ -12,14 +12,13 @@ const innerPackages = require('./packages');
12
12
  const innerRemotes = require('./remotes');
13
13
  const innerGlobal = require('./global');
14
14
 
15
-
16
-
17
15
  module.exports.run = (args) => {
18
16
  return Promise.resolve()
19
17
  .then(() => {
20
18
  if (args.custom) {
21
19
  return initConfigCustom(args);
22
-
20
+ } else if (args.projectsGroup) {
21
+ return initConfigProjectsGroup(args.projectsGroup, args.euiVersion);
23
22
  } else {
24
23
  return initConfigCore(args);
25
24
  }
@@ -27,9 +26,8 @@ module.exports.run = (args) => {
27
26
 
28
27
  .catch((e) => {
29
28
  throw e;
30
- })
31
- }
32
-
29
+ });
30
+ };
33
31
 
34
32
  const initConfigCustom = (args) => {
35
33
  return Promise.resolve()
@@ -47,24 +45,24 @@ const initConfigCustom = (args) => {
47
45
 
48
46
  return innerGlobal.updateConfig({
49
47
  project: customConfig.project,
50
- packages: [...defaultPackages, ...customConfig.packages.map(p => p.name)],
48
+ packages: [...defaultPackages, ...customConfig.packages.map((p) => p.name)],
51
49
  packagesBranches: customConfig.packages,
52
50
  remotes: customConfig.remotes,
53
- reset: true
51
+ reset: true,
54
52
  });
55
53
  })
56
54
  .catch((e) => {
57
55
  throw e;
58
- })
59
- }
60
-
56
+ });
57
+ };
61
58
 
62
59
  const initConfigCore = (args) => {
63
60
  return Promise.resolve()
64
61
  .then(() => {
65
- tools.logInfo('Updating local configuration')
62
+ tools.logInfo('Updating local configuration');
66
63
 
67
- let packages = [], remotes = [];
64
+ let packages = [],
65
+ remotes = [];
68
66
  if (args.project || args.pkg) {
69
67
  packages = getInputPackages(args.project, args.pkg, args.team, args.prjOnly, args.containerOnly);
70
68
  tools.logInfo('Found packages : ');
@@ -73,7 +71,7 @@ const initConfigCore = (args) => {
73
71
 
74
72
  if (args.remote) {
75
73
  const remote = innerRemotes.getCsdrRemotes()[args.remote];
76
- if (remote) {
74
+ if (remote) {
77
75
  remotes.push(args.remote);
78
76
  }
79
77
  }
@@ -82,19 +80,27 @@ const initConfigCore = (args) => {
82
80
  })
83
81
  .catch((e) => {
84
82
  throw e;
85
- })
86
- }
87
-
88
-
89
-
83
+ });
84
+ };
90
85
 
86
+ const initConfigProjectsGroup = (projectsGroup, euiVersion) => {
87
+ return Promise.resolve()
88
+ .then(() => {
89
+ tools.logInfo('Updating local configuration');
91
90
 
91
+ const projects = innerProjects.getCsdrProjectsGroupForEuiVersion(projectsGroup, euiVersion);
92
92
 
93
+ return innerGlobal.updateConfig({ projects });
94
+ })
95
+ .catch((e) => {
96
+ throw e;
97
+ });
98
+ };
93
99
 
94
100
  const getInputPackages = (project, pkg, team, prjOnly, containerOnly) => {
95
101
  tools.logInfo('Gathering team packages');
96
102
 
97
- var packages = [];
103
+ let packages = [];
98
104
 
99
105
  // when package is provided, we initialize this package only
100
106
  if (pkg) {
@@ -131,10 +137,12 @@ const getInputPackages = (project, pkg, team, prjOnly, containerOnly) => {
131
137
  }
132
138
 
133
139
  const csdrPackage = innerPackages.getCsdrPackages()[p];
134
- if (typeof team === 'undefined' ||
140
+ if (
141
+ typeof team === 'undefined' ||
135
142
  team === 'all' ||
136
- csdrPackage.teams && (csdrPackage.teams.indexOf(team) >= 0 || csdrPackage.teams.indexOf('all') >= 0)) {
143
+ (csdrPackage.teams && (csdrPackage.teams.indexOf(team) >= 0 || csdrPackage.teams.indexOf('all') >= 0))
144
+ ) {
137
145
  packages.push(p);
138
146
  }
139
147
  }
140
- }
148
+ };