Compare commits

...

11 Commits

Author SHA1 Message Date
7e540bda87 2.2.3 2016-02-11 19:10:14 +01:00
b293dfe92d add figlet greeting 2016-02-11 19:10:01 +01:00
a753a5db2c 2.2.2 2016-02-09 20:36:40 +01:00
27f79b4425 readded test.ts to default build process 2016-02-09 20:36:31 +01:00
1ada5dd5a9 2.2.1 2016-02-09 17:42:43 +01:00
a41bfd442c fix coveralls initial value 2016-02-09 17:42:31 +01:00
2917b10ffb 2.2.0 2016-02-09 17:26:37 +01:00
bfc5bbbbb7 fix coverage path 2016-02-09 17:26:25 +01:00
cf507a4a17 add coverage badge 2016-02-09 17:19:27 +01:00
73a57ed264 2.1.10 2016-02-09 17:01:45 +01:00
39b79b679c fix config traveling 2016-02-09 17:01:37 +01:00
14 changed files with 42 additions and 30 deletions

View File

@ -1,6 +1,9 @@
# npmts # npmts
Write npm modules with TypeScript without hassle. Write npm modules with TypeScript without hassle.
## Status
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/npmts/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/npmts?branch=master)
## How to use npmts ## How to use npmts
### Install ### Install

2
index.d.ts vendored
View File

