@eui/tools 5.2.0 → 5.2.3

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.2.0
1
+ 5.2.3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 5.2.3 (2022-05-03)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * wrong tag set for envTarget based packages/remotes - EUI-5632 [EUI-5632](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5632) ([6f9a69d2](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/6f9a69d2e73067902592575a6c97d7c0e5633d40))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.2.2 (2022-05-03)
11
+
12
+ ##### Bug Fixes
13
+
14
+ * **other:**
15
+ * missing configuration injection for v14 normal app config - EUI-4106 [EUI-4106](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4106) ([16e1260c](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/16e1260c4845c65f2743c1ca1e9ae5a455dc51bc))
16
+
17
+ * * *
18
+ * * *
19
+ ## 5.2.1 (2022-05-02)
20
+
21
+ ##### Bug Fixes
22
+
23
+ * **other:**
24
+ * wrong initial version set for envTarget remote delivery - EUI-5632 [EUI-5632](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5632) ([cc894439](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/cc8944393d48bb9b7ae2ee5afb3ab5052983f4a5))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 5.2.0 (2022-04-29)
2
29
 
3
30
  ##### New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.2.0",
3
+ "version": "5.2.3",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -790,7 +790,7 @@ const versionUtils = require('./scripts/csdr/version/version-utils');
790
790
  // METADATA API TESTING
791
791
  // --------------------
792
792
  // const metadataModule = require('./scripts/csdr/metadata/v2');
793
- // const pkg = configUtils.packages.getPackage('mywp-dummy-eui10-remote-el-ui');
793
+ // const pkg = configUtils.packages.getPackage('cc-task-details-eui10-remote-el-ui');
794
794
 
795
795
  // Promise.resolve()
796
796
  // .then(() => {
@@ -840,12 +840,33 @@ const versionUtils = require('./scripts/csdr/version/version-utils');
840
840
  // })
841
841
 
842
842
 
843
- const pkg = configUtils.packages.getPackage('opsys-epc-esub-bo-ui', true);
843
+ // METADATA ESTING
844
+ // --------------------
845
+ const pkg = configUtils.packages.getPackage('cc-task-details-eui10-remote-el-ui');
846
+ const envTarget = 'DEV';
847
+
848
+ let versionsMetadata, envsMetadata;
844
849
 
845
850
  Promise.resolve()
851
+ // generating new version based on the env target and the envs cycle type
846
852
  .then(() => {
847
- return metadataUtils.package.getPackageVersionsByMajor(pkg, '10', false)
853
+ return versionUtils.packageRemote.getNewVersion(pkg, envTarget);
848
854
  })
849
- .then((versions) => {
850
- console.log(versions);
855
+ .then((version) => {
856
+ console.log(version);
851
857
  })
858
+
859
+
860
+
861
+
862
+
863
+
864
+ // const pkg = configUtils.packages.getPackage('opsys-epc-esub-bo-ui', true);
865
+
866
+ // Promise.resolve()
867
+ // .then(() => {
868
+ // return metadataUtils.package.getPackageVersionsByMajor(pkg, '10', false)
869
+ // })
870
+ // .then((versions) => {
871
+ // console.log(versions);
872
+ // })
@@ -311,6 +311,36 @@ const angularProjectDefV13 = {
311
311
  }
312
312
  ]
313
313
  },
314
+ "production-optimized-no-openid": {
315
+ "fileReplacements": [
316
+ {
317
+ "replace": "apps/@project.name@/src/environments/environment.ts",
318
+ "with": "apps/@project.name@/src/environments/environment.prod.ts"
319
+ }
320
+ ],
321
+ "optimization": {
322
+ "scripts": true,
323
+ "styles": {
324
+ "minify": false,
325
+ "inlineCritical": true
326
+ },
327
+ "fonts": true
328
+ },
329
+ "outputHashing": "all",
330
+ "sourceMap": false,
331
+ "namedChunks": true,
332
+ "aot": true,
333
+ "extractLicenses": true,
334
+ "vendorChunk": false,
335
+ "buildOptimizer": true,
336
+ "budgets": [
337
+ {
338
+ "type": "initial",
339
+ "maximumWarning": "2mb",
340
+ "maximumError": "6mb"
341
+ }
342
+ ]
343
+ },
314
344
  "development": {
315
345
  "buildOptimizer": false,
316
346
  "optimization": false,
@@ -433,6 +463,36 @@ const angularProjectDefV14 = {
433
463
  }
434
464
  ]
435
465
  },
