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-18 18:11:42 +00:00
|
|
|
plugins.beautylog.log("now installing typings from" + " ts/tsd.json".blue);
|
2016-01-25 19:24:59 +00:00
|
|
|
plugins.g.if(process.env.TRAVIS,
|
|
|
|
plugins.g.tsd({
|
|
|
|
command: 'reinstall',
|
|
|
|
config: paths.tsd
|
|
|
|
}, cb)
|
|
|
|
)
|
|
|
|
;
|
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']);
|
|
|
|
}
|
|
|
|
}
|