Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
41
my-app/node_modules/@istanbuljs/load-nyc-config/CHANGELOG.md
generated
vendored
Executable file
41
my-app/node_modules/@istanbuljs/load-nyc-config/CHANGELOG.md
generated
vendored
Executable file
|
@ -0,0 +1,41 @@
|
|||
# Changelog
|
||||
|
||||
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.
|
||||
|
||||
## [1.1.0](https://github.com/istanbuljs/load-nyc-config/compare/v1.0.0...v1.1.0) (2020-05-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Create `isLoading` function ([#15](https://github.com/istanbuljs/load-nyc-config/issues/15)) ([0e58b51](https://github.com/istanbuljs/load-nyc-config/commit/0e58b516f663af7ed710ba27f2090fc28bc3fdb1))
|
||||
* Support loading ES module config from `.js` files ([#14](https://github.com/istanbuljs/load-nyc-config/issues/14)) ([b1ea369](https://github.com/istanbuljs/load-nyc-config/commit/b1ea369f1e5162133b7057c5e3fefb8085671ab3))
|
||||
|
||||
## [1.0.0](https://github.com/istanbuljs/load-nyc-config/compare/v1.0.0-alpha.2...v1.0.0) (2019-12-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Version bump only ([#11](https://github.com/istanbuljs/load-nyc-config/issues/11)) ([8c3f1be](https://github.com/istanbuljs/load-nyc-config/commit/8c3f1be8d4d30161088a79878c02210db4c2fbfb))
|
||||
|
||||
## [1.0.0-alpha.2](https://github.com/istanbuljs/load-nyc-config/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2019-11-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Remove support for loading .js config under `type: 'module'` ([#10](https://github.com/istanbuljs/load-nyc-config/issues/10)) ([420fe87](https://github.com/istanbuljs/load-nyc-config/commit/420fe87da7dde3e9d98ef07f0a8a03d2b4d1dcb1))
|
||||
* Resolve cwd per config that sets it ([#9](https://github.com/istanbuljs/load-nyc-config/issues/9)) ([649efdc](https://github.com/istanbuljs/load-nyc-config/commit/649efdcda405c476764eebcf15af5da542fb21e1))
|
||||
|
||||
## [1.0.0-alpha.1](https://github.com/istanbuljs/load-nyc-config/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2019-10-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add `cwd` to returned config object ([#8](https://github.com/istanbuljs/load-nyc-config/issues/8)) ([cb5184a](https://github.com/istanbuljs/load-nyc-config/commit/cb5184a))
|
||||
|
||||
## 1.0.0-alpha.0 (2019-10-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add support for loading config from ESM modules ([#7](https://github.com/istanbuljs/load-nyc-config/issues/7)) ([bc5ea3e](https://github.com/istanbuljs/load-nyc-config/commit/bc5ea3e)), closes [#6](https://github.com/istanbuljs/load-nyc-config/issues/6)
|
||||
* Initial implementation ([ff90134](https://github.com/istanbuljs/load-nyc-config/commit/ff90134))
|
16
my-app/node_modules/@istanbuljs/load-nyc-config/LICENSE
generated
vendored
Executable file
16
my-app/node_modules/@istanbuljs/load-nyc-config/LICENSE
generated
vendored
Executable file
|
@ -0,0 +1,16 @@
|
|||
ISC License
|
||||
|
||||
Copyright (c) 2019, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
64
my-app/node_modules/@istanbuljs/load-nyc-config/README.md
generated
vendored
Executable file
64
my-app/node_modules/@istanbuljs/load-nyc-config/README.md
generated
vendored
Executable file
|
@ -0,0 +1,64 @@
|
|||
# @istanbuljs/load-nyc-config
|
||||
|
||||
The utility function which NYC uses to load configuration.
|
||||
This can be used by outside programs to calculate the configuration.
|
||||
Command-line arguments are not considered by this function.
|
||||
|
||||
```js
|
||||
const {loadNycConfig} = require('@istanbuljs/load-nyc-config');
|
||||
|
||||
(async () {
|
||||
console.log(await loadNycConfig());
|
||||
})();
|
||||
```
|
||||
|
||||
## loadNycConfig([options])
|
||||
|
||||
### options.cwd
|
||||
|
||||
Type: `string`
|
||||
Default: `cwd` from parent nyc process or `process.cwd()`
|
||||
|
||||
### options.nycrcPath
|
||||
|
||||
Type: `string`
|
||||
Default: `undefined`
|
||||
|
||||
Name of the file containing nyc configuration.
|
||||
This can be a relative or absolute path.
|
||||
Relative paths can exist at `options.cwd` or any parent directory.
|
||||
If an nycrc is specified but cannot be found an exception is thrown.
|
||||
|
||||
If no nycrc option is provided the default priority of config files are:
|
||||
|
||||
* .nycrc
|
||||
* .nycrc.json
|
||||
* .nycrc.yml
|
||||
* .nycrc.yaml
|
||||
* nyc.config.js
|
||||
* nyc.config.cjs
|
||||
* nyc.config.mjs
|
||||
|
||||
## Configuration merging
|
||||
|
||||
Configuration is first loaded from `package.json` if found, this serves as the package
|
||||
defaults. These options can be overridden by an nycrc if found. Arrays are not merged,
|
||||
so if `package.json` sets `"require": ["@babel/register"]` and `.nycrc` sets `"require": ["esm"]`
|
||||
the effective require setting will only include `"esm"`.
|
||||
|
||||
## isLoading
|
||||
|
||||
```js
|
||||
const {isLoading} = require('@istanbuljs/load-nyc-config');
|
||||
|
||||
console.log(isLoading());
|
||||
```
|
||||
|
||||
In some cases source transformation hooks can get installed before the configuration is
|
||||
loaded. This allows hooks to ignore source loads that occur during configuration load.
|
||||
|
||||
## `@istanbuljs/load-nyc-config` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of `@istanbuljs/load-nyc-config` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-istanbuljs-load-nyc-config?utm_source=npm-istanbuljs-load-nyc-config&utm_medium=referral&utm_campaign=enterprise)
|
166
my-app/node_modules/@istanbuljs/load-nyc-config/index.js
generated
vendored
Executable file
166
my-app/node_modules/@istanbuljs/load-nyc-config/index.js
generated
vendored
Executable file
|
@ -0,0 +1,166 @@
|
|||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {promisify} = require('util');
|
||||
const camelcase = require('camelcase');
|
||||
const findUp = require('find-up');
|
||||
const resolveFrom = require('resolve-from');
|
||||
const getPackageType = require('get-package-type');
|
||||
|
||||
const readFile = promisify(fs.readFile);
|
||||
|
||||
let loadActive = false;
|
||||
|
||||
function isLoading() {
|
||||
return loadActive;
|
||||
}
|
||||
|
||||
const standardConfigFiles = [
|
||||
'.nycrc',
|
||||
'.nycrc.json',
|
||||
'.nycrc.yml',
|
||||
'.nycrc.yaml',
|
||||
'nyc.config.js',
|
||||
'nyc.config.cjs',
|
||||
'nyc.config.mjs'
|
||||
];
|
||||
|
||||
function camelcasedConfig(config) {
|
||||
const results = {};
|
||||
for (const [field, value] of Object.entries(config)) {
|
||||
results[camelcase(field)] = value;
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
async function findPackage(options) {
|
||||
const cwd = options.cwd || process.env.NYC_CWD || process.cwd();
|
||||
const pkgPath = await findUp('package.json', {cwd});
|
||||
if (pkgPath) {
|
||||
const pkgConfig = JSON.parse(await readFile(pkgPath, 'utf8')).nyc || {};
|
||||
if ('cwd' in pkgConfig) {
|
||||
pkgConfig.cwd = path.resolve(path.dirname(pkgPath), pkgConfig.cwd);
|
||||
}
|
||||
|
||||
return {
|
||||
cwd: path.dirname(pkgPath),
|
||||
pkgConfig
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
cwd,
|
||||
pkgConfig: {}
|
||||
};
|
||||
}
|
||||
|
||||
async function actualLoad(configFile) {
|
||||
if (!configFile) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const configExt = path.extname(configFile).toLowerCase();
|
||||
switch (configExt) {
|
||||
case '.js':
|
||||
/* istanbul ignore next: coverage for 13.2.0+ is shown in load-esm.js */
|
||||
if (await getPackageType(configFile) === 'module') {
|
||||
return require('./load-esm')(configFile);
|
||||
}
|
||||
|
||||
/* fallthrough */
|
||||
case '.cjs':
|
||||
return require(configFile);
|
||||
/* istanbul ignore next: coverage for 13.2.0+ is shown in load-esm.js */
|
||||
case '.mjs':
|
||||
return require('./load-esm')(configFile);
|
||||
case '.yml':
|
||||
case '.yaml':
|
||||
return require('js-yaml').load(await readFile(configFile, 'utf8'));
|
||||
default:
|
||||
return JSON.parse(await readFile(configFile, 'utf8'));
|
||||
}
|
||||
}
|
||||
|
||||
async function loadFile(configFile) {
|
||||
/* This lets @istanbuljs/esm-loader-hook avoid circular initialization when loading
|
||||
* configuration. This should generally only happen when the loader hook is active
|
||||
* on the main nyc process. */
|
||||
loadActive = true;
|
||||
|
||||
try {
|
||||
return await actualLoad(configFile);
|
||||
} finally {
|
||||
loadActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function applyExtends(config, filename, loopCheck = new Set()) {
|
||||
config = camelcasedConfig(config);
|
||||
if ('extends' in config) {
|
||||
const extConfigs = [].concat(config.extends);
|
||||
if (extConfigs.some(e => typeof e !== 'string')) {
|
||||
throw new TypeError(`${filename} contains an invalid 'extends' option`);
|
||||
}
|
||||
|
||||
delete config.extends;
|
||||
const filePath = path.dirname(filename);
|
||||
for (const extConfig of extConfigs) {
|
||||
const configFile = resolveFrom.silent(filePath, extConfig) ||
|
||||
resolveFrom.silent(filePath, './' + extConfig);
|
||||
if (!configFile) {
|
||||
throw new Error(`Could not resolve configuration file ${extConfig} from ${path.dirname(filename)}.`);
|
||||
}
|
||||
|
||||
if (loopCheck.has(configFile)) {
|
||||
throw new Error(`Circular extended configurations: '${configFile}'.`);
|
||||
}
|
||||
|
||||
loopCheck.add(configFile);
|
||||
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const configLoaded = await loadFile(configFile);
|
||||
if ('cwd' in configLoaded) {
|
||||
configLoaded.cwd = path.resolve(path.dirname(configFile), configLoaded.cwd);
|
||||
}
|
||||
|
||||
Object.assign(
|
||||
config,
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await applyExtends(configLoaded, configFile, loopCheck)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
async function loadNycConfig(options = {}) {
|
||||
const {cwd, pkgConfig} = await findPackage(options);
|
||||
const configFiles = [].concat(options.nycrcPath || standardConfigFiles);
|
||||
const configFile = await findUp(configFiles, {cwd});
|
||||
if (options.nycrcPath && !configFile) {
|
||||
throw new Error(`Requested configuration file ${options.nycrcPath} not found`);
|
||||
}
|
||||
|
||||
const config = {
|
||||
cwd,
|
||||
...(await applyExtends(pkgConfig, path.join(cwd, 'package.json'))),
|
||||
...(await applyExtends(await loadFile(configFile), configFile))
|
||||
};
|
||||
|
||||
const arrayFields = ['require', 'extension', 'exclude', 'include'];
|
||||
for (const arrayField of arrayFields) {
|
||||
if (config[arrayField]) {
|
||||
config[arrayField] = [].concat(config[arrayField]);
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
loadNycConfig,
|
||||
isLoading
|
||||
};
|
12
my-app/node_modules/@istanbuljs/load-nyc-config/load-esm.js
generated
vendored
Executable file
12
my-app/node_modules/@istanbuljs/load-nyc-config/load-esm.js
generated
vendored
Executable file
|
@ -0,0 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
const {pathToFileURL} = require('url');
|
||||
|
||||
module.exports = async filename => {
|
||||
const mod = await import(pathToFileURL(filename));
|
||||
if ('default' in mod === false) {
|
||||
throw new Error(`${filename} has no default export`);
|
||||
}
|
||||
|
||||
return mod.default;
|
||||
};
|
49
my-app/node_modules/@istanbuljs/load-nyc-config/package.json
generated
vendored
Executable file
49
my-app/node_modules/@istanbuljs/load-nyc-config/package.json
generated
vendored
Executable file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "@istanbuljs/load-nyc-config",
|
||||
"version": "1.1.0",
|
||||
"description": "Utility function to load nyc configuration",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"pretest": "xo",
|
||||
"test": "tap",
|
||||
"snap": "npm test -- --snapshot",
|
||||
"release": "standard-version"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"license": "ISC",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/istanbuljs/load-nyc-config.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/istanbuljs/load-nyc-config/issues"
|
||||
},
|
||||
"homepage": "https://github.com/istanbuljs/load-nyc-config#readme",
|
||||
"dependencies": {
|
||||
"camelcase": "^5.3.1",
|
||||
"find-up": "^4.1.0",
|
||||
"get-package-type": "^0.1.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"resolve-from": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"semver": "^6.3.0",
|
||||
"standard-version": "^7.0.0",
|
||||
"tap": "^14.10.5",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"test/fixtures/extends/invalid.*"
|
||||
],
|
||||
"rules": {
|
||||
"require-atomic-updates": 0,
|
||||
"capitalized-comments": 0,
|
||||
"unicorn/import-index": 0,
|
||||
"import/extensions": 0,
|
||||
"import/no-useless-path-segments": 0
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue