2016-05-25 05:23:48 +02:00
|
|
|
import "typings-global";
|
2016-02-20 00:53:23 +01:00
|
|
|
import plugins = require("./npmts.plugins");
|
2016-05-17 02:32:40 +02:00
|
|
|
import {npmtsOra} from "./npmts.promisechain";
|
2016-03-23 14:12:58 +01:00
|
|
|
|
2016-04-02 19:22:01 +02:00
|
|
|
export let isCi = function(){
|
|
|
|
return plugins.smartci.check.isCi();
|
|
|
|
};
|
|
|
|
|
2016-02-20 00:53:23 +01:00
|
|
|
export var run = function(configArg){
|
2016-02-22 22:22:39 +01:00
|
|
|
var done = plugins.Q.defer();
|
2016-02-20 00:53:23 +01:00
|
|
|
var config = configArg;
|
2016-03-23 14:12:58 +01:00
|
|
|
|
2016-05-17 02:32:40 +02:00
|
|
|
npmtsOra.text("now determining build options...");
|
2016-03-23 14:12:58 +01:00
|
|
|
|
|
|
|
//handle default mode
|
2016-02-20 00:53:23 +01:00
|
|
|
if (config.mode == "default"){
|
|
|
|
config.typings = [
|
2016-03-12 10:21:16 +01:00
|
|
|
"./ts/typings.json"
|
2016-02-20 00:53:23 +01:00
|
|
|
];
|
|
|
|
config.ts = {
|
2016-06-07 08:49:22 +02:00
|
|
|
["./ts/**/*.ts"]: "./dist/"
|
|
|
|
};
|
|
|
|
config.testTs = {
|
2016-02-20 00:53:23 +01:00
|
|
|
["./test/test.ts"]: "./test/"
|
|
|
|
};
|
|
|
|
config.test = ["./index.js"];
|
|
|
|
}
|
2016-04-30 11:55:42 +02:00
|
|
|
|
|
|
|
//check if config.tsOptions is available
|
|
|
|
config.tsOptions ? void(0) : config.tsOptions = {};
|
2016-03-23 14:12:58 +01:00
|
|
|
|
2016-05-29 20:56:53 +02:00
|
|
|
|
2016-03-23 15:47:28 +01:00
|
|
|
|
2016-03-30 01:32:41 +02:00
|
|
|
config.coverageTreshold ? void(0) : config.coverageTreshold = 70;
|
|
|
|
|
2016-03-23 15:47:28 +01:00
|
|
|
// handle docs
|
|
|
|
config.docs ? void(0) : config.docs = {};
|
2016-03-23 14:12:58 +01:00
|
|
|
|
2016-04-02 01:20:52 +02:00
|
|
|
plugins.beautylog.ok("build options are ready!");
|
2016-03-23 14:12:58 +01:00
|
|
|
done.resolve(config);
|
2016-02-20 00:53:23 +01:00
|
|
|
return done.promise;
|
|
|
|
};
|