This commit is contained in:
oitsjustjose 2017-02-26 17:06:42 -05:00
commit 6b60015c02
9588 changed files with 1149251 additions and 49 deletions

160
node_modules/gulp-help/index.js generated vendored Normal file
View file

@ -0,0 +1,160 @@
var objectAssign = require('object-assign'),
chalk = require('chalk'),
attachHelp = require('./lib/attach-help.js'),
calculateMargin = require('./lib/calculate-margin.js'),
noop = require('./lib/noop'),
DEFAULT_OPTIONS = {
aliases: [],
description: 'Display this help text.',
afterPrintCallback: noop,
hideDepsMessage: false,
hideEmpty: false
};
module.exports = function (gulp, options) {
var originalTaskFn = gulp.task;
options = objectAssign({}, DEFAULT_OPTIONS, options);
/**
* gulp.task(name[, help, deps, fn, taskOptions])
*
* Adds `help` and `taskOptions` to the typical gulp task definition:
* https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulptaskname-deps-fn
* @param {string} name
* @param {string | boolean} [help]
* @param {Array} [deps]
* @param {function} [fn]
* @param {object} [taskOptions]
*/
gulp.task = function (name, help, deps, fn, taskOptions) {
var task;
/* jshint noempty: false */
if (name && (help === null || help === undefined)) {
// just a name. do nothing.
} else if (help === false) {
// .task('test', false, ...)
//ignoredTasks.push(name);
if (typeof deps === 'function') {
// .task('test', false, function(){}, {})
taskOptions = fn;
fn = deps;
deps = undefined;
} else {
// .task('test', false, ['dep'], function(){}, {})
// nothing needs to be re-assigned
}
} else if (typeof help === 'function') {
// .task('test', function(){})
taskOptions = deps;
fn = undefined;
deps = help;
help = undefined;
} else if (Array.isArray(help)) {
// .task('test', ['dep'], ...)
taskOptions = fn;
fn = deps;
deps = help;
help = undefined;
} else if (name && !deps) {
// .task('test', '...')
// help text with no func and no deps
} else if (typeof deps === 'function') {
// .task('test', '...', function, {})
taskOptions = fn;
fn = deps;
deps = undefined;
} else if (Array.isArray(deps)) {
// .task('test', '...', ['dep'], function, {})
// nothing needs to be re-assigned
} else {
throw new Error('gulp-help: Unexpected arg types. Should be in the form: `gulp.task(name[, help, deps, fn, taskOptions])`');
}
if (!deps) {
originalTaskFn.call(gulp, name, fn);
} else {
originalTaskFn.call(gulp, name, deps, fn);
}
task = gulp.tasks[name];
taskOptions = objectAssign({
aliases: []
}, taskOptions);
taskOptions.aliases.forEach(function (alias) {
gulp.task(alias, false, [name], noop);
});
attachHelp(task, help, deps, taskOptions);
return gulp;
};
gulp.task('help', options.description, function () {
var marginData = calculateMargin(gulp.tasks);
var margin = marginData.margin;
var hideDepsMessageOpt = options.hideDepsMessage;
var hideEmptyOpt = options.hideEmpty;
var showAllTasks = process.argv.indexOf('--all') !== -1;
var afterPrintCallback = options.afterPrintCallback;
// set options buffer if the tasks array has options
var optionsBuffer = marginData.hasOptions ? ' --' : '';
console.log('');
console.log(chalk.underline('Usage'));
console.log(' gulp [TASK] [OPTIONS...]');
console.log('');
console.log(chalk.underline('Available tasks'));
Object.keys(gulp.tasks).sort().forEach(function (name) {
if (gulp.tasks[name].help || showAllTasks) {
var help = gulp.tasks[name].help || {message: '', options: {}};
if (!showAllTasks && help.message === '' && hideEmptyOpt) {
return; //skip task
}
var args = [' ', chalk.cyan(name)];
args.push(new Array(margin - name.length + 1 + optionsBuffer.length).join(' '));
if (help.message) {
args.push(help.message);
}
if (help.aliases) {
args.push(help.aliases);
}
if (help.depsMessage && !hideDepsMessageOpt) {
args.push(chalk.cyan(help.depsMessage));
}
var options = Object.keys(help.options).sort();
options.forEach(function (option) {
var optText = help.options[option];
args.push('\n ' + optionsBuffer + chalk.cyan(option) + ' ');
args.push(new Array(margin - option.length + 1).join(' '));
args.push(optText);
});
console.log.apply(console, args);
}
});
console.log('');
if (afterPrintCallback) {
afterPrintCallback(gulp.tasks);
}
}, options);
// do not add default task if one already exists
if (gulp.tasks['default'] === undefined) {
gulp.task('default', false, ['help']);
}
return gulp;
};