466
+ "production-optimized-no-openid": {
467
+ "fileReplacements": [
468
+ {
469
+ "replace": "apps/@project.name@/src/environments/environment.ts",
470
+ "with": "apps/@project.name@/src/environments/environment.prod.ts"
471
+ }
472
+ ],
473
+ "optimization": {
474
+ "scripts": true,
475
+ "styles": {
476
+ "minify": false,
477
+ "inlineCritical": true
478
+ },
479
+ "fonts": true
480
+ },
481
+ "outputHashing": "all",
482
+ "sourceMap": false,
483
+ "namedChunks": true,
484
+ "aot": true,
485
+ "extractLicenses": true,
486
+ "vendorChunk": false,
487
+ "buildOptimizer": true,
488
+ "budgets": [
489
+ {
490
+ "type": "initial",
491
+ "maximumWarning": "2mb",
492
+ "maximumError": "6mb"
493
+ }
494
+ ]
495
+ },
436
496
  "development": {
437
497
  "buildOptimizer": false,
438
498
  "optimization": false,
@@ -260,7 +260,8 @@ module.exports.updateVersion = (pkg, pkgMetadata, envTarget) => {
260
260
  (branches.isSnapshot || branches.isSupportSnapshot),
261
261
  branches.isNext,
262
262
  branches.isSupport,
263
- branches.isHotfix
263
+ branches.isHotfix,
264
+ envTarget
264
265
  );
265
266
  })
266
267
 
@@ -7,7 +7,7 @@ const semver = require('semver');
7
7
  const tools = require('../../utils/tools');
8
8
 
9
9
 