@ -6,7 +6,6 @@ declare module NpmtsPlugins {
gulp: any; gulp: any;
g: { g: {
coveralls: any; coveralls: any;
if: any;
insert: any; insert: any;
istanbul: any; istanbul: any;
mocha: any; mocha: any;
@ -44,7 +43,6 @@ declare var plugins: {
gulp: any; gulp: any;
g: { g: {
coveralls: any; coveralls: any;
if: any;
insert: any; insert: any;
istanbul: any; istanbul: any;
mocha: any; mocha: any;

View File

@ -10,7 +10,6 @@ var NpmtsPlugins;
gulp: require("gulp"), gulp: require("gulp"),
g: { g: {
coveralls: require("gulp-coveralls"), coveralls: require("gulp-coveralls"),
if: require("gulp-if"),
insert: require("gulp-insert"), insert: require("gulp-insert"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
mocha: require("gulp-mocha"), mocha: require("gulp-mocha"),
@ -77,7 +76,7 @@ var NpmtsOptions;
var done = plugins.q.defer(); var done = plugins.q.defer();
var config = configArg; var config = configArg;
if (typeof config.coveralls === "undefined") { if (typeof config.coveralls === "undefined") {
config.coveralls = true; config.coveralls = false;
} }
if (config.mode == "default") { if (config.mode == "default") {
config.typings = [ config.typings = [
@ -85,6 +84,7 @@ var NpmtsOptions;
]; ];
config.ts = (_a = {}, config.ts = (_a = {},
_a["./ts/index.ts"] = "./index.js", _a["./ts/index.ts"] = "./index.js",
_a["./ts/test.ts"] = "./test/test.js",
_a _a
); );
config.test = ["./index.js"]; config.test = ["./index.js"];
@ -181,7 +181,7 @@ var NpmtsCompile;
moduleStream.on("queueDrain", function () { moduleStream.on("queueDrain", function () {
plugins.beautylog.success("custom TypeScript installed successfully"); plugins.beautylog.success("custom TypeScript installed successfully");
moduleStream.on("finish", function () { moduleStream.on("finish", function () {
done.resolve(); done.resolve(config);
}); });
moduleStream.end(); moduleStream.end();
}); });
@ -209,15 +209,20 @@ var NpmtsTests;
return stream; return stream;
}; };
var coveralls = function () { var coveralls = function () {
var stream = plugins.gulp.src("./coverage/**/lcov.info") var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
.pipe(plugins.g.if((process.env.TRAVIS && config.coveralls), plugins.g.coveralls())); .pipe(plugins.g.coveralls());
return stream; return stream;
}; };
istanbul().on("finish", function () { istanbul().on("finish", function () {
mocha().on("finish", function () { mocha().on("finish", function () {
coveralls().on("finish", function () { if (process.env.TRAVIS && config.coveralls) {
coveralls().on("finish", function () {
done.resolve(config);
});
}
else {
done.resolve(config); done.resolve(config);
}); }
}); });
}); });
return done.promise; return done.promise;
@ -246,5 +251,6 @@ var NpmtsPromisechain;
/// <reference path="./npmts.promisechain.ts" /> /// <reference path="./npmts.promisechain.ts" />
console.log("**** starting NPMTS ****"); console.log("**** starting NPMTS ****");
var plugins = NpmtsPlugins.init(); var plugins = NpmtsPlugins.init();
plugins.beautylog.figletSync("NPMTS");
var paths = NpmtsPaths.init(); var paths = NpmtsPaths.init();
var promisechain = NpmtsPromisechain.init(); var promisechain = NpmtsPromisechain.init();

View File

@ -1,6 +1,6 @@
{ {
"name": "npmts", "name": "npmts",
"version": "2.1.9", "version": "2.2.3",
"description": "write npm modules with TypeScript", "description": "write npm modules with TypeScript",
"main": "index.js", "main": "index.js",
"typings": "./index.d.ts", "typings": "./index.d.ts",
@ -26,20 +26,19 @@
}, },
"homepage": "https://github.com/pushrocks/npmts#readme", "homepage": "https://github.com/pushrocks/npmts#readme",
"dependencies": { "dependencies": {
"beautylog": "2.0.7", "beautylog": "2.1.1",
"fs-extra": "^0.26.5", "fs-extra": "^0.26.5",
"gulp": "3.9.0", "gulp": "3.9.1",
"gulp-coveralls": "^0.1.4", "gulp-coveralls": "^0.1.4",
"gulp-if": "^2.0.0",
"gulp-insert": "0.5.0", "gulp-insert": "0.5.0",
"gulp-istanbul": "^0.10.3", "gulp-istanbul": "^0.10.3",
"gulp-mocha": "^2.2.0", "gulp-mocha": "^2.2.0",
"gulp-typescript": "2.10.0", "gulp-typescript": "2.11.0",
"gulp-typings": "0.0.0", "gulp-typings": "0.0.0",
"merge2": "1.0.1", "merge2": "1.0.1",
"q": "^1.4.1", "q": "^1.4.1",
"smartcli": "0.0.11", "smartcli": "0.0.11",
"smartfile": "0.0.11", "smartfile": "0.0.11",
"typings": "^0.6.6" "typings": "^0.6.8"
} }
} }

View File

@ -77,7 +77,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 16:34:30 GMT+0100 (CET) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Feb 11 2016 19:08:46 GMT+0100 (CET)
</div> </div>
</div> </div>
<script src="../prettify.js"></script> <script src="../prettify.js"></script>

View File

@ -76,7 +76,7 @@ module.exports = testplugin;
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 16:34:30 GMT+0100 (CET) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Feb 11 2016 19:08:46 GMT+0100 (CET)
</div> </div>
</div> </div>
<script src="../prettify.js"></script> <script src="../prettify.js"></script>

View File

@ -77,7 +77,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Feb 09 2016 16:34:30 GMT+0100 (CET) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Feb 11 2016 19:08:46 GMT+0100 (CET)
</div> </div>
</div> </div>
<script src="prettify.js"></script> <script src="prettify.js"></script>

2
test/assets/test/test.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
/// <reference path="ts/typings/main.d.ts" />
declare var testplugin: any;

View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****"); console.log("**** starting test ****");
var testplugin = require("../index.js"); var testplugin = require("../index.js");

View File

@ -7,7 +7,8 @@
/// <reference path="./npmts.compile.ts" /> /// <reference path="./npmts.compile.ts" />
/// <reference path="./npmts.tests.ts" /> /// <reference path="./npmts.tests.ts" />
/// <reference path="./npmts.promisechain.ts" /> /// <reference path="./npmts.promisechain.ts" />
console.log("**** starting NPMTS ****") console.log("**** starting NPMTS ****");
var plugins = NpmtsPlugins.init(); var plugins = NpmtsPlugins.init();
plugins.beautylog.figletSync("NPMTS");
var paths = NpmtsPaths.init(); var paths = NpmtsPaths.init();
var promisechain = NpmtsPromisechain.init(); var promisechain = NpmtsPromisechain.init();

View File

@ -83,7 +83,7 @@ module NpmtsCompile {
moduleStream.on("queueDrain",function(){ moduleStream.on("queueDrain",function(){
plugins.beautylog.success("custom TypeScript installed successfully"); plugins.beautylog.success("custom TypeScript installed successfully");
moduleStream.on("finish",function(){ moduleStream.on("finish",function(){
done.resolve(); done.resolve(config);
}); });
moduleStream.end(); moduleStream.end();
}); });

View File

@ -4,14 +4,15 @@ module NpmtsOptions {
var done = plugins.q.defer(); var done = plugins.q.defer();
var config = configArg; var config = configArg;
if (typeof config.coveralls === "undefined"){ if (typeof config.coveralls === "undefined"){
config.coveralls = true; config.coveralls = false;
} }
if (config.mode == "default"){ if (config.mode == "default"){
config.typings = [ config.typings = [
"./ts/" "./ts/"
]; ];
config.ts = { config.ts = {
["./ts/index.ts"]: "./index.js" ["./ts/index.ts"]: "./index.js",
["./ts/test.ts"]: "./test/test.js"
}; };
config.test = ["./index.js"]; config.test = ["./index.js"];
done.resolve(config); done.resolve(config);

View File

@ -7,7 +7,6 @@ module NpmtsPlugins {
gulp: require("gulp"), gulp: require("gulp"),
g: { g: {
coveralls: require("gulp-coveralls"), coveralls: require("gulp-coveralls"),
if: require("gulp-if"),
insert: require("gulp-insert"), insert: require("gulp-insert"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
mocha: require("gulp-mocha"), mocha: require("gulp-mocha"),

View File

@ -23,19 +23,20 @@ module NpmtsTests {
}; };
var coveralls = function(){ var coveralls = function(){
var stream = plugins.gulp.src("./coverage/**/lcov.info") var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
.pipe(plugins.g.if( .pipe(plugins.g.coveralls());
(process.env.TRAVIS && config.coveralls),
plugins.g.coveralls()
));
return stream; return stream;
}; };
istanbul().on("finish",function(){ istanbul().on("finish",function(){
mocha().on("finish",function(){ mocha().on("finish",function(){
coveralls().on("finish",function(){ if(process.env.TRAVIS && config.coveralls){
coveralls().on("finish",function(){
done.resolve(config);
})
} else {
done.resolve(config); done.resolve(config);
}) }
}) })
}); });
return done.promise; return done.promise;