c8 7.11.3 → 7.12.0

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
@@ -36,6 +36,7 @@ Here is a list of common options. Run `c8 --help` for the full list and document
36
36
  | `--src` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | `[process.cwd()]`|
37
37
  | `-n`, `--include` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | `[]` (include all files) |
38
38
  | `-x`, `--exclude` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | [list](https://github.com/istanbuljs/schema/blob/master/default-exclude.js) |
39
+ | `--exclude-after-remap` | see [section below](#exclude-after-remap) for more info | `boolean` | `false` |
39
40
  | `-e`, `--extension` | only files matching these extensions will show coverage | `string \| Array<string>` | [list](https://github.com/istanbuljs/schema/blob/master/default-extension.js) |
40
41
  | `--skip-full` | do not show files with 100% statement, branch, and function coverage | `boolean` | `false` |
41
42
  | `--check-coverage` | check whether coverage is within thresholds provided | `boolean` | `false` |
@@ -53,6 +54,24 @@ By supplying `--all` to c8, all files in directories specified with `--src` (def
53
54
  and `--exclude` flag checks, will be loaded into the report. If any of those files remain uncovered they will be factored
54
55
  into the report with a default of 0% coverage.
55
56
 
57
+ ## SourceMap Support
58
+
59
+ `c8` can handle source-maps, for remapping coverage from generated code to original source files (_useful for TypeScript, JSX, etc_).
60
+
61
+ ### Source map files versus inline source maps
62
+
63
+ Just-in-time instrumented codebases will often insert source maps inline with the `.js` code they generate at runtime (e.g, `@babel/register` can be configured to insert a source map footer).
64
+
65
+ Pre-instrumented codebases, e.g., running `tsc` to generate `.js` in a build folder, may generate either inline source maps, or a separate `.map` file stored on disk.
66
+
67
+ `c8` can handle loading both types of source maps.
68
+
69
+ ### Exclude after remap
70
+
71
+ Depending on the size and configuration of your project, it may be preferable to apply exclusion logic either before or after source-maps are used to remap compiled to original source files.
72
+
73
+ `--exclude-after-remap` is used to control this behaviour.
74
+
56
75
  ## c8 report
57
76
 
58
77
  run `c8 report` to regenerate reports after `c8` has already been run.
package/lib/report.js CHANGED
@@ -74,7 +74,7 @@ class Report {
74
74
  reports.create(_reporter, {
75
75
  skipEmpty: false,
76
76
  skipFull: this.skipFull,
77
- maxCols: 100
77
+ maxCols: process.stdout.columns || 100
78
78
  }).execute(context)
79
79
  }
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c8",
3
- "version": "7.11.3",
3
+ "version": "7.12.0",
4
4
  "description": "output coverage reports using Node.js' built in coverage",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",