Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ionic/cli-framework

Package Overview
Dependencies
Maintainers
15
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/cli-framework - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0-testing.73b2b888

16

lib/output.d.ts
/// <reference types="node" />
import * as ζinquirer from 'inquirer';
import * as ζlogUpdate from 'log-update';
import { Colors } from './colors';

@@ -11,4 +12,2 @@ import { TaskChain } from './tasks';

redrawLine(msg?: string): void;
open(): void;
close(): void;
}

@@ -25,2 +24,15 @@ export interface StreamOutputStrategyOptions {

}
export interface LogUpdateOutputStrategyOptions {
readonly LogUpdate: typeof ζlogUpdate;
readonly stream?: NodeJS.WritableStream;
readonly colors?: Colors;
}
export declare class LogUpdateOutputStrategy implements OutputStrategy, RedrawLine {
readonly stream: NodeJS.WritableStream;
protected readonly colors: Colors;
protected readonly logUpdate: typeof ζlogUpdate;
constructor({ LogUpdate, stream, colors }: LogUpdateOutputStrategyOptions);
redrawLine(msg?: string): void;
createTaskChain(): TaskChain;
}
export interface BottomBarOutputStrategyOptions {

@@ -27,0 +39,0 @@ readonly BottomBar: typeof ζinquirer.ui.BottomBar;

@@ -27,2 +27,38 @@ "use strict";

exports.StreamOutputStrategy = StreamOutputStrategy;
class LogUpdateOutputStrategy {
constructor({ LogUpdate, stream = process.stdout, colors = colors_1.DEFAULT_COLORS }) {
this.stream = stream;
this.colors = colors;
this.logUpdate = LogUpdate.create(stream);
}
redrawLine(msg = '') {
this.logUpdate(msg);
}
createTaskChain() {
const { failure, strong, success } = this.colors;
const chain = new tasks_1.TaskChain({ taskOptions: { tickInterval: 50 } });
chain.on('next', task => {
task.on('success', () => {
this.stream.write(`${success(tasks_1.ICON_SUCCESS)} ${task.msg} - done!\n`);
});
task.on('failure', () => {
this.stream.write(`${failure(tasks_1.ICON_FAILURE)} ${task.msg} - failed!\n`);
});
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.logUpdate.clear();
});
});
chain.on('end', () => {
this.logUpdate.done();
});
return chain;
}
}
exports.LogUpdateOutputStrategy = LogUpdateOutputStrategy;
class BottomBarOutputStrategy {

@@ -29,0 +65,0 @@ constructor({ BottomBar, input = process.stdin, output = process.stdout, colors = colors_1.DEFAULT_COLORS }) {

6

package.json
{
"name": "@ionic/cli-framework",
"version": "1.2.0",
"version": "1.3.0-testing.73b2b888",
"description": "The foundation framework of the Ionic CLI",

@@ -30,3 +30,3 @@ "homepage": "https://ionicframework.com/",

"dependencies": {
"@ionic/utils-fs": "0.0.4",
"@ionic/utils-fs": "0.1.0-testing.73b2b888",
"chalk": "^2.3.0",

@@ -36,2 +36,3 @@ "debug": "^4.0.0",

"lodash": "^4.17.5",
"log-update": "^2.3.0",
"minimist": "^1.2.0",

@@ -55,2 +56,3 @@ "rimraf": "^2.6.2",

"@types/lodash": "^4.14.104",
"@types/log-update": "^2.0.0",
"@types/minimist": "^1.2.0",

@@ -57,0 +59,0 @@ "@types/node": "^6.0.101",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc