ready for npmts-g

This commit is contained in:
Philipp Kunz 2016-06-10 06:14:12 +02:00
parent 3df47307a3
commit 7f4d72f0d6
10 changed files with 45 additions and 72 deletions

28
dist/index.js vendored
View File

@ -1,18 +1,26 @@
"use strict";
require("typings-global");
// start early and load modules
/* ================================================== *
Starting NPMTS main process.
* ================================================== */
var early = require("early");
early.start("NPMTS");
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
early.stop();
plugins.beautylog.figletSync("NPMTS");
var projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
plugins.beautylog.info("npmts version: " + projectInfo.version);
try {
npmts_promisechain_1.promisechain();
}
catch (err) {
console.log(err);
}
var npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
var npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
.then(function () {
plugins.beautylog.figletSync("NPMTS");
plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version);
try {
npmts_promisechain_1.promisechain();
}
catch (err) {
console.log(err);
}
});
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();

20
dist/npmts.options.js vendored
View File

@ -5,19 +5,6 @@ var npmts_promisechain_1 = require("./npmts.promisechain");
exports.isCi = function () {
return plugins.smartci.check.isCi();
};
exports.isRelease = function () {
return plugins.smartci.check.isCi()
&& plugins.smartci.check.isTaggedCommit();
};
exports.doPublish = function () {
try {
return exports.isRelease()
&& plugins.smartci.get.subJobNumber() == 1;
}
catch (err) {
return false;
}
};
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
@ -39,16 +26,9 @@ exports.run = function (configArg) {
}
//check if config.tsOptions is available
config.tsOptions ? void (0) : config.tsOptions = {};
// handle state of current build
exports.isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
: plugins.beautylog.info("NOT A RELEASE build!");
exports.isRelease() && exports.doPublish() ? plugins.beautylog.info("All right: This is the first subBuild, so this one publishes COVERAGE + DOCS when tests succeed!")
: plugins.beautylog.info("We are not publishing anything!");
config.coverageTreshold ? void (0) : config.coverageTreshold = 70;
// handle docs
config.docs ? void (0) : config.docs = {};
config.docs.publish ? void (0) : config.docs.publish = false;
exports.doPublish() ? void (0) : config.docs.publish = false;
plugins.beautylog.ok("build options are ready!");
done.resolve(config);
return done.promise;

2
dist/npmts.paths.js vendored
View File

@ -4,7 +4,7 @@ var plugins = require("./npmts.plugins");
//Npmts Paths
exports.npmtsPackageRoot = plugins.path.join(__dirname, "../");
//Project paths
exports.cwd = plugins.smartcli.get.cwd().path;
exports.cwd = process.cwd();
//Directories
exports.tsDir = plugins.path.join(exports.cwd, "ts/");
exports.distDir = plugins.path.join(exports.cwd, "dist/");

View File

@ -2,7 +2,6 @@
require("typings-global");
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");
@ -14,6 +13,7 @@ var NpmtsPublish = require("./npmts.publish");
var NpmtsTests = require("./npmts.tests");
exports.promisechain = function () {
var done = plugins.Q.defer();
exports.npmtsOra.start();
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsClean.run)

View File

@ -7,8 +7,9 @@
"npmts": "dist/cli.js"
},
"scripts": {
"test": "(npm run compile && npm run check)",
"test": "(npm run compile && npm run check && npm run checkVersion)",
"check": "(cd ./test/assets && node ../../dist/index.js)",
"checkVersion":"cd ./test/assets && node ../../dist/index.js -v",
"compile": "(cd compile && node compile.js)"
},
"repository": {
@ -27,7 +28,7 @@
"homepage": "https://gitlab.com/pushrocks/npmts#readme",
"dependencies": {
"beautylog": "5.0.8",
"early": "^2.0.1",
"early": "^2.0.7",
"fs-extra": "^0.30.0",
"gulp": "3.9.1",
"gulp-concat": "^2.6.0",
@ -46,7 +47,7 @@
"q": "^1.4.1",
"shelljs": "^0.7.0",
"smartci": "0.0.1",
"smartcli": "0.0.11",
"smartcli": "1.0.1",
"smartcov": "0.0.6",
"smartenv": "1.2.5",
"smartfile": "3.0.10",

View File

@ -1,6 +1,8 @@
import "typings-global";
// start early and load modules
/* ================================================== *
Starting NPMTS main process.
* ================================================== */
import * as early from "early";
early.start("NPMTS");
import * as plugins from "./npmts.plugins"
@ -8,14 +10,20 @@ import * as paths from "./npmts.paths";
import {promisechain} from "./npmts.promisechain";
early.stop();
plugins.beautylog.figletSync("NPMTS");
let projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
plugins.beautylog.info("npmts version: " + projectInfo.version);
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
try {
promisechain();
}
catch(err){
console.log(err);
}
let npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
.then(() => {
plugins.beautylog.figletSync("NPMTS");
plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version);
try {
promisechain();
}
catch(err){
console.log(err);
}
});
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();

View File

@ -6,21 +6,6 @@ export let isCi = function(){
return plugins.smartci.check.isCi();
};
export let isRelease = function():boolean {
return plugins.smartci.check.isCi()
&& plugins.smartci.check.isTaggedCommit();
};
export let doPublish = function():boolean {
try {
return isRelease()
&& plugins.smartci.get.subJobNumber() == 1;
}
catch (err){
return false;
}
};
export var run = function(configArg){
var done = plugins.Q.defer();
var config = configArg;
@ -44,21 +29,12 @@ export var run = function(configArg){
//check if config.tsOptions is available
config.tsOptions ? void(0) : config.tsOptions = {};
// handle state of current build
isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
: plugins.beautylog.info("NOT A RELEASE build!");
isRelease() && doPublish() ? plugins.beautylog.info("All right: This is the first subBuild, so this one publishes COVERAGE + DOCS when tests succeed!")
: plugins.beautylog.info("We are not publishing anything!");
config.coverageTreshold ? void(0) : config.coverageTreshold = 70;
// handle docs
config.docs ? void(0) : config.docs = {};
config.docs.publish ? void(0) : config.docs.publish = false;
doPublish() ? void(0) : config.docs.publish = false;
plugins.beautylog.ok("build options are ready!");
done.resolve(config);

View File

@ -6,7 +6,7 @@ export let npmtsPackageRoot = plugins.path.join(__dirname,"../");
//Project paths
export let cwd = plugins.smartcli.get.cwd().path;
export let cwd = process.cwd();
//Directories
export let tsDir = plugins.path.join(cwd,"ts/");

View File

@ -20,7 +20,7 @@ export let path = require("path");
export let Q = require("q");
export let shelljs = require("shelljs");
export let smartci = require("smartci");
export let smartcli = require("smartcli");
export import smartcli = require("smartcli");
export let smartcov = require("smartcov");
export import smartenv = require("smartenv");
export import smartfile = require("smartfile");

View File

@ -2,7 +2,6 @@ import "typings-global";
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");
@ -16,6 +15,7 @@ import NpmtsTests = require("./npmts.tests");
export let promisechain = function(){
let done = plugins.Q.defer();
npmtsOra.start();
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsClean.run)