@eui/tools 5.3.24 → 5.3.27

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
- 5.3.24
1
+ 5.3.27
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 5.3.27 (2022-06-29)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * removed packages injection config injection for MWP - adapted default config injection for MWP - MWP-7700 [MWP-7700](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-7700) ([a9ae69f4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/a9ae69f49558b66afbf6e3ce9395148c924023c0))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.3.26 (2022-06-23)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * adapted for MWP v14 setup and migration - MWP-8474 [MWP-8474](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-8474) ([4fc90eca](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/4fc90eca36fe64366397bded27818675f17485f4))
16
+
17
+ * * *
18
+ * * *
19
+ ## 5.3.25 (2022-06-22)
20
+
21
+ ##### Bug Fixes
22
+
23
+ * **other:**
24
+ * avoid removing assets path on app source injection - MWP-7700 [MWP-7700](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-7700) ([63b520d1](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/63b520d107bdfe4dd64f46bd6eb78943db71fc93))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 5.3.24 (2022-06-21)
2
29
 
3
30
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.3.24",
3
+ "version": "5.3.27",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -6,6 +6,7 @@ const path = require('path');
6
6
  // LOCAL
7
7
  const tools = require('../../utils/tools');
8
8
 
9
+ const innerPackages = require('./packages');
9
10
 
10
11
 
