monocart-coverage-reports 2.12.5 → 2.12.7
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
|
@@ -45,6 +45,7 @@ const filterPath = (str) => {
|
|
|
45
45
|
}
|
|
46
46
|
return true;
|
|
47
47
|
});
|
|
48
|
+
|
|
48
49
|
return ls.join('/');
|
|
49
50
|
};
|
|
50
51
|
|
|
@@ -58,6 +59,28 @@ const betterFileURLToPath = (url) => {
|
|
|
58
59
|
return url;
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
const normalizePathDir = (sourcePath) => {
|
|
63
|
+
|
|
64
|
+
// decodeURI("%20") to space
|
|
65
|
+
let str = decodeURI(`${sourcePath}`);
|
|
66
|
+
str = str.replace(/\\/g, '/');
|
|
67
|
+
|
|
68
|
+
// remove / of start, end or double, ./ ../
|
|
69
|
+
return str.split('/').map((it) => {
|
|
70
|
+
it = it.trim();
|
|
71
|
+
// remove illegal characters except /
|
|
72
|
+
it = it.replace(/[\\:*?"<>|]/g, '');
|
|
73
|
+
// keep space
|
|
74
|
+
// it = it.replace(/\s+/g, '-');
|
|
75
|
+
return it;
|
|
76
|
+
}).filter((item) => {
|
|
77
|
+
if (!item || item === '.' || item === '..') {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}).join('/');
|
|
82
|
+
};
|
|
83
|
+
|
|
61
84
|
const normalizeSourcePath = (sourceUrl, baseDir) => {
|
|
62
85
|
|
|
63
86
|
// includes anonymous and everything
|
|
@@ -95,16 +118,21 @@ const normalizeSourcePath = (sourceUrl, baseDir) => {
|
|
|
95
118
|
// url http/https/webpack
|
|
96
119
|
const urlObj = Util.resolveUrl(sourceUrl);
|
|
97
120
|
if (urlObj) {
|
|
98
|
-
|
|
121
|
+
let host = urlObj.host;
|
|
122
|
+
// remove : before port, : can not be a part of dir
|
|
123
|
+
host = host.replace(':', '-');
|
|
124
|
+
|
|
99
125
|
// always start with '/'
|
|
100
126
|
const pathname = urlObj.pathname;
|
|
101
127
|
|
|
102
128
|
let p = host + pathname;
|
|
103
129
|
// webpack://monocart-v8/packages/v8/src/app.vue?5cc4
|
|
104
130
|
if (urlObj.search) {
|
|
105
|
-
p += urlObj.search
|
|
131
|
+
p += `-${urlObj.search}`;
|
|
106
132
|
}
|
|
107
133
|
|
|
134
|
+
p = normalizePathDir(p);
|
|
135
|
+
|
|
108
136
|
return filterPath(p);
|
|
109
137
|
}
|
|
110
138
|
|
|
@@ -151,28 +179,6 @@ const getSourcePathReplacer = (options) => {
|
|
|
151
179
|
|
|
152
180
|
// ========================================================================================================
|
|
153
181
|
|
|
154
|
-
const normalizeIstanbulFilePath = (sourcePath) => {
|
|
155
|
-
|
|
156
|
-
// decodeURI("%20") to space
|
|
157
|
-
let str = decodeURI(`${sourcePath}`);
|
|
158
|
-
str = str.replace(/\\/g, '/');
|
|
159
|
-
|
|
160
|
-
// remove / of start, end or double, ./ ../
|
|
161
|
-
return str.split('/').map((it) => {
|
|
162
|
-
it = it.trim();
|
|
163
|
-
// remove illegal characters except /
|
|
164
|
-
it = it.replace(/[\\:*?"<>|]/g, '');
|
|
165
|
-
// space
|
|
166
|
-
it = it.replace(/\s+/g, '-');
|
|
167
|
-
return it;
|
|
168
|
-
}).filter((item) => {
|
|
169
|
-
if (!item || item === '.' || item === '..') {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
return true;
|
|
173
|
-
}).join('/');
|
|
174
|
-
};
|
|
175
|
-
|
|
176
182
|
const initIstanbulSourcePath = (coverageData, fileSources, options) => {
|
|
177
183
|
|
|
178
184
|
const sourcePathReplacer = getSourcePathReplacer(options);
|
|
@@ -200,8 +206,6 @@ const initIstanbulSourcePath = (coverageData, fileSources, options) => {
|
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
208
|
|
|
203
|
-
sourcePath = normalizeIstanbulFilePath(sourcePath);
|
|
204
|
-
|
|
205
209
|
// console.log(item);
|
|
206
210
|
|
|
207
211
|
// update source path
|
package/lib/utils/util.js
CHANGED
|
@@ -489,10 +489,15 @@ const Util = {
|
|
|
489
489
|
|
|
490
490
|
readFileSync: function(filePath) {
|
|
491
491
|
if (fs.existsSync(filePath)) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
492
|
+
let buf;
|
|
493
|
+
try {
|
|
494
|
+
// Returns: <string> | <Buffer>
|
|
495
|
+
buf = fs.readFileSync(filePath);
|
|
496
|
+
if (Buffer.isBuffer(buf)) {
|
|
497
|
+
return buf.toString('utf8');
|
|
498
|
+
}
|
|
499
|
+
} catch (e) {
|
|
500
|
+
// ignore
|
|
496
501
|
}
|
|
497
502
|
return buf;
|
|
498
503
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monocart-coverage-reports",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.7",
|
|
4
4
|
"description": "A code coverage tool to generate native V8 reports or Istanbul reports.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -71,63 +71,63 @@
|
|
|
71
71
|
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"acorn": "^8.
|
|
75
|
-
"acorn-loose": "^8.5.
|
|
74
|
+
"acorn": "^8.15.0",
|
|
75
|
+
"acorn-loose": "^8.5.2",
|
|
76
76
|
"acorn-walk": "^8.3.4",
|
|
77
|
-
"commander": "^
|
|
77
|
+
"commander": "^14.0.0",
|
|
78
78
|
"console-grid": "^2.2.3",
|
|
79
79
|
"eight-colors": "^1.3.1",
|
|
80
80
|
"foreground-child": "^3.3.1",
|
|
81
81
|
"istanbul-lib-coverage": "^3.2.2",
|
|
82
82
|
"istanbul-lib-report": "^3.0.1",
|
|
83
|
-
"istanbul-reports": "^3.
|
|
83
|
+
"istanbul-reports": "^3.2.0",
|
|
84
84
|
"lz-utils": "^2.1.0",
|
|
85
85
|
"monocart-locator": "^1.0.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@actions/core": "^1.11.1",
|
|
89
89
|
"@actions/github": "^6.0.1",
|
|
90
|
-
"@jridgewell/sourcemap-codec": "^1.5.
|
|
90
|
+
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
91
91
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
92
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
93
|
-
"@rollup/plugin-typescript": "^12.1.
|
|
92
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
93
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
94
94
|
"async-tick": "^1.0.0",
|
|
95
95
|
"babel-loader": "^10.0.0",
|
|
96
|
-
"babel-plugin-istanbul": "^7.0.
|
|
96
|
+
"babel-plugin-istanbul": "^7.0.1",
|
|
97
97
|
"convert-source-map": "^2.0.0",
|
|
98
|
-
"cross-env": "^
|
|
98
|
+
"cross-env": "^10.0.0",
|
|
99
99
|
"diff-sequences": "^29.6.3",
|
|
100
|
-
"esbuild": "^0.25.
|
|
101
|
-
"eslint": "~9.
|
|
102
|
-
"eslint-config-plus": "^2.0.
|
|
103
|
-
"eslint-plugin-html": "^8.1.
|
|
104
|
-
"eslint-plugin-vue": "^10.
|
|
100
|
+
"esbuild": "^0.25.9",
|
|
101
|
+
"eslint": "~9.35.0",
|
|
102
|
+
"eslint-config-plus": "^2.0.3",
|
|
103
|
+
"eslint-plugin-html": "^8.1.3",
|
|
104
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
105
105
|
"find-up": "^7.0.0",
|
|
106
106
|
"foreground-child": "^3.3.1",
|
|
107
|
-
"koa": "^3.0.
|
|
107
|
+
"koa": "^3.0.1",
|
|
108
108
|
"koa-static-resolver": "^1.0.6",
|
|
109
109
|
"minimatch": "^9.0.5",
|
|
110
|
-
"mocha": "^11.
|
|
110
|
+
"mocha": "^11.7.2",
|
|
111
111
|
"monocart-code-viewer": "^1.1.5",
|
|
112
112
|
"monocart-formatter": "^3.0.1",
|
|
113
113
|
"node-stream-zip": "^1.15.0",
|
|
114
|
-
"open": "^10.
|
|
115
|
-
"playwright": "^1.
|
|
116
|
-
"postcss": "^8.5.
|
|
117
|
-
"puppeteer": "^24.
|
|
118
|
-
"rollup": "^4.
|
|
119
|
-
"starfall-cli": "^2.0.
|
|
120
|
-
"stylelint": "^16.
|
|
121
|
-
"stylelint-config-plus": "^1.1.
|
|
122
|
-
"supports-color": "^10.
|
|
114
|
+
"open": "^10.2.0",
|
|
115
|
+
"playwright": "^1.55.0",
|
|
116
|
+
"postcss": "^8.5.6",
|
|
117
|
+
"puppeteer": "^24.19.0",
|
|
118
|
+
"rollup": "^4.50.1",
|
|
119
|
+
"starfall-cli": "^2.0.22",
|
|
120
|
+
"stylelint": "^16.24.0",
|
|
121
|
+
"stylelint-config-plus": "^1.1.4",
|
|
122
|
+
"supports-color": "^10.2.2",
|
|
123
123
|
"swc-loader": "^0.2.6",
|
|
124
|
-
"ts-loader": "^9.5.
|
|
125
|
-
"tsx": "^4.
|
|
126
|
-
"turbogrid": "^3.2.
|
|
127
|
-
"typescript": "^5.
|
|
128
|
-
"vine-ui": "^3.1.
|
|
129
|
-
"webpack": "^5.
|
|
130
|
-
"ws": "^8.18.
|
|
124
|
+
"ts-loader": "^9.5.4",
|
|
125
|
+
"tsx": "^4.20.5",
|
|
126
|
+
"turbogrid": "^3.2.1",
|
|
127
|
+
"typescript": "^5.9.2",
|
|
128
|
+
"vine-ui": "^3.1.18",
|
|
129
|
+
"webpack": "^5.101.3",
|
|
130
|
+
"ws": "^8.18.3",
|
|
131
131
|
"yazl": "^3.3.1"
|
|
132
132
|
}
|
|
133
133
|
}
|