monocart-coverage-reports 2.12.9 → 2.12.11
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 +88 -16
- package/README.zh-Hans.md +83 -11
- package/lib/cli.js +16 -8
- package/lib/index.d.ts +9 -9
- package/lib/packages/monocart-coverage-assets.js +1 -1
- package/lib/packages/monocart-coverage-vendor.js +16 -18
- package/lib/utils/util.js +18 -18
- package/package.json +136 -133
package/lib/utils/util.js
CHANGED
|
@@ -76,23 +76,24 @@ const Util = {
|
|
|
76
76
|
},
|
|
77
77
|
|
|
78
78
|
strToObj: (str) => {
|
|
79
|
-
if (typeof str
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
79
|
+
if (typeof str !== 'string') {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
str = str.trim();
|
|
83
|
+
if (!(str.startsWith('{') && str.endsWith('}'))) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// Accept JSON-like objects using single or double quotes, e.g.
|
|
87
|
+
// {'**/node_modules/**':false,'**/src/*.js':true}
|
|
88
|
+
// Normalize single quotes to double quotes, then JSON.parse (safe, no code execution).
|
|
89
|
+
const normalized = str.replace(/'/g, '"');
|
|
90
|
+
try {
|
|
91
|
+
const obj = JSON.parse(normalized);
|
|
92
|
+
if (obj && typeof obj === 'object') {
|
|
93
|
+
return obj;
|
|
95
94
|
}
|
|
95
|
+
} catch (e) {
|
|
96
|
+
// not a parseable object literal
|
|
96
97
|
}
|
|
97
98
|
},
|
|
98
99
|
|
|
@@ -744,7 +745,6 @@ const Util = {
|
|
|
744
745
|
// skip \s and comments
|
|
745
746
|
fixSourceRange: (locator, start, end) => {
|
|
746
747
|
|
|
747
|
-
let fixedStart = start;
|
|
748
748
|
let fixedEnd = end;
|
|
749
749
|
|
|
750
750
|
const rangeText = locator.getSlice(start, end);
|
|
@@ -814,7 +814,7 @@ const Util = {
|
|
|
814
814
|
startOffset += 1;
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
-
fixedStart = start + startOffset;
|
|
817
|
+
const fixedStart = start + startOffset;
|
|
818
818
|
|
|
819
819
|
return {
|
|
820
820
|
fixedStart,
|
package/package.json
CHANGED
|
@@ -1,133 +1,136 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "monocart-coverage-reports",
|
|
3
|
-
"version": "2.12.
|
|
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
|
-
},
|
|
15
|
-
"./register": {
|
|
16
|
-
"import": "./lib/register/register.mjs",
|
|
17
|
-
"require": "./lib/register/register.js"
|
|
18
|
-
},
|
|
19
|
-
"./converter": "./lib/converter/converter.js",
|
|
20
|
-
"./util": "./lib/utils/util.js",
|
|
21
|
-
"./package.json": "./package.json"
|
|
22
|
-
},
|
|
23
|
-
"types": "./lib/index.d.ts",
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build-test": "node ./test/build/build-test.js",
|
|
26
|
-
"build": "npx sf lint && npx sf b -p && npm run build-test",
|
|
27
|
-
"test-unit": "mocha --parallel test/unit/*.test.js",
|
|
28
|
-
"test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-report.js",
|
|
29
|
-
"test-node-api": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-api node ./test/test-node-api.js",
|
|
30
|
-
"test-node-ins": "node ./test/test-node-ins.js",
|
|
31
|
-
"test-node-cdp": "node --inspect=9229 ./test/test-node-cdp.js",
|
|
32
|
-
"test-node-vm": "node ./test/test-node-vm.js",
|
|
33
|
-
"test-node-koa": "node ./test/test-node-koa.js",
|
|
34
|
-
"test-node-fgc": "node ./test/test-node-fgc.js",
|
|
35
|
-
"test-node": "node ./test/test.js --node",
|
|
36
|
-
"test-istanbul": "node ./test/test-istanbul.js",
|
|
37
|
-
"test-v8": "node ./test/test-v8.js",
|
|
38
|
-
"test-puppeteer": "node ./test/test-puppeteer.js",
|
|
39
|
-
"test-css": "node ./test/test-css.js",
|
|
40
|
-
"test-minify": "node ./test/test-minify.js",
|
|
41
|
-
"test-esbuild": "node ./test/test-esbuild.js",
|
|
42
|
-
"test-rollup": "node ./test/test-rollup.js",
|
|
43
|
-
"test-sections": "node ./test/test-sections.js",
|
|
44
|
-
"test-swc": "node ./test/test-swc.js",
|
|
45
|
-
"test-v8-and-istanbul": "node ./test/test-v8-and-istanbul.js",
|
|
46
|
-
"test-browser": "node ./test/test.js --browser",
|
|
47
|
-
"test-cli": "npx mcr node ./test/specs/node.test.js -c test/mcr.config.cli.js",
|
|
48
|
-
"test-demo": "node ./test/test-demo.js",
|
|
49
|
-
"test-merge": "node ./test/test-merge.js",
|
|
50
|
-
"test-merge-istanbul": "node ./test/test-merge-istanbul.js",
|
|
51
|
-
"test-merge-v8": "node ./test/test-merge-v8.js",
|
|
52
|
-
"test-merge-cli": "npx mcr merge -r console-details,v8 --inputDir .temp/code-coverage/raw --outputDir .temp/merge-cli",
|
|
53
|
-
"test-client": "node ./test/test-client.js",
|
|
54
|
-
"test-
|
|
55
|
-
"test-
|
|
56
|
-
"test": "
|
|
57
|
-
"test
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"acorn
|
|
76
|
-
"acorn-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"istanbul-lib-
|
|
83
|
-
"istanbul-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"@actions/
|
|
90
|
-
"@
|
|
91
|
-
"@
|
|
92
|
-
"@
|
|
93
|
-
"@rollup/plugin-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"eslint
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "monocart-coverage-reports",
|
|
3
|
+
"version": "2.12.11",
|
|
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
|
+
},
|
|
15
|
+
"./register": {
|
|
16
|
+
"import": "./lib/register/register.mjs",
|
|
17
|
+
"require": "./lib/register/register.js"
|
|
18
|
+
},
|
|
19
|
+
"./converter": "./lib/converter/converter.js",
|
|
20
|
+
"./util": "./lib/utils/util.js",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"types": "./lib/index.d.ts",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build-test": "node ./test/build/build-test.js",
|
|
26
|
+
"build": "npx sf lint && npx sf b -p && npm run build-test",
|
|
27
|
+
"test-unit": "mocha --parallel test/unit/*.test.js",
|
|
28
|
+
"test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-report.js",
|
|
29
|
+
"test-node-api": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-api node ./test/test-node-api.js",
|
|
30
|
+
"test-node-ins": "node ./test/test-node-ins.js",
|
|
31
|
+
"test-node-cdp": "node --inspect=9229 ./test/test-node-cdp.js",
|
|
32
|
+
"test-node-vm": "node ./test/test-node-vm.js",
|
|
33
|
+
"test-node-koa": "node ./test/test-node-koa.js",
|
|
34
|
+
"test-node-fgc": "node ./test/test-node-fgc.js",
|
|
35
|
+
"test-node": "node ./test/test.js --node",
|
|
36
|
+
"test-istanbul": "node ./test/test-istanbul.js",
|
|
37
|
+
"test-v8": "node ./test/test-v8.js",
|
|
38
|
+
"test-puppeteer": "node ./test/test-puppeteer.js",
|
|
39
|
+
"test-css": "node ./test/test-css.js",
|
|
40
|
+
"test-minify": "node ./test/test-minify.js",
|
|
41
|
+
"test-esbuild": "node ./test/test-esbuild.js",
|
|
42
|
+
"test-rollup": "node ./test/test-rollup.js",
|
|
43
|
+
"test-sections": "node ./test/test-sections.js",
|
|
44
|
+
"test-swc": "node ./test/test-swc.js",
|
|
45
|
+
"test-v8-and-istanbul": "node ./test/test-v8-and-istanbul.js",
|
|
46
|
+
"test-browser": "node ./test/test.js --browser",
|
|
47
|
+
"test-cli": "npx mcr node ./test/specs/node.test.js -c test/mcr.config.cli.js",
|
|
48
|
+
"test-demo": "node ./test/test-demo.js",
|
|
49
|
+
"test-merge": "node ./test/test-merge.js",
|
|
50
|
+
"test-merge-istanbul": "node ./test/test-merge-istanbul.js",
|
|
51
|
+
"test-merge-v8": "node ./test/test-merge-v8.js",
|
|
52
|
+
"test-merge-cli": "npx mcr merge -r console-details,v8 --inputDir .temp/code-coverage/raw --outputDir .temp/merge-cli",
|
|
53
|
+
"test-client": "node ./test/test-client.js",
|
|
54
|
+
"test-cp": "npx mcr node test/test-cp.mjs --outputDir .temp/test-cp",
|
|
55
|
+
"test-all": "node ./test/test.js",
|
|
56
|
+
"test-pr": "node --inspect=9230 ./test/test-pr.js",
|
|
57
|
+
"test": "npm run test-unit && npx mcr npm run test-all -c test/mcr.config.mcr.js && node ./scripts/docs.js",
|
|
58
|
+
"test:snap": "cross-env TEST_SNAPSHOT=true npm run test",
|
|
59
|
+
"dev": "npx sf d app",
|
|
60
|
+
"open": "node ./scripts/open.js",
|
|
61
|
+
"eol": "git rm -rf --cached . && git reset --hard HEAD",
|
|
62
|
+
"patch": "npm run build && npm run test && npx sf publish patch -r",
|
|
63
|
+
"beta": "npm version prerelease --preid=beta && npm run build && npm run test && npm publish --tag beta"
|
|
64
|
+
},
|
|
65
|
+
"files": [
|
|
66
|
+
"lib",
|
|
67
|
+
"README.zh-Hans.md"
|
|
68
|
+
],
|
|
69
|
+
"license": "MIT",
|
|
70
|
+
"repository": {
|
|
71
|
+
"type": "git",
|
|
72
|
+
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"acorn": "^8.16.0",
|
|
76
|
+
"acorn-loose": "^8.5.2",
|
|
77
|
+
"acorn-walk": "^8.3.5",
|
|
78
|
+
"commander": "^14.0.3",
|
|
79
|
+
"console-grid": "^2.2.4",
|
|
80
|
+
"eight-colors": "^1.3.3",
|
|
81
|
+
"foreground-child": "^4.0.3",
|
|
82
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
83
|
+
"istanbul-lib-report": "^3.0.1",
|
|
84
|
+
"istanbul-reports": "^3.2.0",
|
|
85
|
+
"lz-utils": "^2.1.1",
|
|
86
|
+
"monocart-locator": "^1.0.3"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@actions/core": "^3.0.0",
|
|
90
|
+
"@actions/github": "^9.1.0",
|
|
91
|
+
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
92
|
+
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
93
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
94
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
95
|
+
"@swc/core": "^1.15.30",
|
|
96
|
+
"@types/node": "^25.6.0",
|
|
97
|
+
"async-tick": "^1.0.2",
|
|
98
|
+
"babel-loader": "^10.1.1",
|
|
99
|
+
"babel-plugin-istanbul": "^8.0.0",
|
|
100
|
+
"convert-source-map": "^2.0.0",
|
|
101
|
+
"cross-env": "^10.1.0",
|
|
102
|
+
"diff-sequences": "^29.6.3",
|
|
103
|
+
"esbuild": "^0.28.0",
|
|
104
|
+
"eslint": "~10.2.1",
|
|
105
|
+
"eslint-config-plus": "^2.0.4",
|
|
106
|
+
"eslint-plugin-html": "^8.1.4",
|
|
107
|
+
"eslint-plugin-vue": "^10.8.0",
|
|
108
|
+
"find-up": "^8.0.0",
|
|
109
|
+
"foreground-child": "^4.0.3",
|
|
110
|
+
"koa": "^3.2.0",
|
|
111
|
+
"koa-static-resolver": "^1.0.6",
|
|
112
|
+
"minimatch": "^9.0.5",
|
|
113
|
+
"mocha": "^11.7.5",
|
|
114
|
+
"monocart-code-viewer": "^1.2.0",
|
|
115
|
+
"monocart-formatter": "^3.0.1",
|
|
116
|
+
"node-stream-zip": "^1.15.0",
|
|
117
|
+
"open": "^11.0.0",
|
|
118
|
+
"playwright": "^1.59.1",
|
|
119
|
+
"postcss": "^8.5.10",
|
|
120
|
+
"puppeteer": "^24.41.0",
|
|
121
|
+
"rollup": "^4.60.2",
|
|
122
|
+
"starfall-cli": "^2.0.24",
|
|
123
|
+
"stylelint": "^17.8.0",
|
|
124
|
+
"stylelint-config-plus": "^1.1.6",
|
|
125
|
+
"supports-color": "^10.2.2",
|
|
126
|
+
"swc-loader": "^0.2.7",
|
|
127
|
+
"ts-loader": "^9.5.7",
|
|
128
|
+
"tsx": "^4.21.0",
|
|
129
|
+
"turbogrid": "^3.2.4",
|
|
130
|
+
"typescript": "^6.0.3",
|
|
131
|
+
"vine-ui": "^3.1.18",
|
|
132
|
+
"webpack": "^5.106.2",
|
|
133
|
+
"ws": "^8.20.0",
|
|
134
|
+
"yazl": "^3.3.1"
|
|
135
|
+
}
|
|
136
|
+
}
|