ready for npmts-g
This commit is contained in:
28
ts/index.ts
28
ts/index.ts
@ -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();
|
@ -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);
|
||||
|
@ -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/");
|
||||
|
@ -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");
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user