29
node_modules/gulp-help/lib/attach-help.js generated vendored Normal file
View file

@ -0,0 +1,29 @@
module.exports = function (task, msg, deps, taskOptions) {
if (!task) {
return;
}
if (msg === false) {
delete task.help;
return;
}
msg = (typeof msg === 'string') ? msg : '';
var aliases = '';
if (taskOptions.aliases && taskOptions.aliases.length > 0) {
aliases = 'Aliases: ' + taskOptions.aliases.join(', ');
}
var depsMessage = '';
if (deps && typeof deps === 'object' && deps.length > 0) {
depsMessage = '[' + deps.join(', ') + ']';
}
task.help = {
message: msg,
aliases: aliases,
depsMessage: depsMessage,
options: taskOptions.options || {}
};
};

39
node_modules/gulp-help/lib/calculate-margin.js generated vendored Normal file
View file

@ -0,0 +1,39 @@
/**
* @param {object} tasksObj - gulp.tasks
*
* returns:
* margin - length of longest task / options name
* hasOptions - true if any task has option(s)
*
* @returns {{margin: number, hasOptions: boolean}}
*/
module.exports = function (tasksObj) {
var hasOptions = false;
var margin = Object.keys(tasksObj).reduce(function (m, taskName) {
var optionsMargin = 0, opts;
// if exists, iterate options list to calculate margin for options
var includeAll = process.argv.indexOf('--all') !== -1;
if (includeAll || (tasksObj[taskName].help && tasksObj[taskName].help.options)) {
var help = tasksObj[taskName].help || {options: {}};
opts = Object.keys(help.options).sort();
optionsMargin = opts.reduce(function (m, opt) {
// if, at any time while iterating the tasks array, we also iterate an opts array, set hasOptions flag
hasOptions = true;
return m > opt.length ? m : opt.length;
}, 0);
}
if (!(tasksObj[taskName].help || includeAll) || (m > taskName.length && m > optionsMargin)) {
return m;
} else if (optionsMargin > taskName.length) {
return optionsMargin;
} else {
return taskName.length;
}
}, 0);
return {
margin: margin,
hasOptions: hasOptions
};
};

1
node_modules/gulp-help/lib/noop.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = function() {};

21
node_modules/gulp-help/license generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Chris Montgomery <chr.montgomery@gmail.com> (chrismontgomery.info)
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.

View file

