monocart-coverage-reports 2.5.2 → 2.5.3
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
|
@@ -23,17 +23,20 @@ const filterPath = (str) => {
|
|
|
23
23
|
|
|
24
24
|
const getSourcePath = (url, index = '', type = '') => {
|
|
25
25
|
|
|
26
|
+
// no url for anonymous
|
|
26
27
|
if (!url) {
|
|
27
28
|
// anonymous scripts will have __playwright_evaluation_script__ as their URL.
|
|
28
|
-
url =
|
|
29
|
+
url = ['anonymous', index ? `-${index}` : '', type ? `.${type}` : ''].join('');
|
|
30
|
+
return filterPath(url);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
//
|
|
33
|
+
// already is file url
|
|
32
34
|
if (url.startsWith('file:')) {
|
|
33
35
|
const relPath = Util.relativePath(fileURLToPath(url));
|
|
34
36
|
return filterPath(relPath);
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
// http/https url, other url
|
|
37
40
|
const urlObj = Util.resolveUrl(url);
|
|
38
41
|
if (urlObj) {
|
|
39
42
|
const host = [urlObj.hostname, urlObj.port].filter((it) => it).join('-');
|
|
@@ -49,8 +52,10 @@ const getSourcePath = (url, index = '', type = '') => {
|
|
|
49
52
|
return filterPath(p);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
// could be path
|
|
56
|
+
const fileUrl = pathToFileURL(url).toString();
|
|
57
|
+
const relPath = Util.relativePath(fileURLToPath(fileUrl));
|
|
58
|
+
return filterPath(relPath);
|
|
54
59
|
|
|
55
60
|
};
|
|
56
61
|
|
package/lib/utils/util.js
CHANGED
|
@@ -9,7 +9,13 @@ const CG = require('console-grid');
|
|
|
9
9
|
const Share = require('../platform/share.js');
|
|
10
10
|
const { deflateSync } = require('lz-utils');
|
|
11
11
|
|
|
12
|
-
const { acornWalk } = require('../packages/monocart-coverage-vendor.js');
|
|
12
|
+
const { acornWalk, supportsColor } = require('../packages/monocart-coverage-vendor.js');
|
|
13
|
+
|
|
14
|
+
// https://github.com/chalk/supports-color
|
|
15
|
+
// disabled color if Terminal stdout does not support color
|
|
16
|
+
if (!supportsColor.stdout) {
|
|
17
|
+
EC.disabled = true;
|
|
18
|
+
}
|
|
13
19
|
|
|
14
20
|
const Util = {
|
|
15
21
|
... Share,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monocart-coverage-reports",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Monocart coverage reports",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"console-grid": "~2.2.1",
|
|
58
|
-
"eight-colors": "~1.
|
|
58
|
+
"eight-colors": "~1.3.0",
|
|
59
59
|
"istanbul-lib-coverage": "~3.2.2",
|
|
60
60
|
"istanbul-lib-report": "~3.0.1",
|
|
61
|
-
"istanbul-reports": "~3.1.
|
|
61
|
+
"istanbul-reports": "~3.1.7",
|
|
62
62
|
"lz-utils": "~2.0.2",
|
|
63
63
|
"monocart-code-viewer": "~1.1.0",
|
|
64
64
|
"monocart-formatter": "~2.3.1",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"eslint-plugin-html": "^8.0.0",
|
|
72
72
|
"eslint-plugin-vue": "^9.21.1",
|
|
73
73
|
"stylelint": "^15.11.0",
|
|
74
|
-
"stylelint-config-plus": "^1.0.4"
|
|
74
|
+
"stylelint-config-plus": "^1.0.4",
|
|
75
|
+
"supports-color": "^9.4.0"
|
|
75
76
|
}
|
|
76
77
|
}
|