mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-16 23:33:38 -05:00
chore(package): re-init package with commitizen and standard-release
This commit is contained in:
83
node_modules/listr-update-renderer/index.js
generated
vendored
Normal file
83
node_modules/listr-update-renderer/index.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
'use strict';
|
||||
const logUpdate = require('log-update');
|
||||
const chalk = require('chalk');
|
||||
const figures = require('figures');
|
||||
const indentString = require('indent-string');
|
||||
const cliTruncate = require('cli-truncate');
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const utils = require('./lib/utils');
|
||||
|
||||
const renderHelper = (tasks, options, level) => {
|
||||
level = level || 0;
|
||||
|
||||
let output = [];
|
||||
|
||||
for (const task of tasks) {
|
||||
if (task.isEnabled()) {
|
||||
const skipped = task.isSkipped() ? ` ${chalk.dim('[skipped]')}` : '';
|
||||
|
||||
output.push(indentString(` ${utils.getSymbol(task, options)} ${task.title}${skipped}`, level, ' '));
|
||||
|
||||
if ((task.isPending() || task.isSkipped() || task.hasFailed()) && utils.isDefined(task.output)) {
|
||||
let data = task.output;
|
||||
|
||||
if (typeof data === 'string') {
|
||||
data = stripAnsi(data.trim().split('\n').filter(Boolean).pop());
|
||||
|
||||
if (data === '') {
|
||||
data = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isDefined(data)) {
|
||||
const out = indentString(`${figures.arrowRight} ${data}`, level, ' ');
|
||||
output.push(` ${chalk.gray(cliTruncate(out, process.stdout.columns - 3))}`);
|
||||
}
|
||||
}
|
||||
|
||||
if ((task.isPending() || task.hasFailed() || options.collapse === false) && (task.hasFailed() || options.showSubtasks !== false) && task.subtasks.length > 0) {
|
||||
output = output.concat(renderHelper(task.subtasks, options, level + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output.join('\n');
|
||||
};
|
||||
|
||||
const render = (tasks, options) => {
|
||||
logUpdate(renderHelper(tasks, options));
|
||||
};
|
||||
|
||||
class UpdateRenderer {
|
||||
|
||||
constructor(tasks, options) {
|
||||
this._tasks = tasks;
|
||||
this._options = Object.assign({
|
||||
showSubtasks: true,
|
||||
collapse: true
|
||||
}, options);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this._id) {
|
||||
// Do not render if we are already rendering
|
||||
return;
|
||||
}
|
||||
|
||||
this._id = setInterval(() => {
|
||||
render(this._tasks, this._options);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
end() {
|
||||
if (this._id) {
|
||||
clearInterval(this._id);
|
||||
this._id = undefined;
|
||||
}
|
||||
|
||||
render(this._tasks, this._options);
|
||||
logUpdate.done();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UpdateRenderer;
|
||||
34
node_modules/listr-update-renderer/lib/utils.js
generated
vendored
Normal file
34
node_modules/listr-update-renderer/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
const chalk = require('chalk');
|
||||
const logSymbols = require('log-symbols');
|
||||
const figures = require('figures');
|
||||
const elegantSpinner = require('elegant-spinner');
|
||||
|
||||
const pointer = chalk.yellow(figures.pointer);
|
||||
const skipped = chalk.yellow(figures.arrowDown);
|
||||
|
||||
exports.isDefined = x => x !== null && x !== undefined;
|
||||
|
||||
exports.getSymbol = (task, options) => {
|
||||
if (!task.spinner) {
|
||||
task.spinner = elegantSpinner();
|
||||
}
|
||||
|
||||
if (task.isPending()) {
|
||||
return options.showSubtasks !== false && task.subtasks.length > 0 ? pointer : chalk.yellow(task.spinner());
|
||||
}
|
||||
|
||||
if (task.isCompleted()) {
|
||||
return logSymbols.success;
|
||||
}
|
||||
|
||||
if (task.hasFailed()) {
|
||||
return task.subtasks.length > 0 ? pointer : logSymbols.error;
|
||||
}
|
||||
|
||||
if (task.isSkipped()) {
|
||||
return skipped;
|
||||
}
|
||||
|
||||
return ' ';
|
||||
};
|
||||
21
node_modules/listr-update-renderer/license
generated
vendored
Normal file
21
node_modules/listr-update-renderer/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sam Verschueren <sam.verschueren@gmail.com> (github.com/SamVerschueren)
|
||||
|
||||
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.
|
||||
27
node_modules/listr-update-renderer/node_modules/indent-string/index.js
generated
vendored
Normal file
27
node_modules/listr-update-renderer/node_modules/indent-string/index.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
module.exports = (str, count, opts) => {
|
||||
// Support older versions: use the third parameter as options.indent
|
||||
// TODO: Remove the workaround in the next major version
|
||||
const options = typeof opts === 'object' ? Object.assign({indent: ' '}, opts) : {indent: opts || ' '};
|
||||
count = count === undefined ? 1 : count;
|
||||
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof str}\``);
|
||||
}
|
||||
|
||||
if (typeof count !== 'number') {
|
||||
throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);
|
||||
}
|
||||
|
||||
if (typeof options.indent !== 'string') {
|
||||
throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``);
|
||||
}
|
||||
|
||||
if (count === 0) {
|
||||
return str;
|
||||
}
|
||||
|
||||
const regex = options.includeEmptyLines ? /^/mg : /^(?!\s*$)/mg;
|
||||
return str.replace(regex, options.indent.repeat(count));
|
||||
}
|
||||
;
|
||||
9
node_modules/listr-update-renderer/node_modules/indent-string/license
generated
vendored
Normal file
9
node_modules/listr-update-renderer/node_modules/indent-string/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
36
node_modules/listr-update-renderer/node_modules/indent-string/package.json
generated
vendored
Normal file
36
node_modules/listr-update-renderer/node_modules/indent-string/package.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "indent-string",
|
||||
"version": "3.2.0",
|
||||
"description": "Indent each line in a string",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/indent-string",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"indent",
|
||||
"string",
|
||||
"str",
|
||||
"pad",
|
||||
"align",
|
||||
"line",
|
||||
"text",
|
||||
"each",
|
||||
"every"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
72
node_modules/listr-update-renderer/node_modules/indent-string/readme.md
generated
vendored
Normal file
72
node_modules/listr-update-renderer/node_modules/indent-string/readme.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# indent-string [](https://travis-ci.org/sindresorhus/indent-string)
|
||||
|
||||
> Indent each line in a string
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install indent-string
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const indentString = require('indent-string');
|
||||
|
||||
indentString('Unicorns\nRainbows', 4);
|
||||
//=> ' Unicorns'
|
||||
//=> ' Rainbows'
|
||||
|
||||
indentString('Unicorns\nRainbows', 4, {indent: '♥'});
|
||||
//=> '♥♥♥♥Unicorns'
|
||||
//=> '♥♥♥♥Rainbows'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### indentString(input, [count], [options])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string`
|
||||
|
||||
String you want to indent.
|
||||
|
||||
#### count
|
||||
|
||||
Type: `number`<br>
|
||||
Default: `1`
|
||||
|
||||
How many times you want `indent` repeated.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`<br>
|
||||
|
||||
##### indent
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `' '`
|
||||
|
||||
String to use for the indent.
|
||||
|
||||
##### includeEmptyLines
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Also indent empty lines.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module
|
||||
- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
49
node_modules/listr-update-renderer/package.json
generated
vendored
Normal file
49
node_modules/listr-update-renderer/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "listr-update-renderer",
|
||||
"version": "0.2.0",
|
||||
"description": "Listr update renderer",
|
||||
"license": "MIT",
|
||||
"repository": "SamVerschueren/listr-update-renderer",
|
||||
"author": {
|
||||
"name": "Sam Verschueren",
|
||||
"email": "sam.verschueren@gmail.com",
|
||||
"url": "github.com/SamVerschueren"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"keywords": [
|
||||
"listr",
|
||||
"update",
|
||||
"renderer",
|
||||
"ora",
|
||||
"logupdate",
|
||||
"rendering"
|
||||
],
|
||||
"dependencies": {
|
||||
"chalk": "^1.1.3",
|
||||
"cli-truncate": "^0.2.1",
|
||||
"elegant-spinner": "^1.0.1",
|
||||
"figures": "^1.7.0",
|
||||
"indent-string": "^3.0.0",
|
||||
"log-symbols": "^1.0.2",
|
||||
"log-update": "^1.0.2",
|
||||
"strip-ansi": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"delay": "^1.3.1",
|
||||
"listr": "^0.9.0",
|
||||
"xo": "*",
|
||||
"zen-observable": "^0.4.0"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
65
node_modules/listr-update-renderer/readme.md
generated
vendored
Normal file
65
node_modules/listr-update-renderer/readme.md
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
# listr-update-renderer [](https://travis-ci.org/SamVerschueren/listr-update-renderer)
|
||||
|
||||
> [Listr](https://github.com/SamVerschueren/listr) update renderer
|
||||
|
||||
<img src="screenshot.gif" />
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save listr-update-renderer
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const UpdaterRenderer = require('listr-update-renderer');
|
||||
const Listr = require('listr');
|
||||
|
||||
const list = new Listr([
|
||||
{
|
||||
title: 'foo',
|
||||
task: () => Promise.resolve('bar')
|
||||
}
|
||||
], {
|
||||
renderer: UpdaterRenderer,
|
||||
collapse: false
|
||||
});
|
||||
|
||||
list.run();
|
||||
```
|
||||
|
||||
> Note: This is the default renderer for [Listr](https://github.com/SamVerschueren/listr) and doesn't need to be specified.
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
These options should be provided in the [Listr](https://github.com/SamVerschueren/listr) options object.
|
||||
|
||||
### showSubtasks
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Set to `false` if you want to disable the rendering of the subtasks. Subtasks will be rendered if an error occurred in one of them.
|
||||
|
||||
### collapse
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Set to `false` if you don't want subtasks to be hidden after the main task succeed.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [listr](https://github.com/SamVerschueren/listr) - Terminal task list
|
||||
- [listr-verbose-renderer](https://github.com/SamVerschueren/listr-verbose-renderer) - Listr verbose renderer
|
||||
- [listr-silent-renderer](https://github.com/SamVerschueren/listr-silent-renderer) - Suppress Listr rendering output
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sam Verschueren](https://github.com/SamVerschueren)
|
||||
Reference in New Issue
Block a user