10
- const getNewVersionForDev = (versionsMetadata, envsMetadata, rootEnv) => {
10
+ const getNewVersionForDev = (versionsMetadata, envsMetadata, rootEnv, currentVersion) => {
11
11
  let version;
12
12
  const lastIntMetadata = envsMetadata[rootEnv];
13
13
 
@@ -19,7 +19,11 @@ const getNewVersionForDev = (versionsMetadata, envsMetadata, rootEnv) => {
19
19
 
20
20
  } else {
21
21
  tools.logInfo('No INT metadata found : initializing version');
22
- version = '1.0.0-SNAPSHOT';
22
+ if (currentVersion) {
23
+ version = semver.coerce(currentVersion).raw + '-SNAPSHOT';
24
+ } else {
25
+ version = '1.0.0-SNAPSHOT';
26
+ }
23
27
  tools.logInfo(`version intialized : ${version}`);
24
28
  }
25
29
 
@@ -48,6 +52,7 @@ const getNewVersionForDev = (versionsMetadata, envsMetadata, rootEnv) => {
48
52
 
49
53
  // if it's a branch new DEV stream release, the snapshot is itialized
50
54
  } else {
55
+ tools.logInfo(`prevVersions matching: ${version} not found initializing first release of raw version`);
51
56
  version += '.0';
52
57
  }
53
58
  }
@@ -132,7 +137,7 @@ const getNewVersionForEnv = (versionsMetadata, envsMetadata, rootEnv, envTarget)
132
137
 
133
138
 
134
139
 
135
- module.exports.getNewVersionDefault = (envTarget, versionsMetadata, envsMetadata) => {
140
+ module.exports.getNewVersionDefault = (envTarget, versionsMetadata, envsMetadata, currentVersion) => {
136
141
  tools.logInfo(`Retrieve version for ${envTarget}`);
137
142
 
138
143
  return Promise.resolve()
@@ -145,7 +150,7 @@ module.exports.getNewVersionDefault = (envTarget, versionsMetadata, envsMetadata
145
150
  // =====================================================================
146
151
 
147
152
  if (envTarget === 'DEV') {
148
- version = getNewVersionForDev(versionsMetadata, envsMetadata, 'INT');
153
+ version = getNewVersionForDev(versionsMetadata, envsMetadata, 'INT', currentVersion);
149
154
  }
150
155
 
151
156
 
@@ -16,7 +16,7 @@ const configUtils = require('../config/config-utils');
16
16
  const { dryRun, nexusUser, nexusPassword } = tools.getArgs();
17
17
 
18
18
 
19
- const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
19
+ const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget) => {
20
20
  return Promise.resolve()
21
21
  .then(() => {
22
22
  const pkgJsonFile = path.resolve(folder, 'package.json');
@@ -48,7 +48,7 @@ const writePackageJsonCore = (newVersion, folder, isSnapshot, isNextBranch, isSu
48
48
  })
49
49
  }
50
50
 
51
- const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
51
+ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget) => {
52
52
  return Promise.resolve()
53
53
  .then(() => {
54
54
  tools.logTitle('updating package version');
@@ -56,11 +56,11 @@ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBr
56
56
  if (!pkg.parent) {
57
57
  return Promise.resolve()
58
58
  .then(() => {
59
- return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
59
+ return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget);
60
60
  })
61
61
  .then(() => {
62
62
  if (!pkg.element && !pkg.config) {
63
- return writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
63
+ return writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget);
64
64
  }
65
65
  })
66
66
  .catch((e) => {
@@ -70,7 +70,7 @@ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBr
70
70
  } else {
71
71
  return Promise.resolve()
72
72
  .then(() => {
73
- return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
73
+ return writePackageJsonCore(newVersion, pkg.paths.pkgDirectory, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget);
74
74
  })
75
75
  .then(() => {
76
76
  let linkedPackages = Object.keys(pkg.packages)
@@ -85,7 +85,7 @@ const writePackageJson = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBr
85
85
  .then((linkedPackages) => Promise.resolve().then(() => {
86
86
  return linkedPackages.reduce((promise, pkg) => {
87
87
  return promise.then(() => (
88
- writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch)
88
+ writePackageJsonCore(newVersion, pkg.paths.pkgPublish, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget)
89
89
  ));
90
90
  }, Promise.resolve());
91
91
  }))
@@ -113,7 +113,7 @@ const writePomXml = (pkg, newVersion, isSnapshot, isForceTimestamp = true) => {
113
113
  if (dryRun) {
114
114
  return;
115
115
  }
116
-
116
+
117
117
  return Promise.resolve()
118
118
  .then(() => {
119
119
  return templateUtils.generateMavenSettings(nexusUser, nexusPassword);
@@ -146,13 +146,56 @@ const writePomXml = (pkg, newVersion, isSnapshot, isForceTimestamp = true) => {
146
146
 
147
147
 
148
148
 
149
- module.exports.updateVersion = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch) => {
149
+ module.exports.updateVersion = (pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget) => {
150
150
  if (pkg.backend) {
151
151
  return writePomXml(pkg, newVersion, isSnapshot);
152
152
  }
153
153
  else {
154
- return writePackageJson(pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch);
154
+ return writePackageJson(pkg, newVersion, isSnapshot, isNextBranch, isSupportBranch, isHotfixBranch, envTarget);
155
155
  }
156
156
  }
157
157
 
158
158
 
159
+ module.exports.getCurrentVersion = (pkg) => {
160
+ return Promise.resolve()
161
+ .then(() => {
162
+ let currentVersion;
163
+
164
+ tools.logTitle('Extracting current version');
165
+
166
+ if (pkg.backend) {
167
+ // if nodejs backend, explicitely declared
168
+ if (pkg.build && pkg.build.nodejs) {
169
+ tools.logInfo('UI package => extracting from package.json');
170
+
171
+ const pathPkgJson = path.resolve(pkg.paths.pkgDirectory, 'package.json');
172
+ const pkgJson = require(pathPkgJson);
173
+ currentVersion = pkgJson.version;
174
+
175
+ // by default maven java backend is taken into account
176
+ } else {
177
+ tools.logInfo('Backend => extracting pom.xml');
178
+ const xmlContent = tools.getXMLJsContent(path.join(pkg.paths.pkgDirectory, 'pom.xml'));
179
+
180
+ tools.logInfo('Content found:');
181
+ console.log(xmlContent);
182
+
183
+ currentVersion = xmlContent.project.version.toString();
184
+ }
185
+
186
+ } else {
187
+ tools.logInfo('UI package => extracting from package.json');
188
+
189
+ const pathPkgJson = path.resolve(pkg.paths.pkgDirectory, 'package.json');
190
+ const pkgJson = require(pathPkgJson);
191
+ currentVersion = pkgJson.version;
192
+ }
193
+
194
+ tools.logSuccess('Current version found : ' + currentVersion);
195
+ return currentVersion;
196
+ })
197
+ .catch((e) => {
198
+ throw e;
199
+ })
200
+ }
201
+
@@ -2,57 +2,13 @@
2
2
 
3
3
  // externals
4
4
  const semver = require('semver');
5
- const path = require('path');
6
5
 
7
6
  // local
8
7
  const tools = require('../../utils/tools');
9
8
 
10
- const RELEASE_TYPES = ['major', 'minor', 'patch'];
9
+ // inner
10
+ const innerPackageCommon = require('./package-common');
11
11
 
12
- const getCurrentVersion = (pkg) => {
13
- return Promise.resolve()
14
- .then(() => {
15
- let currentVersion;
16
-
17
- tools.logTitle('Extracting current version');
18
-
19
- if (pkg.backend) {
20
- // if nodejs backend, explicitely declared
21
- if (pkg.build && pkg.build.nodejs) {
22
- tools.logInfo('UI package => extracting from package.json');
23
-
24
- const pathPkgJson = path.resolve(pkg.paths.pkgDirectory, 'package.json');
25
- const pkgJson = require(pathPkgJson);
26
- currentVersion = pkgJson.version;
27
-
28
- // by default maven java backend is taken into account
29
- } else {
30
- tools.logInfo('Backend => extracting pom.xml');
31
- const xmlContent = tools.getXMLJsContent(path.join(pkg.paths.pkgDirectory, 'pom.xml'));
32
-
33
- tools.logInfo('Content found:');
34
- console.log(xmlContent);
35
-
36
- currentVersion = xmlContent.project.version.toString();
37
- }
38
-
39
- } else {
40
- tools.logInfo('UI package => extracting from package.json');
41
-
42
- const pathPkgJson = path.resolve(pkg.paths.pkgDirectory, 'package.json');
43
- const pkgJson = require(pathPkgJson);
44
- currentVersion = pkgJson.version;
45
- }
46
-
47
- tools.logSuccess('Current version found : ' + currentVersion);
48
- return currentVersion;
49
- })
50
- .catch((e) => {
51
- throw e;
52
- })
53
- }
54
-
55
- // PUBLIC METHODS
56
12
 
57
13
  module.exports.getNewVersion = (
58
14
  pkg,
@@ -61,7 +17,7 @@ module.exports.getNewVersion = (
61
17
  ) => {
62
18
  return Promise.resolve()
63
19
  .then(() => {
64
- return getCurrentVersion(pkg);
20
+ return innerPackageCommon.getCurrentVersion(pkg);
65
21
  })
66
22
 
67
23
  .then((currentVersion) => {
@@ -69,6 +25,8 @@ module.exports.getNewVersion = (
69
25
 
70
26
  tools.logInfo(`Current version found : ${currentVersion}`);
71
27
 
28
+ const RELEASE_TYPES = ['major', 'minor', 'patch'];
29
+
72
30
  let newVersion = '1.0.0';
73
31
 
74
32
  if (commits) {
@@ -12,6 +12,7 @@ const metadataUtils = require('../metadata/metadata-utils');
12
12
 
13
13
  // inner modules
14
14
  const innerCommon = require('./common');
15
+ const innerPackageCommon = require('./package-common');
15
16
 
16
17
  // constants
17
18
  const { dryRun } = tools.getArgs();
@@ -21,8 +22,17 @@ const { dryRun } = tools.getArgs();
21
22
  module.exports.getNewVersion = (pkg, envTarget) => {
22
23
  let versionsMetadata;
23
24
  let envsMetadata;
25
+ let currentVersion;
24
26
 
25
27
  return Promise.resolve()
28
+ // get current version
29
+ .then(() => {
30
+ return innerPackageCommon.getCurrentVersion(pkg);
31
+ })
32
+ .then((version) => {
33
+ currentVersion = version;
34
+ })
35
+
26
36
  // fetch versions history and store
27
37
  .then(() => {
28
38
  return metadataUtils.packageVersions.getMetadata(pkg);
@@ -42,7 +52,7 @@ module.exports.getNewVersion = (pkg, envTarget) => {
42
52
 
43
53
  // generating new version based on the env target and the envs cycle type
44
54
  .then(() => {
45
- return innerCommon.getNewVersionDefault(envTarget, versionsMetadata, envsMetadata);
55
+ return innerCommon.getNewVersionDefault(envTarget, versionsMetadata, envsMetadata, currentVersion);
46
56
  })
47
57
 
48
58
  .catch((e) => {
@@ -9,6 +9,7 @@ const innerPackage = require('./package');
9
9
  const innerPackageCommon = require('./package-common');
10
10
  const innerPackageRemote = require('./package-remote');
11
11
  const innerPackageDefault = require('./package-default');
12
+ const innerCommon = require('./common');
12
13
 
13
14
  // re-exports inner modules
14
15
  module.exports.app = innerApp;
@@ -19,3 +20,4 @@ module.exports.package = innerPackage;
19
20
  module.exports.packageCommon = innerPackageCommon;
20
21
  module.exports.packageRemote = innerPackageRemote;
21
22
  module.exports.packageDefault = innerPackageDefault;
23
+ module.exports.common = innerCommon;