switch to common js

This commit is contained in:
Philipp Kunz 2016-02-23 14:34:40 +01:00
parent 1577333a76
commit 387f7bb608
30 changed files with 568 additions and 293 deletions

18
dist/beautylog.browser.js vendored Normal file
View File

@ -0,0 +1,18 @@
/// <reference path="./typings/main.d.ts" />
exports.log = function (message) {
console.log('%c Log: %c ' + message, "background:#42A5F5;color:#ffffff", "color:#42A5F5;");
};
exports.info = function (message) {
console.log('%c Info: %c ' + message, 'background:#EC407A;color:#ffffff;', 'color:#EC407A;');
};
exports.ok = function (message) {
console.log('%c OK: %c ' + message, "background:#000000;color:#8BC34A;", "color:#000000;");
};
exports.success = function (message) {
console.log('%c Success: %c ' + message, "background:#8BC34A;color:#ffffff;", "color:#8BC34A;");
};
exports.warn = function (message) {
console.log('%c Warn: %c ' + message, "background:#000000;color:#FB8C00;", "color:#000000;");
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5icm93c2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUVqQyxXQUFHLEdBQUcsVUFBUyxPQUFPO0lBQzdCLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxHQUFHLE9BQU8sRUFBQyxrQ0FBa0MsRUFBQyxnQkFBZ0IsQ0FBQyxDQUFDO0FBQzdGLENBQUMsQ0FBQztBQUNTLFlBQUksR0FBRyxVQUFTLE9BQU87SUFDOUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLEdBQUcsT0FBTyxFQUFDLG1DQUFtQyxFQUFDLGdCQUFnQixDQUFDLENBQUM7QUFDL0YsQ0FBQyxDQUFDO0FBQ1MsVUFBRSxHQUFHLFVBQVMsT0FBTztJQUM1QixPQUFPLENBQUMsR0FBRyxDQUFDLFlBQVksR0FBRyxPQUFPLEVBQUMsbUNBQW1DLEVBQUMsZ0JBQWdCLENBQUMsQ0FBQztBQUM3RixDQUFDLENBQUM7QUFDU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lLmxvZygnJWMgU3VjY2VzczogJWMgJyArIG1lc3NhZ2UsXCJiYWNrZ3JvdW5kOiM4QkMzNEE7Y29sb3I6I2ZmZmZmZjtcIixcImNvbG9yOiM4QkMzNEE7XCIpO1xufTtcbmV4cG9ydCBsZXQgd2FybiA9IGZ1bmN0aW9uKG1lc3NhZ2Upe1xuICAgIGNvbnNvbGUubG9nKCclYyBXYXJuOiAlYyAnICsgbWVzc2FnZSxcImJhY2tncm91bmQ6IzAwMDAwMDtjb2xvcjojRkI4QzAwO1wiLFwiY29sb3I6IzAwMDAwMDtcIik7XG59OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

53
dist/beautylog.classes.js vendored Normal file

File diff suppressed because one or more lines are too long

19
dist/beautylog.node.code.js vendored Normal file
View File

@ -0,0 +1,19 @@
/// <reference path="./typings/main.d.ts" />
var codeFunction = function (codeString, options) {
var hlight = require("hlight");
var codeSnippet = {
source: codeString,
highlighted: "default"
};
if (typeof codeString != "string") {
console.log("beautylog.code() expects a string as first argument!");
return;
}
;
if (typeof options != "undefined") {
codeSnippet.highlighted = hlight(codeSnippet.source, options.language);
}
};
module.exports = codeFunction;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLmNvZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDO0FBRTVDLElBQUksWUFBWSxHQUFHLFVBQVMsVUFBVSxFQUFDLE9BQVE7SUFDM0MsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQy9CLElBQUksV0FBVyxHQUFHO1FBQ2QsTUFBTSxFQUFDLFVBQVU7UUFDakIsV0FBVyxFQUFDLFNBQVM7S0FDeEIsQ0FBQztJQUNGLEVBQUUsQ0FBQyxDQUFDLE9BQU8sVUFBVSxJQUFJLFFBQVEsQ0FBQyxDQUFBLENBQUM7UUFDL0I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uZ3VhZ2UpO1xuICAgICAgICAvL2NvbnNvbGUubG9nKGNvZGVTbmlwcGV0LmhpZ2hsaWdodGVkKVxuICAgIH1cbn07XG5leHBvcnQgPSBjb2RlRnVuY3Rpb247Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

39
dist/beautylog.node.figlet.js vendored Normal file
View File

@ -0,0 +1,39 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./beautylog.plugins");
var defaultOptions = {
font: "Star Wars",
color: "green",
cb: function () { }
};
exports.figlet = function (textArg, optionsArg) {
var done = plugins.q.defer();
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions, optionsArg);
plugins.figlet(textArg, {
font: options.font,
horizontalLayout: 'default',
verticalLayout: 'default'
}, function (err, data) {
if (err) {
console.log('Something went wrong...');
console.dir(err);
return;
}
console.log(data[options.color]);
options.cb();
done.resolve();
});
return done.promise;
};
exports.figletSync = function (textArg, optionsArg) {
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions, optionsArg);
console.log(plugins.figlet.textSync(textArg, {
font: options.font,
horizontalLayout: 'default',
verticalLayout: 'default'
})[options.color]);
return true;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLmZpZ2xldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcscUJBQXFCLENBQUMsQ0FBQztBQUNoRCxJQUFJLGNBQWMsR0FBRztJQUNqQixJQUFJLEVBQUMsV0FBVztJQUNoQixLQUFLLEVBQUUsT0FBTztJQUNkLEVBQUUsRUFBRSxjQUFXLENBQUM7Q0FDbkIsQ0FBQztBQUNTLGNBQU0sR0FBRyxVQUFTLE9BQWMsRUFBQyxVQUFXO0lBQ25ELElBQUksSUFBSSxHQUFHLE9BQU8sQ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b3VyY2UvIn0=

