@eui/tools 4.21.0 → 4.21.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
- 4.21.0
1
+ 4.21.3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 4.21.3 (2022-03-17)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * force yarn.lock updates for v10 ui packages - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([f2dfc5c0](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/f2dfc5c0e0119945e8a14b7492b8e458bc0229ed))
7
+
8
+ * * *
9
+ * * *
10
+ ## 4.21.2 (2022-03-17)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * re-enable remove of yarn.lock for package - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([c4c34ad7](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/c4c34ad71332f58b4b3a70e91cd0b514d797636d))
16
+
17
+ * * *
18
+ * * *
19
+ ## 4.21.1 (2022-03-17)
20
+
21
+ ##### Chores
22
+
23
+ * **other:**
24
+ * disable remove of yarn.lock for pkg build - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([17326a12](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/17326a1248ed34d4fe85e63e9a881fc4924e916a))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 4.21.0 (2022-03-15)
2
29
 
3
30
  ##### New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "4.21.0",
3
+ "version": "4.21.3",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -688,8 +688,24 @@ const translationUtils = require('./scripts/utils/pre-build/translations/transla
688
688
  // return compositeUtils.getDeps(prj, 'DEV');
689
689
  // })
690
690
 
691
+ // return Promise.resolve()
692
+ // .then(() => {
693
+ // const configOptions = configUtils.global.getConfigOptions();
694
+ // console.log(configOptions);
695
+ // })
696
+
691
697
  return Promise.resolve()
692
698
  .then(() => {
693
- const configOptions = configUtils.global.getConfigOptions();
694
- console.log(configOptions);
699
+ const versions = configUtils.packages.getLocalPackagesEuiVersion();
700
+ console.log(versions);
695
701
  })
702
+
703
+ // return Promise.resolve()
704
+ // .then(() => {
705
+ // const fileContent = tools.getJsonFileContent(path.join(process.cwd(), 'packages', 'devops-metadata', 'cc-task-centre-eui10-remote-el-ui-versions-metadata.json'));
706
+ // let out = '';
707
+ // const versions = fileContent.versions.filter(v => v.duration !== undefined).map((v) => {
708
+ // out += `${v.date.substring(0,8)},${v.duration/1000}\n`;
709
+ // })
710
+ // tools.writeFileContent(path.join(process.cwd(), 'extract.txt'), out);
711
+ // })
@@ -242,22 +242,43 @@ module.exports.getDepGraph = () => {
242
242
 
243
243
 
244
244
  module.exports.getLocalPackagesEuiVersion = () => {
245
- tools.logInfo('getting local packages installed eUI version...');
245
+ tools.logTitle('getting local packages installed eUI version...');
246
246
 
247
247
  const pkgs = getPackages();
248
248
  let versionsFound = [];
249
249
 
250
250
  pkgs.forEach((p) => {
251
251
  if (p.parent !== true && p.tsPackage !== false) {
252
+ tools.logInfo(`checking ${p.name}`);
252
253
 
253
254
  let version = 'DEFAULT';
254
255
 
255
- if (p.build) {
256
- if (p.build.euiVersion) {
257
- version = p.build.euiVersion;
256
+ if (p.build && p.build.euiVersion) {
257
+ version = p.build.euiVersion;
258
+
259
+ } else {
260
+ const depsCompositeFile = path.join(p.paths.pkgRootDirectory, 'dependencies-composite.json');
261
+ tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
262
+
263
+ if (!tools.isFileExists(depsCompositeFile)) {
264
+ tools.logInfo('---- no dependencies-composite.json file found');
265
+ } else {
266
+ const deps = tools.getJsonFileContent(depsCompositeFile);
267
+ const euiDepsBase = deps['@eui/deps-base'];
268
+
269
+ if (euiDepsBase) {
270
+ let euiVersion = euiDepsBase.split('.')[0];
271
+
272
+ if (euiVersion.substr(0,1) === '^') {
273
+ euiVersion = euiVersion.substr(1);
274
+ }
275
+ version = `${euiVersion}.x`;
276
+ }
258
277
  }
259
278
  }
260
- tools.logInfo(`checking ${p.name} - version found : ${version}`);
279
+
280
+ tools.logInfo(`---- version found : ${version}\n`);
281
+
261
282
  versionsFound.push(version);
262
283
  }
263
284
  })
@@ -193,7 +193,7 @@ module.exports.processLocalEuiVersions = () => {
193
193
  const euiVersion = euiVersionsLocal[0];
194
194
 
195
195
  if (!euiVersion || euiVersion === 'DEFAULT') {
196
- tools.logInfo('Default eUI version found or empty, taking default resolutions..skipping');
196
+ tools.logInfo('Default eUI version found or empty...skipping');
197
197
 
198
198
  } else {
199
199
  tools.logInfo(`Processing resolutions replacement for eUI version found : ${euiVersion}`);
@@ -202,28 +202,41 @@ module.exports.processLocalEuiVersions = () => {
202
202
  const rootPackageJson = require(rootPackageJsonFile);
203
203
 
204
204
  const resolutionsJsonFile = path.join(__dirname, 'resources', euiVersion, 'resolutions.json');
205
- const resolutionsJson = require(resolutionsJsonFile);
206
205
 
207
- tools.logInfo('Injecting resolutions content');
208
- console.log(resolutionsJson);
209
- rootPackageJson.resolutions = resolutionsJson;
206
+ if (tools.isFileExists(resolutionsJsonFile)) {
207
+ const resolutionsJson = require(resolutionsJsonFile);
210
208
 
211
- tools.logInfo('Updating root package.json');
212
- tools.writeJsonFileSync(rootPackageJsonFile, rootPackageJson);
209
+ tools.logInfo('Injecting resolutions content');
210
+ console.log(resolutionsJson);
211
+ rootPackageJson.resolutions = resolutionsJson;
212
+
213
+ tools.logInfo('Updating root package.json');
214
+ tools.writeJsonFileSync(rootPackageJsonFile, rootPackageJson);
215
+ } else {
216
+ tools.logWarning('Not found...skipping');
217
+ }
213
218
 
214
219
  tools.logInfo(`Processing .browserlistrc replacement for eUI version found : ${euiVersion}`);
215
220
 
216
221
  const blResourcesFile = path.join(__dirname, 'resources', euiVersion, 'browserslistrc');
217
222
  const blDestFile = path.join(process.cwd(), '.browserslistrc');
218
223
 
219
- tools.copy(blResourcesFile, blDestFile);
224
+ if (tools.isFileExists(blResourcesFile)) {
225
+ tools.copy(blResourcesFile, blDestFile);
226
+ } else {
227
+ tools.logWarning('Not found...skipping');
228
+ }
220
229
 
221
- // tools.logInfo(`Processing yarn.lock replacement for eUI version found : ${euiVersion}`);
230
+ tools.logInfo(`Processing yarn.lock replacement for eUI version found : ${euiVersion}`);
222
231
 
223
- // const yResourcesFile = path.join(__dirname, 'resources', euiVersion, 'yarn.lock');
224
- // const yDestFile = path.join(process.cwd(), 'yarn.lock');
232
+ const yResourcesFile = path.join(__dirname, 'resources', euiVersion, 'yarn.lock');
233
+ const yDestFile = path.join(process.cwd(), 'yarn.lock');
225
234
 
226
- // tools.copy(yResourcesFile, yDestFile);
235
+ if (tools.isFileExists(yResourcesFile)) {
236
+ tools.copy(yResourcesFile, yDestFile);
237
+ } else {
238
+ tools.logWarning('Not found...skipping');
239
+ }
227
240
  }
228
241
  })
229
242
  .catch((e) => {