tscoverage/ts/npmts.default.ts

47 lines
1.5 KiB
TypeScript
Raw Normal View History

2016-01-16 13:33:09 +00:00
/// <reference path="./index.ts" />
module NpmtsDefault {
2016-01-30 04:29:54 +00:00
export var run = function() {
var done = plugins.q.defer();
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"
}))
2016-01-30 03:57:24 +00:00
.pipe(plugins.gulp.dest(paths.testDir))
2016-01-16 13:33:09 +00:00
});
2016-01-18 18:11:42 +00:00
plugins.gulp.task("defaultCleanup",function(cb){
plugins.beautylog.success("TypeScript for this module compiled successfully.");
2016-01-30 04:29:54 +00:00
done.resolve();
2016-01-18 18:11:42 +00:00
cb();
});
2016-01-18 17:59:44 +00:00
plugins.gulp.task("default",function(cb){
2016-01-31 21:24:57 +00:00
plugins.g.sequence("defaultIndexTS","defaultTestTS","defaultCleanup",cb);
2016-01-16 13:33:09 +00:00
});
plugins.gulp.start.apply(plugins.gulp, ['default']);
2016-01-30 04:29:54 +00:00
return done.promise;
2016-01-16 13:33:09 +00:00
}
}