56
dist/beautylog.node.js vendored Normal file
View File

@ -0,0 +1,56 @@
/// <reference path="./typings/main.d.ts" />
var log = require("./beautylog.node.log");
exports.table = require("./beautylog.node.table");
var figletModule = require("./beautylog.node.figlet");
exports.figlet = figletModule.figlet;
exports.figletSync = figletModule.figletSync;
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
exports.dir = function (logText) {
return log(logText, 'dir');
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
exports.error = function (logText) {
return log(logText, 'error');
};
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
exports.info = function (logText) {
return log(logText, 'info');
};
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
exports.ok = function (logText) {
return log(logText, 'ok');
};
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.success = function (logText) {
return log(logText, 'success');
};
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.warn = function (logText) {
return log(logText, 'warn');
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU1QyxJQUFPLEdBQUcsV0FBVyxzQkFBc0IsQ0FBQyxDQUFDO0FBQy9CLGFBQUssV0FBVyx3QkFBd0IsQ0FBQyxDQUFDO0FBRXhELElBQU8sWUFBWSxXQUFXLHlCQUF5QixDQUFDLENBQUM7QUFFOUMsY0FBTSxHQUFHLFlBQVksQ0FBQyxNQUFNLENBQUM7QUFDN0Isa0JBQVUsR0FBRyxZQUFZLENBQUMsVUFBVSxDQUFDO0FBQ2hEOzs7O0dBSUc7QUFDUSxXQUFHLEdBQUcsVUFBUyxPQUFPO0lBQzdCLE1BQU0sQ0FBQyxHQUFHLENBQUMsT0FBTyxFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQy9CLENBQUMsQ0FB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uICogbG9ncyBhIHN1Y2Nlc3MgdG8gY29uc29sZVxuICogQHBhcmFtIGxvZ1RleHQgc3RyaW5nIHRvIGxvZyBhcyBlcnJvclxuICogQHJldHVybnMge2Jvb2xlYW59XG4gKi9cbmV4cG9ydCBsZXQgc3VjY2VzcyA9IGZ1bmN0aW9uKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICdzdWNjZXNzJyk7XG59O1xuXG4vKipcbiAqIGxvZ3MgYSAnd2FybjonIG1lc3NhZ2UgdG8gY29uc29sZVxuICogQHBhcmFtIGxvZ1RleHQgc3RyaW5nIHRvIGxvZyBhcyBlcnJvclxuICogQHJldHVybnMge2Jvb2xlYW59XG4gKi9cbmV4cG9ydCBsZXQgd2FybiA9IGZ1bmN0aW9uKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICd3YXJuJyk7XG59OyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

60
dist/beautylog.node.log.js vendored Normal file

File diff suppressed because one or more lines are too long

10
dist/beautylog.node.table.js vendored Normal file
View File

@ -0,0 +1,10 @@
/// <reference path="./typings/main.d.ts" />
var classes = require("./beautylog.classes");
var beautylogOsTable = {};
beautylogOsTable.new = function (typeArg, tableHeadArrayArg) {
var newConsoleTable = new classes.ConsoleTable(typeArg, tableHeadArrayArg);
return newConsoleTable;
};
module.exports = beautylogOsTable;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxxQkFBcUIsQ0FBQyxDQUFDO0FBRWhELElBQUksZ0JBQWdCLEdBQU8sRUFBRSxDQUFDO0FBRTlCLGdCQUFnQixDQUFDLEdBQUcsR0FBRyxVQUFTLE9BQWMsRUFBQyxpQkFBa0I7SUFDN0QsSUFBSSxlQUFlLEdBQUcsSUFBSSxPQUFPLENBQUMsWUFBWSxDQUFDLE9BQU8sRUFBQyxpQkFBaUIsQ0FBQyxDQUFDO0lBQzFFLE1BQU0sQ0FBQyxlQUFlLENBQUM7QUFDM0IsQ0FBQyxDQUFDO0FBQ0YsaUJBQVMsZ0JBQWdCLENBQUMiLCJmaWxlIjoiYmVhdXR5bG9nLm5vZGUudGFibGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgY2xhc3NlcyA9IHJlcXVpcmUoXCIuL2JlYXV0eWxvZy5jbGFzc2VzXCIpO1xuXG52YXIgYmVhdXR5bG9nT3NUYWJsZTphbnkgPSB7fTtcblxuYmVhdXR5bG9nT3NUYWJsZS5uZXcgPSBmdW5jdGlvbih0eXBlQXJnOnN0cmluZyx0YWJsZUhlYWRBcnJheUFyZz8pIHtcbiAgICB2YXIgbmV3Q29uc29sZVRhYmxlID0gbmV3IGNsYXNzZXMuQ29uc29sZVRhYmxlKHR5cGVBcmcsdGFibGVIZWFkQXJyYXlBcmcpO1xuICAgIHJldHVybiBuZXdDb25zb2xlVGFibGU7XG59O1xuZXhwb3J0ID0gYmVhdXR5bG9nT3NUYWJsZTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

17
dist/beautylog.plugins.js vendored Normal file
View File

@ -0,0 +1,17 @@
/// <reference path="./typings/main.d.ts" />
var plugins = {
lodash: require("lodash"),
smartenv: require("smartenv"),
q: require("q")
};
if (plugins.smartenv.getEnv().isNode) {
plugins = plugins.lodash.assign(plugins, {
cliTable: require("cli-table2"),
colors: require("colors"),
clc: require("cli-color"),
figlet: require("figlet")
});
}
module.exports = plugins;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5wbHVnaW5zLnRzIl0sIm5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x7XG4gICAgICAgIGNsaVRhYmxlOiAgcmVxdWlyZShcImNsaS10YWJsZTJcIiksXG4gICAgICAgIGNvbG9yczogcmVxdWlyZShcImNvbG9yc1wiKSxcbiAgICAgICAgY2xjOiByZXF1aXJlKFwiY2xpLWNvbG9yXCIpLFxuICAgICAgICBmaWdsZXQ6IHJlcXVpcmUoXCJmaWdsZXRcIilcbiAgICB9KTtcbn1cbmV4cG9ydCA9IHBsdWdpbnM7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

3
dist/beautylog.promisechain.js vendored Normal file
View File

@ -0,0 +1,3 @@
/// <reference path="./typings/main.d.ts" />
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5wcm9taXNlY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDIiwiZmlsZSI6ImJlYXV0eWxvZy5wcm9taXNlY2hhaW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

19
dist/index.js vendored Normal file
View File

@ -0,0 +1,19 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./beautylog.plugins");
var BeautylogNode = require("./beautylog.node");
var BeautylogBrowser = require("./beautylog.browser");
var beautylog;
switch (plugins.smartenv.getEnv().runtimeEnv) {
case "node":
beautylog = BeautylogNode;
break;
case "browser":
beautylog = BeautylogBrowser;
break;
default:
console.log("something is strange about the platform in which you try to use beautylog");
break;
}
module.exports = beautylog;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU1QyxJQUFPLE9BQU8sV0FBVyxxQkFBcUIsQ0FBQ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ZSBcImJyb3dzZXJcIjpcbiAgICAgICAgYmVhdXR5bG9nID0gQmVhdXR5bG9nQnJvd3NlcjtcbiAgICAgICAgYnJlYWs7XG4gICAgZGVmYXVsdDpcbiAgICAgICAgY29uc29sZS5sb2coXCJzb21ldGhpbmcgaXMgc3RyYW5nZSBhYm91dCB0aGUgcGxhdGZvcm0gaW4gd2hpY2ggeW91IHRyeSB0byB1c2UgYmVhdXR5bG9nXCIpO1xuICAgICAgICBicmVhaztcbn1cblxuZXhwb3J0ID0gYmVhdXR5bG9nO1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

19
dist/testbrowser.js vendored Normal file
View File

@ -0,0 +1,19 @@
/// <reference path="typings/tsd.d.ts" />
var plugins = {
gulp: require("gulp"),
gulpBrowser: require("gulp-browser"),
easyserve: require("easyserve")
};
plugins.gulp.task('compileBrowserJS', function () {
var stream = plugins.gulp.src('test/browser/index.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("test/browser/browserified/"));
return stream;
});
plugins.gulp.task('default', ['compileBrowserJS'], function () {
console.log('browserJS has been browserified');
plugins.easyserve("test/browser/");
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3Ricm93c2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlDQUF5QztBQUN6QyxJQUFJLE9BQU8sR0FBRztJQUNWLElBQUksRUFBRSxPQUFPLENBQUMsTUFBTSxDQUFDO0lBQ3JCLFdBQVcsRUFBRSxPQUFPLENBQUMsY0FBYyxDQUFDO0lBQ3BDLFNBQVMsRUFBRSxPQUFPLENBQUMsV0FBVyxDQUFDO0NBQ2xDLENBQUM7QUFFRixPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsRUFBRTtJQUNsQyxJQUFJLE1BQU0sR0FBRyxPQUFPLENBQUMsSU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kZXguanMnKVxuICAgICAgICAucGlwZShwbHVnaW5zLmd1bHBCcm93c2VyLmJyb3dzZXJpZnkoKSlcbiAgICAgICAgLnBpcGUocGx1Z2lucy5ndWxwLmRlc3QoXCJ0ZXN0L2Jyb3dzZXIvYnJvd3NlcmlmaWVkL1wiKSk7XG4gICAgcmV0dXJuIHN0cmVhbTtcbn0pO1xuXG5wbHVnaW5zLmd1bHAudGFzaygnZGVmYXVsdCcsWydjb21waWxlQnJvd3NlckpTJ10sIGZ1bmN0aW9uKCkge1xuICAgIGNvbnNvbGUubG9nKCdicm93c2VySlMgaGFzIGJlZW4gYnJvd3NlcmlmaWVkJyk7XG4gICAgcGx1Z2lucy5lYXN5c2VydmUoXCJ0ZXN0L2Jyb3dzZXIvXCIpO1xufSk7XG5cbnBsdWdpbnMuZ3VscC5zdGFydC5hcHBseShwbHVnaW5zLmd1bHAsIFsnZGVmYXVsdCddKTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

View File

@ -35,14 +35,14 @@
"colors": "1.1.2",
"figlet": "^1.1.1",
"hlight": "0.0.8",
"lodash": "^4.5.0",
"lodash": "^4.5.1",
"q": "^1.4.1",
"smartenv": "1.0.6"
"smartenv": "1.0.7"
},
"devDependencies": {
"easyserve": "0.0.5",
"gulp": "^3.9.1",
"gulp-browser": "1.0.10",
"npmts": "2.3.3"
"npmts": "3.1.2"
}
}

3
test/test.d.ts vendored
View File

@ -1,3 +0,0 @@
/// <reference path="ts/typings/main.d.ts" />
declare var smartenv: any;
declare var beautylog: any;

File diff suppressed because one or more lines are too long

1
test/test.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACnC,IAAI,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAEvC,QAAQ,CAAC,WAAW,EAAC;IACjB,QAAQ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;YAC3D,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAC,EAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,QAAQ,EAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,aAAa,EAAC;QACnB,EAAE,CAAC,8CAA8C,EAAC;YAC9C,SAAS,CAAC,UAAU,CAAC,OAAO,EAAC,EAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,CAAC;QAClE,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,EAAC;QACb,EAAE,CAAC,uBAAuB,EAAC;YACvB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,SAAS,CAAC,IAAI,CACV,oEAAoE,EACpE;gBACI,QAAQ,EAAC,YAAY;aACxB,CACJ,CAAC;QACN,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAC"}

View File

@ -1,4 +1,4 @@
/// <reference path="./typings/main.d.ts" />
/// <reference path="../ts/typings/main.d.ts" />
var smartenv = require("smartenv");
var beautylog = require('../index.js');

18
test/testbrowser.js Normal file
View File

@ -0,0 +1,18 @@
/// <reference path="typings/tsd.d.ts" />
var plugins = {
gulp: require("gulp"),
gulpBrowser: require("gulp-browser"),
easyserve: require("easyserve")
};
plugins.gulp.task('compileBrowserJS', function () {
var stream = plugins.gulp.src('test/browser/index.js')
.pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("test/browser/browserified/"));
return stream;
});
plugins.gulp.task('default', ['compileBrowserJS'], function () {
console.log('browserJS has been browserified');
plugins.easyserve("test/browser/");
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
//# sourceMappingURL=testbrowser.js.map

1
test/testbrowser.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"testbrowser.js","sourceRoot":"","sources":["testbrowser.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,OAAO,GAAG;IACV,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC,cAAc,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC;CAClC,CAAC;AAEF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;IAClC,IAAI,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC;SACjD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;SACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAC3D,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,CAAC,kBAAkB,CAAC,EAAE;IAC9C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC"}

View File

@ -1,22 +1,17 @@
/// <reference path="./index.ts" />
module BeautylogBrowser {
export function init() {
var beautylogBrowser:any = {};
beautylogBrowser.log = function(message){
/// <reference path="./typings/main.d.ts" />
export let log = function(message){
console.log('%c Log: %c ' + message,"background:#42A5F5;color:#ffffff","color:#42A5F5;");
};
beautylogBrowser.info = function(message){
};
export let info = function(message){
console.log('%c Info: %c ' + message,'background:#EC407A;color:#ffffff;','color:#EC407A;');
};
beautylogBrowser.ok = function(message){
};
export let ok = function(message){
console.log('%c OK: %c ' + message,"background:#000000;color:#8BC34A;","color:#000000;");
};
beautylogBrowser.success = function(message){
};
export let success = function(message){
console.log('%c Success: %c ' + message,"background:#8BC34A;color:#ffffff;","color:#8BC34A;");
};
beautylogBrowser.warn = function(message){
};
export let warn = function(message){
console.log('%c Warn: %c ' + message,"background:#000000;color:#FB8C00;","color:#000000;");
};
return beautylogBrowser;
}
}
};

View File

@ -1,4 +1,6 @@
/// <reference path="./index.ts" />
/// <reference path="./typings/main.d.ts" />
import plugins = require("./beautylog.plugins");
var tableHelpers = {
makeRow: function(cellCounterArg:number = 2,colorArg:string = "cyan"){
var rowArray = [];
@ -9,7 +11,7 @@ var tableHelpers = {
}
};
class ConsoleTable {
export class ConsoleTable {
tableHead:string[];
rows;
type:string;
@ -31,7 +33,7 @@ class ConsoleTable {
this.rows.push(row);
}
print() {
var table = new BeautylogNodeTable.cliTable({
var table = new plugins.cliTable({
head: this.tableHead
});
for (var row in this.rows){

View File

@ -1,10 +1,7 @@
/// <reference path="./index.ts" />
module BeautylogNodeCode {
export var init = function() {
/// <reference path="./typings/main.d.ts" />
var codeFunction = function(codeString,options?){
var hlight = require("hlight");
var codeFunction = function(codeString,options?){
let hlight = require("hlight");
var codeSnippet = {
source:codeString,
highlighted:"default"
@ -17,7 +14,5 @@ module BeautylogNodeCode {
codeSnippet.highlighted = hlight(codeSnippet.source,options.language);
//console.log(codeSnippet.highlighted)
}
};
return codeFunction;
}
}
};
export = codeFunction;

View File

@ -1,11 +1,11 @@
/// <reference path="./index.ts" />
module BeautylogNodeFiglet {
var defaultOptions = {
/// <reference path="./typings/main.d.ts" />
import plugins = require("./beautylog.plugins");
var defaultOptions = {
font:"Star Wars",
color: "green",
cb: function(){}
};
export var figlet = function(textArg:string,optionsArg?){
};
export var figlet = function(textArg:string,optionsArg?){
var done = plugins.q.defer();
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions,optionsArg);
@ -24,8 +24,8 @@ module BeautylogNodeFiglet {
done.resolve();
});
return done.promise;
};
export var figletSync = function(textArg:string,optionsArg?){
};
export var figletSync = function(textArg:string,optionsArg?){
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions,optionsArg);
console.log(plugins.figlet.textSync(textArg,{
@ -34,5 +34,4 @@ module BeautylogNodeFiglet {
verticalLayout: 'default'
})[options.color]);
return true;
};
}
};

View File

@ -1,8 +1,8 @@
/// <reference path="./index.ts" />
module BeautylogNodeLog {
export var init = function(){
/// <reference path="./typings/main.d.ts" />
var localBl = {
import plugins = require("./beautylog.plugins");
var localBl = {
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
infoPrefix: plugins.clc.bgXterm(198).xterm(231).bold(' INFO ') + ' ',
@ -10,15 +10,15 @@ module BeautylogNodeLog {
okPrefix: ' '.bgGreen + ' OK! '.bgBlack.green.bold + ' ',
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
};
};
/**
/**
*
* @param logText
* @param logType
* @returns {boolean}
*/
var logFunction = function(logText:string = 'empty log', logType:string = 'normal') {
var logFunction = function(logText:string = 'empty log', logType:string = 'normal') {
try {
switch (logType) {
case 'dir':
@ -55,7 +55,5 @@ module BeautylogNodeLog {
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
return false;
}
};
return logFunction;
}
}
};
export = logFunction;

View File

@ -1,14 +1,10 @@
/// <reference path="./index.ts" />
module BeautylogNodeTable {
export var cliTable;
export function init() {
cliTable = require("cli-table2");
var beautylogOsTable:any = {};
/// <reference path="./typings/main.d.ts" />
import classes = require("./beautylog.classes");
beautylogOsTable.new = function(typeArg:string,tableHeadArrayArg?) {
var newConsoleTable = new ConsoleTable(typeArg,tableHeadArrayArg);
var beautylogOsTable:any = {};
beautylogOsTable.new = function(typeArg:string,tableHeadArrayArg?) {
var newConsoleTable = new classes.ConsoleTable(typeArg,tableHeadArrayArg);
return newConsoleTable;
};
return beautylogOsTable;
}
}
};
export = beautylogOsTable;

View File

@ -1,71 +1,63 @@
/// <reference path="./index.ts" />
module BeautylogNode {
export function init() {
/// <reference path="./typings/main.d.ts" />
var beautylogNode:any = {
log:BeautylogNodeLog.init(),
code:BeautylogNodeCode.init(),
figlet:BeautylogNodeFiglet.figlet,
figletSync:BeautylogNodeFiglet.figletSync
};
import log = require("./beautylog.node.log");
export import table = require("./beautylog.node.table");
import code = require("./beautylog.node.code");
import figletModule = require("./beautylog.node.figlet");
/**
export let figlet = figletModule.figlet;
export let figletSync = figletModule.figletSync;
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
beautylogNode.dir = function(logText) {
return beautylogNode.log(logText, 'dir');
};
export let dir = function(logText) {
return log(logText, 'dir');
};
/**
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
beautylogNode.error = function(logText) {
return beautylogNode.log(logText, 'error');
};
export let error = function(logText) {
return log(logText, 'error');
};
/**
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
beautylogNode.info = function(logText) {
return beautylogNode.log(logText, 'info');
};
export let info = function(logText) {
return log(logText, 'info');
};
/**
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
beautylogNode.ok = function(logText) {
return beautylogNode.log(logText, 'ok');
};
export let ok = function(logText) {
return log(logText, 'ok');
};
/**
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
beautylogNode.success = function(logText) {
return beautylogNode.log(logText, 'success');
};
export let success = function(logText) {
return log(logText, 'success');
};
/**
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
beautylogNode.warn = function(logText) {
return beautylogNode.log(logText, 'warn');
};
beautylogNode.table = BeautylogNodeTable.init();
return beautylogNode;
}
}
export let warn = function(logText) {
return log(logText, 'warn');
};

View File

@ -1,19 +1,16 @@
/// <reference path="./index.ts" />
module BeautylogPlugins {
var plugins:any = {};
export var init = function(){
plugins = {
/// <reference path="./typings/main.d.ts" />
var plugins:any = {
lodash: require("lodash"),
smartenv: require("smartenv"),
q: require("q")
};
if (plugins.smartenv.getEnv().isNode){
};
if (plugins.smartenv.getEnv().isNode){
plugins = plugins.lodash.assign(plugins,{
cliTable: require("cli-table2"),
colors: require("colors"),
clc: require("cli-color"),
figlet: require("figlet")
});
}
return plugins;
};
}
export = plugins;

View File

@ -1,4 +1 @@
/// <reference path="./index.ts" />
module BeautylogPromiseChain {
}
/// <reference path="./typings/main.d.ts" />

View File

@ -1,28 +1,19 @@
/// <reference path="./typings/main.d.ts" />
/// <reference path="./beautylog.plugins.ts" />
/// <reference path="./beautylog.classes.ts" />
/// <reference path="./beautylog.node.ts" />
/// <reference path="./beautylog.node.log.ts" />
/// <reference path="./beautylog.node.code.ts" />
/// <reference path="./beautylog.node.table.ts" />
/// <reference path="./beautylog.node.figlet.ts" />
/// <reference path="./beautylog.browser.ts" />
/// <reference path="./beautylog.promisechain.ts" />
var plugins = BeautylogPlugins.init();
var beautylog = (function() {
switch (plugins.smartenv.getEnv().runtimeEnv) {
import plugins = require("./beautylog.plugins");
import BeautylogNode = require("./beautylog.node");
import BeautylogBrowser = require("./beautylog.browser");
var beautylog;
switch(plugins.smartenv.getEnv().runtimeEnv) {
case "node":
var beautylogOs = BeautylogNode.init();
return beautylogOs;
beautylog = BeautylogNode;
break;
case "browser":
var beautylogBrowser = BeautylogBrowser.init();
return beautylogBrowser;
beautylog = BeautylogBrowser;
break;
default:
console.log("something is strange about the platform in which you try to use beautylog");
break;
}
})();
module.exports = beautylog;
}
export = beautylog;

View File

@ -1,15 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
},
"colors/colors.d.ts": {
"commit": "273a567b0a0bcc34cbf2a2470b2febc95796b644"
}
}
}