updated to export classes directly

This commit is contained in:
Philipp Kunz 2016-05-14 23:58:40 +02:00
parent 57dd2586fd
commit de2e538e11
8 changed files with 20 additions and 52 deletions

View File

@ -1,4 +0,0 @@
import { Table } from "./beautylog.classes.table";
import { Ora } from "./beautylog.classes.ora";
export declare let table: (tableTypeArg: string, tableHeadArrayArg?: string[]) => Table;
export declare let ora: (textArg: string, colorArg: string, startArg?: boolean) => Ora;

View File

@ -1,12 +0,0 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
var beautylog_classes_table_1 = require("./beautylog.classes.table");
var beautylog_classes_ora_1 = require("./beautylog.classes.ora");
exports.table = function (tableTypeArg, tableHeadArrayArg) {
return new beautylog_classes_table_1.Table(tableTypeArg, tableHeadArrayArg);
};
exports.ora = function (textArg, colorArg, startArg) {
return new beautylog_classes_ora_1.Ora(textArg, colorArg, startArg);
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFNUMsd0NBQW9CLDJCQUEyQixDQUFDLENBQUE7QUFDaEQsc0NBQWtCLHlCQUF5QixDQUFDLENBQUE7QUFFakMsYUFBSyxHQUFHLFVBQVMsWUFBbUIsRUFBQyxpQkFBMkI7SUFDdkUsTUFBTSxDQUFDLElBQUksK0JBQUssQ0FBQyxZQUFZLEVBQUMsaUJBQWlCLENBQUMsQ0FBQztBQUNyRCxDQUFDLENBQUE7QUFFVSxXQUFHLEdBQUcsVUFBUyxPQUFjLEVBQUMsUUFBZSxFQUFDLFFBQWlCO0lBQ3RFLE1BQU0sQ0FBQyxJQUFJLDJCQUFHLENBQUMsT0FBTyxFQUFDLFFBQVEsRUFBQyxRQUFRLENBQUMsQ0FBQztBQUM5QyxDQUFDLENBQUEiLCJmaWxlIjoiYmVhdXR5bG9nLmNsYXNzZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XHJcblxyXG5pbXBvcnQge1RhYmxlfSBmcm9tIFwiLi9iZWF1dHlsb2cuY2xhc3Nlcy50YWJsZVwiO1xyXG5pbXBvcnQge09yYX0gZnJvbSBcIi4vYmVhdXR5bG9nLmNsYXNzZXMub3JhXCI7XHJcblxyXG5leHBvcnQgbGV0IHRhYmxlID0gZnVuY3Rpb24odGFibGVUeXBlQXJnOnN0cmluZyx0YWJsZUhlYWRBcnJheUFyZz86c3RyaW5nW10pe1xyXG4gICAgcmV0dXJuIG5ldyBUYWJsZSh0YWJsZVR5cGVBcmcsdGFibGVIZWFkQXJyYXlBcmcpO1xyXG59XHJcblxyXG5leHBvcnQgbGV0IG9yYSA9IGZ1bmN0aW9uKHRleHRBcmc6c3RyaW5nLGNvbG9yQXJnOnN0cmluZyxzdGFydEFyZz86Ym9vbGVhbil7XHJcbiAgICByZXR1cm4gbmV3IE9yYSh0ZXh0QXJnLGNvbG9yQXJnLHN0YXJ0QXJnKTtcclxufSJdfQ==

6
dist/index.d.ts vendored
View File

@ -1,5 +1,5 @@
import { Ora } from "./beautylog.classes.ora";
import { Table } from "./beautylog.classes.table";
export { Table } from "./beautylog.classes.table";
export { Ora } from "./beautylog.classes.ora";
export declare let dir: (logText: any) => void;
export declare let error: (logText: any) => void;
export declare let figlet: (textArg: string, optionsArg?: any) => any;
@ -7,7 +7,5 @@ export declare let figletSync: (textArg: string, optionsArg?: any) => boolean;
export declare let info: (logText: any) => void;
export declare let log: (logText?: string, logType?: string) => void;
export declare let ok: (logText: any) => void;
export declare let ora: (textArg: string, colorArg: string, startArg?: boolean) => Ora;
export declare let success: (logText: any) => void;
export declare let table: (tableTypeArg: string, tableHeadArrayArg?: string[]) => Table;
export declare let warn: (logText: any) => void;

9
dist/index.js vendored
View File

@ -1,8 +1,11 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
var classes = require("./beautylog.classes");
var BeautylogLog = require("./beautylog.log");
var BeautylogFiglet = require("./beautylog.figlet");
var beautylog_classes_table_1 = require("./beautylog.classes.table");
exports.Table = beautylog_classes_table_1.Table;
var beautylog_classes_ora_1 = require("./beautylog.classes.ora");
exports.Ora = beautylog_classes_ora_1.Ora;
exports.dir = BeautylogLog.dir;
exports.error = BeautylogLog.error;
exports.figlet = BeautylogFiglet.figlet;
@ -10,9 +13,7 @@ exports.figletSync = BeautylogFiglet.figletSync;
exports.info = BeautylogLog.info;
exports.log = BeautylogLog.log;
exports.ok = BeautylogLog.ok;
exports.ora = classes.ora;
exports.success = BeautylogLog.success;
exports.table = classes.table;
exports.warn = BeautylogLog.warn;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFHNUMsSUFBWSxPQUFPLFdBQU0scUJBQXFCLENBQUMsQ0FBQTtBQUMvQyxJQUFZLFlBQVksV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQ2hELElBQVksZUFBZSxXQUFNLG9CQUVqQyxDQUFDLENBRm9EO0FBSzFDLFdBQUcsR0FBSSxZQUFZLENBQUMsR0FBRyxDQUFDO0FBQ3hCLGFBQUssR0FBSSxZQUFZLENBQUMsS0FBSyxDQUFDO0FBQzVCLGNBQU0sR0FBSSxlQUFlLENBQUMsTUFBTSxDQUFDO0FBQ2pDLGtCQUFVLEdBQUksZUFBZSxDQUFDLFVBQVUsQ0FBQztBQUN6QyxZQUFJLEdBQUksWUFBWSxDQUFDLElBQUksQ0FBQztBQUMxQixXQUFHLEdBQUksWUFBWSxDQUFDLEdBQUcsQ0FBQztBQUN4QixVQUFFLEdBQUksWUFBWSxDQUFDLEVBQUUsQ0FBQztBQUN0QixXQUFHLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQztBQUNsQixlQUFPL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LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxyXG5cclxuaW1wb3J0ICogYXMgcGx1Z2lucyBmcm9tIFwiLi9iZWF1dHlsb2cucGx1Z2luc1wiO1xyXG5pbXBvcnQgKiBhcyBCZWF1dHlsb2dMb2cgZnJvbSBcIi4vYmVhdXR5bG9nLmxvZ1wiO1xyXG5pbXBvcnQgKiBhcyBCZWF1dHlsb2dGaWdsZXQgZnJvbSBcIi4vYmVhdXR5bG9nLmZpZ2xldFwiXHJcblxyXG5leHBvcnQge1RhYmxlfSBmcm9tIFwiLi9iZWF1dHlsb2cuY2xhc3Nlcy50YWJsZVwiO1xyXG5leHBvcnQge09yYX0gZnJvbSBcIi4vYmVhdXR5bG9nLmNsYXNzZXMub3JhXCI7XHJcblxyXG5leHBvcnQgbGV0IGRpciA9ICBCZWF1dHlsb2dMb2cuZGlyO1xyXG5leHBvcnQgbGV0IGVycm9yID0gIEJlYXV0eWxvZ0xvZy5lcnJvcjtcclxuZXhwb3J0IGxldCBmaWdsZXQgPSAgQmVhdXR5bG9nRmlnbGV0LmZpZ2xldDtcclxuZXhwb3J0IGxldCBmaWdsZXRTeW5jID0gIEJlYXV0eWxvZ0ZpZ2xldC5maWdsZXRTeW5jO1xyXG5leHBvcnQgbGV0IGluZm8gPSAgQmVhdXR5bG9nTG9nLmluZm87XHJcbmV4cG9ydCBsZXQgbG9nID0gIEJlYXV0eWxvZ0xvZy5sb2c7XHJcbmV4cG9ydCBsZXQgb2sgPSAgQmVhdXR5bG9nTG9nLm9rO1xyXG5leHBvcnQgbGV0IHN1Y2Nlc3MgPSAgQmVhdXR5bG9nTG9nLnN1Y2Nlc3M7XHJcbmV4cG9ydCBsZXQgd2FybiA9ICBCZWF1dHlsb2dMb2cud2FybjtcclxuIl19

File diff suppressed because one or more lines are too long

View File

@ -49,7 +49,7 @@ describe("beautylog",function(){
describe(".ora(text,color)",function(){
it("should display, update, and end a message",function(done){
this.timeout(10000);
let testOra = beautylog.ora("This is a test text","green",true);
let testOra = new beautylog.Ora("This is a test text","green",true);
setTimeout(function(){
testOra.text("updated text!");
testOra.log("an intermediate log message","info");
@ -61,7 +61,7 @@ describe("beautylog",function(){
});
it("should display an error message when ended with error",function(done){
this.timeout(10000);
let testOra = beautylog.ora("This is another test text","green");
let testOra = new beautylog.Ora("This is another test text","green");
setTimeout(function(){
testOra.endError("Allright, ora displays an error!");
done();
@ -78,16 +78,16 @@ describe("beautylog",function(){
beautylog.warn('beautylog.warn(), with normal logText, without logType');
});
});
describe(".table",function(){
describe(".Table",function(){
it("should print a nice table",function(){
(function(){
var testTable1 = beautylog.table("checks");
var testTable1 = new beautylog.Table("checks");
testTable1.push(['check1','success']);
testTable1.push(['check2','error']);
testTable1.push(['check3','error']);
testTable1.print();
var testTable2 = beautylog.table("custom",["Column1".red,"Column2".blue,"Column3".cyan]);
var testTable2 = new beautylog.Table("custom",["Column1".red,"Column2".blue,"Column3".cyan]);
testTable2.push(["Hey","this","works"]);
testTable2.print();
})();

View File

@ -1,12 +0,0 @@
/// <reference path="./typings/main.d.ts" />
import {Table} from "./beautylog.classes.table";
import {Ora} from "./beautylog.classes.ora";
export let table = function(tableTypeArg:string,tableHeadArrayArg?:string[]){
return new Table(tableTypeArg,tableHeadArrayArg);
}
export let ora = function(textArg:string,colorArg:string,startArg?:boolean){
return new Ora(textArg,colorArg,startArg);
}

View File

@ -1,12 +1,11 @@
/// <reference path="./typings/main.d.ts" />
import * as plugins from "./beautylog.plugins";
import * as classes from "./beautylog.classes";
import * as BeautylogLog from "./beautylog.log";
import * as BeautylogFiglet from "./beautylog.figlet"
import {Ora} from "./beautylog.classes.ora";
import {Table} from "./beautylog.classes.table";
export {Table} from "./beautylog.classes.table";
export {Ora} from "./beautylog.classes.ora";
export let dir = BeautylogLog.dir;
export let error = BeautylogLog.error;
@ -15,7 +14,5 @@ export let figletSync = BeautylogFiglet.figletSync;
export let info = BeautylogLog.info;
export let log = BeautylogLog.log;
export let ok = BeautylogLog.ok;
export let ora = classes.ora;
export let success = BeautylogLog.success;
export let table = classes.table;
export let warn = BeautylogLog.warn;