mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-21 13:23:03 +01:00
ci: add node_modules to .gitignore
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
sablier.yaml
|
||||
./plugins/traefik/e2e/kubeconfig.yaml
|
||||
./plugins/traefik/e2e/kubeconfig.yaml
|
||||
node_modules
|
||||
19
node_modules/@babel/code-frame/README.md
generated
vendored
19
node_modules/@babel/code-frame/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/code-frame
|
||||
|
||||
> Generate errors that contain a code frame that point to source locations.
|
||||
|
||||
See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/code-frame
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/code-frame --dev
|
||||
```
|
||||
19
node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
19
node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/helper-validator-identifier
|
||||
|
||||
> Validate identifier/keywords name
|
||||
|
||||
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-validator-identifier
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-validator-identifier
|
||||
```
|
||||
19
node_modules/@babel/highlight/README.md
generated
vendored
19
node_modules/@babel/highlight/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
# @babel/highlight
|
||||
|
||||
> Syntax highlight JavaScript strings for output in terminals.
|
||||
|
||||
See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/highlight
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/highlight --dev
|
||||
```
|
||||
219
node_modules/@colors/colors/README.md
generated
vendored
219
node_modules/@colors/colors/README.md
generated
vendored
@@ -1,219 +0,0 @@
|
||||
# @colors/colors ("colors.js")
|
||||
[](https://github.com/DABH/colors.js/actions/workflows/ci.yml)
|
||||
[](https://www.npmjs.org/package/@colors/colors)
|
||||
|
||||
Please check out the [roadmap](ROADMAP.md) for upcoming features and releases. Please open Issues to provide feedback.
|
||||
|
||||
## get color and style in your node.js console
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
npm install @colors/colors
|
||||
|
||||
## colors and styles!
|
||||
|
||||
### text colors
|
||||
|
||||
- black
|
||||
- red
|
||||
- green
|
||||
- yellow
|
||||
- blue
|
||||
- magenta
|
||||
- cyan
|
||||
- white
|
||||
- gray
|
||||
- grey
|
||||
|
||||
### bright text colors
|
||||
|
||||
- brightRed
|
||||
- brightGreen
|
||||
- brightYellow
|
||||
- brightBlue
|
||||
- brightMagenta
|
||||
- brightCyan
|
||||
- brightWhite
|
||||
|
||||
### background colors
|
||||
|
||||
- bgBlack
|
||||
- bgRed
|
||||
- bgGreen
|
||||
- bgYellow
|
||||
- bgBlue
|
||||
- bgMagenta
|
||||
- bgCyan
|
||||
- bgWhite
|
||||
- bgGray
|
||||
- bgGrey
|
||||
|
||||
### bright background colors
|
||||
|
||||
- bgBrightRed
|
||||
- bgBrightGreen
|
||||
- bgBrightYellow
|
||||
- bgBrightBlue
|
||||
- bgBrightMagenta
|
||||
- bgBrightCyan
|
||||
- bgBrightWhite
|
||||
|
||||
### styles
|
||||
|
||||
- reset
|
||||
- bold
|
||||
- dim
|
||||
- italic
|
||||
- underline
|
||||
- inverse
|
||||
- hidden
|
||||
- strikethrough
|
||||
|
||||
### extras
|
||||
|
||||
- rainbow
|
||||
- zebra
|
||||
- america
|
||||
- trap
|
||||
- random
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
By popular demand, `@colors/colors` now ships with two types of usages!
|
||||
|
||||
The super nifty way
|
||||
|
||||
```js
|
||||
var colors = require('@colors/colors');
|
||||
|
||||
console.log('hello'.green); // outputs green text
|
||||
console.log('i like cake and pies'.underline.red); // outputs red underlined text
|
||||
console.log('inverse the color'.inverse); // inverses the color
|
||||
console.log('OMG Rainbows!'.rainbow); // rainbow
|
||||
console.log('Run the trap'.trap); // Drops the bass
|
||||
|
||||
```
|
||||
|
||||
or a slightly less nifty way which doesn't extend `String.prototype`
|
||||
|
||||
```js
|
||||
var colors = require('@colors/colors/safe');
|
||||
|
||||
console.log(colors.green('hello')); // outputs green text
|
||||
console.log(colors.red.underline('i like cake and pies')); // outputs red underlined text
|
||||
console.log(colors.inverse('inverse the color')); // inverses the color
|
||||
console.log(colors.rainbow('OMG Rainbows!')); // rainbow
|
||||
console.log(colors.trap('Run the trap')); // Drops the bass
|
||||
|
||||
```
|
||||
|
||||
I prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way.
|
||||
|
||||
If you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object.
|
||||
|
||||
## Enabling/Disabling Colors
|
||||
|
||||
The package will auto-detect whether your terminal can use colors and enable/disable accordingly. When colors are disabled, the color functions do nothing. You can override this with a command-line flag:
|
||||
|
||||
```bash
|
||||
node myapp.js --no-color
|
||||
node myapp.js --color=false
|
||||
|
||||
node myapp.js --color
|
||||
node myapp.js --color=true
|
||||
node myapp.js --color=always
|
||||
|
||||
FORCE_COLOR=1 node myapp.js
|
||||
```
|
||||
|
||||
Or in code:
|
||||
|
||||
```javascript
|
||||
var colors = require('@colors/colors');
|
||||
colors.enable();
|
||||
colors.disable();
|
||||
```
|
||||
|
||||
## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)
|
||||
|
||||
```js
|
||||
var name = 'Beowulf';
|
||||
console.log(colors.green('Hello %s'), name);
|
||||
// outputs -> 'Hello Beowulf'
|
||||
```
|
||||
|
||||
## Custom themes
|
||||
|
||||
### Using standard API
|
||||
|
||||
```js
|
||||
|
||||
var colors = require('@colors/colors');
|
||||
|
||||
colors.setTheme({
|
||||
silly: 'rainbow',
|
||||
input: 'grey',
|
||||
verbose: 'cyan',
|
||||
prompt: 'grey',
|
||||
info: 'green',
|
||||
data: 'grey',
|
||||
help: 'cyan',
|
||||
warn: 'yellow',
|
||||
debug: 'blue',
|
||||
error: 'red'
|
||||
});
|
||||
|
||||
// outputs red text
|
||||
console.log("this is an error".error);
|
||||
|
||||
// outputs yellow text
|
||||
console.log("this is a warning".warn);
|
||||
```
|
||||
|
||||
### Using string safe API
|
||||
|
||||
```js
|
||||
var colors = require('@colors/colors/safe');
|
||||
|
||||
// set single property
|
||||
var error = colors.red;
|
||||
error('this is red');
|
||||
|
||||
// set theme
|
||||
colors.setTheme({
|
||||
silly: 'rainbow',
|
||||
input: 'grey',
|
||||
verbose: 'cyan',
|
||||
prompt: 'grey',
|
||||
info: 'green',
|
||||
data: 'grey',
|
||||
help: 'cyan',
|
||||
warn: 'yellow',
|
||||
debug: 'blue',
|
||||
error: 'red'
|
||||
});
|
||||
|
||||
// outputs red text
|
||||
console.log(colors.error("this is an error"));
|
||||
|
||||
// outputs yellow text
|
||||
console.log(colors.warn("this is a warning"));
|
||||
|
||||
```
|
||||
|
||||
### Combining Colors
|
||||
|
||||
```javascript
|
||||
var colors = require('@colors/colors');
|
||||
|
||||
colors.setTheme({
|
||||
custom: ['red', 'underline']
|
||||
});
|
||||
|
||||
console.log('test'.custom);
|
||||
```
|
||||
|
||||
*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*
|
||||
171
node_modules/@nodelib/fs.scandir/README.md
generated
vendored
171
node_modules/@nodelib/fs.scandir/README.md
generated
vendored
@@ -1,171 +0,0 @@
|
||||
# @nodelib/fs.scandir
|
||||
|
||||
> List files and directories inside the specified directory.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
The package is aimed at obtaining information about entries in the directory.
|
||||
|
||||
* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
|
||||
* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode).
|
||||
* :link: Can safely work with broken symbolic links.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.scandir
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsScandir from '@nodelib/fs.scandir';
|
||||
|
||||
fsScandir.scandir('path', (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .scandir(path, [optionsOrSettings], callback)
|
||||
|
||||
Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style.
|
||||
|
||||
```ts
|
||||
fsScandir.scandir('path', (error, entries) => { /* … */ });
|
||||
fsScandir.scandir('path', {}, (error, entries) => { /* … */ });
|
||||
fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
### .scandirSync(path, [optionsOrSettings])
|
||||
|
||||
Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path.
|
||||
|
||||
```ts
|
||||
const entries = fsScandir.scandirSync('path');
|
||||
const entries = fsScandir.scandirSync('path', {});
|
||||
const entries = fsScandir.scandirSync(('path', new fsScandir.Settings());
|
||||
```
|
||||
|
||||
#### path
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | Buffer | URL`
|
||||
|
||||
A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
|
||||
#### optionsOrSettings
|
||||
|
||||
* Required: `false`
|
||||
* Type: `Options | Settings`
|
||||
* Default: An instance of `Settings` class
|
||||
|
||||
An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class.
|
||||
|
||||
> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
|
||||
|
||||
### Settings([options])
|
||||
|
||||
A class of full settings of the package.
|
||||
|
||||
```ts
|
||||
const settings = new fsScandir.Settings({ followSymbolicLinks: false });
|
||||
|
||||
const entries = fsScandir.scandirSync('path', settings);
|
||||
```
|
||||
|
||||
## Entry
|
||||
|
||||
* `name` — The name of the entry (`unknown.txt`).
|
||||
* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
|
||||
* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class.
|
||||
* `stats` (optional) — An instance of `fs.Stats` class.
|
||||
|
||||
For example, the `scandir` call for `tools` directory with one directory inside:
|
||||
|
||||
```ts
|
||||
{
|
||||
dirent: Dirent { name: 'typedoc', /* … */ },
|
||||
name: 'typedoc',
|
||||
path: 'tools/typedoc'
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### stats
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
|
||||
|
||||
> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO??
|
||||
|
||||
### followSymbolicLinks
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`.
|
||||
|
||||
### `pathSegmentSeparator`
|
||||
|
||||
* Type: `string`
|
||||
* Default: `path.sep`
|
||||
|
||||
By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
|
||||
|
||||
### `fs`
|
||||
|
||||
* Type: [`FileSystemAdapter`](./src/adapters/fs.ts)
|
||||
* Default: A default FS methods
|
||||
|
||||
By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
|
||||
|
||||
```ts
|
||||
interface FileSystemAdapter {
|
||||
lstat?: typeof fs.lstat;
|
||||
stat?: typeof fs.stat;
|
||||
lstatSync?: typeof fs.lstatSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
readdir?: typeof fs.readdir;
|
||||
readdirSync?: typeof fs.readdirSync;
|
||||
}
|
||||
|
||||
const settings = new fsScandir.Settings({
|
||||
fs: { lstat: fakeLstat }
|
||||
});
|
||||
```
|
||||
|
||||
## `old` and `modern` mode
|
||||
|
||||
This package has two modes that are used depending on the environment and parameters of use.
|
||||
|
||||
### old
|
||||
|
||||
* Node.js below `10.10` or when the `stats` option is enabled
|
||||
|
||||
When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links).
|
||||
|
||||
### modern
|
||||
|
||||
* Node.js 10.10+ and the `stats` option is disabled
|
||||
|
||||
In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present.
|
||||
|
||||
This mode makes fewer calls to the file system. It's faster.
|
||||
|
||||
## Changelog
|
||||
|
||||
See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the terms of the MIT license.
|
||||
126
node_modules/@nodelib/fs.stat/README.md
generated
vendored
126
node_modules/@nodelib/fs.stat/README.md
generated
vendored
@@ -1,126 +0,0 @@
|
||||
# @nodelib/fs.stat
|
||||
|
||||
> Get the status of a file with some features.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
Wrapper around standard method `fs.lstat` and `fs.stat` with some features.
|
||||
|
||||
* :beginner: Normally follows symbolic link.
|
||||
* :gear: Can safely work with broken symbolic link.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.stat
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsStat from '@nodelib/fs.stat';
|
||||
|
||||
fsStat.stat('path', (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .stat(path, [optionsOrSettings], callback)
|
||||
|
||||
Returns an instance of `fs.Stats` class for provided path with standard callback-style.
|
||||
|
||||
```ts
|
||||
fsStat.stat('path', (error, stats) => { /* … */ });
|
||||
fsStat.stat('path', {}, (error, stats) => { /* … */ });
|
||||
fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ });
|
||||
```
|
||||
|
||||
### .statSync(path, [optionsOrSettings])
|
||||
|
||||
Returns an instance of `fs.Stats` class for provided path.
|
||||
|
||||
```ts
|
||||
const stats = fsStat.stat('path');
|
||||
const stats = fsStat.stat('path', {});
|
||||
const stats = fsStat.stat('path', new fsStat.Settings());
|
||||
```
|
||||
|
||||
#### path
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | Buffer | URL`
|
||||
|
||||
A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
|
||||
#### optionsOrSettings
|
||||
|
||||
* Required: `false`
|
||||
* Type: `Options | Settings`
|
||||
* Default: An instance of `Settings` class
|
||||
|
||||
An [`Options`](#options) object or an instance of [`Settings`](#settings) class.
|
||||
|
||||
> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
|
||||
|
||||
### Settings([options])
|
||||
|
||||
A class of full settings of the package.
|
||||
|
||||
```ts
|
||||
const settings = new fsStat.Settings({ followSymbolicLink: false });
|
||||
|
||||
const stats = fsStat.stat('path', settings);
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### `followSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `markSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`).
|
||||
|
||||
> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
|
||||
|
||||
### `fs`
|
||||
|
||||
* Type: [`FileSystemAdapter`](./src/adapters/fs.ts)
|
||||
* Default: A default FS methods
|
||||
|
||||
By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
|
||||
|
||||
```ts
|
||||
interface FileSystemAdapter {
|
||||
lstat?: typeof fs.lstat;
|
||||
stat?: typeof fs.stat;
|
||||
lstatSync?: typeof fs.lstatSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
}
|
||||
|
||||
const settings = new fsStat.Settings({
|
||||
fs: { lstat: fakeLstat }
|
||||
});
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the terms of the MIT license.
|
||||
215
node_modules/@nodelib/fs.walk/README.md
generated
vendored
215
node_modules/@nodelib/fs.walk/README.md
generated
vendored
@@ -1,215 +0,0 @@
|
||||
# @nodelib/fs.walk
|
||||
|
||||
> A library for efficiently walking a directory recursively.
|
||||
|
||||
## :bulb: Highlights
|
||||
|
||||
* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional).
|
||||
* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode).
|
||||
* :gear: Built-in directories/files and error filtering system.
|
||||
* :link: Can safely work with broken symbolic links.
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
npm install @nodelib/fs.walk
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import * as fsWalk from '@nodelib/fs.walk';
|
||||
|
||||
fsWalk.walk('path', (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### .walk(path, [optionsOrSettings], callback)
|
||||
|
||||
Reads the directory recursively and asynchronously. Requires a callback function.
|
||||
|
||||
> :book: If you want to use the Promise API, use `util.promisify`.
|
||||
|
||||
```ts
|
||||
fsWalk.walk('path', (error, entries) => { /* … */ });
|
||||
fsWalk.walk('path', {}, (error, entries) => { /* … */ });
|
||||
fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ });
|
||||
```
|
||||
|
||||
### .walkStream(path, [optionsOrSettings])
|
||||
|
||||
Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider.
|
||||
|
||||
```ts
|
||||
const stream = fsWalk.walkStream('path');
|
||||
const stream = fsWalk.walkStream('path', {});
|
||||
const stream = fsWalk.walkStream('path', new fsWalk.Settings());
|
||||
```
|
||||
|
||||
### .walkSync(path, [optionsOrSettings])
|
||||
|
||||
Reads the directory recursively and synchronously. Returns an array of entries.
|
||||
|
||||
```ts
|
||||
const entries = fsWalk.walkSync('path');
|
||||
const entries = fsWalk.walkSync('path', {});
|
||||
const entries = fsWalk.walkSync('path', new fsWalk.Settings());
|
||||
```
|
||||
|
||||
#### path
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | Buffer | URL`
|
||||
|
||||
A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
|
||||
#### optionsOrSettings
|
||||
|
||||
* Required: `false`
|
||||
* Type: `Options | Settings`
|
||||
* Default: An instance of `Settings` class
|
||||
|
||||
An [`Options`](#options) object or an instance of [`Settings`](#settings) class.
|
||||
|
||||
> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class.
|
||||
|
||||
### Settings([options])
|
||||
|
||||
A class of full settings of the package.
|
||||
|
||||
```ts
|
||||
const settings = new fsWalk.Settings({ followSymbolicLinks: true });
|
||||
|
||||
const entries = fsWalk.walkSync('path', settings);
|
||||
```
|
||||
|
||||
## Entry
|
||||
|
||||
* `name` — The name of the entry (`unknown.txt`).
|
||||
* `path` — The path of the entry relative to call directory (`root/unknown.txt`).
|
||||
* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class.
|
||||
* [`stats`] — An instance of `fs.Stats` class.
|
||||
|
||||
## Options
|
||||
|
||||
### basePath
|
||||
|
||||
* Type: `string`
|
||||
* Default: `undefined`
|
||||
|
||||
By default, all paths are built relative to the root path. You can use this option to set custom root path.
|
||||
|
||||
In the example below we read the files from the `root` directory, but in the results the root path will be `custom`.
|
||||
|
||||
```ts
|
||||
fsWalk.walkSync('root'); // → ['root/file.txt']
|
||||
fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt']
|
||||
```
|
||||
|
||||
### concurrency
|
||||
|
||||
* Type: `number`
|
||||
* Default: `Infinity`
|
||||
|
||||
The maximum number of concurrent calls to `fs.readdir`.
|
||||
|
||||
> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)).
|
||||
|
||||
### deepFilter
|
||||
|
||||
* Type: [`DeepFilterFunction`](./src/settings.ts)
|
||||
* Default: `undefined`
|
||||
|
||||
A function that indicates whether the directory will be read deep or not.
|
||||
|
||||
```ts
|
||||
// Skip all directories that starts with `node_modules`
|
||||
const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules');
|
||||
```
|
||||
|
||||
### entryFilter
|
||||
|
||||
* Type: [`EntryFilterFunction`](./src/settings.ts)
|
||||
* Default: `undefined`
|
||||
|
||||
A function that indicates whether the entry will be included to results or not.
|
||||
|
||||
```ts
|
||||
// Exclude all `.js` files from results
|
||||
const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js');
|
||||
```
|
||||
|
||||
### errorFilter
|
||||
|
||||
* Type: [`ErrorFilterFunction`](./src/settings.ts)
|
||||
* Default: `undefined`
|
||||
|
||||
A function that allows you to skip errors that occur when reading directories.
|
||||
|
||||
For example, you can skip `ENOENT` errors if required:
|
||||
|
||||
```ts
|
||||
// Skip all ENOENT errors
|
||||
const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT';
|
||||
```
|
||||
|
||||
### stats
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Adds an instance of `fs.Stats` class to the [`Entry`](#entry).
|
||||
|
||||
> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type.
|
||||
|
||||
### followSymbolicLinks
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`.
|
||||
|
||||
### `throwErrorOnBrokenSymbolicLink`
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
|
||||
|
||||
### `pathSegmentSeparator`
|
||||
|
||||
* Type: `string`
|
||||
* Default: `path.sep`
|
||||
|
||||
By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead.
|
||||
|
||||
### `fs`
|
||||
|
||||
* Type: `FileSystemAdapter`
|
||||
* Default: A default FS methods
|
||||
|
||||
By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own.
|
||||
|
||||
```ts
|
||||
interface FileSystemAdapter {
|
||||
lstat: typeof fs.lstat;
|
||||
stat: typeof fs.stat;
|
||||
lstatSync: typeof fs.lstatSync;
|
||||
statSync: typeof fs.statSync;
|
||||
readdir: typeof fs.readdir;
|
||||
readdirSync: typeof fs.readdirSync;
|
||||
}
|
||||
|
||||
const settings = new fsWalk.Settings({
|
||||
fs: { lstat: fakeLstat }
|
||||
});
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the terms of the MIT license.
|
||||
285
node_modules/@octokit/auth-token/README.md
generated
vendored
285
node_modules/@octokit/auth-token/README.md
generated
vendored
@@ -1,285 +0,0 @@
|
||||
# auth-token.js
|
||||
|
||||
> GitHub API token authentication for browsers and Node.js
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/auth-token)
|
||||
[](https://github.com/octokit/auth-token.js/actions?query=workflow%3ATest)
|
||||
|
||||
`@octokit/auth-token` is the simplest of [GitHub’s authentication strategies](https://github.com/octokit/auth.js).
|
||||
|
||||
It is useful if you want to support multiple authentication strategies, as it’s API is compatible with its sibling packages for [basic](https://github.com/octokit/auth-basic.js), [GitHub App](https://github.com/octokit/auth-app.js) and [OAuth app](https://github.com/octokit/auth.js) authentication.
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [`createTokenAuth(token) options`](#createtokenauthtoken-options)
|
||||
- [`auth()`](#auth)
|
||||
- [Authentication object](#authentication-object)
|
||||
- [`auth.hook(request, route, options)` or `auth.hook(request, options)`](#authhookrequest-route-options-or-authhookrequest-options)
|
||||
- [Find more information](#find-more-information)
|
||||
- [Find out what scopes are enabled for oauth tokens](#find-out-what-scopes-are-enabled-for-oauth-tokens)
|
||||
- [Find out if token is a personal access token or if it belongs to an OAuth app](#find-out-if-token-is-a-personal-access-token-or-if-it-belongs-to-an-oauth-app)
|
||||
- [Find out what permissions are enabled for a repository](#find-out-what-permissions-are-enabled-for-a-repository)
|
||||
- [Use token for git operations](#use-token-for-git-operations)
|
||||
- [License](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/auth-token` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { createTokenAuth } from "https://cdn.skypack.dev/@octokit/auth-token";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/auth-token</code>
|
||||
|
||||
```js
|
||||
const { createTokenAuth } = require("@octokit/auth-token");
|
||||
// or: import { createTokenAuth } from "@octokit/auth-token";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const auth = createTokenAuth("ghp_PersonalAccessToken01245678900000000");
|
||||
const authentication = await auth();
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghp_PersonalAccessToken01245678900000000',
|
||||
// tokenType: 'oauth'
|
||||
// }
|
||||
```
|
||||
|
||||
## `createTokenAuth(token) options`
|
||||
|
||||
The `createTokenAuth` method accepts a single argument of type string, which is the token. The passed token can be one of the following:
|
||||
|
||||
- [Personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)
|
||||
- [OAuth access token](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/)
|
||||
- [GITHUB_TOKEN provided to GitHub Actions](https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables)
|
||||
- Installation access token ([server-to-server](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation))
|
||||
- User authentication for installation ([user-to-server](https://docs.github.com/en/developers/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps))
|
||||
|
||||
Examples
|
||||
|
||||
```js
|
||||
// Personal access token or OAuth access token
|
||||
createTokenAuth("ghp_PersonalAccessToken01245678900000000");
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghp_PersonalAccessToken01245678900000000',
|
||||
// tokenType: 'oauth'
|
||||
// }
|
||||
|
||||
// Installation access token or GitHub Action token
|
||||
createTokenAuth("ghs_InstallallationOrActionToken00000000");
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghs_InstallallationOrActionToken00000000',
|
||||
// tokenType: 'installation'
|
||||
// }
|
||||
|
||||
// Installation access token or GitHub Action token
|
||||
createTokenAuth("ghu_InstallationUserToServer000000000000");
|
||||
// {
|
||||
// type: 'token',
|
||||
// token: 'ghu_InstallationUserToServer000000000000',
|
||||
// tokenType: 'user-to-server'
|
||||
// }
|
||||
```
|
||||
|
||||
## `auth()`
|
||||
|
||||
The `auth()` method has no options. It returns a promise which resolves with the the authentication object.
|
||||
|
||||
## Authentication object
|
||||
|
||||
<table width="100%">
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th width=150>
|
||||
name
|
||||
</th>
|
||||
<th width=70>
|
||||
type
|
||||
</th>
|
||||
<th>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th>
|
||||
<code>type</code>
|
||||
</th>
|
||||
<th>
|
||||
<code>string</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>"token"</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>token</code>
|
||||
</th>
|
||||
<th>
|
||||
<code>string</code>
|
||||
</th>
|
||||
<td>
|
||||
The provided token.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>tokenType</code>
|
||||
</th>
|
||||
<th>
|
||||
<code>string</code>
|
||||
</th>
|
||||
<td>
|
||||
Can be either <code>"oauth"</code> for personal access tokens and OAuth tokens, <code>"installation"</code> for installation access tokens (includes <code>GITHUB_TOKEN</code> provided to GitHub Actions), <code>"app"</code> for a GitHub App JSON Web Token, or <code>"user-to-server"</code> for a user authentication token through an app installation.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## `auth.hook(request, route, options)` or `auth.hook(request, options)`
|
||||
|
||||
`auth.hook()` hooks directly into the request life cycle. It authenticates the request using the provided token.
|
||||
|
||||
The `request` option is an instance of [`@octokit/request`](https://github.com/octokit/request.js#readme). The `route`/`options` parameters are the same as for the [`request()` method](https://github.com/octokit/request.js#request).
|
||||
|
||||
`auth.hook()` can be called directly to send an authenticated request
|
||||
|
||||
```js
|
||||
const { data: authorizations } = await auth.hook(
|
||||
request,
|
||||
"GET /authorizations"
|
||||
);
|
||||
```
|
||||
|
||||
Or it can be passed as option to [`request()`](https://github.com/octokit/request.js#request).
|
||||
|
||||
```js
|
||||
const requestWithAuth = request.defaults({
|
||||
request: {
|
||||
hook: auth.hook,
|
||||
},
|
||||
});
|
||||
|
||||
const { data: authorizations } = await requestWithAuth("GET /authorizations");
|
||||
```
|
||||
|
||||
## Find more information
|
||||
|
||||
`auth()` does not send any requests, it only transforms the provided token string into an authentication object.
|
||||
|
||||
Here is a list of things you can do to retrieve further information
|
||||
|
||||
### Find out what scopes are enabled for oauth tokens
|
||||
|
||||
Note that this does not work for installations. There is no way to retrieve permissions based on an installation access tokens.
|
||||
|
||||
```js
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const authentication = await auth();
|
||||
|
||||
const response = await request("HEAD /");
|
||||
const scopes = response.headers["x-oauth-scopes"].split(/,\s+/);
|
||||
|
||||
if (scopes.length) {
|
||||
console.log(
|
||||
`"${TOKEN}" has ${scopes.length} scopes enabled: ${scopes.join(", ")}`
|
||||
);
|
||||
} else {
|
||||
console.log(`"${TOKEN}" has no scopes enabled`);
|
||||
}
|
||||
```
|
||||
|
||||
### Find out if token is a personal access token or if it belongs to an OAuth app
|
||||
|
||||
```js
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const authentication = await auth();
|
||||
|
||||
const response = await request("HEAD /");
|
||||
const clientId = response.headers["x-oauth-client-id"];
|
||||
|
||||
if (clientId) {
|
||||
console.log(
|
||||
`"${token}" is an OAuth token, its app’s client_id is ${clientId}.`
|
||||
);
|
||||
} else {
|
||||
console.log(`"${token}" is a personal access token`);
|
||||
}
|
||||
```
|
||||
|
||||
### Find out what permissions are enabled for a repository
|
||||
|
||||
Note that the `permissions` key is not set when authenticated using an installation access token.
|
||||
|
||||
```js
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const authentication = await auth();
|
||||
|
||||
const response = await request("GET /repos/{owner}/{repo}", {
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
});
|
||||
|
||||
console.log(response.data.permissions);
|
||||
// {
|
||||
// admin: true,
|
||||
// push: true,
|
||||
// pull: true
|
||||
// }
|
||||
```
|
||||
|
||||
### Use token for git operations
|
||||
|
||||
Both OAuth and installation access tokens can be used for git operations. However, when using with an installation, [the token must be prefixed with `x-access-token`](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation).
|
||||
|
||||
This example is using the [`execa`](https://github.com/sindresorhus/execa) package to run a `git push` command.
|
||||
|
||||
```js
|
||||
const TOKEN = "ghp_PersonalAccessToken01245678900000000";
|
||||
|
||||
const auth = createTokenAuth(TOKEN);
|
||||
const { token, tokenType } = await auth();
|
||||
const tokenWithPrefix =
|
||||
tokenType === "installation" ? `x-access-token:${token}` : token;
|
||||
|
||||
const repositoryUrl = `https://${tokenWithPrefix}@github.com/octocat/hello-world.git`;
|
||||
|
||||
const { stdout } = await execa("git", ["push", repositoryUrl]);
|
||||
console.log(stdout);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
448
node_modules/@octokit/core/README.md
generated
vendored
448
node_modules/@octokit/core/README.md
generated
vendored
@@ -1,448 +0,0 @@
|
||||
# core.js
|
||||
|
||||
> Extendable client for GitHub's REST & GraphQL APIs
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/core)
|
||||
[](https://github.com/octokit/core.js/actions?query=workflow%3ATest+branch%3Amain)
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [REST API example](#rest-api-example)
|
||||
- [GraphQL example](#graphql-example)
|
||||
- [Options](#options)
|
||||
- [Defaults](#defaults)
|
||||
- [Authentication](#authentication)
|
||||
- [Logging](#logging)
|
||||
- [Hooks](#hooks)
|
||||
- [Plugins](#plugins)
|
||||
- [Build your own Octokit with Plugins and Defaults](#build-your-own-octokit-with-plugins-and-defaults)
|
||||
- [LICENSE](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
If you need a minimalistic library to utilize GitHub's [REST API](https://developer.github.com/v3/) and [GraphQL API](https://developer.github.com/v4/) which you can extend with plugins as needed, then `@octokit/core` is a great starting point.
|
||||
|
||||
If you don't need the Plugin API then using [`@octokit/request`](https://github.com/octokit/request.js/) or [`@octokit/graphql`](https://github.com/octokit/graphql.js/) directly is a good alternative.
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/core</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/core</code>
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
// or: import { Octokit } from "@octokit/core";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### REST API example
|
||||
|
||||
```js
|
||||
// Create a personal access token at https://github.com/settings/tokens/new?scopes=repo
|
||||
const octokit = new Octokit({ auth: `personal-access-token123` });
|
||||
|
||||
const response = await octokit.request("GET /orgs/{org}/repos", {
|
||||
org: "octokit",
|
||||
type: "private",
|
||||
});
|
||||
```
|
||||
|
||||
See [`@octokit/request`](https://github.com/octokit/request.js) for full documentation of the `.request` method.
|
||||
|
||||
### GraphQL example
|
||||
|
||||
```js
|
||||
const octokit = new Octokit({ auth: `secret123` });
|
||||
|
||||
const response = await octokit.graphql(
|
||||
`query ($login: String!) {
|
||||
organization(login: $login) {
|
||||
repositories(privacy: PRIVATE) {
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}`,
|
||||
{ login: "octokit" }
|
||||
);
|
||||
```
|
||||
|
||||
See [`@octokit/graphql`](https://github.com/octokit/graphql.js) for full documentation of the `.graphql` method.
|
||||
|
||||
## Options
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
name
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.authStrategy</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>Function<code>
|
||||
</td>
|
||||
<td>
|
||||
Defaults to <a href="https://github.com/octokit/auth-token.js#readme"><code>@octokit/auth-token</code></a>. See <a href="#authentication">Authentication</a> below for examples.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.auth</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>String</code> or <code>Object</code>
|
||||
</td>
|
||||
<td>
|
||||
See <a href="#authentication">Authentication</a> below for examples.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.baseUrl</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>String</code>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
When using with GitHub Enterprise Server, set `options.baseUrl` to the root URL of the API. For example, if your GitHub Enterprise Server's hostname is `github.acme-inc.com`, then set `options.baseUrl` to `https://github.acme-inc.com/api/v3`. Example
|
||||
|
||||
```js
|
||||
const octokit = new Octokit({
|
||||
baseUrl: "https://github.acme-inc.com/api/v3",
|
||||
});
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.previews</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>Array of Strings</code>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Some REST API endpoints require preview headers to be set, or enable
|
||||
additional features. Preview headers can be set on a per-request basis, e.g.
|
||||
|
||||
```js
|
||||
octokit.request("POST /repos/{owner}/{repo}/pulls", {
|
||||
mediaType: {
|
||||
previews: ["shadow-cat"],
|
||||
},
|
||||
owner,
|
||||
repo,
|
||||
title: "My pull request",
|
||||
base: "main",
|
||||
head: "my-feature",
|
||||
draft: true,
|
||||
});
|
||||
```
|
||||
|
||||
You can also set previews globally, by setting the `options.previews` option on the constructor. Example:
|
||||
|
||||
```js
|
||||
const octokit = new Octokit({
|
||||
previews: ["shadow-cat"],
|
||||
});
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.request</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>Object</code>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Set a default request timeout (`options.request.timeout`) or an [`http(s).Agent`](https://nodejs.org/api/http.html#http_class_http_agent) e.g. for proxy usage (Node only, `options.request.agent`).
|
||||
|
||||
There are more `options.request.*` options, see [`@octokit/request` options](https://github.com/octokit/request.js#request). `options.request` can also be set on a per-request basis.
|
||||
|
||||
</td></tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.timeZone</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>String</code>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Sets the `Time-Zone` header which defines a timezone according to the [list of names from the Olson database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
||||
|
||||
```js
|
||||
const octokit = new Octokit({
|
||||
timeZone: "America/Los_Angeles",
|
||||
});
|
||||
```
|
||||
|
||||
The time zone header will determine the timezone used for generating the timestamp when creating commits. See [GitHub's Timezones documentation](https://developer.github.com/v3/#timezones).
|
||||
|
||||
</td></tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.userAgent</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>String</code>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
A custom user agent string for your app or library. Example
|
||||
|
||||
```js
|
||||
const octokit = new Octokit({
|
||||
userAgent: "my-app/v1.2.3",
|
||||
});
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Defaults
|
||||
|
||||
You can create a new Octokit class with customized default options.
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.defaults({
|
||||
auth: "personal-access-token123",
|
||||
baseUrl: "https://github.acme-inc.com/api/v3",
|
||||
userAgent: "my-app/v1.2.3",
|
||||
});
|
||||
const octokit1 = new MyOctokit();
|
||||
const octokit2 = new MyOctokit();
|
||||
```
|
||||
|
||||
If you pass additional options to your new constructor, the options will be merged shallowly.
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.defaults({
|
||||
foo: {
|
||||
opt1: 1,
|
||||
},
|
||||
});
|
||||
const octokit = new MyOctokit({
|
||||
foo: {
|
||||
opt2: 1,
|
||||
},
|
||||
});
|
||||
// options will be { foo: { opt2: 1 }}
|
||||
```
|
||||
|
||||
If you need a deep or conditional merge, you can pass a function instead.
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.defaults((options) => {
|
||||
return {
|
||||
foo: Object.assign({}, options.foo, { opt1: 1 }),
|
||||
};
|
||||
});
|
||||
const octokit = new MyOctokit({
|
||||
foo: { opt2: 1 },
|
||||
});
|
||||
// options will be { foo: { opt1: 1, opt2: 1 }}
|
||||
```
|
||||
|
||||
Be careful about mutating the `options` object in the `Octokit.defaults` callback, as it can have unforeseen consequences.
|
||||
|
||||
## Authentication
|
||||
|
||||
Authentication is optional for some REST API endpoints accessing public data, but is required for GraphQL queries. Using authentication also increases your [API rate limit](https://developer.github.com/v3/#rate-limiting).
|
||||
|
||||
By default, Octokit authenticates using the [token authentication strategy](https://github.com/octokit/auth-token.js). Pass in a token using `options.auth`. It can be a personal access token, an OAuth token, an installation access token or a JSON Web Token for GitHub App authentication. The `Authorization` header will be set according to the type of token.
|
||||
|
||||
```js
|
||||
import { Octokit } from "@octokit/core";
|
||||
|
||||
const octokit = new Octokit({
|
||||
auth: "mypersonalaccesstoken123",
|
||||
});
|
||||
|
||||
const { data } = await octokit.request("/user");
|
||||
```
|
||||
|
||||
To use a different authentication strategy, set `options.authStrategy`. A list of authentication strategies is available at [octokit/authentication-strategies.js](https://github.com/octokit/authentication-strategies.js/#readme).
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
import { Octokit } from "@octokit/core";
|
||||
import { createAppAuth } from "@octokit/auth-app";
|
||||
|
||||
const appOctokit = new Octokit({
|
||||
authStrategy: createAppAuth,
|
||||
auth: {
|
||||
appId: 123,
|
||||
privateKey: process.env.PRIVATE_KEY,
|
||||
},
|
||||
});
|
||||
|
||||
const { data } = await appOctokit.request("/app");
|
||||
```
|
||||
|
||||
The `.auth()` method returned by the current authentication strategy can be accessed at `octokit.auth()`. Example
|
||||
|
||||
```js
|
||||
const { token } = await appOctokit.auth({
|
||||
type: "installation",
|
||||
installationId: 123,
|
||||
});
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
There are four built-in log methods
|
||||
|
||||
1. `octokit.log.debug(message[, additionalInfo])`
|
||||
1. `octokit.log.info(message[, additionalInfo])`
|
||||
1. `octokit.log.warn(message[, additionalInfo])`
|
||||
1. `octokit.log.error(message[, additionalInfo])`
|
||||
|
||||
They can be configured using the [`log` client option](client-options). By default, `octokit.log.debug()` and `octokit.log.info()` are no-ops, while the other two call `console.warn()` and `console.error()` respectively.
|
||||
|
||||
This is useful if you build reusable [plugins](#plugins).
|
||||
|
||||
If you would like to make the log level configurable using an environment variable or external option, we recommend the [console-log-level](https://github.com/watson/console-log-level) package. Example
|
||||
|
||||
```js
|
||||
const octokit = new Octokit({
|
||||
log: require("console-log-level")({ level: "info" }),
|
||||
});
|
||||
```
|
||||
|
||||
## Hooks
|
||||
|
||||
You can customize Octokit's request lifecycle with hooks.
|
||||
|
||||
```js
|
||||
octokit.hook.before("request", async (options) => {
|
||||
validate(options);
|
||||
});
|
||||
octokit.hook.after("request", async (response, options) => {
|
||||
console.log(`${options.method} ${options.url}: ${response.status}`);
|
||||
});
|
||||
octokit.hook.error("request", async (error, options) => {
|
||||
if (error.status === 304) {
|
||||
return findInCache(error.response.headers.etag);
|
||||
}
|
||||
|
||||
throw error;
|
||||
});
|
||||
octokit.hook.wrap("request", async (request, options) => {
|
||||
// add logic before, after, catch errors or replace the request altogether
|
||||
return request(options);
|
||||
});
|
||||
```
|
||||
|
||||
See [before-after-hook](https://github.com/gr2m/before-after-hook#readme) for more documentation on hooks.
|
||||
|
||||
## Plugins
|
||||
|
||||
Octokit’s functionality can be extended using plugins. The `Octokit.plugin()` method accepts a plugin (or many) and returns a new constructor.
|
||||
|
||||
A plugin is a function which gets two arguments:
|
||||
|
||||
1. the current instance
|
||||
2. the options passed to the constructor.
|
||||
|
||||
In order to extend `octokit`'s API, the plugin must return an object with the new methods.
|
||||
|
||||
```js
|
||||
// index.js
|
||||
const { Octokit } = require("@octokit/core")
|
||||
const MyOctokit = Octokit.plugin(
|
||||
require("./lib/my-plugin"),
|
||||
require("octokit-plugin-example")
|
||||
);
|
||||
|
||||
const octokit = new MyOctokit({ greeting: "Moin moin" });
|
||||
octokit.helloWorld(); // logs "Moin moin, world!"
|
||||
octokit.request("GET /"); // logs "GET / - 200 in 123ms"
|
||||
|
||||
// lib/my-plugin.js
|
||||
module.exports = (octokit, options = { greeting: "Hello" }) => {
|
||||
// hook into the request lifecycle
|
||||
octokit.hook.wrap("request", async (request, options) => {
|
||||
const time = Date.now();
|
||||
const response = await request(options);
|
||||
console.log(
|
||||
`${options.method} ${options.url} – ${response.status} in ${Date.now() -
|
||||
time}ms`
|
||||
);
|
||||
return response;
|
||||
});
|
||||
|
||||
// add a custom method
|
||||
return {
|
||||
helloWorld: () => console.log(`${options.greeting}, world!`);
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## Build your own Octokit with Plugins and Defaults
|
||||
|
||||
You can build your own Octokit class with preset default options and plugins. In fact, this is mostly how the `@octokit/<context>` modules work, such as [`@octokit/action`](https://github.com/octokit/action.js):
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const MyActionOctokit = Octokit.plugin(
|
||||
require("@octokit/plugin-paginate-rest").paginateRest,
|
||||
require("@octokit/plugin-throttling").throttling,
|
||||
require("@octokit/plugin-retry").retry
|
||||
).defaults({
|
||||
throttle: {
|
||||
onAbuseLimit: (retryAfter, options) => {
|
||||
/* ... */
|
||||
},
|
||||
onRateLimit: (retryAfter, options) => {
|
||||
/* ... */
|
||||
},
|
||||
},
|
||||
authStrategy: require("@octokit/auth-action").createActionAuth,
|
||||
userAgent: `my-octokit-action/v1.2.3`,
|
||||
});
|
||||
|
||||
const octokit = new MyActionOctokit();
|
||||
const installations = await octokit.paginate("GET /app/installations");
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
421
node_modules/@octokit/endpoint/README.md
generated
vendored
421
node_modules/@octokit/endpoint/README.md
generated
vendored
@@ -1,421 +0,0 @@
|
||||
# endpoint.js
|
||||
|
||||
> Turns GitHub REST API endpoints into generic request options
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/endpoint)
|
||||
[](https://github.com/octokit/endpoint.js/actions/workflows/test.yml?query=branch%3Amain)
|
||||
|
||||
`@octokit/endpoint` combines [GitHub REST API routes](https://developer.github.com/v3/) with your parameters and turns them into generic request options that can be used in any request library.
|
||||
|
||||
<!-- update table of contents by running `npx markdown-toc README.md -i` -->
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [API](#api)
|
||||
- [`endpoint(route, options)` or `endpoint(options)`](#endpointroute-options-or-endpointoptions)
|
||||
- [`endpoint.defaults()`](#endpointdefaults)
|
||||
- [`endpoint.DEFAULTS`](#endpointdefaults)
|
||||
- [`endpoint.merge(route, options)` or `endpoint.merge(options)`](#endpointmergeroute-options-or-endpointmergeoptions)
|
||||
- [`endpoint.parse()`](#endpointparse)
|
||||
- [Special cases](#special-cases)
|
||||
- [The `data` parameter – set request body directly](#the-data-parameter-%E2%80%93-set-request-body-directly)
|
||||
- [Set parameters for both the URL/query and the request body](#set-parameters-for-both-the-urlquery-and-the-request-body)
|
||||
- [LICENSE](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/endpoint</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { endpoint } from "https://cdn.skypack.dev/@octokit/endpoint";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/endpoint</code>
|
||||
|
||||
```js
|
||||
const { endpoint } = require("@octokit/endpoint");
|
||||
// or: import { endpoint } from "@octokit/endpoint";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Example for [List organization repositories](https://developer.github.com/v3/repos/#list-organization-repositories)
|
||||
|
||||
```js
|
||||
const requestOptions = endpoint("GET /orgs/{org}/repos", {
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001",
|
||||
},
|
||||
org: "octokit",
|
||||
type: "private",
|
||||
});
|
||||
```
|
||||
|
||||
The resulting `requestOptions` looks as follows
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "GET",
|
||||
"url": "https://api.github.com/orgs/octokit/repos?type=private",
|
||||
"headers": {
|
||||
"accept": "application/vnd.github.v3+json",
|
||||
"authorization": "token 0000000000000000000000000000000000000001",
|
||||
"user-agent": "octokit/endpoint.js v1.2.3"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can pass `requestOptions` to common request libraries
|
||||
|
||||
```js
|
||||
const { url, ...options } = requestOptions;
|
||||
// using with fetch (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
|
||||
fetch(url, options);
|
||||
// using with request (https://github.com/request/request)
|
||||
request(requestOptions);
|
||||
// using with got (https://github.com/sindresorhus/got)
|
||||
got[options.method](url, options);
|
||||
// using with axios
|
||||
axios(requestOptions);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `endpoint(route, options)` or `endpoint(options)`
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
name
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th>
|
||||
<code>route</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
If set, it has to be a string consisting of URL and the request method, e.g., <code>GET /orgs/{org}</code>. If it’s set to a URL, only the method defaults to <code>GET</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.method</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<strong>Required unless <code>route</code> is set.</strong> Any supported <a href="https://developer.github.com/v3/#http-verbs">http verb</a>. <em>Defaults to <code>GET</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.url</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<strong>Required unless <code>route</code> is set.</strong> A path or full URL which may contain <code>:variable</code> or <code>{variable}</code> placeholders,
|
||||
e.g., <code>/orgs/{org}/repos</code>. The <code>url</code> is parsed using <a href="https://github.com/bramstein/url-template">url-template</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.baseUrl</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
<em>Defaults to <code>https://api.github.com</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.headers</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Custom headers. Passed headers are merged with defaults:<br>
|
||||
<em><code>headers['user-agent']</code> defaults to <code>octokit-endpoint.js/1.2.3</code> (where <code>1.2.3</code> is the released version)</em>.<br>
|
||||
<em><code>headers['accept']</code> defaults to <code>application/vnd.github.v3+json</code></em>.<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.mediaType.format</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
Media type param, such as <code>raw</code>, <code>diff</code>, or <code>text+json</code>. See <a href="https://developer.github.com/v3/media/">Media Types</a>. Setting <code>options.mediaType.format</code> will amend the <code>headers.accept</code> value.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.mediaType.previews</code>
|
||||
</th>
|
||||
<td>
|
||||
Array of Strings
|
||||
</td>
|
||||
<td>
|
||||
Name of previews, such as <code>mercy</code>, <code>symmetra</code>, or <code>scarlet-witch</code>. See <a href="https://developer.github.com/v3/previews/">API Previews</a>. If <code>options.mediaType.previews</code> was set as default, the new previews will be merged into the default ones. Setting <code>options.mediaType.previews</code> will amend the <code>headers.accept</code> value. <code>options.mediaType.previews</code> will be merged with an existing array set using <code>.defaults()</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.data</code>
|
||||
</th>
|
||||
<td>
|
||||
Any
|
||||
</td>
|
||||
<td>
|
||||
Set request body directly instead of setting it to JSON based on additional parameters. See <a href="#data-parameter">"The <code>data</code> parameter"</a> below.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<code>options.request</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Pass custom meta information for the request. The <code>request</code> object will be returned as is.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
All other options will be passed depending on the `method` and `url` options.
|
||||
|
||||
1. If the option key has a placeholder in the `url`, it will be used as the replacement. For example, if the passed options are `{url: '/orgs/{org}/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos`.
|
||||
2. If the `method` is `GET` or `HEAD`, the option is passed as a query parameter.
|
||||
3. Otherwise, the parameter is passed in the request body as a JSON key.
|
||||
|
||||
**Result**
|
||||
|
||||
`endpoint()` is a synchronous method and returns an object with the following keys:
|
||||
|
||||
<table>
|
||||
<thead align=left>
|
||||
<tr>
|
||||
<th>
|
||||
key
|
||||
</th>
|
||||
<th>
|
||||
type
|
||||
</th>
|
||||
<th width=100%>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody align=left valign=top>
|
||||
<tr>
|
||||
<th><code>method</code></th>
|
||||
<td>String</td>
|
||||
<td>The http method. Always lowercase.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>url</code></th>
|
||||
<td>String</td>
|
||||
<td>The url with placeholders replaced with passed parameters.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>headers</code></th>
|
||||
<td>Object</td>
|
||||
<td>All header names are lowercased.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>body</code></th>
|
||||
<td>Any</td>
|
||||
<td>The request body if one is present. Only for <code>PATCH</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code> requests.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><code>request</code></th>
|
||||
<td>Object</td>
|
||||
<td>Request meta option, it will be returned as it was passed into <code>endpoint()</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### `endpoint.defaults()`
|
||||
|
||||
Override or set default options. Example:
|
||||
|
||||
```js
|
||||
const request = require("request");
|
||||
const myEndpoint = require("@octokit/endpoint").defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
org: "my-project",
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
request(myEndpoint(`GET /orgs/{org}/repos`));
|
||||
```
|
||||
|
||||
You can call `.defaults()` again on the returned method, the defaults will cascade.
|
||||
|
||||
```js
|
||||
const myProjectEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
},
|
||||
org: "my-project",
|
||||
});
|
||||
const myProjectEndpointWithAuth = myProjectEndpoint.defaults({
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
`myProjectEndpointWithAuth` now defaults the `baseUrl`, `headers['user-agent']`,
|
||||
`org` and `headers['authorization']` on top of `headers['accept']` that is set
|
||||
by the global default.
|
||||
|
||||
### `endpoint.DEFAULTS`
|
||||
|
||||
The current default options.
|
||||
|
||||
```js
|
||||
endpoint.DEFAULTS.baseUrl; // https://api.github.com
|
||||
const myEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
});
|
||||
myEndpoint.DEFAULTS.baseUrl; // https://github-enterprise.acme-inc.com/api/v3
|
||||
```
|
||||
|
||||
### `endpoint.merge(route, options)` or `endpoint.merge(options)`
|
||||
|
||||
Get the defaulted endpoint options, but without parsing them into request options:
|
||||
|
||||
```js
|
||||
const myProjectEndpoint = endpoint.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
},
|
||||
org: "my-project",
|
||||
});
|
||||
myProjectEndpoint.merge("GET /orgs/{org}/repos", {
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
org: "my-secret-project",
|
||||
type: "private",
|
||||
});
|
||||
|
||||
// {
|
||||
// baseUrl: 'https://github-enterprise.acme-inc.com/api/v3',
|
||||
// method: 'GET',
|
||||
// url: '/orgs/{org}/repos',
|
||||
// headers: {
|
||||
// accept: 'application/vnd.github.v3+json',
|
||||
// authorization: `token 0000000000000000000000000000000000000001`,
|
||||
// 'user-agent': 'myApp/1.2.3'
|
||||
// },
|
||||
// org: 'my-secret-project',
|
||||
// type: 'private'
|
||||
// }
|
||||
```
|
||||
|
||||
### `endpoint.parse()`
|
||||
|
||||
Stateless method to turn endpoint options into request options. Calling
|
||||
`endpoint(options)` is the same as calling `endpoint.parse(endpoint.merge(options))`.
|
||||
|
||||
## Special cases
|
||||
|
||||
<a name="data-parameter"></a>
|
||||
|
||||
### The `data` parameter – set request body directly
|
||||
|
||||
Some endpoints such as [Render a Markdown document in raw mode](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode) don’t have parameters that are sent as request body keys, instead, the request body needs to be set directly. In these cases, set the `data` parameter.
|
||||
|
||||
```js
|
||||
const options = endpoint("POST /markdown/raw", {
|
||||
data: "Hello world github/linguist#1 **cool**, and #1!",
|
||||
headers: {
|
||||
accept: "text/html;charset=utf-8",
|
||||
"content-type": "text/plain",
|
||||
},
|
||||
});
|
||||
|
||||
// options is
|
||||
// {
|
||||
// method: 'post',
|
||||
// url: 'https://api.github.com/markdown/raw',
|
||||
// headers: {
|
||||
// accept: 'text/html;charset=utf-8',
|
||||
// 'content-type': 'text/plain',
|
||||
// 'user-agent': userAgent
|
||||
// },
|
||||
// body: 'Hello world github/linguist#1 **cool**, and #1!'
|
||||
// }
|
||||
```
|
||||
|
||||
### Set parameters for both the URL/query and the request body
|
||||
|
||||
There are API endpoints that accept both query parameters as well as a body. In that case, you need to add the query parameters as templates to `options.url`, as defined in the [RFC 6570 URI Template specification](https://tools.ietf.org/html/rfc6570).
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
endpoint(
|
||||
"POST https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
|
||||
{
|
||||
name: "example.zip",
|
||||
label: "short description",
|
||||
headers: {
|
||||
"content-type": "text/plain",
|
||||
"content-length": 14,
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
data: "Hello, world!",
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
409
node_modules/@octokit/graphql/README.md
generated
vendored
409
node_modules/@octokit/graphql/README.md
generated
vendored
@@ -1,409 +0,0 @@
|
||||
# graphql.js
|
||||
|
||||
> GitHub GraphQL API client for browsers and Node
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/graphql)
|
||||
[](https://github.com/octokit/graphql.js/actions?query=workflow%3ATest+branch%3Amain)
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [Send a simple query](#send-a-simple-query)
|
||||
- [Authentication](#authentication)
|
||||
- [Variables](#variables)
|
||||
- [Pass query together with headers and variables](#pass-query-together-with-headers-and-variables)
|
||||
- [Use with GitHub Enterprise](#use-with-github-enterprise)
|
||||
- [Use custom `@octokit/request` instance](#use-custom-octokitrequest-instance)
|
||||
- [TypeScript](#typescript)
|
||||
- [Additional Types](#additional-types)
|
||||
- [Errors](#errors)
|
||||
- [Partial responses](#partial-responses)
|
||||
- [Writing tests](#writing-tests)
|
||||
- [License](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/graphql` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { graphql } from "https://cdn.skypack.dev/@octokit/graphql";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/graphql</code>
|
||||
|
||||
```js
|
||||
const { graphql } = require("@octokit/graphql");
|
||||
// or: import { graphql } from "@octokit/graphql";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### Send a simple query
|
||||
|
||||
```js
|
||||
const { repository } = await graphql(
|
||||
`
|
||||
{
|
||||
repository(owner: "octokit", name: "graphql.js") {
|
||||
issues(last: 3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
{
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
### Authentication
|
||||
|
||||
The simplest way to authenticate a request is to set the `Authorization` header, e.g. to a [personal access token](https://github.com/settings/tokens/).
|
||||
|
||||
```js
|
||||
const graphqlWithAuth = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const { repository } = await graphqlWithAuth(`
|
||||
{
|
||||
repository(owner: "octokit", name: "graphql.js") {
|
||||
issues(last: 3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
```
|
||||
|
||||
For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by [`@octokit/auth`](https://github.com/octokit/auth.js).
|
||||
|
||||
```js
|
||||
const { createAppAuth } = require("@octokit/auth-app");
|
||||
const auth = createAppAuth({
|
||||
appId: process.env.APP_ID,
|
||||
privateKey: process.env.PRIVATE_KEY,
|
||||
installationId: 123,
|
||||
});
|
||||
const graphqlWithAuth = graphql.defaults({
|
||||
request: {
|
||||
hook: auth.hook,
|
||||
},
|
||||
});
|
||||
|
||||
const { repository } = await graphqlWithAuth(
|
||||
`{
|
||||
repository(owner: "octokit", name: "graphql.js") {
|
||||
issues(last: 3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
);
|
||||
```
|
||||
|
||||
### Variables
|
||||
|
||||
⚠️ Do not use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the query strings as they make your code vulnerable to query injection attacks (see [#2](https://github.com/octokit/graphql.js/issues/2)). Use variables instead:
|
||||
|
||||
```js
|
||||
const { lastIssues } = await graphql(
|
||||
`
|
||||
query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
issues(last: $num) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
{
|
||||
owner: "octokit",
|
||||
repo: "graphql.js",
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
### Pass query together with headers and variables
|
||||
|
||||
```js
|
||||
const { graphql } = require("@octokit/graphql");
|
||||
const { lastIssues } = await graphql({
|
||||
query: `query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
|
||||
repository(owner:$owner, name:$repo) {
|
||||
issues(last:$num) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`,
|
||||
owner: "octokit",
|
||||
repo: "graphql.js",
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Use with GitHub Enterprise
|
||||
|
||||
```js
|
||||
let { graphql } = require("@octokit/graphql");
|
||||
graphql = graphql.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api",
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const { repository } = await graphql(`
|
||||
{
|
||||
repository(owner: "acme-project", name: "acme-repo") {
|
||||
issues(last: 3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
```
|
||||
|
||||
### Use custom `@octokit/request` instance
|
||||
|
||||
```js
|
||||
const { request } = require("@octokit/request");
|
||||
const { withCustomRequest } = require("@octokit/graphql");
|
||||
|
||||
let requestCounter = 0;
|
||||
const myRequest = request.defaults({
|
||||
headers: {
|
||||
authorization: "bearer secret123",
|
||||
},
|
||||
request: {
|
||||
hook(request, options) {
|
||||
requestCounter++;
|
||||
return request(options);
|
||||
},
|
||||
},
|
||||
});
|
||||
const myGraphql = withCustomRequest(myRequest);
|
||||
await request("/");
|
||||
await myGraphql(`
|
||||
{
|
||||
repository(owner: "acme-project", name: "acme-repo") {
|
||||
issues(last: 3) {
|
||||
edges {
|
||||
node {
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
// requestCounter is now 2
|
||||
```
|
||||
|
||||
## TypeScript
|
||||
|
||||
`@octokit/graphql` is exposing proper types for its usage with TypeScript projects.
|
||||
|
||||
### Additional Types
|
||||
|
||||
Additionally, `GraphQlQueryResponseData` has been exposed to users:
|
||||
|
||||
```ts
|
||||
import type { GraphQlQueryResponseData } from "@octokit/graphql";
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
In case of a GraphQL error, `error.message` is set to a combined message describing all errors returned by the endpoint.
|
||||
All errors can be accessed at `error.errors`. `error.request` has the request options such as query, variables and headers set for easier debugging.
|
||||
|
||||
```js
|
||||
let { graphql, GraphqlResponseError } = require("@octokit/graphql");
|
||||
graphql = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const query = `{
|
||||
viewer {
|
||||
bioHtml
|
||||
}
|
||||
}`;
|
||||
|
||||
try {
|
||||
const result = await graphql(query);
|
||||
} catch (error) {
|
||||
if (error instanceof GraphqlResponseError) {
|
||||
// do something with the error, allowing you to detect a graphql response error,
|
||||
// compared to accidentally catching unrelated errors.
|
||||
|
||||
// server responds with an object like the following (as an example)
|
||||
// class GraphqlResponseError {
|
||||
// "headers": {
|
||||
// "status": "403",
|
||||
// },
|
||||
// "data": null,
|
||||
// "errors": [{
|
||||
// "message": "Field 'bioHtml' doesn't exist on type 'User'",
|
||||
// "locations": [{
|
||||
// "line": 3,
|
||||
// "column": 5
|
||||
// }]
|
||||
// }]
|
||||
// }
|
||||
|
||||
console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } }
|
||||
console.log(error.message); // Field 'bioHtml' doesn't exist on type 'User'
|
||||
} else {
|
||||
// handle non-GraphQL error
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Partial responses
|
||||
|
||||
A GraphQL query may respond with partial data accompanied by errors. In this case we will throw an error but the partial data will still be accessible through `error.data`
|
||||
|
||||
```js
|
||||
let { graphql } = require("@octokit/graphql");
|
||||
graphql = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token secret123`,
|
||||
},
|
||||
});
|
||||
const query = `{
|
||||
repository(name: "probot", owner: "probot") {
|
||||
name
|
||||
ref(qualifiedName: "master") {
|
||||
target {
|
||||
... on Commit {
|
||||
history(first: 25, after: "invalid cursor") {
|
||||
nodes {
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`;
|
||||
|
||||
try {
|
||||
const result = await graphql(query);
|
||||
} catch (error) {
|
||||
// server responds with
|
||||
// {
|
||||
// "data": {
|
||||
// "repository": {
|
||||
// "name": "probot",
|
||||
// "ref": null
|
||||
// }
|
||||
// },
|
||||
// "errors": [
|
||||
// {
|
||||
// "type": "INVALID_CURSOR_ARGUMENTS",
|
||||
// "path": [
|
||||
// "repository",
|
||||
// "ref",
|
||||
// "target",
|
||||
// "history"
|
||||
// ],
|
||||
// "locations": [
|
||||
// {
|
||||
// "line": 7,
|
||||
// "column": 11
|
||||
// }
|
||||
// ],
|
||||
// "message": "`invalid cursor` does not appear to be a valid cursor."
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
|
||||
console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } }
|
||||
console.log(error.message); // `invalid cursor` does not appear to be a valid cursor.
|
||||
console.log(error.data); // { repository: { name: 'probot', ref: null } }
|
||||
}
|
||||
```
|
||||
|
||||
## Writing tests
|
||||
|
||||
You can pass a replacement for [the built-in fetch implementation](https://github.com/bitinn/node-fetch) as `request.fetch` option. For example, using [fetch-mock](http://www.wheresrhys.co.uk/fetch-mock/) works great to write tests
|
||||
|
||||
```js
|
||||
const assert = require("assert");
|
||||
const fetchMock = require("fetch-mock/es5/server");
|
||||
|
||||
const { graphql } = require("@octokit/graphql");
|
||||
|
||||
graphql("{ viewer { login } }", {
|
||||
headers: {
|
||||
authorization: "token secret123",
|
||||
},
|
||||
request: {
|
||||
fetch: fetchMock
|
||||
.sandbox()
|
||||
.post("https://api.github.com/graphql", (url, options) => {
|
||||
assert.strictEqual(options.headers.authorization, "token secret123");
|
||||
assert.strictEqual(
|
||||
options.body,
|
||||
'{"query":"{ viewer { login } }"}',
|
||||
"Sends correct query"
|
||||
);
|
||||
return { data: {} };
|
||||
}),
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
17
node_modules/@octokit/openapi-types/README.md
generated
vendored
17
node_modules/@octokit/openapi-types/README.md
generated
vendored
@@ -1,17 +0,0 @@
|
||||
# @octokit/openapi-types
|
||||
|
||||
> Generated TypeScript definitions based on GitHub's OpenAPI spec
|
||||
|
||||
This package is continously updated based on [GitHub's OpenAPI specification](https://github.com/github/rest-api-description/)
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { components } from "@octokit/openapi-types";
|
||||
|
||||
type Repository = components["schemas"]["full-repository"];
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
269
node_modules/@octokit/plugin-paginate-rest/README.md
generated
vendored
269
node_modules/@octokit/plugin-paginate-rest/README.md
generated
vendored
@@ -1,269 +0,0 @@
|
||||
# plugin-paginate-rest.js
|
||||
|
||||
> Octokit plugin to paginate REST API endpoint responses
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/plugin-paginate-rest)
|
||||
[](https://github.com/octokit/plugin-paginate-rest.js/actions?workflow=Test)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
|
||||
import {
|
||||
paginateRest,
|
||||
composePaginateRest,
|
||||
} from "https://cdn.skypack.dev/@octokit/plugin-paginate-rest";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with `npm install @octokit/core @octokit/plugin-paginate-rest`. Optionally replace `@octokit/core` with a core-compatible module
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const {
|
||||
paginateRest,
|
||||
composePaginateRest,
|
||||
} = require("@octokit/plugin-paginate-rest");
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.plugin(paginateRest);
|
||||
const octokit = new MyOctokit({ auth: "secret123" });
|
||||
|
||||
// See https://developer.github.com/v3/issues/#list-issues-for-a-repository
|
||||
const issues = await octokit.paginate("GET /repos/{owner}/{repo}/issues", {
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
});
|
||||
```
|
||||
|
||||
If you want to utilize the pagination methods in another plugin, use `composePaginateRest`.
|
||||
|
||||
```js
|
||||
function myPlugin(octokit, options) {
|
||||
return {
|
||||
allStars({owner, repo}) => {
|
||||
return composePaginateRest(
|
||||
octokit,
|
||||
"GET /repos/{owner}/{repo}/stargazers",
|
||||
{owner, repo }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## `octokit.paginate()`
|
||||
|
||||
The `paginateRest` plugin adds a new `octokit.paginate()` method which accepts the same parameters as [`octokit.request`](https://github.com/octokit/request.js#request). Only "List ..." endpoints such as [List issues for a repository](https://developer.github.com/v3/issues/#list-issues-for-a-repository) are supporting pagination. Their [response includes a Link header](https://developer.github.com/v3/issues/#response-1). For other endpoints, `octokit.paginate()` behaves the same as `octokit.request()`.
|
||||
|
||||
The `per_page` parameter is usually defaulting to `30`, and can be set to up to `100`, which helps retrieving a big amount of data without hitting the rate limits too soon.
|
||||
|
||||
An optional `mapFunction` can be passed to map each page response to a new value, usually an array with only the data you need. This can help to reduce memory usage, as only the relevant data has to be kept in memory until the pagination is complete.
|
||||
|
||||
```js
|
||||
const issueTitles = await octokit.paginate(
|
||||
"GET /repos/{owner}/{repo}/issues",
|
||||
{
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
},
|
||||
(response) => response.data.map((issue) => issue.title)
|
||||
);
|
||||
```
|
||||
|
||||
The `mapFunction` gets a 2nd argument `done` which can be called to end the pagination early.
|
||||
|
||||
```js
|
||||
const issues = await octokit.paginate(
|
||||
"GET /repos/{owner}/{repo}/issues",
|
||||
{
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
},
|
||||
(response, done) => {
|
||||
if (response.data.find((issue) => issue.title.includes("something"))) {
|
||||
done();
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
Alternatively you can pass a `request` method as first argument. This is great when using in combination with [`@octokit/plugin-rest-endpoint-methods`](https://github.com/octokit/plugin-rest-endpoint-methods.js/):
|
||||
|
||||
```js
|
||||
const issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
});
|
||||
```
|
||||
|
||||
## `octokit.paginate.iterator()`
|
||||
|
||||
If your target runtime environments supports async iterators (such as most modern browsers and Node 10+), you can iterate through each response
|
||||
|
||||
```js
|
||||
const parameters = {
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
};
|
||||
for await (const response of octokit.paginate.iterator(
|
||||
"GET /repos/{owner}/{repo}/issues",
|
||||
parameters
|
||||
)) {
|
||||
// do whatever you want with each response, break out of the loop, etc.
|
||||
const issues = response.data;
|
||||
console.log("%d issues found", issues.length);
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively you can pass a `request` method as first argument. This is great when using in combination with [`@octokit/plugin-rest-endpoint-methods`](https://github.com/octokit/plugin-rest-endpoint-methods.js/):
|
||||
|
||||
```js
|
||||
const parameters = {
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
};
|
||||
for await (const response of octokit.paginate.iterator(
|
||||
octokit.rest.issues.listForRepo,
|
||||
parameters
|
||||
)) {
|
||||
// do whatever you want with each response, break out of the loop, etc.
|
||||
const issues = response.data;
|
||||
console.log("%d issues found", issues.length);
|
||||
}
|
||||
```
|
||||
|
||||
## `composePaginateRest` and `composePaginateRest.iterator`
|
||||
|
||||
The `compose*` methods work just like their `octokit.*` counterparts described above, with the differenct that both methods require an `octokit` instance to be passed as first argument
|
||||
|
||||
## How it works
|
||||
|
||||
`octokit.paginate()` wraps `octokit.request()`. As long as a `rel="next"` link value is present in the response's `Link` header, it sends another request for that URL, and so on.
|
||||
|
||||
Most of GitHub's paginating REST API endpoints return an array, but there are a few exceptions which return an object with a key that includes the items array. For example:
|
||||
|
||||
- [Search repositories](https://developer.github.com/v3/search/#example) (key `items`)
|
||||
- [List check runs for a specific ref](https://developer.github.com/v3/checks/runs/#response-3) (key: `check_runs`)
|
||||
- [List check suites for a specific ref](https://developer.github.com/v3/checks/suites/#response-1) (key: `check_suites`)
|
||||
- [List repositories](https://developer.github.com/v3/apps/installations/#list-repositories) for an installation (key: `repositories`)
|
||||
- [List installations for a user](https://developer.github.com/v3/apps/installations/#response-1) (key `installations`)
|
||||
|
||||
`octokit.paginate()` is working around these inconsistencies so you don't have to worry about it.
|
||||
|
||||
If a response is lacking the `Link` header, `octokit.paginate()` still resolves with an array, even if the response returns a single object.
|
||||
|
||||
## Types
|
||||
|
||||
The plugin also exposes some types and runtime type guards for TypeScript projects.
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Types
|
||||
</th><td>
|
||||
|
||||
```typescript
|
||||
import {
|
||||
PaginateInterface,
|
||||
PaginatingEndpoints,
|
||||
} from "@octokit/plugin-paginate-rest";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Guards
|
||||
</th><td>
|
||||
|
||||
```typescript
|
||||
import { isPaginatingEndpoint } from "@octokit/plugin-paginate-rest";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### PaginateInterface
|
||||
|
||||
An `interface` that declares all the overloads of the `.paginate` method.
|
||||
|
||||
### PaginatingEndpoints
|
||||
|
||||
An `interface` which describes all API endpoints supported by the plugin. Some overloads of `.paginate()` method and `composePaginateRest()` function depend on `PaginatingEndpoints`, using the `keyof PaginatingEndpoints` as a type for one of its arguments.
|
||||
|
||||
```typescript
|
||||
import { Octokit } from "@octokit/core";
|
||||
import {
|
||||
PaginatingEndpoints,
|
||||
composePaginateRest,
|
||||
} from "@octokit/plugin-paginate-rest";
|
||||
|
||||
type DataType<T> = "data" extends keyof T ? T["data"] : unknown;
|
||||
|
||||
async function myPaginatePlugin<E extends keyof PaginatingEndpoints>(
|
||||
octokit: Octokit,
|
||||
endpoint: E,
|
||||
parameters?: PaginatingEndpoints[E]["parameters"]
|
||||
): Promise<DataType<PaginatingEndpoints[E]["response"]>> {
|
||||
return await composePaginateRest(octokit, endpoint, parameters);
|
||||
}
|
||||
```
|
||||
|
||||
### isPaginatingEndpoint
|
||||
|
||||
A type guard, `isPaginatingEndpoint(arg)` returns `true` if `arg` is one of the keys in `PaginatingEndpoints` (is `keyof PaginatingEndpoints`).
|
||||
|
||||
```typescript
|
||||
import { Octokit } from "@octokit/core";
|
||||
import {
|
||||
isPaginatingEndpoint,
|
||||
composePaginateRest,
|
||||
} from "@octokit/plugin-paginate-rest";
|
||||
|
||||
async function myPlugin(octokit: Octokit, arg: unknown) {
|
||||
if (isPaginatingEndpoint(arg)) {
|
||||
return await composePaginateRest(octokit, arg);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
69
node_modules/@octokit/plugin-request-log/README.md
generated
vendored
69
node_modules/@octokit/plugin-request-log/README.md
generated
vendored
@@ -1,69 +0,0 @@
|
||||
# plugin-request-log.js
|
||||
|
||||
> Log all requests and request errors
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/plugin-request-log)
|
||||
[](https://github.com/octokit/plugin-request-log.js/actions?workflow=Test)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-request-log` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
|
||||
import { requestLog } from "https://cdn.skypack.dev/@octokit/plugin-request-log";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with `npm install @octokit/core @octokit/plugin-request-log`. Optionally replace `@octokit/core` with a core-compatible module
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const { requestLog } = require("@octokit/plugin-request-log");
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.plugin(requestLog);
|
||||
const octokit = new MyOctokit({ auth: "secret123" });
|
||||
|
||||
octokit.request("GET /");
|
||||
// logs "GET / - 200 in 123ms
|
||||
|
||||
octokit.request("GET /oops");
|
||||
// logs "GET / - 404 in 123ms
|
||||
```
|
||||
|
||||
In order to log all request options, the `log.debug` option needs to be set. We recommend the [console-log-level](https://github.com/watson/console-log-level) package for a configurable log level
|
||||
|
||||
```js
|
||||
const octokit = new MyOctokit({
|
||||
log: require("console-log-level")({
|
||||
auth: "secret123",
|
||||
level: "info",
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
76
node_modules/@octokit/plugin-rest-endpoint-methods/README.md
generated
vendored
76
node_modules/@octokit/plugin-rest-endpoint-methods/README.md
generated
vendored
@@ -1,76 +0,0 @@
|
||||
# plugin-rest-endpoint-methods.js
|
||||
|
||||
> Octokit plugin adding one method for all of api.github.com REST API endpoints
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/plugin-rest-endpoint-methods)
|
||||
[](https://github.com/octokit/plugin-rest-endpoint-methods.js/actions?workflow=Test)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-rest-endpoint-methods` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
|
||||
import { restEndpointMethods } from "https://cdn.skypack.dev/@octokit/plugin-rest-endpoint-methods";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with `npm install @octokit/core @octokit/plugin-rest-endpoint-methods`. Optionally replace `@octokit/core` with a compatible module
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/core");
|
||||
const {
|
||||
restEndpointMethods,
|
||||
} = require("@octokit/plugin-rest-endpoint-methods");
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const MyOctokit = Octokit.plugin(restEndpointMethods);
|
||||
const octokit = new MyOctokit({ auth: "secret123" });
|
||||
|
||||
// https://developer.github.com/v3/users/#get-the-authenticated-user
|
||||
octokit.rest.users.getAuthenticated();
|
||||
```
|
||||
|
||||
There is one method for each REST API endpoint documented at [https://developer.github.com/v3](https://developer.github.com/v3). All endpoint methods are documented in the [docs/](docs/) folder, e.g. [docs/users/getAuthenticated.md](docs/users/getAuthenticated.md)
|
||||
|
||||
## TypeScript
|
||||
|
||||
Parameter and response types for all endpoint methods exported as `{ RestEndpointMethodTypes }`.
|
||||
|
||||
Example
|
||||
|
||||
```ts
|
||||
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
|
||||
|
||||
type UpdateLabelParameters =
|
||||
RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
|
||||
type UpdateLabelResponse =
|
||||
RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
|
||||
```
|
||||
|
||||
In order to get types beyond parameters and responses, check out [`@octokit/openapi-types`](https://github.com/octokit/openapi-types.ts/#readme), which is a direct transpilation from GitHub's official OpenAPI specification.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
71
node_modules/@octokit/request-error/README.md
generated
vendored
71
node_modules/@octokit/request-error/README.md
generated
vendored
@@ -1,71 +0,0 @@
|
||||
# http-error.js
|
||||
|
||||
> Error class for Octokit request errors
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/request-error)
|
||||
[](https://github.com/octokit/request-error.js/actions?query=workflow%3ATest)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/request-error</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { RequestError } from "https://cdn.skypack.dev/@octokit/request-error";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/request-error</code>
|
||||
|
||||
```js
|
||||
const { RequestError } = require("@octokit/request-error");
|
||||
// or: import { RequestError } from "@octokit/request-error";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const error = new RequestError("Oops", 500, {
|
||||
request: {
|
||||
method: "POST",
|
||||
url: "https://api.github.com/foo",
|
||||
body: {
|
||||
bar: "baz",
|
||||
},
|
||||
headers: {
|
||||
authorization: "token secret123",
|
||||
},
|
||||
},
|
||||
response: {
|
||||
status: 500,
|
||||
url: "https://api.github.com/foo",
|
||||
headers: {
|
||||
"x-github-request-id": "1:2:3:4",
|
||||
},
|
||||
data: {
|
||||
foo: "bar",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
error.message; // Oops
|
||||
error.status; // 500
|
||||
error.request; // { method, url, headers, body }
|
||||
error.response; // { url, status, headers, data }
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
553
node_modules/@octokit/request/README.md
generated
vendored
553
node_modules/@octokit/request/README.md
generated
vendored
@@ -1,553 +0,0 @@
|
||||
# request.js
|
||||
|
||||
> Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/request)
|
||||
[](https://github.com/octokit/request.js/actions?query=workflow%3ATest+branch%3Amain)
|
||||
|
||||
`@octokit/request` is a request library for browsers & node that makes it easier
|
||||
to interact with [GitHub’s REST API](https://developer.github.com/v3/) and
|
||||
[GitHub’s GraphQL API](https://developer.github.com/v4/guides/forming-calls/#the-graphql-endpoint).
|
||||
|
||||
It uses [`@octokit/endpoint`](https://github.com/octokit/endpoint.js) to parse
|
||||
the passed options and sends the request using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
|
||||
([node-fetch](https://github.com/bitinn/node-fetch) when the runtime has no native `fetch` API).
|
||||
|
||||
<!-- update table of contents by running `npx markdown-toc README.md -i` -->
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Features](#features)
|
||||
- [Usage](#usage)
|
||||
- [REST API example](#rest-api-example)
|
||||
- [GraphQL example](#graphql-example)
|
||||
- [Alternative: pass `method` & `url` as part of options](#alternative-pass-method--url-as-part-of-options)
|
||||
- [Authentication](#authentication)
|
||||
- [request()](#request)
|
||||
- [`request.defaults()`](#requestdefaults)
|
||||
- [`request.endpoint`](#requestendpoint)
|
||||
- [Special cases](#special-cases)
|
||||
- [The `data` parameter – set request body directly](#the-data-parameter--set-request-body-directly)
|
||||
- [Set parameters for both the URL/query and the request body](#set-parameters-for-both-the-urlquery-and-the-request-body)
|
||||
- [LICENSE](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Features
|
||||
|
||||
🤩 1:1 mapping of REST API endpoint documentation, e.g. [Add labels to an issue](https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue) becomes
|
||||
|
||||
```js
|
||||
request("POST /repos/{owner}/{repo}/issues/{number}/labels", {
|
||||
mediaType: {
|
||||
previews: ["symmetra"],
|
||||
},
|
||||
owner: "octokit",
|
||||
repo: "request.js",
|
||||
number: 1,
|
||||
labels: ["🐛 bug"],
|
||||
});
|
||||
```
|
||||
|
||||
👶 [Small bundle size](https://bundlephobia.com/result?p=@octokit/request@5.0.3) (\<4kb minified + gzipped)
|
||||
|
||||
😎 [Authenticate](#authentication) with any of [GitHubs Authentication Strategies](https://github.com/octokit/auth.js).
|
||||
|
||||
👍 Sensible defaults
|
||||
|
||||
- `baseUrl`: `https://api.github.com`
|
||||
- `headers.accept`: `application/vnd.github.v3+json`
|
||||
- `headers.agent`: `octokit-request.js/<current version> <OS information>`, e.g. `octokit-request.js/1.2.3 Node.js/10.15.0 (macOS Mojave; x64)`
|
||||
|
||||
👌 Simple to test: mock requests by passing a custom fetch method.
|
||||
|
||||
🧐 Simple to debug: Sets `error.request` to request options causing the error (with redacted credentials).
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/request</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { request } from "https://cdn.skypack.dev/@octokit/request";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/request</code>
|
||||
|
||||
```js
|
||||
const { request } = require("@octokit/request");
|
||||
// or: import { request } from "@octokit/request";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### REST API example
|
||||
|
||||
```js
|
||||
// Following GitHub docs formatting:
|
||||
// https://developer.github.com/v3/repos/#list-organization-repositories
|
||||
const result = await request("GET /orgs/{org}/repos", {
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001",
|
||||
},
|
||||
org: "octokit",
|
||||
type: "private",
|
||||
});
|
||||
|
||||
console.log(`${result.data.length} repos found.`);
|
||||
```
|
||||
|
||||
### GraphQL example
|
||||
|
||||
For GraphQL request we recommend using [`@octokit/graphql`](https://github.com/octokit/graphql.js#readme)
|
||||
|
||||
```js
|
||||
const result = await request("POST /graphql", {
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001",
|
||||
},
|
||||
query: `query ($login: String!) {
|
||||
organization(login: $login) {
|
||||
repositories(privacy: PRIVATE) {
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}`,
|
||||
variables: {
|
||||
login: "octokit",
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Alternative: pass `method` & `url` as part of options
|
||||
|
||||
Alternatively, pass in a method and a url
|
||||
|
||||
```js
|
||||
const result = await request({
|
||||
method: "GET",
|
||||
url: "/orgs/{org}/repos",
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001",
|
||||
},
|
||||
org: "octokit",
|
||||
type: "private",
|
||||
});
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
The simplest way to authenticate a request is to set the `Authorization` header directly, e.g. to a [personal access token](https://github.com/settings/tokens/).
|
||||
|
||||
```js
|
||||
const requestWithAuth = request.defaults({
|
||||
headers: {
|
||||
authorization: "token 0000000000000000000000000000000000000001",
|
||||
},
|
||||
});
|
||||
const result = await requestWithAuth("GET /user");
|
||||
```
|
||||
|
||||
For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by [`@octokit/auth`](https://github.com/octokit/auth.js).
|
||||
|
||||
```js
|
||||
const { createAppAuth } = require("@octokit/auth-app");
|
||||
const auth = createAppAuth({
|
||||
appId: process.env.APP_ID,
|
||||
privateKey: process.env.PRIVATE_KEY,
|
||||
installationId: 123,
|
||||
});
|
||||
const requestWithAuth = request.defaults({
|
||||
request: {
|
||||
hook: auth.hook,
|
||||
},
|
||||
mediaType: {
|
||||
previews: ["machine-man"],
|
||||
},
|
||||
});
|
||||
|
||||
const { data: app } = await requestWithAuth("GET /app");
|
||||
const { data: app } = await requestWithAuth(
|
||||
"POST /repos/{owner}/{repo}/issues",
|
||||
{
|
||||
owner: "octocat",
|
||||
repo: "hello-world",
|
||||
title: "Hello from the engine room",
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## request()
|
||||
|
||||
`request(route, options)` or `request(options)`.
|
||||
|
||||
**Options**
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align=left>
|
||||
name
|
||||
</th>
|
||||
<th align=left>
|
||||
type
|
||||
</th>
|
||||
<th align=left>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>route</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
**Required**. If <code>route</code> is set it has to be a string consisting of the request method and URL, e.g. <code>GET /orgs/{org}</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.baseUrl</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
The base URL that <code>route</code> or <code>url</code> will be prefixed with, if they use relative paths. <em>Defaults to <code>https://api.github.com</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<th align=left>
|
||||
<code>options.headers</code>
|
||||
</th>
|
||||
<td>
|
||||
Object
|
||||
</td>
|
||||
<td>
|
||||
Custom headers. Passed headers are merged with defaults:<br>
|
||||
<em><code>headers['user-agent']</code> defaults to <code>octokit-rest.js/1.2.3</code> (where <code>1.2.3</code> is the released version)</em>.<br>
|
||||
<em><code>headers['accept']</code> defaults to <code>application/vnd.github.v3+json</code>.<br> Use <code>options.mediaType.{format,previews}</code> to request API previews and custom media types.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.mediaType.format</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
Media type param, such as `raw`, `html`, or `full`. See <a href="https://developer.github.com/v3/media/">Media Types</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.mediaType.previews</code>
|
||||
</th>
|
||||
<td>
|
||||
Array of strings
|
||||
</td>
|
||||
<td>
|
||||
Name of previews, such as `mercy`, `symmetra`, or `scarlet-witch`. See <a href="https://developer.github.com/v3/previews/">API Previews</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.method</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
Any supported <a href="https://developer.github.com/v3/#http-verbs">http verb</a>, case insensitive. <em>Defaults to <code>Get</code></em>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.url</code>
|
||||
</th>
|
||||
<td>
|
||||
String
|
||||
</td>
|
||||
<td>
|
||||
**Required**. A path or full URL which may contain <code>:variable</code> or <code>{variable}</code> placeholders,
|
||||
e.g. <code>/orgs/{org}/repos</code>. The <code>url</code> is parsed using <a href="https://github.com/bramstein/url-template">url-template</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.data</code>
|
||||
</th>
|
||||
<td>
|
||||
Any
|
||||
</td>
|
||||
<td>
|
||||
Set request body directly instead of setting it to JSON based on additional parameters. See <a href="#data-parameter">"The `data` parameter"</a> below.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.request.agent</code>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://nodejs.org/api/http.html#http_class_http_agent">http(s).Agent</a> instance
|
||||
</td>
|
||||
<td>
|
||||
Node only. Useful for custom proxy, certificate, or dns lookup.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.request.fetch</code>
|
||||
</th>
|
||||
<td>
|
||||
Function
|
||||
</td>
|
||||
<td>
|
||||
Custom replacement for <a href="https://github.com/bitinn/node-fetch">built-in fetch method</a>. Useful for testing or request hooks.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.request.hook</code>
|
||||
</th>
|
||||
<td>
|
||||
Function
|
||||
</td>
|
||||
<td>
|
||||
Function with the signature <code>hook(request, endpointOptions)</code>, where <code>endpointOptions</code> are the parsed options as returned by <a href="https://github.com/octokit/endpoint.js#endpointmergeroute-options-or-endpointmergeoptions"><code>endpoint.merge()</code></a>, and <code>request</code> is <a href="https://github.com/octokit/request.js#request"><code>request()</code></a>. This option works great in conjuction with <a href="https://github.com/gr2m/before-after-hook">before-after-hook</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<a name="options-request-signal"></a><code>options.request.signal</code>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://github.com/bitinn/node-fetch/tree/e996bdab73baf996cf2dbf25643c8fe2698c3249#request-cancellation-with-abortsignal">new AbortController().signal</a>
|
||||
</td>
|
||||
<td>
|
||||
Use an <code>AbortController</code> instance to cancel a request. In node you can only cancel streamed requests.
|
||||
</td>
|
||||
</tr>
|
||||
<th align=left>
|
||||
<code>options.request.log</code>
|
||||
</th>
|
||||
<td>
|
||||
<code>object</code>
|
||||
</td>
|
||||
<td>
|
||||
Used for internal logging. Defaults to <a href="https://developer.mozilla.org/en-US/docs/Web/API/console"><code>console</code></a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left>
|
||||
<code>options.request.timeout</code>
|
||||
</th>
|
||||
<td>
|
||||
Number
|
||||
</td>
|
||||
<td>
|
||||
Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). <a href="#options-request-signal">options.request.signal</a> is recommended instead.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
All other options except `options.request.*` will be passed depending on the `method` and `url` options.
|
||||
|
||||
1. If the option key is a placeholder in the `url`, it will be used as replacement. For example, if the passed options are `{url: '/orgs/{org}/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos`
|
||||
2. If the `method` is `GET` or `HEAD`, the option is passed as query parameter
|
||||
3. Otherwise the parameter is passed in the request body as JSON key.
|
||||
|
||||
**Result**
|
||||
|
||||
`request` returns a promise. If the request was successful, the promise resolves with an object containing 4 keys:
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align=left>
|
||||
key
|
||||
</th>
|
||||
<th align=left>
|
||||
type
|
||||
</th>
|
||||
<th align=left>
|
||||
description
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align=left><code>status</code></th>
|
||||
<td>Integer</td>
|
||||
<td>Response status status</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left><code>url</code></th>
|
||||
<td>String</td>
|
||||
<td>URL of response. If a request results in redirects, this is the final URL. You can send a <code>HEAD</code> request to retrieve it without loading the full response body.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left><code>headers</code></th>
|
||||
<td>Object</td>
|
||||
<td>All response headers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align=left><code>data</code></th>
|
||||
<td>Any</td>
|
||||
<td>The response body as returned from server. If the response is JSON then it will be parsed into an object</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
If an error occurs, the promise is rejected with an `error` object containing 3 keys to help with debugging:
|
||||
|
||||
- `error.status` The http response status code
|
||||
- `error.request` The request options such as `method`, `url` and `data`
|
||||
- `error.response` The http response object with `url`, `headers`, and `data`
|
||||
|
||||
If the error is due to an `AbortSignal` being used, the resulting `AbortError` is bubbled up to the caller.
|
||||
|
||||
## `request.defaults()`
|
||||
|
||||
Override or set default options. Example:
|
||||
|
||||
```js
|
||||
const myrequest = require("@octokit/request").defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
org: "my-project",
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
myrequest(`GET /orgs/{org}/repos`);
|
||||
```
|
||||
|
||||
You can call `.defaults()` again on the returned method, the defaults will cascade.
|
||||
|
||||
```js
|
||||
const myProjectRequest = request.defaults({
|
||||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
|
||||
headers: {
|
||||
"user-agent": "myApp/1.2.3",
|
||||
},
|
||||
org: "my-project",
|
||||
});
|
||||
const myProjectRequestWithAuth = myProjectRequest.defaults({
|
||||
headers: {
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
`myProjectRequest` now defaults the `baseUrl`, `headers['user-agent']`,
|
||||
`org` and `headers['authorization']` on top of `headers['accept']` that is set
|
||||
by the global default.
|
||||
|
||||
## `request.endpoint`
|
||||
|
||||
See https://github.com/octokit/endpoint.js. Example
|
||||
|
||||
```js
|
||||
const options = request.endpoint("GET /orgs/{org}/repos", {
|
||||
org: "my-project",
|
||||
type: "private",
|
||||
});
|
||||
|
||||
// {
|
||||
// method: 'GET',
|
||||
// url: 'https://api.github.com/orgs/my-project/repos?type=private',
|
||||
// headers: {
|
||||
// accept: 'application/vnd.github.v3+json',
|
||||
// authorization: 'token 0000000000000000000000000000000000000001',
|
||||
// 'user-agent': 'octokit/endpoint.js v1.2.3'
|
||||
// }
|
||||
// }
|
||||
```
|
||||
|
||||
All of the [`@octokit/endpoint`](https://github.com/octokit/endpoint.js) API can be used:
|
||||
|
||||
- [`octokitRequest.endpoint()`](#endpoint)
|
||||
- [`octokitRequest.endpoint.defaults()`](#endpointdefaults)
|
||||
- [`octokitRequest.endpoint.merge()`](#endpointdefaults)
|
||||
- [`octokitRequest.endpoint.parse()`](#endpointmerge)
|
||||
|
||||
## Special cases
|
||||
|
||||
<a name="data-parameter"></a>
|
||||
|
||||
### The `data` parameter – set request body directly
|
||||
|
||||
Some endpoints such as [Render a Markdown document in raw mode](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode) don’t have parameters that are sent as request body keys, instead the request body needs to be set directly. In these cases, set the `data` parameter.
|
||||
|
||||
```js
|
||||
const response = await request("POST /markdown/raw", {
|
||||
data: "Hello world github/linguist#1 **cool**, and #1!",
|
||||
headers: {
|
||||
accept: "text/html;charset=utf-8",
|
||||
"content-type": "text/plain",
|
||||
},
|
||||
});
|
||||
|
||||
// Request is sent as
|
||||
//
|
||||
// {
|
||||
// method: 'post',
|
||||
// url: 'https://api.github.com/markdown/raw',
|
||||
// headers: {
|
||||
// accept: 'text/html;charset=utf-8',
|
||||
// 'content-type': 'text/plain',
|
||||
// 'user-agent': userAgent
|
||||
// },
|
||||
// body: 'Hello world github/linguist#1 **cool**, and #1!'
|
||||
// }
|
||||
//
|
||||
// not as
|
||||
//
|
||||
// {
|
||||
// ...
|
||||
// body: '{"data": "Hello world github/linguist#1 **cool**, and #1!"}'
|
||||
// }
|
||||
```
|
||||
|
||||
### Set parameters for both the URL/query and the request body
|
||||
|
||||
There are API endpoints that accept both query parameters as well as a body. In that case you need to add the query parameters as templates to `options.url`, as defined in the [RFC 6570 URI Template specification](https://tools.ietf.org/html/rfc6570).
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
request(
|
||||
"POST https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
|
||||
{
|
||||
name: "example.zip",
|
||||
label: "short description",
|
||||
headers: {
|
||||
"content-type": "text/plain",
|
||||
"content-length": 14,
|
||||
authorization: `token 0000000000000000000000000000000000000001`,
|
||||
},
|
||||
data: "Hello, world!",
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
67
node_modules/@octokit/rest/README.md
generated
vendored
67
node_modules/@octokit/rest/README.md
generated
vendored
@@ -1,67 +0,0 @@
|
||||
# rest.js
|
||||
|
||||
> GitHub REST API client for JavaScript
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/rest)
|
||||
[](https://github.com/octokit/rest.js/actions?query=workflow%3ATest+branch%3Amain)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/rest</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/rest</code>
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/rest");
|
||||
// or: import { Octokit } from "@octokit/rest";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const octokit = new Octokit();
|
||||
|
||||
// Compare: https://docs.github.com/en/rest/reference/repos/#list-organization-repositories
|
||||
octokit.rest.repos
|
||||
.listForOrg({
|
||||
org: "octokit",
|
||||
type: "public",
|
||||
})
|
||||
.then(({ data }) => {
|
||||
// handle data
|
||||
});
|
||||
```
|
||||
|
||||
See https://octokit.github.io/rest.js for full documentation.
|
||||
|
||||
## Contributing
|
||||
|
||||
We would love you to contribute to `@octokit/rest`, pull requests are very welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
||||
|
||||
## Credits
|
||||
|
||||
`@octokit/rest` was originally created as [`node-github`](https://www.npmjs.com/package/github) in 2012 by Mike de Boer from Cloud9 IDE, Inc. [The original commit](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/) is from 2010 which predates the npm registry.
|
||||
|
||||
It was adopted and renamed by GitHub in 2017. Learn more about its origin on GitHub's blog: [From 48k lines of code to 10—the story of GitHub’s JavaScript SDK](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/)
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
65
node_modules/@octokit/types/README.md
generated
vendored
65
node_modules/@octokit/types/README.md
generated
vendored
@@ -1,65 +0,0 @@
|
||||
# types.ts
|
||||
|
||||
> Shared TypeScript definitions for Octokit projects
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/types)
|
||||
[](https://github.com/octokit/types.ts/actions?workflow=Test)
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Usage](#usage)
|
||||
- [Examples](#examples)
|
||||
- [Get parameter and response data types for a REST API endpoint](#get-parameter-and-response-data-types-for-a-rest-api-endpoint)
|
||||
- [Get response types from endpoint methods](#get-response-types-from-endpoint-methods)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Usage
|
||||
|
||||
See all exported types at https://octokit.github.io/types.ts
|
||||
|
||||
## Examples
|
||||
|
||||
### Get parameter and response data types for a REST API endpoint
|
||||
|
||||
```ts
|
||||
import { Endpoints } from "@octokit/types";
|
||||
|
||||
type listUserReposParameters =
|
||||
Endpoints["GET /repos/{owner}/{repo}"]["parameters"];
|
||||
type listUserReposResponse = Endpoints["GET /repos/{owner}/{repo}"]["response"];
|
||||
|
||||
async function listRepos(
|
||||
options: listUserReposParameters
|
||||
): listUserReposResponse["data"] {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Get response types from endpoint methods
|
||||
|
||||
```ts
|
||||
import {
|
||||
GetResponseTypeFromEndpointMethod,
|
||||
GetResponseDataTypeFromEndpointMethod,
|
||||
} from "@octokit/types";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
|
||||
const octokit = new Octokit();
|
||||
type CreateLabelResponseType = GetResponseTypeFromEndpointMethod<
|
||||
typeof octokit.issues.createLabel
|
||||
>;
|
||||
type CreateLabelResponseDataType = GetResponseDataTypeFromEndpointMethod<
|
||||
typeof octokit.issues.createLabel
|
||||
>;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
47
node_modules/@pnpm/npm-conf/readme.md
generated
vendored
47
node_modules/@pnpm/npm-conf/readme.md
generated
vendored
@@ -1,47 +0,0 @@
|
||||
# @pnpm/npm-conf [](https://travis-ci.com/pnpm/npm-conf)
|
||||
|
||||
> Get the npm config
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ pnpm add @pnpm/npm-conf
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const npmConf = require('@pnpm/npm-conf');
|
||||
|
||||
const conf = npmConf();
|
||||
|
||||
conf.get('prefix')
|
||||
//=> //=> /Users/unicorn/.npm-packages
|
||||
|
||||
conf.get('registry')
|
||||
//=> https://registry.npmjs.org/
|
||||
```
|
||||
|
||||
To get a list of all available `npm` config options:
|
||||
|
||||
```bash
|
||||
$ npm config list --long
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### npmConf()
|
||||
|
||||
Returns the `npm` config.
|
||||
|
||||
### npmConf.defaults
|
||||
|
||||
Returns the default `npm` config.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
184
node_modules/@semantic-release/commit-analyzer/README.md
generated
vendored
184
node_modules/@semantic-release/commit-analyzer/README.md
generated
vendored
@@ -1,184 +0,0 @@
|
||||
# **commit-analyzer**
|
||||
|
||||
[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to analyze commits with [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)
|
||||
|
||||
[](https://github.com/semantic-release/commit-analyzer/actions?query=workflow%3ATest+branch%3Amaster) [](https://www.npmjs.com/package/@semantic-release/commit-analyzer)
|
||||
[](https://www.npmjs.com/package/@semantic-release/commit-analyzer)
|
||||
[](https://www.npmjs.com/package/@semantic-release/commit-analyzer)
|
||||
|
||||
| Step | Description |
|
||||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `analyzeCommits` | Determine the type of release by analyzing commits with [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog). |
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install @semantic-release/commit-analyzer -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["@semantic-release/commit-analyzer", {
|
||||
"preset": "angular",
|
||||
"releaseRules": [
|
||||
{"type": "docs", "scope":"README", "release": "patch"},
|
||||
{"type": "refactor", "release": "patch"},
|
||||
{"type": "style", "release": "patch"}
|
||||
],
|
||||
"parserOpts": {
|
||||
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
|
||||
}
|
||||
}],
|
||||
"@semantic-release/release-notes-generator"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
With this example:
|
||||
- the commits that contains `BREAKING CHANGE` or `BREAKING CHANGES` in their body will be considered breaking changes.
|
||||
- the commits with a 'docs' `type`, a 'README' `scope` will be associated with a `patch` release
|
||||
- the commits with a 'refactor' `type` will be associated with a `patch` release
|
||||
- the commits with a 'style' `type` will be associated with a `patch` release
|
||||
|
||||
**Note**: Your commits must be formatted **exactly** as specified by the chosen convention. For example the [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) require the `BREAKING CHANGE` keyword to be followed by a colon (`:`) and to be in the **footer** of the commit message.
|
||||
|
||||
## Configuration
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Description | Default |
|
||||
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `preset` | [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset (possible values: [`angular`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular), [`atom`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-atom), [`codemirror`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-codemirror), [`ember`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-ember), [`eslint`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint), [`express`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-express), [`jquery`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-jquery), [`jshint`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-jshint), [`conventionalcommits`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits)). | [`angular`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular) |
|
||||
| `config` | npm package name of a custom [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset. | - |
|
||||
| `parserOpts` | Additional [conventional-commits-parser](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#conventionalcommitsparseroptions) options that will extends the ones loaded by `preset` or `config`. This is convenient to use a [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset with some customizations without having to create a new module. | - |
|
||||
| `releaseRules` | An external module, a path to a module or an `Array` of rules. See [`releaseRules`](#releaserules). | See [`releaseRules`](#releaserules) |
|
||||
| `presetConfig` | Additional configuration passed to the [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset. Used for example with [conventional-changelog-conventionalcommits](https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.0.0/README.md). | - |
|
||||
|
||||
**Notes**: in order to use a `preset` it must be installed (for example to use the [eslint preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint) you must install it with `npm install conventional-changelog-eslint -D`)
|
||||
|
||||
**Note**: `config` will be overwritten by the values of `preset`. You should use either `preset` or `config`, but not both.
|
||||
|
||||
**Note**: Individual properties of `parserOpts` will override ones loaded with an explicitly set `preset` or `config`. If `preset` or `config` are not set, only the properties set in `parserOpts` will be used.
|
||||
|
||||
**Note**: For presets that expects a configuration object, such as [`conventionalcommits`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits), the `presetConfig` option **must** be set.
|
||||
|
||||
#### releaseRules
|
||||
|
||||
Release rules are used when deciding if the commits since the last release warrant a new release. If you define custom release rules the [default rules](lib/default-release-rules.js) will be used if nothing matched. Those rules will be matched against the commit objects resulting of [conventional-commits-parser](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser) parsing. Each rule property can be defined as a [glob](https://github.com/micromatch/micromatch#matching-features).
|
||||
|
||||
##### Rules definition
|
||||
|
||||
This is an `Array` of rule objects. A rule object has a `release` property and 1 or more criteria.
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["@semantic-release/commit-analyzer", {
|
||||
"preset": "angular",
|
||||
"releaseRules": [
|
||||
{"type": "docs", "scope": "README", "release": "patch"},
|
||||
{"type": "refactor", "scope": "core-*", "release": "minor"},
|
||||
{"type": "refactor", "release": "patch"},
|
||||
{"scope": "no-release", "release": false}
|
||||
]
|
||||
}],
|
||||
"@semantic-release/release-notes-generator"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
##### Rules matching
|
||||
|
||||
Each commit will be compared with each rule and when it matches, the commit will be associated with the release type in the rule's `release` property. If a commit match multiple rules, the highest release type (`major` > `minor` > `patch`) is associated with the commit.
|
||||
|
||||
See [release types](lib/default-release-types.js) for the release types hierarchy.
|
||||
|
||||
With the previous example:
|
||||
- Commits with `type` 'docs' and `scope` 'README' will be associated with a `patch` release.
|
||||
- Commits with `type` 'refactor' and `scope` starting with 'core-' (i.e. 'core-ui', 'core-rules', ...) will be associated with a `minor` release.
|
||||
- Other commits with `type` 'refactor' (without `scope` or with a `scope` not matching the glob `core-*`) will be associated with a `patch` release.
|
||||
- Commits with scope `no-release` will not be associated with a release type.
|
||||
|
||||
##### Default rules matching
|
||||
|
||||
If a commit doesn't match any rule in `releaseRules` it will be evaluated against the [default release rules](lib/default-release-rules.js).
|
||||
|
||||
With the previous example:
|
||||
- Commits with a breaking change will be associated with a `major` release.
|
||||
- Commits with `type` 'feat' will be associated with a `minor` release.
|
||||
- Commits with `type` 'fix' will be associated with a `patch` release.
|
||||
- Commits with `type` 'perf' will be associated with a `patch` release.
|
||||
- Commits with scope `no-release` will not be associated with a release type even if they have a breaking change or the `type` 'feat', 'fix' or 'perf'.
|
||||
|
||||
##### No rules matching
|
||||
|
||||
If a commit doesn't match any rules in `releaseRules` or in [default release rules](lib/default-release-rules.js) then no release type will be associated with the commit.
|
||||
|
||||
With the previous example:
|
||||
- Commits with `type` 'style' will not be associated with a release type.
|
||||
- Commits with `type` 'test' will not be associated with a release type.
|
||||
- Commits with `type` 'chore' will not be associated with a release type.
|
||||
|
||||
##### Multiple commits
|
||||
|
||||
If there is multiple commits that match one or more rules, the one with the highest release type will determine the global release type.
|
||||
|
||||
Considering the following commits:
|
||||
- `docs(README): Add more details to the API docs`
|
||||
- `feat(API): Add a new method to the public API`
|
||||
|
||||
With the previous example the release type determined by the plugin will be `minor`.
|
||||
|
||||
##### Specific commit properties
|
||||
|
||||
The properties to set in the rules will depends on the commit style chosen. For example [conventional-changelog-angular](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular) use the commit properties `type`, `scope` and `subject` but [conventional-changelog-eslint](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-eslint) uses `tag` and `message`.
|
||||
|
||||
For example with `eslint` preset:
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["@semantic-release/commit-analyzer", {
|
||||
"preset": "eslint",
|
||||
"releaseRules": [
|
||||
{"tag": "Docs", "message":"*README*", "release": "patch"},
|
||||
{"tag": "New", "release": "patch"}
|
||||
]
|
||||
}],
|
||||
"@semantic-release/release-notes-generator"
|
||||
]
|
||||
}
|
||||
```
|
||||
With this configuration:
|
||||
- Commits with `tag` 'Docs', that contains 'README' in their header message will be associated with a `patch` release.
|
||||
- Commits with `tag` 'New' will be associated with a `patch` release.
|
||||
- Commits with `tag` 'Breaking' will be associated with a `major` release (per [default release rules](lib/default-release-rules.js)).
|
||||
- Commits with `tag` 'Fix' will be associated with a `patch` release (per [default release rules](lib/default-release-rules.js)).
|
||||
- Commits with `tag` 'Update' will be associated with a `minor` release (per [default release rules](lib/default-release-rules.js)).
|
||||
- All other commits will not be associated with a release type.
|
||||
|
||||
##### External package / file
|
||||
|
||||
`releaseRules` can also reference a module, either by it's `npm` name or path:
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["@semantic-release/commit-analyzer", {
|
||||
"preset": "angular",
|
||||
"releaseRules": "./config/release-rules.js"
|
||||
}],
|
||||
"@semantic-release/release-notes-generator"
|
||||
]
|
||||
}
|
||||
```
|
||||
```js
|
||||
// File: config/release-rules.js
|
||||
module.exports = [
|
||||
{type: 'docs', scope: 'README', release: 'patch'},
|
||||
{type: 'refactor', scope: 'core-*', release: 'minor'},
|
||||
{type: 'refactor', release: 'patch'},
|
||||
];
|
||||
```
|
||||
41
node_modules/@semantic-release/error/README.md
generated
vendored
41
node_modules/@semantic-release/error/README.md
generated
vendored
@@ -1,41 +0,0 @@
|
||||
# @semantic-release/error
|
||||
|
||||
Error type used by all [semantic-release](https://github.com/semantic-release/semantic-release) packages.
|
||||
|
||||
[](https://github.com/semantic-release/error/actions?query=workflow%3ATest+branch%3Amaster)
|
||||
|
||||
Errors of type `SemanticReleaseError` or an inherited type will be considered by [semantic-release](https://github.com/semantic-release/semantic-release) as an expected exception case (no release to be done, running on a PR etc..). That indicate to the `semantic-release` process to stop and exit with the `0` success code.
|
||||
|
||||
Any other type of error will be considered by [semantic-release](https://github.com/semantic-release/semantic-release) as an unexpected error (i/o issue, code problem etc...). That indicate to the `semantic-release` process to stop, log the error and exit with the `1` failure code.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const SemanticReleaseError = require("@semantic-release/error");
|
||||
|
||||
// Default
|
||||
throw new SemanticReleaseError();
|
||||
|
||||
// With error message
|
||||
throw new SemanticReleaseError("An error happened");
|
||||
|
||||
// With error message and error code
|
||||
throw new SemanticReleaseError("An error happened", "ECODE");
|
||||
|
||||
// With error message, error code and details
|
||||
throw new SemanticReleaseError("An error happened", "ECODE", "Here is some suggestions to solve this error.");
|
||||
|
||||
// With inheritance
|
||||
class InheritedError extends SemanticReleaseError {
|
||||
constructor(message, code, newProperty, details) {
|
||||
super(message);
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
this.name = this.constructor.name;
|
||||
this.code = code;
|
||||
this.details = details;
|
||||
this.newProperty = "newProperty";
|
||||
}
|
||||
}
|
||||
|
||||
throw new InheritedError("An error happened", "ECODE", "Here is some suggestions to solve this error.");
|
||||
```
|
||||
141
node_modules/@semantic-release/exec/README.md
generated
vendored
141
node_modules/@semantic-release/exec/README.md
generated
vendored
@@ -1,141 +0,0 @@
|
||||
# @semantic-release/exec
|
||||
|
||||
[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to execute custom shell commands.
|
||||
|
||||
[](https://github.com/semantic-release/exec/actions?query=workflow%3ATest+branch%3Amaster) [](https://www.npmjs.com/package/@semantic-release/exec)
|
||||
[](https://www.npmjs.com/package/@semantic-release/exec)
|
||||
[](https://www.npmjs.com/package/@semantic-release/exec)
|
||||
|
||||
| Step | Description |
|
||||
|--------------------|---------------------------------------------------------------------------------------------------------|
|
||||
| `verifyConditions` | Execute a shell command to verify if the release should happen. |
|
||||
| `analyzeCommits` | Execute a shell command to determine the type of release. |
|
||||
| `verifyRelease` | Execute a shell command to verifying a release that was determined before and is about to be published. |
|
||||
| `generateNotes` | Execute a shell command to generate the release note. |
|
||||
| `prepare` | Execute a shell command to prepare the release. |
|
||||
| `publish` | Execute a shell command to publish the release. |
|
||||
| `success` | Execute a shell command to notify of a new release. |
|
||||
| `fail` | Execute a shell command to notify of a failed release. |
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install @semantic-release/exec -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
["@semantic-release/exec", {
|
||||
"verifyConditionsCmd": "./verify.sh",
|
||||
"publishCmd": "./publish.sh ${nextRelease.version} ${options.branch} ${commits.length} ${Date.now()}"
|
||||
}],
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
With this example:
|
||||
- the shell command `./verify.sh` will be executed on the [verify conditions step](https://github.com/semantic-release/semantic-release#release-steps)
|
||||
- the shell command `./publish.sh 1.0.0 master 3 870668040000` (for the release of version `1.0.0` from branch `master` with `3` commits on `August 4th, 1997 at 2:14 AM`) will be executed on the [publish step](https://github.com/semantic-release/semantic-release#release-steps)
|
||||
|
||||
**Note**: it's required to define a plugin for the [analyze commits step](https://github.com/semantic-release/semantic-release#release-steps). If no [analyzeCommitsCmd](#analyzecommitscmd) is defined the plugin [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer) must be defined in the `plugins` list.
|
||||
|
||||
## Configuration
|
||||
|
||||
### Options
|
||||
|
||||
| Options | Description |
|
||||
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `verifyConditionsCmd` | The shell command to execute during the verify condition step. See [verifyConditionsCmd](#verifyconditionscmd). |
|
||||
| `analyzeCommitsCmd` | The shell command to execute during the analyze commits step. See [analyzeCommitsCmd](#analyzecommitscmd). |
|
||||
| `verifyReleaseCmd` | The shell command to execute during the verify release step. See [verifyReleaseCmd](#verifyreleasecmd). |
|
||||
| `generateNotesCmd` | The shell command to execute during the generate notes step. See [generateNotesCmd](#generatenotescmd). |
|
||||
| `prepareCmd` | The shell command to execute during the prepare step. See [prepareCmd](#preparecmd). |
|
||||
| `addChannelCmd` | The shell command to execute during the add channel step. See [addChannelCmd](#addchannelcmd). |
|
||||
| `publishCmd` | The shell command to execute during the publish step. See [publishCmd](#publishcmd). |
|
||||
| `successCmd` | The shell command to execute during the success step. See [successCmd](#successcmd). |
|
||||
| `failCmd` | The shell command to execute during the fail step. See [failCmd](#failcmd). |
|
||||
| `shell` | The shell to use to run the command. See [execa#shell](https://github.com/sindresorhus/execa#shell). |
|
||||
| `execCwd` | The path to use as current working directory when executing the shell commands. This path is relative to the path from which **semantic-release** is running. For example if **semantic-release** runs from `/my-project` and `execCwd` is set to `buildScripts` then the shell command will be executed from `/my-project/buildScripts` |
|
||||
|
||||
Each shell command is generated with [Lodash template](https://lodash.com/docs#template). All the objects passed to the [semantic-release plugins](https://github.com/semantic-release/semantic-release#plugins) are available as template options.
|
||||
|
||||
## verifyConditionsCmd
|
||||
|
||||
Execute a shell command to verify if the release should happen.
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|--------------------------------------------------------------------------|
|
||||
| `exit code` | `0` if the verification is successful, or any other exit code otherwise. |
|
||||
| `stdout` | Write only the reason for the verification to fail. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## analyzeCommitsCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | Only the release type (`major`, `minor` or `patch` etc..) can be written to `stdout`. If no release has to be done the command must not write to `stdout`. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## verifyReleaseCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|--------------------------------------------------------------------------|
|
||||
| `exit code` | `0` if the verification is successful, or any other exit code otherwise. |
|
||||
| `stdout` | Only the reason for the verification to fail can be written to `stdout`. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## generateNotesCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | Only the release note must be written to `stdout`. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## prepareCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | Can be used for logging. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## addChannelCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | The `release` information can be written to `stdout` as parseable JSON (for example `{"name": "Release name", "url": "http://url/release/1.0.0"}`). If the command write non parseable JSON to `stdout` no `release` information will be returned. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## publishCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | The `release` information can be written to `stdout` as parseable JSON (for example `{"name": "Release name", "url": "http://url/release/1.0.0"}`). If the command write non parseable JSON to `stdout` no `release` information will be returned. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## successCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | Can be used for logging. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
|
||||
## failCmd
|
||||
|
||||
| Command property | Description |
|
||||
|------------------|---------------------------------------------------------------------------------------------------------------------|
|
||||
| `exit code` | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |
|
||||
| `stdout` | Can be used for logging. |
|
||||
| `stderr` | Can be used for logging. |
|
||||
272
node_modules/@semantic-release/git/README.md
generated
vendored
272
node_modules/@semantic-release/git/README.md
generated
vendored
@@ -1,272 +0,0 @@
|
||||
# @semantic-release/git
|
||||
|
||||
[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to commit release assets to the project's [git](https://git-scm.com/) repository.
|
||||
|
||||
[](https://github.com/semantic-release/git/actions?query=workflow%3ATest+branch%3Amaster) [](https://www.npmjs.com/package/@semantic-release/git)
|
||||
[](https://www.npmjs.com/package/@semantic-release/git)
|
||||
[](https://www.npmjs.com/package/@semantic-release/git)
|
||||
|
||||
| Step | Description |
|
||||
|--------------------|------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `verifyConditions` | Verify the access to the remote Git repository, the commit [`message`](#message) and the [`assets`](#assets) option configuration. |
|
||||
| `prepare` | Create a release commit, including configurable file assets. |
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install @semantic-release/git -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
["@semantic-release/git", {
|
||||
"assets": ["dist/**/*.{js,css}", "docs", "package.json"],
|
||||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
With this example, for each release a release commit will be pushed to the remote Git repository with:
|
||||
- a message formatted like `chore(release): <version> [skip ci]\n\n<release notes>`
|
||||
- the `.js` and `.css` files in the `dist` directory, the files in the `docs` directory and the `package.json`
|
||||
|
||||
### Merging between semantic-release branches
|
||||
|
||||
This plugin will, by default, create commit messages with the keyword `[skip ci]`, so they won't trigger a new unnecessary CI build. If you are using **semantic-release** with [multiple branches](https://github.com/semantic-release/semantic-release/blob/beta/docs/usage/workflow-configuration.md), when merging a branch with a head being a release commit, a CI job will be triggered on the target branch. Depending on the CI service that might create an unexpected behavior as the head of the target branch might be ignored by the build due to the `[skip ci]` keyword.
|
||||
|
||||
To avoid any unexpected behavior we recommend to use the [`--no-ff` option](https://git-scm.com/docs/git-merge#Documentation/git-merge.txt---no-ff) when merging branches used by **semantic-release**.
|
||||
|
||||
**Note**: This concerns only merges done between two branches configured in the [`branches` option](https://github.com/semantic-release/semantic-release/blob/beta/docs/usage/configuration.md#branches).
|
||||
|
||||
## Configuration
|
||||
|
||||
### Git authentication
|
||||
|
||||
The Git user associated with the [Git credentials](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication) has to be able to push commit to the [release branch](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#branch).
|
||||
|
||||
When configuring branches permission on a Git hosting service (e.g. [GitHub protected branches](https://help.github.com/articles/about-protected-branches), [GitLab protected branches](https://docs.gitlab.com/ee/user/project/protected_branches.html) or [Bitbucket branch permissions](https://confluence.atlassian.com/bitbucket/branch-permissions-385912271.html)) it might be necessary to create a specific configuration in order to allow the **semantic-release** user to bypass global restrictions. For example on GitHub you can uncheck "Include administrators" and configure **semantic-release** to use an administrator user, so the plugin can push the release commit without requiring [status checks](https://help.github.com/articles/about-required-status-checks) and [pull request reviews](https://help.github.com/articles/about-required-reviews-for-pull-requests).
|
||||
|
||||
### Environment variables
|
||||
|
||||
| Variable | Description | Default |
|
||||
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
|
||||
| `GIT_AUTHOR_NAME` | The author name associated with the release commit. See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot. |
|
||||
| `GIT_AUTHOR_EMAIL` | The author email associated with the release commit. See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot email address. |
|
||||
| `GIT_COMMITTER_NAME` | The committer name associated with the release commit. See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot. |
|
||||
| `GIT_COMMITTER_EMAIL` | The committer email associated with the release commit. See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot email address. |
|
||||
|
||||
### Options
|
||||
|
||||
| Options | Description | Default |
|
||||
|-----------|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
|
||||
| `message` | The message for the release commit. See [message](#message). | `chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}` |
|
||||
| `assets` | Files to include in the release commit. Set to `false` to disable adding files to the release commit. See [assets](#assets). | `['CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json']` |
|
||||
|
||||
#### `message`
|
||||
|
||||
The message for the release commit is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
|
||||
|
||||
| Parameter | Description |
|
||||
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `branch` | The branch from which the release is done. |
|
||||
| `branch.name` | The branch name. |
|
||||
| `branch.type` | The [type of branch](https://github.com/semantic-release/semantic-release/blob/beta/docs/usage/workflow-configuration.md#branch-types). |
|
||||
| `branch.channel` | The distribution channel on which to publish releases from this branch. |
|
||||
| `branch.range` | The range of [semantic versions](https://semver.org) to support on this branch. |
|
||||
| `branch.prerelease` | The pre-release detonation to append to [semantic versions](https://semver.org) released from this branch. |
|
||||
| `lastRelease` | `Object` with `version`, `gitTag` and `gitHead` of the last release. |
|
||||
| `nextRelease` | `Object` with `version`, `gitTag`, `gitHead` and `notes` of the release being done. |
|
||||
|
||||
**Note**: It is recommended to include `[skip ci]` in the commit message to not trigger a new build. Some CI service support the `[skip ci]` keyword only in the subject of the message.
|
||||
|
||||
##### `message` examples
|
||||
|
||||
The `message` `Release <%= nextRelease.version %> - <%= new Date().toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }) %> [skip ci]\n\n<%= nextRelease.notes %>` will generate the commit message:
|
||||
|
||||
> Release v1.0.0 - Oct. 21, 2015 1:24 AM \[skip ci\]<br><br>## 1.0.0<br><br>### Features<br>* Generate 1.21 gigawatts of electricity<br>...
|
||||
|
||||
#### `assets`
|
||||
|
||||
Can be an `Array` or a single entry. Each entry can be either:
|
||||
- a [glob](https://github.com/micromatch/micromatch#matching-features)
|
||||
- or an `Object` with a `path` property containing a [glob](https://github.com/micromatch/micromatch#matching-features).
|
||||
|
||||
Each entry in the `assets` `Array` is globbed individually. A [glob](https://github.com/micromatch/micromatch#matching-features) can be a `String` (`"dist/**/*.js"` or `"dist/mylib.js"`) or an `Array` of `String`s that will be globbed together (`["dist/**", "!**/*.css"]`).
|
||||
|
||||
If a directory is configured, all the files under this directory and its children will be included.
|
||||
|
||||
**Note**: If a file has a match in `assets` it will be included even if it also has a match in `.gitignore`.
|
||||
|
||||
##### `assets` examples
|
||||
|
||||
`'dist/*.js'`: include all `js` files in the `dist` directory, but not in its sub-directories.
|
||||
|
||||
`'dist/**/*.js'`: include all `js` files in the `dist` directory and its sub-directories.
|
||||
|
||||
`[['dist', '!**/*.css']]`: include all files in the `dist` directory and its sub-directories excluding the `css` files.
|
||||
|
||||
`[['dist', '!**/*.css'], 'package.json']`: include `package.json` and all files in the `dist` directory and its sub-directories excluding the `css` files.
|
||||
|
||||
`[['dist/**/*.{js,css}', '!**/*.min.*']]`: include all `js` and `css` files in the `dist` directory and its sub-directories excluding the minified version.
|
||||
|
||||
### Examples
|
||||
|
||||
When used with the [@semantic-release/changelog](https://github.com/semantic-release/changelog) or [@semantic-release/npm](https://github.com/semantic-release/npm) plugins:
|
||||
- The [@semantic-release/changelog](https://github.com/semantic-release/changelog) plugin must be called first in order to update the changelog file so the `@semantic-release/git` and [@semantic-release/npm](https://github.com/semantic-release/npm) plugins can include it in the release.
|
||||
- The [@semantic-release/npm](https://github.com/semantic-release/npm) plugin must be called second in order to update the `package.json` file so the `@semantic-release/git` plugin can include it in the release commit.
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/changelog",
|
||||
"@semantic-release/npm",
|
||||
"@semantic-release/git"
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
### GPG signature
|
||||
|
||||
Using GPG, you can [sign and verify tags and commits](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work). With GPG keys, the release tags and commits made by Semantic-release are verified and other people can trust that they were really were made by your account.
|
||||
|
||||
#### Generate the GPG keys
|
||||
|
||||
If you already have a GPG public and private key you can skip this step and go to the [Get the GPG keys ID and the public key content](#get-the-gpg-keys-id-and-the-public-key-content) step.
|
||||
|
||||
[Download and install the GPG command line tools](https://www.gnupg.org/download/#binary) for your operating system.
|
||||
|
||||
Create a GPG key
|
||||
|
||||
```bash
|
||||
$ gpg --full-generate-key
|
||||
```
|
||||
|
||||
At the prompt select the `RSA and RSA` king of key, enter `4096` for the keysize, specify how long the key should be valid, enter yout name, the email associated with your Git hosted account and finally set a long and hard to guess passphrase.
|
||||
|
||||
#### Get the GPG keys ID and the public key content
|
||||
|
||||
Use the `gpg --list-secret-keys --keyid-format LONG` command to list your GPG keys. From the list, copy the GPG key ID you just created.
|
||||
|
||||
```bash
|
||||
$ gpg --list-secret-keys --keyid-format LONG
|
||||
/Users/<user_home>/.gnupg/pubring.gpg
|
||||
---------------------------------------
|
||||
sec rsa4096/XXXXXXXXXXXXXXXX 2017-12-01 [SC]
|
||||
uid <your_name> <your_email>
|
||||
ssb rsa4096/YYYYYYYYYYYYYYYY 2017-12-01 [E]
|
||||
```
|
||||
the GPG key ID if 16 character string, on the on the `sec` line, after `rsa4096`. In this example, the GPG key ID is `XXXXXXXXXXXXXXXX`.
|
||||
|
||||
Export the public key (replace XXXXXXXXXXXXXXXX with your key ID):
|
||||
|
||||
```bash
|
||||
$ gpg --armor --export XXXXXXXXXXXXXXXX
|
||||
```
|
||||
|
||||
Copy your GPG key, beginning with -----BEGIN PGP PUBLIC KEY BLOCK----- and ending with -----END PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
#### Add the GPG key to your Git hosted account
|
||||
|
||||
##### Add the GPG key to GitHub
|
||||
|
||||
In GitHub **Settings**, click on **SSH and GPG keys** in the sidebar, then on the **New GPG Key** button.
|
||||
|
||||
Paste the entire GPG key export previously and click the **Add GPG Key** button.
|
||||
|
||||
See [Adding a new GPG key to your GitHub account](https://help.github.com/articles/adding-a-new-gpg-key-to-your-github-account/) for more details.
|
||||
|
||||
### Use the GPG key to sign commit and tags locally
|
||||
|
||||
If you want to use this GPG to also sign the commits and tags you create on your local machine you can follow the instruction at [Git Tools - Signing Your Work](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work)
|
||||
This step is optional and unrelated to Semantic-release.
|
||||
|
||||
#### Add the GPG keys to your CI environment
|
||||
|
||||
Make the public and private GPG key available on the CI environment. Encrypt the keys, commit it to your repository and configure the CI environment to decrypt it.
|
||||
|
||||
##### Add the GPG keys to Travis CI
|
||||
|
||||
Install the [Travis CLI](https://github.com/travis-ci/travis.rb#installation):
|
||||
|
||||
```bash
|
||||
$ gem install travis
|
||||
```
|
||||
|
||||
[Login](https://github.com/travis-ci/travis.rb#login) to Travis with the CLI:
|
||||
|
||||
```bash
|
||||
$ travis login
|
||||
```
|
||||
|
||||
Add the following [environment](https://github.com/travis-ci/travis.rb#env) variables to Travis:
|
||||
- `GPG_PASSPHRASE` to Travis with the value set during the [GPG keys generation](#generate-the-gpg-keys) step
|
||||
- `GPG_KEY_ID` to Travis with the value of your GPG key ID retrieved during the [GPG keys generation](#generate-the-gpg-keys) (replace XXXXXXXXXXXXXXXX with your key ID)
|
||||
- `GIT_EMAIL` with the email address you set during the [GPG keys generation](#generate-the-gpg-keys) step
|
||||
- `GIT_USERNAME` with the name you set during the [GPG keys generation](#generate-the-gpg-keys) step
|
||||
|
||||
```bash
|
||||
$ travis env set GPG_PASSPHRASE <gpg_passphrase>
|
||||
$ travis env set GPG_KEY_ID XXXXXXXXXXXXXXXX
|
||||
$ travis env set GIT_EMAIL <your_email>
|
||||
$ travis env set GIT_USERNAME <your_name>
|
||||
```
|
||||
|
||||
From your repository root export your public and private GPG keys in the `git_gpg_keys.asc` (replace XXXXXXXXXXXXXXXX with your key ID):
|
||||
|
||||
```bash
|
||||
$ gpg --export -a XXXXXXXXXXXXXXXX > git_gpg_keys.asc
|
||||
$ gpg --export-secret-key -a XXXXXXXXXXXXXXXX >> git_gpg_keys.asc
|
||||
```
|
||||
|
||||
[Encrypt](https://github.com/travis-ci/travis.rb#encrypt) the `git_gpg_keys.asc` (public and private key) using a symmetric encryption (AES-256), and store the secret in a secure environment variable in the Travis environment:
|
||||
|
||||
```bash
|
||||
$ travis encrypt-file git_gpg_keys.asc
|
||||
```
|
||||
The `travis encrypt-file` will encrypt the keys into the `git_gpg_keys.asc.enc` file and output in the console the command to add to your `.travis.yml` file. It should look like `openssl aes-256-cbc -K $encrypted_AAAAAAAAAAAA_key -iv $encrypted_BBBBBBBBBBBB_iv -in git_gpg_keys.asc.enc -out git_gpg_keys.asc -d`.
|
||||
|
||||
Copy this command to your `.travis.yml` file in the `before_install` step. Change the output path to write the unencrypted key in `/tmp`: `-out git_gpg_keys.asc` => `/tmp/git_gpg_keys.asc`. This will avoid to commit / modify / delete the unencrypted keys by mistake on the CI. Then add the commands to decrypt the GPG keys and make it available to `git`:
|
||||
|
||||
```yaml
|
||||
before_install:
|
||||
# Decrypt the git_gpg_keys.asc.enc key into /tmp/git_gpg_keys.asc
|
||||
- openssl aes-256-cbc -K $encrypted_AAAAAAAAAAAA_key -iv $encrypted_BBBBBBBBBBBB_iv -in git_gpg_keys.asc.enc -out /tmp/git_gpg_keys.asc -d
|
||||
# Make sure only the current user can read the keys
|
||||
- chmod 600 /tmp/git_gpg_keys.asc
|
||||
# Import the gpg key
|
||||
- gpg --batch --yes --import /tmp/git_gpg_keys.asc
|
||||
# Create a script that pass the passphrase to the gpg CLI called by git
|
||||
- echo '/usr/bin/gpg2 --passphrase ${GPG_PASSPHRASE} --batch --no-tty "$@"' > /tmp/gpg-with-passphrase && chmod +x /tmp/gpg-with-passphrase
|
||||
# Configure git to use the script that passes the passphrase
|
||||
- git config gpg.program "/tmp/gpg-with-passphrase"
|
||||
# Configure git to sign the commits and tags
|
||||
- git config commit.gpgsign true
|
||||
# Configure git to use your GPG key
|
||||
- git config --global user.signingkey ${GPG_KEY_ID}
|
||||
```
|
||||
|
||||
See [Encrypting Files](https://docs.travis-ci.com/user/encrypting-files/) for more details.
|
||||
|
||||
Delete the local keys as it won't be used anymore:
|
||||
|
||||
```bash
|
||||
$ rm git_gpg_keys.asc
|
||||
```
|
||||
|
||||
Commit the encrypted keys and the `.travis.yml` file to your repository:
|
||||
|
||||
```bash
|
||||
$ git add git_gpg_keys.asc.enc .travis.yml
|
||||
$ git commit -m "ci(travis): Add the encrypted GPG keys"
|
||||
$ git push
|
||||
```
|
||||
221
node_modules/@semantic-release/github/README.md
generated
vendored
221
node_modules/@semantic-release/github/README.md
generated
vendored
@@ -1,221 +0,0 @@
|
||||
# @semantic-release/github
|
||||
|
||||
[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to publish a
|
||||
[GitHub release](https://help.github.com/articles/about-releases) and comment on released Pull Requests/Issues.
|
||||
|
||||
[](https://github.com/semantic-release/github/actions?query=workflow%3ATest+branch%3Amaster)
|
||||
|
||||
[](https://www.npmjs.com/package/@semantic-release/github)
|
||||
[](https://www.npmjs.com/package/@semantic-release/github)
|
||||
[](https://www.npmjs.com/package/@semantic-release/github)
|
||||
|
||||
| Step | Description |
|
||||
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `verifyConditions` | Verify the presence and the validity of the authentication (set via [environment variables](#environment-variables)) and the [assets](#assets) option configuration. |
|
||||
| `publish` | Publish a [GitHub release](https://help.github.com/articles/about-releases), optionally uploading file assets. |
|
||||
| `addChannel` | Update a [GitHub release](https://help.github.com/articles/about-releases)'s `pre-release` field. |
|
||||
| `success` | Add a comment to each [GitHub Issue](https://help.github.com/articles/about-issues) or [Pull Request](https://help.github.com/articles/about-pull-requests) resolved by the release and close issues previously open by the `fail` step. |
|
||||
| `fail` | Open or update a [GitHub Issue](https://help.github.com/articles/about-issues) with information about the errors that caused the release to fail. |
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install @semantic-release/github -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
["@semantic-release/github", {
|
||||
"assets": [
|
||||
{"path": "dist/asset.min.css", "label": "CSS distribution"},
|
||||
{"path": "dist/asset.min.js", "label": "JS distribution"}
|
||||
]
|
||||
}],
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
With this example [GitHub releases](https://help.github.com/articles/about-releases) will be published with the file `dist/asset.min.css` and `dist/asset.min.js`.
|
||||
|
||||
## Configuration
|
||||
|
||||
### GitHub authentication
|
||||
|
||||
The GitHub authentication configuration is **required** and can be set via [environment variables](#environment-variables).
|
||||
|
||||
Follow the [Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) documentation to obtain an authentication token. The token has to be made available in your CI environment via the `GH_TOKEN` environment variable. The user associated with the token must have push permission to the repository.
|
||||
|
||||
When creating the token, the **minimum required scopes** are:
|
||||
|
||||
- [`repo`](https://github.com/settings/tokens/new?scopes=repo) for a private repository
|
||||
- [`public_repo`](https://github.com/settings/tokens/new?scopes=public_repo) for a public repository
|
||||
|
||||
_Notes on GitHub Actions:_ You can use the default token which is provided in the secret _GITHUB_TOKEN_. However releases done with this token will NOT trigger release events to start other workflows.
|
||||
If you have actions that trigger on newly created releases, please use a generated token for that and store it in your repository's secrets (any other name than GITHUB_TOKEN is fine).
|
||||
|
||||
When using the _GITHUB_TOKEN_, the **minimum required permissions** are:
|
||||
|
||||
- `contents: write` to be able to publish a GitHub release
|
||||
- `issues: write` to be able to comment on released issues
|
||||
- `pull-requests: write` to be able to comment on released pull requests
|
||||
|
||||
### Environment variables
|
||||
|
||||
| Variable | Description |
|
||||
| -------------------------------------------------- | --------------------------------------------------------- |
|
||||
| `GH_TOKEN` or `GITHUB_TOKEN` | **Required.** The token used to authenticate with GitHub. |
|
||||
| `GITHUB_API_URL` or `GH_URL` or `GITHUB_URL` | The GitHub Enterprise endpoint. |
|
||||
| `GH_PREFIX` or `GITHUB_PREFIX` | The GitHub Enterprise API prefix. |
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Description | Default |
|
||||
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `githubUrl` | The GitHub Enterprise endpoint. | `GH_URL` or `GITHUB_URL` environment variable. |
|
||||
| `githubApiPathPrefix` | The GitHub Enterprise API prefix. | `GH_PREFIX` or `GITHUB_PREFIX` environment variable. |
|
||||
| `proxy` | The proxy to use to access the GitHub API. Set to `false` to disable usage of proxy. See [proxy](#proxy). | `HTTP_PROXY` environment variable. |
|
||||
| `assets` | An array of files to upload to the release. See [assets](#assets). | - |
|
||||
| `successComment` | The comment to add to each issue and pull request resolved by the release. Set to `false` to disable commenting on issues and pull requests. See [successComment](#successcomment). | `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)` |
|
||||
| `failComment` | The content of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. See [failComment](#failcomment). | Friendly message with links to **semantic-release** documentation and support, with the list of errors that caused the release to fail. |
|
||||
| `failTitle` | The title of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. | `The automated release is failing 🚨` |
|
||||
| `labels` | The [labels](https://help.github.com/articles/about-labels) to add to the issue created when a release fails. Set to `false` to not add any label. | `['semantic-release']` |
|
||||
| `assignees` | The [assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users) to add to the issue created when a release fails. | - |
|
||||
| `releasedLabels` | The [labels](https://help.github.com/articles/about-labels) to add to each issue and pull request resolved by the release. Set to `false` to not add any label. See [releasedLabels](#releasedlabels). | `['released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>']- |
|
||||
| `addReleases` | Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See [addReleases](#addReleases). | `false` |
|
||||
|
||||
#### proxy
|
||||
|
||||
Can be `false`, a proxy URL or an `Object` with the following properties:
|
||||
|
||||
| Property | Description | Default |
|
||||
|---------------|----------------------------------------------------------------|--------------------------------------|
|
||||
| `host` | **Required.** Proxy host to connect to. | - |
|
||||
| `port` | **Required.** Proxy port to connect to. | File name extracted from the `path`. |
|
||||
| `secureProxy` | If `true`, then use TLS to connect to the proxy. | `false` |
|
||||
| `headers` | Additional HTTP headers to be sent on the HTTP CONNECT method. | - |
|
||||
|
||||
See [node-https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent#new-httpsproxyagentobject-options) and [node-http-proxy-agent](https://github.com/TooTallNate/node-http-proxy-agent) for additional details.
|
||||
|
||||
##### proxy examples
|
||||
|
||||
`'http://168.63.76.32:3128'`: use the proxy running on host `168.63.76.32` and port `3128` for each GitHub API request.
|
||||
`{host: '168.63.76.32', port: 3128, headers: {Foo: 'bar'}}`: use the proxy running on host `168.63.76.32` and port `3128` for each GitHub API request, setting the `Foo` header value to `bar`.
|
||||
|
||||
#### assets
|
||||
|
||||
Can be a [glob](https://github.com/isaacs/node-glob#glob-primer) or and `Array` of
|
||||
[globs](https://github.com/isaacs/node-glob#glob-primer) and `Object`s with the following properties:
|
||||
|
||||
| Property | Description | Default |
|
||||
| -------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------ |
|
||||
| `path` | **Required.** A [glob](https://github.com/isaacs/node-glob#glob-primer) to identify the files to upload. | - |
|
||||
| `name` | The name of the downloadable file on the GitHub release. | File name extracted from the `path`. |
|
||||
| `label` | Short description of the file displayed on the GitHub release. | - |
|
||||
|
||||
Each entry in the `assets` `Array` is globbed individually. A [glob](https://github.com/isaacs/node-glob#glob-primer)
|
||||
can be a `String` (`"dist/**/*.js"` or `"dist/mylib.js"`) or an `Array` of `String`s that will be globbed together
|
||||
(`["dist/**", "!**/*.css"]`).
|
||||
|
||||
If a directory is configured, all the files under this directory and its children will be included.
|
||||
|
||||
The `name` and `label` for each assets are generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
|
||||
|
||||
| Parameter | Description |
|
||||
|---------------|-------------------------------------------------------------------------------------|
|
||||
| `branch` | The branch from which the release is done. |
|
||||
| `lastRelease` | `Object` with `version`, `gitTag` and `gitHead` of the last release. |
|
||||
| `nextRelease` | `Object` with `version`, `gitTag`, `gitHead` and `notes` of the release being done. |
|
||||
| `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
|
||||
|
||||
**Note**: If a file has a match in `assets` it will be included even if it also has a match in `.gitignore`.
|
||||
|
||||
##### assets examples
|
||||
|
||||
`'dist/*.js'`: include all the `js` files in the `dist` directory, but not in its sub-directories.
|
||||
|
||||
`[['dist', '!**/*.css']]`: include all the files in the `dist` directory and its sub-directories excluding the `css`
|
||||
files.
|
||||
|
||||
`[{path: 'dist/MyLibrary.js', label: 'MyLibrary JS distribution'}, {path: 'dist/MyLibrary.css', label: 'MyLibrary CSS
|
||||
distribution'}]`: include the `dist/MyLibrary.js` and `dist/MyLibrary.css` files, and label them `MyLibrary JS
|
||||
distribution` and `MyLibrary CSS distribution` in the GitHub release.
|
||||
|
||||
`[['dist/**/*.{js,css}', '!**/*.min.*'], {path: 'build/MyLibrary.zip', label: 'MyLibrary'}]`: include all the `js` and
|
||||
`css` files in the `dist` directory and its sub-directories excluding the minified version, plus the
|
||||
`build/MyLibrary.zip` file and label it `MyLibrary` in the GitHub release.
|
||||
|
||||
`[{path: 'dist/MyLibrary.js', name: 'MyLibrary-${nextRelease.gitTag}.js', label: 'MyLibrary JS (${nextRelease.gitTag}) distribution'}]`: include the file `dist/MyLibrary.js` and upload it to the GitHub release with name `MyLibrary-v1.0.0.js` and label `MyLibrary JS (v1.0.0) distribution` which will generate the link:
|
||||
|
||||
> `[MyLibrary JS (v1.0.0) distribution](MyLibrary-v1.0.0.js)`
|
||||
|
||||
#### successComment
|
||||
|
||||
The message for the issue comments is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
|
||||
|
||||
| Parameter | Description |
|
||||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
|
||||
| `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
|
||||
| `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
|
||||
| `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
|
||||
| `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
|
||||
| `issue` | A [GitHub API pull request object](https://developer.github.com/v3/search/#search-issues) for pull requests related to a commit, or an `Object` with the `number` property for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
|
||||
|
||||
##### successComment example
|
||||
|
||||
The `successComment` `This ${issue.pull_request ? 'pull request' : 'issue'} is included in version ${nextRelease.version}` will generate the comment:
|
||||
|
||||
> This pull request is included in version 1.0.0
|
||||
|
||||
#### failComment
|
||||
|
||||
The message for the issue content is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
|
||||
|
||||
| Parameter | Description |
|
||||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `branch` | The branch from which the release had failed. |
|
||||
| `errors` | An `Array` of [SemanticReleaseError](https://github.com/semantic-release/error). Each error has the `message`, `code`, `pluginName` and `details` properties.<br>`pluginName` contains the package name of the plugin that threw the error.<br>`details` contains a information about the error formatted in markdown. |
|
||||
|
||||
##### failComment example
|
||||
|
||||
The `failComment` `This release from branch ${branch.name} had failed due to the following errors:\n- ${errors.map(err => err.message).join('\\n- ')}` will generate the comment:
|
||||
|
||||
> This release from branch master had failed due to the following errors:
|
||||
> - Error message 1
|
||||
> - Error message 2
|
||||
|
||||
#### releasedLabels
|
||||
|
||||
Each label name is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
|
||||
|
||||
| Parameter | Description |
|
||||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
|
||||
| `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
|
||||
| `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
|
||||
| `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
|
||||
| `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
|
||||
| `issue` | A [GitHub API pull request object](https://developer.github.com/v3/search/#search-issues) for pull requests related to a commit, or an `Object` with the `number` property for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
|
||||
|
||||
##### releasedLabels example
|
||||
|
||||
The `releasedLabels` ```['released<%= nextRelease.channel ? ` on @\${nextRelease.channel}` : "" %> from <%= branch.name %>']``` will generate the label:
|
||||
|
||||
> released on @next from branch next
|
||||
|
||||
#### addReleases
|
||||
|
||||
Add links to other releases to the GitHub release body.
|
||||
|
||||
Valid values for this option are `false`, `"top"` or `"bottom"`.
|
||||
|
||||
##### addReleases example
|
||||
|
||||
See [The introducing PR](https://github.com/semantic-release/github/pull/282) for an example on how it will look.
|
||||
130
node_modules/@semantic-release/npm/README.md
generated
vendored
130
node_modules/@semantic-release/npm/README.md
generated
vendored
@@ -1,130 +0,0 @@
|
||||
# @semantic-release/npm
|
||||
|
||||
[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to publish a [npm](https://www.npmjs.com) package.
|
||||
|
||||
[](https://github.com/semantic-release/npm/actions?query=workflow%3ATest+branch%3Amaster) [](https://www.npmjs.com/package/@semantic-release/npm)
|
||||
[](https://www.npmjs.com/package/@semantic-release/npm)
|
||||
[](https://www.npmjs.com/package/@semantic-release/npm)
|
||||
|
||||
| Step | Description |
|
||||
|--------------------|-------------|
|
||||
| `verifyConditions` | Verify the presence of the `NPM_TOKEN` environment variable, or an `.npmrc` file, and verify the authentication method is valid. |
|
||||
| `prepare` | Update the `package.json` version and [create](https://docs.npmjs.com/cli/pack) the npm package tarball. |
|
||||
| `addChannel` | [Add a release to a dist-tag](https://docs.npmjs.com/cli/dist-tag). |
|
||||
| `publish` | [Publish the npm package](https://docs.npmjs.com/cli/publish) to the registry. |
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install @semantic-release/npm -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/npm",
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Npm registry authentication
|
||||
|
||||
The npm authentication configuration is **required** and can be set via [environment variables](#environment-variables).
|
||||
|
||||
Both the [token](https://docs.npmjs.com/getting-started/working_with_tokens) and the legacy (`username`, `password` and `email`) authentication are supported. It is recommended to use the [token](https://docs.npmjs.com/getting-started/working_with_tokens) authentication. The legacy authentication is supported as the alternative npm registries [Artifactory](https://www.jfrog.com/open-source/#os-arti) and [npm-registry-couchapp](https://github.com/npm/npm-registry-couchapp) only supports that form of authentication.
|
||||
|
||||
**Notes**:
|
||||
- Only the `auth-only` [level of npm two-factor authentication](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) is supported, **semantic-release** will not work with the default `auth-and-writes` level.
|
||||
- The presence of an `.npmrc` file will override any specified environment variables.
|
||||
|
||||
### Environment variables
|
||||
|
||||
| Variable | Description |
|
||||
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |
|
||||
| `NPM_USERNAME` | Npm username created via [npm adduser](https://docs.npmjs.com/cli/adduser) or on [npmjs.com](https://www.npmjs.com) |
|
||||
| `NPM_PASSWORD` | Password of the npm user. |
|
||||
| `NPM_EMAIL` | Email address associated with the npm user |
|
||||
| `NPM_CONFIG_USERCONFIG` | Path to non-default .npmrc file |
|
||||
|
||||
Use either `NPM_TOKEN` for token authentication or `NPM_USERNAME`, `NPM_PASSWORD` and `NPM_EMAIL` for legacy authentication
|
||||
|
||||
### Options
|
||||
|
||||
| Options | Description | Default |
|
||||
|--------------|---------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `npmPublish` | Whether to publish the `npm` package to the registry. If `false` the `package.json` version will still be updated. | `false` if the `package.json` [private](https://docs.npmjs.com/files/package.json#private) property is `true`, `true` otherwise. |
|
||||
| `pkgRoot` | Directory path to publish. | `.` |
|
||||
| `tarballDir` | Directory path in which to write the package tarball. If `false` the tarball is not be kept on the file system. | `false` |
|
||||
|
||||
**Note**: The `pkgRoot` directory must contain a `package.json`. The version will be updated only in the `package.json` and `npm-shrinkwrap.json` within the `pkgRoot` directory.
|
||||
|
||||
**Note**: If you use a [shareable configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/shareable-configurations.md#shareable-configurations) that defines one of these options you can set it to `false` in your [**semantic-release** configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in order to use the default value.
|
||||
|
||||
### Npm configuration
|
||||
|
||||
The plugin uses the [`npm` CLI](https://github.com/npm/cli) which will read the configuration from [`.npmrc`](https://docs.npmjs.com/files/npmrc). See [`npm config`](https://docs.npmjs.com/misc/config) for the option list.
|
||||
|
||||
The [`registry`](https://docs.npmjs.com/misc/registry) can be configured via the npm environment variable `NPM_CONFIG_REGISTRY` and will take precedence over the configuration in `.npmrc`.
|
||||
|
||||
The [`registry`](https://docs.npmjs.com/misc/registry) and [`dist-tag`](https://docs.npmjs.com/cli/dist-tag) can be configured in the `package.json` and will take precedence over the configuration in `.npmrc` and `NPM_CONFIG_REGISTRY`:
|
||||
```json
|
||||
{
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"tag": "latest"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
The `npmPublish` and `tarballDir` option can be used to skip the publishing to the `npm` registry and instead, release the package tarball with another plugin. For example with the [@semantic-release/github](https://github.com/semantic-release/github) plugin:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
["@semantic-release/npm", {
|
||||
"npmPublish": false,
|
||||
"tarballDir": "dist",
|
||||
}],
|
||||
["@semantic-release/github", {
|
||||
"assets": "dist/*.tgz"
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
When publishing from a sub-directory with the `pkgRoot` option, the `package.json` and `npm-shrinkwrap.json` updated with the new version can be moved to another directory with a `postversion`. For example with the [@semantic-release/git](https://github.com/semantic-release/git) plugin:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
["@semantic-release/npm", {
|
||||
"pkgRoot": "dist",
|
||||
}],
|
||||
["@semantic-release/git", {
|
||||
"assets": ["package.json", "npm-shrinkwrap.json"]
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"postversion": "cp -r package.json .. && cp -r npm-shrinkwrap.json .."
|
||||
}
|
||||
}
|
||||
```
|
||||
71
node_modules/@semantic-release/release-notes-generator/README.md
generated
vendored
71
node_modules/@semantic-release/release-notes-generator/README.md
generated
vendored
@@ -1,71 +0,0 @@
|
||||
# **release-notes-generator**
|
||||
|
||||
[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to generate changelog content with [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)
|
||||
|
||||
[](https://github.com/semantic-release/release-notes-generator/actions?query=workflow%3ATest+branch%3Amaster) [](https://www.npmjs.com/package/@semantic-release/release-notes-generator)
|
||||
[](https://www.npmjs.com/package/@semantic-release/release-notes-generator)
|
||||
|
||||
| Step | Description |
|
||||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `generateNotes` | Generate release notes for the commits added since the last release with [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog). |
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
$ npm install @semantic-release/release-notes-generator -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [
|
||||
["@semantic-release/commit-analyzer", {
|
||||
"preset": "angular",
|
||||
"parserOpts": {
|
||||
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
|
||||
}
|
||||
}],
|
||||
["@semantic-release/release-notes-generator", {
|
||||
"preset": "angular",
|
||||
"parserOpts": {
|
||||
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
|
||||
},
|
||||
"writerOpts": {
|
||||
"commitsSort": ["subject", "scope"]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
With this example:
|
||||
- the commits that contains `BREAKING CHANGE`, `BREAKING CHANGES` or `BREAKING` in their body will be considered breaking changes (by default the [angular preset](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/index.js#L14) checks only for `BREAKING CHANGE` and `BREAKING CHANGES`)
|
||||
- the commits will be sorted in the changelog by `subject` then `scope` (by default the [angular preset](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/index.js#L90) sort the commits in the changelog by `scope` then `subject`)
|
||||
|
||||
## Configuration
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Description | Default |
|
||||
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `preset` | [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset (possible values: [`angular`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular), [`atom`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-atom), [`codemirror`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-codemirror), [`ember`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-ember), [`eslint`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint), [`express`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-express), [`jquery`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-jquery), [`jshint`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-jshint), [`conventionalcommits`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits)). | [`angular`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular) |
|
||||
| `config` | NPM package name of a custom [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset. | - |
|
||||
| `parserOpts` | Additional [conventional-commits-parser](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#conventionalcommitsparseroptions) options that will extends the ones loaded by `preset` or `config`. This is convenient to use a [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset with some customizations without having to create a new module. | - |
|
||||
| `writerOpts` | Additional [conventional-commits-writer](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#options) options that will extends the ones loaded by `preset` or `config`. This is convenient to use a [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset with some customizations without having to create a new module. | - |
|
||||
| `host` | The host used to generate links to issues and commits. See [conventional-changelog-writer#host](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#host). | The host from the [`repositoryurl` option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#repositoryurl). |
|
||||
| `linkCompare` | Whether to include a link to compare changes since previous release in the release note. | `true` |
|
||||
| `linkReferences` | Whether to include a link to issues and commits in the release note. See [conventional-changelog-writer#linkreferences](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#linkreferences). | `true` |
|
||||
| `commit` | Keyword used to generate commit links (formatted as `<host>/<owner>/<repository>/<commit>/<commit_sha>`). See [conventional-changelog-writer#commit](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commit). | `commits` for Bitbucket repositories, `commit` otherwise |
|
||||
| `issue` | Keyword used to generate issue links (formatted as `<host>/<owner>/<repository>/<issue>/<issue_number>`). See [conventional-changelog-writer#issue](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#issue). | `issue` for Bitbucket repositories, `issues` otherwise |
|
||||
| `presetConfig` | Additional configuration passed to the [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset. Used for example with [conventional-changelog-conventionalcommits](https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.0.0/README.md). | - |
|
||||
|
||||
**Notes**: in order to use a `preset` it must be installed (for example to use the [eslint preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint) you must install it with `npm install conventional-changelog-eslint -D`)
|
||||
|
||||
**Note**: `config` will be overwritten by the values of `preset`. You should use either `preset` or `config`, but not both.
|
||||
|
||||
**Note**: Individual properties of `parserOpts` and `writerOpts` will override ones loaded with an explicitly set `preset` or `config`. If `preset` or `config` are not set, only the properties set in `parserOpts` and `writerOpts` will be used.
|
||||
|
||||
**Note**: For presets that expects a configuration object, such as [`conventionalcommits`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits), the `presetConfig` option **must** be set.
|
||||
156
node_modules/@semantic-release/release-notes-generator/node_modules/find-up/readme.md
generated
vendored
156
node_modules/@semantic-release/release-notes-generator/node_modules/find-up/readme.md
generated
vendored
@@ -1,156 +0,0 @@
|
||||
# find-up [](https://travis-ci.org/sindresorhus/find-up)
|
||||
|
||||
> Find a file or directory by walking up parent directories
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install find-up
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/
|
||||
└── Users
|
||||
└── sindresorhus
|
||||
├── unicorn.png
|
||||
└── foo
|
||||
└── bar
|
||||
├── baz
|
||||
└── example.js
|
||||
```
|
||||
|
||||
`example.js`
|
||||
|
||||
```js
|
||||
const path = require('path');
|
||||
const findUp = require('find-up');
|
||||
|
||||
(async () => {
|
||||
console.log(await findUp('unicorn.png'));
|
||||
//=> '/Users/sindresorhus/unicorn.png'
|
||||
|
||||
console.log(await findUp(['rainbow.png', 'unicorn.png']));
|
||||
//=> '/Users/sindresorhus/unicorn.png'
|
||||
|
||||
console.log(await findUp(async directory => {
|
||||
const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png'));
|
||||
return hasUnicorns && directory;
|
||||
}, {type: 'directory'}));
|
||||
//=> '/Users/sindresorhus'
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### findUp(name, options?)
|
||||
### findUp(matcher, options?)
|
||||
|
||||
Returns a `Promise` for either the path or `undefined` if it couldn't be found.
|
||||
|
||||
### findUp([...name], options?)
|
||||
|
||||
Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found.
|
||||
|
||||
### findUp.sync(name, options?)
|
||||
### findUp.sync(matcher, options?)
|
||||
|
||||
Returns a path or `undefined` if it couldn't be found.
|
||||
|
||||
### findUp.sync([...name], options?)
|
||||
|
||||
Returns the first path found (by respecting the order of the array) or `undefined` if none could be found.
|
||||
|
||||
#### name
|
||||
|
||||
Type: `string`
|
||||
|
||||
Name of the file or directory to find.
|
||||
|
||||
#### matcher
|
||||
|
||||
Type: `Function`
|
||||
|
||||
A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases.
|
||||
|
||||
When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Directory to start from.
|
||||
|
||||
##### type
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `'file'`<br>
|
||||
Values: `'file'` `'directory'`
|
||||
|
||||
The type of paths that can match.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Allow symbolic links to match if they point to the chosen path type.
|
||||
|
||||
### findUp.exists(path)
|
||||
|
||||
Returns a `Promise<boolean>` of whether the path exists.
|
||||
|
||||
### findUp.sync.exists(path)
|
||||
|
||||
Returns a `boolean` of whether the path exists.
|
||||
|
||||
#### path
|
||||
|
||||
Type: `string`
|
||||
|
||||
Path to a file or directory.
|
||||
|
||||
### findUp.stop
|
||||
|
||||
A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem.
|
||||
|
||||
```js
|
||||
const path = require('path');
|
||||
const findUp = require('find-up');
|
||||
|
||||
(async () => {
|
||||
await findUp(directory => {
|
||||
return path.basename(directory) === 'work' ? findUp.stop : 'logo.png';
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
|
||||
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
|
||||
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
|
||||
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-find-up?utm_source=npm-find-up&utm_medium=referral&utm_campaign=readme">Get professional support for 'find-up' 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>
|
||||
122
node_modules/@semantic-release/release-notes-generator/node_modules/locate-path/readme.md
generated
vendored
122
node_modules/@semantic-release/release-notes-generator/node_modules/locate-path/readme.md
generated
vendored
@@ -1,122 +0,0 @@
|
||||
# locate-path [](https://travis-ci.org/sindresorhus/locate-path)
|
||||
|
||||
> Get the first path that exists on disk of multiple paths
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install locate-path
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Here we find the first file that exists on disk, in array order.
|
||||
|
||||
```js
|
||||
const locatePath = require('locate-path');
|
||||
|
||||
const files = [
|
||||
'unicorn.png',
|
||||
'rainbow.png', // Only this one actually exists on disk
|
||||
'pony.png'
|
||||
];
|
||||
|
||||
(async () => {
|
||||
console(await locatePath(files));
|
||||
//=> 'rainbow'
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### locatePath(paths, [options])
|
||||
|
||||
Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### paths
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
Paths to check.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### concurrency
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `Infinity`<br>
|
||||
Minimum: `1`
|
||||
|
||||
Number of concurrently pending promises.
|
||||
|
||||
##### preserveOrder
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Preserve `paths` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `process.cwd()`
|
||||
|
||||
Current working directory.
|
||||
|
||||
##### type
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `file`<br>
|
||||
Values: `file` `directory`
|
||||
|
||||
The type of paths that can match.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Allow symbolic links to match if they point to the chosen path type.
|
||||
|
||||
### locatePath.sync(paths, [options])
|
||||
|
||||
Returns the first path that exists or `undefined` if none exists.
|
||||
|
||||
#### paths
|
||||
|
||||
Type: `Iterable<string>`
|
||||
|
||||
Paths to check.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Same as above.
|
||||
|
||||
##### type
|
||||
|
||||
Same as above.
|
||||
|
||||
##### allowSymlinks
|
||||
|
||||
Same as above.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
101
node_modules/@semantic-release/release-notes-generator/node_modules/p-limit/readme.md
generated
vendored
101
node_modules/@semantic-release/release-notes-generator/node_modules/p-limit/readme.md
generated
vendored
@@ -1,101 +0,0 @@
|
||||
# p-limit [](https://travis-ci.org/sindresorhus/p-limit)
|
||||
|
||||
> Run multiple promise-returning & async functions with limited concurrency
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-limit
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pLimit = require('p-limit');
|
||||
|
||||
const limit = pLimit(1);
|
||||
|
||||
const input = [
|
||||
limit(() => fetchSomething('foo')),
|
||||
limit(() => fetchSomething('bar')),
|
||||
limit(() => doSomething())
|
||||
];
|
||||
|
||||
(async () => {
|
||||
// Only one promise is run at once
|
||||
const result = await Promise.all(input);
|
||||
console.log(result);
|
||||
})();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### pLimit(concurrency)
|
||||
|
||||
Returns a `limit` function.
|
||||
|
||||
#### concurrency
|
||||
|
||||
Type: `number`\
|
||||
Minimum: `1`\
|
||||
Default: `Infinity`
|
||||
|
||||
Concurrency limit.
|
||||
|
||||
### limit(fn, ...args)
|
||||
|
||||
Returns the promise returned by calling `fn(...args)`.
|
||||
|
||||
#### fn
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Promise-returning/async function.
|
||||
|
||||
#### args
|
||||
|
||||
Any arguments to pass through to `fn`.
|
||||
|
||||
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.
|
||||
|
||||
### limit.activeCount
|
||||
|
||||
The number of promises that are currently running.
|
||||
|
||||
### limit.pendingCount
|
||||
|
||||
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
||||
|
||||
### limit.clearQueue()
|
||||
|
||||
Discard pending promises that are waiting to run.
|
||||
|
||||
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
||||
|
||||
Note: This does not cancel promises that are already running.
|
||||
|
||||
## FAQ
|
||||
|
||||
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
|
||||
|
||||
This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.
|
||||
|
||||
## Related
|
||||
|
||||
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
|
||||
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
|
||||
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
|
||||
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&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>
|
||||
90
node_modules/@semantic-release/release-notes-generator/node_modules/p-locate/readme.md
generated
vendored
90
node_modules/@semantic-release/release-notes-generator/node_modules/p-locate/readme.md
generated
vendored
@@ -1,90 +0,0 @@
|
||||
# p-locate [](https://travis-ci.org/sindresorhus/p-locate)
|
||||
|
||||
> Get the first fulfilled promise that satisfies the provided testing function
|
||||
|
||||
Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-locate
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Here we find the first file that exists on disk, in array order.
|
||||
|
||||
```js
|
||||
const pathExists = require('path-exists');
|
||||
const pLocate = require('p-locate');
|
||||
|
||||
const files = [
|
||||
'unicorn.png',
|
||||
'rainbow.png', // Only this one actually exists on disk
|
||||
'pony.png'
|
||||
];
|
||||
|
||||
(async () => {
|
||||
const foundPath = await pLocate(files, file => pathExists(file));
|
||||
|
||||
console.log(foundPath);
|
||||
//=> 'rainbow'
|
||||
})();
|
||||
```
|
||||
|
||||
*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pLocate(input, tester, [options])
|
||||
|
||||
Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Iterable<Promise | unknown>`
|
||||
|
||||
An iterable of promises/values to test.
|
||||
|
||||
#### tester(element)
|
||||
|
||||
Type: `Function`
|
||||
|
||||
This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### concurrency
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `Infinity`<br>
|
||||
Minimum: `1`
|
||||
|
||||
Number of concurrently pending promises returned by `tester`.
|
||||
|
||||
##### preserveOrder
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Preserve `input` order when searching.
|
||||
|
||||
Disable this to improve performance if you don't care about the order.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
|
||||
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
|
||||
- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -1,52 +0,0 @@
|
||||
# path-exists [](https://travis-ci.org/sindresorhus/path-exists)
|
||||
|
||||
> Check if a path exists
|
||||
|
||||
NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.
|
||||
|
||||
While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.
|
||||
|
||||
Never use this before handling a file though:
|
||||
|
||||
> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install path-exists
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
const pathExists = require('path-exists');
|
||||
|
||||
(async () => {
|
||||
console.log(await pathExists('foo.js'));
|
||||
//=> true
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pathExists(path)
|
||||
|
||||
Returns a `Promise<boolean>` of whether the path exists.
|
||||
|
||||
### pathExists.sync(path)
|
||||
|
||||
Returns a `boolean` of whether the path exists.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -1,77 +0,0 @@
|
||||
# read-pkg-up [](https://travis-ci.org/sindresorhus/read-pkg-up)
|
||||
|
||||
> Read the closest package.json file
|
||||
|
||||
## Why
|
||||
|
||||
- [Finds the closest package.json](https://github.com/sindresorhus/find-up)
|
||||
- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs)
|
||||
- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)
|
||||
- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install read-pkg-up
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const readPkgUp = require('read-pkg-up');
|
||||
|
||||
(async () => {
|
||||
console.log(await readPkgUp());
|
||||
/*
|
||||
{
|
||||
packageJson: {
|
||||
name: 'awesome-package',
|
||||
version: '1.0.0',
|
||||
…
|
||||
},
|
||||
path: '/Users/sindresorhus/dev/awesome-package/package.json'
|
||||
}
|
||||
*/
|
||||
})();
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### readPkgUp(options?)
|
||||
|
||||
Returns a `Promise<object>` or `Promise<undefined>` if no `package.json` was found.
|
||||
|
||||
### readPkgUp.sync(options?)
|
||||
|
||||
Returns the result object or `undefined` if no `package.json` was found.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### cwd
|
||||
|
||||
Type: `string`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
Directory to start looking for a package.json file.
|
||||
|
||||
##### normalize
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
|
||||
|
||||
## read-pkg-up for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of read-pkg-up 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-read-pkg-up?utm_source=npm-read-pkg-up&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## Related
|
||||
|
||||
- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file
|
||||
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
|
||||
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
|
||||
- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json
|
||||
635
node_modules/@semantic-release/release-notes-generator/node_modules/type-fest/readme.md
generated
vendored
635
node_modules/@semantic-release/release-notes-generator/node_modules/type-fest/readme.md
generated
vendored
@@ -1,635 +0,0 @@
|
||||
<div align="center">
|
||||
<br>
|
||||
<br>
|
||||
<img src="media/logo.svg" alt="type-fest" height="300">
|
||||
<br>
|
||||
<br>
|
||||
<b>A collection of essential TypeScript types</b>
|
||||
<br>
|
||||
<hr>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
[](https://travis-ci.com/sindresorhus/type-fest)
|
||||
[](https://www.youtube.com/watch?v=9auOCbH5Ns4)
|
||||
<!-- Commented out until they actually show anything
|
||||
[](https://www.npmjs.com/package/type-fest?activeTab=dependents) [](https://www.npmjs.com/package/type-fest)
|
||||
-->
|
||||
|
||||
Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
|
||||
|
||||
Either add this package as a dependency or copy-paste the needed types. No credit required. 👌
|
||||
|
||||
PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install type-fest
|
||||
```
|
||||
|
||||
*Requires TypeScript >=3.2*
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import {Except} from 'type-fest';
|
||||
|
||||
type Foo = {
|
||||
unicorn: string;
|
||||
rainbow: boolean;
|
||||
};
|
||||
|
||||
type FooWithoutRainbow = Except<Foo, 'rainbow'>;
|
||||
//=> {unicorn: string}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Click the type names for complete docs.
|
||||
|
||||
### Basic
|
||||
|
||||
- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
||||
- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
||||
- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
|
||||
- [`JsonObject`](source/basic.d.ts) - Matches a JSON object.
|
||||
- [`JsonArray`](source/basic.d.ts) - Matches a JSON array.
|
||||
- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value.
|
||||
- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
|
||||
|
||||
### Utilities
|
||||
|
||||
- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type).
|
||||
- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly<T>`.
|
||||
- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
||||
- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.
|
||||
- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys.
|
||||
- [`RequireExactlyOne`](source/require-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more.
|
||||
- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep.
|
||||
- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep.
|
||||
- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729).
|
||||
- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
||||
- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/).
|
||||
- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional.
|
||||
- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required.
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file).
|
||||
|
||||
|
||||
## Declined types
|
||||
|
||||
*If we decline a type addition, we will make sure to document the better solution here.*
|
||||
|
||||
- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider.
|
||||
- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary<number>` vs `Record<string, number>`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now.
|
||||
|
||||
|
||||
## Tips
|
||||
|
||||
### Built-in types
|
||||
|
||||
There are many advanced types most users don't know about.
|
||||
|
||||
- [`Partial<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/KYOwrgtgBAMg9gcxsAbsANlA3gKClAeQDMiAaPKAEWACMwFz8BRAJxbhcagDEBDAF17ocAXxw4AliH7AWRXgGNgUAHJwAJsADCcEEQkJsFXgAcTK3hGAAuKAGd+LKQgDcFEx363wEGrLf46IjIaOi28EioGG5iOArovHZ2qhrAAIJmAEJgEuiaLEb4Jk4oAsoKuvoIYCwCErq2apo6egZQALyF+FCm5pY2UABETelmg1xFnrYAzAAM8xNQQZGh4cFR6AB0xEQUIm4UFa0IABRHVbYACrws-BJCADwjLVUAfACUXfhEHFBnug4oABrYAATygcCIhBoACtgAp+JsQaC7P9ju9Prhut0joCwCZ1GUAGpCMDKTrnAwAbWRPWSyMhKWalQMAF0Dtj8BIoSd8YSZCT0GSOu1OmAQJp9CBgOpPkc7uBgBzOfwABYSOybSnVWp3XQ0sF04FgxnPFkIVkdKB84mkpUUfCxbEsYD8GogKBqjUBKBiWIAen9UGut3u6CeqReBlePXQQQA7skwMl+HAoMU4CgJJoISB0ODeOmbvwIVC1cAcIGmdpzVApDI5IpgJscNL49WMiZsrl8id3lrzScsD0zBYrLZBgAVOCUOCdwa+95uIA)
|
||||
|
||||
```ts
|
||||
interface NodeConfig {
|
||||
appName: string;
|
||||
port: number;
|
||||
}
|
||||
|
||||
class NodeAppBuilder {
|
||||
private configuration: NodeConfig = {
|
||||
appName: 'NodeApp',
|
||||
port: 3000
|
||||
};
|
||||
|
||||
config(config: Partial<NodeConfig>) {
|
||||
type NodeConfigKey = keyof NodeConfig;
|
||||
|
||||
for (const key of Object.keys(config) as NodeConfigKey[]) {
|
||||
const updateValue = config[key];
|
||||
|
||||
if (updateValue === undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.configuration[key] = updateValue;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
// `Partial<NodeConfig>`` allows us to provide only a part of the
|
||||
// NodeConfig interface.
|
||||
new NodeAppBuilder().config({appName: 'ToDoApp'});
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Required<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA)
|
||||
|
||||
```ts
|
||||
interface ContactForm {
|
||||
email?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
function submitContactForm(formData: Required<ContactForm>) {
|
||||
// Send the form data to the server.
|
||||
}
|
||||
|
||||
submitContactForm({
|
||||
email: 'ex@mple.com',
|
||||
message: 'Hi! Could you tell me more about…',
|
||||
});
|
||||
|
||||
// TypeScript error: missing property 'message'
|
||||
submitContactForm({
|
||||
email: 'ex@mple.com',
|
||||
});
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Readonly<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA)
|
||||
|
||||
```ts
|
||||
enum LogLevel {
|
||||
Off,
|
||||
Debug,
|
||||
Error,
|
||||
Fatal
|
||||
};
|
||||
|
||||
interface LoggerConfig {
|
||||
name: string;
|
||||
level: LogLevel;
|
||||
}
|
||||
|
||||
class Logger {
|
||||
config: Readonly<LoggerConfig>;
|
||||
|
||||
constructor({name, level}: LoggerConfig) {
|
||||
this.config = {name, level};
|
||||
Object.freeze(this.config);
|
||||
}
|
||||
}
|
||||
|
||||
const config: LoggerConfig = {
|
||||
name: 'MyApp',
|
||||
level: LogLevel.Debug
|
||||
};
|
||||
|
||||
const logger = new Logger(config);
|
||||
|
||||
// TypeScript Error: cannot assign to read-only property.
|
||||
logger.config.level = LogLevel.Error;
|
||||
|
||||
// We are able to edit config variable as we please.
|
||||
config.level = LogLevel.Error;
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Pick<T, K>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA)
|
||||
|
||||
```ts
|
||||
interface Article {
|
||||
title: string;
|
||||
thumbnail: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
// Creates new type out of the `Article` interface composed
|
||||
// from the Articles' two properties: `title` and `thumbnail`.
|
||||
// `ArticlePreview = {title: string; thumbnail: string}`
|
||||
type ArticlePreview = Pick<Article, 'title' | 'thumbnail'>;
|
||||
|
||||
// Render a list of articles using only title and description.
|
||||
function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement {
|
||||
const articles = document.createElement('div');
|
||||
|
||||
for (const preview of previews) {
|
||||
// Append preview to the articles.
|
||||
}
|
||||
|
||||
return articles;
|
||||
}
|
||||
|
||||
const articles = renderArticlePreviews([
|
||||
{
|
||||
title: 'TypeScript tutorial!',
|
||||
thumbnail: '/assets/ts.jpg'
|
||||
}
|
||||
]);
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Record<K, T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA)
|
||||
|
||||
```ts
|
||||
// Positions of employees in our company.
|
||||
type MemberPosition = 'intern' | 'developer' | 'tech-lead';
|
||||
|
||||
// Interface describing properties of a single employee.
|
||||
interface Employee {
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
yearsOfExperience: number;
|
||||
}
|
||||
|
||||
// Create an object that has all possible `MemberPosition` values set as keys.
|
||||
// Those keys will store a collection of Employees of the same position.
|
||||
const team: Record<MemberPosition, Employee[]> = {
|
||||
intern: [],
|
||||
developer: [],
|
||||
'tech-lead': [],
|
||||
};
|
||||
|
||||
// Our team has decided to help John with his dream of becoming Software Developer.
|
||||
team.intern.push({
|
||||
firstName: 'John',
|
||||
lastName: 'Doe',
|
||||
yearsOfExperience: 0
|
||||
});
|
||||
|
||||
// `Record` forces you to initialize all of the property keys.
|
||||
// TypeScript Error: "tech-lead" property is missing
|
||||
const teamEmpty: Record<MemberPosition, null> = {
|
||||
intern: null,
|
||||
developer: null,
|
||||
};
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Exclude<T, U>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA)
|
||||
|
||||
```ts
|
||||
interface ServerConfig {
|
||||
port: null | string | number;
|
||||
}
|
||||
|
||||
type RequestHandler = (request: Request, response: Response) => void;
|
||||
|
||||
// Exclude `null` type from `null | string | number`.
|
||||
// In case the port is equal to `null`, we will use default value.
|
||||
function getPortValue(port: Exclude<ServerConfig['port'], null>): number {
|
||||
if (typeof port === 'string') {
|
||||
return parseInt(port, 10);
|
||||
}
|
||||
|
||||
return port;
|
||||
}
|
||||
|
||||
function startServer(handler: RequestHandler, config: ServerConfig): void {
|
||||
const server = require('http').createServer(handler);
|
||||
|
||||
const port = config.port === null ? 3000 : getPortValue(config.port);
|
||||
server.listen(port);
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Extract<T, U>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA)
|
||||
|
||||
```ts
|
||||
declare function uniqueId(): number;
|
||||
|
||||
const ID = Symbol('ID');
|
||||
|
||||
interface Person {
|
||||
[ID]: number;
|
||||
name: string;
|
||||
age: number;
|
||||
}
|
||||
|
||||
// Allows changing the person data as long as the property key is of string type.
|
||||
function changePersonData<
|
||||
Obj extends Person,
|
||||
Key extends Extract<keyof Person, string>,
|
||||
Value extends Obj[Key]
|
||||
> (obj: Obj, key: Key, value: Value): void {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
// Tiny Andrew was born.
|
||||
const andrew = {
|
||||
[ID]: uniqueId(),
|
||||
name: 'Andrew',
|
||||
age: 0,
|
||||
};
|
||||
|
||||
// Cool, we're fine with that.
|
||||
changePersonData(andrew, 'name', 'Pony');
|
||||
|
||||
// Goverment didn't like the fact that you wanted to change your identity.
|
||||
changePersonData(andrew, ID, uniqueId());
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`NonNullable<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
Works with <code>strictNullChecks</code> set to <code>true</code>. (Read more <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html">here</a>)
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA)
|
||||
|
||||
```ts
|
||||
type PortNumber = string | number | null;
|
||||
|
||||
/** Part of a class definition that is used to build a server */
|
||||
class ServerBuilder {
|
||||
portNumber!: NonNullable<PortNumber>;
|
||||
|
||||
port(this: ServerBuilder, port: PortNumber): ServerBuilder {
|
||||
if (port == null) {
|
||||
this.portNumber = 8000;
|
||||
} else {
|
||||
this.portNumber = port;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
const serverBuilder = new ServerBuilder();
|
||||
|
||||
serverBuilder
|
||||
.port('8000') // portNumber = '8000'
|
||||
.port(null) // portNumber = 8000
|
||||
.port(3000); // portNumber = 3000
|
||||
|
||||
// TypeScript error
|
||||
serverBuilder.portNumber = null;
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Parameters<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA)
|
||||
|
||||
```ts
|
||||
function shuffle(input: any[]): void {
|
||||
// Mutate array randomly changing its' elements indexes.
|
||||
}
|
||||
|
||||
function callNTimes<Fn extends (...args: any[]) => any> (func: Fn, callCount: number) {
|
||||
// Type that represents the type of the received function parameters.
|
||||
type FunctionParameters = Parameters<Fn>;
|
||||
|
||||
return function (...args: FunctionParameters) {
|
||||
for (let i = 0; i < callCount; i++) {
|
||||
func(...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const shuffleTwice = callNTimes(shuffle, 2);
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`ConstructorParameters<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA)
|
||||
|
||||
```ts
|
||||
class ArticleModel {
|
||||
title: string;
|
||||
content?: string;
|
||||
|
||||
constructor(title: string) {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
||||
|
||||
class InstanceCache<T extends (new (...args: any[]) => any)> {
|
||||
private ClassConstructor: T;
|
||||
private cache: Map<string, InstanceType<T>> = new Map();
|
||||
|
||||
constructor (ctr: T) {
|
||||
this.ClassConstructor = ctr;
|
||||
}
|
||||
|
||||
getInstance (...args: ConstructorParameters<T>): InstanceType<T> {
|
||||
const hash = this.calculateArgumentsHash(...args);
|
||||
|
||||
const existingInstance = this.cache.get(hash);
|
||||
if (existingInstance !== undefined) {
|
||||
return existingInstance;
|
||||
}
|
||||
|
||||
return new this.ClassConstructor(...args);
|
||||
}
|
||||
|
||||
private calculateArgumentsHash(...args: any[]): string {
|
||||
// Calculate hash.
|
||||
return 'hash';
|
||||
}
|
||||
}
|
||||
|
||||
const articleCache = new InstanceCache(ArticleModel);
|
||||
const amazonArticle = articleCache.getInstance('Amazon forests burining!');
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`ReturnType<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)
|
||||
|
||||
```ts
|
||||
/** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */
|
||||
function mapIter<
|
||||
Elem,
|
||||
Func extends (elem: Elem) => any,
|
||||
Ret extends ReturnType<Func>
|
||||
>(iter: Iterable<Elem>, callback: Func): Ret[] {
|
||||
const mapped: Ret[] = [];
|
||||
|
||||
for (const elem of iter) {
|
||||
mapped.push(callback(elem));
|
||||
}
|
||||
|
||||
return mapped;
|
||||
}
|
||||
|
||||
const setObject: Set<string> = new Set();
|
||||
const mapObject: Map<number, string> = new Map();
|
||||
|
||||
mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[]
|
||||
|
||||
mapIter(mapObject, ([key, value]: [number, string]) => {
|
||||
return key % 2 === 0 ? value : 'Odd';
|
||||
}); // string[]
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`InstanceType<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)
|
||||
|
||||
```ts
|
||||
class IdleService {
|
||||
doNothing (): void {}
|
||||
}
|
||||
|
||||
class News {
|
||||
title: string;
|
||||
content: string;
|
||||
|
||||
constructor(title: string, content: string) {
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
|
||||
const instanceCounter: Map<Function, number> = new Map();
|
||||
|
||||
interface Constructor {
|
||||
new(...args: any[]): any;
|
||||
}
|
||||
|
||||
// Keep track how many instances of `Constr` constructor have been created.
|
||||
function getInstance<
|
||||
Constr extends Constructor,
|
||||
Args extends ConstructorParameters<Constr>
|
||||
>(constructor: Constr, ...args: Args): InstanceType<Constr> {
|
||||
let count = instanceCounter.get(constructor) || 0;
|
||||
|
||||
const instance = new constructor(...args);
|
||||
|
||||
instanceCounter.set(constructor, count + 1);
|
||||
|
||||
console.log(`Created ${count + 1} instances of ${Constr.name} class`);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
const idleService = getInstance(IdleService);
|
||||
// Will log: `Created 1 instances of IdleService class`
|
||||
const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...');
|
||||
// Will log: `Created 1 instances of News class`
|
||||
```
|
||||
</details>
|
||||
|
||||
- [`Omit<T, K>`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K.
|
||||
<details>
|
||||
<summary>
|
||||
Example
|
||||
</summary>
|
||||
|
||||
[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA)
|
||||
|
||||
```ts
|
||||
interface Animal {
|
||||
imageUrl: string;
|
||||
species: string;
|
||||
images: string[];
|
||||
paragraphs: string[];
|
||||
}
|
||||
|
||||
// Creates new type with all properties of the `Animal` interface
|
||||
// except 'images' and 'paragraphs' properties. We can use this
|
||||
// type to render small hover tooltip for a wiki entry list.
|
||||
type AnimalShortInfo = Omit<Animal, 'images' | 'paragraphs'>;
|
||||
|
||||
function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement {
|
||||
const container = document.createElement('div');
|
||||
// Internal implementation.
|
||||
return container;
|
||||
}
|
||||
```
|
||||
</details>
|
||||
|
||||
You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types).
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Jarek Radosz](https://github.com/CvX)
|
||||
- [Dimitri Benin](https://github.com/BendingBender)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
(MIT OR CC0-1.0)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-type-fest?utm_source=npm-type-fest&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>
|
||||
93
node_modules/@tootallnate/once/README.md
generated
vendored
93
node_modules/@tootallnate/once/README.md
generated
vendored
@@ -1,93 +0,0 @@
|
||||
# @tootallnate/once
|
||||
|
||||
### Creates a Promise that waits for a single event
|
||||
|
||||
## Installation
|
||||
|
||||
Install with `npm`:
|
||||
|
||||
```bash
|
||||
$ npm install @tootallnate/once
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### once(emitter: EventEmitter, name: string, opts?: OnceOptions): Promise<[...Args]>
|
||||
|
||||
Creates a Promise that waits for event `name` to occur on `emitter`, and resolves
|
||||
the promise with an array of the values provided to the event handler. If an
|
||||
`error` event occurs before the event specified by `name`, then the Promise is
|
||||
rejected with the error argument.
|
||||
|
||||
```typescript
|
||||
import once from '@tootallnate/once';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
const emitter = new EventEmitter();
|
||||
|
||||
setTimeout(() => {
|
||||
emitter.emit('foo', 'bar');
|
||||
}, 100);
|
||||
|
||||
const [result] = await once(emitter, 'foo');
|
||||
console.log({ result });
|
||||
// { result: 'bar' }
|
||||
```
|
||||
|
||||
#### Promise Strong Typing
|
||||
|
||||
The main feature that this module provides over other "once" implementations is that
|
||||
the Promise that is returned is _**strongly typed**_ based on the type of `emitter`
|
||||
and the `name` of the event. Some examples are shown below.
|
||||
|
||||
_The process "exit" event contains a single number for exit code:_
|
||||
|
||||
```typescript
|
||||
const [code] = await once(process, 'exit');
|
||||
// ^ number
|
||||
```
|
||||
_A child process "exit" event contains either an exit code or a signal:_
|
||||
|
||||
```typescript
|
||||
const child = spawn('echo', []);
|
||||
const [code, signal] = await once(child, 'exit');
|
||||
// ^ number | null
|
||||
// ^ string | null
|
||||
```
|
||||
|
||||
_A forked child process "message" event is type `any`, so you can cast the Promise directly:_
|
||||
|
||||
```typescript
|
||||
const child = fork('file.js');
|
||||
|
||||
// With `await`
|
||||
const [message, _]: [WorkerPayload, unknown] = await once(child, 'message');
|
||||
|
||||
// With Promise
|
||||
const messagePromise: Promise<[WorkerPayload, unknown]> = once(child, 'message');
|
||||
|
||||
// Better yet would be to leave it as `any`, and validate the payload
|
||||
// at runtime with i.e. `ajv` + `json-schema-to-typescript`
|
||||
```
|
||||
|
||||
_If the TypeScript definition does not contain an overload for the specified event name, then the Promise will have type `unknown[]` and your code will need to narrow the result manually:_
|
||||
|
||||
```typescript
|
||||
interface CustomEmitter extends EventEmitter {
|
||||
on(name: 'foo', listener: (a: string, b: number) => void): this;
|
||||
}
|
||||
|
||||
const emitter: CustomEmitter = new EventEmitter();
|
||||
|
||||
// "foo" event is a defined overload, so it's properly typed
|
||||
const fooPromise = once(emitter, 'foo');
|
||||
// ^ Promise<[a: string, b: number]>
|
||||
|
||||
// "bar" event in not a defined overload, so it gets `unknown[]`
|
||||
const barPromise = once(emitter, 'bar');
|
||||
// ^ Promise<unknown[]>
|
||||
```
|
||||
|
||||
### OnceOptions
|
||||
|
||||
- `signal` - `AbortSignal` instance to unbind event handlers before the Promise has been fulfilled.
|
||||
16
node_modules/@types/minimist/README.md
generated
vendored
16
node_modules/@types/minimist/README.md
generated
vendored
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/minimist`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for minimist (https://github.com/substack/minimist).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/minimist.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 07 Jul 2021 00:01:41 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), [Necroskillz](https://github.com/Necroskillz), [kamranayub](https://github.com/kamranayub), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
||||
66
node_modules/@types/normalize-package-data/README.md
generated
vendored
66
node_modules/@types/normalize-package-data/README.md
generated
vendored
@@ -1,66 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/normalize-package-data`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data.
|
||||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data/index.d.ts)
|
||||
````ts
|
||||
// Type definitions for normalize-package-data 2.4
|
||||
// Project: https://github.com/npm/normalize-package-data#readme
|
||||
// Definitions by: Jeff Dickey <https://github.com/jdxcode>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = normalize;
|
||||
|
||||
declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void;
|
||||
declare function normalize(data: normalize.Input, strict?: boolean): void;
|
||||
|
||||
declare namespace normalize {
|
||||
type WarnFn = (msg: string) => void;
|
||||
interface Input {[k: string]: any; }
|
||||
|
||||
interface Person {
|
||||
name?: string | undefined;
|
||||
email?: string | undefined;
|
||||
url?: string | undefined;
|
||||
}
|
||||
|
||||
interface Package {
|
||||
[k: string]: any;
|
||||
name: string;
|
||||
version: string;
|
||||
files?: string[] | undefined;
|
||||
bin?: {[k: string]: string } | undefined;
|
||||
man?: string[] | undefined;
|
||||
keywords?: string[] | undefined;
|
||||
author?: Person | undefined;
|
||||
maintainers?: Person[] | undefined;
|
||||
contributors?: Person[] | undefined;
|
||||
bundleDependencies?: {[name: string]: string; } | undefined;
|
||||
dependencies?: {[name: string]: string; } | undefined;
|
||||
devDependencies?: {[name: string]: string; } | undefined;
|
||||
optionalDependencies?: {[name: string]: string; } | undefined;
|
||||
description?: string | undefined;
|
||||
engines?: {[type: string]: string } | undefined;
|
||||
license?: string | undefined;
|
||||
repository?: { type: string, url: string } | undefined;
|
||||
bugs?: { url: string, email?: string | undefined } | { url?: string | undefined, email: string } | undefined;
|
||||
homepage?: string | undefined;
|
||||
scripts?: {[k: string]: string} | undefined;
|
||||
readme: string;
|
||||
_id: string;
|
||||
}
|
||||
}
|
||||
|
||||
````
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 07 Jul 2021 16:31:34 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Jeff Dickey](https://github.com/jdxcode).
|
||||
16
node_modules/@types/retry/README.md
generated
vendored
16
node_modules/@types/retry/README.md
generated
vendored
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/retry`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for retry (https://github.com/tim-kos/node-retry).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/retry
|
||||
|
||||
Additional Details
|
||||
* Last updated: Thu, 03 Jan 2019 17:45:51 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by Stan Goldmann <https://github.com/krenor>, BendingBender <https://github.com/BendingBender>.
|
||||
8
node_modules/JSONStream/.travis.yml
generated
vendored
8
node_modules/JSONStream/.travis.yml
generated
vendored
@@ -1,8 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 4
|
||||
- 5
|
||||
- 6
|
||||
sudo: false
|
||||
|
||||
|
||||
145
node_modules/agent-base/README.md
generated
vendored
145
node_modules/agent-base/README.md
generated
vendored
@@ -1,145 +0,0 @@
|
||||
agent-base
|
||||
==========
|
||||
### Turn a function into an [`http.Agent`][http.Agent] instance
|
||||
[](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI)
|
||||
|
||||
This module provides an `http.Agent` generator. That is, you pass it an async
|
||||
callback function, and it returns a new `http.Agent` instance that will invoke the
|
||||
given callback function when sending outbound HTTP requests.
|
||||
|
||||
#### Some subclasses:
|
||||
|
||||
Here's some more interesting uses of `agent-base`.
|
||||
Send a pull request to list yours!
|
||||
|
||||
* [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
|
||||
* [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
|
||||
* [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
|
||||
* [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Install with `npm`:
|
||||
|
||||
``` bash
|
||||
$ npm install agent-base
|
||||
```
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
Here's a minimal example that creates a new `net.Socket` connection to the server
|
||||
for every HTTP request (i.e. the equivalent of `agent: false` option):
|
||||
|
||||
```js
|
||||
var net = require('net');
|
||||
var tls = require('tls');
|
||||
var url = require('url');
|
||||
var http = require('http');
|
||||
var agent = require('agent-base');
|
||||
|
||||
var endpoint = 'http://nodejs.org/api/';
|
||||
var parsed = url.parse(endpoint);
|
||||
|
||||
// This is the important part!
|
||||
parsed.agent = agent(function (req, opts) {
|
||||
var socket;
|
||||
// `secureEndpoint` is true when using the https module
|
||||
if (opts.secureEndpoint) {
|
||||
socket = tls.connect(opts);
|
||||
} else {
|
||||
socket = net.connect(opts);
|
||||
}
|
||||
return socket;
|
||||
});
|
||||
|
||||
// Everything else works just like normal...
|
||||
http.get(parsed, function (res) {
|
||||
console.log('"response" event!', res.headers);
|
||||
res.pipe(process.stdout);
|
||||
});
|
||||
```
|
||||
|
||||
Returning a Promise or using an `async` function is also supported:
|
||||
|
||||
```js
|
||||
agent(async function (req, opts) {
|
||||
await sleep(1000);
|
||||
// etc…
|
||||
});
|
||||
```
|
||||
|
||||
Return another `http.Agent` instance to "pass through" the responsibility
|
||||
for that HTTP request to that agent:
|
||||
|
||||
```js
|
||||
agent(function (req, opts) {
|
||||
return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
## Agent(Function callback[, Object options]) → [http.Agent][]
|
||||
|
||||
Creates a base `http.Agent` that will execute the callback function `callback`
|
||||
for every HTTP request that it is used as the `agent` for. The callback function
|
||||
is responsible for creating a `stream.Duplex` instance of some kind that will be
|
||||
used as the underlying socket in the HTTP request.
|
||||
|
||||
The `options` object accepts the following properties:
|
||||
|
||||
* `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional).
|
||||
|
||||
The callback function should have the following signature:
|
||||
|
||||
### callback(http.ClientRequest req, Object options, Function cb) → undefined
|
||||
|
||||
The ClientRequest `req` can be accessed to read request headers and
|
||||
and the path, etc. The `options` object contains the options passed
|
||||
to the `http.request()`/`https.request()` function call, and is formatted
|
||||
to be directly passed to `net.connect()`/`tls.connect()`, or however
|
||||
else you want a Socket to be created. Pass the created socket to
|
||||
the callback function `cb` once created, and the HTTP request will
|
||||
continue to proceed.
|
||||
|
||||
If the `https` module is used to invoke the HTTP request, then the
|
||||
`secureEndpoint` property on `options` _will be set to `true`_.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
||||
|
||||
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.
|
||||
|
||||
[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
|
||||
[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
|
||||
[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
|
||||
[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
|
||||
[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
|
||||
61
node_modules/aggregate-error/readme.md
generated
vendored
61
node_modules/aggregate-error/readme.md
generated
vendored
@@ -1,61 +0,0 @@
|
||||
# aggregate-error [](https://travis-ci.org/sindresorhus/aggregate-error)
|
||||
|
||||
> Create an error from multiple errors
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install aggregate-error
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const AggregateError = require('aggregate-error');
|
||||
|
||||
const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);
|
||||
|
||||
throw error;
|
||||
/*
|
||||
AggregateError:
|
||||
Error: foo
|
||||
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)
|
||||
Error: bar
|
||||
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||
Error: baz
|
||||
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||
at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
|
||||
at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
|
||||
at Module._compile (module.js:556:32)
|
||||
at Object.Module._extensions..js (module.js:565:10)
|
||||
at Module.load (module.js:473:32)
|
||||
at tryModuleLoad (module.js:432:12)
|
||||
at Function.Module._load (module.js:424:3)
|
||||
at Module.runMain (module.js:590:10)
|
||||
at run (bootstrap_node.js:394:7)
|
||||
at startup (bootstrap_node.js:149:9)
|
||||
*/
|
||||
|
||||
for (const individualError of error) {
|
||||
console.log(individualError);
|
||||
}
|
||||
//=> [Error: foo]
|
||||
//=> [Error: bar]
|
||||
//=> [Error: baz]
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### AggregateError(errors)
|
||||
|
||||
Returns an `Error` that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors.
|
||||
|
||||
#### errors
|
||||
|
||||
Type: `Array<Error|Object|string>`
|
||||
|
||||
If a string, a new `Error` is created with the string as the error message.<br>
|
||||
If a non-Error object, a new `Error` is created with all properties from the object copied over.
|
||||
245
node_modules/ansi-escapes/readme.md
generated
vendored
245
node_modules/ansi-escapes/readme.md
generated
vendored
@@ -1,245 +0,0 @@
|
||||
# ansi-escapes
|
||||
|
||||
> [ANSI escape codes](http://www.termsys.demon.co.uk/vtansi.htm) for manipulating the terminal
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-escapes
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import ansiEscapes from 'ansi-escapes';
|
||||
|
||||
// Moves the cursor two rows up and to the left
|
||||
process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);
|
||||
//=> '\u001B[2A\u001B[1000D'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### cursorTo(x, y?)
|
||||
|
||||
Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
|
||||
|
||||
### cursorMove(x, y?)
|
||||
|
||||
Set the position of the cursor relative to its current position.
|
||||
|
||||
### cursorUp(count)
|
||||
|
||||
Move cursor up a specific amount of rows. Default is `1`.
|
||||
|
||||
### cursorDown(count)
|
||||
|
||||
Move cursor down a specific amount of rows. Default is `1`.
|
||||
|
||||
### cursorForward(count)
|
||||
|
||||
Move cursor forward a specific amount of columns. Default is `1`.
|
||||
|
||||
### cursorBackward(count)
|
||||
|
||||
Move cursor backward a specific amount of columns. Default is `1`.
|
||||
|
||||
### cursorLeft
|
||||
|
||||
Move cursor to the left side.
|
||||
|
||||
### cursorSavePosition
|
||||
|
||||
Save cursor position.
|
||||
|
||||
### cursorRestorePosition
|
||||
|
||||
Restore saved cursor position.
|
||||
|
||||
### cursorGetPosition
|
||||
|
||||
Get cursor position.
|
||||
|
||||
### cursorNextLine
|
||||
|
||||
Move cursor to the next line.
|
||||
|
||||
### cursorPrevLine
|
||||
|
||||
Move cursor to the previous line.
|
||||
|
||||
### cursorHide
|
||||
|
||||
Hide cursor.
|
||||
|
||||
### cursorShow
|
||||
|
||||
Show cursor.
|
||||
|
||||
### eraseLines(count)
|
||||
|
||||
Erase from the current cursor position up the specified amount of rows.
|
||||
|
||||
### eraseEndLine
|
||||
|
||||
Erase from the current cursor position to the end of the current line.
|
||||
|
||||
### eraseStartLine
|
||||
|
||||
Erase from the current cursor position to the start of the current line.
|
||||
|
||||
### eraseLine
|
||||
|
||||
Erase the entire current line.
|
||||
|
||||
### eraseDown
|
||||
|
||||
Erase the screen from the current line down to the bottom of the screen.
|
||||
|
||||
### eraseUp
|
||||
|
||||
Erase the screen from the current line up to the top of the screen.
|
||||
|
||||
### eraseScreen
|
||||
|
||||
Erase the screen and move the cursor the top left position.
|
||||
|
||||
### scrollUp
|
||||
|
||||
Scroll display up one line.
|
||||
|
||||
### scrollDown
|
||||
|
||||
Scroll display down one line.
|
||||
|
||||
### clearScreen
|
||||
|
||||
Clear the terminal screen. (Viewport)
|
||||
|
||||
### clearTerminal
|
||||
|
||||
Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)
|
||||
|
||||
### beep
|
||||
|
||||
Output a beeping sound.
|
||||
|
||||
### link(text, url)
|
||||
|
||||
Create a clickable link.
|
||||
|
||||
[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support.
|
||||
|
||||
### image(filePath, options?)
|
||||
|
||||
Display an image.
|
||||
|
||||
*Currently only supported on iTerm2 >=3*
|
||||
|
||||
See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Buffer`
|
||||
|
||||
Buffer of an image. Usually read in with `fs.readFile()`.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### width
|
||||
##### height
|
||||
|
||||
Type: `string | number`
|
||||
|
||||
The width and height are given as a number followed by a unit, or the word "auto".
|
||||
|
||||
- `N`: N character cells.
|
||||
- `Npx`: N pixels.
|
||||
- `N%`: N percent of the session's width or height.
|
||||
- `auto`: The image's inherent size will be used to determine an appropriate dimension.
|
||||
|
||||
##### preserveAspectRatio
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
### iTerm.setCwd(path?)
|
||||
|
||||
Type: `string`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
[Inform iTerm2](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click).
|
||||
|
||||
### iTerm.annotation(message, options?)
|
||||
|
||||
Creates an escape code to display an "annotation" in iTerm2.
|
||||
|
||||
An annotation looks like this when shown:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/924465/64382136-b60ac700-cfe9-11e9-8a35-9682e8dc4b72.png" width="500">
|
||||
|
||||
See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information.
|
||||
|
||||
#### message
|
||||
|
||||
Type: `string`
|
||||
|
||||
The message to display within the annotation.
|
||||
|
||||
The `|` character is disallowed and will be stripped.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### length
|
||||
|
||||
Type: `number`\
|
||||
Default: The remainder of the line
|
||||
|
||||
Nonzero number of columns to annotate.
|
||||
|
||||
##### x
|
||||
|
||||
Type: `number`\
|
||||
Default: Cursor position
|
||||
|
||||
Starting X coordinate.
|
||||
|
||||
Must be used with `y` and `length`.
|
||||
|
||||
##### y
|
||||
|
||||
Type: `number`\
|
||||
Default: Cursor position
|
||||
|
||||
Starting Y coordinate.
|
||||
|
||||
Must be used with `x` and `length`.
|
||||
|
||||
##### isHidden
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Create a "hidden" annotation.
|
||||
|
||||
Annotations created this way can be shown using the "Show Annotations" iTerm command.
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-escapes?utm_source=npm-ansi-escapes&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>
|
||||
78
node_modules/ansi-regex/readme.md
generated
vendored
78
node_modules/ansi-regex/readme.md
generated
vendored
@@ -1,78 +0,0 @@
|
||||
# ansi-regex
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
||||
//=> ['\u001B[4m']
|
||||
|
||||
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
||||
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### ansiRegex(options?)
|
||||
|
||||
Returns a regex for matching ANSI escape codes.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### onlyFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false` *(Matches any ANSI escape codes in a string)*
|
||||
|
||||
Match only the first ANSI escape.
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&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>
|
||||
147
node_modules/ansi-styles/readme.md
generated
vendored
147
node_modules/ansi-styles/readme.md
generated
vendored
@@ -1,147 +0,0 @@
|
||||
# ansi-styles [](https://travis-ci.org/chalk/ansi-styles)
|
||||
|
||||
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
||||
|
||||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
||||
|
||||
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-styles
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const style = require('ansi-styles');
|
||||
|
||||
console.log(`${style.green.open}Hello world!${style.green.close}`);
|
||||
|
||||
|
||||
// Color conversion between 16/256/truecolor
|
||||
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
|
||||
// may be degraded to fit that color palette. This means terminals
|
||||
// that do not support 16 million colors will best-match the
|
||||
// original color.
|
||||
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
|
||||
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
|
||||
console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(Not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(Not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `gray` ("bright black")
|
||||
- `redBright`
|
||||
- `greenBright`
|
||||
- `yellowBright`
|
||||
- `blueBright`
|
||||
- `magentaBright`
|
||||
- `cyanBright`
|
||||
- `whiteBright`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
- `bgBlackBright`
|
||||
- `bgRedBright`
|
||||
- `bgGreenBright`
|
||||
- `bgYellowBright`
|
||||
- `bgBlueBright`
|
||||
- `bgMagentaBright`
|
||||
- `bgCyanBright`
|
||||
- `bgWhiteBright`
|
||||
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `style.modifier`
|
||||
- `style.color`
|
||||
- `style.bgColor`
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.color.green.open);
|
||||
```
|
||||
|
||||
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(style.codes.get(36));
|
||||
//=> 39
|
||||
```
|
||||
|
||||
|
||||
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
|
||||
|
||||
To use these, call the associated conversion function with the intended output, for example:
|
||||
|
||||
```js
|
||||
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
|
||||
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
|
||||
|
||||
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
|
||||
|
||||
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
|
||||
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
62
node_modules/ansicolors/README.md
generated
vendored
62
node_modules/ansicolors/README.md
generated
vendored
@@ -1,62 +0,0 @@
|
||||
# ansicolors [](http://next.travis-ci.org/thlorenz/ansicolors)
|
||||
|
||||
Functions that surround a string with ansicolor codes so it prints in color.
|
||||
|
||||
In case you need styles, like `bold`, have a look at [ansistyles](https://github.com/thlorenz/ansistyles).
|
||||
|
||||
## Installation
|
||||
|
||||
npm install ansicolors
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var colors = require('ansicolors');
|
||||
|
||||
// foreground colors
|
||||
var redHerring = colors.red('herring');
|
||||
var blueMoon = colors.blue('moon');
|
||||
var brighBlueMoon = colors.brightBlue('moon');
|
||||
|
||||
console.log(redHerring); // this will print 'herring' in red
|
||||
console.log(blueMoon); // this 'moon' in blue
|
||||
console.log(brightBlueMoon); // I think you got the idea
|
||||
|
||||
// background colors
|
||||
console.log(colors.bgYellow('printed on yellow background'));
|
||||
console.log(colors.bgBrightBlue('printed on bright blue background'));
|
||||
|
||||
// mixing background and foreground colors
|
||||
// below two lines have same result (order in which bg and fg are combined doesn't matter)
|
||||
console.log(colors.bgYellow(colors.blue('printed on yellow background in blue')));
|
||||
console.log(colors.blue(colors.bgYellow('printed on yellow background in blue')));
|
||||
```
|
||||
|
||||
## Advanced API
|
||||
|
||||
**ansicolors** allows you to access opening and closing escape sequences separately.
|
||||
|
||||
```js
|
||||
var colors = require('ansicolors');
|
||||
|
||||
function inspect(obj, depth) {
|
||||
return require('util').inspect(obj, false, depth || 5, true);
|
||||
}
|
||||
|
||||
console.log('open blue', inspect(colors.open.blue));
|
||||
console.log('close bgBlack', inspect(colors.close.bgBlack));
|
||||
|
||||
// => open blue '\u001b[34m'
|
||||
// close bgBlack '\u001b[49m'
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Look at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via:
|
||||
|
||||
npm explore ansicolors && npm test
|
||||
|
||||
## Alternatives
|
||||
|
||||
**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool,
|
||||
I'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js).
|
||||
216
node_modules/argparse/CHANGELOG.md
generated
vendored
216
node_modules/argparse/CHANGELOG.md
generated
vendored
@@ -1,216 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [2.0.1] - 2020-08-29
|
||||
### Fixed
|
||||
- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150.
|
||||
|
||||
|
||||
## [2.0.0] - 2020-08-14
|
||||
### Changed
|
||||
- Full rewrite. Now port from python 3.9.0 & more precise following.
|
||||
See [doc](./doc) for difference and migration info.
|
||||
- node.js 10+ required
|
||||
- Removed most of local docs in favour of original ones.
|
||||
|
||||
|
||||
## [1.0.10] - 2018-02-15
|
||||
### Fixed
|
||||
- Use .concat instead of + for arrays, #122.
|
||||
|
||||
|
||||
## [1.0.9] - 2016-09-29
|
||||
### Changed
|
||||
- Rerelease after 1.0.8 - deps cleanup.
|
||||
|
||||
|
||||
## [1.0.8] - 2016-09-29
|
||||
### Changed
|
||||
- Maintenance (deps bump, fix node 6.5+ tests, coverage report).
|
||||
|
||||
|
||||
## [1.0.7] - 2016-03-17
|
||||
### Changed
|
||||
- Teach `addArgument` to accept string arg names. #97, @tomxtobin.
|
||||
|
||||
|
||||
## [1.0.6] - 2016-02-06
|
||||
### Changed
|
||||
- Maintenance: moved to eslint & updated CS.
|
||||
|
||||
|
||||
## [1.0.5] - 2016-02-05
|
||||
### Changed
|
||||
- Removed lodash dependency to significantly reduce install size.
|
||||
Thanks to @mourner.
|
||||
|
||||
|
||||
## [1.0.4] - 2016-01-17
|
||||
### Changed
|
||||
- Maintenance: lodash update to 4.0.0.
|
||||
|
||||
|
||||
## [1.0.3] - 2015-10-27
|
||||
### Fixed
|
||||
- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple.
|
||||
|
||||
|
||||
## [1.0.2] - 2015-03-22
|
||||
### Changed
|
||||
- Relaxed lodash version dependency.
|
||||
|
||||
|
||||
## [1.0.1] - 2015-02-20
|
||||
### Changed
|
||||
- Changed dependencies to be compatible with ancient nodejs.
|
||||
|
||||
|
||||
## [1.0.0] - 2015-02-19
|
||||
### Changed
|
||||
- Maintenance release.
|
||||
- Replaced `underscore` with `lodash`.
|
||||
- Bumped version to 1.0.0 to better reflect semver meaning.
|
||||
- HISTORY.md -> CHANGELOG.md
|
||||
|
||||
|
||||
## [0.1.16] - 2013-12-01
|
||||
### Changed
|
||||
- Maintenance release. Updated dependencies and docs.
|
||||
|
||||
|
||||
## [0.1.15] - 2013-05-13
|
||||
### Fixed
|
||||
- Fixed #55, @trebor89
|
||||
|
||||
|
||||
## [0.1.14] - 2013-05-12
|
||||
### Fixed
|
||||
- Fixed #62, @maxtaco
|
||||
|
||||
|
||||
## [0.1.13] - 2013-04-08
|
||||
### Changed
|
||||
- Added `.npmignore` to reduce package size
|
||||
|
||||
|
||||
## [0.1.12] - 2013-02-10
|
||||
### Fixed
|
||||
- Fixed conflictHandler (#46), @hpaulj
|
||||
|
||||
|
||||
## [0.1.11] - 2013-02-07
|
||||
### Added
|
||||
- Added 70+ tests (ported from python), @hpaulj
|
||||
- Added conflictHandler, @applepicke
|
||||
- Added fromfilePrefixChar, @hpaulj
|
||||
|
||||
### Fixed
|
||||
- Multiple bugfixes, @hpaulj
|
||||
|
||||
|
||||
## [0.1.10] - 2012-12-30
|
||||
### Added
|
||||
- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion)
|
||||
support, thanks to @hpaulj
|
||||
|
||||
### Fixed
|
||||
- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj
|
||||
|
||||
|
||||
## [0.1.9] - 2012-12-27
|
||||
### Fixed
|
||||
- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj
|
||||
- Fixed default value behavior with `*` positionals, thanks to @hpaulj
|
||||
- Improve `getDefault()` behavior, thanks to @hpaulj
|
||||
- Improve negative argument parsing, thanks to @hpaulj
|
||||
|
||||
|
||||
## [0.1.8] - 2012-12-01
|
||||
### Fixed
|
||||
- Fixed parser parents (issue #19), thanks to @hpaulj
|
||||
- Fixed negative argument parse (issue #20), thanks to @hpaulj
|
||||
|
||||
|
||||
## [0.1.7] - 2012-10-14
|
||||
### Fixed
|
||||
- Fixed 'choices' argument parse (issue #16)
|
||||
- Fixed stderr output (issue #15)
|
||||
|
||||
|
||||
## [0.1.6] - 2012-09-09
|
||||
### Fixed
|
||||
- Fixed check for conflict of options (thanks to @tomxtobin)
|
||||
|
||||
|
||||
## [0.1.5] - 2012-09-03
|
||||
### Fixed
|
||||
- Fix parser #setDefaults method (thanks to @tomxtobin)
|
||||
|
||||
|
||||
## [0.1.4] - 2012-07-30
|
||||
### Fixed
|
||||
- Fixed pseudo-argument support (thanks to @CGamesPlay)
|
||||
- Fixed addHelp default (should be true), if not set (thanks to @benblank)
|
||||
|
||||
|
||||
## [0.1.3] - 2012-06-27
|
||||
### Fixed
|
||||
- Fixed formatter api name: Formatter -> HelpFormatter
|
||||
|
||||
|
||||
## [0.1.2] - 2012-05-29
|
||||
### Fixed
|
||||
- Removed excess whitespace in help
|
||||
- Fixed error reporting, when parcer with subcommands
|
||||
called with empty arguments
|
||||
|
||||
### Added
|
||||
- Added basic tests
|
||||
|
||||
|
||||
## [0.1.1] - 2012-05-23
|
||||
### Fixed
|
||||
- Fixed line wrapping in help formatter
|
||||
- Added better error reporting on invalid arguments
|
||||
|
||||
|
||||
## [0.1.0] - 2012-05-16
|
||||
### Added
|
||||
- First release.
|
||||
|
||||
|
||||
[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0
|
||||
[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10
|
||||
[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9
|
||||
[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8
|
||||
[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7
|
||||
[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6
|
||||
[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5
|
||||
[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4
|
||||
[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3
|
||||
[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2
|
||||
[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1
|
||||
[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0
|
||||
[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16
|
||||
[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15
|
||||
[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14
|
||||
[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13
|
||||
[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12
|
||||
[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11
|
||||
[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10
|
||||
[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9
|
||||
[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8
|
||||
[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7
|
||||
[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6
|
||||
[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5
|
||||
[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4
|
||||
[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3
|
||||
[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2
|
||||
[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1
|
||||
[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0
|
||||
84
node_modules/argparse/README.md
generated
vendored
84
node_modules/argparse/README.md
generated
vendored
@@ -1,84 +0,0 @@
|
||||
argparse
|
||||
========
|
||||
|
||||
[](http://travis-ci.org/nodeca/argparse)
|
||||
[](https://www.npmjs.org/package/argparse)
|
||||
|
||||
CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)).
|
||||
|
||||
**Difference with original.**
|
||||
|
||||
- JS has no keyword arguments support.
|
||||
- Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`.
|
||||
- JS has no python's types `int`, `float`, ...
|
||||
- Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`.
|
||||
- `%r` format specifier uses `require('util').inspect()`.
|
||||
|
||||
More details in [doc](./doc).
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
`test.js` file:
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
const { ArgumentParser } = require('argparse');
|
||||
const { version } = require('./package.json');
|
||||
|
||||
const parser = new ArgumentParser({
|
||||
description: 'Argparse example'
|
||||
});
|
||||
|
||||
parser.add_argument('-v', '--version', { action: 'version', version });
|
||||
parser.add_argument('-f', '--foo', { help: 'foo bar' });
|
||||
parser.add_argument('-b', '--bar', { help: 'bar foo' });
|
||||
parser.add_argument('--baz', { help: 'baz bar' });
|
||||
|
||||
console.dir(parser.parse_args());
|
||||
```
|
||||
|
||||
Display help:
|
||||
|
||||
```
|
||||
$ ./test.js -h
|
||||
usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
|
||||
|
||||
Argparse example
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-v, --version show program's version number and exit
|
||||
-f FOO, --foo FOO foo bar
|
||||
-b BAR, --bar BAR bar foo
|
||||
--baz BAZ baz bar
|
||||
```
|
||||
|
||||
Parse arguments:
|
||||
|
||||
```
|
||||
$ ./test.js -f=3 --bar=4 --baz 5
|
||||
{ foo: '3', bar: '4', baz: '5' }
|
||||
```
|
||||
|
||||
|
||||
API docs
|
||||
--------
|
||||
|
||||
Since this is a port with minimal divergence, there's no separate documentation.
|
||||
Use original one instead, with notes about difference.
|
||||
|
||||
1. [Original doc](https://docs.python.org/3.9/library/argparse.html).
|
||||
2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html).
|
||||
3. [Difference with python](./doc).
|
||||
|
||||
|
||||
argparse for enterprise
|
||||
-----------------------
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of argparse 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-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
42
node_modules/argv-formatter/README.md
generated
vendored
42
node_modules/argv-formatter/README.md
generated
vendored
@@ -1,42 +0,0 @@
|
||||
argv-formatter
|
||||
==============
|
||||
|
||||
Bizarro [minimist](https://github.com/substack/minimist): transform an options object into into a `process.argv`-like array. Helpful for using `child_process` and passing complex arguments more easily.
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
$ npm install --save argv-formatter
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
#### `formatter.format(object)` -> `Array`
|
||||
|
||||
Accepts an `object` of containing options and arguments and returns an array of arguments.
|
||||
|
||||
* options with a value of `true` will be included with a flag only (`{R: true}` -> `['-R']`)
|
||||
* options that are falsey will be removed
|
||||
* all values will be stringified, (`{D: new Date(0)}` -> `['-D', 'Thurs Jan 1 1970...']`)
|
||||
* arguments can be passed under the `_` key as a value or array of values
|
||||
|
||||
## Examples
|
||||
|
||||
To generate arguments to a `git log` command for printing the short hashes of commits that have changed our test files:
|
||||
```js
|
||||
var args = formatter.format({
|
||||
_: './test/*',
|
||||
format: '%h'
|
||||
});
|
||||
console.log(args.join(' ')); // --format=%h ./test/*
|
||||
|
||||
```
|
||||
|
||||
[git-log-parser](https://github.com/bendrucker/git-log-parser) uses this to spawn a `git` process:
|
||||
|
||||
```js
|
||||
var spawn = require('child_process').spawn;
|
||||
var formatter = require('argv-formatter');
|
||||
var args = formatter.format(options);
|
||||
var child = spawn('git', ['log'].concat(args));
|
||||
```
|
||||
51
node_modules/array-ify/README.md
generated
vendored
51
node_modules/array-ify/README.md
generated
vendored
@@ -1,51 +0,0 @@
|
||||
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
> Turn anything into an array
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save array-ify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var arrayify = require('array-ify');
|
||||
|
||||
arrayify('unicorn');
|
||||
//=> ['unicorn']
|
||||
|
||||
arrayify(['unicorn']);
|
||||
//=> ['unicorn']
|
||||
|
||||
arrayify(null);
|
||||
//=> [null]
|
||||
|
||||
arrayify(undefined);
|
||||
//=> [undefined]
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [arrify](https://github.com/sindresorhus/arrify) - Convert a value to an array
|
||||
|
||||
The difference that is this module does **NOT** turn `null` or `undefined` to an empty array.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Steve Mao](https://github.com/stevemao)
|
||||
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/array-ify.svg
|
||||
[npm-url]: https://npmjs.org/package/array-ify
|
||||
[travis-image]: https://travis-ci.org/stevemao/array-ify.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/stevemao/array-ify
|
||||
[daviddm-image]: https://david-dm.org/stevemao/array-ify.svg?theme=shields.io
|
||||
[daviddm-url]: https://david-dm.org/stevemao/array-ify
|
||||
[coveralls-image]: https://coveralls.io/repos/stevemao/array-ify/badge.svg
|
||||
[coveralls-url]: https://coveralls.io/r/stevemao/array-ify
|
||||
34
node_modules/array-union/readme.md
generated
vendored
34
node_modules/array-union/readme.md
generated
vendored
@@ -1,34 +0,0 @@
|
||||
# array-union [](https://travis-ci.org/sindresorhus/array-union)
|
||||
|
||||
> Create an array of unique values, in order, from the input arrays
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install array-union
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const arrayUnion = require('array-union');
|
||||
|
||||
arrayUnion([1, 1, 2, 3], [2, 3]);
|
||||
//=> [1, 2, 3]
|
||||
|
||||
arrayUnion(['foo', 'foo', 'bar']);
|
||||
//=> ['foo', 'bar']
|
||||
|
||||
arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
|
||||
//=> ['🐱', '🦄', '🐻', '🌈']
|
||||
|
||||
arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
|
||||
//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
36
node_modules/arrify/readme.md
generated
vendored
36
node_modules/arrify/readme.md
generated
vendored
@@ -1,36 +0,0 @@
|
||||
# arrify [](https://travis-ci.org/sindresorhus/arrify)
|
||||
|
||||
> Convert a value to an array
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save arrify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const arrify = require('arrify');
|
||||
|
||||
arrify('unicorn');
|
||||
//=> ['unicorn']
|
||||
|
||||
arrify(['unicorn']);
|
||||
//=> ['unicorn']
|
||||
|
||||
arrify(null);
|
||||
//=> []
|
||||
|
||||
arrify(undefined);
|
||||
//=> []
|
||||
```
|
||||
|
||||
*Supplying `null` or `undefined` results in an empty array.*
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
2
node_modules/balanced-match/.github/FUNDING.yml
generated
vendored
2
node_modules/balanced-match/.github/FUNDING.yml
generated
vendored
@@ -1,2 +0,0 @@
|
||||
tidelift: "npm/balanced-match"
|
||||
patreon: juliangruber
|
||||
21
node_modules/balanced-match/LICENSE.md
generated
vendored
21
node_modules/balanced-match/LICENSE.md
generated
vendored
@@ -1,21 +0,0 @@
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.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.
|
||||
97
node_modules/balanced-match/README.md
generated
vendored
97
node_modules/balanced-match/README.md
generated
vendored
@@ -1,97 +0,0 @@
|
||||
# balanced-match
|
||||
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
|
||||
|
||||
[](http://travis-ci.org/juliangruber/balanced-match)
|
||||
[](https://www.npmjs.org/package/balanced-match)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/balanced-match)
|
||||
|
||||
## Example
|
||||
|
||||
Get the first matching pair of braces:
|
||||
|
||||
```js
|
||||
var balanced = require('balanced-match');
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'));
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'));
|
||||
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
|
||||
```
|
||||
|
||||
The matches are:
|
||||
|
||||
```bash
|
||||
$ node example.js
|
||||
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
|
||||
{ start: 3,
|
||||
end: 9,
|
||||
pre: 'pre',
|
||||
body: 'first',
|
||||
post: 'between{second}post' }
|
||||
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### var m = balanced(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
object with those keys:
|
||||
|
||||
* **start** the index of the first match of `a`
|
||||
* **end** the index of the matching `b`
|
||||
* **pre** the preamble, `a` and `b` not included
|
||||
* **body** the match, `a` and `b` not included
|
||||
* **post** the postscript, `a` and `b` not included
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
|
||||
|
||||
### var r = balanced.range(a, b, str)
|
||||
|
||||
For the first non-nested matching pair of `a` and `b` in `str`, return an
|
||||
array with indexes: `[ <a index>, <b index> ]`.
|
||||
|
||||
If there's no match, `undefined` will be returned.
|
||||
|
||||
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install balanced-match
|
||||
```
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security).
|
||||
Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.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.
|
||||
653
node_modules/before-after-hook/README.md
generated
vendored
653
node_modules/before-after-hook/README.md
generated
vendored
@@ -1,653 +0,0 @@
|
||||
# before-after-hook
|
||||
|
||||
> asynchronous hooks for internal functionality
|
||||
|
||||
[](https://www.npmjs.com/package/before-after-hook)
|
||||
[](https://github.com/gr2m/before-after-hook/actions/workflows/test.yml)
|
||||
|
||||
## Usage
|
||||
|
||||
### Singular hook
|
||||
|
||||
```js
|
||||
// instantiate singular hook API
|
||||
const hook = new Hook.Singular();
|
||||
|
||||
// Create a hook
|
||||
function getData(options) {
|
||||
return hook(fetchFromDatabase, options)
|
||||
.then(handleData)
|
||||
.catch(handleGetError);
|
||||
}
|
||||
|
||||
// register before/error/after hooks.
|
||||
// The methods can be async or return a promise
|
||||
hook.before(beforeHook);
|
||||
hook.error(errorHook);
|
||||
hook.after(afterHook);
|
||||
|
||||
getData({ id: 123 });
|
||||
```
|
||||
|
||||
### Hook collection
|
||||
|
||||
```js
|
||||
// instantiate hook collection API
|
||||
const hookCollection = new Hook.Collection();
|
||||
|
||||
// Create a hook
|
||||
function getData(options) {
|
||||
return hookCollection("get", fetchFromDatabase, options)
|
||||
.then(handleData)
|
||||
.catch(handleGetError);
|
||||
}
|
||||
|
||||
// register before/error/after hooks.
|
||||
// The methods can be async or return a promise
|
||||
hookCollection.before("get", beforeHook);
|
||||
hookCollection.error("get", errorHook);
|
||||
hookCollection.after("get", afterHook);
|
||||
|
||||
getData({ id: 123 });
|
||||
```
|
||||
|
||||
### Hook.Singular vs Hook.Collection
|
||||
|
||||
There's no fundamental difference between the `Hook.Singular` and `Hook.Collection` hooks except for the fact that a hook from a collection requires you to pass along the name. Therefore the following explanation applies to both code snippets as described above.
|
||||
|
||||
The methods are executed in the following order
|
||||
|
||||
1. `beforeHook`
|
||||
2. `fetchFromDatabase`
|
||||
3. `afterHook`
|
||||
4. `handleData`
|
||||
|
||||
`beforeHook` can mutate `options` before it’s passed to `fetchFromDatabase`.
|
||||
|
||||
If an error is thrown in `beforeHook` or `fetchFromDatabase` then `errorHook` is
|
||||
called next.
|
||||
|
||||
If `afterHook` throws an error then `handleGetError` is called instead
|
||||
of `handleData`.
|
||||
|
||||
If `errorHook` throws an error then `handleGetError` is called next, otherwise
|
||||
`afterHook` and `handleData`.
|
||||
|
||||
You can also use `hook.wrap` to achieve the same thing as shown above (collection example):
|
||||
|
||||
```js
|
||||
hookCollection.wrap("get", async (getData, options) => {
|
||||
await beforeHook(options);
|
||||
|
||||
try {
|
||||
const result = getData(options);
|
||||
} catch (error) {
|
||||
await errorHook(error, options);
|
||||
}
|
||||
|
||||
await afterHook(result, options);
|
||||
});
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install before-after-hook
|
||||
```
|
||||
|
||||
Or download [the latest `before-after-hook.min.js`](https://github.com/gr2m/before-after-hook/releases/latest).
|
||||
|
||||
## API
|
||||
|
||||
- [Singular Hook Constructor](#singular-hook-api)
|
||||
- [Hook Collection Constructor](#hook-collection-api)
|
||||
|
||||
## Singular hook API
|
||||
|
||||
- [Singular constructor](#singular-constructor)
|
||||
- [hook.api](#singular-api)
|
||||
- [hook()](#singular-api)
|
||||
- [hook.before()](#singular-api)
|
||||
- [hook.error()](#singular-api)
|
||||
- [hook.after()](#singular-api)
|
||||
- [hook.wrap()](#singular-api)
|
||||
- [hook.remove()](#singular-api)
|
||||
|
||||
### Singular constructor
|
||||
|
||||
The `Hook.Singular` constructor has no options and returns a `hook` instance with the
|
||||
methods below:
|
||||
|
||||
```js
|
||||
const hook = new Hook.Singular();
|
||||
```
|
||||
|
||||
Using the singular hook is recommended for [TypeScript](#typescript)
|
||||
|
||||
### Singular API
|
||||
|
||||
The singular hook is a reference to a single hook. This means that there's no need to pass along any identifier (such as a `name` as can be seen in the [Hook.Collection API](#hookcollectionapi)).
|
||||
|
||||
The API of a singular hook is exactly the same as a collection hook and we therefore suggest you read the [Hook.Collection API](#hookcollectionapi) and leave out any use of the `name` argument. Just skip it like described in this example:
|
||||
|
||||
```js
|
||||
const hook = new Hook.Singular();
|
||||
|
||||
// good
|
||||
hook.before(beforeHook);
|
||||
hook.after(afterHook);
|
||||
hook(fetchFromDatabase, options);
|
||||
|
||||
// bad
|
||||
hook.before("get", beforeHook);
|
||||
hook.after("get", afterHook);
|
||||
hook("get", fetchFromDatabase, options);
|
||||
```
|
||||
|
||||
## Hook collection API
|
||||
|
||||
- [Collection constructor](#collection-constructor)
|
||||
- [hookCollection.api](#hookcollectionapi)
|
||||
- [hookCollection()](#hookcollection)
|
||||
- [hookCollection.before()](#hookcollectionbefore)
|
||||
- [hookCollection.error()](#hookcollectionerror)
|
||||
- [hookCollection.after()](#hookcollectionafter)
|
||||
- [hookCollection.wrap()](#hookcollectionwrap)
|
||||
- [hookCollection.remove()](#hookcollectionremove)
|
||||
|
||||
### Collection constructor
|
||||
|
||||
The `Hook.Collection` constructor has no options and returns a `hookCollection` instance with the
|
||||
methods below
|
||||
|
||||
```js
|
||||
const hookCollection = new Hook.Collection();
|
||||
```
|
||||
|
||||
### hookCollection.api
|
||||
|
||||
Use the `api` property to return the public API:
|
||||
|
||||
- [hookCollection.before()](#hookcollectionbefore)
|
||||
- [hookCollection.after()](#hookcollectionafter)
|
||||
- [hookCollection.error()](#hookcollectionerror)
|
||||
- [hookCollection.wrap()](#hookcollectionwrap)
|
||||
- [hookCollection.remove()](#hookcollectionremove)
|
||||
|
||||
That way you don’t need to expose the [hookCollection()](#hookcollection) method to consumers of your library
|
||||
|
||||
### hookCollection()
|
||||
|
||||
Invoke before and after hooks. Returns a promise.
|
||||
|
||||
```js
|
||||
hookCollection(nameOrNames, method /*, options */);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String or Array of Strings</td>
|
||||
<td>Hook name, for example <code>'save'</code>. Or an array of names, see example below.</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>Callback to be executed after all before hooks finished execution successfully. <code>options</code> is passed as first argument</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>options</code></th>
|
||||
<td>Object</td>
|
||||
<td>Will be passed to all before hooks as reference, so they can mutate it</td>
|
||||
<td>No, defaults to empty object (<code>{}</code>)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Resolves with whatever `method` returns or resolves with.
|
||||
Rejects with error that is thrown or rejected with by
|
||||
|
||||
1. Any of the before hooks, whichever rejects / throws first
|
||||
2. `method`
|
||||
3. Any of the after hooks, whichever rejects / throws first
|
||||
|
||||
Simple Example
|
||||
|
||||
```js
|
||||
hookCollection(
|
||||
"save",
|
||||
function (record) {
|
||||
return store.save(record);
|
||||
},
|
||||
record
|
||||
);
|
||||
// shorter: hookCollection('save', store.save, record)
|
||||
|
||||
hookCollection.before("save", function addTimestamps(record) {
|
||||
const now = new Date().toISOString();
|
||||
if (record.createdAt) {
|
||||
record.updatedAt = now;
|
||||
} else {
|
||||
record.createdAt = now;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Example defining multiple hooks at once.
|
||||
|
||||
```js
|
||||
hookCollection(
|
||||
["add", "save"],
|
||||
function (record) {
|
||||
return store.save(record);
|
||||
},
|
||||
record
|
||||
);
|
||||
|
||||
hookCollection.before("add", function addTimestamps(record) {
|
||||
if (!record.type) {
|
||||
throw new Error("type property is required");
|
||||
}
|
||||
});
|
||||
|
||||
hookCollection.before("save", function addTimestamps(record) {
|
||||
if (!record.type) {
|
||||
throw new Error("type property is required");
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Defining multiple hooks is helpful if you have similar methods for which you want to define separate hooks, but also an additional hook that gets called for all at once. The example above is equal to this:
|
||||
|
||||
```js
|
||||
hookCollection(
|
||||
"add",
|
||||
function (record) {
|
||||
return hookCollection(
|
||||
"save",
|
||||
function (record) {
|
||||
return store.save(record);
|
||||
},
|
||||
record
|
||||
);
|
||||
},
|
||||
record
|
||||
);
|
||||
```
|
||||
|
||||
### hookCollection.before()
|
||||
|
||||
Add before hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.before(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Executed before the wrapped method. Called with the hook’s
|
||||
<code>options</code> argument. Before hooks can mutate the passed options
|
||||
before they are passed to the wrapped method.
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.before("save", function validate(record) {
|
||||
if (!record.name) {
|
||||
throw new Error("name property is required");
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### hookCollection.error()
|
||||
|
||||
Add error hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.error(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Executed when an error occurred in either the wrapped method or a
|
||||
<code>before</code> hook. Called with the thrown <code>error</code>
|
||||
and the hook’s <code>options</code> argument. The first <code>method</code>
|
||||
which does not throw an error will set the result that the after hook
|
||||
methods will receive.
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.error("save", function (error, options) {
|
||||
if (error.ignore) return;
|
||||
throw error;
|
||||
});
|
||||
```
|
||||
|
||||
### hookCollection.after()
|
||||
|
||||
Add after hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.after(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Executed after wrapped method. Called with what the wrapped method
|
||||
resolves with the hook’s <code>options</code> argument.
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.after("save", function (result, options) {
|
||||
if (result.updatedAt) {
|
||||
app.emit("update", result);
|
||||
} else {
|
||||
app.emit("create", result);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### hookCollection.wrap()
|
||||
|
||||
Add wrap hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.wrap(name, method);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>method</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Receives both the wrapped method and the passed options as arguments so it can add logic before and after the wrapped method, it can handle errors and even replace the wrapped method altogether
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.wrap("save", async function (saveInDatabase, options) {
|
||||
if (!record.name) {
|
||||
throw new Error("name property is required");
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await saveInDatabase(options);
|
||||
|
||||
if (result.updatedAt) {
|
||||
app.emit("update", result);
|
||||
} else {
|
||||
app.emit("create", result);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
if (error.ignore) return;
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
See also: [Test mock example](examples/test-mock-example.md)
|
||||
|
||||
### hookCollection.remove()
|
||||
|
||||
Removes hook for given name.
|
||||
|
||||
```js
|
||||
hookCollection.remove(name, hookMethod);
|
||||
```
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Required</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<th align="left"><code>name</code></th>
|
||||
<td>String</td>
|
||||
<td>Hook name, for example <code>'save'</code></td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="left"><code>beforeHookMethod</code></th>
|
||||
<td>Function</td>
|
||||
<td>
|
||||
Same function that was previously passed to <code>hookCollection.before()</code>, <code>hookCollection.error()</code>, <code>hookCollection.after()</code> or <code>hookCollection.wrap()</code>
|
||||
</td>
|
||||
<td>Yes</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example
|
||||
|
||||
```js
|
||||
hookCollection.remove("save", validateRecord);
|
||||
```
|
||||
|
||||
## TypeScript
|
||||
|
||||
This library contains type definitions for TypeScript.
|
||||
|
||||
### Type support for `Singular`:
|
||||
|
||||
```ts
|
||||
import { Hook } from "before-after-hook";
|
||||
|
||||
type TOptions = { foo: string }; // type for options
|
||||
type TResult = { bar: number }; // type for result
|
||||
type TError = Error; // type for error
|
||||
|
||||
const hook = new Hook.Singular<TOptions, TResult, TError>();
|
||||
|
||||
hook.before((options) => {
|
||||
// `options.foo` has `string` type
|
||||
|
||||
// not allowed
|
||||
options.foo = 42;
|
||||
|
||||
// allowed
|
||||
options.foo = "Forty-Two";
|
||||
});
|
||||
|
||||
const hookedMethod = hook(
|
||||
(options) => {
|
||||
// `options.foo` has `string` type
|
||||
|
||||
// not allowed, because it does not satisfy the `R` type
|
||||
return { foo: 42 };
|
||||
|
||||
// allowed
|
||||
return { bar: 42 };
|
||||
},
|
||||
{ foo: "Forty-Two" }
|
||||
);
|
||||
```
|
||||
|
||||
You can choose not to pass the types for options, result or error. So, these are completely valid:
|
||||
|
||||
```ts
|
||||
const hook = new Hook.Singular<O, R>();
|
||||
const hook = new Hook.Singular<O>();
|
||||
const hook = new Hook.Singular();
|
||||
```
|
||||
|
||||
In these cases, the omitted types will implicitly be `any`.
|
||||
|
||||
### Type support for `Collection`:
|
||||
|
||||
`Collection` also has strict type support. You can use it like this:
|
||||
|
||||
```ts
|
||||
import { Hook } from "before-after-hook";
|
||||
|
||||
type HooksType = {
|
||||
add: {
|
||||
Options: { type: string };
|
||||
Result: { id: number };
|
||||
Error: Error;
|
||||
};
|
||||
save: {
|
||||
Options: { type: string };
|
||||
Result: { id: number };
|
||||
};
|
||||
read: {
|
||||
Options: { id: number; foo: number };
|
||||
};
|
||||
destroy: {
|
||||
Options: { id: number; foo: string };
|
||||
};
|
||||
};
|
||||
|
||||
const hooks = new Hook.Collection<HooksType>();
|
||||
|
||||
hooks.before("destroy", (options) => {
|
||||
// `options.id` has `number` type
|
||||
});
|
||||
|
||||
hooks.error("add", (err, options) => {
|
||||
// `options.type` has `string` type
|
||||
// `err` is `instanceof Error`
|
||||
});
|
||||
|
||||
hooks.error("save", (err, options) => {
|
||||
// `options.type` has `string` type
|
||||
// `err` has type `any`
|
||||
});
|
||||
|
||||
hooks.after("save", (result, options) => {
|
||||
// `options.type` has `string` type
|
||||
// `result.id` has `number` type
|
||||
});
|
||||
```
|
||||
|
||||
You can choose not to pass the types altogether. In that case, everything will implicitly be `any`:
|
||||
|
||||
```ts
|
||||
const hook = new Hook.Collection();
|
||||
```
|
||||
|
||||
Alternative imports:
|
||||
|
||||
```ts
|
||||
import { Singular, Collection } from "before-after-hook";
|
||||
|
||||
const hook = new Singular();
|
||||
const hooks = new Collection();
|
||||
```
|
||||
|
||||
## Upgrading to 1.4
|
||||
|
||||
Since version 1.4 the `Hook` constructor has been deprecated in favor of returning `Hook.Singular` in an upcoming breaking release.
|
||||
|
||||
Version 1.4 is still 100% backwards-compatible, but if you want to continue using hook collections, we recommend using the `Hook.Collection` constructor instead before the next release.
|
||||
|
||||
For even more details, check out [the PR](https://github.com/gr2m/before-after-hook/pull/52).
|
||||
|
||||
## See also
|
||||
|
||||
If `before-after-hook` is not for you, have a look at one of these alternatives:
|
||||
|
||||
- https://github.com/keystonejs/grappling-hook
|
||||
- https://github.com/sebelga/promised-hooks
|
||||
- https://github.com/bnoguchi/hooks-js
|
||||
- https://github.com/cb1kenobi/hook-emitter
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0](LICENSE)
|
||||
25
node_modules/bottleneck/.travis.yml
generated
vendored
25
node_modules/bottleneck/.travis.yml
generated
vendored
@@ -1,25 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 8
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- next
|
||||
services:
|
||||
- redis-server
|
||||
env:
|
||||
global:
|
||||
- "REDIS_HOST=127.0.0.1"
|
||||
- "REDIS_PORT=6379"
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.npm
|
||||
install:
|
||||
- npm i
|
||||
sudo: required
|
||||
after_success: npx codecov --file=./coverage/lcov.info
|
||||
script: npm run test-all
|
||||
|
||||
before_install:
|
||||
- npm i -g npm@5.10
|
||||
- npm --version
|
||||
1027
node_modules/bottleneck/README.md
generated
vendored
1027
node_modules/bottleneck/README.md
generated
vendored
File diff suppressed because it is too large
Load Diff
129
node_modules/brace-expansion/README.md
generated
vendored
129
node_modules/brace-expansion/README.md
generated
vendored
@@ -1,129 +0,0 @@
|
||||
# brace-expansion
|
||||
|
||||
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
||||
as known from sh/bash, in JavaScript.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/brace-expansion)
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var expand = require('brace-expansion');
|
||||
|
||||
expand('file-{a,b,c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('-v{,,}')
|
||||
// => ['-v', '-v', '-v']
|
||||
|
||||
expand('file{0..2}.jpg')
|
||||
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
|
||||
|
||||
expand('file-{a..c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('file{2..0}.jpg')
|
||||
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
|
||||
|
||||
expand('file{0..4..2}.jpg')
|
||||
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
|
||||
|
||||
expand('file-{a..e..2}.jpg')
|
||||
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
|
||||
|
||||
expand('file{00..10..5}.jpg')
|
||||
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
|
||||
|
||||
expand('{{A..C},{a..c}}')
|
||||
// => ['A', 'B', 'C', 'a', 'b', 'c']
|
||||
|
||||
expand('ppp{,config,oe{,conf}}')
|
||||
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var expand = require('brace-expansion');
|
||||
```
|
||||
|
||||
### var expanded = expand(str)
|
||||
|
||||
Return an array of all possible and valid expansions of `str`. If none are
|
||||
found, `[str]` is returned.
|
||||
|
||||
Valid expansions are:
|
||||
|
||||
```js
|
||||
/^(.*,)+(.+)?$/
|
||||
// {a,b,...}
|
||||
```
|
||||
|
||||
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
|
||||
|
||||
```js
|
||||
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
A numeric sequence from `x` to `y` inclusive, with optional increment.
|
||||
If `x` or `y` start with a leading `0`, all the numbers will be padded
|
||||
to have equal length. Negative numbers and backwards iteration work too.
|
||||
|
||||
```js
|
||||
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
|
||||
`x` and `y` must be exactly one character, and if given, `incr` must be a
|
||||
number.
|
||||
|
||||
For compatibility reasons, the string `${` is not eligible for brace expansion.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install brace-expansion
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
- [Julian Gruber](https://github.com/juliangruber)
|
||||
- [Isaac Z. Schlueter](https://github.com/isaacs)
|
||||
|
||||
## Sponsors
|
||||
|
||||
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
|
||||
|
||||
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.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.
|
||||
184
node_modules/braces/CHANGELOG.md
generated
vendored
184
node_modules/braces/CHANGELOG.md
generated
vendored
@@ -1,184 +0,0 @@
|
||||
# Release history
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
<details>
|
||||
<summary><strong>Guiding Principles</strong></summary>
|
||||
|
||||
- Changelogs are for humans, not machines.
|
||||
- There should be an entry for every single version.
|
||||
- The same types of changes should be grouped.
|
||||
- Versions and sections should be linkable.
|
||||
- The latest version comes first.
|
||||
- The release date of each versions is displayed.
|
||||
- Mention whether you follow Semantic Versioning.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Types of changes</strong></summary>
|
||||
|
||||
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
|
||||
|
||||
- `Added` for new features.
|
||||
- `Changed` for changes in existing functionality.
|
||||
- `Deprecated` for soon-to-be removed features.
|
||||
- `Removed` for now removed features.
|
||||
- `Fixed` for any bug fixes.
|
||||
- `Security` in case of vulnerabilities.
|
||||
|
||||
</details>
|
||||
|
||||
## [3.0.0] - 2018-04-08
|
||||
|
||||
v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler.
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
- The undocumented `.makeRe` method was removed
|
||||
|
||||
**Non-breaking changes**
|
||||
|
||||
- Caching was removed
|
||||
|
||||
## [2.3.2] - 2018-04-08
|
||||
|
||||
- start refactoring
|
||||
- cover sets
|
||||
- better range handling
|
||||
|
||||
## [2.3.1] - 2018-02-17
|
||||
|
||||
- Remove unnecessary escape in Regex. (#14)
|
||||
|
||||
## [2.3.0] - 2017-10-19
|
||||
|
||||
- minor code reorganization
|
||||
- optimize regex
|
||||
- expose `maxLength` option
|
||||
|
||||
## [2.2.1] - 2017-05-30
|
||||
|
||||
- don't condense when braces contain extglobs
|
||||
|
||||
## [2.2.0] - 2017-05-28
|
||||
|
||||
- ensure word boundaries are preserved
|
||||
- fixes edge case where extglob characters precede a brace pattern
|
||||
|
||||
## [2.1.1] - 2017-04-27
|
||||
|
||||
- use snapdragon-node
|
||||
- handle edge case
|
||||
- optimizations, lint
|
||||
|
||||
## [2.0.4] - 2017-04-11
|
||||
|
||||
- pass opts to compiler
|
||||
- minor optimization in create method
|
||||
- re-write parser handlers to remove negation regex
|
||||
|
||||
## [2.0.3] - 2016-12-10
|
||||
|
||||
- use split-string
|
||||
- clear queue at the end
|
||||
- adds sequences example
|
||||
- add unit tests
|
||||
|
||||
## [2.0.2] - 2016-10-21
|
||||
|
||||
- fix comma handling in nested extglobs
|
||||
|
||||
## [2.0.1] - 2016-10-20
|
||||
|
||||
- add comments
|
||||
- more tests, ensure quotes are stripped
|
||||
|
||||
## [2.0.0] - 2016-10-19
|
||||
|
||||
- don't expand braces inside character classes
|
||||
- add quantifier pattern
|
||||
|
||||
## [1.8.5] - 2016-05-21
|
||||
|
||||
- Refactor (#10)
|
||||
|
||||
## [1.8.4] - 2016-04-20
|
||||
|
||||
- fixes https://github.com/jonschlinkert/micromatch/issues/66
|
||||
|
||||
## [1.8.0] - 2015-03-18
|
||||
|
||||
- adds exponent examples, tests
|
||||
- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38
|
||||
|
||||
## [1.6.0] - 2015-01-30
|
||||
|
||||
- optimizations, `bash` mode:
|
||||
- improve path escaping
|
||||
|
||||
## [1.5.0] - 2015-01-28
|
||||
|
||||
- Merge pull request #5 from eush77/lib-files
|
||||
|
||||
## [1.4.0] - 2015-01-24
|
||||
|
||||
- add extglob tests
|
||||
- externalize exponent function
|
||||
- better whitespace handling
|
||||
|
||||
## [1.3.0] - 2015-01-24
|
||||
|
||||
- make regex patterns explicity
|
||||
|
||||
## [1.1.0] - 2015-01-11
|
||||
|
||||
- don't create a match group with `makeRe`
|
||||
|
||||
## [1.0.0] - 2014-12-23
|
||||
|
||||
- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e'
|
||||
- support empty brace syntax
|
||||
- better bash coverage
|
||||
- better support for regex strings
|
||||
|
||||
## [0.1.4] - 2014-11-14
|
||||
|
||||
- improve recognition of bad args, recognize mismatched argument types
|
||||
- support escaping
|
||||
- remove pathname-expansion
|
||||
- support whitespace in patterns
|
||||
|
||||
## [0.1.0]
|
||||
|
||||
- first commit
|
||||
|
||||
[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2
|
||||
[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1
|
||||
[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0
|
||||
[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1
|
||||
[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0
|
||||
[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1
|
||||
[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0
|
||||
[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4
|
||||
[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3
|
||||
[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2
|
||||
[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0
|
||||
[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5
|
||||
[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4
|
||||
[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0
|
||||
[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0
|
||||
[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0
|
||||
[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0
|
||||
[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0
|
||||
[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0
|
||||
[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0
|
||||
[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0
|
||||
[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4
|
||||
|
||||
[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD
|
||||
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
|
||||
593
node_modules/braces/README.md
generated
vendored
593
node_modules/braces/README.md
generated
vendored
@@ -1,593 +0,0 @@
|
||||
# braces [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/braces) [](https://npmjs.org/package/braces) [](https://npmjs.org/package/braces) [](https://travis-ci.org/micromatch/braces)
|
||||
|
||||
> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.
|
||||
|
||||
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save braces
|
||||
```
|
||||
|
||||
## v3.0.0 Released!!
|
||||
|
||||
See the [changelog](CHANGELOG.md) for details.
|
||||
|
||||
## Why use braces?
|
||||
|
||||
Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters.
|
||||
|
||||
* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
|
||||
* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
|
||||
* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
|
||||
* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
|
||||
* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
|
||||
* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
|
||||
* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
|
||||
* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
|
||||
* [Supports escaping](#escaping) - To prevent evaluation of special characters.
|
||||
|
||||
## Usage
|
||||
|
||||
The main export is a function that takes one or more brace `patterns` and `options`.
|
||||
|
||||
```js
|
||||
const braces = require('braces');
|
||||
// braces(patterns[, options]);
|
||||
|
||||
console.log(braces(['{01..05}', '{a..e}']));
|
||||
//=> ['(0[1-5])', '([a-e])']
|
||||
|
||||
console.log(braces(['{01..05}', '{a..e}'], { expand: true }));
|
||||
//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e']
|
||||
```
|
||||
|
||||
### Brace Expansion vs. Compilation
|
||||
|
||||
By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching.
|
||||
|
||||
**Compiled**
|
||||
|
||||
```js
|
||||
console.log(braces('a/{x,y,z}/b'));
|
||||
//=> ['a/(x|y|z)/b']
|
||||
console.log(braces(['a/{01..20}/b', 'a/{1..5}/b']));
|
||||
//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ]
|
||||
```
|
||||
|
||||
**Expanded**
|
||||
|
||||
Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)):
|
||||
|
||||
```js
|
||||
console.log(braces('a/{x,y,z}/b', { expand: true }));
|
||||
//=> ['a/x/b', 'a/y/b', 'a/z/b']
|
||||
|
||||
console.log(braces.expand('{01..10}'));
|
||||
//=> ['01','02','03','04','05','06','07','08','09','10']
|
||||
```
|
||||
|
||||
### Lists
|
||||
|
||||
Expand lists (like Bash "sets"):
|
||||
|
||||
```js
|
||||
console.log(braces('a/{foo,bar,baz}/*.js'));
|
||||
//=> ['a/(foo|bar|baz)/*.js']
|
||||
|
||||
console.log(braces.expand('a/{foo,bar,baz}/*.js'));
|
||||
//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js']
|
||||
```
|
||||
|
||||
### Sequences
|
||||
|
||||
Expand ranges of characters (like Bash "sequences"):
|
||||
|
||||
```js
|
||||
console.log(braces.expand('{1..3}')); // ['1', '2', '3']
|
||||
console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b']
|
||||
console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c']
|
||||
console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c']
|
||||
|
||||
// supports zero-padded ranges
|
||||
console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b']
|
||||
console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b']
|
||||
```
|
||||
|
||||
See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options.
|
||||
|
||||
### Steppped ranges
|
||||
|
||||
Steps, or increments, may be used with ranges:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('{2..10..2}'));
|
||||
//=> ['2', '4', '6', '8', '10']
|
||||
|
||||
console.log(braces('{2..10..2}'));
|
||||
//=> ['(2|4|6|8|10)']
|
||||
```
|
||||
|
||||
When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion.
|
||||
|
||||
### Nesting
|
||||
|
||||
Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved.
|
||||
|
||||
**"Expanded" braces**
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a{b,c,/{x,y}}/e'));
|
||||
//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e']
|
||||
|
||||
console.log(braces.expand('a/{x,{1..5},y}/c'));
|
||||
//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c']
|
||||
```
|
||||
|
||||
**"Optimized" braces**
|
||||
|
||||
```js
|
||||
console.log(braces('a{b,c,/{x,y}}/e'));
|
||||
//=> ['a(b|c|/(x|y))/e']
|
||||
|
||||
console.log(braces('a/{x,{1..5},y}/c'));
|
||||
//=> ['a/(x|([1-5])|y)/c']
|
||||
```
|
||||
|
||||
### Escaping
|
||||
|
||||
**Escaping braces**
|
||||
|
||||
A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a\\{d,c,b}e'));
|
||||
//=> ['a{d,c,b}e']
|
||||
|
||||
console.log(braces.expand('a{d,c,b\\}e'));
|
||||
//=> ['a{d,c,b}e']
|
||||
```
|
||||
|
||||
**Escaping commas**
|
||||
|
||||
Commas inside braces may also be escaped:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a{b\\,c}d'));
|
||||
//=> ['a{b,c}d']
|
||||
|
||||
console.log(braces.expand('a{d\\,c,b}e'));
|
||||
//=> ['ad,ce', 'abe']
|
||||
```
|
||||
|
||||
**Single items**
|
||||
|
||||
Following bash conventions, a brace pattern is also not expanded when it contains a single character:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a{b}c'));
|
||||
//=> ['a{b}c']
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### options.maxLength
|
||||
|
||||
**Type**: `Number`
|
||||
|
||||
**Default**: `65,536`
|
||||
|
||||
**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera.
|
||||
|
||||
```js
|
||||
console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error
|
||||
```
|
||||
|
||||
### options.expand
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing).
|
||||
|
||||
```js
|
||||
console.log(braces('a/{b,c}/d', { expand: true }));
|
||||
//=> [ 'a/b/d', 'a/c/d' ]
|
||||
```
|
||||
|
||||
### options.nodupes
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Remove duplicates from the returned array.
|
||||
|
||||
### options.rangeLimit
|
||||
|
||||
**Type**: `Number`
|
||||
|
||||
**Default**: `1000`
|
||||
|
||||
**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`.
|
||||
|
||||
You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether.
|
||||
|
||||
**Examples**
|
||||
|
||||
```js
|
||||
// pattern exceeds the "rangeLimit", so it's optimized automatically
|
||||
console.log(braces.expand('{1..1000}'));
|
||||
//=> ['([1-9]|[1-9][0-9]{1,2}|1000)']
|
||||
|
||||
// pattern does not exceed "rangeLimit", so it's NOT optimized
|
||||
console.log(braces.expand('{1..100}'));
|
||||
//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100']
|
||||
```
|
||||
|
||||
### options.transform
|
||||
|
||||
**Type**: `Function`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Customize range expansion.
|
||||
|
||||
**Example: Transforming non-numeric values**
|
||||
|
||||
```js
|
||||
const alpha = braces.expand('x/{a..e}/y', {
|
||||
transform(value, index) {
|
||||
// When non-numeric values are passed, "value" is a character code.
|
||||
return 'foo/' + String.fromCharCode(value) + '-' + index;
|
||||
}
|
||||
});
|
||||
console.log(alpha);
|
||||
//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ]
|
||||
```
|
||||
|
||||
**Example: Transforming numeric values**
|
||||
|
||||
```js
|
||||
const numeric = braces.expand('{1..5}', {
|
||||
transform(value) {
|
||||
// when numeric values are passed, "value" is a number
|
||||
return 'foo/' + value * 2;
|
||||
}
|
||||
});
|
||||
console.log(numeric);
|
||||
//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ]
|
||||
```
|
||||
|
||||
### options.quantifiers
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times.
|
||||
|
||||
Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists)
|
||||
|
||||
The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists.
|
||||
|
||||
**Examples**
|
||||
|
||||
```js
|
||||
const braces = require('braces');
|
||||
console.log(braces('a/b{1,3}/{x,y,z}'));
|
||||
//=> [ 'a/b(1|3)/(x|y|z)' ]
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
|
||||
//=> [ 'a/b{1,3}/(x|y|z)' ]
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
|
||||
//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
|
||||
```
|
||||
|
||||
### options.unescape
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Strip backslashes that were used for escaping from the result.
|
||||
|
||||
## What is "brace expansion"?
|
||||
|
||||
Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs).
|
||||
|
||||
In addition to "expansion", braces are also used for matching. In other words:
|
||||
|
||||
* [brace expansion](#brace-expansion) is for generating new lists
|
||||
* [brace matching](#brace-matching) is for filtering existing lists
|
||||
|
||||
<details>
|
||||
<summary><strong>More about brace expansion</strong> (click to expand)</summary>
|
||||
|
||||
There are two main types of brace expansion:
|
||||
|
||||
1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}`
|
||||
2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges".
|
||||
|
||||
Here are some example brace patterns to illustrate how they work:
|
||||
|
||||
**Sets**
|
||||
|
||||
```
|
||||
{a,b,c} => a b c
|
||||
{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2
|
||||
```
|
||||
|
||||
**Sequences**
|
||||
|
||||
```
|
||||
{1..9} => 1 2 3 4 5 6 7 8 9
|
||||
{4..-4} => 4 3 2 1 0 -1 -2 -3 -4
|
||||
{1..20..3} => 1 4 7 10 13 16 19
|
||||
{a..j} => a b c d e f g h i j
|
||||
{j..a} => j i h g f e d c b a
|
||||
{a..z..3} => a d g j m p s v y
|
||||
```
|
||||
|
||||
**Combination**
|
||||
|
||||
Sets and sequences can be mixed together or used along with any other strings.
|
||||
|
||||
```
|
||||
{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3
|
||||
foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar
|
||||
```
|
||||
|
||||
The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases.
|
||||
|
||||
## Brace matching
|
||||
|
||||
In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching.
|
||||
|
||||
For example, the pattern `foo/{1..3}/bar` would match any of following strings:
|
||||
|
||||
```
|
||||
foo/1/bar
|
||||
foo/2/bar
|
||||
foo/3/bar
|
||||
```
|
||||
|
||||
But not:
|
||||
|
||||
```
|
||||
baz/1/qux
|
||||
baz/2/qux
|
||||
baz/3/qux
|
||||
```
|
||||
|
||||
Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings:
|
||||
|
||||
```
|
||||
foo/1/bar
|
||||
foo/2/bar
|
||||
foo/3/bar
|
||||
baz/1/qux
|
||||
baz/2/qux
|
||||
baz/3/qux
|
||||
```
|
||||
|
||||
## Brace matching pitfalls
|
||||
|
||||
Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of.
|
||||
|
||||
### tldr
|
||||
|
||||
**"brace bombs"**
|
||||
|
||||
* brace expansion can eat up a huge amount of processing resources
|
||||
* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
|
||||
* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
|
||||
|
||||
For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section.
|
||||
|
||||
### The solution
|
||||
|
||||
Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries.
|
||||
|
||||
### Geometric complexity
|
||||
|
||||
At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`.
|
||||
|
||||
For example, the following sets demonstrate quadratic (`O(n^2)`) complexity:
|
||||
|
||||
```
|
||||
{1,2}{3,4} => (2X2) => 13 14 23 24
|
||||
{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246
|
||||
```
|
||||
|
||||
But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity:
|
||||
|
||||
```
|
||||
{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248
|
||||
249 257 258 259 267 268 269 347 348 349 357
|
||||
358 359 367 368 369
|
||||
```
|
||||
|
||||
Now, imagine how this complexity grows given that each element is a n-tuple:
|
||||
|
||||
```
|
||||
{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB)
|
||||
{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB)
|
||||
```
|
||||
|
||||
Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control.
|
||||
|
||||
**More information**
|
||||
|
||||
Interested in learning more about brace expansion?
|
||||
|
||||
* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
|
||||
* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
|
||||
* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
|
||||
|
||||
</details>
|
||||
|
||||
## Performance
|
||||
|
||||
Braces is not only screaming fast, it's also more accurate the other brace expansion libraries.
|
||||
|
||||
### Better algorithms
|
||||
|
||||
Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_.
|
||||
|
||||
Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently.
|
||||
|
||||
**The proof is in the numbers**
|
||||
|
||||
Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively.
|
||||
|
||||
| **Pattern** | **braces** | **[minimatch][]** |
|
||||
| --- | --- | --- |
|
||||
| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)| N/A (freezes) |
|
||||
| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) |
|
||||
| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) |
|
||||
| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) |
|
||||
| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) |
|
||||
| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) |
|
||||
| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) |
|
||||
| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) |
|
||||
| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) |
|
||||
| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
|
||||
| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) |
|
||||
| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) |
|
||||
| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) |
|
||||
| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) |
|
||||
| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) |
|
||||
| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) |
|
||||
| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) |
|
||||
|
||||
### Faster algorithms
|
||||
|
||||
When you need expansion, braces is still much faster.
|
||||
|
||||
_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_
|
||||
|
||||
| **Pattern** | **braces** | **[minimatch][]** |
|
||||
| --- | --- | --- |
|
||||
| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) |
|
||||
| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) |
|
||||
| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) |
|
||||
| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) |
|
||||
| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) |
|
||||
| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) |
|
||||
| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) |
|
||||
| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) |
|
||||
|
||||
If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js).
|
||||
|
||||
## Benchmarks
|
||||
|
||||
### Running benchmarks
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```bash
|
||||
npm i -d && npm benchmark
|
||||
```
|
||||
|
||||
### Latest results
|
||||
|
||||
Braces is more accurate, without sacrificing performance.
|
||||
|
||||
```bash
|
||||
# range (expanded)
|
||||
braces x 29,040 ops/sec ±3.69% (91 runs sampled))
|
||||
minimatch x 4,735 ops/sec ±1.28% (90 runs sampled)
|
||||
|
||||
# range (optimized for regex)
|
||||
braces x 382,878 ops/sec ±0.56% (94 runs sampled)
|
||||
minimatch x 1,040 ops/sec ±0.44% (93 runs sampled)
|
||||
|
||||
# nested ranges (expanded)
|
||||
braces x 19,744 ops/sec ±2.27% (92 runs sampled))
|
||||
minimatch x 4,579 ops/sec ±0.50% (93 runs sampled)
|
||||
|
||||
# nested ranges (optimized for regex)
|
||||
braces x 246,019 ops/sec ±2.02% (93 runs sampled)
|
||||
minimatch x 1,028 ops/sec ±0.39% (94 runs sampled)
|
||||
|
||||
# set (expanded)
|
||||
braces x 138,641 ops/sec ±0.53% (95 runs sampled)
|
||||
minimatch x 219,582 ops/sec ±0.98% (94 runs sampled)
|
||||
|
||||
# set (optimized for regex)
|
||||
braces x 388,408 ops/sec ±0.41% (95 runs sampled)
|
||||
minimatch x 44,724 ops/sec ±0.91% (89 runs sampled)
|
||||
|
||||
# nested sets (expanded)
|
||||
braces x 84,966 ops/sec ±0.48% (94 runs sampled)
|
||||
minimatch x 140,720 ops/sec ±0.37% (95 runs sampled)
|
||||
|
||||
# nested sets (optimized for regex)
|
||||
braces x 263,340 ops/sec ±2.06% (92 runs sampled)
|
||||
minimatch x 28,714 ops/sec ±0.40% (90 runs sampled)
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
<details>
|
||||
<summary><strong>Contributing</strong></summary>
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Running Tests</strong></summary>
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Building docs</strong></summary>
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 197 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 4 | [doowb](https://github.com/doowb) |
|
||||
| 1 | [es128](https://github.com/es128) |
|
||||
| 1 | [eush77](https://github.com/eush77) |
|
||||
| 1 | [hemanth](https://github.com/hemanth) |
|
||||
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [GitHub Profile](https://github.com/jonschlinkert)
|
||||
* [Twitter Profile](https://twitter.com/jonschlinkert)
|
||||
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
|
||||
48
node_modules/callsites/readme.md
generated
vendored
48
node_modules/callsites/readme.md
generated
vendored
@@ -1,48 +0,0 @@
|
||||
# callsites [](https://travis-ci.org/sindresorhus/callsites)
|
||||
|
||||
> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install callsites
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const callsites = require('callsites');
|
||||
|
||||
function unicorn() {
|
||||
console.log(callsites()[0].getFileName());
|
||||
//=> '/Users/sindresorhus/dev/callsites/test.js'
|
||||
}
|
||||
|
||||
unicorn();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Returns an array of callsite objects with the following methods:
|
||||
|
||||
- `getThis`: returns the value of `this`.
|
||||
- `getTypeName`: returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property.
|
||||
- `getFunction`: returns the current function.
|
||||
- `getFunctionName`: returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
|
||||
- `getMethodName`: returns the name of the property of `this` or one of its prototypes that holds the current function.
|
||||
- `getFileName`: if this function was defined in a script returns the name of the script.
|
||||
- `getLineNumber`: if this function was defined in a script returns the current line number.
|
||||
- `getColumnNumber`: if this function was defined in a script returns the current column number
|
||||
- `getEvalOrigin`: if this function was created using a call to `eval` returns a string representing the location where `eval` was called.
|
||||
- `isToplevel`: is this a top-level invocation, that is, is this the global object?
|
||||
- `isEval`: does this call take place in code defined by a call to `eval`?
|
||||
- `isNative`: is this call in native V8 code?
|
||||
- `isConstructor`: is this a constructor call?
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
125
node_modules/camelcase-keys/readme.md
generated
vendored
125
node_modules/camelcase-keys/readme.md
generated
vendored
@@ -1,125 +0,0 @@
|
||||
# camelcase-keys [](https://travis-ci.org/sindresorhus/camelcase-keys)
|
||||
|
||||
> Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install camelcase-keys
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const camelcaseKeys = require('camelcase-keys');
|
||||
|
||||
// Convert an object
|
||||
camelcaseKeys({'foo-bar': true});
|
||||
//=> {fooBar: true}
|
||||
|
||||
// Convert an array of objects
|
||||
camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]);
|
||||
//=> [{fooBar: true}, {barFoo: false}]
|
||||
|
||||
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
|
||||
//=> {fooBar: true, nested: {unicornRainbow: true}}
|
||||
|
||||
camelcaseKeys({a_b: 1, a_c: {c_d: 1, c_e: {e_f: 1}}}, {deep: true, stopPaths: ['a_c.c_e']}),
|
||||
//=> {aB: 1, aC: {cD: 1, cE: {e_f: 1}}}
|
||||
|
||||
// Convert object keys to pascal case
|
||||
camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true});
|
||||
//=> {FooBar: true, Nested: {UnicornRainbow: true}}
|
||||
```
|
||||
|
||||
```js
|
||||
const camelcaseKeys = require('camelcase-keys');
|
||||
|
||||
const argv = require('minimist')(process.argv.slice(2));
|
||||
//=> {_: [], 'foo-bar': true}
|
||||
|
||||
camelcaseKeys(argv);
|
||||
//=> {_: [], fooBar: true}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### camelcaseKeys(input, options?)
|
||||
|
||||
#### input
|
||||
|
||||
Type: `object | object[]`
|
||||
|
||||
An object or array of objects to camel-case.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### exclude
|
||||
|
||||
Type: `Array<string | RegExp>`\
|
||||
Default: `[]`
|
||||
|
||||
Exclude keys from being camel-cased.
|
||||
|
||||
##### stopPaths
|
||||
|
||||
Type: `string[]`\
|
||||
Default: `[]`
|
||||
|
||||
Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.
|
||||
|
||||
```js
|
||||
camelcaseKeys({
|
||||
a_b: 1,
|
||||
a_c: {
|
||||
c_d: 1,
|
||||
c_e: {
|
||||
e_f: 1
|
||||
}
|
||||
}
|
||||
}, {
|
||||
deep: true,
|
||||
stopPaths: [
|
||||
'a_c.c_e'
|
||||
]
|
||||
}),
|
||||
/*
|
||||
{
|
||||
aB: 1,
|
||||
aC: {
|
||||
cD: 1,
|
||||
cE: {
|
||||
e_f: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
```
|
||||
|
||||
##### deep
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Recurse nested objects and objects in arrays.
|
||||
|
||||
##### pascalCase
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Uppercase the first character as in `bye-bye` → `ByeBye`.
|
||||
|
||||
## camelcase-keys for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of camelcase-keys 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-camelcase-keys?utm_source=npm-camelcase-keys&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## Related
|
||||
|
||||
- [snakecase-keys](https://github.com/bendrucker/snakecase-keys)
|
||||
- [kebabcase-keys](https://github.com/mattiloh/kebabcase-keys)
|
||||
|
||||
99
node_modules/camelcase/readme.md
generated
vendored
99
node_modules/camelcase/readme.md
generated
vendored
@@ -1,99 +0,0 @@
|
||||
# camelcase [](https://travis-ci.org/sindresorhus/camelcase)
|
||||
|
||||
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=readme">Get professional support for 'camelcase' 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>
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install camelcase
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const camelCase = require('camelcase');
|
||||
|
||||
camelCase('foo-bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo_bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('Foo-Bar', {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
|
||||
camelCase('--foo.bar', {pascalCase: false});
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase('foo bar');
|
||||
//=> 'fooBar'
|
||||
|
||||
console.log(process.argv[3]);
|
||||
//=> '--foo-bar'
|
||||
camelCase(process.argv[3]);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['foo', 'bar']);
|
||||
//=> 'fooBar'
|
||||
|
||||
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
||||
//=> 'FooBar'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### camelCase(input, [options])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string` `string[]`
|
||||
|
||||
String to convert to camel case.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### pascalCase
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Uppercase the first character: `foo-bar` → `FooBar`
|
||||
|
||||
|
||||
## Security
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
|
||||
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
|
||||
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
|
||||
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
6
node_modules/cardinal/.travis.yml
generated
vendored
6
node_modules/cardinal/.travis.yml
generated
vendored
@@ -1,6 +0,0 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
- "8"
|
||||
- "10"
|
||||
131
node_modules/cardinal/README.md
generated
vendored
131
node_modules/cardinal/README.md
generated
vendored
@@ -1,131 +0,0 @@
|
||||
# cardinal [](http://travis-ci.org/thlorenz/cardinal)
|
||||
|
||||
<a href="https://www.patreon.com/bePatron?u=8663953"><img alt="become a patron" src="https://c5.patreon.com/external/logo/become_a_patron_button.png" height="35px"></a>
|
||||
|
||||
[](https://nodei.co/npm/cardinal/)
|
||||
|
||||
**car·di·nal** *(kärdn-l, kärdnl)* - crested thick-billed North American finch having bright red plumage in the male.
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- highlights JavaScript code with ANSI colors to improve terminal output
|
||||
- theming support, see [custom color themes](https://github.com/thlorenz/cardinal/tree/master/themes)
|
||||
- optionally print line numbers
|
||||
- API and command line interface (`cdl`)
|
||||
- `.cardinalrc` config to customize settings
|
||||
- supports UNIX pipes
|
||||
|
||||
***
|
||||
|
||||
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
|
||||
|
||||
- [Installation](#installation)
|
||||
- [As library](#as-library)
|
||||
- [As Commandline Tool](#as-commandline-tool)
|
||||
- [Commandline](#commandline)
|
||||
- [Highlight a file](#highlight-a-file)
|
||||
- [As part of a UNIX pipe](#as-part-of-a-unix-pipe)
|
||||
- [Theme](#theme)
|
||||
- [API](#api)
|
||||
- [*highlight(code[, opts])*](#highlightcode-opts)
|
||||
- [*highlightFileSync(fullPath[, opts])*](#highlightfilesyncfullpath-opts)
|
||||
- [*highlightFile(fullPath[, opts], callback)*](#highlightfilefullpath-opts-callback)
|
||||
- [opts](#opts)
|
||||
- [Examples ([*browse*](https://github.com/thlorenz/cardinal/tree/master/examples))](#examples-[browse]https://githubcom/thlorenz/cardinal/tree/master/examples)
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### As library
|
||||
|
||||
npm install cardinal
|
||||
|
||||
### As Commandline Tool
|
||||
|
||||
[sudo] npm install -g cardinal
|
||||
|
||||
**Note:**
|
||||
|
||||
When installed globally, cardinal exposes itself as the `cdl` command.
|
||||
|
||||
## Commandline
|
||||
|
||||
### Highlight a file
|
||||
|
||||
cdl <file.js> [options]
|
||||
|
||||
**options**:
|
||||
- `--nonum`: turns off line number printing (relevant if it is turned on inside `~/.cardinalrc`
|
||||
|
||||
### As part of a UNIX pipe
|
||||
|
||||
cat file.js | grep console | cdl
|
||||
|
||||
**Note:**
|
||||
|
||||
Not all code lines may be parsable JavaScript. In these cases the line is printed to the terminal without
|
||||
highlighting it.
|
||||
|
||||
### Theme
|
||||
|
||||
The default theme will be used for highlighting.
|
||||
|
||||
To use a different theme, include a `.cardinalrc` file in your `HOME` directory.
|
||||
|
||||
This is a JSON file of the following form:
|
||||
|
||||
```json
|
||||
{
|
||||
"theme": "hide-semicolons",
|
||||
"linenos": true|false
|
||||
}
|
||||
```
|
||||
|
||||
- `theme` can be the name of any of the [built-in themes](https://github.com/thlorenz/cardinal/tree/master/themes) or the
|
||||
full path to a custom theme anywhere on your computer.
|
||||
- linenos toggles line number printing
|
||||
|
||||
## API
|
||||
|
||||
### *highlight(code[, opts])*
|
||||
|
||||
- returns the highlighted version of the passed code ({String}) or throws an error if it was not able to parse it
|
||||
- opts (see below)
|
||||
|
||||
### *highlightFileSync(fullPath[, opts])*
|
||||
|
||||
- returns the highlighted version of the file whose fullPath ({String}) was passed or throws an error if it was not able
|
||||
to parse it
|
||||
- opts (see below)
|
||||
|
||||
### *highlightFile(fullPath[, opts], callback)*
|
||||
|
||||
- calls back with the highlighted version of the file whose fullPath ({String}) was passed or with an error if it was not able
|
||||
to parse it
|
||||
- opts (see below)
|
||||
- `callback` ({Function}) has the following signature: `function (err, highlighted) { .. }`
|
||||
|
||||
### opts
|
||||
|
||||
opts is an {Object} with the following properties:
|
||||
|
||||
- `theme` {Object} is used to optionally override the theme used to highlight
|
||||
- `linenos` {Boolean} if `true` line numbers are included in the highlighted code
|
||||
- `firstline` {Integer} sets line number of the first line when line numbers are printed
|
||||
- `jsx` {Boolean} if `true` _JSX_ syntax is supported, otherwise cardinal will raise an error
|
||||
when encountering _JSX_ (default: `false`)
|
||||
|
||||
**Note** The `json` option is obsoleted and not necessary anymore as cardinal properly understands both JSON and JavaScript.
|
||||
|
||||
## Examples ([*browse*](https://github.com/thlorenz/cardinal/tree/master/examples))
|
||||
|
||||
- [sample .cardinalrc](https://github.com/thlorenz/cardinal/blob/master/examples/.cardinalrc)
|
||||
- [highlighting a code snippet](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-string.js) via
|
||||
***highlight()***
|
||||
- [file that highlights itself](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-self.js) via
|
||||
***highlightFile()*** including line numbers
|
||||
- [file that highlights itself hiding all
|
||||
semicolons](https://github.com/thlorenz/cardinal/blob/master/examples/highlight-self-hide-semicolons.js) via
|
||||
***highlightFileSync()***
|
||||
7
node_modules/cardinal/examples/README.md
generated
vendored
7
node_modules/cardinal/examples/README.md
generated
vendored
@@ -1,7 +0,0 @@
|
||||
# Cardinal Examples
|
||||
|
||||
You can run the examples individually or as a demo:
|
||||
|
||||
- install cardinal: `npm install cardinal`
|
||||
- explore cardinal: `npm explore cardinal`
|
||||
- run the demo: `npm run demo`
|
||||
31
node_modules/cardinal/themes/README.md
generated
vendored
31
node_modules/cardinal/themes/README.md
generated
vendored
@@ -1,31 +0,0 @@
|
||||
# cardinal themes
|
||||
|
||||
These are the built in themes that come with cardinal.
|
||||
|
||||
You can create more themes by copying and then editing the [empty
|
||||
theme](https://github.com/thlorenz/cardinal/blob/master/themes/empty.js) which is provided for that purpose.
|
||||
|
||||
The [hide semicolons theme](https://github.com/thlorenz/cardinal/blob/master/themes/hide-semicolons.js) has the added
|
||||
benefit of making all semicolons invisible. This makes code more readable at times.
|
||||
|
||||
Find out how to change the theme used by cardinal [here](https://github.com/thlorenz/cardinal#theme).
|
||||
|
||||
# sharing themes
|
||||
|
||||
To add your theme to the cardinal built-in themes, follow the below steps:
|
||||
|
||||
1. fork the cardinal repository
|
||||
2. add your theme to the themes folder and commit your changes
|
||||
3. create a pull request
|
||||
|
||||
If you believe that your theme is better than the current default theme, let me know by creating an issue.
|
||||
|
||||
This will allow others to cast their vote. If enough people agree, your theme will be promoted to be the default.
|
||||
|
||||
## Contributed Themes
|
||||
|
||||
### tomorrow night
|
||||
|
||||
[](https://github.com/thlorenz/cardinal/blob/master/themes/tomorrow-night.js)
|
||||
|
||||
*by [firede](https://github.com/firede)*
|
||||
314
node_modules/chalk/readme.md
generated
vendored
314
node_modules/chalk/readme.md
generated
vendored
@@ -1,314 +0,0 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<br>
|
||||
<img width="320" src="media/logo.svg" alt="Chalk">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
> Terminal string styling done right
|
||||
|
||||
[](https://travis-ci.org/chalk/chalk) [](https://coveralls.io/github/chalk/chalk?branch=master) [](https://www.youtube.com/watch?v=9auOCbH5Ns4) [](https://github.com/xojs/xo) [](https://github.com/sindresorhus/awesome-nodejs)
|
||||
|
||||
### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
|
||||
|
||||
<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900">
|
||||
|
||||
|
||||
## Highlights
|
||||
|
||||
- Expressive API
|
||||
- Highly performant
|
||||
- Ability to nest styles
|
||||
- [256/Truecolor color support](#256-and-truecolor-color-support)
|
||||
- Auto-detects color support
|
||||
- Doesn't extend `String.prototype`
|
||||
- Clean and focused
|
||||
- Actively maintained
|
||||
- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```console
|
||||
$ npm install chalk
|
||||
```
|
||||
|
||||
<a href="https://www.patreon.com/sindresorhus">
|
||||
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
|
||||
</a>
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
|
||||
console.log(chalk.blue('Hello world!'));
|
||||
```
|
||||
|
||||
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
const log = console.log;
|
||||
|
||||
// Combine styled and normal strings
|
||||
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
|
||||
|
||||
// Compose multiple styles using the chainable API
|
||||
log(chalk.blue.bgRed.bold('Hello world!'));
|
||||
|
||||
// Pass in multiple arguments
|
||||
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
|
||||
|
||||
// Nest styles
|
||||
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
|
||||
|
||||
// Nest styles of the same type even (color, underline, background)
|
||||
log(chalk.green(
|
||||
'I am a green line ' +
|
||||
chalk.blue.underline.bold('with a blue substring') +
|
||||
' that becomes green again!'
|
||||
));
|
||||
|
||||
// ES2015 template literal
|
||||
log(`
|
||||
CPU: ${chalk.red('90%')}
|
||||
RAM: ${chalk.green('40%')}
|
||||
DISK: ${chalk.yellow('70%')}
|
||||
`);
|
||||
|
||||
// ES2015 tagged template literal
|
||||
log(chalk`
|
||||
CPU: {red ${cpu.totalPercent}%}
|
||||
RAM: {green ${ram.used / ram.total * 100}%}
|
||||
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
|
||||
`);
|
||||
|
||||
// Use RGB colors in terminal emulators that support it.
|
||||
log(chalk.keyword('orange')('Yay for orange colored text!'));
|
||||
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
|
||||
log(chalk.hex('#DEADED').bold('Bold gray!'));
|
||||
```
|
||||
|
||||
Easily define your own themes:
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
|
||||
const error = chalk.bold.red;
|
||||
const warning = chalk.keyword('orange');
|
||||
|
||||
console.log(error('Error!'));
|
||||
console.log(warning('Warning!'));
|
||||
```
|
||||
|
||||
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
|
||||
|
||||
```js
|
||||
const name = 'Sindre';
|
||||
console.log(chalk.green('Hello %s'), name);
|
||||
//=> 'Hello Sindre'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### chalk.`<style>[.<style>...](string, [string...])`
|
||||
|
||||
Example: `chalk.red.bold.underline('Hello', 'world');`
|
||||
|
||||
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
|
||||
|
||||
Multiple arguments will be separated by space.
|
||||
|
||||
### chalk.enabled
|
||||
|
||||
Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
|
||||
|
||||
Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
|
||||
|
||||
If you need to change this in a reusable module, create a new instance:
|
||||
|
||||
```js
|
||||
const ctx = new chalk.constructor({enabled: false});
|
||||
```
|
||||
|
||||
### chalk.level
|
||||
|
||||
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
|
||||
|
||||
If you need to change this in a reusable module, create a new instance:
|
||||
|
||||
```js
|
||||
const ctx = new chalk.constructor({level: 0});
|
||||
```
|
||||
|
||||
Levels are as follows:
|
||||
|
||||
0. All colors disabled
|
||||
1. Basic color support (16 colors)
|
||||
2. 256 color support
|
||||
3. Truecolor support (16 million colors)
|
||||
|
||||
### chalk.supportsColor
|
||||
|
||||
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
|
||||
|
||||
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
|
||||
|
||||
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(Not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(Not widely supported)*
|
||||
- `visible` (Text is emitted only if enabled)
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue` *(On Windows the bright version is used since normal blue is illegible)*
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `gray` ("bright black")
|
||||
- `redBright`
|
||||
- `greenBright`
|
||||
- `yellowBright`
|
||||
- `blueBright`
|
||||
- `magentaBright`
|
||||
- `cyanBright`
|
||||
- `whiteBright`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
- `bgBlackBright`
|
||||
- `bgRedBright`
|
||||
- `bgGreenBright`
|
||||
- `bgYellowBright`
|
||||
- `bgBlueBright`
|
||||
- `bgMagentaBright`
|
||||
- `bgCyanBright`
|
||||
- `bgWhiteBright`
|
||||
|
||||
|
||||
## Tagged template literal
|
||||
|
||||
Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
|
||||
const miles = 18;
|
||||
const calculateFeet = miles => miles * 5280;
|
||||
|
||||
console.log(chalk`
|
||||
There are {bold 5280 feet} in a mile.
|
||||
In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
|
||||
`);
|
||||
```
|
||||
|
||||
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
|
||||
|
||||
Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
|
||||
|
||||
```js
|
||||
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
|
||||
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
|
||||
```
|
||||
|
||||
Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
|
||||
|
||||
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
|
||||
|
||||
|
||||
## 256 and Truecolor color support
|
||||
|
||||
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
|
||||
|
||||
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
|
||||
|
||||
Examples:
|
||||
|
||||
- `chalk.hex('#DEADED').underline('Hello, world!')`
|
||||
- `chalk.keyword('orange')('Some orange text')`
|
||||
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
|
||||
|
||||
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
|
||||
|
||||
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
|
||||
- `chalk.bgKeyword('orange')('Some orange text')`
|
||||
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
|
||||
|
||||
The following color models can be used:
|
||||
|
||||
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
|
||||
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
||||
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
|
||||
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
|
||||
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
|
||||
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
|
||||
- `ansi16`
|
||||
- `ansi256`
|
||||
|
||||
|
||||
## Windows
|
||||
|
||||
If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`.
|
||||
|
||||
|
||||
## Origin story
|
||||
|
||||
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
|
||||
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
|
||||
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
|
||||
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
|
||||
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
|
||||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
|
||||
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
||||
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
|
||||
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
|
||||
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
|
||||
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
|
||||
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
76
node_modules/clean-stack/readme.md
generated
vendored
76
node_modules/clean-stack/readme.md
generated
vendored
@@ -1,76 +0,0 @@
|
||||
# clean-stack [](https://travis-ci.org/sindresorhus/clean-stack)
|
||||
|
||||
> Clean up error stack traces
|
||||
|
||||
Removes the mostly unhelpful internal Node.js entries.
|
||||
|
||||
Also works in Electron.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install clean-stack
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const cleanStack = require('clean-stack');
|
||||
|
||||
const error = new Error('Missing unicorn');
|
||||
|
||||
console.log(error.stack);
|
||||
/*
|
||||
Error: Missing unicorn
|
||||
at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
|
||||
at Module._compile (module.js:409:26)
|
||||
at Object.Module._extensions..js (module.js:416:10)
|
||||
at Module.load (module.js:343:32)
|
||||
at Function.Module._load (module.js:300:12)
|
||||
at Function.Module.runMain (module.js:441:10)
|
||||
at startup (node.js:139:18)
|
||||
*/
|
||||
|
||||
console.log(cleanStack(error.stack));
|
||||
/*
|
||||
Error: Missing unicorn
|
||||
at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
|
||||
*/
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### cleanStack(stack, [options])
|
||||
|
||||
#### stack
|
||||
|
||||
Type: `string`
|
||||
|
||||
The `stack` property of an `Error`.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### pretty
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Prettify the file paths in the stack:
|
||||
|
||||
`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15`
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [extrack-stack](https://github.com/sindresorhus/extract-stack) - Extract the actual stack of an error
|
||||
- [stack-utils](https://github.com/tapjs/stack-utils) - Captures and cleans stack traces
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
104
node_modules/cli-table3/CHANGELOG.md
generated
vendored
104
node_modules/cli-table3/CHANGELOG.md
generated
vendored
@@ -1,104 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## v0.6.2 (2022-04-11)
|
||||
|
||||
#### :rocket: Enhancement
|
||||
* [#292](https://github.com/cli-table/cli-table3/pull/292) Hyperlink support for cells ([@speedytwenty](https://github.com/speedytwenty))
|
||||
* [#288](https://github.com/cli-table/cli-table3/pull/288) Add debugging capabilities ([@speedytwenty](https://github.com/speedytwenty))
|
||||
* [#217](https://github.com/cli-table/cli-table3/pull/217) Add wrapOnWordBoundary option for consistently readable word wrapping ([@speedytwenty](https://github.com/speedytwenty))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* [#290](https://github.com/cli-table/cli-table3/pull/290) Fix to erroneous column truncation when using colSpan ([@speedytwenty](https://github.com/speedytwenty))
|
||||
* [#287](https://github.com/cli-table/cli-table3/pull/287) Correctly set cell padding for zero values ([@speedytwenty](https://github.com/speedytwenty))
|
||||
* [#278](https://github.com/cli-table/cli-table3/pull/278) Refactored table layouts + Layout fix for #269 ([@speedytwenty](https://github.com/speedytwenty))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#286](https://github.com/cli-table/cli-table3/pull/286) Regenerate docs ([@speedytwenty](https://github.com/speedytwenty))
|
||||
|
||||
#### :house: Internal
|
||||
* [#276](https://github.com/cli-table/cli-table3/pull/276) Move CI to Github Actions ([@speedytwenty](https://github.com/speedytwenty))
|
||||
* [#283](https://github.com/cli-table/cli-table3/pull/283) #196 - Fix to failing unit tests ([@speedytwenty](https://github.com/speedytwenty))
|
||||
|
||||
## v0.6.1 (2022-01-09)
|
||||
|
||||
* [#251](https://github.com/cli-table/cli-table3/pull/251) Pin `colors` to 1.4.0 ([@JJ](https://github.com/JJ))
|
||||
|
||||
## v0.6.0 (2020-03-30)
|
||||
|
||||
#### :boom: Breaking Change
|
||||
* [#156](https://github.com/cli-table/cli-table3/pull/156) Drop support for Node 6 and 8 ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* [#92](https://github.com/cli-table/cli-table3/pull/92) Emoji Length Calculation Fix ([@acupoftee](https://github.com/acupoftee))
|
||||
* [#53](https://github.com/cli-table/cli-table3/pull/53) "Table" union type definition fix ([@macieklad](https://github.com/macieklad))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#135](https://github.com/cli-table/cli-table3/pull/135) docs: use https ([@DanielRuf](https://github.com/DanielRuf))
|
||||
|
||||
#### :house: Internal
|
||||
* [#132](https://github.com/cli-table/cli-table3/pull/132) Update lockfile ([@DanielRuf](https://github.com/DanielRuf))
|
||||
* [#134](https://github.com/cli-table/cli-table3/pull/134) Fix ESLint errors ([@DanielRuf](https://github.com/DanielRuf))
|
||||
* [#103](https://github.com/cli-table/cli-table3/pull/103) Fix Jest configuration ([@boneskull](https://github.com/boneskull))
|
||||
|
||||
#### Committers: 5
|
||||
- Christopher Hiller ([@boneskull](https://github.com/boneskull))
|
||||
- Daniel Ruf ([@DanielRuf](https://github.com/DanielRuf))
|
||||
- Maciej Ładoś ([@macieklad](https://github.com/macieklad))
|
||||
- Tee ([@acupoftee](https://github.com/acupoftee))
|
||||
- Tobias Bieniek ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
|
||||
## v0.5.1 (2018-07-19)
|
||||
|
||||
#### :rocket: Enhancement
|
||||
* [#21](https://github.com/cli-table/cli-table3/pull/21) Import type definition from `@types/cli-table2` ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### Committers: 1
|
||||
- Tobias Bieniek ([Turbo87](https://github.com/Turbo87))
|
||||
|
||||
|
||||
## v0.5.0 (2018-06-11)
|
||||
|
||||
#### :boom: Breaking Change
|
||||
* [#2](https://github.com/cli-table/cli-table3/pull/2) Update Node version requirements. ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#11](https://github.com/cli-table/cli-table3/pull/11) Update Documentation. ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### :house: Internal
|
||||
* [#16](https://github.com/cli-table/cli-table3/pull/16) Replace `kind-of` dependency with `typeof` and `Array.isArray()`. ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#15](https://github.com/cli-table/cli-table3/pull/15) Remove Gulp. ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#13](https://github.com/cli-table/cli-table3/pull/13) Use ES6 class syntax and `let/const`. ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#12](https://github.com/cli-table/cli-table3/pull/12) Add ESLint and Prettier. ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#10](https://github.com/cli-table/cli-table3/pull/10) chore: use yarn cache. ([@DanielRuf](https://github.com/DanielRuf))
|
||||
* [#9](https://github.com/cli-table/cli-table3/pull/9) Use Jest for testing. ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#3](https://github.com/cli-table/cli-table3/pull/3) Add `yarn.lock` file. ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#1](https://github.com/cli-table/cli-table3/pull/1) Skip broken test. ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### Committers: 2
|
||||
- Daniel Ruf ([DanielRuf](https://github.com/DanielRuf))
|
||||
- Tobias Bieniek ([Turbo87](https://github.com/Turbo87))
|
||||
|
||||
|
||||
## v0.4.0 (2018-06-10)
|
||||
|
||||
First official release as `cli-table3`. Changes compares to `cli-table2` v0.2.0:
|
||||
|
||||
#### :rocket: Enhancement
|
||||
* [#27](https://github.com/jamestalmage/cli-table2/pull/27) Remove "lodash" dependency. ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* [#29](https://github.com/jamestalmage/cli-table2/pull/29) Fix wordWrap with colSpan. ([@mmurphy](https://github.com/mmurphy))
|
||||
* [#24](https://github.com/jamestalmage/cli-table2/pull/24) Fixing the runtime error when content is truncated. ([@sthadeshwar](https://github.com/sthadeshwar))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#41](https://github.com/jamestalmage/cli-table2/pull/41) Create LICENSE. ([@GantMan](https://github.com/GantMan))
|
||||
|
||||
#### :house: Internal
|
||||
* [#26](https://github.com/jamestalmage/cli-table2/pull/26) package.json: Whitelist JS files ([@Turbo87](https://github.com/Turbo87))
|
||||
|
||||
#### Committers: 4
|
||||
- Gant Laborde ([GantMan](https://github.com/GantMan))
|
||||
- Martin Murphy ([mmurphy](https://github.com/mmurphy))
|
||||
- Satyajit Thadeshwar ([sthadeshwar](https://github.com/sthadeshwar))
|
||||
- Tobias Bieniek ([Turbo87](https://github.com/Turbo87))
|
||||
236
node_modules/cli-table3/README.md
generated
vendored
236
node_modules/cli-table3/README.md
generated
vendored
@@ -1,236 +0,0 @@
|
||||
cli-table3
|
||||
===============================================================================
|
||||
|
||||
[](https://www.npmjs.com/package/cli-table3)
|
||||
[](https://github.com/cli-table/cli-table3/actions/workflows/test.yml)
|
||||
|
||||
This utility allows you to render unicode-aided tables on the command line from
|
||||
your node.js scripts.
|
||||
|
||||
`cli-table3` is based on (and api compatible with) the original [cli-table](https://github.com/Automattic/cli-table),
|
||||
and [cli-table2](https://github.com/jamestalmage/cli-table2), which are both
|
||||
unmaintained. `cli-table3` includes all the additional features from
|
||||
`cli-table2`.
|
||||
|
||||

|
||||
|
||||
## Features not in the original cli-table
|
||||
|
||||
- Ability to make cells span columns and/or rows.
|
||||
- Ability to set custom styles per cell (border characters/colors, padding, etc).
|
||||
- Vertical alignment (top, bottom, center).
|
||||
- [Word wrapping options](./basic-usage.md#set-wordwrap-to-true-to-wrap-text-on-word-boundaries).
|
||||
- More robust truncation of cell text that contains ansi color characters.
|
||||
- Better handling of text color that spans multiple lines.
|
||||
- API compatible with the original cli-table.
|
||||
- Exhaustive test suite including the entire original cli-table test suite.
|
||||
- Lots of examples auto-generated from the tests ([basic](https://github.com/cli-table/cli-table3/blob/master/basic-usage.md), [advanced](https://github.com/cli-table/cli-table3/blob/master/advanced-usage.md)).
|
||||
|
||||
## Features
|
||||
|
||||
- Customizable characters that constitute the table.
|
||||
- Color/background styling in the header through
|
||||
[<s>colors.js</s>](https://github.com/marak/colors.js)
|
||||
[@colors/colors](https://github.com/DABH/colors.js)
|
||||
- Column width customization
|
||||
- Text truncation based on predefined widths
|
||||
- Text alignment (left, right, center)
|
||||
- Padding (left, right)
|
||||
- Easy-to-use API
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install cli-table3
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
||||
A portion of the unit test suite is used to generate examples:
|
||||
- [basic-usage](https://github.com/cli-table/cli-table3/blob/master/basic-usage.md) - covers basic uses.
|
||||
- [advanced](https://github.com/cli-table/cli-table3/blob/master/advanced-usage.md) - covers using the new column and row span features.
|
||||
|
||||
This package is api compatible with the original [cli-table](https://github.com/Automattic/cli-table).
|
||||
So all the original documentation still applies (copied below).
|
||||
|
||||
### Horizontal Tables
|
||||
```javascript
|
||||
var Table = require('cli-table3');
|
||||
|
||||
// instantiate
|
||||
var table = new Table({
|
||||
head: ['TH 1 label', 'TH 2 label']
|
||||
, colWidths: [100, 200]
|
||||
});
|
||||
|
||||
// table is an Array, so you can `push`, `unshift`, `splice` and friends
|
||||
table.push(
|
||||
['First value', 'Second value']
|
||||
, ['First value', 'Second value']
|
||||
);
|
||||
|
||||
console.log(table.toString());
|
||||
```
|
||||
|
||||
### Vertical Tables
|
||||
```javascript
|
||||
var Table = require('cli-table3');
|
||||
var table = new Table();
|
||||
|
||||
table.push(
|
||||
{ 'Some key': 'Some value' }
|
||||
, { 'Another key': 'Another value' }
|
||||
);
|
||||
|
||||
console.log(table.toString());
|
||||
```
|
||||
### Cross Tables
|
||||
Cross tables are very similar to vertical tables, with two key differences:
|
||||
|
||||
1. They require a `head` setting when instantiated that has an empty string as the first header
|
||||
2. The individual rows take the general form of { "Header": ["Row", "Values"] }
|
||||
|
||||
```javascript
|
||||
var Table = require('cli-table3');
|
||||
var table = new Table({ head: ["", "Top Header 1", "Top Header 2"] });
|
||||
|
||||
table.push(
|
||||
{ 'Left Header 1': ['Value Row 1 Col 1', 'Value Row 1 Col 2'] }
|
||||
, { 'Left Header 2': ['Value Row 2 Col 1', 'Value Row 2 Col 2'] }
|
||||
);
|
||||
|
||||
console.log(table.toString());
|
||||
```
|
||||
|
||||
### Custom styles
|
||||
The ```chars``` property controls how the table is drawn:
|
||||
```javascript
|
||||
var table = new Table({
|
||||
chars: { 'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗'
|
||||
, 'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝'
|
||||
, 'left': '║' , 'left-mid': '╟' , 'mid': '─' , 'mid-mid': '┼'
|
||||
, 'right': '║' , 'right-mid': '╢' , 'middle': '│' }
|
||||
});
|
||||
|
||||
table.push(
|
||||
['foo', 'bar', 'baz']
|
||||
, ['frob', 'bar', 'quuz']
|
||||
);
|
||||
|
||||
console.log(table.toString());
|
||||
// Outputs:
|
||||
//
|
||||
//╔══════╤═════╤══════╗
|
||||
//║ foo │ bar │ baz ║
|
||||
//╟──────┼─────┼──────╢
|
||||
//║ frob │ bar │ quuz ║
|
||||
//╚══════╧═════╧══════╝
|
||||
```
|
||||
|
||||
Empty decoration lines will be skipped, to avoid vertical separator rows just
|
||||
set the 'mid', 'left-mid', 'mid-mid', 'right-mid' to the empty string:
|
||||
```javascript
|
||||
var table = new Table({ chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''} });
|
||||
table.push(
|
||||
['foo', 'bar', 'baz']
|
||||
, ['frobnicate', 'bar', 'quuz']
|
||||
);
|
||||
|
||||
console.log(table.toString());
|
||||
// Outputs: (note the lack of the horizontal line between rows)
|
||||
//┌────────────┬─────┬──────┐
|
||||
//│ foo │ bar │ baz │
|
||||
//│ frobnicate │ bar │ quuz │
|
||||
//└────────────┴─────┴──────┘
|
||||
```
|
||||
|
||||
By setting all chars to empty with the exception of 'middle' being set to a
|
||||
single space and by setting padding to zero, it's possible to get the most
|
||||
compact layout with no decorations:
|
||||
```javascript
|
||||
var table = new Table({
|
||||
chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
|
||||
, 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
|
||||
, 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
|
||||
, 'right': '' , 'right-mid': '' , 'middle': ' ' },
|
||||
style: { 'padding-left': 0, 'padding-right': 0 }
|
||||
});
|
||||
|
||||
table.push(
|
||||
['foo', 'bar', 'baz']
|
||||
, ['frobnicate', 'bar', 'quuz']
|
||||
);
|
||||
|
||||
console.log(table.toString());
|
||||
// Outputs:
|
||||
//foo bar baz
|
||||
//frobnicate bar quuz
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
Later versions of cli-table3 supporting debugging your table data.
|
||||
|
||||
Enable and use debugging:
|
||||
|
||||
```
|
||||
var table = new Table({ debug: 1 });
|
||||
table.push([{}, {},}); // etc.
|
||||
|
||||
console.log(table.toString());
|
||||
table.messages.forEach((message) => console.log(message));
|
||||
```
|
||||
|
||||
If you are rendering multiple tables with debugging on run `Table.reset()` after
|
||||
rendering each table.
|
||||
|
||||
## Build Targets
|
||||
|
||||
Clone the repository and run `yarn install` to install all its submodules, then run one of the following commands:
|
||||
|
||||
###### Run the tests with coverage reports.
|
||||
```bash
|
||||
$ yarn test:coverage
|
||||
```
|
||||
|
||||
###### Run the tests every time a file changes.
|
||||
```bash
|
||||
$ yarn test:watch
|
||||
```
|
||||
|
||||
###### Update the documentation.
|
||||
```bash
|
||||
$ yarn docs
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
- James Talmage - author <james.talmage@jrtechnical.com> ([jamestalmage](https://github.com/jamestalmage))
|
||||
- Guillermo Rauch - author of the original cli-table <guillermo@learnboost.com> ([Rauchg](https://github.com/rauchg))
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 James Talmage <james.talmage@jrtechnical.com>
|
||||
|
||||
Original cli-table code/documentation: Copyright (c) 2010 LearnBoost <dev@learnboost.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.
|
||||
139
node_modules/cliui/CHANGELOG.md
generated
vendored
139
node_modules/cliui/CHANGELOG.md
generated
vendored
@@ -1,139 +0,0 @@
|
||||
# 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.
|
||||
|
||||
## [8.0.1](https://github.com/yargs/cliui/compare/v8.0.0...v8.0.1) (2022-10-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** move rollup-plugin-ts to dev deps ([#124](https://github.com/yargs/cliui/issues/124)) ([7c8bd6b](https://github.com/yargs/cliui/commit/7c8bd6ba024d61e4eeae310c7959ab8ab6829081))
|
||||
|
||||
## [8.0.0](https://github.com/yargs/cliui/compare/v7.0.4...v8.0.0) (2022-09-30)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **deps:** drop Node 10 to release CVE-2021-3807 patch (#122)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** drop Node 10 to release CVE-2021-3807 patch ([#122](https://github.com/yargs/cliui/issues/122)) ([f156571](https://github.com/yargs/cliui/commit/f156571ce4f2ebf313335e3a53ad905589da5a30))
|
||||
|
||||
### [7.0.4](https://www.github.com/yargs/cliui/compare/v7.0.3...v7.0.4) (2020-11-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** import UIOptions from definitions ([#97](https://www.github.com/yargs/cliui/issues/97)) ([f04f343](https://www.github.com/yargs/cliui/commit/f04f3439bc78114c7e90f82ff56f5acf16268ea8))
|
||||
|
||||
### [7.0.3](https://www.github.com/yargs/cliui/compare/v7.0.2...v7.0.3) (2020-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#93](https://www.github.com/yargs/cliui/issues/93)) ([eca16fc](https://www.github.com/yargs/cliui/commit/eca16fc05d26255df3280906c36d7f0e5b05c6e9))
|
||||
|
||||
### [7.0.2](https://www.github.com/yargs/cliui/compare/v7.0.1...v7.0.2) (2020-10-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0-13.6 require a string fallback ([#91](https://www.github.com/yargs/cliui/issues/91)) ([b529d7e](https://www.github.com/yargs/cliui/commit/b529d7e432901af1af7848b23ed6cf634497d961))
|
||||
|
||||
### [7.0.1](https://www.github.com/yargs/cliui/compare/v7.0.0...v7.0.1) (2020-08-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** main should be build/index.cjs ([dc29a3c](https://www.github.com/yargs/cliui/commit/dc29a3cc617a410aa850e06337b5954b04f2cb4d))
|
||||
|
||||
## [7.0.0](https://www.github.com/yargs/cliui/compare/v6.0.0...v7.0.0) (2020-08-16)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* tsc/ESM/Deno support (#82)
|
||||
* modernize deps and build (#80)
|
||||
|
||||
### Build System
|
||||
|
||||
* modernize deps and build ([#80](https://www.github.com/yargs/cliui/issues/80)) ([339d08d](https://www.github.com/yargs/cliui/commit/339d08dc71b15a3928aeab09042af94db2f43743))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* tsc/ESM/Deno support ([#82](https://www.github.com/yargs/cliui/issues/82)) ([4b777a5](https://www.github.com/yargs/cliui/commit/4b777a5fe01c5d8958c6708695d6aab7dbe5706c))
|
||||
|
||||
## [6.0.0](https://www.github.com/yargs/cliui/compare/v5.0.0...v6.0.0) (2019-11-10)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* update deps, drop Node 6
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* update deps, drop Node 6 ([62056df](https://www.github.com/yargs/cliui/commit/62056df))
|
||||
|
||||
## [5.0.0](https://github.com/yargs/cliui/compare/v4.1.0...v5.0.0) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update wrap-ansi to fix compatibility with latest versions of chalk. ([#60](https://github.com/yargs/cliui/issues/60)) ([7bf79ae](https://github.com/yargs/cliui/commit/7bf79ae))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Drop support for node < 6.
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
## [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
## [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46))
|
||||
* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* officially drop support for Node < 4
|
||||
|
||||
|
||||
|
||||
<a name="3.2.0"></a>
|
||||
## [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33))
|
||||
|
||||
### Features
|
||||
|
||||
* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32))
|
||||
141
node_modules/cliui/README.md
generated
vendored
141
node_modules/cliui/README.md
generated
vendored
@@ -1,141 +0,0 @@
|
||||
# cliui
|
||||
|
||||

|
||||
[](https://www.npmjs.com/package/cliui)
|
||||
[](https://conventionalcommits.org)
|
||||

|
||||
|
||||
easily create complex multi-column command-line-interfaces.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
const ui = require('cliui')()
|
||||
|
||||
ui.div('Usage: $0 [command] [options]')
|
||||
|
||||
ui.div({
|
||||
text: 'Options:',
|
||||
padding: [2, 0, 1, 0]
|
||||
})
|
||||
|
||||
ui.div(
|
||||
{
|
||||
text: "-f, --file",
|
||||
width: 20,
|
||||
padding: [0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
text: "the file to load." +
|
||||
chalk.green("(if this description is long it wraps).")
|
||||
,
|
||||
width: 20
|
||||
},
|
||||
{
|
||||
text: chalk.red("[required]"),
|
||||
align: 'right'
|
||||
}
|
||||
)
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
## Deno/ESM Support
|
||||
|
||||
As of `v7` `cliui` supports [Deno](https://github.com/denoland/deno) and
|
||||
[ESM](https://nodejs.org/api/esm.html#esm_ecmascript_modules):
|
||||
|
||||
```typescript
|
||||
import cliui from "https://deno.land/x/cliui/deno.ts";
|
||||
|
||||
const ui = cliui({})
|
||||
|
||||
ui.div('Usage: $0 [command] [options]')
|
||||
|
||||
ui.div({
|
||||
text: 'Options:',
|
||||
padding: [2, 0, 1, 0]
|
||||
})
|
||||
|
||||
ui.div({
|
||||
text: "-f, --file",
|
||||
width: 20,
|
||||
padding: [0, 4, 0, 4]
|
||||
})
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
<img width="500" src="screenshot.png">
|
||||
|
||||
## Layout DSL
|
||||
|
||||
cliui exposes a simple layout DSL:
|
||||
|
||||
If you create a single `ui.div`, passing a string rather than an
|
||||
object:
|
||||
|
||||
* `\n`: characters will be interpreted as new rows.
|
||||
* `\t`: characters will be interpreted as new columns.
|
||||
* `\s`: characters will be interpreted as padding.
|
||||
|
||||
**as an example...**
|
||||
|
||||
```js
|
||||
var ui = require('./')({
|
||||
width: 60
|
||||
})
|
||||
|
||||
ui.div(
|
||||
'Usage: node ./bin/foo.js\n' +
|
||||
' <regex>\t provide a regex\n' +
|
||||
' <glob>\t provide a glob\t [required]'
|
||||
)
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
**will output:**
|
||||
|
||||
```shell
|
||||
Usage: node ./bin/foo.js
|
||||
<regex> provide a regex
|
||||
<glob> provide a glob [required]
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
```js
|
||||
cliui = require('cliui')
|
||||
```
|
||||
|
||||
### cliui({width: integer})
|
||||
|
||||
Specify the maximum width of the UI being generated.
|
||||
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`.
|
||||
|
||||
### cliui({wrap: boolean})
|
||||
|
||||
Enable or disable the wrapping of text in a column.
|
||||
|
||||
### cliui.div(column, column, column)
|
||||
|
||||
Create a row with any number of columns, a column
|
||||
can either be a string, or an object with the following
|
||||
options:
|
||||
|
||||
* **text:** some text to place in the column.
|
||||
* **width:** the width of a column.
|
||||
* **align:** alignment, `right` or `center`.
|
||||
* **padding:** `[top, right, bottom, left]`.
|
||||
* **border:** should a border be placed around the div?
|
||||
|
||||
### cliui.span(column, column, column)
|
||||
|
||||
Similar to `div`, except the next row will be appended without
|
||||
a new line being created.
|
||||
|
||||
### cliui.resetOutput()
|
||||
|
||||
Resets the UI elements of the current cliui instance, maintaining the values
|
||||
set for `width` and `wrap`.
|
||||
54
node_modules/color-convert/CHANGELOG.md
generated
vendored
54
node_modules/color-convert/CHANGELOG.md
generated
vendored
@@ -1,54 +0,0 @@
|
||||
# 1.0.0 - 2016-01-07
|
||||
|
||||
- Removed: unused speed test
|
||||
- Added: Automatic routing between previously unsupported conversions
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Removed: `convert()` class
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Changed: all functions to lookup dictionary
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Changed: `ansi` to `ansi256`
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
- Fixed: argument grouping for functions requiring only one argument
|
||||
([#27](https://github.com/Qix-/color-convert/pull/27))
|
||||
|
||||
# 0.6.0 - 2015-07-23
|
||||
|
||||
- Added: methods to handle
|
||||
[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
|
||||
- rgb2ansi16
|
||||
- rgb2ansi
|
||||
- hsl2ansi16
|
||||
- hsl2ansi
|
||||
- hsv2ansi16
|
||||
- hsv2ansi
|
||||
- hwb2ansi16
|
||||
- hwb2ansi
|
||||
- cmyk2ansi16
|
||||
- cmyk2ansi
|
||||
- keyword2ansi16
|
||||
- keyword2ansi
|
||||
- ansi162rgb
|
||||
- ansi162hsl
|
||||
- ansi162hsv
|
||||
- ansi162hwb
|
||||
- ansi162cmyk
|
||||
- ansi162keyword
|
||||
- ansi2rgb
|
||||
- ansi2hsl
|
||||
- ansi2hsv
|
||||
- ansi2hwb
|
||||
- ansi2cmyk
|
||||
- ansi2keyword
|
||||
([#18](https://github.com/harthur/color-convert/pull/18))
|
||||
|
||||
# 0.5.3 - 2015-06-02
|
||||
|
||||
- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
|
||||
([#15](https://github.com/harthur/color-convert/issues/15))
|
||||
|
||||
---
|
||||
|
||||
Check out commit logs for older releases
|
||||
68
node_modules/color-convert/README.md
generated
vendored
68
node_modules/color-convert/README.md
generated
vendored
@@ -1,68 +0,0 @@
|
||||
# color-convert
|
||||
|
||||
[](https://travis-ci.org/Qix-/color-convert)
|
||||
|
||||
Color-convert is a color conversion library for JavaScript and node.
|
||||
It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
|
||||
convert.keyword.rgb('blue'); // [0, 0, 255]
|
||||
|
||||
var rgbChannels = convert.rgb.channels; // 3
|
||||
var cmykChannels = convert.cmyk.channels; // 4
|
||||
var ansiChannels = convert.ansi16.channels; // 1
|
||||
```
|
||||
|
||||
# Install
|
||||
|
||||
```console
|
||||
$ npm install color-convert
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
Simply get the property of the _from_ and _to_ conversion that you're looking for.
|
||||
|
||||
All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
|
||||
|
||||
All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
// Hex to LAB
|
||||
convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
|
||||
convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
|
||||
|
||||
// RGB to CMYK
|
||||
convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
|
||||
convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
|
||||
```
|
||||
|
||||
### Arrays
|
||||
All functions that accept multiple arguments also support passing an array.
|
||||
|
||||
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
|
||||
|
||||
```js
|
||||
var convert = require('color-convert');
|
||||
|
||||
convert.rgb.hex(123, 45, 67); // '7B2D43'
|
||||
convert.rgb.hex([123, 45, 67]); // '7B2D43'
|
||||
```
|
||||
|
||||
## Routing
|
||||
|
||||
Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
|
||||
|
||||
Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
|
||||
|
||||
# Contribute
|
||||
|
||||
If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
|
||||
|
||||
# License
|
||||
Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
|
||||
11
node_modules/color-name/README.md
generated
vendored
11
node_modules/color-name/README.md
generated
vendored
@@ -1,11 +0,0 @@
|
||||
A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
|
||||
|
||||
[](https://nodei.co/npm/color-name/)
|
||||
|
||||
|
||||
```js
|
||||
var colors = require('color-name');
|
||||
colors.red //[255,0,0]
|
||||
```
|
||||
|
||||
<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
|
||||
70
node_modules/compare-func/README.md
generated
vendored
70
node_modules/compare-func/README.md
generated
vendored
@@ -1,70 +0,0 @@
|
||||
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
> Get a compare function for array to sort
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save compare-func
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var compareFunc = require('compare-func');
|
||||
|
||||
// sort by an object property
|
||||
[{x: 'b'}, {x: 'a'}, {x: 'c'}].sort(compareFunc('x'));
|
||||
//=> [{x: 'a'}, {x: 'b'}, {x: 'c'}]
|
||||
|
||||
// sort by a nested object property
|
||||
[{x: {y: 'b'}}, {x: {y: 'a'}}].sort(compareFunc('x.y'));
|
||||
//=> [{x: {y: 'a'}}, {x: {y: 'b'}}]
|
||||
|
||||
// sort by the `x` propery, then `y`
|
||||
[{x: 'c', y: 'c'}, {x: 'b', y: 'a'}, {x: 'b', y: 'b'}].sort(compareFunc(['x', 'y']));
|
||||
//=> [{x: 'b', y: 'a'}, {x: 'b', y: 'b'}, {x: 'c', y: 'c'}]
|
||||
|
||||
// sort by the returned value
|
||||
[{x: 'b'}, {x: 'a'}, {x: 'c'}].sort(compareFunc(function(el) {
|
||||
return el.x;
|
||||
}));
|
||||
//=> [{x: 'a'}, {x: 'b'}, {x: 'c'}]
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### compareFunc([property])
|
||||
|
||||
Returns a compare function for array to sort
|
||||
|
||||
#### property
|
||||
|
||||
Type: `string`, `function` or `array` of either
|
||||
|
||||
If missing it sorts on itself.
|
||||
|
||||
The string can be a [dot path](https://github.com/sindresorhus/dot-prop) to a nested object property.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [sort-on](https://github.com/sindresorhus/sort-on) - Sort an array on an object property
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Steve Mao](https://github.com/stevemao)
|
||||
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/compare-func.svg
|
||||
[npm-url]: https://npmjs.org/package/compare-func
|
||||
[travis-image]: https://travis-ci.org/stevemao/compare-func.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/stevemao/compare-func
|
||||
[daviddm-image]: https://david-dm.org/stevemao/compare-func.svg?theme=shields.io
|
||||
[daviddm-url]: https://david-dm.org/stevemao/compare-func
|
||||
[coveralls-image]: https://coveralls.io/repos/stevemao/compare-func/badge.svg
|
||||
[coveralls-url]: https://coveralls.io/r/stevemao/compare-func
|
||||
4
node_modules/concat-map/.travis.yml
generated
vendored
4
node_modules/concat-map/.travis.yml
generated
vendored
@@ -1,4 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.4
|
||||
- 0.6
|
||||
408
node_modules/conventional-changelog-angular/CHANGELOG.md
generated
vendored
408
node_modules/conventional-changelog-angular/CHANGELOG.md
generated
vendored
@@ -1,408 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
### [5.0.13](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular-vconventional-changelog-angular@5.0.12...conventional-changelog-angular-v5.0.13) (2021-09-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conventional-commits-parser:** address CVE-2021-23425 ([#841](https://www.github.com/conventional-changelog/conventional-changelog/issues/841)) ([02b3d53](https://www.github.com/conventional-changelog/conventional-changelog/commit/02b3d53a0c142f0c28ee7d190d210c76a62887c2))
|
||||
|
||||
## [5.0.12](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.11...conventional-changelog-angular@5.0.12) (2020-11-05)
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.11](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.10...conventional-changelog-angular@5.0.11) (2020-06-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency compare-func to v2 ([#647](https://github.com/conventional-changelog/conventional-changelog/issues/647)) ([de4f630](https://github.com/conventional-changelog/conventional-changelog/commit/de4f6309403ca0d46b7c6235052f4dca61ea15bc))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.10](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.6...conventional-changelog-angular@5.0.10) (2020-05-08)
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.5...conventional-changelog-angular@5.0.6) (2019-11-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revertPattern match default git revert format ([#545](https://github.com/conventional-changelog/conventional-changelog/issues/545)) ([fe449f8](https://github.com/conventional-changelog/conventional-changelog/commit/fe449f899567574a36d1819b313e2caa899052ff))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.3...conventional-changelog-angular@5.0.4) (2019-10-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* use full commit hash in commit link ([7a60dec](https://github.com/conventional-changelog/conventional-changelog/commit/7a60dec)), closes [#476](https://github.com/conventional-changelog/conventional-changelog/issues/476)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.2...conventional-changelog-angular@5.0.3) (2019-02-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **preset:angular:** scoped npm packages should not be seen as GitHub username ([#394](https://github.com/conventional-changelog/conventional-changelog/issues/394)) ([e332ef0](https://github.com/conventional-changelog/conventional-changelog/commit/e332ef0))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.1...conventional-changelog-angular@5.0.2) (2018-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="5.0.1"></a>
|
||||
## [5.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@5.0.0...conventional-changelog-angular@5.0.1) (2018-08-21)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="5.0.0"></a>
|
||||
# [5.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@4.0.1...conventional-changelog-angular@5.0.0) (2018-06-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* re-use parser options within each preset ([#335](https://github.com/conventional-changelog/conventional-changelog/issues/335)) ([d3eaacf](https://github.com/conventional-changelog/conventional-changelog/commit/d3eaacf)), closes [#241](https://github.com/conventional-changelog/conventional-changelog/issues/241)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Re-use parser options object between components of a preset. For some
|
||||
presets this may change the behavior of `conventional-recommended-bump`
|
||||
as the parser options object for the `conventional-recommended-bump` options
|
||||
within a preset were different than the parser options object for the
|
||||
`conventional-changelog` options within a preset.
|
||||
|
||||
If you are not using `conventional-recommended-bump`, then this is
|
||||
**not** a breaking change for you.
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="4.0.1"></a>
|
||||
## [4.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@4.0.0...conventional-changelog-angular@4.0.1) (2018-06-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix plurality of "are" vs. "is" ([#331](https://github.com/conventional-changelog/conventional-changelog/issues/331)) ([027e778](https://github.com/conventional-changelog/conventional-changelog/commit/027e778))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.7...conventional-changelog-angular@4.0.0) (2018-05-29)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* remove anchor from header templates ([#301](https://github.com/conventional-changelog/conventional-changelog/issues/301)) ([346f24f](https://github.com/conventional-changelog/conventional-changelog/commit/346f24f)), closes [#186](https://github.com/conventional-changelog/conventional-changelog/issues/186)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **package:** Set the package's minimum required Node version to be the oldest LTS
|
||||
currently supported by the Node Release working group. At this time,
|
||||
that is Node 6 (which is in its Maintenance LTS phase).
|
||||
* Anchor tags are removed from the changelog header templates. The
|
||||
rendered Markdown will no longer contain anchor tags proceeding the
|
||||
version number header that constitutes the changelog header. This means
|
||||
that consumers of rendered markdown will not be able to use a URL that
|
||||
has been constructed to contain a version number anchor tag reference,
|
||||
since the anchor tag won't exist in the rendered markdown.
|
||||
|
||||
It's stronly recomended consumers use the full URL path to the release
|
||||
page for a given version, as that URL is a permalink to that verison,
|
||||
contains all relavent release information, and does not, otherwise, rely
|
||||
on the anchor tag being excessible from the current page view.
|
||||
|
||||
As an example, for version `2.0.0` of a GitHub project, the following
|
||||
URL should be used:
|
||||
- https://github.com/conventional-changelog/releaser-tools/releases/tag/v2.0.0
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.7"></a>
|
||||
## [3.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.6...conventional-changelog-angular@3.0.7) (2018-04-16)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="3.0.6"></a>
|
||||
## [3.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.5...conventional-changelog-angular@3.0.6) (2018-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revert previous change ([2f4530f](https://github.com/conventional-changelog/conventional-changelog/commit/2f4530f))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.5"></a>
|
||||
## [3.0.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.4...conventional-changelog-angular@3.0.5) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="3.0.4"></a>
|
||||
## [3.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.3...conventional-changelog-angular@3.0.4) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="3.0.3"></a>
|
||||
## [3.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.2...conventional-changelog-angular@3.0.3) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="3.0.2"></a>
|
||||
## [3.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.1...conventional-changelog-angular@3.0.2) (2018-03-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="3.0.1"></a>
|
||||
## [3.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@3.0.0...conventional-changelog-angular@3.0.1) (2018-03-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
## [3.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@1.6.6...conventional-changelog-angular@3.0.0) (2018-03-22)
|
||||
|
||||
### Features
|
||||
|
||||
* **angular:** use latest [Angular Commit Conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type) ([03f0210e42dff58689ddf182694a8a6ca26e526b](https://github.com/conventional-changelog/conventional-changelog/commit/03f0210e42dff58689ddf182694a8a6ca26e526b))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
The Angular conventions specifically say that breaking changes must start with "BREAKING CHANGE", not the plural form. Therefore the previous plural form "CHANGES" has been corrected to singular "CHANGE".
|
||||
|
||||
Former "chore" type has been replaced by a type "build" for commits on the build system and "ci" for commits regarding CI
|
||||
|
||||
<a name="1.6.6"></a>
|
||||
## [1.6.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@1.6.5...conventional-changelog-angular@1.6.6) (2018-02-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.6.5"></a>
|
||||
## [1.6.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-angular@1.6.4...conventional-changelog-angular@1.6.5) (2018-02-20)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.6.4"></a>
|
||||
## [1.6.4](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.6.3...conventional-changelog-angular@1.6.4) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.6.3"></a>
|
||||
## [1.6.3](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.6.2...conventional-changelog-angular@1.6.3) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.6.2"></a>
|
||||
## [1.6.2](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.6.1...conventional-changelog-angular@1.6.2) (2018-02-05)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.6.1"></a>
|
||||
## [1.6.1](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.6.0...conventional-changelog-angular@1.6.1) (2018-01-29)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.6.0"></a>
|
||||
# [1.6.0](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.5.3...conventional-changelog-angular@1.6.0) (2017-12-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **preset:** add recommended-bump opts into presets ([60815b5](https://github.com/conventional-changelog/conventional-changelog-angular/commit/60815b5)), closes [#241](https://github.com/conventional-changelog/conventional-changelog-angular/issues/241)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.5.3"></a>
|
||||
## [1.5.3](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.5.2...conventional-changelog-angular@1.5.3) (2017-12-08)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.5.2"></a>
|
||||
## [1.5.2](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.5.1...conventional-changelog-angular@1.5.2) (2017-11-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-angular
|
||||
|
||||
<a name="1.5.1"></a>
|
||||
## [1.5.1](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.5.0...conventional-changelog-angular@1.5.1) (2017-10-01)
|
||||
|
||||
<a name="1.5.0"></a>
|
||||
# [1.5.0](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.4.0...conventional-changelog-angular@1.5.0) (2017-09-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **angular:** smarter username detection ([#219](https://github.com/conventional-changelog/conventional-changelog/issues/219)) ([f1b4847](https://github.com/conventional-changelog/conventional-changelog-angular/commit/f1b4847)), closes [#218](https://github.com/conventional-changelog/conventional-changelog-angular/issues/218)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **angular:** use the context for getting the repository and host urls ([#217](https://github.com/conventional-changelog/conventional-changelog/issues/217)) ([c146f2a](https://github.com/conventional-changelog/conventional-changelog-angular/commit/c146f2a))
|
||||
|
||||
<a name="1.4.0"></a>
|
||||
# [1.4.0](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.3.3...conventional-changelog-angular@1.4.0) (2017-07-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **angular:** find package.json from cwd upwards ([#206](https://github.com/conventional-changelog/conventional-changelog/issues/206)) ([867c142](https://github.com/conventional-changelog/conventional-changelog-angular/commit/867c142))
|
||||
|
||||
<a name="1.3.3"></a>
|
||||
## [1.3.3](https://github.com/conventional-changelog/conventional-changelog-angular/compare/conventional-changelog-angular@1.3.2...conventional-changelog-angular@1.3.3) (2017-03-11)
|
||||
|
||||
<a name="1.3.0"></a>
|
||||
# [1.3.0](https://github.com/conventional-changelog/conventional-changelog-angular/compare/v1.2.0...v1.3.0) (2016-08-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **noteKeywords:** make BREAKING CHANGE more forgiving ([7dce559](https://github.com/conventional-changelog/conventional-changelog-angular/commit/7dce559))
|
||||
* **references:** remove references that already appear in the subject ([aa765c2](https://github.com/conventional-changelog/conventional-changelog-angular/commit/aa765c2))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.0"></a>
|
||||
# [1.2.0](https://github.com/conventional-changelog/conventional-changelog-angular/compare/v1.1.0...v1.2.0) (2016-05-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **template:** use context.repoUrl([2b5818b](https://github.com/conventional-changelog/conventional-changelog-angular/commit/2b5818b))
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/conventional-changelog/conventional-changelog-angular/compare/v1.0.0...v1.1.0) (2016-04-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **template:** whitespace ([72f8b12](https://github.com/conventional-changelog/conventional-changelog-angular/commit/72f8b12))
|
||||
* update to reference conventional-changelog org ([cd1a75a](https://github.com/conventional-changelog/conventional-changelog-angular/commit/cd1a75a))
|
||||
* **template:** wrong version link if no host ([bb20a7b](https://github.com/conventional-changelog/conventional-changelog-angular/commit/bb20a7b)), closes [#8](https://github.com/conventional-changelog/conventional-changelog-angular/issues/8)
|
||||
|
||||
### Features
|
||||
|
||||
* remove commit length restriction ([6aebb75](https://github.com/conventional-changelog/conventional-changelog-angular/commit/6aebb75)), closes [#12](https://github.com/conventional-changelog/conventional-changelog-angular/issues/12)
|
||||
* **github:** adds github-specific replacements for issues and users ([2633f73](https://github.com/conventional-changelog/conventional-changelog-angular/commit/2633f73)), closes [#12](https://github.com/conventional-changelog/conventional-changelog-angular/issues/12)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://github.com/stevemao/conventional-changelog-angular/compare/v0.1.0...v1.0.0) (2016-02-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **writerOpts.transform:** do not discard commit if there is BREAKING CHANGE ([e67c4a1](https://github.com/stevemao/conventional-changelog-angular/commit/e67c4a1)), closes [ajoslin/conventional-changelog#127](https://github.com/ajoslin/conventional-changelog/issues/127) [angular/angular#5672](https://github.com/angular/angular/issues/5672)
|
||||
|
||||
|
||||
|
||||
<a name="0.1.0"></a>
|
||||
# [0.1.0](https://github.com/stevemao/conventional-changelog-angular/compare/v0.0.2...v0.1.0) (2016-01-30)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.0.2"></a>
|
||||
## [0.0.2](https://github.com/stevemao/conventional-changelog-angular/compare/v0.0.1...v0.0.2) (2016-01-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **exports:** export the promise ([60def39](https://github.com/stevemao/conventional-changelog-angular/commit/60def39))
|
||||
|
||||
|
||||
|
||||
<a name="0.0.1"></a>
|
||||
## 0.0.1 (2015-12-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **init:** extracting code from https://github.com/ajoslin/conventional-changelog ([79a8c6b](https://github.com/stevemao/conventional-changelog-angular/commit/79a8c6b))
|
||||
15
node_modules/conventional-changelog-angular/LICENSE.md
generated
vendored
15
node_modules/conventional-changelog-angular/LICENSE.md
generated
vendored
@@ -1,15 +0,0 @@
|
||||
### ISC License
|
||||
|
||||
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
|
||||
|
||||
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.
|
||||
104
node_modules/conventional-changelog-angular/README.md
generated
vendored
104
node_modules/conventional-changelog-angular/README.md
generated
vendored
@@ -1,104 +0,0 @@
|
||||
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
> [conventional-changelog](https://github.com/ajoslin/conventional-changelog) [angular](https://github.com/angular/angular) preset
|
||||
|
||||
**Issues with the convention itself should be reported on the Angular issue tracker.**
|
||||
|
||||
## Angular Convention
|
||||
|
||||
Angular's [commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit).
|
||||
|
||||
### Examples
|
||||
|
||||
Appears under "Features" header, pencil subheader:
|
||||
|
||||
```
|
||||
feat(pencil): add 'graphiteWidth' option
|
||||
```
|
||||
|
||||
Appears under "Bug Fixes" header, graphite subheader, with a link to issue #28:
|
||||
|
||||
```
|
||||
fix(graphite): stop graphite breaking when width < 0.1
|
||||
|
||||
Closes #28
|
||||
```
|
||||
|
||||
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
|
||||
|
||||
```
|
||||
perf(pencil): remove graphiteWidth option
|
||||
|
||||
BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason.
|
||||
```
|
||||
|
||||
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
|
||||
|
||||
```
|
||||
revert: feat(pencil): add 'graphiteWidth' option
|
||||
|
||||
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
|
||||
```
|
||||
|
||||
### Commit Message Format
|
||||
|
||||
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
The **header** is mandatory and the **scope** of the header is optional.
|
||||
|
||||
### Revert
|
||||
|
||||
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
||||
|
||||
### Type
|
||||
|
||||
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
|
||||
|
||||
Other prefixes are up to your discretion. Suggested prefixes are `build`, `ci`, `docs` ,`style`, `refactor`, and `test` for non-changelog related tasks.
|
||||
|
||||
Details regarding these types can be found in the official [Angular Contributing Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type).
|
||||
|
||||
### Scope
|
||||
|
||||
The scope could be anything specifying place of the commit change. For example `$location`,
|
||||
`$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
|
||||
|
||||
### Subject
|
||||
|
||||
The subject contains succinct description of the change:
|
||||
|
||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
* don't capitalize first letter
|
||||
* no dot (.) at the end
|
||||
|
||||
### Body
|
||||
|
||||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
||||
The body should include the motivation for the change and contrast this with previous behavior.
|
||||
|
||||
### Footer
|
||||
|
||||
The footer should contain any information about **Breaking Changes** and is also the place to
|
||||
reference GitHub issues that this commit **Closes**.
|
||||
|
||||
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
||||
|
||||
A detailed explanation can be found in this [document](#commit-message-format).
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/conventional-changelog-angular.svg
|
||||
[npm-url]: https://npmjs.org/package/conventional-changelog-angular
|
||||
[travis-image]: https://travis-ci.org/conventional-changelog/conventional-changelog-angular.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/conventional-changelog/conventional-changelog-angular
|
||||
[daviddm-image]: https://david-dm.org/conventional-changelog/conventional-changelog-angular.svg?theme=shields.io
|
||||
[daviddm-url]: https://david-dm.org/conventional-changelog/conventional-changelog-angular
|
||||
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-changelog-angular/badge.svg
|
||||
[coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-changelog-angular
|
||||
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
|
||||
603
node_modules/conventional-changelog-writer/CHANGELOG.md
generated
vendored
603
node_modules/conventional-changelog-writer/CHANGELOG.md
generated
vendored
@@ -1,603 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
### [5.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer-v5.0.0...conventional-changelog-writer-v5.0.1) (2021-12-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** patch the handlebars package for CVE-2021-23369 ([1cfc3a1](https://github.com/conventional-changelog/conventional-changelog/commit/1cfc3a1600a11a61d1a9e8d3051d1101cfaa36f1))
|
||||
|
||||
## [5.0.0](https://www.github.com/conventional-changelog/conventional-changelog/compare/v4.1.0...v5.0.0) (2020-12-30)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* nested object properties no longer supported when sorting
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* drop compare-func making sort consistent across node versions ([#729](https://www.github.com/conventional-changelog/conventional-changelog/issues/729)) ([e0081a8](https://www.github.com/conventional-changelog/conventional-changelog/commit/e0081a829133891e2def4a7b7ee5fa25f1440049))
|
||||
|
||||
## [4.1.0](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.18...v4.1.0) (2020-12-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add helper for parsing array of commits ([#711](https://www.github.com/conventional-changelog/conventional-changelog/issues/711)) ([e869fe6](https://www.github.com/conventional-changelog/conventional-changelog/commit/e869fe67548b210508a9df0ce99180164b740e65))
|
||||
|
||||
## [4.0.18](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.17...conventional-changelog-writer@4.0.18) (2020-11-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency through2 to v4 ([#657](https://github.com/conventional-changelog/conventional-changelog/issues/657)) ([7ae618c](https://github.com/conventional-changelog/conventional-changelog/commit/7ae618c81491841e5b1d796d3933aac0c54bc312))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.17](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.16...conventional-changelog-writer@4.0.17) (2020-06-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency compare-func to v2 ([#647](https://github.com/conventional-changelog/conventional-changelog/issues/647)) ([de4f630](https://github.com/conventional-changelog/conventional-changelog/commit/de4f6309403ca0d46b7c6235052f4dca61ea15bc))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.16](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.15...conventional-changelog-writer@4.0.16) (2020-05-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** address CVE in meow ([#642](https://github.com/conventional-changelog/conventional-changelog/issues/642)) ([46311d2](https://github.com/conventional-changelog/conventional-changelog/commit/46311d2932b367f370d06c4e447b8dcf4bc4e83f))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.15](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.11...conventional-changelog-writer@4.0.15) (2020-05-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update yargs-parser to move off a flagged-vulnerable version. ([#635](https://github.com/conventional-changelog/conventional-changelog/issues/635)) ([aafc0f0](https://github.com/conventional-changelog/conventional-changelog/commit/aafc0f00412c3e4b23b8418300e5a570a48fe24d))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.11](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.10...conventional-changelog-writer@4.0.11) (2019-11-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add types for cli flags ([#551](https://github.com/conventional-changelog/conventional-changelog/issues/551)) ([bf1d64a](https://github.com/conventional-changelog/conventional-changelog/commit/bf1d64aeaf8f262d4b2beec02d2aebb78df7343b))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.10](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.9...conventional-changelog-writer@4.0.10) (2019-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update lodash to fix security issues ([#535](https://github.com/conventional-changelog/conventional-changelog/issues/535)) ([ac43f51](https://github.com/conventional-changelog/conventional-changelog/commit/ac43f51de1f3b597c32f7f8442917a2d06199018))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.7...conventional-changelog-writer@4.0.8) (2019-10-02)
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.6...conventional-changelog-writer@4.0.7) (2019-07-29)
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.5...conventional-changelog-writer@4.0.6) (2019-05-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency semver to v6 ([#458](https://github.com/conventional-changelog/conventional-changelog/issues/458)) ([efaa7bb](https://github.com/conventional-changelog/conventional-changelog/commit/efaa7bb))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.4...conventional-changelog-writer@4.0.5) (2019-04-11)
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.3...conventional-changelog-writer@4.0.4) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency through2 to v3 ([#392](https://github.com/conventional-changelog/conventional-changelog/issues/392)) ([26fe91f](https://github.com/conventional-changelog/conventional-changelog/commit/26fe91f))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.2...conventional-changelog-writer@4.0.3) (2019-02-14)
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.1...conventional-changelog-writer@4.0.2) (2018-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bad release of conventional-changelog-writer ([b5da9af](https://github.com/conventional-changelog/conventional-changelog/commit/b5da9af))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@4.0.0...conventional-changelog-writer@4.0.1) (2018-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.9...conventional-changelog-writer@4.0.0) (2018-05-29)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* remove anchor from header templates ([#301](https://github.com/conventional-changelog/conventional-changelog/issues/301)) ([346f24f](https://github.com/conventional-changelog/conventional-changelog/commit/346f24f)), closes [#186](https://github.com/conventional-changelog/conventional-changelog/issues/186)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **package:** Set the package's minimum required Node version to be the oldest LTS
|
||||
currently supported by the Node Release working group. At this time,
|
||||
that is Node 6 (which is in its Maintenance LTS phase).
|
||||
* Anchor tags are removed from the changelog header templates. The
|
||||
rendered Markdown will no longer contain anchor tags proceeding the
|
||||
version number header that constitutes the changelog header. This means
|
||||
that consumers of rendered markdown will not be able to use a URL that
|
||||
has been constructed to contain a version number anchor tag reference,
|
||||
since the anchor tag won't exist in the rendered markdown.
|
||||
|
||||
It's stronly recomended consumers use the full URL path to the release
|
||||
page for a given version, as that URL is a permalink to that verison,
|
||||
contains all relavent release information, and does not, otherwise, rely
|
||||
on the anchor tag being excessible from the current page view.
|
||||
|
||||
As an example, for version `2.0.0` of a GitHub project, the following
|
||||
URL should be used:
|
||||
- https://github.com/conventional-changelog/releaser-tools/releases/tag/v2.0.0
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.9"></a>
|
||||
## [3.0.9](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.8...conventional-changelog-writer@3.0.9) (2018-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revert previous change ([2f4530f](https://github.com/conventional-changelog/conventional-changelog/commit/2f4530f))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.8"></a>
|
||||
## [3.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.7...conventional-changelog-writer@3.0.8) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.7"></a>
|
||||
## [3.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.6...conventional-changelog-writer@3.0.7) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.6"></a>
|
||||
## [3.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.5...conventional-changelog-writer@3.0.6) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.5"></a>
|
||||
## [3.0.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.4...conventional-changelog-writer@3.0.5) (2018-03-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.4"></a>
|
||||
## [3.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.3...conventional-changelog-writer@3.0.4) (2018-02-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.3"></a>
|
||||
## [3.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-writer@3.0.2...conventional-changelog-writer@3.0.3) (2018-02-20)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.2"></a>
|
||||
## [3.0.2](https://github.com/conventional-changelog/conventional-changelog-writer/compare/conventional-changelog-writer@3.0.1...conventional-changelog-writer@3.0.2) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.1"></a>
|
||||
## [3.0.1](https://github.com/conventional-changelog/conventional-changelog-writer/compare/conventional-changelog-writer@3.0.0...conventional-changelog-writer@3.0.1) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/conventional-changelog/conventional-changelog-writer/compare/conventional-changelog-writer@2.0.3...conventional-changelog-writer@3.0.0) (2018-01-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **writer:** normalize release headings ([#237](https://github.com/conventional-changelog/conventional-changelog-writer/issues/237)) ([9e87dc3](https://github.com/conventional-changelog/conventional-changelog-writer/commit/9e87dc3)), closes [/github.com/conventional-changelog/conventional-changelog/issues/214#issuecomment-326681934](https://github.com//github.com/conventional-changelog/conventional-changelog/issues/214/issues/issuecomment-326681934)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **writer:** Logic for generating release headings has been changed to make all
|
||||
heading levels the same (`##`/`h2`) for better compatibility with
|
||||
screen readers and parsers, and to conform to HTML semantics. Patch
|
||||
release titles are now wrapped in a `<small>` tag to maintain the
|
||||
visual hierarchy of the previous style.
|
||||
|
||||
Fixes https://github.com/conventional-changelog/conventional-changelog/issues/214
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.0.3"></a>
|
||||
## [2.0.3](https://github.com/conventional-changelog/conventional-changelog-writer/compare/conventional-changelog-writer@2.0.2...conventional-changelog-writer@2.0.3) (2017-12-08)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="2.0.2"></a>
|
||||
## [2.0.2](https://github.com/conventional-changelog/conventional-changelog-writer/compare/conventional-changelog-writer@2.0.1...conventional-changelog-writer@2.0.2) (2017-11-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-changelog-writer
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/conventional-changelog/conventional-changelog-writer/compare/conventional-changelog-writer@2.0.0...conventional-changelog-writer@2.0.1) (2017-09-01)
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# 2.0.0 (2017-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cli:** options format ([41c813b](https://github.com/conventional-changelog/conventional-changelog-writer/commit/41c813b))
|
||||
* **cli:** require file with absolute path ([fe2b5fe](https://github.com/conventional-changelog/conventional-changelog-writer/commit/fe2b5fe)), closes [#13](https://github.com/conventional-changelog/conventional-changelog-writer/issues/13)
|
||||
* **cli:** use absolute path to require context and options ([08808fe](https://github.com/conventional-changelog/conventional-changelog-writer/commit/08808fe))
|
||||
* **cli:** when it is not tty, it should exit if errors ([aa8708c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/aa8708c))
|
||||
* **context:** auto link references if repoUrl ([d5d66f3](https://github.com/conventional-changelog/conventional-changelog-writer/commit/d5d66f3))
|
||||
* **context.version:** only valid a semver can decide `context.isPatch` ([8dbc53a](https://github.com/conventional-changelog/conventional-changelog-writer/commit/8dbc53a))
|
||||
* **date:** should use committerDate not authorDate ([fbdf73d](https://github.com/conventional-changelog/conventional-changelog-writer/commit/fbdf73d))
|
||||
* **deps:** concat-stream should be in devdeps ([e90881c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/e90881c))
|
||||
* **deps:** require split2 ([59db605](https://github.com/conventional-changelog/conventional-changelog-writer/commit/59db605))
|
||||
* **doFlush:** correct logic ([38e3c03](https://github.com/conventional-changelog/conventional-changelog-writer/commit/38e3c03)), closes [#19](https://github.com/conventional-changelog/conventional-changelog-writer/issues/19)
|
||||
* **doFlush:** one it is the only potential release ([3d600cf](https://github.com/conventional-changelog/conventional-changelog-writer/commit/3d600cf))
|
||||
* **err:** catch any possible error ([c934f50](https://github.com/conventional-changelog/conventional-changelog-writer/commit/c934f50))
|
||||
* **error:** handle errors properly ([bde1200](https://github.com/conventional-changelog/conventional-changelog-writer/commit/bde1200))
|
||||
* **firstRelease:** correct logic ([ccc02e1](https://github.com/conventional-changelog/conventional-changelog-writer/commit/ccc02e1))
|
||||
* **functionify:** should not change falsy values ([1aed002](https://github.com/conventional-changelog/conventional-changelog-writer/commit/1aed002))
|
||||
* **generateOn:** should pass the transformed commit ([2b6cc6c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/2b6cc6c))
|
||||
* **host:** auto removes "/" at the end of `options.host` ([2bdadf0](https://github.com/conventional-changelog/conventional-changelog-writer/commit/2bdadf0))
|
||||
* **keyCommit:** all fields of `keyCommit` overwrites `context` ([63296b5](https://github.com/conventional-changelog/conventional-changelog-writer/commit/63296b5)), closes [#5](https://github.com/conventional-changelog/conventional-changelog-writer/issues/5)
|
||||
* **linkReferences:** can be changed to `false` ([a56f9fd](https://github.com/conventional-changelog/conventional-changelog-writer/commit/a56f9fd))
|
||||
* **notes:** do not include reverted notes ([4e60fe2](https://github.com/conventional-changelog/conventional-changelog-writer/commit/4e60fe2))
|
||||
* **notesSort:** defaults to sort on `text` ([3511ffb](https://github.com/conventional-changelog/conventional-changelog-writer/commit/3511ffb))
|
||||
* **options:** only apply default transform in certain conditions ([6080181](https://github.com/conventional-changelog/conventional-changelog-writer/commit/6080181))
|
||||
* **partials:** only register if its a string ([915cbeb](https://github.com/conventional-changelog/conventional-changelog-writer/commit/915cbeb))
|
||||
* **reverse:** should be the other way ([b4156e3](https://github.com/conventional-changelog/conventional-changelog-writer/commit/b4156e3))
|
||||
* **template:** commit template markdown ([0949b5a](https://github.com/conventional-changelog/conventional-changelog-writer/commit/0949b5a))
|
||||
* linting ([33ac525](https://github.com/conventional-changelog/conventional-changelog-writer/commit/33ac525))
|
||||
* **template:** default commit template should handle unkown host ([d1ed4fc](https://github.com/conventional-changelog/conventional-changelog-writer/commit/d1ed4fc))
|
||||
* **template:** remove an extra newline in footer ([f6180c5](https://github.com/conventional-changelog/conventional-changelog-writer/commit/f6180c5))
|
||||
* **template:** should not html escape ([e4e33ae](https://github.com/conventional-changelog/conventional-changelog-writer/commit/e4e33ae))
|
||||
* **template:** tweak ([ef6996a](https://github.com/conventional-changelog/conventional-changelog-writer/commit/ef6996a))
|
||||
* **templates:** generate correct url if only host exists ([35f1799](https://github.com/conventional-changelog/conventional-changelog-writer/commit/35f1799))
|
||||
* **templates:** incase partial is empty also don't ignore default partials ([d90fb65](https://github.com/conventional-changelog/conventional-changelog-writer/commit/d90fb65))
|
||||
* **transform:** do not strip leading v ([8e2da57](https://github.com/conventional-changelog/conventional-changelog-writer/commit/8e2da57))
|
||||
* **transform:** should work if any field is missing ([fd413ed](https://github.com/conventional-changelog/conventional-changelog-writer/commit/fd413ed))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **defaults:** merge default options and make it less angular ([8e29f96](https://github.com/conventional-changelog/conventional-changelog-writer/commit/8e29f96)), closes [#3](https://github.com/conventional-changelog/conventional-changelog-writer/issues/3) [#4](https://github.com/conventional-changelog/conventional-changelog-writer/issues/4)
|
||||
* migrate repo to lerna mono-repo ([793e823](https://github.com/conventional-changelog/conventional-changelog-writer/commit/793e823))
|
||||
* **transform:** if returns a falsy value this commit is ignored ([9508ed6](https://github.com/conventional-changelog/conventional-changelog-writer/commit/9508ed6))
|
||||
* use new api of `references` and `notes` ([4d27326](https://github.com/conventional-changelog/conventional-changelog-writer/commit/4d27326))
|
||||
* **cli:** version can be passed directly as an input ([cadf7af](https://github.com/conventional-changelog/conventional-changelog-writer/commit/cadf7af))
|
||||
* **commit:** `raw` object is attached to `commit` ([2ea9f04](https://github.com/conventional-changelog/conventional-changelog-writer/commit/2ea9f04))
|
||||
* **commit.hbs:** scope can be missing ([82e0ffa](https://github.com/conventional-changelog/conventional-changelog-writer/commit/82e0ffa))
|
||||
* **commit.hbs:** use `header` if `subject` is missing ([5e475a0](https://github.com/conventional-changelog/conventional-changelog-writer/commit/5e475a0))
|
||||
* **compareFunc:** these values can be string or array ([464988c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/464988c))
|
||||
* **compareFunc:** use module "compare-func" ([520014e](https://github.com/conventional-changelog/conventional-changelog-writer/commit/520014e))
|
||||
* **context:** expose `finalizeContext` to modify context at last ([d5545c0](https://github.com/conventional-changelog/conventional-changelog-writer/commit/d5545c0))
|
||||
* **context:** fallback to repoUrl ([dc9c626](https://github.com/conventional-changelog/conventional-changelog-writer/commit/dc9c626))
|
||||
* **context:** linkReferences has nothing to do with context.host ([1656df8](https://github.com/conventional-changelog/conventional-changelog-writer/commit/1656df8))
|
||||
* **debug:** convient function for debugging ([c041e35](https://github.com/conventional-changelog/conventional-changelog-writer/commit/c041e35))
|
||||
* **flush:** add `options.doFlush` to make it possible not to flush ([2fdf142](https://github.com/conventional-changelog/conventional-changelog-writer/commit/2fdf142))
|
||||
* **generate:** originalCommits as last argument ([797fa8c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/797fa8c))
|
||||
* **generateOn:** also pass commits, context and options to the function ([a59c73c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/a59c73c)), closes [ajoslin/conventional-changelog#135](https://github.com/ajoslin/conventional-changelog/issues/135)
|
||||
* **generateOn:** by default if `commit.version` is a valid semver ([19ad3b1](https://github.com/conventional-changelog/conventional-changelog-writer/commit/19ad3b1))
|
||||
* **generateOn:** if the commit is ignored fall back on the original ([be5723a](https://github.com/conventional-changelog/conventional-changelog-writer/commit/be5723a))
|
||||
* **generateOn:** log doesn't have to be generated once ([ff88a62](https://github.com/conventional-changelog/conventional-changelog-writer/commit/ff88a62))
|
||||
* **generateOn:** other type to disable ([9c50b90](https://github.com/conventional-changelog/conventional-changelog-writer/commit/9c50b90))
|
||||
* **includeDetails:** return an object that contains more details ([81e79f7](https://github.com/conventional-changelog/conventional-changelog-writer/commit/81e79f7))
|
||||
* **map:** change `options.replacements` to `options.map` ([d0a04ef](https://github.com/conventional-changelog/conventional-changelog-writer/commit/d0a04ef))
|
||||
* **maxSubjectLength:** added ([83c98b9](https://github.com/conventional-changelog/conventional-changelog-writer/commit/83c98b9))
|
||||
* **noteGroups:** remove and add note title transform ([abedbfd](https://github.com/conventional-changelog/conventional-changelog-writer/commit/abedbfd))
|
||||
* **notes:** attach the commit to the note ([af89d4a](https://github.com/conventional-changelog/conventional-changelog-writer/commit/af89d4a)), closes [#12](https://github.com/conventional-changelog/conventional-changelog-writer/issues/12)
|
||||
* **owner:** add owner context ([8d7b5d9](https://github.com/conventional-changelog/conventional-changelog-writer/commit/8d7b5d9)), closes [#7](https://github.com/conventional-changelog/conventional-changelog-writer/issues/7)
|
||||
* **reverse:** new options for commits that are poured reversely ([613651e](https://github.com/conventional-changelog/conventional-changelog-writer/commit/613651e))
|
||||
* **revert:** ignore reverted commits ([0f279ad](https://github.com/conventional-changelog/conventional-changelog-writer/commit/0f279ad))
|
||||
* **transform:** add a transform option ([b05dc2e](https://github.com/conventional-changelog/conventional-changelog-writer/commit/b05dc2e)), closes [#2](https://github.com/conventional-changelog/conventional-changelog-writer/issues/2)
|
||||
* **transform:** also pass context as an arg ([76b869d](https://github.com/conventional-changelog/conventional-changelog-writer/commit/76b869d))
|
||||
* **version:** is not a required field any more ([3790d8f](https://github.com/conventional-changelog/conventional-changelog-writer/commit/3790d8f))
|
||||
* **version:** strip leading v by default ([43c2c7e](https://github.com/conventional-changelog/conventional-changelog-writer/commit/43c2c7e))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **get/set:** drop dot-prop and just use lodash ([601e580](https://github.com/conventional-changelog/conventional-changelog-writer/commit/601e580))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **context:** `context.host` cannot change the default of `context.linkReferences` because if the host is unknown, `context.host` is `undefined` and all links will just use `context.repository`.
|
||||
* The upstream must use the new api of `references` and `notes`.
|
||||
|
||||
`closes` now becomes `references`
|
||||
The `notes` object is no longer a key-value object but an array of note object, such as
|
||||
```js
|
||||
{
|
||||
title: 'BREAKING AMEND',
|
||||
text: 'some breaking change'
|
||||
}
|
||||
```
|
||||
* **notes:** `includeDetails` will only include `log` and `keyCommit`.
|
||||
* **templates:** If `partials` is not empty, it should not ignore header, commit and footer partials.
|
||||
* **reverse:** when there is no commits left for the last block of logs it will still try to generate one. (Assume commits might be rebased or lost but still need a new version).
|
||||
* **noteGroups:** `options.noteGroups` is no longer available. Filter the notes from upstream or in `options.transform` instead.
|
||||
* **notes:** `notes` in `noteGroups` is not an array of simple string any more but object. You must use `note.text` to access the equivalent of previous `note`.
|
||||
* **cli:** Previously version number has to be passed as a flag. As a version number is compulsory, it does not make sense for a flag to be compulsory. So if a version number is passed as an input it is still valid.
|
||||
* **transform:** `options.hashLength`, `options.maxSubjectLength` and `options.map` are deprecated in favour of `options.transform`.
|
||||
* **map:** `options.replacements` is now `options.map` and it can also take functions
|
||||
* **compareFunc:** commitGroupsCompareFn -> commitGroupsSort, commitsCompareFn -> commitsSort, noteGroupsCompareFn -> noteGroupsSort and notesCompareFn -> notesSort
|
||||
* **compareFunc:** Default compare functions no longer sort by lexicographical order. They use `localeCompare` instead
|
||||
* **version:** `version` is not a required field and it is moved to the `context` object. If version is found in the last commit, it will be overwritten.
|
||||
|
||||
<a name="1.4.1"></a>
|
||||
## [1.4.1](https://github.com/conventional-changelog/conventional-changelog-writer/compare/v1.4.0...v1.4.1) (2016-05-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **context:** auto link references if repoUrl([30bb234](https://github.com/conventional-changelog/conventional-changelog-writer/commit/30bb234))
|
||||
|
||||
|
||||
|
||||
<a name="1.4.0"></a>
|
||||
# [1.4.0](https://github.com/conventional-changelog/conventional-changelog-writer/compare/v1.3.0...v1.4.0) (2016-05-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **context:** fallback to repoUrl([e504682](https://github.com/conventional-changelog/conventional-changelog-writer/commit/e504682))
|
||||
|
||||
|
||||
|
||||
<a name="1.3.0"></a>
|
||||
# [1.3.0](https://github.com/conventional-changelog/conventional-changelog-writer/compare/v1.2.1...v1.3.0) (2016-05-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **debug:** convient function for debugging([3b6233f](https://github.com/conventional-changelog/conventional-changelog-writer/commit/3b6233f))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.1"></a>
|
||||
## [1.2.1](https://github.com/conventional-changelog/conventional-changelog-writer/compare/v1.2.0...v1.2.1) (2016-04-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **templates:** generate correct url if only host exists ([bda0328](https://github.com/conventional-changelog/conventional-changelog-writer/commit/bda0328))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.0"></a>
|
||||
# [1.2.0](https://github.com/conventional-changelog/conventional-changelog-writer/compare/v1.1.1...v1.2.0) (2016-04-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **transform:** also pass context as an arg ([9bd984c](https://github.com/conventional-changelog/conventional-changelog-writer/commit/9bd984c))
|
||||
|
||||
|
||||
|
||||
<a name="1.1.1"></a>
|
||||
## [1.1.1](https://github.com/stevemao/conventional-changelog-writer/compare/v1.1.0...v1.1.1) (2016-02-29)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/stevemao/conventional-changelog-writer/compare/v1.0.3...v1.1.0) (2016-02-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **generate:** originalCommits as last argument ([186bfb9](https://github.com/stevemao/conventional-changelog-writer/commit/186bfb9))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
## [1.0.3](https://github.com/stevemao/conventional-changelog-writer/compare/v1.0.2...v1.0.3) (2016-02-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **firstRelease:** correct logic ([43552a2](https://github.com/stevemao/conventional-changelog-writer/commit/43552a2))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## [1.0.2](https://github.com/stevemao/conventional-changelog-writer/compare/v1.0.1...v1.0.2) (2016-02-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **doFlush:** one it is the only potential release ([cc3b5db](https://github.com/stevemao/conventional-changelog-writer/commit/cc3b5db))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/stevemao/conventional-changelog-writer/compare/v1.0.0...v1.0.1) (2016-02-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **doFlush:** correct logic ([54d96cc](https://github.com/stevemao/conventional-changelog-writer/commit/54d96cc)), closes [#19](https://github.com/stevemao/conventional-changelog-writer/issues/19)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://github.com/stevemao/conventional-changelog-writer/compare/v0.5.1...v1.0.0) (2016-02-05)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.5.1"></a>
|
||||
## [0.5.1](https://github.com/stevemao/conventional-changelog-writer/compare/v0.5.0...v0.5.1) (2016-02-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **context.version:** only valid a semver can decide `context.isPatch` ([59ed325](https://github.com/stevemao/conventional-changelog-writer/commit/59ed325))
|
||||
|
||||
|
||||
|
||||
<a name="0.5.0"></a>
|
||||
# [0.5.0](https://github.com/stevemao/conventional-changelog-writer/compare/v0.4.2...v0.5.0) (2016-02-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **flush:** add `options.doFlush` to make it possible not to flush ([7850589](https://github.com/stevemao/conventional-changelog-writer/commit/7850589))
|
||||
|
||||
|
||||
|
||||
<a name="0.4.2"></a>
|
||||
## [0.4.2](https://github.com/stevemao/conventional-changelog-writer/compare/v0.4.1...v0.4.2) (2016-01-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **generateOn:** also pass commits, context and options to the function ([3146f66](https://github.com/stevemao/conventional-changelog-writer/commit/3146f66)), closes [ajoslin/conventional-changelog#135](https://github.com/ajoslin/conventional-changelog/issues/135)
|
||||
|
||||
|
||||
|
||||
<a name="0.4.1"></a>
|
||||
## [0.4.1](https://github.com/stevemao/conventional-changelog-writer/compare/v0.4.0...v0.4.1) (2015-09-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **template:** default commit template should handle unkown host ([ef62bfd](https://github.com/stevemao/conventional-changelog-writer/commit/ef62bfd))
|
||||
|
||||
### Features
|
||||
|
||||
* **context:** linkReferences has nothing to do with context.host ([f5883a6](https://github.com/stevemao/conventional-changelog-writer/commit/f5883a6))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* `context.host` cannot change the default of `context.linkReferences` because if the host is unknown, `context.host` is `undefined` and all links will just use `context.repository`.
|
||||
|
||||
|
||||
|
||||
<a name="0.4.0"></a>
|
||||
# [0.4.0](https://github.com/stevemao/conventional-changelog-writer/compare/v0.3.2...v0.4.0) (2015-09-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cli:** require file with absolute path ([e9d9702](https://github.com/stevemao/conventional-changelog-writer/commit/e9d9702)), closes [#13](https://github.com/stevemao/conventional-changelog-writer/issues/13)
|
||||
* **notesSort:** defaults to sort on `text` ([6d3d564](https://github.com/stevemao/conventional-changelog-writer/commit/6d3d564))
|
||||
|
||||
### Features
|
||||
|
||||
* **notes:** attach the commit to the note ([2977336](https://github.com/stevemao/conventional-changelog-writer/commit/2977336)), closes [#12](https://github.com/stevemao/conventional-changelog-writer/issues/12)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* `notes` in `noteGroups` is not an array of simple string any more but object. You must use `note.text` to access the equivalent of previous `note`.
|
||||
21
node_modules/conventional-changelog-writer/LICENSE.md
generated
vendored
21
node_modules/conventional-changelog-writer/LICENSE.md
generated
vendored
@@ -1,21 +0,0 @@
|
||||
### MIT License
|
||||
|
||||
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
|
||||
|
||||
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.
|
||||
369
node_modules/conventional-changelog-writer/README.md
generated
vendored
369
node_modules/conventional-changelog-writer/README.md
generated
vendored
@@ -1,369 +0,0 @@
|
||||
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
> Write logs based on conventional commits and templates
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save conventional-changelog-writer
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var conventionalChangelogWriter = require('conventional-changelog-writer');
|
||||
|
||||
conventionalChangelogWriter(context, options);
|
||||
```
|
||||
|
||||
It returns a transform stream.
|
||||
|
||||
It expects an object mode upstream that looks something like this:
|
||||
|
||||
```js
|
||||
{ hash: '9b1aff905b638aa274a5fc8f88662df446d374bd',
|
||||
header: 'feat(scope): broadcast $destroy event on scope destruction',
|
||||
type: 'feat',
|
||||
scope: 'scope',
|
||||
subject: 'broadcast $destroy event on scope destruction',
|
||||
body: null,
|
||||
footer: 'Closes #1',
|
||||
notes: [],
|
||||
references: [ { action: 'Closes', owner: null, repository: null, issue: '1', raw: '#1' } ] }
|
||||
{ hash: '13f31602f396bc269076ab4d389cfd8ca94b20ba',
|
||||
header: 'feat(ng-list): Allow custom separator',
|
||||
type: 'feat',
|
||||
scope: 'ng-list',
|
||||
subject: 'Allow custom separator',
|
||||
body: 'bla bla bla',
|
||||
footer: 'BREAKING CHANGE: some breaking change',
|
||||
notes: [ { title: 'BREAKING CHANGE', text: 'some breaking change' } ],
|
||||
references: [] }
|
||||
```
|
||||
|
||||
Each chunk should be a commit. Json object is also **valid**. Parts of the objects will be formatted and combined into a log based on the handlebars context, templates and options.
|
||||
|
||||
The downstream might look something like this:
|
||||
|
||||
```js
|
||||
## 0.0.1 "this is a title" (2015-05-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ng-list:** Allow custom separator ([13f3160](https://github.com/a/b/commits/13f3160))
|
||||
* **scope:** broadcast $destroy event on scope destruction ([9b1aff9](https://github.com/a/b/commits/9b1aff9)), closes [#1](https://github.com/a/b/issues/1)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* some breaking change
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### conventionalChangelogWriter([context, [options]])
|
||||
|
||||
Returns a transform stream.
|
||||
|
||||
### conventionalChangelogWriter.parseArray(commits, [context, [options]])
|
||||
|
||||
Rather than returning a transform stream for parsing commits,
|
||||
parses the array of commits provided generating a CHANGELOG entry.
|
||||
|
||||
#### context
|
||||
|
||||
Variables that will be interpolated to the template. This object contains, but not limits to the following fields.
|
||||
|
||||
##### version
|
||||
|
||||
Type: `string`
|
||||
|
||||
Version number of the up-coming release. If `version` is found in the last commit before generating logs, it will be overwritten.
|
||||
|
||||
##### title
|
||||
|
||||
Type: `string`
|
||||
|
||||
##### isPatch
|
||||
|
||||
Type: `boolean` Default: `semver.patch(context.version) !== 0`
|
||||
|
||||
By default, this value is true if `version`'s patch is `0`.
|
||||
|
||||
##### host
|
||||
|
||||
Type: `string`
|
||||
|
||||
The hosting website. Eg: `'https://github.com'` or `'https://bitbucket.org'`
|
||||
|
||||
##### owner
|
||||
|
||||
Type: `string`
|
||||
|
||||
The owner of the repository. Eg: `'stevemao'`.
|
||||
|
||||
##### repository
|
||||
|
||||
Type: `string`
|
||||
|
||||
The repository name on `host`. Eg: `'conventional-changelog-writer'`.
|
||||
|
||||
##### repoUrl
|
||||
|
||||
Type: `string`
|
||||
|
||||
The whole repository url. Eg: `'https://github.com/conventional-changelog/conventional-changelog-writer'`.
|
||||
The should be used as a fallback when `context.repository` doesn't exist.
|
||||
|
||||
##### linkReferences
|
||||
|
||||
Type: `boolean` Default: `true` if (`context.repository` or `context.repoUrl`), `context.commit` and `context.issue` are truthy
|
||||
|
||||
Should all references be linked?
|
||||
|
||||
##### commit
|
||||
|
||||
Type: `string` Default: `'commits'`
|
||||
|
||||
Commit keyword in the url if `context.linkReferences === true`.
|
||||
|
||||
##### issue
|
||||
|
||||
Type: `string` Default: `'issues'`
|
||||
|
||||
Issue or pull request keyword in the url if `context.linkReferences === true`.
|
||||
|
||||
##### date
|
||||
|
||||
Type: `string` Default: `dateFormat(new Date(), 'yyyy-mm-dd', true)`
|
||||
|
||||
Default to formatted (`'yyyy-mm-dd'`) today's date. [dateformat](https://github.com/felixge/node-dateformat) is used for formatting the date. If `version` is found in the last commit, `committerDate` will overwrite this.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### transform
|
||||
|
||||
Type: `object` or `function` Default: get the first 7 digits of hash, and `committerDate` will be formatted as `'yyyy-mm-dd'`.
|
||||
|
||||
Replace with new values in each commit.
|
||||
|
||||
If this is an object, the keys are paths to a nested object property. the values can be a string (static) and a function (dynamic) with the old value and path passed as arguments. This value is merged with your own transform object.
|
||||
|
||||
If this is a function, the commit chunk will be passed as the argument and the returned value would be the new commit object. This is a handy function if you can't provide a transform stream as an upstream of this one. If returns a falsy value this commit is ignored.
|
||||
|
||||
a `raw` object that is originally poured form upstream is attached to `commit`.
|
||||
|
||||
##### groupBy
|
||||
|
||||
Type: `string` Default: `'type'`
|
||||
|
||||
How to group the commits. EG: based on the same type. If this value is falsy, commits are not grouped.
|
||||
|
||||
##### commitGroupsSort
|
||||
|
||||
Type: `function`, `string` or `array`
|
||||
|
||||
A compare function used to sort commit groups. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
|
||||
|
||||
##### commitsSort
|
||||
|
||||
Type: `function`, `string` or `array` Default: `'header'`
|
||||
|
||||
A compare function used to sort commits. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
|
||||
|
||||
##### noteGroupsSort
|
||||
|
||||
Type: `function`, `string` or `array` Default: `'title'`
|
||||
|
||||
A compare function used to sort note groups. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
|
||||
|
||||
##### notesSort
|
||||
|
||||
Type: `function`, `string` or `array` Default: `'text'`
|
||||
|
||||
A compare function used to sort note groups. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
|
||||
|
||||
##### generateOn
|
||||
|
||||
Type: `function`, `string` or `any` Default: if `commit.version` is a valid semver.
|
||||
|
||||
When the upstream finishes pouring the commits it will generate a block of logs if `doFlush` is `true`. However, you can generate more than one block based on this criteria (usually a version) even if there are still commits from the upstream.
|
||||
|
||||
###### generateOn(commit, commits, context, options)
|
||||
|
||||
####### commit
|
||||
|
||||
Current commit.
|
||||
|
||||
####### commits
|
||||
|
||||
Current collected commits.
|
||||
|
||||
####### context
|
||||
|
||||
The generated context based on original input `context` and `options`.
|
||||
|
||||
####### options
|
||||
|
||||
Normalized options.
|
||||
|
||||
**NOTE**: It checks on the transformed commit chunk instead of the original one (you can check on the original by access the `raw` object on the `commit`). However, if the transformed commit is ignored it falls back to the original commit.
|
||||
|
||||
If this value is a `string`, it checks the existence of the field. Set to other type to disable it.
|
||||
|
||||
##### finalizeContext
|
||||
|
||||
Type: `function` Default: pass through
|
||||
|
||||
Last chance to modify your context before generating a changelog.
|
||||
|
||||
###### finalizeContext(context, options, commits, keyCommit)
|
||||
|
||||
####### context
|
||||
|
||||
The generated context based on original input `context` and `options`.
|
||||
|
||||
####### options
|
||||
|
||||
Normalized options.
|
||||
|
||||
####### commits
|
||||
|
||||
Filtered commits from your git metadata.
|
||||
|
||||
####### keyCommit
|
||||
|
||||
The commit that triggers to generate the log.
|
||||
|
||||
##### debug
|
||||
|
||||
Type: `function` Default: `function() {}`
|
||||
|
||||
A function to get debug information.
|
||||
|
||||
##### reverse
|
||||
|
||||
Type: `boolean` Default: `false`
|
||||
|
||||
The normal order means reverse chronological order. `reverse` order means chronological order. Are the commits from upstream in the reverse order? You should only worry about this when generating more than one blocks of logs based on `generateOn`. If you find the last commit is in the wrong block inverse this value.
|
||||
|
||||
##### includeDetails
|
||||
|
||||
Type: `boolean` Default: `false`
|
||||
|
||||
If this value is `true`, instead of emitting strings of changelog, it emits objects containing the details the block.
|
||||
|
||||
*NOTE:* The downstream must be in object mode if this is `true`.
|
||||
*NOTE:* This is only supported when using streaming mode.
|
||||
|
||||
##### ignoreReverted
|
||||
|
||||
Type: `boolean` Default: `true`
|
||||
|
||||
If `true`, reverted commits will be ignored.
|
||||
|
||||
##### doFlush
|
||||
|
||||
Type: `boolean` Default: `true`
|
||||
|
||||
If `true`, the stream will flush out the last bit of commits (could be empty) to changelog.
|
||||
|
||||
*NOTE:* This is only supported when using streaming mode.
|
||||
|
||||
##### mainTemplate
|
||||
|
||||
Type: `string` Default: [template.hbs](templates/template.hbs)
|
||||
|
||||
The main handlebars template.
|
||||
|
||||
##### headerPartial
|
||||
|
||||
Type: `string` Default: [header.hbs](templates/header.hbs)
|
||||
|
||||
##### commitPartial
|
||||
|
||||
Type: `string` Default: [commit.hbs](templates/commit.hbs)
|
||||
|
||||
##### footerPartial
|
||||
|
||||
Type: `string` Default: [footer.hbs](templates/footer.hbs)
|
||||
|
||||
##### partials
|
||||
|
||||
Type: `object`
|
||||
|
||||
Partials that used in the main template, if any. The key should be the partial name and the value should be handlebars template strings. If you are using handlebars template files, read files by yourself.
|
||||
|
||||
|
||||
## Customization Guide
|
||||
|
||||
It is possible to customize this the changelog to suit your needs. Templates are written in [handlebars](http://handlebarsjs.com). You can customize all partials or the whole template. Template variables are from either `upstream` or `context`. The following are a suggested way of defining variables.
|
||||
|
||||
### upstream
|
||||
|
||||
Variables in upstream are commit specific and should be used per commit. Eg: *commit date* and *commit username*. You can think of them as "local" or "isolate" variables. A "raw" commit message (original commit poured from upstream) is attached to `commit`. `transform` can be used to modify a commit.
|
||||
|
||||
### context
|
||||
|
||||
context should be module specific and can be used across the whole log. Thus these variables should not be related to any single commit and should be generic information of the module or all commits. Eg: *repository url* and *author names*, etc. You can think of them as "global" or "root" variables.
|
||||
|
||||
Basically you can make your own templates and define all your template context. Extra context are based on commits from upstream and `options`. For more details, please checkout [handlebars](http://handlebarsjs.com) and the source code of this module. `finalizeContext` can be used at last to modify context before generating a changelog.
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```sh
|
||||
$ npm install --global conventional-changelog-writer
|
||||
$ conventional-changelog-writer --help # for more details
|
||||
```
|
||||
|
||||
It works with [Line Delimited JSON](http://en.wikipedia.org/wiki/Line_Delimited_JSON).
|
||||
|
||||
If you have commits.ldjson
|
||||
|
||||
```js
|
||||
{"hash":"9b1aff905b638aa274a5fc8f88662df446d374bd","header":"feat(ngMessages): provide support for dynamic message resolution","type":"feat","scope":"ngMessages","subject":"provide support for dynamic message resolution","body":"Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.","footer":"BREAKING CHANGE: The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.\nCloses #10036\nCloses #9338","notes":[{"title":"BREAKING CHANGE","text":"The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive."}],"references":[{"action":"Closes","owner",null,"repository":null,"issue":"10036","raw":"#10036"},{"action":"Closes","owner":null,"repository":null,"issue":"9338","raw":"#9338"}]}
|
||||
```
|
||||
|
||||
And you run
|
||||
|
||||
```sh
|
||||
$ conventional-changelog-writer commits.ldjson -o options.js
|
||||
```
|
||||
|
||||
The output might look something like this
|
||||
|
||||
```md
|
||||
# 1.0.0 (2015-04-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ngMessages:** provide support for dynamic message resolution 9b1aff9, closes #10036 #9338
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.
|
||||
```
|
||||
|
||||
It is printed to stdout.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Steve Mao](https://github.com/stevemao)
|
||||
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/conventional-changelog-writer.svg
|
||||
[npm-url]: https://npmjs.org/package/conventional-changelog-writer
|
||||
[travis-image]: https://travis-ci.org/conventional-changelog/conventional-changelog-writer.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/conventional-changelog/conventional-changelog-writer
|
||||
[daviddm-image]: https://david-dm.org/conventional-changelog/conventional-changelog-writer.svg?theme=shields.io
|
||||
[daviddm-url]: https://david-dm.org/conventional-changelog/conventional-changelog-writer
|
||||
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-changelog-writer/badge.svg
|
||||
[coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-changelog-writer
|
||||
70
node_modules/conventional-changelog-writer/node_modules/semver/CHANGELOG.md
generated
vendored
70
node_modules/conventional-changelog-writer/node_modules/semver/CHANGELOG.md
generated
vendored
@@ -1,70 +0,0 @@
|
||||
# changes log
|
||||
|
||||
## 6.2.0
|
||||
|
||||
* Coerce numbers to strings when passed to semver.coerce()
|
||||
* Add `rtl` option to coerce from right to left
|
||||
|
||||
## 6.1.3
|
||||
|
||||
* Handle X-ranges properly in includePrerelease mode
|
||||
|
||||
## 6.1.2
|
||||
|
||||
* Do not throw when testing invalid version strings
|
||||
|
||||
## 6.1.1
|
||||
|
||||
* Add options support for semver.coerce()
|
||||
* Handle undefined version passed to Range.test
|
||||
|
||||
## 6.1.0
|
||||
|
||||
* Add semver.compareBuild function
|
||||
* Support `*` in semver.intersects
|
||||
|
||||
## 6.0
|
||||
|
||||
* Fix `intersects` logic.
|
||||
|
||||
This is technically a bug fix, but since it is also a change to behavior
|
||||
that may require users updating their code, it is marked as a major
|
||||
version increment.
|
||||
|
||||
## 5.7
|
||||
|
||||
* Add `minVersion` method
|
||||
|
||||
## 5.6
|
||||
|
||||
* Move boolean `loose` param to an options object, with
|
||||
backwards-compatibility protection.
|
||||
* Add ability to opt out of special prerelease version handling with
|
||||
the `includePrerelease` option flag.
|
||||
|
||||
## 5.5
|
||||
|
||||
* Add version coercion capabilities
|
||||
|
||||
## 5.4
|
||||
|
||||
* Add intersection checking
|
||||
|
||||
## 5.3
|
||||
|
||||
* Add `minSatisfying` method
|
||||
|
||||
## 5.2
|
||||
|
||||
* Add `prerelease(v)` that returns prerelease components
|
||||
|
||||
## 5.1
|
||||
|
||||
* Add Backus-Naur for ranges
|
||||
* Remove excessively cute inspection methods
|
||||
|
||||
## 5.0
|
||||
|
||||
* Remove AMD/Browserified build artifacts
|
||||
* Fix ltr and gtr when using the `*` range
|
||||
* Fix for range `*` with a prerelease identifier
|
||||
443
node_modules/conventional-changelog-writer/node_modules/semver/README.md
generated
vendored
443
node_modules/conventional-changelog-writer/node_modules/semver/README.md
generated
vendored
@@ -1,443 +0,0 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero element in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||
|
||||
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||
coercible tuple that does not share an ending index with a longer coercible
|
||||
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||
any other overlapping SemVer tuple.
|
||||
|
||||
### Clean
|
||||
|
||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||
|
||||
This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges.
|
||||
|
||||
ex.
|
||||
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||
* `s.clean('~1.0.0')`: `null`
|
||||
119
node_modules/conventional-commits-filter/CHANGELOG.md
generated
vendored
119
node_modules/conventional-commits-filter/CHANGELOG.md
generated
vendored
@@ -1,119 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@2.0.6...conventional-commits-filter@2.0.7) (2020-11-05)
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@2.0.2...conventional-commits-filter@2.0.6) (2020-05-08)
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@2.0.1...conventional-commits-filter@2.0.2) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **filter:** replace `is-subset` with `lodash.ismatch` ([#377](https://github.com/conventional-changelog/conventional-changelog/issues/377)) ([fbcc92e](https://github.com/conventional-changelog/conventional-changelog/commit/fbcc92e))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@2.0.0...conventional-commits-filter@2.0.1) (2018-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@1.1.6...conventional-commits-filter@2.0.0) (2018-05-29)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **package:** Set the package's minimum required Node version to be the oldest LTS
|
||||
currently supported by the Node Release working group. At this time,
|
||||
that is Node 6 (which is in its Maintenance LTS phase).
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.1.6"></a>
|
||||
## [1.1.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@1.1.5...conventional-commits-filter@1.1.6) (2018-03-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
<a name="1.1.5"></a>
|
||||
## [1.1.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@1.1.4...conventional-commits-filter@1.1.5) (2018-02-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
<a name="1.1.4"></a>
|
||||
## [1.1.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-filter@1.1.3...conventional-commits-filter@1.1.4) (2018-02-20)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
<a name="1.1.3"></a>
|
||||
## [1.1.3](https://github.com/stevemao/conventional-commits-filter/compare/conventional-commits-filter@1.1.2...conventional-commits-filter@1.1.3) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
<a name="1.1.2"></a>
|
||||
## [1.1.2](https://github.com/stevemao/conventional-commits-filter/compare/conventional-commits-filter@1.1.1...conventional-commits-filter@1.1.2) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-filter
|
||||
|
||||
<a name="1.1.1"></a>
|
||||
## [1.1.1](https://github.com/stevemao/conventional-commits-filter/compare/conventional-commits-filter@1.1.0...conventional-commits-filter@1.1.1) (2017-12-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **filter:** only remove commits that reverted commits in the scope ([#226](https://github.com/stevemao/conventional-commits-filter/issues/226)) ([461dae6](https://github.com/stevemao/conventional-commits-filter/commit/461dae6))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# 1.1.0 (2017-11-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* migrate repo to lerna mono-repo ([793e823](https://github.com/stevemao/conventional-commits-filter/commit/793e823))
|
||||
184
node_modules/conventional-commits-filter/README.md
generated
vendored
184
node_modules/conventional-commits-filter/README.md
generated
vendored
@@ -1,184 +0,0 @@
|
||||
# conventional-commits-filter [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
|
||||
> Filter out reverted commits parsed by conventional-commits-parser
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save conventional-commits-filter
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var conventionalCommitsFilter = require('conventional-commits-filter');
|
||||
|
||||
var commits = [{
|
||||
type: 'revert',
|
||||
scope: null,
|
||||
subject: 'feat(): amazing new module',
|
||||
header: 'revert: feat(): amazing new module\n',
|
||||
body: 'This reverts commit 56185b7356766d2b30cfa2406b257080272e0b7a.\n',
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: {
|
||||
header: 'feat(): amazing new module',
|
||||
hash: '56185b7356766d2b30cfa2406b257080272e0b7a',
|
||||
body: null
|
||||
},
|
||||
hash: '789d898b5f8422d7f65cc25135af2c1a95a125ac\n',
|
||||
raw: {
|
||||
type: 'revert',
|
||||
scope: null,
|
||||
subject: 'feat(): amazing new module',
|
||||
header: 'revert: feat(): amazing new module\n',
|
||||
body: 'This reverts commit 56185b7356766d2b30cfa2406b257080272e0b7a.\n',
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: {
|
||||
header: 'feat(): amazing new module',
|
||||
hash: '56185b7356766d2b30cfa2406b257080272e0b7a',
|
||||
body: null
|
||||
},
|
||||
hash: '789d898b5f8422d7f65cc25135af2c1a95a125ac\n'
|
||||
}
|
||||
}, {
|
||||
type: 'Features',
|
||||
scope: null,
|
||||
subject: 'wow',
|
||||
header: 'amazing new module\n',
|
||||
body: null,
|
||||
footer: 'BREAKING CHANGE: Not backward compatible.\n',
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '56185b',
|
||||
raw: {
|
||||
type: 'feat',
|
||||
scope: null,
|
||||
subject: 'amazing new module',
|
||||
header: 'feat(): amazing new module\n',
|
||||
body: null,
|
||||
footer: 'BREAKING CHANGE: Not backward compatible.\n',
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '56185b7356766d2b30cfa2406b257080272e0b7a\n'
|
||||
}
|
||||
}, {
|
||||
type: 'What',
|
||||
scope: null,
|
||||
subject: 'new feature',
|
||||
header: 'feat(): new feature\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '815a3f0',
|
||||
raw: {
|
||||
type: 'feat',
|
||||
scope: null,
|
||||
subject: 'new feature',
|
||||
header: 'feat(): new feature\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '815a3f0717bf1dfce007bd076420c609504edcf3\n'
|
||||
}
|
||||
}, {
|
||||
type: 'Chores',
|
||||
scope: null,
|
||||
subject: 'first commit',
|
||||
header: 'chore: first commit\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '74a3e4d6d25',
|
||||
raw: {
|
||||
type: 'chore',
|
||||
scope: null,
|
||||
subject: 'first commit',
|
||||
header: 'chore: first commit\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '74a3e4d6d25dee2c0d6483a0a3887417728cbe0a\n'
|
||||
}
|
||||
}];
|
||||
|
||||
commits = conventionalCommitsFilter(commits);
|
||||
console.log(commits);
|
||||
/*=>
|
||||
[{
|
||||
type: 'What',
|
||||
scope: null,
|
||||
subject: 'new feature',
|
||||
header: 'feat(): new feature\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '815a3f0',
|
||||
raw: {
|
||||
type: 'feat',
|
||||
scope: null,
|
||||
subject: 'new feature',
|
||||
header: 'feat(): new feature\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '815a3f0717bf1dfce007bd076420c609504edcf3\n'
|
||||
}
|
||||
}, {
|
||||
type: 'Chores',
|
||||
scope: null,
|
||||
subject: 'first commit',
|
||||
header: 'chore: first commit\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '74a3e4d6d25',
|
||||
raw: {
|
||||
type: 'chore',
|
||||
scope: null,
|
||||
subject: 'first commit',
|
||||
header: 'chore: first commit\n',
|
||||
body: null,
|
||||
footer: null,
|
||||
notes: [],
|
||||
references: [],
|
||||
revert: null,
|
||||
hash: '74a3e4d6d25dee2c0d6483a0a3887417728cbe0a\n'
|
||||
}
|
||||
}]
|
||||
*/
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Steve Mao]()
|
||||
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/conventional-commits-filter.svg
|
||||
[npm-url]: https://npmjs.org/package/conventional-commits-filter
|
||||
[travis-image]: https://travis-ci.org/stevemao/conventional-commits-filter.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/stevemao/conventional-commits-filter
|
||||
[daviddm-image]: https://david-dm.org/stevemao/conventional-commits-filter.svg
|
||||
[daviddm-url]: https://david-dm.org/stevemao/conventional-commits-filter
|
||||
[coveralls-image]: https://coveralls.io/repos/stevemao/conventional-commits-filter/badge.svg?branch=master
|
||||
[coveralls-url]: https://coveralls.io/r/stevemao/conventional-commits-filter
|
||||
463
node_modules/conventional-commits-parser/CHANGELOG.md
generated
vendored
463
node_modules/conventional-commits-parser/CHANGELOG.md
generated
vendored
@@ -1,463 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [3.2.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.1.0...conventional-commits-parser@3.2.0) (2020-11-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ignore gpg lines ([#685](https://github.com/conventional-changelog/conventional-changelog/issues/685)) ([f8fcbc2](https://github.com/conventional-changelog/conventional-changelog/commit/f8fcbc2e8b0834c29178ace6382b438a020ad828))
|
||||
* **deps:** update dependency through2 to v4 ([#657](https://github.com/conventional-changelog/conventional-changelog/issues/657)) ([7ae618c](https://github.com/conventional-changelog/conventional-changelog/commit/7ae618c81491841e5b1d796d3933aac0c54bc312))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allows notes pattern to be customized ([#586](https://github.com/conventional-changelog/conventional-changelog/issues/586)) ([9c00f32](https://github.com/conventional-changelog/conventional-changelog/commit/9c00f3242d916be1774a618d943f908f8d9699a6))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.1.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.8...conventional-commits-parser@3.1.0) (2020-05-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update yargs-parser to move off a flagged-vulnerable version. ([#635](https://github.com/conventional-changelog/conventional-changelog/issues/635)) ([aafc0f0](https://github.com/conventional-changelog/conventional-changelog/commit/aafc0f00412c3e4b23b8418300e5a570a48fe24d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **conventional-commits-parser:** add issuePrefixesCaseSensitive parser option ([#580](https://github.com/conventional-changelog/conventional-changelog/issues/580)) ([526b282](https://github.com/conventional-changelog/conventional-changelog/commit/526b28214d12c55158eb2e4d44408378587ceb97))
|
||||
* support slash in headerPattern default options ([93a547d](https://github.com/conventional-changelog/conventional-changelog/commit/93a547d742634d8676f499cfa2a274bc3792d020))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### [3.2.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.3...conventional-commits-parser-v3.2.4) (2021-12-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* support BREAKING-CHANGE alongside BREAKING CHANGE ([#882](https://github.com/conventional-changelog/conventional-changelog/issues/882)) ([e6f44ad](https://github.com/conventional-changelog/conventional-changelog/commit/e6f44adcf1ac5abbb85bdac73237c331c6594177))
|
||||
|
||||
### [3.2.3](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.2...conventional-commits-parser-v3.2.3) (2021-10-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address ReDoS issue ([#861](https://www.github.com/conventional-changelog/conventional-changelog/issues/861)) ([c696fa3](https://www.github.com/conventional-changelog/conventional-changelog/commit/c696fa35f93e0ee13728d6cf1221587ac6386311))
|
||||
|
||||
### [3.2.2](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.1...conventional-commits-parser-v3.2.2) (2021-09-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conventional-commits-parser:** address CVE-2021-23425 ([#841](https://www.github.com/conventional-changelog/conventional-changelog/issues/841)) ([02b3d53](https://www.github.com/conventional-changelog/conventional-changelog/commit/02b3d53a0c142f0c28ee7d190d210c76a62887c2))
|
||||
|
||||
### [3.2.1](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.2.0...v3.2.1) (2021-02-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* handle missing header in merge commit ([#757](https://www.github.com/conventional-changelog/conventional-changelog/issues/757)) ([d189d3e](https://www.github.com/conventional-changelog/conventional-changelog/commit/d189d3e45b82e7141115ce8eccd95c8cf2d7db77))
|
||||
|
||||
## [3.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.7...conventional-commits-parser@3.0.8) (2019-11-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add types for cli flags ([#551](https://github.com/conventional-changelog/conventional-changelog/issues/551)) ([bf1d64a](https://github.com/conventional-changelog/conventional-changelog/commit/bf1d64aeaf8f262d4b2beec02d2aebb78df7343b))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.6...conventional-commits-parser@3.0.7) (2019-11-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conventional-commits-parser:** add breaking change notes if header match `breakingHeaderPattern` ([#544](https://github.com/conventional-changelog/conventional-changelog/issues/544)) ([efdf3cb](https://github.com/conventional-changelog/conventional-changelog/commit/efdf3cbc9de3278b180a48beebb74e596e3c5f94))
|
||||
* **conventional-commits-parser:** add missing separator pipe to non tty parser ([#546](https://github.com/conventional-changelog/conventional-changelog/issues/546)) ([c522743](https://github.com/conventional-changelog/conventional-changelog/commit/c5227437b0b300f30a57e8ba5df2a8ab8d163af0))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.5...conventional-commits-parser@3.0.6) (2019-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conventional-commits-parser:** downgrade is-text-path due to node 6 incompatibility ([#536](https://github.com/conventional-changelog/conventional-changelog/issues/536)) ([3aa2637](https://github.com/conventional-changelog/conventional-changelog/commit/3aa2637a1c65bb4db3d8bf2c6ce17e6f5abe1ca1))
|
||||
* **deps:** update lodash to fix security issues ([#535](https://github.com/conventional-changelog/conventional-changelog/issues/535)) ([ac43f51](https://github.com/conventional-changelog/conventional-changelog/commit/ac43f51de1f3b597c32f7f8442917a2d06199018))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.3...conventional-commits-parser@3.0.4) (2019-10-02)
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.2...conventional-commits-parser@3.0.3) (2019-05-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency is-text-path to v2 ([#455](https://github.com/conventional-changelog/conventional-changelog/issues/455)) ([0f40ec3](https://github.com/conventional-changelog/conventional-changelog/commit/0f40ec3))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.1...conventional-commits-parser@3.0.2) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** update dependency through2 to v3 ([#392](https://github.com/conventional-changelog/conventional-changelog/issues/392)) ([26fe91f](https://github.com/conventional-changelog/conventional-changelog/commit/26fe91f))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.0...conventional-commits-parser@3.0.1) (2018-11-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.7...conventional-commits-parser@3.0.0) (2018-05-29)
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **package:** Set the package's minimum required Node version to be the oldest LTS
|
||||
currently supported by the Node Release working group. At this time,
|
||||
that is Node 6 (which is in its Maintenance LTS phase).
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.1.7"></a>
|
||||
## [2.1.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.6...conventional-commits-parser@2.1.7) (2018-03-27)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
<a name="2.1.6"></a>
|
||||
## [2.1.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.5...conventional-commits-parser@2.1.6) (2018-03-22)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
<a name="2.1.5"></a>
|
||||
## [2.1.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.4...conventional-commits-parser@2.1.5) (2018-02-24)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
<a name="2.1.4"></a>
|
||||
## [2.1.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.3...conventional-commits-parser@2.1.4) (2018-02-20)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
<a name="2.1.3"></a>
|
||||
## [2.1.3](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.1.2...conventional-commits-parser@2.1.3) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
<a name="2.1.2"></a>
|
||||
## [2.1.2](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.1.1...conventional-commits-parser@2.1.2) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package conventional-commits-parser
|
||||
|
||||
<a name="2.1.1"></a>
|
||||
## [2.1.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.1.0...conventional-commits-parser@2.1.1) (2018-02-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* truncate after scissors line ([#267](https://github.com/conventional-changelog/conventional-commits-parser/issues/267)) ([e09df10](https://github.com/conventional-changelog/conventional-commits-parser/commit/e09df10))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.0.1...conventional-commits-parser@2.1.0) (2017-12-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* always parse references ([e84a9ae](https://github.com/conventional-changelog/conventional-commits-parser/commit/e84a9ae)), closes [#248](https://github.com/conventional-changelog/conventional-commits-parser/issues/248)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* make comment stripping optional ([db5b711](https://github.com/conventional-changelog/conventional-commits-parser/commit/db5b711)), closes [#251](https://github.com/conventional-changelog/conventional-commits-parser/issues/251)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.0.0...conventional-commits-parser@2.0.1) (2017-11-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conventional-commits-parser:** ignore comments ([#231](https://github.com/conventional-changelog/conventional-commits-parser/issues/231)) ([9db53e3](https://github.com/conventional-changelog/conventional-commits-parser/commit/9db53e3)), closes [#224](https://github.com/conventional-changelog/conventional-commits-parser/issues/224)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# 2.0.0 (2017-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cli:** commit can be split when testing a commit file ([f3b3a3f](https://github.com/conventional-changelog/conventional-commits-parser/commit/f3b3a3f))
|
||||
* **cli:** error handling for ENOENT is fixed ([3c92233](https://github.com/conventional-changelog/conventional-commits-parser/commit/3c92233))
|
||||
* **cli:** fix "undefined" in json string ([0680e42](https://github.com/conventional-changelog/conventional-commits-parser/commit/0680e42))
|
||||
* **cli:** options format ([491357e](https://github.com/conventional-changelog/conventional-commits-parser/commit/491357e))
|
||||
* **deps:** require split2 ([1941c37](https://github.com/conventional-changelog/conventional-commits-parser/commit/1941c37))
|
||||
* **error:** change error type and wordings ([d8be5e5](https://github.com/conventional-changelog/conventional-commits-parser/commit/d8be5e5))
|
||||
* **footer:** notes contains more than one paragraphs after references ([d744ec7](https://github.com/conventional-changelog/conventional-commits-parser/commit/d744ec7))
|
||||
* **headerCorrespondence:** string value for cli ([fb774fc](https://github.com/conventional-changelog/conventional-commits-parser/commit/fb774fc))
|
||||
* **headerPattern:** change how capturing groups works ([fe1fe0c](https://github.com/conventional-changelog/conventional-commits-parser/commit/fe1fe0c))
|
||||
* **issuePrefixes:** should return noMatch if falsy ([72db2bf](https://github.com/conventional-changelog/conventional-commits-parser/commit/72db2bf))
|
||||
* **mention:** fix mention matching ([965986b](https://github.com/conventional-changelog/conventional-commits-parser/commit/965986b)), closes [#26](https://github.com/conventional-changelog/conventional-commits-parser/issues/26)
|
||||
* **newlines:** preserve newlines in a part ([06b8c7c](https://github.com/conventional-changelog/conventional-commits-parser/commit/06b8c7c)), closes [#15](https://github.com/conventional-changelog/conventional-commits-parser/issues/15)
|
||||
* **notes:** note keywords must appear at the beginning of a sentence ([5a2059e](https://github.com/conventional-changelog/conventional-commits-parser/commit/5a2059e)), closes [#23](https://github.com/conventional-changelog/conventional-commits-parser/issues/23)
|
||||
* **parser:** do not trim spaces but newlines ([1e8c4c5](https://github.com/conventional-changelog/conventional-commits-parser/commit/1e8c4c5))
|
||||
* **parser:** it returns null if there is no header ([8571c9e](https://github.com/conventional-changelog/conventional-commits-parser/commit/8571c9e))
|
||||
* **regex:** do not treat it as note if there are texts after keywords ([571b03e](https://github.com/conventional-changelog/conventional-commits-parser/commit/571b03e))
|
||||
* **regex:** make getReferencePartsRegex stricter ([62adf54](https://github.com/conventional-changelog/conventional-commits-parser/commit/62adf54)), closes [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [#30](https://github.com/conventional-changelog/conventional-commits-parser/issues/30) [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [#28](https://github.com/conventional-changelog/conventional-commits-parser/issues/28)
|
||||
* **revertPattern:** correct regex ([8628983](https://github.com/conventional-changelog/conventional-commits-parser/commit/8628983))
|
||||
* **util:** remove an accidentally commited file ([3710a8c](https://github.com/conventional-changelog/conventional-commits-parser/commit/3710a8c))
|
||||
* **warn:** should tell which commit cannot be parsed ([04b0a9b](https://github.com/conventional-changelog/conventional-commits-parser/commit/04b0a9b))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* init ([a529841](https://github.com/conventional-changelog/conventional-commits-parser/commit/a529841))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **breaks:** change `breaks` to `notes` ([5189a61](https://github.com/conventional-changelog/conventional-commits-parser/commit/5189a61)), closes [#2](https://github.com/conventional-changelog/conventional-commits-parser/issues/2)
|
||||
* **merge:** pull-request should be merge ([4e7c61c](https://github.com/conventional-changelog/conventional-commits-parser/commit/4e7c61c))
|
||||
* **regex:** regex now takes `options` ([eea319a](https://github.com/conventional-changelog/conventional-commits-parser/commit/eea319a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cli:** able to have two files, separator works for interactive ([db1e3b5](https://github.com/conventional-changelog/conventional-commits-parser/commit/db1e3b5))
|
||||
* **cli:** add aliases, more help details and tests ([eb654a2](https://github.com/conventional-changelog/conventional-commits-parser/commit/eb654a2))
|
||||
* **cli:** add missing options ([8ac1cf7](https://github.com/conventional-changelog/conventional-commits-parser/commit/8ac1cf7))
|
||||
* **cli:** add warn function for interactive shell ([84fe31f](https://github.com/conventional-changelog/conventional-commits-parser/commit/84fe31f))
|
||||
* **correspondence:** add `headerCorrespondence` and improve commit parts ([aca9e95](https://github.com/conventional-changelog/conventional-commits-parser/commit/aca9e95)), closes [#6](https://github.com/conventional-changelog/conventional-commits-parser/issues/6)
|
||||
* **fieldPattern:** should support string format ([b6b6b52](https://github.com/conventional-changelog/conventional-commits-parser/commit/b6b6b52))
|
||||
* **hash:** drop support ([1ccc751](https://github.com/conventional-changelog/conventional-commits-parser/commit/1ccc751))
|
||||
* **headerParts:** headerParts can be anything ([31e1c11](https://github.com/conventional-changelog/conventional-commits-parser/commit/31e1c11)), closes [#10](https://github.com/conventional-changelog/conventional-commits-parser/issues/10)
|
||||
* **issuePrefixes:** init and referenceKeywords -> referenceActions ([86bf798](https://github.com/conventional-changelog/conventional-commits-parser/commit/86bf798)), closes [#11](https://github.com/conventional-changelog/conventional-commits-parser/issues/11)
|
||||
* **maxSubjectLength:** removed ([3448582](https://github.com/conventional-changelog/conventional-commits-parser/commit/3448582))
|
||||
* **mentions:** [@someone](https://github.com/someone) in commit ([d60fe76](https://github.com/conventional-changelog/conventional-commits-parser/commit/d60fe76)), closes [#24](https://github.com/conventional-changelog/conventional-commits-parser/issues/24)
|
||||
* **newline:** fields does not contain leading or trailing newlines ([6db453b](https://github.com/conventional-changelog/conventional-commits-parser/commit/6db453b)), closes [#14](https://github.com/conventional-changelog/conventional-commits-parser/issues/14)
|
||||
* **note:** noteKeywords is case insensitive ([f779a29](https://github.com/conventional-changelog/conventional-commits-parser/commit/f779a29)), closes [#21](https://github.com/conventional-changelog/conventional-commits-parser/issues/21)
|
||||
* **options:** all options can be a string ([0fa17b4](https://github.com/conventional-changelog/conventional-commits-parser/commit/0fa17b4))
|
||||
* **otherFields:** other fields are possible to be included ([9e06278](https://github.com/conventional-changelog/conventional-commits-parser/commit/9e06278))
|
||||
* improvements and bug fixes ([1cde104](https://github.com/conventional-changelog/conventional-commits-parser/commit/1cde104)), closes [#5](https://github.com/conventional-changelog/conventional-commits-parser/issues/5)
|
||||
* migrate repo to lerna mono-repo ([793e823](https://github.com/conventional-changelog/conventional-commits-parser/commit/793e823))
|
||||
* **regex:** matching JIRA-123 like references ([20f1f7a](https://github.com/conventional-changelog/conventional-commits-parser/commit/20f1f7a)), closes [#19](https://github.com/conventional-changelog/conventional-commits-parser/issues/19)
|
||||
* support squash commits ([#31](https://github.com/conventional-changelog/conventional-changelog/issues/31)) ([fff60c0](https://github.com/conventional-changelog/conventional-commits-parser/commit/fff60c0))
|
||||
* **owner:** yield owner field ([d8d0334](https://github.com/conventional-changelog/conventional-commits-parser/commit/d8d0334)), closes [#12](https://github.com/conventional-changelog/conventional-commits-parser/issues/12)
|
||||
* **parser:** notes can have more than one paragraph ([733bfa9](https://github.com/conventional-changelog/conventional-commits-parser/commit/733bfa9)), closes [#3](https://github.com/conventional-changelog/conventional-commits-parser/issues/3)
|
||||
* **pullRequest:** Allow to skip and parse pull request header ([a2e929f](https://github.com/conventional-changelog/conventional-commits-parser/commit/a2e929f)), closes [#20](https://github.com/conventional-changelog/conventional-commits-parser/issues/20)
|
||||
* **reference:** able to reference an issue without an action ([6474123](https://github.com/conventional-changelog/conventional-commits-parser/commit/6474123)), closes [#22](https://github.com/conventional-changelog/conventional-commits-parser/issues/22)
|
||||
* **reference:** expose prefix ([47df766](https://github.com/conventional-changelog/conventional-commits-parser/commit/47df766)), closes [#17](https://github.com/conventional-changelog/conventional-commits-parser/issues/17)
|
||||
* **references:** allow header to reference an issue ([df18a24](https://github.com/conventional-changelog/conventional-commits-parser/commit/df18a24))
|
||||
* **references:** support other formats of references ([7c70213](https://github.com/conventional-changelog/conventional-commits-parser/commit/7c70213)), closes [#4](https://github.com/conventional-changelog/conventional-commits-parser/issues/4) [#8](https://github.com/conventional-changelog/conventional-commits-parser/issues/8)
|
||||
* **regex:** leading and trailing space for closes and breaks keywords are trimmed ([9639860](https://github.com/conventional-changelog/conventional-commits-parser/commit/9639860))
|
||||
* **revert:** parse a commit that reverts ([2af7233](https://github.com/conventional-changelog/conventional-commits-parser/commit/2af7233))
|
||||
* **stream:** emmit an empty string to down stream if commit cannot be parsed ([76bf84e](https://github.com/conventional-changelog/conventional-commits-parser/commit/76bf84e))
|
||||
* **sync:** add the sync function ([82071c6](https://github.com/conventional-changelog/conventional-commits-parser/commit/82071c6)), closes [#13](https://github.com/conventional-changelog/conventional-commits-parser/issues/13)
|
||||
* **warn:** optionally warn user what is wrong when commit cannot be parsed ([32b3cda](https://github.com/conventional-changelog/conventional-commits-parser/commit/32b3cda))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **regex:** regex should be constructed in index.html ([15afd26](https://github.com/conventional-changelog/conventional-commits-parser/commit/15afd26))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **merge:** `pull request` should be `merge`. Also make the parsed result to be consistent with other parts.
|
||||
* This module is imported from https://github.com/ajoslin/conventional-changelog, and is originally written by @vojtajina, @btford and @ajoslin.
|
||||
* **hash:** hash is no longer supported. This parser should just parse raw commit messages. Also text fields are appended with a newline "
|
||||
".
|
||||
* **regex:** It returns a nomatch regex if it's keywords are missing.
|
||||
* **headerParts:** `headerParts` does not limit to `type`, `scope` and `subject`. They can now be defined in `options.headerCorrespondence` and the order is the order of capturing group in `options.headerPattern`. If part is missing in `options.headerCorrespondence` it is `undefined`. If part is not captured but is not missing in `options.headerCorrespondence` it is `null`.
|
||||
* **maxSubjectLength:** `maxSubjectLength` is not available any more.
|
||||
* **issuePrefixes:** `options.referenceKeywords` is now `options.referenceActions`
|
||||
* **references:** `closes` now becomes `references` and it is loosely based the links above.
|
||||
* **parser:** The regex for matching notes are loosen. The semicolon and space are optional. The `notes` object is no longer a key-value object but an array of note object, such as
|
||||
```js
|
||||
{
|
||||
title: 'BREAKING AMEND',
|
||||
text: 'some breaking change'
|
||||
}
|
||||
```
|
||||
The detection of notes, closes, continueNote and isBody are mutually exclusive.
|
||||
* **breaks:** Variable name related to `breaks` changes to `notes`, because "Important Notes" a more generic term. There is no functional changes.
|
||||
* **stream:** It no longer skips the chunk if commit cannot be parsed. An empty string is passed to down stream
|
||||
* **correspondence:** body and footer will be null if they are not found. type and subject are nullable too.
|
||||
|
||||
<a name="1.3.0"></a>
|
||||
# [1.3.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.3...v1.3.0) (2016-10-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support squash commits (#31) ([860c7a1](https://github.com/conventional-changelog/conventional-commits-parser/commit/860c7a1))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.3"></a>
|
||||
## [1.2.3](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.2...v1.2.3) (2016-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **regex:** do not treat it as note if there are texts after keywords ([9cb56bc](https://github.com/conventional-changelog/conventional-commits-parser/commit/9cb56bc))
|
||||
|
||||
|
||||
|
||||
<a name="1.2.2"></a>
|
||||
## [1.2.2](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.1...v1.2.2) (2016-05-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **regex:** make getReferencePartsRegex stricter ([b8a9fda](https://github.com/conventional-changelog/conventional-commits-parser/commit/b8a9fda)), closes [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [(#30](https://github.com/(/issues/30) [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [#28](https://github.com/conventional-changelog/conventional-commits-parser/issues/28)
|
||||
|
||||
|
||||
|
||||
<a name="1.2.1"></a>
|
||||
## [1.2.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.0...v1.2.1) (2016-04-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **mention:** fix mention matching ([43b32e7](https://github.com/conventional-changelog/conventional-commits-parser/commit/43b32e7)), closes [#26](https://github.com/conventional-changelog/conventional-commits-parser/issues/26)
|
||||
|
||||
|
||||
|
||||
<a name="1.2.0"></a>
|
||||
# [1.2.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.1.0...v1.2.0) (2016-04-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **mentions:** @someone in commit ([b2eabbf](https://github.com/conventional-changelog/conventional-commits-parser/commit/b2eabbf)), closes [#24](https://github.com/conventional-changelog/conventional-commits-parser/issues/24)
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.0.1...v1.1.0) (2016-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **notes:** note keywords must appear at the beginning of a sentence ([6e13789](https://github.com/conventional-changelog/conventional-commits-parser/commit/6e13789)), closes [#23](https://github.com/conventional-changelog/conventional-commits-parser/issues/23)
|
||||
|
||||
### Features
|
||||
|
||||
* **reference:** able to reference an issue without an action ([cf847b1](https://github.com/conventional-changelog/conventional-commits-parser/commit/cf847b1)), closes [#22](https://github.com/conventional-changelog/conventional-commits-parser/issues/22)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/stevemao/conventional-commits-parser/compare/v1.0.0...v1.0.1) (2016-02-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** require split2 ([ad55810](https://github.com/stevemao/conventional-commits-parser/commit/ad55810))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://github.com/stevemao/conventional-commits-parser/compare/v0.2.0...v1.0.0) (2016-02-05)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.2.0"></a>
|
||||
# [0.2.0](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.2...v0.2.0) (2016-02-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **note:** noteKeywords is case insensitive ([4442b86](https://github.com/stevemao/conventional-commits-parser/commit/4442b86)), closes [#21](https://github.com/stevemao/conventional-commits-parser/issues/21)
|
||||
* **pullRequest:** Allow to skip and parse pull request header ([aa85033](https://github.com/stevemao/conventional-commits-parser/commit/aa85033)), closes [#20](https://github.com/stevemao/conventional-commits-parser/issues/20)
|
||||
* **regex:** matching JIRA-123 like references ([5342f45](https://github.com/stevemao/conventional-commits-parser/commit/5342f45)), closes [#19](https://github.com/stevemao/conventional-commits-parser/issues/19)
|
||||
|
||||
|
||||
|
||||
<a name="0.1.2"></a>
|
||||
## [0.1.2](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.1...v0.1.2) (2015-09-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **parser:** do not trim spaces but newlines ([62e7bf5](https://github.com/stevemao/conventional-commits-parser/commit/62e7bf5))
|
||||
|
||||
|
||||
|
||||
<a name="0.1.1"></a>
|
||||
## [0.1.1](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.0...v0.1.1) (2015-09-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **newlines:** preserve newlines in a part ([beb3d05](https://github.com/stevemao/conventional-commits-parser/commit/beb3d05)), closes [#15](https://github.com/stevemao/conventional-commits-parser/issues/15)
|
||||
|
||||
### Features
|
||||
|
||||
* **reference:** expose prefix ([9962dda](https://github.com/stevemao/conventional-commits-parser/commit/9962dda)), closes [#17](https://github.com/stevemao/conventional-commits-parser/issues/17)
|
||||
21
node_modules/conventional-commits-parser/LICENSE.md
generated
vendored
21
node_modules/conventional-commits-parser/LICENSE.md
generated
vendored
@@ -1,21 +0,0 @@
|
||||
### MIT License
|
||||
|
||||
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
|
||||
|
||||
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.
|
||||
383
node_modules/conventional-commits-parser/README.md
generated
vendored
383
node_modules/conventional-commits-parser/README.md
generated
vendored
@@ -1,383 +0,0 @@
|
||||
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
> Parse raw conventional commits
|
||||
|
||||
|
||||
## Conventional Commit Message Format
|
||||
|
||||
A minimum input should contain a raw message.
|
||||
|
||||
Each commit message consists of a **merge header**, a **header** (mandatory), a **body** and a **footer**. **Mention** (optional) someone using the `@` notation.
|
||||
|
||||
```
|
||||
<merge>
|
||||
<header>
|
||||
<body>
|
||||
<footer>
|
||||
```
|
||||
|
||||
### merge
|
||||
|
||||
The merge header may optionally have a special format that includes other parts, such as **branch**, **issueId** or **source**.
|
||||
|
||||
```
|
||||
Merge branch <branch>
|
||||
Merge pull request <issue-id> from <source>
|
||||
```
|
||||
|
||||
### header
|
||||
|
||||
The header may optionally have a special format that includes other parts, such as **type**, **scope** and **subject**. You could **reference** (optional) issues here.
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
```
|
||||
|
||||
### footer
|
||||
|
||||
The footer should contain any information about **Important Notes** (optional) and is also the place to **reference** (optional) issues.
|
||||
|
||||
```
|
||||
<important note>
|
||||
<references>
|
||||
```
|
||||
|
||||
### other parts
|
||||
|
||||
This module will only parse the message body. However, it is possible to include other fields such as hash, committer or date.
|
||||
|
||||
```
|
||||
My commit message
|
||||
-sideNotes-
|
||||
It should warn the correct unfound file names.
|
||||
Also it should continue if one file cannot be found.
|
||||
Tests are added for these
|
||||
```
|
||||
|
||||
Then `sideNotes` will be `It should warn the correct unfound file names.\nAlso it should continue if one file cannot be found.\nTests are added for these`. You can customize the `fieldPattern`.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
$ npm install --save conventional-commits-parser
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var conventionalCommitsParser = require('conventional-commits-parser');
|
||||
|
||||
conventionalCommitsParser(options);
|
||||
```
|
||||
|
||||
It returns a transform stream and expects an upstream that looks something like this:
|
||||
|
||||
```
|
||||
'feat(scope): broadcast $destroy event on scope destruction\nCloses #1'
|
||||
'feat(ng-list): Allow custom separator\nbla bla bla\n\nBREAKING CHANGE: some breaking change.\nThanks @stevemao\n'
|
||||
```
|
||||
|
||||
Each chunk should be a commit. The downstream will look something like this:
|
||||
|
||||
```js
|
||||
{ type: 'feat',
|
||||
scope: 'scope',
|
||||
subject: 'broadcast $destroy event on scope destruction',
|
||||
merge: null,
|
||||
header: 'feat(scope): broadcast $destroy event on scope destruction',
|
||||
body: null,
|
||||
footer: 'Closes #1',
|
||||
notes: [],
|
||||
references:
|
||||
[ { action: 'Closes',
|
||||
owner: null,
|
||||
repository: null,
|
||||
issue: '1',
|
||||
raw: '#1',
|
||||
prefix: '#' } ],
|
||||
mentions: [],
|
||||
revert: null }
|
||||
{ type: 'feat',
|
||||
scope: 'ng-list',
|
||||
subject: 'Allow custom separator',
|
||||
merge: null,
|
||||
header: 'feat(ng-list): Allow custom separator',
|
||||
body: 'bla bla bla',
|
||||
footer: 'BREAKING CHANGE: some breaking change.\nThanks @stevemao',
|
||||
notes:
|
||||
[ { title: 'BREAKING CHANGE',
|
||||
text: 'some breaking change.\nThanks @stevemao' } ],
|
||||
references: [],
|
||||
mentions: [ 'stevemao' ],
|
||||
revert: null }
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### conventionalCommitsParser([options])
|
||||
|
||||
Returns an transform stream. If there is any malformed commits it will be gracefully ignored (an empty data will be emitted so down stream can notice).
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### mergePattern
|
||||
|
||||
Type: `regex` or `string` Default: null
|
||||
|
||||
Pattern to match merge headers. EG: branch merge, GitHub or GitLab like pull requests headers. When a merge header is parsed, the next line is used for conventional header parsing.
|
||||
|
||||
For example, if we have a commit
|
||||
|
||||
```
|
||||
Merge pull request #1 from user/feature/feature-name
|
||||
|
||||
feat(scope): broadcast $destroy event on scope destruction
|
||||
```
|
||||
|
||||
We can parse it with these options and the default headerPattern:
|
||||
|
||||
```js
|
||||
{
|
||||
mergePattern: /^Merge pull request #(\d+) from (.*)$/,
|
||||
mergeCorrespondence: ['id', 'source']
|
||||
}
|
||||
```
|
||||
|
||||
##### mergeCorrespondence
|
||||
|
||||
Type: `array` of `string` or `string` Default: null
|
||||
|
||||
Used to define what capturing group of `mergePattern`.
|
||||
|
||||
If it's a `string` it will be converted to an `array` separated by a comma.
|
||||
|
||||
##### headerPattern
|
||||
|
||||
Type: `regex` or `string` Default: `/^(\w*)(?:\(([\w\$\.\-\* ]*)\))?\: (.*)$/`
|
||||
|
||||
Used to match header pattern.
|
||||
|
||||
##### headerCorrespondence
|
||||
|
||||
Type: `array` of `string` or `string` Default `['type', 'scope', 'subject']`
|
||||
|
||||
Used to define what capturing group of `headerPattern` captures what header part. The order of the array should correspond to the order of `headerPattern`'s capturing group. If the part is not captured it is `null`. If it's a `string` it will be converted to an `array` separated by a comma.
|
||||
|
||||
##### referenceActions
|
||||
|
||||
Type: `array` of `string` or `string` Default:
|
||||
`[
|
||||
'close',
|
||||
'closes',
|
||||
'closed',
|
||||
'fix',
|
||||
'fixes',
|
||||
'fixed',
|
||||
'resolve',
|
||||
'resolves',
|
||||
'resolved'
|
||||
]`
|
||||
|
||||
Keywords to reference an issue. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
|
||||
|
||||
Set it to `null` to reference an issue without any action.
|
||||
|
||||
##### issuePrefixes
|
||||
|
||||
Type: `array` of `string` or `string` Default: `['#']`
|
||||
|
||||
The prefixes of an issue. EG: In `gh-123` `gh-` is the prefix.
|
||||
|
||||
##### issuePrefixesCaseSensitive
|
||||
|
||||
Type: `boolean` Default: false
|
||||
|
||||
Used to define if `issuePrefixes` should be considered case sensitive.
|
||||
|
||||
##### noteKeywords
|
||||
|
||||
Type: `array` of `string` or `string` Default: `['BREAKING CHANGE',
|
||||
'BREAKING-CHANGE']`
|
||||
|
||||
Keywords for important notes. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
|
||||
|
||||
##### notesPattern
|
||||
|
||||
Type: `function` Default: `noteKeywordsSelection => ^[\\s|*]*(' + noteKeywordsSelection + ')[:\\s]+(.*)` where `noteKeywordsSelection` is `join(noteKeywords, '|')`
|
||||
|
||||
A function that takes `noteKeywordsSelection` and returns a `RegExp` to be matched against the notes.
|
||||
|
||||
##### fieldPattern
|
||||
|
||||
Type: `regex` or `string` Default: `/^-(.*?)-$/`
|
||||
|
||||
Pattern to match other fields.
|
||||
|
||||
##### revertPattern
|
||||
|
||||
Type: `regex` or `string` Default: `/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./`
|
||||
|
||||
Pattern to match what this commit reverts.
|
||||
|
||||
##### revertCorrespondence
|
||||
|
||||
Type: `array` of `string` or `string` Default: `['header', 'hash']`
|
||||
|
||||
Used to define what capturing group of `revertPattern` captures what reverted commit fields. The order of the array should correspond to the order of `revertPattern`'s capturing group.
|
||||
|
||||
For example, if we had commit
|
||||
|
||||
```
|
||||
Revert "throw an error if a callback is passed"
|
||||
|
||||
This reverts commit 9bb4d6c.
|
||||
```
|
||||
|
||||
If configured correctly, the parsed result would be
|
||||
|
||||
```js
|
||||
{
|
||||
revert: {
|
||||
header: 'throw an error if a callback is passed',
|
||||
hash: '9bb4d6c'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
It implies that this commit reverts a commit with header `'throw an error if a callback is passed'` and hash `'9bb4d6c'`.
|
||||
|
||||
If it's a `string` it will be converted to an `array` separated by a comma.
|
||||
|
||||
##### commentChar
|
||||
|
||||
Type: `string` or `null` Default: null
|
||||
|
||||
What commentChar to use. By default it is `null`, so no comments are stripped.
|
||||
Set to `#` if you pass the contents of `.git/COMMIT_EDITMSG` directly.
|
||||
|
||||
If you have configured the git commentchar via `git config core.commentchar` you'll want to pass what you have set there.
|
||||
|
||||
##### warn
|
||||
|
||||
Type: `function` or `boolean` Default: `function() {}`
|
||||
|
||||
What warn function to use. For example, `console.warn.bind(console)` or `grunt.log.writeln`. By default, it's a noop. If it is `true`, it will error if commit cannot be parsed (strict).
|
||||
|
||||
### conventionalCommitsParser.sync(commit, [options])
|
||||
|
||||
The sync version. Useful when parsing a single commit. Returns the result.
|
||||
|
||||
#### commit
|
||||
|
||||
A single commit to be parsed.
|
||||
|
||||
#### options
|
||||
|
||||
Same as the `options` of `conventionalCommitsParser`.
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
You can use cli to practice writing commit messages or parse messages from files. Note: the sample output might be different. It's just for demonstration purposes.
|
||||
|
||||
```sh
|
||||
$ npm install --global conventional-commits-parser
|
||||
```
|
||||
|
||||
If you run `conventional-commits-parser` without any arguments
|
||||
|
||||
```sh
|
||||
$ conventional-commits-parser
|
||||
```
|
||||
|
||||
You will enter an interactive shell. To show your parsed output enter "return" three times (or enter your specified separator).
|
||||
|
||||
```sh
|
||||
> fix(title): a title is fixed
|
||||
|
||||
|
||||
{"type":"fix","scope":"title","subject":"a title is fixed","header":"fix(title): a title is fixed","body":null,"footer":null,"notes":[],"references":[],"revert":null}
|
||||
```
|
||||
|
||||
You can also use cli to parse messages from files.
|
||||
|
||||
If you have log.txt
|
||||
|
||||
```text
|
||||
feat(ngMessages): provide support for dynamic message resolution
|
||||
|
||||
Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.
|
||||
|
||||
BREAKING CHANGE: The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.
|
||||
|
||||
Closes #10036
|
||||
Closes #9338
|
||||
```
|
||||
|
||||
And you run
|
||||
|
||||
```sh
|
||||
$ conventional-commits-parser log.txt
|
||||
# or
|
||||
$ cat log.txt | conventional-commits-parser
|
||||
```
|
||||
|
||||
An array of json will be printed to stdout.
|
||||
|
||||
```sh
|
||||
[
|
||||
{"type":"feat","scope":"ngMessages","subject":"provide support for dynamic message resolution","header":"feat(ngMessages): provide support for dynamic message resolution","body":"Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.","footer":"BREAKING CHANGE: The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.\nCloses #10036\nCloses #9338","notes":[{"title":"BREAKING CHANGE","text":"The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive."}],"references":[{"action":"Closes","owner":null,"repository":null,"issue":"10036","raw":"#10036"},{"action":"Closes","owner":null,"repository":null,"issue":"9338","raw":"#9338"}],"revert":null}
|
||||
]
|
||||
```
|
||||
|
||||
Commits should be split by at least three newlines (`\n\n\n`) or you can specify a separator as the second argument.
|
||||
|
||||
Eg: in log2.txt
|
||||
|
||||
```text
|
||||
|
||||
docs(ngMessageExp): split ngMessage docs up to show its alias more clearly
|
||||
===
|
||||
|
||||
fix($animate): applyStyles from options on leave
|
||||
|
||||
Closes #10068
|
||||
```
|
||||
|
||||
And you run
|
||||
|
||||
```sh
|
||||
$ conventional-commits-parser log2.txt '==='
|
||||
```
|
||||
|
||||
```sh
|
||||
[
|
||||
{"type":"docs","scope":"ngMessageExp","subject":"split ngMessage docs up to show its alias more clearly","header":"docs(ngMessageExp): split ngMessage docs up to show its alias more clearly","body":null,"footer":null,"notes":[],"references":[],"revert":null}
|
||||
,
|
||||
{"type":"fix","scope":"$animate","subject":"applyStyles from options on leave","header":"fix($animate): applyStyles from options on leave","body":null,"footer":"Closes #10068","notes":[],"references":[{"action":"Closes","owner":null,"repository":null,"issue":"10068","raw":"#10068"}],"revert":null}
|
||||
]
|
||||
```
|
||||
|
||||
Will be printed out.
|
||||
|
||||
You can specify one or more files. The output array will be in order of the input file paths. If you specify more than one separator, the last one will be used.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Steve Mao](https://github.com/stevemao)
|
||||
|
||||
|
||||
[npm-image]: https://badge.fury.io/js/conventional-commits-parser.svg
|
||||
[npm-url]: https://npmjs.org/package/conventional-commits-parser
|
||||
[travis-image]: https://travis-ci.org/conventional-changelog/conventional-commits-parser.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/conventional-changelog/conventional-commits-parser
|
||||
[daviddm-image]: https://david-dm.org/conventional-changelog/conventional-commits-parser.svg?theme=shields.io
|
||||
[daviddm-url]: https://david-dm.org/conventional-changelog/conventional-commits-parser
|
||||
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-commits-parser/badge.svg
|
||||
[coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-commits-parser
|
||||
3
node_modules/core-util-is/README.md
generated
vendored
3
node_modules/core-util-is/README.md
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# core-util-is
|
||||
|
||||
The `util.is*` functions introduced in Node v0.12.
|
||||
582
node_modules/cosmiconfig/README.md
generated
vendored
582
node_modules/cosmiconfig/README.md
generated
vendored
@@ -1,582 +0,0 @@
|
||||
# cosmiconfig
|
||||
|
||||
[](https://codecov.io/gh/davidtheclark/cosmiconfig)
|
||||
|
||||
> **MAINTAINERS WANTED!** If you're interested in taking over and maintaining Cosmiconfig, please let @davidtheclark know (with an issue or email). I'd like to hand over the keys completely, so I'm looking for **owners**, not people who just want to merge a PR or two! You can make the decisions about what happens in v8 and subsequent versions, how the package balances stability and opinionated features, and so on. Take a look at open issues and PRs to learn about possibilities that have been on people's minds over the years.
|
||||
|
||||
Cosmiconfig searches for and loads configuration for your program.
|
||||
|
||||
It features smart defaults based on conventional expectations in the JavaScript ecosystem.
|
||||
But it's also flexible enough to search wherever you'd like to search, and load whatever you'd like to load.
|
||||
|
||||
By default, Cosmiconfig will start where you tell it to start and search up the directory tree for the following:
|
||||
|
||||
- a `package.json` property
|
||||
- a JSON or YAML, extensionless "rc file"
|
||||
- an "rc file" with the extensions `.json`, `.yaml`, `.yml`, `.js`, or `.cjs`
|
||||
- any of the above two inside a `.config` subdirectory
|
||||
- a `.config.js` or `.config.cjs` CommonJS module
|
||||
|
||||
For example, if your module's name is "myapp", cosmiconfig will search up the directory tree for configuration in the following places:
|
||||
|
||||
- a `myapp` property in `package.json`
|
||||
- a `.myapprc` file in JSON or YAML format
|
||||
- a `.myapprc.json`, `.myapprc.yaml`, `.myapprc.yml`, `.myapprc.js`, or `.myapprc.cjs` file
|
||||
- a `myapprc`, `myapprc.json`, `myapprc.yaml`, `myapprc.yml`, `myapprc.js` or `myapprc.cjs` file inside a `.config` subdirectory
|
||||
- a `myapp.config.js` or `myapp.config.cjs` CommonJS module exporting an object
|
||||
|
||||
Cosmiconfig continues to search up the directory tree, checking each of these places in each directory, until it finds some acceptable configuration (or hits the home directory).
|
||||
|
||||
## Table of contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Result](#result)
|
||||
- [Asynchronous API](#asynchronous-api)
|
||||
- [cosmiconfig()](#cosmiconfig-1)
|
||||
- [explorer.search()](#explorersearch)
|
||||
- [explorer.load()](#explorerload)
|
||||
- [explorer.clearLoadCache()](#explorerclearloadcache)
|
||||
- [explorer.clearSearchCache()](#explorerclearsearchcache)
|
||||
- [explorer.clearCaches()](#explorerclearcaches)
|
||||
- [Synchronous API](#synchronous-api)
|
||||
- [cosmiconfigSync()](#cosmiconfigsync)
|
||||
- [explorerSync.search()](#explorersyncsearch)
|
||||
- [explorerSync.load()](#explorersyncload)
|
||||
- [explorerSync.clearLoadCache()](#explorersyncclearloadcache)
|
||||
- [explorerSync.clearSearchCache()](#explorersyncclearsearchcache)
|
||||
- [explorerSync.clearCaches()](#explorersyncclearcaches)
|
||||
- [cosmiconfigOptions](#cosmiconfigoptions)
|
||||
- [searchPlaces](#searchplaces)
|
||||
- [loaders](#loaders)
|
||||
- [packageProp](#packageprop)
|
||||
- [stopDir](#stopdir)
|
||||
- [cache](#cache)
|
||||
- [transform](#transform)
|
||||
- [ignoreEmptySearchPlaces](#ignoreemptysearchplaces)
|
||||
- [Caching](#caching)
|
||||
- [Differences from rc](#differences-from-rc)
|
||||
- [Contributing & Development](#contributing--development)
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install cosmiconfig
|
||||
```
|
||||
|
||||
Tested in Node 14+.
|
||||
|
||||
## Usage
|
||||
|
||||
Create a Cosmiconfig explorer, then either `search` for or directly `load` a configuration file.
|
||||
|
||||
```js
|
||||
const { cosmiconfig, cosmiconfigSync } = require('cosmiconfig');
|
||||
// ...
|
||||
const explorer = cosmiconfig(moduleName);
|
||||
|
||||
// Search for a configuration by walking up directories.
|
||||
// See documentation for search, below.
|
||||
explorer.search()
|
||||
.then((result) => {
|
||||
// result.config is the parsed configuration object.
|
||||
// result.filepath is the path to the config file that was found.
|
||||
// result.isEmpty is true if there was nothing to parse in the config file.
|
||||
})
|
||||
.catch((error) => {
|
||||
// Do something constructive.
|
||||
});
|
||||
|
||||
// Load a configuration directly when you know where it should be.
|
||||
// The result object is the same as for search.
|
||||
// See documentation for load, below.
|
||||
explorer.load(pathToConfig).then(..);
|
||||
|
||||
// You can also search and load synchronously.
|
||||
const explorerSync = cosmiconfigSync(moduleName);
|
||||
|
||||
const searchedFor = explorerSync.search();
|
||||
const loaded = explorerSync.load(pathToConfig);
|
||||
```
|
||||
|
||||
## Result
|
||||
|
||||
The result object you get from `search` or `load` has the following properties:
|
||||
|
||||
- **config:** The parsed configuration object. `undefined` if the file is empty.
|
||||
- **filepath:** The path to the configuration file that was found.
|
||||
- **isEmpty:** `true` if the configuration file is empty. This property will not be present if the configuration file is not empty.
|
||||
|
||||
## Asynchronous API
|
||||
|
||||
### cosmiconfig()
|
||||
|
||||
```js
|
||||
const { cosmiconfig } = require('cosmiconfig');
|
||||
const explorer = cosmiconfig(moduleName[, cosmiconfigOptions])
|
||||
```
|
||||
|
||||
Creates a cosmiconfig instance ("explorer") configured according to the arguments, and initializes its caches.
|
||||
|
||||
#### moduleName
|
||||
|
||||
Type: `string`. **Required.**
|
||||
|
||||
Your module name. This is used to create the default [`searchPlaces`] and [`packageProp`].
|
||||
|
||||
If your [`searchPlaces`] value will include files, as it does by default (e.g. `${moduleName}rc`), your `moduleName` must consist of characters allowed in filenames. That means you should not copy scoped package names, such as `@my-org/my-package`, directly into `moduleName`.
|
||||
|
||||
**[`cosmiconfigOptions`] are documented below.**
|
||||
You may not need them, and should first read about the functions you'll use.
|
||||
|
||||
### explorer.search()
|
||||
|
||||
```js
|
||||
explorer.search([searchFrom]).then(result => {..})
|
||||
```
|
||||
|
||||
Searches for a configuration file. Returns a Promise that resolves with a [result] or with `null`, if no configuration file is found.
|
||||
|
||||
You can do the same thing synchronously with [`explorerSync.search()`].
|
||||
|
||||
Let's say your module name is `goldengrahams` so you initialized with `const explorer = cosmiconfig('goldengrahams');`.
|
||||
Here's how your default [`search()`] will work:
|
||||
|
||||
- Starting from `process.cwd()` (or some other directory defined by the `searchFrom` argument to [`search()`]), look for configuration objects in the following places:
|
||||
1. A `goldengrahams` property in a `package.json` file.
|
||||
2. A `.goldengrahamsrc` file with JSON or YAML syntax.
|
||||
3. A `.goldengrahamsrc.json`, `.goldengrahamsrc.yaml`, `.goldengrahamsrc.yml`, `.goldengrahamsrc.js`, or `.goldengrahamsrc.cjs` file.
|
||||
4. A `goldengrahamsrc`, `goldengrahamsrc.json`, `goldengrahamsrc.yaml`, `goldengrahamsrc.yml`, `goldengrahamsrc.js`, or `goldengrahamsrc.cjs` file in the `.config` subdirectory.
|
||||
5. A `goldengrahams.config.js` or `goldengrahams.config.cjs` CommonJS module exporting the object.
|
||||
- If none of those searches reveal a configuration object, move up one directory level and try again.
|
||||
So the search continues in `./`, `../`, `../../`, `../../../`, etc., checking the same places in each directory.
|
||||
- Continue searching until arriving at your home directory (or some other directory defined by the cosmiconfig option [`stopDir`]).
|
||||
- If at any point a parsable configuration is found, the [`search()`] Promise resolves with its [result] \(or, with [`explorerSync.search()`], the [result] is returned).
|
||||
- If no configuration object is found, the [`search()`] Promise resolves with `null` (or, with [`explorerSync.search()`], `null` is returned).
|
||||
- If a configuration object is found *but is malformed* (causing a parsing error), the [`search()`] Promise rejects with that error (so you should `.catch()` it). (Or, with [`explorerSync.search()`], the error is thrown.)
|
||||
|
||||
**If you know exactly where your configuration file should be, you can use [`load()`], instead.**
|
||||
|
||||
**The search process is highly customizable.**
|
||||
Use the cosmiconfig options [`searchPlaces`] and [`loaders`] to precisely define where you want to look for configurations and how you want to load them.
|
||||
|
||||
#### searchFrom
|
||||
|
||||
Type: `string`.
|
||||
Default: `process.cwd()`.
|
||||
|
||||
A filename.
|
||||
[`search()`] will start its search here.
|
||||
|
||||
If the value is a directory, that's where the search starts.
|
||||
If it's a file, the search starts in that file's directory.
|
||||
|
||||
### explorer.load()
|
||||
|
||||
```js
|
||||
explorer.load(loadPath).then(result => {..})
|
||||
```
|
||||
|
||||
Loads a configuration file. Returns a Promise that resolves with a [result] or rejects with an error (if the file does not exist or cannot be loaded).
|
||||
|
||||
Use `load` if you already know where the configuration file is and you just need to load it.
|
||||
|
||||
```js
|
||||
explorer.load('load/this/file.json'); // Tries to load load/this/file.json.
|
||||
```
|
||||
|
||||
If you load a `package.json` file, the result will be derived from whatever property is specified as your [`packageProp`].
|
||||
|
||||
You can do the same thing synchronously with [`explorerSync.load()`].
|
||||
|
||||
### explorer.clearLoadCache()
|
||||
|
||||
Clears the cache used in [`load()`].
|
||||
|
||||
### explorer.clearSearchCache()
|
||||
|
||||
Clears the cache used in [`search()`].
|
||||
|
||||
### explorer.clearCaches()
|
||||
|
||||
Performs both [`clearLoadCache()`] and [`clearSearchCache()`].
|
||||
|
||||
## Synchronous API
|
||||
|
||||
### cosmiconfigSync()
|
||||
|
||||
```js
|
||||
const { cosmiconfigSync } = require('cosmiconfig');
|
||||
const explorerSync = cosmiconfigSync(moduleName[, cosmiconfigOptions])
|
||||
```
|
||||
|
||||
Creates a *synchronous* cosmiconfig instance ("explorerSync") configured according to the arguments, and initializes its caches.
|
||||
|
||||
See [`cosmiconfig()`](#cosmiconfig-1).
|
||||
|
||||
### explorerSync.search()
|
||||
|
||||
```js
|
||||
const result = explorerSync.search([searchFrom]);
|
||||
```
|
||||
|
||||
Synchronous version of [`explorer.search()`].
|
||||
|
||||
Returns a [result] or `null`.
|
||||
|
||||
### explorerSync.load()
|
||||
|
||||
```js
|
||||
const result = explorerSync.load(loadPath);
|
||||
```
|
||||
|
||||
Synchronous version of [`explorer.load()`].
|
||||
|
||||
Returns a [result].
|
||||
|
||||
### explorerSync.clearLoadCache()
|
||||
|
||||
Clears the cache used in [`load()`].
|
||||
|
||||
### explorerSync.clearSearchCache()
|
||||
|
||||
Clears the cache used in [`search()`].
|
||||
|
||||
### explorerSync.clearCaches()
|
||||
|
||||
Performs both [`clearLoadCache()`] and [`clearSearchCache()`].
|
||||
|
||||
## cosmiconfigOptions
|
||||
|
||||
Type: `Object`.
|
||||
|
||||
Possible options are documented below.
|
||||
|
||||
### searchPlaces
|
||||
|
||||
Type: `Array<string>`.
|
||||
Default: See below.
|
||||
|
||||
An array of places that [`search()`] will check in each directory as it moves up the directory tree.
|
||||
Each place is relative to the directory being searched, and the places are checked in the specified order.
|
||||
|
||||
**Default `searchPlaces`:**
|
||||
|
||||
```js
|
||||
[
|
||||
'package.json',
|
||||
`.${moduleName}rc`,
|
||||
`.${moduleName}rc.json`,
|
||||
`.${moduleName}rc.yaml`,
|
||||
`.${moduleName}rc.yml`,
|
||||
`.${moduleName}rc.js`,
|
||||
`.${moduleName}rc.cjs`,
|
||||
`.config/${moduleName}rc`,
|
||||
`.config/${moduleName}rc.json`,
|
||||
`.config/${moduleName}rc.yaml`,
|
||||
`.config/${moduleName}rc.yml`,
|
||||
`.config/${moduleName}rc.js`,
|
||||
`.config/${moduleName}rc.cjs`,
|
||||
`${moduleName}.config.js`,
|
||||
`${moduleName}.config.cjs`,
|
||||
]
|
||||
```
|
||||
|
||||
Create your own array to search more, fewer, or altogether different places.
|
||||
|
||||
Every item in `searchPlaces` needs to have a loader in [`loaders`] that corresponds to its extension.
|
||||
(Common extensions are covered by default loaders.)
|
||||
Read more about [`loaders`] below.
|
||||
|
||||
`package.json` is a special value: When it is included in `searchPlaces`, Cosmiconfig will always parse it as JSON and load a property within it, not the whole file.
|
||||
That property is defined with the [`packageProp`] option, and defaults to your module name.
|
||||
|
||||
Examples, with a module named `porgy`:
|
||||
|
||||
```js
|
||||
// Disallow extensions on rc files:
|
||||
[
|
||||
'package.json',
|
||||
'.porgyrc',
|
||||
'porgy.config.js'
|
||||
]
|
||||
|
||||
// ESLint searches for configuration in these places:
|
||||
[
|
||||
'.eslintrc.js',
|
||||
'.eslintrc.yaml',
|
||||
'.eslintrc.yml',
|
||||
'.eslintrc.json',
|
||||
'.eslintrc',
|
||||
'package.json'
|
||||
]
|
||||
|
||||
// Babel looks in fewer places:
|
||||
[
|
||||
'package.json',
|
||||
'.babelrc'
|
||||
]
|
||||
|
||||
// Maybe you want to look for a wide variety of JS flavors:
|
||||
[
|
||||
'porgy.config.js',
|
||||
'porgy.config.mjs',
|
||||
'porgy.config.ts',
|
||||
'porgy.config.coffee'
|
||||
]
|
||||
// ^^ You will need to designate custom loaders to tell
|
||||
// Cosmiconfig how to handle these special JS flavors.
|
||||
|
||||
// Look within a .config/ subdirectory of every searched directory:
|
||||
[
|
||||
'package.json',
|
||||
'.porgyrc',
|
||||
'.config/.porgyrc',
|
||||
'.porgyrc.json',
|
||||
'.config/.porgyrc.json'
|
||||
]
|
||||
```
|
||||
|
||||
### loaders
|
||||
|
||||
Type: `Object`.
|
||||
Default: See below.
|
||||
|
||||
An object that maps extensions to the loader functions responsible for loading and parsing files with those extensions.
|
||||
|
||||
Cosmiconfig exposes its default loaders on a named export `defaultLoaders`.
|
||||
|
||||
**Default `loaders`:**
|
||||
|
||||
```js
|
||||
const { defaultLoaders } = require('cosmiconfig');
|
||||
|
||||
console.log(Object.entries(defaultLoaders))
|
||||
// [
|
||||
// [ '.cjs', [Function: loadJs] ],
|
||||
// [ '.js', [Function: loadJs] ],
|
||||
// [ '.json', [Function: loadJson] ],
|
||||
// [ '.yaml', [Function: loadYaml] ],
|
||||
// [ '.yml', [Function: loadYaml] ],
|
||||
// [ 'noExt', [Function: loadYaml] ]
|
||||
// ]
|
||||
```
|
||||
|
||||
(YAML is a superset of JSON; which means YAML parsers can parse JSON; which is how extensionless files can be either YAML *or* JSON with only one parser.)
|
||||
|
||||
**If you provide a `loaders` object, your object will be *merged* with the defaults.**
|
||||
So you can override one or two without having to override them all.
|
||||
|
||||
**Keys in `loaders`** are extensions (starting with a period), or `noExt` to specify the loader for files *without* extensions, like `.myapprc`.
|
||||
|
||||
**Values in `loaders`** are a loader function (described below) whose values are loader functions.
|
||||
|
||||
**The most common use case for custom loaders value is to load extensionless `rc` files as strict JSON**, instead of JSON *or* YAML (the default).
|
||||
To accomplish that, provide the following `loaders` value:
|
||||
|
||||
```js
|
||||
{
|
||||
noExt: defaultLoaders['.json']
|
||||
}
|
||||
```
|
||||
|
||||
If you want to load files that are not handled by the loader functions Cosmiconfig exposes, you can write a custom loader function or use one from NPM if it exists.
|
||||
|
||||
**Third-party loaders:**
|
||||
|
||||
- [cosmiconfig-typescript-loader](https://github.com/codex-/cosmiconfig-typescript-loader)
|
||||
|
||||
**Use cases for custom loader function:**
|
||||
|
||||
- Allow configuration syntaxes that aren't handled by Cosmiconfig's defaults, like JSON5, INI, or XML.
|
||||
- Allow ES2015 modules from `.mjs` configuration files.
|
||||
- Parse JS files with Babel before deriving the configuration.
|
||||
|
||||
**Custom loader functions** have the following signature:
|
||||
|
||||
```js
|
||||
// Sync
|
||||
(filepath: string, content: string) => Object | null
|
||||
|
||||
// Async
|
||||
(filepath: string, content: string) => Object | null | Promise<Object | null>
|
||||
```
|
||||
|
||||
Cosmiconfig reads the file when it checks whether the file exists, so it will provide you with both the file's path and its content.
|
||||
Do whatever you need to, and return either a configuration object or `null` (or, for async-only loaders, a Promise that resolves with one of those).
|
||||
`null` indicates that no real configuration was found and the search should continue.
|
||||
|
||||
A few things to note:
|
||||
|
||||
- If you use a custom loader, be aware of whether it's sync or async: you cannot use async customer loaders with the sync API ([`cosmiconfigSync()`]).
|
||||
- **Special JS syntax can also be handled by using a `require` hook**, because `defaultLoaders['.js']` just uses `require`.
|
||||
Whether you use custom loaders or a `require` hook is up to you.
|
||||
|
||||
Examples:
|
||||
|
||||
```js
|
||||
// Allow JSON5 syntax:
|
||||
{
|
||||
'.json': json5Loader
|
||||
}
|
||||
|
||||
// Allow a special configuration syntax of your own creation:
|
||||
{
|
||||
'.special': specialLoader
|
||||
}
|
||||
|
||||
// Allow many flavors of JS, using custom loaders:
|
||||
{
|
||||
'.mjs': esmLoader,
|
||||
'.ts': typeScriptLoader,
|
||||
'.coffee': coffeeScriptLoader
|
||||
}
|
||||
|
||||
// Allow many flavors of JS but rely on require hooks:
|
||||
{
|
||||
'.mjs': defaultLoaders['.js'],
|
||||
'.ts': defaultLoaders['.js'],
|
||||
'.coffee': defaultLoaders['.js']
|
||||
}
|
||||
```
|
||||
|
||||
### packageProp
|
||||
|
||||
Type: `string | Array<string>`.
|
||||
Default: `` `${moduleName}` ``.
|
||||
|
||||
Name of the property in `package.json` to look for.
|
||||
|
||||
Use a period-delimited string or an array of strings to describe a path to nested properties.
|
||||
|
||||
For example, the value `'configs.myPackage'` or `['configs', 'myPackage']` will get you the `"myPackage"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"configs": {
|
||||
"myPackage": {..}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If nested property names within the path include periods, you need to use an array of strings. For example, the value `['configs', 'foo.bar', 'baz']` will get you the `"baz"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"configs": {
|
||||
"foo.bar": {
|
||||
"baz": {..}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If a string includes period but corresponds to a top-level property name, it will not be interpreted as a period-delimited path. For example, the value `'one.two'` will get you the `"three"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"one.two": "three",
|
||||
"one": {
|
||||
"two": "four"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### stopDir
|
||||
|
||||
Type: `string`.
|
||||
Default: Absolute path to your home directory.
|
||||
|
||||
Directory where the search will stop.
|
||||
|
||||
### cache
|
||||
|
||||
Type: `boolean`.
|
||||
Default: `true`.
|
||||
|
||||
If `false`, no caches will be used.
|
||||
Read more about ["Caching"](#caching) below.
|
||||
|
||||
### transform
|
||||
|
||||
Type: `(Result) => Promise<Result> | Result`.
|
||||
|
||||
A function that transforms the parsed configuration. Receives the [result].
|
||||
|
||||
If using [`search()`] or [`load()`] \(which are async), the transform function can return the transformed result or return a Promise that resolves with the transformed result.
|
||||
If using `cosmiconfigSync`, [`search()`] or [`load()`], the function must be synchronous and return the transformed result.
|
||||
|
||||
The reason you might use this option — instead of simply applying your transform function some other way — is that *the transformed result will be cached*. If your transformation involves additional filesystem I/O or other potentially slow processing, you can use this option to avoid repeating those steps every time a given configuration is searched or loaded.
|
||||
|
||||
### ignoreEmptySearchPlaces
|
||||
|
||||
Type: `boolean`.
|
||||
Default: `true`.
|
||||
|
||||
By default, if [`search()`] encounters an empty file (containing nothing but whitespace) in one of the [`searchPlaces`], it will ignore the empty file and move on.
|
||||
If you'd like to load empty configuration files, instead, set this option to `false`.
|
||||
|
||||
Why might you want to load empty configuration files?
|
||||
If you want to throw an error, or if an empty configuration file means something to your program.
|
||||
|
||||
## Caching
|
||||
|
||||
As of v2, cosmiconfig uses caching to reduce the need for repetitious reading of the filesystem or expensive transforms. Every new cosmiconfig instance (created with `cosmiconfig()`) has its own caches.
|
||||
|
||||
To avoid or work around caching, you can do the following:
|
||||
|
||||
- Set the `cosmiconfig` option [`cache`] to `false`.
|
||||
- Use the cache-clearing methods [`clearLoadCache()`], [`clearSearchCache()`], and [`clearCaches()`].
|
||||
- Create separate instances of cosmiconfig (separate "explorers").
|
||||
|
||||
## Differences from [rc](https://github.com/dominictarr/rc)
|
||||
|
||||
[rc](https://github.com/dominictarr/rc) serves its focused purpose well. cosmiconfig differs in a few key ways — making it more useful for some projects, less useful for others:
|
||||
|
||||
- Looks for configuration in some different places: in a `package.json` property, an rc file, a `.config.js` file, and rc files with extensions.
|
||||
- Built-in support for JSON, YAML, and CommonJS formats.
|
||||
- Stops at the first configuration found, instead of finding all that can be found up the directory tree and merging them automatically.
|
||||
- Options.
|
||||
- Asynchronous by default (though can be run synchronously).
|
||||
|
||||
## Contributing & Development
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
And please do participate!
|
||||
|
||||
[result]: #result
|
||||
|
||||
[`load()`]: #explorerload
|
||||
|
||||
[`search()`]: #explorersearch
|
||||
|
||||
[`clearloadcache()`]: #explorerclearloadcache
|
||||
|
||||
[`clearsearchcache()`]: #explorerclearsearchcache
|
||||
|
||||
[`cosmiconfig()`]: #cosmiconfig
|
||||
|
||||
[`cosmiconfigSync()`]: #cosmiconfigsync
|
||||
|
||||
[`clearcaches()`]: #explorerclearcaches
|
||||
|
||||
[`packageprop`]: #packageprop
|
||||
|
||||
[`cache`]: #cache
|
||||
|
||||
[`stopdir`]: #stopdir
|
||||
|
||||
[`searchplaces`]: #searchplaces
|
||||
|
||||
[`loaders`]: #loaders
|
||||
|
||||
[`cosmiconfigoptions`]: #cosmiconfigoptions
|
||||
|
||||
[`explorerSync.search()`]: #explorersyncsearch
|
||||
|
||||
[`explorerSync.load()`]: #explorersyncload
|
||||
|
||||
[`explorer.search()`]: #explorersearch
|
||||
|
||||
[`explorer.load()`]: #explorerload
|
||||
130
node_modules/cross-spawn/CHANGELOG.md
generated
vendored
130
node_modules/cross-spawn/CHANGELOG.md
generated
vendored
@@ -1,130 +0,0 @@
|
||||
# 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.
|
||||
|
||||
### [7.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.2...v7.0.3) (2020-05-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* detect path key based on correct environment ([#133](https://github.com/moxystudio/node-cross-spawn/issues/133)) ([159e7e9](https://github.com/moxystudio/node-cross-spawn/commit/159e7e9785e57451cba034ae51719f97135074ae))
|
||||
|
||||
### [7.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.1...v7.0.2) (2020-04-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix worker threads in Node >=11.10.0 ([#132](https://github.com/moxystudio/node-cross-spawn/issues/132)) ([6c5b4f0](https://github.com/moxystudio/node-cross-spawn/commit/6c5b4f015814a6c4f6b33230dfd1a860aedc0aaf))
|
||||
|
||||
### [7.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.0...v7.0.1) (2019-10-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** support worker threads ([#127](https://github.com/moxystudio/node-cross-spawn/issues/127)) ([cfd49c9](https://github.com/moxystudio/node-cross-spawn/commit/cfd49c9))
|
||||
|
||||
## [7.0.0](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.0) (2019-09-03)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* drop support for Node.js < 8
|
||||
|
||||
* drop support for versions below Node.js 8 ([#125](https://github.com/moxystudio/node-cross-spawn/issues/125)) ([16feb53](https://github.com/moxystudio/node-cross-spawn/commit/16feb53))
|
||||
|
||||
<a name="6.0.5"></a>
|
||||
## [6.0.5](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.4...v6.0.5) (2018-03-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* avoid using deprecated Buffer constructor ([#94](https://github.com/moxystudio/node-cross-spawn/issues/94)) ([d5770df](https://github.com/moxystudio/node-cross-spawn/commit/d5770df)), closes [/nodejs.org/api/deprecations.html#deprecations_dep0005](https://github.com//nodejs.org/api/deprecations.html/issues/deprecations_dep0005)
|
||||
|
||||
|
||||
|
||||
<a name="6.0.4"></a>
|
||||
## [6.0.4](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.3...v6.0.4) (2018-01-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix paths being incorrectly normalized on unix ([06ee3c6](https://github.com/moxystudio/node-cross-spawn/commit/06ee3c6)), closes [#90](https://github.com/moxystudio/node-cross-spawn/issues/90)
|
||||
|
||||
|
||||
|
||||
<a name="6.0.3"></a>
|
||||
## [6.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.2...v6.0.3) (2018-01-23)
|
||||
|
||||
|
||||
|
||||
<a name="6.0.2"></a>
|
||||
## [6.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.1...v6.0.2) (2018-01-23)
|
||||
|
||||
|
||||
|
||||
<a name="6.0.1"></a>
|
||||
## [6.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.0...v6.0.1) (2018-01-23)
|
||||
|
||||
|
||||
|
||||
<a name="6.0.0"></a>
|
||||
# [6.0.0](https://github.com/moxystudio/node-cross-spawn/compare/5.1.0...6.0.0) (2018-01-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix certain arguments not being correctly escaped or causing batch syntax error ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)), closes [#82](https://github.com/moxystudio/node-cross-spawn/issues/82) [#51](https://github.com/moxystudio/node-cross-spawn/issues/51)
|
||||
* fix commands as posix relatixe paths not working correctly, e.g.: `./my-command` ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
|
||||
* fix `options` argument being mutated ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
|
||||
* fix commands resolution when PATH was actually Path ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* improve compliance with node's ENOENT errors ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
|
||||
* improve detection of node's shell option support ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* upgrade tooling
|
||||
* upgrate project to es6 (node v4)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* remove support for older nodejs versions, only `node >= 4` is supported
|
||||
|
||||
|
||||
<a name="5.1.0"></a>
|
||||
## [5.1.0](https://github.com/moxystudio/node-cross-spawn/compare/5.0.1...5.1.0) (2017-02-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix `options.shell` support for NodeJS [v4.8](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.8.0)
|
||||
|
||||
|
||||
<a name="5.0.1"></a>
|
||||
## [5.0.1](https://github.com/moxystudio/node-cross-spawn/compare/5.0.0...5.0.1) (2016-11-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix `options.shell` support for NodeJS v7
|
||||
|
||||
|
||||
<a name="5.0.0"></a>
|
||||
# [5.0.0](https://github.com/moxystudio/node-cross-spawn/compare/4.0.2...5.0.0) (2016-10-30)
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
* add support for `options.shell`
|
||||
* improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module
|
||||
|
||||
|
||||
## Chores
|
||||
|
||||
* refactor some code to make it more clear
|
||||
* update README caveats
|
||||
96
node_modules/cross-spawn/README.md
generated
vendored
96
node_modules/cross-spawn/README.md
generated
vendored
@@ -1,96 +0,0 @@
|
||||
# cross-spawn
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]
|
||||
|
||||
[npm-url]:https://npmjs.org/package/cross-spawn
|
||||
[downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg
|
||||
[npm-image]:https://img.shields.io/npm/v/cross-spawn.svg
|
||||
[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn
|
||||
[travis-image]:https://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg
|
||||
[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn
|
||||
[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg
|
||||
[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn
|
||||
[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg
|
||||
[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn
|
||||
[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg
|
||||
[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev
|
||||
[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg
|
||||
|
||||
A cross platform solution to node's spawn and spawnSync.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Node.js version 8 and up:
|
||||
`$ npm install cross-spawn`
|
||||
|
||||
Node.js version 7 and under:
|
||||
`$ npm install cross-spawn@6`
|
||||
|
||||
## Why
|
||||
|
||||
Node has issues when using spawn on Windows:
|
||||
|
||||
- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318)
|
||||
- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix))
|
||||
- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367)
|
||||
- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`)
|
||||
- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149)
|
||||
- No `options.shell` support on node `<v4.8`
|
||||
|
||||
All these issues are handled correctly by `cross-spawn`.
|
||||
There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement.
|
||||
|
||||
|
||||
```js
|
||||
const spawn = require('cross-spawn');
|
||||
|
||||
// Spawn NPM asynchronously
|
||||
const child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
|
||||
|
||||
// Spawn NPM synchronously
|
||||
const result = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
|
||||
```
|
||||
|
||||
|
||||
## Caveats
|
||||
|
||||
### Using `options.shell` as an alternative to `cross-spawn`
|
||||
|
||||
Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves
|
||||
the [PATHEXT](https://github.com/joyent/node/issues/2318) issue but:
|
||||
|
||||
- It's not supported in node `<v4.8`
|
||||
- You must manually escape the command and arguments which is very error prone, specially when passing user input
|
||||
- There are a lot of other unresolved issues from the [Why](#why) section that you must take into account
|
||||
|
||||
If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned.
|
||||
|
||||
### `options.shell` support
|
||||
|
||||
While `cross-spawn` adds support for `options.shell` in node `<v4.8`, all of its enhancements are disabled.
|
||||
|
||||
This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way.
|
||||
|
||||
### Shebangs support
|
||||
|
||||
While `cross-spawn` handles shebangs on Windows, its support is limited. More specifically, it just supports `#!/usr/bin/env <program>` where `<program>` must not contain any arguments.
|
||||
If you would like to have the shebang support improved, feel free to contribute via a pull-request.
|
||||
|
||||
Remember to always test your code on Windows!
|
||||
|
||||
|
||||
## Tests
|
||||
|
||||
`$ npm test`
|
||||
`$ npm test -- --watch` during development
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php).
|
||||
51
node_modules/crypto-random-string/readme.md
generated
vendored
51
node_modules/crypto-random-string/readme.md
generated
vendored
@@ -1,51 +0,0 @@
|
||||
# crypto-random-string [](https://travis-ci.org/sindresorhus/crypto-random-string)
|
||||
|
||||
> Generate a [cryptographically strong](https://en.m.wikipedia.org/wiki/Strong_cryptography) random string
|
||||
|
||||
Can be useful for creating an identifier, slug, salt, fixture, etc.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install crypto-random-string
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const cryptoRandomString = require('crypto-random-string');
|
||||
|
||||
cryptoRandomString(10);
|
||||
//=> '2cf05d94db'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### cryptoRandomString(length)
|
||||
|
||||
Returns a [`hex`](https://en.wikipedia.org/wiki/Hexadecimal) string.
|
||||
|
||||
#### length
|
||||
|
||||
Type: `number`
|
||||
|
||||
Length of the returned string.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer
|
||||
- [random-float](https://github.com/sindresorhus/random-float) - Generate a random float
|
||||
- [random-item](https://github.com/sindresorhus/random-item) - Get a random item from an array
|
||||
- [random-boolean](https://github.com/arthurvr/random-boolean) - Get a random boolean
|
||||
- [random-obj-key](https://github.com/sindresorhus/random-obj-key) - Get a random key from an object
|
||||
- [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object
|
||||
- [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
162
node_modules/dateformat/Readme.md
generated
vendored
162
node_modules/dateformat/Readme.md
generated
vendored
@@ -1,162 +0,0 @@
|
||||
# dateformat
|
||||
|
||||
A node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.
|
||||
|
||||
[](https://travis-ci.org/felixge/node-dateformat)
|
||||
|
||||
## Modifications
|
||||
|
||||
* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.
|
||||
* Added a `module.exports = dateFormat;` statement at the bottom
|
||||
* Added the placeholder `N` to get the ISO 8601 numeric representation of the day of the week
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install dateformat
|
||||
$ dateformat --help
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
As taken from Steven's post, modified to match the Modifications listed above:
|
||||
```js
|
||||
var dateFormat = require('dateformat');
|
||||
var now = new Date();
|
||||
|
||||
// Basic usage
|
||||
dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT");
|
||||
// Saturday, June 9th, 2007, 5:46:21 PM
|
||||
|
||||
// You can use one of several named masks
|
||||
dateFormat(now, "isoDateTime");
|
||||
// 2007-06-09T17:46:21
|
||||
|
||||
// ...Or add your own
|
||||
dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"';
|
||||
dateFormat(now, "hammerTime");
|
||||
// 17:46! Can't touch this!
|
||||
|
||||
// You can also provide the date as a string
|
||||
dateFormat("Jun 9 2007", "fullDate");
|
||||
// Saturday, June 9, 2007
|
||||
|
||||
// Note that if you don't include the mask argument,
|
||||
// dateFormat.masks.default is used
|
||||
dateFormat(now);
|
||||
// Sat Jun 09 2007 17:46:21
|
||||
|
||||
// And if you don't include the date argument,
|
||||
// the current date and time is used
|
||||
dateFormat();
|
||||
// Sat Jun 09 2007 17:46:22
|
||||
|
||||
// You can also skip the date argument (as long as your mask doesn't
|
||||
// contain any numbers), in which case the current date/time is used
|
||||
dateFormat("longTime");
|
||||
// 5:46:22 PM EST
|
||||
|
||||
// And finally, you can convert local time to UTC time. Simply pass in
|
||||
// true as an additional argument (no argument skipping allowed in this case):
|
||||
dateFormat(now, "longTime", true);
|
||||
// 10:46:21 PM UTC
|
||||
|
||||
// ...Or add the prefix "UTC:" or "GMT:" to your mask.
|
||||
dateFormat(now, "UTC:h:MM:ss TT Z");
|
||||
// 10:46:21 PM UTC
|
||||
|
||||
// You can also get the ISO 8601 week of the year:
|
||||
dateFormat(now, "W");
|
||||
// 42
|
||||
|
||||
// and also get the ISO 8601 numeric representation of the day of the week:
|
||||
dateFormat(now,"N");
|
||||
// 6
|
||||
```
|
||||
|
||||
### Mask options
|
||||
|
||||
Mask | Description
|
||||
---- | -----------
|
||||
`d` | Day of the month as digits; no leading zero for single-digit days.
|
||||
`dd` | Day of the month as digits; leading zero for single-digit days.
|
||||
`ddd` | Day of the week as a three-letter abbreviation.
|
||||
`dddd` | Day of the week as its full name.
|
||||
`m` | Month as digits; no leading zero for single-digit months.
|
||||
`mm` | Month as digits; leading zero for single-digit months.
|
||||
`mmm` | Month as a three-letter abbreviation.
|
||||
`mmmm` | Month as its full name.
|
||||
`yy` | Year as last two digits; leading zero for years less than 10.
|
||||
`yyyy` | Year represented by four digits.
|
||||
`h` | Hours; no leading zero for single-digit hours (12-hour clock).
|
||||
`hh` | Hours; leading zero for single-digit hours (12-hour clock).
|
||||
`H` | Hours; no leading zero for single-digit hours (24-hour clock).
|
||||
`HH` | Hours; leading zero for single-digit hours (24-hour clock).
|
||||
`M` | Minutes; no leading zero for single-digit minutes.
|
||||
`MM` | Minutes; leading zero for single-digit minutes.
|
||||
`N` | ISO 8601 numeric representation of the day of the week.
|
||||
`o` | GMT/UTC timezone offset, e.g. -0500 or +0230.
|
||||
`s` | Seconds; no leading zero for single-digit seconds.
|
||||
`ss` | Seconds; leading zero for single-digit seconds.
|
||||
`S` | The date's ordinal suffix (st, nd, rd, or th). Works well with `d`.
|
||||
`l` | Milliseconds; gives 3 digits.
|
||||
`L` | Milliseconds; gives 2 digits.
|
||||
`t` | Lowercase, single-character time marker string: a or p.
|
||||
`tt` | Lowercase, two-character time marker string: am or pm.
|
||||
`T` | Uppercase, single-character time marker string: A or P.
|
||||
`TT` | Uppercase, two-character time marker string: AM or PM.
|
||||
`W` | ISO 8601 week number of the year, e.g. 42
|
||||
`Z` | US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the
|
||||
`'...'`, `"..."` | Literal character sequence. Surrounding quotes are removed.
|
||||
`UTC:` | Must be the first four characters of the mask. Converts the date from local time to UTC/GMT/Zulu time before applying the mask. The "UTC:" prefix is removed.
|
||||
|
||||
### Named Formats
|
||||
|
||||
Name | Mask | Example
|
||||
---- | ---- | -------
|
||||
`default` | `ddd mmm dd yyyy HH:MM:ss` | Sat Jun 09 2007 17:46:21
|
||||
`shortDate` | `m/d/yy` | 6/9/07
|
||||
`mediumDate` | `mmm d, yyyy` | Jun 9, 2007
|
||||
`longDate` | `mmmm d, yyyy` | June 9, 2007
|
||||
`fullDate` | `dddd, mmmm d, yyyy` | Saturday, June 9, 2007
|
||||
`shortTime` | `h:MM TT` | 5:46 PM
|
||||
`mediumTime` | `h:MM:ss TT` | 5:46:21 PM
|
||||
`longTime` | `h:MM:ss TT Z` | 5:46:21 PM EST
|
||||
`isoDate` | `yyyy-mm-dd` | 2007-06-09
|
||||
`isoTime` | `HH:MM:ss` | 17:46:21
|
||||
`isoDateTime` | `yyyy-mm-dd'T'HH:MM:ss` | 2007-06-09T17:46:21
|
||||
`isoUtcDateTime` | `UTC:yyyy-mm-dd'T'HH:MM:ss'Z'` | 2007-06-09T22:46:21Z
|
||||
|
||||
### Localization
|
||||
Day names, month names and the AM/PM indicators can be localized by
|
||||
passing an object with the necessary strings. For example:
|
||||
```js
|
||||
var dateFormat = require('dateformat');
|
||||
dateFormat.i18n = {
|
||||
dayNames: [
|
||||
'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
|
||||
'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
||||
],
|
||||
monthNames: [
|
||||
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
|
||||
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
|
||||
],
|
||||
timeNames: [
|
||||
'a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM'
|
||||
]
|
||||
};
|
||||
```
|
||||
> Notice that only one language is supported at a time and all strings
|
||||
> *must* be present in the new value.
|
||||
|
||||
### Breaking change in 2.1.0
|
||||
- 2.1.0 was published with a breaking change, for those using localized strings.
|
||||
- 2.2.0 has been published without the change, to keep packages refering to ^2.0.0 to continue working. This is now branch v2_2.
|
||||
- 3.0.* contains the localized AM/PM change.
|
||||
|
||||
## License
|
||||
|
||||
(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.
|
||||
|
||||
[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format
|
||||
[stevenlevithan]: http://stevenlevithan.com/
|
||||
481
node_modules/debug/README.md
generated
vendored
481
node_modules/debug/README.md
generated
vendored
@@ -1,481 +0,0 @@
|
||||
# debug
|
||||
[](https://travis-ci.org/debug-js/debug) [](https://coveralls.io/github/debug-js/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
|
||||
|
||||
A tiny JavaScript debugging utility modelled after Node.js core's debugging
|
||||
technique. Works in Node.js and web browsers.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install debug
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
|
||||
|
||||
Example [_app.js_](./examples/node/app.js):
|
||||
|
||||
```js
|
||||
var debug = require('debug')('http')
|
||||
, http = require('http')
|
||||
, name = 'My App';
|
||||
|
||||
// fake app
|
||||
|
||||
debug('booting %o', name);
|
||||
|
||||
http.createServer(function(req, res){
|
||||
debug(req.method + ' ' + req.url);
|
||||
res.end('hello\n');
|
||||
}).listen(3000, function(){
|
||||
debug('listening');
|
||||
});
|
||||
|
||||
// fake worker of some kind
|
||||
|
||||
require('./worker');
|
||||
```
|
||||
|
||||
Example [_worker.js_](./examples/node/worker.js):
|
||||
|
||||
```js
|
||||
var a = require('debug')('worker:a')
|
||||
, b = require('debug')('worker:b');
|
||||
|
||||
function work() {
|
||||
a('doing lots of uninteresting work');
|
||||
setTimeout(work, Math.random() * 1000);
|
||||
}
|
||||
|
||||
work();
|
||||
|
||||
function workb() {
|
||||
b('doing some work');
|
||||
setTimeout(workb, Math.random() * 2000);
|
||||
}
|
||||
|
||||
workb();
|
||||
```
|
||||
|
||||
The `DEBUG` environment variable is then used to enable these based on space or
|
||||
comma-delimited names.
|
||||
|
||||
Here are some examples:
|
||||
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
|
||||
|
||||
#### Windows command prompt notes
|
||||
|
||||
##### CMD
|
||||
|
||||
On Windows the environment variable is set using the `set` command.
|
||||
|
||||
```cmd
|
||||
set DEBUG=*,-not_this
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```cmd
|
||||
set DEBUG=* & node app.js
|
||||
```
|
||||
|
||||
##### PowerShell (VS Code default)
|
||||
|
||||
PowerShell uses different syntax to set environment variables.
|
||||
|
||||
```cmd
|
||||
$env:DEBUG = "*,-not_this"
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```cmd
|
||||
$env:DEBUG='app';node app.js
|
||||
```
|
||||
|
||||
Then, run the program to be debugged as usual.
|
||||
|
||||
npm script example:
|
||||
```js
|
||||
"windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
|
||||
```
|
||||
|
||||
## Namespace Colors
|
||||
|
||||
Every debug instance has a color generated for it based on its namespace name.
|
||||
This helps when visually parsing the debug output to identify which debug instance
|
||||
a debug line belongs to.
|
||||
|
||||
#### Node.js
|
||||
|
||||
In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
|
||||
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
|
||||
otherwise debug will only use a small handful of basic colors.
|
||||
|
||||
<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
|
||||
|
||||
#### Web Browser
|
||||
|
||||
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
|
||||
option. These are WebKit web inspectors, Firefox ([since version
|
||||
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
|
||||
and the Firebug plugin for Firefox (any version).
|
||||
|
||||
<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
|
||||
|
||||
|
||||
## Millisecond diff
|
||||
|
||||
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
|
||||
|
||||
When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
|
||||
|
||||
|
||||
## Conventions
|
||||
|
||||
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
|
||||
|
||||
## Wildcards
|
||||
|
||||
The `*` character may be used as a wildcard. Suppose for example your library has
|
||||
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
|
||||
instead of listing all three with
|
||||
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
|
||||
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
|
||||
|
||||
You can also exclude specific debuggers by prefixing them with a "-" character.
|
||||
For example, `DEBUG=*,-connect:*` would include all debuggers except those
|
||||
starting with "connect:".
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When running through Node.js, you can set a few environment variables that will
|
||||
change the behavior of the debug logging:
|
||||
|
||||
| Name | Purpose |
|
||||
|-----------|-------------------------------------------------|
|
||||
| `DEBUG` | Enables/disables specific debugging namespaces. |
|
||||
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
|
||||
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
|
||||
| `DEBUG_DEPTH` | Object inspection depth. |
|
||||
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
|
||||
|
||||
|
||||
__Note:__ The environment variables beginning with `DEBUG_` end up being
|
||||
converted into an Options object that gets used with `%o`/`%O` formatters.
|
||||
See the Node.js documentation for
|
||||
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
|
||||
for the complete list.
|
||||
|
||||
## Formatters
|
||||
|
||||
Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
|
||||
Below are the officially supported formatters:
|
||||
|
||||
| Formatter | Representation |
|
||||
|-----------|----------------|
|
||||
| `%O` | Pretty-print an Object on multiple lines. |
|
||||
| `%o` | Pretty-print an Object all on a single line. |
|
||||
| `%s` | String. |
|
||||
| `%d` | Number (both integer and float). |
|
||||
| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
|
||||
| `%%` | Single percent sign ('%'). This does not consume an argument. |
|
||||
|
||||
|
||||
### Custom formatters
|
||||
|
||||
You can add custom formatters by extending the `debug.formatters` object.
|
||||
For example, if you wanted to add support for rendering a Buffer as hex with
|
||||
`%h`, you could do something like:
|
||||
|
||||
```js
|
||||
const createDebug = require('debug')
|
||||
createDebug.formatters.h = (v) => {
|
||||
return v.toString('hex')
|
||||
}
|
||||
|
||||
// …elsewhere
|
||||
const debug = createDebug('foo')
|
||||
debug('this is hex: %h', new Buffer('hello world'))
|
||||
// foo this is hex: 68656c6c6f20776f726c6421 +0ms
|
||||
```
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
|
||||
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
|
||||
if you don't want to build it yourself.
|
||||
|
||||
Debug's enable state is currently persisted by `localStorage`.
|
||||
Consider the situation shown below where you have `worker:a` and `worker:b`,
|
||||
and wish to debug both. You can enable this using `localStorage.debug`:
|
||||
|
||||
```js
|
||||
localStorage.debug = 'worker:*'
|
||||
```
|
||||
|
||||
And then refresh the page.
|
||||
|
||||
```js
|
||||
a = debug('worker:a');
|
||||
b = debug('worker:b');
|
||||
|
||||
setInterval(function(){
|
||||
a('doing some work');
|
||||
}, 1000);
|
||||
|
||||
setInterval(function(){
|
||||
b('doing some work');
|
||||
}, 1200);
|
||||
```
|
||||
|
||||
In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
|
||||
|
||||
## Output streams
|
||||
|
||||
By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
|
||||
|
||||
Example [_stdout.js_](./examples/node/stdout.js):
|
||||
|
||||
```js
|
||||
var debug = require('debug');
|
||||
var error = debug('app:error');
|
||||
|
||||
// by default stderr is used
|
||||
error('goes to stderr!');
|
||||
|
||||
var log = debug('app:log');
|
||||
// set this namespace to log via console.log
|
||||
log.log = console.log.bind(console); // don't forget to bind to console!
|
||||
log('goes to stdout');
|
||||
error('still goes to stderr!');
|
||||
|
||||
// set all output to go via console.info
|
||||
// overrides all per-namespace log settings
|
||||
debug.log = console.info.bind(console);
|
||||
error('now goes to stdout via console.info');
|
||||
log('still goes to stdout, but via console.info now');
|
||||
```
|
||||
|
||||
## Extend
|
||||
You can simply extend debugger
|
||||
```js
|
||||
const log = require('debug')('auth');
|
||||
|
||||
//creates new debug instance with extended namespace
|
||||
const logSign = log.extend('sign');
|
||||
const logLogin = log.extend('login');
|
||||
|
||||
log('hello'); // auth hello
|
||||
logSign('hello'); //auth:sign hello
|
||||
logLogin('hello'); //auth:login hello
|
||||
```
|
||||
|
||||
## Set dynamically
|
||||
|
||||
You can also enable debug dynamically by calling the `enable()` method :
|
||||
|
||||
```js
|
||||
let debug = require('debug');
|
||||
|
||||
console.log(1, debug.enabled('test'));
|
||||
|
||||
debug.enable('test');
|
||||
console.log(2, debug.enabled('test'));
|
||||
|
||||
debug.disable();
|
||||
console.log(3, debug.enabled('test'));
|
||||
|
||||
```
|
||||
|
||||
print :
|
||||
```
|
||||
1 false
|
||||
2 true
|
||||
3 false
|
||||
```
|
||||
|
||||
Usage :
|
||||
`enable(namespaces)`
|
||||
`namespaces` can include modes separated by a colon and wildcards.
|
||||
|
||||
Note that calling `enable()` completely overrides previously set DEBUG variable :
|
||||
|
||||
```
|
||||
$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
|
||||
=> false
|
||||
```
|
||||
|
||||
`disable()`
|
||||
|
||||
Will disable all namespaces. The functions returns the namespaces currently
|
||||
enabled (and skipped). This can be useful if you want to disable debugging
|
||||
temporarily without knowing what was enabled to begin with.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
let debug = require('debug');
|
||||
debug.enable('foo:*,-foo:bar');
|
||||
let namespaces = debug.disable();
|
||||
debug.enable(namespaces);
|
||||
```
|
||||
|
||||
Note: There is no guarantee that the string will be identical to the initial
|
||||
enable string, but semantically they will be identical.
|
||||
|
||||
## Checking whether a debug target is enabled
|
||||
|
||||
After you've created a debug instance, you can determine whether or not it is
|
||||
enabled by checking the `enabled` property:
|
||||
|
||||
```javascript
|
||||
const debug = require('debug')('http');
|
||||
|
||||
if (debug.enabled) {
|
||||
// do stuff...
|
||||
}
|
||||
```
|
||||
|
||||
You can also manually toggle this property to force the debug instance to be
|
||||
enabled or disabled.
|
||||
|
||||
## Usage in child processes
|
||||
|
||||
Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
worker = fork(WORKER_WRAP_PATH, [workerPath], {
|
||||
stdio: [
|
||||
/* stdin: */ 0,
|
||||
/* stdout: */ 'pipe',
|
||||
/* stderr: */ 'pipe',
|
||||
'ipc',
|
||||
],
|
||||
env: Object.assign({}, process.env, {
|
||||
DEBUG_COLORS: 1 // without this settings, colors won't be shown
|
||||
}),
|
||||
});
|
||||
|
||||
worker.stderr.pipe(process.stderr, { end: false });
|
||||
```
|
||||
|
||||
|
||||
## Authors
|
||||
|
||||
- TJ Holowaychuk
|
||||
- Nathan Rajlich
|
||||
- Andrew Rhyne
|
||||
- Josh Junon
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
|
||||
|
||||
<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
|
||||
|
||||
|
||||
## Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
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.
|
||||
29
node_modules/decamelize-keys/node_modules/map-obj/readme.md
generated
vendored
29
node_modules/decamelize-keys/node_modules/map-obj/readme.md
generated
vendored
@@ -1,29 +0,0 @@
|
||||
# map-obj [](https://travis-ci.org/sindresorhus/map-obj)
|
||||
|
||||
> Map object keys and values into a new object
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save map-obj
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var mapObj = require('map-obj');
|
||||
|
||||
var newObject = mapObj({foo: 'bar'}, function (key, value, object) {
|
||||
// first element is the new key and second is the new value
|
||||
// here we reverse the order
|
||||
return [value, key];
|
||||
});
|
||||
//=> {bar: 'foo'}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user