--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
5
node_modules/gulp-prompt/.npmignore
generated
vendored
Normal file
5
node_modules/gulp-prompt/.npmignore
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.DS_STORE
|
||||
node_modules/
|
||||
test.js
|
||||
gulpfile.js
|
||||
npm-debug.log
|
||||
132
node_modules/gulp-prompt/README.md
generated
vendored
Normal file
132
node_modules/gulp-prompt/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
# Gulp prompt
|
||||
|
||||
Add interaction to gulp tasks.
|
||||
|
||||
## .confirm([options])
|
||||
|
||||
Options:
|
||||
|
||||
- **message** - Message to be displayed
|
||||
- **default** - Default response if none is provided
|
||||
|
||||
This method will allow the pipe to continue if the user input is true, otherwise, it will be terminated.
|
||||
|
||||
Default usage:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.confirm())
|
||||
.pipe(gulp.dest('dest'));
|
||||
|
||||
```
|
||||
|
||||
If a string is provided to the options, it will be set as the message:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.confirm('Are you ready for Gulp?'))
|
||||
.pipe(gulp.dest('dest'));
|
||||
|
||||
```
|
||||
|
||||
Example when using options:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.confirm({
|
||||
message: 'Continue?',
|
||||
default: true
|
||||
}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
|
||||
```
|
||||
|
||||
## .prompt(questions, callback)
|
||||
|
||||
This is a clean pass-through function for gulp to utilize the full [Inquirer.js Library](https://github.com/SBoudrias/Inquirer.js), please refer to them for documentation on corresponding parameters.
|
||||
|
||||
Please note that all types are avaiable, not just the examples below.
|
||||
|
||||
Example Input:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.prompt({
|
||||
type: 'input',
|
||||
name: 'task',
|
||||
message: 'Which task would you like to run?'
|
||||
}, function(res){
|
||||
//value is in res.task (the name option gives the key)
|
||||
}));
|
||||
|
||||
```
|
||||
|
||||
Example Checkbox:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.prompt({
|
||||
type: 'checkbox',
|
||||
name: 'bump',
|
||||
message: 'What type of bump would you like to do?',
|
||||
choices: ['patch', 'minor', 'major']
|
||||
}, function(res){
|
||||
//value is in res.bump (as an array)
|
||||
}));
|
||||
|
||||
```
|
||||
|
||||
Example Password:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.prompt({
|
||||
type: 'password',
|
||||
name: 'pass',
|
||||
message: 'Please enter your password'
|
||||
}, function(res){
|
||||
//value is in res.pass
|
||||
}));
|
||||
|
||||
```
|
||||
|
||||
Example Multiple:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.prompt([{
|
||||
type: 'input',
|
||||
name: 'first',
|
||||
message: 'First question?'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'second',
|
||||
message: 'Second question?'
|
||||
}], function(res){
|
||||
//value is in res.first and res.second
|
||||
}));
|
||||
|
||||
```
|
||||
|
||||
Example Validation:
|
||||
```javascript
|
||||
|
||||
gulp.src('test.js')
|
||||
.pipe(prompt.prompt({
|
||||
type: 'password',
|
||||
name: 'pass',
|
||||
message: 'Please enter your password',
|
||||
validate: function(pass){
|
||||
|
||||
if(pass !== '123456'){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}, function(res){
|
||||
//value is in res.pass
|
||||
}));
|
||||
|
||||
```
|
||||
70
node_modules/gulp-prompt/index.js
generated
vendored
Normal file
70
node_modules/gulp-prompt/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
var inq = require('inquirer'),
|
||||
es = require('event-stream');
|
||||
|
||||
module.exports = {
|
||||
|
||||
prompt: function(questions, callback){
|
||||
var prompted = false;
|
||||
return es.map(function(file, cb){
|
||||
|
||||
if(prompted===true){
|
||||
cb(null,file);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!questions instanceof Array){
|
||||
questions = [questions];
|
||||
}
|
||||
|
||||
if(typeof callback !== 'function'){
|
||||
callback = function(){};
|
||||
}
|
||||
|
||||
inq.prompt(questions, function(res){
|
||||
callback(res);
|
||||
cb(null, file);
|
||||
});
|
||||
prompted = true;
|
||||
});
|
||||
},
|
||||
|
||||
confirm: function(options){
|
||||
var prompted = false;
|
||||
return es.map(function(file, cb){
|
||||
|
||||
if(prompted===true){
|
||||
cb(null,file);
|
||||
return;
|
||||
}
|
||||
|
||||
var opts = {
|
||||
type: 'confirm',
|
||||
name: 'val',
|
||||
message: 'Are you sure?',
|
||||
default: false
|
||||
};
|
||||
|
||||
if(typeof options === 'string'){
|
||||
opts.message = options;
|
||||
}
|
||||
|
||||
if(typeof options !== 'object'){
|
||||
options = {};
|
||||
}
|
||||
|
||||
opts.message = options.message || opts.message;
|
||||
opts.default = options.default || opts.default;
|
||||
|
||||
inq.prompt([opts], function(res){
|
||||
|
||||
if(res.val){
|
||||
cb(null, file);
|
||||
}
|
||||
|
||||
});
|
||||
prompted = true;
|
||||
});
|
||||
},
|
||||
|
||||
inq: inq
|
||||
};
|
||||
96
node_modules/gulp-prompt/package.json
generated
vendored
Normal file
96
node_modules/gulp-prompt/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "gulp-prompt@^0.2.0",
|
||||
"scope": null,
|
||||
"escapedName": "gulp-prompt",
|
||||
"name": "gulp-prompt",
|
||||
"rawSpec": "^0.2.0",
|
||||
"spec": ">=0.2.0 <0.3.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/Users/jose/Documents/GitHub/Mods/node_modules/semantic-ui"
|
||||
]
|
||||
],
|
||||
"_from": "gulp-prompt@>=0.2.0 <0.3.0",
|
||||
"_id": "gulp-prompt@0.2.0",
|
||||
"_inCache": true,
|
||||
"_location": "/gulp-prompt",
|
||||
"_nodeVersion": "5.10.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/gulp-prompt-0.2.0.tgz_1459760617398_0.42593945236876607"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "freyskeyd",
|
||||
"email": "contact@freyskeyd.fr"
|
||||
},
|
||||
"_npmVersion": "3.8.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "gulp-prompt@^0.2.0",
|
||||
"scope": null,
|
||||
"escapedName": "gulp-prompt",
|
||||
"name": "gulp-prompt",
|
||||
"rawSpec": "^0.2.0",
|
||||
"spec": ">=0.2.0 <0.3.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/semantic-ui"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-prompt/-/gulp-prompt-0.2.0.tgz",
|
||||
"_shasum": "9760c90bbd87e800228330ebac74d659cc2ddb78",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "gulp-prompt@^0.2.0",
|
||||
"_where": "/Users/jose/Documents/GitHub/Mods/node_modules/semantic-ui",
|
||||
"author": {
|
||||
"name": "Simon Paitrault",
|
||||
"email": "contact@freyskeyd.fr"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Freyskeyd/gulp-prompt/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"event-stream": "~3.0.20",
|
||||
"inquirer": "~0.10"
|
||||
},
|
||||
"description": "Add interactive console prompts to gulp",
|
||||
"devDependencies": {
|
||||
"event-stream": "~3.0.20",
|
||||
"inquirer": "~0.3.5"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dist": {
|
||||
"shasum": "9760c90bbd87e800228330ebac74d659cc2ddb78",
|
||||
"tarball": "https://registry.npmjs.org/gulp-prompt/-/gulp-prompt-0.2.0.tgz"
|
||||
},
|
||||
"gitHead": "e51a9576d2eaf65efa53760264cf05dfefe55599",
|
||||
"homepage": "https://github.com/Freyskeyd/gulp-prompt#readme",
|
||||
"keywords": [
|
||||
"gulpplugin",
|
||||
"prompt"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "freyskeyd",
|
||||
"email": "contact@freyskeyd.fr"
|
||||
}
|
||||
],
|
||||
"name": "gulp-prompt",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Freyskeyd/gulp-prompt.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "0.2.0"
|
||||
}
|
||||
0
node_modules/gulp-prompt/test/.gitkeep
generated
vendored
Normal file
0
node_modules/gulp-prompt/test/.gitkeep
generated
vendored
Normal file
Loading…
Reference in a new issue