monocart-coverage-reports 2.5.3 → 2.5.5
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 +10 -30
- package/lib/converter/ast.js +17 -13
- package/lib/converter/collect-source-maps.js +56 -15
- package/lib/converter/converter.js +8 -1
- package/lib/generate.js +1 -1
- package/lib/packages/monocart-coverage-v8.js +1 -1
- package/lib/platform/share.js +1 -1
- package/lib/utils/util.js +9 -1
- package/lib/v8/v8.js +6 -4
- package/package.json +8 -7
package/lib/platform/share.js
CHANGED
|
@@ -421,7 +421,7 @@ const Util = {
|
|
|
421
421
|
const max = Math.pow(base, i + 1);
|
|
422
422
|
if (v > min && v < max) {
|
|
423
423
|
const unit = units[i];
|
|
424
|
-
v = prefix + (v / min).toFixed(places) + space + unit;
|
|
424
|
+
v = prefix + parseFloat((v / min).toFixed(places)) + space + unit;
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
427
427
|
}
|
package/lib/utils/util.js
CHANGED
|
@@ -501,10 +501,18 @@ const Util = {
|
|
|
501
501
|
|
|
502
502
|
// time is debug level
|
|
503
503
|
logTime: (message, time_start) => {
|
|
504
|
-
if (Util.loggingLevel < Util.loggingLevels.
|
|
504
|
+
if (Util.loggingLevel < Util.loggingLevels.info) {
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
|
+
|
|
508
|
+
const slowDuration = 1000;
|
|
507
509
|
const duration = Date.now() - time_start;
|
|
510
|
+
if (Util.loggingLevel < Util.loggingLevels.debug) {
|
|
511
|
+
if (duration < slowDuration) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
508
516
|
const durationH = Util.TSF(duration);
|
|
509
517
|
const ls = [`[MCR] ${message}`, ' ('];
|
|
510
518
|
if (duration <= 100) {
|
package/lib/v8/v8.js
CHANGED
|
@@ -63,7 +63,8 @@ const initV8ListAndSourcemap = async (v8list, options) => {
|
|
|
63
63
|
// init id, sourcePath
|
|
64
64
|
v8list = v8list.map((item, i) => {
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
// it could be a empty file
|
|
67
|
+
let source = `${item.source || item.text || ''}`;
|
|
67
68
|
|
|
68
69
|
// fix source with script offset
|
|
69
70
|
let scriptOffset;
|
|
@@ -114,10 +115,11 @@ const initV8ListAndSourcemap = async (v8list, options) => {
|
|
|
114
115
|
|
|
115
116
|
// collect sourcemap first
|
|
116
117
|
const time_start = Date.now();
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
118
|
+
const smList = await collectSourceMaps(v8list, options);
|
|
119
|
+
if (smList.length) {
|
|
119
120
|
// debug level time
|
|
120
|
-
Util.logTime(`loaded sourcemaps: ${
|
|
121
|
+
Util.logTime(`loaded sourcemaps: ${smList.length}`, time_start);
|
|
122
|
+
// console.log(smList);
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
return v8list;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monocart-coverage-reports",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5",
|
|
4
4
|
"description": "Monocart coverage reports",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,17 +20,18 @@
|
|
|
20
20
|
"build-docs": "node ./scripts/build-docs.js",
|
|
21
21
|
"build-test": "node ./scripts/build-test.js",
|
|
22
22
|
"build": "sf lint && sf b -p && npm run build-test",
|
|
23
|
-
"test-node": "npm run test-node-env && npm run test-node-api && npm run test-node-ins && npm run test-node-cdp && npm run test-node-koa && npm run test-vm",
|
|
23
|
+
"test-node": "npm run test-node-env && npm run test-node-api && npm run test-node-ins && npm run test-node-cdp && npm run test-node-koa && npm run test-node-vm",
|
|
24
24
|
"test-node-env": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-env node ./test/test-node-env.js && node ./test/generate-report.js",
|
|
25
25
|
"test-node-api": "cross-env NODE_V8_COVERAGE=.temp/v8-coverage-api node ./test/test-node-api.js",
|
|
26
26
|
"test-node-fgc": "node ./test/test-node-fgc.js",
|
|
27
27
|
"test-node-ins": "node ./test/test-node-ins.js",
|
|
28
28
|
"test-node-cdp": "node --inspect=9229 ./test/test-node-cdp.js",
|
|
29
29
|
"test-node-koa": "node ./test/test-node-koa.js",
|
|
30
|
-
"test-vm": "node ./test/test-vm.js",
|
|
30
|
+
"test-node-vm": "node ./test/test-node-vm.js",
|
|
31
31
|
"test-istanbul": "node ./test/test-istanbul.js",
|
|
32
32
|
"test-v8": "node ./test/test-v8.js",
|
|
33
|
-
"test-
|
|
33
|
+
"test-puppeteer": "node ./test/test-puppeteer.js",
|
|
34
|
+
"test-browser": "node ./test/test.js && npm run test-istanbul && npm run test-v8 && npm run test-puppeteer && npm run test-anonymous && npm run test-css",
|
|
34
35
|
"test-anonymous": "node ./test/test-anonymous.js",
|
|
35
36
|
"test-css": "node ./test/test-css.js",
|
|
36
37
|
"test-cli": "npx mcr \"node ./test/test-node-env.js\" -o docs/cli -c test/cli-options.js",
|
|
@@ -60,8 +61,8 @@
|
|
|
60
61
|
"istanbul-lib-report": "~3.0.1",
|
|
61
62
|
"istanbul-reports": "~3.1.7",
|
|
62
63
|
"lz-utils": "~2.0.2",
|
|
63
|
-
"monocart-code-viewer": "~1.1.
|
|
64
|
-
"monocart-formatter": "~2.3.
|
|
64
|
+
"monocart-code-viewer": "~1.1.1",
|
|
65
|
+
"monocart-formatter": "~2.3.2",
|
|
65
66
|
"turbogrid": "~3.0.13"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"eslint": "^8.56.0",
|
|
70
71
|
"eslint-config-plus": "^1.0.6",
|
|
71
72
|
"eslint-plugin-html": "^8.0.0",
|
|
72
|
-
"eslint-plugin-vue": "^9.
|
|
73
|
+
"eslint-plugin-vue": "^9.22.0",
|
|
73
74
|
"stylelint": "^15.11.0",
|
|
74
75
|
"stylelint-config-plus": "^1.0.4",
|
|
75
76
|
"supports-color": "^9.4.0"
|