nyc 15.0.0-beta.3 → 15.0.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/CHANGELOG.md +2 -1
- package/bin/nyc.js +12 -7
- package/index.js +3 -2
- package/lib/register-env.js +27 -0
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
## [15.0.0
|
|
5
|
+
## [15.0.0](https://github.com/istanbuljs/nyc/compare/v14.1.1...v15.0.0) (2019-12-20)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
### ⚠ BREAKING CHANGES
|
|
@@ -21,6 +21,7 @@ files.
|
|
|
21
21
|
* Add `.cjs`, `.mjs`, `.ts`, `.tsx`, `.jsx` to default extensions ([#1110](https://github.com/istanbuljs/nyc/issues/1110)) ([914b776](https://github.com/istanbuljs/nyc/commit/914b776215ad3ea54f0e46b4ba2904a8a9d4dfdd)), closes [#1103](https://github.com/istanbuljs/nyc/issues/1103)
|
|
22
22
|
* Allow `nyc instrument` to instrument code in place ([#1149](https://github.com/istanbuljs/nyc/issues/1149)) ([7783284](https://github.com/istanbuljs/nyc/commit/77832845b85134d21eca3a23c812c4f21f36713f))
|
|
23
23
|
* Drop node.js 6, upgrade dependencies ([#1134](https://github.com/istanbuljs/nyc/issues/1134)) ([00c3b34](https://github.com/istanbuljs/nyc/commit/00c3b3440a5b2ffe11b9c19ae4e08ad2f5b70e33))
|
|
24
|
+
* Filenames relative to project cwd in coverage reports ([#1212](https://github.com/istanbuljs/nyc/issues/1212)) ([5258e9f](https://github.com/istanbuljs/nyc/commit/5258e9fdb1d9e3d4abd4cc9768bc09cd8040a6be))
|
|
24
25
|
* Use @istanbuljs/schema for yargs setup ([#1194](https://github.com/istanbuljs/nyc/issues/1194)) ([fd40d49](https://github.com/istanbuljs/nyc/commit/fd40d49331665d936b86f30e9a873ba80071b770))
|
|
25
26
|
* Use istanbul-lib-processinfo ([#1145](https://github.com/istanbuljs/nyc/issues/1145)) ([7943413](https://github.com/istanbuljs/nyc/commit/7943413dc032f8f98a164fdde88d7344e817bb5e))
|
|
26
27
|
* Use source base name to prefix cache files ([#1144](https://github.com/istanbuljs/nyc/issues/1144)) ([5c1b7a9](https://github.com/istanbuljs/nyc/commit/5c1b7a9c43771f3439af44a1104e5426519e1123))
|
package/bin/nyc.js
CHANGED
|
@@ -52,15 +52,20 @@ async function main () {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (!argv.useSpawnWrap) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
const requireModules = [
|
|
56
|
+
require.resolve('../lib/register-env.js'),
|
|
57
|
+
...nyc.require.map(mod => resolveFrom.silent(nyc.cwd, mod) || mod)
|
|
58
|
+
]
|
|
59
|
+
const preloadList = require('node-preload')
|
|
60
|
+
preloadList.push(
|
|
61
|
+
...requireModules,
|
|
62
|
+
require.resolve('../lib/wrap.js')
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
Object.assign(process.env, env)
|
|
66
|
+
requireModules.forEach(mod => {
|
|
60
67
|
require(mod)
|
|
61
68
|
})
|
|
62
|
-
preloadAppend(require.resolve('../lib/wrap.js'))
|
|
63
|
-
Object.assign(propagateEnv, env)
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
if (argv.all) {
|
package/index.js
CHANGED
|
@@ -365,8 +365,8 @@ class NYC {
|
|
|
365
365
|
// This is a bug with the spawn-wrap method where
|
|
366
366
|
// we cannot force propagation of NYC_PROCESS_ID.
|
|
367
367
|
if (!this.config.useSpawnWrap) {
|
|
368
|
-
const
|
|
369
|
-
|
|
368
|
+
const updateVariable = require('./lib/register-env.js')
|
|
369
|
+
updateVariable('NYC_PROCESS_ID')
|
|
370
370
|
}
|
|
371
371
|
this._addRequireHooks()
|
|
372
372
|
this._wrapExit()
|
|
@@ -441,6 +441,7 @@ class NYC {
|
|
|
441
441
|
reports.create(_reporter, {
|
|
442
442
|
skipEmpty: this.config.skipEmpty,
|
|
443
443
|
skipFull: this.config.skipFull,
|
|
444
|
+
projectRoot: this.cwd,
|
|
444
445
|
maxCols: process.stdout.columns || 100
|
|
445
446
|
}).execute(context)
|
|
446
447
|
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const processOnSpawn = require('process-on-spawn')
|
|
4
|
+
|
|
5
|
+
const envToCopy = {}
|
|
6
|
+
|
|
7
|
+
processOnSpawn.addListener(({ env }) => {
|
|
8
|
+
Object.assign(env, envToCopy)
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const copyAtLoad = [
|
|
12
|
+
'NYC_CONFIG',
|
|
13
|
+
'NYC_CWD',
|
|
14
|
+
'NYC_PROCESS_ID',
|
|
15
|
+
'BABEL_DISABLE_CACHE',
|
|
16
|
+
'NYC_PROCESS_ID'
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
for (const env of copyAtLoad) {
|
|
20
|
+
if (env in process.env) {
|
|
21
|
+
envToCopy[env] = process.env[env]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = function updateVariable (envName) {
|
|
26
|
+
envToCopy[envName] = process.env[envName]
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nyc",
|
|
3
|
-
"version": "15.0.0
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "the Istanbul command line interface",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -55,31 +55,32 @@
|
|
|
55
55
|
"author": "Ben Coe <ben@npmjs.com>",
|
|
56
56
|
"license": "ISC",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@istanbuljs/load-nyc-config": "^1.0.0
|
|
58
|
+
"@istanbuljs/load-nyc-config": "^1.0.0",
|
|
59
59
|
"@istanbuljs/schema": "^0.1.2",
|
|
60
60
|
"caching-transform": "^4.0.0",
|
|
61
61
|
"convert-source-map": "^1.7.0",
|
|
62
62
|
"decamelize": "^1.2.0",
|
|
63
|
-
"find-cache-dir": "
|
|
63
|
+
"find-cache-dir": "^3.2.0",
|
|
64
64
|
"find-up": "^4.1.0",
|
|
65
65
|
"foreground-child": "^2.0.0",
|
|
66
66
|
"glob": "^7.1.6",
|
|
67
|
-
"istanbul-lib-coverage": "^3.0.0
|
|
68
|
-
"istanbul-lib-hook": "^3.0.0
|
|
69
|
-
"istanbul-lib-instrument": "^4.0.0
|
|
67
|
+
"istanbul-lib-coverage": "^3.0.0",
|
|
68
|
+
"istanbul-lib-hook": "^3.0.0",
|
|
69
|
+
"istanbul-lib-instrument": "^4.0.0",
|
|
70
70
|
"istanbul-lib-processinfo": "^2.0.2",
|
|
71
|
-
"istanbul-lib-report": "^3.0.0
|
|
72
|
-
"istanbul-lib-source-maps": "^4.0.0
|
|
73
|
-
"istanbul-reports": "^3.0.0
|
|
71
|
+
"istanbul-lib-report": "^3.0.0",
|
|
72
|
+
"istanbul-lib-source-maps": "^4.0.0",
|
|
73
|
+
"istanbul-reports": "^3.0.0",
|
|
74
74
|
"js-yaml": "^3.13.1",
|
|
75
75
|
"make-dir": "^3.0.0",
|
|
76
76
|
"p-map": "^3.0.0",
|
|
77
|
-
"
|
|
77
|
+
"process-on-spawn": "^1.0.0",
|
|
78
|
+
"node-preload": "^0.2.0",
|
|
78
79
|
"resolve-from": "^5.0.0",
|
|
79
80
|
"rimraf": "^3.0.0",
|
|
80
81
|
"signal-exit": "^3.0.2",
|
|
81
|
-
"spawn-wrap": "^2.0.0
|
|
82
|
-
"test-exclude": "^6.0.0
|
|
82
|
+
"spawn-wrap": "^2.0.0",
|
|
83
|
+
"test-exclude": "^6.0.0",
|
|
83
84
|
"uuid": "^3.3.3",
|
|
84
85
|
"yargs": "^15.0.2"
|
|
85
86
|
},
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
"source-map-support": "^0.5.16",
|
|
92
93
|
"standard": "^12.0.1",
|
|
93
94
|
"standard-version": "^7.0.1",
|
|
94
|
-
"tap": "^14.10.
|
|
95
|
+
"tap": "^14.10.5",
|
|
95
96
|
"which": "^2.0.2"
|
|
96
97
|
},
|
|
97
98
|
"engines": {
|