This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ See `examples/expand.js` for a running example.
#### Checkbox - `{type: 'checkbox'}`
Take `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`] properties. `default` is expected to be an Array of the checked choices value.
Take `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`, `loop`] properties. `default` is expected to be an Array of the checked choices value.
Choices marked as `{checked: true}` will be checked by default.
+5 -2
View File
@@ -56,8 +56,11 @@ class Prompt {
*/
run() {
return new Promise((resolve) => {
this._run((value) => resolve(value));
return new Promise((resolve, reject) => {
this._run(
(value) => resolve(value),
(error) => reject(error)
);
});
}
+5 -5
View File
@@ -15,6 +15,7 @@ var { map, takeUntil } = require('rxjs/operators');
var Base = require('./base');
var observe = require('../utils/events');
var Paginator = require('../utils/paginator');
var incrementListIndex = require('../utils/incrementListIndex');
class CheckboxPrompt extends Base {
constructor(questions, rl, answers) {
@@ -37,7 +38,8 @@ class CheckboxPrompt extends Base {
// Make sure no default is set (so it won't be printed)
this.opt.default = null;
this.paginator = new Paginator(this.screen);
const shouldLoop = this.opt.loop === undefined ? true : this.opt.loop;
this.paginator = new Paginator(this.screen, { isInfinite: shouldLoop });
}
/**
@@ -170,14 +172,12 @@ class CheckboxPrompt extends Base {
}
onUpKey() {
var len = this.opt.choices.realLength;
this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1;
this.pointer = incrementListIndex(this.pointer, 'up', this.opt);
this.render();
}
onDownKey() {
var len = this.opt.choices.realLength;
this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0;
this.pointer = incrementListIndex(this.pointer, 'down', this.opt);
this.render();
}
+6 -1
View File
@@ -55,7 +55,7 @@ class PromptUI extends Base {
}, this.answers)
)
.toPromise(Promise)
.then(this.onCompletion.bind(this));
.then(this.onCompletion.bind(this), this.onError.bind(this));
}
/**
@@ -68,6 +68,11 @@ class PromptUI extends Base {
return this.answers;
}
onError(error) {
this.close();
return Promise.reject(error);
}
processQuestion(question) {
question = _.clone(question);
return defer(() => {
+150 -2
View File
@@ -1,4 +1,152 @@
import * as cssColors from 'color-name';
declare type CSSColor =
| 'aliceblue'
| 'antiquewhite'
| 'aqua'
| 'aquamarine'
| 'azure'
| 'beige'
| 'bisque'
| 'black'
| 'blanchedalmond'
| 'blue'
| 'blueviolet'
| 'brown'
| 'burlywood'
| 'cadetblue'
| 'chartreuse'
| 'chocolate'
| 'coral'
| 'cornflowerblue'
| 'cornsilk'
| 'crimson'
| 'cyan'
| 'darkblue'
| 'darkcyan'
| 'darkgoldenrod'
| 'darkgray'
| 'darkgreen'
| 'darkgrey'
| 'darkkhaki'
| 'darkmagenta'
| 'darkolivegreen'
| 'darkorange'
| 'darkorchid'
| 'darkred'
| 'darksalmon'
| 'darkseagreen'
| 'darkslateblue'
| 'darkslategray'
| 'darkslategrey'
| 'darkturquoise'
| 'darkviolet'
| 'deeppink'
| 'deepskyblue'
| 'dimgray'
| 'dimgrey'
| 'dodgerblue'
| 'firebrick'
| 'floralwhite'
| 'forestgreen'
| 'fuchsia'
| 'gainsboro'
| 'ghostwhite'
| 'gold'
| 'goldenrod'
| 'gray'
| 'green'
| 'greenyellow'
| 'grey'
| 'honeydew'
| 'hotpink'
| 'indianred'
| 'indigo'
| 'ivory'
| 'khaki'
| 'lavender'
| 'lavenderblush'
| 'lawngreen'
| 'lemonchiffon'
| 'lightblue'
| 'lightcoral'
| 'lightcyan'
| 'lightgoldenrodyellow'
| 'lightgray'
| 'lightgreen'
| 'lightgrey'
| 'lightpink'
| 'lightsalmon'
| 'lightseagreen'
| 'lightskyblue'
| 'lightslategray'
| 'lightslategrey'
| 'lightsteelblue'
| 'lightyellow'
| 'lime'
| 'limegreen'
| 'linen'
| 'magenta'
| 'maroon'
| 'mediumaquamarine'
| 'mediumblue'
| 'mediumorchid'
| 'mediumpurple'
| 'mediumseagreen'
| 'mediumslateblue'
| 'mediumspringgreen'
| 'mediumturquoise'
| 'mediumvioletred'
| 'midnightblue'
| 'mintcream'
| 'mistyrose'
| 'moccasin'
| 'navajowhite'
| 'navy'
| 'oldlace'
| 'olive'
| 'olivedrab'
| 'orange'
| 'orangered'
| 'orchid'
| 'palegoldenrod'
| 'palegreen'
| 'paleturquoise'
| 'palevioletred'
| 'papayawhip'
| 'peachpuff'
| 'peru'
| 'pink'
| 'plum'
| 'powderblue'
| 'purple'
| 'rebeccapurple'
| 'red'
| 'rosybrown'
| 'royalblue'
| 'saddlebrown'
| 'salmon'
| 'sandybrown'
| 'seagreen'
| 'seashell'
| 'sienna'
| 'silver'
| 'skyblue'
| 'slateblue'
| 'slategray'
| 'slategrey'
| 'snow'
| 'springgreen'
| 'steelblue'
| 'tan'
| 'teal'
| 'thistle'
| 'tomato'
| 'turquoise'
| 'violet'
| 'wheat'
| 'white'
| 'whitesmoke'
| 'yellow'
| 'yellowgreen';
declare namespace ansiStyles {
interface ColorConvert {
@@ -21,7 +169,7 @@ declare namespace ansiStyles {
/**
@param keyword - A CSS color name.
*/
keyword(keyword: keyof typeof cssColors): string;
keyword(keyword: CSSColor): string;
/**
The HSL color space.
+12 -13
View File
@@ -1,32 +1,32 @@
{
"_args": [
[
"ansi-styles@4.2.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"ansi-styles@4.3.0",
"/home/node/nuxt"
]
],
"_from": "ansi-styles@4.2.1",
"_id": "ansi-styles@4.2.1",
"_from": "ansi-styles@4.3.0",
"_id": "ansi-styles@4.3.0",
"_inBundle": false,
"_integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"_integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"_location": "/inquirer/ansi-styles",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "ansi-styles@4.2.1",
"raw": "ansi-styles@4.3.0",
"name": "ansi-styles",
"escapedName": "ansi-styles",
"rawSpec": "4.2.1",
"rawSpec": "4.3.0",
"saveSpec": null,
"fetchSpec": "4.2.1"
"fetchSpec": "4.3.0"
},
"_requiredBy": [
"/inquirer/chalk"
],
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"_spec": "4.2.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"_spec": "4.3.0",
"_where": "/home/node/nuxt",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -36,7 +36,6 @@
"url": "https://github.com/chalk/ansi-styles/issues"
},
"dependencies": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
},
"description": "ANSI escape codes for styling strings in the terminal",
@@ -88,5 +87,5 @@
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor",
"test": "xo && ava && tsd"
},
"version": "4.2.1"
"version": "4.3.0"
}
+4 -10
View File
@@ -145,14 +145,8 @@ style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color backgroun
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
---
## For enterprise
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&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>
Available as part of the Tidelift Subscription.
The maintainers of `ansi-styles` 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-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+12 -12
View File
@@ -1,32 +1,32 @@
{
"_args": [
[
"chalk@4.1.0",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"chalk@4.1.2",
"/home/node/nuxt"
]
],
"_from": "chalk@4.1.0",
"_id": "chalk@4.1.0",
"_from": "chalk@4.1.2",
"_id": "chalk@4.1.2",
"_inBundle": false,
"_integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"_integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"_location": "/inquirer/chalk",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "chalk@4.1.0",
"raw": "chalk@4.1.2",
"name": "chalk",
"escapedName": "chalk",
"rawSpec": "4.1.0",
"rawSpec": "4.1.2",
"saveSpec": null,
"fetchSpec": "4.1.0"
"fetchSpec": "4.1.2"
},
"_requiredBy": [
"/inquirer"
],
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"_spec": "4.1.0",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"_spec": "4.1.2",
"_where": "/home/node/nuxt",
"bugs": {
"url": "https://github.com/chalk/chalk/issues"
},
@@ -89,7 +89,7 @@
"bench": "matcha benchmark.js",
"test": "xo && nyc ava && tsd"
},
"version": "4.1.0",
"version": "4.1.2",
"xo": {
"rules": {
"unicorn/prefer-string-slice": "off",
+48
View File
@@ -13,6 +13,54 @@
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
<br>
---
<div align="center">
<p>
<p>
<sup>
Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a>
</sup>
</p>
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://standardresume.co/tech">
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/>
</a>
<br>
<br>
<a href="https://retool.com/?utm_campaign=sindresorhus">
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
</a>
<br>
<br>
<a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=chalk&utm_source=github">
<div>
<img src="https://dashboard.doppler.com/imgs/logo-long.svg" width="240" alt="Doppler">
</div>
<b>All your environment variables, in one place</b>
<div>
<span>Stop struggling with scattered API keys, hacking together home-brewed tools,</span>
<br>
<span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
</div>
</a>
<br>
<a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github">
<div>
<img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery">
</div>
</a>
</p>
</div>
---
<br>
## Highlights
- Expressive API
+15 -16
View File
@@ -1,35 +1,34 @@
{
"_args": [
[
"inquirer@7.3.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"inquirer@7.3.3",
"/home/node/nuxt"
]
],
"_from": "inquirer@7.3.1",
"_id": "inquirer@7.3.1",
"_from": "inquirer@7.3.3",
"_id": "inquirer@7.3.3",
"_inBundle": false,
"_integrity": "sha512-/+vOpHQHhoh90Znev8BXiuw1TDQ7IDxWsQnFafUEoK5+4uN5Eoz1p+3GqOj/NtzEi9VzWKQcV9Bm+i8moxedsA==",
"_integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==",
"_location": "/inquirer",
"_phantomChildren": {
"@types/color-name": "1.1.1",
"emoji-regex": "8.0.0"
"supports-color": "7.2.0"
},
"_requested": {
"type": "version",
"registry": true,
"raw": "inquirer@7.3.1",
"raw": "inquirer@7.3.3",
"name": "inquirer",
"escapedName": "inquirer",
"rawSpec": "7.3.1",
"rawSpec": "7.3.3",
"saveSpec": null,
"fetchSpec": "7.3.1"
"fetchSpec": "7.3.3"
},
"_requiredBy": [
"/@nuxt/telemetry"
],
"_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.1.tgz",
"_spec": "7.3.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz",
"_spec": "7.3.3",
"_where": "/home/node/nuxt",
"author": {
"name": "Simon Boudrias",
"email": "admin@simonboudrias.com"
@@ -44,7 +43,7 @@
"cli-width": "^3.0.0",
"external-editor": "^3.0.3",
"figures": "^3.0.0",
"lodash": "^4.17.16",
"lodash": "^4.17.19",
"mute-stream": "0.0.8",
"run-async": "^2.4.0",
"rxjs": "^6.6.0",
@@ -69,7 +68,7 @@
"lib",
"README.md"
],
"gitHead": "dce97d8d78286c75e1926278d98133b0f431016a",
"gitHead": "808d5538531c1ca1c34f832d77bc98dfd0ba4000",
"homepage": "https://github.com/SBoudrias/Inquirer.js#readme",
"keywords": [
"command",
@@ -92,5 +91,5 @@
"prepublishOnly": "cp ../../README.md .",
"test": "nyc mocha test/**/* -r ./test/before"
},
"version": "7.3.1"
"version": "7.3.3"
}