@ -0,0 +1,39 @@
'use strict';
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function ToObject(val) {
if (val == null) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function ownEnumerableKeys(obj) {
var keys = Object.getOwnPropertyNames(obj);
if (Object.getOwnPropertySymbols) {
keys = keys.concat(Object.getOwnPropertySymbols(obj));
}
return keys.filter(function (key) {
return propIsEnumerable.call(obj, key);
});
}
module.exports = Object.assign || function (target, source) {
var from;
var keys;
var to = ToObject(target);
for (var s = 1; s < arguments.length; s++) {
from = arguments[s];
keys = ownEnumerableKeys(Object(from));
for (var i = 0; i < keys.length; i++) {
to[keys[i]] = from[keys[i]];
}
}
return to;
};

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
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.

View file

@ -0,0 +1,102 @@
{
"_args": [
[
{
"raw": "object-assign@^3.0.0",
"scope": null,
"escapedName": "object-assign",
"name": "object-assign",
"rawSpec": "^3.0.0",
"spec": ">=3.0.0 <4.0.0",
"type": "range"
},
"/Users/jose/Documents/GitHub/Mods/node_modules/gulp-help"
]
],
"_from": "object-assign@>=3.0.0 <4.0.0",
"_id": "object-assign@3.0.0",
"_inCache": true,
"_location": "/gulp-help/object-assign",
"_nodeVersion": "0.12.4",
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
"_npmVersion": "2.10.1",
"_phantomChildren": {},
"_requested": {
"raw": "object-assign@^3.0.0",
"scope": null,
"escapedName": "object-assign",
"name": "object-assign",
"rawSpec": "^3.0.0",
"spec": ">=3.0.0 <4.0.0",
"type": "range"
},
"_requiredBy": [
"/gulp-help"
],
"_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz",
"_shasum": "9bedd5ca0897949bca47e7ff408062d549f587f2",
"_shrinkwrap": null,
"_spec": "object-assign@^3.0.0",
"_where": "/Users/jose/Documents/GitHub/Mods/node_modules/gulp-help",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/object-assign/issues"
},
"dependencies": {},
"description": "ES6 Object.assign() ponyfill",
"devDependencies": {
"mocha": "*"
},
"directories": {},
"dist": {
"shasum": "9bedd5ca0897949bca47e7ff408062d549f587f2",
"tarball": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "02622dcb0d82bd81a071ed0b04fedf5e5eea7059",
"homepage": "https://github.com/sindresorhus/object-assign",
"keywords": [
"object",
"assign",
"extend",
"properties",
"es6",
"ecmascript",
"harmony",
"ponyfill",
"prollyfill",
"polyfill",
"shim",
"browser"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
"name": "object-assign",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/object-assign.git"
},
"scripts": {
"test": "mocha"
},
"version": "3.0.0"
}

View file

@ -0,0 +1,51 @@
# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)
> ES6 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill
> Ponyfill: A polyfill that doesn't overwrite the native method
## Install
```sh
$ npm install --save object-assign
```
## Usage
```js
var objectAssign = require('object-assign');
objectAssign({foo: 0}, {bar: 1});
//=> {foo: 0, bar: 1}
// multiple sources
objectAssign({foo: 0}, {bar: 1}, {baz: 2});
//=> {foo: 0, bar: 1, baz: 2}
// overwrites equal keys
objectAssign({foo: 0}, {foo: 1}, {foo: 2});
//=> {foo: 2}
// ignores null and undefined sources
objectAssign({foo: 0}, null, {bar: 1}, undefined);
//=> {foo: 0, bar: 1}
```
## API
### objectAssign(target, source, [source, ...])
Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
## Resources
- [ES6 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)

136
node_modules/gulp-help/package.json generated vendored Normal file
View file

@ -0,0 +1,136 @@
{
"_args": [
[
{
"raw": "gulp-help@^1.6.1",
"scope": null,
"escapedName": "gulp-help",
"name": "gulp-help",
"rawSpec": "^1.6.1",
"spec": ">=1.6.1 <2.0.0",
"type": "range"
},
"/Users/jose/Documents/GitHub/Mods/node_modules/semantic-ui"
]
],
"_from": "gulp-help@>=1.6.1 <2.0.0",
"_id": "gulp-help@1.6.1",
"_inCache": true,
"_location": "/gulp-help",
"_nodeVersion": "2.3.2",
"_npmUser": {
"name": "chmontgomery",
"email": "chr.montgomery@gmail.com"
},
"_npmVersion": "2.11.3",
"_phantomChildren": {},
"_requested": {
"raw": "gulp-help@^1.6.1",
"scope": null,
"escapedName": "gulp-help",
"name": "gulp-help",
"rawSpec": "^1.6.1",
"spec": ">=1.6.1 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/semantic-ui"
],
"_resolved": "https://registry.npmjs.org/gulp-help/-/gulp-help-1.6.1.tgz",
"_shasum": "261db186e18397fef3f6a2c22e9c315bfa88ae0c",
"_shrinkwrap": null,
"_spec": "gulp-help@^1.6.1",
"_where": "/Users/jose/Documents/GitHub/Mods/node_modules/semantic-ui",
"author": {
"name": "Chris Montgomery",
"email": "chr.montgomery@gmail.com",
"url": "http://www.chrismontgomery.info/"
},
"bugs": {
"url": "https://github.com/chmontgomery/gulp-help/issues"
},
"contributors": [
{
"name": "Chris Montgomery",
"url": "http://www.chrismontgomery.info/"
},
{
"name": "Sascha Depold",
"url": "http://depold.com"
},
{
"name": "Scott Silvi",
"url": "https://github.com/scottsilvi"
},
{
"name": "Fede Ramirez",
"url": "http://2fd.github.io/"
},
{
"name": "Kent C. Dodds",
"url": "https://github.com/kentcdodds"
},
{
"name": "Rui Marinho",
"url": "https://github.com/ruimarinho"
},
{
"name": "Jacek Tomaszewski",
"url": "https://github.com/jtomaszewski"
},
{
"name": "MrFusion42",
"url": "https://github.com/MrFusion42"
},
{
"name": "Jordi Dosne",
"url": "https://github.com/JiDai"
}
],
"dependencies": {
"chalk": "^1.0.0",
"object-assign": "^3.0.0"
},
"description": "Adds a default help task to gulp and provides the ability to add custom help messages to your gulp tasks",
"devDependencies": {
"mocha": "^2.2.5",
"should": "^6.0.3",
"sinon": "^1.14.1"
},
"directories": {},
"dist": {
"shasum": "261db186e18397fef3f6a2c22e9c315bfa88ae0c",
"tarball": "https://registry.npmjs.org/gulp-help/-/gulp-help-1.6.1.tgz"
},
"engines": {
"node": ">= 0.10"
},
"gitHead": "e3ee634ec8e6019472446dcaf534737ee90dcccf",
"homepage": "https://github.com/chmontgomery/gulp-help#readme",
"keywords": [
"gulp",
"help",
"tasks",
"list",
"gulpfriendly"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "chmontgomery",
"email": "chr.montgomery@gmail.com"
}
],
"name": "gulp-help",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/chmontgomery/gulp-help.git"
},
"scripts": {
"test": "mocha"
},
"version": "1.6.1"
}

