@jonloucks/badges-ts 1.4.0 → 1.4.1
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.
|
@@ -7,7 +7,7 @@ export const COMMAND = {
|
|
|
7
7
|
context.display.trace(`Running discover with: ${context.arguments.join(' ')}`);
|
|
8
8
|
const lcovPath = getLcovInfoPath(context);
|
|
9
9
|
const { totals, files } = parseLcovInfo(lcovPath);
|
|
10
|
-
const html = generateHtmlReport(totals, files);
|
|
10
|
+
const html = generateHtmlReport(context, totals, files);
|
|
11
11
|
const outputFolder = getCoverageReportFolder(context);
|
|
12
12
|
Internal.createFoldersIfNotExist(outputFolder);
|
|
13
13
|
const indexHtmlFile = resolve(outputFolder, "index.html");
|
|
@@ -31,8 +31,9 @@ function parseLcovInfo(lcovPath) {
|
|
|
31
31
|
};
|
|
32
32
|
const files = [];
|
|
33
33
|
for (const rec of records) {
|
|
34
|
-
if (
|
|
34
|
+
if (rec.length === 0 || (rec.length === 1 && rec[0] === '\n')) {
|
|
35
35
|
continue;
|
|
36
|
+
}
|
|
36
37
|
const fileMatch = rec.match(/SF:(.+)/);
|
|
37
38
|
const file = fileMatch ? fileMatch[1].trim() : "unknown";
|
|
38
39
|
const lf = matchNumber(rec.match(/LF:(\d+)/)?.[1]);
|
|
@@ -47,19 +48,89 @@ function parseLcovInfo(lcovPath) {
|
|
|
47
48
|
totals.functions.hit += fnh;
|
|
48
49
|
totals.branches.found += brf;
|
|
49
50
|
totals.branches.hit += brh;
|
|
51
|
+
let folder;
|
|
52
|
+
let fileName;
|
|
53
|
+
if (file.lastIndexOf('/') > -1) {
|
|
54
|
+
folder = file.substring(0, file.lastIndexOf('/'));
|
|
55
|
+
fileName = file.substring(file.lastIndexOf('/') + 1);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
folder = '';
|
|
59
|
+
fileName = file;
|
|
60
|
+
}
|
|
50
61
|
files.push({
|
|
51
|
-
|
|
62
|
+
folder: folder,
|
|
63
|
+
file: fileName,
|
|
52
64
|
lines: percent(lh, lf),
|
|
53
65
|
functions: percent(fnh, fnf),
|
|
54
66
|
branches: percent(brh, brf),
|
|
67
|
+
missedLines: lh !== lf ? parseMissedLines(rec) : '',
|
|
68
|
+
missedFunctions: fnh !== fnf ? parseMissedFunctions(rec) : '',
|
|
69
|
+
missedBranches: brh !== brf ? parseMissedBranches(rec) : ''
|
|
55
70
|
});
|
|
56
71
|
}
|
|
57
72
|
return { totals, files };
|
|
58
73
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
function parseMissedLines(rec) {
|
|
75
|
+
const missedLines = rec.split('\n')
|
|
76
|
+
.filter(line => line.startsWith('DA:') && line.endsWith(',0'))
|
|
77
|
+
.map(line => Number(line.split(':')[1].split(',')[0]));
|
|
78
|
+
return toRanges(missedLines);
|
|
79
|
+
}
|
|
80
|
+
function toRanges(lines) {
|
|
81
|
+
const ranges = [];
|
|
82
|
+
let rangeStart = null;
|
|
83
|
+
let previousLine = null;
|
|
84
|
+
for (const line of lines) {
|
|
85
|
+
if (rangeStart === null) {
|
|
86
|
+
rangeStart = line;
|
|
87
|
+
}
|
|
88
|
+
else if (previousLine !== null && line === previousLine + 1) {
|
|
89
|
+
// Continue the range
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// End the previous range and start a new one
|
|
93
|
+
if (rangeStart !== null) {
|
|
94
|
+
ranges.push(rangeStart === previousLine ? `${rangeStart}` : `${rangeStart}-${previousLine}`);
|
|
95
|
+
}
|
|
96
|
+
rangeStart = line;
|
|
97
|
+
}
|
|
98
|
+
previousLine = line;
|
|
99
|
+
}
|
|
100
|
+
// Handle the last range if it exists
|
|
101
|
+
if (rangeStart !== null && previousLine !== null) {
|
|
102
|
+
ranges.push(rangeStart === previousLine ? `${rangeStart}` : `${rangeStart}-${previousLine}`);
|
|
103
|
+
}
|
|
104
|
+
return ranges.join('</br>');
|
|
105
|
+
}
|
|
106
|
+
//FN:26,anonymous_7
|
|
107
|
+
//FNDA:0,anonymous_7 <-- MISSED FUNCTION
|
|
108
|
+
function parseMissedFunctions(rec) {
|
|
109
|
+
const nameToLineMap = {};
|
|
110
|
+
rec.split('\n').forEach(line => {
|
|
111
|
+
if (line.startsWith('FN:')) {
|
|
112
|
+
const parts = line.split(':')[1].split(',');
|
|
113
|
+
const lineNum = parts[0];
|
|
114
|
+
const funcName = parts[1];
|
|
115
|
+
nameToLineMap[funcName] = lineNum;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
function lineForFunction(funcName) {
|
|
119
|
+
return funcName + " @ " + (nameToLineMap[funcName] ?? '?');
|
|
120
|
+
}
|
|
121
|
+
const fnNotFound = 'FNDA:0,';
|
|
122
|
+
return rec.split('\n')
|
|
123
|
+
.filter(line => line.startsWith(fnNotFound))
|
|
124
|
+
.map(line => lineForFunction(line.substring(fnNotFound.length).trim()))
|
|
125
|
+
.join('</br>');
|
|
126
|
+
}
|
|
127
|
+
function parseMissedBranches(rec) {
|
|
128
|
+
const missedBranches = rec.split('\n')
|
|
129
|
+
.filter(line => line.startsWith('BRDA:') && (line.endsWith(',0') || line.endsWith(',-')))
|
|
130
|
+
.map(line => Number(line.split(':')[1].split(',')[0]));
|
|
131
|
+
return toRanges(missedBranches);
|
|
132
|
+
}
|
|
133
|
+
function generateHtmlReport(context, totals, files) {
|
|
63
134
|
return `
|
|
64
135
|
<!DOCTYPE html>
|
|
65
136
|
<html lang="en">
|
|
@@ -72,39 +143,152 @@ function generateHtmlReport(totals, files) {
|
|
|
72
143
|
th, td { border: 1px solid #ddd; padding: 0.5em; text-align: left; }
|
|
73
144
|
th { background: #f4f4f4; }
|
|
74
145
|
.pct { font-weight: bold; }
|
|
146
|
+
.tooltip-cell {
|
|
147
|
+
position: relative; /* Needed for absolute positioning of the tooltip content */
|
|
148
|
+
cursor: help; /* Changes cursor to indicate interactivity */
|
|
149
|
+
}
|
|
150
|
+
.tooltip-content {
|
|
151
|
+
display: none; /* Hide the content by default */
|
|
152
|
+
position: absolute; /* Position relative to the parent cell */
|
|
153
|
+
color: blue;
|
|
154
|
+
background-color: #f9f9f9;
|
|
155
|
+
border: 1px solid #ccc;
|
|
156
|
+
padding: 10px;
|
|
157
|
+
z-index: 10; /* Ensure it appears above other elements */
|
|
158
|
+
right: 0;
|
|
159
|
+
/* left: 100%; *//* Position to the right of the cell */
|
|
160
|
+
top: 0;
|
|
161
|
+
white-space: nowrap; /* Prevents text from wrapping (optional) */
|
|
162
|
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
163
|
+
}
|
|
164
|
+
.tooltip-cell:hover .tooltip-content {
|
|
165
|
+
display: block; /* Show the content on hover */
|
|
166
|
+
}
|
|
167
|
+
.th-sort-asc::after { content: " ▲"; }
|
|
168
|
+
.th-sort-desc::after { content: " ▼"; }
|
|
75
169
|
</style>
|
|
76
170
|
</head>
|
|
77
171
|
<body>
|
|
78
172
|
<h1>Coverage Report</h1>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
173
|
+
${generateSummaryTable(context, totals, files)}
|
|
174
|
+
${generateTablePerFile(context, files)}
|
|
175
|
+
</body>
|
|
176
|
+
<script>
|
|
177
|
+
document.querySelectorAll('#perFileTable th').forEach((headerCell, index) => {
|
|
178
|
+
headerCell.addEventListener('click', () => {
|
|
179
|
+
const tableElement = headerCell.parentElement.parentElement.parentElement;
|
|
180
|
+
const headerRow = headerCell.parentElement;
|
|
181
|
+
const tableBody = tableElement.querySelector('tbody');
|
|
182
|
+
const rows = Array.from(tableBody.querySelectorAll('tr'));
|
|
183
|
+
|
|
184
|
+
// Toggle sort direction
|
|
185
|
+
const isAscending = headerCell.classList.contains('th-sort-asc');
|
|
186
|
+
|
|
187
|
+
// Remove existing sort classes from all headers
|
|
188
|
+
headerRow.querySelectorAll('th').forEach(th => th.classList.remove('th-sort-asc', 'th-sort-desc'));
|
|
189
|
+
|
|
190
|
+
// Sort the rows
|
|
191
|
+
const sortedRows = rows.sort((a, b) => {
|
|
192
|
+
const aText = a.cells[index].textContent.trim();
|
|
193
|
+
const bText = b.cells[index].textContent.trim();
|
|
194
|
+
|
|
195
|
+
// numeric: true handles both "10" > "2" and alphabetical sorting
|
|
196
|
+
return aText.localeCompare(bText, undefined, { numeric: true }) * (isAscending ? -1 : 1);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Re-add rows to the body in new order
|
|
200
|
+
tableBody.append(...sortedRows);
|
|
201
|
+
|
|
202
|
+
// Update classes for visual indicators
|
|
203
|
+
headerCell.classList.toggle('th-sort-asc', !isAscending);
|
|
204
|
+
headerCell.classList.toggle('th-sort-desc', isAscending);
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
208
|
+
// Target the 1st header (index 0) and click it automatically
|
|
209
|
+
document.querySelectorAll('#perFileTable th')[0].click();
|
|
210
|
+
});
|
|
211
|
+
</script>
|
|
212
|
+
</html>
|
|
213
|
+
`;
|
|
214
|
+
}
|
|
215
|
+
function generateCell(context, percent, tooltipContent) {
|
|
216
|
+
return `
|
|
217
|
+
<td class="tooltip-cell" style="color: white; background-color: ${Internal.colorFromPercentComplete(context, percent)}">
|
|
218
|
+
${Internal.formatPercent(percent)}
|
|
219
|
+
${generateTooltip(tooltipContent)}
|
|
220
|
+
</td>
|
|
221
|
+
`;
|
|
222
|
+
}
|
|
223
|
+
function generateTooltip(content) {
|
|
224
|
+
if (content.length === 0) {
|
|
225
|
+
return "";
|
|
226
|
+
}
|
|
227
|
+
return `<span class="tooltip-content">${content}</span>`;
|
|
228
|
+
}
|
|
229
|
+
function generateSummaryTable(context, totals, files) {
|
|
230
|
+
const uniqueFolders = Array.from(new Set(files.map(f => f.folder))).sort();
|
|
231
|
+
return `<h2>Summary</h2>
|
|
232
|
+
<table id="summaryTable" width="400px">
|
|
233
|
+
<thead>
|
|
234
|
+
<tr>
|
|
235
|
+
<th>Category</th>
|
|
236
|
+
<th style="width: 120px;">Lines</th>
|
|
237
|
+
<th style="width: 120px;">Functions</th>
|
|
238
|
+
<th style="width: 120px;">Branches</th>
|
|
239
|
+
</tr>
|
|
240
|
+
</thead>
|
|
241
|
+
<tbody>
|
|
242
|
+
<tr>
|
|
243
|
+
<td>All Files</td>
|
|
244
|
+
${generateCell(context, percent(totals.lines.hit, totals.lines.found), "")}
|
|
245
|
+
${generateCell(context, percent(totals.functions.hit, totals.functions.found), "")}
|
|
246
|
+
${generateCell(context, percent(totals.branches.hit, totals.branches.found), "")}
|
|
247
|
+
</tr>
|
|
248
|
+
${uniqueFolders.map(folder => {
|
|
249
|
+
const folderCov = folderCoverage(files, folder);
|
|
250
|
+
return `
|
|
251
|
+
<tr>
|
|
252
|
+
<td>${folder}</td>
|
|
253
|
+
${generateCell(context, folderCov.lines, "")}
|
|
254
|
+
${generateCell(context, folderCov.functions, "")}
|
|
255
|
+
${generateCell(context, folderCov.branches, "")}
|
|
256
|
+
</tr>
|
|
257
|
+
`;
|
|
258
|
+
}).join("")}
|
|
259
|
+
</tbody>
|
|
260
|
+
</table>`;
|
|
261
|
+
}
|
|
262
|
+
function folderCoverage(files, folder) {
|
|
263
|
+
const folderFiles = files.filter(f => f.folder === folder);
|
|
264
|
+
const totalLines = folderFiles.reduce((sum, f) => sum + f.lines, 0);
|
|
265
|
+
const totalFunctions = folderFiles.reduce((sum, f) => sum + f.functions, 0);
|
|
266
|
+
const totalBranches = folderFiles.reduce((sum, f) => sum + f.branches, 0);
|
|
267
|
+
return { lines: totalLines / folderFiles.length, functions: totalFunctions / folderFiles.length, branches: totalBranches / folderFiles.length };
|
|
268
|
+
}
|
|
269
|
+
function generateTablePerFile(context, files) {
|
|
270
|
+
return `<h2>Coverage Per File</h2>
|
|
271
|
+
<table id="perFileTable">
|
|
87
272
|
<thead>
|
|
88
273
|
<tr>
|
|
89
274
|
<th>File</th>
|
|
90
|
-
<th>
|
|
91
|
-
<th>
|
|
92
|
-
<th>
|
|
275
|
+
<th>Folder</th>
|
|
276
|
+
<th style="width: 120px;">Lines</th>
|
|
277
|
+
<th style="width: 120px;">Functions</th>
|
|
278
|
+
<th style="width: 120px;">Branches</th>
|
|
93
279
|
</tr>
|
|
94
280
|
</thead>
|
|
95
281
|
<tbody>
|
|
96
282
|
${files.map(f => `
|
|
97
283
|
<tr>
|
|
98
284
|
<td>${f.file}</td>
|
|
99
|
-
<td>${
|
|
100
|
-
|
|
101
|
-
|
|
285
|
+
<td>${f.folder}</td>
|
|
286
|
+
${generateCell(context, f.lines, f.missedLines)}
|
|
287
|
+
${generateCell(context, f.functions, f.missedFunctions)}
|
|
288
|
+
${generateCell(context, f.branches, f.missedBranches)}
|
|
102
289
|
</tr>
|
|
103
290
|
`).join("")}
|
|
104
291
|
</tbody>
|
|
105
|
-
</table
|
|
106
|
-
</body>
|
|
107
|
-
</html>
|
|
108
|
-
`;
|
|
292
|
+
</table>`;
|
|
109
293
|
}
|
|
110
294
|
//# sourceMappingURL=coverage-report-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-report-command.js","sourceRoot":"","sources":["../../src/impl/coverage-report-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE9F,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,OAAO,GAAkB;IACpC,OAAO,EAAE,KAAK,WAAW,OAAgB;QACvC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/E,MAAM,QAAQ,GA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,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;AAClJ,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAgB,EAAE,KAAqB;IACnE,OAAO;;;;;;;;;;;;QAYD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;;gBAEP,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,MAAM;YACZ,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC;YAC7C,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC;YACrD,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,cAAc,CAAC;;OAExD,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;;WAEN,CAAA;AACX,CAAC"}
|
package/impl/discover-command.js
CHANGED
|
@@ -18,7 +18,8 @@ export const COMMAND = {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
async function discoverProject(context) {
|
|
21
|
-
return CONTRACTS.enforce(DISCOVER_PROJECT).discoverProject(context)
|
|
21
|
+
return CONTRACTS.enforce(DISCOVER_PROJECT).discoverProject(context)
|
|
22
|
+
.then((project) => {
|
|
22
23
|
context.display.info(`Discovered project: ${project.name}, version: ${project.version}`);
|
|
23
24
|
return project;
|
|
24
25
|
}).catch((error) => {
|
|
@@ -27,7 +28,8 @@ async function discoverProject(context) {
|
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
async function discoverCoverage(context) {
|
|
30
|
-
return CONTRACTS.enforce(DISCOVER_COVERAGE).discoverCoverage(context)
|
|
31
|
+
return CONTRACTS.enforce(DISCOVER_COVERAGE).discoverCoverage(context)
|
|
32
|
+
.then((coverage) => {
|
|
31
33
|
context.display.info(`Discovered code coverage: ${Internal.formatPercent(coverage.percentage)}`);
|
|
32
34
|
return coverage;
|
|
33
35
|
}).catch((error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover-command.js","sourceRoot":"","sources":["../../src/impl/discover-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAkB;IACpC,OAAO,EAAE,KAAK,WAAW,OAAgB;QACvC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/E,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,eAAe,CAAC,OAAO,CAAC;YACxB,gBAAgB,CAAC,OAAO,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,KAAK,UAAU,eAAe,CAAC,OAAgB;IAC7C,OAAO,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"discover-command.js","sourceRoot":"","sources":["../../src/impl/discover-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GA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AC,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;QACxB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9E,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jonloucks/badges-ts",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Node.js badge creator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -86,16 +86,16 @@
|
|
|
86
86
|
"minimatch": "10.2.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@types/node": "^25.3.
|
|
89
|
+
"@types/node": "^25.3.1",
|
|
90
90
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
91
91
|
"@typescript-eslint/parser": "^8.56.0",
|
|
92
|
-
"eslint": "^
|
|
92
|
+
"eslint": "^10.0.2",
|
|
93
93
|
"tsx": "^4.19.2",
|
|
94
94
|
"typedoc": "^0.28.17",
|
|
95
95
|
"typescript": "^5.9.3"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@jonloucks/contracts-ts": "^2.0.
|
|
98
|
+
"@jonloucks/contracts-ts": "^2.0.3",
|
|
99
99
|
"@jonloucks/variants-ts": "^1.1.0"
|
|
100
100
|
}
|
|
101
101
|
}
|
package/version.js
CHANGED