@eui/tools 6.12.1 → 6.12.2

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.12.1
1
+ 6.12.2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.12.2 (2023-06-13)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * adjusted styles report - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([29457541](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/2945754155ec262c76c8443cee0885b205301fe4))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.12.1 (2023-06-13)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.12.1",
3
+ "version": "6.12.2",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -1260,7 +1260,7 @@ Promise.resolve()
1260
1260
  console.log(metadataUtils.package.isNewPackageBuild(pkg2));
1261
1261
 
1262
1262
  // newly created pkg
1263
- const pkg3 = configUtils.packages.getPackage('cc-summa-shared-ui', true);
1263
+ const pkg3 = configUtils.packages.getPackage('coli-management-ui', true);
1264
1264
  console.log(metadataUtils.package.isNewPackageBuild(pkg3));
1265
1265
 
1266
1266
  return auditUtils.styles.audit(pkg2);
@@ -104,6 +104,10 @@ const runStylesAudit = module.exports.runStylesAudit = (pkg, customPath) => {
104
104
  count: 0,
105
105
  indices: []
106
106
  },
107
+ zIndex: {
108
+ count: 0,
109
+ indices: []
110
+ },
107
111
  inlineStyles: {
108
112
  count: 0,
109
113
  indices: []
@@ -209,6 +213,14 @@ const runStylesAudit = module.exports.runStylesAudit = (pkg, customPath) => {
209
213
  }
210
214
  report.ngDeep.count += ngDeepIndices.length;
211
215
  report.ngDeep.indices = [...report.ngDeep.indices, ...generateIndicesContent(ngDeepIndices, file, fileContent)];
216
+
217
+ let zIndexIndices = [];
218
+ regex = /z-index/gi;
219
+ while ( (result = regex.exec(fileContent)) ) {
220
+ zIndexIndices.push(result.index);
221
+ }
222
+ report.zIndex.count += zIndexIndices.length;
223
+ report.zIndex.indices = [...report.zIndex.indices, ...generateIndicesContent(zIndexIndices, file, fileContent)];
212
224
  });
213
225
 
214
226
 
@@ -375,6 +387,12 @@ const runStylesAudit = module.exports.runStylesAudit = (pkg, customPath) => {
375
387
  status: getStatus(report.ngDeep.count),
376
388
  comment: (report.ngDeep.count !== 0) ? 'Avoid ::ng-deep usage' : null
377
389
  }
390
+ report.finalReport['zIndex'] = {
391
+ description: 'z-index usage found',
392
+ value: report.zIndex.count,
393
+ status: getStatus(report.zIndex.count),
394
+ comment: (report.zIndex.count !== 0) ? 'Avoid z-index setting, usage of eUI CSS vars should be applied' : null
395
+ }
378
396
  }
379
397
 
380
398
  // CRITICAL ONLY
@@ -391,8 +391,10 @@ module.exports.getConfigOptions = () => {
391
391
  "plainColors": gatesForVersion.plainColors,
392
392
  "important": gatesForVersion.important,
393
393
  "ngDeep": gatesForVersion.ngDeep,
394
+ "zIndex": gatesForVersion.zIndex,
394
395
  "inlineStyles": gatesForVersion.inlineStyles,
395
- "uxCmp": gatesForVersion.uxCmp
396
+ "uxCmp": gatesForVersion.uxCmp,
397
+ "allModules": gatesForVersion.allModules,
396
398
  };
397
399
  })
398
400
  }
@@ -253,18 +253,26 @@ module.exports.getPackageVersionFirst = (pkg) => {
253
253
  }
254
254
 
255
255
  module.exports.isNewPackageBuild = (pkg) => {
256
- tools.logInfo('Checking if package is a newly created one : first build date after 2023/06/01');
256
+ tools.logInfo('Checking if package is a newly created one : first build date after 2023/06/01 or never built for MASTER');
257
257
 
258
258
  const firstPackageVersion = this.getPackageVersionFirst(pkg);
259
+ const versionsLatest = this.getPackageVersionsLatest(pkg);
259
260
 
260
261
  if (firstPackageVersion) {
261
- const pkgDate = firstPackageVersion.date;
262
262
 
263
- const pivotDate = moment('20230601');
264
- const pkgDateM = moment(pkgDate, 'YYYYMMDD-HH:mm');
265
- tools.logInfo(`First package build version date : ${pkgDate}`);
266
- tools.logInfo(`==> NEW package : ${pkgDateM > pivotDate}`);
267
- return pkgDateM > pivotDate;
263
+ if (versionsLatest.length === 0) {
264
+ tools.logInfo(`==> package has never been built for MASTER / latest version, package is considered new`);
265
+ return true;
266
+
267
+ } else {
268
+ const pkgDate = firstPackageVersion.date;
269
+
270
+ const pivotDate = moment('20230601');
271
+ const pkgDateM = moment(pkgDate, 'YYYYMMDD-HH:mm');
272
+ tools.logInfo(`First package build version date : ${pkgDate}`);
273
+ tools.logInfo(`==> NEW package : ${pkgDateM > pivotDate}`);
274
+ return pkgDateM > pivotDate;
275
+ }
268
276
 
269
277
  } else {
270
278
  tools.logInfo(`==> no versions metadata found : first build, package is new`);