@eui/tools 6.12.31 → 6.12.32
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 +9 -0
- package/package.json +1 -1
- package/scripts/csdr/audit/styles.js +43 -0
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.12.
|
|
1
|
+
6.12.32
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 6.12.32 (2023-07-24)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* added mywp-shared audit checks for no sub-entry usage - bypass style audit with disabled feature - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([03bf262e](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/03bf262e20662030ab31a5bbecaf5932b0f282f9))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
1
10
|
## 6.12.31 (2023-07-24)
|
|
2
11
|
|
|
3
12
|
##### Chores
|
package/package.json
CHANGED
|
@@ -93,6 +93,7 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
93
93
|
htmlFilesCount: 0,
|
|
94
94
|
htmlLinesCount: 0,
|
|
95
95
|
scssLinescount: 0,
|
|
96
|
+
stylesAuditDisabledCount: 0,
|
|
96
97
|
tsOver500: {
|
|
97
98
|
count: 0,
|
|
98
99
|
files: [],
|
|
@@ -153,6 +154,10 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
153
154
|
count: 0,
|
|
154
155
|
indices: []
|
|
155
156
|
},
|
|
157
|
+
mywpSharedAll: {
|
|
158
|
+
count: 0,
|
|
159
|
+
indices: []
|
|
160
|
+
},
|
|
156
161
|
finalReport: {},
|
|
157
162
|
};
|
|
158
163
|
|
|
@@ -175,6 +180,11 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
175
180
|
const fileContent = tools.getFileContent(filePath).trim();
|
|
176
181
|
const linesCount = fileContent.split('\n').length;
|
|
177
182
|
|
|
183
|
+
if (fileContent.indexOf('styles-audit-disabled') !== -1) {
|
|
184
|
+
report.stylesAuditDisabledCount++;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
if (fileContent === '') {
|
|
179
189
|
report.scssEmptyFiles++;
|
|
180
190
|
}
|
|
@@ -255,6 +265,11 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
255
265
|
const fileContent = tools.getFileContent(filePath);
|
|
256
266
|
const linesCount = fileContent.split('\n').length;
|
|
257
267
|
|
|
268
|
+
if (fileContent.indexOf('styles-audit-disabled') !== -1) {
|
|
269
|
+
report.stylesAuditDisabledCount++;
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
|
|
258
273
|
report.htmlLinesCount += linesCount;
|
|
259
274
|
|
|
260
275
|
let result,
|
|
@@ -286,6 +301,11 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
286
301
|
const fileContent = tools.getFileContent(filePath);
|
|
287
302
|
const linesCount = fileContent.split('\n').length;
|
|
288
303
|
|
|
304
|
+
if (fileContent.indexOf('styles-audit-disabled') !== -1) {
|
|
305
|
+
report.stylesAuditDisabledCount++;
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
289
309
|
if (linesCount > 500) {
|
|
290
310
|
report.tsOver500.count++;
|
|
291
311
|
report.tsOver500.files.push(file);
|
|
@@ -324,6 +344,14 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
324
344
|
}
|
|
325
345
|
report.allModules.count += allModulesIndices.length;
|
|
326
346
|
report.allModules.indices = [...report.allModules.indices, ...generateIndicesContent(allModulesIndices, file, fileContent)];
|
|
347
|
+
|
|
348
|
+
let mywpSharedAllIndices = [];
|
|
349
|
+
regex = /\@mywp\/shared'|\@mywp\/shared"/gi;
|
|
350
|
+
while ((result = regex.exec(fileContent))) {
|
|
351
|
+
mywpSharedAllIndices.push(result.index);
|
|
352
|
+
}
|
|
353
|
+
report.mywpSharedAll.count += mywpSharedAllIndices.length;
|
|
354
|
+
report.mywpSharedAll.indices = [...report.mywpSharedAll.indices, ...generateIndicesContent(mywpSharedAllIndices, file, fileContent)];
|
|
327
355
|
});
|
|
328
356
|
|
|
329
357
|
// Analyzing 3rd party dependencies usage
|
|
@@ -403,6 +431,15 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
403
431
|
};
|
|
404
432
|
}
|
|
405
433
|
|
|
434
|
+
if (report.stylesAuditDisabledCount !==0) {
|
|
435
|
+
report.finalReport['stylesAuditDisabledCount'] = {
|
|
436
|
+
description: 'audit disabled count',
|
|
437
|
+
value: report.stylesAuditDisabledCount,
|
|
438
|
+
status: report.stylesAuditDisabledCount !== 0 ? 'IMPROVE': 'OK',
|
|
439
|
+
comment : report.stylesAuditDisabledCount !==0 ? 'If not done yet, files to be checked by eUI team': null,
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
406
443
|
// BALANCED - styles content
|
|
407
444
|
|
|
408
445
|
if (report.scssFilesCount !== 0) {
|
|
@@ -492,6 +529,12 @@ const runStylesAudit = (module.exports.runStylesAudit = (pkg, customPath) => {
|
|
|
492
529
|
status: report.allModules.count !== 0 ? 'CRITICAL' : 'OK',
|
|
493
530
|
comment: report.allModules.count !== 0 ? 'Use only tree-shakable eUI module imports (as of 15+)' : null,
|
|
494
531
|
};
|
|
532
|
+
report.finalReport['mywpSharedAll'] = {
|
|
533
|
+
description: 'Usage of @mywp/shared import without sub-entry',
|
|
534
|
+
value: report.mywpSharedAll.count,
|
|
535
|
+
status: report.mywpSharedAll.count !== 0 ? 'CRITICAL' : 'OK',
|
|
536
|
+
comment: report.mywpSharedAll.count !== 0 ? 'use only import of @mywp/shared/SUB_ENTRY (as of 16+)' : null,
|
|
537
|
+
};
|
|
495
538
|
|
|
496
539
|
// IMPROVE ONLY
|
|
497
540
|
|