@eui/tools 6.13.16 → 6.14.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.
@@ -1 +1 @@
1
- 6.13.16
1
+ 6.14.1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.14.1 (2023-12-04)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * generate config when only projects array exists - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([df74f311](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/df74f311008a71a6c7d93b30db397ecc57c68421))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.14.0 (2023-12-04)
11
+
12
+ ##### New Features
13
+
14
+ * **other:**
15
+ * 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))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.13.16 (2023-11-29)
2
20
 
3
21
  ##### 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.1",
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
+ // }
@@ -102,30 +102,32 @@ const getGeneratedConfig = (euircBaseFile) => {
102
102
  })
103
103
 
104
104
  // remapping projects against csdr packages config
105
- configContent.packages.forEach((p) => {
106
- genConfig.packages[p] = globalConfig.packages[p];
105
+ if (configContent.packages) {
106
+ configContent.packages.forEach((p) => {
107
+ genConfig.packages[p] = globalConfig.packages[p];
107
108
 
108
- // checking if package has config override in its own folder
109
- const pkgCsdrConfig = path.join(process.cwd(), 'packages', p, '.csdr-config.json');
109
+ // checking if package has config override in its own folder
110
+ const pkgCsdrConfig = path.join(process.cwd(), 'packages', p, '.csdr-config.json');
110
111
 
111
- if (tools.isFileExists(pkgCsdrConfig)) {
112
- const pkgCsdrConfigJson = require(pkgCsdrConfig);
113
- genConfig.packages[p] = pkgCsdrConfigJson;
114
- }
115
- })
112
+ if (tools.isFileExists(pkgCsdrConfig)) {
113
+ const pkgCsdrConfigJson = require(pkgCsdrConfig);
114
+ genConfig.packages[p] = pkgCsdrConfigJson;
115
+ }
116
+ })
116
117
 
117
- // treating parent / children packages
118
- Object.keys(genConfig.packages).forEach((p) => {
119
- // getting package
120
- const pkg = genConfig.packages[p];
118
+ // treating parent / children packages
119
+ Object.keys(genConfig.packages).forEach((p) => {
120
+ // getting package
121
+ const pkg = genConfig.packages[p];
121
122
 
122
- // insert children packages if any
123
- if (pkg && pkg.parent) {
124
- Object.keys(pkg.packages).forEach((pc) => {
125
- genConfig.packages[pc] = pkg.packages[pc];
126
- })
127
- }
128
- })
123
+ // insert children packages if any
124
+ if (pkg && pkg.parent) {
125
+ Object.keys(pkg.packages).forEach((pc) => {
126
+ genConfig.packages[pc] = pkg.packages[pc];
127
+ })
128
+ }
129
+ })
130
+ }
129
131
 
130
132
  // remapping remotes
131
133
  if (configContent.remotes) {
@@ -168,7 +170,7 @@ module.exports.getConfig = () => {
168
170
 
169
171
 
170
172
 
171
- module.exports.updateConfig = (args = { project, packages, packagesBranches, remotes, reset}) => {
173
+ module.exports.updateConfig = (args = { project, projects, packages, packagesBranches, remotes, reset}) => {
172
174
  tools.logInfo('Updating euirc config');
173
175
  console.log(args);
174
176
 
@@ -178,40 +180,51 @@ module.exports.updateConfig = (args = { project, packages, packagesBranches, rem
178
180
 
179
181
  if (!tools.isFileExists(configFile) || args.reset) {
180
182
  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;
183
+
184
+ if (args.projects) {
185
+ newConfig.projects = args.projects;
186
+
187
+ } else {
188
+ if (args.project && args.project !== 'NONE') {
189
+ newConfig.projects.push(args.project);
190
+ }
191
+ newConfig.packages = [];
192
+ if (args.packages) {
193
+ newConfig.packages = args.packages;
194
+ }
195
+ newConfig.packagesBranches = [];
196
+ if (args.packagesBranches) {
197
+ newConfig.packagesBranches = args.packagesBranches;
198
+ }
199
+ newConfig.remotes = [];
200
+ if (args.remotes) {
201
+ newConfig.remotes = args.remotes;
202
+ }
195
203
  }
196
204
 
197
205
  } else {
198
206
  newConfig = require(configFile);
199
207
 
200
- if (args.project && args.project !== 'NONE') {
201
- if (newConfig.projects.indexOf(args.project) < 0) {
202
- newConfig.projects.push(args.project);
208
+ if (args.projects) {
209
+ newConfig.projects = args.projects;
210
+
211
+ } else {
212
+ if (args.project && args.project !== 'NONE') {
213
+ if (newConfig.projects.indexOf(args.project) < 0) {
214
+ newConfig.projects.push(args.project);
215
+ }
203
216
  }
204
- }
205
217
 
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
- }
218
+ if (args.packages) {
219
+ newConfig.packages = tools.removeArrayDuplicates([...newConfig.packages || [], ...args.packages]);
220
+ }
221
+ if (args.packagesBranches) {
222
+ newConfig.packagesBranches = tools.removeArrayDuplicates([...newConfig.packagesBranches || [], ...args.packagesBranches]);
223
+ }
212
224
 
213
- if (args.remotes) {
214
- newConfig.remotes = tools.removeArrayDuplicates([...newConfig.remotes || [], ...args.remotes]);
225
+ if (args.remotes) {
226
+ newConfig.remotes = tools.removeArrayDuplicates([...newConfig.remotes || [], ...args.remotes]);
227
+ }
215
228
  }
216
229
  }
217
230
 
@@ -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
+ };