@eui/tools 5.3.83 → 5.3.85

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.83
1
+ 5.3.85
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 5.3.85 (2022-10-28)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * cleanup element serve script for v14 - MWP-8915 [MWP-8915](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-8915) ([7c19c05b](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/7c19c05b2298fe907970b269a74bd1daeb94f652))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.3.84 (2022-10-28)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * adapted element serve for v14 - MWP-8915 [MWP-8915](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-8915) ([70b7b254](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/70b7b2544b19b78b44c438ec6bd21f3863c86149))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 5.3.83 (2022-10-28)
2
20
 
3
21
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.3.83",
3
+ "version": "5.3.85",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -954,4 +954,8 @@ const versionUtils = require('./scripts/csdr/version/version-utils');
954
954
  // })
955
955
 
956
956
 
957
+ // const pkg = configUtils.packages.getPackage('cc-task-centre-eui14-remote-el-ui', true);
957
958
 
959
+ // const version = configUtils.packages.getRemoteEuiVersion(pkg);
960
+ // const versionNumber = version.split('.')[0];
961
+ // console.log(versionNumber);
@@ -245,6 +245,60 @@ module.exports.getDepGraph = () => {
245
245
  }
246
246
 
247
247
 
248
+ const getEuiVersionCore = (pkg) => {
249
+ let version;
250
+
251
+ const depsCompositeFile = path.join(pkg.paths.pkgRootDirectory, 'dependencies-composite.json');
252
+ tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
253
+
254
+ if (!tools.isFileExists(depsCompositeFile)) {
255
+ tools.logInfo('---- no dependencies-composite.json file found');
256
+ } else {
257
+ const deps = tools.getJsonFileContent(depsCompositeFile);
258
+ const euiDepsBase = deps['@eui/deps-base'];
259
+
260
+ if (euiDepsBase) {
261
+ let euiVersion = euiDepsBase.split('.')[0];
262
+
263
+ if (euiVersion.substr(0,1) === '^') {
264
+ euiVersion = euiVersion.substr(1);
265
+ }
266
+ version = `${euiVersion}.x`;
267
+
268
+ if (version === '7.x') {
269
+ version = 'DEFAULT';
270
+ }
271
+ }
272
+ }
273
+
274
+ return version;
275
+ }
276
+
277
+
278
+ module.exports.getRemoteEuiVersion = (pkg) => {
279
+ if (pkg.parent !== true && pkg.tsPackage !== false) {
280
+ tools.logInfo(`checking ${pkg.name}`);
281
+
282
+ let version;
283
+
284
+ if (pkg.build && pkg.build.euiVersion) {
285
+ version = pkg.build.euiVersion;
286
+
287
+ } else {
288
+ version = getEuiVersionCore(pkg);
289
+ }
290
+
291
+ if (version) {
292
+ tools.logInfo(`---- version found : ${version}\n`);
293
+ } else {
294
+ tools.logInfo('---- version detection skipped');
295
+ }
296
+
297
+ return version;
298
+ }
299
+ }
300
+
301
+
248
302
  const getPackageEuiVersion = module.exports.getPackageEuiVersion = (pkg) => {
249
303
  if (pkg.parent !== true && pkg.tsPackage !== false) {
250
304
  tools.logInfo(`checking ${pkg.name}`);
@@ -255,28 +309,7 @@ const getPackageEuiVersion = module.exports.getPackageEuiVersion = (pkg) => {
255
309
  version = pkg.build.euiVersion;
256
310
 
257
311
  } else if (!pkg.remote) {
258
- const depsCompositeFile = path.join(pkg.paths.pkgRootDirectory, 'dependencies-composite.json');
259
- tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
260
-
261
- if (!tools.isFileExists(depsCompositeFile)) {
262
- tools.logInfo('---- no dependencies-composite.json file found');
263
- } else {
264
- const deps = tools.getJsonFileContent(depsCompositeFile);
265
- const euiDepsBase = deps['@eui/deps-base'];
266
-
267
- if (euiDepsBase) {
268
- let euiVersion = euiDepsBase.split('.')[0];
269
-
270
- if (euiVersion.substr(0,1) === '^') {
271
- euiVersion = euiVersion.substr(1);
272
- }
273
- version = `${euiVersion}.x`;
274
-
275
- if (version === '7.x') {
276
- version = 'DEFAULT';
277
- }
278
- }
279
- }
312
+ version = getEuiVersionCore(pkg);
280
313
  }
281
314
 
282
315
  if (version) {
@@ -13,6 +13,8 @@ module.exports.serve = () => {
13
13
 
14
14
  const pkg = configUtils.packages.getPackage();
15
15
 
16
+ const remoteEuiVersion = configUtils.packages.getRemoteEuiVersion(pkg);
17
+
16
18
  const ng = path.resolve(pkg.paths.repoNodeModules, '@angular', 'cli', 'bin', 'ng');
17
19
 
18
20
 
@@ -38,9 +40,16 @@ module.exports.serve = () => {
38
40
 
39
41
  const destPath = path.join(process.cwd(), 'apps', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
40
42
 
41
- args.push(`--outputPath=${destPath}`);
43
+ const versionNumber = remoteEuiVersion.split('.')[0];
44
+
45
+ if (versionNumber <= 10) {
46
+ args.push(`--outputPath=${destPath}`);
47
+ args.push(`--single-bundle=true`);
48
+ } else {
49
+ args.push(`--output-path=${destPath}`);
50
+ }
51
+
42
52
  args.push('--watch=true');
43
- args.push(`--single-bundle=true`);
44
53
  args.push(`--output-hashing=none`);
45
54
 
46
55
  if (configuration) {