monocart-coverage-reports 2.8.6 → 2.9.0
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/README.md +29 -6
- package/README.zh-Hans.md +27 -4
- package/lib/converter/converter.js +14 -5
- package/lib/default/options.js +3 -0
- package/lib/generate.js +255 -134
- package/lib/index.d.ts +52 -2
- package/lib/index.js +18 -5
- package/lib/istanbul/istanbul-summary.js +4 -1
- package/lib/packages/monocart-coverage-app.js +1 -1
- package/lib/platform/share.js +1 -7
- package/lib/utils/markdown.js +132 -0
- package/lib/utils/snapshot.js +13 -53
- package/lib/utils/util.js +178 -10
- package/package.json +104 -104
package/lib/platform/share.js
CHANGED
|
@@ -205,13 +205,7 @@ const Util = {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
// rangeList should be sorted by startKey, but seems useless here
|
|
208
|
-
|
|
209
|
-
const listStart = rangeList.filter((it) => startPos >= it[startKey]);
|
|
210
|
-
if (!listStart.length) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
const list = listStart.filter((it) => endPos <= it[endKey]);
|
|
208
|
+
const list = rangeList.filter((it) => startPos >= it[startKey] && endPos <= it[endKey]);
|
|
215
209
|
if (!list.length) {
|
|
216
210
|
return;
|
|
217
211
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
|
|
3
|
+
const renderLine = (ls, padding) => {
|
|
4
|
+
const spacing = ''.padEnd(padding, ' ');
|
|
5
|
+
const line = ls.join(`${spacing}|${spacing}`);
|
|
6
|
+
return `|${spacing}${line}${spacing}|`;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const renderCell = (cellValue, column) => {
|
|
10
|
+
|
|
11
|
+
// To include a pipe | as content within your cell, use a \ before the pipe:
|
|
12
|
+
cellValue = cellValue.split(/\\?\|/g).join('\\|');
|
|
13
|
+
const valueWidth = cellValue.length;
|
|
14
|
+
const width = column.width;
|
|
15
|
+
|
|
16
|
+
if (width <= valueWidth) {
|
|
17
|
+
return cellValue;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const spacingWidth = width - valueWidth;
|
|
21
|
+
const spacing = ''.padEnd(spacingWidth, ' ');
|
|
22
|
+
|
|
23
|
+
const align = column.align;
|
|
24
|
+
|
|
25
|
+
if (align === 'right') {
|
|
26
|
+
return spacing + cellValue;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (align === 'center') {
|
|
30
|
+
const l = Math.round(spacingWidth * 0.5);
|
|
31
|
+
const r = spacingWidth - l;
|
|
32
|
+
const spacingL = ''.padEnd(l, ' ');
|
|
33
|
+
const spacingR = ''.padEnd(r, ' ');
|
|
34
|
+
return spacingL + cellValue + spacingR;
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return cellValue + spacing;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const renderHyphen = (column) => {
|
|
42
|
+
const width = column.width;
|
|
43
|
+
const align = column.align;
|
|
44
|
+
if (align === 'right') {
|
|
45
|
+
return ':'.padStart(width, '-');
|
|
46
|
+
}
|
|
47
|
+
if (align === 'center') {
|
|
48
|
+
const hyphen = ''.padEnd(width - 2, '-');
|
|
49
|
+
return `:${hyphen}:`;
|
|
50
|
+
}
|
|
51
|
+
// default to left
|
|
52
|
+
return ':'.padEnd(width, '-');
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const generateMarkdownGrid = (data) => {
|
|
56
|
+
|
|
57
|
+
const options = {
|
|
58
|
+
name: '',
|
|
59
|
+
padding: 1,
|
|
60
|
+
nullPlaceholder: '',
|
|
61
|
+
... data.options
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const padding = options.padding;
|
|
65
|
+
|
|
66
|
+
// console.log(data, options);
|
|
67
|
+
|
|
68
|
+
const lines = [];
|
|
69
|
+
|
|
70
|
+
if (options.name) {
|
|
71
|
+
lines.push(`## ${options.name}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// init columns
|
|
75
|
+
const columns = data.columns.map((item) => {
|
|
76
|
+
if (typeof item === 'string') {
|
|
77
|
+
item = {
|
|
78
|
+
name: item
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const column = {
|
|
82
|
+
... item
|
|
83
|
+
};
|
|
84
|
+
column.name = `${column.name}`;
|
|
85
|
+
if (typeof column.width !== 'number') {
|
|
86
|
+
column.width = column.name.length;
|
|
87
|
+
}
|
|
88
|
+
column.width = Math.max(column.width, 3);
|
|
89
|
+
return column;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// header
|
|
93
|
+
const headers = [];
|
|
94
|
+
columns.forEach((column) => {
|
|
95
|
+
headers.push(renderCell(column.name, column));
|
|
96
|
+
});
|
|
97
|
+
lines.push(renderLine(headers, padding));
|
|
98
|
+
|
|
99
|
+
const hyphens = [];
|
|
100
|
+
columns.forEach((column) => {
|
|
101
|
+
hyphens.push(renderHyphen(column));
|
|
102
|
+
});
|
|
103
|
+
lines.push(renderLine(hyphens, padding));
|
|
104
|
+
|
|
105
|
+
// rows
|
|
106
|
+
data.rows.forEach((row) => {
|
|
107
|
+
const cells = [];
|
|
108
|
+
columns.forEach((column, i) => {
|
|
109
|
+
let cellValue = '';
|
|
110
|
+
if (Array.isArray(row)) {
|
|
111
|
+
cellValue += row[i];
|
|
112
|
+
} else {
|
|
113
|
+
let v = row[column.id];
|
|
114
|
+
if (typeof v === 'undefined' || v === null) {
|
|
115
|
+
v = options.nullPlaceholder;
|
|
116
|
+
}
|
|
117
|
+
if (column.formatter) {
|
|
118
|
+
v = column.formatter(v, row, column);
|
|
119
|
+
}
|
|
120
|
+
cellValue += v;
|
|
121
|
+
}
|
|
122
|
+
cells.push(renderCell(cellValue, column));
|
|
123
|
+
});
|
|
124
|
+
lines.push(renderLine(cells, padding));
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return lines.join(os.EOL) + os.EOL;
|
|
128
|
+
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
module.exports = generateMarkdownGrid;
|
package/lib/utils/snapshot.js
CHANGED
|
@@ -3,56 +3,6 @@ const EC = require('eight-colors');
|
|
|
3
3
|
|
|
4
4
|
const Util = require('./util.js');
|
|
5
5
|
|
|
6
|
-
const getUncoveredLines = (file) => {
|
|
7
|
-
const lines = [];
|
|
8
|
-
|
|
9
|
-
const dataLines = file.data.lines;
|
|
10
|
-
|
|
11
|
-
let startLine;
|
|
12
|
-
let endLine;
|
|
13
|
-
|
|
14
|
-
const addLines = () => {
|
|
15
|
-
if (!startLine) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
if (endLine) {
|
|
19
|
-
// range
|
|
20
|
-
lines.push(`${startLine.line}-${endLine.line}`);
|
|
21
|
-
startLine = null;
|
|
22
|
-
endLine = null;
|
|
23
|
-
} else {
|
|
24
|
-
// only start
|
|
25
|
-
lines.push(startLine.line);
|
|
26
|
-
startLine = null;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const setLines = (line) => {
|
|
31
|
-
if (startLine) {
|
|
32
|
-
endLine = {
|
|
33
|
-
line
|
|
34
|
-
};
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
startLine = {
|
|
38
|
-
line
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
Object.keys(dataLines).forEach((line) => {
|
|
43
|
-
const count = dataLines[line];
|
|
44
|
-
if (count === 0 || typeof count === 'string') {
|
|
45
|
-
setLines(line);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
// count >= 1
|
|
49
|
-
addLines();
|
|
50
|
-
});
|
|
51
|
-
addLines();
|
|
52
|
-
|
|
53
|
-
return lines.join(',');
|
|
54
|
-
};
|
|
55
|
-
|
|
56
6
|
const mergeSingleSubGroups = (item) => {
|
|
57
7
|
|
|
58
8
|
if (!item.subs) {
|
|
@@ -97,7 +47,7 @@ const getGroupedRows = (flatRows) => {
|
|
|
97
47
|
|
|
98
48
|
let filename = lastName;
|
|
99
49
|
if (file.nameStatus) {
|
|
100
|
-
filename = Util.getColorStrByStatus(lastName, file.nameStatus);
|
|
50
|
+
filename = Util.getColorStrByStatus(lastName, file.nameStatus, 'ansicode');
|
|
101
51
|
}
|
|
102
52
|
file.name = filename;
|
|
103
53
|
subs.push(file);
|
|
@@ -248,7 +198,10 @@ const getSnapshot = (reportData) => {
|
|
|
248
198
|
addPercent(snapshot.summary, summary);
|
|
249
199
|
|
|
250
200
|
files.sort((a, b) => {
|
|
251
|
-
|
|
201
|
+
if (a.sourcePath > b.sourcePath) {
|
|
202
|
+
return 1;
|
|
203
|
+
}
|
|
204
|
+
return -1;
|
|
252
205
|
});
|
|
253
206
|
files.forEach((file) => {
|
|
254
207
|
// do NOT add debug file
|
|
@@ -257,7 +210,14 @@ const getSnapshot = (reportData) => {
|
|
|
257
210
|
}
|
|
258
211
|
const fileSummary = {};
|
|
259
212
|
addPercent(fileSummary, file.summary);
|
|
260
|
-
fileSummary.uncoveredLines = getUncoveredLines(file);
|
|
213
|
+
fileSummary.uncoveredLines = Util.getUncoveredLines(file.data.lines);
|
|
214
|
+
|
|
215
|
+
// no extras for istanbul
|
|
216
|
+
const extras = file.data.extras;
|
|
217
|
+
fileSummary.extras = Object.keys(extras).map((k) => {
|
|
218
|
+
return k + extras[k];
|
|
219
|
+
}).join(',');
|
|
220
|
+
|
|
261
221
|
snapshot.files[file.sourcePath] = fileSummary;
|
|
262
222
|
});
|
|
263
223
|
|
package/lib/utils/util.js
CHANGED
|
@@ -501,19 +501,178 @@ const Util = {
|
|
|
501
501
|
return template;
|
|
502
502
|
},
|
|
503
503
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
504
|
+
normalizeColorType: (color) => {
|
|
505
|
+
return `${color}`.trim().toLowerCase();
|
|
506
|
+
},
|
|
507
|
+
|
|
508
|
+
getColorStrByStatus: (str, status, color = '') => {
|
|
509
|
+
|
|
510
|
+
const colorHandlers = {
|
|
511
|
+
'ansicode': () => {
|
|
512
|
+
if (status === 'low') {
|
|
513
|
+
return EC.red(str);
|
|
514
|
+
}
|
|
515
|
+
if (status === 'medium') {
|
|
516
|
+
return EC.yellow(str);
|
|
517
|
+
}
|
|
518
|
+
if (status === 'high') {
|
|
519
|
+
return EC.green(str);
|
|
520
|
+
}
|
|
521
|
+
return str;
|
|
522
|
+
},
|
|
523
|
+
'unicode': () => {
|
|
524
|
+
if (status === 'low') {
|
|
525
|
+
return `🔴 ${str}`;
|
|
526
|
+
}
|
|
527
|
+
if (status === 'medium') {
|
|
528
|
+
return `🟡 ${str}`;
|
|
529
|
+
}
|
|
530
|
+
if (status === 'high') {
|
|
531
|
+
return `🟢 ${str}`;
|
|
532
|
+
}
|
|
533
|
+
return str;
|
|
534
|
+
},
|
|
535
|
+
'html': () => {
|
|
536
|
+
if (status === 'low') {
|
|
537
|
+
return `<font color="red">${str}</font>`;
|
|
538
|
+
}
|
|
539
|
+
if (status === 'medium') {
|
|
540
|
+
return `<font color="orange">${str}</font>`;
|
|
541
|
+
}
|
|
542
|
+
if (status === 'high') {
|
|
543
|
+
return `<font color="green">${str}</font>`;
|
|
544
|
+
}
|
|
545
|
+
return str;
|
|
546
|
+
},
|
|
547
|
+
'tex': () => {
|
|
548
|
+
const texStr = str.replace('%', '\\\\%');
|
|
549
|
+
if (status === 'low') {
|
|
550
|
+
return `$\\color{red}{\\textsf{${texStr}}}$`;
|
|
551
|
+
}
|
|
552
|
+
if (status === 'medium') {
|
|
553
|
+
return `$\\color{orange}{\\textsf{${texStr}}}$`;
|
|
554
|
+
}
|
|
555
|
+
if (status === 'high') {
|
|
556
|
+
return `$\\color{green}{\\textsf{${texStr}}}$`;
|
|
557
|
+
}
|
|
558
|
+
return str;
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
const handler = colorHandlers[color];
|
|
563
|
+
if (handler) {
|
|
564
|
+
return handler();
|
|
513
565
|
}
|
|
566
|
+
// no color
|
|
514
567
|
return str;
|
|
515
568
|
},
|
|
516
569
|
|
|
570
|
+
getUncoveredLines: (dataLines, color = '') => {
|
|
571
|
+
|
|
572
|
+
const lines = [];
|
|
573
|
+
|
|
574
|
+
let startLine;
|
|
575
|
+
let endLine;
|
|
576
|
+
|
|
577
|
+
const getHtmlColor = (c) => {
|
|
578
|
+
return c === 'yellow' ? 'orange' : c;
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
const getAnsiLink = () => {
|
|
582
|
+
if (startLine.value !== 'red' && endLine.value !== 'red' && endLine.line - startLine.line === 1) {
|
|
583
|
+
return EC.yellow('-');
|
|
584
|
+
}
|
|
585
|
+
return EC.red('-');
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
const getHtmlLink = () => {
|
|
589
|
+
if (startLine.value !== 'red' && endLine.value !== 'red' && endLine.line - startLine.line === 1) {
|
|
590
|
+
return '<font color="orange">-</font>';
|
|
591
|
+
}
|
|
592
|
+
return '<font color="red">-</font>';
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
const addRangeItem = () => {
|
|
596
|
+
if (color === 'ansicode') {
|
|
597
|
+
lines.push(EC[startLine.value](startLine.line) + getAnsiLink() + EC[endLine.value](endLine.line));
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if (color === 'html') {
|
|
602
|
+
lines.push(`<font color="${getHtmlColor(startLine.value)}">${startLine.line}</font>${getHtmlLink()}<font color="${getHtmlColor(endLine.value)}">${endLine.line}</font>`);
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// no color
|
|
607
|
+
lines.push(`${startLine.line}-${endLine.line}`);
|
|
608
|
+
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
const addStartItem = () => {
|
|
612
|
+
if (color === 'ansicode') {
|
|
613
|
+
lines.push(EC[startLine.value](startLine.line));
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
if (color === 'html') {
|
|
618
|
+
lines.push(`<font color="${getHtmlColor(startLine.value)}">${startLine.line}</font>`);
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// no color
|
|
623
|
+
lines.push(startLine.line);
|
|
624
|
+
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
const addLines = () => {
|
|
628
|
+
if (!startLine) {
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
if (endLine) {
|
|
632
|
+
// range
|
|
633
|
+
addRangeItem();
|
|
634
|
+
startLine = null;
|
|
635
|
+
endLine = null;
|
|
636
|
+
} else {
|
|
637
|
+
// only start
|
|
638
|
+
addStartItem();
|
|
639
|
+
startLine = null;
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
const setLines = (line, value) => {
|
|
644
|
+
if (startLine) {
|
|
645
|
+
endLine = {
|
|
646
|
+
line,
|
|
647
|
+
value
|
|
648
|
+
};
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
startLine = {
|
|
652
|
+
line,
|
|
653
|
+
value
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
Object.keys(dataLines).forEach((line) => {
|
|
658
|
+
const count = dataLines[line];
|
|
659
|
+
if (count === 0) {
|
|
660
|
+
setLines(line, 'red');
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
// 0 < count < 1
|
|
664
|
+
if (typeof count === 'string') {
|
|
665
|
+
setLines(line, 'yellow');
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
// count >= 1
|
|
669
|
+
addLines();
|
|
670
|
+
});
|
|
671
|
+
addLines();
|
|
672
|
+
|
|
673
|
+
return lines.join(',');
|
|
674
|
+
},
|
|
675
|
+
|
|
517
676
|
cmpVersion: (v1, v2) => {
|
|
518
677
|
const [strMajor1, strMinor1, strPatch1] = `${v1}`.split('.');
|
|
519
678
|
const [strMajor2, strMinor2, strPatch2] = `${v2}`.split('.');
|
|
@@ -611,7 +770,15 @@ const Util = {
|
|
|
611
770
|
}
|
|
612
771
|
const duration = Date.now() - time_start;
|
|
613
772
|
const durationH = Util.TF(duration);
|
|
614
|
-
const ls = [`[MCR] ${message}
|
|
773
|
+
const ls = [`[MCR] ${message}`];
|
|
774
|
+
|
|
775
|
+
// memory
|
|
776
|
+
const { heapUsed } = process.memoryUsage();
|
|
777
|
+
const memory = parseFloat((heapUsed / 1024 ** 2).toFixed(1));
|
|
778
|
+
ls.push(` (memory: ${memory}MB)`);
|
|
779
|
+
|
|
780
|
+
// time
|
|
781
|
+
ls.push(' (');
|
|
615
782
|
if (duration <= 100) {
|
|
616
783
|
ls.push(EC.green(durationH));
|
|
617
784
|
} else if (duration < 500) {
|
|
@@ -620,6 +787,7 @@ const Util = {
|
|
|
620
787
|
ls.push(EC.red(durationH));
|
|
621
788
|
}
|
|
622
789
|
ls.push(')');
|
|
790
|
+
|
|
623
791
|
console.log(ls.join(''));
|
|
624
792
|
}
|
|
625
793
|
|
package/package.json
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "monocart-coverage-reports",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A code coverage tool to generate native V8 reports or Istanbul reports.",
|
|
5
|
-
"main": "./lib/index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"mcr": "./lib/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./lib/index.d.ts",
|
|
12
|
-
"import": "./lib/index.mjs",
|
|
13
|
-
"require": "./lib/index.js",
|
|
14
|
-
"default": "./lib/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./register": {
|
|
17
|
-
"import": "./lib/register/register.mjs",
|
|
18
|
-
"require": "./lib/register/register.js",
|
|
19
|
-
"default": "./lib/register/register.js"
|
|
20
|
-
},
|
|
21
|
-
"./converter": "./lib/converter/converter.js",
|
|
22
|
-
"./util": "./lib/utils/util.js",
|
|
23
|
-
"./package.json": "./package.json"
|
|
24
|
-
},
|
|
25
|
-
"types": "./lib/index.d.ts",
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build-test": "node ./test/build/build-test.js",
|
|
28
|
-
"build": "npx sf lint && npx sf b -p && npm run build-test",
|
|
29
|
-
"test-unit": "mocha --parallel test/unit/*.test.js",
|
|
30
|
-
"test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-report.js",
|
|
31
|
-
"test-node-api": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-api node ./test/test-node-api.js",
|
|
32
|
-
"test-node-ins": "node ./test/test-node-ins.js",
|
|
33
|
-
"test-node-cdp": "node --inspect=9229 ./test/test-node-cdp.js",
|
|
34
|
-
"test-node-vm": "node ./test/test-node-vm.js",
|
|
35
|
-
"test-node-koa": "node ./test/test-node-koa.js",
|
|
36
|
-
"test-node-fgc": "node ./test/test-node-fgc.js",
|
|
37
|
-
"test-node": "node ./test/test.js --node",
|
|
38
|
-
"test-istanbul": "node ./test/test-istanbul.js",
|
|
39
|
-
"test-v8": "node ./test/test-v8.js",
|
|
40
|
-
"test-puppeteer": "node ./test/test-puppeteer.js",
|
|
41
|
-
"test-anonymous": "node ./test/test-anonymous.js",
|
|
42
|
-
"test-css": "node ./test/test-css.js",
|
|
43
|
-
"test-minify": "node ./test/test-minify.js",
|
|
44
|
-
"test-esbuild": "node ./test/test-esbuild.js",
|
|
45
|
-
"test-rollup": "node ./test/test-rollup.js",
|
|
46
|
-
"test-swc": "node ./test/test-swc.js",
|
|
47
|
-
"test-v8-and-istanbul": "node ./test/test-v8-and-istanbul.js",
|
|
48
|
-
"test-browser": "node ./test/test.js --browser",
|
|
49
|
-
"test-cli": "npx mcr node ./test/specs/node.test.js -c test/mcr.config.cli.js",
|
|
50
|
-
"test-tsx": "npx mcr tsx ./test/specs/tsx.test.ts -c test/mcr.config.tsx.js",
|
|
51
|
-
"test-demo": "node ./test/test-demo.js",
|
|
52
|
-
"test-merge": "node ./test/test-merge.js",
|
|
53
|
-
"test-merge-istanbul": "node ./test/test-merge-istanbul.js",
|
|
54
|
-
"test-client": "node ./test/test-client.js",
|
|
55
|
-
"test-all": "node ./test/test.js && node ./scripts/docs.js",
|
|
56
|
-
"test": "npm run test-unit && npx mcr npm run test-all -c test/mcr.config.mcr.js",
|
|
57
|
-
"test:snap": "cross-env TEST_SNAPSHOT=true npm run test",
|
|
58
|
-
"dev": "npx sf d app",
|
|
59
|
-
"open": "node ./scripts/open.js",
|
|
60
|
-
"eol": "git rm -rf --cached . && git reset --hard HEAD",
|
|
61
|
-
"patch": "npm run build && npm run test && npx sf publish patch -r"
|
|
62
|
-
},
|
|
63
|
-
"workspaces": [
|
|
64
|
-
"packages/*",
|
|
65
|
-
"test"
|
|
66
|
-
],
|
|
67
|
-
"files": [
|
|
68
|
-
"lib",
|
|
69
|
-
"README.zh-Hans.md"
|
|
70
|
-
],
|
|
71
|
-
"license": "MIT",
|
|
72
|
-
"repository": {
|
|
73
|
-
"type": "git",
|
|
74
|
-
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
|
|
75
|
-
},
|
|
76
|
-
"dependencies": {
|
|
77
|
-
"console-grid": "^2.2.2",
|
|
78
|
-
"eight-colors": "^1.3.0",
|
|
79
|
-
"istanbul-lib-coverage": "^3.2.2",
|
|
80
|
-
"istanbul-lib-report": "^3.0.1",
|
|
81
|
-
"istanbul-reports": "^3.1.7",
|
|
82
|
-
"lz-utils": "^2.0.2",
|
|
83
|
-
"monocart-code-viewer": "^1.1.4",
|
|
84
|
-
"monocart-formatter": "^3.0.0",
|
|
85
|
-
"monocart-locator": "^1.0.
|
|
86
|
-
"turbogrid": "^3.2.0"
|
|
87
|
-
},
|
|
88
|
-
"devDependencies": {
|
|
89
|
-
"commander": "^12.1.0",
|
|
90
|
-
"esbuild": "^0.
|
|
91
|
-
"eslint": "~9.6.0",
|
|
92
|
-
"eslint-config-plus": "^2.0.2",
|
|
93
|
-
"eslint-plugin-html": "^8.1.1",
|
|
94
|
-
"eslint-plugin-vue": "^9.
|
|
95
|
-
"find-up": "^7.0.0",
|
|
96
|
-
"minimatch": "^9.0.5",
|
|
97
|
-
"starfall-cli": "^2.0.19",
|
|
98
|
-
"stylelint": "^16.6.1",
|
|
99
|
-
"stylelint-config-plus": "^1.1.2",
|
|
100
|
-
"supports-color": "^9.4.0",
|
|
101
|
-
"tsx": "^4.16.
|
|
102
|
-
"ws": "^8.17.1"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "monocart-coverage-reports",
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "A code coverage tool to generate native V8 reports or Istanbul reports.",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mcr": "./lib/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"import": "./lib/index.mjs",
|
|
13
|
+
"require": "./lib/index.js",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./register": {
|
|
17
|
+
"import": "./lib/register/register.mjs",
|
|
18
|
+
"require": "./lib/register/register.js",
|
|
19
|
+
"default": "./lib/register/register.js"
|
|
20
|
+
},
|
|
21
|
+
"./converter": "./lib/converter/converter.js",
|
|
22
|
+
"./util": "./lib/utils/util.js",
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"types": "./lib/index.d.ts",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build-test": "node ./test/build/build-test.js",
|
|
28
|
+
"build": "npx sf lint && npx sf b -p && npm run build-test",
|
|
29
|
+
"test-unit": "mocha --parallel test/unit/*.test.js",
|
|
30
|
+
"test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-report.js",
|
|
31
|
+
"test-node-api": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-api node ./test/test-node-api.js",
|
|
32
|
+
"test-node-ins": "node ./test/test-node-ins.js",
|
|
33
|
+
"test-node-cdp": "node --inspect=9229 ./test/test-node-cdp.js",
|
|
34
|
+
"test-node-vm": "node ./test/test-node-vm.js",
|
|
35
|
+
"test-node-koa": "node ./test/test-node-koa.js",
|
|
36
|
+
"test-node-fgc": "node ./test/test-node-fgc.js",
|
|
37
|
+
"test-node": "node ./test/test.js --node",
|
|
38
|
+
"test-istanbul": "node ./test/test-istanbul.js",
|
|
39
|
+
"test-v8": "node ./test/test-v8.js",
|
|
40
|
+
"test-puppeteer": "node ./test/test-puppeteer.js",
|
|
41
|
+
"test-anonymous": "node ./test/test-anonymous.js",
|
|
42
|
+
"test-css": "node ./test/test-css.js",
|
|
43
|
+
"test-minify": "node ./test/test-minify.js",
|
|
44
|
+
"test-esbuild": "node ./test/test-esbuild.js",
|
|
45
|
+
"test-rollup": "node ./test/test-rollup.js",
|
|
46
|
+
"test-swc": "node ./test/test-swc.js",
|
|
47
|
+
"test-v8-and-istanbul": "node ./test/test-v8-and-istanbul.js",
|
|
48
|
+
"test-browser": "node ./test/test.js --browser",
|
|
49
|
+
"test-cli": "npx mcr node ./test/specs/node.test.js -c test/mcr.config.cli.js",
|
|
50
|
+
"test-tsx": "npx mcr tsx ./test/specs/tsx.test.ts -c test/mcr.config.tsx.js",
|
|
51
|
+
"test-demo": "node ./test/test-demo.js",
|
|
52
|
+
"test-merge": "node ./test/test-merge.js",
|
|
53
|
+
"test-merge-istanbul": "node ./test/test-merge-istanbul.js",
|
|
54
|
+
"test-client": "node ./test/test-client.js",
|
|
55
|
+
"test-all": "node ./test/test.js && node ./scripts/docs.js",
|
|
56
|
+
"test": "npm run test-unit && npx mcr npm run test-all -c test/mcr.config.mcr.js",
|
|
57
|
+
"test:snap": "cross-env TEST_SNAPSHOT=true npm run test",
|
|
58
|
+
"dev": "npx sf d app",
|
|
59
|
+
"open": "node ./scripts/open.js",
|
|
60
|
+
"eol": "git rm -rf --cached . && git reset --hard HEAD",
|
|
61
|
+
"patch": "npm run build && npm run test && npx sf publish patch -r"
|
|
62
|
+
},
|
|
63
|
+
"workspaces": [
|
|
64
|
+
"packages/*",
|
|
65
|
+
"test"
|
|
66
|
+
],
|
|
67
|
+
"files": [
|
|
68
|
+
"lib",
|
|
69
|
+
"README.zh-Hans.md"
|
|
70
|
+
],
|
|
71
|
+
"license": "MIT",
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"console-grid": "^2.2.2",
|
|
78
|
+
"eight-colors": "^1.3.0",
|
|
79
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
80
|
+
"istanbul-lib-report": "^3.0.1",
|
|
81
|
+
"istanbul-reports": "^3.1.7",
|
|
82
|
+
"lz-utils": "^2.0.2",
|
|
83
|
+
"monocart-code-viewer": "^1.1.4",
|
|
84
|
+
"monocart-formatter": "^3.0.0",
|
|
85
|
+
"monocart-locator": "^1.0.2",
|
|
86
|
+
"turbogrid": "^3.2.0"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"commander": "^12.1.0",
|
|
90
|
+
"esbuild": "^0.23.0",
|
|
91
|
+
"eslint": "~9.6.0",
|
|
92
|
+
"eslint-config-plus": "^2.0.2",
|
|
93
|
+
"eslint-plugin-html": "^8.1.1",
|
|
94
|
+
"eslint-plugin-vue": "^9.27.0",
|
|
95
|
+
"find-up": "^7.0.0",
|
|
96
|
+
"minimatch": "^9.0.5",
|
|
97
|
+
"starfall-cli": "^2.0.19",
|
|
98
|
+
"stylelint": "^16.6.1",
|
|
99
|
+
"stylelint-config-plus": "^1.1.2",
|
|
100
|
+
"supports-color": "^9.4.0",
|
|
101
|
+
"tsx": "^4.16.2",
|
|
102
|
+
"ws": "^8.17.1"
|
|
103
|
+
}
|
|
104
|
+
}
|