@ionic/cli-framework-output
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -6,2 +6,18 @@ # Change Log | ||
# [2.2.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework-output@2.1.0...@ionic/cli-framework-output@2.2.0) (2020-09-02) | ||
### Bug Fixes | ||
* **formatter:** do not strip newlines when not titleizing ([3e38cd8](https://github.com/ionic-team/ionic-cli/commit/3e38cd891d0b914e03ea06d57cbb6ab067d43ac2)) | ||
### Features | ||
* **output:** write method shortcut ([ca89ee9](https://github.com/ionic-team/ionic-cli/commit/ca89ee92a99a52bd4abd8a1cb97ba3087ec8c4e0)) | ||
# [2.1.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework-output@2.0.2...@ionic/cli-framework-output@2.1.0) (2020-08-29) | ||
@@ -8,0 +24,0 @@ |
@@ -186,3 +186,3 @@ "use strict"; | ||
const indentation = tag ? format_1.stringWidth(tag) + 1 : 0; | ||
const pulledLines = utils_1.dropWhile(lines, l => l === ''); | ||
const pulledLines = titleize ? utils_1.dropWhile(lines, l => l === '') : lines; | ||
return ((tag ? `${tag} ` : '') + | ||
@@ -189,0 +189,0 @@ (wrap |
@@ -7,2 +7,3 @@ /// <reference types="node" /> | ||
readonly colors: Colors; | ||
write(msg: string): boolean; | ||
createTaskChain(): TaskChain; | ||
@@ -18,11 +19,10 @@ } | ||
constructor({ stream, colors }: StreamOutputStrategyOptions); | ||
write(msg: string): boolean; | ||
createTaskChain(): TaskChain; | ||
} | ||
export interface TTYOutputStrategyOptions { | ||
export interface TTYOutputStrategyOptions extends StreamOutputStrategyOptions { | ||
readonly stream?: NodeJS.WriteStream; | ||
readonly colors?: Colors; | ||
} | ||
export declare class TTYOutputStrategy implements OutputStrategy { | ||
export declare class TTYOutputStrategy extends StreamOutputStrategy implements OutputStrategy { | ||
readonly stream: NodeJS.WriteStream; | ||
readonly colors: Colors; | ||
protected readonly redrawer: TTYOutputRedrawer; | ||
@@ -29,0 +29,0 @@ constructor({ stream, colors }?: TTYOutputStrategyOptions); |
@@ -13,2 +13,5 @@ "use strict"; | ||
} | ||
write(msg) { | ||
return this.stream.write(msg); | ||
} | ||
createTaskChain() { | ||
@@ -20,6 +23,6 @@ const { failure, success, weak } = this.colors; | ||
if (result.success) { | ||
this.stream.write(`${success(tasks_1.ICON_SUCCESS)} ${task.msg} ${weak(`in ${utils_1.formatHrTime(result.elapsedTime)}`)}\n`); | ||
this.write(`${success(tasks_1.ICON_SUCCESS)} ${task.msg} ${weak(`in ${utils_1.formatHrTime(result.elapsedTime)}`)}\n`); | ||
} | ||
else { | ||
this.stream.write(`${failure(tasks_1.ICON_FAILURE)} ${task.msg} ${failure(weak('- failed!'))}\n`); | ||
this.write(`${failure(tasks_1.ICON_FAILURE)} ${task.msg} ${failure(weak('- failed!'))}\n`); | ||
} | ||
@@ -32,6 +35,6 @@ }); | ||
exports.StreamOutputStrategy = StreamOutputStrategy; | ||
class TTYOutputStrategy { | ||
class TTYOutputStrategy extends StreamOutputStrategy { | ||
constructor({ stream = process.stdout, colors = colors_1.NO_COLORS } = {}) { | ||
super({ stream, colors }); | ||
this.stream = stream; | ||
this.colors = colors; | ||
this.redrawer = new TTYOutputRedrawer({ stream }); | ||
@@ -45,6 +48,6 @@ } | ||
if (result.success) { | ||
this.stream.write(`${success(tasks_1.ICON_SUCCESS)} ${task.msg} ${weak(`in ${utils_1.formatHrTime(result.elapsedTime)}`)}\n`); | ||
this.write(`${success(tasks_1.ICON_SUCCESS)} ${task.msg} ${weak(`in ${utils_1.formatHrTime(result.elapsedTime)}`)}\n`); | ||
} | ||
else { | ||
this.stream.write(`${failure(tasks_1.ICON_FAILURE)} ${task.msg} ${failure(weak('- failed!'))}\n`); | ||
this.write(`${failure(tasks_1.ICON_FAILURE)} ${task.msg} ${failure(weak('- failed!'))}\n`); | ||
} | ||
@@ -51,0 +54,0 @@ }); |
{ | ||
"name": "@ionic/cli-framework-output", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "The log/tasks/spinners portion of Ionic CLI Framework", | ||
@@ -51,3 +51,3 @@ "homepage": "https://ionicframework.com/", | ||
}, | ||
"gitHead": "9d14290abb3f55f2f161d425a85187a925992b24" | ||
"gitHead": "e3853f3968f2b9c7fad9053b982f1c89ac96f0ed" | ||
} |
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
33084
825