bandersnatch
Advanced tools
Comparing version 1.10.3 to 1.11.0
@@ -28,2 +28,6 @@ import Enquirer from 'enquirer'; | ||
} | ||
getSelectLimit() { | ||
// Never more than what fits on the screen (+ some padding) or 20 | ||
return Math.min(process.stdout.rows - 3, 20); | ||
} | ||
/** | ||
@@ -57,6 +61,4 @@ * Returns an array of arguments and options which should be prompted, because | ||
initial: defaultValue, | ||
// @todo ignoring type error here, probably need another type | ||
// than Question[] | ||
// @ts-ignore | ||
choices: arg.getChoices(), | ||
limit: this.getSelectLimit(), | ||
}); | ||
@@ -68,6 +70,7 @@ break; | ||
name, | ||
type: 'select', | ||
type: 'autocomplete', | ||
message: arg.getPrompt(), | ||
initial: defaultValue, | ||
choices: arg.getChoices(), | ||
limit: this.getSelectLimit(), | ||
}); | ||
@@ -74,0 +77,0 @@ break; |
@@ -28,8 +28,2 @@ import type { InferredOptionType, Options, PositionalOptions } from 'yargs'; | ||
} ? boolean : O extends { | ||
default: string; | ||
} ? string : O extends { | ||
optional: true; | ||
} ? string | undefined : O extends { | ||
variadic: true; | ||
} ? Array<string> : O extends { | ||
choices: ReadonlyArray<infer C>; | ||
@@ -42,3 +36,12 @@ type: 'array'; | ||
choices: ReadonlyArray<infer C>; | ||
} ? C : unknown extends InferredOptionType<O> ? F : InferredOptionType<O>; | ||
optional: true; | ||
} ? C | undefined : O extends { | ||
choices: ReadonlyArray<infer C>; | ||
} ? C : O extends { | ||
default: string; | ||
} ? string : O extends { | ||
optional: true; | ||
} ? string | undefined : O extends { | ||
variadic: true; | ||
} ? Array<string> : unknown extends InferredOptionType<O> ? F : InferredOptionType<O>; | ||
export declare class BaseArg { | ||
@@ -45,0 +48,0 @@ protected name: string; |
@@ -12,2 +12,3 @@ import { Argument } from './argument.js'; | ||
prompt(): Promise<T>; | ||
private getSelectLimit; | ||
/** | ||
@@ -14,0 +15,0 @@ * Returns an array of arguments and options which should be prompted, because |
{ | ||
"name": "bandersnatch", | ||
"description": "Simple TypeScript CLI / REPL framework", | ||
"version": "1.10.3", | ||
"version": "1.11.0", | ||
"repository": { | ||
@@ -66,16 +66,16 @@ "type": "git", | ||
"@semantic-release/git": "10.0.1", | ||
"@types/jest": "27.5.1", | ||
"@types/node": "17.0.33", | ||
"@types/jest": "28.1.1", | ||
"@types/node": "17.0.42", | ||
"convert-extension": "0.3.0", | ||
"doctoc": "2.2.0", | ||
"husky": "8.0.1", | ||
"jest": "28.1.0", | ||
"jest": "28.1.1", | ||
"leasot": "13.1.0", | ||
"mock-argv": "2.0.8", | ||
"prettier": "2.6.2", | ||
"semantic-release": "19.0.2", | ||
"ts-jest": "28.0.2", | ||
"ts-node": "10.7.0", | ||
"tsd": "0.20.0", | ||
"typescript": "4.6.4" | ||
"prettier": "2.7.0", | ||
"semantic-release": "19.0.3", | ||
"ts-jest": "28.0.5", | ||
"ts-node": "10.8.1", | ||
"tsd": "0.21.0", | ||
"typescript": "4.7.3" | ||
}, | ||
@@ -85,3 +85,3 @@ "tsd": { | ||
}, | ||
"packageManager": "yarn@3.2.0" | ||
"packageManager": "yarn@3.2.1" | ||
} |
@@ -63,3 +63,3 @@ # bandersnatch | ||
- [`command.option(name, options)`](#commandoptionname-options) | ||
- [`command.command(command)`](#commandcommandcommand) | ||
- [`command.add(command)`](#commandaddcommand) | ||
- [`command.default()`](#commanddefault) | ||
@@ -526,3 +526,3 @@ - [`command.action(function)`](#commandactionfunction) | ||
#### `command.command(command)` | ||
#### `command.add(command)` | ||
@@ -529,0 +529,0 @@ Adds a sub-command to the command. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97126
2227