@eui/tools 6.1.1 → 6.1.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.
- package/.version.properties +1 -1
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/scripts/csdr/audit/styles.js +66 -54
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.1.
|
|
1
|
+
6.1.2
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 6.1.2 (2022-11-06)
|
|
2
|
+
|
|
3
|
+
##### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* slack not rendering certain emoji - MWP-6448 [MWP-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-6448) ([ec2cdeb7](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/ec2cdeb7f6d506b40649e8ab98952b7eb0203e46))
|
|
7
|
+
* styles auditing only for UI packages - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([265671d9](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/265671d9c756e84771fc2df61d5993957246a268))
|
|
8
|
+
|
|
9
|
+
* * *
|
|
10
|
+
* * *
|
|
1
11
|
## 6.1.1 (2022-11-06)
|
|
2
12
|
|
|
3
13
|
##### Chores
|
package/package.json
CHANGED
|
@@ -337,79 +337,86 @@ const runStylesAudit = module.exports.runStylesAudit = (pkg) => {
|
|
|
337
337
|
|
|
338
338
|
// CRITICAL ONLY
|
|
339
339
|
|
|
340
|
-
report.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
340
|
+
if (report.htmlLinesCount !== 0) {
|
|
341
|
+
report.finalReport['inlineStyles'] = {
|
|
342
|
+
description: 'inline styles found in HTML',
|
|
343
|
+
value: report.inlineStyles.count,
|
|
344
|
+
status: (report.inlineStyles.count !== 0) ? 'CRITICAL' : 'OK',
|
|
345
|
+
comment: (report.inlineStyles.count !== 0) ? 'No inline styles should be present in html, usage classes with scss / eUI utilities instead' : null
|
|
346
|
+
}
|
|
347
|
+
report.finalReport['material'] = {
|
|
348
|
+
description: 'material component usage found in HTML',
|
|
349
|
+
value: report.material.count,
|
|
350
|
+
status: (report.material.count !== 0) ? 'CRITICAL' : 'OK',
|
|
351
|
+
comment: (report.material.count !== 0) ? 'Usage of material should be avoided' : null
|
|
352
|
+
}
|
|
353
|
+
report.finalReport['primeng'] = {
|
|
354
|
+
description: 'PrimeNG components usage found in HTML',
|
|
355
|
+
value: report.primeng.count,
|
|
356
|
+
status: (report.primeng.count !== 0) ? 'CRITICAL' : 'OK',
|
|
357
|
+
comment: (report.primeng.count !== 0) ? 'Remove any PrimeNG usage, deprecated in eUI' : null
|
|
358
|
+
}
|
|
359
359
|
|
|
360
|
+
// IMPROVE ONLY
|
|
360
361
|
|
|
361
|
-
|
|
362
|
+
report.finalReport['uxCmp'] = {
|
|
363
|
+
description: 'eUI ux- components usage found in HTML',
|
|
364
|
+
value: report.uxCmp.count,
|
|
365
|
+
status: (report.uxCmp.count !== 0) ? 'IMPROVE' : 'OK',
|
|
366
|
+
comment: (report.uxCmp.count !== 0) ? 'Replace by "eui-" components whenever possible, to ensure future proof migration' : null
|
|
367
|
+
}
|
|
362
368
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
369
|
+
report.finalReport['tsOver500'] = {
|
|
370
|
+
description: 'TS file containing more than 500 lines',
|
|
371
|
+
value: report.tsOver500.count,
|
|
372
|
+
status: (report.tsOver500.count !== 0) ? 'IMPROVE' : 'OK',
|
|
373
|
+
comment: (report.tsOver500.count !== 0) ? 'Split TS files into multiple ones for readability' : null
|
|
374
|
+
}
|
|
368
375
|
}
|
|
369
376
|
|
|
370
|
-
report.finalReport['tsOver500'] = {
|
|
371
|
-
description: 'TS file containing more than 500 lines',
|
|
372
|
-
value: report.tsOver500.count,
|
|
373
|
-
status: (report.tsOver500.count !== 0) ? 'IMPROVE' : 'OK',
|
|
374
|
-
comment: (report.tsOver500.count !== 0) ? 'Split TS files into multiple ones for readability' : null
|
|
375
|
-
}
|
|
376
377
|
|
|
377
378
|
|
|
378
|
-
|
|
379
|
+
if (Object.keys(report.finalReport).length === 0) {
|
|
380
|
+
tools.logInfo('No sources to audit...skipping');
|
|
381
|
+
return null;
|
|
379
382
|
|
|
380
|
-
|
|
383
|
+
} else {
|
|
384
|
+
// Calculating score
|
|
381
385
|
|
|
382
|
-
|
|
383
|
-
total++;
|
|
386
|
+
let score = 0, total = 0;
|
|
384
387
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
388
|
+
Object.entries(report.finalReport).forEach((v) => {
|
|
389
|
+
total++;
|
|
390
|
+
|
|
391
|
+
switch(v[1].status) {
|
|
392
|
+
case 'OK':
|
|
393
|
+
score++;
|
|
394
|
+
break;
|
|
395
|
+
case 'IMPROVE':
|
|
396
|
+
score+=0.5;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
});
|
|
394
400
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
401
|
+
report.score = score;
|
|
402
|
+
report.total = total;
|
|
403
|
+
report.pcScore = Math.floor(100 * score / total);
|
|
398
404
|
|
|
399
405
|
|
|
400
|
-
|
|
406
|
+
// return JSON report
|
|
401
407
|
|
|
402
|
-
|
|
403
|
-
|
|
408
|
+
tools.logInfo('STATS report');
|
|
409
|
+
console.log(JSON.stringify(report, null, 2));
|
|
404
410
|
|
|
405
|
-
|
|
411
|
+
return report;
|
|
412
|
+
}
|
|
406
413
|
}
|
|
407
414
|
|
|
408
415
|
|
|
409
416
|
|
|
410
417
|
|
|
411
418
|
module.exports.audit = (pkg) => {
|
|
412
|
-
if (pkg.remote) {
|
|
419
|
+
if (pkg.remote && pkg.name.indexOf('-ui') === -1) {
|
|
413
420
|
return;
|
|
414
421
|
}
|
|
415
422
|
|
|
@@ -420,6 +427,11 @@ module.exports.audit = (pkg) => {
|
|
|
420
427
|
|
|
421
428
|
const report = runStylesAudit(pkg);
|
|
422
429
|
|
|
430
|
+
if (!report) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
|
|
423
435
|
// FINAL REPORT
|
|
424
436
|
|
|
425
437
|
let finalReportMessage = `*STYLES AUDIT REPORT for ${pkg.name}:*\n\n`;
|
|
@@ -432,10 +444,10 @@ module.exports.audit = (pkg) => {
|
|
|
432
444
|
} else if (v[1].status === 'IMPROVE') {
|
|
433
445
|
statusEmoji = ':warning:';
|
|
434
446
|
} else {
|
|
435
|
-
statusEmoji = ':
|
|
447
|
+
statusEmoji = ':large_green_circle:';
|
|
436
448
|
}
|
|
437
449
|
|
|
438
|
-
finalReportMessage +=
|
|
450
|
+
finalReportMessage += `${statusEmoji} *${v[1].description}*: found *${v[1].value}* - status: *${v[1].status}* ${(v[1].comment) ? '==> ' + v[1].comment : ''}\n`;
|
|
439
451
|
});
|
|
440
452
|
|
|
441
453
|
finalReportMessage +=`\neUI compliance score : *${report.score}* out of *${report.total}* *(${report.pcScore}%)*`;
|