Bump @ava/typescript from 3.0.1 to 4.0.0 (#1576)
* Bump @ava/typescript from 3.0.1 to 4.0.0 Bumps [@ava/typescript](https://github.com/avajs/typescript) from 3.0.1 to 4.0.0. - [Release notes](https://github.com/avajs/typescript/releases) - [Commits](https://github.com/avajs/typescript/compare/v3.0.1...v4.0.0) --- updated-dependencies: - dependency-name: "@ava/typescript" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions@github.com>
This commit is contained in:
parent
ec298233c1
commit
19f00dc212
68 changed files with 2374 additions and 1754 deletions
141
node_modules/npm-run-path/index.d.ts
generated
vendored
141
node_modules/npm-run-path/index.d.ts
generated
vendored
|
|
@ -1,89 +1,84 @@
|
|||
declare namespace npmRunPath {
|
||||
interface RunPathOptions {
|
||||
/**
|
||||
Working directory.
|
||||
export interface RunPathOptions {
|
||||
/**
|
||||
Working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string | URL;
|
||||
|
||||
/**
|
||||
PATH to be appended. Default: [`PATH`](https://github.com/sindresorhus/path-key).
|
||||
/**
|
||||
PATH to be appended. Default: [`PATH`](https://github.com/sindresorhus/path-key).
|
||||
|
||||
Set it to an empty string to exclude the default PATH.
|
||||
*/
|
||||
readonly path?: string;
|
||||
Set it to an empty string to exclude the default PATH.
|
||||
*/
|
||||
readonly path?: string;
|
||||
|
||||
/**
|
||||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
||||
/**
|
||||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
|
||||
interface ProcessEnv {
|
||||
[key: string]: string | undefined;
|
||||
}
|
||||
|
||||
interface EnvOptions {
|
||||
/**
|
||||
Working directory.
|
||||
|
||||
@default process.cwd()
|
||||
*/
|
||||
readonly cwd?: string;
|
||||
|
||||
/**
|
||||
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
||||
*/
|
||||
readonly env?: ProcessEnv;
|
||||
|
||||
/**
|
||||
Path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
|
||||
declare const npmRunPath: {
|
||||
export type ProcessEnv = Record<string, string | undefined>;
|
||||
|
||||
export interface EnvOptions {
|
||||
/**
|
||||
Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
|
||||
The working directory.
|
||||
|
||||
@returns The augmented path string.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as childProcess from 'child_process';
|
||||
import npmRunPath = require('npm-run-path');
|
||||
|
||||
console.log(process.env.PATH);
|
||||
//=> '/usr/local/bin'
|
||||
|
||||
console.log(npmRunPath());
|
||||
//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
|
||||
|
||||
// `foo` is a locally installed binary
|
||||
childProcess.execFileSync('foo', {
|
||||
env: npmRunPath.env()
|
||||
});
|
||||
```
|
||||
@default process.cwd()
|
||||
*/
|
||||
(options?: npmRunPath.RunPathOptions): string;
|
||||
readonly cwd?: string | URL;
|
||||
|
||||
/**
|
||||
@returns The augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
||||
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
||||
*/
|
||||
env(options?: npmRunPath.EnvOptions): npmRunPath.ProcessEnv;
|
||||
readonly env?: ProcessEnv;
|
||||
|
||||
// TODO: Remove this for the next major release
|
||||
default: typeof npmRunPath;
|
||||
};
|
||||
/**
|
||||
The path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
||||
|
||||
export = npmRunPath;
|
||||
This can be either an absolute path or a path relative to the `cwd` option.
|
||||
|
||||
@default process.execPath
|
||||
*/
|
||||
readonly execPath?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
|
||||
|
||||
@returns The augmented path string.
|
||||
|
||||
@example
|
||||
```
|
||||
import childProcess from 'node:child_process';
|
||||
import {npmRunPath} from 'npm-run-path';
|
||||
|
||||
console.log(process.env.PATH);
|
||||
//=> '/usr/local/bin'
|
||||
|
||||
console.log(npmRunPath());
|
||||
//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
|
||||
```
|
||||
*/
|
||||
export function npmRunPath(options?: RunPathOptions): string;
|
||||
|
||||
/**
|
||||
@returns The augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
||||
|
||||
@example
|
||||
```
|
||||
import childProcess from 'node:child_process';
|
||||
import {npmRunPathEnv} from 'npm-run-path';
|
||||
|
||||
// `foo` is a locally installed binary
|
||||
childProcess.execFileSync('foo', {
|
||||
env: npmRunPathEnv()
|
||||
});
|
||||
```
|
||||
*/
|
||||
export function npmRunPathEnv(options?: EnvOptions): ProcessEnv;
|
||||
|
|
|
|||
49
node_modules/npm-run-path/index.js
generated
vendored
49
node_modules/npm-run-path/index.js
generated
vendored
|
|
@ -1,17 +1,18 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const pathKey = require('path-key');
|
||||
import process from 'node:process';
|
||||
import path from 'node:path';
|
||||
import url from 'node:url';
|
||||
import pathKey from 'path-key';
|
||||
|
||||
const npmRunPath = options => {
|
||||
options = {
|
||||
cwd: process.cwd(),
|
||||
path: process.env[pathKey()],
|
||||
execPath: process.execPath,
|
||||
...options
|
||||
};
|
||||
export function npmRunPath(options = {}) {
|
||||
const {
|
||||
cwd = process.cwd(),
|
||||
path: path_ = process.env[pathKey()],
|
||||
execPath = process.execPath,
|
||||
} = options;
|
||||
|
||||
let previous;
|
||||
let cwdPath = path.resolve(options.cwd);
|
||||
const cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd;
|
||||
let cwdPath = path.resolve(cwdString);
|
||||
const result = [];
|
||||
|
||||
while (previous !== cwdPath) {
|
||||
|
|
@ -20,28 +21,18 @@ const npmRunPath = options => {
|
|||
cwdPath = path.resolve(cwdPath, '..');
|
||||
}
|
||||
|
||||
// Ensure the running `node` binary is used
|
||||
const execPathDir = path.resolve(options.cwd, options.execPath, '..');
|
||||
result.push(execPathDir);
|
||||
// Ensure the running `node` binary is used.
|
||||
result.push(path.resolve(cwdString, execPath, '..'));
|
||||
|
||||
return result.concat(options.path).join(path.delimiter);
|
||||
};
|
||||
return [...result, path_].join(path.delimiter);
|
||||
}
|
||||
|
||||
module.exports = npmRunPath;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = npmRunPath;
|
||||
export function npmRunPathEnv({env = process.env, ...options} = {}) {
|
||||
env = {...env};
|
||||
|
||||
module.exports.env = options => {
|
||||
options = {
|
||||
env: process.env,
|
||||
...options
|
||||
};
|
||||
|
||||
const env = {...options.env};
|
||||
const path = pathKey({env});
|
||||
|
||||
options.path = env[path];
|
||||
env[path] = module.exports(options);
|
||||
env[path] = npmRunPath(options);
|
||||
|
||||
return env;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
2
node_modules/npm-run-path/license
generated
vendored
2
node_modules/npm-run-path/license
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
|
|
|||
31
node_modules/npm-run-path/node_modules/path-key/index.d.ts
generated
vendored
Normal file
31
node_modules/npm-run-path/node_modules/path-key/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
export interface Options {
|
||||
/**
|
||||
Use a custom environment variables object.
|
||||
|
||||
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env).
|
||||
*/
|
||||
readonly env?: Record<string, string | undefined>;
|
||||
|
||||
/**
|
||||
Get the PATH key for a specific platform.
|
||||
|
||||
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform).
|
||||
*/
|
||||
readonly platform?: NodeJS.Platform;
|
||||
}
|
||||
|
||||
/**
|
||||
Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform.
|
||||
|
||||
@example
|
||||
```
|
||||
import pathKey from 'path-key';
|
||||
|
||||
const key = pathKey();
|
||||
//=> 'PATH'
|
||||
|
||||
const PATH = process.env[key];
|
||||
//=> '/usr/local/bin:/usr/bin:/bin'
|
||||
```
|
||||
*/
|
||||
export default function pathKey(options?: Options): string;
|
||||
12
node_modules/npm-run-path/node_modules/path-key/index.js
generated
vendored
Normal file
12
node_modules/npm-run-path/node_modules/path-key/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export default function pathKey(options = {}) {
|
||||
const {
|
||||
env = process.env,
|
||||
platform = process.platform
|
||||
} = options;
|
||||
|
||||
if (platform !== 'win32') {
|
||||
return 'PATH';
|
||||
}
|
||||
|
||||
return Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
|
||||
}
|
||||
9
node_modules/npm-run-path/node_modules/path-key/license
generated
vendored
Normal file
9
node_modules/npm-run-path/node_modules/path-key/license
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
41
node_modules/npm-run-path/node_modules/path-key/package.json
generated
vendored
Normal file
41
node_modules/npm-run-path/node_modules/path-key/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "path-key",
|
||||
"version": "4.0.0",
|
||||
"description": "Get the PATH environment variable key cross-platform",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/path-key",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"key",
|
||||
"environment",
|
||||
"env",
|
||||
"variable",
|
||||
"get",
|
||||
"cross-platform",
|
||||
"windows"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.14.37",
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.14.0",
|
||||
"xo": "^0.38.2"
|
||||
}
|
||||
}
|
||||
57
node_modules/npm-run-path/node_modules/path-key/readme.md
generated
vendored
Normal file
57
node_modules/npm-run-path/node_modules/path-key/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# path-key
|
||||
|
||||
> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform
|
||||
|
||||
It's usually `PATH` but on Windows it can be any casing like `Path`...
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install path-key
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import pathKey from 'path-key';
|
||||
|
||||
const key = pathKey();
|
||||
//=> 'PATH'
|
||||
|
||||
const PATH = process.env[key];
|
||||
//=> '/usr/local/bin:/usr/bin:/bin'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### pathKey(options?)
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### env
|
||||
|
||||
Type: `object`\
|
||||
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)
|
||||
|
||||
Use a custom environment variables object.
|
||||
|
||||
#### platform
|
||||
|
||||
Type: `string`\
|
||||
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)
|
||||
|
||||
Get the PATH key for a specific platform.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
17
node_modules/npm-run-path/package.json
generated
vendored
17
node_modules/npm-run-path/package.json
generated
vendored
|
|
@ -1,16 +1,19 @@
|
|||
{
|
||||
"name": "npm-run-path",
|
||||
"version": "4.0.1",
|
||||
"version": "5.1.0",
|
||||
"description": "Get your PATH prepended with locally installed binaries",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/npm-run-path",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
|
|
@ -34,11 +37,11 @@
|
|||
"executable"
|
||||
],
|
||||
"dependencies": {
|
||||
"path-key": "^3.0.0"
|
||||
"path-key": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.17.0",
|
||||
"xo": "^0.45.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
44
node_modules/npm-run-path/readme.md
generated
vendored
44
node_modules/npm-run-path/readme.md
generated
vendored
|
|
@ -1,22 +1,20 @@
|
|||
# npm-run-path [](https://travis-ci.org/sindresorhus/npm-run-path)
|
||||
# npm-run-path
|
||||
|
||||
> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries
|
||||
|
||||
In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install npm-run-path
|
||||
```
|
||||
$ npm install npm-run-path
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const childProcess = require('child_process');
|
||||
const npmRunPath = require('npm-run-path');
|
||||
import childProcess from 'node:child_process';
|
||||
import {npmRunPath, npmRunPathEnv} from 'npm-run-path';
|
||||
|
||||
console.log(process.env.PATH);
|
||||
//=> '/usr/local/bin'
|
||||
|
|
@ -26,16 +24,15 @@ console.log(npmRunPath());
|
|||
|
||||
// `foo` is a locally installed binary
|
||||
childProcess.execFileSync('foo', {
|
||||
env: npmRunPath.env()
|
||||
env: npmRunPathEnv()
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### npmRunPath(options?)
|
||||
|
||||
Returns the augmented path string.
|
||||
Returns the augmented PATH string.
|
||||
|
||||
#### options
|
||||
|
||||
|
|
@ -43,29 +40,30 @@ Type: `object`
|
|||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Type: `string | URL`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
Working directory.
|
||||
The working directory.
|
||||
|
||||
##### path
|
||||
|
||||
Type: `string`<br>
|
||||
Type: `string`\
|
||||
Default: [`PATH`](https://github.com/sindresorhus/path-key)
|
||||
|
||||
PATH to be appended.<br>
|
||||
The PATH to be appended.
|
||||
|
||||
Set it to an empty string to exclude the default PATH.
|
||||
|
||||
##### execPath
|
||||
|
||||
Type: `string`<br>
|
||||
Type: `string`\
|
||||
Default: `process.execPath`
|
||||
|
||||
Path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
||||
The path to the current Node.js executable. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
|
||||
|
||||
### npmRunPath.env(options?)
|
||||
### npmRunPathEnv(options?)
|
||||
|
||||
Returns the augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
||||
|
||||
|
|
@ -75,33 +73,31 @@ Type: `object`
|
|||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Type: `string | URL`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
Working directory.
|
||||
The working directory.
|
||||
|
||||
##### env
|
||||
|
||||
Type: `Object`
|
||||
Type: `object`
|
||||
|
||||
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
||||
|
||||
##### execPath
|
||||
|
||||
Type: `string`<br>
|
||||
Type: `string`\
|
||||
Default: `process.execPath`
|
||||
|
||||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
||||
The path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH.
|
||||
|
||||
This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module
|
||||
- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue