Comparing version 0.46.0 to 0.47.0
import ConfigLoader from './ConfigLoader'; | ||
import { ConsoleInterface } from './Console'; | ||
import Emitter, { EmitterInterface } from './Emitter'; | ||
import Emitter, { EmitterInterface, EventArguments, EventListener } from './Emitter'; | ||
import Module, { ModuleInterface } from './Module'; | ||
@@ -8,6 +8,6 @@ import ModuleLoader from './ModuleLoader'; | ||
import Plugin, { PluginInterface } from './Plugin'; | ||
import Reporter, { ReporterInterface } from './Reporter'; | ||
import Reporter, { ReporterInterface, ReporterOptions } from './Reporter'; | ||
import Routine, { RoutineInterface } from './Routine'; | ||
import Tool, { ToolInterface } from './Tool'; | ||
export { ConfigLoader, ConsoleInterface, Emitter, EmitterInterface, Module, ModuleInterface, ModuleLoader, Pipeline, Plugin, PluginInterface, Reporter, ReporterInterface, Routine, RoutineInterface, Tool, ToolInterface }; | ||
import Tool, { ToolInterface, ToolOptions } from './Tool'; | ||
export { ConfigLoader, ConsoleInterface, Emitter, EmitterInterface, EventArguments, EventListener, Module, ModuleInterface, ModuleLoader, Pipeline, Plugin, PluginInterface, Reporter, ReporterInterface, ReporterOptions, Routine, RoutineInterface, Tool, ToolInterface, ToolOptions }; | ||
export * from './types'; |
@@ -25,4 +25,6 @@ /// <reference types="node" /> | ||
err: WrappedStream; | ||
errorLogs: string[]; | ||
lastOutputHeight: number; | ||
lines: T[]; | ||
logs: string[]; | ||
options: To; | ||
@@ -43,2 +45,3 @@ out: WrappedStream; | ||
displayFinalOutput(error?: Error | null): void; | ||
displayLogs(logs: string[]): void; | ||
displayFooter(): void; | ||
@@ -51,2 +54,4 @@ flushBufferedOutput(): this; | ||
handleBaseStop: (error: Error | null) => void; | ||
handleLogMessage: (message: string) => void; | ||
handleErrorMessage: (message: string) => void; | ||
hideCursor(): this; | ||
@@ -53,0 +58,0 @@ indent(length?: number): string; |
@@ -28,4 +28,6 @@ "use strict"; | ||
_this.bufferedStreams = []; | ||
_this.errorLogs = []; | ||
_this.lastOutputHeight = 0; | ||
_this.lines = []; | ||
_this.logs = []; | ||
_this.renderScheduled = false; | ||
@@ -49,2 +51,8 @@ _this.restoreCursorOnExit = false; | ||
}; | ||
_this.handleLogMessage = function (message) { | ||
_this.logs.push(message); | ||
}; | ||
_this.handleErrorMessage = function (message) { | ||
_this.errorLogs.push(message); | ||
}; | ||
_this.options = optimal_1.default(options, { | ||
@@ -67,2 +75,4 @@ footer: optimal_1.string().empty(), | ||
cli.on('stop', this.handleBaseStop); | ||
cli.on('log', this.handleLogMessage); | ||
cli.on('log.error', this.handleErrorMessage); | ||
}; | ||
@@ -108,8 +118,15 @@ Reporter.prototype.addLine = function (line) { | ||
if (error) { | ||
this.displayLogs(this.errorLogs); | ||
this.displayError(error); | ||
} | ||
else { | ||
this.displayLogs(this.logs); | ||
this.displayFooter(); | ||
} | ||
}; | ||
Reporter.prototype.displayLogs = function (logs) { | ||
if (logs.length > 0) { | ||
this.out("\n\n" + logs.join('\n') + "\n\n"); | ||
} | ||
}; | ||
Reporter.prototype.displayFooter = function () { | ||
@@ -116,0 +133,0 @@ var footer = this.options.footer; |
@@ -29,2 +29,4 @@ import { Blueprint, Struct } from 'optimal'; | ||
getPlugin(name: string): PluginInterface; | ||
log(message: string, ...args: any[]): this; | ||
logError(message: string, ...args: any[]): this; | ||
} | ||
@@ -49,2 +51,4 @@ export default class Tool<Tp extends PluginInterface> extends Emitter implements ToolInterface { | ||
loadReporter(): this; | ||
log(message: string, ...args: any[]): this; | ||
logError(message: string, ...args: any[]): this; | ||
} |
@@ -24,2 +24,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var util_1 = __importDefault(require("util")); | ||
var chalk_1 = __importDefault(require("chalk")); | ||
@@ -184,4 +185,20 @@ var debug_1 = __importDefault(require("debug")); | ||
}; | ||
Tool.prototype.log = function (message) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
this.console.emit('log', [util_1.default.format.apply(util_1.default, [message].concat(args)), message, args]); | ||
return this; | ||
}; | ||
Tool.prototype.logError = function (message) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
this.console.emit('log.error', [util_1.default.format.apply(util_1.default, [message].concat(args)), message, args]); | ||
return this; | ||
}; | ||
return Tool; | ||
}(Emitter_1.default)); | ||
exports.default = Tool; |
import debug from 'debug'; | ||
import { Struct } from 'optimal'; | ||
export interface Debugger extends debug.IDebugger { | ||
(message: any, ...args: any[]): void; | ||
invariant(condition: boolean, message: string, pass: string, fail: string): void; | ||
@@ -5,0 +6,0 @@ } |
{ | ||
"name": "boost", | ||
"version": "0.46.0", | ||
"version": "0.47.0", | ||
"description": "Robust pipeline for creating build tools that separate logic into routines and tasks.", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
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
382550
1954