monocart-coverage-reports 2.5.5 → 2.5.6
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 +22 -5
- package/lib/cli.js +94 -15
- package/lib/converter/collect-source-maps.js +10 -7
- package/lib/converter/converter.js +19 -5
- package/lib/index.d.ts +23 -8
- package/lib/packages/monocart-coverage-vendor.js +46 -44
- package/lib/v8/v8.js +26 -6
- package/package.json +3 -2
package/lib/v8/v8.js
CHANGED
|
@@ -5,8 +5,8 @@ const Util = require('../utils/util.js');
|
|
|
5
5
|
const { getV8Summary } = require('./v8-summary.js');
|
|
6
6
|
const { dedupeFlatRanges } = require('../utils/dedupe.js');
|
|
7
7
|
const { getSourcePath } = require('../utils/source-path.js');
|
|
8
|
-
const { mergeScriptCovs } = require('../packages/monocart-coverage-vendor.js');
|
|
9
|
-
const collectSourceMaps = require('../converter/collect-source-maps.js');
|
|
8
|
+
const { mergeScriptCovs, minimatch } = require('../packages/monocart-coverage-vendor.js');
|
|
9
|
+
const { collectSourceMaps } = require('../converter/collect-source-maps.js');
|
|
10
10
|
const version = require('../../package.json').version;
|
|
11
11
|
|
|
12
12
|
const getWrapperSource = (offset, source) => {
|
|
@@ -23,18 +23,38 @@ const getWrapperSource = (offset, source) => {
|
|
|
23
23
|
return startStr + source;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
// filter list first
|
|
26
|
+
const getEntryFilter = (options) => {
|
|
29
27
|
const entryFilter = options.entryFilter;
|
|
30
28
|
if (typeof entryFilter === 'function') {
|
|
31
|
-
|
|
29
|
+
return entryFilter;
|
|
32
30
|
}
|
|
33
31
|
|
|
32
|
+
if (entryFilter && typeof entryFilter === 'string') {
|
|
33
|
+
return (entry) => {
|
|
34
|
+
return minimatch(entry.url, entryFilter);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return () => true;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const initV8ListAndSourcemap = async (v8list, options) => {
|
|
42
|
+
|
|
43
|
+
// entry filter
|
|
44
|
+
const entryFilter = getEntryFilter(options);
|
|
45
|
+
|
|
34
46
|
// filter no source or text
|
|
35
47
|
// init type and css source from text
|
|
36
48
|
// keep functions
|
|
37
49
|
v8list = v8list.filter((item) => {
|
|
50
|
+
|
|
51
|
+
// filter entry
|
|
52
|
+
if (!entryFilter(item)) {
|
|
53
|
+
// console.log('-', item.url);
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
// console.log(item.url);
|
|
57
|
+
|
|
38
58
|
if (typeof item.source === 'string' && item.functions) {
|
|
39
59
|
item.type = 'js';
|
|
40
60
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monocart-coverage-reports",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"description": "Monocart coverage reports",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -67,10 +67,11 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"commander": "^12.0.0",
|
|
70
|
-
"eslint": "^8.
|
|
70
|
+
"eslint": "^8.57.0",
|
|
71
71
|
"eslint-config-plus": "^1.0.6",
|
|
72
72
|
"eslint-plugin-html": "^8.0.0",
|
|
73
73
|
"eslint-plugin-vue": "^9.22.0",
|
|
74
|
+
"minimatch": "^9.0.3",
|
|
74
75
|
"stylelint": "^15.11.0",
|
|
75
76
|
"stylelint-config-plus": "^1.0.4",
|
|
76
77
|
"supports-color": "^9.4.0"
|