ready for npmts-g
This commit is contained in:
28
dist/index.js
vendored
28
dist/index.js
vendored
@ -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
20
dist/npmts.options.js
vendored
@ -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
2
dist/npmts.paths.js
vendored
@ -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/");
|
||||
|
2
dist/npmts.promisechain.js
vendored
2
dist/npmts.promisechain.js
vendored
@ -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)
|
||||
|
Reference in New Issue
Block a user