11
12
  const angularConfigDef = {
@@ -1307,12 +1308,21 @@ module.exports.registerAngularPackage = (pkg, isReset) => {
1307
1308
  pathBase = 'packages/' + pkg.parentPkg + '/packages';
1308
1309
  }
1309
1310
 
1311
+ let packageEuiVersion;
1312
+
1313
+ if (pkg.build && pkg.build.euiVersion) {
1314
+ packageEuiVersion = pkg.build.euiVersion;
1315
+
1316
+ } else {
1317
+ packageEuiVersion = innerPackages.getPackageEuiVerison(pkg);
1318
+ }
1319
+
1310
1320
  let projectDef = JSON.stringify(angularPackageDef);
1311
1321
 
1312
- if (pkg.build && pkg.build.euiVersion === '13.x') {
1322
+ if (packageEuiVersion === '13.x') {
1313
1323
  projectDef = JSON.stringify(angularPackageDefV13);
1314
1324
  }
1315
- if (pkg.build && pkg.build.euiVersion === '14.x') {
1325
+ if (packageEuiVersion === '14.x') {
1316
1326
  projectDef = JSON.stringify(angularPackageDefV14);
1317
1327
  }
1318
1328
 
@@ -243,52 +243,63 @@ module.exports.getDepGraph = () => {
243
243
  }
244
244
 
245
245
 
246
- module.exports.getLocalPackagesEuiVersion = () => {
247
- tools.logTitle('getting local packages installed eUI version...');
248
-
249
- const pkgs = getPackages();
250
- let versionsFound = [];
251
-
252
- pkgs.forEach((p) => {
253
- if (p.parent !== true && p.tsPackage !== false) {
254
- tools.logInfo(`checking ${p.name}`);
246
+ const getPackageEuiVersion = module.exports.getPackageEuiVerison = (pkg) => {
247
+ if (pkg.parent !== true && pkg.tsPackage !== false) {
248
+ tools.logInfo(`checking ${pkg.name}`);
255
249
 
256
- let version;
250
+ let version;
257
251
 
258
- if (p.build && p.build.euiVersion) {
259
- version = p.build.euiVersion;
252
+ if (pkg.build && pkg.build.euiVersion) {
253
+ version = pkg.build.euiVersion;
260
254
 
261
- } else if (!p.remote) {
262
- const depsCompositeFile = path.join(p.paths.pkgRootDirectory, 'dependencies-composite.json');
263
- tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
255
+ } else if (!pkg.remote) {
256
+ const depsCompositeFile = path.join(pkg.paths.pkgRootDirectory, 'dependencies-composite.json');
257
+ tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
264
258
 
265
- if (!tools.isFileExists(depsCompositeFile)) {
266
- tools.logInfo('---- no dependencies-composite.json file found');
267
- } else {
268
- const deps = tools.getJsonFileContent(depsCompositeFile);
269
- const euiDepsBase = deps['@eui/deps-base'];
259
+ if (!tools.isFileExists(depsCompositeFile)) {
260
+ tools.logInfo('---- no dependencies-composite.json file found');
261
+ } else {
262
+ const deps = tools.getJsonFileContent(depsCompositeFile);
263
+ const euiDepsBase = deps['@eui/deps-base'];
270
264
 
271
- if (euiDepsBase) {
272
- let euiVersion = euiDepsBase.split('.')[0];
265
+ if (euiDepsBase) {
266
+ let euiVersion = euiDepsBase.split('.')[0];
273
267
 
274
- if (euiVersion.substr(0,1) === '^') {
275
- euiVersion = euiVersion.substr(1);
276
- }
277
- version = `${euiVersion}.x`;
268
+ if (euiVersion.substr(0,1) === '^') {
269
+ euiVersion = euiVersion.substr(1);
270
+ }
271
+ version = `${euiVersion}.x`;
278
272
 
279
- if (version === '7.x') {
280
- version = 'DEFAULT';
281
- }
273
+ if (version === '7.x') {
274
+ version = 'DEFAULT';
282
275
  }
283
276
  }
284
277
  }
278
+ }
285
279
 
286
- if (version) {
287
- tools.logInfo(`---- version found : ${version}\n`);
288
- versionsFound.push(version);
289
- } else {
290
- tools.logInfo('---- version detection skipped');
291
- }
280
+ if (version) {
281
+ tools.logInfo(`---- version found : ${version}\n`);
282
+ } else {
283
+ tools.logInfo('---- version detection skipped');
284
+ }
285
+
286
+ return version;
287
+ }
288
+ }
289
+
290
+
291
+
292
+ module.exports.getLocalPackagesEuiVersion = () => {
293
+ tools.logTitle('getting local packages installed eUI version...');
294
+
295
+ const pkgs = getPackages();
296
+ let versionsFound = [];
297
+
298
+ pkgs.forEach((p) => {
299
+ const version = getPackageEuiVersion(p);
300
+
301
+ if (version) {
302
+ versionsFound.push(version);
292
303
  }
293
304
  })
294
305
 
@@ -10,7 +10,7 @@ const configUtils = require('../config/config-utils');
10
10
  const metadataUtils = require('../metadata/metadata-utils');
11
11
 
12
12
  // FETCH ARGS
13
- const { dryRun, skipInstall, registry, remotesImport } = tools.getArgs();
13
+ const { dryRun, skipInstall, registry, remotesImport, skipLocalPackagesDeps } = tools.getArgs();
14
14
 
15
15
 
16
16
 
@@ -227,17 +227,24 @@ const getLocalPackagesDeps = () => {
227
227
  const getLocalPackageCompositeDeps = (pkg) => {
228
228
  let pkgJsonFile;
229
229
 
230
- if (pkg.child) {
231
- pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-composite.json');
230
+ if (!skipLocalPackagesDeps) {
231
+ if (pkg.child) {
232
+ pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-composite.json');
233
+ } else {
234
+ pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-composite.json');
235
+ }
236
+
237
+ if (tools.isFileExists(pkgJsonFile)) {
238
+ tools.logInfo(`found ${pkgJsonFile}, parsing...`);
239
+ }
240
+
241
+ return tools.getJsonFileContent(pkgJsonFile) || {};
242
+
232
243
  } else {
233
- pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-composite.json');
234
- }
244
+ tools.logInfo('Skipping gathering local packages composite deps');
235
245
 
236
- if (tools.isFileExists(pkgJsonFile)) {
237
- tools.logInfo(`found ${pkgJsonFile}, parsing...`);
246
+ return {};
238
247
  }
239
-
240
- return tools.getJsonFileContent(pkgJsonFile) || {};
241
248
  }
242
249
 
243
250
 
@@ -290,7 +290,7 @@ module.exports.run = () => {
290
290
  if (project.build && project.build.distribution) {
291
291
  return Promise.resolve()
292
292
  .then(() => {
293
- return utils.buildApp.generateProjectDistributionFile(project, (isSnapshot || isSupportSnapshotBranch));
293
+ return utils.buildApp.generateProjectDistributionFile(project, (isSnapshot || isSupportSnapshotBranch), envTarget);
294
294
  })
295
295
  .catch((e) => {
296
296
  throw e;
@@ -270,7 +270,7 @@ module.exports.postBuild = (project) => {
270
270
  }
271
271
 
272
272
 
273
- module.exports.generateProjectDistributionFile = (project, isSnapshot) => {
273
+ module.exports.generateProjectDistributionFile = (project, isSnapshot, envTarget) => {
274
274
  tools.logTitle('Generating distribution file');
275
275
 
276
276
  let projectVersion;
@@ -298,6 +298,36 @@ module.exports.generateProjectDistributionFile = (project, isSnapshot) => {
298
298
  if (isSnapshot && project.build.distribution.bucketNameSnapshot) {
299
299
  bucketName = project.build.distribution.bucketNameSnapshot;
300
300
  }
301
+
302
+ if (envTarget) {
303
+ if (envTarget === 'DEV' && project.build.distribution.bucketNameDev) {
304
+ bucketName = project.build.distribution.bucketNameDev;
305
+ }
306
+
307
+ if (envTarget === 'TST' && project.build.distribution.bucketNameTst) {
308
+ bucketName = project.build.distribution.bucketNameTst;
309
+ }
310
+
311
+ if (envTarget === 'INT' && project.build.distribution.bucketNameInt) {
312
+ bucketName = project.build.distribution.bucketNameInt;
313
+ }
314
+
315
+ if (envTarget === 'ACC' && project.build.distribution.bucketNameAcc) {
316
+ bucketName = project.build.distribution.bucketNameAcc;
317
+ }
318
+
319
+ if (envTarget === 'DLT' && project.build.distribution.bucketNameDlt) {
320
+ bucketName = project.build.distribution.bucketNameDlt;
321
+ }
322
+
323
+ if (envTarget === 'TRN' && project.build.distribution.bucketNameTrn) {
324
+ bucketName = project.build.distribution.bucketNameTrn;
325
+ }
326
+
327
+ if (envTarget === 'PROD' && project.build.distribution.bucketNameProd) {
328
+ bucketName = project.build.distribution.bucketNameProd;
329
+ }
330
+ }
301
331
  }
302
332
 
303
333
  // final output bucket location
@@ -68,9 +68,9 @@ const injectConfig = (project) => {
68
68
  }
69
69
  })
70
70
 
71
- .then(() => {
72
- return injectPackagesConfig(project);
73
- })
71
+ // .then(() => {
72
+ // return injectPackagesConfig(project);
73
+ // })
74
74
 
75
75
  .catch((e) => {
76
76
  throw e;
@@ -78,129 +78,129 @@ const injectConfig = (project) => {
78
78
  }
79
79
 
80
80
 
81
- const injectPackagesConfig = (project) => {
82
- tools.logTitle('Injecting package config');
81
+ // const injectPackagesConfig = (project) => {
82
+ // tools.logTitle('Injecting package config');
83
83
 
84
- return Promise.resolve()
84
+ // return Promise.resolve()
85
85
 
86
- // fetching current project linked composite packages dependencies
87
- .then(() => {
88
- return installUtils.common.getLocalProjectDeps(project);
89
- })
86
+ // // fetching current project linked composite packages dependencies
87
+ // .then(() => {
88
+ // return installUtils.common.getLocalProjectDeps(project);
89
+ // })
90
90
 
91
91
 
92
- // remapping dependencies with package names
93
- .then((prjDeps) => {
92
+ // // remapping dependencies with package names
93
+ // .then((prjDeps) => {
94
94
 
95
- // gather only the locally installed projects,
96
- const localPackagesConfig = configUtils.packages.getPackages();
95
+ // // gather only the locally installed projects,
96
+ // const localPackagesConfig = configUtils.packages.getPackages();
97
97
 
98
- let localPackagesArray = [];
98
+ // let localPackagesArray = [];
99
99
 
100
- Object.keys(prjDeps).forEach((p) => {
101
- const filteredPackage = localPackagesConfig.filter((fp) => {
102
- // filtering from the current deps pkg
103
- return fp.npmPkg === p;
104
- })[0];
100
+ // Object.keys(prjDeps).forEach((p) => {
101
+ // const filteredPackage = localPackagesConfig.filter((fp) => {
102
+ // // filtering from the current deps pkg
103
+ // return fp.npmPkg === p;
104
+ // })[0];
105
105
 
106
- if (filteredPackage) localPackagesArray.push(filteredPackage.name);
107
- });
106
+ // if (filteredPackage) localPackagesArray.push(filteredPackage.name);
107
+ // });
108
108
 
109
109
 
110
110
 
111
- // gather the full CSDR packages from project dependencies
112
- const csdrPackagesConfig = configUtils.packages.getCsdrPackagesFull();
111
+ // // gather the full CSDR packages from project dependencies
112
+ // const csdrPackagesConfig = configUtils.packages.getCsdrPackagesFull();
113
113
 
114
- let csdrPackagesArray = [];
114
+ // let csdrPackagesArray = [];
115
115
 
116
- Object.keys(prjDeps).forEach((p) => {
117
- const filteredPackage = csdrPackagesConfig.filter((fp) => {
118
- // filtering from the current deps pkg; excluding the ones found locally
119
- return fp.npmPkg === p && !localPackagesArray.includes(fp.name);
120
- })[0];
116
+ // Object.keys(prjDeps).forEach((p) => {
117
+ // const filteredPackage = csdrPackagesConfig.filter((fp) => {
118
+ // // filtering from the current deps pkg; excluding the ones found locally
119
+ // return fp.npmPkg === p && !localPackagesArray.includes(fp.name);
120
+ // })[0];
121
121
 
122
- if (filteredPackage) csdrPackagesArray.push(filteredPackage.npmPkg);
123
- });
122
+ // if (filteredPackage) csdrPackagesArray.push(filteredPackage.npmPkg);
123
+ // });
124
124
 
125
125
 
126
- return {
127
- csdrPackages: csdrPackagesArray,
128
- localPackages: localPackagesArray,
129
- };
130
- })
126
+ // return {
127
+ // csdrPackages: csdrPackagesArray,
128
+ // localPackages: localPackagesArray,
129
+ // };
130
+ // })
131
131
 
132
132
 
133
- // checking filtered packages if config overrides is provided
134
- .then((filteredPackages) => {
133
+ // // checking filtered packages if config overrides is provided
134
+ // .then((filteredPackages) => {
135
135
 
136
- // checking installed packages
137
- filteredPackages.csdrPackages.forEach((p) => {
138
- const pkgPath = path.join(process.cwd(), 'node_modules', p);
139
- processPackageConfig(project, pkgPath);
140
- })
136
+ // // checking installed packages
137
+ // filteredPackages.csdrPackages.forEach((p) => {
138
+ // const pkgPath = path.join(process.cwd(), 'node_modules', p);
139
+ // processPackageConfig(project, pkgPath);
140
+ // })
141
141
 
142
- // checking local packages
143
- filteredPackages.localPackages.forEach((p) => {
144
- const pkgPath = path.join(process.cwd(), 'packages', p);
145
- processPackageConfig(project, pkgPath);
146
- })
142
+ // // checking local packages
143
+ // filteredPackages.localPackages.forEach((p) => {
144
+ // const pkgPath = path.join(process.cwd(), 'packages', p);
145
+ // processPackageConfig(project, pkgPath);
146
+ // })
147
147
 
148
- })
148
+ // })
149
149
 
150
150
 
151
- .catch((e) => {
152
- throw e;
153
- })
154
- }
151
+ // .catch((e) => {
152
+ // throw e;
153
+ // })
154
+ // }
155
155
 
156
- const processPackageConfig = (project, folder) => {
157
- const configPath = path.join(folder, 'assets', 'config');
158
- tools.logInfo(`checking ${configPath}`);
156
+ // const processPackageConfig = (project, folder) => {
157
+ // const configPath = path.join(folder, 'assets', 'config');
158
+ // tools.logInfo(`checking ${configPath}`);
159
159
 
160
- // checking if pkg contains overriden config
161
- if (!tools.isDirExists(configPath)) {
162
- tools.logWarning('not found...skipping');
160
+ // // checking if pkg contains overriden config
161
+ // if (!tools.isDirExists(configPath)) {
162
+ // tools.logWarning('not found...skipping');
163
163
 
164
- // processing the files found and mapping them to base config files
165
- } else {
166
- const configFiles = tools.getFiles(configPath);
167
- tools.logSuccess('OK, found config files : ');
168
- console.log(configFiles);
164
+ // // processing the files found and mapping them to base config files
165
+ // } else {
166
+ // const configFiles = tools.getFiles(configPath);
167
+ // tools.logSuccess('OK, found config files : ');
168
+ // console.log(configFiles);
169
169
 
170
- // checking if files maps the base config file
171
- const projectAssetsPath = path.join(process.cwd(), project.folder, 'src', 'assets');
172
- const baseConfigFiles = tools.getFiles(projectAssetsPath);
170
+ // // checking if files maps the base config file
171
+ // const projectAssetsPath = path.join(process.cwd(), project.folder, 'src', 'assets');
172
+ // const baseConfigFiles = tools.getFiles(projectAssetsPath);
173
173
 
174
- configFiles.forEach((f) => {
175
- if (!baseConfigFiles.includes(f)) {
176
- tools.logWarning(`${f} is not matching base config files`);
174
+ // configFiles.forEach((f) => {
175
+ // if (!baseConfigFiles.includes(f)) {
176
+ // tools.logWarning(`${f} is not matching base config files`);
177
177
 
178
- } else {
179
- tools.logSuccess(`${f} matched in base config files...processing`);
178
+ // } else {
179
+ // tools.logSuccess(`${f} matched in base config files...processing`);
180
180
 
181
- // fetching files content
182
- const configFileContent = tools.getJsonFileContent(path.join(configPath, f));
183
- const baseConfigFileContent = tools.getJsonFileContent(path.join(projectAssetsPath, f));
181
+ // // fetching files content
182
+ // const configFileContent = tools.getJsonFileContent(path.join(configPath, f));
183
+ // const baseConfigFileContent = tools.getJsonFileContent(path.join(projectAssetsPath, f));
184
184
 
185
- baseConfigFileContent.openIdConnect.apiGatewayServices = {
186
- ...baseConfigFileContent.openIdConnect.apiGatewayServices,
187
- ...configFileContent.apiGatewayServices
188
- };
185
+ // baseConfigFileContent.openIdConnect.apiGatewayServices = {
186
+ // ...baseConfigFileContent.openIdConnect.apiGatewayServices,
187
+ // ...configFileContent.apiGatewayServices
188
+ // };
189
189
 
190
- baseConfigFileContent.modules = {
191
- ...baseConfigFileContent.modules,
192
- ...configFileContent.modules
193
- };
190
+ // baseConfigFileContent.modules = {
191
+ // ...baseConfigFileContent.modules,
192
+ // ...configFileContent.modules
193
+ // };
194
194
 
195
- tools.writeJsonFileSync(path.join(projectAssetsPath, f), baseConfigFileContent);
195
+ // tools.writeJsonFileSync(path.join(projectAssetsPath, f), baseConfigFileContent);
196
196
 
197
- tools.logSuccess('OK => file processed');
198
- }
197
+ // tools.logSuccess('OK => file processed');
198
+ // }
199
199
 
200
- })
201
- }
202
- }
200
+ // })
201
+ // }
202
+ // }
203
203
 
204
204
 
205
205
  module.exports.injectConfig = injectConfig;
206
- module.exports.injectPackagesConfig = injectPackagesConfig;
206
+ // module.exports.injectPackagesConfig = injectPackagesConfig;
@@ -110,8 +110,27 @@ module.exports.injectExternalAppSources = (project, build = false) => {
110
110
  return Promise.resolve()
111
111
  .then(() => {
112
112
  if (!build) {
113
- tools.logInfo(`Removing ${projectSrcPath} content`);
114
- return tools.rimraf(projectSrcPath);
113
+ // removing previously injected content, except assets
114
+ const projectSrcAppPath = path.join(projectSrcPath, 'app');
115
+ const projectSrcConfigPath = path.join(projectSrcPath, 'config');
116
+ const projectSrcEnvironmentsPath = path.join(projectSrcPath, 'environments');
117
+
118
+ return Promise.resolve()
119
+ .then(() => {
120
+ tools.logInfo(`Removing ${projectSrcAppPath} content`);
121
+ return tools.rimraf(projectSrcAppPath);
122
+ })
123
+ .then(() => {
124
+ tools.logInfo(`Removing ${projectSrcConfigPath} content`);
125
+ return tools.rimraf(projectSrcConfigPath);
126
+ })
127
+ .then(() => {
128
+ tools.logInfo(`Removing ${projectSrcEnvironmentsPath} content`);
129
+ return tools.rimraf(projectSrcEnvironmentsPath);
130
+ })
131
+ .catch((e) => {
132
+ throw e;
133
+ })
115
134
  }
116
135
  })
117
136
  .then(() => {
@@ -160,6 +160,9 @@ module.exports.injectAppConfig = (project, configEnvTarget) => {
160
160
  envFilePath = path.join(project.paths.angularPath, 'src/assets/config', `env-json-config-${configEnvTarget}.json`);
161
161
  }
162
162
 
163
+ if (project.build && project.build.customEnvJsonConfigInjection) {
164
+ return;
165
+ }
163
166
  if (!tools.isFileExists(envFilePath)) {
164
167
  tools.logError(`Cannot find environment config to inject : `);
165
168
  tools.logError(`${envFilePath} missing...`);