tscoverage/ts/npmts.default.ts

57 lines
2.0 KiB
TypeScript
Raw Normal View History

2016-01-16 13:33:09 +00:00
/// <reference path="./index.ts" />
module NpmtsDefault {
export var init = function() {
2016-01-18 17:59:44 +00:00
plugins.gulp.task("defaultTsd",function(cb){
2016-01-25 19:52:29 +00:00
if(!process.env.TRAVIS) {
2016-01-25 19:24:59 +00:00
plugins.g.tsd({
command: 'reinstall',
config: paths.tsd
2016-01-25 19:52:29 +00:00
}, cb);
plugins.beautylog.log("now installing typings from" + " ts/tsd.json".blue);
} else {
plugins.beautylog.warn("We are on TRAVIS. Typings will not be installed due to GitHub API restrictions.");
plugins.beautylog.log("Make sure the repo tracks " + "typings".blue + " directories")
}
2016-01-18 17:59:44 +00:00
});
plugins.gulp.task("defaultIndexTS", function(){
2016-01-18 18:11:42 +00:00
plugins.beautylog.log("now compiling" + " ts/index.ts".blue);
2016-01-18 14:15:15 +00:00
var tsResult = plugins.gulp.src(paths.indexTS)
.pipe(plugins.g.typescript({
out:"index.js",
declaration:true
}));
return plugins.mergeStream([
tsResult.dts.pipe(plugins.gulp.dest(paths.cwd)),
tsResult.js
.pipe(plugins.g.insert.prepend('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(paths.cwd))
]);
2016-01-16 13:33:09 +00:00
});
2016-01-18 17:59:44 +00:00
plugins.gulp.task("defaultTestTS", function(){
2016-01-18 18:11:42 +00:00
plugins.beautylog.log("now compiling" + " ts/test.ts".blue);
2016-01-16 13:33:09 +00:00
plugins.gulp.src(paths.testTS)
2016-01-18 14:15:15 +00:00
.pipe(plugins.g.typescript({
2016-01-16 13:33:09 +00:00
out: "test.js"
}))
.pipe(plugins.gulp.dest(paths.cwd))
});
2016-01-18 18:11:42 +00:00
plugins.gulp.task("defaultCleanup",function(cb){
plugins.beautylog.success("TypeScript for this module compiled successfully.");
cb();
});
2016-01-18 17:59:44 +00:00
plugins.gulp.task("default",function(cb){
2016-01-18 18:11:42 +00:00
plugins.g.sequence("defaultTsd","defaultIndexTS","defaultTestTS","defaultCleanup",cb);
2016-01-16 13:33:09 +00:00
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
}
}