mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-23 14:24:46 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
280
node_modules/babel-plugin-istanbul/CHANGELOG.md
generated
vendored
Normal file
280
node_modules/babel-plugin-istanbul/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,280 @@
|
|||
# Change Log
|
||||
|
||||
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.
|
||||
|
||||
## [5.1.4](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.3...v5.1.4) (2019-04-25)
|
||||
|
||||
|
||||
|
||||
## [5.1.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.2...v5.1.3) (2019-04-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Revert [#192](https://github.com/istanbuljs/babel-plugin-istanbul/issues/192) ([201a933](https://github.com/istanbuljs/babel-plugin-istanbul/commit/201a933)) due to regression detailed at [#201](https://github.com/istanbuljs/babel-plugin-istanbul/issues/201)
|
||||
|
||||
|
||||
|
||||
## [5.1.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.1...v5.1.2) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ensure correct scope references after traversal ([#192](https://github.com/istanbuljs/babel-plugin-istanbul/issues/192)) ([201a933](https://github.com/istanbuljs/babel-plugin-istanbul/commit/201a933))
|
||||
|
||||
|
||||
|
||||
<a name="5.1.1"></a>
|
||||
## [5.1.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.0...v5.1.1) (2019-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* respect changes of cwd in options ([#171](https://github.com/istanbuljs/babel-plugin-istanbul/issues/171)) ([adec723](https://github.com/istanbuljs/babel-plugin-istanbul/commit/adec723))
|
||||
|
||||
|
||||
|
||||
<a name="5.1.0"></a>
|
||||
# [5.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.0.1...v5.1.0) (2018-09-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Bump dependencies. ([b509649](https://github.com/istanbuljs/babel-plugin-istanbul/commit/b509649))
|
||||
|
||||
|
||||
|
||||
<a name="5.0.1"></a>
|
||||
## [5.0.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.0.0...v5.0.1) (2018-07-24)
|
||||
|
||||
|
||||
|
||||
<a name="5.0.0"></a>
|
||||
# [5.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.6...v5.0.0) (2018-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to babel 7 and newest istanbul libraries ([#158](https://github.com/istanbuljs/babel-plugin-istanbul/issues/158)) ([a9e1564](https://github.com/istanbuljs/babel-plugin-istanbul/commit/a9e1564))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Drop node 4 support, upgrade to babel 7, stop shipping @babel/plugin-syntax-object-rest-spread
|
||||
|
||||
|
||||
|
||||
<a name="4.1.6"></a>
|
||||
## <small>4.1.6 (2018-03-09)</small>
|
||||
|
||||
* chore: explicit update of istanbul dependencies (#149) ([77b6eb7](https://github.com/istanbuljs/babel-plugin-istanbul/commit/77b6eb7)), closes [#149](https://github.com/istanbuljs/babel-plugin-istanbul/issues/149)
|
||||
* chore(package): update coveralls to version 3.0.0 (#133) ([7045a03](https://github.com/istanbuljs/babel-plugin-istanbul/commit/7045a03)), closes [#133](https://github.com/istanbuljs/babel-plugin-istanbul/issues/133)
|
||||
* chore(package): update mocha to version 4.0.0 (#134) ([38176ba](https://github.com/istanbuljs/babel-plugin-istanbul/commit/38176ba)), closes [#134](https://github.com/istanbuljs/babel-plugin-istanbul/issues/134)
|
||||
* fix: babel-preset-es2015 => babel-preset-env (#138) ([18fe954](https://github.com/istanbuljs/babel-plugin-istanbul/commit/18fe954)), closes [#138](https://github.com/istanbuljs/babel-plugin-istanbul/issues/138)
|
||||
* fix: include object-spread-syntax plugin (#141) ([428a952](https://github.com/istanbuljs/babel-plugin-istanbul/commit/428a952)), closes [#141](https://github.com/istanbuljs/babel-plugin-istanbul/issues/141)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.5"></a>
|
||||
## [4.1.5](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.2...v4.1.5) (2017-08-23)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.4"></a>
|
||||
## [4.1.4](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.3...v4.1.4) (2017-05-27)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.3"></a>
|
||||
## [4.1.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.1...v4.1.3) (2017-04-29)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.2"></a>
|
||||
## [4.1.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.1...v4.1.2) (2017-03-27)
|
||||
|
||||
|
||||
|
||||
<a name="4.1.1"></a>
|
||||
## [4.1.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.1.0...v4.1.1) (2017-03-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* explicit upgrade to patched version of istanbul-lib-instrument ([db8ecbe](https://github.com/istanbuljs/babel-plugin-istanbul/commit/db8ecbe))
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
# [4.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v4.0.0...v4.1.0) (2017-03-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add includeUntested option to expose coverage of all instrumented files ([#80](https://github.com/istanbuljs/babel-plugin-istanbul/issues/80)) ([b078bbd](https://github.com/istanbuljs/babel-plugin-istanbul/commit/b078bbd))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.1.2...v4.0.0) (2017-02-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* load configuration from process.env.NYC_CONFIG if present ([#93](https://github.com/istanbuljs/babel-plugin-istanbul/issues/93)) ([e902924](https://github.com/istanbuljs/babel-plugin-istanbul/commit/e902924))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* drop Node 0.10 and 0.12 support, upgrade dependencies to reflect this ([#88](https://github.com/istanbuljs/babel-plugin-istanbul/issues/88)) ([594c03a](https://github.com/istanbuljs/babel-plugin-istanbul/commit/594c03a))
|
||||
* we can now use the language feature Object.assign ([#92](https://github.com/istanbuljs/babel-plugin-istanbul/issues/92)) ([f77db2a](https://github.com/istanbuljs/babel-plugin-istanbul/commit/f77db2a))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* I've updated dependencies and dropped Node 0.10 and Node 0.12 support.
|
||||
|
||||
|
||||
|
||||
<a name="3.1.2"></a>
|
||||
## [3.1.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.1.1...v3.1.2) (2017-01-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address regression related to export const foo = () => {} ([#79](https://github.com/istanbuljs/babel-plugin-istanbul/issues/79)) ([f870a8f](https://github.com/istanbuljs/babel-plugin-istanbul/commit/f870a8f))
|
||||
|
||||
|
||||
|
||||
<a name="3.1.1"></a>
|
||||
## [3.1.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.1.0...v3.1.1) (2017-01-02)
|
||||
|
||||
|
||||
|
||||
<a name="3.1.0"></a>
|
||||
# [3.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v3.0.0...v3.1.0) (2016-12-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade a bunch of core dependencies ([#77](https://github.com/istanbuljs/babel-plugin-istanbul/issues/77)) ([e764330](https://github.com/istanbuljs/babel-plugin-istanbul/commit/e764330))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* accept source map input for the visitor ([#75](https://github.com/istanbuljs/babel-plugin-istanbul/issues/75)) ([437e90b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/437e90b))
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.3...v3.0.0) (2016-11-14)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** update test-exclude to version 3.0.0 ([#68](https://github.com/istanbuljs/babel-plugin-istanbul/issues/68)) ([0396385](https://github.com/istanbuljs/babel-plugin-istanbul/commit/0396385))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* package: test-exclude now adds `**/node_modules/**` as exclude rule by default.
|
||||
|
||||
|
||||
|
||||
<a name="2.0.3"></a>
|
||||
## [2.0.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.2...v2.0.3) (2016-10-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force istanbul-lib-instrument with variable hoisting fix ([#64](https://github.com/istanbuljs/babel-plugin-istanbul/issues/64)) ([209a0cf](https://github.com/istanbuljs/babel-plugin-istanbul/commit/209a0cf))
|
||||
* switch deprecated lodash.assign for object-assign ([#58](https://github.com/istanbuljs/babel-plugin-istanbul/issues/58)) ([6e051fc](https://github.com/istanbuljs/babel-plugin-istanbul/commit/6e051fc))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.2"></a>
|
||||
## [2.0.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.1...v2.0.2) (2016-09-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* take realpath of cwd, whether or not set in env ([#37](https://github.com/istanbuljs/babel-plugin-istanbul/issues/37)) ([6274d83](https://github.com/istanbuljs/babel-plugin-istanbul/commit/6274d83))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v2.0.0...v2.0.1) (2016-09-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update istanbul-lib-instrument ([573e0d4](https://github.com/istanbuljs/babel-plugin-istanbul/commit/573e0d4))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.1.0...v2.0.0) (2016-08-14)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* upgrade to version of test-exclude with new exclude rules ([#35](https://github.com/istanbuljs/babel-plugin-istanbul/issues/35)) ([220ce2b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/220ce2b))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* see https://github.com/istanbuljs/test-exclude/blob/master/CHANGELOG.md#breaking-changes
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.3...v1.1.0) (2016-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade to istanbul-lib-instrument with faster babel-generator ([#18](https://github.com/istanbuljs/babel-plugin-istanbul/issues/18)) ([d33263c](https://github.com/istanbuljs/babel-plugin-istanbul/commit/d33263c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow exclude/include options to be passed as Babel plugin config ([#16](https://github.com/istanbuljs/babel-plugin-istanbul/issues/16)) ([cf68421](https://github.com/istanbuljs/babel-plugin-istanbul/commit/cf68421))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
## [1.0.3](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.2...v1.0.3) (2016-07-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* keep using NYC_CWD if available ([#10](https://github.com/istanbuljs/babel-plugin-istanbul/issues/10)) ([db0352b](https://github.com/istanbuljs/babel-plugin-istanbul/commit/db0352b))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## [1.0.2](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.1...v1.0.2) (2016-07-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* take realpath of process.cwd(), fixes [#7](https://github.com/istanbuljs/babel-plugin-istanbul/issues/7) ([#8](https://github.com/istanbuljs/babel-plugin-istanbul/issues/8)) ([e8d3785](https://github.com/istanbuljs/babel-plugin-istanbul/commit/e8d3785)), closes [#7](https://github.com/istanbuljs/babel-plugin-istanbul/issues/7) [#8](https://github.com/istanbuljs/babel-plugin-istanbul/issues/8)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v1.0.0...v1.0.1) (2016-06-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade to version of istanbul-lib-instrument that fixes some out of bounds issues ([#6](https://github.com/istanbuljs/babel-plugin-istanbul/issues/6)) ([a949065](https://github.com/istanbuljs/babel-plugin-istanbul/commit/a949065)), closes [#6](https://github.com/istanbuljs/babel-plugin-istanbul/issues/6)
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2016-06-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* port functionality from __coverage__, get ready for first release ([#2](https://github.com/istanbuljs/babel-plugin-istanbul/issues/2)) ([2a8ee44](https://github.com/istanbuljs/babel-plugin-istanbul/commit/2a8ee44))
|
27
node_modules/babel-plugin-istanbul/LICENSE
generated
vendored
Normal file
27
node_modules/babel-plugin-istanbul/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2016, Istanbul Code Coverage
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of babel-plugin-istanbul nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
131
node_modules/babel-plugin-istanbul/README.md
generated
vendored
Normal file
131
node_modules/babel-plugin-istanbul/README.md
generated
vendored
Normal file
|
@ -0,0 +1,131 @@
|
|||
# babel-plugin-istanbul
|
||||
|
||||
[](https://greenkeeper.io/)
|
||||
[](https://travis-ci.org/istanbuljs/babel-plugin-istanbul)
|
||||
[](https://coveralls.io/github/istanbuljs/babel-plugin-istanbul?branch=master)
|
||||
[](https://conventionalcommits.org)
|
||||
[](http://devtoolscommunity.herokuapp.com)
|
||||
|
||||
_Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com)_.
|
||||
|
||||
A Babel plugin that instruments your code with Istanbul coverage.
|
||||
It can instantly be used with [karma-coverage](https://github.com/karma-runner/karma-coverage) and mocha on Node.js (through [nyc](https://github.com/bcoe/nyc)).
|
||||
|
||||
__Note:__ This plugin does not generate any report or save any data to any file;
|
||||
it only adds instrumenting code to your JavaScript source code.
|
||||
To integrate with testing tools, please see the [Integrations](#integrations) section.
|
||||
|
||||
## Usage
|
||||
|
||||
Install it:
|
||||
|
||||
```
|
||||
npm install --save-dev babel-plugin-istanbul
|
||||
```
|
||||
|
||||
Add it to `.babelrc` in test mode:
|
||||
|
||||
```js
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [ "istanbul" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Optionally, use [cross-env](https://www.npmjs.com/package/cross-env) to set
|
||||
`NODE_ENV=test`:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.js"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Integrations
|
||||
|
||||
### karma
|
||||
|
||||
It _just works_ with Karma. First, make sure that the code is already transpiled by Babel (either using `karma-babel-preprocessor`, `karma-webpack`, or `karma-browserify`). Then, simply set up [karma-coverage](https://github.com/karma-runner/karma-coverage) according to the docs, but __don’t add the `coverage` preprocessor.__ This plugin has already instrumented your code, and Karma should pick it up automatically.
|
||||
|
||||
It has been tested with [bemusic/bemuse](https://codecov.io/github/bemusic/bemuse) project, which contains ~2400 statements.
|
||||
|
||||
### mocha on node.js (through nyc)
|
||||
|
||||
Configure Mocha to transpile JavaScript code using Babel, then you can run your tests with [`nyc`](https://github.com/bcoe/nyc), which will collect all the coverage report.
|
||||
|
||||
babel-plugin-istanbul respects the `include`/`exclude` configuration options from nyc,
|
||||
but you also need to __configure NYC not to instrument your code__ by adding these settings in your `package.json`:
|
||||
|
||||
```js
|
||||
"nyc": {
|
||||
"sourceMap": false,
|
||||
"instrument": false
|
||||
},
|
||||
```
|
||||
|
||||
## Ignoring files
|
||||
|
||||
You don't want to cover your test files as this will skew your coverage results. You can configure this by providing plugin options matching nyc's [`exclude`/`include` rules](https://github.com/bcoe/nyc#excluding-files):
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
["istanbul", {
|
||||
"exclude": [
|
||||
"**/*.spec.js"
|
||||
]
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you don't provide options in your Babel config, the plugin will look for `exclude`/`include` config under an `"nyc"` key in `package.json`.
|
||||
|
||||
You can also use [istanbul's ignore hints](https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes) to specify specific lines of code to skip instrumenting.
|
||||
|
||||
## Source Maps
|
||||
|
||||
By default, this plugin will pick up inline source maps and attach them to the instrumented code such that code coverage can be remapped back to the original source, even for multi-step build processes. This can be memory intensive. Set `useInlineSourceMaps` to prevent this behavior.
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
["istanbul", {
|
||||
"useInlineSourceMaps": false
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you're instrumenting code programatically, you can pass a source map explicitly.
|
||||
```js
|
||||
import babelPluginIstanbul from 'babel-plugin-istanbul';
|
||||
|
||||
function instrument(sourceCode, sourceMap, fileName) {
|
||||
return babel.transform(sourceCode, {
|
||||
filename,
|
||||
plugins: [
|
||||
[babelPluginIstanbul, {
|
||||
inputSourceMap: sourceMap
|
||||
}]
|
||||
]
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
## Credit where credit is due
|
||||
|
||||
The approach used in `babel-plugin-istanbul` was inspired by [Thai Pangsakulyanont](https://github.com/dtinth)'s original library [`babel-plugin-__coverage__`](https://github.com/dtinth/babel-plugin-__coverage__).
|
109
node_modules/babel-plugin-istanbul/lib/index.js
generated
vendored
Normal file
109
node_modules/babel-plugin-istanbul/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
|
||||
var _fs = require("fs");
|
||||
|
||||
var _path = require("path");
|
||||
|
||||
var _istanbulLibInstrument = require("istanbul-lib-instrument");
|
||||
|
||||
var testExclude = require('test-exclude');
|
||||
|
||||
var findUp = require('find-up');
|
||||
|
||||
function getRealpath(n) {
|
||||
try {
|
||||
return (0, _fs.realpathSync)(n) || n;
|
||||
} catch (e) {
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
function makeShouldSkip() {
|
||||
var exclude;
|
||||
return function shouldSkip(file, opts) {
|
||||
if (!exclude || exclude.cwd !== opts.cwd) {
|
||||
var cwd = getRealpath(process.env.NYC_CWD || process.cwd());
|
||||
var nycConfig = process.env.NYC_CONFIG ? JSON.parse(process.env.NYC_CONFIG) : {};
|
||||
var config = {};
|
||||
|
||||
if (Object.keys(opts).length > 0) {
|
||||
// explicitly configuring options in babel
|
||||
// takes precedence.
|
||||
config = opts;
|
||||
} else if (nycConfig.include || nycConfig.exclude) {
|
||||
// nyc was configured in a parent process (keep these settings).
|
||||
config = {
|
||||
include: nycConfig.include,
|
||||
exclude: nycConfig.exclude
|
||||
};
|
||||
} else {
|
||||
// fallback to loading config from key in package.json.
|
||||
config = {
|
||||
configKey: 'nyc',
|
||||
configPath: (0, _path.dirname)(findUp.sync('package.json', {
|
||||
cwd: cwd
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
||||
exclude = testExclude(Object.assign({
|
||||
cwd: cwd
|
||||
}, config));
|
||||
}
|
||||
|
||||
return !exclude.shouldInstrument(file);
|
||||
};
|
||||
}
|
||||
|
||||
function makeVisitor(_ref) {
|
||||
var t = _ref.types;
|
||||
var shouldSkip = makeShouldSkip();
|
||||
return {
|
||||
visitor: {
|
||||
Program: {
|
||||
enter: function enter(path) {
|
||||
this.__dv__ = null;
|
||||
var realPath = getRealpath(this.file.opts.filename);
|
||||
|
||||
if (shouldSkip(realPath, this.opts)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var inputSourceMap = this.opts.inputSourceMap;
|
||||
|
||||
if (this.opts.useInlineSourceMaps !== false) {
|
||||
if (!inputSourceMap && this.file.inputMap) {
|
||||
inputSourceMap = this.file.inputMap.sourcemap;
|
||||
}
|
||||
}
|
||||
|
||||
this.__dv__ = (0, _istanbulLibInstrument.programVisitor)(t, realPath, {
|
||||
coverageVariable: '__coverage__',
|
||||
inputSourceMap: inputSourceMap
|
||||
});
|
||||
|
||||
this.__dv__.enter(path);
|
||||
},
|
||||
exit: function exit(path) {
|
||||
if (!this.__dv__) {
|
||||
return;
|
||||
}
|
||||
|
||||
var result = this.__dv__.exit(path);
|
||||
|
||||
if (this.opts.onCover) {
|
||||
this.opts.onCover(getRealpath(this.file.opts.filename), result.fileCoverage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var _default = makeVisitor;
|
||||
exports["default"] = _default;
|
76
node_modules/babel-plugin-istanbul/package.json
generated
vendored
Normal file
76
node_modules/babel-plugin-istanbul/package.json
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"name": "babel-plugin-istanbul",
|
||||
"version": "5.1.4",
|
||||
"author": "Thai Pangsakulyanont @dtinth",
|
||||
"license": "BSD-3-Clause",
|
||||
"description": "A babel plugin that adds istanbul instrumentation to ES6 code",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"find-up": "^3.0.0",
|
||||
"istanbul-lib-instrument": "^3.3.0",
|
||||
"test-exclude": "^5.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.4.3",
|
||||
"@babel/core": "^7.4.3",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.4.3",
|
||||
"@babel/preset-env": "^7.4.3",
|
||||
"@babel/register": "^7.4.0",
|
||||
"chai": "^4.2.0",
|
||||
"coveralls": "^3.0.3",
|
||||
"cross-env": "^5.2.0",
|
||||
"mocha": "^6.1.4",
|
||||
"nyc": "^14.1.0",
|
||||
"pmock": "^0.2.3",
|
||||
"standard": "^12.0.1",
|
||||
"standard-version": "^5.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"release": "babel src --out-dir lib",
|
||||
"pretest": "standard && npm run release",
|
||||
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.js",
|
||||
"prepublish": "npm test && npm run release",
|
||||
"version": "standard-version"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"fixtures/has-inline-source-map.js"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/istanbuljs/babel-plugin-istanbul.git"
|
||||
},
|
||||
"keywords": [
|
||||
"istanbul",
|
||||
"babel",
|
||||
"plugin",
|
||||
"instrumentation"
|
||||
],
|
||||
"nyc": {
|
||||
"include": [
|
||||
"src/*.js",
|
||||
"fixtures/should-cover.js"
|
||||
],
|
||||
"require": [
|
||||
"@babel/register"
|
||||
],
|
||||
"sourceMap": false,
|
||||
"instrument": false
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/istanbuljs/babel-plugin-istanbul/issues"
|
||||
},
|
||||
"homepage": "https://github.com/istanbuljs/babel-plugin-istanbul#readme",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz"
|
||||
,"_integrity": "sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ=="
|
||||
,"_from": "babel-plugin-istanbul@5.1.4"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue