@eui/tools 6.1.3 → 6.1.5

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.1.3
1
+ 6.1.5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.1.5 (2022-11-08)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * rebase from 5.x - adapted element build - fix last error over current MWP - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([27db36c5](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/27db36c506e2cf30d8a69371cd7cf5d94c2a8519))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.1.4 (2022-11-08)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * tsconfig path fixes - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([5f7c80d4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/5f7c80d459b427127e2cc3c1282aaaace6fe5cdc))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.1.3 (2022-11-07)
2
20
 
3
21
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.1.3",
3
+ "version": "6.1.5",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -46,6 +46,7 @@
46
46
  "svg-sprite": "2.0.0",
47
47
  "imagemin": "7.0.1",
48
48
  "imagemin-svgo": "9.0.0",
49
- "lunr": "2.3.9"
49
+ "lunr": "2.3.9",
50
+ "concat": "1.0.3"
50
51
  }
51
52
  }
@@ -25,6 +25,7 @@ const {
25
25
  angularProjectDefConfigurationOptimizedLight,
26
26
  angularPackageDef,
27
27
  angularPackageSubEntryDef,
28
+ angularPackageSubEntryDef15,
28
29
  angularPackageDefV13,
29
30
  angularPackageDefV14,
30
31
  angularPackageDefV15,
@@ -206,7 +206,6 @@ module.exports.getPackagePaths = (pkg) => {
206
206
  pkgPublish: resolvePath(packagesPath + '/' + folder + publishFolder),
207
207
  pkgSrc: resolvePath(packagesPath + '/' + folder + '/src'),
208
208
  pkgLibFolder: resolvePath(packagesPath + '/' + folder + '/src/lib'),
209
- tsConfig: this.getTSConfigPath(resolvePath, packagesPath + '/' + folder),
210
209
  };
211
210
 
212
211
  return paths;
@@ -417,7 +416,7 @@ module.exports.getTSConfigPath = (resolvePath, packagePath) => {
417
416
  const tsPath = resolvePath(`${packagePath}/tsconfig.json`);
418
417
  const oldPath = resolvePath(`${packagePath}/tsconfig.lib.json`);
419
418
 
420
- return tools.isDirExists(tsPath) ? tsPath : oldPath;
419
+ return tools.isFileExists(tsPath) ? tsPath : oldPath;
421
420
  }
422
421
 
423
422
  module.exports.getTSConfigFileName = (tsConfigPath) => {
@@ -100,7 +100,7 @@ module.exports.getRemappedDeps = (pkgDeps, pkgDefaultDeps, isMaster) => {
100
100
  .reduce((acc, k) => {
101
101
 
102
102
  // if the package is being part of CSDR
103
- if (pkgDeps[k]) {
103
+ if (pkgDeps[k] && typeof(pkgDeps[k]) !== 'function') {
104
104
 
105
105
  const latestTagMajor = pkgDeps[k].split('.')[0];
106
106
 
@@ -476,14 +476,8 @@ module.exports.getPackageVersionsByMajor = (pkg, major, isMaster) => {
476
476
  tools.logInfo(`----> ${versions.length} metadata versions found excluding snapshots`);
477
477
 
478
478
  } else {
479
- versions = versions.filter(v => v.version.indexOf('snapshot') !== -1);
480
- tools.logInfo(`----> ${versions.length} metadata versions found including snapshots`);
481
-
482
- if (versions.length === 0) {
483
- versions = pkgVersions.filter(v => v.version.split('.')[0] === major);
484
- versions = versions.filter(v => v.version.indexOf('snapshot') === -1);
485
- tools.logInfo(`----> ${versions.length} metadata versions non-master release for major`);
486
- }
479
+ versions = pkgVersions.filter(v => v.version.split('.')[0] === major);
480
+ tools.logInfo(`----> ${versions.length} metadata versions non-master release for major`);
487
481
  }
488
482
 
489
483
  return versions;
@@ -111,7 +111,7 @@ const commitAndPush = (branch, message, folder) => {
111
111
 
112
112
  try {
113
113
  tools.logInfo('Commit and push - second try - retrying pull & push');
114
- execa.sync('git', ['pull', 'origin', branch], { cwd: folder });
114
+ execa.sync('git', ['pull', 'origin', branch, '--rebase'], { cwd: folder });
115
115
  execa.sync('git', ['push', 'origin', branch], { cwd: folder });
116
116
 
117
117
  } catch (e3) {
@@ -146,11 +146,6 @@ const tagVersion = (version, branch, message, folder) => {
146
146
  })
147
147
  .catch((e) => {
148
148
  return Promise.resolve()
149
- // .then(() => {
150
- // return new Promise((resolve) => {
151
- // setTimeout(resolve, 8000);
152
- // });
153
- // })
154
149
  .then(() => {
155
150
  execa.sync('git', ['tag', '-a', `v${version}b`, '-m', message], { cwd: folder });
156
151
  execa.sync('git', ['push', '--follow-tags', 'origin', branch], { cwd: folder });
@@ -165,33 +160,6 @@ const tagVersion = (version, branch, message, folder) => {
165
160
  }
166
161
  }
167
162
 
168
-
169
-
170
- // const forceSnapshot = (pkg, folder, version) => {
171
- // return Promise.resolve()
172
- // .then(() => {
173
- // tools.logInfo('Setting back snapshot in develop');
174
- // const newVersion = semver.inc(version, 'patch') + '-SNAPSHOT';
175
- // tools.logInfo('new snapshot version increment : ' + newVersion);
176
-
177
- // tools.logInfo('Checkout develop');
178
- // execa.shellSync('git checkout develop', { cwd: folder });
179
-
180
- // return versionUtils.writePomXml(pkg, newVersion, false, false);
181
- // })
182
- // .then(() => {
183
- // return commitAndPush(
184
- // 'develop',
185
- // `chore(release): forced next increment snapshot version ${newVersion} - from CI server`,
186
- // folder
187
- // );
188
- // })
189
- // .catch((e) => {
190
- // throw e;
191
- // })
192
- // }
193
-
194
-
195
163
  const mergeMasterToDevelop = (pkg, folder, version) => {
196
164
  tools.logTitle('Merge back on develop');
197
165
  tools.logInfo(`Merging release changes into "develop" branch...`);
@@ -216,12 +184,6 @@ const mergeMasterToDevelop = (pkg, folder, version) => {
216
184
  execa.shellSync('git push origin develop', { cwd: folder });
217
185
  execa.shellSync('git checkout master', { cwd: folder });
218
186
  })
219
- // TODO test in on local backend service before activation
220
- // .then(() => {
221
- // if (version && pkg.backend) {
222
- // return forceSnapshot(pkg, inputPath, version);
223
- // }
224
- // })
225
187
  .then(() => {
226
188
  tools.logSuccess();
227
189
  })
@@ -2,11 +2,14 @@
2
2
 
3
3
  const path = require('path');
4
4
  const execa = require('execa');
5
+ const concat = require('concat');
5
6
 
6
7
  const tools = require('../tools');
8
+
7
9
  const preBuildUtils = require('../pre-build/pre-build-utils');
8
10
  const configUtils = require('../../csdr/config/config-utils');
9
11
 
12
+
10
13
  module.exports.serve = () => {
11
14
 
12
15
  let { project, configuration, baseHref, host, proxyConfig, maxSpaceSize, port } = tools.getArgs();
@@ -17,6 +20,13 @@ module.exports.serve = () => {
17
20
 
18
21
  const ng = path.resolve(pkg.paths.repoNodeModules, '@angular', 'cli', 'bin', 'ng');
19
22
 
23
+ let destPath;
24
+
25
+ if (!project) {
26
+ tools.logInfo('Project paramater must be specified...stopping');
27
+ return;
28
+ }
29
+
20
30
 
21
31
  return Promise.resolve()
22
32
  .then(() => {
@@ -30,95 +40,69 @@ module.exports.serve = () => {
30
40
  .then(() => {
31
41
  var args;
32
42
 
33
- if (project) {
34
-
35
- if (maxSpaceSize) {
36
- args = ['--max_old_space_size=4096', ng, 'build', pkg.name];
37
- } else {
38
- args = [ng, 'build', pkg.name];
39
- }
40
-
41
- const projectConfig = configUtils.projects.getProject(project);
42
-
43
- let destPath;
44
- if (projectConfig.host && projectConfig.virtual) {
45
- destPath = path.join(process.cwd(), 'hosts', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
46
- } else {
47
- destPath = path.join(process.cwd(), 'apps', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
48
- }
49
-
50
- const versionNumber = remoteEuiVersion.split('.')[0];
51
-
52
- if (versionNumber <= 10) {
53
- args.push(`--outputPath=${destPath}`);
54
- args.push(`--single-bundle=true`);
55
- } else {
56
- args.push(`--output-path=${destPath}`);
57
- }
58
-
59
- args.push('--watch=true');
60
- args.push(`--output-hashing=none`);
61
-
62
- if (configuration) {
63
- args.push(`--configuration=${configuration || 'production'}`);
64
- }
65
-
66
- const webpackExtraFile = path.join(pkg.paths.pkgRootDirectory, 'webpack.extra.js');
67
- if (tools.isFileExists(webpackExtraFile)) {
68
- args.push(`--extra-webpack-config=${webpackExtraFile}`);
69
- }
70
-
71
- tools.logInfo(`ng build with args ${args}`);
72
-
73
-
74
-
43
+ if (maxSpaceSize) {
44
+ args = ['--max_old_space_size=4096', ng, 'build', pkg.name];
75
45
  } else {
46
+ args = [ng, 'build', pkg.name];
47
+ }
76
48
 
77
- if (maxSpaceSize) {
78
- args = ['--max_old_space_size=4096', ng, 'serve', pkg.name];
79
- } else {
80
- args = [ng, 'serve', pkg.name];
81
- }
82
-
83
- if (configuration) {
84
- args.push(`--configuration=${configuration}`);
85
- }
86
-
87
- if (proxyConfig) {
88
- args.push(`--proxy-config=${proxyConfig}`);
89
- }
90
-
91
- if (baseHref) {
92
- args.push(`--base-href=${baseHref}`);
93
- }
49
+ const projectConfig = configUtils.projects.getProject(project);
94
50
 
95
- if (host) {
96
- args.push(`--host=${host}`);
97
- }
51
+ if (projectConfig.host && projectConfig.virtual) {
52
+ destPath = path.join(process.cwd(), 'hosts', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
53
+ } else {
54
+ destPath = path.join(process.cwd(), 'apps', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
55
+ }
98
56
 
99
- if (port) {
100
- args.push(`--port=${port}`);
101
- } else {
102
- args.push(`--port=4202`);
103
- }
57
+ const versionNumber = remoteEuiVersion.split('.')[0];
104
58
 
105
- args.push('--open=true');
59
+ if (versionNumber <= 10) {
60
+ args.push(`--outputPath=${destPath}`);
61
+ args.push(`--single-bundle=true`);
62
+ } else {
63
+ args.push(`--output-path=${destPath}`);
64
+ }
106
65
 
66
+ args.push('--watch=true');
67
+ args.push(`--output-hashing=none`);
107
68
 
108
- tools.logInfo(`ng serve with args ${args}`);
69
+ if (configuration) {
70
+ args.push(`--configuration=${configuration || 'production'}`);
71
+ }
109
72
 
73
+ const webpackExtraFile = path.join(pkg.paths.pkgRootDirectory, 'webpack.extra.js');
74
+ if (tools.isFileExists(webpackExtraFile)) {
75
+ args.push(`--extra-webpack-config=${webpackExtraFile}`);
110
76
  }
111
77
 
78
+ tools.logInfo(`ng build with args ${args}`);
79
+
112
80
  const spawnSync = require('child_process').spawnSync;
113
81
  const output = spawnSync('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
114
82
 
115
83
  if (output.error) {
116
84
  throw new Error(JSON.stringify(output));
117
85
  }
118
-
119
- // breaking on MacOS for unknown reasons...
120
- // return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
121
86
  })
87
+
88
+ // activate in case concat is needed
89
+ // .then(() => {
90
+ // const destPath = path.join(process.cwd(), 'hosts', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
91
+
92
+ // tools.move(path.join(destPath, 'main.js'), path.join(destPath, 'main-old.js'));
93
+
94
+ // const files = [
95
+ // 'runtime.js',
96
+ // 'polyfills.js',
97
+ // 'scripts.js',
98
+ // 'main-old.js'
99
+ // ].map(f => path.join(destPath, f));
100
+
101
+ // const outFilePath = path.join(destPath, 'main.js');
102
+
103
+ // return concat(files, outFilePath);
104
+ // })
105
+
122
106
  .catch((e) => {
123
107
  throw e;
124
108
  });