Comparing version 2.0.2 to 2.0.3
@@ -5,2 +5,3 @@ import args = require('./args'); | ||
import validate = require('./validate'); | ||
import errors = require('./errors'); | ||
import chalk = require('chalk'); | ||
@@ -12,3 +13,8 @@ export declare const deps: { | ||
readonly validate: typeof validate; | ||
readonly screen: { | ||
readonly errtermwidth: number; | ||
readonly stdtermwidth: number; | ||
}; | ||
readonly renderList: (items: [string, string | undefined][]) => string; | ||
readonly errors: typeof errors; | ||
readonly chalk: (chalk.Chalk & { | ||
@@ -15,0 +21,0 @@ supportsColor: chalk.ColorSupport; |
@@ -8,3 +8,5 @@ "use strict"; | ||
get validate() { return fetch('./validate'); }, | ||
get renderList() { return fetch('cli-ux/lib/list').renderList; }, | ||
get screen() { return fetch('./screen').default; }, | ||
get renderList() { return fetch('./list').renderList; }, | ||
get errors() { return fetch('./errors'); }, | ||
get chalk() { | ||
@@ -11,0 +13,0 @@ try { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const list_1 = require("cli-ux/lib/list"); | ||
const deps_1 = require("./deps"); | ||
const help_1 = require("./help"); | ||
@@ -18,3 +18,3 @@ class CLIParseError extends Error { | ||
if (namedArgs.length) { | ||
const list = list_1.renderList(namedArgs.map(a => [a.name, a.description])); | ||
const list = deps_1.deps.renderList(namedArgs.map(a => [a.name, a.description])); | ||
message += `:\n${list}`; | ||
@@ -29,3 +29,3 @@ } | ||
constructor({ flags, parse }) { | ||
const usage = list_1.renderList(help_1.flagUsages(flags, { displayRequired: false })); | ||
const usage = deps_1.deps.renderList(help_1.flagUsages(flags, { displayRequired: false })); | ||
const message = `Missing required flag${flags.length === 1 ? '' : 's'}:\n${usage}`; | ||
@@ -32,0 +32,0 @@ super({ parse, message }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const deps_1 = require("./deps"); | ||
const ts_lodash_1 = require("ts-lodash"); | ||
function dim(s) { | ||
@@ -27,5 +26,6 @@ if (deps_1.deps.chalk) | ||
return []; | ||
flags = ts_lodash_1.default.sortBy(flags, f => [!f.char, f.char, f.name]); | ||
const _ = require('ts-lodash').default; | ||
flags = _.sortBy(flags, f => [!f.char, f.char, f.name]); | ||
return flags.map(f => flagUsage(f, options)); | ||
} | ||
exports.flagUsages = flagUsages; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ts_lodash_1 = require("ts-lodash"); | ||
let debug; | ||
@@ -17,3 +16,4 @@ try { | ||
this._setNames(); | ||
this.booleanFlags = ts_lodash_1.default.pickBy(input.flags, (f) => f.type === 'boolean'); | ||
const _ = require('ts-lodash').default; | ||
this.booleanFlags = _.pickBy(input.flags, (f) => f.type === 'boolean'); | ||
} | ||
@@ -20,0 +20,0 @@ parse() { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const errors_1 = require("./errors"); | ||
const deps_1 = require("./deps"); | ||
function validate(parse) { | ||
@@ -9,3 +9,3 @@ function validateArgs() { | ||
const extras = parse.output.argv.slice(maxArgs); | ||
throw new errors_1.UnexpectedArgsError({ parse, args: extras }); | ||
throw new deps_1.deps.errors.UnexpectedArgsError({ parse, args: extras }); | ||
} | ||
@@ -15,3 +15,3 @@ const requiredArgs = parse.input.args.filter(a => a.required); | ||
if (missingRequiredArgs.length) { | ||
throw new errors_1.RequiredArgsError({ parse, args: missingRequiredArgs }); | ||
throw new deps_1.deps.errors.RequiredArgsError({ parse, args: missingRequiredArgs }); | ||
} | ||
@@ -22,3 +22,3 @@ } | ||
if (flags.length) | ||
throw new errors_1.RequiredFlagError({ parse, flags }); | ||
throw new deps_1.deps.errors.RequiredFlagError({ parse, flags }); | ||
} | ||
@@ -25,0 +25,0 @@ validateArgs(); |
{ | ||
"name": "cli-flags", | ||
"description": "basic CLI flag parser", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"author": "Jeff Dickey", | ||
"bugs": "https://github.com/heroku/cli-flags/issues", | ||
"dependencies": { | ||
"cli-ux": "^2.0.10", | ||
"@heroku/linewrap": "^1.0.0", | ||
"ts-lodash": "^4.0.8" | ||
@@ -13,5 +13,5 @@ }, | ||
"@types/chalk": "2.2.0", | ||
"@types/jest": "^21.1.8", | ||
"@types/jest": "^21.1.9", | ||
"@types/lodash": "^4.14.91", | ||
"@types/node": "^8.5.1", | ||
"@types/node": "^8.5.2", | ||
"babel-core": "^6.26.0", | ||
@@ -21,3 +21,3 @@ "chalk": "^2.3.0", | ||
"husky": "^0.14.3", | ||
"jest": "^22.0.3", | ||
"jest": "^22.0.4", | ||
"lint-staged": "^6.0.0", | ||
@@ -24,0 +24,0 @@ "prettier": "^1.9.2", |
23496
24
655
8
+ Added@heroku/linewrap@^1.0.0
- Removedcli-ux@^2.0.10
- Removed@cli-engine/screen@0.0.0(transitive)
- Removed@heroku-cli/color@1.1.16(transitive)
- Removedansi-escapes@3.2.04.3.2(transitive)
- Removedansi-regex@3.0.14.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedansicolors@0.2.1(transitive)
- Removedcardinal@1.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcli-ux@2.1.1(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesprima@3.0.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedmoment@2.30.1(transitive)
- Removedpassword-prompt@1.1.3(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedredeyed@1.0.1(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedstrip-ansi@4.0.05.2.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedtslib@1.14.1(transitive)
- Removedtype-fest@0.21.3(transitive)
- Removedwhich@2.0.2(transitive)