mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2026-04-28 17:22:06 -06:00
Update node_modules
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
# 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.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
@@ -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.
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
# @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');
|
||||
|
||||
console.log(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
|
||||
|
||||
## 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"`.
|
||||
|
||||
## `@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)
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
'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 readFile = promisify(fs.readFile);
|
||||
|
||||
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':
|
||||
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 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 actualLoad(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 actualLoad(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
|
||||
};
|
||||
+12
@@ -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;
|
||||
};
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"_from": "@istanbuljs/load-nyc-config@^1.0.0",
|
||||
"_id": "@istanbuljs/load-nyc-config@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==",
|
||||
"_location": "/@istanbuljs/load-nyc-config",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@istanbuljs/load-nyc-config@^1.0.0",
|
||||
"name": "@istanbuljs/load-nyc-config",
|
||||
"escapedName": "@istanbuljs%2fload-nyc-config",
|
||||
"scope": "@istanbuljs",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-plugin-istanbul"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz",
|
||||
"_shasum": "10602de5570baea82f8afbfa2630b24e7a8cfe5b",
|
||||
"_spec": "@istanbuljs/load-nyc-config@^1.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx/node_modules/babel-plugin-istanbul",
|
||||
"bugs": {
|
||||
"url": "https://github.com/istanbuljs/load-nyc-config/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"camelcase": "^5.3.1",
|
||||
"find-up": "^4.1.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"resolve-from": "^5.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Utility function to load nyc configuration",
|
||||
"devDependencies": {
|
||||
"semver": "^6.3.0",
|
||||
"standard-version": "^7.0.0",
|
||||
"tap": "^14.10.5",
|
||||
"xo": "^0.25.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"homepage": "https://github.com/istanbuljs/load-nyc-config#readme",
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "@istanbuljs/load-nyc-config",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/istanbuljs/load-nyc-config.git"
|
||||
},
|
||||
"scripts": {
|
||||
"pretest": "xo",
|
||||
"release": "standard-version",
|
||||
"snap": "npm test -- --snapshot",
|
||||
"test": "tap"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"test/fixtures/extends/invalid.*"
|
||||
],
|
||||
"rules": {
|
||||
"require-atomic-updates": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user