121
node_modules/gulp-help/readme.md generated vendored Normal file
View file

@ -0,0 +1,121 @@
# [gulp](https://github.com/gulpjs/gulp)-help [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
> Adds a default help task to gulp and provides the ability to add custom help messages to your gulp tasks
## Install
```bash
$ npm install --save-dev gulp-help
```
## Usage
Before defining any tasks, add `gulp help` to your gulp instance
```js
// gulpfile.js
var gulp = require('gulp-help')(require('gulp'));
```
Next, define help text for each custom task
```js
// gulpfile.js
gulp.task('lint', 'Lints all server side js', function () {
gulp.src('./lib/**/*.js')
.pipe(jshint());
});
```
Now show that help via `gulp help`
![](screenshot.png)
## New task API
### gulp.task(name[, help, deps, fn, taskOptions])
#### [name](https://github.com/gulpjs/gulp/blob/master/docs/API.md#name)
Type: `string`
#### help
Type: `string | boolean`
Custom help message as a string.
If you want to hide the task from the help menu, supply `false`
```js
gulp.task('task-hidden-from-help', false, function () {
// ...
});
```
However, if the `--all` flag is provided, even these tasks will be shown. (i.e. `gulp help --all`)
#### [deps](https://github.com/gulpjs/gulp/blob/master/docs/API.md#deps)
Type: `Array`
#### [fn](https://github.com/gulpjs/gulp/blob/master/docs/API.md#fn)
Type: `function`
#### taskOptions.aliases
Type: `Array`
List of aliases for this task
```js
gulp.task('version', 'prints the version.', [], function() {
// ...
}, {
aliases: ['v', 'V']
});
```
which results in
![](screenshot-aliases.png)
#### taskOptions.options
Type: `Object`
Object documenting options which can be passed to your task
```js
gulp.task('version', 'prints the version.', [], function () {
// ...
}, {
options: {
'env=prod': 'description of env, perhaps with available values',
'key=val': 'description of key & val',
'key': 'description of key'
}
});
```
which results in
![](screenshot-options.png)
## require('gulp-help')(require('gulp'), options);
These are all the options available to be passed to the `gulp-help` instance, NOT individual tasks.
- `description` - modifies the default help message
- `aliases` - adds aliases to the default help task
- `hideEmpty` - hide all tasks with no help message defined. Useful when including 3rd party tasks
- `hideDepsMessage` - hide all task dependencies
- `afterPrintCallback` - a function to run after the default help task runs
## License
MIT © [Chris Montgomery](http://www.chrismontgomery.info/)
[npm-url]: https://npmjs.org/package/gulp-help
[npm-image]: http://img.shields.io/npm/v/gulp-help.svg
[travis-image]: https://travis-ci.org/chmontgomery/gulp-help.svg?branch=master
[travis-url]: https://travis-ci.org/chmontgomery/gulp-help