monocart-coverage-reports 2.12.0 → 2.12.1

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 CHANGED
@@ -724,6 +724,18 @@ if (platform === 'linux') {
724
724
  console.log('hello linux');
725
725
  }
726
726
  ```
727
+ - Compatible with [c8 coverage](https://github.com/bcoe/c8/?tab=readme-ov-file#ignoring-all-lines-until-told) or [nodejs coverage](https://nodejs.org/docs/latest/api/test.html#collecting-code-coverage) syntax
728
+ ```js
729
+ /* c8 ignore start */
730
+ function uncovered() {
731
+ }
732
+ /* c8 ignore stop */
733
+
734
+ /* node:coverage disable */
735
+ function uncovered() {
736
+ }
737
+ /* node:coverage enable */
738
+ ```
727
739
 
728
740
  ## Multiprocessing Support
729
741
  > The data will be added to `[outputDir]/.cache`, After the generation of the report, this data will be removed unless debugging has been enabled or a raw report has been used, see [Debug for Coverage and Sourcemap](#debug-for-coverage-and-sourcemap)
package/README.zh-Hans.md CHANGED
@@ -727,6 +727,18 @@ if (platform === 'linux') {
727
727
  console.log('hello linux');
728
728
  }
729
729
  ```
730
+ - 兼容支持 [c8 coverage](https://github.com/bcoe/c8/?tab=readme-ov-file#ignoring-all-lines-until-told) 或 [nodejs coverage](https://nodejs.org/docs/latest/api/test.html#collecting-code-coverage) 的语法格式
731
+ ```js
732
+ /* c8 ignore start */
733
+ function uncovered() {
734
+ }
735
+ /* c8 ignore stop */
736
+
737
+ /* node:coverage disable */
738
+ function uncovered() {
739
+ }
740
+ /* node:coverage enable */
741
+ ```
730
742
 
731
743
  ## Multiprocessing Support
732
744
  > 多进程支持可以很好的解决异步并行的情况。所有的覆盖率数据会保存到`[outputDir]/.cache`,在报告生成之后,这些缓存数据会被清除。除非开启了[调试模式](#debug-for-coverage-and-sourcemap),或者使用了`raw`报告
@@ -281,6 +281,10 @@ const addAtRule = (item, coverageList, coveredRanges, empty) => {
281
281
 
282
282
  const addCssRules = (list, coverageList, coveredRanges, empty) => {
283
283
 
284
+ if (!Util.isList(list)) {
285
+ return 0;
286
+ }
287
+
284
288
  let count = 0;
285
289
 
286
290
  // line and line is 1-base
package/package.json CHANGED
@@ -1,117 +1,117 @@
1
- {
2
- "name": "monocart-coverage-reports",
3
- "version": "2.12.0",
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-anonymous": "node ./test/test-anonymous.js",
40
- "test-css": "node ./test/test-css.js",
41
- "test-minify": "node ./test/test-minify.js",
42
- "test-esbuild": "node ./test/test-esbuild.js",
43
- "test-rollup": "node ./test/test-rollup.js",
44
- "test-sections": "node ./test/test-sections.js",
45
- "test-swc": "node ./test/test-swc.js",
46
- "test-v8-and-istanbul": "node ./test/test-v8-and-istanbul.js",
47
- "test-browser": "node ./test/test.js --browser",
48
- "test-cli": "npx mcr node ./test/specs/node.test.js -c test/mcr.config.cli.js",
49
- "test-demo": "node ./test/test-demo.js",
50
- "test-merge": "node ./test/test-merge.js",
51
- "test-merge-istanbul": "node ./test/test-merge-istanbul.js",
52
- "test-merge-v8": "node ./test/test-merge-v8.js",
53
- "test-merge-cli": "npx mcr merge -r console-details,v8 --inputDir .temp/code-coverage/raw --outputDir .temp/merge-cli",
54
- "test-client": "node ./test/test-client.js",
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
- "workspaces": [
66
- "test"
67
- ],
68
- "files": [
69
- "lib",
70
- "README.zh-Hans.md"
71
- ],
72
- "license": "MIT",
73
- "repository": {
74
- "type": "git",
75
- "url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
76
- },
77
- "dependencies": {
78
- "acorn": "^8.14.0",
79
- "acorn-loose": "^8.4.0",
80
- "acorn-walk": "^8.3.4",
81
- "commander": "^13.0.0",
82
- "console-grid": "^2.2.3",
83
- "eight-colors": "^1.3.1",
84
- "foreground-child": "^3.3.0",
85
- "istanbul-lib-coverage": "^3.2.2",
86
- "istanbul-lib-report": "^3.0.1",
87
- "istanbul-reports": "^3.1.7",
88
- "lz-utils": "^2.1.0",
89
- "monocart-locator": "^1.0.2"
90
- },
91
- "devDependencies": {
92
- "@jridgewell/sourcemap-codec": "^1.5.0",
93
- "async-tick": "^1.0.0",
94
- "convert-source-map": "^2.0.0",
95
- "diff-sequences": "^29.6.3",
96
- "esbuild": "^0.24.2",
97
- "eslint": "~9.18.0",
98
- "eslint-config-plus": "^2.0.2",
99
- "eslint-plugin-html": "^8.1.2",
100
- "eslint-plugin-vue": "^9.32.0",
101
- "find-up": "^7.0.0",
102
- "minimatch": "^9.0.5",
103
- "mocha": "^11.0.1",
104
- "monocart-code-viewer": "^1.1.4",
105
- "monocart-formatter": "^3.0.0",
106
- "node-stream-zip": "^1.15.0",
107
- "postcss": "^8.5.1",
108
- "starfall-cli": "^2.0.20",
109
- "stylelint": "^16.13.2",
110
- "stylelint-config-plus": "^1.1.3",
111
- "supports-color": "^10.0.0",
112
- "turbogrid": "^3.2.0",
113
- "vine-ui": "^3.1.16",
114
- "ws": "^8.18.0",
115
- "yazl": "^3.3.1"
116
- }
117
- }
1
+ {
2
+ "name": "monocart-coverage-reports",
3
+ "version": "2.12.1",
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-anonymous": "node ./test/test-anonymous.js",
40
+ "test-css": "node ./test/test-css.js",
41
+ "test-minify": "node ./test/test-minify.js",
42
+ "test-esbuild": "node ./test/test-esbuild.js",
43
+ "test-rollup": "node ./test/test-rollup.js",
44
+ "test-sections": "node ./test/test-sections.js",
45
+ "test-swc": "node ./test/test-swc.js",
46
+ "test-v8-and-istanbul": "node ./test/test-v8-and-istanbul.js",
47
+ "test-browser": "node ./test/test.js --browser",
48
+ "test-cli": "npx mcr node ./test/specs/node.test.js -c test/mcr.config.cli.js",
49
+ "test-demo": "node ./test/test-demo.js",
50
+ "test-merge": "node ./test/test-merge.js",
51
+ "test-merge-istanbul": "node ./test/test-merge-istanbul.js",
52
+ "test-merge-v8": "node ./test/test-merge-v8.js",
53
+ "test-merge-cli": "npx mcr merge -r console-details,v8 --inputDir .temp/code-coverage/raw --outputDir .temp/merge-cli",
54
+ "test-client": "node ./test/test-client.js",
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
+ "workspaces": [
66
+ "test"
67
+ ],
68
+ "files": [
69
+ "lib",
70
+ "README.zh-Hans.md"
71
+ ],
72
+ "license": "MIT",
73
+ "repository": {
74
+ "type": "git",
75
+ "url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
76
+ },
77
+ "dependencies": {
78
+ "acorn": "^8.14.0",
79
+ "acorn-loose": "^8.4.0",
80
+ "acorn-walk": "^8.3.4",
81
+ "commander": "^13.1.0",
82
+ "console-grid": "^2.2.3",
83
+ "eight-colors": "^1.3.1",
84
+ "foreground-child": "^3.3.0",
85
+ "istanbul-lib-coverage": "^3.2.2",
86
+ "istanbul-lib-report": "^3.0.1",
87
+ "istanbul-reports": "^3.1.7",
88
+ "lz-utils": "^2.1.0",
89
+ "monocart-locator": "^1.0.2"
90
+ },
91
+ "devDependencies": {
92
+ "@jridgewell/sourcemap-codec": "^1.5.0",
93
+ "async-tick": "^1.0.0",
94
+ "convert-source-map": "^2.0.0",
95
+ "diff-sequences": "^29.6.3",
96
+ "esbuild": "^0.24.2",
97
+ "eslint": "~9.19.0",
98
+ "eslint-config-plus": "^2.0.2",
99
+ "eslint-plugin-html": "^8.1.2",
100
+ "eslint-plugin-vue": "^9.32.0",
101
+ "find-up": "^7.0.0",
102
+ "minimatch": "^9.0.5",
103
+ "mocha": "^11.1.0",
104
+ "monocart-code-viewer": "^1.1.4",
105
+ "monocart-formatter": "^3.0.0",
106
+ "node-stream-zip": "^1.15.0",
107
+ "postcss": "^8.5.1",
108
+ "starfall-cli": "^2.0.20",
109
+ "stylelint": "^16.14.1",
110
+ "stylelint-config-plus": "^1.1.3",
111
+ "supports-color": "^10.0.0",
112
+ "turbogrid": "^3.2.0",
113
+ "vine-ui": "^3.1.16",
114
+ "ws": "^8.18.0",
115
+ "yazl": "^3.3.1"
116
+ }
117
+ }