tscoverage/ts/npmts.options.ts

38 lines
959 B
TypeScript
Raw Normal View History

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