monocart-coverage-reports 2.12.8 → 2.12.10
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/lib/utils/source-path.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
1
2
|
const path = require('path');
|
|
2
3
|
const { fileURLToPath, pathToFileURL } = require('url');
|
|
3
4
|
const Util = require('./util.js');
|
|
@@ -161,6 +162,7 @@ const initIstanbulSourcePath = (coverageData, fileSources, options) => {
|
|
|
161
162
|
const sourcePathReplacer = getSourcePathReplacer(options);
|
|
162
163
|
|
|
163
164
|
const newCoverage = {};
|
|
165
|
+
// eslint-disable-next-line complexity
|
|
164
166
|
Object.keys(coverageData).forEach((sourcePath) => {
|
|
165
167
|
// previous coverage and source
|
|
166
168
|
const item = coverageData[sourcePath];
|
|
@@ -175,6 +177,10 @@ const initIstanbulSourcePath = (coverageData, fileSources, options) => {
|
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
|
|
180
|
+
if (!fs.existsSync(sourcePath)) {
|
|
181
|
+
sourcePath = normalizePathDir(sourcePath);
|
|
182
|
+
}
|
|
183
|
+
|
|
178
184
|
// new source path, second is source url
|
|
179
185
|
if (sourcePathReplacer) {
|
|
180
186
|
const newSourcePath = sourcePathReplacer(sourcePath, item);
|
|
@@ -183,8 +189,6 @@ const initIstanbulSourcePath = (coverageData, fileSources, options) => {
|
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
191
|
|
|
186
|
-
// console.log(item);
|
|
187
|
-
|
|
188
192
|
// update source path
|
|
189
193
|
if (item.data) {
|
|
190
194
|
item.data.path = sourcePath;
|
package/package.json
CHANGED
|
@@ -1,133 +1,135 @@
|
|
|
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-all": "node ./test/test.js",
|
|
55
|
-
"test-pr": "node --inspect=9230 ./test/test-pr.js",
|
|
56
|
-
"test": "npm run test-unit && npx mcr npm run test-all -c test/mcr.config.mcr.js && node ./scripts/docs.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
|
-
"beta": "npm version prerelease --preid=beta && npm run build && npm run test && npm publish --tag beta"
|
|
63
|
-
},
|
|
64
|
-
"files": [
|
|
65
|
-
"lib",
|
|
66
|
-
"README.zh-Hans.md"
|
|
67
|
-
],
|
|
68
|
-
"license": "MIT",
|
|
69
|
-
"repository": {
|
|
70
|
-
"type": "git",
|
|
71
|
-
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
|
|
72
|
-
},
|
|
73
|
-
"dependencies": {
|
|
74
|
-
"acorn": "^8.
|
|
75
|
-
"acorn-loose": "^8.5.2",
|
|
76
|
-
"acorn-walk": "^8.3.
|
|
77
|
-
"commander": "^14.0.
|
|
78
|
-
"console-grid": "^2.2.
|
|
79
|
-
"eight-colors": "^1.3.
|
|
80
|
-
"foreground-child": "^
|
|
81
|
-
"istanbul-lib-coverage": "^3.2.2",
|
|
82
|
-
"istanbul-lib-report": "^3.0.1",
|
|
83
|
-
"istanbul-reports": "^3.2.0",
|
|
84
|
-
"lz-utils": "^2.1.
|
|
85
|
-
"monocart-locator": "^1.0.
|
|
86
|
-
},
|
|
87
|
-
"devDependencies": {
|
|
88
|
-
"@actions/core": "^
|
|
89
|
-
"@actions/github": "^
|
|
90
|
-
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
91
|
-
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
92
|
-
"@rollup/plugin-commonjs": "^
|
|
93
|
-
"@rollup/plugin-typescript": "^12.
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"eslint
|
|
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.10",
|
|
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-all": "node ./test/test.js",
|
|
55
|
+
"test-pr": "node --inspect=9230 ./test/test-pr.js",
|
|
56
|
+
"test": "npm run test-unit && npx mcr npm run test-all -c test/mcr.config.mcr.js && node ./scripts/docs.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
|
+
"beta": "npm version prerelease --preid=beta && npm run build && npm run test && npm publish --tag beta"
|
|
63
|
+
},
|
|
64
|
+
"files": [
|
|
65
|
+
"lib",
|
|
66
|
+
"README.zh-Hans.md"
|
|
67
|
+
],
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"repository": {
|
|
70
|
+
"type": "git",
|
|
71
|
+
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"acorn": "^8.16.0",
|
|
75
|
+
"acorn-loose": "^8.5.2",
|
|
76
|
+
"acorn-walk": "^8.3.5",
|
|
77
|
+
"commander": "^14.0.3",
|
|
78
|
+
"console-grid": "^2.2.4",
|
|
79
|
+
"eight-colors": "^1.3.3",
|
|
80
|
+
"foreground-child": "^4.0.3",
|
|
81
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
82
|
+
"istanbul-lib-report": "^3.0.1",
|
|
83
|
+
"istanbul-reports": "^3.2.0",
|
|
84
|
+
"lz-utils": "^2.1.1",
|
|
85
|
+
"monocart-locator": "^1.0.3"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@actions/core": "^3.0.0",
|
|
89
|
+
"@actions/github": "^9.1.0",
|
|
90
|
+
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
91
|
+
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
92
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
93
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
94
|
+
"@swc/core": "^1.15.26",
|
|
95
|
+
"@types/node": "^25.6.0",
|
|
96
|
+
"async-tick": "^1.0.2",
|
|
97
|
+
"babel-loader": "^10.1.1",
|
|
98
|
+
"babel-plugin-istanbul": "^8.0.0",
|
|
99
|
+
"convert-source-map": "^2.0.0",
|
|
100
|
+
"cross-env": "^10.1.0",
|
|
101
|
+
"diff-sequences": "^29.6.3",
|
|
102
|
+
"esbuild": "^0.28.0",
|
|
103
|
+
"eslint": "~10.2.0",
|
|
104
|
+
"eslint-config-plus": "^2.0.4",
|
|
105
|
+
"eslint-plugin-html": "^8.1.4",
|
|
106
|
+
"eslint-plugin-vue": "^10.8.0",
|
|
107
|
+
"find-up": "^8.0.0",
|
|
108
|
+
"foreground-child": "^4.0.3",
|
|
109
|
+
"koa": "^3.2.0",
|
|
110
|
+
"koa-static-resolver": "^1.0.6",
|
|
111
|
+
"minimatch": "^9.0.5",
|
|
112
|
+
"mocha": "^11.7.5",
|
|
113
|
+
"monocart-code-viewer": "^1.2.0",
|
|
114
|
+
"monocart-formatter": "^3.0.1",
|
|
115
|
+
"node-stream-zip": "^1.15.0",
|
|
116
|
+
"open": "^11.0.0",
|
|
117
|
+
"playwright": "^1.59.1",
|
|
118
|
+
"postcss": "^8.5.9",
|
|
119
|
+
"puppeteer": "^24.40.0",
|
|
120
|
+
"rollup": "^4.60.1",
|
|
121
|
+
"starfall-cli": "^2.0.24",
|
|
122
|
+
"stylelint": "^17.8.0",
|
|
123
|
+
"stylelint-config-plus": "^1.1.6",
|
|
124
|
+
"supports-color": "^10.2.2",
|
|
125
|
+
"swc-loader": "^0.2.7",
|
|
126
|
+
"ts-loader": "^9.5.7",
|
|
127
|
+
"tsx": "^4.21.0",
|
|
128
|
+
"turbogrid": "^3.2.4",
|
|
129
|
+
"typescript": "^6.0.2",
|
|
130
|
+
"vine-ui": "^3.1.18",
|
|
131
|
+
"webpack": "^5.106.2",
|
|
132
|
+
"ws": "^8.20.0",
|
|
133
|
+
"yazl": "^3.3.1"
|
|
134
|
+
}
|
|
135
|
+
}
|