From 90aa0dbc328d1631a306e65a762341b2126dd305 Mon Sep 17 00:00:00 2001 From: Jason Brumwell Date: Fri, 23 Sep 2016 17:17:34 -0400 Subject: [PATCH 01/38] Support default values for options --- dist/command.js | 1025 +++++++++++++++++++++++++---------------------- dist/option.js | 24 +- dist/ui.js | 4 +- dist/util.js | 22 +- dist/vorpal.js | 2 +- lib/command.js | 972 +++++++++++++++++++++----------------------- lib/option.js | 15 +- lib/ui.js | 3 +- lib/util.js | 6 +- test/vorpal.js | 23 ++ 10 files changed, 1098 insertions(+), 998 deletions(-) diff --git a/dist/command.js b/dist/command.js index 36939f8b..51e65ea6 100755 --- a/dist/command.js +++ b/dist/command.js @@ -4,562 +4,643 @@ * Module dependencies. */ -var EventEmitter = require('events').EventEmitter; -var Option = require('./option'); -var VorpalUtil = require('./util'); -var _ = require('lodash'); +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; -/** - * Command prototype. - */ - -var command = Command.prototype; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/** - * Expose `Command`. - */ +var _events = require('events'); -module.exports = exports = Command; +var _option = require('./option'); -/** - * Initialize a new `Command` instance. - * - * @param {String} name - * @param {Vorpal} parent - * @return {Command} - * @api public - */ +var _option2 = _interopRequireDefault(_option); -function Command(name, parent) { - if (!(this instanceof Command)) { - return new Command(); - } - this.commands = []; - this.options = []; - this._args = []; - this._aliases = []; - this._name = name; - this._relay = false; - this._hidden = false; - this._parent = parent; - this._mode = false; - this._catch = false; - this._help = undefined; - this._init = undefined; - this._after = undefined; - this._allowUnknownOptions = false; -} +var _util = require('./util'); -/** - * Registers an option for given command. - * - * @param {String} flags - * @param {String} description - * @param {Function} fn - * @param {String} defaultValue - * @return {Command} - * @api public - */ +var _util2 = _interopRequireDefault(_util); -command.option = function (flags, description, autocomplete) { - var self = this; - var option = new Option(flags, description, autocomplete); - var oname = option.name(); - var name = _camelcase(oname); - var defaultValue; - - // preassign default value only for --no-*, [optional], or - if (option.bool === false || option.optional || option.required) { - // when --no-* we make sure default is true - if (option.bool === false) { - defaultValue = true; - } - // preassign only if we have a default - if (defaultValue !== undefined) { - self[name] = defaultValue; - } - } +var _lodash = require('lodash'); - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function (val) { - // unassigned or bool - if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { - // if no value, bool true, and we have a default, then use it! - if (val === null) { - self[name] = option.bool ? defaultValue || true : false; - } else { - self[name] = val; - } - } else if (val !== null) { - // reassign - self[name] = val; - } - }); +var _lodash2 = _interopRequireDefault(_lodash); - return this; -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Defines an action for a given command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -command.action = function (fn) { - var self = this; - self._fn = fn; - return this; -}; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -/** - * Defines a function to validate arguments - * before action is performed. Arguments - * are valid if no errors are thrown from - * the function. - * - * @param fn - * @returns {Command} - * @api public - */ -command.validate = function (fn) { - var self = this; - self._validate = fn; - return this; -}; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * Defines a function to be called when the - * command is canceled. + * Converts string to camel case. * - * @param fn - * @returns {Command} - * @api public + * @param {String} flag + * @return {String} + * @api private */ -command.cancel = function (fn) { - this._cancel = fn; - return this; -}; +function _camelcase(flag) { + return flag.split('-').reduce(function (str, word) { + return str + word[0].toUpperCase() + word.slice(1); + }); +} -/** - * Defines a method to be called when - * the command set has completed. - * - * @param {Function} fn - * @return {Command} - * @api public - */ +module.exports = function (_EventEmitter) { + _inherits(Command, _EventEmitter); -command.done = function (fn) { - this._done = fn; - return this; -}; + function Command(name, parent) { + _classCallCheck(this, Command); -/** - * Defines tabbed auto-completion - * for the given command. Favored over - * deprecated command.autocompletion. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + var _this = _possibleConstructorReturn(this, (Command.__proto__ || Object.getPrototypeOf(Command)).apply(this, arguments)); -command.autocomplete = function (obj) { - this._autocomplete = obj; - return this; -}; + if (!(_this instanceof Command)) { + var _ret; -/** - * Defines tabbed auto-completion rules - * for the given command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + return _ret = new Command(), _possibleConstructorReturn(_this, _ret); + } -command.autocompletion = function (param) { - this._parent._useDeprecatedAutocompletion = true; - if (!_.isFunction(param) && !_.isObject(param)) { - throw new Error('An invalid object type was passed into the first parameter of command.autocompletion: function expected.'); + _this.commands = []; + _this.options = []; + _this._args = []; + _this._aliases = []; + _this._name = name; + _this._relay = false; + _this._hidden = false; + _this._parent = parent; + _this._mode = false; + _this._catch = false; + _this._help = undefined; + _this._init = undefined; + _this._after = undefined; + _this._allowUnknownOptions = false; + return _this; } - this._autocompletion = param; - return this; -}; + /** + * Registers an option for given command. + * + * @param {String} flags + * @param {String} description + * @param {Function} fn + * @param {String} defaultValue + * @return {Command} + * @api public + */ + + + _createClass(Command, [{ + key: 'option', + value: function option(flags, description) { + var _this2 = this; + + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var option = new _option2.default(flags, description, options); + var oname = option.name(); + var name = _camelcase(oname); + var defaultValue = void 0; + + // preassign default value only for --no-*, [optional], or + if (option.bool === false || option.optional || option.required) { + // when --no-* we make sure default is true + if (option.bool === false) { + defaultValue = true; + } + // preassign only if we have a default + if (defaultValue !== undefined) { + this[name] = defaultValue; + } + } -/** - * Defines an init action for a mode command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on(oname, function (val) { + // unassigned or bool + if (typeof _this2[name] === 'boolean' || typeof _this2[name] === 'undefined') { + // if no value, bool true, and we have a default, then use it! + if (val === null) { + _this2[name] = option.bool ? defaultValue || true : false; + } else { + _this2[name] = val; + } + } else if (val !== null) { + // reassign + _this2[name] = val; + } + }); -command.init = function (fn) { - var self = this; - if (self._mode !== true) { - throw Error('Cannot call init from a non-mode action.'); - } - self._init = fn; - return this; -}; + return this; + } -/** - * Defines a prompt delimiter for a - * mode once entered. - * - * @param {String} delimiter - * @return {Command} - * @api public - */ + /** + * Defines an action for a given command. + * + * @param {Function} fn + * @return {Command} + * @api public + */ -command.delimiter = function (delimiter) { - this._delimiter = delimiter; - return this; -}; + }, { + key: 'action', + value: function action(fn) { + this._fn = fn; -/** - * Sets args for static typing of options - * using minimist. - * - * @param {Object} types - * @return {Command} - * @api public - */ + return this; + } -command.types = function (types) { - var supported = ['string', 'boolean']; - for (var item in types) { - if (supported.indexOf(item) === -1) { - throw new Error('An invalid type was passed into command.types(): ' + item); + /** + * Defines a function to validate arguments + * before action is performed. Arguments + * are valid if no errors are thrown from + * the function. + * + * @param fn + * @returns {Command} + * @api public + */ + + }, { + key: 'validate', + value: function validate(fn) { + this._validate = fn; + return this; } - types[item] = !_.isArray(types[item]) ? [types[item]] : types[item]; - } - this._types = types; - return this; -}; -/** - * Defines an alias for a given command. - * - * @param {String} alias - * @return {Command} - * @api public - */ + /** + * Defines a function to be called when the + * command is canceled. + * + * @param fn + * @returns {Command} + * @api public + */ + + }, { + key: 'cancel', + value: function cancel(fn) { + this._cancel = fn; + return this; + } -command.alias = function () { - var self = this; - for (var i = 0; i < arguments.length; ++i) { - var alias = arguments[i]; - if (_.isArray(alias)) { - for (var j = 0; j < alias.length; ++j) { - this.alias(alias[j]); - } + /** + * Defines a method to be called when + * the command set has completed. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + }, { + key: 'done', + value: function done(fn) { + this._done = fn; return this; } - this._parent.commands.forEach(function (cmd) { - if (!_.isEmpty(cmd._aliases)) { - if (_.includes(cmd._aliases, alias)) { - var msg = 'Duplicate alias "' + alias + '" for command "' + self._name + '" detected. Was first reserved by command "' + cmd._name + '".'; - throw new Error(msg); - } - } - }); - this._aliases.push(alias); - } - return this; -}; -/** - * Defines description for given command. - * - * @param {String} str - * @return {Command} - * @api public - */ + /** + * Defines tabbed auto-completion + * for the given command. Favored over + * deprecated command.autocompletion. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + }, { + key: 'autocomplete', + value: function autocomplete(obj) { + this._autocomplete = obj; + return this; + } -command.description = function (str) { - if (arguments.length === 0) { - return this._description; - } - this._description = str; - return this; -}; + /** + * Defines tabbed auto-completion rules + * for the given command. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + }, { + key: 'autocompletion', + value: function autocompletion(param) { + this._parent._useDeprecatedAutocompletion = true; + if (!_lodash2.default.isFunction(param) && !_lodash2.default.isObject(param)) { + throw new Error('An invalid object type was passed into the first parameter of command.autocompletion: function expected.'); + } -/** - * Removes self from Vorpal instance. - * - * @return {Command} - * @api public - */ + this._autocompletion = param; + return this; + } -command.remove = function () { - var self = this; - this._parent.commands = _.reject(this._parent.commands, function (command) { - if (command._name === self._name) { - return true; + /** + * Defines an init action for a mode command. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + }, { + key: 'init', + value: function init(fn) { + if (this._mode !== true) { + throw Error('Cannot call init from a non-mode action.'); + } + this._init = fn; + return this; } - }); - return this; -}; -/** - * Returns the commands arguments as string. - * - * @param {String} desc - * @return {String} - * @api public - */ + /** + * Defines a prompt delimiter for a + * mode once entered. + * + * @param {String} delimiter + * @return {Command} + * @api public + */ + + }, { + key: 'delimiter', + value: function delimiter(_delimiter) { + this._delimiter = _delimiter; + return this; + } -command.arguments = function (desc) { - return this._parseExpectedArgs(desc.split(/ +/)); -}; + /** + * Sets args for static typing of options + * using minimist. + * + * @param {Object} types + * @return {Command} + * @api public + */ + + }, { + key: 'types', + value: function types(_types) { + var supported = ['string', 'boolean']; + + for (var item in _types) { + if (supported.indexOf(item) === -1) { + throw new Error('An invalid type was passed into command.types(): ' + item); + } + _types[item] = !_lodash2.default.isArray(_types[item]) ? [_types[item]] : _types[item]; + } + this._types = _types; + return this; + } -/** - * Returns the help info for given command. - * - * @return {String} - * @api public - */ + /** + * Defines an alias for a given command. + * + * @param {String} alias + * @return {Command} + * @api public + */ + + }, { + key: 'alias', + value: function alias() { + var _arguments2 = arguments, + _this3 = this; + + var _loop = function _loop(i) { + var alias = _arguments2[i]; + + if (_lodash2.default.isArray(alias)) { + for (j = 0; j < alias.length; ++j) { + _this3.alias(alias[j]); + } + return { + v: _this3 + }; + } -command.helpInformation = function () { - var desc = []; - var cmdName = this._name; - var alias = ''; + _this3._parent.commands.forEach(function (cmd) { + if (!_lodash2.default.isEmpty(cmd._aliases)) { + if (_lodash2.default.includes(cmd._aliases, alias)) { + var msg = 'Duplicate alias "' + alias + '" for command "' + this._name + '" detected. Was first reserved by command "' + cmd._name + '".'; + throw new Error(msg); + } + } + }); - if (this._description) { - desc = [' ' + this._description, '']; - } + _this3._aliases.push(alias); + }; - if (this._aliases.length > 0) { - alias = ' Alias: ' + this._aliases.join(' | ') + '\n'; - } - var usage = ['', ' Usage: ' + cmdName + ' ' + this.usage(), '']; + for (var i = 0; i < arguments.length; ++i) { + var j; - var cmds = []; + var _ret2 = _loop(i); - var help = String(this.optionHelp().replace(/^/gm, ' ')); - var options = [' Options:', '', help, '']; + if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; + } - var res = usage.concat(cmds).concat(alias).concat(desc).concat(options).join('\n'); + return this; + } - res = res.replace(/\n\n\n/g, '\n\n'); + /** + * Defines description for given command. + * + * @param {String} str + * @return {Command} + * @api public + */ + + }, { + key: 'description', + value: function description(str) { + var isGetter = arguments.length === 0; + + if (!isGetter) { + this._description = str; + } - return res; -}; + return isGetter ? this._description : this; + } -/** - * Doesn't show command in the help menu. - * - * @return {Command} - * @api public - */ + /** + * Removes self from Vorpal instance. + * + * @return {Command} + * @api public + */ -command.hidden = function () { - this._hidden = true; - return this; -}; + }, { + key: 'remove', + value: function remove() { + var _this4 = this; -/** - * Allows undeclared options to be passed in with the command. - * - * @param {Boolean} [allowUnknownOptions=true] - * @return {Command} - * @api public - */ + this._parent.commands = _lodash2.default.reject(this._parent.commands, function (command) { + return command._name === _this4._name; + }); -command.allowUnknownOptions = function () { - var allowUnknownOptions = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; + return this; + } - allowUnknownOptions = allowUnknownOptions === "false" ? false : allowUnknownOptions; + /** + * Returns the commands arguments as string. + * + * @param {String} desc + * @return {String} + * @api public + */ + + }, { + key: 'arguments', + value: function _arguments(desc) { + return this._parseExpectedArgs(desc.split(/ +/)); + } - this._allowUnknownOptions = !!allowUnknownOptions; - return this; -}; + /** + * Returns the help info for given command. + * + * @return {String} + * @api public + */ + + }, { + key: 'helpInformation', + value: function helpInformation() { + var desc = []; + var cmdName = this._name; + var alias = ''; + + if (this._description) { + desc = [' ' + this._description, '']; + } -/** - * Returns the command usage string for help. - * - * @param {String} str - * @return {String} - * @api public - */ + if (this._aliases.length > 0) { + alias = ' Alias: ' + this._aliases.join(' | ') + '\n'; + } + var usage = ['', ' Usage: ' + cmdName + ' ' + this.usage(), '']; -command.usage = function (str) { - var args = this._args.map(function (arg) { - return VorpalUtil.humanReadableArgName(arg); - }); + var cmds = []; - var usage = '[options]' + (this.commands.length ? ' [command]' : '') + (this._args.length ? ' ' + args.join(' ') : ''); + var help = String(this.optionHelp().replace(/^/gm, ' ')); + var options = [' Options:', '', help, '']; - if (arguments.length === 0) { - return this._usage || usage; - } + var res = usage.concat(cmds).concat(alias).concat(desc).concat(options).join('\n'); - this._usage = str; + res = res.replace(/\n\n\n/g, '\n\n'); - return this; -}; + return res; + } -/** - * Returns the help string for the command's options. - * - * @return {String} - * @api public - */ + /** + * Doesn't show command in the help menu. + * + * @return {Command} + * @api public + */ + + }, { + key: 'hidden', + value: function hidden() { + this._hidden = true; + return this; + } -command.optionHelp = function () { - var width = this._largestOptionLength(); + /** + * Allows undeclared options to be passed in with the command. + * + * @param {Boolean} [allowUnknownOptions=true] + * @return {Command} + * @api public + */ - // Prepend the help information - return [VorpalUtil.pad('--help', width) + ' output usage information'].concat(this.options.map(function (option) { - return VorpalUtil.pad(option.flags, width) + ' ' + option.description; - })).join('\n'); -}; + }, { + key: 'allowUnknownOptions', + value: function allowUnknownOptions() { + var _allowUnknownOptions = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; -/** - * Returns the length of the longest option. - * - * @return {Integer} - * @api private - */ + _allowUnknownOptions = _allowUnknownOptions === 'false' ? false : _allowUnknownOptions; -command._largestOptionLength = function () { - return this.options.reduce(function (max, option) { - return Math.max(max, option.flags.length); - }, 0); -}; + this._allowUnknownOptions = !!_allowUnknownOptions; + return this; + } -/** - * Adds a custom handling for the --help flag. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + /** + * Returns the command usage string for help. + * + * @param {String} str + * @return {String} + * @api public + */ -command.help = function (fn) { - if (_.isFunction(fn)) { - this._help = fn; - } - return this; -}; + }, { + key: 'usage', + value: function usage(str) { + var args = this._args.map(function (arg) { + return _util2.default.humanReadableArgName(arg); + }); -/** - * Edits the raw command string before it - * is executed. - * - * @param {String} str - * @return {String} str - * @api public - */ + var usage = '[options]' + (this.commands.length ? ' [command]' : '') + (this._args.length ? ' ' + args.join(' ') : ''); -command.parse = function (fn) { - if (_.isFunction(fn)) { - this._parse = fn; - } - return this; -}; + var isGetter = arguments.length === 0; -/** - * Adds a command to be executed after command completion. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + if (!isGetter) { + this._usage = str; + } -command.after = function (fn) { - if (_.isFunction(fn)) { - this._after = fn; - } - return this; -}; + return isGetter ? this._usage || usage : this; + } -/** - * Parses and returns expected command arguments. - * - * @param {String} args - * @return {Array} - * @api private - */ + /** + * Returns the help string for the command's options. + * + * @return {String} + * @api public + */ + + }, { + key: 'optionHelp', + value: function optionHelp() { + var width = this._largestOptionLength(); + + // Prepend the help information + return [_util2.default.pad('--help', width) + ' output usage information'].concat(this.options.map(function (option) { + return _util2.default.pad(option.flags, width) + ' ' + option.description; + })).join('\n'); + } -command._parseExpectedArgs = function (args) { - if (!args.length) { - return; - } - var self = this; - args.forEach(function (arg) { - var argDetails = { - required: false, - name: '', - variadic: false - }; - - switch (arg[0]) { - case '<': - argDetails.required = true; - argDetails.name = arg.slice(1, -1); - break; - case '[': - argDetails.name = arg.slice(1, -1); - break; - default: - break; + /** + * Returns the length of the longest option. + * + * @return {Integer} + * @api private + */ + + }, { + key: '_largestOptionLength', + value: function _largestOptionLength() { + return this.options.reduce(function (max, option) { + return Math.max(max, option.flags.length); + }, 0); } - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { - argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); + /** + * Adds a custom handling for the --help flag. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + }, { + key: 'help', + value: function help(fn) { + if (_lodash2.default.isFunction(fn)) { + this._help = fn; + } + return this; } - if (argDetails.name) { - self._args.push(argDetails); + + /** + * Edits the raw command string before it + * is executed. + * + * @param {String} str + * @return {String} str + * @api public + */ + + }, { + key: 'parse', + value: function parse(fn) { + if (_lodash2.default.isFunction(fn)) { + this._parse = fn; + } + return this; } - }); - // If the user entered args in a weird order, - // properly sequence them. - if (self._args.length > 1) { - self._args = self._args.sort(function (argu1, argu2) { - if (argu1.required && !argu2.required) { - return -1; - } else if (argu2.required && !argu1.required) { - return 1; - } else if (argu1.variadic && !argu2.variadic) { - return 1; - } else if (argu2.variadic && !argu1.variadic) { - return -1; + /** + * Adds a command to be executed after command completion. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + }, { + key: 'after', + value: function after(fn) { + if (_lodash2.default.isFunction(fn)) { + this._after = fn; } - return 0; - }); - } + return this; + } - return; -}; + /** + * Parses and returns expected command arguments. + * + * @param {String} args + * @return {Array} + * @api private + */ + + }, { + key: '_parseExpectedArgs', + value: function _parseExpectedArgs(args) { + var _this5 = this; + + if (!args.length) { + return; + } -/** - * Converts string to camel case. - * - * @param {String} flag - * @return {String} - * @api private - */ + args.forEach(function (arg) { + var argDetails = { + required: false, + name: '', + variadic: false + }; + + switch (arg[0]) { + case '<': + argDetails.required = true; + argDetails.name = arg.slice(1, -1); + break; + case '[': + argDetails.name = arg.slice(1, -1); + break; + default: + break; + } -function _camelcase(flag) { - return flag.split('-').reduce(function (str, word) { - return str + word[0].toUpperCase() + word.slice(1); - }); -} + if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { + argDetails.variadic = true; + argDetails.name = argDetails.name.slice(0, -3); + } + if (argDetails.name) { + _this5._args.push(argDetails); + } + }); + + // If the user entered args in a weird order, + // properly sequence them. + if (this._args.length > 1) { + this._args = this._args.sort(function (argu1, argu2) { + if (argu1.required && !argu2.required) { + return -1; + } else if (argu2.required && !argu1.required) { + return 1; + } else if (argu1.variadic && !argu2.variadic) { + return 1; + } else if (argu2.variadic && !argu1.variadic) { + return -1; + } + return 0; + }); + } -/** - * Make command an EventEmitter. - */ + return; + } + }]); -command.__proto__ = EventEmitter.prototype; \ No newline at end of file + return Command; +}(_events.EventEmitter); \ No newline at end of file diff --git a/dist/option.js b/dist/option.js index 4d130eff..ccffb5a3 100755 --- a/dist/option.js +++ b/dist/option.js @@ -2,6 +2,12 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _lodash = require('lodash'); + +var _lodash2 = _interopRequireDefault(_lodash); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Option = function () { @@ -16,14 +22,21 @@ var Option = function () { * @api public */ - function Option(flags, description, autocomplete) { + function Option(flags, description) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + _classCallCheck(this, Option); + options = _lodash2.default.isPlainObject(options) ? options : { + autocomplete: options + }; + + this.autocomplete = _lodash2.default.get(options, 'autocomplete'); + this._default = _lodash2.default.get(options, 'default', null); this.flags = flags; this.required = ~flags.indexOf('<'); this.optional = ~flags.indexOf('['); - this.bool = ! ~flags.indexOf('-no-'); - this.autocomplete = autocomplete; + this.bool = !~flags.indexOf('-no-'); flags = flags.split(/[ ,|]+/); if (flags.length > 1 && !/^[[<]/.test(flags[1])) { this.assignFlag(flags.shift()); @@ -78,6 +91,11 @@ var Option = function () { this.short = flag; } } + }, { + key: 'default', + value: function _default() { + return this._default; + } }]); return Option; diff --git a/dist/ui.js b/dist/ui.js index 3a70b419..0d67245a 100755 --- a/dist/ui.js +++ b/dist/ui.js @@ -34,7 +34,7 @@ var UI = function (_EventEmitter) { function UI() { _classCallCheck(this, UI); - var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UI).call(this)); + var _this = _possibleConstructorReturn(this, (UI.__proto__ || Object.getPrototypeOf(UI)).call(this)); var self = _this; @@ -193,7 +193,7 @@ var UI = function (_EventEmitter) { value: function prompt(options, cb) { var _this2 = this; - var prompt = undefined; + var prompt = void 0; options = options || {}; if (!this.parent) { return prompt; diff --git a/dist/util.js b/dist/util.js index 2d5126a5..21514942 100755 --- a/dist/util.js +++ b/dist/util.js @@ -24,7 +24,7 @@ var util = { parseArgs: function parseArgs(str, opts) { var reg = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; var arr = []; - var match = undefined; + var match = void 0; do { match = reg.exec(str); if (match !== null) { @@ -49,9 +49,9 @@ var util = { parseCommand: function parseCommand(command, commands) { var self = this; var pipes = []; - var match = undefined; - var matchArgs = undefined; - var matchParts = undefined; + var match = void 0; + var matchArgs = void 0; + var matchParts = void 0; function parsePipes() { // First, split the command by pipes naively. @@ -146,8 +146,8 @@ var util = { matchCommand: function matchCommand(cmd, cmds) { var parts = String(cmd).trim().split(' '); - var match = undefined; - var matchArgs = undefined; + var match = void 0; + var matchArgs = void 0; for (var i = 0; i < parts.length; ++i) { var subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); match = _.find(cmds, { _name: subcommand }) || match; @@ -175,8 +175,8 @@ var util = { if (match) { var allCommands = _.map(cmds, '_name'); var wordMatch = false; - for (var key in allCommands) { - var _cmd2 = allCommands[key]; + for (var _key in allCommands) { + var _cmd2 = allCommands[_key]; var parts2 = String(_cmd2).split(' '); var cmdParts = String(match.command).split(' '); var matchAll = true; @@ -295,11 +295,15 @@ var util = { var exist = parsedArgs[short] !== undefined ? parsedArgs[short] : undefined; exist = exist === undefined && parsedArgs[long] !== undefined ? parsedArgs[long] : exist; var existsNotSet = exist === true || exist === false; - if (existsNotSet && o.required !== 0) { + var defaultValue = o.default(); + + if (existsNotSet && o.required !== 0 && !defaultValue) { return '\n Missing required value for option ' + (o.long || o.short) + '. Showing Help:'; } if (exist !== undefined) { args.options[long || short] = exist; + } else if (defaultValue) { + args.options[long || short] = defaultValue; } } diff --git a/dist/vorpal.js b/dist/vorpal.js index a103f270..f62543bb 100755 --- a/dist/vorpal.js +++ b/dist/vorpal.js @@ -553,7 +553,7 @@ vorpal.prompt = function () { } }; - var prompt = undefined; + var prompt = void 0; var ssn = _this.getSessionById(options.sessionId); if (!ssn) { diff --git a/lib/command.js b/lib/command.js index ed52cc56..0723339b 100755 --- a/lib/command.js +++ b/lib/command.js @@ -3,584 +3,546 @@ /** * Module dependencies. */ - -var EventEmitter = require('events').EventEmitter; -var Option = require('./option'); -var VorpalUtil = require('./util'); -var _ = require('lodash'); +import { + EventEmitter +} from 'events'; +import Option from './option'; +import VorpalUtil from './util'; +import _ from 'lodash'; /** - * Command prototype. - */ - -var command = Command.prototype; - -/** - * Expose `Command`. - */ - -module.exports = exports = Command; - -/** - * Initialize a new `Command` instance. + * Converts string to camel case. * - * @param {String} name - * @param {Vorpal} parent - * @return {Command} - * @api public + * @param {String} flag + * @return {String} + * @api private */ - -function Command(name, parent) { - if (!(this instanceof Command)) { - return new Command(); - } - this.commands = []; - this.options = []; - this._args = []; - this._aliases = []; - this._name = name; - this._relay = false; - this._hidden = false; - this._parent = parent; - this._mode = false; - this._catch = false; - this._help = undefined; - this._init = undefined; - this._after = undefined; - this._allowUnknownOptions = false; +function _camelcase(flag) { + return flag.split('-').reduce(function (str, word) { + return str + word[0].toUpperCase() + word.slice(1); + }); } -/** - * Registers an option for given command. - * - * @param {String} flags - * @param {String} description - * @param {Function} fn - * @param {String} defaultValue - * @return {Command} - * @api public - */ +module.exports = class Command extends EventEmitter { + constructor(name, parent) { + super(...arguments); -command.option = function (flags, description, autocomplete) { - var self = this; - var option = new Option(flags, description, autocomplete); - var oname = option.name(); - var name = _camelcase(oname); - var defaultValue; - - // preassign default value only for --no-*, [optional], or - if (option.bool === false || option.optional || option.required) { - // when --no-* we make sure default is true - if (option.bool === false) { - defaultValue = true; - } - // preassign only if we have a default - if (defaultValue !== undefined) { - self[name] = defaultValue; + if (!(this instanceof Command)) { + return new Command(); } + + this.commands = []; + this.options = []; + this._args = []; + this._aliases = []; + this._name = name; + this._relay = false; + this._hidden = false; + this._parent = parent; + this._mode = false; + this._catch = false; + this._help = undefined; + this._init = undefined; + this._after = undefined; + this._allowUnknownOptions = false; } - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function (val) { - // unassigned or bool - if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { - // if no value, bool true, and we have a default, then use it! - if (val === null) { - self[name] = option.bool ? - defaultValue || true : - false; - } else { - self[name] = val; + /** + * Registers an option for given command. + * + * @param {String} flags + * @param {String} description + * @param {Function} fn + * @param {String} defaultValue + * @return {Command} + * @api public + */ + option(flags, description, options = {}) { + const option = new Option(flags, description, options); + const oname = option.name(); + const name = _camelcase(oname); + let defaultValue; + + // preassign default value only for --no-*, [optional], or + if (option.bool === false || option.optional || option.required) { + // when --no-* we make sure default is true + if (option.bool === false) { + defaultValue = true; + } + // preassign only if we have a default + if (defaultValue !== undefined) { + this[name] = defaultValue; } - } else if (val !== null) { - // reassign - self[name] = val; } - }); - - return this; -}; - -/** - * Defines an action for a given command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - -command.action = function (fn) { - var self = this; - self._fn = fn; - return this; -}; - -/** - * Defines a function to validate arguments - * before action is performed. Arguments - * are valid if no errors are thrown from - * the function. - * - * @param fn - * @returns {Command} - * @api public - */ -command.validate = function (fn) { - var self = this; - self._validate = fn; - return this; -}; - -/** - * Defines a function to be called when the - * command is canceled. - * - * @param fn - * @returns {Command} - * @api public - */ -command.cancel = function (fn) { - this._cancel = fn; - return this; -}; - -/** - * Defines a method to be called when - * the command set has completed. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - -command.done = function (fn) { - this._done = fn; - return this; -}; - -/** - * Defines tabbed auto-completion - * for the given command. Favored over - * deprecated command.autocompletion. - * - * @param {Function} fn - * @return {Command} - * @api public - */ -command.autocomplete = function (obj) { - this._autocomplete = obj; - return this; -}; + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on(oname, (val) => { + // unassigned or bool + if (typeof this[name] === 'boolean' || typeof this[name] === 'undefined') { + // if no value, bool true, and we have a default, then use it! + if (val === null) { + this[name] = option.bool ? + defaultValue || true : + false; + } else { + this[name] = val; + } + } else if (val !== null) { + // reassign + this[name] = val; + } + }); -/** - * Defines tabbed auto-completion rules - * for the given command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + return this; + } -command.autocompletion = function (param) { - this._parent._useDeprecatedAutocompletion = true; - if (!_.isFunction(param) && !_.isObject(param)) { - throw new Error('An invalid object type was passed into the first parameter of command.autocompletion: function expected.'); + /** + * Defines an action for a given command. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + action(fn) { + this._fn = fn; + + return this; } - this._autocompletion = param; - return this; -}; + /** + * Defines a function to validate arguments + * before action is performed. Arguments + * are valid if no errors are thrown from + * the function. + * + * @param fn + * @returns {Command} + * @api public + */ + validate(fn) { + this._validate = fn; + return this; + } -/** - * Defines an init action for a mode command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + /** + * Defines a function to be called when the + * command is canceled. + * + * @param fn + * @returns {Command} + * @api public + */ + cancel(fn) { + this._cancel = fn; + return this; + } -command.init = function (fn) { - var self = this; - if (self._mode !== true) { - throw Error('Cannot call init from a non-mode action.'); + /** + * Defines a method to be called when + * the command set has completed. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + done(fn) { + this._done = fn; + return this; } - self._init = fn; - return this; -}; -/** - * Defines a prompt delimiter for a - * mode once entered. - * - * @param {String} delimiter - * @return {Command} - * @api public - */ + /** + * Defines tabbed auto-completion + * for the given command. Favored over + * deprecated command.autocompletion. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + autocomplete(obj) { + this._autocomplete = obj; + return this; + } -command.delimiter = function (delimiter) { - this._delimiter = delimiter; - return this; -}; + /** + * Defines tabbed auto-completion rules + * for the given command. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + autocompletion(param) { + this._parent._useDeprecatedAutocompletion = true; + if (!_.isFunction(param) && !_.isObject(param)) { + throw new Error('An invalid object type was passed into the first parameter of command.autocompletion: function expected.'); + } -/** - * Sets args for static typing of options - * using minimist. - * - * @param {Object} types - * @return {Command} - * @api public - */ + this._autocompletion = param; + return this; + } -command.types = function (types) { - var supported = ['string', 'boolean']; - for (var item in types) { - if (supported.indexOf(item) === -1) { - throw new Error('An invalid type was passed into command.types(): ' + item); + /** + * Defines an init action for a mode command. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + + init(fn) { + if (this._mode !== true) { + throw Error('Cannot call init from a non-mode action.'); } - types[item] = (!_.isArray(types[item])) ? [types[item]] : types[item]; + this._init = fn; + return this; } - this._types = types; - return this; -}; -/** - * Defines an alias for a given command. - * - * @param {String} alias - * @return {Command} - * @api public - */ + /** + * Defines a prompt delimiter for a + * mode once entered. + * + * @param {String} delimiter + * @return {Command} + * @api public + */ + delimiter(delimiter) { + this._delimiter = delimiter; + return this; + } -command.alias = function () { - var self = this; - for (var i = 0; i < arguments.length; ++i) { - var alias = arguments[i]; - if (_.isArray(alias)) { - for (var j = 0; j < alias.length; ++j) { - this.alias(alias[j]); + /** + * Sets args for static typing of options + * using minimist. + * + * @param {Object} types + * @return {Command} + * @api public + */ + types(types) { + const supported = ['string', 'boolean']; + + for (let item in types) { + if (supported.indexOf(item) === -1) { + throw new Error('An invalid type was passed into command.types(): ' + item); } - return this; + types[item] = (!_.isArray(types[item])) ? [types[item]] : types[item]; } - this._parent.commands.forEach(function (cmd) { - if (!_.isEmpty(cmd._aliases)) { - if (_.includes(cmd._aliases, alias)) { - var msg = 'Duplicate alias "' + alias + '" for command "' + self._name + '" detected. Was first reserved by command "' + cmd._name + '".'; - throw new Error(msg); - } - } - }); - this._aliases.push(alias); + this._types = types; + return this; } - return this; -}; - -/** - * Defines description for given command. - * - * @param {String} str - * @return {Command} - * @api public - */ -command.description = function (str) { - if (arguments.length === 0) { - return this._description; - } - this._description = str; - return this; -}; + /** + * Defines an alias for a given command. + * + * @param {String} alias + * @return {Command} + * @api public + */ + alias() { + for (let i = 0; i < arguments.length; ++i) { + const alias = arguments[i]; + + if (_.isArray(alias)) { + for (var j = 0; j < alias.length; ++j) { + this.alias(alias[j]); + } + return this; + } -/** - * Removes self from Vorpal instance. - * - * @return {Command} - * @api public - */ + this._parent.commands.forEach(function (cmd) { + if (!_.isEmpty(cmd._aliases)) { + if (_.includes(cmd._aliases, alias)) { + const msg = `Duplicate alias "${alias}" for command "${this._name}" detected. Was first reserved by command "${cmd._name}".`; + throw new Error(msg); + } + } + }); -command.remove = function () { - var self = this; - this._parent.commands = _.reject(this._parent.commands, function (command) { - if (command._name === self._name) { - return true; + this._aliases.push(alias); } - }); - return this; -}; -/** - * Returns the commands arguments as string. - * - * @param {String} desc - * @return {String} - * @api public - */ + return this; + } -command.arguments = function (desc) { - return this._parseExpectedArgs(desc.split(/ +/)); -}; + /** + * Defines description for given command. + * + * @param {String} str + * @return {Command} + * @api public + */ + description(str) { + const isGetter = arguments.length === 0; + + if (!isGetter) { + this._description = str; + } -/** - * Returns the help info for given command. - * - * @return {String} - * @api public - */ + return isGetter ? this._description : this; + } -command.helpInformation = function () { - var desc = []; - var cmdName = this._name; - var alias = ''; + /** + * Removes self from Vorpal instance. + * + * @return {Command} + * @api public + */ - if (this._description) { - desc = [ - ' ' + this._description, - '' - ]; - } + remove() { + this._parent.commands = _.reject(this._parent.commands, (command) => { + return command._name === this._name; + }); - if (this._aliases.length > 0) { - alias = ' Alias: ' + this._aliases.join(' | ') + '\n'; + return this; } - var usage = [ - '', - ' Usage: ' + cmdName + ' ' + this.usage(), - '' - ]; - - var cmds = []; - - var help = String(this.optionHelp().replace(/^/gm, ' ')); - var options = [ - ' Options:', - '', - help, - '' - ]; - - var res = usage - .concat(cmds) - .concat(alias) - .concat(desc) - .concat(options) - .join('\n'); - - res = res.replace(/\n\n\n/g, '\n\n'); - - return res; -}; -/** - * Doesn't show command in the help menu. - * - * @return {Command} - * @api public - */ + /** + * Returns the commands arguments as string. + * + * @param {String} desc + * @return {String} + * @api public + */ -command.hidden = function () { - this._hidden = true; - return this; -}; + arguments(desc) { + return this._parseExpectedArgs(desc.split(/ +/)); + } -/** - * Allows undeclared options to be passed in with the command. - * - * @param {Boolean} [allowUnknownOptions=true] - * @return {Command} - * @api public - */ + /** + * Returns the help info for given command. + * + * @return {String} + * @api public + */ + + helpInformation() { + let desc = []; + const cmdName = this._name; + let alias = ''; + + if (this._description) { + desc = [ + ' ' + this._description, + '' + ]; + } -command.allowUnknownOptions = function (allowUnknownOptions = true) { - allowUnknownOptions = allowUnknownOptions === "false" ? false : allowUnknownOptions; + if (this._aliases.length > 0) { + alias = ' Alias: ' + this._aliases.join(' | ') + '\n'; + } + const usage = [ + '', + ' Usage: ' + cmdName + ' ' + this.usage(), + '' + ]; - this._allowUnknownOptions = !!allowUnknownOptions; - return this; -}; + const cmds = []; -/** - * Returns the command usage string for help. - * - * @param {String} str - * @return {String} - * @api public - */ + const help = String(this.optionHelp().replace(/^/gm, ' ')); + const options = [ + ' Options:', + '', + help, + '' + ]; -command.usage = function (str) { - var args = this._args.map(function (arg) { - return VorpalUtil.humanReadableArgName(arg); - }); + let res = usage + .concat(cmds) + .concat(alias) + .concat(desc) + .concat(options) + .join('\n'); - var usage = '[options]' + - (this.commands.length ? ' [command]' : '') + - (this._args.length ? ' ' + args.join(' ') : ''); + res = res.replace(/\n\n\n/g, '\n\n'); - if (arguments.length === 0) { - return (this._usage || usage); + return res; } - this._usage = str; - - return this; -}; + /** + * Doesn't show command in the help menu. + * + * @return {Command} + * @api public + */ -/** - * Returns the help string for the command's options. - * - * @return {String} - * @api public - */ + hidden() { + this._hidden = true; + return this; + } -command.optionHelp = function () { - var width = this._largestOptionLength(); + /** + * Allows undeclared options to be passed in with the command. + * + * @param {Boolean} [allowUnknownOptions=true] + * @return {Command} + * @api public + */ + allowUnknownOptions(allowUnknownOptions = true) { + allowUnknownOptions = allowUnknownOptions === 'false' ? false : allowUnknownOptions; + + this._allowUnknownOptions = !!allowUnknownOptions; + return this; + } - // Prepend the help information - return [VorpalUtil.pad('--help', width) + ' output usage information'] - .concat(this.options.map(function (option) { - return VorpalUtil.pad(option.flags, width) + ' ' + option.description; - })) - .join('\n'); -}; + /** + * Returns the command usage string for help. + * + * @param {String} str + * @return {String} + * @api public + */ + usage(str) { + const args = this._args.map((arg) => { + return VorpalUtil.humanReadableArgName(arg); + }); -/** - * Returns the length of the longest option. - * - * @return {Integer} - * @api private - */ + const usage = '[options]' + + (this.commands.length ? ' [command]' : '') + + (this._args.length ? ' ' + args.join(' ') : ''); -command._largestOptionLength = function () { - return this.options.reduce(function (max, option) { - return Math.max(max, option.flags.length); - }, 0); -}; + const isGetter = arguments.length === 0; -/** - * Adds a custom handling for the --help flag. - * - * @param {Function} fn - * @return {Command} - * @api public - */ + if (!isGetter) { + this._usage = str; + } -command.help = function (fn) { - if (_.isFunction(fn)) { - this._help = fn; + return isGetter ? (this._usage || usage) : this; } - return this; -}; - -/** - * Edits the raw command string before it - * is executed. - * - * @param {String} str - * @return {String} str - * @api public - */ -command.parse = function (fn) { - if (_.isFunction(fn)) { - this._parse = fn; + /** + * Returns the help string for the command's options. + * + * @return {String} + * @api public + */ + optionHelp() { + const width = this._largestOptionLength(); + + // Prepend the help information + return [VorpalUtil.pad('--help', width) + ' output usage information'] + .concat(this.options.map((option) => { + return VorpalUtil.pad(option.flags, width) + ' ' + option.description; + })) + .join('\n'); } - return this; -}; - -/** - * Adds a command to be executed after command completion. - * - * @param {Function} fn - * @return {Command} - * @api public - */ -command.after = function (fn) { - if (_.isFunction(fn)) { - this._after = fn; + /** + * Returns the length of the longest option. + * + * @return {Integer} + * @api private + */ + _largestOptionLength() { + return this.options.reduce((max, option) => { + return Math.max(max, option.flags.length); + }, 0); } - return this; -}; -/** - * Parses and returns expected command arguments. - * - * @param {String} args - * @return {Array} - * @api private - */ - -command._parseExpectedArgs = function (args) { - if (!args.length) { - return; - } - var self = this; - args.forEach(function (arg) { - var argDetails = { - required: false, - name: '', - variadic: false - }; - - switch (arg[0]) { - case '<': - argDetails.required = true; - argDetails.name = arg.slice(1, -1); - break; - case '[': - argDetails.name = arg.slice(1, -1); - break; - default: - break; + /** + * Adds a custom handling for the --help flag. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + help(fn) { + if (_.isFunction(fn)) { + this._help = fn; } + return this; + } - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { - argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); - } - if (argDetails.name) { - self._args.push(argDetails); + /** + * Edits the raw command string before it + * is executed. + * + * @param {String} str + * @return {String} str + * @api public + */ + parse(fn) { + if (_.isFunction(fn)) { + this._parse = fn; } - }); + return this; + } - // If the user entered args in a weird order, - // properly sequence them. - if (self._args.length > 1) { - self._args = self._args.sort(function (argu1, argu2) { - if (argu1.required && !argu2.required) { - return -1; - } else if (argu2.required && !argu1.required) { - return 1; - } else if (argu1.variadic && !argu2.variadic) { - return 1; - } else if (argu2.variadic && !argu1.variadic) { - return -1; - } - return 0; - }); + /** + * Adds a command to be executed after command completion. + * + * @param {Function} fn + * @return {Command} + * @api public + */ + after(fn) { + if (_.isFunction(fn)) { + this._after = fn; + } + return this; } - return; -}; + /** + * Parses and returns expected command arguments. + * + * @param {String} args + * @return {Array} + * @api private + */ + _parseExpectedArgs(args) { + if (!args.length) { + return; + } -/** - * Converts string to camel case. - * - * @param {String} flag - * @return {String} - * @api private - */ + args.forEach((arg) => { + const argDetails = { + required: false, + name: '', + variadic: false + }; + + switch (arg[0]) { + case '<': + argDetails.required = true; + argDetails.name = arg.slice(1, -1); + break; + case '[': + argDetails.name = arg.slice(1, -1); + break; + default: + break; + } -function _camelcase(flag) { - return flag.split('-').reduce(function (str, word) { - return str + word[0].toUpperCase() + word.slice(1); - }); -} + if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { + argDetails.variadic = true; + argDetails.name = argDetails.name.slice(0, -3); + } + if (argDetails.name) { + this._args.push(argDetails); + } + }); -/** - * Make command an EventEmitter. - */ + // If the user entered args in a weird order, + // properly sequence them. + if (this._args.length > 1) { + this._args = this._args.sort((argu1, argu2) => { + if (argu1.required && !argu2.required) { + return -1; + } else if (argu2.required && !argu1.required) { + return 1; + } else if (argu1.variadic && !argu2.variadic) { + return 1; + } else if (argu2.variadic && !argu1.variadic) { + return -1; + } + return 0; + }); + } -command.__proto__ = EventEmitter.prototype; + return; + } +}; diff --git a/lib/option.js b/lib/option.js index 3ef05aa1..b140ca06 100755 --- a/lib/option.js +++ b/lib/option.js @@ -1,4 +1,4 @@ -'use strict'; +import _ from 'lodash'; class Option { @@ -12,12 +12,17 @@ class Option { * @api public */ - constructor(flags, description, autocomplete) { + constructor(flags, description, options = {}) { + options = _.isPlainObject(options) ? options : { + autocomplete: options + }; + + this.autocomplete = _.get(options, 'autocomplete'); + this._default = _.get(options, 'default', null); this.flags = flags; this.required = ~flags.indexOf('<'); this.optional = ~flags.indexOf('['); this.bool = !~flags.indexOf('-no-'); - this.autocomplete = autocomplete; flags = flags.split(/[ ,|]+/); if (flags.length > 1 && !/^[[<]/.test(flags[1])) { this.assignFlag(flags.shift()); @@ -69,6 +74,10 @@ class Option { this.short = flag; } } + + default() { + return this._default; + } } /** diff --git a/lib/ui.js b/lib/ui.js index e049ed4a..00d634e4 100755 --- a/lib/ui.js +++ b/lib/ui.js @@ -239,8 +239,7 @@ class UI extends EventEmitter { inquirer.prompt.prompts.input.prototype.getQuestion = function () { self._activePrompt = this; let message = this.opt.message; - if ((this.opt.default || this.opt.default === false) - && this.status !== 'answered') { + if ((this.opt.default || this.opt.default === false) && this.status !== 'answered') { message += chalk.dim('(' + this.opt.default + ') '); } self.inquirerStdout.push(message); diff --git a/lib/util.js b/lib/util.js index 2de72266..74dcbf9b 100755 --- a/lib/util.js +++ b/lib/util.js @@ -291,11 +291,15 @@ const util = { let exist = (parsedArgs[short] !== undefined) ? parsedArgs[short] : undefined; exist = (exist === undefined && parsedArgs[long] !== undefined) ? parsedArgs[long] : exist; const existsNotSet = (exist === true || exist === false); - if (existsNotSet && o.required !== 0) { + const defaultValue = o.default(); + + if (existsNotSet && o.required !== 0 && ! defaultValue) { return `\n Missing required value for option ${(o.long || o.short)}. Showing Help:`; } if (exist !== undefined) { args.options[long || short] = exist; + } else if (defaultValue) { + args.options[long || short] = defaultValue; } } diff --git a/test/vorpal.js b/test/vorpal.js index 2418b6c6..2f99247c 100755 --- a/test/vorpal.js +++ b/test/vorpal.js @@ -84,6 +84,15 @@ vorpal return args; }); +vorpal + .command('defaultValues ') + .option('-s, --sound [sound]', 'Animal Sound', { + default : 'moo', + }) + .action(function (args, cb) { + return args; + }); + require('assert'); describe('argument parsing', function () { @@ -285,6 +294,20 @@ describe('option parsing', function () { }); }); + describe('options with default values', function () { + it('should allow for default values', function () { + var fixture = obj({ options: { sound: 'moo' }, animal: 'cow' }); + + obj(vorpal.execSync('defaultValues cow')).should.equal(fixture); + }); + + it('should allow for overwriting the default values', function () { + var fixture = obj({ options: { sound: 'bark' }, animal: 'dog' }); + + obj(vorpal.execSync('defaultValues --sound bark dog')).should.equal(fixture); + }); + }); + describe('negated options', function () { it('should make a boolean option false', function () { var fixture = obj({ options: { bool: false }, args: ['cows'] }); From 8f3b815befd34b33e24e0e82217b4f08921b3976 Mon Sep 17 00:00:00 2001 From: Jason Brumwell Date: Wed, 12 Apr 2017 11:53:37 -0400 Subject: [PATCH 02/38] Review fixes --- dist/option.js | 14 +++++--------- lib/option.js | 8 ++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/dist/option.js b/dist/option.js index ccffb5a3..aff28351 100755 --- a/dist/option.js +++ b/dist/option.js @@ -1,12 +1,8 @@ 'use strict'; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _lodash = require('lodash'); +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -27,12 +23,12 @@ var Option = function () { _classCallCheck(this, Option); - options = _lodash2.default.isPlainObject(options) ? options : { + options = (typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' ? options : { autocomplete: options }; - this.autocomplete = _lodash2.default.get(options, 'autocomplete'); - this._default = _lodash2.default.get(options, 'default', null); + this.autocomplete = options.autocomplete; + this._default = options.default ? options.default : null; this.flags = flags; this.required = ~flags.indexOf('<'); this.optional = ~flags.indexOf('['); diff --git a/lib/option.js b/lib/option.js index b140ca06..f8710b71 100755 --- a/lib/option.js +++ b/lib/option.js @@ -1,4 +1,4 @@ -import _ from 'lodash'; +'use strict'; class Option { @@ -13,12 +13,12 @@ class Option { */ constructor(flags, description, options = {}) { - options = _.isPlainObject(options) ? options : { + options = typeof options === 'object' ? options : { autocomplete: options }; - this.autocomplete = _.get(options, 'autocomplete'); - this._default = _.get(options, 'default', null); + this.autocomplete = options.autocomplete; + this._default = options.default ? options.default : null; this.flags = flags; this.required = ~flags.indexOf('<'); this.optional = ~flags.indexOf('['); From 7ced49ad054332929cd9ec7af9ed9ac7e11572d7 Mon Sep 17 00:00:00 2001 From: Nathan Schwartz Date: Fri, 5 May 2017 10:55:32 -0500 Subject: [PATCH 03/38] Rename variable from Vantage to Vorpal --- dist/ui.js | 3 ++- dist/vorpal.js | 1 + test/util/util.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/ui.js b/dist/ui.js index 0d67245a..c9d28ba4 100755 --- a/dist/ui.js +++ b/dist/ui.js @@ -68,6 +68,7 @@ var UI = function (_EventEmitter) { _this._sigintCount = 0; _this._sigint = function () { if (_this._sigintCount > 1) { + _this.parent.emit('vorpal_exit'); process.exit(0); } else { var text = _this.input(); @@ -141,7 +142,7 @@ var UI = function (_EventEmitter) { var render = inquirer.prompt.prompts[promptType].prototype.render; inquirer.prompt.prompts[promptType].prototype.render = function () { self._activePrompt = this; - return render.call(this); + return render.apply(this, arguments); }; }; diff --git a/dist/vorpal.js b/dist/vorpal.js index cbe34d8b..76ed7a8d 100755 --- a/dist/vorpal.js +++ b/dist/vorpal.js @@ -1229,6 +1229,7 @@ vorpal.getSessionById = function (id) { vorpal.exit = function (options) { var ssn = this.getSessionById(options.sessionId); + this.emit('vorpal_exit'); if (ssn.isLocal()) { process.exit(0); } else { diff --git a/test/util/util.js b/test/util/util.js index 095e11e1..e3301782 100755 --- a/test/util/util.js +++ b/test/util/util.js @@ -1,4 +1,4 @@ -var Vantage = require('../../'); +var Vorpal = require('../../'); var _ = require('lodash'); var path = require('path'); @@ -14,7 +14,7 @@ module.exports = { }); for (var i = 0; i < options.ports.length; ++i) { - var vorpal = new Vantage(); + var vorpal = new Vorpal(); var port = options.ports[i]; vorpal .delimiter(port + ':') From 4fffccce8dda172a36833981d1d8e25666ef9a6c Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 24 May 2017 20:48:56 -0700 Subject: [PATCH 04/38] Updated deps and switched to Yarn. --- package.json | 28 +- yarn.lock | 3480 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3493 insertions(+), 15 deletions(-) create mode 100644 yarn.lock diff --git a/package.json b/package.json index 6f87ab35..adc3e9b8 100644 --- a/package.json +++ b/package.json @@ -33,23 +33,21 @@ }, "homepage": "https://github.com/dthree/vorpal#readme", "devDependencies": { - "babel": "^6.3.26", - "babel-core": "^6.4.5", - "babel-preset-es2015": "^6.3.13", - "bluebird": "^3.1.1", - "gulp": "^3.9.0", + "babel": "^6.23.0", + "babel-core": "^6.24.1", + "babel-preset-es2015": "^6.24.1", + "bluebird": "^3.5.0", + "gulp": "^3.9.1", "gulp-babel": "^6.1.2", - "gulp-changed": "^1.3.0", - "gulp-eslint": "^1.1.1", - "gulp-xo": "^0.7.0", - "load-plugins": "^2.1.0", - "mocha": "^2.2.5", - "moment": "^2.10.3", - "request": "^2.58.0", - "should": "^6.0.3", - "vorpal-less": "0.0.4", + "gulp-changed": "^3.1.0", + "gulp-eslint": "^3.0.1", + "gulp-xo": "^0.15.0", + "load-plugins": "^2.1.2", + "mocha": "^3.4.2", + "should": "^11.2.1", + "vorpal-less": "^0.0.13", "vorpal-repl": "^1.1.8", - "xo": "^0.9.0" + "xo": "^0.18.2" }, "dependencies": { "babel-polyfill": "^6.3.14", diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..b2908ec7 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,3480 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" + +ajv-keywords@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" + +ajv@^4.7.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + dependencies: + string-width "^2.0.0" + +ansi-escapes@^1.0.0, ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +app-name@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/app-name/-/app-name-0.2.0.tgz#cab1b3fef599f8b001e083e49b3c2705ee80addc" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-differ@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1, array-uniq@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrayify-compact@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/arrayify-compact/-/arrayify-compact-0.2.0.tgz#459170e155ca12bb514484839c9d71507c80ec4d" + dependencies: + arr-flatten "^1.0.1" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +async-array-reduce@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/async-array-reduce/-/async-array-reduce-0.2.1.tgz#c8be010a2b5cd00dea96c81116034693dfdd82d1" + +babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-core@^6.0.2, babel-core@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.24.1" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-is-absolute "^1.0.0" + private "^0.1.6" + slash "^1.0.0" + source-map "^0.5.0" + +babel-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.24.1.tgz#7a9747f258d8947d32d515f6aa1c7bd02204a080" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + lodash "^4.2.0" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.24.1.tgz#d36e22fab1008d79d88648e32116868128456ce8" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + lodash "^4.2.0" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + lodash "^4.2.0" + +babel-plugin-transform-es2015-classes@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418" + dependencies: + regenerator-transform "0.9.11" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.3.14: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" + dependencies: + babel-runtime "^6.22.0" + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-preset-es2015@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-register@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" + dependencies: + babel-core "^6.24.1" + babel-runtime "^6.22.0" + core-js "^2.4.0" + home-or-tmp "^2.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.2" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-template@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + lodash "^4.2.0" + +babel-traverse@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babylon "^6.15.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.19.0, babel-types@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babel@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel/-/babel-6.23.0.tgz#d0d1e7d803e974765beea3232d4e153c0efb90f4" + +babylon@^6.11.0, babylon@^6.15.0: + version "6.17.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.1.tgz#17f14fddf361b695981fe679385e4f1c01ebd86f" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +beeper@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" + +bluebird@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" + +boxen@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.1.0.tgz#b1b69dd522305e807a99deee777dbd6e5167b102" + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^1.1.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^0.1.0" + widest-line "^1.0.0" + +brace-expansion@^1.0.0, brace-expansion@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +buf-compare@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buf-compare/-/buf-compare-1.0.1.tgz#fef28da8b8113a0a0db4430b0b6467b69730b34a" + +buffer-shims@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +bufferstreams@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/bufferstreams/-/bufferstreams-1.1.1.tgz#0161373060ac5988eff99058731114f6e195d51e" + dependencies: + readable-stream "^2.0.2" + +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +capture-stack-trace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +circular-json@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + +cli-cursor@^1.0.1, cli-cursor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-1.1.1.tgz#a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + +clone-stats@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" + +clone@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" + +clone@^1.0.0, clone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +commander@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +configstore@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.0.tgz#45df907073e26dfa1cf4b2d52f5b60545eaa11d1" + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + +convert-source-map@^1.1.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + +core-assert@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/core-assert/-/core-assert-0.2.1.tgz#f85e2cf9bfed28f773cc8b3fa5c5b69bdc02fe3f" + dependencies: + buf-compare "^1.0.0" + is-error "^2.2.0" + +core-js@^2.0.0, core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + +cross-spawn-async@^2.1.1: + version "2.2.5" + resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" + dependencies: + lru-cache "^4.0.0" + which "^1.2.8" + +cross-spawn@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +cwd@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/cwd/-/cwd-0.10.0.tgz#172400694057c22a13b0cf16162c7e4b7a7fe567" + dependencies: + find-pkg "^0.1.2" + fs-exists-sync "^0.1.0" + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +dateformat@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.0.0.tgz#2743e3abb5c3fc2462e527dca445e04e9f4dee17" + +debug@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + +debug@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + dependencies: + ms "0.7.2" + +debug@^2.1.1, debug@^2.2.0: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-assign@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-1.0.0.tgz#b092743be8427dc621ea0067cdec7e70dd19f37b" + dependencies: + is-obj "^1.0.0" + +deep-extend@~0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +deep-strict-equal@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/deep-strict-equal/-/deep-strict-equal-0.2.0.tgz#4a078147a8ab57f6a0d4f5547243cd22f44eb4e4" + dependencies: + core-assert "^0.2.0" + +defaults@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +deprecated@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/deprecated/-/deprecated-0.0.1.tgz#f9c9af5464afa1e7a971458a8bdef2aa94d5bb19" + +detect-file@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-0.1.0.tgz#4935dedfd9488648e006b0129566e9386711ea63" + dependencies: + fs-exists-sync "^0.1.0" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +dot-prop@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" + dependencies: + is-obj "^1.0.0" + +duplexer2@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" + dependencies: + readable-stream "~1.1.9" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + +end-of-stream@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" + dependencies: + once "~1.3.0" + +enhance-visitors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/enhance-visitors/-/enhance-visitors-1.0.0.tgz#aa945d05da465672a1ebd38fee2ed3da8518e95a" + dependencies: + lodash "^4.13.1" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.21" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.21.tgz#19a725f9e51d0300bbc1e8e821109fd9daf55925" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-config-xo@^0.18.0: + version "0.18.2" + resolved "https://registry.yarnpkg.com/eslint-config-xo/-/eslint-config-xo-0.18.2.tgz#0a157120875619929e735ffd6b185c41e8a187af" + +eslint-formatter-pretty@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-formatter-pretty/-/eslint-formatter-pretty-1.1.0.tgz#ab4d06da02fed8c13ae9f0dc540a433ef7ed6f5e" + dependencies: + ansi-escapes "^1.4.0" + chalk "^1.1.3" + log-symbols "^1.0.2" + plur "^2.1.2" + string-width "^2.0.0" + +eslint-import-resolver-node@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" + dependencies: + debug "^2.2.0" + object-assign "^4.0.1" + resolve "^1.1.6" + +eslint-module-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.0.0.tgz#a6f8c21d901358759cdc35dbac1982ae1ee58bce" + dependencies: + debug "2.2.0" + pkg-dir "^1.0.0" + +eslint-plugin-ava@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-ava/-/eslint-plugin-ava-4.2.0.tgz#12e4664659c1fae7895fa3f346c313ceb8907c77" + dependencies: + arrify "^1.0.1" + deep-strict-equal "^0.2.0" + enhance-visitors "^1.0.0" + espree "^3.1.3" + espurify "^1.5.0" + multimatch "^2.1.0" + pkg-up "^1.0.0" + req-all "^1.0.0" + +eslint-plugin-import@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.3.0.tgz#37c801e0ada0e296cbdf20c3f393acb5b52af36b" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.2.0" + doctrine "1.5.0" + eslint-import-resolver-node "^0.2.0" + eslint-module-utils "^2.0.0" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + +eslint-plugin-no-use-extend-native@^0.3.2: + version "0.3.12" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-use-extend-native/-/eslint-plugin-no-use-extend-native-0.3.12.tgz#3ad9a00c2df23b5d7f7f6be91550985a4ab701ea" + dependencies: + is-get-set-prop "^1.0.0" + is-js-type "^2.0.0" + is-obj-prop "^1.0.0" + is-proto-prop "^1.0.0" + +eslint-plugin-promise@^3.4.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" + +eslint-plugin-unicorn@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-2.1.1.tgz#3e9294366799b715e16a6df89159495b68930cb3" + dependencies: + lodash.camelcase "^4.1.1" + lodash.kebabcase "^4.0.1" + lodash.snakecase "^4.0.1" + lodash.upperfirst "^4.2.0" + req-all "^1.0.0" + +eslint@^3.0.0, eslint@^3.18.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.5.2" + debug "^2.1.1" + doctrine "^2.0.0" + escope "^3.6.0" + espree "^3.4.0" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.14.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.1.3, espree@^3.4.0: + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" + dependencies: + acorn "^5.0.1" + acorn-jsx "^3.0.0" + +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +espurify@^1.5.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226" + dependencies: + core-js "^2.0.0" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + dependencies: + estraverse "~4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +estraverse@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + +execa@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" + dependencies: + cross-spawn-async "^2.1.1" + is-stream "^1.1.0" + npm-run-path "^1.0.0" + object-assign "^4.0.1" + path-key "^1.0.0" + strip-eof "^1.0.0" + +execa@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" + dependencies: + cross-spawn "^4.0.0" + get-stream "^2.2.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +expand-tilde@^1.2.1, expand-tilde@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" + dependencies: + os-homedir "^1.0.1" + +extend-shallow@^2.0.0, extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +fancy-log@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" + dependencies: + chalk "^1.1.1" + time-stamp "^1.0.0" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-file-up@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/find-file-up/-/find-file-up-0.1.3.tgz#cf68091bcf9f300a40da411b37da5cce5a2fbea0" + dependencies: + fs-exists-sync "^0.1.0" + resolve-dir "^0.1.0" + +find-index@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" + +find-pkg@^0.1.0, find-pkg@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/find-pkg/-/find-pkg-0.1.2.tgz#1bdc22c06e36365532e2a248046854b9788da557" + dependencies: + find-file-up "^0.1.2" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +findup-sync@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12" + dependencies: + detect-file "^0.1.0" + is-glob "^2.0.1" + micromatch "^2.3.7" + resolve-dir "^0.1.0" + +fined@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fined/-/fined-1.0.2.tgz#5b28424b760d7598960b7ef8480dff8ad3660e97" + dependencies: + expand-tilde "^1.2.1" + lodash.assignwith "^4.0.7" + lodash.isempty "^4.2.1" + lodash.isplainobject "^4.0.4" + lodash.isstring "^4.0.1" + lodash.pick "^4.2.1" + parse-filepath "^1.0.1" + +first-chunk-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" + +flagged-respawn@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-0.3.2.tgz#ff191eddcd7088a675b2610fffc976be9b8074b5" + +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +fs-exists-sync@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +function-bind@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +gaze@^0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f" + dependencies: + globule "~0.1.0" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +get-set-props@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-set-props/-/get-set-props-0.1.0.tgz#998475c178445686d0b32246da5df8dbcfbe8ea3" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +get-stdin@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob-stream@^3.1.5: + version "3.1.18" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-3.1.18.tgz#9170a5f12b790306fdfe598f313f8f7954fd143b" + dependencies: + glob "^4.3.1" + glob2base "^0.0.12" + minimatch "^2.0.1" + ordered-read-streams "^0.1.0" + through2 "^0.6.1" + unique-stream "^1.0.0" + +glob-watcher@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-0.0.6.tgz#b95b4a8df74b39c83298b0c05c978b4d9a3b710b" + dependencies: + gaze "^0.5.1" + +glob2base@^0.0.12: + version "0.0.12" + resolved "https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56" + dependencies: + find-index "^0.1.1" + +glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^4.3.1: + version "4.5.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "^2.0.1" + once "^1.3.0" + +glob@~3.1.21: + version "3.1.21" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" + dependencies: + graceful-fs "~1.2.0" + inherits "1" + minimatch "~0.2.11" + +global-modules@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" + dependencies: + global-prefix "^0.1.4" + is-windows "^0.2.0" + +global-prefix@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f" + dependencies: + homedir-polyfill "^1.0.0" + ini "^1.3.4" + is-windows "^0.2.0" + which "^1.2.12" + +globals@^9.0.0, globals@^9.14.0: + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +globby@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +globule@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" + dependencies: + glob "~3.1.21" + lodash "~1.0.1" + minimatch "~0.2.11" + +glogg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" + dependencies: + sparkles "^1.0.0" + +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +graceful-fs@^3.0.0: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +graceful-fs@~1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +growl@1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" + +gulp-babel@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-6.1.2.tgz#7c0176e4ba3f244c60588a0c4b320a45d1adefce" + dependencies: + babel-core "^6.0.2" + gulp-util "^3.0.0" + object-assign "^4.0.1" + replace-ext "0.0.1" + through2 "^2.0.0" + vinyl-sourcemaps-apply "^0.2.0" + +gulp-changed@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/gulp-changed/-/gulp-changed-3.1.0.tgz#87cd1593a0bb4a5129dc2f229bece6d9488c272a" + dependencies: + gulp-util "^3.0.0" + pify "^2.3.0" + through2 "^2.0.0" + +gulp-eslint@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/gulp-eslint/-/gulp-eslint-3.0.1.tgz#04e57e3e18c6974267c12cf6855dc717d4a313bd" + dependencies: + bufferstreams "^1.1.1" + eslint "^3.0.0" + gulp-util "^3.0.6" + +gulp-util@^3.0.0, gulp-util@^3.0.6: + version "3.0.8" + resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" + dependencies: + array-differ "^1.0.0" + array-uniq "^1.0.2" + beeper "^1.0.0" + chalk "^1.0.0" + dateformat "^2.0.0" + fancy-log "^1.1.0" + gulplog "^1.0.0" + has-gulplog "^0.1.0" + lodash._reescape "^3.0.0" + lodash._reevaluate "^3.0.0" + lodash._reinterpolate "^3.0.0" + lodash.template "^3.0.0" + minimist "^1.1.0" + multipipe "^0.1.2" + object-assign "^3.0.0" + replace-ext "0.0.1" + through2 "^2.0.0" + vinyl "^0.5.0" + +gulp-xo@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/gulp-xo/-/gulp-xo-0.15.0.tgz#71022f11423ddb49e6a7d892717cde350886d129" + dependencies: + gulp-util "^3.0.6" + through2 "^2.0.0" + xo "^0.18.0" + +gulp@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/gulp/-/gulp-3.9.1.tgz#571ce45928dd40af6514fc4011866016c13845b4" + dependencies: + archy "^1.0.0" + chalk "^1.0.0" + deprecated "^0.0.1" + gulp-util "^3.0.0" + interpret "^1.0.0" + liftoff "^2.1.0" + minimist "^1.1.0" + orchestrator "^0.3.0" + pretty-hrtime "^1.0.0" + semver "^4.1.0" + tildify "^1.0.0" + v8flags "^2.0.2" + vinyl-fs "^0.3.0" + +gulplog@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + dependencies: + glogg "^1.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +has-glob@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/has-glob/-/has-glob-0.1.1.tgz#a261c4c2a6c667e0c77b700a7f297c39ef3aa589" + dependencies: + is-glob "^2.0.1" + +has-gulplog@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" + dependencies: + sparkles "^1.0.0" + +has@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +homedir-polyfill@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.4.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" + +ignore@^3.2.0, ignore@^3.2.6: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +in-publish@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" + +inherits@2, inherits@^2.0.3, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@^1.3.4, ini@~1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + +inquirer@0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.11.0.tgz#7448bfa924092af311d47173bbab990cae2bb027" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^1.0.1" + figures "^1.3.5" + lodash "^3.3.1" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + strip-ansi "^3.0.0" + through "^2.3.6" + +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +interpret@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +irregular-plurals@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.2.0.tgz#38f299834ba8c00c30be9c554e137269752ff3ac" + +is-absolute@^0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" + dependencies: + is-relative "^0.2.1" + is-windows "^0.2.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-error@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-error/-/is-error-2.2.1.tgz#684a96d84076577c98f4cdb40c6d26a5123bf19c" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-get-set-prop@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-get-set-prop/-/is-get-set-prop-1.0.0.tgz#2731877e4d78a6a69edcce6bb9d68b0779e76312" + dependencies: + get-set-props "^0.1.0" + lowercase-keys "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-js-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-js-type/-/is-js-type-2.0.0.tgz#73617006d659b4eb4729bba747d28782df0f7e22" + dependencies: + js-types "^1.0.0" + +is-my-json-valid@^2.10.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-obj-prop@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-obj-prop/-/is-obj-prop-1.0.0.tgz#b34de79c450b8d7c73ab2cdf67dc875adb85f80e" + dependencies: + lowercase-keys "^1.0.0" + obj-props "^1.0.0" + +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-proto-prop@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-proto-prop/-/is-proto-prop-1.0.0.tgz#b3951f95c089924fb5d4fcda6542ab3e83e2b220" + dependencies: + lowercase-keys "^1.0.0" + proto-props "^0.2.0" + +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-relative@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-0.2.1.tgz#d27f4c7d516d175fb610db84bbeef23c3bc97aa5" + dependencies: + is-unc-path "^0.1.1" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-stream@^1.0.0, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-unc-path@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-0.1.2.tgz#6ab053a72573c10250ff416a3814c35178af39b9" + dependencies: + unc-path-regex "^0.1.0" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-valid-glob@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" + +is-windows@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + +js-types@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/js-types/-/js-types-1.0.0.tgz#d242e6494ed572ad3c92809fc8bed7f7687cbf03" + +js-yaml@^3.5.1: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json3@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +json5@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + dependencies: + package-json "^4.0.0" + +lazy-cache@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" + dependencies: + set-getter "^0.1.0" + +lazy-req@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-2.0.0.tgz#c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +liftoff@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.3.0.tgz#a98f2ff67183d8ba7cfaca10548bd7ff0550b385" + dependencies: + extend "^3.0.0" + findup-sync "^0.4.2" + fined "^1.0.1" + flagged-respawn "^0.3.2" + lodash.isplainobject "^4.0.4" + lodash.isstring "^4.0.1" + lodash.mapvalues "^4.4.0" + rechoir "^0.6.2" + resolve "^1.1.7" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +load-pkg@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/load-pkg/-/load-pkg-3.0.1.tgz#9230b37ec04e569003060bc58951e3ed508d594f" + dependencies: + find-pkg "^0.1.0" + +load-plugins@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/load-plugins/-/load-plugins-2.1.2.tgz#e00ffdf45e2067ba188fca0453eb703f049a76d0" + dependencies: + app-name "^0.2.0" + extend-shallow "^2.0.0" + resolve-dep "^0.6.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash._baseassign@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" + dependencies: + lodash._basecopy "^3.0.0" + lodash.keys "^3.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basecreate@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" + +lodash._basetostring@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" + +lodash._basevalues@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash._reescape@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" + +lodash._reevaluate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" + +lodash._reinterpolate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + +lodash._root@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + +lodash.assignwith@^4.0.7: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz#127a97f02adc41751a954d24b0de17e100e038eb" + +lodash.camelcase@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + +lodash.create@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" + dependencies: + lodash._baseassign "^3.0.0" + lodash._basecreate "^3.0.0" + lodash._isiterateecall "^3.0.0" + +lodash.escape@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" + dependencies: + lodash._root "^3.0.0" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.isempty@^4.2.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" + +lodash.isequal@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + +lodash.isplainobject@^4.0.4: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + +lodash.kebabcase@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash.mapvalues@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" + +lodash.pick@^4.2.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + +lodash.restparam@^3.0.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" + +lodash.snakecase@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + +lodash.template@^3.0.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" + dependencies: + lodash._basecopy "^3.0.0" + lodash._basetostring "^3.0.0" + lodash._basevalues "^3.0.0" + lodash._isiterateecall "^3.0.0" + lodash._reinterpolate "^3.0.0" + lodash.escape "^3.0.0" + lodash.keys "^3.0.0" + lodash.restparam "^3.0.0" + lodash.templatesettings "^3.0.0" + +lodash.templatesettings@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.escape "^3.0.0" + +lodash.upperfirst@^4.2.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" + +lodash@^3.10.0, lodash@^3.3.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" + +lodash@^4.0.0, lodash@^4.13.1, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.1: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +lodash@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" + +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + +lookup-path@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/lookup-path/-/lookup-path-0.3.1.tgz#a4ef2410ae32669af700c4cb7e1b0109509cf2b8" + dependencies: + debug "^2.2.0" + is-absolute "^0.2.3" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lowercase-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +lru-cache@^4.0.0, lru-cache@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" + dependencies: + pseudomap "^1.0.1" + yallist "^2.0.0" + +make-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" + dependencies: + pify "^2.3.0" + +map-cache@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +matched@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/matched/-/matched-0.4.4.tgz#56d7b7eb18033f0cf9bc52eb2090fac7dc1e89fa" + dependencies: + arr-union "^3.1.0" + async-array-reduce "^0.2.0" + extend-shallow "^2.0.1" + fs-exists-sync "^0.1.0" + glob "^7.0.5" + has-glob "^0.1.1" + is-valid-glob "^0.3.0" + lazy-cache "^2.0.1" + resolve-dir "^0.1.0" + +meow@^3.4.2: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +micromatch@^2.3.11, micromatch@^2.3.7: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +minimatch@^2.0.1: + version "2.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" + dependencies: + brace-expansion "^1.0.0" + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimatch@~0.2.11: + version "0.2.14" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" + dependencies: + browser-stdout "1.3.0" + commander "2.9.0" + debug "2.6.0" + diff "3.2.0" + escape-string-regexp "1.0.5" + glob "7.1.1" + growl "1.9.2" + json3 "3.3.2" + lodash.create "3.1.1" + mkdirp "0.5.1" + supports-color "3.1.2" + +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + +ms@0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +multimatch@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" + dependencies: + array-differ "^1.0.0" + array-union "^1.0.1" + arrify "^1.0.0" + minimatch "^3.0.0" + +multipipe@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" + dependencies: + duplexer2 "0.0.2" + +mute-stream@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" + +natives@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +node-localstorage@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/node-localstorage/-/node-localstorage-0.6.0.tgz#45a0601c6932dfde6644a23361f1be173c75d3af" + +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" + dependencies: + path-key "^1.0.0" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +obj-props@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/obj-props/-/obj-props-1.1.0.tgz#626313faa442befd4a44e9a02c3cb6bde937b511" + +object-assign@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +once@~1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +orchestrator@^0.3.0: + version "0.3.8" + resolved "https://registry.yarnpkg.com/orchestrator/-/orchestrator-0.3.8.tgz#14e7e9e2764f7315fbac184e506c7aa6df94ad7e" + dependencies: + end-of-stream "~0.1.5" + sequencify "~0.0.7" + stream-consume "~0.1.0" + +ordered-read-streams@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz#fd565a9af8eb4473ba69b6ed8a34352cb552f126" + +os-homedir@^1.0.0, os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +parse-filepath@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.1.tgz#159d6155d43904d16c10ef698911da1e91969b73" + dependencies: + is-absolute "^0.2.3" + map-cache "^0.2.0" + path-root "^0.1.1" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-key@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + dependencies: + path-root-regex "^0.1.0" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-conf@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279" + dependencies: + find-up "^2.0.0" + load-json-file "^2.0.0" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +pkg-up@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" + dependencies: + find-up "^1.0.0" + +plur@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" + dependencies: + irregular-plurals "^1.0.0" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-hrtime@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" + +private@^0.1.6: + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + +proto-props@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/proto-props/-/proto-props-0.2.1.tgz#5e01dc2675a0de9abfa76e799dfa334d6f483f4b" + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +randomatic@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + +rc@^1.0.1, rc@^1.1.6: + version "1.2.1" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +"readable-stream@>=1.0.33-1 <1.1.0-0": + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2: + version "2.2.9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" + dependencies: + buffer-shims "~1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~1.0.0" + util-deprecate "~1.0.1" + +readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readline2@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + mute-stream "0.0.5" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +regenerate@^1.2.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" + +regenerator-runtime@^0.10.0: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regenerator-transform@0.9.11: + version "0.9.11" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +registry-auth-token@^3.0.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.1.tgz#fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006" + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +replace-ext@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" + +req-all@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/req-all/-/req-all-1.0.0.tgz#d128569451c340b432409c656cf166260cd2628d" + +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-1.0.0.tgz#4eaeea41ed040d1702457df64a42b2b07d246f9f" + dependencies: + resolve-from "^2.0.0" + +resolve-dep@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/resolve-dep/-/resolve-dep-0.6.0.tgz#673f1441e777852fd6ad81365ce7d5d85455a4fb" + dependencies: + arrayify-compact "^0.2.0" + cwd "^0.10.0" + extend-shallow "^2.0.1" + load-pkg "^3.0.1" + lookup-path "^0.3.1" + matched "^0.4.4" + micromatch "^2.3.11" + resolve "^1.1.7" + +resolve-dir@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" + dependencies: + expand-tilde "^1.2.2" + global-modules "^0.2.3" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + +resolve@^1.1.6, resolve@^1.1.7: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +rimraf@^2.2.8: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +rx-lite@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" + +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + +"semver@2 || 3 || 4 || 5", semver@^4.1.0: + version "4.3.6" + resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" + +semver@^5.0.3, semver@^5.1.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +sequencify@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" + +set-getter@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" + dependencies: + to-object-path "^0.3.0" + +shelljs@^0.7.5: + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +should-equal@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-1.0.1.tgz#0b6e9516f2601a9fb0bb2dcc369afa1c7e200af7" + dependencies: + should-type "^1.0.0" + +should-format@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/should-format/-/should-format-3.0.3.tgz#9bfc8f74fa39205c53d38c34d717303e277124f1" + dependencies: + should-type "^1.3.0" + should-type-adaptors "^1.0.1" + +should-type-adaptors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/should-type-adaptors/-/should-type-adaptors-1.0.1.tgz#efe5553cdf68cff66e5c5f51b712dc351c77beaa" + dependencies: + should-type "^1.3.0" + should-util "^1.0.0" + +should-type@^1.0.0, should-type@^1.3.0, should-type@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/should-type/-/should-type-1.4.0.tgz#0756d8ce846dfd09843a6947719dfa0d4cff5cf3" + +should-util@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/should-util/-/should-util-1.0.0.tgz#c98cda374aa6b190df8ba87c9889c2b4db620063" + +should@^11.2.1: + version "11.2.1" + resolved "https://registry.yarnpkg.com/should/-/should-11.2.1.tgz#90f55145552d01cfc200666e4e818a1c9670eda2" + dependencies: + should-equal "^1.0.0" + should-format "^3.0.2" + should-type "^1.4.0" + should-type-adaptors "^1.0.1" + should-util "^1.0.0" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slice-ansi@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.3.tgz#9ee38472a17a9f0f72e7ebc9ec0c328c39dc4a8b" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +sort-keys@^1.1.1, sort-keys@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + dependencies: + is-plain-obj "^1.0.0" + +source-map-support@^0.4.2: + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" + dependencies: + source-map "^0.5.6" + +source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +sparkles@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +stream-consume@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" + dependencies: + safe-buffer "^5.0.1" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" + dependencies: + first-chunk-stream "^1.0.0" + is-utf8 "^0.2.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +term-size@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" + dependencies: + execa "^0.4.0" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +the-argv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/the-argv/-/the-argv-1.0.0.tgz#0084705005730dd84db755253c931ae398db9522" + +through2@^0.6.1: + version "0.6.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + +through2@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +tildify@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" + dependencies: + os-homedir "^1.0.0" + +time-stamp@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" + +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + +to-fast-properties@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +unc-path-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + +unique-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-1.0.0.tgz#d59a4a75427447d9aa6c91e70263f8d26a4b104b" + +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + +update-notifier@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.1.0.tgz#ec0c1e53536b76647a24b77cb83966d9315123d9" + dependencies: + boxen "^1.0.0" + chalk "^1.0.0" + configstore "^3.0.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + lazy-req "^2.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + dependencies: + os-homedir "^1.0.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +v8flags@^2.0.2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + dependencies: + user-home "^1.1.1" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +vinyl-fs@^0.3.0: + version "0.3.14" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-0.3.14.tgz#9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6" + dependencies: + defaults "^1.0.0" + glob-stream "^3.1.5" + glob-watcher "^0.0.6" + graceful-fs "^3.0.0" + mkdirp "^0.5.0" + strip-bom "^1.0.0" + through2 "^0.6.1" + vinyl "^0.4.0" + +vinyl-sourcemaps-apply@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" + dependencies: + source-map "^0.5.1" + +vinyl@^0.4.0: + version "0.4.6" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" + dependencies: + clone "^0.2.0" + clone-stats "^0.0.1" + +vinyl@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" + dependencies: + clone "^1.0.0" + clone-stats "^0.0.1" + replace-ext "0.0.1" + +vorpal-less@^0.0.13: + version "0.0.13" + resolved "https://registry.yarnpkg.com/vorpal-less/-/vorpal-less-0.0.13.tgz#a5adbc4fbc8ad6a150fe6d91a8996e93fd8b6418" + dependencies: + slice-ansi "0.0.3" + +vorpal-repl@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/vorpal-repl/-/vorpal-repl-1.1.8.tgz#ed1086eb073509486a1a54a76754c888bf221e81" + dependencies: + chalk "^1.1.0" + json-stringify-safe "^5.0.1" + lodash "^3.10.0" + +which@^1.2.12, which@^1.2.8, which@^1.2.9: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +widest-line@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-1.0.0.tgz#0c09c85c2a94683d0d7eaf8ee097d564bf0e105c" + dependencies: + string-width "^1.0.1" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.1.0.tgz#1769f4b551eedce419f0505deae2e26763542d37" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +write-json-file@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.1.0.tgz#ba1cf3ac7ee89db26c3d528986e48421389046b7" + dependencies: + graceful-fs "^4.1.2" + make-dir "^1.0.0" + pify "^2.0.0" + sort-keys "^1.1.1" + write-file-atomic "^2.0.0" + +write-pkg@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.1.0.tgz#353aa44c39c48c21440f5c08ce6abd46141c9c08" + dependencies: + sort-keys "^1.1.2" + write-json-file "^2.0.0" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + +xo-init@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xo-init/-/xo-init-0.5.0.tgz#8e28dec79676cc5e042fde5fd8f710e2646b0e36" + dependencies: + arrify "^1.0.0" + execa "^0.5.0" + minimist "^1.1.3" + path-exists "^3.0.0" + read-pkg-up "^2.0.0" + the-argv "^1.0.0" + write-pkg "^2.0.0" + +xo@^0.18.0, xo@^0.18.2: + version "0.18.2" + resolved "https://registry.yarnpkg.com/xo/-/xo-0.18.2.tgz#92a42eb02a4fb149dfea5518021914f5aac84ff0" + dependencies: + arrify "^1.0.0" + debug "^2.2.0" + deep-assign "^1.0.0" + eslint "^3.18.0" + eslint-config-xo "^0.18.0" + eslint-formatter-pretty "^1.0.0" + eslint-plugin-ava "^4.2.0" + eslint-plugin-import "^2.0.0" + eslint-plugin-no-use-extend-native "^0.3.2" + eslint-plugin-promise "^3.4.0" + eslint-plugin-unicorn "^2.1.0" + get-stdin "^5.0.0" + globby "^6.0.0" + has-flag "^2.0.0" + ignore "^3.2.6" + lodash.isequal "^4.4.0" + meow "^3.4.2" + multimatch "^2.1.0" + path-exists "^3.0.0" + pkg-conf "^2.0.0" + resolve-cwd "^1.0.0" + resolve-from "^2.0.0" + slash "^1.0.0" + update-notifier "^2.1.0" + xo-init "^0.5.0" + +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +yallist@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" From fd3abafa129f4502a50cb5dc1ed605e173ab5bf4 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 24 May 2017 21:34:37 -0700 Subject: [PATCH 05/38] Updated Inquirer and other prod deps. --- .travis.yml | 21 +++---- CHANGELOG.md | 3 + dist/ui.js | 8 +-- examples/mode/mode.js | 4 +- lib/ui.js | 8 +-- package.json | 12 ++-- yarn.lock | 141 ++++++++++++++++++++++++++++++++---------- 7 files changed, 136 insertions(+), 61 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.travis.yml b/.travis.yml index d21428df..36e0f00a 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ -language: node_js -node_js: - - "0.12" - - "0.11" - - "0.10" - - "4.2.0" - - "iojs-v2" -sudo: false -branches: - only: - - master \ No newline at end of file +language: node_js +node_js: + - 4 + - 5 + - 6 + - node +sudo: false +branches: + only: + - master diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..967e1b4e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# 2.0.0 [IN PROGRESS] +* Updated minimum Node.js requirement to v4. +* Updated Inquirer.js to v3 from v0.11. diff --git a/dist/ui.js b/dist/ui.js index c9d28ba4..340c3242 100755 --- a/dist/ui.js +++ b/dist/ui.js @@ -211,7 +211,7 @@ var UI = function (_EventEmitter) { } this._midPrompt = true; try { - prompt = inquirer.prompt(options, function (result) { + prompt = inquirer.prompt(options).then(function (result) { _this2.inquirerStdout = []; _this2._midPrompt = false; if (_this2._cancel === true) { @@ -297,11 +297,10 @@ var UI = function (_EventEmitter) { var newWidth = prompt.rl.line.length; var diff = newWidth - width; prompt.rl.cursor += diff; - var cursor = 0; var message = prompt.getQuestion(); var addition = prompt.status === 'answered' ? chalk.cyan(prompt.answer) : line; message += addition; - prompt.screen.render(message, { cursor: cursor }); + prompt.screen.render(message); var key = (e.key || {}).name; var value = prompt ? String(line) : undefined; @@ -522,11 +521,10 @@ var UI = function (_EventEmitter) { var newWidth = prompt.rl.line.length; var diff = newWidth - width; prompt.rl.cursor += diff; - var cursor = 0; var message = prompt.getQuestion(); var addition = prompt.status === 'answered' ? chalk.cyan(prompt.answer) : prompt.rl.line; message += addition; - prompt.screen.render(message, { cursor: cursor }); + prompt.screen.render(message); return this; } diff --git a/examples/mode/mode.js b/examples/mode/mode.js index 8e623369..cabe55c9 100755 --- a/examples/mode/mode.js +++ b/examples/mode/mode.js @@ -30,7 +30,7 @@ var server; server = new Vorpal() .banner(banner) .delimiter(delimiter) - .listen(port) + // .listen(port) .show(); /** @@ -68,7 +68,7 @@ server try { var res = eval(command); var log = (_.isString(res)) ? String(res).white : res; - console.log(log); + // console.log(log); cb(res); } catch (e) { console.log(e); diff --git a/lib/ui.js b/lib/ui.js index 4f2721bc..9ab98b96 100755 --- a/lib/ui.js +++ b/lib/ui.js @@ -188,7 +188,7 @@ class UI extends EventEmitter { } this._midPrompt = true; try { - prompt = inquirer.prompt(options, (result) => { + prompt = inquirer.prompt(options).then((result) => { this.inquirerStdout = []; this._midPrompt = false; if (this._cancel === true) { @@ -272,13 +272,12 @@ class UI extends EventEmitter { const newWidth = prompt.rl.line.length; const diff = newWidth - width; prompt.rl.cursor += diff; - const cursor = 0; let message = prompt.getQuestion(); const addition = (prompt.status === 'answered') ? chalk.cyan(prompt.answer) : line; message += addition; - prompt.screen.render(message, {cursor: cursor}); + prompt.screen.render(message); const key = (e.key || {}).name; const value = (prompt) ? String(line) : undefined; @@ -483,13 +482,12 @@ class UI extends EventEmitter { const newWidth = prompt.rl.line.length; const diff = newWidth - width; prompt.rl.cursor += diff; - const cursor = 0; let message = prompt.getQuestion(); const addition = (prompt.status === 'answered') ? chalk.cyan(prompt.answer) : prompt.rl.line; message += addition; - prompt.screen.render(message, {cursor: cursor}); + prompt.screen.render(message); return this; } diff --git a/package.json b/package.json index adc3e9b8..cf0613a0 100644 --- a/package.json +++ b/package.json @@ -50,16 +50,16 @@ "xo": "^0.18.2" }, "dependencies": { - "babel-polyfill": "^6.3.14", + "babel-polyfill": "^6.23.0", "chalk": "^1.1.0", "in-publish": "^2.0.0", - "inquirer": "0.11.0", - "lodash": "^4.5.1", - "log-update": "^1.0.2", + "inquirer": "^3.0.6", + "lodash": "^4.17.0", + "log-update": "^2.0.0", "minimist": "^1.2.0", - "node-localstorage": "^0.6.0", + "node-localstorage": "^1.3.0", "strip-ansi": "^3.0.0", - "wrap-ansi": "^2.0.0" + "wrap-ansi": "^2.1.0" }, "engines": { "node": ">= 0.10.0", diff --git a/yarn.lock b/yarn.lock index b2908ec7..b45f0931 100644 --- a/yarn.lock +++ b/yarn.lock @@ -422,7 +422,7 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-polyfill@^6.3.14: +babel-polyfill@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" dependencies: @@ -627,15 +627,17 @@ cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" -cli-cursor@^1.0.1, cli-cursor@^1.0.2: +cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" dependencies: restore-cursor "^1.0.1" -cli-width@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-1.1.1.tgz#a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d" +cli-cursor@^2.0.0, cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.1.0" @@ -1177,6 +1179,14 @@ extend@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +external-editor@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" + dependencies: + iconv-lite "^0.4.17" + jschardet "^1.4.2" + tmp "^0.0.31" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -1201,6 +1211,12 @@ figures@^1.3.5: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" @@ -1639,6 +1655,10 @@ hosted-git-info@^2.1.4: version "2.4.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" +iconv-lite@^0.4.17: + version "0.4.17" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.17.tgz#4fdaa3b38acbc2c031b045d0edcdfe1ecab18c8d" + ignore@^3.2.0, ignore@^3.2.6: version "3.3.3" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" @@ -1676,38 +1696,39 @@ ini@^1.3.4, ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" -inquirer@0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.11.0.tgz#7448bfa924092af311d47173bbab990cae2bb027" +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" dependencies: ansi-escapes "^1.1.0" ansi-regex "^2.0.0" chalk "^1.0.0" cli-cursor "^1.0.1" - cli-width "^1.0.1" + cli-width "^2.0.0" figures "^1.3.5" - lodash "^3.3.1" + lodash "^4.3.0" readline2 "^1.0.1" run-async "^0.1.0" rx-lite "^3.1.2" + string-width "^1.0.1" strip-ansi "^3.0.0" through "^2.3.6" -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" +inquirer@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347" dependencies: ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" chalk "^1.0.0" - cli-cursor "^1.0.1" + cli-cursor "^2.1.0" cli-width "^2.0.0" - figures "^1.3.5" + external-editor "^2.0.1" + figures "^2.0.0" lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" + mute-stream "0.0.7" + run-async "^2.2.0" + rx "^4.1.0" + string-width "^2.0.0" strip-ansi "^3.0.0" through "^2.3.6" @@ -1861,6 +1882,10 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" @@ -1947,6 +1972,10 @@ js-yaml@^3.5.1: argparse "^1.0.7" esprima "^3.1.1" +jschardet@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -2214,11 +2243,11 @@ lodash.upperfirst@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" -lodash@^3.10.0, lodash@^3.3.1: +lodash@^3.10.0: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.0.0, lodash@^4.13.1, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.1: +lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2232,12 +2261,13 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" -log-update@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" +log-update@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.0.0.tgz#7f4354d7be1be62b724fcbb3c4b94454c0db5e26" dependencies: ansi-escapes "^1.0.0" - cli-cursor "^1.0.2" + cli-cursor "^2.0.0" + wrap-ansi "^2.1.0" lookup-path@^0.3.1: version "0.3.1" @@ -2335,6 +2365,10 @@ micromatch@^2.3.11, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + minimatch@^2.0.1: version "2.0.10" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" @@ -2415,6 +2449,10 @@ mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + natives@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" @@ -2423,9 +2461,11 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -node-localstorage@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/node-localstorage/-/node-localstorage-0.6.0.tgz#45a0601c6932dfde6644a23361f1be173c75d3af" +node-localstorage@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/node-localstorage/-/node-localstorage-1.3.0.tgz#2e436aae8dcc9ace97b43c65c16c0d577be0a55c" + dependencies: + write-file-atomic "^1.1.4" normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.3.8" @@ -2493,6 +2533,12 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -2520,7 +2566,7 @@ os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-tmpdir@^1.0.1: +os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2938,6 +2984,13 @@ restore-cursor@^1.0.1: exit-hook "^1.0.0" onetime "^1.0.0" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + rimraf@^2.2.8: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" @@ -2950,10 +3003,20 @@ run-async@^0.1.0: dependencies: once "^1.3.0" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +rx@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" + safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" @@ -3032,7 +3095,7 @@ sigmund@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" -signal-exit@^3.0.0: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3223,6 +3286,12 @@ timed-out@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" +tmp@^0.0.31: + version "0.0.31" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" + dependencies: + os-tmpdir "~1.0.1" + to-fast-properties@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -3383,7 +3452,7 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -wrap-ansi@^2.0.0: +wrap-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" dependencies: @@ -3394,6 +3463,14 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + write-file-atomic@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.1.0.tgz#1769f4b551eedce419f0505deae2e26763542d37" From 792764e7517cce74ef95822fe14bae5b4183a6e7 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 25 May 2017 19:09:18 -0700 Subject: [PATCH 06/38] Remove dist folder. --- .gitignore | 2 +- dist/autocomplete.js | 445 ------------- dist/command-instance.js | 123 ---- dist/command.js | 660 ------------------- dist/history.js | 188 ------ dist/intercept.js | 51 -- dist/local-storage.js | 37 -- dist/logger.js | 138 ---- dist/option.js | 104 --- dist/session.js | 559 ---------------- dist/ui.js | 652 ------------------- dist/util.js | 468 -------------- dist/vorpal-commons.js | 52 -- dist/vorpal.js | 1326 -------------------------------------- 14 files changed, 1 insertion(+), 4804 deletions(-) delete mode 100755 dist/autocomplete.js delete mode 100755 dist/command-instance.js delete mode 100755 dist/command.js delete mode 100755 dist/history.js delete mode 100755 dist/intercept.js delete mode 100755 dist/local-storage.js delete mode 100755 dist/logger.js delete mode 100755 dist/option.js delete mode 100755 dist/session.js delete mode 100755 dist/ui.js delete mode 100755 dist/util.js delete mode 100755 dist/vorpal-commons.js delete mode 100755 dist/vorpal.js diff --git a/.gitignore b/.gitignore index 6e40ca75..a62923fd 100755 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ pids lib-cov coverage .grunt -dist/.local_storage* +dist/ build/Release node_modules test/util/playground.js diff --git a/dist/autocomplete.js b/dist/autocomplete.js deleted file mode 100755 index c08fbad9..00000000 --- a/dist/autocomplete.js +++ /dev/null @@ -1,445 +0,0 @@ -'use strict'; - -var _ = require('lodash'); -var strip = require('strip-ansi'); - -var autocomplete = { - - /** - * Handles tabbed autocompletion. - * - * - Initial tabbing lists all registered commands. - * - Completes a command halfway typed. - * - Recognizes options and lists all possible options. - * - Recognizes option arguments and lists them. - * - Supports cursor positions anywhere in the string. - * - Supports piping. - * - * @param {String} str - * @return {String} cb - * @api public - */ - - exec: function exec(str, cb) { - var self = this; - var input = parseInput(str, this.parent.ui._activePrompt.screen.rl.cursor); - var commands = getCommandNames(this.parent.commands); - var vorpalMatch = getMatch(input.context, commands, { ignoreSlashes: true }); - var freezeTabs = false; - - function end(str) { - var res = handleTabCounts.call(self, str, freezeTabs); - cb(undefined, res); - } - - function evaluateTabs(input) { - if (input.context && input.context[input.context.length - 1] === '/') { - freezeTabs = true; - } - } - - if (vorpalMatch) { - input.context = vorpalMatch; - evaluateTabs(input); - end(assembleInput(input)); - return; - } - - input = getMatchObject.call(this, input, commands); - if (input.match) { - input = parseMatchSection.call(this, input); - getMatchData.call(self, input, function (data) { - var dataMatch = getMatch(input.context, data); - if (dataMatch) { - input.context = dataMatch; - evaluateTabs(input); - end(assembleInput(input)); - return; - } - end(filterData(input.context, data)); - }); - return; - } - end(filterData(input.context, commands)); - }, - - /** - * Independent / stateless auto-complete function. - * Parses an array of strings for the best match. - * - * @param {String} str - * @param {Array} arr - * @return {String} - * @api private - */ - - match: function match(str, arr, options) { - arr = arr || []; - options = options || {}; - arr.sort(); - var arrX = _.clone(arr); - var strX = String(str); - - var prefix = ''; - - if (options.ignoreSlashes !== true) { - var parts = strX.split('/'); - strX = parts.pop(); - prefix = parts.join('/'); - prefix = parts.length > 0 ? prefix + '/' : prefix; - } - - var matches = []; - for (var i = 0; i < arrX.length; i++) { - if (strip(arrX[i]).slice(0, strX.length) === strX) { - matches.push(arrX[i]); - } - } - if (matches.length === 1) { - // If we have a slash, don't add a space after match. - var space = String(strip(matches[0])).slice(strip(matches[0]).length - 1) === '/' ? '' : ' '; - return prefix + matches[0] + space; - } else if (matches.length === 0) { - return undefined; - } else if (strX.length === 0) { - return matches; - } - - var longestMatchLength = matches.reduce(function (previous, current) { - for (var i = 0; i < current.length; i++) { - if (previous[i] && current[i] !== previous[i]) { - return current.substr(0, i); - } - } - return previous; - }).length; - - // couldn't resolve any further, return all matches - if (longestMatchLength === strX.length) { - return matches; - } - - // return the longest matching portion along with the prefix - return prefix + matches[0].substr(0, longestMatchLength); - } -}; - -/** - * Tracks how many times tab was pressed - * based on whether the UI changed. - * - * @param {String} str - * @return {String} result - * @api private - */ - -function handleTabCounts(str, freezeTabs) { - var result; - if (_.isArray(str)) { - this._tabCtr += 1; - if (this._tabCtr > 1) { - result = str.length === 0 ? undefined : str; - } - } else { - this._tabCtr = freezeTabs === true ? this._tabCtr + 1 : 0; - result = str; - } - return result; -} - -/** - * Looks for a potential exact match - * based on given data. - * - * @param {String} ctx - * @param {Array} data - * @return {String} - * @api private - */ - -function getMatch(ctx, data, options) { - // Look for a command match, eliminating and then - // re-introducing leading spaces. - var len = ctx.length; - var trimmed = ctx.replace(/^\s+/g, ''); - var match = autocomplete.match(trimmed, data.slice(), options); - if (_.isArray(match)) { - return match; - } - var prefix = new Array(len - trimmed.length + 1).join(' '); - // If we get an autocomplete match on a command, finish it. - if (match) { - // Put the leading spaces back in. - match = prefix + match; - return match; - } - return undefined; -} - -/** - * Takes the input object and assembles - * the final result to display on the screen. - * - * @param {Object} input - * @return {String} - * @api private - */ - -function assembleInput(input) { - if (_.isArray(input.context)) { - return input.context; - } - var result = (input.prefix || '') + (input.context || '') + (input.suffix || ''); - return strip(result); -} - -/** - * Reduces an array of possible - * matches to list based on a given - * string. - * - * @param {String} str - * @param {Array} data - * @return {Array} - * @api private - */ - -function filterData(str, data) { - data = data || []; - var ctx = String(str || '').trim(); - var slashParts = ctx.split('/'); - ctx = slashParts.pop(); - var wordParts = String(ctx).trim().split(' '); - var res = data.filter(function (item) { - return strip(item).slice(0, ctx.length) === ctx; - }); - res = res.map(function (item) { - var parts = String(item).trim().split(' '); - if (parts.length > 1) { - parts = parts.slice(wordParts.length); - return parts.join(' '); - } - return item; - }); - return res; -} - -/** - * Takes the user's current prompt - * string and breaks it into its - * integral parts for analysis and - * modification. - * - * @param {String} str - * @param {Integer} idx - * @return {Object} - * @api private - */ - -function parseInput(str, idx) { - var raw = String(str || ''); - var sliced = raw.slice(0, idx); - var sections = sliced.split('|'); - var prefix = sections.slice(0, sections.length - 1) || []; - prefix.push(''); - prefix = prefix.join('|'); - var suffix = getSuffix(raw.slice(idx)); - var context = sections[sections.length - 1]; - return { - raw: raw, - prefix: prefix, - suffix: suffix, - context: context - }; -} - -/** - * Takes the context after a - * matched command and figures - * out the applicable context, - * including assigning its role - * such as being an option - * parameter, etc. - * - * @param {Object} input - * @return {Object} - * @api private - */ - -function parseMatchSection(input) { - var parts = (input.context || '').split(' '); - var last = parts.pop(); - var beforeLast = strip(parts[parts.length - 1] || '').trim(); - if (beforeLast.slice(0, 1) === '-') { - input.option = beforeLast; - } - input.context = last; - input.prefix = (input.prefix || '') + parts.join(' ') + ' '; - return input; -} - -/** - * Returns a cleaned up version of the - * remaining text to the right of the cursor. - * - * @param {String} suffix - * @return {String} - * @api private - */ - -function getSuffix(suffix) { - suffix = suffix.slice(0, 1) === ' ' ? suffix : suffix.replace(/.+?(?=\s)/, ''); - suffix = suffix.slice(1, suffix.length); - return suffix; -} - -/** - * Compile all available commands and aliases - * in alphabetical order. - * - * @param {Array} cmds - * @return {Array} - * @api private - */ - -function getCommandNames(cmds) { - var commands = _.map(cmds, '_name'); - commands = commands.concat.apply(commands, _.map(cmds, '_aliases')); - commands.sort(); - return commands; -} - -/** - * When we know that we've - * exceeded a known command, grab - * on to that command and return it, - * fixing the overall input context - * at the same time. - * - * @param {Object} input - * @param {Array} commands - * @return {Object} - * @api private - */ - -function getMatchObject(input, commands) { - var len = input.context.length; - var trimmed = String(input.context).replace(/^\s+/g, ''); - var prefix = new Array(len - trimmed.length + 1).join(' '); - var match; - var suffix; - commands.forEach(function (cmd) { - var nextChar = trimmed.substr(cmd.length, 1); - if (trimmed.substr(0, cmd.length) === cmd && String(cmd).trim() !== '' && nextChar === ' ') { - match = cmd; - suffix = trimmed.substr(cmd.length); - prefix += trimmed.substr(0, cmd.length); - } - }); - - var matchObject = match ? _.find(this.parent.commands, { _name: String(match).trim() }) : undefined; - - if (!matchObject) { - this.parent.commands.forEach(function (cmd) { - if ((cmd._aliases || []).indexOf(String(match).trim()) > -1) { - matchObject = cmd; - } - return; - }); - } - - if (!matchObject) { - matchObject = _.find(this.parent.commands, { _catch: true }); - if (matchObject) { - suffix = input.context; - } - } - - if (!matchObject) { - prefix = input.context; - suffix = ''; - } - - if (matchObject) { - input.match = matchObject; - input.prefix += prefix; - input.context = suffix; - } - return input; -} - -/** - * Takes a known matched command, and reads - * the applicable data by calling its autocompletion - * instructions, whether it is the command's - * autocompletion or one of its options. - * - * @param {Object} input - * @param {Function} cb - * @return {Array} - * @api private - */ - -function getMatchData(input, cb) { - var string = input.context; - var cmd = input.match; - var midOption = String(string).trim().slice(0, 1) === '-'; - var afterOption = input.option !== undefined; - if (midOption === true) { - var results = []; - for (var i = 0; i < cmd.options.length; ++i) { - var long = cmd.options[i].long; - var short = cmd.options[i].short; - if (!long && short) { - results.push(short); - } else if (long) { - results.push(long); - } - } - cb(results); - return; - } - - function handleDataFormat(str, config, callback) { - var data = []; - if (_.isArray(config)) { - data = config; - } else if (_.isFunction(config)) { - var cbk = config.length < 2 ? function () {} : function (res) { - callback(res || []); - }; - var res = config(str, cbk); - if (res && _.isFunction(res.then)) { - res.then(function (resp) { - callback(resp); - }).catch(function (err) { - callback(err); - }); - } else if (config.length < 2) { - callback(res); - } - return; - } - callback(data); - return; - } - - if (afterOption === true) { - var opt = strip(input.option).trim(); - var shortMatch = _.find(cmd.options, { short: opt }); - var longMatch = _.find(cmd.options, { long: opt }); - var match = longMatch || shortMatch; - if (match) { - var config = match.autocomplete; - handleDataFormat(string, config, cb); - return; - } - } - - var conf = cmd._autocomplete; - conf = conf && conf.data ? conf.data : conf; - handleDataFormat(string, conf, cb); - return; -} - -module.exports = autocomplete; \ No newline at end of file diff --git a/dist/command-instance.js b/dist/command-instance.js deleted file mode 100755 index e0942af4..00000000 --- a/dist/command-instance.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var util = require('./util'); -var _ = require('lodash'); - -var CommandInstance = function () { - - /** - * Initialize a new `CommandInstance` instance. - * - * @param {Object} params - * @return {CommandInstance} - * @api public - */ - - function CommandInstance() { - var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - - var command = _ref.command; - var commandObject = _ref.commandObject; - var args = _ref.args; - var commandWrapper = _ref.commandWrapper; - var callback = _ref.callback; - var downstream = _ref.downstream; - - _classCallCheck(this, CommandInstance); - - this.command = command; - this.commandObject = commandObject; - this.args = args; - this.commandWrapper = commandWrapper; - this.session = commandWrapper.session; - this.parent = this.session.parent; - this.callback = callback; - this.downstream = downstream; - } - - /** - * Cancel running command. - */ - - _createClass(CommandInstance, [{ - key: 'cancel', - value: function cancel() { - this.session.emit('vorpal_command_cancel'); - } - - /** - * Route stdout either through a piped command, or the session's stdout. - */ - - }, { - key: 'log', - value: function log() { - var _this = this; - - var args = util.fixArgsForApply(arguments); - if (this.downstream) { - var fn = this.downstream.commandObject._fn || function () {}; - this.session.registerCommand(); - this.downstream.args.stdin = args; - var onComplete = function onComplete(err) { - if (_this.session.isLocal() && err) { - _this.session.log(err.stack || err); - _this.session.parent.emit('client_command_error', { command: _this.downstream.command, error: err }); - } - _this.session.completeCommand(); - }; - - var validate = this.downstream.commandObject._validate; - if (_.isFunction(validate)) { - try { - validate.call(this.downstream, this.downstream.args); - } catch (e) { - // Log error without piping to downstream on validation error. - this.session.log(e.toString()); - onComplete(); - return; - } - } - - var res = fn.call(this.downstream, this.downstream.args, onComplete); - if (res && _.isFunction(res.then)) { - res.then(onComplete, onComplete); - } - } else { - this.session.log.apply(this.session, args); - } - } - }, { - key: 'prompt', - value: function prompt(a, b, c) { - return this.session.prompt(a, b, c); - } - }, { - key: 'delimiter', - value: function delimiter(a, b, c) { - return this.session.delimiter(a, b, c); - } - }, { - key: 'help', - value: function help(a, b, c) { - return this.session.help(a, b, c); - } - }, { - key: 'match', - value: function match(a, b, c) { - return this.session.match(a, b, c); - } - }]); - - return CommandInstance; -}(); - -module.exports = CommandInstance; \ No newline at end of file diff --git a/dist/command.js b/dist/command.js deleted file mode 100755 index d94775fa..00000000 --- a/dist/command.js +++ /dev/null @@ -1,660 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _events = require('events'); - -var _option = require('./option'); - -var _option2 = _interopRequireDefault(_option); - -var _util = require('./util'); - -var _util2 = _interopRequireDefault(_util); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * Converts string to camel case. - * - * @param {String} flag - * @return {String} - * @api private - */ -function _camelcase(flag) { - return flag.split('-').reduce(function (str, word) { - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -module.exports = function (_EventEmitter) { - _inherits(Command, _EventEmitter); - - function Command(name, parent) { - _classCallCheck(this, Command); - - var _this = _possibleConstructorReturn(this, (Command.__proto__ || Object.getPrototypeOf(Command)).apply(this, arguments)); - - if (!(_this instanceof Command)) { - var _ret; - - return _ret = new Command(), _possibleConstructorReturn(_this, _ret); - } - - _this.commands = []; - _this.options = []; - _this._args = []; - _this._aliases = []; - _this._name = name; - _this._relay = false; - _this._hidden = false; - _this._parent = parent; - _this._mode = false; - _this._catch = false; - _this._help = undefined; - _this._init = undefined; - _this._after = undefined; - _this._allowUnknownOptions = false; - return _this; - } - - /** - * Registers an option for given command. - * - * @param {String} flags - * @param {String} description - * @param {Function} fn - * @param {String} defaultValue - * @return {Command} - * @api public - */ - - - _createClass(Command, [{ - key: 'option', - value: function option(flags, description) { - var _this2 = this; - - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - - var option = new _option2.default(flags, description, options); - var oname = option.name(); - var name = _camelcase(oname); - var defaultValue = void 0; - - // preassign default value only for --no-*, [optional], or - if (option.bool === false || option.optional || option.required) { - // when --no-* we make sure default is true - if (option.bool === false) { - defaultValue = true; - } - // preassign only if we have a default - if (defaultValue !== undefined) { - this[name] = defaultValue; - } - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function (val) { - // unassigned or bool - if (typeof _this2[name] === 'boolean' || typeof _this2[name] === 'undefined') { - // if no value, bool true, and we have a default, then use it! - if (val === null) { - _this2[name] = option.bool ? defaultValue || true : false; - } else { - _this2[name] = val; - } - } else if (val !== null) { - // reassign - _this2[name] = val; - } - }); - - return this; - } - - /** - * Let's you compose other funtions to extend the command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'use', - value: function use(fn) { - return fn(this); - } - - /** - * Defines an action for a given command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'action', - value: function action(fn) { - this._fn = fn; - - return this; - } - - /** - * Defines a function to validate arguments - * before action is performed. Arguments - * are valid if no errors are thrown from - * the function. - * - * @param fn - * @returns {Command} - * @api public - */ - - }, { - key: 'validate', - value: function validate(fn) { - this._validate = fn; - return this; - } - - /** - * Defines a function to be called when the - * command is canceled. - * - * @param fn - * @returns {Command} - * @api public - */ - - }, { - key: 'cancel', - value: function cancel(fn) { - this._cancel = fn; - return this; - } - - /** - * Defines a method to be called when - * the command set has completed. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'done', - value: function done(fn) { - this._done = fn; - return this; - } - - /** - * Defines tabbed auto-completion - * for the given command. Favored over - * deprecated command.autocompletion. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'autocomplete', - value: function autocomplete(obj) { - this._autocomplete = obj; - return this; - } - - /** - * Defines tabbed auto-completion rules - * for the given command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'autocompletion', - value: function autocompletion(param) { - this._parent._useDeprecatedAutocompletion = true; - if (!_lodash2.default.isFunction(param) && !_lodash2.default.isObject(param)) { - throw new Error('An invalid object type was passed into the first parameter of command.autocompletion: function expected.'); - } - - this._autocompletion = param; - return this; - } - - /** - * Defines an init action for a mode command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'init', - value: function init(fn) { - if (this._mode !== true) { - throw Error('Cannot call init from a non-mode action.'); - } - this._init = fn; - return this; - } - - /** - * Defines a prompt delimiter for a - * mode once entered. - * - * @param {String} delimiter - * @return {Command} - * @api public - */ - - }, { - key: 'delimiter', - value: function delimiter(_delimiter) { - this._delimiter = _delimiter; - return this; - } - - /** - * Sets args for static typing of options - * using minimist. - * - * @param {Object} types - * @return {Command} - * @api public - */ - - }, { - key: 'types', - value: function types(_types) { - var supported = ['string', 'boolean']; - - for (var item in _types) { - if (supported.indexOf(item) === -1) { - throw new Error('An invalid type was passed into command.types(): ' + item); - } - _types[item] = !_lodash2.default.isArray(_types[item]) ? [_types[item]] : _types[item]; - } - this._types = _types; - return this; - } - - /** - * Defines an alias for a given command. - * - * @param {String} alias - * @return {Command} - * @api public - */ - - }, { - key: 'alias', - value: function alias() { - var _arguments2 = arguments, - _this3 = this; - - var _loop = function _loop(i) { - var alias = _arguments2[i]; - - if (_lodash2.default.isArray(alias)) { - for (j = 0; j < alias.length; ++j) { - _this3.alias(alias[j]); - } - return { - v: _this3 - }; - } - - _this3._parent.commands.forEach(function (cmd) { - if (!_lodash2.default.isEmpty(cmd._aliases)) { - if (_lodash2.default.includes(cmd._aliases, alias)) { - var msg = 'Duplicate alias "' + alias + '" for command "' + this._name + '" detected. Was first reserved by command "' + cmd._name + '".'; - throw new Error(msg); - } - } - }); - - _this3._aliases.push(alias); - }; - - for (var i = 0; i < arguments.length; ++i) { - var j; - - var _ret2 = _loop(i); - - if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; - } - - return this; - } - - /** - * Defines description for given command. - * - * @param {String} str - * @return {Command} - * @api public - */ - - }, { - key: 'description', - value: function description(str) { - var isGetter = arguments.length === 0; - - if (!isGetter) { - this._description = str; - } - - return isGetter ? this._description : this; - } - - /** - * Removes self from Vorpal instance. - * - * @return {Command} - * @api public - */ - - }, { - key: 'remove', - value: function remove() { - var _this4 = this; - - this._parent.commands = _lodash2.default.reject(this._parent.commands, function (command) { - return command._name === _this4._name; - }); - - return this; - } - - /** - * Returns the commands arguments as string. - * - * @param {String} desc - * @return {String} - * @api public - */ - - }, { - key: 'arguments', - value: function _arguments(desc) { - return this._parseExpectedArgs(desc.split(/ +/)); - } - - /** - * Returns the help info for given command. - * - * @return {String} - * @api public - */ - - }, { - key: 'helpInformation', - value: function helpInformation() { - var desc = []; - var cmdName = this._name; - var alias = ''; - - if (this._description) { - desc = [' ' + this._description, '']; - } - - if (this._aliases.length > 0) { - alias = ' Alias: ' + this._aliases.join(' | ') + '\n'; - } - var usage = ['', ' Usage: ' + cmdName + ' ' + this.usage(), '']; - - var cmds = []; - - var help = String(this.optionHelp().replace(/^/gm, ' ')); - var options = [' Options:', '', help, '']; - - var res = usage.concat(cmds).concat(alias).concat(desc).concat(options).join('\n'); - - res = res.replace(/\n\n\n/g, '\n\n'); - - return res; - } - - /** - * Doesn't show command in the help menu. - * - * @return {Command} - * @api public - */ - - }, { - key: 'hidden', - value: function hidden() { - this._hidden = true; - return this; - } - - /** - * Allows undeclared options to be passed in with the command. - * - * @param {Boolean} [allowUnknownOptions=true] - * @return {Command} - * @api public - */ - - }, { - key: 'allowUnknownOptions', - value: function allowUnknownOptions() { - var _allowUnknownOptions = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0]; - - _allowUnknownOptions = _allowUnknownOptions === 'false' ? false : _allowUnknownOptions; - - this._allowUnknownOptions = !!_allowUnknownOptions; - return this; - } - - /** - * Returns the command usage string for help. - * - * @param {String} str - * @return {String} - * @api public - */ - - }, { - key: 'usage', - value: function usage(str) { - var args = this._args.map(function (arg) { - return _util2.default.humanReadableArgName(arg); - }); - - var usage = '[options]' + (this.commands.length ? ' [command]' : '') + (this._args.length ? ' ' + args.join(' ') : ''); - - var isGetter = arguments.length === 0; - - if (!isGetter) { - this._usage = str; - } - - return isGetter ? this._usage || usage : this; - } - - /** - * Returns the help string for the command's options. - * - * @return {String} - * @api public - */ - - }, { - key: 'optionHelp', - value: function optionHelp() { - var width = this._largestOptionLength(); - - // Prepend the help information - return [_util2.default.pad('--help', width) + ' output usage information'].concat(this.options.map(function (option) { - return _util2.default.pad(option.flags, width) + ' ' + option.description; - })).join('\n'); - } - - /** - * Returns the length of the longest option. - * - * @return {Integer} - * @api private - */ - - }, { - key: '_largestOptionLength', - value: function _largestOptionLength() { - return this.options.reduce(function (max, option) { - return Math.max(max, option.flags.length); - }, 0); - } - - /** - * Adds a custom handling for the --help flag. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'help', - value: function help(fn) { - if (_lodash2.default.isFunction(fn)) { - this._help = fn; - } - return this; - } - - /** - * Edits the raw command string before it - * is executed. - * - * @param {String} str - * @return {String} str - * @api public - */ - - }, { - key: 'parse', - value: function parse(fn) { - if (_lodash2.default.isFunction(fn)) { - this._parse = fn; - } - return this; - } - - /** - * Adds a command to be executed after command completion. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - - }, { - key: 'after', - value: function after(fn) { - if (_lodash2.default.isFunction(fn)) { - this._after = fn; - } - return this; - } - - /** - * Parses and returns expected command arguments. - * - * @param {String} args - * @return {Array} - * @api private - */ - - }, { - key: '_parseExpectedArgs', - value: function _parseExpectedArgs(args) { - var _this5 = this; - - if (!args.length) { - return; - } - - args.forEach(function (arg) { - var argDetails = { - required: false, - name: '', - variadic: false - }; - - switch (arg[0]) { - case '<': - argDetails.required = true; - argDetails.name = arg.slice(1, -1); - break; - case '[': - argDetails.name = arg.slice(1, -1); - break; - default: - break; - } - - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { - argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); - } - if (argDetails.name) { - _this5._args.push(argDetails); - } - }); - - // If the user entered args in a weird order, - // properly sequence them. - if (this._args.length > 1) { - this._args = this._args.sort(function (argu1, argu2) { - if (argu1.required && !argu2.required) { - return -1; - } else if (argu2.required && !argu1.required) { - return 1; - } else if (argu1.variadic && !argu2.variadic) { - return 1; - } else if (argu2.variadic && !argu1.variadic) { - return -1; - } - return 0; - }); - } - - return; - } - }]); - - return Command; -}(_events.EventEmitter); \ No newline at end of file diff --git a/dist/history.js b/dist/history.js deleted file mode 100755 index a52d1e18..00000000 --- a/dist/history.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict'; - -var _ = require('lodash'); -var LocalStorage = require('node-localstorage').LocalStorage; -var path = require('path'); -var os = require('os'); - -// Number of command histories kept in persistent storage -var HISTORY_SIZE = 500; - -var temp = path.normalize(path.join(os.tmpdir(), '/.local_storage')); -var DEFAULT_STORAGE_PATH = temp; - -var History = function History() { - this._storageKey = undefined; - - // Prompt Command History - // Histctr moves based on number of times 'up' (+= ctr) - // or 'down' (-= ctr) was pressed in traversing - // command history. - this._hist = []; - this._histCtr = 0; - - // When in a 'mode', we reset the - // history and store it in a cache until - // exiting the 'mode', at which point we - // resume the original history. - this._histCache = []; - this._histCtrCache = 0; -}; - -/** - * Initialize the history with local storage data - * Called from setId when history id is set - */ - -History.prototype._init = function () { - if (!this._storageKey) { - return; - } - - // Load history from local storage - var persistedHistory = JSON.parse(this._localStorage.getItem(this._storageKey)); - if (_.isArray(persistedHistory)) { - Array.prototype.push.apply(this._hist, persistedHistory); - } -}; - -/** - * Set id for this history instance. - * Calls init internally to initialize - * the history with the id. - */ - -History.prototype.setId = function (id) { - // Initialize a localStorage instance with default - // path if it is not initialized - if (!this._localStorage) { - this._localStorage = new LocalStorage(DEFAULT_STORAGE_PATH); - } - this._storageKey = 'cmd_history_' + id; - this._init(); -}; - -/** - * Initialize a local storage instance with - * the path if not already initialized. - * - * @param path - */ - -History.prototype.setStoragePath = function (path) { - if (!this._localStorage) { - this._localStorage = new LocalStorage(path); - } -}; - -/** - * Get previous history. Called when up is pressed. - * - * @return {String} - */ - -History.prototype.getPreviousHistory = function () { - this._histCtr++; - this._histCtr = this._histCtr > this._hist.length ? this._hist.length : this._histCtr; - return this._hist[this._hist.length - this._histCtr]; -}; - -/** - * Get next history. Called when down is pressed. - * - * @return {String} - */ - -History.prototype.getNextHistory = function () { - this._histCtr--; - - // Return empty prompt if the we dont have any history to show - if (this._histCtr < 1) { - this._histCtr = 0; - return ''; - } - - return this._hist[this._hist.length - this._histCtr]; -}; - -/** - * Peek into history, without changing state - * - * @return {String} - */ - -History.prototype.peek = function (depth) { - depth = depth || 0; - return this._hist[this._hist.length - 1 - depth]; -}; - -/** - * A new command was submitted. Called when enter is pressed and the prompt is not empty. - * - * @param cmd - */ - -History.prototype.newCommand = function (cmd) { - // Always reset history when new command is executed. - this._histCtr = 0; - - // Don't store command in history if it's a duplicate. - if (this._hist[this._hist.length - 1] === cmd) { - return; - } - - // Push into history. - this._hist.push(cmd); - - // Only persist history when not in mode - if (this._storageKey && !this._inMode) { - var persistedHistory = this._hist; - var historyLen = this._hist.length; - if (historyLen > HISTORY_SIZE) { - persistedHistory = this._hist.slice(historyLen - HISTORY_SIZE - 1, historyLen - 1); - } - - // Add to local storage - this._localStorage.setItem(this._storageKey, JSON.stringify(persistedHistory)); - } -}; - -/** - * Called when entering a mode - */ - -History.prototype.enterMode = function () { - // Reassign the command history to a - // cache, replacing it with a blank - // history for the mode. - this._histCache = _.clone(this._hist); - this._histCtrCache = parseFloat(this._histCtr); - this._hist = []; - this._histCtr = 0; - this._inMode = true; -}; - -/** - * Called when exiting a mode - */ - -History.prototype.exitMode = function () { - this._hist = this._histCache; - this._histCtr = this._histCtrCache; - this._histCache = []; - this._histCtrCache = 0; - this._inMode = false; -}; - -/** - * Clears the command history - * (Currently only used in unit test) - */ - -History.prototype.clear = function () { - if (this._storageKey) { - this._localStorage.removeItem(this._storageKey); - } -}; - -module.exports = History; \ No newline at end of file diff --git a/dist/intercept.js b/dist/intercept.js deleted file mode 100755 index 6c153ff3..00000000 --- a/dist/intercept.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var _ = require('lodash'); - -/** - * Intercepts stdout, passes thru callback - * also pass console.error thru stdout so it goes to callback too - * (stdout.write and stderr.write are both refs to the same stream.write function) - * returns an unhook() function, call when done intercepting - * - * @param {Function} callback - * @return {Function} - */ - -module.exports = function (callback) { - var oldStdoutWrite = process.stdout.write; - var oldConsoleError = console.error; - process.stdout.write = function (write) { - return function (string) { - var args = _.toArray(arguments); - args[0] = interceptor(string); - write.apply(process.stdout, args); - }; - }(process.stdout.write); - - console.error = function () { - return function () { - var args = _.toArray(arguments); - args.unshift('\x1b[31m[ERROR]\x1b[0m'); - console.log.apply(console.log, args); - }; - }(console.error); - - function interceptor(string) { - // only intercept the string - var result = callback(string); - if (typeof result === 'string') { - string = result.replace(/\n$/, '') + (result && /\n$/.test(string) ? '\n' : ''); - } - return string; - } - // puts back to original - return function unhook() { - process.stdout.write = oldStdoutWrite; - console.error = oldConsoleError; - }; -}; \ No newline at end of file diff --git a/dist/local-storage.js b/dist/local-storage.js deleted file mode 100755 index f5241363..00000000 --- a/dist/local-storage.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var LocalStorageO = require('node-localstorage').LocalStorage; -var path = require('path'); -var os = require('os'); -var temp = path.normalize(path.join(os.tmpdir(), '/.local_storage_')); -var DEFAULT_STORAGE_PATH = temp; - -var LocalStorage = { - setId: function setId(id) { - if (id === undefined) { - throw new Error('vorpal.localStorage() requires a unique key to be passed in.'); - } - if (!this._localStorage) { - this._localStorage = new LocalStorageO(DEFAULT_STORAGE_PATH + id); - } - }, - validate: function validate() { - if (this._localStorage === undefined) { - throw new Error('Vorpal.localStorage() was not initialized before writing data.'); - } - }, - getItem: function getItem(key, value) { - this.validate(); - return this._localStorage.getItem(key, value); - }, - setItem: function setItem(key, value) { - this.validate(); - return this._localStorage.setItem(key, value); - }, - removeItem: function removeItem(key) { - this.validate(); - return this._localStorage.removeItem(key); - } -}; - -module.exports = LocalStorage; \ No newline at end of file diff --git a/dist/logger.js b/dist/logger.js deleted file mode 100755 index e914bcdb..00000000 --- a/dist/logger.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var _ = require('lodash'); -var util = require('./util'); -var ut = require('util'); - -/** - * Initialize a new `Logger` instance. - * - * @return {Logger} - * @api public - */ - -function viewed(str) { - var re = /\u001b\[\d+m/gm; - return String(str).replace(re, ''); -} - -function trimTo(str, amt) { - var raw = ''; - var visual = viewed(str).slice(0, amt); - var result = ''; - for (var i = 0; i < str.length; ++i) { - raw += str[i]; - if (viewed(raw) === visual) { - result = raw;break; - } - } - - if (result.length < amt - 10) { - return result; - } - - var newResult = result;var found = false; - for (var j = result.length; j > 0; --j) { - if (result[j] === ' ') { - found = true; - break; - } else { - newResult = newResult.slice(0, newResult.length - 1); - } - } - - if (found === true) { - return newResult; - } - - return result; -} - -function Logger(cons) { - var logger = cons || console; - log = function log() { - logger.log.apply(logger, arguments); - }; - - log.cols = function () { - var width = process.stdout.columns; - var pads = 0; - var padsWidth = 0; - var cols = 0; - var colsWidth = 0; - var input = arguments; - - for (var h = 0; h < arguments.length; ++h) { - if (typeof arguments[h] === 'number') { - padsWidth += arguments[h]; - pads++; - } - if (_.isArray(arguments[h]) && typeof arguments[h][0] === 'number') { - padsWidth += arguments[h][0]; - pads++; - } - } - - cols = arguments.length - pads; - colsWidth = Math.floor((width - padsWidth) / cols); - - var lines = []; - - var go = function go() { - var str = ''; - var done = true; - for (var i = 0; i < input.length; ++i) { - if (typeof input[i] === 'number') { - str += util.pad('', input[i], ' '); - } else if (_.isArray(input[i]) && typeof input[i][0] === 'number') { - str += util.pad('', input[i][0], input[i][1]); - } else { - var chosenWidth = colsWidth + 0; - var trimmed = trimTo(input[i], colsWidth); - var trimmedLength = trimmed.length; - var re = /\\u001b\[\d+m/gm; - var matches = ut.inspect(trimmed).match(re); - var color = ''; - // Ugh. We're chopping a line, so we have to look for unfinished - // color assignments and throw them on the next line. - if (matches && matches[matches.length - 1] !== '\\u001b[39m') { - trimmed += '\u001b[39m'; - var number = String(matches[matches.length - 1]).slice(7, 9); - color = '\x1B[' + number + 'm'; - } - input[i] = color + String(input[i].slice(trimmedLength, input[i].length)).trim(); - str += util.pad(String(trimmed).trim(), chosenWidth, ' '); - if (viewed(input[i]).trim() !== '') { - done = false; - } - } - } - lines.push(str); - if (!done) { - go(); - } - }; - go(); - for (var i = 0; i < lines.length; ++i) { - logger.log(lines[i]); - } - return this; - }; - - log.br = function () { - logger.log(' '); - return this; - }; - - return this.log; -} - -/** - * Expose `logger`. - */ - -module.exports = exports = Logger; \ No newline at end of file diff --git a/dist/option.js b/dist/option.js deleted file mode 100755 index aff28351..00000000 --- a/dist/option.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Option = function () { - - /** - * Initialize a new `Option` instance. - * - * @param {String} flags - * @param {String} description - * @param {Autocomplete} autocomplete - * @return {Option} - * @api public - */ - - function Option(flags, description) { - var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; - - _classCallCheck(this, Option); - - options = (typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' ? options : { - autocomplete: options - }; - - this.autocomplete = options.autocomplete; - this._default = options.default ? options.default : null; - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) { - this.assignFlag(flags.shift()); - } - this.assignFlag(flags.shift()); - this.description = description || ''; - } - - /** - * Return option name. - * - * @return {String} - * @api private - */ - - _createClass(Option, [{ - key: 'name', - value: function name() { - if (this.long !== undefined) { - return this.long.replace('--', '').replace('no-', ''); - } - return this.short.replace('-', ''); - } - - /** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - - }, { - key: 'is', - value: function is(arg) { - return arg === this.short || arg === this.long; - } - - /** - * Assigned flag to either long or short. - * - * @param {String} flag - * @api private - */ - - }, { - key: 'assignFlag', - value: function assignFlag(flag) { - if (flag.startsWith('--')) { - this.long = flag; - } else { - this.short = flag; - } - } - }, { - key: 'default', - value: function _default() { - return this._default; - } - }]); - - return Option; -}(); - -/** - * Expose `Option`. - */ - -module.exports = exports = Option; \ No newline at end of file diff --git a/dist/session.js b/dist/session.js deleted file mode 100755 index 68e14652..00000000 --- a/dist/session.js +++ /dev/null @@ -1,559 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter; -var os = require('os'); -var _ = require('lodash'); -var util = require('./util'); -var autocomplete = require('./autocomplete'); -var CommandInstance = require('./command-instance'); - -/** - * Initialize a new `Session` instance. - * - * @param {String} name - * @return {Session} - * @api public - */ - -function Session(options) { - options = options || {}; - this.id = options.id || this._guid(); - this.parent = options.parent || undefined; - this.authenticating = options.authenticating || false; - this.authenticated = options.authenticated || undefined; - this.user = options.user || 'guest'; - this.host = options.host; - this.address = options.address || undefined; - this._isLocal = options.local || undefined; - this._delimiter = options.delimiter || String(os.hostname()).split('.')[0] + '~$'; - this._modeDelimiter = undefined; - - // Keeps history of how many times in a row `tab` was - // pressed on the keyboard. - this._tabCtr = 0; - - this.cmdHistory = this.parent.cmdHistory; - - // Special command mode vorpal is in at the moment, - // such as REPL. See mode documentation. - this._mode = undefined; - - return this; -} - -/** - * Extend Session prototype as an event emitter. - */ - -Session.prototype = Object.create(EventEmitter.prototype); - -/** - * Session prototype. - */ - -var session = Session.prototype; - -/** - * Expose `Session`. - */ - -module.exports = exports = Session; - -/** - * Pipes logging data through any piped - * commands, and then sends it to ._log for - * actual logging. - * - * @param {String} [... arguments] - * @return {Session} - * @api public - */ - -session.log = function () { - var args = util.fixArgsForApply(arguments); - return this._log.apply(this, args); -}; - -/** - * Routes logging for a given session. - * is on a local TTY, or remote. - * - * @param {String} [... arguments] - * @return {Session} - * @api public - */ - -session._log = function () { - var self = this; - if (this.isLocal()) { - this.parent.ui.log.apply(this.parent.ui, arguments); - } else { - // If it's an error, expose the stack. Otherwise - // we get a helpful '{}'. - var args = []; - for (var i = 0; i < arguments.length; ++i) { - var str = arguments[i]; - str = str && str.stack ? 'Error: ' + str.message : str; - args.push(str); - } - self.parent._send('vantage-ssn-stdout-downstream', 'downstream', { sessionId: self.id, value: args }); - } - return this; -}; - -/** - * Returns whether given session - * is on a local TTY, or remote. - * - * @return {Boolean} - * @api public - */ - -session.isLocal = function () { - return this._isLocal; -}; - -/** - * Maps to vorpal.prompt for a session - * context. - * - * @param {Object} options - * @param {Function} cb - * @api public - */ - -session.prompt = function (options, cb) { - options = options || {}; - options.sessionId = this.id; - return this.parent.prompt(options, cb); -}; - -/** - * Gets the full (normal + mode) delimiter - * for this session. - * - * @return {String} - * @api public - */ - -session.fullDelimiter = function () { - var result = this._delimiter + (this._modeDelimiter !== undefined ? this._modeDelimiter : ''); - return result; -}; - -/** - * Sets the delimiter for this session. - * - * @param {String} str - * @return {Session} - * @api public - */ - -session.delimiter = function (str) { - if (str === undefined) { - return this._delimiter; - } - this._delimiter = String(str).trim() + ' '; - if (this.isLocal()) { - this.parent.ui.refresh(); - } else { - this.parent._send('vantage-delimiter-downstream', 'downstream', { value: str, sessionId: this.id }); - } - return this; -}; - -/** - * Sets the mode delimiter for this session. - * - * @param {String} str - * @return {Session} - * @api public - */ - -session.modeDelimiter = function (str) { - var self = this; - if (str === undefined) { - return this._modeDelimiter; - } - if (!this.isLocal()) { - self.parent._send('vantage-mode-delimiter-downstream', 'downstream', { value: str, sessionId: self.id }); - } else { - if (str === false || str === 'false') { - this._modeDelimiter = undefined; - } else { - this._modeDelimiter = String(str).trim() + ' '; - } - this.parent.ui.refresh(); - } - return this; -}; - -/** - * Returns the result of a keypress - * string, depending on the type. - * - * @param {String} key - * @param {String} value - * @return {Function} - * @api private - */ - -session.getKeypressResult = function (key, value, cb) { - cb = cb || function () {}; - var keyMatch = ['up', 'down', 'tab'].indexOf(key) > -1; - if (key !== 'tab') { - this._tabCtr = 0; - } - if (keyMatch) { - if (['up', 'down'].indexOf(key) > -1) { - cb(undefined, this.getHistory(key)); - } else if (key === 'tab') { - // If the Vorpal user has any commands that use - // command.autocompletion, defer to the deprecated - // version of autocompletion. Otherwise, default - // to the new version. - var fn = this.parent._useDeprecatedAutocompletion ? 'getAutocompleteDeprecated' : 'getAutocomplete'; - this[fn](value, function (err, data) { - cb(err, data); - }); - } - } else { - this._histCtr = 0; - } -}; - -session.history = function (str) { - var exceptions = []; - if (str && exceptions.indexOf(String(str).toLowerCase()) === -1) { - this.cmdHistory.newCommand(str); - } -}; - -/** - * New autocomplete. - * - * @param {String} str - * @param {Function} cb - * @api private - */ - -session.getAutocomplete = function (str, cb) { - return autocomplete.exec.call(this, str, cb); -}; - -/** - * Deprecated autocomplete - being deleted - * in Vorpal 2.0. - * - * @param {String} str - * @param {Function} cb - * @api private - */ - -session.getAutocompleteDeprecated = function (str, cb) { - cb = cb || function () {}; - - // Entire command string - var cursor = this.parent.ui._activePrompt.screen.rl.cursor; - var trimmed = String(str).trim(); - var cut = String(trimmed).slice(0, cursor); - var remainder = String(trimmed).slice(cursor, trimmed.length).replace(/ +$/, ''); - trimmed = cut; - - // Set "trimmed" to command string after pipe - // Set "pre" to command string, pipe, and a space - var pre = ''; - var lastPipeIndex = trimmed.lastIndexOf('|'); - if (lastPipeIndex !== -1) { - pre = trimmed.substr(0, lastPipeIndex + 1) + ' '; - trimmed = trimmed.substr(lastPipeIndex + 1).trim(); - } - - // Complete command - var names = _.map(this.parent.commands, '_name'); - names = names.concat.apply(names, _.map(this.parent.commands, '_aliases')); - var result = this._autocomplete(trimmed, names); - if (result && trimmed.length < String(result).trim().length) { - cb(undefined, pre + result + remainder); - return; - } - - // Find custom autocompletion - var match; - var extra; - - names.forEach(function (name) { - if (trimmed.substr(0, name.length) === name && String(name).trim() !== '') { - match = name; - extra = trimmed.substr(name.length).trim(); - } - }); - - var command = match ? _.find(this.parent.commands, { _name: match }) : undefined; - - if (!command) { - command = _.find(this.parent.commands, { _catch: true }); - if (command) { - extra = trimmed; - } - } - - if (command && _.isFunction(command._autocompletion)) { - this._tabCtr++; - command._autocompletion.call(this, extra, this._tabCtr, function (err, autocomplete) { - if (err) { - return cb(err); - } - if (_.isArray(autocomplete)) { - return cb(undefined, autocomplete); - } else if (autocomplete === undefined) { - return cb(undefined, undefined); - } - return cb(undefined, pre + autocomplete + remainder); - }); - } else { - cb(undefined, undefined); - } -}; - -session._autocomplete = function (str, arr) { - return autocomplete.match.call(this, str, arr); -}; - -/** - * Public facing autocomplete helper. - * - * @param {String} str - * @param {Array} arr - * @return {String} - * @api public - */ - -session.help = function (command) { - this.log(this.parent._commandHelp(command || '')); -}; - -/** - * Public facing autocomplete helper. - * - * @param {String} str - * @param {Array} arr - * @return {String} - * @api public - */ - -session.match = function (str, arr) { - return this._autocomplete(str, arr); -}; - -/** - * Gets a new command set ready. - * - * @return {session} - * @api public - */ - -session.execCommandSet = function (wrapper, callback) { - var self = this; - var response = {}; - var res; - var cbk = callback; - this._registeredCommands = 1; - this._completedCommands = 0; - - // Create the command instance for the first - // command and hook it up to the pipe chain. - var commandInstance = new CommandInstance({ - downstream: wrapper.pipes[0], - commandObject: wrapper.commandObject, - commandWrapper: wrapper - }); - - wrapper.commandInstance = commandInstance; - - function sendDones(itm) { - if (itm.commandObject && itm.commandObject._done) { - itm.commandObject._done.call(itm); - } - if (itm.downstream) { - sendDones(itm.downstream); - } - } - - // Called when command is cancelled - this.cancelCommands = function () { - var callCancel = function callCancel(commandInstance) { - if (_.isFunction(commandInstance.commandObject._cancel)) { - commandInstance.commandObject._cancel.call(commandInstance); - } - - if (commandInstance.downstream) { - callCancel(commandInstance.downstream); - } - }; - - callCancel(wrapper.commandInstance); - - // Check if there is a cancel method on the promise - if (res && _.isFunction(res.cancel)) { - res.cancel(wrapper.commandInstance); - } - - self.removeListener('vorpal_command_cancel', self.cancelCommands); - self.cancelCommands = undefined; - self._commandSetCallback = undefined; - self._registeredCommands = 0; - self._completedCommands = 0; - self.parent.emit('client_command_cancelled', { command: wrapper.command }); - - cbk(wrapper); - }; - - this.on('vorpal_command_cancel', self.cancelCommands); - - // Gracefully handles all instances of the command completing. - this._commandSetCallback = function () { - var err = response.error; - var data = response.data; - var argus = response.args; - if (self.isLocal() && err) { - var stack; - if (data && data.stack) { - stack = data.stack; - } else if (err && err.stack) { - stack = err.stack; - } else { - stack = err; - } - self.log(stack); - self.parent.emit('client_command_error', { command: wrapper.command, error: err }); - } else if (self.isLocal()) { - self.parent.emit('client_command_executed', { command: wrapper.command }); - } - - self.removeListener('vorpal_command_cancel', self.cancelCommands); - self.cancelCommands = undefined; - cbk(wrapper, err, data, argus); - sendDones(commandInstance); - }; - - function onCompletion(wrapper, err, data, argus) { - response = { - error: err, - data: data, - args: argus - }; - self.completeCommand(); - } - - var valid; - if (_.isFunction(wrapper.validate)) { - try { - valid = wrapper.validate.call(commandInstance, wrapper.args); - } catch (e) { - // Complete with error on validation error - onCompletion(wrapper, e); - return this; - } - } - - if (valid !== true && valid !== undefined) { - onCompletion(wrapper, valid || null); - return this; - } - - // Call the root command. - res = wrapper.fn.call(commandInstance, wrapper.args, function () { - var argus = util.fixArgsForApply(arguments); - onCompletion(wrapper, argus[0], argus[1], argus); - }); - - // If the command as declared by the user - // returns a promise, handle accordingly. - if (res && _.isFunction(res.then)) { - res.then(function (data) { - onCompletion(wrapper, undefined, data); - }).catch(function (err) { - onCompletion(wrapper, true, err); - }); - } - - return this; -}; - -/** - * Adds on a command or sub-command in progress. - * Session keeps tracked of commands, - * and as soon as all commands have been - * compelted, the session returns the entire - * command set as complete. - * - * @return {session} - * @api public - */ - -session.registerCommand = function () { - this._registeredCommands = this._registeredCommands || 0; - this._registeredCommands++; - return this; -}; - -/** - * Marks a command or subcommand as having completed. - * If all commands have completed, calls back - * to the root command as being done. - * - * @return {session} - * @api public - */ - -session.completeCommand = function () { - this._completedCommands++; - if (this._registeredCommands <= this._completedCommands) { - this._registeredCommands = 0; - this._completedCommands = 0; - if (this._commandSetCallback) { - this._commandSetCallback(); - } - this._commandSetCallback = undefined; - } - return this; -}; - -/** - * Returns the appropriate command history - * string based on an 'Up' or 'Down' arrow - * key pressed by the user. - * - * @param {String} direction - * @return {String} - * @api private - */ - -session.getHistory = function (direction) { - var history; - if (direction === 'up') { - history = this.cmdHistory.getPreviousHistory(); - } else if (direction === 'down') { - history = this.cmdHistory.getNextHistory(); - } - return history; -}; - -/** - * Generates random GUID for Session ID. - * - * @return {GUID} - * @api private - */ - -session._guid = function () { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); - } - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); -}; \ No newline at end of file diff --git a/dist/ui.js b/dist/ui.js deleted file mode 100755 index 340c3242..00000000 --- a/dist/ui.js +++ /dev/null @@ -1,652 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _ = require('lodash'); -var inquirer = require('inquirer'); -var EventEmitter = require('events').EventEmitter; -var chalk = require('chalk'); -var util = require('./util'); -var logUpdate = require('log-update'); - -var UI = function (_EventEmitter) { - _inherits(UI, _EventEmitter); - - /** - * Sets intial variables and registers - * listeners. This is called once in a - * process thread regardless of how many - * instances of Vorpal have been generated. - * - * @api private - */ - - function UI() { - _classCallCheck(this, UI); - - var _this = _possibleConstructorReturn(this, (UI.__proto__ || Object.getPrototypeOf(UI)).call(this)); - - var self = _this; - - // Attached vorpal instance. The UI can - // only attach to one instance of Vorpal - // at a time, and directs all events to that - // instance. - _this.parent = undefined; - - // Hook to reference active inquirer prompt. - _this._activePrompt = undefined; - - // Fail-safe to ensure there is no double - // prompt in odd situations. - _this._midPrompt = false; - - // Handle for inquirer's prompt. - _this.inquirer = inquirer; - - // prompt history from inquirer - _this.inquirerStdout = []; - - // Whether a prompt is currently in cancel mode. - _this._cancelled = false; - - // Middleware for piping stdout through. - _this._pipeFn = undefined; - - // Custom function on sigint event. - _this._sigintCalled = false; - _this._sigintCount = 0; - _this._sigint = function () { - if (_this._sigintCount > 1) { - _this.parent.emit('vorpal_exit'); - process.exit(0); - } else { - var text = _this.input(); - if (!_this.parent) { - // If Vorpal isn't shown, just exit. - process.exit(0); - } else if (_this.parent.session.cancelCommands) { - // There are commands running if - // cancelCommands function is available. - _this.imprint(); - _this.submit(''); - _this._sigintCalled = false; - _this._sigintCount = 0; - _this.parent.session.emit('vorpal_command_cancel'); - } else if (String(text).trim() !== '') { - _this.imprint(); - _this.submit(''); - _this._sigintCalled = false; - _this._sigintCount = 0; - } else { - _this._sigintCalled = false; - _this.delimiter(' '); - _this.submit(''); - _this.log('(^C again to quit)'); - } - } - }; - - process.stdin.on('keypress', function (letter, key) { - key = key || {}; - if (key.ctrl === true && key.shift === false && key.meta === false && ['c', 'C'].indexOf(key.name) > -1) { - _this._sigintCount++; - if (_this._sigint !== undefined && !_this._sigintCalled) { - _this._sigintCalled = true; - _this._sigint.call(self.parent); - _this._sigintCalled = false; - } - } else { - _this._sigintCalled = false; - _this._sigintCount = 0; - } - }); - - // Extend the render function to steal the active prompt object, - // as inquirer doesn't expose it and we need it. - var prompts = ['input', 'checkbox', 'confirm', 'expand', 'list', 'password', 'rawlist']; - - var _loop = function _loop(key) { - var promptType = prompts[key]; - - // Add method to Inquirer to get type of prompt. - inquirer.prompt.prompts[promptType].prototype.getType = function () { - return promptType; - }; - - // Hook in to steal Inquirer's keypress. - inquirer.prompt.prompts[promptType].prototype.onKeypress = function (e) { - // Inquirer seems to have a bug with release v0.10.1 - // (not 0.10.0 though) that triggers keypresses for - // the previous prompt in addition to the current one. - // So if the prompt is answered, shut it up. - if (this.status && this.status === 'answered') { - return; - } - self._activePrompt = this; - self.parent.emit('client_keypress', e); - self._keypressHandler(e, this); - }; - - // Add hook to render method. - var render = inquirer.prompt.prompts[promptType].prototype.render; - inquirer.prompt.prompts[promptType].prototype.render = function () { - self._activePrompt = this; - return render.apply(this, arguments); - }; - }; - - for (var key in prompts) { - _loop(key); - } - - // Sigint handling - make it more graceful. - var onSigInt = function onSigInt() { - if (_.isFunction(_this._sigint) && !_this._sigintCalled) { - _this._sigintCalled = true; - _this._sigint.call(_this.parent); - } - }; - process.on('SIGINT', onSigInt); - process.on('SIGTERM', onSigInt); - return _this; - } - - /** - * Hook for sigint event. - * - * @param {Object} options - * @param {Function} cb - * @api public - */ - - _createClass(UI, [{ - key: 'sigint', - value: function sigint(fn) { - if (_.isFunction(fn)) { - this._sigint = fn; - } else { - throw new Error('vorpal.ui.sigint must be passed in a valid function.'); - } - return this; - } - - /** - * Creates an inquirer prompt on the TTY. - * - * @param {Object} options - * @param {Function} cb - * @api public - */ - - }, { - key: 'prompt', - value: function prompt(options, cb) { - var _this2 = this; - - var prompt = void 0; - options = options || {}; - if (!this.parent) { - return prompt; - } - if (options.delimiter) { - this.setDelimiter(options.delimiter); - } - if (options.message) { - this.setDelimiter(options.message); - } - if (this._midPrompt) { - console.log('Prompt called when mid prompt...'); - throw new Error('UI Prompt called when already mid prompt.'); - } - this._midPrompt = true; - try { - prompt = inquirer.prompt(options).then(function (result) { - _this2.inquirerStdout = []; - _this2._midPrompt = false; - if (_this2._cancel === true) { - _this2._cancel = false; - } else { - cb(result); - } - }); - - // Temporary hack. We need to pull the active - // prompt from inquirer as soon as possible, - // however we can't just assign it sync, as - // the prompt isn't ready yet. - // I am trying to get inquirer extended to - // fire an event instead. - setTimeout(function () { - // this._activePrompt = prompt._activePrompt; - }, 100); - } catch (e) { - console.log('Vorpal Prompt error:', e); - } - return prompt; - } - - /** - * Returns a boolean as to whether user - * is mid another pr ompt. - * - * @return {Boolean} - * @api public - */ - - }, { - key: 'midPrompt', - value: function midPrompt() { - var mid = this._midPrompt === true && this.parent !== undefined; - return mid; - } - }, { - key: 'setDelimiter', - value: function setDelimiter(str) { - var self = this; - if (!this.parent) { - return; - } - str = String(str).trim() + ' '; - this._lastDelimiter = str; - inquirer.prompt.prompts.password.prototype.getQuestion = function () { - self._activePrompt = this; - return this.opt.message; - }; - inquirer.prompt.prompts.input.prototype.getQuestion = function () { - self._activePrompt = this; - var message = this.opt.message; - if ((this.opt.default || this.opt.default === false) && this.status !== 'answered') { - message += chalk.dim('(' + this.opt.default + ') '); - } - self.inquirerStdout.push(message); - return message; - }; - } - - /** - * Event handler for keypresses - deals with command history - * and tabbed auto-completion. - * - * @param {Event} e - * @param {Prompt} prompt - * @api private - */ - - }, { - key: '_keypressHandler', - value: function _keypressHandler(e, prompt) { - // Remove tab characters from user input. - prompt.rl.line = prompt.rl.line.replace(/\t+/, ''); - - // Mask passwords. - var line = prompt.getType() !== 'password' ? prompt.rl.line : '*'.repeat(prompt.rl.line.length); - - // Re-write render function. - var width = prompt.rl.line.length; - var newWidth = prompt.rl.line.length; - var diff = newWidth - width; - prompt.rl.cursor += diff; - var message = prompt.getQuestion(); - var addition = prompt.status === 'answered' ? chalk.cyan(prompt.answer) : line; - message += addition; - prompt.screen.render(message); - - var key = (e.key || {}).name; - var value = prompt ? String(line) : undefined; - this.emit('vorpal_ui_keypress', { key: key, value: value, e: e }); - } - - /** - * Pauses active prompt, returning - * the value of what had been typed so far. - * - * @return {String} val - * @api public - */ - - }, { - key: 'pause', - value: function pause() { - if (!this.parent) { - return false; - } - if (!this._activePrompt) { - return false; - } - if (!this._midPrompt) { - return false; - } - var val = this._lastDelimiter + this._activePrompt.rl.line; - this._midPrompt = false; - var rl = this._activePrompt.screen.rl; - var screen = this._activePrompt.screen; - rl.output.unmute(); - screen.clean(); - rl.output.write(''); - return val; - } - - /** - * Resumes active prompt, accepting - * a string, which will fill the prompt - * with that text and put the cursor at - * the end. - * - * @param {String} val - * @api public - */ - - }, { - key: 'resume', - value: function resume(val) { - if (!this.parent) { - return this; - } - val = val || ''; - if (!this._activePrompt) { - return this; - } - if (this._midPrompt) { - return this; - } - var rl = this._activePrompt.screen.rl; - rl.output.write(val); - this._midPrompt = true; - return this; - } - - /** - * Cancels the active prompt, essentially - * but cutting out of the inquirer loop. - * - * @api public - */ - - }, { - key: 'cancel', - value: function cancel() { - if (this.midPrompt()) { - this._cancel = true; - this.submit(''); - this._midPrompt = false; - } - return this; - } - - /** - * Attaches TTY prompt to a given Vorpal instance. - * - * @param {Vorpal} vorpal - * @return {UI} - * @api public - */ - - }, { - key: 'attach', - value: function attach(vorpal) { - this.parent = vorpal; - this.refresh(); - this.parent._prompt(); - return this; - } - - /** - * Detaches UI from a given Vorpal instance. - * - * @param {Vorpal} vorpal - * @return {UI} - * @api public - */ - - }, { - key: 'detach', - value: function detach(vorpal) { - if (vorpal === this.parent) { - this.parent = undefined; - } - return this; - } - - /** - * Receives and runs logging through - * a piped function is one is provided - * through ui.pipe(). Pauses any active - * prompts, logs the data and then if - * paused, resumes the prompt. - * - * @return {UI} - * @api public - */ - - }, { - key: 'log', - value: function log() { - var args = util.fixArgsForApply(arguments); - args = _.isFunction(this._pipeFn) ? this._pipeFn(args) : args; - if (args === '') { - return this; - } - args = util.fixArgsForApply(args); - if (this.midPrompt()) { - var data = this.pause(); - console.log.apply(console.log, args); - if (typeof data !== 'undefined' && data !== false) { - this.resume(data); - } else { - console.log('Log got back \'false\' as data. This shouldn\'t happen.', data); - } - } else { - console.log.apply(console.log, args); - } - return this; - } - - /** - * Submits a given prompt. - * - * @param {String} value - * @return {UI} - * @api public - */ - - }, { - key: 'submit', - value: function submit() { - if (this._activePrompt) { - // this._activePrompt.screen.onClose(); - this._activePrompt.rl.emit('line'); - // this._activePrompt.onEnd({isValid: true, value: value}); - // to do - I don't know a good way to do this. - } - return this; - } - - /** - * Does a literal, one-time write to the - * *current* prompt delimiter. - * - * @param {String} str - * @return {UI} - * @api public - */ - - }, { - key: 'delimiter', - value: function delimiter(str) { - if (!this._activePrompt) { - return this; - } - var prompt = this._activePrompt; - if (str === undefined) { - return prompt.opt.message; - } - prompt.opt.message = str; - this.refresh(); - return this; - } - - /** - * Re-writes the input of an Inquirer prompt. - * If no string is passed, it gets the current - * input. - * - * @param {String} str - * @return {String} - * @api public - */ - - }, { - key: 'input', - value: function input(str) { - if (!this._activePrompt) { - return undefined; - } - var prompt = this._activePrompt; - if (str === undefined) { - return prompt.rl.line; - } - var width = prompt.rl.line.length; - prompt.rl.line = str; - var newWidth = prompt.rl.line.length; - var diff = newWidth - width; - prompt.rl.cursor += diff; - var message = prompt.getQuestion(); - var addition = prompt.status === 'answered' ? chalk.cyan(prompt.answer) : prompt.rl.line; - message += addition; - prompt.screen.render(message); - return this; - } - - /** - * Logs the current delimiter and typed data. - * - * @return {UI} - * @api public - */ - - }, { - key: 'imprint', - value: function imprint() { - if (!this.parent) { - return this; - } - var val = this._activePrompt.rl.line; - var delimiter = this._lastDelimiter || this.delimiter() || ''; - this.log(delimiter + val); - return this; - } - - /** - * Redraws the inquirer prompt with a new string. - * - * @param {String} str - * @return {UI} - * @api private - */ - - }, { - key: 'refresh', - value: function refresh() { - if (!this.parent || !this._activePrompt) { - return this; - } - this._activePrompt.screen.clean(); - this._activePrompt.render(); - this._activePrompt.rl.output.write(this._activePrompt.rl.line); - return this; - } - - /** - * Writes over existing logging. - * - * @param {String} str - * @return {UI} - * @api public - */ - - }, { - key: 'redraw', - value: function redraw(str) { - logUpdate(str); - return this; - } - }]); - - return UI; -}(EventEmitter); - -/** - * Initialize singleton. - */ - -var ui = new UI(); - -/** - * Clears logging from `ui.redraw` - * permanently. - * - * @return {UI} - * @api public - */ - -ui.redraw.clear = function () { - logUpdate.clear(); - return ui; -}; - -/** - * Prints logging from `ui.redraw` - * permanently. - * - * @return {UI} - * @api public - */ - -ui.redraw.done = function () { - logUpdate.done(); - ui.refresh(); - return ui; -}; - -/** - * Expose `ui`. - * - * Modifying global? WTF?!? Yes. It is evil. - * However node.js prompts are also quite - * evil in a way. Nothing prevents dual prompts - * between applications in the same terminal, - * and inquirer doesn't catch or deal with this, so - * if you want to start two independent instances of - * vorpal, you need to know that prompt listeners - * have already been initiated, and that you can - * only attach the tty to one vorpal instance - * at a time. - * When you fire inqurier twice, you get a double-prompt, - * where every keypress fires twice and it's just a - * total mess. So forgive me. - */ - -global.__vorpal = global.__vorpal || {}; -global.__vorpal.ui = global.__vorpal.ui || { - exists: false, - exports: undefined -}; - -if (!global.__vorpal.ui.exists) { - global.__vorpal.ui.exists = true; - global.__vorpal.ui.exports = ui; - module.exports = exports = global.__vorpal.ui.exports; -} else { - module.exports = global.__vorpal.ui.exports; -} \ No newline at end of file diff --git a/dist/util.js b/dist/util.js deleted file mode 100755 index 222d2579..00000000 --- a/dist/util.js +++ /dev/null @@ -1,468 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -var _ = require('lodash'); -var minimist = require('minimist'); -var strip = require('strip-ansi'); - -var util = { - /** - * Parses command arguments from multiple - * sources. - * - * @param {String} str - * @param {Object} opts - * @return {Array} - * @api private - */ - - parseArgs: function parseArgs(str, opts) { - var reg = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; - var arr = []; - var match = void 0; - do { - match = reg.exec(str); - if (match !== null) { - arr.push(match[1] || match[2] || match[3] || match[4]); - } - } while (match !== null); - - arr = minimist(arr, opts); - arr._ = arr._ || []; - return arr; - }, - - /** - * Prepares a command and all its parts for execution. - * - * @param {String} command - * @param {Array} commands - * @return {Object} - * @api public - */ - - parseCommand: function parseCommand(command, commands) { - var self = this; - var pipes = []; - var match = void 0; - var matchArgs = void 0; - var matchParts = void 0; - - function parsePipes() { - // First, split the command by pipes naively. - // This will split command arguments in half when the argument contains a pipe character. - // For example, say "(Vorpal|vorpal)" will be split into ['say "(Vorpal', 'vorpal)'] which isn't good. - var naivePipes = String(command).trim().split('|'); - - // Contruct empty array to place correctly split commands into. - var newPipes = []; - - // We will look for pipe characters within these quotes to rejoin together. - var quoteChars = ['"', '\'', '`']; - - // This will expand to contain one boolean key for each type of quote. - // The value keyed by the quote is toggled off and on as quote type is opened and closed. - // Example { "`": true, "'": false } would mean that there is an open angle quote. - var quoteTracker = {}; - - // The current command piece before being rejoined with it's over half. - // Since it's not common for pipes to occur in commands, this is usually the entire command pipe. - var commandPart = ''; - - // Loop through each naive pipe. - for (var key in naivePipes) { - // It's possible/likely that this naive pipe is the whole pipe if it doesn't contain an unfinished quote. - var possiblePipe = naivePipes[key]; - commandPart += possiblePipe; - - // Loop through each individual character in the possible pipe tracking the opening and closing of quotes. - for (var i = 0; i < possiblePipe.length; i++) { - var char = possiblePipe[i]; - if (quoteChars.indexOf(char) !== -1) { - quoteTracker[char] = !quoteTracker[char]; - } - } - - // Does the pipe end on an unfinished quote? - var inQuote = _.some(quoteChars, function (quoteChar) { - return quoteTracker[quoteChar]; - }); - - // If the quotes have all been closed or this is the last possible pipe in the array, add as pipe. - if (!inQuote || key * 1 === naivePipes.length - 1) { - newPipes.push(commandPart.trim()); - commandPart = ''; - } else { - // Quote was left open. The pipe character was previously removed when the array was split. - commandPart += '|'; - } - } - - // Set the first pipe to command and the rest to pipes. - command = newPipes.shift(); - pipes = pipes.concat(newPipes); - } - - function parseMatch() { - matchParts = self.matchCommand(command, commands); - match = matchParts.command; - matchArgs = matchParts.args; - } - - parsePipes(); - parseMatch(); - - if (match && _.isFunction(match._parse)) { - command = match._parse(command, matchParts.args); - parsePipes(); - parseMatch(); - } - - return { - command: command, - match: match, - matchArgs: matchArgs, - pipes: pipes - }; - }, - - /** - * Run a raw command string, e.g. foo -bar - * against a given list of commands, - * and if there is a match, parse the - * results. - * - * @param {String} cmd - * @param {Array} cmds - * @return {Object} - * @api public - */ - - matchCommand: function matchCommand(cmd, cmds) { - var parts = String(cmd).trim().split(' '); - - var match = void 0; - var matchArgs = void 0; - for (var i = 0; i < parts.length; ++i) { - var subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); - match = _.find(cmds, { _name: subcommand }) || match; - if (!match) { - for (var key in cmds) { - var _cmd = cmds[key]; - var idx = _cmd._aliases.indexOf(subcommand); - match = idx > -1 ? _cmd : match; - } - } - if (match) { - matchArgs = parts.slice(parts.length - i, parts.length).join(' '); - break; - } - } - // If there's no command match, check if the - // there's a `catch` command, which catches all - // missed commands. - if (!match) { - match = _.find(cmds, { _catch: true }); - // If there is one, we still need to make sure we aren't - // partially matching command groups, such as `do things` when - // there is a command `do things well`. If we match partially, - // we still want to show the help menu for that command group. - if (match) { - var allCommands = _.map(cmds, '_name'); - var wordMatch = false; - for (var _key in allCommands) { - var _cmd2 = allCommands[_key]; - var parts2 = String(_cmd2).split(' '); - var cmdParts = String(match.command).split(' '); - var matchAll = true; - for (var k = 0; k < cmdParts.length; ++k) { - if (parts2[k] !== cmdParts[k]) { - matchAll = false; - break; - } - } - if (matchAll) { - wordMatch = true; - break; - } - } - if (wordMatch) { - match = undefined; - } else { - matchArgs = cmd; - } - } - } - - return { - command: match, - args: matchArgs - }; - }, - - buildCommandArgs: function buildCommandArgs(passedArgs, cmd, execCommand, isCommandArgKeyPairNormalized) { - var args = { options: {} }; - - if (isCommandArgKeyPairNormalized) { - // Normalize all foo="bar" with "foo='bar'" - // This helps implement unix-like key value pairs. - var reg = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; - passedArgs = passedArgs.replace(reg, '"$2=\'$4$5\'"'); - } - - // Types are custom arg types passed - // into `minimist` as per its docs. - var types = cmd._types || {}; - - // Make a list of all boolean options - // registered for this command. These are - // simply commands that don't have required - // or optional args. - var booleans = []; - cmd.options.forEach(function (opt) { - if (opt.required === 0 && opt.optional === 0) { - if (opt.short) { - booleans.push(opt.short); - } - if (opt.long) { - booleans.push(opt.long); - } - } - }); - - // Review the args passed into the command, - // and filter out the boolean list to only those - // options passed in. - // This returns a boolean list of all options - // passed in by the caller, which don't have - // required or optional args. - var passedArgParts = passedArgs.split(' '); - types.boolean = booleans.map(function (str) { - return String(str).replace(/^-*/, ''); - }).filter(function (str) { - var match = false; - var strings = ['-' + str, '--' + str, '--no-' + str]; - for (var i = 0; i < passedArgParts.length; ++i) { - if (strings.indexOf(passedArgParts[i]) > -1) { - match = true; - break; - } - } - return match; - }); - - // Use minimist to parse the args. - var parsedArgs = this.parseArgs(passedArgs, types); - - function validateArg(arg, cmdArg) { - return !(arg === undefined && cmdArg.required === true); - } - - // Builds varidiac args and options. - var valid = true; - var remainingArgs = _.clone(parsedArgs._); - for (var l = 0; l < 10; ++l) { - var matchArg = cmd._args[l]; - var passedArg = parsedArgs._[l]; - if (matchArg !== undefined) { - valid = !valid ? false : validateArg(parsedArgs._[l], matchArg); - if (!valid) { - break; - } - if (passedArg !== undefined) { - if (matchArg.variadic === true) { - args[matchArg.name] = remainingArgs; - } else { - args[matchArg.name] = passedArg; - remainingArgs.shift(); - } - } - } - } - - if (!valid) { - return '\n Missing required argument. Showing Help:'; - } - - // Looks for ommitted required options and throws help. - for (var m = 0; m < cmd.options.length; ++m) { - var o = cmd.options[m]; - var short = String(o.short || '').replace(/-/g, ''); - var long = String(o.long || '').replace(/--no-/g, '').replace(/^-*/g, ''); - var exist = parsedArgs[short] !== undefined ? parsedArgs[short] : undefined; - exist = exist === undefined && parsedArgs[long] !== undefined ? parsedArgs[long] : exist; - var existsNotSet = exist === true || exist === false; - var defaultValue = o.default(); - - if (existsNotSet && o.required !== 0 && !defaultValue) { - return '\n Missing required value for option ' + (o.long || o.short) + '. Showing Help:'; - } - if (exist !== undefined) { - args.options[long || short] = exist; - } else if (defaultValue) { - args.options[long || short] = defaultValue; - } - } - - // Looks for supplied options that don't - // exist in the options list. - // If the command allows unknown options, - // adds it, otherwise throws help. - var passedOpts = _.chain(parsedArgs).keys().pull('_').pull('help').value(); - - var _loop = function _loop(key) { - var opt = passedOpts[key]; - var optionFound = _.find(cmd.options, function (expected) { - if ('--' + opt === expected.long || '--no-' + opt === expected.long || '-' + opt === expected.short) { - return true; - } - return false; - }); - if (optionFound === undefined) { - if (cmd._allowUnknownOptions) { - args.options[opt] = parsedArgs[opt]; - } else { - return { - v: '\n Invalid option: \'' + opt + '\'. Showing Help:' - }; - } - } - }; - - for (var key in passedOpts) { - var _ret = _loop(key); - - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; - } - - // If args were passed into the programmatic - // `vorpal.exec(cmd, args, callback)`, merge - // them here. - if (execCommand && execCommand.args && _.isObject(execCommand.args)) { - args = _.extend(args, execCommand.args); - } - - // Looks for a help arg and throws help if any. - if (parsedArgs.help || parsedArgs._.indexOf('/?') > -1) { - args.options.help = true; - } - - return args; - }, - - /** - * Makes an argument name pretty for help. - * - * @param {String} arg - * @return {String} - * @api private - */ - - humanReadableArgName: function humanReadableArgName(arg) { - var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); - return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']'; - }, - - /** - * Formats an array to display in a TTY - * in a pretty fashion. - * - * @param {Array} arr - * @return {String} - * @api public - */ - - prettifyArray: function prettifyArray(arr) { - arr = arr || []; - var arrClone = _.clone(arr); - var width = process.stdout.columns; - var longest = strip(arrClone.sort(function (a, b) { - return strip(b).length - strip(a).length; - })[0] || '').length + 2; - var fullWidth = strip(String(arr.join(''))).length; - var fitsOneLine = fullWidth + arr.length * 2 <= width; - var cols = Math.floor(width / longest); - cols = cols < 1 ? 1 : cols; - if (fitsOneLine) { - return arr.join(' '); - } - var col = 0; - var lines = []; - var line = ''; - for (var key in arr) { - var arrEl = arr[key]; - if (col < cols) { - col++; - } else { - lines.push(line); - line = ''; - col = 1; - } - line += this.pad(arrEl, longest, ' '); - } - if (line !== '') { - lines.push(line); - } - return lines.join('\n'); - }, - - /** - * Pads a value with with space or - * a specified delimiter to match a - * given width. - * - * @param {String} str - * @param {Integer} width - * @param {String} delimiter - * @return {String} - * @api private - */ - - pad: function pad(str, width, delimiter) { - width = Math.floor(width); - delimiter = delimiter || ' '; - var len = Math.max(0, width - strip(str).length); - return str + Array(len + 1).join(delimiter); - }, - - /** - * Pad a row on the start and end with spaces. - * - * @param {String} str - * @return {String} - */ - padRow: function padRow(str) { - return str.split('\n').map(function (row) { - return ' ' + row + ' '; - }).join('\n'); - }, - - // When passing down applied args, we need to turn - // them from `{ '0': 'foo', '1': 'bar' }` into ['foo', 'bar'] - // instead. - fixArgsForApply: function fixArgsForApply(obj) { - if (!_.isObject(obj)) { - if (!_.isArray(obj)) { - return [obj]; - } - return obj; - } - var argArray = []; - for (var key in obj) { - var aarg = obj[key]; - argArray.push(aarg); - } - return argArray; - } -}; - -/** - * Expose `util`. - */ - -module.exports = exports = util; \ No newline at end of file diff --git a/dist/vorpal-commons.js b/dist/vorpal-commons.js deleted file mode 100755 index 5046703d..00000000 --- a/dist/vorpal-commons.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -/** - * Function library for Vorpal's out-of-the-box - * API commands. Imported into a Vorpal server - * through vorpal.use(module). - */ - -/** - * Module dependencies. - */ - -var _ = require('lodash'); - -module.exports = function (vorpal) { - /** - * Help for a particular command. - */ - - vorpal.command('help [command...]').description('Provides help for a given command.').action(function (args, cb) { - var self = this; - if (args.command) { - args.command = args.command.join(' '); - var name = _.find(this.parent.commands, { _name: String(args.command).toLowerCase().trim() }); - if (name && !name._hidden) { - if (_.isFunction(name._help)) { - name._help(args.command, function (str) { - self.log(str); - cb(); - }); - return; - } - this.log(name.helpInformation()); - } else { - this.log(this.parent._commandHelp(args.command)); - } - } else { - this.log(this.parent._commandHelp(args.command)); - } - cb(); - }); - - /** - * Exits Vorpal. - */ - - vorpal.command('exit').alias('quit').description('Exits application.').action(function (args) { - args.options = args.options || {}; - args.options.sessionId = this.session.id; - this.parent.exit(args.options); - }); -}; \ No newline at end of file diff --git a/dist/vorpal.js b/dist/vorpal.js deleted file mode 100755 index 4b6cd2ab..00000000 --- a/dist/vorpal.js +++ /dev/null @@ -1,1326 +0,0 @@ -'use strict'; - -/** - * Polyfill for ES6. - */ - -if (!global._babelPolyfill) { - // When the runtime transformer properly detects all shimmed methods, use instead. - // http://www.2ality.com/2015/12/babel6-helpersstandard-library.html#babel-plugin-transform-runtime - require('babel-polyfill'); -} - -/** - * Module dependencies. - */ - -var _ = require('lodash'); -var EventEmitter = require('events').EventEmitter; -var Command = require('./command'); -var CommandInstance = require('./command-instance'); -var VorpalUtil = require('./util'); -var ui = require('./ui'); -var Session = require('./session'); -var intercept = require('./intercept'); -var minimist = require('minimist'); -var commons = require('./vorpal-commons'); -var chalk = require('chalk'); -var os = require('os'); -var History = require('./history'); -var LocalStorage = require('./local-storage'); -var wrap = require('wrap-ansi'); - -/** - * Initialize a new `Vorpal` instance. - * - * @return {Vorpal} - * @api public - */ - -function Vorpal() { - if (!(this instanceof Vorpal)) { - return new Vorpal(); - } - - // Program version - // Exposed through vorpal.version(str); - this._version = ''; - - // Program title - this._title = ''; - - // Program description - this._description = ''; - - // Program baner - this._banner = ''; - - // Command line history instance - this.cmdHistory = new this.CmdHistoryExtension(); - - // Registered `vorpal.command` commands and - // their options. - this.commands = []; - - // Queue of IP requests, executed async, in sync. - this._queue = []; - - // Current command being executed. - this._command = undefined; - - // Expose UI. - this.ui = ui; - - // Expose chalk as a convenience. - this.chalk = chalk; - - // Expose lodash as a convenience. - this.lodash = _; - - // Exposed through vorpal.delimiter(str). - this._delimiter = 'local@' + String(os.hostname()).split('.')[0] + '~$ '; - ui.setDelimiter(this._delimiter); - - // Placeholder for vantage server. If vantage - // is used, this will be over-written. - this.server = { - sessions: [] - }; - - // Whether all stdout is being hooked through a function. - this._hooked = false; - - this._useDeprecatedAutocompletion = false; - - // Expose common utilities, like padding. - this.util = VorpalUtil; - - this.Session = Session; - - // Active vorpal server session. - this.session = new this.Session({ - local: true, - user: 'local', - parent: this, - delimiter: this._delimiter - }); - - // Allow unix-like key value pair normalization to be turned off by toggling this switch on. - this.isCommandArgKeyPairNormalized = true; - - this._init(); - return this; -} - -/** - * Extend Vorpal prototype as an event emitter. - */ - -Vorpal.prototype = Object.create(EventEmitter.prototype); - -/** - * Vorpal prototype. - */ - -var vorpal = Vorpal.prototype; - -/** - * Expose `Vorpal`. - */ - -exports = module.exports = Vorpal; - -/** - * Extension to `constructor`. - * @api private - */ - -Vorpal.prototype._init = function () { - var self = this; - - ui.on('vorpal_ui_keypress', function (data) { - self.emit('keypress', data); - self._onKeypress(data.key, data.value); - }); - - self.use(commons); -}; - -/** - * Parses `process.argv` and executes - * a Vorpal command based on it. - * @api public - */ - -Vorpal.prototype.parse = function (argv, options) { - options = options || {}; - var args = argv; - var result = this; - var catchExists = !(_.find(this.commands, { _catch: true }) === undefined); - args.shift(); - args.shift(); - if (args.length > 0 || catchExists) { - if (options.use === 'minimist') { - result = minimist(args); - } else { - // Wrap the spaced args back in quotes. - for (var i = 0; i < args.length; ++i) { - if (i === 0) { - continue; - } - if (args[i].indexOf(' ') > -1) { - args[i] = '"' + args[i] + '"'; - } - } - this.exec(args.join(' '), function (err) { - if (err !== undefined && err !== null) { - throw new Error(err); - } - process.exit(0); - }); - } - } - return result; -}; - -/** - * Sets version of your application's API. - * - * @param {String} version - * @return {Vorpal} - * @api public - */ - -vorpal.version = function (version) { - this._version = version; - return this; -}; - -/** - * Sets the title of your application. - * - * @param {String} title - * @return {Vorpal} - * @api public - */ - -vorpal.title = function (title) { - this._title = title; - return this; -}; - -/** - * Sets the description of your application. - * - * @param {String} description - * @return {Vorpal} - * @api public - */ - -vorpal.description = function (description) { - this._description = description; - return this; -}; - -/** - * Sets the banner of your application. - * - * @param {String} banner - * @return {Vorpal} - * @api public - */ - -vorpal.banner = function (banner) { - this._banner = banner; - return this; -}; - -/** - * Sets the permanent delimiter for this - * Vorpal server instance. - * - * @param {String} str - * @return {Vorpal} - * @api public - */ - -vorpal.delimiter = function (str) { - this._delimiter = str; - if (this.session.isLocal() && !this.session.client) { - this.session.delimiter(str); - } - return this; -}; - -/** - * Imports a library of Vorpal API commands - * from another Node module as an extension - * of Vorpal. - * - * @param {Array} commands - * @return {Vorpal} - * @api public - */ - -vorpal.use = function (commands, options) { - if (!commands) { - return this; - } - if (_.isFunction(commands)) { - commands.call(this, this, options); - } else if (_.isString(commands)) { - return this.use(require(commands), options); - } else { - commands = _.isArray(commands) ? commands : [commands]; - for (var i = 0; i < commands.length; ++i) { - var cmd = commands[i]; - if (cmd.command) { - var command = this.command(cmd.command); - if (cmd.description) { - command.description(cmd.description); - } - if (cmd.options) { - cmd.options = _.isArray(cmd.options) ? cmd.options : [cmd.options]; - for (var j = 0; j < cmd.options.length; ++j) { - command.option(cmd.options[j][0], cmd.options[j][1]); - } - } - if (cmd.action) { - command.action(cmd.action); - } - } - } - } - return this; -}; - -/** - * Registers a new command in the vorpal API. - * - * @param {String} name - * @param {String} desc - * @param {Object} opts - * @return {Command} - * @api public - */ - -vorpal.command = function (name, desc, opts) { - opts = opts || {}; - name = String(name); - - var argsRegExp = /(\[[^\]]*\]|\<[^\>]*\>)/g; - var args = []; - var arg; - - while ((arg = argsRegExp.exec(name)) !== null) { - args.push(arg[1]); - } - - var cmdNameRegExp = /^([^\[\<]*)/; - var cmdName = cmdNameRegExp.exec(name)[0].trim(); - - var cmd = new Command(cmdName, this); - - if (desc) { - cmd.description(desc); - this.executables = true; - } - - cmd._noHelp = Boolean(opts.noHelp); - cmd._mode = opts.mode || false; - cmd._catch = opts.catch || false; - cmd._parseExpectedArgs(args); - cmd.parent = this; - - var exists = false; - for (var i = 0; i < this.commands.length; ++i) { - exists = this.commands[i]._name === cmd._name ? true : exists; - if (exists) { - this.commands[i] = cmd; - break; - } - } - if (!exists) { - this.commands.push(cmd); - } else { - console.warn(chalk.yellow('Warning: command named "' + name + '" was registered more than once.\nIf you intend to override a command, you should explicitly remove the first command with command.remove().')); - } - - this.emit('command_registered', { command: cmd, name: name }); - - return cmd; -}; - -/** - * Registers a new 'mode' command in the vorpal API. - * - * @param {String} name - * @param {String} desc - * @param {Object} opts - * @return {Command} - * @api public - */ - -vorpal.mode = function (name, desc, opts) { - return this.command(name, desc, _.extend(opts || {}, { mode: true })); -}; - -/** - * Registers a 'catch' command in the vorpal API. - * This is executed when no command matches are found. - * - * @param {String} name - * @param {String} desc - * @param {Object} opts - * @return {Command} - * @api public - */ - -vorpal.catch = function (name, desc, opts) { - return this.command(name, desc, _.extend(opts || {}, { catch: true })); -}; - -/** - * An alias to the `catch` command. - * - * @param {String} name - * @param {String} desc - * @param {Object} opts - * @return {Command} - * @api public - */ - -vorpal.default = function (name, desc, opts) { - return this.command(name, desc, _.extend(opts || {}, { catch: true })); -}; - -/** - * Delegates to ui.log. - * - * @param {String} log - * @return {Vorpal} - * @api public - */ - -vorpal.log = function () { - this.ui.log.apply(this.ui, arguments); - return this; -}; - -/** - * Intercepts all logging through `vorpal.log` - * and runs it through the function declared by - * `vorpal.pipe()`. - * - * @param {Function} fn - * @return {Vorpal} - * @api public - */ - -vorpal.pipe = function (fn) { - if (this.ui) { - this.ui._pipeFn = fn; - } - return this; -}; - -/** - * If Vorpal is the local terminal, - * hook all stdout, through a fn. - * - * @return {Vorpal} - * @api private - */ - -vorpal.hook = function (fn) { - if (fn !== undefined) { - this._hook(fn); - } else { - this._unhook(); - } - return this; -}; - -/** - * Unhooks stdout capture. - * - * @return {Vorpal} - * @api public - */ - -vorpal._unhook = function () { - if (this._hooked && this._unhook !== undefined) { - this._unhook(); - this._hooked = false; - } - return this; -}; - -/** - * Hooks all stdout through a given function. - * - * @param {Function} fn - * @return {Vorpal} - * @api public - */ - -vorpal._hook = function (fn) { - if (this._hooked && this._unhook !== undefined) { - this._unhook(); - } - this._unhook = intercept(fn); - this._hooked = true; - return this; -}; - -/** - * History module used to get command history - */ -vorpal.CmdHistoryExtension = History; - -/** - * Set id for command line history - * @param id - * @return {Vorpal} - * @api public - */ -vorpal.history = function (id) { - this.cmdHistory.setId(id); - return this; -}; - -/** - * Set id for local storage - * @param id - * @return {Vorpal} - * @api public - */ -vorpal.localStorage = function (id) { - var ls = Object.create(LocalStorage); - ls.setId(id); - _.extend(this.localStorage, ls); - return this; -}; - -/** - * Set the path to where command line history is persisted. - * Must be called before vorpal.history - * @param path - * @return {Vorpal} - * @api public - */ -vorpal.historyStoragePath = function (path) { - this.cmdHistory.setStoragePath(path); - return this; -}; - -/** - * Hook the tty prompt to this given instance - * of vorpal. - * - * @return {Vorpal} - * @api public - */ - -vorpal.show = function () { - ui.attach(this); - return this; -}; - -/** - * Disables the vorpal prompt on the - * local terminal. - * - * @return {Vorpal} - * @api public - */ - -vorpal.hide = function () { - ui.detach(this); - return this; -}; - -/** - * Listener for a UI keypress. Either - * handles the keypress locally or sends - * it upstream. - * - * @param {String} key - * @param {String} value - * @api private - */ - -vorpal._onKeypress = function (key, value) { - var self = this; - if (this.session.isLocal() && !this.session.client && !this._command) { - this.session.getKeypressResult(key, value, function (err, result) { - if (!err && result !== undefined) { - if (_.isArray(result)) { - var formatted = VorpalUtil.prettifyArray(result); - self.ui.imprint(); - self.session.log(formatted); - } else { - self.ui.input(result); - } - } - }); - } else { - this._send('vantage-keypress-upstream', 'upstream', { - key: key, - value: value, - sessionId: this.session.id - }); - } -}; - -/** - * For use in vorpal API commands, sends - * a prompt command downstream to the local - * terminal. Executes a prompt and returns - * the response upstream to the API command. - * - * @param {Object} options - * @param {Function} userCallback - * @return {Vorpal} - * @api public - */ - -vorpal.prompt = function () { - var _this = this; - - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var userCallback = arguments[1]; - - return new Promise(function (resolve) { - // Setup callback to also resolve promise. - var cb = function cb(response) { - // Does not currently handle Inquirer validation errors. - resolve(response); - if (userCallback) { - userCallback(response); - } - }; - - var prompt = void 0; - var ssn = _this.getSessionById(options.sessionId); - - if (!ssn) { - throw new Error('Vorpal.prompt was called without a passed Session ID.'); - } - - var handler = function handler(data) { - var response = data.value; - _this.removeListener('vantage-prompt-upstream', handler); - cb(response); - }; - - if (ssn.isLocal()) { - ui.setDelimiter(options.message || ssn.delimiter()); - prompt = ui.prompt(options, function (result) { - ui.setDelimiter(ssn.delimiter()); - cb(result); - }); - } else { - _this.on('vantage-prompt-upstream', handler); - _this._send('vantage-prompt-downstream', 'downstream', { options: options, value: undefined, sessionId: ssn.id }); - } - return prompt; - }); -}; - -/** - * Renders the CLI prompt or sends the - * request to do so downstream. - * - * @param {Object} data - * @return {Vorpal} - * @api private - */ - -vorpal._prompt = function (data) { - var self = this; - var prompt; - data = data || {}; - if (!data.sessionId) { - data.sessionId = self.session.id; - } - var ssn = self.getSessionById(data.sessionId); - - // If we somehow got to _prompt and aren't the - // local client, send the command downstream. - if (!ssn.isLocal()) { - this._send('vantage-resume-downstream', 'downstream', { sessionId: data.sessionId }); - return self; - } - - if (ui.midPrompt()) { - return self; - } - - prompt = ui.prompt({ - type: 'input', - name: 'command', - message: ssn.fullDelimiter() - }, function (result) { - if (self.ui._cancelled === true) { - self.ui._cancelled = false;return; - } - var str = String(result.command).trim(); - self.emit('client_prompt_submit', str); - if (str === '' || str === 'undefined') { - self._prompt(data);return; - } - self.exec(str, function () { - self._prompt(data); - }); - }); - - return prompt; -}; - -/** - * Executes a vorpal API command and - * returns the response either through a - * callback or Promise in the absence - * of a callback. - * - * A little black magic here - because - * we sometimes have to send commands 10 - * miles upstream through 80 other instances - * of vorpal and we aren't going to send - * the callback / promise with us on that - * trip, we store the command, callback, - * resolve and reject objects (as they apply) - * in a local vorpal._command variable. - * - * When the command eventually comes back - * downstream, we dig up the callbacks and - * finally resolve or reject the promise, etc. - * - * Lastly, to add some more complexity, we throw - * command and callbacks into a queue that will - * be unearthed and sent in due time. - * - * @param {String} cmd - * @param {Function} cb - * @return {Promise or Vorpal} - * @api public - */ - -vorpal.exec = function (cmd, args, cb) { - var self = this; - var ssn = self.session; - - cb = _.isFunction(args) ? args : cb; - args = args || {}; - - if (args.sessionId) { - ssn = self.getSessionById(args.sessionId); - } - - var command = { - command: cmd, - args: args, - callback: cb, - session: ssn - }; - - if (cb !== undefined) { - self._queue.push(command); - self._queueHandler(); - return self; - } - - return new Promise(function (resolve, reject) { - command.resolve = resolve; - command.reject = reject; - self._queue.push(command); - self._queueHandler(); - }); -}; - -/** - * Executes a Vorpal command in sync. - * - * @param {String} cmd - * @param {Object} args - * @return {*} stdout - * @api public - */ - -vorpal.execSync = function (cmd, options) { - var self = this; - var ssn = self.session; - options = options || {}; - if (options.sessionId) { - ssn = self.getSessionById(options.sessionId); - } - - var command = { - command: cmd, - args: options, - session: ssn, - sync: true, - options: options - }; - - return self._execQueueItem(command); -}; - -/** - * Commands issued to Vorpal server - * are executed in sequence. Called once - * when a command is inserted or completes, - * shifts the next command in the queue - * and sends it to `vorpal._execQueueItem`. - * - * @api private - */ - -vorpal._queueHandler = function () { - if (this._queue.length > 0 && this._command === undefined) { - var item = this._queue.shift(); - this._execQueueItem(item); - } -}; - -/** - * Fires off execution of a command - either - * calling upstream or executing locally. - * - * @param {Object} cmd - * @api private - */ - -vorpal._execQueueItem = function (cmd) { - var self = this; - self._command = cmd; - if (cmd.session.isLocal() && !cmd.session.client) { - return this._exec(cmd); - } - self._send('vantage-command-upstream', 'upstream', { - command: cmd.command, - args: cmd.args, - completed: false, - sessionId: cmd.session.id - }); -}; - -/** - * Executes a vorpal API command. - * Warning: Dragons lie beyond this point. - * - * @param {String} item - * @api private - */ - -vorpal._exec = function (item) { - var self = this; - item = item || {}; - item.command = item.command || ''; - var modeCommand = item.command; - item.command = item.session._mode ? item.session._mode : item.command; - - var promptCancelled = false; - if (this.ui._midPrompt) { - promptCancelled = true; - this.ui.cancel(); - } - - if (!item.session) { - throw new Error('Fatal Error: No session was passed into command for execution: ' + item); - } - - if (String(item.command).indexOf('undefine') > -1) { - throw new Error('vorpal._exec was called with an undefined command.'); - } - - // History for our 'up' and 'down' arrows. - item.session.history(item.session._mode ? modeCommand : item.command); - - var commandData = this.util.parseCommand(item.command, this.commands); - item.command = commandData.command; - item.pipes = commandData.pipes; - var match = commandData.match; - var matchArgs = commandData.matchArgs; - - function throwHelp(cmd, msg, alternativeMatch) { - if (msg) { - cmd.session.log(msg); - } - var pickedMatch = alternativeMatch || match; - cmd.session.log(pickedMatch.helpInformation()); - } - - function callback(cmd, err, msg, argus) { - // Resume the prompt if we had to cancel - // an active prompt, due to programmatic - // execution. - if (promptCancelled) { - self._prompt(); - } - if (cmd.sync) { - // If we want the command to be fatal, - // throw a real error. Otherwise, silently - // return the error. - delete self._command; - if (err) { - if (cmd.options && (cmd.options.fatal === true || vorpal._fatal === true)) { - throw new Error(err); - } - return err; - } - return msg; - } else if (cmd.callback) { - if (argus) { - cmd.callback.apply(self, argus); - } else { - cmd.callback.call(self, err, msg); - } - } else if (!err && cmd.resolve) { - cmd.resolve(msg); - } else if (err && cmd.reject) { - cmd.reject(msg); - } - delete self._command; - self._queueHandler(); - } - - if (match) { - item.fn = match._fn; - item._cancel = match._cancel; - item.validate = match._validate; - item.commandObject = match; - var init = match._init || function (arrgs, cb) { - cb(); - }; - var delimiter = match._delimiter || String(item.command).toLowerCase() + ':'; - - item.args = self.util.buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); - - // If we get a string back, it's a validation error. - // Show help and return. - if (_.isString(item.args) || !_.isObject(item.args)) { - throwHelp(item, item.args); - return callback(item, undefined, item.args); - } - - // Build the piped commands. - var allValid = true; - for (var j = 0; j < item.pipes.length; ++j) { - var commandParts = self.util.matchCommand(item.pipes[j], self.commands); - if (!commandParts.command) { - item.session.log(self._commandHelp(item.pipes[j])); - allValid = false; - break; - } - commandParts.args = self.util.buildCommandArgs(commandParts.args, commandParts.command); - if (_.isString(commandParts.args) || !_.isObject(commandParts.args)) { - throwHelp(item, commandParts.args, commandParts.command); - allValid = false; - break; - } - item.pipes[j] = commandParts; - } - // If invalid piped commands, return. - if (!allValid) { - return callback(item); - } - - // If `--help` or `/?` is passed, do help. - if (item.args.options.help && _.isFunction(match._help)) { - // If the command has a custom help function, run it - // as the actual "command". In this way it can go through - // the whole cycle and expect a callback. - item.fn = match._help; - delete item.validate; - delete item._cancel; - } else if (item.args.options.help) { - // Otherwise, throw the standard help. - throwHelp(item, ''); - return callback(item); - } - - // If this command throws us into a 'mode', - // prepare for it. - if (match._mode === true && !item.session._mode) { - // Assign vorpal to be in a 'mode'. - item.session._mode = item.command; - // Execute the mode's `init` function - // instead of the `action` function. - item.fn = init; - delete item.validate; - - self.cmdHistory.enterMode(); - item.session.modeDelimiter(delimiter); - } else if (item.session._mode) { - if (String(modeCommand).trim() === 'exit') { - self._exitMode({ sessionId: item.session.id }); - return callback(item); - } - // This executes when actually in a 'mode' - // session. We now pass in the raw text of what - // is typed into the first param of `action` - // instead of arguments. - item.args = modeCommand; - } - - if (item.sync === true) { - // If we're running synchronous commands, - // we don't support piping. - var response; - var error; - try { - response = item.fn.call(new CommandInstance({ - downstream: undefined, - commandWrapper: item, - commandObject: item.commandObject, - args: item.args - }), item.args); - } catch (e) { - error = e; - } - return callback(item, error, response); - } - - // Builds commandInstance objects for every - // command and piped command included in the - // execution string. - - // Build the instances for each pipe. - item.pipes = item.pipes.map(function (pipe) { - return new CommandInstance({ - commandWrapper: item, - command: pipe.command._name, - commandObject: pipe.command, - args: pipe.args - }); - }); - - // Reverse through the pipes and assign the - // `downstream` object of each parent to its - // child command. - for (var k = item.pipes.length - 1; k > -1; --k) { - var downstream = item.pipes[k + 1]; - item.pipes[k].downstream = downstream; - } - - item.session.execCommandSet(item, function (wrapper, err, data, argus) { - callback(wrapper, err, data, argus); - }); - } else { - // If no command match, just return. - item.session.log(this._commandHelp(item.command)); - return callback(item, undefined, 'Invalid command.'); - } -}; - -/** - * Exits out of a give 'mode' one is in. - * Reverts history and delimiter back to - * regular vorpal usage. - * - * @api private - */ - -vorpal._exitMode = function (options) { - var ssn = this.getSessionById(options.sessionId); - ssn._mode = false; - this.cmdHistory.exitMode(); - ssn.modeDelimiter(false); - this.emit('mode_exit', this.cmdHistory.peek()); -}; - -/** - * Registers a custom handler for SIGINT. - * Vorpal exits with 0 by default - * on a sigint. - * - * @param {Function} fn - * @return {Vorpal} - * @api public - */ - -vorpal.sigint = function (fn) { - if (_.isFunction(fn)) { - ui.sigint(fn); - } else { - throw new Error('vorpal.sigint must be passed in a valid function.'); - } - return this; -}; - -/** - * Returns the instance of given command. - * - * @param {String} cmd - * @return {Command} - * @api public - */ - -vorpal.find = function (name) { - return _.find(this.commands, { _name: name }); -}; - -/** - * Registers custom help. - * - * @param {Function} fn - * @return {Vorpal} - * @api public - */ - -vorpal.help = function (fn) { - this._help = fn; -}; - -/** - * Returns help string for a given command. - * - * @param {String} command - * @api private - */ - -vorpal._commandHelp = function (command) { - if (!this.commands.length) { - return ''; - } - - if (this._help !== undefined && _.isFunction(this._help)) { - return this._help(command); - } - - var matches = []; - var singleMatches = []; - - command = command ? String(command).trim().toLowerCase() : undefined; - for (var i = 0; i < this.commands.length; ++i) { - var parts = String(this.commands[i]._name).split(' '); - if (parts.length === 1 && parts[0] === command && !this.commands[i]._hidden && !this.commands[i]._catch) { - singleMatches.push(command); - } - var str = ''; - for (var j = 0; j < parts.length; ++j) { - str = String(str + ' ' + parts[j]).trim(); - if (str === command && !this.commands[i]._hidden && !this.commands[i]._catch) { - matches.push(this.commands[i]); - break; - } - } - } - - var invalidString = command && matches.length === 0 && singleMatches.length === 0 ? ['', ' Invalid Command. Showing Help:', ''].join('\n') : ''; - - var commandMatch = matches.length > 0; - var commandMatchLength = commandMatch ? String(command).trim().split(' ').length + 1 : 1; - matches = matches.length === 0 ? this.commands : matches; - - var skipGroups = !(matches.length + 6 > process.stdout.rows); - - var commands = matches.filter(function (cmd) { - return !cmd._noHelp; - }).filter(function (cmd) { - return !cmd._catch; - }).filter(function (cmd) { - return !cmd._hidden; - }).filter(function (cmd) { - if (skipGroups === true) { - return true; - } - return String(cmd._name).trim().split(' ').length <= commandMatchLength; - }).map(function (cmd) { - var args = cmd._args.map(function (arg) { - return VorpalUtil.humanReadableArgName(arg); - }).join(' '); - - return [cmd._name + (cmd._alias ? '|' + cmd._alias : '') + (cmd.options.length ? ' [options]' : '') + ' ' + args, cmd.description() || '']; - }); - - var width = commands.reduce(function (max, commandX) { - return Math.max(max, commandX[0].length); - }, 0); - - var counts = {}; - - var groups = _.uniq(matches.filter(function (cmd) { - return String(cmd._name).trim().split(' ').length > commandMatchLength; - }).map(function (cmd) { - return String(cmd._name).split(' ').slice(0, commandMatchLength).join(' '); - }).map(function (cmd) { - counts[cmd] = counts[cmd] || 0; - counts[cmd]++; - return cmd; - })).map(function (cmd) { - var prefix = ' ' + VorpalUtil.pad(cmd + ' *', width) + ' ' + counts[cmd] + ' sub-command' + (counts[cmd] === 1 ? '' : 's') + '.'; - return prefix; - }); - - groups = skipGroups ? [] : groups; - - var descriptionWidth = process.stdout.columns - (width + 4); - - var commandsString = commands.length < 1 ? '' : '\n Commands:\n\n' + commands.map(function (cmd) { - var prefix = ' ' + VorpalUtil.pad(cmd[0], width) + ' '; - var suffix = wrap(cmd[1], descriptionWidth - 8).split('\n'); - for (var _i = 0; _i < suffix.length; ++_i) { - if (_i !== 0) { - suffix[_i] = VorpalUtil.pad('', width + 6) + suffix[_i]; - } - } - suffix = suffix.join('\n'); - return prefix + suffix; - }).join('\n') + '\n\n'; - - var groupsString = groups.length < 1 ? '' : ' Command Groups:\n\n' + groups.join('\n') + '\n'; - - var results = String(this._helpHeader(!!invalidString) + invalidString + commandsString + '\n' + groupsString).replace(/\n\n\n/g, '\n\n').replace(/\n\n$/, '\n'); - - return results; -}; - -vorpal._helpHeader = function (hideTitle) { - var header = []; - - if (this._banner) { - header.push(VorpalUtil.padRow(this._banner), ''); - } - - // Only show under specific conditions - if (this._title && !hideTitle) { - var title = this._title; - - if (this._version) { - title += ' v' + this._version; - } - - header.push(VorpalUtil.padRow(title)); - - if (this._description) { - var descWidth = process.stdout.columns * 0.75; // Only 75% of the screen - - header.push(VorpalUtil.padRow(wrap(this._description, descWidth))); - } - } - - // Pad the top and bottom - if (header.length) { - header.unshift(''); - header.push(''); - } - - return header.join('\n'); -}; - -/** - * Abstracts the logic for sending and - * receiving sockets upstream and downstream. - * - * To do: Has the start of logic for vorpal sessions, - * which I haven't fully confronted yet. - * - * @param {String} str - * @param {String} direction - * @param {String} data - * @param {Object} options - * @api private - */ - -vorpal._send = function (str, direction, data, options) { - options = options || {}; - data = data || {}; - var ssn = this.getSessionById(data.sessionId); - if (!ssn) { - throw new Error('No Sessions logged for ID ' + data.sessionId + ' in vorpal._send.'); - } - if (direction === 'upstream') { - if (ssn.client) { - ssn.client.emit(str, data); - } - } else if (direction === 'downstream') { - if (ssn.server) { - ssn.server.emit(str, data); - } - } -}; - -/** - * Handles the 'middleman' in a 3+-way vagrant session. - * If a vagrant instance is a 'client' and 'server', it is - * now considered a 'proxy' and its sole purpose is to proxy - * information through, upstream or downstream. - * - * If vorpal is not a proxy, it resolves a promise for further - * code that assumes one is now an end user. If it ends up - * piping the traffic through, it never resolves the promise. - * - * @param {String} str - * @param {String} direction - * @param {String} data - * @param {Object} options - * @api private - */ -vorpal._proxy = function (str, direction, data, options) { - var self = this; - return new Promise(function (resolve) { - var ssn = self.getSessionById(data.sessionId); - if (ssn && !ssn.isLocal() && ssn.client) { - self._send(str, direction, data, options); - } else { - resolve(); - } - }); -}; - -/** - * Returns session by id. - * - * @param {Integer} id - * @return {Session} - * @api public - */ - -vorpal.getSessionById = function (id) { - if (_.isObject(id)) { - throw new Error('vorpal.getSessionById: id ' + JSON.stringify(id) + ' should not be an object.'); - } - var ssn = _.find(this.server.sessions, { id: id }); - ssn = this.session.id === id ? this.session : ssn; - if (!id) { - throw new Error('vorpal.getSessionById was called with no ID passed.'); - } - if (!ssn) { - var sessions = { - local: this.session.id, - server: _.map(this.server.sessions, 'id') - }; - throw new Error('No session found for id ' + id + ' in vorpal.getSessionById. Sessions: ' + JSON.stringify(sessions)); - } - return ssn; -}; - -/** - * Kills a remote vorpal session. If user - * is running on a direct terminal, will kill - * node instance after confirmation. - * - * @param {Object} options - * @param {Function} cb - * @api private - */ - -vorpal.exit = function (options) { - var ssn = this.getSessionById(options.sessionId); - this.emit('vorpal_exit'); - if (ssn.isLocal()) { - process.exit(0); - } else { - ssn.server.emit('vantage-close-downstream', { sessionId: ssn.id }); - } -}; - -Object.defineProperty(vorpal, 'activeCommand', { - get: function get() { - var result = this._command ? this._command.commandInstance : undefined; - return result; - } -}); \ No newline at end of file From 401f9b78351c8cadf64211114a5fa7d2a84064cd Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 25 May 2017 19:40:20 -0700 Subject: [PATCH 07/38] Replaced Gulp with NPM scripts. Updated to use milesj/build-tool-config for Babel and ESLint. --- .babelrc | 3 - .travis.yml | 3 +- gulpfile.babel.js | 23 - package.json | 49 +- test/autocomplete.js | 6 +- test/index.js | 2 +- test/integration.js | 2 +- test/util/util.js | 2 +- test/vorpal.js | 2 +- yarn.lock | 3474 +++++++++++++++++++++++++++--------------- 10 files changed, 2259 insertions(+), 1307 deletions(-) delete mode 100755 .babelrc delete mode 100755 gulpfile.babel.js diff --git a/.babelrc b/.babelrc deleted file mode 100755 index af0f0c3d..00000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015"] -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 36e0f00a..25ee4060 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ language: node_js node_js: - - 4 - - 5 - 6 + - 7 - node sudo: false branches: diff --git a/gulpfile.babel.js b/gulpfile.babel.js deleted file mode 100755 index 74df79e3..00000000 --- a/gulpfile.babel.js +++ /dev/null @@ -1,23 +0,0 @@ -const gulp = require('gulp'); -const _gulp = require('load-plugins')('gulp-*'); - -const paths = {}; -paths.src = './lib/**/*.js'; -paths.dist = './dist'; - -gulp.task('lint', () => { - return gulp.src(paths.src) - .pipe(_gulp.xo()); -}); - -gulp.task('build', () => { - return gulp.src(paths.src) - .pipe(_gulp.babel()) - .pipe(gulp.dest(paths.dist)); -}); - -gulp.task('watch', ['build'], () => { - gulp.watch(paths.src, ['build']); -}); - -gulp.task('default', ['watch']); diff --git a/package.json b/package.json index cf0613a0..16885f91 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,14 @@ "description": "Node's first framework for building immersive CLI apps.", "main": "./dist/vorpal.js", "scripts": { - "test": "gulp build; mocha;", - "prepublish": "in-publish && gulp build || not-in-publish" + "build": "build-lib ./lib -d ./dist", + "lint": "run-linter ./lib", + "test": "npm run build; mocha", + "prepublish": "in-publish && npm run build || not-in-publish" }, + "files": [ + "dist" + ], "repository": { "type": "git", "url": "git+https://github.com/dthree/vorpal.git" @@ -33,21 +38,12 @@ }, "homepage": "https://github.com/dthree/vorpal#readme", "devDependencies": { - "babel": "^6.23.0", - "babel-core": "^6.24.1", - "babel-preset-es2015": "^6.24.1", + "@milesj/build-tool-config": "^0.7.1", "bluebird": "^3.5.0", - "gulp": "^3.9.1", - "gulp-babel": "^6.1.2", - "gulp-changed": "^3.1.0", - "gulp-eslint": "^3.0.1", - "gulp-xo": "^0.15.0", - "load-plugins": "^2.1.2", "mocha": "^3.4.2", "should": "^11.2.1", "vorpal-less": "^0.0.13", - "vorpal-repl": "^1.1.8", - "xo": "^0.18.2" + "vorpal-repl": "^1.1.8" }, "dependencies": { "babel-polyfill": "^6.23.0", @@ -62,26 +58,13 @@ "wrap-ansi": "^2.1.0" }, "engines": { - "node": ">= 0.10.0", - "iojs": ">= 1.0.0" + "node": ">=6.5.0", + "npm": ">=3.0.0" }, - "xo": { - "space": true, - "rules": { - "no-eval": 0, - "no-unused-expressions": 0, - "max-nested-callbacks": 0, - "no-proto": 0, - "wrap-iife": 0, - "global-require": 0, - "no-negated-condition": 0, - "no-loop-func": 0, - "no-implicit-coercion": 0, - "no-use-extend-native/no-use-extend-native": 0, - "no-undef": 0 - } + "babel": { + "extends": "./node_modules/@milesj/build-tool-config/babel.node.json5" }, - "files": [ - "dist" - ] + "eslintConfig": { + "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5" + } } diff --git a/test/autocomplete.js b/test/autocomplete.js index 70c70380..83aacec7 100644 --- a/test/autocomplete.js +++ b/test/autocomplete.js @@ -1,4 +1,4 @@ -var Vorpal = require('../'); +var Vorpal = require('../dist/vorpal'); var assert = require('assert'); var _ = require('lodash'); var vorpal = new Vorpal(); @@ -33,7 +33,7 @@ describe('session._autocomplete', function () { assert.equal(result, 'def '); }); - + it('should return the prefix along with the partial match when supplied with a prefix input', function() { var result = vorpal.session._autocomplete('foo/de', ['dally','definitive', 'definitop', 'bob']); assert.equal(result, "foo/definit"); @@ -47,4 +47,4 @@ describe('session._autocomplete', function () { assert.equal(result[2], "definitive"); assert.equal(result[3], "definitop"); }); -}); \ No newline at end of file +}); diff --git a/test/index.js b/test/index.js index 1817a30c..f9af5891 100755 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,4 @@ -var Vorpal = require('../'); +var Vorpal = require('../dist/vorpal'); var should = require('should'); var vorpal = new Vorpal(); diff --git a/test/integration.js b/test/integration.js index e3011fed..55ece0b9 100755 --- a/test/integration.js +++ b/test/integration.js @@ -1,6 +1,6 @@ 'use strict'; -var Vorpal = require('../'); +var Vorpal = require('../dist/vorpal'); var commands = require('./util/server'); var BlueBirdPromise = require('bluebird'); var fs = require('fs'); diff --git a/test/util/util.js b/test/util/util.js index e3301782..1b036700 100755 --- a/test/util/util.js +++ b/test/util/util.js @@ -1,4 +1,4 @@ -var Vorpal = require('../../'); +var Vorpal = require('../../dist/vorpal'); var _ = require('lodash'); var path = require('path'); diff --git a/test/vorpal.js b/test/vorpal.js index 54a16ba9..1552c193 100755 --- a/test/vorpal.js +++ b/test/vorpal.js @@ -5,7 +5,7 @@ * this one. */ -var Vorpal = require('../'); +var Vorpal = require('../dist/vorpal'); var should = require('should'); var assert = require('assert'); var intercept = require('../dist/intercept'); diff --git a/yarn.lock b/yarn.lock index b45f0931..ca7358a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,58 @@ # yarn lockfile v1 +"@milesj/build-tool-config@^0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.7.1.tgz#9312fdc3d31007b5a1fde613e274ff1f296d7e65" + dependencies: + babel-cli "^6.24.1" + babel-eslint "^7.2.0" + babel-jest "^20.0.3" + babel-plugin-transform-runtime "^6.23.0" + babel-preset-env "^1.5.1" + babel-preset-flow "^6.23.0" + babel-preset-react "^6.24.1" + babel-preset-stage-2 "^6.24.1" + babel-runtime "^6.23.0" + copy "^0.3.0" + enzyme "^2.8.2" + eslint "^3.19.0" + eslint-config-airbnb "^15.0.1" + eslint-plugin-flowtype "^2.33.0" + eslint-plugin-import "^2.3.0" + eslint-plugin-jest "^20.0.3" + eslint-plugin-jsx-a11y "^5.0.3" + eslint-plugin-react "^7.0.1" + flow-bin "^0.47.0" + jest "^20.0.4" + json5 "^0.5.1" + react "^15.5.4" + react-dom "^15.5.4" + react-test-renderer "^15.5.4" + rimraf "^2.6.1" + rollup "^0.41.6" + rollup-plugin-babel "^2.7.1" + rollup-plugin-commonjs "^8.0.2" + rollup-plugin-json "^2.1.1" + rollup-plugin-node-resolve "^3.0.0" + rollup-plugin-replace "^1.1.1" + rollup-plugin-uglify "^2.0.1" + rollup-watch "^3.2.2" + +abab@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" + +abbrev@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" + +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -12,6 +64,10 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +acorn@^4.0.1, acorn@^4.0.4: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + acorn@^5.0.1: version "5.0.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" @@ -20,24 +76,36 @@ ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" -ajv@^4.7.0: +ajv@^4.7.0, ajv@^4.9.1: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" -ansi-align@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" dependencies: - string-width "^2.0.0" + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" ansi-escapes@^1.0.0, ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" -ansi-regex@^2.0.0: +ansi-green@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ansi-green/-/ansi-green-0.1.1.tgz#8a5d9a979e458d57c40e33580b37390b8e10d0f7" + dependencies: + ansi-wrap "0.1.0" + +ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -45,13 +113,39 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -app-name@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/app-name/-/app-name-0.2.0.tgz#cab1b3fef599f8b001e083e49b3c2705ee80addc" +ansi-styles@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" + dependencies: + color-convert "^1.0.0" -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" +ansi-wrap@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +aproba@^1.0.3: + version "1.1.1" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" + +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" argparse@^1.0.7: version "1.0.9" @@ -59,6 +153,12 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +aria-query@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.5.0.tgz#85e3152cd8cc5bab18dbed61cd9c4fce54fa79c3" + dependencies: + ast-types-flow "0.0.7" + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -73,13 +173,16 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" -array-differ@^1.0.0: +array-equal@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" array-union@^1.0.1: version "1.0.2" @@ -87,7 +190,7 @@ array-union@^1.0.1: dependencies: array-uniq "^1.0.1" -array-uniq@^1.0.1, array-uniq@^1.0.2: +array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -95,20 +198,87 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -arrayify-compact@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/arrayify-compact/-/arrayify-compact-0.2.0.tgz#459170e155ca12bb514484839c9d71507c80ec4d" - dependencies: - arr-flatten "^1.0.1" - arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" +asap@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +ast-types-flow@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + async-array-reduce@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/async-array-reduce/-/async-array-reduce-0.2.1.tgz#c8be010a2b5cd00dea96c81116034693dfdd82d1" +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.4: + version "2.4.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7" + dependencies: + lodash "^4.14.0" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +axobject-query@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0" + dependencies: + ast-types-flow "0.0.7" + +babel-cli@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.1.tgz#207cd705bba61489b2ea41b5312341cf6aca2283" + dependencies: + babel-core "^6.24.1" + babel-polyfill "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + commander "^2.8.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.0.0" + glob "^7.0.0" + lodash "^4.2.0" + output-file-sync "^1.1.0" + path-is-absolute "^1.0.0" + slash "^1.0.0" + source-map "^0.5.0" + v8flags "^2.0.10" + optionalDependencies: + chokidar "^1.6.1" + babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -117,7 +287,7 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.0.2, babel-core@^6.24.1: +babel-core@6, babel-core@^6.0.0, babel-core@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" dependencies: @@ -141,7 +311,16 @@ babel-core@^6.0.2, babel-core@^6.24.1: slash "^1.0.0" source-map "^0.5.0" -babel-generator@^6.24.1: +babel-eslint@^7.2.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" + dependencies: + babel-code-frame "^6.22.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" + babylon "^6.17.0" + +babel-generator@^6.18.0, babel-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" dependencies: @@ -154,6 +333,30 @@ babel-generator@^6.24.1: source-map "^0.5.0" trim-right "^1.0.1" +babel-helper-bindify-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-builder-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.24.1.tgz#0ad7917e33c8d751e646daca4e77cc19377d2cbc" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + esutils "^2.0.0" + babel-helper-call-delegate@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" @@ -172,6 +375,23 @@ babel-helper-define-map@^6.24.1: babel-types "^6.24.1" lodash "^4.2.0" +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-explode-class@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" + dependencies: + babel-helper-bindify-decorators "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" @@ -211,6 +431,16 @@ babel-helper-regex@^6.24.1: babel-types "^6.24.1" lodash "^4.2.0" +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-replace-supers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" @@ -229,6 +459,14 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" +babel-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^20.0.3" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -241,6 +479,93 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-istanbul@^4.0.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.1" + test-exclude "^4.1.0" + +babel-plugin-jest-hoist@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-decorators@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" + dependencies: + babel-helper-explode-class "^6.24.1" + babel-plugin-syntax-decorators "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" @@ -253,7 +578,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.24.1: +babel-plugin-transform-es2015-block-scoping@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576" dependencies: @@ -263,7 +588,7 @@ babel-plugin-transform-es2015-block-scoping@^6.24.1: babel-types "^6.24.1" lodash "^4.2.0" -babel-plugin-transform-es2015-classes@^6.24.1: +babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.9.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" dependencies: @@ -277,33 +602,33 @@ babel-plugin-transform-es2015-classes@^6.24.1: babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-computed-properties@^6.24.1: +babel-plugin-transform-es2015-computed-properties@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-destructuring@^6.22.0: +babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.24.1: +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-plugin-transform-es2015-for-of@^6.22.0: +babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.24.1: +babel-plugin-transform-es2015-function-name@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" dependencies: @@ -317,7 +642,7 @@ babel-plugin-transform-es2015-literals@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.24.1: +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" dependencies: @@ -325,7 +650,7 @@ babel-plugin-transform-es2015-modules-amd@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-commonjs@^6.24.1: +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" dependencies: @@ -334,7 +659,7 @@ babel-plugin-transform-es2015-modules-commonjs@^6.24.1: babel-template "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-modules-systemjs@^6.24.1: +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" dependencies: @@ -342,7 +667,7 @@ babel-plugin-transform-es2015-modules-systemjs@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-umd@^6.24.1: +babel-plugin-transform-es2015-modules-umd@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" dependencies: @@ -350,14 +675,14 @@ babel-plugin-transform-es2015-modules-umd@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-object-super@^6.24.1: +babel-plugin-transform-es2015-object-super@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.24.1: +babel-plugin-transform-es2015-parameters@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" dependencies: @@ -368,7 +693,7 @@ babel-plugin-transform-es2015-parameters@^6.24.1: babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-shorthand-properties@^6.24.1: +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" dependencies: @@ -381,7 +706,7 @@ babel-plugin-transform-es2015-spread@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.24.1: +babel-plugin-transform-es2015-sticky-regex@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" dependencies: @@ -395,13 +720,13 @@ babel-plugin-transform-es2015-template-literals@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.24.1: +babel-plugin-transform-es2015-unicode-regex@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" dependencies: @@ -409,12 +734,68 @@ babel-plugin-transform-es2015-unicode-regex@^6.24.1: babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-regenerator@^6.24.1: +babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-display-name@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.23.0.tgz#4398910c358441dc4cef18787264d0412ed36b37" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-self@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-source@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" + dependencies: + babel-helper-builder-react-jsx "^6.24.1" + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418" dependencies: regenerator-transform "0.9.11" +babel-plugin-transform-runtime@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee" + dependencies: + babel-runtime "^6.22.0" + babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" @@ -430,34 +811,82 @@ babel-polyfill@^6.23.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-preset-es2015@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" +babel-preset-env@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.5.1.tgz#d2eca6af179edf27cdc305a84820f601b456dd0b" dependencies: babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^2.1.2" + invariant "^2.2.2" + semver "^5.3.0" + +babel-preset-flow@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" + dependencies: + babel-plugin-transform-flow-strip-types "^6.22.0" + +babel-preset-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" + dependencies: + babel-plugin-jest-hoist "^20.0.3" + +babel-preset-react@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" + dependencies: + babel-plugin-syntax-jsx "^6.3.13" + babel-plugin-transform-react-display-name "^6.23.0" + babel-plugin-transform-react-jsx "^6.24.1" + babel-plugin-transform-react-jsx-self "^6.22.0" + babel-plugin-transform-react-jsx-source "^6.22.0" + babel-preset-flow "^6.23.0" + +babel-preset-stage-2@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-decorators "^6.24.1" + babel-preset-stage-3 "^6.24.1" + +babel-preset-stage-3@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.24.1" + babel-plugin-transform-async-to-generator "^6.24.1" + babel-plugin-transform-exponentiation-operator "^6.24.1" + babel-plugin-transform-object-rest-spread "^6.22.0" babel-register@^6.24.1: version "6.24.1" @@ -471,14 +900,14 @@ babel-register@^6.24.1: mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@^6.18.0, babel-runtime@^6.22.0: +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.24.1: +babel-template@^6.16.0, babel-template@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" dependencies: @@ -488,7 +917,7 @@ babel-template@^6.24.1: babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.24.1: +babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" dependencies: @@ -502,7 +931,7 @@ babel-traverse@^6.24.1: invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.19.0, babel-types@^6.24.1: +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" dependencies: @@ -511,11 +940,7 @@ babel-types@^6.19.0, babel-types@^6.24.1: lodash "^4.2.0" to-fast-properties "^1.0.1" -babel@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel/-/babel-6.23.0.tgz#d0d1e7d803e974765beea3232d4e153c0efb90f4" - -babylon@^6.11.0, babylon@^6.15.0: +babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: version "6.17.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.1.tgz#17f14fddf361b695981fe679385e4f1c01ebd86f" @@ -523,27 +948,37 @@ balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" -bluebird@^3.5.0: +bluebird@^3.4.1, bluebird@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" -boxen@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.1.0.tgz#b1b69dd522305e807a99deee777dbd6e5167b102" +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" dependencies: - ansi-align "^2.0.0" - camelcase "^4.0.0" - chalk "^1.1.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^0.1.0" - widest-line "^1.0.0" + hoek "2.x.x" -brace-expansion@^1.0.0, brace-expansion@^1.1.7: +brace-expansion@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" dependencies: @@ -558,25 +993,40 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +browser-resolve@^1.11.0, browser-resolve@^1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" -buf-compare@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buf-compare/-/buf-compare-1.0.1.tgz#fef28da8b8113a0a0db4430b0b6467b69730b34a" +browserslist@^2.1.2: + version "2.1.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.1.4.tgz#cc526af4a1312b7d2e05653e56d0c8ab70c0e053" + dependencies: + caniuse-lite "^1.0.30000670" + electron-to-chromium "^1.3.11" + +bser@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" + dependencies: + node-int64 "^0.4.0" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" buffer-shims@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" -bufferstreams@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/bufferstreams/-/bufferstreams-1.1.1.tgz#0161373060ac5988eff99058731114f6e195d51e" - dependencies: - readable-stream "^2.0.2" - -builtin-modules@^1.0.0, builtin-modules@^1.1.1: +builtin-modules@^1.0.0, builtin-modules@^1.1.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -590,24 +1040,32 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -capture-stack-trace@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" +caniuse-lite@^1.0.30000670: + version "1.0.30000671" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000671.tgz#c206c2f1a1feb34de46064407c4356818389bf1e" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" @@ -619,14 +1077,50 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +cheerio@^0.22.0: + version "0.22.0" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.0" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash.assignin "^4.0.9" + lodash.bind "^4.1.4" + lodash.defaults "^4.0.1" + lodash.filter "^4.4.0" + lodash.flatten "^4.2.0" + lodash.foreach "^4.3.0" + lodash.map "^4.4.0" + lodash.merge "^4.4.0" + lodash.pick "^4.2.1" + lodash.reduce "^4.4.0" + lodash.reject "^4.4.0" + lodash.some "^4.4.0" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +ci-info@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" + circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" -cli-boxes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" - cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -643,15 +1137,27 @@ cli-width@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + clone-stats@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" -clone@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" - -clone@^1.0.0, clone@^1.0.2: +clone@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" @@ -663,7 +1169,23 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -commander@2.9.0: +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@2.9.0, commander@^2.8.1, commander@~2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -681,33 +1203,46 @@ concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -configstore@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.0.tgz#45df907073e26dfa1cf4b2d52f5b60545eaa11d1" - dependencies: - dot-prop "^4.1.0" - graceful-fs "^4.1.2" - make-dir "^1.0.0" - unique-string "^1.0.0" - write-file-atomic "^2.0.0" - xdg-basedir "^3.0.0" +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" -convert-source-map@^1.1.0: +content-type-parser@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" + +convert-source-map@^1.1.0, convert-source-map@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" -core-assert@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/core-assert/-/core-assert-0.2.1.tgz#f85e2cf9bfed28f773cc8b3fa5c5b69bdc02fe3f" +copy@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/copy/-/copy-0.3.0.tgz#0d5fda5e063d2dedf992b78ac060a0820caeeff3" dependencies: - buf-compare "^1.0.0" - is-error "^2.2.0" + async-each "^1.0.0" + bluebird "^3.4.1" + extend-shallow "^2.0.1" + file-contents "^0.3.1" + glob-parent "^2.0.0" + graceful-fs "^4.1.4" + has-glob "^0.1.1" + is-absolute "^0.2.5" + lazy-cache "^2.0.1" + log-ok "^0.1.1" + matched "^0.4.1" + mkdirp "^0.5.1" + resolve-dir "^0.1.0" + to-file "^0.2.0" -core-js@^2.0.0, core-js@^2.4.0: +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + +core-js@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" @@ -715,42 +1250,34 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -create-error-class@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" - dependencies: - capture-stack-trace "^1.0.0" - -cross-spawn-async@^2.1.1: - version "2.2.5" - resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" dependencies: - lru-cache "^4.0.0" - which "^1.2.8" + boom "2.x.x" -cross-spawn@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" +css-select@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" dependencies: - lru-cache "^4.0.1" - which "^1.2.9" + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" -crypto-random-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" +css-what@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - dependencies: - array-find-index "^1.0.1" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" -cwd@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/cwd/-/cwd-0.10.0.tgz#172400694057c22a13b0cf16162c7e4b7a7fe567" +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" dependencies: - find-pkg "^0.1.2" - fs-exists-sync "^0.1.0" + cssom "0.3.x" d@1: version "1.0.0" @@ -758,9 +1285,15 @@ d@1: dependencies: es5-ext "^0.10.9" -dateformat@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.0.0.tgz#2743e3abb5c3fc2462e527dca445e04e9f4dee17" +damerau-levenshtein@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" debug@2.2.0: version "2.2.0" @@ -768,28 +1301,22 @@ debug@2.2.0: dependencies: ms "0.7.1" -debug@2.6.0: +debug@2.6.0, debug@^2.1.1, debug@^2.2.0: version "2.6.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" dependencies: ms "0.7.2" -debug@^2.1.1, debug@^2.2.0: +debug@^2.6.3: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: ms "2.0.0" -decamelize@^1.1.2: +decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -deep-assign@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-1.0.0.tgz#b092743be8427dc621ea0067cdec7e70dd19f37b" - dependencies: - is-obj "^1.0.0" - deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -798,17 +1325,24 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" -deep-strict-equal@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/deep-strict-equal/-/deep-strict-equal-0.2.0.tgz#4a078147a8ab57f6a0d4f5547243cd22f44eb4e4" +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" dependencies: - core-assert "^0.2.0" + strip-bom "^2.0.0" -defaults@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" dependencies: - clone "^1.0.2" + is-descriptor "^0.1.0" del@^2.0.2: version "2.2.2" @@ -822,15 +1356,13 @@ del@^2.0.2: pinkie-promise "^2.0.0" rimraf "^2.2.8" -deprecated@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/deprecated/-/deprecated-0.0.1.tgz#f9c9af5464afa1e7a971458a8bdef2aa94d5bb19" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" -detect-file@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-0.1.0.tgz#4935dedfd9488648e006b0129566e9386711ea63" - dependencies: - fs-exists-sync "^0.1.0" +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" detect-indent@^4.0.0: version "4.0.0" @@ -838,7 +1370,7 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff@3.2.0: +diff@3.2.0, diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -856,33 +1388,78 @@ doctrine@^2.0.0: esutils "^2.0.2" isarray "^1.0.0" -dot-prop@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" +dom-serializer@0, dom-serializer@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" dependencies: - is-obj "^1.0.0" + domelementtype "~1.1.1" + entities "~1.1.1" -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" +domelementtype@1, domelementtype@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domhandler@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259" dependencies: - readable-stream "~1.1.9" + domelementtype "1" -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" +domutils@1.5.1, domutils@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + dependencies: + dom-serializer "0" + domelementtype "1" -end-of-stream@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" dependencies: - once "~1.3.0" + jsbn "~0.1.0" -enhance-visitors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/enhance-visitors/-/enhance-visitors-1.0.0.tgz#aa945d05da465672a1ebd38fee2ed3da8518e95a" +electron-to-chromium@^1.3.11: + version "1.3.11" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.11.tgz#744761df1d67b492b322ce9aa0aba5393260eb61" + +emoji-regex@^6.1.0: + version "6.4.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.4.2.tgz#a30b6fee353d406d96cfb9fa765bdc82897eff6e" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +enzyme@^2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-2.8.2.tgz#6c8bcb05012abc4aa4bc3213fb23780b9b5b1714" + dependencies: + cheerio "^0.22.0" + function.prototype.name "^1.0.0" + is-subset "^0.1.1" + lodash "^4.17.2" + object-is "^1.0.1" + object.assign "^4.0.4" + object.entries "^1.0.3" + object.values "^1.0.3" + prop-types "^15.5.4" + uuid "^2.0.3" + +"errno@>=0.1.1 <0.2.0-0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" dependencies: - lodash "^4.13.1" + prr "~0.0.0" error-ex@^1.2.0: version "1.3.1" @@ -890,6 +1467,23 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.6.1, es-abstract@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.0" + is-callable "^1.1.3" + is-regex "^1.0.3" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: version "0.10.21" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.21.tgz#19a725f9e51d0300bbc1e8e821109fd9daf55925" @@ -946,6 +1540,17 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escodegen@^1.6.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -955,19 +1560,15 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-xo@^0.18.0: - version "0.18.2" - resolved "https://registry.yarnpkg.com/eslint-config-xo/-/eslint-config-xo-0.18.2.tgz#0a157120875619929e735ffd6b185c41e8a187af" +eslint-config-airbnb-base@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.2.0.tgz#19a9dc4481a26f70904545ec040116876018f853" -eslint-formatter-pretty@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-formatter-pretty/-/eslint-formatter-pretty-1.1.0.tgz#ab4d06da02fed8c13ae9f0dc540a433ef7ed6f5e" +eslint-config-airbnb@^15.0.1: + version "15.0.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-15.0.1.tgz#7b5188e5b7c74b9b2ce639fd5e1daba8fd761aed" dependencies: - ansi-escapes "^1.4.0" - chalk "^1.1.3" - log-symbols "^1.0.2" - plur "^2.1.2" - string-width "^2.0.0" + eslint-config-airbnb-base "^11.2.0" eslint-import-resolver-node@^0.2.0: version "0.2.3" @@ -984,20 +1585,13 @@ eslint-module-utils@^2.0.0: debug "2.2.0" pkg-dir "^1.0.0" -eslint-plugin-ava@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-ava/-/eslint-plugin-ava-4.2.0.tgz#12e4664659c1fae7895fa3f346c313ceb8907c77" +eslint-plugin-flowtype@^2.33.0: + version "2.33.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.33.0.tgz#b2783814ed2ddcf729953b8f65ff73c90cabee4b" dependencies: - arrify "^1.0.1" - deep-strict-equal "^0.2.0" - enhance-visitors "^1.0.0" - espree "^3.1.3" - espurify "^1.5.0" - multimatch "^2.1.0" - pkg-up "^1.0.0" - req-all "^1.0.0" - -eslint-plugin-import@^2.0.0: + lodash "^4.15.0" + +eslint-plugin-import@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.3.0.tgz#37c801e0ada0e296cbdf20c3f393acb5b52af36b" dependencies: @@ -1012,30 +1606,31 @@ eslint-plugin-import@^2.0.0: minimatch "^3.0.3" read-pkg-up "^2.0.0" -eslint-plugin-no-use-extend-native@^0.3.2: - version "0.3.12" - resolved "https://registry.yarnpkg.com/eslint-plugin-no-use-extend-native/-/eslint-plugin-no-use-extend-native-0.3.12.tgz#3ad9a00c2df23b5d7f7f6be91550985a4ab701ea" - dependencies: - is-get-set-prop "^1.0.0" - is-js-type "^2.0.0" - is-obj-prop "^1.0.0" - is-proto-prop "^1.0.0" +eslint-plugin-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-20.0.3.tgz#ec15eba6ac0ab44a67ebf6e02672ca9d7e7cba29" -eslint-plugin-promise@^3.4.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" +eslint-plugin-jsx-a11y@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.0.3.tgz#4a939f76ec125010528823331bf948cc573380b6" + dependencies: + aria-query "^0.5.0" + array-includes "^3.0.3" + ast-types-flow "0.0.7" + axobject-query "^0.1.0" + damerau-levenshtein "^1.0.0" + emoji-regex "^6.1.0" + jsx-ast-utils "^1.4.0" -eslint-plugin-unicorn@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-2.1.1.tgz#3e9294366799b715e16a6df89159495b68930cb3" +eslint-plugin-react@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.0.1.tgz#e78107e1e559c6e2b17786bb67c2e2a010ad0d2f" dependencies: - lodash.camelcase "^4.1.1" - lodash.kebabcase "^4.0.1" - lodash.snakecase "^4.0.1" - lodash.upperfirst "^4.2.0" - req-all "^1.0.0" + doctrine "^2.0.0" + has "^1.0.1" + jsx-ast-utils "^1.3.4" -eslint@^3.0.0, eslint@^3.18.0: +eslint@^3.19.0: version "3.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" dependencies: @@ -1075,23 +1670,21 @@ eslint@^3.0.0, eslint@^3.18.0: text-table "~0.2.0" user-home "^2.0.0" -espree@^3.1.3, espree@^3.4.0: +espree@^3.4.0: version "3.4.3" resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" dependencies: acorn "^5.0.1" acorn-jsx "^3.0.0" +esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + esprima@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" -espurify@^1.5.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226" - dependencies: - core-js "^2.0.0" - esquery@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" @@ -1105,6 +1698,10 @@ esrecurse@^4.1.0: estraverse "~4.1.0" object-assign "^4.0.1" +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1113,7 +1710,15 @@ estraverse@~4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" -esutils@^2.0.2: +estree-walker@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" + +estree-walker@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa" + +esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1124,28 +1729,11 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" -execa@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" - dependencies: - cross-spawn-async "^2.1.1" - is-stream "^1.1.0" - npm-run-path "^1.0.0" - object-assign "^4.0.1" - path-key "^1.0.0" - strip-eof "^1.0.0" - -execa@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" +exec-sh@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" dependencies: - cross-spawn "^4.0.0" - get-stream "^2.2.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" + merge "^1.1.3" exit-hook@^1.0.0: version "1.1.1" @@ -1163,7 +1751,7 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -expand-tilde@^1.2.1, expand-tilde@^1.2.2: +expand-tilde@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" dependencies: @@ -1175,7 +1763,7 @@ extend-shallow@^2.0.0, extend-shallow@^2.0.1: dependencies: is-extendable "^0.1.0" -extend@^3.0.0: +extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -1193,17 +1781,38 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -fancy-log@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" - dependencies: - chalk "^1.1.1" - time-stamp "^1.0.0" +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" + dependencies: + bser "1.0.2" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +fbjs@^0.8.9: + version "0.8.12" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.9" + figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -1217,6 +1826,35 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +file-contents@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/file-contents/-/file-contents-0.2.4.tgz#0506f7b8eff62afa45ae45da4df9e9d47df453cb" + dependencies: + extend-shallow "^2.0.0" + file-stat "^0.1.0" + graceful-fs "^4.1.2" + is-buffer "^1.1.0" + is-utf8 "^0.2.0" + lazy-cache "^0.2.3" + through2 "^2.0.0" + +file-contents@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/file-contents/-/file-contents-0.3.2.tgz#a0939fed1b8cda1580266fc6b753a232fb46de53" + dependencies: + define-property "^0.2.5" + extend-shallow "^2.0.1" + file-stat "^0.2.3" + fs-exists-sync "^0.1.0" + graceful-fs "^4.1.4" + is-buffer "^1.1.3" + isobject "^2.1.0" + lazy-cache "^2.0.1" + strip-bom-buffer "^0.1.1" + strip-bom-string "^0.1.2" + through2 "^2.0.1" + vinyl "^1.1.1" + file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" @@ -1224,10 +1862,34 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +file-stat@^0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/file-stat/-/file-stat-0.1.3.tgz#d0f1961d7d10732928120a6e6955471c2a5b5411" + dependencies: + graceful-fs "^4.1.2" + lazy-cache "^0.2.3" + through2 "^2.0.0" + +file-stat@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/file-stat/-/file-stat-0.2.3.tgz#469a7e927d6930079624cdb38109405456cb06a9" + dependencies: + fs-exists-sync "^0.1.0" + graceful-fs "^4.1.4" + lazy-cache "^2.0.1" + through2 "^2.0.1" + filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + fill-range@^2.1.0: version "2.2.3" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" @@ -1238,23 +1900,6 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-file-up@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/find-file-up/-/find-file-up-0.1.3.tgz#cf68091bcf9f300a40da411b37da5cce5a2fbea0" - dependencies: - fs-exists-sync "^0.1.0" - resolve-dir "^0.1.0" - -find-index@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" - -find-pkg@^0.1.0, find-pkg@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/find-pkg/-/find-pkg-0.1.2.tgz#1bdc22c06e36365532e2a248046854b9788da557" - dependencies: - find-file-up "^0.1.2" - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -1262,41 +1907,12 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.0.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: locate-path "^2.0.0" -findup-sync@^0.4.2: - version "0.4.3" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12" - dependencies: - detect-file "^0.1.0" - is-glob "^2.0.1" - micromatch "^2.3.7" - resolve-dir "^0.1.0" - -fined@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.0.2.tgz#5b28424b760d7598960b7ef8480dff8ad3660e97" - dependencies: - expand-tilde "^1.2.1" - lodash.assignwith "^4.0.7" - lodash.isempty "^4.2.1" - lodash.isplainobject "^4.0.4" - lodash.isstring "^4.0.1" - lodash.pick "^4.2.1" - parse-filepath "^1.0.1" - -first-chunk-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" - -flagged-respawn@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-0.3.2.tgz#ff191eddcd7088a675b2610fffc976be9b8074b5" - flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -1306,6 +1922,10 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +flow-bin@^0.47.0: + version "0.47.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.47.0.tgz#a2a08ab3e0d1f1cb57d17e27b30b118b62fda367" + for-in@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1316,23 +1936,82 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + fs-exists-sync@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" +fs-readdir-recursive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -function-bind@^1.0.2: +fsevents@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.29" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2, function-bind@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" -gaze@^0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f" +function.prototype.name@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.0.0.tgz#5f523ca64e491a5f95aba80cc1e391080a14482e" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.0" + is-callable "^1.1.2" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" dependencies: - globule "~0.1.0" + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" generate-function@^2.0.0: version "2.0.0" @@ -1344,28 +2023,15 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" -get-set-props@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-set-props/-/get-set-props-0.1.0.tgz#998475c178445686d0b32246da5df8dbcfbe8ea3" - -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - -get-stdin@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-stream@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: - object-assign "^4.0.1" - pinkie-promise "^2.0.0" - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + assert-plus "^1.0.0" glob-base@^0.3.0: version "0.3.0" @@ -1380,30 +2046,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob-stream@^3.1.5: - version "3.1.18" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-3.1.18.tgz#9170a5f12b790306fdfe598f313f8f7954fd143b" - dependencies: - glob "^4.3.1" - glob2base "^0.0.12" - minimatch "^2.0.1" - ordered-read-streams "^0.1.0" - through2 "^0.6.1" - unique-stream "^1.0.0" - -glob-watcher@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-0.0.6.tgz#b95b4a8df74b39c83298b0c05c978b4d9a3b710b" - dependencies: - gaze "^0.5.1" - -glob2base@^0.0.12: - version "0.0.12" - resolved "https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56" - dependencies: - find-index "^0.1.1" - -glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: +glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -1414,23 +2057,6 @@ glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^4.3.1: - version "4.5.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "^2.0.1" - once "^1.3.0" - -glob@~3.1.21: - version "3.1.21" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" - dependencies: - graceful-fs "~1.2.0" - inherits "1" - minimatch "~0.2.11" - global-modules@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" @@ -1462,60 +2088,10 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -globby@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - dependencies: - array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -globule@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" - dependencies: - glob "~3.1.21" - lodash "~1.0.1" - minimatch "~0.2.11" - -glogg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" - dependencies: - sparkles "^1.0.0" - -got@^6.7.1: - version "6.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" - dependencies: - create-error-class "^3.0.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-redirect "^1.0.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - unzip-response "^2.0.1" - url-parse-lax "^1.0.0" - -graceful-fs@^3.0.0: - version "3.0.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" - dependencies: - natives "^1.1.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -graceful-fs@~1.2.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" - "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -1524,87 +2100,30 @@ growl@1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" -gulp-babel@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-6.1.2.tgz#7c0176e4ba3f244c60588a0c4b320a45d1adefce" - dependencies: - babel-core "^6.0.2" - gulp-util "^3.0.0" - object-assign "^4.0.1" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl-sourcemaps-apply "^0.2.0" - -gulp-changed@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/gulp-changed/-/gulp-changed-3.1.0.tgz#87cd1593a0bb4a5129dc2f229bece6d9488c272a" - dependencies: - gulp-util "^3.0.0" - pify "^2.3.0" - through2 "^2.0.0" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -gulp-eslint@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/gulp-eslint/-/gulp-eslint-3.0.1.tgz#04e57e3e18c6974267c12cf6855dc717d4a313bd" +handlebars@^4.0.3: + version "4.0.10" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" dependencies: - bufferstreams "^1.1.1" - eslint "^3.0.0" - gulp-util "^3.0.6" + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" -gulp-util@^3.0.0, gulp-util@^3.0.6: - version "3.0.8" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^2.0.0" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" -gulp-xo@^0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/gulp-xo/-/gulp-xo-0.15.0.tgz#71022f11423ddb49e6a7d892717cde350886d129" +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" dependencies: - gulp-util "^3.0.6" - through2 "^2.0.0" - xo "^0.18.0" - -gulp@^3.9.1: - version "3.9.1" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-3.9.1.tgz#571ce45928dd40af6514fc4011866016c13845b4" - dependencies: - archy "^1.0.0" - chalk "^1.0.0" - deprecated "^0.0.1" - gulp-util "^3.0.0" - interpret "^1.0.0" - liftoff "^2.1.0" - minimist "^1.1.0" - orchestrator "^0.3.0" - pretty-hrtime "^1.0.0" - semver "^4.1.0" - tildify "^1.0.0" - v8flags "^2.0.2" - vinyl-fs "^0.3.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - dependencies: - glogg "^1.0.0" + ajv "^4.9.1" + har-schema "^1.0.5" has-ansi@^2.0.0: version "2.0.0" @@ -1616,21 +2135,15 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - has-glob@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/has-glob/-/has-glob-0.1.1.tgz#a261c4c2a6c667e0c77b700a7f297c39ef3aa589" dependencies: is-glob "^2.0.1" -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - dependencies: - sparkles "^1.0.0" +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" has@^1.0.1: version "1.0.1" @@ -1638,6 +2151,19 @@ has@^1.0.1: dependencies: function-bind "^1.0.2" +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -1655,11 +2181,40 @@ hosted-git-info@^2.1.4: version "2.4.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" -iconv-lite@^0.4.17: +html-encoding-sniffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz#79bf7a785ea495fe66165e734153f363ff5437da" + dependencies: + whatwg-encoding "^1.0.1" + +htmlparser2@^3.9.1: + version "3.9.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + dependencies: + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@0.4.13: + version "0.4.13" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" + +iconv-lite@^0.4.17, iconv-lite@~0.4.13: version "0.4.17" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.17.tgz#4fdaa3b38acbc2c031b045d0edcdfe1ecab18c8d" -ignore@^3.2.0, ignore@^3.2.6: +ignore@^3.2.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" @@ -1671,12 +2226,6 @@ in-publish@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - dependencies: - repeating "^2.0.0" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1684,11 +2233,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" - -inherits@2, inherits@^2.0.3, inherits@~2.0.1: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -1736,28 +2281,40 @@ interpret@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" -invariant@^2.2.0: +invariant@^2.2.0, invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: loose-envify "^1.0.0" -irregular-plurals@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.2.0.tgz#38f299834ba8c00c30be9c554e137269752ff3ac" +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" -is-absolute@^0.2.3: +is-absolute@^0.2.5: version "0.2.6" resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" dependencies: is-relative "^0.2.1" is-windows "^0.2.0" +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" -is-buffer@^1.1.5: +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.0, is-buffer@^1.1.3, is-buffer@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" @@ -1767,6 +2324,35 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" +is-callable@^1.1.1, is-callable@^1.1.2, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-ci@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + dependencies: + ci-info "^1.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-descriptor@^0.1.0: + version "0.1.5" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.5.tgz#e3fb8b4ab65f3a37373388e18b401d78c58cbea7" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^3.0.2" + lazy-cache "^2.0.2" + is-dotfile@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" @@ -1777,10 +2363,6 @@ is-equal-shallow@^0.1.3: dependencies: is-primitive "^2.0.0" -is-error@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-error/-/is-error-2.2.1.tgz#684a96d84076577c98f4cdb40c6d26a5123bf19c" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -1805,24 +2387,15 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-get-set-prop@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-get-set-prop/-/is-get-set-prop-1.0.0.tgz#2731877e4d78a6a69edcce6bb9d68b0779e76312" - dependencies: - get-set-props "^0.1.0" - lowercase-keys "^1.0.0" - is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" dependencies: is-extglob "^1.0.0" -is-js-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-js-type/-/is-js-type-2.0.0.tgz#73617006d659b4eb4729bba747d28782df0f7e22" - dependencies: - js-types "^1.0.0" +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" is-my-json-valid@^2.10.0: version "2.16.0" @@ -1833,27 +2406,12 @@ is-my-json-valid@^2.10.0: jsonpointer "^4.0.0" xtend "^4.0.0" -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - is-number@^2.0.2, is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: kind-of "^3.0.2" -is-obj-prop@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-obj-prop/-/is-obj-prop-1.0.0.tgz#b34de79c450b8d7c73ab2cdf67dc875adb85f80e" - dependencies: - lowercase-keys "^1.0.0" - obj-props "^1.0.0" - -is-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -1870,10 +2428,6 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-plain-obj@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -1890,16 +2444,11 @@ is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" -is-proto-prop@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-proto-prop/-/is-proto-prop-1.0.0.tgz#b3951f95c089924fb5d4fcda6542ab3e83e2b220" +is-regex@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" dependencies: - lowercase-keys "^1.0.0" - proto-props "^0.2.0" - -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + has "^1.0.1" is-relative@^0.2.1: version "0.2.1" @@ -1913,14 +2462,22 @@ is-resolvable@^1.0.0: dependencies: tryit "^1.0.1" -is-retry-allowed@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - -is-stream@^1.0.0, is-stream@^1.1.0: +is-stream@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + is-unc-path@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-0.1.2.tgz#6ab053a72573c10250ff416a3814c35178af39b9" @@ -1939,10 +2496,6 @@ is-windows@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1951,31 +2504,346 @@ isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" -isobject@^2.0.0: +isobject@^2.0.0, isobject@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" dependencies: isarray "1.0.0" +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-api@^1.1.1: + version "1.1.8" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.1.0" + istanbul-lib-hook "^1.0.6" + istanbul-lib-instrument "^1.7.1" + istanbul-lib-report "^1.1.0" + istanbul-lib-source-maps "^1.2.0" + istanbul-reports "^1.1.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" + +istanbul-lib-hook@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.13.0" + istanbul-lib-coverage "^1.1.0" + semver "^5.3.0" + +istanbul-lib-report@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" + dependencies: + istanbul-lib-coverage "^1.1.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" + dependencies: + debug "^2.6.3" + istanbul-lib-coverage "^1.1.0" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" + dependencies: + handlebars "^4.0.3" + +jest-changed-files@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" + +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" + dependencies: + ansi-escapes "^1.4.0" + callsites "^2.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + istanbul-api "^1.1.1" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-instrument "^1.4.2" + istanbul-lib-source-maps "^1.1.0" + jest-changed-files "^20.0.3" + jest-config "^20.0.4" + jest-docblock "^20.0.3" + jest-environment-jsdom "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve-dependencies "^20.0.3" + jest-runtime "^20.0.4" + jest-snapshot "^20.0.3" + jest-util "^20.0.3" + micromatch "^2.3.11" + node-notifier "^5.0.2" + pify "^2.3.0" + slash "^1.0.0" + string-length "^1.0.1" + throat "^3.0.0" + which "^1.2.12" + worker-farm "^1.3.1" + yargs "^7.0.2" + +jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" + dependencies: + chalk "^1.1.3" + glob "^7.1.1" + jest-environment-jsdom "^20.0.3" + jest-environment-node "^20.0.3" + jest-jasmine2 "^20.0.4" + jest-matcher-utils "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-validate "^20.0.3" + pretty-format "^20.0.3" + +jest-diff@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" + dependencies: + chalk "^1.1.3" + diff "^3.2.0" + jest-matcher-utils "^20.0.3" + pretty-format "^20.0.3" + +jest-docblock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" + +jest-environment-jsdom@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" + jsdom "^9.12.0" + +jest-environment-node@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" + +jest-haste-map@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^20.0.3" + micromatch "^2.3.11" + sane "~1.6.0" + worker-farm "^1.3.1" + +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-matchers "^20.0.3" + jest-message-util "^20.0.3" + jest-snapshot "^20.0.3" + once "^1.4.0" + p-map "^1.1.1" + +jest-matcher-utils@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" + dependencies: + chalk "^1.1.3" + pretty-format "^20.0.3" + +jest-matchers@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" + dependencies: + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + +jest-message-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" + dependencies: + chalk "^1.1.3" + micromatch "^2.3.11" + slash "^1.0.0" + +jest-mock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" + +jest-regex-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" + +jest-resolve-dependencies@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" + dependencies: + jest-regex-util "^20.0.3" + +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" + dependencies: + browser-resolve "^1.11.2" + is-builtin-module "^1.0.0" + resolve "^1.3.2" + +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" + dependencies: + babel-core "^6.0.0" + babel-jest "^20.0.3" + babel-plugin-istanbul "^4.0.0" + chalk "^1.1.3" + convert-source-map "^1.4.0" + graceful-fs "^4.1.11" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-util "^20.0.3" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + strip-bom "3.0.0" + yargs "^7.0.2" + +jest-snapshot@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" + dependencies: + chalk "^1.1.3" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-util "^20.0.3" + natural-compare "^1.4.0" + pretty-format "^20.0.3" + +jest-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" + dependencies: + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-message-util "^20.0.3" + jest-mock "^20.0.3" + jest-validate "^20.0.3" + leven "^2.1.0" + mkdirp "^0.5.1" + +jest-validate@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" + dependencies: + chalk "^1.1.3" + jest-matcher-utils "^20.0.3" + leven "^2.1.0" + pretty-format "^20.0.3" + +jest@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" + dependencies: + jest-cli "^20.0.4" + +jodid25519@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + dependencies: + jsbn "~0.1.0" + js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-types@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/js-types/-/js-types-1.0.0.tgz#d242e6494ed572ad3c92809fc8bed7f7687cbf03" - -js-yaml@^3.5.1: +js-yaml@^3.5.1, js-yaml@^3.7.0: version "3.8.4" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + jschardet@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" +jsdom@^9.12.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" + dependencies: + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" + array-equal "^1.0.0" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + escodegen "^1.6.1" + html-encoding-sniffer "^1.0.1" + nwmatcher ">= 1.3.9 < 2.0.0" + parse5 "^1.5.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" + whatwg-encoding "^1.0.1" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -1984,13 +2852,17 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: jsonify "~0.0.0" -json-stringify-safe@^5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -1998,7 +2870,7 @@ json3@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" -json5@^0.5.0: +json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2010,27 +2882,48 @@ jsonpointer@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" +jsprim@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + dependencies: + assert-plus "1.0.0" + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +jsx-ast-utils@^1.3.4, jsx-ast-utils@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" + kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" dependencies: is-buffer "^1.1.5" -latest-version@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" - dependencies: - package-json "^4.0.0" +lazy-cache@^0.2.3: + version "0.2.7" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65" -lazy-cache@^2.0.1: +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lazy-cache@^2.0.1, lazy-cache@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" dependencies: set-getter "^0.1.0" -lazy-req@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-2.0.0.tgz#c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4" +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" levn@^0.3.0, levn@~0.3.0: version "0.3.0" @@ -2039,20 +2932,6 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -liftoff@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.3.0.tgz#a98f2ff67183d8ba7cfaca10548bd7ff0550b385" - dependencies: - extend "^3.0.0" - findup-sync "^0.4.2" - fined "^1.0.1" - flagged-respawn "^0.3.2" - lodash.isplainobject "^4.0.4" - lodash.isstring "^4.0.1" - lodash.mapvalues "^4.4.0" - rechoir "^0.6.2" - resolve "^1.1.7" - load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -2072,20 +2951,6 @@ load-json-file@^2.0.0: pify "^2.0.0" strip-bom "^3.0.0" -load-pkg@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/load-pkg/-/load-pkg-3.0.1.tgz#9230b37ec04e569003060bc58951e3ed508d594f" - dependencies: - find-pkg "^0.1.0" - -load-plugins@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/load-plugins/-/load-plugins-2.1.2.tgz#e00ffdf45e2067ba188fca0453eb703f049a76d0" - dependencies: - app-name "^0.2.0" - extend-shallow "^2.0.0" - resolve-dep "^0.6.0" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -2108,14 +2973,6 @@ lodash._basecreate@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - lodash._getnative@^3.0.0: version "3.9.1" resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" @@ -2124,29 +2981,13 @@ lodash._isiterateecall@^3.0.0: version "3.0.9" resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - -lodash.assignwith@^4.0.7: +lodash.assignin@^4.0.9: version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz#127a97f02adc41751a954d24b0de17e100e038eb" + resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2" -lodash.camelcase@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" +lodash.bind@^4.1.4: + version "4.2.1" + resolved "https://registry.yarnpkg.com/lodash.bind/-/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35" lodash.cond@^4.3.0: version "4.5.2" @@ -2160,11 +3001,21 @@ lodash.create@3.1.1: lodash._basecreate "^3.0.0" lodash._isiterateecall "^3.0.0" -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - dependencies: - lodash._root "^3.0.0" +lodash.defaults@^4.0.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + +lodash.filter@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.filter/-/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace" + +lodash.flatten@^4.2.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + +lodash.foreach@^4.3.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53" lodash.isarguments@^3.0.0: version "3.1.0" @@ -2174,26 +3025,6 @@ lodash.isarray@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" -lodash.isempty@^4.2.1: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e" - -lodash.isequal@^4.4.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - -lodash.isplainobject@^4.0.4: - version "4.0.6" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - -lodash.kebabcase@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" - lodash.keys@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" @@ -2202,64 +3033,44 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.mapvalues@^4.4.0: +lodash.map@^4.4.0: version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" + resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" + +lodash.merge@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" lodash.pick@^4.2.1: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - -lodash.snakecase@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" - -lodash.template@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" +lodash.reduce@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b" -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" +lodash.reject@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.reject/-/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415" -lodash.upperfirst@^4.2.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" +lodash.some@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" lodash@^3.10.0: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.0, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.0, lodash@^4.17.2, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -lodash@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" - -log-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" +log-ok@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/log-ok/-/log-ok-0.1.1.tgz#bea3dd36acd0b8a7240d78736b5b97c65444a334" dependencies: - chalk "^1.0.0" + ansi-green "^0.1.1" + success-symbol "^0.1.0" log-update@^2.0.0: version "2.0.0" @@ -2269,56 +3080,35 @@ log-update@^2.0.0: cli-cursor "^2.0.0" wrap-ansi "^2.1.0" -lookup-path@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/lookup-path/-/lookup-path-0.3.1.tgz#a4ef2410ae32669af700c4cb7e1b0109509cf2b8" - dependencies: - debug "^2.2.0" - is-absolute "^0.2.3" +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" -loud-rejection@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" +magic-string@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.15.2.tgz#0681d7388741bbc3addaa65060992624c6c09e9c" dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - -lowercase-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + vlq "^0.2.1" -lru-cache@2: - version "2.7.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" - -lru-cache@^4.0.0, lru-cache@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" +magic-string@^0.19.0: + version "0.19.1" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.19.1.tgz#14d768013caf2ec8fdea16a49af82fc377e75201" dependencies: - pseudomap "^1.0.1" - yallist "^2.0.0" + vlq "^0.2.1" -make-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" dependencies: - pify "^2.3.0" + tmpl "1.0.x" -map-cache@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - -map-obj@^1.0.0, map-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - -matched@^0.4.4: +matched@^0.4.1: version "0.4.4" resolved "https://registry.yarnpkg.com/matched/-/matched-0.4.4.tgz#56d7b7eb18033f0cf9bc52eb2090fac7dc1e89fa" dependencies: @@ -2332,22 +3122,11 @@ matched@^0.4.4: lazy-cache "^2.0.1" resolve-dir "^0.1.0" -meow@^3.4.2: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" -micromatch@^2.3.11, micromatch@^2.3.7: +micromatch@^2.1.5, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -2365,38 +3144,35 @@ micromatch@^2.3.11, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -minimatch@^2.0.1: - version "2.0.10" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" - dependencies: - brace-expansion "^1.0.0" - minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: brace-expansion "^1.1.7" -minimatch@~0.2.11: - version "0.2.14" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" - dependencies: - lru-cache "2" - sigmund "~1.0.0" - -minimist@0.0.8: +minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: +minimist@^1.1.1, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -2430,21 +3206,6 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -multimatch@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" - dependencies: - array-differ "^1.0.0" - array-union "^1.0.1" - arrify "^1.0.0" - minimatch "^3.0.0" - -multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - dependencies: - duplexer2 "0.0.2" - mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" @@ -2453,21 +3214,62 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -natives@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" +nan@^2.3.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +node-fetch@^1.0.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.0.tgz#3ff6c56544f9b7fb00682338bb55ee6f54a8a0ef" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + node-localstorage@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/node-localstorage/-/node-localstorage-1.3.0.tgz#2e436aae8dcc9ace97b43c65c16c0d577be0a55c" dependencies: write-file-atomic "^1.1.4" -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +node-notifier@^5.0.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" + dependencies: + growly "^1.3.0" + semver "^5.3.0" + shellwords "^0.1.0" + which "^1.2.12" + +node-pre-gyp@^0.6.29: + version "0.6.34" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" + dependencies: + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "^2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: version "2.3.8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" dependencies: @@ -2482,34 +3284,62 @@ normalize-path@^2.0.1: dependencies: remove-trailing-separator "^1.0.1" -npm-run-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" +npmlog@^4.0.2: + version "4.1.0" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.0.tgz#dc59bee85f64f00ed424efb2af0783df25d1c0b5" dependencies: - path-key "^1.0.0" + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" +nth-check@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" dependencies: - path-key "^2.0.0" + boolbase "~1.0.0" number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -obj-props@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/obj-props/-/obj-props-1.1.0.tgz#626313faa442befd4a44e9a02c3cb6bde937b511" +"nwmatcher@>= 1.3.9 < 2.0.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf" -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object-is@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" + +object-keys@^1.0.10, object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +object.assign@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.0" + object-keys "^1.0.10" + +object.entries@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.6.1" + function-bind "^1.1.0" + has "^1.0.1" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -2517,15 +3347,18 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" +object.values@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a" dependencies: - wrappy "1" + define-properties "^1.1.2" + es-abstract "^1.6.1" + function-bind "^1.1.0" + has "^1.0.1" -once@~1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" +once@^1.3.0, once@^1.3.3, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: wrappy "1" @@ -2539,7 +3372,14 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" -optionator@^0.8.2: +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -2550,29 +3390,34 @@ optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -orchestrator@^0.3.0: - version "0.3.8" - resolved "https://registry.yarnpkg.com/orchestrator/-/orchestrator-0.3.8.tgz#14e7e9e2764f7315fbac184e506c7aa6df94ad7e" - dependencies: - end-of-stream "~0.1.5" - sequencify "~0.0.7" - stream-consume "~0.1.0" - -ordered-read-streams@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz#fd565a9af8eb4473ba69b6ed8a34352cb552f126" - os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +output-file-sync@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" p-limit@^1.1.0: version "1.1.0" @@ -2584,22 +3429,9 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -package-json@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" - dependencies: - got "^6.7.1" - registry-auth-token "^3.0.1" - registry-url "^3.0.3" - semver "^5.1.0" - -parse-filepath@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.1.tgz#159d6155d43904d16c10ef698911da1e91969b73" - dependencies: - is-absolute "^0.2.3" - map-cache "^0.2.0" - path-root "^0.1.1" +p-map@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" parse-glob@^3.0.4: version "3.0.4" @@ -2620,6 +3452,10 @@ parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" +parse5@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -2638,28 +3474,10 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" -path-key@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" - -path-key@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - dependencies: - path-root-regex "^0.1.0" - path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -2674,6 +3492,10 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -2688,31 +3510,12 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-conf@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279" - dependencies: - find-up "^2.0.0" - load-json-file "^2.0.0" - pkg-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" dependencies: find-up "^1.0.0" -pkg-up@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" - dependencies: - find-up "^1.0.0" - -plur@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" - dependencies: - irregular-plurals "^1.0.0" - pluralize@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" @@ -2721,17 +3524,16 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-hrtime@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" +pretty-format@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" + dependencies: + ansi-regex "^2.1.1" + ansi-styles "^3.0.0" private@^0.1.6: version "0.1.7" @@ -2745,13 +3547,30 @@ progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" -proto-props@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/proto-props/-/proto-props-0.2.1.tgz#5e01dc2675a0de9abfa76e799dfa334d6f483f4b" +promise@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" + dependencies: + asap "~2.0.3" -pseudomap@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +prop-types@^15.5.4, prop-types@^15.5.7, prop-types@~15.5.7: + version "15.5.10" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.3.1" + +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" randomatic@^1.1.3: version "1.1.6" @@ -2760,7 +3579,7 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" -rc@^1.0.1, rc@^1.1.6: +rc@^1.1.7: version "1.2.1" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" dependencies: @@ -2769,6 +3588,31 @@ rc@^1.0.1, rc@^1.1.6: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-dom@^15.5.4: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.5.4.tgz#ba0c28786fd52ed7e4f2135fe0288d462aef93da" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "~15.5.7" + +react-test-renderer@^15.5.4: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-15.5.4.tgz#d4ebb23f613d685ea8f5390109c2d20fbf7c83bc" + dependencies: + fbjs "^0.8.9" + object-assign "^4.1.0" + +react@^15.5.4: + version "15.5.4" + resolved "https://registry.yarnpkg.com/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.1.0" + object-assign "^4.1.0" + prop-types "^15.5.7" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -2797,18 +3641,9 @@ read-pkg@^2.0.0: dependencies: load-json-file "^2.0.0" normalize-package-data "^2.3.2" - path-type "^2.0.0" - -"readable-stream@>=1.0.33-1 <1.1.0-0": - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" + path-type "^2.0.0" -readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2: +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.9" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" dependencies: @@ -2820,14 +3655,14 @@ readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2: string_decoder "~1.0.0" util-deprecate "~1.0.1" -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" readline2@^1.0.1: version "1.0.1" @@ -2843,13 +3678,6 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" @@ -2881,19 +3709,6 @@ regexpu-core@^2.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" -registry-auth-token@^3.0.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.1.tgz#fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006" - dependencies: - rc "^1.1.6" - safe-buffer "^5.0.1" - -registry-url@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" - dependencies: - rc "^1.0.1" - regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" @@ -2926,9 +3741,44 @@ replace-ext@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" -req-all@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/req-all/-/req-all-1.0.0.tgz#d128569451c340b432409c656cf166260cd2628d" +request@^2.79.0, request@^2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +require-relative@0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" require-uncached@^1.0.2: version "1.0.3" @@ -2937,25 +3787,6 @@ require-uncached@^1.0.2: caller-path "^0.1.0" resolve-from "^1.0.0" -resolve-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-1.0.0.tgz#4eaeea41ed040d1702457df64a42b2b07d246f9f" - dependencies: - resolve-from "^2.0.0" - -resolve-dep@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/resolve-dep/-/resolve-dep-0.6.0.tgz#673f1441e777852fd6ad81365ce7d5d85455a4fb" - dependencies: - arrayify-compact "^0.2.0" - cwd "^0.10.0" - extend-shallow "^2.0.1" - load-pkg "^3.0.1" - lookup-path "^0.3.1" - matched "^0.4.4" - micromatch "^2.3.11" - resolve "^1.1.7" - resolve-dir@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" @@ -2967,11 +3798,11 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.6, resolve@^1.1.7: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -2991,12 +3822,92 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" -rimraf@^2.2.8: +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" +rollup-plugin-babel@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" + dependencies: + babel-core "6" + babel-plugin-transform-es2015-classes "^6.9.0" + object-assign "^4.1.0" + rollup-pluginutils "^1.5.0" + +rollup-plugin-commonjs@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.0.2.tgz#98b1589bfe32a6c0f67790b60c0b499972afed89" + dependencies: + acorn "^4.0.1" + estree-walker "^0.3.0" + magic-string "^0.19.0" + resolve "^1.1.7" + rollup-pluginutils "^2.0.1" + +rollup-plugin-json@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.1.1.tgz#933390dff3c9e3e654157d61304c5e167fc58623" + dependencies: + rollup-pluginutils "^1.5.2" + +rollup-plugin-node-resolve@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0" + dependencies: + browser-resolve "^1.11.0" + builtin-modules "^1.1.0" + is-module "^1.0.0" + resolve "^1.1.6" + +rollup-plugin-replace@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-1.1.1.tgz#396315ded050a6ce43b9518a886a3f60efb1ea33" + dependencies: + magic-string "^0.15.2" + minimatch "^3.0.2" + rollup-pluginutils "^1.5.0" + +rollup-plugin-uglify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-2.0.1.tgz#67b37ad1efdafbd83af4c36b40c189ee4866c969" + dependencies: + uglify-js "^3.0.9" + +rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + dependencies: + estree-walker "^0.2.1" + minimatch "^3.0.2" + +rollup-pluginutils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0" + dependencies: + estree-walker "^0.3.0" + micromatch "^2.3.11" + +rollup-watch@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-3.2.2.tgz#5e574232e9ef36da9177f46946d8080cb267354b" + dependencies: + require-relative "0.8.7" + +rollup@^0.41.6: + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" + dependencies: + source-map-support "^0.4.0" + run-async@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" @@ -3021,23 +3932,29 @@ safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" -semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" +sane@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" dependencies: - semver "^5.0.3" + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" -"semver@2 || 3 || 4 || 5", semver@^4.1.0: - version "4.3.6" - resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" +sax@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" -semver@^5.0.3, semver@^5.1.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" -sequencify@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" set-getter@^0.1.0: version "0.1.0" @@ -3045,6 +3962,14 @@ set-getter@^0.1.0: dependencies: to-object-path "^0.3.0" +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + shelljs@^0.7.5: version "0.7.7" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" @@ -3053,6 +3978,10 @@ shelljs@^0.7.5: interpret "^1.0.0" rechoir "^0.6.2" +shellwords@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" + should-equal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-1.0.1.tgz#0b6e9516f2601a9fb0bb2dcc369afa1c7e200af7" @@ -3091,10 +4020,6 @@ should@^11.2.1: should-type-adaptors "^1.0.1" should-util "^1.0.0" -sigmund@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3115,25 +4040,33 @@ slide@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" -sort-keys@^1.1.1, sort-keys@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" dependencies: - is-plain-obj "^1.0.0" + hoek "2.x.x" -source-map-support@^0.4.2: +source-map-support@^0.4.0, source-map-support@^0.4.2: version "0.4.15" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" dependencies: source-map "^0.5.6" -source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.6: +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -sparkles@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" spdx-correct@~1.0.0: version "1.0.2" @@ -3153,11 +4086,28 @@ sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" -stream-consume@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" +sshpk@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jodid25519 "^1.0.0" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -3172,54 +4122,52 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - string_decoder@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" dependencies: safe-buffer "^5.0.1" +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" dependencies: ansi-regex "^2.0.0" -strip-bom@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" +strip-bom-buffer@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/strip-bom-buffer/-/strip-bom-buffer-0.1.1.tgz#ca3ddc4919c13f9fddf30b1dff100a9835248b4d" dependencies: - first-chunk-stream "^1.0.0" + is-buffer "^1.1.0" is-utf8 "^0.2.0" -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - dependencies: - is-utf8 "^0.2.0" +strip-bom-string@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-0.1.2.tgz#9c6e720a313ba9836589518405ccfb88a5f41b9c" -strip-bom@^3.0.0: +strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" dependencies: - get-stdin "^4.0.1" + is-utf8 "^0.2.0" strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@3.1.2: +success-symbol@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/success-symbol/-/success-symbol-0.1.0.tgz#24022e486f3bf1cdca094283b769c472d3b72897" + +supports-color@3.1.2, supports-color@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" dependencies: @@ -3229,6 +4177,10 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" @@ -3240,28 +4192,46 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -term-size@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" +tar-pack@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +test-exclude@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" dependencies: - execa "^0.4.0" + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -the-argv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/the-argv/-/the-argv-1.0.0.tgz#0084705005730dd84db755253c931ae398db9522" - -through2@^0.6.1: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" +throat@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" -through2@^2.0.0: +through2@^2.0.0, through2@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: @@ -3272,39 +4242,48 @@ through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -tildify@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" - dependencies: - os-homedir "^1.0.0" - -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - -timed-out@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - tmp@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" dependencies: os-tmpdir "~1.0.1" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + to-fast-properties@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +to-file@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/to-file/-/to-file-0.2.0.tgz#236c6c088065e570defbd15cf4b4e565be46ea93" + dependencies: + define-property "^0.2.5" + extend-shallow "^2.0.1" + file-contents "^0.2.4" + glob-parent "^2.0.0" + is-valid-glob "^0.3.0" + isobject "^2.1.0" + lazy-cache "^2.0.1" + vinyl "^1.1.1" + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" dependencies: kind-of "^3.0.2" -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +tough-cookie@^2.3.2, tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" trim-right@^1.0.1: version "1.0.1" @@ -3314,6 +4293,16 @@ tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -3324,42 +4313,37 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -unc-path-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" +ua-parser-js@^0.7.9: + version "0.7.12" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" -unique-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-1.0.0.tgz#d59a4a75427447d9aa6c91e70263f8d26a4b104b" +uglify-js@^2.6: + version "2.8.27" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" -unique-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" +uglify-js@^3.0.9: + version "3.0.11" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.11.tgz#81f594b9a24dad76e39da92f8f06e5b3bc8c2e11" dependencies: - crypto-random-string "^1.0.0" + commander "~2.9.0" + source-map "~0.5.1" -unzip-response@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -update-notifier@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.1.0.tgz#ec0c1e53536b76647a24b77cb83966d9315123d9" - dependencies: - boxen "^1.0.0" - chalk "^1.0.0" - configstore "^3.0.0" - is-npm "^1.0.0" - latest-version "^3.0.0" - lazy-req "^2.0.0" - semver-diff "^2.0.0" - xdg-basedir "^3.0.0" - -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - dependencies: - prepend-http "^1.0.1" +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +unc-path-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" user-home@^1.1.1: version "1.1.1" @@ -3375,7 +4359,15 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -v8flags@^2.0.2: +uuid@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + +uuid@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" + +v8flags@^2.0.10: version "2.1.1" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" dependencies: @@ -3388,40 +4380,24 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -vinyl-fs@^0.3.0: - version "0.3.14" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-0.3.14.tgz#9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6" - dependencies: - defaults "^1.0.0" - glob-stream "^3.1.5" - glob-watcher "^0.0.6" - graceful-fs "^3.0.0" - mkdirp "^0.5.0" - strip-bom "^1.0.0" - through2 "^0.6.1" - vinyl "^0.4.0" - -vinyl-sourcemaps-apply@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" - dependencies: - source-map "^0.5.1" - -vinyl@^0.4.0: - version "0.4.6" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" dependencies: - clone "^0.2.0" - clone-stats "^0.0.1" + extsprintf "1.0.2" -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" +vinyl@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" dependencies: clone "^1.0.0" clone-stats "^0.0.1" replace-ext "0.0.1" +vlq@^0.2.1: + version "0.2.2" + resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.2.tgz#e316d5257b40b86bb43cb8d5fea5d7f54d6b0ca1" + vorpal-less@^0.0.13: version "0.0.13" resolved "https://registry.yarnpkg.com/vorpal-less/-/vorpal-less-0.0.13.tgz#a5adbc4fbc8ad6a150fe6d91a8996e93fd8b6418" @@ -3436,23 +4412,77 @@ vorpal-repl@^1.1.8: json-stringify-safe "^5.0.1" lodash "^3.10.0" -which@^1.2.12, which@^1.2.8, which@^1.2.9: +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + +webidl-conversions@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + +whatwg-encoding@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz#3c6c451a198ee7aec55b1ec61d0920c67801a5f4" + dependencies: + iconv-lite "0.4.13" + +whatwg-fetch@>=0.10.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" + +whatwg-url@^4.3.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0" + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which@^1.2.12: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: isexe "^2.0.0" -widest-line@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-1.0.0.tgz#0c09c85c2a94683d0d7eaf8ee097d564bf0e105c" +wide-align@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" dependencies: - string-width "^1.0.1" + string-width "^1.0.2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2, wordwrap@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -wrap-ansi@^2.1.0: +worker-farm@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" + dependencies: + errno ">=0.1.1 <0.2.0-0" + xtend ">=4.0.0 <4.1.0-0" + +wrap-ansi@^2.0.0, wrap-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" dependencies: @@ -3471,87 +4501,53 @@ write-file-atomic@^1.1.4: imurmurhash "^0.1.4" slide "^1.1.5" -write-file-atomic@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.1.0.tgz#1769f4b551eedce419f0505deae2e26763542d37" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - -write-json-file@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.1.0.tgz#ba1cf3ac7ee89db26c3d528986e48421389046b7" - dependencies: - graceful-fs "^4.1.2" - make-dir "^1.0.0" - pify "^2.0.0" - sort-keys "^1.1.1" - write-file-atomic "^2.0.0" - -write-pkg@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.1.0.tgz#353aa44c39c48c21440f5c08ce6abd46141c9c08" - dependencies: - sort-keys "^1.1.2" - write-json-file "^2.0.0" - write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" dependencies: mkdirp "^0.5.1" -xdg-basedir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" - -xo-init@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/xo-init/-/xo-init-0.5.0.tgz#8e28dec79676cc5e042fde5fd8f710e2646b0e36" - dependencies: - arrify "^1.0.0" - execa "^0.5.0" - minimist "^1.1.3" - path-exists "^3.0.0" - read-pkg-up "^2.0.0" - the-argv "^1.0.0" - write-pkg "^2.0.0" - -xo@^0.18.0, xo@^0.18.2: - version "0.18.2" - resolved "https://registry.yarnpkg.com/xo/-/xo-0.18.2.tgz#92a42eb02a4fb149dfea5518021914f5aac84ff0" - dependencies: - arrify "^1.0.0" - debug "^2.2.0" - deep-assign "^1.0.0" - eslint "^3.18.0" - eslint-config-xo "^0.18.0" - eslint-formatter-pretty "^1.0.0" - eslint-plugin-ava "^4.2.0" - eslint-plugin-import "^2.0.0" - eslint-plugin-no-use-extend-native "^0.3.2" - eslint-plugin-promise "^3.4.0" - eslint-plugin-unicorn "^2.1.0" - get-stdin "^5.0.0" - globby "^6.0.0" - has-flag "^2.0.0" - ignore "^3.2.6" - lodash.isequal "^4.4.0" - meow "^3.4.2" - multimatch "^2.1.0" - path-exists "^3.0.0" - pkg-conf "^2.0.0" - resolve-cwd "^1.0.0" - resolve-from "^2.0.0" - slash "^1.0.0" - update-notifier "^2.1.0" - xo-init "^0.5.0" +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -yallist@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From 204fe38b6212e14c820015c0481d4493d26574e6 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 25 May 2017 19:50:36 -0700 Subject: [PATCH 08/38] Updated changelog. --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 967e1b4e..e5d00690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ # 2.0.0 [IN PROGRESS] -* Updated minimum Node.js requirement to v4. +#### 🚀 New +* Updated minimum Node.js requirement to v6.5. * Updated Inquirer.js to v3 from v0.11. +* Added a new `default` option to commands. +* Added a new `vorpal_exit` event. + +#### 🐞 Fixed +* Will now properly exit all scenarios if Ctrl + C is pressed. +* Now supports slashes in autocomplete list values. +* Improvements to variadic argument parsing. + +#### 🛠 Internal +* Migrated to 100% ES2015 syntax. +* Migrated from Gulp to NPM scripts. +* Updated to the latest Babel and ESLint (based off Airbnb config). From 5a227229837b4ec161f9ebacbf37f943077f797d Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Fri, 26 May 2017 00:00:25 -0700 Subject: [PATCH 09/38] Updated changelog. --- CHANGELOG.md | 14 +++++++++++--- examples/mode/README.md | 25 ++++++++++++------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5d00690..bca849e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ # 2.0.0 [IN PROGRESS] -#### 🚀 New +#### 💥 Breaking * Updated minimum Node.js requirement to v6.5. * Updated Inquirer.js to v3 from v0.11. -* Added a new `default` option to commands. + +#### 🚀 New +* Added `Vorpal#title`, `Vorpal#version`, `Vorpal#description`, and `Vorpal#banner` descriptor methods. + * Renders in the header of help and menu screens. +* Added a new options object as the 3rd argument to `Vorpal#command`. + * Supports a new `default` option. + * Supports the old autocomplete functionality as a fallback. * Added a new `vorpal_exit` event. #### 🐞 Fixed @@ -12,5 +18,7 @@ #### 🛠 Internal * Migrated to 100% ES2015 syntax. -* Migrated from Gulp to NPM scripts. +* Migrated to Yarn from NPM. +* Migrated to Yarn scripts from Gulp. * Updated to the latest Babel and ESLint (based off Airbnb config). +* Removed the `dist` folder from the repository. diff --git a/examples/mode/README.md b/examples/mode/README.md index c9854753..f8f2715d 100755 --- a/examples/mode/README.md +++ b/examples/mode/README.md @@ -1,13 +1,12 @@ -# Vantage Server with a `mode` command. - -This is an example of setting up a `mode` command to establish a basic REPL client. - -### Running the file - -```bash -$ git clone git://github.com/dthree/vantage.git vantage -$ cd ./vantage -$ npm install -$ node ./examples/mode/mode.js -``` - +# Vantage Server with a `mode` command. + +This is an example of setting up a `mode` command to establish a basic REPL client. + +### Running the file + +```bash +$ git clone git://github.com/dthree/vantage.git vantage +$ cd ./vantage +$ npm install +$ node ./examples/mode/mode.js +``` From c5dcf943dd0de0fd0a13e8fb7990ea375e0b78c1 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Sat, 27 May 2017 16:55:18 -0700 Subject: [PATCH 10/38] Removed Babel. Updating Node.js req to 6.10. --- .npmignore | 4 ++++ .travis.yml | 2 +- CHANGELOG.md | 5 +++-- lib/command.js | 14 +++++++------- lib/vorpal.js | 10 ---------- package.json | 18 ++++-------------- test/autocomplete.js | 2 +- test/index.js | 2 +- test/integration.js | 4 ++-- test/util/util.js | 2 +- test/vorpal.js | 4 ++-- yarn.lock | 4 ---- 12 files changed, 26 insertions(+), 45 deletions(-) diff --git a/.npmignore b/.npmignore index e69de29b..b64d6345 100755 --- a/.npmignore +++ b/.npmignore @@ -0,0 +1,4 @@ +examples/ +test/ +.gitignore +.travis.yml diff --git a/.travis.yml b/.travis.yml index 25ee4060..53424661 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - 6 + - 6.10 - 7 - node sudo: false diff --git a/CHANGELOG.md b/CHANGELOG.md index bca849e8..680b6248 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # 2.0.0 [IN PROGRESS] #### 💥 Breaking -* Updated minimum Node.js requirement to v6.5. +* Updated minimum Node.js requirement to v6.10 (oldest LTS). * Updated Inquirer.js to v3 from v0.11. #### 🚀 New @@ -20,5 +20,6 @@ * Migrated to 100% ES2015 syntax. * Migrated to Yarn from NPM. * Migrated to Yarn scripts from Gulp. -* Updated to the latest Babel and ESLint (based off Airbnb config). +* Updated to no longer require or build with Babel. +* Updated to the latest ESLint (based off Airbnb config). * Removed the `dist` folder from the repository. diff --git a/lib/command.js b/lib/command.js index 582d83ba..e05381d1 100755 --- a/lib/command.js +++ b/lib/command.js @@ -3,12 +3,10 @@ /** * Module dependencies. */ -import { - EventEmitter -} from 'events'; -import Option from './option'; -import VorpalUtil from './util'; -import _ from 'lodash'; +const { EventEmitter } = require('events'); +const Option = require('./option'); +const VorpalUtil = require('./util'); +const _ = require('lodash'); /** * Converts string to camel case. @@ -23,7 +21,7 @@ function _camelcase(flag) { }); } -module.exports = class Command extends EventEmitter { +class Command extends EventEmitter { constructor(name, parent) { super(...arguments); @@ -559,3 +557,5 @@ module.exports = class Command extends EventEmitter { return; } }; + +module.exports = Command; diff --git a/lib/vorpal.js b/lib/vorpal.js index f4a08819..4a4d2259 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,15 +1,5 @@ 'use strict'; -/** - * Polyfill for ES6. - */ - -if (!global._babelPolyfill) { - // When the runtime transformer properly detects all shimmed methods, use instead. - // http://www.2ality.com/2015/12/babel6-helpersstandard-library.html#babel-plugin-transform-runtime - require('babel-polyfill'); -} - /** * Module dependencies. */ diff --git a/package.json b/package.json index 16885f91..ac831b21 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,11 @@ "name": "vorpal", "version": "1.11.4", "description": "Node's first framework for building immersive CLI apps.", - "main": "./dist/vorpal.js", + "main": "./lib/vorpal.js", "scripts": { - "build": "build-lib ./lib -d ./dist", "lint": "run-linter ./lib", - "test": "npm run build; mocha", - "prepublish": "in-publish && npm run build || not-in-publish" + "test": "mocha" }, - "files": [ - "dist" - ], "repository": { "type": "git", "url": "git+https://github.com/dthree/vorpal.git" @@ -46,9 +41,7 @@ "vorpal-repl": "^1.1.8" }, "dependencies": { - "babel-polyfill": "^6.23.0", "chalk": "^1.1.0", - "in-publish": "^2.0.0", "inquirer": "^3.0.6", "lodash": "^4.17.0", "log-update": "^2.0.0", @@ -58,11 +51,8 @@ "wrap-ansi": "^2.1.0" }, "engines": { - "node": ">=6.5.0", - "npm": ">=3.0.0" - }, - "babel": { - "extends": "./node_modules/@milesj/build-tool-config/babel.node.json5" + "node": ">=6.10.0", + "npm": ">=3.10.0" }, "eslintConfig": { "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5" diff --git a/test/autocomplete.js b/test/autocomplete.js index 83aacec7..165d9361 100644 --- a/test/autocomplete.js +++ b/test/autocomplete.js @@ -1,4 +1,4 @@ -var Vorpal = require('../dist/vorpal'); +var Vorpal = require('../lib/vorpal'); var assert = require('assert'); var _ = require('lodash'); var vorpal = new Vorpal(); diff --git a/test/index.js b/test/index.js index f9af5891..3c7ec12b 100755 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,4 @@ -var Vorpal = require('../dist/vorpal'); +var Vorpal = require('../lib/vorpal'); var should = require('should'); var vorpal = new Vorpal(); diff --git a/test/integration.js b/test/integration.js index 55ece0b9..69a90189 100755 --- a/test/integration.js +++ b/test/integration.js @@ -1,11 +1,11 @@ 'use strict'; -var Vorpal = require('../dist/vorpal'); +var Vorpal = require('../lib/vorpal'); var commands = require('./util/server'); var BlueBirdPromise = require('bluebird'); var fs = require('fs'); -var intercept = require('../dist/intercept'); +var intercept = require('../lib/intercept'); var stdout = ''; var umute; var mute = function () { diff --git a/test/util/util.js b/test/util/util.js index 1b036700..303149d4 100755 --- a/test/util/util.js +++ b/test/util/util.js @@ -1,4 +1,4 @@ -var Vorpal = require('../../dist/vorpal'); +var Vorpal = require('../../lib/vorpal'); var _ = require('lodash'); var path = require('path'); diff --git a/test/vorpal.js b/test/vorpal.js index 1552c193..d37e67f9 100755 --- a/test/vorpal.js +++ b/test/vorpal.js @@ -5,10 +5,10 @@ * this one. */ -var Vorpal = require('../dist/vorpal'); +var Vorpal = require('../lib/vorpal'); var should = require('should'); var assert = require('assert'); -var intercept = require('../dist/intercept'); +var intercept = require('../lib/intercept'); var vorpal; diff --git a/yarn.lock b/yarn.lock index ca7358a3..ac7eaa78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2222,10 +2222,6 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" -in-publish@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" From 410a403e65f30d4815394f499d91793a379056b9 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Sat, 27 May 2017 16:57:49 -0700 Subject: [PATCH 11/38] Fix travis config. --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53424661..3de9398f 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,8 @@ language: node_js node_js: - - 6.10 - - 7 - - node + - "6.10" + - "7" + - "node" sudo: false -branches: - only: - - master +notifications: + email: false From 7bd99d0b58107fd80f7057a5b7e379a05545b8a4 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Fri, 26 May 2017 01:01:10 -0700 Subject: [PATCH 12/38] Converted command-instance to ES2015. --- lib/command-instance.js | 106 ++++++++++++++++++++-------------------- lib/session.js | 3 +- lib/vorpal.js | 4 +- 3 files changed, 55 insertions(+), 58 deletions(-) diff --git a/lib/command-instance.js b/lib/command-instance.js index 03d9cb85..b2e5b08b 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -1,37 +1,22 @@ -'use strict'; +import util from './util'; -/** - * Module dependencies. - */ +export default class CommandInstance { + constructor(options = {}) { + const { command, commandObject, args, commandWrapper, callback, downstream } = options; -const util = require('./util'); -const _ = require('lodash'); - -class CommandInstance { - - /** - * Initialize a new `CommandInstance` instance. - * - * @param {Object} params - * @return {CommandInstance} - * @api public - */ - - constructor({command, commandObject, args, commandWrapper, callback, downstream} = {}) { + this.args = args; + this.callback = callback; this.command = command; this.commandObject = commandObject; - this.args = args; this.commandWrapper = commandWrapper; - this.session = commandWrapper.session; - this.parent = this.session.parent; - this.callback = callback; this.downstream = downstream; + this.parent = commandWrapper.session.parent; + this.session = commandWrapper.session; } /** * Cancel running command. */ - cancel() { this.session.emit('vorpal_command_cancel'); } @@ -39,39 +24,54 @@ class CommandInstance { /** * Route stdout either through a piped command, or the session's stdout. */ + log(...params) { + const args = util.fixArgsForApply(params); + + if (!this.downstream) { + this.session.log(...args); - log() { - const args = util.fixArgsForApply(arguments); - if (this.downstream) { - const fn = this.downstream.commandObject._fn || function () {}; - this.session.registerCommand(); - this.downstream.args.stdin = args; - const onComplete = (err) => { - if (this.session.isLocal() && err) { - this.session.log(err.stack || err); - this.session.parent.emit('client_command_error', {command: this.downstream.command, error: err}); - } - this.session.completeCommand(); - }; - - const validate = this.downstream.commandObject._validate; - if (_.isFunction(validate)) { - try { - validate.call(this.downstream, this.downstream.args); - } catch (e) { - // Log error without piping to downstream on validation error. - this.session.log(e.toString()); - onComplete(); - return; - } + return; + } + + this.session.registerCommand(); + this.downstream.args.stdin = args; + + const onComplete = (error) => { + if (this.session.isLocal() && error) { + this.session.log(error.stack || error); + this.session.parent.emit('client_command_error', { + command: this.downstream.command, + error, + }); + } + + this.session.completeCommand(); + }; + + // eslint-disable-next-line no-underscore-dangle + const validate = this.downstream.commandObject._validate; + + if (typeof validate === 'function') { + try { + validate.call(this.downstream, this.downstream.args); + } catch (e) { + // Log error without piping to downstream on validation error. + this.session.log(e.toString()); + onComplete(); + + return; } + } - const res = fn.call(this.downstream, this.downstream.args, onComplete); - if (res && _.isFunction(res.then)) { - res.then(onComplete, onComplete); + // eslint-disable-next-line no-underscore-dangle + const callback = this.downstream.commandObject._fn; + + if (callback) { + const response = callback.call(this.downstream, this.downstream.args, onComplete); + + if (response instanceof Promise) { + response.then(onComplete, onComplete); } - } else { - this.session.log.apply(this.session, args); } } @@ -91,5 +91,3 @@ class CommandInstance { return this.session.match(a, b, c); } } - -module.exports = CommandInstance; diff --git a/lib/session.js b/lib/session.js index 058deb3c..b9019478 100755 --- a/lib/session.js +++ b/lib/session.js @@ -1,4 +1,5 @@ 'use strict'; +import CommandInstance from './command-instance'; /** * Module dependencies. @@ -9,7 +10,7 @@ var os = require('os'); var _ = require('lodash'); var util = require('./util'); var autocomplete = require('./autocomplete'); -var CommandInstance = require('./command-instance'); + /** * Initialize a new `Session` instance. diff --git a/lib/vorpal.js b/lib/vorpal.js index 4a4d2259..f1510407 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,5 +1,4 @@ -'use strict'; - +const CommandInstance = require('./command-instance'); /** * Module dependencies. */ @@ -7,7 +6,6 @@ var _ = require('lodash'); var EventEmitter = require('events').EventEmitter; var Command = require('./command'); -var CommandInstance = require('./command-instance'); var VorpalUtil = require('./util'); var ui = require('./ui'); var Session = require('./session'); From b1943cbe5d6393f35dbd3a098abfdbbd7f735d00 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Sat, 27 May 2017 17:02:35 -0700 Subject: [PATCH 13/38] Updated to use require(). --- lib/command-instance.js | 8 ++++---- lib/session.js | 3 +-- package.json | 6 +++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/command-instance.js b/lib/command-instance.js index b2e5b08b..b73e9fe5 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -1,6 +1,6 @@ -import util from './util'; +const util = require('./util'); -export default class CommandInstance { +class CommandInstance { constructor(options = {}) { const { command, commandObject, args, commandWrapper, callback, downstream } = options; @@ -48,7 +48,6 @@ export default class CommandInstance { this.session.completeCommand(); }; - // eslint-disable-next-line no-underscore-dangle const validate = this.downstream.commandObject._validate; if (typeof validate === 'function') { @@ -63,7 +62,6 @@ export default class CommandInstance { } } - // eslint-disable-next-line no-underscore-dangle const callback = this.downstream.commandObject._fn; if (callback) { @@ -91,3 +89,5 @@ export default class CommandInstance { return this.session.match(a, b, c); } } + +module.exports = CommandInstance; diff --git a/lib/session.js b/lib/session.js index b9019478..1222bfdd 100755 --- a/lib/session.js +++ b/lib/session.js @@ -1,5 +1,4 @@ -'use strict'; -import CommandInstance from './command-instance'; +const CommandInstance = require('./command-instance'); /** * Module dependencies. diff --git a/package.json b/package.json index ac831b21..fa195ec5 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "./lib/vorpal.js", "scripts": { "lint": "run-linter ./lib", + "lint:only": "run-linter", "test": "mocha" }, "repository": { @@ -55,6 +56,9 @@ "npm": ">=3.10.0" }, "eslintConfig": { - "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5" + "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5", + "rules": { + "no-underscore-dangle": 0 + } } } From 0793eb662895feed4e16f961bc89c462e79c44d2 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Sat, 27 May 2017 17:40:51 -0700 Subject: [PATCH 14/38] Convert Command to ES2015. --- CHANGELOG.md | 1 + lib/command.js | 368 +++++++++++++-------------------------- lib/helpers/camelCase.js | 5 + package.json | 9 +- 4 files changed, 139 insertions(+), 244 deletions(-) create mode 100644 lib/helpers/camelCase.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 680b6248..e834754e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ #### 💥 Breaking * Updated minimum Node.js requirement to v6.10 (oldest LTS). * Updated Inquirer.js to v3 from v0.11. +* Removed `Command#autocompletion` method. #### 🚀 New * Added `Vorpal#title`, `Vorpal#version`, `Vorpal#description`, and `Vorpal#banner` descriptor methods. diff --git a/lib/command.js b/lib/command.js index e05381d1..5c427c1e 100755 --- a/lib/command.js +++ b/lib/command.js @@ -1,64 +1,37 @@ -'use strict'; - -/** - * Module dependencies. - */ const { EventEmitter } = require('events'); const Option = require('./option'); const VorpalUtil = require('./util'); -const _ = require('lodash'); - -/** - * Converts string to camel case. - * - * @param {String} flag - * @return {String} - * @api private - */ -function _camelcase(flag) { - return flag.split('-').reduce(function (str, word) { - return str + word[0].toUpperCase() + word.slice(1); - }); -} +const camelCase = require('./helpers/camelCase'); + +const VARIADIC_LENGTH = 3; class Command extends EventEmitter { constructor(name, parent) { - super(...arguments); - - if (!(this instanceof Command)) { - return new Command(); - } + super(); this.commands = []; this.options = []; - this._args = []; + this._after = undefined; this._aliases = []; - this._name = name; - this._relay = false; - this._hidden = false; - this._parent = parent; - this._mode = false; + this._allowUnknownOptions = false; + this._args = []; this._catch = false; this._help = undefined; + this._hidden = false; this._init = undefined; - this._after = undefined; - this._allowUnknownOptions = false; + this._mode = false; + this._name = name; + this._parent = parent; + this._relay = false; + this._types = {}; } /** * Registers an option for given command. - * - * @param {String} flags - * @param {String} description - * @param {Function} fn - * @param {String} defaultValue - * @return {Command} - * @api public */ option(flags, description, options = {}) { const option = new Option(flags, description, options); - const oname = option.name(); - const name = _camelcase(oname); + const name = camelCase(option.name()); let defaultValue; // preassign default value only for --no-*, [optional], or @@ -67,8 +40,9 @@ class Command extends EventEmitter { if (option.bool === false) { defaultValue = true; } + // preassign only if we have a default - if (defaultValue !== undefined) { + if (typeof defaultValue !== 'undefined') { this[name] = defaultValue; } } @@ -76,47 +50,32 @@ class Command extends EventEmitter { // register the option this.options.push(option); - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, (val) => { - // unassigned or bool + // when it's passed, assign the value and conditionally invoke the callback + this.on(option.name(), (value) => { if (typeof this[name] === 'boolean' || typeof this[name] === 'undefined') { // if no value, bool true, and we have a default, then use it! - if (val === null) { - this[name] = option.bool ? - defaultValue || true : - false; + if (value === null) { + this[name] = option.bool ? (defaultValue || true) : false; } else { - this[name] = val; + this[name] = value; } - } else if (val !== null) { - // reassign - this[name] = val; + } else if (value !== null) { + this[name] = value; } }); return this; } - - /** - * Let's you compose other funtions to extend the command. - * - * @param {Function} fn - * @return {Command} - * @api public - */ - use(fn) { - return fn(this); - } - + /** + * Let's you compose other funtions to extend the command. + */ + use(fn) { + return fn(this); + } /** * Defines an action for a given command. - * - * @param {Function} fn - * @return {Command} - * @api public */ action(fn) { this._fn = fn; @@ -129,39 +88,30 @@ class Command extends EventEmitter { * before action is performed. Arguments * are valid if no errors are thrown from * the function. - * - * @param fn - * @returns {Command} - * @api public */ validate(fn) { this._validate = fn; + return this; } /** * Defines a function to be called when the * command is canceled. - * - * @param fn - * @returns {Command} - * @api public */ cancel(fn) { this._cancel = fn; + return this; } /** * Defines a method to be called when * the command set has completed. - * - * @param {Function} fn - * @return {Command} - * @api public */ done(fn) { this._done = fn; + return this; } @@ -169,189 +119,152 @@ class Command extends EventEmitter { * Defines tabbed auto-completion * for the given command. Favored over * deprecated command.autocompletion. - * - * @param {Function} fn - * @return {Command} - * @api public */ autocomplete(obj) { this._autocomplete = obj; + return this; } /** * Defines tabbed auto-completion rules * for the given command. - * - * @param {Function} fn - * @return {Command} - * @api public */ autocompletion(param) { this._parent._useDeprecatedAutocompletion = true; - if (!_.isFunction(param) && !_.isObject(param)) { - throw new Error('An invalid object type was passed into the first parameter of command.autocompletion: function expected.'); + + if (typeof param !== 'function') { + throw new Error('An invalid object type was passed into the first parameter of Command#autocompletion: function expected.'); } this._autocompletion = param; + return this; } /** * Defines an init action for a mode command. - * - * @param {Function} fn - * @return {Command} - * @api public */ - init(fn) { if (this._mode !== true) { throw Error('Cannot call init from a non-mode action.'); } + this._init = fn; + return this; } /** * Defines a prompt delimiter for a * mode once entered. - * - * @param {String} delimiter - * @return {Command} - * @api public */ delimiter(delimiter) { this._delimiter = delimiter; + return this; } /** * Sets args for static typing of options * using minimist. - * - * @param {Object} types - * @return {Command} - * @api public */ types(types) { const supported = ['string', 'boolean']; - for (let item in types) { - if (supported.indexOf(item) === -1) { - throw new Error('An invalid type was passed into command.types(): ' + item); + Object.keys(types).forEach((item) => { + if (!supported.includes(item)) { + throw new Error(`An invalid type was passed into Command#types(): ${item}`); } - types[item] = (!_.isArray(types[item])) ? [types[item]] : types[item]; - } - this._types = types; + + this._types[item] = Array.isArray(types[item]) ? types[item] : [types[item]]; + }); + return this; } /** * Defines an alias for a given command. - * - * @param {String} alias - * @return {Command} - * @api public */ - alias() { - for (let i = 0; i < arguments.length; ++i) { - const alias = arguments[i]; + alias(...aliases) { + aliases.forEach((alias) => { + if (Array.isArray(alias)) { + this.alias(...alias); - if (_.isArray(alias)) { - for (var j = 0; j < alias.length; ++j) { - this.alias(alias[j]); - } - return this; + return; } - this._parent.commands.forEach(function (cmd) { - if (!_.isEmpty(cmd._aliases)) { - if (_.includes(cmd._aliases, alias)) { - const msg = `Duplicate alias "${alias}" for command "${this._name}" detected. Was first reserved by command "${cmd._name}".`; - throw new Error(msg); - } + this._parent.commands.forEach((command) => { + if (command._aliases.includes(alias)) { + throw new Error( + `Duplicate alias "${alias}" for command "${this._name}" detected. ` + + `Was first reserved by command "${command._name}".` + ); } }); this._aliases.push(alias); - } + }); return this; } /** * Defines description for given command. - * - * @param {String} str - * @return {Command} - * @api public */ - description(str) { - const isGetter = arguments.length === 0; - - if (!isGetter) { - this._description = str; + description(desc) { + if (!desc) { + return this._description; } - return isGetter ? this._description : this; + this._description = desc; + + return this; } /** * Removes self from Vorpal instance. - * - * @return {Command} - * @api public */ - remove() { - this._parent.commands = _.reject(this._parent.commands, (command) => { - return command._name === this._name; - }); + this._parent.commands = this._parent.commands.filter(command => ( + command._name !== this._name + )); return this; } /** * Returns the commands arguments as string. - * - * @param {String} desc - * @return {String} - * @api public */ - arguments(desc) { return this._parseExpectedArgs(desc.split(/ +/)); } /** * Returns the help info for given command. - * - * @return {String} - * @api public */ - helpInformation() { let desc = []; - const cmdName = this._name; let alias = ''; if (this._description) { desc = [ - ' ' + this._description, - '' + ` ${this._description}`, + '', ]; } - if (this._aliases.length > 0) { - alias = ' Alias: ' + this._aliases.join(' | ') + '\n'; + if (this._aliases.length) { + alias = ` Alias: ${this._aliases.join(' | ')}\n`; } + const usage = [ '', - ' Usage: ' + cmdName + ' ' + this.usage(), - '' + ` Usage: ${this._name} ${this.usage()}`, + '', ]; + // TODO const cmds = []; const help = String(this.optionHelp().replace(/^/gm, ' ')); @@ -359,161 +272,128 @@ class Command extends EventEmitter { ' Options:', '', help, - '' + '', ]; - let res = usage + return usage .concat(cmds) .concat(alias) .concat(desc) .concat(options) - .join('\n'); - - res = res.replace(/\n\n\n/g, '\n\n'); - - return res; + .join('\n') + .replace(/\n\n\n/g, '\n\n'); } /** * Doesn't show command in the help menu. - * - * @return {Command} - * @api public */ - hidden() { this._hidden = true; + return this; } /** * Allows undeclared options to be passed in with the command. - * - * @param {Boolean} [allowUnknownOptions=true] - * @return {Command} - * @api public */ - allowUnknownOptions(allowUnknownOptions = true) { - allowUnknownOptions = allowUnknownOptions === 'false' ? false : allowUnknownOptions; + allowUnknownOptions(allow = true) { + this._allowUnknownOptions = allow; - this._allowUnknownOptions = !!allowUnknownOptions; return this; } /** * Returns the command usage string for help. - * - * @param {String} str - * @return {String} - * @api public */ - usage(str) { - const args = this._args.map((arg) => { - return VorpalUtil.humanReadableArgName(arg); - }); - - const usage = '[options]' + - (this.commands.length ? ' [command]' : '') + - (this._args.length ? ' ' + args.join(' ') : ''); - - const isGetter = arguments.length === 0; - - if (!isGetter) { - this._usage = str; + usage(usage) { + if (!usage) { + const args = this._args.map(arg => VorpalUtil.humanReadableArgName(arg)); + + return this._usage || [ + '[options]', + this.commands.length ? '[command]' : '', + this._args.length ? args.join(' ') : '', + ].join(' '); } - return isGetter ? (this._usage || usage) : this; + this._usage = usage; + + return this; } /** * Returns the help string for the command's options. - * - * @return {String} - * @api public */ optionHelp() { const width = this._largestOptionLength(); // Prepend the help information - return [VorpalUtil.pad('--help', width) + ' output usage information'] - .concat(this.options.map((option) => { - return VorpalUtil.pad(option.flags, width) + ' ' + option.description; - })) + return [`${VorpalUtil.pad('--help', width)} output usage information`] + .concat(this.options.map(option => ( + `${VorpalUtil.pad(option.flags, width)} ${option.description}` + ))) .join('\n'); } /** * Returns the length of the longest option. - * - * @return {Integer} - * @api private */ _largestOptionLength() { - return this.options.reduce((max, option) => { - return Math.max(max, option.flags.length); - }, 0); + return this.options.reduce((max, option) => Math.max(max, option.flags.length), 0); } /** * Adds a custom handling for the --help flag. - * - * @param {Function} fn - * @return {Command} - * @api public */ help(fn) { - if (_.isFunction(fn)) { + if (typeof fn === 'function') { this._help = fn; + } else { + throw new Error('A function is required for Command#help.'); } + return this; } /** - * Edits the raw command string before it - * is executed. - * - * @param {String} str - * @return {String} str - * @api public + * Edits the raw command string before it is executed. */ parse(fn) { - if (_.isFunction(fn)) { + if (typeof fn === 'function') { this._parse = fn; + } else { + throw new Error('A function is required for Command#parse.'); } + return this; } /** * Adds a command to be executed after command completion. - * - * @param {Function} fn - * @return {Command} - * @api public */ after(fn) { - if (_.isFunction(fn)) { + if (typeof fn === 'function') { this._after = fn; + } else { + throw new Error('A function is required for Command#after.'); } + return this; } /** * Parses and returns expected command arguments. - * - * @param {String} args - * @return {Array} - * @api private */ _parseExpectedArgs(args) { - if (!args.length) { + if (!args || !args.length) { return; } args.forEach((arg) => { const argDetails = { - required: false, name: '', - variadic: false + required: false, + variadic: false, }; switch (arg[0]) { @@ -528,17 +408,20 @@ class Command extends EventEmitter { break; } - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { + if ( + argDetails.name.length > VARIADIC_LENGTH && + argDetails.name.slice(-VARIADIC_LENGTH) === '...' + ) { argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); + argDetails.name = argDetails.name.slice(0, -VARIADIC_LENGTH); } + if (argDetails.name) { this._args.push(argDetails); } }); - // If the user entered args in a weird order, - // properly sequence them. + // If the user entered args in a weird order, properly sequence them if (this._args.length > 1) { this._args = this._args.sort((argu1, argu2) => { if (argu1.required && !argu2.required) { @@ -550,12 +433,11 @@ class Command extends EventEmitter { } else if (argu2.variadic && !argu1.variadic) { return -1; } + return 0; }); } - - return; } -}; +} module.exports = Command; diff --git a/lib/helpers/camelCase.js b/lib/helpers/camelCase.js new file mode 100644 index 00000000..214a15ac --- /dev/null +++ b/lib/helpers/camelCase.js @@ -0,0 +1,5 @@ +function camelCase(string) { + return string.split('-').reduce((str, word) => str + word[0].toUpperCase() + word.slice(1)); +} + +module.exports = camelCase; diff --git a/package.json b/package.json index fa195ec5..f410e542 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,14 @@ "eslintConfig": { "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5", "rules": { - "no-underscore-dangle": 0 + "comma-dangle": ["error", { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "never", + "exports": "never", + "functions": "never" + }], + "no-underscore-dangle": "off" } } } From c68597ab0d5ceecd40122db2dbcac03bb39430e7 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Sat, 27 May 2017 23:07:07 -0700 Subject: [PATCH 15/38] Converted UI to ES2015. --- lib/ui.js | 417 ++++++++++++++++++++++++------------------------------ 1 file changed, 187 insertions(+), 230 deletions(-) diff --git a/lib/ui.js b/lib/ui.js index 18fc9e3b..1c7d2e59 100755 --- a/lib/ui.js +++ b/lib/ui.js @@ -1,30 +1,22 @@ -'use strict'; +/* eslint-disable no-console, no-param-reassign */ -/** - * Module dependencies. - */ - -const _ = require('lodash'); -const inquirer = require('inquirer'); -const EventEmitter = require('events').EventEmitter; +const { EventEmitter } = require('events'); const chalk = require('chalk'); -const util = require('./util'); +const inquirer = require('inquirer'); const logUpdate = require('log-update'); +const util = require('./util'); -class UI extends EventEmitter { +const INQUIRER_PROMPTS = ['input', 'checkbox', 'confirm', 'expand', 'list', 'password', 'rawlist']; +class UI extends EventEmitter { /** * Sets intial variables and registers * listeners. This is called once in a * process thread regardless of how many * instances of Vorpal have been generated. - * - * @api private */ - constructor() { super(); - const self = this; // Attached vorpal instance. The UI can // only attach to one instance of Vorpal @@ -58,38 +50,44 @@ class UI extends EventEmitter { if (this._sigintCount > 1) { this.parent.emit('vorpal_exit'); process.exit(0); + } + + // If Vorpal isn't shown, just exit. + if (!this.parent) { + process.exit(0); + } + + const text = this.input(); + + // There are commands running if cancelCommands function is available. + if (this.parent.session.cancelCommands) { + this.imprint(); + this.submit(''); + this._sigintCalled = false; + this._sigintCount = 0; + this.parent.session.emit('vorpal_command_cancel'); + + } else if (String(text).trim()) { + this.imprint(); + this.submit(''); + this._sigintCalled = false; + this._sigintCount = 0; + } else { - const text = this.input(); - if (!this.parent) { - // If Vorpal isn't shown, just exit. - process.exit(0); - } else if (this.parent.session.cancelCommands) { - // There are commands running if - // cancelCommands function is available. - this.imprint(); - this.submit(''); - this._sigintCalled = false; - this._sigintCount = 0; - this.parent.session.emit('vorpal_command_cancel'); - } else if (String(text).trim() !== '') { - this.imprint(); - this.submit(''); - this._sigintCalled = false; - this._sigintCount = 0; - } else { - this._sigintCalled = false; - this.delimiter(' '); - this.submit(''); - this.log('(^C again to quit)'); - } + this._sigintCalled = false; + this.delimiter(' '); + this.submit(''); + this.log('(^C again to quit)'); } }; - process.stdin.on('keypress', (letter, key) => { - key = key || {}; - if (key.ctrl === true && key.shift === false && key.meta === false && ['c', 'C'].indexOf(key.name) > -1) { - this._sigintCount++; - if (this._sigint !== undefined && !this._sigintCalled) { + const self = this; + + process.stdin.on('keypress', (letter, key = {}) => { + if (key.ctrl && !key.shift && !key.meta && ['c', 'C'].indexOf(key.name) > -1) { + this._sigintCount += 1; + + if (this._sigint && !this._sigintCalled) { this._sigintCalled = true; this._sigint.call(self.parent); this._sigintCalled = false; @@ -102,18 +100,14 @@ class UI extends EventEmitter { // Extend the render function to steal the active prompt object, // as inquirer doesn't expose it and we need it. - const prompts = ['input', 'checkbox', 'confirm', 'expand', 'list', 'password', 'rawlist']; - - for (const key in prompts) { - const promptType = prompts[key]; - + INQUIRER_PROMPTS.forEach((promptType) => { // Add method to Inquirer to get type of prompt. - inquirer.prompt.prompts[promptType].prototype.getType = function () { + inquirer.prompt.prompts[promptType].prototype.getType = function getType() { return promptType; }; // Hook in to steal Inquirer's keypress. - inquirer.prompt.prompts[promptType].prototype.onKeypress = function (e) { + inquirer.prompt.prompts[promptType].prototype.onKeypress = function onKeypress(e) { // Inquirer seems to have a bug with release v0.10.1 // (not 0.10.0 though) that triggers keypresses for // the previous prompt in addition to the current one. @@ -121,129 +115,124 @@ class UI extends EventEmitter { if (this.status && this.status === 'answered') { return; } + self._activePrompt = this; self.parent.emit('client_keypress', e); self._keypressHandler(e, this); }; - // Add hook to render method. - const render = inquirer.prompt.prompts[promptType].prototype.render; - inquirer.prompt.prompts[promptType].prototype.render = function () { + // Add hook to render method + const baseRender = inquirer.prompt.prompts[promptType].prototype.render; + + inquirer.prompt.prompts[promptType].prototype.render = function render(...args) { self._activePrompt = this; - return render.apply(this, arguments); + + return baseRender.apply(this, args); }; - } + }); - // Sigint handling - make it more graceful. + // Sigint handling - make it more graceful const onSigInt = () => { - if (_.isFunction(this._sigint) && !this._sigintCalled) { + if (typeof this._sigint === 'function' && !this._sigintCalled) { this._sigintCalled = true; this._sigint.call(this.parent); } }; + process.on('SIGINT', onSigInt); process.on('SIGTERM', onSigInt); } /** * Hook for sigint event. - * - * @param {Object} options - * @param {Function} cb - * @api public */ - sigint(fn) { - if (_.isFunction(fn)) { + if (typeof fn === 'function') { this._sigint = fn; } else { - throw new Error('vorpal.ui.sigint must be passed in a valid function.'); + throw new Error('UI#sigint must be passed a valid function.'); } + return this; } /** * Creates an inquirer prompt on the TTY. - * - * @param {Object} options - * @param {Function} cb - * @api public */ - - prompt(options, cb) { + prompt(options = {}, cb = null) { let prompt; - options = options || {}; + if (!this.parent) { return prompt; } + if (options.delimiter) { this.setDelimiter(options.delimiter); } + if (options.message) { this.setDelimiter(options.message); } + if (this._midPrompt) { - console.log('Prompt called when mid prompt...'); - throw new Error('UI Prompt called when already mid prompt.'); + throw new Error('UI prompt called when already in a prompt.'); } + this._midPrompt = true; + try { prompt = inquirer.prompt(options).then((result) => { this.inquirerStdout = []; this._midPrompt = false; - if (this._cancel === true) { + + if (this._cancel) { this._cancel = false; } else { cb(result); } }); - - // Temporary hack. We need to pull the active - // prompt from inquirer as soon as possible, - // however we can't just assign it sync, as - // the prompt isn't ready yet. - // I am trying to get inquirer extended to - // fire an event instead. - setTimeout(() => { - // this._activePrompt = prompt._activePrompt; - }, 100); } catch (e) { - console.log('Vorpal Prompt error:', e); + console.log('Vorpal prompt error:', e); } + return prompt; } /** * Returns a boolean as to whether user - * is mid another pr ompt. - * - * @return {Boolean} - * @api public + * is mid another prompt. */ - midPrompt() { - const mid = (this._midPrompt === true && this.parent !== undefined); - return mid; + return (this._midPrompt && this.parent); } - setDelimiter(str) { - const self = this; + setDelimiter(value) { if (!this.parent) { return; } - str = String(str).trim() + ' '; - this._lastDelimiter = str; - inquirer.prompt.prompts.password.prototype.getQuestion = function () { + + const self = this; + const delimiter = String(value).trim(); + + this._lastDelimiter = `${delimiter} `; + + inquirer.prompt.prompts.password.prototype.getQuestion = function getPasswordQuestion() { self._activePrompt = this; + return this.opt.message; }; - inquirer.prompt.prompts.input.prototype.getQuestion = function () { + + inquirer.prompt.prompts.input.prototype.getQuestion = function getInputQuestion() { self._activePrompt = this; - let message = this.opt.message; + + let { message } = this.opt; + if ((this.opt.default || this.opt.default === false) && this.status !== 'answered') { - message += chalk.dim('(' + this.opt.default + ') '); + message += chalk.dim(`(${this.opt.default}) `); } + self.inquirerStdout.push(message); + return message; }; } @@ -251,64 +240,63 @@ class UI extends EventEmitter { /** * Event handler for keypresses - deals with command history * and tabbed auto-completion. - * - * @param {Event} e - * @param {Prompt} prompt - * @api private */ - _keypressHandler(e, prompt) { - // Remove tab characters from user input. + // Remove tab characters from user input prompt.rl.line = prompt.rl.line.replace(/\t+/, ''); - // Mask passwords. - const line = prompt.getType() !== 'password' ? - prompt.rl.line : - '*'.repeat(prompt.rl.line.length); + // Mask passwords + const line = (prompt.getType() === 'password') + ? '*'.repeat(prompt.rl.line.length) + : prompt.rl.line; - // Re-write render function. + // Re-write render function const width = prompt.rl.line.length; const newWidth = prompt.rl.line.length; const diff = newWidth - width; + prompt.rl.cursor += diff; - let message = prompt.getQuestion(); - const addition = (prompt.status === 'answered') ? + + const message = prompt.getQuestion() + (prompt.status === 'answered') ? chalk.cyan(prompt.answer) : line; - message += addition; + prompt.screen.render(message); const key = (e.key || {}).name; - const value = (prompt) ? String(line) : undefined; - this.emit('vorpal_ui_keypress', {key: key, value: value, e: e}); + const value = prompt ? String(line) : undefined; + + this.emit('vorpal_ui_keypress', { key, value, e }); } /** * Pauses active prompt, returning * the value of what had been typed so far. - * - * @return {String} val - * @api public */ - pause() { if (!this.parent) { return false; } + if (!this._activePrompt) { return false; } + if (!this._midPrompt) { return false; } - const val = this._lastDelimiter + this._activePrompt.rl.line; + + const value = this._lastDelimiter + this._activePrompt.rl.line; + this._midPrompt = false; - const rl = this._activePrompt.screen.rl; - const screen = this._activePrompt.screen; - rl.output.unmute(); + + const { screen } = this._activePrompt.screen; + + screen.rl.output.unmute(); screen.clean(); - rl.output.write(''); - return val; + screen.rl.output.write(''); + + return value; } /** @@ -316,71 +304,60 @@ class UI extends EventEmitter { * a string, which will fill the prompt * with that text and put the cursor at * the end. - * - * @param {String} val - * @api public */ - resume(val) { if (!this.parent) { return this; } - val = val || ''; + if (!this._activePrompt) { return this; } + if (this._midPrompt) { return this; } - const rl = this._activePrompt.screen.rl; - rl.output.write(val); + + this._activePrompt.screen.rl.output.write(val || ''); this._midPrompt = true; + return this; } /** * Cancels the active prompt, essentially * but cutting out of the inquirer loop. - * - * @api public */ - cancel() { if (this.midPrompt()) { this._cancel = true; this.submit(''); this._midPrompt = false; } + return this; } /** * Attaches TTY prompt to a given Vorpal instance. - * - * @param {Vorpal} vorpal - * @return {UI} - * @api public */ - attach(vorpal) { this.parent = vorpal; this.refresh(); this.parent._prompt(); + return this; } /** * Detaches UI from a given Vorpal instance. - * - * @param {Vorpal} vorpal - * @return {UI} - * @api public */ detach(vorpal) { if (vorpal === this.parent) { - this.parent = undefined; + this.parent = null; } + return this; } @@ -390,42 +367,36 @@ class UI extends EventEmitter { * through ui.pipe(). Pauses any active * prompts, logs the data and then if * paused, resumes the prompt. - * - * @return {UI} - * @api public */ + log(...params) { + let args = util.fixArgsForApply(params); + + args = (typeof this._pipeFn === 'function') + ? this._pipeFn(args) + : args; - log() { - let args = util.fixArgsForApply(arguments); - args = (_.isFunction(this._pipeFn)) ? - this._pipeFn(args) : - args; if (args === '') { return this; } + args = util.fixArgsForApply(args); + if (this.midPrompt()) { const data = this.pause(); - console.log.apply(console.log, args); - if (typeof data !== 'undefined' && data !== false) { + + if (data) { this.resume(data); } else { console.log('Log got back \'false\' as data. This shouldn\'t happen.', data); } - } else { - console.log.apply(console.log, args); } + return this; } /** * Submits a given prompt. - * - * @param {String} value - * @return {UI} - * @api public */ - submit() { if (this._activePrompt) { // this._activePrompt.screen.onClose(); @@ -433,28 +404,28 @@ class UI extends EventEmitter { // this._activePrompt.onEnd({isValid: true, value: value}); // to do - I don't know a good way to do this. } + return this; } /** * Does a literal, one-time write to the * *current* prompt delimiter. - * - * @param {String} str - * @return {UI} - * @api public */ - - delimiter(str) { + delimiter(delimiter) { if (!this._activePrompt) { return this; } + const prompt = this._activePrompt; - if (str === undefined) { + + if (!delimiter) { return prompt.opt.message; } - prompt.opt.message = str; + + prompt.opt.message = delimiter; this.refresh(); + return this; } @@ -462,114 +433,97 @@ class UI extends EventEmitter { * Re-writes the input of an Inquirer prompt. * If no string is passed, it gets the current * input. - * - * @param {String} str - * @return {String} - * @api public */ - - input(str) { + input(input) { if (!this._activePrompt) { - return undefined; + return ''; } + const prompt = this._activePrompt; - if (str === undefined) { + + if (!input) { return prompt.rl.line; } + const width = prompt.rl.line.length; - prompt.rl.line = str; + + prompt.rl.line = input; + const newWidth = prompt.rl.line.length; const diff = newWidth - width; + prompt.rl.cursor += diff; - let message = prompt.getQuestion(); - const addition = (prompt.status === 'answered') ? - chalk.cyan(prompt.answer) : - prompt.rl.line; - message += addition; + + const message = prompt.getQuestion() + (prompt.status === 'answered') + ? chalk.cyan(prompt.answer) + : prompt.rl.line; + prompt.screen.render(message); + return this; } /** * Logs the current delimiter and typed data. - * - * @return {UI} - * @api public */ - imprint() { if (!this.parent) { return this; } - const val = this._activePrompt.rl.line; + const delimiter = this._lastDelimiter || this.delimiter() || ''; - this.log(delimiter + val); + + this.log(delimiter + this._activePrompt.rl.line); + return this; } /** * Redraws the inquirer prompt with a new string. - * - * @param {String} str - * @return {UI} - * @api private */ - refresh() { if (!this.parent || !this._activePrompt) { return this; } + this._activePrompt.screen.clean(); this._activePrompt.render(); this._activePrompt.rl.output.write(this._activePrompt.rl.line); + return this; } /** * Writes over existing logging. - * - * @param {String} str - * @return {UI} - * @api public */ + redraw(output) { + logUpdate(output); - redraw(str) { - logUpdate(str); return this; } - } /** * Initialize singleton. */ - const ui = new UI(); /** - * Clears logging from `ui.redraw` - * permanently. - * - * @return {UI} - * @api public + * Clears logging from `ui.redraw` permanently. */ - -ui.redraw.clear = function () { +ui.redraw.clear = function clear() { logUpdate.clear(); + return ui; }; /** - * Prints logging from `ui.redraw` - * permanently. - * - * @return {UI} - * @api public + * Prints logging from `ui.redraw` permanently. */ - -ui.redraw.done = function () { +ui.redraw.done = function done() { logUpdate.done(); ui.refresh(); + return ui; }; @@ -591,16 +545,19 @@ ui.redraw.done = function () { * total mess. So forgive me. */ -global.__vorpal = global.__vorpal || {}; -global.__vorpal.ui = global.__vorpal.ui || { - exists: false, - exports: undefined -}; - -if (!global.__vorpal.ui.exists) { - global.__vorpal.ui.exists = true; - global.__vorpal.ui.exports = ui; - module.exports = exports = global.__vorpal.ui.exports; -} else { - module.exports = global.__vorpal.ui.exports; -} +// TODO investigate +// global.__vorpal = global.__vorpal || {}; +// global.__vorpal.ui = global.__vorpal.ui || { +// exists: false, +// exports: undefined +// }; +// +// if (!global.__vorpal.ui.exists) { +// global.__vorpal.ui.exists = true; +// global.__vorpal.ui.exports = ui; +// module.exports = exports = global.__vorpal.ui.exports; +// } else { +// module.exports = global.__vorpal.ui.exports; +// } + +module.exports = ui; From 3b2a94f6b1bce73739a081bc2589ac894f2ae2ca Mon Sep 17 00:00:00 2001 From: Nathan Schwartz Date: Sat, 27 May 2017 13:43:29 -0500 Subject: [PATCH 16/38] Update lib/history.js to ES2015 --- lib/history.js | 334 ++++++++++++++++++++++++------------------------- 1 file changed, 167 insertions(+), 167 deletions(-) diff --git a/lib/history.js b/lib/history.js index 0cdb2409..ea10879e 100755 --- a/lib/history.js +++ b/lib/history.js @@ -1,190 +1,190 @@ -'use strict'; - -var _ = require('lodash'); -var LocalStorage = require('node-localstorage').LocalStorage; -var path = require('path'); +const { LocalStorage } = require('node-localstorage'); +const path = require('path'); const os = require('os'); // Number of command histories kept in persistent storage -var HISTORY_SIZE = 500; +const HISTORY_SIZE = 500; const temp = path.normalize(path.join(os.tmpdir(), '/.local_storage')); const DEFAULT_STORAGE_PATH = temp; -var History = function () { - this._storageKey = undefined; - - // Prompt Command History - // Histctr moves based on number of times 'up' (+= ctr) - // or 'down' (-= ctr) was pressed in traversing - // command history. - this._hist = []; - this._histCtr = 0; - - // When in a 'mode', we reset the - // history and store it in a cache until - // exiting the 'mode', at which point we - // resume the original history. - this._histCache = []; - this._histCtrCache = 0; -}; - -/** - * Initialize the history with local storage data - * Called from setId when history id is set - */ - -History.prototype._init = function () { - if (!this._storageKey) { - return; +class History { + constructor() { + this._storageKey = undefined; + + // Prompt Command History + // Histctr moves based on number of times 'up' (+= ctr) + // or 'down' (-= ctr) was pressed in traversing + // command history. + this._hist = []; + this._histCtr = 0; + + // When in a 'mode', we reset the + // history and store it in a cache until + // exiting the 'mode', at which point we + // resume the original history. + this._histCache = []; + this._histCtrCache = 0; } - // Load history from local storage - var persistedHistory = JSON.parse(this._localStorage.getItem(this._storageKey)); - if (_.isArray(persistedHistory)) { - Array.prototype.push.apply(this._hist, persistedHistory); + /** + * Initialize the history with local storage data + * Called from setId when history id is set + */ + + _init() { + if (!this._storageKey) { + return; + } + + // Load history from local storage + const persistedHistory = JSON.parse(this._localStorage.getItem(this._storageKey)); + if (Array.isArray(persistedHistory)) { + this._hist.push(...persistedHistory); + } } -}; - -/** - * Set id for this history instance. - * Calls init internally to initialize - * the history with the id. - */ - -History.prototype.setId = function (id) { - // Initialize a localStorage instance with default - // path if it is not initialized - if (!this._localStorage) { - this._localStorage = new LocalStorage(DEFAULT_STORAGE_PATH); + + /** + * Set id for this history instance. + * Calls init internally to initialize + * the history with the id. + */ + + setId(id) { + // Initialize a localStorage instance with default + // path if it is not initialized + if (!this._localStorage) { + this._localStorage = new LocalStorage(DEFAULT_STORAGE_PATH); + } + this._storageKey = `cmd_history_${id}`; + this._init(); } - this._storageKey = 'cmd_history_' + id; - this._init(); -}; - -/** - * Initialize a local storage instance with - * the path if not already initialized. - * - * @param path - */ - -History.prototype.setStoragePath = function (path) { - if (!this._localStorage) { - this._localStorage = new LocalStorage(path); + + /** + * Initialize a local storage instance with + * the path if not already initialized. + * + * @param path + */ + + setStoragePath(path) { + if (!this._localStorage) { + this._localStorage = new LocalStorage(path); + } } -}; - -/** - * Get previous history. Called when up is pressed. - * - * @return {String} - */ - -History.prototype.getPreviousHistory = function () { - this._histCtr++; - this._histCtr = (this._histCtr > this._hist.length) ? - this._hist.length : - this._histCtr; - return this._hist[this._hist.length - (this._histCtr)]; -}; - -/** - * Get next history. Called when down is pressed. - * - * @return {String} - */ - -History.prototype.getNextHistory = function () { - this._histCtr--; - - // Return empty prompt if the we dont have any history to show - if (this._histCtr < 1) { - this._histCtr = 0; - return ''; + + /** + * Get previous history. Called when up is pressed. + * + * @return {String} + */ + + getPreviousHistory() { + this._histCtr += 1; + this._histCtr = (this._histCtr > this._hist.length) ? + this._hist.length : + this._histCtr; + + return this._hist[this._hist.length - (this._histCtr)]; } - return this._hist[this._hist.length - this._histCtr]; -}; - -/** - * Peek into history, without changing state - * - * @return {String} - */ - -History.prototype.peek = function (depth) { - depth = depth || 0; - return this._hist[this._hist.length - 1 - depth]; -}; - -/** - * A new command was submitted. Called when enter is pressed and the prompt is not empty. - * - * @param cmd - */ - -History.prototype.newCommand = function (cmd) { - // Always reset history when new command is executed. - this._histCtr = 0; - - // Don't store command in history if it's a duplicate. - if (this._hist[this._hist.length - 1] === cmd) { - return; + /** + * Get next history. Called when down is pressed. + * + * @return {String} + */ + + getNextHistory() { + this._histCtr -= 1; + + // Return empty prompt if the we dont have any history to show + if (this._histCtr < 1) { + this._histCtr = 0; + + return ''; + } + + return this._hist[this._hist.length - this._histCtr]; + } + + /** + * Peek into history, without changing state + * + * @return {String} + */ + + peek(depth = 0) { + return this._hist[this._hist.length - 1 - depth]; } - // Push into history. - this._hist.push(cmd); + /** + * A new command was submitted. Called when enter is pressed and the prompt is not empty. + * + * @param cmd + */ - // Only persist history when not in mode - if (this._storageKey && !this._inMode) { - var persistedHistory = this._hist; - var historyLen = this._hist.length; - if (historyLen > HISTORY_SIZE) { - persistedHistory = this._hist.slice(historyLen - HISTORY_SIZE - 1, historyLen - 1); + newCommand(cmd) { + // Always reset history when new command is executed. + this._histCtr = 0; + + // Don't store command in history if it's a duplicate. + if (this._hist[this._hist.length - 1] === cmd) { + return; } - // Add to local storage - this._localStorage.setItem(this._storageKey, JSON.stringify(persistedHistory)); + // Push into history. + this._hist.push(cmd); + + // Only persist history when not in mode + if (this._storageKey && !this._inMode) { + let persistedHistory = this._hist; + const historyLen = this._hist.length; + if (historyLen > HISTORY_SIZE) { + persistedHistory = this._hist.slice(historyLen - HISTORY_SIZE - 1, historyLen - 1); + } + + // Add to local storage + this._localStorage.setItem(this._storageKey, JSON.stringify(persistedHistory)); + } } -}; - -/** - * Called when entering a mode - */ - -History.prototype.enterMode = function () { - // Reassign the command history to a - // cache, replacing it with a blank - // history for the mode. - this._histCache = _.clone(this._hist); - this._histCtrCache = parseFloat(this._histCtr); - this._hist = []; - this._histCtr = 0; - this._inMode = true; -}; - -/** - * Called when exiting a mode - */ - -History.prototype.exitMode = function () { - this._hist = this._histCache; - this._histCtr = this._histCtrCache; - this._histCache = []; - this._histCtrCache = 0; - this._inMode = false; -}; - -/** - * Clears the command history - * (Currently only used in unit test) - */ - -History.prototype.clear = function () { - if (this._storageKey) { - this._localStorage.removeItem(this._storageKey); + + /** + * Called when entering a mode + */ + + enterMode() { + // Reassign the command history to a + // cache, replacing it with a blank + // history for the mode. + this._histCache = [...this._hist]; + this._histCtrCache = parseFloat(this._histCtr); + this._hist = []; + this._histCtr = 0; + this._inMode = true; + } + + /** + * Called when exiting a mode + */ + + exitMode() { + this._hist = this._histCache; + this._histCtr = this._histCtrCache; + this._histCache = []; + this._histCtrCache = 0; + this._inMode = false; + } + + /** + * Clears the command history + * (Currently only used in unit test) + */ + + clear() { + if (this._storageKey) { + this._localStorage.removeItem(this._storageKey); + } } -}; +} module.exports = History; From b9fc2836fd48bc5f3f8a610a2f18fec07cd9a8f2 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 1 Jul 2017 23:13:39 +0100 Subject: [PATCH 17/38] Fixed crash when persisted history cannot be parsed Under some rare conditions, Vorpal can produce an invalid persisted history which, when loaded, would result in an uncaught exception that crashes the caller. To prevent this, the history is reset when invalid JSON is loaded. --- lib/history.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/history.js b/lib/history.js index ea10879e..34014fa4 100755 --- a/lib/history.js +++ b/lib/history.js @@ -38,7 +38,13 @@ class History { } // Load history from local storage - const persistedHistory = JSON.parse(this._localStorage.getItem(this._storageKey)); + let persistedHistory = []; + try { + persistedHistory = JSON.parse(this._localStorage.getItem(this._storageKey)); + } catch (error) { + // Nothing to do if the history cannot be parsed + // so just load an empty one, which is better than crashing. + } if (Array.isArray(persistedHistory)) { this._hist.push(...persistedHistory); } From 489bce8b759f94ec2678b40365f19ab158687ec3 Mon Sep 17 00:00:00 2001 From: "J.R. Mathis" Date: Mon, 3 Jul 2017 09:01:03 -0500 Subject: [PATCH 18/38] Resolves #263 Workaround incorrectly interpreted number-like values returned from minimist --- lib/util.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/util.js b/lib/util.js index 8978176b..f36ad511 100755 --- a/lib/util.js +++ b/lib/util.js @@ -29,9 +29,18 @@ const util = { arr.push(match[1] || match[2] || match[3] || match[4]); } } while (match !== null); + + // Create clone of arr before sending to minimist, resolves #263 + var raw = arr.slice(0) arr = minimist(arr, opts); arr._ = arr._ || []; + + // Test for incorrectly interpreted number-like values from minimist, resolves #263 + arr._.forEach(function (arg, index) { + if (arg === Infinity) arr._[index] = raw[index]; + }); + return arr; }, From 2d18ed6039c61b1186ea9c2dd78491e310eb5b5d Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 30 May 2017 22:54:03 -0700 Subject: [PATCH 19/38] Moving utils into files. Refactored to ES2015. --- lib/command.js | 2 +- lib/util.js | 338 ---------------------------- lib/utils/buildCommandArgs.js | 142 ++++++++++++ lib/{helpers => utils}/camelCase.js | 6 +- lib/utils/humanReadableArgName.js | 8 + lib/utils/matchCommand.js | 71 ++++++ lib/utils/parseArgs.js | 24 ++ lib/utils/parseCommand.js | 94 ++++++++ 8 files changed, 342 insertions(+), 343 deletions(-) create mode 100644 lib/utils/buildCommandArgs.js rename lib/{helpers => utils}/camelCase.js (61%) create mode 100644 lib/utils/humanReadableArgName.js create mode 100644 lib/utils/matchCommand.js create mode 100644 lib/utils/parseArgs.js create mode 100644 lib/utils/parseCommand.js diff --git a/lib/command.js b/lib/command.js index 5c427c1e..5ccc9a68 100755 --- a/lib/command.js +++ b/lib/command.js @@ -1,7 +1,7 @@ const { EventEmitter } = require('events'); const Option = require('./option'); const VorpalUtil = require('./util'); -const camelCase = require('./helpers/camelCase'); +const camelCase = require('./utils/camelCase'); const VARIADIC_LENGTH = 3; diff --git a/lib/util.js b/lib/util.js index 8978176b..bed69019 100755 --- a/lib/util.js +++ b/lib/util.js @@ -9,344 +9,6 @@ const minimist = require('minimist'); const strip = require('strip-ansi'); const util = { - /** - * Parses command arguments from multiple - * sources. - * - * @param {String} str - * @param {Object} opts - * @return {Array} - * @api private - */ - - parseArgs: function (str, opts) { - const reg = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; - let arr = []; - let match; - do { - match = reg.exec(str); - if (match !== null) { - arr.push(match[1] || match[2] || match[3] || match[4]); - } - } while (match !== null); - - arr = minimist(arr, opts); - arr._ = arr._ || []; - return arr; - }, - - /** - * Prepares a command and all its parts for execution. - * - * @param {String} command - * @param {Array} commands - * @return {Object} - * @api public - */ - - parseCommand: function (command, commands) { - const self = this; - let pipes = []; - let match; - let matchArgs; - let matchParts; - - function parsePipes() { - // First, split the command by pipes naively. - // This will split command arguments in half when the argument contains a pipe character. - // For example, say "(Vorpal|vorpal)" will be split into ['say "(Vorpal', 'vorpal)'] which isn't good. - const naivePipes = String(command).trim().split('|'); - - // Contruct empty array to place correctly split commands into. - const newPipes = []; - - // We will look for pipe characters within these quotes to rejoin together. - const quoteChars = ['"', '\'', '`']; - - // This will expand to contain one boolean key for each type of quote. - // The value keyed by the quote is toggled off and on as quote type is opened and closed. - // Example { "`": true, "'": false } would mean that there is an open angle quote. - const quoteTracker = {}; - - // The current command piece before being rejoined with it's over half. - // Since it's not common for pipes to occur in commands, this is usually the entire command pipe. - let commandPart = ''; - - // Loop through each naive pipe. - for (const key in naivePipes) { - // It's possible/likely that this naive pipe is the whole pipe if it doesn't contain an unfinished quote. - const possiblePipe = naivePipes[key]; - commandPart += possiblePipe; - - // Loop through each individual character in the possible pipe tracking the opening and closing of quotes. - for (let i = 0; i < possiblePipe.length; i++) { - const char = possiblePipe[i]; - if (quoteChars.indexOf(char) !== -1) { - quoteTracker[char] = !quoteTracker[char]; - } - } - - // Does the pipe end on an unfinished quote? - const inQuote = _.some(quoteChars, (quoteChar) => quoteTracker[quoteChar]); - - // If the quotes have all been closed or this is the last possible pipe in the array, add as pipe. - if (!inQuote || key * 1 === naivePipes.length - 1) { - newPipes.push(commandPart.trim()); - commandPart = ''; - } else { - // Quote was left open. The pipe character was previously removed when the array was split. - commandPart += '|'; - } - } - - // Set the first pipe to command and the rest to pipes. - command = newPipes.shift(); - pipes = pipes.concat(newPipes); - } - - function parseMatch() { - matchParts = self.matchCommand(command, commands); - match = matchParts.command; - matchArgs = matchParts.args; - } - - parsePipes(); - parseMatch(); - - if (match && _.isFunction(match._parse)) { - command = match._parse(command, matchParts.args); - parsePipes(); - parseMatch(); - } - - return ({ - command: command, - match: match, - matchArgs: matchArgs, - pipes: pipes - }); - }, - - /** - * Run a raw command string, e.g. foo -bar - * against a given list of commands, - * and if there is a match, parse the - * results. - * - * @param {String} cmd - * @param {Array} cmds - * @return {Object} - * @api public - */ - - matchCommand: function (cmd, cmds) { - const parts = String(cmd).trim().split(' '); - - let match; - let matchArgs; - for (let i = 0; i < parts.length; ++i) { - const subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); - match = _.find(cmds, {_name: subcommand}) || match; - if (!match) { - for (const key in cmds) { - const cmd = cmds[key]; - const idx = cmd._aliases.indexOf(subcommand); - match = (idx > -1) ? cmd : match; - } - } - if (match) { - matchArgs = parts.slice(parts.length - i, parts.length).join(' '); - break; - } - } - // If there's no command match, check if the - // there's a `catch` command, which catches all - // missed commands. - if (!match) { - match = _.find(cmds, {_catch: true}); - // If there is one, we still need to make sure we aren't - // partially matching command groups, such as `do things` when - // there is a command `do things well`. If we match partially, - // we still want to show the help menu for that command group. - if (match) { - const allCommands = _.map(cmds, '_name'); - let wordMatch = false; - for (const key in allCommands) { - const cmd = allCommands[key]; - const parts2 = String(cmd).split(' '); - const cmdParts = String(match.command).split(' '); - let matchAll = true; - for (let k = 0; k < cmdParts.length; ++k) { - if (parts2[k] !== cmdParts[k]) { - matchAll = false; - break; - } - } - if (matchAll) { - wordMatch = true; - break; - } - } - if (wordMatch) { - match = undefined; - } else { - matchArgs = cmd; - } - } - } - - return ({ - command: match, - args: matchArgs - }); - }, - - buildCommandArgs: function (passedArgs, cmd, execCommand, isCommandArgKeyPairNormalized) { - let args = {options: {}}; - - if(isCommandArgKeyPairNormalized) { - // Normalize all foo="bar" with "foo='bar'" - // This helps implement unix-like key value pairs. - const reg = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; - passedArgs = passedArgs.replace(reg, `"$2='$4$5'"`); - } - - // Types are custom arg types passed - // into `minimist` as per its docs. - const types = cmd._types || {}; - - // Make a list of all boolean options - // registered for this command. These are - // simply commands that don't have required - // or optional args. - const booleans = []; - cmd.options.forEach(function (opt) { - if (opt.required === 0 && opt.optional === 0) { - if (opt.short) { - booleans.push(opt.short); - } - if (opt.long) { - booleans.push(opt.long); - } - } - }); - - // Review the args passed into the command, - // and filter out the boolean list to only those - // options passed in. - // This returns a boolean list of all options - // passed in by the caller, which don't have - // required or optional args. - const passedArgParts = passedArgs.split(' '); - types.boolean = booleans.map(function (str) { - return String(str).replace(/^-*/, ''); - }).filter(function (str) { - let match = false; - let strings = [`-${str}`, `--${str}`, `--no-${str}`]; - for (let i = 0; i < passedArgParts.length; ++i) { - if (strings.indexOf(passedArgParts[i]) > -1) { - match = true; - break; - } - } - return match; - }); - - // Use minimist to parse the args. - const parsedArgs = this.parseArgs(passedArgs, types); - - function validateArg(arg, cmdArg) { - return !(arg === undefined && cmdArg.required === true); - } - - // Builds varidiac args and options. - let valid = true; - const remainingArgs = _.clone(parsedArgs._); - for (let l = 0; l < 10; ++l) { - const matchArg = cmd._args[l]; - const passedArg = parsedArgs._[l]; - if (matchArg !== undefined) { - valid = (!valid) ? false : validateArg(parsedArgs._[l], matchArg); - if (!valid) { - break; - } - if (passedArg !== undefined) { - if (matchArg.variadic === true) { - args[matchArg.name] = remainingArgs; - } else { - args[matchArg.name] = passedArg; - remainingArgs.shift(); - } - } - } - } - - if (!valid) { - return '\n Missing required argument. Showing Help:'; - } - - // Looks for ommitted required options and throws help. - for (let m = 0; m < cmd.options.length; ++m) { - const o = cmd.options[m]; - const short = String(o.short || '').replace(/-/g, ''); - const long = String(o.long || '').replace(/--no-/g, '').replace(/^-*/g, ''); - let exist = (parsedArgs[short] !== undefined) ? parsedArgs[short] : undefined; - exist = (exist === undefined && parsedArgs[long] !== undefined) ? parsedArgs[long] : exist; - const existsNotSet = (exist === true || exist === false); - const defaultValue = o.default(); - - if (existsNotSet && o.required !== 0 && ! defaultValue) { - return `\n Missing required value for option ${(o.long || o.short)}. Showing Help:`; - } - if (exist !== undefined) { - args.options[long || short] = exist; - } else if (defaultValue) { - args.options[long || short] = defaultValue; - } - } - - // Looks for supplied options that don't - // exist in the options list. - // If the command allows unknown options, - // adds it, otherwise throws help. - const passedOpts = _.chain(parsedArgs) - .keys() - .pull('_') - .pull('help') - .value(); - for (const key in passedOpts) { - const opt = passedOpts[key]; - const optionFound = _.find(cmd.options, function (expected) { - if ('--' + opt === expected.long || - '--no-' + opt === expected.long || - '-' + opt === expected.short) { - return true; - } - return false; - }); - if (optionFound === undefined) { - if (cmd._allowUnknownOptions) { - args.options[opt] = parsedArgs[opt]; - } else { - return `\n Invalid option: '${opt}'. Showing Help:`; - } - } - } - - // If args were passed into the programmatic - // `vorpal.exec(cmd, args, callback)`, merge - // them here. - if (execCommand && execCommand.args && _.isObject(execCommand.args)) { - args = _.extend(args, execCommand.args); - } - - // Looks for a help arg and throws help if any. - if (parsedArgs.help || parsedArgs._.indexOf('/?') > -1) { - args.options.help = true; - } - - return args; - }, /** * Makes an argument name pretty for help. diff --git a/lib/utils/buildCommandArgs.js b/lib/utils/buildCommandArgs.js new file mode 100644 index 00000000..a44e5a62 --- /dev/null +++ b/lib/utils/buildCommandArgs.js @@ -0,0 +1,142 @@ +const parseArgs = require('./parseArgs'); + +const PAIR_NORMALIZE_PATTERN = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; +const MAX_ARGS = 10; + +// eslint-disable-next-line complexity +module.exports = function buildCommandArgs( + passedArgs, + command, + execCommand, + isCommandArgKeyPairNormalized = false +) { + const args = { options: {} }; + + // Normalize all foo="bar" with "foo='bar'". + // This helps implement unix-like key value pairs. + if (isCommandArgKeyPairNormalized) { + // eslint-disable-next-line no-param-reassign + passedArgs = passedArgs.replace(PAIR_NORMALIZE_PATTERN, '"$2=\'$4$5\'"'); + } + + // Types are custom arg types passed into `minimist` as per its docs. + const types = command._types || {}; + + // Make a list of all boolean options registered for this command. + // These are simply commands that don't have required or optional args. + const booleans = []; + + command.options.forEach((opt) => { + if (!opt.required && !opt.optional) { + if (opt.short) { + booleans.push(opt.short); + } + + if (opt.long) { + booleans.push(opt.long); + } + } + }); + + // Review the args passed into the command and filter out the boolean list to only those + // options passed in. This returns a boolean list of all options passed in by the caller, + // which don't have required or optional args. + types.boolean = booleans + .map(value => String(value).replace(/^-*/, '')) + .filter((value) => { + const formats = [`-${value}`, `--${value}`, `--no-${value}`]; + + return passedArgs.split(' ').some(part => formats.contains(part)); + }); + + // Use minimist to parse the args, and then build varidiac args and options. + const parsedArgs = parseArgs(passedArgs, types); + const remainingArgs = [...parsedArgs._]; + let valid = true; + + // Builds varidiac args and options. + for (let l = 0; l < MAX_ARGS; l += 1) { + const matchArg = command._args[l]; + const passedArg = parsedArgs._[l]; + + if (matchArg) { + valid = valid ? (!parsedArgs._[l] && matchArg.required) : false; + + if (!valid) { + break; + } + + if (passedArg) { + if (matchArg.variadic) { + args[matchArg.name] = remainingArgs; + } else { + args[matchArg.name] = passedArg; + remainingArgs.shift(); + } + } + } + } + + if (!valid) { + // TODO pad with helper + throw new Error('\n Missing required argument. Showing Help:'); + } + + // Looks for ommitted required options and throws help. + command.options.forEach((option) => { + const short = String(option.short || '').replace(/-/g, ''); + const long = String(option.long || '').replace(/--no-/g, '').replace(/^-*/g, ''); + const exists = (typeof parsedArgs[short] === 'undefined') + ? parsedArgs[long] + : parsedArgs[short]; + const existsNotSet = (exists === true || exists === false); + const defaultValue = option.default(); + + if (existsNotSet && option.required && !defaultValue) { + // TODO pad with helper + throw new Error( + `\n Missing required value for option ${(option.long || option.short)}. Showing Help:` + ); + } + + if (exists) { + args.options[long || short] = exists; + } else if (defaultValue) { + args.options[long || short] = defaultValue; + } + }); + + // Looks for supplied options that don't exist in the options list. + // If the command allows unknown options, adds it, otherwise throws help. + const passedOpts = Object.keys(parsedArgs) + .filter(opt => (opt !== '_' && opt !== 'help')); + + passedOpts.forEach((option) => { + const optionFound = command.options.find(expected => ( + `--${option}` === expected.long || + `--no-${option}` === expected.long || + `-${option}` === expected.short + )); + + if (!optionFound) { + if (command._allowUnknownOptions) { + args.options[option] = parsedArgs[option]; + } else { + // TODO pad with helper + throw new Error(`\n Invalid option ${option}. Showing Help:`); + } + } + }); + + // If args were passed into the programmatic `Vorpal#exec`, merge them here. + if (execCommand && execCommand.args && typeof execCommand.args === 'object') { + Object.assign(args, execCommand.args); + } + + // Looks for a help arg and throws help if any. + if (parsedArgs.help || parsedArgs._.indexOf('/?') > -1) { + args.options.help = true; + } + + return args; +}; diff --git a/lib/helpers/camelCase.js b/lib/utils/camelCase.js similarity index 61% rename from lib/helpers/camelCase.js rename to lib/utils/camelCase.js index 214a15ac..c91c191f 100644 --- a/lib/helpers/camelCase.js +++ b/lib/utils/camelCase.js @@ -1,5 +1,3 @@ -function camelCase(string) { +module.exports = function camelCase(string) { return string.split('-').reduce((str, word) => str + word[0].toUpperCase() + word.slice(1)); -} - -module.exports = camelCase; +}; diff --git a/lib/utils/humanReadableArgName.js b/lib/utils/humanReadableArgName.js new file mode 100644 index 00000000..e08c9c47 --- /dev/null +++ b/lib/utils/humanReadableArgName.js @@ -0,0 +1,8 @@ +/** + * Makes an argument name pretty for help. + */ +module.exports = function humanReadableArgName(arg) { + const name = arg.name + (arg.variadic ? '...' : ''); + + return arg.required ? `<${name}>` : `[${name}]`; +}; diff --git a/lib/utils/matchCommand.js b/lib/utils/matchCommand.js new file mode 100644 index 00000000..6c6757e6 --- /dev/null +++ b/lib/utils/matchCommand.js @@ -0,0 +1,71 @@ +/** + * Run a raw command string, e.g. foo -bar against a given list of commands, + * and if there is a match, parse the results. + */ +module.exports = function matchCommand(command, commands = []) { + const parts = String(command).trim().split(' '); + let match; + let matchArgs; + + for (let i = 0; i < parts.length; i += 1) { + const subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); + match = commands.find(cmd => cmd._name === subcommand); + + if (match) { + matchArgs = parts.slice(parts.length - i, parts.length).join(' '); + break; + + } else { + // eslint-disable-next-line no-loop-func + commands.forEach((cmd) => { + match = command._aliases.includes(subcommand) ? cmd : match; + }); + } + } + + // If there's no command match, check if the there's a `catch` command, + // which catches all missed commands. + if (!match) { + match = commands.find(cmd => cmd._catch === true); + } + + // If there is one, we still need to make sure we aren't + // partially matching command groups, such as `do things` when + // there is a command `do things well`. If we match partially, + // we still want to show the help menu for that command group. + if (match) { + let wordMatch = false; + + commands.some((cmd) => { + const catchParts = String(cmd._name).split(' '); + const commandParts = String(match.command).split(' '); + let matchAll = true; + + for (let i = 0; i < commandParts.length; i += 1) { + if (catchParts[i] !== commandParts[i]) { + matchAll = false; + break; + } + } + + if (matchAll) { + wordMatch = true; + + return true; + } + + return false; + }); + + if (wordMatch) { + match = null; + } else { + matchArgs = command; + } + } + + return { + command, + args: matchArgs, + }; +}; diff --git a/lib/utils/parseArgs.js b/lib/utils/parseArgs.js new file mode 100644 index 00000000..4b59bf99 --- /dev/null +++ b/lib/utils/parseArgs.js @@ -0,0 +1,24 @@ +const minimist = require('minimist'); + +const ARGS_PATTERN = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; + +/** + * Parses command arguments from multiple sources. + */ +module.exports = function parseArgs(input, opts = {}) { + let args = []; + let match; + + do { + match = ARGS_PATTERN.exec(input); + + if (match !== null) { + args.push(match[1] || match[2] || match[3] || match[4]); + } + } while (match !== null); + + args = minimist(args, opts); + args._ = args._ || []; + + return args; +}; diff --git a/lib/utils/parseCommand.js b/lib/utils/parseCommand.js new file mode 100644 index 00000000..d78f0739 --- /dev/null +++ b/lib/utils/parseCommand.js @@ -0,0 +1,94 @@ +const matchCommand = require('./matchCommand'); + +/** + * Prepares a command and all its parts for execution. + */ +module.exports = function parseCommand(command, commands) { + let pipes = []; + let match; + let matchArgs; + let matchParts; + let nextCommand; + + function parsePipes() { + // First, split the command by pipes naively. + // This will split command arguments in half when the argument contains a pipe character. + // Say "(Vorpal|vorpal)" will be split into ['say "(Vorpal', 'vorpal)'] which isn't good. + const naivePipes = String(command).trim().split('|'); + + // Contruct empty array to place correctly split commands into. + const newPipes = []; + + // We will look for pipe characters within these quotes to rejoin together. + const quoteChars = ['"', '\'', '`']; + + // This will expand to contain one boolean key for each type of quote. + // The value keyed by the quote is toggled off and on as quote type is opened and closed. + // Example { "`": true, "'": false } would mean that there is an open angle quote. + const quoteTracker = {}; + + // The current command piece before being rejoined with it's over half. + // Since it's not common for pipes to occur in commands, + // this is usually the entire command pipe. + let commandPart = ''; + + // Loop through each naive pipe. + naivePipes.forEach((possiblePipe, index) => { + // It's possible/likely that this naive pipe is the whole pipe + // if it doesn't contain an unfinished quote. + commandPart += possiblePipe; + + // Loop through each individual character in the possible pipe + // tracking the opening and closing of quotes. + for (let i = 0; i < possiblePipe.length; i += 1) { + const char = possiblePipe[i]; + + if (quoteChars.includes(char)) { + quoteTracker[char] = !quoteTracker[char]; + } + } + + // Does the pipe end on an unfinished quote? + const inQuote = quoteChars.some(quoteChar => quoteTracker[quoteChar]); + + // If the quotes have all been closed or this is the last + // possible pipe in the array, add as pipe. + if (!inQuote || index === naivePipes.length - 1) { + newPipes.push(commandPart.trim()); + commandPart = ''; + + // Quote was left open. The pipe character was previously + // removed when the array was split. + } else { + commandPart += '|'; + } + }); + + // Set the first pipe to command and the rest to pipes. + nextCommand = newPipes.shift(); + pipes = pipes.concat(newPipes); + } + + function parseMatch() { + matchParts = matchCommand(command, commands); + match = matchParts.command; + matchArgs = matchParts.args; + } + + parsePipes(); + parseMatch(); + + if (match && typeof match._parse === 'function') { + nextCommand = match._parse(command, matchParts.args); + + parsePipes(); + parseMatch(); + } + + return { + command: nextCommand || command, + match, + matchArgs, + pipes, + }; +}; From e56d5b84a8a6f6074b08333cd76729f608587072 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Mon, 12 Jun 2017 23:34:19 -0700 Subject: [PATCH 20/38] Porting more utils to functions. --- lib/command-instance.js | 4 +- lib/command.js | 9 ++-- lib/constants.js | 4 ++ lib/logger.js | 8 ++-- lib/session.js | 8 ++-- lib/util.js | 89 ----------------------------------- lib/utils/buildCommandArgs.js | 2 +- lib/utils/pad.js | 8 ++++ lib/utils/padRow.js | 8 ++++ lib/utils/prettifyArray.js | 48 +++++++++++++++++++ lib/vorpal.js | 36 ++++++++------ 11 files changed, 104 insertions(+), 120 deletions(-) create mode 100644 lib/constants.js create mode 100644 lib/utils/pad.js create mode 100644 lib/utils/padRow.js create mode 100644 lib/utils/prettifyArray.js diff --git a/lib/command-instance.js b/lib/command-instance.js index b73e9fe5..b23c5458 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -24,9 +24,7 @@ class CommandInstance { /** * Route stdout either through a piped command, or the session's stdout. */ - log(...params) { - const args = util.fixArgsForApply(params); - + log(...args) { if (!this.downstream) { this.session.log(...args); diff --git a/lib/command.js b/lib/command.js index 5ccc9a68..19e2fdc9 100755 --- a/lib/command.js +++ b/lib/command.js @@ -1,7 +1,8 @@ const { EventEmitter } = require('events'); const Option = require('./option'); -const VorpalUtil = require('./util'); const camelCase = require('./utils/camelCase'); +const humanReadableArgName = require('./utils/humanReadableArgName'); +const pad = require('./utils/pad'); const VARIADIC_LENGTH = 3; @@ -307,7 +308,7 @@ class Command extends EventEmitter { */ usage(usage) { if (!usage) { - const args = this._args.map(arg => VorpalUtil.humanReadableArgName(arg)); + const args = this._args.map(humanReadableArgName); return this._usage || [ '[options]', @@ -328,9 +329,9 @@ class Command extends EventEmitter { const width = this._largestOptionLength(); // Prepend the help information - return [`${VorpalUtil.pad('--help', width)} output usage information`] + return [`${pad('--help', width)} output usage information`] .concat(this.options.map(option => ( - `${VorpalUtil.pad(option.flags, width)} ${option.description}` + `${pad(option.flags, width)} ${option.description}` ))) .join('\n'); } diff --git a/lib/constants.js b/lib/constants.js new file mode 100644 index 00000000..bfcb313c --- /dev/null +++ b/lib/constants.js @@ -0,0 +1,4 @@ +const PADDING = ' '; + +exports.PADDING = PADDING; +exports.PADDING_SIZE = PADDING.length; diff --git a/lib/logger.js b/lib/logger.js index 264863de..bd64d405 100755 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,3 +1,5 @@ +const pad = require('./utils/pad'); + /** * Module dependencies. */ @@ -85,9 +87,9 @@ function Logger(cons) { var done = true; for (var i = 0; i < input.length; ++i) { if (typeof input[i] === 'number') { - str += util.pad('', input[i], ' '); + str += pad('', input[i]); } else if (_.isArray(input[i]) && typeof input[i][0] === 'number') { - str += util.pad('', input[i][0], input[i][1]); + str += pad('', input[i][0], input[i][1]); } else { var chosenWidth = colsWidth + 0; var trimmed = trimTo(input[i], colsWidth); @@ -103,7 +105,7 @@ function Logger(cons) { color = '\x1B[' + number + 'm'; } input[i] = color + String(input[i].slice(trimmedLength, input[i].length)).trim(); - str += util.pad(String(trimmed).trim(), chosenWidth, ' '); + str += pad(String(trimmed).trim(), chosenWidth); if (viewed(input[i]).trim() !== '') { done = false; } diff --git a/lib/session.js b/lib/session.js index 1222bfdd..f896ac73 100755 --- a/lib/session.js +++ b/lib/session.js @@ -73,9 +73,8 @@ module.exports = exports = Session; * @api public */ -session.log = function () { - var args = util.fixArgsForApply(arguments); - return this._log.apply(this, args); +session.log = function (...args) { + return this._log(...args); }; /** @@ -472,8 +471,7 @@ session.execCommandSet = function (wrapper, callback) { } // Call the root command. - res = wrapper.fn.call(commandInstance, wrapper.args, function () { - var argus = util.fixArgsForApply(arguments); + res = wrapper.fn.call(commandInstance, wrapper.args, function (...argus) { onCompletion(wrapper, argus[0], argus[1], argus); }); diff --git a/lib/util.js b/lib/util.js index bed69019..95b5ed01 100755 --- a/lib/util.js +++ b/lib/util.js @@ -10,95 +10,6 @@ const strip = require('strip-ansi'); const util = { - /** - * Makes an argument name pretty for help. - * - * @param {String} arg - * @return {String} - * @api private - */ - - humanReadableArgName: function (arg) { - const nameOutput = arg.name + (arg.variadic === true ? '...' : ''); - return arg.required ? - `<${nameOutput}>` : - `[${nameOutput}]`; - }, - - /** - * Formats an array to display in a TTY - * in a pretty fashion. - * - * @param {Array} arr - * @return {String} - * @api public - */ - - prettifyArray: function (arr) { - arr = arr || []; - const arrClone = _.clone(arr); - const width = process.stdout.columns; - const longest = strip((arrClone.sort(function (a, b) { - return strip(b).length - strip(a).length; - })[0] || '')).length + 2; - const fullWidth = strip(String(arr.join(''))).length; - const fitsOneLine = ((fullWidth + (arr.length * 2)) <= width); - let cols = Math.floor(width / longest); - cols = (cols < 1) ? 1 : cols; - if (fitsOneLine) { - return arr.join(' '); - } - let col = 0; - const lines = []; - let line = ''; - for (const key in arr) { - const arrEl = arr[key]; - if (col < cols) { - col++; - } else { - lines.push(line); - line = ''; - col = 1; - } - line += this.pad(arrEl, longest, ' '); - } - if (line !== '') { - lines.push(line); - } - return lines.join('\n'); - }, - - /** - * Pads a value with with space or - * a specified delimiter to match a - * given width. - * - * @param {String} str - * @param {Integer} width - * @param {String} delimiter - * @return {String} - * @api private - */ - - pad: function (str, width, delimiter) { - width = Math.floor(width); - delimiter = delimiter || ' '; - const len = Math.max(0, width - strip(str).length); - return str + Array(len + 1).join(delimiter); - }, - - /** - * Pad a row on the start and end with spaces. - * - * @param {String} str - * @return {String} - */ - padRow: function (str) { - return str.split('\n').map(function (row) { - return ' ' + row + ' '; - }).join('\n'); - }, - // When passing down applied args, we need to turn // them from `{ '0': 'foo', '1': 'bar' }` into ['foo', 'bar'] // instead. diff --git a/lib/utils/buildCommandArgs.js b/lib/utils/buildCommandArgs.js index a44e5a62..38a4f046 100644 --- a/lib/utils/buildCommandArgs.js +++ b/lib/utils/buildCommandArgs.js @@ -7,7 +7,7 @@ const MAX_ARGS = 10; module.exports = function buildCommandArgs( passedArgs, command, - execCommand, + execCommand = null, isCommandArgKeyPairNormalized = false ) { const args = { options: {} }; diff --git a/lib/utils/pad.js b/lib/utils/pad.js new file mode 100644 index 00000000..4b2a0367 --- /dev/null +++ b/lib/utils/pad.js @@ -0,0 +1,8 @@ +const strip = require('strip-ansi'); + +/** + * Pads a value with a space or a specified delimiter to match a given width. + */ +module.exports = function pad(value, width, delimiter = ' ') { + return value + delimiter.repeat(Math.max(0, Math.floor(width) - strip(value).length)); +}; diff --git a/lib/utils/padRow.js b/lib/utils/padRow.js new file mode 100644 index 00000000..dbbdae45 --- /dev/null +++ b/lib/utils/padRow.js @@ -0,0 +1,8 @@ +const { PADDING } = require('../constants'); + +/** + * Pad a row on the start and end with spaces. + */ +module.exports = function padRow(value) { + return value.split('\n').map(row => PADDING + row + PADDING).join('\n'); +}; diff --git a/lib/utils/prettifyArray.js b/lib/utils/prettifyArray.js new file mode 100644 index 00000000..0e13aadd --- /dev/null +++ b/lib/utils/prettifyArray.js @@ -0,0 +1,48 @@ +const strip = require('strip-ansi'); +const pad = require('./pad'); +const { PADDING_SIZE } = require('../constants'); + +/** + * Formats an array for display in a TTY in a pretty fashion. + */ +module.exports = function prettifyArray(baseArray) { + const array = baseArray ? [...baseArray] : []; + + // Calculate widths + const maxWidth = process.stdout.columns; + const longestWidth = array.reduce((longest, item) => { + const { length } = strip(item); + + return (length > longest) ? length : longest; + }, 0) + PADDING_SIZE; + const fullWidth = strip(array.join('')).length; + + // Does it fit on one line? + if ((fullWidth + (array.length * PADDING_SIZE)) <= maxWidth) { + return array.join(' '); + } + + // Generate the output + const lines = []; + const cols = Math.min(1, Math.floor(maxWidth / longestWidth)); + let line = ''; + let col = 0; + + array.forEach((item) => { + if (col < cols) { + col += 1; + } else { + lines.push(line); + line = ''; + col = 1; + } + + line += pad(item, longestWidth); + }); + + if (line !== '') { + lines.push(line); + } + + return lines.join('\n'); +}; diff --git a/lib/vorpal.js b/lib/vorpal.js index f1510407..0c059baf 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,6 +1,14 @@ const CommandInstance = require('./command-instance'); +const buildCommandArgs = require('./utils/buildCommandArgs'); +const humanReadableArgName = require('./utils/humanReadableArgName'); +const matchCommand = require('./utils/matchCommand'); +const pad = require('./utils/pad'); +const padRow = require('./utils/padRow'); +const parseCommand = require('./utils/parseCommand'); +const prettifyArray = require('./utils/prettifyArray'); + /** - * Module dependencies. + * Module dependencies. (OLD) */ var _ = require('lodash'); @@ -544,7 +552,7 @@ vorpal._onKeypress = function (key, value) { this.session.getKeypressResult(key, value, function (err, result) { if (!err && result !== undefined) { if (_.isArray(result)) { - var formatted = VorpalUtil.prettifyArray(result); + var formatted = prettifyArray(result); self.ui.imprint(); self.session.log(formatted); } else { @@ -821,7 +829,7 @@ vorpal._exec = function (item) { // History for our 'up' and 'down' arrows. item.session.history((item.session._mode ? modeCommand : item.command)); - var commandData = this.util.parseCommand(item.command, this.commands); + var commandData = parseCommand(item.command, this.commands); item.command = commandData.command; item.pipes = commandData.pipes; var match = commandData.match; @@ -879,7 +887,7 @@ vorpal._exec = function (item) { }; var delimiter = match._delimiter || String(item.command).toLowerCase() + ':'; - item.args = self.util.buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); + item.args = buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); // If we get a string back, it's a validation error. // Show help and return. @@ -891,13 +899,13 @@ vorpal._exec = function (item) { // Build the piped commands. var allValid = true; for (var j = 0; j < item.pipes.length; ++j) { - var commandParts = self.util.matchCommand(item.pipes[j], self.commands); + var commandParts = matchCommand(item.pipes[j], self.commands); if (!commandParts.command) { item.session.log(self._commandHelp(item.pipes[j])); allValid = false; break; } - commandParts.args = self.util.buildCommandArgs(commandParts.args, commandParts.command); + commandParts.args = buildCommandArgs(commandParts.args, commandParts.command); if (_.isString(commandParts.args) || !_.isObject(commandParts.args)) { throwHelp(item, commandParts.args, commandParts.command); allValid = false; @@ -1115,9 +1123,7 @@ vorpal._commandHelp = function (command) { } return (String(cmd._name).trim().split(' ').length <= commandMatchLength); }).map(function (cmd) { - var args = cmd._args.map(function (arg) { - return VorpalUtil.humanReadableArgName(arg); - }).join(' '); + var args = cmd._args.map(humanReadableArgName).join(' '); return [ cmd._name + @@ -1147,7 +1153,7 @@ vorpal._commandHelp = function (command) { counts[cmd]++; return cmd; })).map(function (cmd) { - let prefix = ` ${VorpalUtil.pad(cmd + ' *', width)} ${counts[cmd]} sub-command${((counts[cmd] === 1) ? '' : 's')}.`; + let prefix = ` ${pad(cmd + ' *', width)} ${counts[cmd]} sub-command${((counts[cmd] === 1) ? '' : 's')}.`; return prefix; }); @@ -1157,11 +1163,11 @@ vorpal._commandHelp = function (command) { var commandsString = (commands.length < 1) ? '' : '\n Commands:\n\n' + commands.map(function (cmd) { - var prefix = ' ' + VorpalUtil.pad(cmd[0], width) + ' '; + var prefix = ' ' + pad(cmd[0], width) + ' '; var suffix = wrap(cmd[1], descriptionWidth - 8).split('\n'); for (let i = 0; i < suffix.length; ++i) { if (i !== 0) { - suffix[i] = VorpalUtil.pad('', width + 6) + suffix[i]; + suffix[i] = pad('', width + 6) + suffix[i]; } } suffix = suffix.join('\n'); @@ -1190,7 +1196,7 @@ vorpal._helpHeader = function (hideTitle) { var header = []; if (this._banner) { - header.push(VorpalUtil.padRow(this._banner), ''); + header.push(padRow(this._banner), ''); } // Only show under specific conditions @@ -1201,12 +1207,12 @@ vorpal._helpHeader = function (hideTitle) { title += ' v' + this._version; } - header.push(VorpalUtil.padRow(title)); + header.push(padRow(title)); if (this._description) { var descWidth = process.stdout.columns * 0.75; // Only 75% of the screen - header.push(VorpalUtil.padRow(wrap(this._description, descWidth))); + header.push(padRow(wrap(this._description, descWidth))); } } From b6451b4e8ecd6ca83d538ce2c85ffb5d9eba439b Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Mon, 19 Jun 2017 23:09:52 -0700 Subject: [PATCH 21/38] More debugging on why it doesnt work. --- lib/command-instance.js | 4 +- lib/command.js | 8 +- lib/session.js | 8 +- lib/util.js | 427 ++++++++++++++++++++++++++++++++++++++ lib/utils/matchCommand.js | 65 +++--- lib/utils/parseCommand.js | 12 +- lib/vorpal.js | 28 +-- test/index.js | 2 +- test/vorpal.js | 7 + 9 files changed, 502 insertions(+), 59 deletions(-) diff --git a/lib/command-instance.js b/lib/command-instance.js index b23c5458..b73e9fe5 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -24,7 +24,9 @@ class CommandInstance { /** * Route stdout either through a piped command, or the session's stdout. */ - log(...args) { + log(...params) { + const args = util.fixArgsForApply(params); + if (!this.downstream) { this.session.log(...args); diff --git a/lib/command.js b/lib/command.js index 19e2fdc9..2b22f2e1 100755 --- a/lib/command.js +++ b/lib/command.js @@ -4,6 +4,8 @@ const camelCase = require('./utils/camelCase'); const humanReadableArgName = require('./utils/humanReadableArgName'); const pad = require('./utils/pad'); +const VorpalUtil = require('./util'); + const VARIADIC_LENGTH = 3; class Command extends EventEmitter { @@ -308,7 +310,7 @@ class Command extends EventEmitter { */ usage(usage) { if (!usage) { - const args = this._args.map(humanReadableArgName); + const args = this._args.map(arg => VorpalUtil.humanReadableArgName(arg)); return this._usage || [ '[options]', @@ -329,9 +331,9 @@ class Command extends EventEmitter { const width = this._largestOptionLength(); // Prepend the help information - return [`${pad('--help', width)} output usage information`] + return [`${VorpalUtil.pad('--help', width)} output usage information`] .concat(this.options.map(option => ( - `${pad(option.flags, width)} ${option.description}` + `${VorpalUtil.pad(option.flags, width)} ${option.description}` ))) .join('\n'); } diff --git a/lib/session.js b/lib/session.js index f896ac73..1222bfdd 100755 --- a/lib/session.js +++ b/lib/session.js @@ -73,8 +73,9 @@ module.exports = exports = Session; * @api public */ -session.log = function (...args) { - return this._log(...args); +session.log = function () { + var args = util.fixArgsForApply(arguments); + return this._log.apply(this, args); }; /** @@ -471,7 +472,8 @@ session.execCommandSet = function (wrapper, callback) { } // Call the root command. - res = wrapper.fn.call(commandInstance, wrapper.args, function (...argus) { + res = wrapper.fn.call(commandInstance, wrapper.args, function () { + var argus = util.fixArgsForApply(arguments); onCompletion(wrapper, argus[0], argus[1], argus); }); diff --git a/lib/util.js b/lib/util.js index 95b5ed01..8978176b 100755 --- a/lib/util.js +++ b/lib/util.js @@ -9,6 +9,433 @@ const minimist = require('minimist'); const strip = require('strip-ansi'); const util = { + /** + * Parses command arguments from multiple + * sources. + * + * @param {String} str + * @param {Object} opts + * @return {Array} + * @api private + */ + + parseArgs: function (str, opts) { + const reg = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; + let arr = []; + let match; + do { + match = reg.exec(str); + if (match !== null) { + arr.push(match[1] || match[2] || match[3] || match[4]); + } + } while (match !== null); + + arr = minimist(arr, opts); + arr._ = arr._ || []; + return arr; + }, + + /** + * Prepares a command and all its parts for execution. + * + * @param {String} command + * @param {Array} commands + * @return {Object} + * @api public + */ + + parseCommand: function (command, commands) { + const self = this; + let pipes = []; + let match; + let matchArgs; + let matchParts; + + function parsePipes() { + // First, split the command by pipes naively. + // This will split command arguments in half when the argument contains a pipe character. + // For example, say "(Vorpal|vorpal)" will be split into ['say "(Vorpal', 'vorpal)'] which isn't good. + const naivePipes = String(command).trim().split('|'); + + // Contruct empty array to place correctly split commands into. + const newPipes = []; + + // We will look for pipe characters within these quotes to rejoin together. + const quoteChars = ['"', '\'', '`']; + + // This will expand to contain one boolean key for each type of quote. + // The value keyed by the quote is toggled off and on as quote type is opened and closed. + // Example { "`": true, "'": false } would mean that there is an open angle quote. + const quoteTracker = {}; + + // The current command piece before being rejoined with it's over half. + // Since it's not common for pipes to occur in commands, this is usually the entire command pipe. + let commandPart = ''; + + // Loop through each naive pipe. + for (const key in naivePipes) { + // It's possible/likely that this naive pipe is the whole pipe if it doesn't contain an unfinished quote. + const possiblePipe = naivePipes[key]; + commandPart += possiblePipe; + + // Loop through each individual character in the possible pipe tracking the opening and closing of quotes. + for (let i = 0; i < possiblePipe.length; i++) { + const char = possiblePipe[i]; + if (quoteChars.indexOf(char) !== -1) { + quoteTracker[char] = !quoteTracker[char]; + } + } + + // Does the pipe end on an unfinished quote? + const inQuote = _.some(quoteChars, (quoteChar) => quoteTracker[quoteChar]); + + // If the quotes have all been closed or this is the last possible pipe in the array, add as pipe. + if (!inQuote || key * 1 === naivePipes.length - 1) { + newPipes.push(commandPart.trim()); + commandPart = ''; + } else { + // Quote was left open. The pipe character was previously removed when the array was split. + commandPart += '|'; + } + } + + // Set the first pipe to command and the rest to pipes. + command = newPipes.shift(); + pipes = pipes.concat(newPipes); + } + + function parseMatch() { + matchParts = self.matchCommand(command, commands); + match = matchParts.command; + matchArgs = matchParts.args; + } + + parsePipes(); + parseMatch(); + + if (match && _.isFunction(match._parse)) { + command = match._parse(command, matchParts.args); + parsePipes(); + parseMatch(); + } + + return ({ + command: command, + match: match, + matchArgs: matchArgs, + pipes: pipes + }); + }, + + /** + * Run a raw command string, e.g. foo -bar + * against a given list of commands, + * and if there is a match, parse the + * results. + * + * @param {String} cmd + * @param {Array} cmds + * @return {Object} + * @api public + */ + + matchCommand: function (cmd, cmds) { + const parts = String(cmd).trim().split(' '); + + let match; + let matchArgs; + for (let i = 0; i < parts.length; ++i) { + const subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); + match = _.find(cmds, {_name: subcommand}) || match; + if (!match) { + for (const key in cmds) { + const cmd = cmds[key]; + const idx = cmd._aliases.indexOf(subcommand); + match = (idx > -1) ? cmd : match; + } + } + if (match) { + matchArgs = parts.slice(parts.length - i, parts.length).join(' '); + break; + } + } + // If there's no command match, check if the + // there's a `catch` command, which catches all + // missed commands. + if (!match) { + match = _.find(cmds, {_catch: true}); + // If there is one, we still need to make sure we aren't + // partially matching command groups, such as `do things` when + // there is a command `do things well`. If we match partially, + // we still want to show the help menu for that command group. + if (match) { + const allCommands = _.map(cmds, '_name'); + let wordMatch = false; + for (const key in allCommands) { + const cmd = allCommands[key]; + const parts2 = String(cmd).split(' '); + const cmdParts = String(match.command).split(' '); + let matchAll = true; + for (let k = 0; k < cmdParts.length; ++k) { + if (parts2[k] !== cmdParts[k]) { + matchAll = false; + break; + } + } + if (matchAll) { + wordMatch = true; + break; + } + } + if (wordMatch) { + match = undefined; + } else { + matchArgs = cmd; + } + } + } + + return ({ + command: match, + args: matchArgs + }); + }, + + buildCommandArgs: function (passedArgs, cmd, execCommand, isCommandArgKeyPairNormalized) { + let args = {options: {}}; + + if(isCommandArgKeyPairNormalized) { + // Normalize all foo="bar" with "foo='bar'" + // This helps implement unix-like key value pairs. + const reg = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; + passedArgs = passedArgs.replace(reg, `"$2='$4$5'"`); + } + + // Types are custom arg types passed + // into `minimist` as per its docs. + const types = cmd._types || {}; + + // Make a list of all boolean options + // registered for this command. These are + // simply commands that don't have required + // or optional args. + const booleans = []; + cmd.options.forEach(function (opt) { + if (opt.required === 0 && opt.optional === 0) { + if (opt.short) { + booleans.push(opt.short); + } + if (opt.long) { + booleans.push(opt.long); + } + } + }); + + // Review the args passed into the command, + // and filter out the boolean list to only those + // options passed in. + // This returns a boolean list of all options + // passed in by the caller, which don't have + // required or optional args. + const passedArgParts = passedArgs.split(' '); + types.boolean = booleans.map(function (str) { + return String(str).replace(/^-*/, ''); + }).filter(function (str) { + let match = false; + let strings = [`-${str}`, `--${str}`, `--no-${str}`]; + for (let i = 0; i < passedArgParts.length; ++i) { + if (strings.indexOf(passedArgParts[i]) > -1) { + match = true; + break; + } + } + return match; + }); + + // Use minimist to parse the args. + const parsedArgs = this.parseArgs(passedArgs, types); + + function validateArg(arg, cmdArg) { + return !(arg === undefined && cmdArg.required === true); + } + + // Builds varidiac args and options. + let valid = true; + const remainingArgs = _.clone(parsedArgs._); + for (let l = 0; l < 10; ++l) { + const matchArg = cmd._args[l]; + const passedArg = parsedArgs._[l]; + if (matchArg !== undefined) { + valid = (!valid) ? false : validateArg(parsedArgs._[l], matchArg); + if (!valid) { + break; + } + if (passedArg !== undefined) { + if (matchArg.variadic === true) { + args[matchArg.name] = remainingArgs; + } else { + args[matchArg.name] = passedArg; + remainingArgs.shift(); + } + } + } + } + + if (!valid) { + return '\n Missing required argument. Showing Help:'; + } + + // Looks for ommitted required options and throws help. + for (let m = 0; m < cmd.options.length; ++m) { + const o = cmd.options[m]; + const short = String(o.short || '').replace(/-/g, ''); + const long = String(o.long || '').replace(/--no-/g, '').replace(/^-*/g, ''); + let exist = (parsedArgs[short] !== undefined) ? parsedArgs[short] : undefined; + exist = (exist === undefined && parsedArgs[long] !== undefined) ? parsedArgs[long] : exist; + const existsNotSet = (exist === true || exist === false); + const defaultValue = o.default(); + + if (existsNotSet && o.required !== 0 && ! defaultValue) { + return `\n Missing required value for option ${(o.long || o.short)}. Showing Help:`; + } + if (exist !== undefined) { + args.options[long || short] = exist; + } else if (defaultValue) { + args.options[long || short] = defaultValue; + } + } + + // Looks for supplied options that don't + // exist in the options list. + // If the command allows unknown options, + // adds it, otherwise throws help. + const passedOpts = _.chain(parsedArgs) + .keys() + .pull('_') + .pull('help') + .value(); + for (const key in passedOpts) { + const opt = passedOpts[key]; + const optionFound = _.find(cmd.options, function (expected) { + if ('--' + opt === expected.long || + '--no-' + opt === expected.long || + '-' + opt === expected.short) { + return true; + } + return false; + }); + if (optionFound === undefined) { + if (cmd._allowUnknownOptions) { + args.options[opt] = parsedArgs[opt]; + } else { + return `\n Invalid option: '${opt}'. Showing Help:`; + } + } + } + + // If args were passed into the programmatic + // `vorpal.exec(cmd, args, callback)`, merge + // them here. + if (execCommand && execCommand.args && _.isObject(execCommand.args)) { + args = _.extend(args, execCommand.args); + } + + // Looks for a help arg and throws help if any. + if (parsedArgs.help || parsedArgs._.indexOf('/?') > -1) { + args.options.help = true; + } + + return args; + }, + + /** + * Makes an argument name pretty for help. + * + * @param {String} arg + * @return {String} + * @api private + */ + + humanReadableArgName: function (arg) { + const nameOutput = arg.name + (arg.variadic === true ? '...' : ''); + return arg.required ? + `<${nameOutput}>` : + `[${nameOutput}]`; + }, + + /** + * Formats an array to display in a TTY + * in a pretty fashion. + * + * @param {Array} arr + * @return {String} + * @api public + */ + + prettifyArray: function (arr) { + arr = arr || []; + const arrClone = _.clone(arr); + const width = process.stdout.columns; + const longest = strip((arrClone.sort(function (a, b) { + return strip(b).length - strip(a).length; + })[0] || '')).length + 2; + const fullWidth = strip(String(arr.join(''))).length; + const fitsOneLine = ((fullWidth + (arr.length * 2)) <= width); + let cols = Math.floor(width / longest); + cols = (cols < 1) ? 1 : cols; + if (fitsOneLine) { + return arr.join(' '); + } + let col = 0; + const lines = []; + let line = ''; + for (const key in arr) { + const arrEl = arr[key]; + if (col < cols) { + col++; + } else { + lines.push(line); + line = ''; + col = 1; + } + line += this.pad(arrEl, longest, ' '); + } + if (line !== '') { + lines.push(line); + } + return lines.join('\n'); + }, + + /** + * Pads a value with with space or + * a specified delimiter to match a + * given width. + * + * @param {String} str + * @param {Integer} width + * @param {String} delimiter + * @return {String} + * @api private + */ + + pad: function (str, width, delimiter) { + width = Math.floor(width); + delimiter = delimiter || ' '; + const len = Math.max(0, width - strip(str).length); + return str + Array(len + 1).join(delimiter); + }, + + /** + * Pad a row on the start and end with spaces. + * + * @param {String} str + * @return {String} + */ + padRow: function (str) { + return str.split('\n').map(function (row) { + return ' ' + row + ' '; + }).join('\n'); + }, // When passing down applied args, we need to turn // them from `{ '0': 'foo', '1': 'bar' }` into ['foo', 'bar'] diff --git a/lib/utils/matchCommand.js b/lib/utils/matchCommand.js index 6c6757e6..6d8336b3 100644 --- a/lib/utils/matchCommand.js +++ b/lib/utils/matchCommand.js @@ -9,58 +9,59 @@ module.exports = function matchCommand(command, commands = []) { for (let i = 0; i < parts.length; i += 1) { const subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); - match = commands.find(cmd => cmd._name === subcommand); + match = commands.find(cmd => cmd._name === subcommand) || match; - if (match) { - matchArgs = parts.slice(parts.length - i, parts.length).join(' '); - break; - - } else { + if (!match) { // eslint-disable-next-line no-loop-func commands.forEach((cmd) => { match = command._aliases.includes(subcommand) ? cmd : match; }); } + + if (match) { + matchArgs = parts.slice(parts.length - i, parts.length).join(' '); + break; + } } // If there's no command match, check if the there's a `catch` command, // which catches all missed commands. if (!match) { match = commands.find(cmd => cmd._catch === true); - } - // If there is one, we still need to make sure we aren't - // partially matching command groups, such as `do things` when - // there is a command `do things well`. If we match partially, - // we still want to show the help menu for that command group. - if (match) { - let wordMatch = false; + // If there is one, we still need to make sure we aren't + // partially matching command groups, such as `do things` when + // there is a command `do things well`. If we match partially, + // we still want to show the help menu for that command group. + if (match) { + let wordMatch = false; - commands.some((cmd) => { - const catchParts = String(cmd._name).split(' '); - const commandParts = String(match.command).split(' '); - let matchAll = true; + commands.some((cmd) => { + const catchParts = String(cmd._name).split(' '); + const commandParts = String(match.command).split(' '); + let matchAll = true; - for (let i = 0; i < commandParts.length; i += 1) { - if (catchParts[i] !== commandParts[i]) { - matchAll = false; - break; + for (let i = 0; i < commandParts.length; i += 1) { + if (catchParts[i] !== commandParts[i]) { + matchAll = false; + break; + } } - } - if (matchAll) { - wordMatch = true; + if (matchAll) { + wordMatch = true; - return true; - } + return true; + } - return false; - }); + return false; + }); - if (wordMatch) { - match = null; - } else { - matchArgs = command; + if (wordMatch) { + match = null; + } else { + matchArgs = command; + } } } diff --git a/lib/utils/parseCommand.js b/lib/utils/parseCommand.js index d78f0739..b1d13391 100644 --- a/lib/utils/parseCommand.js +++ b/lib/utils/parseCommand.js @@ -8,13 +8,13 @@ module.exports = function parseCommand(command, commands) { let match; let matchArgs; let matchParts; - let nextCommand; + let nextCommand = command; function parsePipes() { // First, split the command by pipes naively. // This will split command arguments in half when the argument contains a pipe character. // Say "(Vorpal|vorpal)" will be split into ['say "(Vorpal', 'vorpal)'] which isn't good. - const naivePipes = String(command).trim().split('|'); + const naivePipes = String(nextCommand).trim().split('|'); // Contruct empty array to place correctly split commands into. const newPipes = []; @@ -49,7 +49,7 @@ module.exports = function parseCommand(command, commands) { } // Does the pipe end on an unfinished quote? - const inQuote = quoteChars.some(quoteChar => quoteTracker[quoteChar]); + const inQuote = quoteChars.some(quoteChar => !!quoteTracker[quoteChar]); // If the quotes have all been closed or this is the last // possible pipe in the array, add as pipe. @@ -70,7 +70,7 @@ module.exports = function parseCommand(command, commands) { } function parseMatch() { - matchParts = matchCommand(command, commands); + matchParts = matchCommand(nextCommand, commands); match = matchParts.command; matchArgs = matchParts.args; } @@ -79,14 +79,14 @@ module.exports = function parseCommand(command, commands) { parseMatch(); if (match && typeof match._parse === 'function') { - nextCommand = match._parse(command, matchParts.args); + nextCommand = match._parse(nextCommand, matchParts.args); parsePipes(); parseMatch(); } return { - command: nextCommand || command, + command: nextCommand, match, matchArgs, pipes, diff --git a/lib/vorpal.js b/lib/vorpal.js index 0c059baf..f23ff2dc 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -14,7 +14,6 @@ const prettifyArray = require('./utils/prettifyArray'); var _ = require('lodash'); var EventEmitter = require('events').EventEmitter; var Command = require('./command'); -var VorpalUtil = require('./util'); var ui = require('./ui'); var Session = require('./session'); var intercept = require('./intercept'); @@ -25,6 +24,7 @@ var os = require('os'); var History = require('./history'); var LocalStorage = require('./local-storage'); var wrap = require('wrap-ansi'); +var VorpalUtil = require('./util'); /** * Initialize a new `Vorpal` instance. @@ -552,7 +552,7 @@ vorpal._onKeypress = function (key, value) { this.session.getKeypressResult(key, value, function (err, result) { if (!err && result !== undefined) { if (_.isArray(result)) { - var formatted = prettifyArray(result); + var formatted = VorpalUtil.prettifyArray(result); self.ui.imprint(); self.session.log(formatted); } else { @@ -829,7 +829,7 @@ vorpal._exec = function (item) { // History for our 'up' and 'down' arrows. item.session.history((item.session._mode ? modeCommand : item.command)); - var commandData = parseCommand(item.command, this.commands); + var commandData = this.util.parseCommand(item.command, this.commands); item.command = commandData.command; item.pipes = commandData.pipes; var match = commandData.match; @@ -887,7 +887,7 @@ vorpal._exec = function (item) { }; var delimiter = match._delimiter || String(item.command).toLowerCase() + ':'; - item.args = buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); + item.args = self.util.buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); // If we get a string back, it's a validation error. // Show help and return. @@ -899,13 +899,13 @@ vorpal._exec = function (item) { // Build the piped commands. var allValid = true; for (var j = 0; j < item.pipes.length; ++j) { - var commandParts = matchCommand(item.pipes[j], self.commands); + var commandParts = self.util.matchCommand(item.pipes[j], self.commands); if (!commandParts.command) { item.session.log(self._commandHelp(item.pipes[j])); allValid = false; break; } - commandParts.args = buildCommandArgs(commandParts.args, commandParts.command); + commandParts.args = self.util.buildCommandArgs(commandParts.args, commandParts.command); if (_.isString(commandParts.args) || !_.isObject(commandParts.args)) { throwHelp(item, commandParts.args, commandParts.command); allValid = false; @@ -1123,7 +1123,9 @@ vorpal._commandHelp = function (command) { } return (String(cmd._name).trim().split(' ').length <= commandMatchLength); }).map(function (cmd) { - var args = cmd._args.map(humanReadableArgName).join(' '); + var args = cmd._args.map(function (arg) { + return VorpalUtil.humanReadableArgName(arg); + }).join(' '); return [ cmd._name + @@ -1153,7 +1155,7 @@ vorpal._commandHelp = function (command) { counts[cmd]++; return cmd; })).map(function (cmd) { - let prefix = ` ${pad(cmd + ' *', width)} ${counts[cmd]} sub-command${((counts[cmd] === 1) ? '' : 's')}.`; + let prefix = ` ${VorpalUtil.pad(cmd + ' *', width)} ${counts[cmd]} sub-command${((counts[cmd] === 1) ? '' : 's')}.`; return prefix; }); @@ -1163,11 +1165,11 @@ vorpal._commandHelp = function (command) { var commandsString = (commands.length < 1) ? '' : '\n Commands:\n\n' + commands.map(function (cmd) { - var prefix = ' ' + pad(cmd[0], width) + ' '; + var prefix = ' ' + VorpalUtil.pad(cmd[0], width) + ' '; var suffix = wrap(cmd[1], descriptionWidth - 8).split('\n'); for (let i = 0; i < suffix.length; ++i) { if (i !== 0) { - suffix[i] = pad('', width + 6) + suffix[i]; + suffix[i] = VorpalUtil.pad('', width + 6) + suffix[i]; } } suffix = suffix.join('\n'); @@ -1196,7 +1198,7 @@ vorpal._helpHeader = function (hideTitle) { var header = []; if (this._banner) { - header.push(padRow(this._banner), ''); + header.push(VorpalUtil.padRow(this._banner), ''); } // Only show under specific conditions @@ -1207,12 +1209,12 @@ vorpal._helpHeader = function (hideTitle) { title += ' v' + this._version; } - header.push(padRow(title)); + header.push(VorpalUtil.padRow(title)); if (this._description) { var descWidth = process.stdout.columns * 0.75; // Only 75% of the screen - header.push(padRow(wrap(this._description, descWidth))); + header.push(VorpalUtil.padRow(wrap(this._description, descWidth))); } } diff --git a/test/index.js b/test/index.js index 3c7ec12b..fe07c198 100755 --- a/test/index.js +++ b/test/index.js @@ -30,7 +30,7 @@ describe('vorpal', function () { describe('mode context', function () { it('parent should have the same context in init and action', function (done) { - var vorpal = Vorpal(); + var vorpal = new Vorpal(); var initCtx; vorpal .mode('ooga') diff --git a/test/vorpal.js b/test/vorpal.js index d37e67f9..69406baf 100755 --- a/test/vorpal.js +++ b/test/vorpal.js @@ -12,6 +12,13 @@ var intercept = require('../lib/intercept'); var vorpal; +process.on('unhandledRejection', (err, p) => { + console.log('An unhandledRejection occurred'); + console.log(`Rejected Promise: ${p}`); + console.log(`Rejection: ${err}`); + console.log(err.stack); +}); + // Normalize inputs to objects. function obj(inp) { if (typeof inp === 'String') { From 6e427681d3af385cce35869c828f5e47e8be5fe4 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 22 Jun 2017 00:23:52 -0700 Subject: [PATCH 22/38] More work on getting it to render. --- lib/command-instance.js | 20 +++++----- lib/command.js | 4 +- lib/history.js | 55 +++++++++------------------ lib/ui.js | 82 ++++++++++++++++------------------------- lib/util.js | 35 ++---------------- lib/utils/pad.js | 4 +- lib/vorpal.js | 12 +++--- 7 files changed, 71 insertions(+), 141 deletions(-) diff --git a/lib/command-instance.js b/lib/command-instance.js index b73e9fe5..f924730e 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -24,9 +24,7 @@ class CommandInstance { /** * Route stdout either through a piped command, or the session's stdout. */ - log(...params) { - const args = util.fixArgsForApply(params); - + log(...args) { if (!this.downstream) { this.session.log(...args); @@ -73,20 +71,20 @@ class CommandInstance { } } - prompt(a, b, c) { - return this.session.prompt(a, b, c); + prompt(...args) { + return this.session.prompt(...args); } - delimiter(a, b, c) { - return this.session.delimiter(a, b, c); + delimiter(...args) { + return this.session.delimiter(...args); } - help(a, b, c) { - return this.session.help(a, b, c); + help(...args) { + return this.session.help(...args); } - match(a, b, c) { - return this.session.match(a, b, c); + match(...args) { + return this.session.match(...args); } } diff --git a/lib/command.js b/lib/command.js index 2b22f2e1..3844d997 100755 --- a/lib/command.js +++ b/lib/command.js @@ -331,9 +331,9 @@ class Command extends EventEmitter { const width = this._largestOptionLength(); // Prepend the help information - return [`${VorpalUtil.pad('--help', width)} output usage information`] + return [`${pad('--help', width)} output usage information`] .concat(this.options.map(option => ( - `${VorpalUtil.pad(option.flags, width)} ${option.description}` + `${pad(option.flags, width)} ${option.description}` ))) .join('\n'); } diff --git a/lib/history.js b/lib/history.js index 34014fa4..b48af2ee 100755 --- a/lib/history.js +++ b/lib/history.js @@ -4,13 +4,11 @@ const os = require('os'); // Number of command histories kept in persistent storage const HISTORY_SIZE = 500; - -const temp = path.normalize(path.join(os.tmpdir(), '/.local_storage')); -const DEFAULT_STORAGE_PATH = temp; +const DEFAULT_STORAGE_PATH = path.normalize(path.join(os.tmpdir(), '.local_storage')); class History { constructor() { - this._storageKey = undefined; + this._storageKey = ''; // Prompt Command History // Histctr moves based on number of times 'up' (+= ctr) @@ -31,7 +29,6 @@ class History { * Initialize the history with local storage data * Called from setId when history id is set */ - _init() { if (!this._storageKey) { return; @@ -55,13 +52,13 @@ class History { * Calls init internally to initialize * the history with the id. */ - setId(id) { // Initialize a localStorage instance with default // path if it is not initialized if (!this._localStorage) { this._localStorage = new LocalStorage(DEFAULT_STORAGE_PATH); } + this._storageKey = `cmd_history_${id}`; this._init(); } @@ -69,37 +66,28 @@ class History { /** * Initialize a local storage instance with * the path if not already initialized. - * - * @param path */ - - setStoragePath(path) { + setStoragePath(newPath) { if (!this._localStorage) { - this._localStorage = new LocalStorage(path); + this._localStorage = new LocalStorage(newPath); } } /** * Get previous history. Called when up is pressed. - * - * @return {String} */ - getPreviousHistory() { this._histCtr += 1; - this._histCtr = (this._histCtr > this._hist.length) ? - this._hist.length : - this._histCtr; + this._histCtr = (this._histCtr > this._hist.length) + ? this._hist.length + : this._histCtr; - return this._hist[this._hist.length - (this._histCtr)]; + return this._hist[this._hist.length - this._histCtr]; } /** * Get next history. Called when down is pressed. - * - * @return {String} */ - getNextHistory() { this._histCtr -= 1; @@ -114,37 +102,32 @@ class History { } /** - * Peek into history, without changing state - * - * @return {String} + * Peek into history, without changing state. */ - peek(depth = 0) { return this._hist[this._hist.length - 1 - depth]; } /** * A new command was submitted. Called when enter is pressed and the prompt is not empty. - * - * @param cmd */ - - newCommand(cmd) { + newCommand(command) { // Always reset history when new command is executed. this._histCtr = 0; // Don't store command in history if it's a duplicate. - if (this._hist[this._hist.length - 1] === cmd) { + if (this._hist[this._hist.length - 1] === command) { return; } // Push into history. - this._hist.push(cmd); + this._hist.push(command); // Only persist history when not in mode if (this._storageKey && !this._inMode) { let persistedHistory = this._hist; const historyLen = this._hist.length; + if (historyLen > HISTORY_SIZE) { persistedHistory = this._hist.slice(historyLen - HISTORY_SIZE - 1, historyLen - 1); } @@ -155,9 +138,8 @@ class History { } /** - * Called when entering a mode + * Called when entering a mode. */ - enterMode() { // Reassign the command history to a // cache, replacing it with a blank @@ -170,9 +152,8 @@ class History { } /** - * Called when exiting a mode + * Called when exiting a mode. */ - exitMode() { this._hist = this._histCache; this._histCtr = this._histCtrCache; @@ -182,10 +163,8 @@ class History { } /** - * Clears the command history - * (Currently only used in unit test) + * Clears the command history (currently only used in unit test). */ - clear() { if (this._storageKey) { this._localStorage.removeItem(this._storageKey); diff --git a/lib/ui.js b/lib/ui.js index 1c7d2e59..11298540 100755 --- a/lib/ui.js +++ b/lib/ui.js @@ -4,7 +4,6 @@ const { EventEmitter } = require('events'); const chalk = require('chalk'); const inquirer = require('inquirer'); const logUpdate = require('log-update'); -const util = require('./util'); const INQUIRER_PROMPTS = ['input', 'checkbox', 'confirm', 'expand', 'list', 'password', 'rawlist']; @@ -50,11 +49,15 @@ class UI extends EventEmitter { if (this._sigintCount > 1) { this.parent.emit('vorpal_exit'); process.exit(0); + + return; } // If Vorpal isn't shown, just exit. if (!this.parent) { process.exit(0); + + return; } const text = this.input(); @@ -212,9 +215,8 @@ class UI extends EventEmitter { } const self = this; - const delimiter = String(value).trim(); - this._lastDelimiter = `${delimiter} `; + this._lastDelimiter = `${String(value).trim()} `; inquirer.prompt.prompts.password.prototype.getQuestion = function getPasswordQuestion() { self._activePrompt = this; @@ -228,7 +230,7 @@ class UI extends EventEmitter { let { message } = this.opt; if ((this.opt.default || this.opt.default === false) && this.status !== 'answered') { - message += chalk.dim(`(${this.opt.default}) `); + message += chalk.dim(` (${this.opt.default}) `); } self.inquirerStdout.push(message); @@ -274,15 +276,7 @@ class UI extends EventEmitter { * the value of what had been typed so far. */ pause() { - if (!this.parent) { - return false; - } - - if (!this._activePrompt) { - return false; - } - - if (!this._midPrompt) { + if (!this.parent || !this._activePrompt || !this._midPrompt) { return false; } @@ -290,7 +284,7 @@ class UI extends EventEmitter { this._midPrompt = false; - const { screen } = this._activePrompt.screen; + const { screen } = this._activePrompt; screen.rl.output.unmute(); screen.clean(); @@ -305,20 +299,12 @@ class UI extends EventEmitter { * with that text and put the cursor at * the end. */ - resume(val) { - if (!this.parent) { - return this; - } - - if (!this._activePrompt) { - return this; - } - - if (this._midPrompt) { + resume(value) { + if (!this.parent || !this._activePrompt || this._midPrompt) { return this; } - this._activePrompt.screen.rl.output.write(val || ''); + this._activePrompt.screen.rl.output.write(value || ''); this._midPrompt = true; return this; @@ -369,18 +355,14 @@ class UI extends EventEmitter { * paused, resumes the prompt. */ log(...params) { - let args = util.fixArgsForApply(params); - - args = (typeof this._pipeFn === 'function') - ? this._pipeFn(args) - : args; + const args = (typeof this._pipeFn === 'function') + ? this._pipeFn(params) + : params; - if (args === '') { + if (!args || args === '') { return this; } - args = util.fixArgsForApply(args); - if (this.midPrompt()) { const data = this.pause(); @@ -436,7 +418,7 @@ class UI extends EventEmitter { */ input(input) { if (!this._activePrompt) { - return ''; + return undefined; // TODO } const prompt = this._activePrompt; @@ -471,9 +453,10 @@ class UI extends EventEmitter { return this; } + const { line } = this._activePrompt.rl; const delimiter = this._lastDelimiter || this.delimiter() || ''; - this.log(delimiter + this._activePrompt.rl.line); + this.log(delimiter + line); return this; } @@ -546,18 +529,17 @@ ui.redraw.done = function done() { */ // TODO investigate -// global.__vorpal = global.__vorpal || {}; -// global.__vorpal.ui = global.__vorpal.ui || { -// exists: false, -// exports: undefined -// }; -// -// if (!global.__vorpal.ui.exists) { -// global.__vorpal.ui.exists = true; -// global.__vorpal.ui.exports = ui; -// module.exports = exports = global.__vorpal.ui.exports; -// } else { -// module.exports = global.__vorpal.ui.exports; -// } - -module.exports = ui; +global.__vorpal = global.__vorpal || {}; +global.__vorpal.ui = global.__vorpal.ui || { + exists: false, + exports: undefined, +}; + +if (global.__vorpal.ui.exists) { + module.exports = global.__vorpal.ui.exports; +} else { + global.__vorpal.ui.exists = true; + global.__vorpal.ui.exports = ui; + exports = ui; + module.exports = ui; +} diff --git a/lib/util.js b/lib/util.js index 8978176b..3e2970dc 100755 --- a/lib/util.js +++ b/lib/util.js @@ -8,6 +8,8 @@ const _ = require('lodash'); const minimist = require('minimist'); const strip = require('strip-ansi'); +const pad = require('./utils/pad'); + const util = { /** * Parses command arguments from multiple @@ -398,7 +400,7 @@ const util = { line = ''; col = 1; } - line += this.pad(arrEl, longest, ' '); + line += pad(arrEl, longest, ' '); } if (line !== '') { lines.push(line); @@ -406,37 +408,6 @@ const util = { return lines.join('\n'); }, - /** - * Pads a value with with space or - * a specified delimiter to match a - * given width. - * - * @param {String} str - * @param {Integer} width - * @param {String} delimiter - * @return {String} - * @api private - */ - - pad: function (str, width, delimiter) { - width = Math.floor(width); - delimiter = delimiter || ' '; - const len = Math.max(0, width - strip(str).length); - return str + Array(len + 1).join(delimiter); - }, - - /** - * Pad a row on the start and end with spaces. - * - * @param {String} str - * @return {String} - */ - padRow: function (str) { - return str.split('\n').map(function (row) { - return ' ' + row + ' '; - }).join('\n'); - }, - // When passing down applied args, we need to turn // them from `{ '0': 'foo', '1': 'bar' }` into ['foo', 'bar'] // instead. diff --git a/lib/utils/pad.js b/lib/utils/pad.js index 4b2a0367..276964bc 100644 --- a/lib/utils/pad.js +++ b/lib/utils/pad.js @@ -3,6 +3,6 @@ const strip = require('strip-ansi'); /** * Pads a value with a space or a specified delimiter to match a given width. */ -module.exports = function pad(value, width, delimiter = ' ') { - return value + delimiter.repeat(Math.max(0, Math.floor(width) - strip(value).length)); +module.exports = function pad(value, width, delimiter) { + return value + (delimiter || ' ').repeat(Math.max(0, Math.floor(width) - strip(value).length)); }; diff --git a/lib/vorpal.js b/lib/vorpal.js index f23ff2dc..4df0c722 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1155,7 +1155,7 @@ vorpal._commandHelp = function (command) { counts[cmd]++; return cmd; })).map(function (cmd) { - let prefix = ` ${VorpalUtil.pad(cmd + ' *', width)} ${counts[cmd]} sub-command${((counts[cmd] === 1) ? '' : 's')}.`; + let prefix = ` ${pad(cmd + ' *', width)} ${counts[cmd]} sub-command${((counts[cmd] === 1) ? '' : 's')}.`; return prefix; }); @@ -1165,11 +1165,11 @@ vorpal._commandHelp = function (command) { var commandsString = (commands.length < 1) ? '' : '\n Commands:\n\n' + commands.map(function (cmd) { - var prefix = ' ' + VorpalUtil.pad(cmd[0], width) + ' '; + var prefix = ' ' + pad(cmd[0], width) + ' '; var suffix = wrap(cmd[1], descriptionWidth - 8).split('\n'); for (let i = 0; i < suffix.length; ++i) { if (i !== 0) { - suffix[i] = VorpalUtil.pad('', width + 6) + suffix[i]; + suffix[i] = pad('', width + 6) + suffix[i]; } } suffix = suffix.join('\n'); @@ -1198,7 +1198,7 @@ vorpal._helpHeader = function (hideTitle) { var header = []; if (this._banner) { - header.push(VorpalUtil.padRow(this._banner), ''); + header.push(padRow(this._banner), ''); } // Only show under specific conditions @@ -1209,12 +1209,12 @@ vorpal._helpHeader = function (hideTitle) { title += ' v' + this._version; } - header.push(VorpalUtil.padRow(title)); + header.push(padRow(title)); if (this._description) { var descWidth = process.stdout.columns * 0.75; // Only 75% of the screen - header.push(VorpalUtil.padRow(wrap(this._description, descWidth))); + header.push(padRow(wrap(this._description, descWidth))); } } From b1501b8c20bb0fe284c100b3f07993a9f6e50ef2 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 22 Jun 2017 00:26:05 -0700 Subject: [PATCH 23/38] Updated deps. --- CHANGELOG.md | 2 +- package.json | 23 ++++--- yarn.lock | 181 +++++++++++++++++++++++++++++++++++---------------- 3 files changed, 138 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e834754e..f4ef1d71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 2.0.0 [IN PROGRESS] #### 💥 Breaking * Updated minimum Node.js requirement to v6.10 (oldest LTS). -* Updated Inquirer.js to v3 from v0.11. +* Updated Inquirer.js to v3.1 from v0.11. * Removed `Command#autocompletion` method. #### 🚀 New diff --git a/package.json b/package.json index f410e542..204cae5e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/dthree/vorpal#readme", "devDependencies": { - "@milesj/build-tool-config": "^0.7.1", + "@milesj/build-tool-config": "^0.9.0", "bluebird": "^3.5.0", "mocha": "^3.4.2", "should": "^11.2.1", @@ -43,12 +43,12 @@ }, "dependencies": { "chalk": "^1.1.0", - "inquirer": "^3.0.6", + "inquirer": "^3.1.1", "lodash": "^4.17.0", "log-update": "^2.0.0", "minimist": "^1.2.0", "node-localstorage": "^1.3.0", - "strip-ansi": "^3.0.0", + "strip-ansi": "^4.0.0", "wrap-ansi": "^2.1.0" }, "engines": { @@ -58,13 +58,16 @@ "eslintConfig": { "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5", "rules": { - "comma-dangle": ["error", { - "arrays": "always-multiline", - "objects": "always-multiline", - "imports": "never", - "exports": "never", - "functions": "never" - }], + "comma-dangle": [ + "error", + { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "never", + "exports": "never", + "functions": "never" + } + ], "no-underscore-dangle": "off" } } diff --git a/yarn.lock b/yarn.lock index ac7eaa78..bcff2289 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,15 +2,15 @@ # yarn lockfile v1 -"@milesj/build-tool-config@^0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.7.1.tgz#9312fdc3d31007b5a1fde613e274ff1f296d7e65" +"@milesj/build-tool-config@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.9.0.tgz#0c998c868edc849c8f004167aa4aeb64c55e8a17" dependencies: babel-cli "^6.24.1" babel-eslint "^7.2.0" babel-jest "^20.0.3" babel-plugin-transform-runtime "^6.23.0" - babel-preset-env "^1.5.1" + babel-preset-env "^1.5.2" babel-preset-flow "^6.23.0" babel-preset-react "^6.24.1" babel-preset-stage-2 "^6.24.1" @@ -19,26 +19,28 @@ enzyme "^2.8.2" eslint "^3.19.0" eslint-config-airbnb "^15.0.1" - eslint-plugin-flowtype "^2.33.0" + eslint-plugin-flowtype "^2.34.0" eslint-plugin-import "^2.3.0" eslint-plugin-jest "^20.0.3" eslint-plugin-jsx-a11y "^5.0.3" + eslint-plugin-promise "^3.5.0" eslint-plugin-react "^7.0.1" - flow-bin "^0.47.0" + eslint-plugin-unicorn "^2.1.1" + flow-bin "^0.48.0" jest "^20.0.4" json5 "^0.5.1" - react "^15.5.4" - react-dom "^15.5.4" - react-test-renderer "^15.5.4" + react "^15.6.1" + react-dom "^15.6.1" + react-test-renderer "^15.6.1" rimraf "^2.6.1" - rollup "^0.41.6" + rollup "^0.43.0" rollup-plugin-babel "^2.7.1" rollup-plugin-commonjs "^8.0.2" - rollup-plugin-json "^2.1.1" + rollup-plugin-json "^2.3.0" rollup-plugin-node-resolve "^3.0.0" rollup-plugin-replace "^1.1.1" rollup-plugin-uglify "^2.0.1" - rollup-watch "^3.2.2" + rollup-watch "^4.0.0" abab@^1.0.3: version "1.0.3" @@ -99,6 +101,10 @@ ansi-escapes@^1.0.0, ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" + ansi-green@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-green/-/ansi-green-0.1.1.tgz#8a5d9a979e458d57c40e33580b37390b8e10d0f7" @@ -109,6 +115,10 @@ ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -811,9 +821,9 @@ babel-polyfill@^6.23.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-preset-env@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.5.1.tgz#d2eca6af179edf27cdc305a84820f601b456dd0b" +babel-preset-env@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.5.2.tgz#cd4ae90a6e94b709f97374b33e5f8b983556adef" dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-syntax-trailing-function-commas "^6.22.0" @@ -1098,7 +1108,7 @@ cheerio@^0.22.0: lodash.reject "^4.4.0" lodash.some "^4.4.0" -chokidar@^1.6.1: +chokidar@^1.6.1, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: @@ -1250,6 +1260,14 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +create-react-class@^15.6.0: + version "15.6.0" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.0.tgz#ab448497c26566e1e29413e883207d57cfe7bed4" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.3.1" + object-assign "^4.1.1" + cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -1585,9 +1603,9 @@ eslint-module-utils@^2.0.0: debug "2.2.0" pkg-dir "^1.0.0" -eslint-plugin-flowtype@^2.33.0: - version "2.33.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.33.0.tgz#b2783814ed2ddcf729953b8f65ff73c90cabee4b" +eslint-plugin-flowtype@^2.34.0: + version "2.34.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" dependencies: lodash "^4.15.0" @@ -1622,6 +1640,10 @@ eslint-plugin-jsx-a11y@^5.0.3: emoji-regex "^6.1.0" jsx-ast-utils "^1.4.0" +eslint-plugin-promise@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" + eslint-plugin-react@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.0.1.tgz#e78107e1e559c6e2b17786bb67c2e2a010ad0d2f" @@ -1630,6 +1652,16 @@ eslint-plugin-react@^7.0.1: has "^1.0.1" jsx-ast-utils "^1.3.4" +eslint-plugin-unicorn@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-2.1.2.tgz#99dffe9f4773b04bc39356a7febd64dd700274bc" + dependencies: + import-modules "^1.1.0" + lodash.camelcase "^4.1.1" + lodash.kebabcase "^4.0.1" + lodash.snakecase "^4.0.1" + lodash.upperfirst "^4.2.0" + eslint@^3.19.0: version "3.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" @@ -1767,7 +1799,7 @@ extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" -external-editor@^2.0.1: +external-editor@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" dependencies: @@ -1922,9 +1954,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.47.0: - version "0.47.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.47.0.tgz#a2a08ab3e0d1f1cb57d17e27b30b118b62fda367" +flow-bin@^0.48.0: + version "0.48.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.48.0.tgz#72d075143524358db8901525e3c784dc13a7c7ee" for-in@^1.0.1: version "1.0.2" @@ -2218,6 +2250,10 @@ ignore@^3.2.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" +import-modules@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/import-modules/-/import-modules-1.1.0.tgz#748db79c5cc42bb9701efab424f894e72600e9dc" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -2255,20 +2291,21 @@ inquirer@^0.12.0: strip-ansi "^3.0.0" through "^2.3.6" -inquirer@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347" +inquirer@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" dependencies: - ansi-escapes "^1.1.0" + ansi-escapes "^2.0.0" chalk "^1.0.0" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^2.0.1" + external-editor "^2.0.4" figures "^2.0.0" lodash "^4.3.0" mute-stream "0.0.7" run-async "^2.2.0" - rx "^4.1.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" string-width "^2.0.0" strip-ansi "^3.0.0" through "^2.3.6" @@ -2985,6 +3022,10 @@ lodash.bind@^4.1.4: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.bind/-/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35" +lodash.camelcase@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" @@ -3021,6 +3062,10 @@ lodash.isarray@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" +lodash.kebabcase@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" + lodash.keys@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" @@ -3049,10 +3094,18 @@ lodash.reject@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.reject/-/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415" +lodash.snakecase@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + lodash.some@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" +lodash.upperfirst@^4.2.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" + lodash@^3.10.0: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" @@ -3307,7 +3360,7 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -3549,7 +3602,7 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@^15.5.4, prop-types@^15.5.7, prop-types@~15.5.7: +prop-types@^15.5.10, prop-types@^15.5.4: version "15.5.10" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" dependencies: @@ -3584,30 +3637,31 @@ rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-dom@^15.5.4: - version "15.5.4" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.5.4.tgz#ba0c28786fd52ed7e4f2135fe0288d462aef93da" +react-dom@^15.6.1: + version "15.6.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.1.tgz#2cb0ed4191038e53c209eb3a79a23e2a4cf99470" dependencies: fbjs "^0.8.9" loose-envify "^1.1.0" object-assign "^4.1.0" - prop-types "~15.5.7" + prop-types "^15.5.10" -react-test-renderer@^15.5.4: - version "15.5.4" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-15.5.4.tgz#d4ebb23f613d685ea8f5390109c2d20fbf7c83bc" +react-test-renderer@^15.6.1: + version "15.6.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-15.6.1.tgz#026f4a5bb5552661fd2cc4bbcd0d4bc8a35ebf7e" dependencies: fbjs "^0.8.9" object-assign "^4.1.0" -react@^15.5.4: - version "15.5.4" - resolved "https://registry.yarnpkg.com/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047" +react@^15.6.1: + version "15.6.1" + resolved "https://registry.yarnpkg.com/react/-/react-15.6.1.tgz#baa8434ec6780bde997cdc380b79cd33b96393df" dependencies: + create-react-class "^15.6.0" fbjs "^0.8.9" loose-envify "^1.1.0" object-assign "^4.1.0" - prop-types "^15.5.7" + prop-types "^15.5.10" read-pkg-up@^1.0.1: version "1.0.1" @@ -3849,11 +3903,11 @@ rollup-plugin-commonjs@^8.0.2: resolve "^1.1.7" rollup-pluginutils "^2.0.1" -rollup-plugin-json@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.1.1.tgz#933390dff3c9e3e654157d61304c5e167fc58623" +rollup-plugin-json@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.3.0.tgz#3c07a452c1b5391be28006fbfff3644056ce0add" dependencies: - rollup-pluginutils "^1.5.2" + rollup-pluginutils "^2.0.1" rollup-plugin-node-resolve@^3.0.0: version "3.0.0" @@ -3878,7 +3932,7 @@ rollup-plugin-uglify@^2.0.1: dependencies: uglify-js "^3.0.9" -rollup-pluginutils@^1.5.0, rollup-pluginutils@^1.5.2: +rollup-pluginutils@^1.5.0: version "1.5.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" dependencies: @@ -3892,15 +3946,16 @@ rollup-pluginutils@^2.0.1: estree-walker "^0.3.0" micromatch "^2.3.11" -rollup-watch@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-3.2.2.tgz#5e574232e9ef36da9177f46946d8080cb267354b" +rollup-watch@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-4.0.0.tgz#309051b9403b9e5445c5746c9eba9a466951d39e" dependencies: + chokidar "^1.7.0" require-relative "0.8.7" -rollup@^0.41.6: - version "0.41.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" +rollup@^0.43.0: + version "0.43.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.43.0.tgz#b36bdb75fa5e0823b6de8aee18ff7b5655520543" dependencies: source-map-support "^0.4.0" @@ -3916,14 +3971,20 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" -rx@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" - safe-buffer@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" @@ -4134,6 +4195,12 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + strip-bom-buffer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/strip-bom-buffer/-/strip-bom-buffer-0.1.1.tgz#ca3ddc4919c13f9fddf30b1dff100a9835248b4d" From e82e35ad4e0c6991d40cc08501d9019baea7b35a Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 22 Jun 2017 19:02:47 -0700 Subject: [PATCH 24/38] Fix logging problem. --- lib/command-instance.js | 4 ++-- lib/intercept.js | 8 +++----- lib/logger.js | 20 ++++++++++---------- lib/session.js | 16 +++++++--------- lib/ui.js | 5 +++++ lib/vorpal.js | 4 ++-- 6 files changed, 29 insertions(+), 28 deletions(-) diff --git a/lib/command-instance.js b/lib/command-instance.js index f924730e..254a7290 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -51,9 +51,9 @@ class CommandInstance { if (typeof validate === 'function') { try { validate.call(this.downstream, this.downstream.args); - } catch (e) { + } catch (error) { // Log error without piping to downstream on validation error. - this.session.log(e.toString()); + this.session.log(error.toString()); onComplete(); return; diff --git a/lib/intercept.js b/lib/intercept.js index 72211c38..3003fad2 100755 --- a/lib/intercept.js +++ b/lib/intercept.js @@ -20,16 +20,14 @@ module.exports = function (callback) { var oldStdoutWrite = process.stdout.write; var oldConsoleError = console.error; process.stdout.write = (function (write) { - return function (string) { - var args = _.toArray(arguments); - args[0] = interceptor(string); + return function (...args) { + args[0] = interceptor(args[0]); write.apply(process.stdout, args); }; }(process.stdout.write)); console.error = (function () { - return function () { - var args = _.toArray(arguments); + return function (...args) { args.unshift('\x1b[31m[ERROR]\x1b[0m'); console.log.apply(console.log, args); }; diff --git a/lib/logger.js b/lib/logger.js index bd64d405..91841b3b 100755 --- a/lib/logger.js +++ b/lib/logger.js @@ -54,30 +54,30 @@ function trimTo(str, amt) { function Logger(cons) { var logger = cons || console; - log = function () { - logger.log.apply(logger, arguments); + const log = function (...args) { + logger.log(...args); }; - log.cols = function () { + log.cols = function (...args) { var width = process.stdout.columns; var pads = 0; var padsWidth = 0; var cols = 0; var colsWidth = 0; - var input = arguments; + var input = args; - for (var h = 0; h < arguments.length; ++h) { - if (typeof arguments[h] === 'number') { - padsWidth += arguments[h]; + for (var h = 0; h < args.length; ++h) { + if (typeof args[h] === 'number') { + padsWidth += args[h]; pads++; } - if (_.isArray(arguments[h]) && typeof arguments[h][0] === 'number') { - padsWidth += arguments[h][0]; + if (_.isArray(args[h]) && typeof args[h][0] === 'number') { + padsWidth += args[h][0]; pads++; } } - cols = arguments.length - pads; + cols = args.length - pads; colsWidth = Math.floor((width - padsWidth) / cols); var lines = []; diff --git a/lib/session.js b/lib/session.js index 1222bfdd..3952e9e5 100755 --- a/lib/session.js +++ b/lib/session.js @@ -73,9 +73,8 @@ module.exports = exports = Session; * @api public */ -session.log = function () { - var args = util.fixArgsForApply(arguments); - return this._log.apply(this, args); +session.log = function (...args) { + return this._log(...args); }; /** @@ -87,16 +86,16 @@ session.log = function () { * @api public */ -session._log = function () { +session._log = function (...args) { var self = this; if (this.isLocal()) { - this.parent.ui.log.apply(this.parent.ui, arguments); + this.parent.ui.log(...args); } else { // If it's an error, expose the stack. Otherwise // we get a helpful '{}'. var args = []; - for (var i = 0; i < arguments.length; ++i) { - var str = arguments[i]; + for (var i = 0; i < args.length; ++i) { + var str = args[i]; str = (str && str.stack) ? 'Error: ' + str.message : str; args.push(str); } @@ -472,8 +471,7 @@ session.execCommandSet = function (wrapper, callback) { } // Call the root command. - res = wrapper.fn.call(commandInstance, wrapper.args, function () { - var argus = util.fixArgsForApply(arguments); + res = wrapper.fn.call(commandInstance, wrapper.args, function (...argus) { onCompletion(wrapper, argus[0], argus[1], argus); }); diff --git a/lib/ui.js b/lib/ui.js index 11298540..24cc1e14 100755 --- a/lib/ui.js +++ b/lib/ui.js @@ -363,14 +363,19 @@ class UI extends EventEmitter { return this; } + // TODO/NOTE - These console logs aren't for debugging. if (this.midPrompt()) { const data = this.pause(); + console.log(...args); + if (data) { this.resume(data); } else { console.log('Log got back \'false\' as data. This shouldn\'t happen.', data); } + } else { + console.log(...args); } return this; diff --git a/lib/vorpal.js b/lib/vorpal.js index 4df0c722..fbdbc085 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -398,8 +398,8 @@ vorpal.default = function (name, desc, opts) { * @api public */ -vorpal.log = function () { - this.ui.log.apply(this.ui, arguments); +vorpal.log = function (...args) { + this.ui.log(...args); return this; }; From dfe231dabeaad1c806a44a0ea90562e57df801e6 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 27 Jun 2017 20:07:00 -0700 Subject: [PATCH 25/38] Added flow. Reintegrated babel. --- .flowconfig | 18 +++++++ examples/prompt/prompt.js | 2 +- flow/minimist.flow.js | 19 +++++++ flow/strip-ansi.flow.js | 3 ++ lib/command.js | 2 +- lib/constants.js | 4 +- lib/logger.js | 2 +- lib/types.js | 1 + lib/util.js | 30 ++--------- lib/utils/buildCommandArgs.js | 2 +- lib/utils/pad.js | 7 +-- lib/utils/padRow.js | 7 +-- lib/utils/parseArgs.js | 12 +++-- lib/utils/prettifyArray.js | 2 +- lib/vorpal.js | 4 +- package.json | 7 ++- yarn.lock | 94 +++++++++++++++++++---------------- 17 files changed, 127 insertions(+), 89 deletions(-) create mode 100644 .flowconfig create mode 100644 flow/minimist.flow.js create mode 100644 flow/strip-ansi.flow.js create mode 100644 lib/types.js diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 00000000..ba6b6af7 --- /dev/null +++ b/.flowconfig @@ -0,0 +1,18 @@ +[include] +./src + +[ignore] +.*/node_modules/.* +.*/tests/.* +.*\.test\.js + +[libs] +./flow + +[options] +emoji=true +esproposal.class_instance_fields=enable +esproposal.class_static_fields=enable +esproposal.export_star_as=enable +module.ignore_non_literal_requires=true +suppress_comment=\\(.\\|\n\\)*\\$FlowIgnore diff --git a/examples/prompt/prompt.js b/examples/prompt/prompt.js index 1a4bdfac..2eb69450 100755 --- a/examples/prompt/prompt.js +++ b/examples/prompt/prompt.js @@ -1,6 +1,6 @@ 'use strict'; -var vorpal = require('./../../')(); +var vorpal = require('../../dist/vorpal')(); vorpal.command('login', 'Login (u: root p: vorpal)') .action(function (args, cb) { diff --git a/flow/minimist.flow.js b/flow/minimist.flow.js new file mode 100644 index 00000000..062fc4a4 --- /dev/null +++ b/flow/minimist.flow.js @@ -0,0 +1,19 @@ +declare module 'minimist' { + declare export type CLIParserOptions = { + alias?: { [arg: string]: string | string[] }, + boolean?: boolean | string | string[], + default?: { [arg: string]: string | boolean | number | null }, + stopEarly?: boolean, + string?: string | string[], + unknown?: (arg: string) => boolean, + '--'?: boolean, + }; + + declare export type CLIArgs = { + _: string | string[], + '--'?: string | string[], + [key: string]: string | boolean | number, + } + + declare export default function minimist(args: string[], opts?: CLIParserOptions): CLIArgs; +} diff --git a/flow/strip-ansi.flow.js b/flow/strip-ansi.flow.js new file mode 100644 index 00000000..51ef1209 --- /dev/null +++ b/flow/strip-ansi.flow.js @@ -0,0 +1,3 @@ +declare module 'strip-ansi' { + declare export default function stripAnsi(input: string): string; +} diff --git a/lib/command.js b/lib/command.js index 3844d997..bd253278 100755 --- a/lib/command.js +++ b/lib/command.js @@ -2,7 +2,7 @@ const { EventEmitter } = require('events'); const Option = require('./option'); const camelCase = require('./utils/camelCase'); const humanReadableArgName = require('./utils/humanReadableArgName'); -const pad = require('./utils/pad'); +import pad from './utils/pad'; const VorpalUtil = require('./util'); diff --git a/lib/constants.js b/lib/constants.js index bfcb313c..d51161a6 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,4 +1,6 @@ -const PADDING = ' '; +// @flow + +const PADDING: string = ' '; exports.PADDING = PADDING; exports.PADDING_SIZE = PADDING.length; diff --git a/lib/logger.js b/lib/logger.js index 91841b3b..921d562f 100755 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,4 +1,4 @@ -const pad = require('./utils/pad'); +import pad from './utils/pad'; /** * Module dependencies. diff --git a/lib/types.js b/lib/types.js new file mode 100644 index 00000000..46e7f7c0 --- /dev/null +++ b/lib/types.js @@ -0,0 +1 @@ +// @flow diff --git a/lib/util.js b/lib/util.js index 3e2970dc..220646c9 100755 --- a/lib/util.js +++ b/lib/util.js @@ -8,34 +8,10 @@ const _ = require('lodash'); const minimist = require('minimist'); const strip = require('strip-ansi'); -const pad = require('./utils/pad'); +import pad from './utils/pad'; +import parseArgs from './utils/parseArgs'; const util = { - /** - * Parses command arguments from multiple - * sources. - * - * @param {String} str - * @param {Object} opts - * @return {Array} - * @api private - */ - - parseArgs: function (str, opts) { - const reg = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; - let arr = []; - let match; - do { - match = reg.exec(str); - if (match !== null) { - arr.push(match[1] || match[2] || match[3] || match[4]); - } - } while (match !== null); - - arr = minimist(arr, opts); - arr._ = arr._ || []; - return arr; - }, /** * Prepares a command and all its parts for execution. @@ -255,7 +231,7 @@ const util = { }); // Use minimist to parse the args. - const parsedArgs = this.parseArgs(passedArgs, types); + const parsedArgs = parseArgs(passedArgs, types); function validateArg(arg, cmdArg) { return !(arg === undefined && cmdArg.required === true); diff --git a/lib/utils/buildCommandArgs.js b/lib/utils/buildCommandArgs.js index 38a4f046..52b49548 100644 --- a/lib/utils/buildCommandArgs.js +++ b/lib/utils/buildCommandArgs.js @@ -1,4 +1,4 @@ -const parseArgs = require('./parseArgs'); +import parseArgs from './parseArgs'; const PAIR_NORMALIZE_PATTERN = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; const MAX_ARGS = 10; diff --git a/lib/utils/pad.js b/lib/utils/pad.js index 276964bc..f7f4fde5 100644 --- a/lib/utils/pad.js +++ b/lib/utils/pad.js @@ -1,8 +1,9 @@ -const strip = require('strip-ansi'); +// @flow +import strip from 'strip-ansi'; /** * Pads a value with a space or a specified delimiter to match a given width. */ -module.exports = function pad(value, width, delimiter) { +export default function pad(value: string, width: number, delimiter?: string): string { return value + (delimiter || ' ').repeat(Math.max(0, Math.floor(width) - strip(value).length)); -}; +} diff --git a/lib/utils/padRow.js b/lib/utils/padRow.js index dbbdae45..cb7a81ba 100644 --- a/lib/utils/padRow.js +++ b/lib/utils/padRow.js @@ -1,8 +1,9 @@ -const { PADDING } = require('../constants'); +// @flow +import { PADDING } from '../constants'; /** * Pad a row on the start and end with spaces. */ -module.exports = function padRow(value) { +export default function padRow(value: string): string { return value.split('\n').map(row => PADDING + row + PADDING).join('\n'); -}; +} diff --git a/lib/utils/parseArgs.js b/lib/utils/parseArgs.js index 4b59bf99..09a9268f 100644 --- a/lib/utils/parseArgs.js +++ b/lib/utils/parseArgs.js @@ -1,11 +1,15 @@ -const minimist = require('minimist'); +// @flow +import minimist from 'minimist'; -const ARGS_PATTERN = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; +import type { CLIArgs, CLIParserOptions } from 'minimist'; + +const ARGS_PATTERN: RegExp = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; /** * Parses command arguments from multiple sources. */ -module.exports = function parseArgs(input, opts = {}) { +export default function parseArgs(input: string, opts?: CLIParserOptions = {}): CLIArgs { + console.log('parseArgs()', 'input=', input, 'opts=', opts); let args = []; let match; @@ -21,4 +25,4 @@ module.exports = function parseArgs(input, opts = {}) { args._ = args._ || []; return args; -}; +} diff --git a/lib/utils/prettifyArray.js b/lib/utils/prettifyArray.js index 0e13aadd..ca4fd862 100644 --- a/lib/utils/prettifyArray.js +++ b/lib/utils/prettifyArray.js @@ -1,5 +1,5 @@ const strip = require('strip-ansi'); -const pad = require('./pad'); +import pad from './pad'; const { PADDING_SIZE } = require('../constants'); /** diff --git a/lib/vorpal.js b/lib/vorpal.js index fbdbc085..ae7e3b41 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -2,8 +2,8 @@ const CommandInstance = require('./command-instance'); const buildCommandArgs = require('./utils/buildCommandArgs'); const humanReadableArgName = require('./utils/humanReadableArgName'); const matchCommand = require('./utils/matchCommand'); -const pad = require('./utils/pad'); -const padRow = require('./utils/padRow'); +import pad from './utils/pad'; +import padRow from './utils/padRow'; const parseCommand = require('./utils/parseCommand'); const prettifyArray = require('./utils/prettifyArray'); diff --git a/package.json b/package.json index 204cae5e..9517e2f0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "description": "Node's first framework for building immersive CLI apps.", "main": "./lib/vorpal.js", "scripts": { + "build": "build-lib ./lib -d ./dist", + "flow": "type-check", "lint": "run-linter ./lib", "lint:only": "run-linter", "test": "mocha" @@ -34,7 +36,7 @@ }, "homepage": "https://github.com/dthree/vorpal#readme", "devDependencies": { - "@milesj/build-tool-config": "^0.9.0", + "@milesj/build-tool-config": "^0.11.2", "bluebird": "^3.5.0", "mocha": "^3.4.2", "should": "^11.2.1", @@ -55,6 +57,9 @@ "node": ">=6.10.0", "npm": ">=3.10.0" }, + "babel": { + "extends": "./node_modules/@milesj/build-tool-config/babel.node.json5" + }, "eslintConfig": { "extends": "./node_modules/@milesj/build-tool-config/eslint.node.json5", "rules": { diff --git a/yarn.lock b/yarn.lock index bcff2289..9f34921b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,14 @@ # yarn lockfile v1 -"@milesj/build-tool-config@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.9.0.tgz#0c998c868edc849c8f004167aa4aeb64c55e8a17" +"@milesj/build-tool-config@^0.11.2": + version "0.11.2" + resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.11.2.tgz#defc773e5ca6701ff2cb4b7375c5bcea27e8d9fe" dependencies: babel-cli "^6.24.1" babel-eslint "^7.2.0" babel-jest "^20.0.3" + babel-plugin-transform-export-extensions "^6.22.0" babel-plugin-transform-runtime "^6.23.0" babel-preset-env "^1.5.2" babel-preset-flow "^6.23.0" @@ -16,16 +17,16 @@ babel-preset-stage-2 "^6.24.1" babel-runtime "^6.23.0" copy "^0.3.0" - enzyme "^2.8.2" + enzyme "^2.9.1" eslint "^3.19.0" eslint-config-airbnb "^15.0.1" eslint-plugin-flowtype "^2.34.0" - eslint-plugin-import "^2.3.0" + eslint-plugin-import "^2.6.0" eslint-plugin-jest "^20.0.3" - eslint-plugin-jsx-a11y "^5.0.3" + eslint-plugin-jsx-a11y "^6.0.0" eslint-plugin-promise "^3.5.0" - eslint-plugin-react "^7.0.1" - eslint-plugin-unicorn "^2.1.1" + eslint-plugin-react "^7.1.0" + eslint-plugin-unicorn "^2.1.2" flow-bin "^0.48.0" jest "^20.0.4" json5 "^0.5.1" @@ -163,9 +164,9 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -aria-query@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.5.0.tgz#85e3152cd8cc5bab18dbed61cd9c4fce54fa79c3" +aria-query@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.7.0.tgz#4af10a1e61573ddea0cf3b99b51c52c05b424d24" dependencies: ast-types-flow "0.0.7" @@ -525,6 +526,10 @@ babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" +babel-plugin-syntax-export-extensions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" + babel-plugin-syntax-flow@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" @@ -752,6 +757,13 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e babel-plugin-syntax-exponentiation-operator "^6.8.0" babel-runtime "^6.22.0" +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" + dependencies: + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.22.0" + babel-plugin-transform-flow-strip-types@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" @@ -1325,7 +1337,7 @@ debug@2.6.0, debug@^2.1.1, debug@^2.2.0: dependencies: ms "0.7.2" -debug@^2.6.3: +debug@^2.6.3, debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: @@ -1458,20 +1470,20 @@ entities@^1.1.1, entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" -enzyme@^2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-2.8.2.tgz#6c8bcb05012abc4aa4bc3213fb23780b9b5b1714" +enzyme@^2.9.1: + version "2.9.1" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-2.9.1.tgz#07d5ce691241240fb817bf2c4b18d6e530240df6" dependencies: cheerio "^0.22.0" function.prototype.name "^1.0.0" is-subset "^0.1.1" - lodash "^4.17.2" + lodash "^4.17.4" object-is "^1.0.1" object.assign "^4.0.4" - object.entries "^1.0.3" - object.values "^1.0.3" - prop-types "^15.5.4" - uuid "^2.0.3" + object.entries "^1.0.4" + object.values "^1.0.4" + prop-types "^15.5.10" + uuid "^3.0.1" "errno@>=0.1.1 <0.2.0-0": version "0.1.4" @@ -1609,13 +1621,13 @@ eslint-plugin-flowtype@^2.34.0: dependencies: lodash "^4.15.0" -eslint-plugin-import@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.3.0.tgz#37c801e0ada0e296cbdf20c3f393acb5b52af36b" +eslint-plugin-import@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.6.0.tgz#2a4bbad36a078e052a3c830ce3dfbd6b8a12c6e5" dependencies: builtin-modules "^1.1.1" contains-path "^0.1.0" - debug "^2.2.0" + debug "^2.6.8" doctrine "1.5.0" eslint-import-resolver-node "^0.2.0" eslint-module-utils "^2.0.0" @@ -1628,11 +1640,11 @@ eslint-plugin-jest@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-20.0.3.tgz#ec15eba6ac0ab44a67ebf6e02672ca9d7e7cba29" -eslint-plugin-jsx-a11y@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.0.3.tgz#4a939f76ec125010528823331bf948cc573380b6" +eslint-plugin-jsx-a11y@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.0.tgz#d5cdd68f665a89540a55ddc0d898caf80ca94ac5" dependencies: - aria-query "^0.5.0" + aria-query "^0.7.0" array-includes "^3.0.3" ast-types-flow "0.0.7" axobject-query "^0.1.0" @@ -1644,15 +1656,15 @@ eslint-plugin-promise@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" -eslint-plugin-react@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.0.1.tgz#e78107e1e559c6e2b17786bb67c2e2a010ad0d2f" +eslint-plugin-react@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz#27770acf39f5fd49cd0af4083ce58104eb390d4c" dependencies: doctrine "^2.0.0" has "^1.0.1" - jsx-ast-utils "^1.3.4" + jsx-ast-utils "^1.4.1" -eslint-plugin-unicorn@^2.1.1: +eslint-plugin-unicorn@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-2.1.2.tgz#99dffe9f4773b04bc39356a7febd64dd700274bc" dependencies: @@ -2924,7 +2936,7 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.3.6" -jsx-ast-utils@^1.3.4, jsx-ast-utils@^1.4.0: +jsx-ast-utils@^1.4.0, jsx-ast-utils@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" @@ -3110,7 +3122,7 @@ lodash@^3.10.0: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.0, lodash@^4.17.2, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3380,7 +3392,7 @@ object.assign@^4.0.4: function-bind "^1.1.0" object-keys "^1.0.10" -object.entries@^1.0.3: +object.entries@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f" dependencies: @@ -3396,7 +3408,7 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -object.values@^1.0.3: +object.values@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a" dependencies: @@ -3602,7 +3614,7 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@^15.5.10, prop-types@^15.5.4: +prop-types@^15.5.10: version "15.5.10" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" dependencies: @@ -4422,11 +4434,7 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -uuid@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" - -uuid@^3.0.0: +uuid@^3.0.0, uuid@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" From ec34bf3e6881a59794dab94adb975c6ec8dd39c2 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 27 Jun 2017 20:24:30 -0700 Subject: [PATCH 26/38] Ported more utils to flow. --- examples/calculator/calculator.js | 3 +- examples/descriptors/descriptors.js | 2 +- lib/command.js | 6 +-- lib/types.js | 6 +++ lib/util.js | 58 ----------------------------- lib/utils/camelCase.js | 6 ++- lib/utils/humanReadableArgName.js | 7 +++- lib/utils/parseArgs.js | 1 - lib/utils/prettifyArray.js | 10 +++-- lib/vorpal.js | 8 ++-- 10 files changed, 31 insertions(+), 76 deletions(-) diff --git a/examples/calculator/calculator.js b/examples/calculator/calculator.js index ad43c286..9a518ac5 100755 --- a/examples/calculator/calculator.js +++ b/examples/calculator/calculator.js @@ -1,6 +1,6 @@ 'use strict'; -var vorpal = require('./../../')(); +var vorpal = require('../../dist/vorpal')(); var less = require('vorpal-less'); var repl = require('vorpal-repl'); vorpal.use(less).use(repl); @@ -9,6 +9,7 @@ vorpal.command('add [numbers...]', 'Adds numbers together') .alias('addition') .alias('plus') .action(function (args, cb) { + console.log(args); var numbers = args.numbers; var sum = 0; for (var i = 0; i < numbers.length; ++i) { diff --git a/examples/descriptors/descriptors.js b/examples/descriptors/descriptors.js index 8ce486e5..57712b57 100644 --- a/examples/descriptors/descriptors.js +++ b/examples/descriptors/descriptors.js @@ -1,6 +1,6 @@ 'use strict'; -var vorpal = require('./../../')(); +var vorpal = require('../../dist/vorpal')(); var chalk = vorpal.chalk; vorpal diff --git a/lib/command.js b/lib/command.js index bd253278..8f1abefc 100755 --- a/lib/command.js +++ b/lib/command.js @@ -1,7 +1,7 @@ const { EventEmitter } = require('events'); const Option = require('./option'); -const camelCase = require('./utils/camelCase'); -const humanReadableArgName = require('./utils/humanReadableArgName'); +import camelCase from './utils/camelCase'; +import humanReadableArgName from './utils/humanReadableArgName'; import pad from './utils/pad'; const VorpalUtil = require('./util'); @@ -310,7 +310,7 @@ class Command extends EventEmitter { */ usage(usage) { if (!usage) { - const args = this._args.map(arg => VorpalUtil.humanReadableArgName(arg)); + const args = this._args.map(arg => humanReadableArgName(arg)); return this._usage || [ '[options]', diff --git a/lib/types.js b/lib/types.js index 46e7f7c0..c4a72c33 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1 +1,7 @@ // @flow + +export type Argument = { + name: string, + required: boolean, + variadic: boolean, +}; diff --git a/lib/util.js b/lib/util.js index 220646c9..3ded2e69 100755 --- a/lib/util.js +++ b/lib/util.js @@ -326,64 +326,6 @@ const util = { return args; }, - /** - * Makes an argument name pretty for help. - * - * @param {String} arg - * @return {String} - * @api private - */ - - humanReadableArgName: function (arg) { - const nameOutput = arg.name + (arg.variadic === true ? '...' : ''); - return arg.required ? - `<${nameOutput}>` : - `[${nameOutput}]`; - }, - - /** - * Formats an array to display in a TTY - * in a pretty fashion. - * - * @param {Array} arr - * @return {String} - * @api public - */ - - prettifyArray: function (arr) { - arr = arr || []; - const arrClone = _.clone(arr); - const width = process.stdout.columns; - const longest = strip((arrClone.sort(function (a, b) { - return strip(b).length - strip(a).length; - })[0] || '')).length + 2; - const fullWidth = strip(String(arr.join(''))).length; - const fitsOneLine = ((fullWidth + (arr.length * 2)) <= width); - let cols = Math.floor(width / longest); - cols = (cols < 1) ? 1 : cols; - if (fitsOneLine) { - return arr.join(' '); - } - let col = 0; - const lines = []; - let line = ''; - for (const key in arr) { - const arrEl = arr[key]; - if (col < cols) { - col++; - } else { - lines.push(line); - line = ''; - col = 1; - } - line += pad(arrEl, longest, ' '); - } - if (line !== '') { - lines.push(line); - } - return lines.join('\n'); - }, - // When passing down applied args, we need to turn // them from `{ '0': 'foo', '1': 'bar' }` into ['foo', 'bar'] // instead. diff --git a/lib/utils/camelCase.js b/lib/utils/camelCase.js index c91c191f..5a89d655 100644 --- a/lib/utils/camelCase.js +++ b/lib/utils/camelCase.js @@ -1,3 +1,5 @@ -module.exports = function camelCase(string) { +// @flow + +export default function camelCase(string: string): string { return string.split('-').reduce((str, word) => str + word[0].toUpperCase() + word.slice(1)); -}; +} diff --git a/lib/utils/humanReadableArgName.js b/lib/utils/humanReadableArgName.js index e08c9c47..5d12062c 100644 --- a/lib/utils/humanReadableArgName.js +++ b/lib/utils/humanReadableArgName.js @@ -1,8 +1,11 @@ +// @flow +import type { Argument } from '../types'; + /** * Makes an argument name pretty for help. */ -module.exports = function humanReadableArgName(arg) { +export default function humanReadableArgName(arg: Argument): string { const name = arg.name + (arg.variadic ? '...' : ''); return arg.required ? `<${name}>` : `[${name}]`; -}; +} diff --git a/lib/utils/parseArgs.js b/lib/utils/parseArgs.js index 09a9268f..668e6fd1 100644 --- a/lib/utils/parseArgs.js +++ b/lib/utils/parseArgs.js @@ -9,7 +9,6 @@ const ARGS_PATTERN: RegExp = /"(.*?)"|'(.*?)'|`(.*?)`|([^\s"]+)/gi; * Parses command arguments from multiple sources. */ export default function parseArgs(input: string, opts?: CLIParserOptions = {}): CLIArgs { - console.log('parseArgs()', 'input=', input, 'opts=', opts); let args = []; let match; diff --git a/lib/utils/prettifyArray.js b/lib/utils/prettifyArray.js index ca4fd862..58ab2404 100644 --- a/lib/utils/prettifyArray.js +++ b/lib/utils/prettifyArray.js @@ -1,14 +1,16 @@ -const strip = require('strip-ansi'); +// @flow +import strip from 'strip-ansi'; import pad from './pad'; -const { PADDING_SIZE } = require('../constants'); +import { PADDING_SIZE } from '../constants'; /** * Formats an array for display in a TTY in a pretty fashion. */ -module.exports = function prettifyArray(baseArray) { +export default function prettifyArray(baseArray?: string[]): string { const array = baseArray ? [...baseArray] : []; // Calculate widths + // $FlowIgnore `columns` is not defined const maxWidth = process.stdout.columns; const longestWidth = array.reduce((longest, item) => { const { length } = strip(item); @@ -45,4 +47,4 @@ module.exports = function prettifyArray(baseArray) { } return lines.join('\n'); -}; +} diff --git a/lib/vorpal.js b/lib/vorpal.js index ae7e3b41..cf773688 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,11 +1,11 @@ const CommandInstance = require('./command-instance'); const buildCommandArgs = require('./utils/buildCommandArgs'); -const humanReadableArgName = require('./utils/humanReadableArgName'); +import humanReadableArgName from './utils/humanReadableArgName'; const matchCommand = require('./utils/matchCommand'); import pad from './utils/pad'; import padRow from './utils/padRow'; const parseCommand = require('./utils/parseCommand'); -const prettifyArray = require('./utils/prettifyArray'); +import prettifyArray from './utils/prettifyArray'; /** * Module dependencies. (OLD) @@ -552,7 +552,7 @@ vorpal._onKeypress = function (key, value) { this.session.getKeypressResult(key, value, function (err, result) { if (!err && result !== undefined) { if (_.isArray(result)) { - var formatted = VorpalUtil.prettifyArray(result); + var formatted = prettifyArray(result); self.ui.imprint(); self.session.log(formatted); } else { @@ -1124,7 +1124,7 @@ vorpal._commandHelp = function (command) { return (String(cmd._name).trim().split(' ').length <= commandMatchLength); }).map(function (cmd) { var args = cmd._args.map(function (arg) { - return VorpalUtil.humanReadableArgName(arg); + return humanReadableArgName(arg); }).join(' '); return [ From aed38a43f72034162c109d8d5fa7ee8281cf1766 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 27 Jun 2017 23:11:38 -0700 Subject: [PATCH 27/38] Added matchCommand. --- lib/util.js | 76 ++------------------------------------- lib/utils/matchCommand.js | 35 +++++++++--------- lib/utils/parseCommand.js | 2 +- lib/vorpal.js | 6 ++-- 4 files changed, 25 insertions(+), 94 deletions(-) diff --git a/lib/util.js b/lib/util.js index 3ded2e69..e927eba4 100755 --- a/lib/util.js +++ b/lib/util.js @@ -8,6 +8,7 @@ const _ = require('lodash'); const minimist = require('minimist'); const strip = require('strip-ansi'); +import matchCommand from './utils/matchCommand'; import pad from './utils/pad'; import parseArgs from './utils/parseArgs'; @@ -83,7 +84,7 @@ const util = { } function parseMatch() { - matchParts = self.matchCommand(command, commands); + matchParts = matchCommand(command, commands); match = matchParts.command; matchArgs = matchParts.args; } @@ -105,79 +106,6 @@ const util = { }); }, - /** - * Run a raw command string, e.g. foo -bar - * against a given list of commands, - * and if there is a match, parse the - * results. - * - * @param {String} cmd - * @param {Array} cmds - * @return {Object} - * @api public - */ - - matchCommand: function (cmd, cmds) { - const parts = String(cmd).trim().split(' '); - - let match; - let matchArgs; - for (let i = 0; i < parts.length; ++i) { - const subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); - match = _.find(cmds, {_name: subcommand}) || match; - if (!match) { - for (const key in cmds) { - const cmd = cmds[key]; - const idx = cmd._aliases.indexOf(subcommand); - match = (idx > -1) ? cmd : match; - } - } - if (match) { - matchArgs = parts.slice(parts.length - i, parts.length).join(' '); - break; - } - } - // If there's no command match, check if the - // there's a `catch` command, which catches all - // missed commands. - if (!match) { - match = _.find(cmds, {_catch: true}); - // If there is one, we still need to make sure we aren't - // partially matching command groups, such as `do things` when - // there is a command `do things well`. If we match partially, - // we still want to show the help menu for that command group. - if (match) { - const allCommands = _.map(cmds, '_name'); - let wordMatch = false; - for (const key in allCommands) { - const cmd = allCommands[key]; - const parts2 = String(cmd).split(' '); - const cmdParts = String(match.command).split(' '); - let matchAll = true; - for (let k = 0; k < cmdParts.length; ++k) { - if (parts2[k] !== cmdParts[k]) { - matchAll = false; - break; - } - } - if (matchAll) { - wordMatch = true; - break; - } - } - if (wordMatch) { - match = undefined; - } else { - matchArgs = cmd; - } - } - } - - return ({ - command: match, - args: matchArgs - }); - }, buildCommandArgs: function (passedArgs, cmd, execCommand, isCommandArgKeyPairNormalized) { let args = {options: {}}; diff --git a/lib/utils/matchCommand.js b/lib/utils/matchCommand.js index 6d8336b3..1e4a0c74 100644 --- a/lib/utils/matchCommand.js +++ b/lib/utils/matchCommand.js @@ -1,22 +1,25 @@ +// @flow +import Command from '../command'; + /** * Run a raw command string, e.g. foo -bar against a given list of commands, * and if there is a match, parse the results. */ -module.exports = function matchCommand(command, commands = []) { - const parts = String(command).trim().split(' '); +export default function matchCommand(commandName: string, commands: Command[] = []): { + args: string, + command: ?Command, +} { + const parts = commandName.trim().split(' '); let match; let matchArgs; for (let i = 0; i < parts.length; i += 1) { - const subcommand = String(parts.slice(0, parts.length - i).join(' ')).trim(); - match = commands.find(cmd => cmd._name === subcommand) || match; + const subcommandName = String(parts.slice(0, parts.length - i).join(' ')).trim(); - if (!match) { - // eslint-disable-next-line no-loop-func - commands.forEach((cmd) => { - match = command._aliases.includes(subcommand) ? cmd : match; - }); - } + match = ( + commands.find(command => command._name === subcommandName) || + commands.find(command => command._aliases.includes(subcommandName)) + ); if (match) { matchArgs = parts.slice(parts.length - i, parts.length).join(' '); @@ -27,7 +30,7 @@ module.exports = function matchCommand(command, commands = []) { // If there's no command match, check if the there's a `catch` command, // which catches all missed commands. if (!match) { - match = commands.find(cmd => cmd._catch === true); + match = commands.find(command => command._catch); // If there is one, we still need to make sure we aren't // partially matching command groups, such as `do things` when @@ -36,8 +39,8 @@ module.exports = function matchCommand(command, commands = []) { if (match) { let wordMatch = false; - commands.some((cmd) => { - const catchParts = String(cmd._name).split(' '); + commands.some((command) => { + const catchParts = String(command._name).split(' '); const commandParts = String(match.command).split(' '); let matchAll = true; @@ -60,13 +63,13 @@ module.exports = function matchCommand(command, commands = []) { if (wordMatch) { match = null; } else { - matchArgs = command; + matchArgs = commandName; } } } return { - command, args: matchArgs, + command: match || null, }; -}; +} diff --git a/lib/utils/parseCommand.js b/lib/utils/parseCommand.js index b1d13391..a1d7e0c0 100644 --- a/lib/utils/parseCommand.js +++ b/lib/utils/parseCommand.js @@ -1,4 +1,4 @@ -const matchCommand = require('./matchCommand'); +import matchCommand from './matchCommand'; /** * Prepares a command and all its parts for execution. diff --git a/lib/vorpal.js b/lib/vorpal.js index cf773688..152fc4ae 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,7 +1,7 @@ const CommandInstance = require('./command-instance'); const buildCommandArgs = require('./utils/buildCommandArgs'); import humanReadableArgName from './utils/humanReadableArgName'; -const matchCommand = require('./utils/matchCommand'); +import matchCommand from './utils/matchCommand'; import pad from './utils/pad'; import padRow from './utils/padRow'; const parseCommand = require('./utils/parseCommand'); @@ -71,7 +71,7 @@ function Vorpal() { this.chalk = chalk; // Expose lodash as a convenience. - this.lodash = _; + // this.lodash = _; // Exposed through vorpal.delimiter(str). this._delimiter = 'local@' + String(os.hostname()).split('.')[0] + '~$ '; @@ -899,7 +899,7 @@ vorpal._exec = function (item) { // Build the piped commands. var allValid = true; for (var j = 0; j < item.pipes.length; ++j) { - var commandParts = self.util.matchCommand(item.pipes[j], self.commands); + var commandParts = matchCommand(item.pipes[j], self.commands); if (!commandParts.command) { item.session.log(self._commandHelp(item.pipes[j])); allValid = false; From e2527b1cf136c0e7cf22d0b8f10cfabf6ba2bccf Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 28 Jun 2017 00:09:45 -0700 Subject: [PATCH 28/38] Fixed tests. --- package.json | 2 +- test/autocomplete.js | 2 +- test/index.js | 2 +- test/integration.js | 6 +++--- test/util/util.js | 2 +- test/vorpal.js | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 9517e2f0..37562f6c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "flow": "type-check", "lint": "run-linter ./lib", "lint:only": "run-linter", - "test": "mocha" + "test": "yarn run build && mocha" }, "repository": { "type": "git", diff --git a/test/autocomplete.js b/test/autocomplete.js index 165d9361..83aacec7 100644 --- a/test/autocomplete.js +++ b/test/autocomplete.js @@ -1,4 +1,4 @@ -var Vorpal = require('../lib/vorpal'); +var Vorpal = require('../dist/vorpal'); var assert = require('assert'); var _ = require('lodash'); var vorpal = new Vorpal(); diff --git a/test/index.js b/test/index.js index fe07c198..09b0e61c 100755 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,4 @@ -var Vorpal = require('../lib/vorpal'); +var Vorpal = require('../dist/vorpal'); var should = require('should'); var vorpal = new Vorpal(); diff --git a/test/integration.js b/test/integration.js index 69a90189..f08b8c4d 100755 --- a/test/integration.js +++ b/test/integration.js @@ -1,11 +1,11 @@ 'use strict'; -var Vorpal = require('../lib/vorpal'); +var Vorpal = require('../dist/vorpal'); var commands = require('./util/server'); var BlueBirdPromise = require('bluebird'); var fs = require('fs'); -var intercept = require('../lib/intercept'); +var intercept = require('../dist/intercept'); var stdout = ''; var umute; var mute = function () { @@ -657,7 +657,7 @@ describe('integration tests:', function () { } }, 1000); var p = new BlueBirdPromise(function () {}); - p.cancellable(); + p.cancel(); return p; }); }); diff --git a/test/util/util.js b/test/util/util.js index 303149d4..1b036700 100755 --- a/test/util/util.js +++ b/test/util/util.js @@ -1,4 +1,4 @@ -var Vorpal = require('../../lib/vorpal'); +var Vorpal = require('../../dist/vorpal'); var _ = require('lodash'); var path = require('path'); diff --git a/test/vorpal.js b/test/vorpal.js index 69406baf..a8ee8b23 100755 --- a/test/vorpal.js +++ b/test/vorpal.js @@ -5,10 +5,10 @@ * this one. */ -var Vorpal = require('../lib/vorpal'); +var Vorpal = require('../dist/vorpal'); var should = require('should'); var assert = require('assert'); -var intercept = require('../lib/intercept'); +var intercept = require('../dist/intercept'); var vorpal; From 4cd75273e5ffe252d9f55d1a5e9b1ea3c92c985d Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 28 Jun 2017 00:09:50 -0700 Subject: [PATCH 29/38] Updated parseCommand. --- lib/util.js | 111 -------------------------------------- lib/utils/parseCommand.js | 13 +++-- lib/vorpal.js | 4 +- 3 files changed, 12 insertions(+), 116 deletions(-) diff --git a/lib/util.js b/lib/util.js index e927eba4..84bffde8 100755 --- a/lib/util.js +++ b/lib/util.js @@ -14,99 +14,6 @@ import parseArgs from './utils/parseArgs'; const util = { - /** - * Prepares a command and all its parts for execution. - * - * @param {String} command - * @param {Array} commands - * @return {Object} - * @api public - */ - - parseCommand: function (command, commands) { - const self = this; - let pipes = []; - let match; - let matchArgs; - let matchParts; - - function parsePipes() { - // First, split the command by pipes naively. - // This will split command arguments in half when the argument contains a pipe character. - // For example, say "(Vorpal|vorpal)" will be split into ['say "(Vorpal', 'vorpal)'] which isn't good. - const naivePipes = String(command).trim().split('|'); - - // Contruct empty array to place correctly split commands into. - const newPipes = []; - - // We will look for pipe characters within these quotes to rejoin together. - const quoteChars = ['"', '\'', '`']; - - // This will expand to contain one boolean key for each type of quote. - // The value keyed by the quote is toggled off and on as quote type is opened and closed. - // Example { "`": true, "'": false } would mean that there is an open angle quote. - const quoteTracker = {}; - - // The current command piece before being rejoined with it's over half. - // Since it's not common for pipes to occur in commands, this is usually the entire command pipe. - let commandPart = ''; - - // Loop through each naive pipe. - for (const key in naivePipes) { - // It's possible/likely that this naive pipe is the whole pipe if it doesn't contain an unfinished quote. - const possiblePipe = naivePipes[key]; - commandPart += possiblePipe; - - // Loop through each individual character in the possible pipe tracking the opening and closing of quotes. - for (let i = 0; i < possiblePipe.length; i++) { - const char = possiblePipe[i]; - if (quoteChars.indexOf(char) !== -1) { - quoteTracker[char] = !quoteTracker[char]; - } - } - - // Does the pipe end on an unfinished quote? - const inQuote = _.some(quoteChars, (quoteChar) => quoteTracker[quoteChar]); - - // If the quotes have all been closed or this is the last possible pipe in the array, add as pipe. - if (!inQuote || key * 1 === naivePipes.length - 1) { - newPipes.push(commandPart.trim()); - commandPart = ''; - } else { - // Quote was left open. The pipe character was previously removed when the array was split. - commandPart += '|'; - } - } - - // Set the first pipe to command and the rest to pipes. - command = newPipes.shift(); - pipes = pipes.concat(newPipes); - } - - function parseMatch() { - matchParts = matchCommand(command, commands); - match = matchParts.command; - matchArgs = matchParts.args; - } - - parsePipes(); - parseMatch(); - - if (match && _.isFunction(match._parse)) { - command = match._parse(command, matchParts.args); - parsePipes(); - parseMatch(); - } - - return ({ - command: command, - match: match, - matchArgs: matchArgs, - pipes: pipes - }); - }, - - buildCommandArgs: function (passedArgs, cmd, execCommand, isCommandArgKeyPairNormalized) { let args = {options: {}}; @@ -253,24 +160,6 @@ const util = { return args; }, - - // When passing down applied args, we need to turn - // them from `{ '0': 'foo', '1': 'bar' }` into ['foo', 'bar'] - // instead. - fixArgsForApply: function (obj) { - if (!_.isObject(obj)) { - if (!_.isArray(obj)) { - return [obj]; - } - return obj; - } - const argArray = []; - for (const key in obj) { - const aarg = obj[key]; - argArray.push(aarg); - } - return argArray; - } }; /** diff --git a/lib/utils/parseCommand.js b/lib/utils/parseCommand.js index a1d7e0c0..280c8c65 100644 --- a/lib/utils/parseCommand.js +++ b/lib/utils/parseCommand.js @@ -1,14 +1,21 @@ +// @flow +import Command from '../command'; import matchCommand from './matchCommand'; /** * Prepares a command and all its parts for execution. */ -module.exports = function parseCommand(command, commands) { +export default function parseCommand(commandName: string, commands: Command[] = []): { + command: string, + match: ?Command, + matchArgs: string, + pipes: string[], +} { let pipes = []; let match; let matchArgs; let matchParts; - let nextCommand = command; + let nextCommand = commandName; function parsePipes() { // First, split the command by pipes naively. @@ -91,4 +98,4 @@ module.exports = function parseCommand(command, commands) { matchArgs, pipes, }; -}; +} diff --git a/lib/vorpal.js b/lib/vorpal.js index 152fc4ae..e9802c01 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -4,7 +4,7 @@ import humanReadableArgName from './utils/humanReadableArgName'; import matchCommand from './utils/matchCommand'; import pad from './utils/pad'; import padRow from './utils/padRow'; -const parseCommand = require('./utils/parseCommand'); +import parseCommand from './utils/parseCommand'; import prettifyArray from './utils/prettifyArray'; /** @@ -829,7 +829,7 @@ vorpal._exec = function (item) { // History for our 'up' and 'down' arrows. item.session.history((item.session._mode ? modeCommand : item.command)); - var commandData = this.util.parseCommand(item.command, this.commands); + var commandData = parseCommand(item.command, this.commands); item.command = commandData.command; item.pipes = commandData.pipes; var match = commandData.match; From 13c7456ae8c0de8e45aaf12710877ef5d3c0a74f Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 28 Jun 2017 00:45:17 -0700 Subject: [PATCH 30/38] Updated buildCommandArgs. --- lib/command-instance.js | 1 - lib/command.js | 2 - lib/constants.js | 6 +- lib/logger.js | 1 - lib/session.js | 1 - lib/types.js | 26 ++++++ lib/util.js | 169 ---------------------------------- lib/utils/buildCommandArgs.js | 44 ++++----- lib/vorpal.js | 10 +- 9 files changed, 54 insertions(+), 206 deletions(-) delete mode 100755 lib/util.js diff --git a/lib/command-instance.js b/lib/command-instance.js index 254a7290..656e9984 100755 --- a/lib/command-instance.js +++ b/lib/command-instance.js @@ -1,4 +1,3 @@ -const util = require('./util'); class CommandInstance { constructor(options = {}) { diff --git a/lib/command.js b/lib/command.js index 8f1abefc..332fdca8 100755 --- a/lib/command.js +++ b/lib/command.js @@ -4,8 +4,6 @@ import camelCase from './utils/camelCase'; import humanReadableArgName from './utils/humanReadableArgName'; import pad from './utils/pad'; -const VorpalUtil = require('./util'); - const VARIADIC_LENGTH = 3; class Command extends EventEmitter { diff --git a/lib/constants.js b/lib/constants.js index d51161a6..8d998803 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,6 +1,4 @@ // @flow -const PADDING: string = ' '; - -exports.PADDING = PADDING; -exports.PADDING_SIZE = PADDING.length; +export const PADDING: string = ' '; +export const PADDING_SIZE: number = PADDING.length; diff --git a/lib/logger.js b/lib/logger.js index 921d562f..395414e8 100755 --- a/lib/logger.js +++ b/lib/logger.js @@ -5,7 +5,6 @@ import pad from './utils/pad'; */ var _ = require('lodash'); -var util = require('./util'); var ut = require('util'); /** diff --git a/lib/session.js b/lib/session.js index 3952e9e5..1d4e7e12 100755 --- a/lib/session.js +++ b/lib/session.js @@ -7,7 +7,6 @@ const CommandInstance = require('./command-instance'); var EventEmitter = require('events').EventEmitter; var os = require('os'); var _ = require('lodash'); -var util = require('./util'); var autocomplete = require('./autocomplete'); diff --git a/lib/types.js b/lib/types.js index c4a72c33..fd2b9225 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,7 +1,33 @@ // @flow +/* eslint-disable no-use-before-define */ + +import typeof Command from './command'; +import typeof CommandInstance from './command-instance'; +import typeof Session from './session'; export type Argument = { name: string, required: boolean, variadic: boolean, }; + +export type CommandArgs = { + options: { [opt: string]: string | number | boolean }, + [arg: string]: string | string[], +}; + +export type CommandExecutionItem = { + args: string | CommandArgs, // From buildCommandArgs() + command: string, // The input on the command line + commandObject?: Command, + fn: (ci: CommandInstance, args: CommandArgs) => void, // TODO response value? + options: ModeOptions, + pipes: string[] | CommandInstance[], // From parseCommand() + session: Session, + sync: boolean, +}; + +export type ModeOptions = { + message?: string, + sessionId?: string, +}; diff --git a/lib/util.js b/lib/util.js deleted file mode 100755 index 84bffde8..00000000 --- a/lib/util.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict'; - -/** - * Module dependencies. - */ - -const _ = require('lodash'); -const minimist = require('minimist'); -const strip = require('strip-ansi'); - -import matchCommand from './utils/matchCommand'; -import pad from './utils/pad'; -import parseArgs from './utils/parseArgs'; - -const util = { - - buildCommandArgs: function (passedArgs, cmd, execCommand, isCommandArgKeyPairNormalized) { - let args = {options: {}}; - - if(isCommandArgKeyPairNormalized) { - // Normalize all foo="bar" with "foo='bar'" - // This helps implement unix-like key value pairs. - const reg = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; - passedArgs = passedArgs.replace(reg, `"$2='$4$5'"`); - } - - // Types are custom arg types passed - // into `minimist` as per its docs. - const types = cmd._types || {}; - - // Make a list of all boolean options - // registered for this command. These are - // simply commands that don't have required - // or optional args. - const booleans = []; - cmd.options.forEach(function (opt) { - if (opt.required === 0 && opt.optional === 0) { - if (opt.short) { - booleans.push(opt.short); - } - if (opt.long) { - booleans.push(opt.long); - } - } - }); - - // Review the args passed into the command, - // and filter out the boolean list to only those - // options passed in. - // This returns a boolean list of all options - // passed in by the caller, which don't have - // required or optional args. - const passedArgParts = passedArgs.split(' '); - types.boolean = booleans.map(function (str) { - return String(str).replace(/^-*/, ''); - }).filter(function (str) { - let match = false; - let strings = [`-${str}`, `--${str}`, `--no-${str}`]; - for (let i = 0; i < passedArgParts.length; ++i) { - if (strings.indexOf(passedArgParts[i]) > -1) { - match = true; - break; - } - } - return match; - }); - - // Use minimist to parse the args. - const parsedArgs = parseArgs(passedArgs, types); - - function validateArg(arg, cmdArg) { - return !(arg === undefined && cmdArg.required === true); - } - - // Builds varidiac args and options. - let valid = true; - const remainingArgs = _.clone(parsedArgs._); - for (let l = 0; l < 10; ++l) { - const matchArg = cmd._args[l]; - const passedArg = parsedArgs._[l]; - if (matchArg !== undefined) { - valid = (!valid) ? false : validateArg(parsedArgs._[l], matchArg); - if (!valid) { - break; - } - if (passedArg !== undefined) { - if (matchArg.variadic === true) { - args[matchArg.name] = remainingArgs; - } else { - args[matchArg.name] = passedArg; - remainingArgs.shift(); - } - } - } - } - - if (!valid) { - return '\n Missing required argument. Showing Help:'; - } - - // Looks for ommitted required options and throws help. - for (let m = 0; m < cmd.options.length; ++m) { - const o = cmd.options[m]; - const short = String(o.short || '').replace(/-/g, ''); - const long = String(o.long || '').replace(/--no-/g, '').replace(/^-*/g, ''); - let exist = (parsedArgs[short] !== undefined) ? parsedArgs[short] : undefined; - exist = (exist === undefined && parsedArgs[long] !== undefined) ? parsedArgs[long] : exist; - const existsNotSet = (exist === true || exist === false); - const defaultValue = o.default(); - - if (existsNotSet && o.required !== 0 && ! defaultValue) { - return `\n Missing required value for option ${(o.long || o.short)}. Showing Help:`; - } - if (exist !== undefined) { - args.options[long || short] = exist; - } else if (defaultValue) { - args.options[long || short] = defaultValue; - } - } - - // Looks for supplied options that don't - // exist in the options list. - // If the command allows unknown options, - // adds it, otherwise throws help. - const passedOpts = _.chain(parsedArgs) - .keys() - .pull('_') - .pull('help') - .value(); - for (const key in passedOpts) { - const opt = passedOpts[key]; - const optionFound = _.find(cmd.options, function (expected) { - if ('--' + opt === expected.long || - '--no-' + opt === expected.long || - '-' + opt === expected.short) { - return true; - } - return false; - }); - if (optionFound === undefined) { - if (cmd._allowUnknownOptions) { - args.options[opt] = parsedArgs[opt]; - } else { - return `\n Invalid option: '${opt}'. Showing Help:`; - } - } - } - - // If args were passed into the programmatic - // `vorpal.exec(cmd, args, callback)`, merge - // them here. - if (execCommand && execCommand.args && _.isObject(execCommand.args)) { - args = _.extend(args, execCommand.args); - } - - // Looks for a help arg and throws help if any. - if (parsedArgs.help || parsedArgs._.indexOf('/?') > -1) { - args.options.help = true; - } - - return args; - }, -}; - -/** - * Expose `util`. - */ - -module.exports = exports = util; diff --git a/lib/utils/buildCommandArgs.js b/lib/utils/buildCommandArgs.js index 52b49548..4bd70c01 100644 --- a/lib/utils/buildCommandArgs.js +++ b/lib/utils/buildCommandArgs.js @@ -1,15 +1,20 @@ +// @flow +import Command from '../command'; +import padRow from './padRow'; import parseArgs from './parseArgs'; -const PAIR_NORMALIZE_PATTERN = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; -const MAX_ARGS = 10; +import type { CommandArgs, CommandExecutionItem } from '../types'; + +const PAIR_NORMALIZE_PATTERN: RegExp = /(['"]?)(\w+)=(?:(['"])((?:(?!\3).)*)\3|(\S+))\1/g; +const MAX_ARGS: number = 10; // eslint-disable-next-line complexity -module.exports = function buildCommandArgs( - passedArgs, - command, - execCommand = null, - isCommandArgKeyPairNormalized = false -) { +export default function buildCommandArgs( + passedArgs: string, + command: Command, + execCommand: ?CommandExecutionItem = null, + isCommandArgKeyPairNormalized: boolean = false +): CommandArgs { const args = { options: {} }; // Normalize all foo="bar" with "foo='bar'". @@ -46,7 +51,7 @@ module.exports = function buildCommandArgs( .filter((value) => { const formats = [`-${value}`, `--${value}`, `--no-${value}`]; - return passedArgs.split(' ').some(part => formats.contains(part)); + return passedArgs.split(' ').some(part => formats.includes(part)); }); // Use minimist to parse the args, and then build varidiac args and options. @@ -60,7 +65,7 @@ module.exports = function buildCommandArgs( const passedArg = parsedArgs._[l]; if (matchArg) { - valid = valid ? (!parsedArgs._[l] && matchArg.required) : false; + valid = valid ? (parsedArgs._[l] && !matchArg.required) : false; if (!valid) { break; @@ -78,8 +83,7 @@ module.exports = function buildCommandArgs( } if (!valid) { - // TODO pad with helper - throw new Error('\n Missing required argument. Showing Help:'); + throw new Error(padRow('\nMissing required argument. Showing Help:')); } // Looks for ommitted required options and throws help. @@ -93,13 +97,12 @@ module.exports = function buildCommandArgs( const defaultValue = option.default(); if (existsNotSet && option.required && !defaultValue) { - // TODO pad with helper - throw new Error( - `\n Missing required value for option ${(option.long || option.short)}. Showing Help:` - ); + throw new Error(padRow( + `\nMissing required value for option ${option.long || option.short}. Showing Help:` + )); } - if (exists) { + if (typeof exists !== 'undefined') { args.options[long || short] = exists; } else if (defaultValue) { args.options[long || short] = defaultValue; @@ -122,8 +125,7 @@ module.exports = function buildCommandArgs( if (command._allowUnknownOptions) { args.options[option] = parsedArgs[option]; } else { - // TODO pad with helper - throw new Error(`\n Invalid option ${option}. Showing Help:`); + throw new Error(padRow(`\nInvalid option ${option}. Showing Help:`)); } } }); @@ -134,9 +136,9 @@ module.exports = function buildCommandArgs( } // Looks for a help arg and throws help if any. - if (parsedArgs.help || parsedArgs._.indexOf('/?') > -1) { + if (parsedArgs.help || parsedArgs._.includes('/?')) { args.options.help = true; } return args; -}; +} diff --git a/lib/vorpal.js b/lib/vorpal.js index e9802c01..0bde4ccc 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,5 +1,5 @@ const CommandInstance = require('./command-instance'); -const buildCommandArgs = require('./utils/buildCommandArgs'); +import buildCommandArgs from './utils/buildCommandArgs'; import humanReadableArgName from './utils/humanReadableArgName'; import matchCommand from './utils/matchCommand'; import pad from './utils/pad'; @@ -24,7 +24,6 @@ var os = require('os'); var History = require('./history'); var LocalStorage = require('./local-storage'); var wrap = require('wrap-ansi'); -var VorpalUtil = require('./util'); /** * Initialize a new `Vorpal` instance. @@ -88,9 +87,6 @@ function Vorpal() { this._useDeprecatedAutocompletion = false; - // Expose common utilities, like padding. - this.util = VorpalUtil; - this.Session = Session; // Active vorpal server session. @@ -887,7 +883,7 @@ vorpal._exec = function (item) { }; var delimiter = match._delimiter || String(item.command).toLowerCase() + ':'; - item.args = self.util.buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); + item.args = buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); // If we get a string back, it's a validation error. // Show help and return. @@ -905,7 +901,7 @@ vorpal._exec = function (item) { allValid = false; break; } - commandParts.args = self.util.buildCommandArgs(commandParts.args, commandParts.command); + commandParts.args = buildCommandArgs(commandParts.args, commandParts.command); if (_.isString(commandParts.args) || !_.isObject(commandParts.args)) { throwHelp(item, commandParts.args, commandParts.command); allValid = false; From 4c6d913c1577927e35a9eff9fdfce8774172c5a0 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 5 Jul 2017 20:47:30 -0700 Subject: [PATCH 31/38] Updated deps. --- package.json | 4 +- yarn.lock | 116 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 83 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 37562f6c..ab2e7994 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/dthree/vorpal#readme", "devDependencies": { - "@milesj/build-tool-config": "^0.11.2", + "@milesj/build-tool-config": "^0.14.0", "bluebird": "^3.5.0", "mocha": "^3.4.2", "should": "^11.2.1", @@ -44,7 +44,7 @@ "vorpal-repl": "^1.1.8" }, "dependencies": { - "chalk": "^1.1.0", + "chalk": "^2.0.1", "inquirer": "^3.1.1", "lodash": "^4.17.0", "log-update": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 9f34921b..d9c28f03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,16 +2,18 @@ # yarn lockfile v1 -"@milesj/build-tool-config@^0.11.2": - version "0.11.2" - resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.11.2.tgz#defc773e5ca6701ff2cb4b7375c5bcea27e8d9fe" +"@milesj/build-tool-config@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.14.0.tgz#b0ef79dae49e273aeca2c204466f4d1dbb2d05c4" dependencies: babel-cli "^6.24.1" babel-eslint "^7.2.0" babel-jest "^20.0.3" + babel-plugin-external-helpers "^6.22.0" + babel-plugin-transform-dev "^2.0.0" babel-plugin-transform-export-extensions "^6.22.0" babel-plugin-transform-runtime "^6.23.0" - babel-preset-env "^1.5.2" + babel-preset-env "^1.6.0" babel-preset-flow "^6.23.0" babel-preset-react "^6.24.1" babel-preset-stage-2 "^6.24.1" @@ -19,15 +21,15 @@ copy "^0.3.0" enzyme "^2.9.1" eslint "^3.19.0" - eslint-config-airbnb "^15.0.1" - eslint-plugin-flowtype "^2.34.0" - eslint-plugin-import "^2.6.0" + eslint-config-airbnb "^15.0.2" + eslint-plugin-flowtype "^2.34.1" + eslint-plugin-import "^2.6.1" eslint-plugin-jest "^20.0.3" - eslint-plugin-jsx-a11y "^6.0.0" + eslint-plugin-jsx-a11y "^5.1.1" eslint-plugin-promise "^3.5.0" eslint-plugin-react "^7.1.0" eslint-plugin-unicorn "^2.1.2" - flow-bin "^0.48.0" + flow-bin "^0.49.1" jest "^20.0.4" json5 "^0.5.1" react "^15.6.1" @@ -42,6 +44,7 @@ rollup-plugin-replace "^1.1.1" rollup-plugin-uglify "^2.0.1" rollup-watch "^4.0.0" + yargs-parser "^7.0.0" abab@^1.0.3: version "1.0.3" @@ -130,6 +133,12 @@ ansi-styles@^3.0.0: dependencies: color-convert "^1.0.0" +ansi-styles@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.1.0.tgz#09c202d5c917ec23188caa5c9cb9179cd9547750" + dependencies: + color-convert "^1.0.0" + ansi-wrap@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" @@ -490,6 +499,12 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-external-helpers@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + dependencies: + babel-runtime "^6.22.0" + babel-plugin-istanbul@^4.0.0: version "4.1.3" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" @@ -581,6 +596,10 @@ babel-plugin-transform-decorators@^6.24.1: babel-template "^6.24.1" babel-types "^6.24.1" +babel-plugin-transform-dev@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-dev/-/babel-plugin-transform-dev-2.0.0.tgz#7a0bb173ab32455de8d38042755b444abcca7743" + babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" @@ -833,9 +852,9 @@ babel-polyfill@^6.23.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-preset-env@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.5.2.tgz#cd4ae90a6e94b709f97374b33e5f8b983556adef" +babel-preset-env@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.0.tgz#2de1c782a780a0a5d605d199c957596da43c44e4" dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-syntax-trailing-function-commas "^6.22.0" @@ -1074,6 +1093,10 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + caniuse-lite@^1.0.30000670: version "1.0.30000671" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000671.tgz#c206c2f1a1feb34de46064407c4356818389bf1e" @@ -1099,6 +1122,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + cheerio@^0.22.0: version "0.22.0" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" @@ -1594,19 +1625,18 @@ eslint-config-airbnb-base@^11.2.0: version "11.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.2.0.tgz#19a9dc4481a26f70904545ec040116876018f853" -eslint-config-airbnb@^15.0.1: - version "15.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-15.0.1.tgz#7b5188e5b7c74b9b2ce639fd5e1daba8fd761aed" +eslint-config-airbnb@^15.0.2: + version "15.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-15.0.2.tgz#7b99fa421d0c15aee3310d647644315b02ea24da" dependencies: eslint-config-airbnb-base "^11.2.0" -eslint-import-resolver-node@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" +eslint-import-resolver-node@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz#4422574cde66a9a7b099938ee4d508a199e0e3cc" dependencies: - debug "^2.2.0" - object-assign "^4.0.1" - resolve "^1.1.6" + debug "^2.6.8" + resolve "^1.2.0" eslint-module-utils@^2.0.0: version "2.0.0" @@ -1615,21 +1645,21 @@ eslint-module-utils@^2.0.0: debug "2.2.0" pkg-dir "^1.0.0" -eslint-plugin-flowtype@^2.34.0: - version "2.34.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" +eslint-plugin-flowtype@^2.34.1: + version "2.34.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.1.tgz#ea109175645b05d37baeac53b9b65066d79b9446" dependencies: lodash "^4.15.0" -eslint-plugin-import@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.6.0.tgz#2a4bbad36a078e052a3c830ce3dfbd6b8a12c6e5" +eslint-plugin-import@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.6.1.tgz#f580be62bb809421d46e338372764afcc9f59bf6" dependencies: builtin-modules "^1.1.1" contains-path "^0.1.0" debug "^2.6.8" doctrine "1.5.0" - eslint-import-resolver-node "^0.2.0" + eslint-import-resolver-node "^0.3.1" eslint-module-utils "^2.0.0" has "^1.0.1" lodash.cond "^4.3.0" @@ -1640,9 +1670,9 @@ eslint-plugin-jest@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-20.0.3.tgz#ec15eba6ac0ab44a67ebf6e02672ca9d7e7cba29" -eslint-plugin-jsx-a11y@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.0.tgz#d5cdd68f665a89540a55ddc0d898caf80ca94ac5" +eslint-plugin-jsx-a11y@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz#5c96bb5186ca14e94db1095ff59b3e2bd94069b1" dependencies: aria-query "^0.7.0" array-includes "^3.0.3" @@ -1966,9 +1996,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.48.0: - version "0.48.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.48.0.tgz#72d075143524358db8901525e3c784dc13a7c7ee" +flow-bin@^0.49.1: + version "0.49.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.49.1.tgz#c9e456b3173a7535a4ffaf28956352c63bb8e3e9" for-in@^1.0.1: version "1.0.2" @@ -2179,6 +2209,10 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + has-glob@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/has-glob/-/has-glob-0.1.1.tgz#a261c4c2a6c667e0c77b700a7f297c39ef3aa589" @@ -3864,7 +3898,7 @@ resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -4252,6 +4286,12 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" +supports-color@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.1.0.tgz#92cc14bb3dad8928ca5656c33e19a19f20af5c7a" + dependencies: + has-flag "^2.0.0" + symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" @@ -4596,6 +4636,12 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.0" +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + dependencies: + camelcase "^4.1.0" + yargs@^7.0.2: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" From c6560fef8bb3eacef0823eb51317211cb4f6d659 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Fri, 7 Jul 2017 00:07:05 -0700 Subject: [PATCH 32/38] Fixed flow issues. Finalized utils. --- .flowconfig | 2 +- lib/command.js | 4 +--- lib/option.js | 4 ++-- lib/utils/buildCommandArgs.js | 31 +++++++++++++------------------ lib/utils/isDefined.js | 5 +++++ lib/utils/matchCommand.js | 15 ++++++++------- lib/utils/parseCommand.js | 8 ++++---- lib/vorpal.js | 19 +++++++++++-------- test/vorpal.js | 10 +++++----- 9 files changed, 50 insertions(+), 48 deletions(-) create mode 100644 lib/utils/isDefined.js diff --git a/.flowconfig b/.flowconfig index ba6b6af7..dfcaed12 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,5 +1,5 @@ [include] -./src +./lib [ignore] .*/node_modules/.* diff --git a/lib/command.js b/lib/command.js index 332fdca8..f220b39f 100755 --- a/lib/command.js +++ b/lib/command.js @@ -6,7 +6,7 @@ import pad from './utils/pad'; const VARIADIC_LENGTH = 3; -class Command extends EventEmitter { +export default class Command extends EventEmitter { constructor(name, parent) { super(); @@ -440,5 +440,3 @@ class Command extends EventEmitter { } } } - -module.exports = Command; diff --git a/lib/option.js b/lib/option.js index f8710b71..529c298d 100755 --- a/lib/option.js +++ b/lib/option.js @@ -20,8 +20,8 @@ class Option { this.autocomplete = options.autocomplete; this._default = options.default ? options.default : null; this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); + this.required = !!~flags.indexOf('<'); + this.optional = !!~flags.indexOf('['); this.bool = !~flags.indexOf('-no-'); flags = flags.split(/[ ,|]+/); if (flags.length > 1 && !/^[[<]/.test(flags[1])) { diff --git a/lib/utils/buildCommandArgs.js b/lib/utils/buildCommandArgs.js index 4bd70c01..c301dcf3 100644 --- a/lib/utils/buildCommandArgs.js +++ b/lib/utils/buildCommandArgs.js @@ -1,5 +1,6 @@ // @flow import Command from '../command'; +import isDefined from './isDefined'; import padRow from './padRow'; import parseArgs from './parseArgs'; @@ -57,7 +58,6 @@ export default function buildCommandArgs( // Use minimist to parse the args, and then build varidiac args and options. const parsedArgs = parseArgs(passedArgs, types); const remainingArgs = [...parsedArgs._]; - let valid = true; // Builds varidiac args and options. for (let l = 0; l < MAX_ARGS; l += 1) { @@ -65,54 +65,49 @@ export default function buildCommandArgs( const passedArg = parsedArgs._[l]; if (matchArg) { - valid = valid ? (parsedArgs._[l] && !matchArg.required) : false; - - if (!valid) { - break; - } - - if (passedArg) { + // Can be a falsy value + if (isDefined(passedArg)) { if (matchArg.variadic) { args[matchArg.name] = remainingArgs; } else { args[matchArg.name] = passedArg; remainingArgs.shift(); } + } else if (matchArg.required) { + throw new Error(padRow('\nMissing required argument. Showing Help:')); } } } - if (!valid) { - throw new Error(padRow('\nMissing required argument. Showing Help:')); - } - // Looks for ommitted required options and throws help. command.options.forEach((option) => { const short = String(option.short || '').replace(/-/g, ''); const long = String(option.long || '').replace(/--no-/g, '').replace(/^-*/g, ''); - const exists = (typeof parsedArgs[short] === 'undefined') + const exists = isDefined(parsedArgs[long]) ? parsedArgs[long] : parsedArgs[short]; const existsNotSet = (exists === true || exists === false); const defaultValue = option.default(); + const hasDefault = (isDefined(defaultValue) && defaultValue !== null); - if (existsNotSet && option.required && !defaultValue) { + if (existsNotSet && option.required && !hasDefault) { throw new Error(padRow( `\nMissing required value for option ${option.long || option.short}. Showing Help:` )); } - if (typeof exists !== 'undefined') { + // Can be a falsy value + if (isDefined(exists)) { args.options[long || short] = exists; - } else if (defaultValue) { + + } else if (hasDefault) { args.options[long || short] = defaultValue; } }); // Looks for supplied options that don't exist in the options list. // If the command allows unknown options, adds it, otherwise throws help. - const passedOpts = Object.keys(parsedArgs) - .filter(opt => (opt !== '_' && opt !== 'help')); + const passedOpts = Object.keys(parsedArgs).filter(opt => (opt !== '_' && opt !== 'help')); passedOpts.forEach((option) => { const optionFound = command.options.find(expected => ( diff --git a/lib/utils/isDefined.js b/lib/utils/isDefined.js new file mode 100644 index 00000000..bbd0c8e8 --- /dev/null +++ b/lib/utils/isDefined.js @@ -0,0 +1,5 @@ +// @flow + +export default function isDefined(value: *): boolean { + return (typeof value !== 'undefined'); +} diff --git a/lib/utils/matchCommand.js b/lib/utils/matchCommand.js index 1e4a0c74..f0a952e4 100644 --- a/lib/utils/matchCommand.js +++ b/lib/utils/matchCommand.js @@ -10,16 +10,17 @@ export default function matchCommand(commandName: string, commands: Command[] = command: ?Command, } { const parts = commandName.trim().split(' '); - let match; - let matchArgs; + let match = null; + let matchArgs = ''; for (let i = 0; i < parts.length; i += 1) { const subcommandName = String(parts.slice(0, parts.length - i).join(' ')).trim(); - match = ( - commands.find(command => command._name === subcommandName) || - commands.find(command => command._aliases.includes(subcommandName)) - ); + match = commands.find(command => command._name === subcommandName) || match; + + if (!match) { + match = commands.find(command => command._aliases.includes(subcommandName)) || match; + } if (match) { matchArgs = parts.slice(parts.length - i, parts.length).join(' '); @@ -41,7 +42,7 @@ export default function matchCommand(commandName: string, commands: Command[] = commands.some((command) => { const catchParts = String(command._name).split(' '); - const commandParts = String(match.command).split(' '); + const commandParts = String((match && match.command) || '').split(' '); let matchAll = true; for (let i = 0; i < commandParts.length; i += 1) { diff --git a/lib/utils/parseCommand.js b/lib/utils/parseCommand.js index 280c8c65..fa081b7a 100644 --- a/lib/utils/parseCommand.js +++ b/lib/utils/parseCommand.js @@ -12,9 +12,9 @@ export default function parseCommand(commandName: string, commands: Command[] = pipes: string[], } { let pipes = []; - let match; - let matchArgs; - let matchParts; + let match = null; + let matchArgs = ''; + let matchParts = {}; let nextCommand = commandName; function parsePipes() { @@ -86,7 +86,7 @@ export default function parseCommand(commandName: string, commands: Command[] = parseMatch(); if (match && typeof match._parse === 'function') { - nextCommand = match._parse(nextCommand, matchParts.args); + nextCommand = match._parse(nextCommand, matchParts.args || ''); parsePipes(); parseMatch(); diff --git a/lib/vorpal.js b/lib/vorpal.js index 0bde4ccc..7cf8aff0 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -13,7 +13,7 @@ import prettifyArray from './utils/prettifyArray'; var _ = require('lodash'); var EventEmitter = require('events').EventEmitter; -var Command = require('./command'); +var Command = require('./command').default; var ui = require('./ui'); var Session = require('./session'); var intercept = require('./intercept'); @@ -883,11 +883,10 @@ vorpal._exec = function (item) { }; var delimiter = match._delimiter || String(item.command).toLowerCase() + ':'; - item.args = buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); - - // If we get a string back, it's a validation error. - // Show help and return. - if (_.isString(item.args) || !_.isObject(item.args)) { + try { + item.args = buildCommandArgs(matchArgs, match, item, self.isCommandArgKeyPairNormalized); + } catch (error) { + item.args = error.message; throwHelp(item, item.args); return callback(item, undefined, item.args); } @@ -901,12 +900,16 @@ vorpal._exec = function (item) { allValid = false; break; } - commandParts.args = buildCommandArgs(commandParts.args, commandParts.command); - if (_.isString(commandParts.args) || !_.isObject(commandParts.args)) { + + try { + commandParts.args = buildCommandArgs(commandParts.args, commandParts.command); + } catch (error) { + commandParts.args = error.message; throwHelp(item, commandParts.args, commandParts.command); allValid = false; break; } + item.pipes[j] = commandParts; } // If invalid piped commands, return. diff --git a/test/vorpal.js b/test/vorpal.js index a8ee8b23..ab089ca4 100755 --- a/test/vorpal.js +++ b/test/vorpal.js @@ -126,7 +126,7 @@ describe('argument parsing', function () { it('should throw help when not passed a required arg', function () { mute(); - var fixture = '\n Missing required argument. Showing Help:'; + var fixture = ' \nMissing required argument. Showing Help: '; vorpal.execSync('required').should.equal(fixture); unmute(); }); @@ -295,7 +295,7 @@ describe('option parsing', function () { }); it('should throw help on a required option without an arg', function () { - var fixture = "\n Missing required value for option --required. Showing Help:"; + var fixture = " \nMissing required value for option --required. Showing Help: "; mute(); vorpal.execSync('foo -r').should.equal(fixture); unmute(); @@ -333,14 +333,14 @@ describe('option parsing', function () { }); it('should return help on a required option', function () { - var fixture = "\n Missing required value for option --required. Showing Help:"; + var fixture = " \nMissing required value for option --required. Showing Help: "; mute(); vorpal.execSync('foo --no-required cows').should.equal(fixture); unmute(); }); it('should throw help on an unknown option', function() { - var fixture = "\n Invalid option: 'unknown'. Showing Help:"; + var fixture = " \nInvalid option: 'unknown'. Showing Help: "; vorpal.execSync('foo --unknown').should.equal(fixture); }); @@ -350,7 +350,7 @@ describe('option parsing', function () { }); it('should allow the allowUnknownOptions state to be set with a boolean', function() { - var fixture = "\n Invalid option: 'unknown'. Showing Help:"; + var fixture = " \nInvalid option: 'unknown'. Showing Help: "; vorpal.execSync('baz --unknown').should.equal(fixture); }); }); From 6893907d3a2bc03c0b8fac2e9ce84445cddc2633 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 12 Jul 2017 21:59:48 -0700 Subject: [PATCH 33/38] Updated deps. --- package.json | 4 ++-- yarn.lock | 48 ++++++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index ab2e7994..37500151 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/dthree/vorpal#readme", "devDependencies": { - "@milesj/build-tool-config": "^0.14.0", + "@milesj/build-tool-config": "^0.15.0", "bluebird": "^3.5.0", "mocha": "^3.4.2", "should": "^11.2.1", @@ -45,7 +45,7 @@ }, "dependencies": { "chalk": "^2.0.1", - "inquirer": "^3.1.1", + "inquirer": "^3.2.0", "lodash": "^4.17.0", "log-update": "^2.0.0", "minimist": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index d9c28f03..792ce395 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,9 +2,9 @@ # yarn lockfile v1 -"@milesj/build-tool-config@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.14.0.tgz#b0ef79dae49e273aeca2c204466f4d1dbb2d05c4" +"@milesj/build-tool-config@^0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@milesj/build-tool-config/-/build-tool-config-0.15.0.tgz#b3259538befa7efa2e32f77430cff1aabef0889a" dependencies: babel-cli "^6.24.1" babel-eslint "^7.2.0" @@ -22,7 +22,7 @@ enzyme "^2.9.1" eslint "^3.19.0" eslint-config-airbnb "^15.0.2" - eslint-plugin-flowtype "^2.34.1" + eslint-plugin-flowtype "2.34.1" eslint-plugin-import "^2.6.1" eslint-plugin-jest "^20.0.3" eslint-plugin-jsx-a11y "^5.1.1" @@ -36,14 +36,14 @@ react-dom "^15.6.1" react-test-renderer "^15.6.1" rimraf "^2.6.1" - rollup "^0.43.0" + rollup "^0.45.2" rollup-plugin-babel "^2.7.1" rollup-plugin-commonjs "^8.0.2" rollup-plugin-json "^2.3.0" rollup-plugin-node-resolve "^3.0.0" rollup-plugin-replace "^1.1.1" rollup-plugin-uglify "^2.0.1" - rollup-watch "^4.0.0" + rollup-watch "^4.3.1" yargs-parser "^7.0.0" abab@^1.0.3: @@ -1122,7 +1122,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.1: +chalk@^2.0.0, chalk@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" dependencies: @@ -1645,7 +1645,7 @@ eslint-module-utils@^2.0.0: debug "2.2.0" pkg-dir "^1.0.0" -eslint-plugin-flowtype@^2.34.1: +eslint-plugin-flowtype@2.34.1: version "2.34.1" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.1.tgz#ea109175645b05d37baeac53b9b65066d79b9446" dependencies: @@ -2337,12 +2337,12 @@ inquirer@^0.12.0: strip-ansi "^3.0.0" through "^2.3.6" -inquirer@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" +inquirer@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.0.tgz#45b44c2160c729d7578c54060b3eed94487bb42b" dependencies: ansi-escapes "^2.0.0" - chalk "^1.0.0" + chalk "^2.0.0" cli-cursor "^2.1.0" cli-width "^2.0.0" external-editor "^2.0.4" @@ -2352,8 +2352,8 @@ inquirer@^3.1.1: run-async "^2.2.0" rx-lite "^4.0.8" rx-lite-aggregates "^4.0.8" - string-width "^2.0.0" - strip-ansi "^3.0.0" + string-width "^2.1.0" + strip-ansi "^4.0.0" through "^2.3.6" interpret@^1.0.0: @@ -3992,16 +3992,17 @@ rollup-pluginutils@^2.0.1: estree-walker "^0.3.0" micromatch "^2.3.11" -rollup-watch@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-4.0.0.tgz#309051b9403b9e5445c5746c9eba9a466951d39e" +rollup-watch@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-4.3.1.tgz#5aa1eaeab787addf368905d102b39d6fc5ce4a8b" dependencies: chokidar "^1.7.0" require-relative "0.8.7" + rollup-pluginutils "^2.0.1" -rollup@^0.43.0: - version "0.43.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.43.0.tgz#b36bdb75fa5e0823b6de8aee18ff7b5655520543" +rollup@^0.45.2: + version "0.45.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.45.2.tgz#63a284c2b31234656f24e9e9717fabb6a7f0fa43" dependencies: source-map-support "^0.4.0" @@ -4225,6 +4226,13 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" +string-width@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.0.tgz#030664561fc146c9423ec7d978fe2457437fe6d0" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + string_decoder@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" From d04777f099ba7e64b9961153e51814da032c7654 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 12 Jul 2017 22:01:38 -0700 Subject: [PATCH 34/38] Updated flow defs. --- .flowconfig | 1 - flow/minimist.flow.js => flow-typed/minimist.js | 0 flow/strip-ansi.flow.js => flow-typed/strip-ansi.js | 0 3 files changed, 1 deletion(-) rename flow/minimist.flow.js => flow-typed/minimist.js (100%) rename flow/strip-ansi.flow.js => flow-typed/strip-ansi.js (100%) diff --git a/.flowconfig b/.flowconfig index dfcaed12..8dc2e468 100644 --- a/.flowconfig +++ b/.flowconfig @@ -7,7 +7,6 @@ .*\.test\.js [libs] -./flow [options] emoji=true diff --git a/flow/minimist.flow.js b/flow-typed/minimist.js similarity index 100% rename from flow/minimist.flow.js rename to flow-typed/minimist.js diff --git a/flow/strip-ansi.flow.js b/flow-typed/strip-ansi.js similarity index 100% rename from flow/strip-ansi.flow.js rename to flow-typed/strip-ansi.js From 387f64acd2dce5630dc8b51b2f6e336ebd0c1c06 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 12 Jul 2017 23:21:42 -0700 Subject: [PATCH 35/38] Converted Logger to ES2015. --- lib/logger.js | 212 +++++++++++++++++++++++++------------------------- lib/types.js | 2 + 2 files changed, 110 insertions(+), 104 deletions(-) diff --git a/lib/logger.js b/lib/logger.js index 395414e8..a6b82f86 100755 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,137 +1,141 @@ -import pad from './utils/pad'; +// @flow -/** - * Module dependencies. - */ +import util from 'util'; +import pad from './utils/pad'; -var _ = require('lodash'); -var ut = require('util'); +import type { LoggerCallback } from './types'; -/** - * Initialize a new `Logger` instance. - * - * @return {Logger} - * @api public - */ +const BUFFER_WIDTH: number = 10; +const ESCAPE_CODE_PATTERN: RegExp = /\u001B\[\d+m/gm; -function viewed(str) { - var re = /\u001b\[\d+m/gm; - return String(str).replace(re, ''); -} +export default class Logger { + logger: LoggerCallback; -function trimTo(str, amt) { - var raw = ''; - var visual = viewed(str).slice(0, amt); - var result = ''; - for (var i = 0; i < str.length; ++i) { - raw += str[i]; - if (viewed(raw) === visual) { - result = raw; break; - } + constructor(logger?: LoggerCallback) { + // eslint-disable-next-line no-console + this.logger = logger || console.log; } - if (result.length < amt - 10) { - return result; + br(): this { + return this.log(' '); } - var newResult = result; var found = false; - for (var j = result.length; j > 0; --j) { - if (result[j] === ' ') { - found = true; - break; - } else { - newResult = newResult.slice(0, newResult.length - 1); - } - } - - if (found === true) { - return newResult; - } - - return result; -} - -function Logger(cons) { - var logger = cons || console; - const log = function (...args) { - logger.log(...args); - }; - - log.cols = function (...args) { - var width = process.stdout.columns; - var pads = 0; - var padsWidth = 0; - var cols = 0; - var colsWidth = 0; - var input = args; - - for (var h = 0; h < args.length; ++h) { - if (typeof args[h] === 'number') { - padsWidth += args[h]; - pads++; + cols(...args: *[]): this { + // $FlowIgnore + const width = process.stdout.columns; + const input = args; + const lines = []; + let pads = 0; + let padsWidth = 0; + let cols = 0; + let colsWidth = 0; + + args.forEach((arg) => { + if (typeof arg === 'number') { + padsWidth += arg; + pads += 1; + + } else if (Array.isArray(arg) && typeof arg[0] === 'number') { + padsWidth += arg[0]; + pads += 1; } - if (_.isArray(args[h]) && typeof args[h][0] === 'number') { - padsWidth += args[h][0]; - pads++; - } - } + }); cols = args.length - pads; colsWidth = Math.floor((width - padsWidth) / cols); - var lines = []; + const appendLine = () => { + let line = ''; + let done = true; - var go = function () { - var str = ''; - var done = true; - for (var i = 0; i < input.length; ++i) { + for (let i = 0; i < input.length; i += 1) { if (typeof input[i] === 'number') { - str += pad('', input[i]); - } else if (_.isArray(input[i]) && typeof input[i][0] === 'number') { - str += pad('', input[i][0], input[i][1]); + line += pad('', input[i]); + + } else if (Array.isArray(input[i]) && typeof input[i][0] === 'number') { + line += pad('', input[i][0], input[i][1]); + } else { - var chosenWidth = colsWidth + 0; - var trimmed = trimTo(input[i], colsWidth); - var trimmedLength = trimmed.length; - var re = /\\u001b\[\d+m/gm; - var matches = ut.inspect(trimmed).match(re); - var color = ''; + const chosenWidth = colsWidth + 0; + let trimmed = this.trimTo(input[i], colsWidth); + const trimmedLength = trimmed.length; + const matches = util.inspect(trimmed).match(ESCAPE_CODE_PATTERN); + let color = ''; + // Ugh. We're chopping a line, so we have to look for unfinished // color assignments and throw them on the next line. - if (matches && matches[matches.length - 1] !== '\\u001b[39m') { - trimmed += '\u001b[39m'; - var number = String(matches[matches.length - 1]).slice(7, 9); - color = '\x1B[' + number + 'm'; + if (matches && matches[matches.length - 1] !== '\\u001B[39m') { + trimmed += '\u001B[39m'; + + // eslint-disable-next-line no-magic-numbers, unicorn/no-hex-escape + color = `\x1B[m${String(matches[matches.length - 1]).slice(7, 9)}`; } - input[i] = color + String(input[i].slice(trimmedLength, input[i].length)).trim(); - str += pad(String(trimmed).trim(), chosenWidth); - if (viewed(input[i]).trim() !== '') { + + input[i] = color + input[i].slice(trimmedLength, input[i].length).trim(); + line += pad(trimmed.trim(), chosenWidth); + + if (this.stripEscapeCode(input[i]).trim() !== '') { done = false; } } } - lines.push(str); + + lines.push(line); + if (!done) { - go(); + appendLine(); } }; - go(); - for (var i = 0; i < lines.length; ++i) { - logger.log(lines[i]); - } + + appendLine(); + + lines.forEach((line) => { + this.log(line); + }); + return this; - }; + } + + log(...args: *[]): this { + this.logger(...args); - log.br = function () { - logger.log(' '); return this; - }; + } - return this.log; -} + trimTo(message: string, amount: number): string { + const visual = this.stripEscapeCode(message).slice(0, amount); + let raw = ''; + let result = ''; + + for (let i = 0; i < message.length; i += 1) { + raw += message[i]; -/** - * Expose `logger`. - */ + if (this.stripEscapeCode(raw) === visual) { + result = raw; + break; + } + } -module.exports = exports = Logger; + if (result.length < (amount - BUFFER_WIDTH)) { + return result; + } + + let newResult = result; + let found = false; + + for (let j = result.length; j > 0; j -= 1) { + if (result[j] === ' ') { + found = true; + break; + } else { + newResult = newResult.slice(0, newResult.length - 1); + } + } + + return found ? newResult : result; + } + + stripEscapeCode(message: string): string { + return message.replace(ESCAPE_CODE_PATTERN, ''); + } +} diff --git a/lib/types.js b/lib/types.js index fd2b9225..406a98ba 100644 --- a/lib/types.js +++ b/lib/types.js @@ -27,6 +27,8 @@ export type CommandExecutionItem = { sync: boolean, }; +export type LoggerCallback = (...args: *[]) => void; + export type ModeOptions = { message?: string, sessionId?: string, From 4d5a8ea3e6575b232e8e1e036cdb0793b03fd640 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 12 Jul 2017 23:56:38 -0700 Subject: [PATCH 36/38] Converted history to flow. --- flow-typed/node-localstorage.js | 14 +++ lib/history.js | 183 ++++++++++++++++---------------- lib/local-storage.js | 2 +- lib/logger.js | 4 +- lib/types.js | 3 + lib/vorpal.js | 6 +- 6 files changed, 117 insertions(+), 95 deletions(-) create mode 100644 flow-typed/node-localstorage.js diff --git a/flow-typed/node-localstorage.js b/flow-typed/node-localstorage.js new file mode 100644 index 00000000..c7a328d8 --- /dev/null +++ b/flow-typed/node-localstorage.js @@ -0,0 +1,14 @@ +declare module 'node-localstorage' { + declare export class LocalStorage { + constructor(path: string, quota?: number): void; + clear(): void; + getItem(key: string): ?string; + key(index: number): ?string; + setItem(key: string, value: string): void; + removeItem(key: string): void; + } + + declare export class JSONStorage extends LocalStorage { + setItem(key: string, value: *): void; + } +} diff --git a/lib/history.js b/lib/history.js index b48af2ee..3fac0377 100755 --- a/lib/history.js +++ b/lib/history.js @@ -1,175 +1,180 @@ -const { LocalStorage } = require('node-localstorage'); -const path = require('path'); -const os = require('os'); +// @flow + +import os from 'os'; +import path from 'path'; +import { JSONStorage } from 'node-localstorage'; + +import type { InputCommand } from './types'; // Number of command histories kept in persistent storage -const HISTORY_SIZE = 500; -const DEFAULT_STORAGE_PATH = path.normalize(path.join(os.tmpdir(), '.local_storage')); +const HISTORY_SIZE: number = 500; +const DEFAULT_STORAGE_PATH: string = path.normalize(path.join(os.tmpdir(), '.local_storage')); + +export default class History { + _counter: number; + _counterCache: number; + _history: InputCommand[]; + _historyCache: InputCommand[]; + _inMode: boolean; + _localStorage: JSONStorage; + _storageKey: string; -class History { constructor() { + this._inMode = false; this._storageKey = ''; - // Prompt Command History - // Histctr moves based on number of times 'up' (+= ctr) - // or 'down' (-= ctr) was pressed in traversing - // command history. - this._hist = []; - this._histCtr = 0; - - // When in a 'mode', we reset the - // history and store it in a cache until - // exiting the 'mode', at which point we - // resume the original history. - this._histCache = []; - this._histCtrCache = 0; + // Counter moves based on number of times 'up' or 'down' + // was pressed in traversing command history. + this._history = []; + this._counter = 0; + + // When in a 'mode', we reset the history and store it in a cache until + // exiting the 'mode', at which point we resume the original history. + this._historyCache = []; + this._counterCache = 0; } /** - * Initialize the history with local storage data - * Called from setId when history id is set + * Set a unique ID for this history instance. */ - _init() { - if (!this._storageKey) { - return; + setKey(key: string): this { + // Initialize an instance with the default path if it is not initialized + if (!this._localStorage) { + this._localStorage = new JSONStorage(DEFAULT_STORAGE_PATH); } - // Load history from local storage + this._storageKey = `command_history_${key}`; + + // Pull in history from local storage let persistedHistory = []; + try { - persistedHistory = JSON.parse(this._localStorage.getItem(this._storageKey)); + persistedHistory = this._localStorage.getItem(this._storageKey); } catch (error) { - // Nothing to do if the history cannot be parsed + // Nothing to do if the history cannot be parsed, // so just load an empty one, which is better than crashing. } - if (Array.isArray(persistedHistory)) { - this._hist.push(...persistedHistory); - } - } - /** - * Set id for this history instance. - * Calls init internally to initialize - * the history with the id. - */ - setId(id) { - // Initialize a localStorage instance with default - // path if it is not initialized - if (!this._localStorage) { - this._localStorage = new LocalStorage(DEFAULT_STORAGE_PATH); + if (Array.isArray(persistedHistory)) { + this._history.push(...persistedHistory); } - this._storageKey = `cmd_history_${id}`; - this._init(); + return this; } /** - * Initialize a local storage instance with - * the path if not already initialized. + * Initialize a local storage instance with the path if not already initialized. */ - setStoragePath(newPath) { + setStoragePath(newPath: string): this { if (!this._localStorage) { - this._localStorage = new LocalStorage(newPath); + this._localStorage = new JSONStorage(newPath); } + + return this; } /** * Get previous history. Called when up is pressed. */ - getPreviousHistory() { - this._histCtr += 1; - this._histCtr = (this._histCtr > this._hist.length) - ? this._hist.length - : this._histCtr; + getPreviousHistory(): InputCommand { + this._counter += 1; + this._counter = (this._counter > this._history.length) + ? this._history.length + : this._counter; - return this._hist[this._hist.length - this._histCtr]; + return this._history[this._history.length - this._counter]; } /** * Get next history. Called when down is pressed. */ - getNextHistory() { - this._histCtr -= 1; + getNextHistory(): InputCommand { + this._counter -= 1; // Return empty prompt if the we dont have any history to show - if (this._histCtr < 1) { - this._histCtr = 0; + if (this._counter < 1) { + this._counter = 0; return ''; } - return this._hist[this._hist.length - this._histCtr]; + return this._history[this._history.length - this._counter]; } /** * Peek into history, without changing state. */ - peek(depth = 0) { - return this._hist[this._hist.length - 1 - depth]; + peek(depth: number = 0): InputCommand { + return this._history[this._history.length - 1 - depth]; } /** * A new command was submitted. Called when enter is pressed and the prompt is not empty. */ - newCommand(command) { - // Always reset history when new command is executed. - this._histCtr = 0; + newCommand(input: InputCommand): this { + // Always reset history when new command is executed + this._counter = 0; - // Don't store command in history if it's a duplicate. - if (this._hist[this._hist.length - 1] === command) { - return; + // Don't store command in history if it's a duplicate + if (this._history[this._history.length - 1] === input) { + return this; } - // Push into history. - this._hist.push(command); + // Push into history + this._history.push(input); // Only persist history when not in mode if (this._storageKey && !this._inMode) { - let persistedHistory = this._hist; - const historyLen = this._hist.length; + const { length } = this._history; + let persistedHistory = this._history; - if (historyLen > HISTORY_SIZE) { - persistedHistory = this._hist.slice(historyLen - HISTORY_SIZE - 1, historyLen - 1); + if (length > HISTORY_SIZE) { + persistedHistory = this._history.slice(length - HISTORY_SIZE - 1, length - 1); } // Add to local storage - this._localStorage.setItem(this._storageKey, JSON.stringify(persistedHistory)); + this._localStorage.setItem(this._storageKey, persistedHistory); } + + return this; } /** * Called when entering a mode. */ - enterMode() { - // Reassign the command history to a - // cache, replacing it with a blank - // history for the mode. - this._histCache = [...this._hist]; - this._histCtrCache = parseFloat(this._histCtr); - this._hist = []; - this._histCtr = 0; + enterMode(): this { + // Reassign the command history to a cache, + // replacing it with a blank history for the mode. + this._historyCache = [...this._history]; + this._counterCache = this._counter; + this._history = []; + this._counter = 0; this._inMode = true; + + return this; } /** * Called when exiting a mode. */ - exitMode() { - this._hist = this._histCache; - this._histCtr = this._histCtrCache; - this._histCache = []; - this._histCtrCache = 0; + exitMode(): this { + this._history = [...this._historyCache]; + this._counter = this._counterCache; + this._historyCache = []; + this._counterCache = 0; this._inMode = false; + + return this; } /** * Clears the command history (currently only used in unit test). */ - clear() { + clear(): this { if (this._storageKey) { this._localStorage.removeItem(this._storageKey); } + + return this; } } - -module.exports = History; diff --git a/lib/local-storage.js b/lib/local-storage.js index 1274b7ae..b4bcb19c 100755 --- a/lib/local-storage.js +++ b/lib/local-storage.js @@ -8,7 +8,7 @@ const DEFAULT_STORAGE_PATH = temp; var LocalStorage = { - setId(id) { + setKey(id) { if (id === undefined) { throw new Error('vorpal.localStorage() requires a unique key to be passed in.'); } diff --git a/lib/logger.js b/lib/logger.js index a6b82f86..bf7ee329 100755 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,6 +1,6 @@ // @flow -import util from 'util'; +import { inspect } from 'util'; import pad from './utils/pad'; import type { LoggerCallback } from './types'; @@ -59,7 +59,7 @@ export default class Logger { const chosenWidth = colsWidth + 0; let trimmed = this.trimTo(input[i], colsWidth); const trimmedLength = trimmed.length; - const matches = util.inspect(trimmed).match(ESCAPE_CODE_PATTERN); + const matches = inspect(trimmed).match(ESCAPE_CODE_PATTERN); let color = ''; // Ugh. We're chopping a line, so we have to look for unfinished diff --git a/lib/types.js b/lib/types.js index 406a98ba..0ae5575b 100644 --- a/lib/types.js +++ b/lib/types.js @@ -27,6 +27,9 @@ export type CommandExecutionItem = { sync: boolean, }; +// The entire command, with arguments and options, entered in the command line +export type InputCommand = string; + export type LoggerCallback = (...args: *[]) => void; export type ModeOptions = { diff --git a/lib/vorpal.js b/lib/vorpal.js index 7cf8aff0..ded81480 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -1,4 +1,5 @@ const CommandInstance = require('./command-instance'); +import History from './history'; import buildCommandArgs from './utils/buildCommandArgs'; import humanReadableArgName from './utils/humanReadableArgName'; import matchCommand from './utils/matchCommand'; @@ -21,7 +22,6 @@ var minimist = require('minimist'); var commons = require('./vorpal-commons'); var chalk = require('chalk'); var os = require('os'); -var History = require('./history'); var LocalStorage = require('./local-storage'); var wrap = require('wrap-ansi'); @@ -477,7 +477,7 @@ vorpal.CmdHistoryExtension = History; * @api public */ vorpal.history = function (id) { - this.cmdHistory.setId(id); + this.cmdHistory.setKey(id); return this; }; @@ -489,7 +489,7 @@ vorpal.history = function (id) { */ vorpal.localStorage = function (id) { var ls = Object.create(LocalStorage); - ls.setId(id); + ls.setKey(id); _.extend(this.localStorage, ls); return this; }; From 067fa3918c8e21f64cd8483cc025941dd7df5ce6 Mon Sep 17 00:00:00 2001 From: "J.R. Mathis" Date: Thu, 13 Jul 2017 07:42:43 -0500 Subject: [PATCH 37/38] Resolve #263 Test for incorrectly interpreted number-like values from minimist, resolves #263 --- lib/utils/parseArgs.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/utils/parseArgs.js b/lib/utils/parseArgs.js index 668e6fd1..850c9be6 100644 --- a/lib/utils/parseArgs.js +++ b/lib/utils/parseArgs.js @@ -20,8 +20,16 @@ export default function parseArgs(input: string, opts?: CLIParserOptions = {}): } } while (match !== null); + // Create clone of arr before sending to minimist, resolves #263 + var raw = arr.slice(0) + args = minimist(args, opts); args._ = args._ || []; + // Test for incorrectly interpreted number-like values from minimist, resolves #263 + arr._.forEach(function (arg, index) { + if (arg === Infinity) arr._[index] = raw[index]; + }); + return args; } From e2fbfb38e642c53df62a6848d6532766fa0c7699 Mon Sep 17 00:00:00 2001 From: "J.R. Mathis" Date: Thu, 13 Jul 2017 07:55:39 -0500 Subject: [PATCH 38/38] Resolves #263 Changed 'arr' to 'args' --- lib/utils/parseArgs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils/parseArgs.js b/lib/utils/parseArgs.js index 850c9be6..51e3621f 100644 --- a/lib/utils/parseArgs.js +++ b/lib/utils/parseArgs.js @@ -21,14 +21,14 @@ export default function parseArgs(input: string, opts?: CLIParserOptions = {}): } while (match !== null); // Create clone of arr before sending to minimist, resolves #263 - var raw = arr.slice(0) + var raw = args.slice(0) args = minimist(args, opts); args._ = args._ || []; // Test for incorrectly interpreted number-like values from minimist, resolves #263 - arr._.forEach(function (arg, index) { - if (arg === Infinity) arr._[index] = raw[index]; + args._.forEach(function (arg, index) { + if (arg === Infinity) args._[index] = raw[index]; }); return args;