@ionic/cli-framework
Advanced tools
Comparing version 2.0.0-beta.0 to 2.0.0-beta.1
/// <reference types="node" /> | ||
import * as ζobject from '@ionic/utils-object'; | ||
import { Opts as ParseArgsOptions, ParsedArgs } from 'minimist'; | ||
@@ -80,4 +79,4 @@ export declare type ParsedArg = string | boolean | null | undefined | string[]; | ||
export declare type NamespaceMapGetter<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = () => Promise<N>; | ||
export declare type ICommandMap<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = ζobject.AliasedMap<string, CommandMapGetter<C, N, M, I, O>>; | ||
export declare type INamespaceMap<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = ζobject.AliasedMap<string, NamespaceMapGetter<C, N, M, I, O>>; | ||
export declare type ICommandMap<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = import('@ionic/utils-object').AliasedMap<string, CommandMapGetter<C, N, M, I, O>>; | ||
export declare type INamespaceMap<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = import('@ionic/utils-object').AliasedMap<string, NamespaceMapGetter<C, N, M, I, O>>; | ||
export interface NamespaceLocateOptions { | ||
@@ -89,10 +88,10 @@ useAliases?: boolean; | ||
parent: N | undefined; | ||
locate(argv: ReadonlyArray<string>, options?: NamespaceLocateOptions): Promise<NamespaceLocateResult<C, N, M, I, O>>; | ||
locate(argv: readonly string[], options?: NamespaceLocateOptions): Promise<NamespaceLocateResult<C, N, M, I, O>>; | ||
getMetadata(): Promise<NamespaceMetadata>; | ||
getNamespaces(): Promise<INamespaceMap<C, N, M, I, O>>; | ||
getCommands(): Promise<ICommandMap<C, N, M, I, O>>; | ||
getCommandMetadataList(): Promise<ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>>; | ||
groupCommandsByNamespace(commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<ReadonlyArray<HydratedNamespaceMetadata<C, N, M, I, O> & { | ||
commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>; | ||
}>>; | ||
getCommandMetadataList(): Promise<readonly HydratedCommandMetadata<C, N, M, I, O>[]>; | ||
groupCommandsByNamespace(commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<readonly (HydratedNamespaceMetadata<C, N, M, I, O> & { | ||
commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]; | ||
})[]>; | ||
} | ||
@@ -102,4 +101,4 @@ export declare type CommandPathItem<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = [string, C | N]; | ||
readonly obj: C | N; | ||
readonly args: ReadonlyArray<string>; | ||
readonly path: ReadonlyArray<CommandPathItem<C, N, M, I, O>>; | ||
readonly args: readonly string[]; | ||
readonly path: readonly CommandPathItem<C, N, M, I, O>[]; | ||
} | ||
@@ -109,4 +108,4 @@ export declare type HydratedCommandMetadata<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> = M & { | ||
readonly namespace: N; | ||
readonly path: ReadonlyArray<CommandPathItem<C, N, M, I, O>>; | ||
readonly aliases: ReadonlyArray<string>; | ||
readonly path: readonly CommandPathItem<C, N, M, I, O>[]; | ||
readonly aliases: readonly string[]; | ||
}; | ||
@@ -117,8 +116,8 @@ export interface NamespaceMetadata extends Metadata { | ||
readonly namespace: N; | ||
readonly aliases: ReadonlyArray<string>; | ||
readonly aliases: readonly string[]; | ||
} | ||
export interface IExecutor<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> { | ||
readonly namespace: N; | ||
execute(argv: ReadonlyArray<string>, env: NodeJS.ProcessEnv): Promise<void>; | ||
run(command: C, cmdargs: ReadonlyArray<string>, runinfo?: Partial<CommandInstanceInfo<C, N, M, I, O>>): Promise<void>; | ||
execute(argv: readonly string[], env: NodeJS.ProcessEnv): Promise<void>; | ||
run(command: C, cmdargs: readonly string[], runinfo?: Partial<CommandInstanceInfo<C, N, M, I, O>>): Promise<void>; | ||
} | ||
@@ -125,0 +124,0 @@ export interface PackageJson { |
@@ -39,10 +39,10 @@ import { AliasedMap } from '@ionic/utils-object'; | ||
*/ | ||
locate(argv: ReadonlyArray<string>, { useAliases }?: NamespaceLocateOptions): Promise<NamespaceLocateResult<C, N, M, I, O>>; | ||
locate(argv: readonly string[], { useAliases }?: NamespaceLocateOptions): Promise<NamespaceLocateResult<C, N, M, I, O>>; | ||
/** | ||
* Get all command metadata in a flat structure. | ||
*/ | ||
getCommandMetadataList(): Promise<ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>>; | ||
groupCommandsByNamespace(commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<ReadonlyArray<HydratedNamespaceMetadata<C, N, M, I, O> & { | ||
commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>; | ||
}>>; | ||
getCommandMetadataList(): Promise<readonly HydratedCommandMetadata<C, N, M, I, O>[]>; | ||
groupCommandsByNamespace(commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<readonly (HydratedNamespaceMetadata<C, N, M, I, O> & { | ||
commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]; | ||
})[]>; | ||
} | ||
@@ -49,0 +49,0 @@ export declare abstract class Command extends BaseCommand<Command, Namespace, CommandMetadata, CommandMetadataInput, CommandMetadataOption> { |
import { CommandMetadata, CommandMetadataInput, CommandMetadataOption, ICommand, INamespace } from '../definitions'; | ||
export declare function getCompletionWords<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption>(ns: N, argv: ReadonlyArray<string>): Promise<string[]>; | ||
export declare function getCompletionWords<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption>(ns: N, argv: readonly string[]): Promise<string[]>; | ||
export interface CompletionFormatterDeps<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> { | ||
@@ -4,0 +4,0 @@ readonly namespace: N; |
@@ -9,7 +9,7 @@ export interface BaseConfigOptions { | ||
*/ | ||
pathPrefix?: ReadonlyArray<string>; | ||
pathPrefix?: readonly string[]; | ||
} | ||
export declare abstract class BaseConfig<T extends object> { | ||
readonly p: string; | ||
protected readonly pathPrefix: ReadonlyArray<string>; | ||
protected readonly pathPrefix: readonly string[]; | ||
constructor(p: string, { pathPrefix }?: BaseConfigOptions); | ||
@@ -16,0 +16,0 @@ readonly file: any; |
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
import { CommandInstanceInfo, CommandMetadata, CommandMetadataInput, CommandMetadataOption, ICommand, IExecutor, INamespace, NamespaceLocateResult } from '../definitions'; | ||
import * as ζipc from '../utils/ipc'; | ||
import { Colors } from './colors'; | ||
import { Command, Namespace } from './command'; | ||
import { CommandHelpSchema, NamespaceHelpSchema } from './help'; | ||
export declare type HelpRPC<S extends CommandHelpSchema | NamespaceHelpSchema> = ζipc.RPC<'help', [ReadonlyArray<string>], S>; | ||
export declare type HelpRPC<S extends CommandHelpSchema | NamespaceHelpSchema> = import('../utils/ipc').RPC<'help', [readonly string[]], S>; | ||
export interface ExecutorOperations { | ||
@@ -15,4 +14,4 @@ readonly RPC: string; | ||
abstract readonly namespace: N; | ||
abstract execute(argv: ReadonlyArray<string>, env: NodeJS.ProcessEnv): Promise<void>; | ||
abstract run(command: C, cmdargs: ReadonlyArray<string>, runinfo?: Partial<CommandInstanceInfo<C, N, M, I, O>>): Promise<void>; | ||
abstract execute(argv: readonly string[], env: NodeJS.ProcessEnv): Promise<void>; | ||
abstract run(command: C, cmdargs: readonly string[], runinfo?: Partial<CommandInstanceInfo<C, N, M, I, O>>): Promise<void>; | ||
} | ||
@@ -29,4 +28,4 @@ export interface BaseExecutorFormatHelpOptions { | ||
export interface BaseExecutor<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> extends AbstractExecutor<C, N, M, I, O> { | ||
on(event: 'operation-rpc', callback: (rpc: ζipc.RPCProcess) => void): this; | ||
emit(event: 'operation-rpc', rpc: ζipc.RPCProcess): boolean; | ||
on(event: 'operation-rpc', callback: (rpc: import('../utils/ipc').RPCProcess) => void): this; | ||
emit(event: 'operation-rpc', rpc: import('../utils/ipc').RPCProcess): boolean; | ||
} | ||
@@ -50,4 +49,4 @@ export declare class BaseExecutor<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> extends AbstractExecutor<C, N, M, I, O> { | ||
*/ | ||
execute(argv: ReadonlyArray<string>, env: NodeJS.ProcessEnv): Promise<void>; | ||
run(command: C, cmdargs: ReadonlyArray<string>, runinfo?: Partial<CommandInstanceInfo<C, N, M, I, O>>): Promise<void>; | ||
execute(argv: readonly string[], env: NodeJS.ProcessEnv): Promise<void>; | ||
run(command: C, cmdargs: readonly string[], runinfo?: Partial<CommandInstanceInfo<C, N, M, I, O>>): Promise<void>; | ||
formatHelp(location: NamespaceLocateResult<C, N, M, I, O>, { format }?: BaseExecutorFormatHelpOptions): Promise<string>; | ||
@@ -54,0 +53,0 @@ /** |
@@ -42,5 +42,5 @@ import { CommandMetadata, CommandMetadataInput, CommandMetadataOption, Footnote, HydratedCommandMetadata, HydratedNamespaceMetadata, ICommand, INamespace, NamespaceLocateResult, NamespaceMetadata } from '../definitions'; | ||
formatCommands(): Promise<string>; | ||
formatCommandGroup(titleText: string, commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<string>; | ||
getListOfCommandDetails(commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<string[]>; | ||
getListOfNamespaceDetails(commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<string[]>; | ||
formatCommandGroup(titleText: string, commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<string>; | ||
getListOfCommandDetails(commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<string[]>; | ||
getListOfNamespaceDetails(commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<string[]>; | ||
/** | ||
@@ -76,3 +76,3 @@ * Insert text before the namespace's summary. | ||
*/ | ||
formatBeforeNamespaceSummary(meta: HydratedNamespaceMetadata<C, N, M, I, O>, commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<string>; | ||
formatBeforeNamespaceSummary(meta: HydratedNamespaceMetadata<C, N, M, I, O>, commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<string>; | ||
/** | ||
@@ -84,3 +84,3 @@ * Insert text that appears after a namespace's summary. | ||
*/ | ||
formatAfterNamespaceSummary(meta: HydratedNamespaceMetadata<C, N, M, I, O>, commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<string>; | ||
formatAfterNamespaceSummary(meta: HydratedNamespaceMetadata<C, N, M, I, O>, commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<string>; | ||
format(): Promise<string>; | ||
@@ -153,5 +153,5 @@ } | ||
readonly description: string; | ||
readonly groups: ReadonlyArray<string>; | ||
readonly groups: readonly string[]; | ||
readonly commands: CommandHelpSchema[]; | ||
readonly aliases: ReadonlyArray<string>; | ||
readonly aliases: readonly string[]; | ||
} | ||
@@ -161,3 +161,3 @@ export declare class NamespaceSchemaHelpFormatter<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> extends NamespaceHelpFormatter<C, N, M, I, O> { | ||
serialize(): Promise<NamespaceHelpSchema>; | ||
formatCommandGroup(commands: ReadonlyArray<HydratedCommandMetadata<C, N, M, I, O>>): Promise<CommandHelpSchema[]>; | ||
formatCommandGroup(commands: readonly HydratedCommandMetadata<C, N, M, I, O>[]): Promise<CommandHelpSchema[]>; | ||
formatCommand(cmd: HydratedCommandMetadata<C, N, M, I, O>): Promise<CommandHelpSchema>; | ||
@@ -173,4 +173,4 @@ } | ||
readonly summary: string; | ||
readonly groups: ReadonlyArray<string>; | ||
readonly aliases: ReadonlyArray<string>; | ||
readonly groups: readonly string[]; | ||
readonly aliases: readonly string[]; | ||
readonly type: string; | ||
@@ -196,11 +196,11 @@ readonly default?: string | boolean; | ||
readonly name: string; | ||
readonly namespace: ReadonlyArray<string>; | ||
readonly namespace: readonly string[]; | ||
readonly summary: string; | ||
readonly description: string; | ||
readonly footnotes: ReadonlyArray<CommandHelpSchemaFootnote>; | ||
readonly groups: ReadonlyArray<string>; | ||
readonly exampleCommands: ReadonlyArray<string>; | ||
readonly aliases: ReadonlyArray<string>; | ||
readonly inputs: ReadonlyArray<CommandHelpSchemaInput>; | ||
readonly options: ReadonlyArray<CommandHelpSchemaOption>; | ||
readonly footnotes: readonly CommandHelpSchemaFootnote[]; | ||
readonly groups: readonly string[]; | ||
readonly exampleCommands: readonly string[]; | ||
readonly aliases: readonly string[]; | ||
readonly inputs: readonly CommandHelpSchemaInput[]; | ||
readonly options: readonly CommandHelpSchemaOption[]; | ||
} | ||
@@ -210,5 +210,5 @@ export declare class CommandSchemaHelpFormatter<C extends ICommand<C, N, M, I, O>, N extends INamespace<C, N, M, I, O>, M extends CommandMetadata<I, O>, I extends CommandMetadataInput, O extends CommandMetadataOption> extends CommandHelpFormatter<C, N, M, I, O> { | ||
serialize(): Promise<CommandHelpSchema>; | ||
formatInputs(inputs: ReadonlyArray<I>): Promise<ReadonlyArray<CommandHelpSchemaInput>>; | ||
formatInputs(inputs: readonly I[]): Promise<readonly CommandHelpSchemaInput[]>; | ||
formatInput(input: I): Promise<CommandHelpSchemaInput>; | ||
formatOptions(options: ReadonlyArray<O>): Promise<ReadonlyArray<CommandHelpSchemaOption>>; | ||
formatOptions(options: readonly O[]): Promise<readonly CommandHelpSchemaOption[]>; | ||
formatOption(option: O): Promise<CommandHelpSchemaOption>; | ||
@@ -215,0 +215,0 @@ formatFootnote(footnote: Footnote): CommandHelpSchemaFootnote; |
@@ -15,3 +15,3 @@ import * as minimist from 'minimist'; | ||
*/ | ||
export declare function stripOptions(pargv: ReadonlyArray<string>, { includeSeparated }: { | ||
export declare function stripOptions(pargv: readonly string[], { includeSeparated }: { | ||
includeSeparated?: boolean; | ||
@@ -26,3 +26,3 @@ }): string[]; | ||
*/ | ||
export declare function separateArgv(pargv: ReadonlyArray<string>): [string[], string[]]; | ||
export declare function separateArgv(pargv: readonly string[]): [string[], string[]]; | ||
/** | ||
@@ -42,3 +42,3 @@ * Takes a Minimist command option and normalizes its values. | ||
export declare function formatOptionName<O extends CommandMetadataOption>(opt: O, { showAliases, showValueSpec, colors }?: FormatOptionNameOptions): string; | ||
export declare function metadataOptionsToParseArgsOptions(commandOptions: ReadonlyArray<CommandMetadataOption>): HydratedParseArgsOptions; | ||
export declare function metadataOptionsToParseArgsOptions(commandOptions: readonly CommandMetadataOption[]): HydratedParseArgsOptions; | ||
export declare type OptionPredicate<O extends CommandMetadataOption> = (option: O, value?: ParsedArg) => boolean; | ||
@@ -59,3 +59,3 @@ export declare namespace OptionFilters { | ||
*/ | ||
export declare function filterCommandLineOptions<O extends CommandMetadataOption>(options: ReadonlyArray<O>, parsedArgs: CommandLineOptions, predicate?: OptionPredicate<O>): CommandLineOptions; | ||
export declare function filterCommandLineOptions<O extends CommandMetadataOption>(options: readonly O[], parsedArgs: CommandLineOptions, predicate?: OptionPredicate<O>): CommandLineOptions; | ||
/** | ||
@@ -70,3 +70,3 @@ * Given an array of command metadata options and an object of parsed options, | ||
*/ | ||
export declare function filterCommandLineOptionsByGroup<O extends CommandMetadataOption>(options: ReadonlyArray<O>, parsedArgs: CommandLineOptions, groups: string | string[]): CommandLineOptions; | ||
export declare function filterCommandLineOptionsByGroup<O extends CommandMetadataOption>(options: readonly O[], parsedArgs: CommandLineOptions, groups: string | string[]): CommandLineOptions; | ||
export interface UnparseArgsOptions { | ||
@@ -73,0 +73,0 @@ useDoubleQuotes?: boolean; |
/// <reference types="node" /> | ||
import * as ζinquirer from 'inquirer'; | ||
import { LogUpdate } from 'log-update'; | ||
@@ -35,21 +34,1 @@ import { Colors } from './colors'; | ||
} | ||
export interface BottomBarOutputStrategyOptions { | ||
readonly BottomBar: typeof ζinquirer.ui.BottomBar; | ||
readonly input?: NodeJS.ReadableStream; | ||
readonly output?: NodeJS.WritableStream; | ||
readonly colors?: Colors; | ||
} | ||
export declare class BottomBarOutputStrategy implements OutputStrategy, RedrawLine { | ||
protected bottomBar?: ζinquirer.ui.BottomBar; | ||
protected readonly BottomBar: typeof ζinquirer.ui.BottomBar; | ||
protected readonly rawinput: NodeJS.ReadableStream; | ||
protected readonly rawoutput: NodeJS.WritableStream; | ||
protected readonly colors: Colors; | ||
constructor({ BottomBar, input, output, colors }: BottomBarOutputStrategyOptions); | ||
readonly stream: NodeJS.WritableStream; | ||
redrawLine(msg?: string): void; | ||
get(): typeof ζinquirer.ui.BottomBar; | ||
open(): void; | ||
close(): void; | ||
createTaskChain(): TaskChain; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Debug = require("debug"); | ||
const logUpdate = require("log-update"); | ||
const colors_1 = require("./colors"); | ||
const tasks_1 = require("./tasks"); | ||
const debug = Debug('ionic:cli-framework:lib:output'); | ||
class StreamOutputStrategy { | ||
@@ -64,71 +62,1 @@ constructor({ stream = process.stdout, colors = colors_1.DEFAULT_COLORS }) { | ||
exports.LogUpdateOutputStrategy = LogUpdateOutputStrategy; | ||
class BottomBarOutputStrategy { | ||
constructor({ BottomBar, input = process.stdin, output = process.stdout, colors = colors_1.DEFAULT_COLORS }) { | ||
this.BottomBar = BottomBar; | ||
this.rawinput = input; | ||
this.rawoutput = output; | ||
this.colors = colors; | ||
} | ||
get stream() { | ||
const bottomBar = this.get(); | ||
return bottomBar.log; | ||
} | ||
redrawLine(msg = '') { | ||
const bottomBar = this.get(); | ||
bottomBar.updateBottomBar(msg); | ||
} | ||
get() { | ||
if (!this.bottomBar) { | ||
this.bottomBar = new this.BottomBar({ input: this.rawinput, output: this.rawoutput }); | ||
try { | ||
// the mute() call appears to be necessary, otherwise when answering | ||
// inquirer prompts upon pressing enter, a copy of the prompt is | ||
// printed to the screen and looks gross | ||
this.bottomBar.rl.output.mute(); | ||
} | ||
catch (e) { | ||
debug('Error while muting bottomBar output: %o', e); | ||
} | ||
} | ||
return this.bottomBar; | ||
} | ||
open() { | ||
this.get(); | ||
} | ||
close() { | ||
if (this.bottomBar) { | ||
// instantiating inquirer.ui.BottomBar hangs, so when close() is called, | ||
// close BottomBar streams | ||
this.bottomBar.close(); | ||
this.bottomBar = undefined; | ||
} | ||
} | ||
createTaskChain() { | ||
const { failure, strong, success } = this.colors; | ||
const chain = new tasks_1.TaskChain({ taskOptions: { tickInterval: 50 } }); | ||
this.open(); | ||
chain.on('next', task => { | ||
this.open(); | ||
task.on('success', () => { | ||
this.stream.write(`${success(tasks_1.ICON_SUCCESS)} ${task.msg} - done!`); | ||
}); | ||
task.on('failure', () => { | ||
this.stream.write(`${failure(tasks_1.ICON_FAILURE)} ${task.msg} - failed!`); | ||
}); | ||
const spinner = new tasks_1.Spinner(); | ||
task.on('tick', () => { | ||
const progress = task.progressRatio ? (task.progressRatio * 100).toFixed(2) : ''; | ||
const frame = spinner.frame(); | ||
this.redrawLine(`${strong(frame)} ${task.msg}${progress ? ' (' + strong(String(progress) + '%') + ')' : ''} `); | ||
}); | ||
task.on('clear', () => { | ||
this.redrawLine(''); | ||
}); | ||
}); | ||
chain.on('end', () => { | ||
this.close(); | ||
}); | ||
return chain; | ||
} | ||
} | ||
exports.BottomBarOutputStrategy = BottomBarOutputStrategy; |
@@ -1,3 +0,5 @@ | ||
import * as ζinquirer from 'inquirer'; | ||
export interface PromptQuestionBase extends ζinquirer.Question { | ||
export declare type Inquirer = import('inquirer').Inquirer; | ||
export declare type Question = import('inquirer').Question; | ||
export declare type Separator = import('inquirer').objects.Separator; | ||
export interface PromptQuestionBase extends Question { | ||
/** | ||
@@ -50,3 +52,3 @@ * The prompt type for this question. | ||
export interface PromptModule { | ||
readonly _inquirer: ζinquirer.Inquirer; | ||
readonly _inquirer: Inquirer; | ||
(question: PromptQuestionConfirm): Promise<PromptValueConfirm>; | ||
@@ -80,2 +82,2 @@ (question: PromptQuestionCheckbox): Promise<PromptValueCheckbox>; | ||
export declare function createPromptModule({ interactive, onFallback }?: CreatePromptModuleOptions): Promise<PromptModule>; | ||
export declare function createPromptChoiceSeparator(): ζinquirer.objects.Separator; | ||
export declare function createPromptChoiceSeparator(): Separator; |
{ | ||
"name": "@ionic/cli-framework", | ||
"version": "2.0.0-beta.0", | ||
"version": "2.0.0-beta.1", | ||
"description": "The foundation framework of the Ionic CLI", | ||
@@ -30,9 +30,9 @@ "homepage": "https://ionicframework.com/", | ||
"dependencies": { | ||
"@ionic/utils-array": "1.0.0-beta.0", | ||
"@ionic/utils-fs": "2.0.0-beta.0", | ||
"@ionic/utils-object": "1.0.0-beta.0", | ||
"@ionic/utils-process": "1.0.0-beta.0", | ||
"@ionic/utils-stream": "1.0.0-beta.0", | ||
"@ionic/utils-subprocess": "1.0.0-beta.0", | ||
"@ionic/utils-terminal": "1.0.0-beta.0", | ||
"@ionic/utils-array": "1.0.0-beta.1", | ||
"@ionic/utils-fs": "2.0.0-beta.1", | ||
"@ionic/utils-object": "1.0.0-beta.1", | ||
"@ionic/utils-process": "1.0.0-beta.1", | ||
"@ionic/utils-stream": "1.0.0-beta.1", | ||
"@ionic/utils-subprocess": "1.0.0-beta.1", | ||
"@ionic/utils-terminal": "1.0.0-beta.1", | ||
"chalk": "^2.3.0", | ||
@@ -47,3 +47,3 @@ "debug": "^4.0.0", | ||
"string-width": "^4.1.0", | ||
"strip-ansi": "^5.0.0", | ||
"strip-ansi": "^5.2.0", | ||
"tslib": "^1.9.0", | ||
@@ -73,3 +73,3 @@ "untildify": "^3.0.2", | ||
}, | ||
"gitHead": "7aa8cf0aec509404d5f457a3a2565851df7c5a4a" | ||
"gitHead": "ef8296bb16d44c6065b4467782a6a42ca0d5422f" | ||
} |
@@ -35,5 +35,5 @@ /// <reference types="node" /> | ||
readonly modulePath: string; | ||
readonly args: ReadonlyArray<string>; | ||
readonly args: readonly string[]; | ||
protected rpc: RPCProcess; | ||
constructor(modulePath: string, args: ReadonlyArray<string>); | ||
constructor(modulePath: string, args: readonly string[]); | ||
start(): void; | ||
@@ -40,0 +40,0 @@ register<R extends RPCResponse<any, object>>(procedure: R['procedure'], fn: (args: R['request']['args']) => Promise<R['data']>): void; |
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
157890
3519
+ Added@ionic/utils-array@1.0.0-beta.1(transitive)
+ Added@ionic/utils-fs@2.0.0-beta.1(transitive)
+ Added@ionic/utils-object@1.0.0-beta.1(transitive)
+ Added@ionic/utils-process@1.0.0-beta.1(transitive)
+ Added@ionic/utils-stream@1.0.0-beta.1(transitive)
+ Added@ionic/utils-subprocess@1.0.0-beta.1(transitive)
+ Added@ionic/utils-terminal@1.0.0-beta.1(transitive)
- Removed@ionic/utils-array@1.0.0-beta.0(transitive)
- Removed@ionic/utils-fs@2.0.0-beta.0(transitive)
- Removed@ionic/utils-object@1.0.0-beta.0(transitive)
- Removed@ionic/utils-process@1.0.0-beta.0(transitive)
- Removed@ionic/utils-stream@1.0.0-beta.0(transitive)
- Removed@ionic/utils-subprocess@1.0.0-beta.0(transitive)
- Removed@ionic/utils-terminal@1.0.0-beta.0(transitive)
Updated@ionic/utils-fs@2.0.0-beta.1
Updatedstrip-ansi@^5.2.0