now uses beautylog.ora

This commit is contained in:
Philipp Kunz 2016-05-17 02:32:40 +02:00
parent e75de7590e
commit 3f261a4fa6
20 changed files with 65 additions and 47 deletions

View File

@ -2,13 +2,14 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now looking at required assets");
npmts_promisechain_1.npmtsOra.text("now looking at required assets");
if (config.cli == true) {
plugins.smartfile.fsaction.copy(plugins.path.join(paths.npmtsAssetsDir, "cli.js"), paths.distDir);
plugins.beautylog.ok("CLI asset has been installed!");
plugins.beautylog.ok("installed CLI assets!");
done.resolve(config);
}
else {

5
dist/npmts.clean.js vendored
View File

@ -2,12 +2,13 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
exports.run = function (configArg) {
plugins.beautylog.log("now cleaning up from previous builds...");
npmts_promisechain_1.npmtsOra.text("cleaning up from previous builds...");
var done = plugins.Q.defer();
plugins.smartfile.fsaction.remove(paths.distDir)
.then(function () {
plugins.beautylog.ok("Cleaned up!");
plugins.beautylog.ok("Cleaned up from previous builds!");
done.resolve(configArg);
});
return done.promise;

View File

@ -3,11 +3,12 @@
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var helpers = require("./npmts.compile.helpers");
var npmts_promisechain_1 = require("./npmts.promisechain");
/**
* handles definition to make them fit for modular use
*/
var definitionHandler = function (configArg) {
plugins.beautylog.log("now making declaration files ready");
npmts_promisechain_1.npmtsOra.text("now making declaration files ready");
var done = plugins.Q.defer();
var configTsLenght = Object.keys(configArg.ts).length;
if (configTsLenght == 0) {
@ -23,7 +24,7 @@ var definitionHandler = function (configArg) {
.pipe(plugins.g.gFunction(function () {
localCounter++;
if (localCounter == configTsLenght) {
plugins.beautylog.ok("declaration files ready!!!");
plugins.beautylog.ok("made declaration files ready!");
done.resolve(configArg);
}
;
@ -34,7 +35,7 @@ var definitionHandler = function (configArg) {
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now compiling " + "TypeScript".yellow);
npmts_promisechain_1.npmtsOra.text("now compiling " + "TypeScript".yellow);
var moduleStream = plugins.merge2({ end: false });
/* -------------------------------------------------
* ----------- compile TypeScript --------------------------
@ -65,7 +66,7 @@ exports.run = function (configArg) {
}
moduleStream.on("queueDrain", function () {
moduleStream.on("finish", function () {
plugins.beautylog.ok("TypeScript has been compiled!");
plugins.beautylog.ok("compiled TypeScript!");
definitionHandler(config)
.then(function () {
done.resolve(config);

View File

@ -2,18 +2,19 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
exports.run = function (configArg) {
var config = configArg;
var done = plugins.Q.defer();
/* -------------------------------------------------
* ----------- install typings ---------------
* ----------------------------------------------- */
plugins.beautylog.log("now installing " + "typings".yellow);
npmts_promisechain_1.npmtsOra.text("now installing typings");
var absoluteTypingsArray = plugins.smartpath.transform.toAbsolute(config.typings, paths.cwd);
plugins.gulp.src(absoluteTypingsArray)
.pipe(plugins.g.typings())
.pipe(plugins.g.gFunction(function () {
plugins.beautylog.ok("typings have been installed!");
plugins.beautylog.ok("typings installed!");
done.resolve(config);
}, "atEnd"));
return done.promise;

3
dist/npmts.jsdoc.js vendored
View File

@ -2,9 +2,10 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
var genJsdoc = function (configArg) {
var done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
npmts_promisechain_1.npmtsOra.text("now generating JsDoc documentation");
plugins.gulp.src([
plugins.path.join(paths.cwd, "README.md"),
plugins.path.join(paths.distDir, "**/*.js")

View File

@ -1,6 +1,7 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var npmts_promisechain_1 = require("./npmts.promisechain");
exports.isCi = function () {
return plugins.smartci.check.isCi();
};
@ -15,7 +16,7 @@ exports.doPublish = function () {
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now determining build options...");
npmts_promisechain_1.npmtsOra.text("now determining build options...");
//handle default mode
if (config.mode == "default") {
config.typings = [

View File

@ -1,6 +1,8 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
exports.npmtsOra = new plugins.beautylog.Ora("setting up TaskChain", "cyan");
exports.npmtsOra.start();
var NpmtsAssets = require("./npmts.assets");
var NpmtsClean = require("./npmts.clean");
var NpmtsCompile = require("./npmts.compile");
@ -41,6 +43,7 @@ exports.run = function () {
plugins.beautylog.success("READY TO SHIP!");
}
else {
exports.npmtsOra.endOk("Tasks finished!");
plugins.beautylog.success("Done!");
}
});

9
dist/npmts.tests.js vendored
View File

@ -2,6 +2,7 @@
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
exports.publishCoverage = function (configArg) {
var done = plugins.Q.defer();
plugins.beautylog.log("now uploading coverage data to codecov.io");
@ -63,11 +64,9 @@ var coverage = function (configArg) {
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now starting tests");
console.log("--------------------------------------------------------------\n" +
"***************************" +
" TESTS: ".blue +
"***************************\n" +
npmts_promisechain_1.npmtsOra.text("now starting tests");
plugins.beautylog.log("-------------------------------------------------------\n" +
"*************************** TESTS: ***************************\n" +
"--------------------------------------------------------------");
istanbul(config)
.then(mocha)

View File

@ -7,8 +7,9 @@
"npmts": "dist/cli.js"
},
"scripts": {
"test": "(cd compile && node compile.js) && (cd test/assets && node ../../dist/index.js)",
"release": "(git add -A && git commit -m 'update' && git push origin master && npm version patch && npm publish)"
"test": "(npm run compile && npm run check)",
"check":"(cd ./test/assets && node ../../dist/index.js)",
"compile":"(cd compile && node compile.js)"
},
"repository": {
"type": "git",
@ -25,21 +26,21 @@
},
"homepage": "https://github.com/pushrocks/npmts#readme",
"dependencies": {
"beautylog": "4.1.2",
"beautylog": "5.0.1",
"fs-extra": "^0.30.0",
"gulp": "3.9.1",
"gulp-codecov": "^2.0.1",
"gulp-concat": "^2.6.0",
"gulp-function": "^1.3.1",
"gulp-if": "^2.0.0",
"gulp-if": "^2.0.1",
"gulp-istanbul": "^0.10.4",
"gulp-jsdoc3": "^0.2.1",
"gulp-mocha": "^2.2.0",
"gulp-replace": "^0.5.4",
"gulp-sourcemaps": "^2.0.0-alpha",
"gulp-typescript": "2.13.0",
"gulp-typescript": "2.13.4",
"gulp-typings": "1.3.6",
"lodash": "^4.11.1",
"lodash": "^4.12.0",
"merge2": "1.0.2",
"projectinfo": "1.0.1",
"q": "^1.4.1",
@ -47,8 +48,8 @@
"smartci": "0.0.1",
"smartcli": "0.0.11",
"smartcov": "0.0.6",
"smartenv": "1.2.2",
"smartfile": "3.0.5",
"smartenv": "1.2.5",
"smartfile": "3.0.6",
"smartpath": "3.2.1",
"smartstring": "^1.0.3",
"source-map-support": "^0.4.0"

View File

@ -6,4 +6,4 @@ var testplugin = {
};
module.exports = testplugin;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFJLFVBQVUsR0FBRztJQUNiLFlBQVksRUFBRTtRQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsd0JBQXdCLENBQUMsQ0FBQztJQUMxQyxDQUFDO0NBQ0osQ0FBQztBQUNGLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxubGV0IHRlc3RwbHVnaW4gPSB7XG4gICAgbG9nU29tZXRoaW5nOiBmdW5jdGlvbigpe1xuICAgICAgICBjb25zb2xlLmxvZyhcIm9ubHkgZnVuY3Rpb24gZXhlY3V0ZWRcIik7XG4gICAgfVxufTtcbm1vZHVsZS5leHBvcnRzID0gdGVzdHBsdWdpbjsiXX0=
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFJLFVBQVUsR0FBRztJQUNiLFlBQVksRUFBRTtRQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsd0JBQXdCLENBQUMsQ0FBQztJQUMxQyxDQUFDO0NBQ0osQ0FBQztBQUNGLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxyXG5sZXQgdGVzdHBsdWdpbiA9IHtcclxuICAgIGxvZ1NvbWV0aGluZzogZnVuY3Rpb24oKXtcclxuICAgICAgICBjb25zb2xlLmxvZyhcIm9ubHkgZnVuY3Rpb24gZXhlY3V0ZWRcIik7XHJcbiAgICB9XHJcbn07XHJcbm1vZHVsZS5leHBvcnRzID0gdGVzdHBsdWdpbjsiXX0=

View File

@ -8,4 +8,4 @@ describe("testplugins", function () {
});
});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksVUFBVSxHQU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BQUMsQ0FBQyxDQUFDO0lBQ1AsQ0FBQyxDQUFDLENBQUM7QUFDUCxDQUFDLENBQUMsQ0FBQyIsImZpbGUiOiJ0ZXN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4uL3RzL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cclxudmFyIHRlc3RwbHVnaW4gPSByZXF1aXJlKFwiLi4vZGlzdC9pbmRleC5qc1wiKTtcclxuZGVzY3JpYmUoXCJ0ZXN0cGx1Z2luc1wiLGZ1bmN0aW9uKCl7XHJcbiAgICBkZXNjcmliZShcIi5sb2dTb21ldGhpbmdcIixmdW5jdGlvbigpe1xyXG4gICAgICAgIGl0KFwic2hvdWxkIGxvZyBzb21ldGhpbmdcIixmdW5jdGlvbigpe1xyXG4gICAgICAgICAgICB0ZXN0cGx1Z2luLmxvZ1NvbWV0aGluZygpXHJcbiAgICAgICAgfSk7XHJcbiAgICB9KTtcclxufSk7Il19

View File

@ -1,14 +1,15 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain";
export var run = function(configArg){
let done = plugins.Q.defer();
let config = configArg;
plugins.beautylog.log("now looking at required assets");
npmtsOra.text("now looking at required assets");
if(config.cli == true){
plugins.smartfile.fsaction.copy(plugins.path.join(paths.npmtsAssetsDir,"cli.js"),paths.distDir);
plugins.beautylog.ok("CLI asset has been installed!");
plugins.beautylog.ok("installed CLI assets!");
done.resolve(config);
} else {
done.resolve(config);

View File

@ -1,13 +1,14 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain";
export let run = function(configArg){
plugins.beautylog.log("now cleaning up from previous builds...");
npmtsOra.text("cleaning up from previous builds...");
let done = plugins.Q.defer();
plugins.smartfile.fsaction.remove(paths.distDir)
.then(function(){
plugins.beautylog.ok("Cleaned up!");
plugins.beautylog.ok("Cleaned up from previous builds!");
done.resolve(configArg);
});
return done.promise;

View File

@ -1,14 +1,14 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import helpers = require("./npmts.compile.helpers");
import {npmtsOra} from "./npmts.promisechain";
/**
* handles definition to make them fit for modular use
*/
let definitionHandler = function(configArg){
plugins.beautylog.log("now making declaration files ready");
npmtsOra.text("now making declaration files ready");
let done = plugins.Q.defer();
let configTsLenght = Object.keys(configArg.ts).length;
if(configTsLenght == 0) {
@ -24,7 +24,7 @@ let definitionHandler = function(configArg){
.pipe(plugins.g.gFunction(function(){
localCounter++
if(localCounter == configTsLenght){
plugins.beautylog.ok("declaration files ready!!!");
plugins.beautylog.ok("made declaration files ready!");
done.resolve(configArg)
};
},"atEnd"));
@ -37,7 +37,7 @@ let definitionHandler = function(configArg){
export let run = function (configArg) {
let done = plugins.Q.defer();
let config = configArg;
plugins.beautylog.log("now compiling " + "TypeScript".yellow);
npmtsOra.text("now compiling " + "TypeScript".yellow);
let moduleStream = plugins.merge2({ end: false });
/* -------------------------------------------------
@ -74,7 +74,7 @@ export let run = function (configArg) {
moduleStream.on("queueDrain", function () {
moduleStream.on("finish", function () {
plugins.beautylog.ok("TypeScript has been compiled!");
plugins.beautylog.ok("compiled TypeScript!");
definitionHandler(config)
.then(function(){
done.resolve(config);

View File

@ -1,18 +1,20 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain";
export var run = function(configArg){
var config = configArg;
var done = plugins.Q.defer();
/* -------------------------------------------------
* ----------- install typings ---------------
* ----------------------------------------------- */
plugins.beautylog.log("now installing " + "typings".yellow);
npmtsOra.text("now installing typings");
var absoluteTypingsArray = plugins.smartpath.transform.toAbsolute(config.typings,paths.cwd);
plugins.gulp.src(absoluteTypingsArray)
.pipe(plugins.g.typings())
.pipe(plugins.g.gFunction(function(){
plugins.beautylog.ok("typings have been installed!");
plugins.beautylog.ok("typings installed!");
done.resolve(config);
},"atEnd"));
return done.promise;

View File

@ -1,10 +1,11 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain";
let genJsdoc = function(configArg){
let done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
npmtsOra.text("now generating JsDoc documentation");
plugins.gulp.src([
plugins.path.join(paths.cwd,"README.md"),
plugins.path.join(paths.distDir,"**/*.js")

View File

@ -1,5 +1,6 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import {npmtsOra} from "./npmts.promisechain";
export let isCi = function(){
return plugins.smartci.check.isCi();
@ -19,7 +20,7 @@ export var run = function(configArg){
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now determining build options...");
npmtsOra.text("now determining build options...");
//handle default mode
if (config.mode == "default"){

View File

@ -1,5 +1,5 @@
/// <reference path="./typings/main.d.ts" />
export let beautylog = require("beautylog");
export import beautylog = require("beautylog");
export let fs = require("fs-extra");
export let gulp = require("gulp");
export let g = {

View File

@ -1,6 +1,9 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
export let npmtsOra = new plugins.beautylog.Ora("setting up TaskChain","cyan");
npmtsOra.start();
import NpmtsAssets = require("./npmts.assets");
import NpmtsClean = require("./npmts.clean");
import NpmtsCompile = require("./npmts.compile");
@ -41,6 +44,7 @@ export var run = function(){
console.log(shipString);
plugins.beautylog.success("READY TO SHIP!");
} else {
npmtsOra.endOk("Tasks finished!");
plugins.beautylog.success("Done!")
}

View File

@ -1,6 +1,7 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
import {npmtsOra} from "./npmts.promisechain";
export let publishCoverage = function(configArg){
let done = plugins.Q.defer();
@ -71,12 +72,10 @@ export let run = function(configArg) {
let done = plugins.Q.defer();
let config = configArg;
plugins.beautylog.log("now starting tests");
console.log(
"--------------------------------------------------------------\n" +
"***************************" +
" TESTS: ".blue +
"***************************\n" +
npmtsOra.text("now starting tests");
plugins.beautylog.log(
"-------------------------------------------------------\n" +
"*************************** TESTS: ***************************\n" +
"--------------------------------------------------------------"
);