Compare commits

...

18 Commits

Author SHA1 Message Date
d8fb9747cd 5.0.1 2016-04-05 00:31:25 +02:00
53209b18a9 update des 2016-04-05 00:31:17 +02:00
3e3561f4bb 5.0.0 2016-04-04 23:19:50 +02:00
099b513e0a update deps 2016-04-04 23:19:34 +02:00
cf15c428c1 4.0.3 2016-04-04 22:58:08 +02:00
3bd876a201 update deps 2016-04-04 22:57:50 +02:00
af62f20614 4.0.2 2016-04-04 16:57:13 +02:00
69eba08b27 updated log message 2016-04-04 16:57:09 +02:00
6635265f4b added codecov badge 2016-04-02 19:36:46 +02:00
ebdda5f969 4.0.1 2016-04-02 19:22:17 +02:00
f3a24154b4 now publishing coverage every time on travis since codecov does a good job sorting anything unwanted out 2016-04-02 19:22:01 +02:00
2980b6b5f3 4.0.0 2016-04-02 19:09:41 +02:00
570046ff67 switched from coveralls to codecov 2016-04-02 19:09:11 +02:00
112ce2d0d6 add author note 2016-04-02 01:25:01 +02:00
791eaefe3c better log messages 2016-04-02 01:20:52 +02:00
a3af90844a 3.6.10 2016-03-30 15:26:57 +02:00
e389f78256 more cosmetics 2016-03-30 15:26:53 +02:00
9e8fc76623 better wording 2016-03-30 01:35:20 +02:00
15 changed files with 59 additions and 43 deletions

View File

@ -6,7 +6,7 @@ Write npm modules with TypeScript without hassle.
[![Dependency Status](https://david-dm.org/pushrocks/npmts.svg)](https://david-dm.org/pushrocks/npmts)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/npmts/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/npmts/badges/code.svg)](https://www.bithound.io/github/pushrocks/npmts)
[![Coverage Status](https://coveralls.io/repos/github/pushrocks/npmts/badge.svg?branch=master)](https://coveralls.io/github/pushrocks/npmts?branch=master)
[![codecov.io](https://codecov.io/github/pushrocks/npmts/coverage.svg?branch=master)](https://codecov.io/github/pushrocks/npmts?branch=master)
## What is NPMTS?
NPMTS is your friend when it comes to write, test, publish and document NPM modules written in TypeScript.
@ -39,7 +39,7 @@ Then use it in package.json's script section to trigger a build:
1. Instrumentalize created JavaScript files with istanbul
1. Run Tests
1. Create Coverage report
1. Upload Coverage reports to travis (Tests must pass, Coveralls must be activated, by default only triggers on travis)
1. Upload Coverage reports to codecov.io (Tests must pass, codecov.io must be activated, by default only triggers on travis)
1. Upload JsDoc Documentation to gh-pages branch on GitHub. (Tests must pass, requires GitHub Token)
#### npmts.json
@ -98,4 +98,9 @@ The file must be named **npmts.json**
* **ts** You can list as many TypeScript files as you like. The key represents the source TypeScript file, the value the output file.
* **typings** is an array of all direcories that have a typings.json present. Uses the new typings tool from npm.
> We will add more options over time.
> We will add more options over time.
### About the authors:
[![Project Phase](https://mediaserve.lossless.digital/lossless.com/img/createdby_github.svg)](https://lossless.com/)
[![PayPal](https://img.shields.io/badge/Support%20us-PayPal-blue.svg)](https://paypal.me/lossless)

3
dist/npmts.clean.js vendored
View File

@ -3,10 +3,11 @@
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
exports.run = function (configArg) {
plugins.beautylog.log("now cleaning up from previous builds");
plugins.beautylog.log("now cleaning up from previous builds...");
var done = plugins.Q.defer();
plugins.smartfile.fsaction.remove(paths.distDir)
.then(function () {
plugins.beautylog.ok("Cleaned up!");
done.resolve(configArg);
});
return done.promise;

View File

@ -12,7 +12,7 @@ exports.run = function () {
switch (config.mode) {
case "default":
case "custom":
plugins.beautylog.log("mode is " + config.mode.yellow);
plugins.beautylog.ok("mode is " + config.mode.yellow);
done.resolve(config);
break;
default:

12
dist/npmts.options.js vendored
View File

@ -1,6 +1,9 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
exports.isCi = function () {
return plugins.smartci.check.isCi();
};
exports.isRelease = function () {
return plugins.smartci.check.isCi()
&& plugins.smartci.check.isTaggedCommit();
@ -12,7 +15,7 @@ exports.doPublish = function () {
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now determining build options");
plugins.beautylog.log("now determining build options...");
//handle default mode
if (config.mode == "default") {
config.typings = [
@ -28,16 +31,17 @@ exports.run = function (configArg) {
// handle state of current build
exports.isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
: plugins.beautylog.info("NOT A RELEASE build!");
exports.isRelease() && exports.doPublish() ? plugins.beautylog.info("All right: This is the first subBuild, so this one publishes coverage and docs when tests succeed!")
exports.isRelease() && exports.doPublish() ? plugins.beautylog.info("All right: This is the first subBuild, so this one publishes COVERAGE + DOCS when tests succeed!")
: plugins.beautylog.info("We are not publishing anything!");
// handle coveralls
config.coveralls ? void (0) : config.coveralls = false;
exports.doPublish() ? void (0) : config.coveralls = false;
config.codecov ? void (0) : config.codecov = true;
exports.isCi() ? void (0) : config.codecov = false;
config.coverageTreshold ? void (0) : config.coverageTreshold = 70;
// handle docs
config.docs ? void (0) : config.docs = {};
config.docs.publish ? void (0) : config.docs.publish = false;
exports.doPublish() ? void (0) : config.docs.publish = false;
plugins.beautylog.ok("build options are ready!");
done.resolve(config);
return done.promise;
var _a;

View File

@ -4,7 +4,7 @@ exports.beautylog = require("beautylog");
exports.fs = require("fs-extra");
exports.gulp = require("gulp");
exports.g = {
coveralls: require("gulp-coveralls"),
codecov: require("gulp-codecov"),
gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"),
jsdoc3: require("gulp-jsdoc3"),
@ -15,7 +15,6 @@ exports.g = {
};
exports.merge2 = require("merge2");
exports.projectinfo = require("projectinfo");
exports.sourceMapSupport = require("source-map-support").install();
exports.path = require("path");
exports.Q = require("q");
exports.shelljs = require("shelljs");
@ -25,3 +24,4 @@ exports.smartcov = require("smartcov");
exports.smartenv = require("smartenv");
exports.smartfile = require("smartfile");
exports.smartpath = require("smartpath");
exports.sourceMapSupport = require("source-map-support").install();

View File

@ -7,7 +7,7 @@ exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
var promiseArray = [];
config.coveralls ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void (0);
config.codecov ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void (0);
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void (0);
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void (0);
plugins.Q.all(promiseArray).then(done.resolve);

10
dist/npmts.tests.js vendored
View File

@ -4,11 +4,11 @@ var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
exports.publishCoverage = function (configArg) {
var done = plugins.Q.defer();
plugins.beautylog.log("now uploading coverage data to coveralls");
plugins.beautylog.log("now uploading coverage data to codecov.io");
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
.pipe(plugins.g.coveralls())
.pipe(plugins.g.codecov())
.pipe(plugins.g.gFunction(function () {
plugins.beautylog.ok("Coverage data has been uploaded to Coveralls!");
plugins.beautylog.ok("Coverage data has been uploaded to codecov.io!");
done.resolve(configArg);
}, "atEnd"));
return done.promise;
@ -47,8 +47,8 @@ var coverage = function (configArg) {
plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir, "lcov.info"))
.then(function (percentageArg) {
if (percentageArg >= configArg.coverageTreshold) {
plugins.beautylog.ok("your coverage of " + percentageArg + "% " + "is within your treshold of " +
configArg.coverageTreshold + "%");
plugins.beautylog.ok("your coverage of " + percentageArg.toString().blue + "% ".blue + "exceeds your treshold of " +
configArg.coverageTreshold.toString().blue + "%".blue);
}
else {
plugins.beautylog.warn("your coverage of " + percentageArg + "% " + "fails your treshold of " +

View File

@ -1,6 +1,6 @@
{
"name": "npmts",
"version": "3.6.9",
"version": "5.0.1",
"description": "write npm modules with TypeScript",
"main": "dist/index.js",
"bin": {
@ -25,29 +25,29 @@
},
"homepage": "https://github.com/pushrocks/npmts#readme",
"dependencies": {
"beautylog": "3.1.2",
"beautylog": "4.1.0",
"fs-extra": "^0.26.7",
"gulp": "3.9.1",
"gulp-codecov": "^2.0.1",
"gulp-concat": "^2.6.0",
"gulp-coveralls": "^0.1.4",
"gulp-function": "^1.2.0",
"gulp-function": "^1.2.3",
"gulp-if": "^2.0.0",
"gulp-istanbul": "^0.10.3",
"gulp-jsdoc3": "^0.2.1",
"gulp-mocha": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-typescript": "2.12.1",
"gulp-typescript": "2.12.2",
"gulp-typings": "1.3.0",
"merge2": "1.0.1",
"merge2": "1.0.2",
"projectinfo": "1.0.1",
"q": "^1.4.1",
"shelljs": "^0.6.0",
"smartci": "0.0.1",
"smartcli": "0.0.11",
"smartcov": "0.0.3",
"smartenv": "1.2.0",
"smartfile": "2.2.0",
"smartpath": "3.0.3",
"smartcov": "0.0.4",
"smartenv": "1.2.1",
"smartfile": "2.3.0",
"smartpath": "3.1.1",
"source-map-support": "^0.4.0"
},
"devDependencies": {}

View File

@ -9,7 +9,7 @@
"./subts2/typings.json",
"./customdir/typings.json"
],
"coveralls":true,
"codecov":true,
"docs": {
"publish":true
},

View File

@ -3,10 +3,11 @@ import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
export let run = function(configArg){
plugins.beautylog.log("now cleaning up from previous builds");
plugins.beautylog.log("now cleaning up from previous builds...");
let done = plugins.Q.defer();
plugins.smartfile.fsaction.remove(paths.distDir)
.then(function(){
plugins.beautylog.ok("Cleaned up!");
done.resolve(configArg);
});
return done.promise;

View File

@ -11,7 +11,7 @@ export var run = function(){
switch (config.mode){
case "default":
case "custom":
plugins.beautylog.log("mode is " + config.mode.yellow);
plugins.beautylog.ok("mode is " + config.mode.yellow);
done.resolve(config);
break;
default:

View File

@ -1,6 +1,10 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
export let isCi = function(){
return plugins.smartci.check.isCi();
};
export let isRelease = function():boolean {
return plugins.smartci.check.isCi()
&& plugins.smartci.check.isTaggedCommit();
@ -15,7 +19,7 @@ export var run = function(configArg){
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now determining build options");
plugins.beautylog.log("now determining build options...");
//handle default mode
if (config.mode == "default"){
@ -33,12 +37,12 @@ export var run = function(configArg){
isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
: plugins.beautylog.info("NOT A RELEASE build!");
isRelease() && doPublish() ? plugins.beautylog.info("All right: This is the first subBuild, so this one publishes coverage and docs when tests succeed!")
isRelease() && doPublish() ? plugins.beautylog.info("All right: This is the first subBuild, so this one publishes COVERAGE + DOCS when tests succeed!")
: plugins.beautylog.info("We are not publishing anything!");
// handle coveralls
config.coveralls ? void(0) : config.coveralls = false;
doPublish() ? void(0) : config.coveralls = false;
config.codecov ? void(0) : config.codecov = true;
isCi() ? void(0) : config.codecov = false;
config.coverageTreshold ? void(0) : config.coverageTreshold = 70;
@ -47,6 +51,7 @@ export var run = function(configArg){
config.docs.publish ? void(0) : config.docs.publish = false;
doPublish() ? void(0) : config.docs.publish = false;
plugins.beautylog.ok("build options are ready!");
done.resolve(config);
return done.promise;
};

View File

@ -3,7 +3,7 @@ export let beautylog = require("beautylog");
export let fs = require("fs-extra");
export let gulp = require("gulp");
export let g = {
coveralls: require("gulp-coveralls"),
codecov: require("gulp-codecov"),
gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"),
jsdoc3: require("gulp-jsdoc3"),
@ -15,7 +15,6 @@ export let g = {
};
export let merge2 = require("merge2");
export let projectinfo = require("projectinfo");
export let sourceMapSupport = require("source-map-support").install();
export let path = require("path");
export let Q = require("q");
export let shelljs = require("shelljs");
@ -24,4 +23,5 @@ export let smartcli = require("smartcli");
export let smartcov = require("smartcov");
export let smartenv = require("smartenv");
export let smartfile = require("smartfile");
export let smartpath = require("smartpath");
export let smartpath = require("smartpath");
export let sourceMapSupport = require("source-map-support").install();

View File

@ -9,7 +9,7 @@ export let run = function(configArg){
let done = plugins.Q.defer();
let config = configArg;
let promiseArray = [];
config.coveralls ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void(0);
config.codecov ? promiseArray.push(NpmtsTests.publishCoverage(configArg)) : void(0);
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void(0);
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0);

View File

@ -4,11 +4,11 @@ import paths = require("./npmts.paths");
export let publishCoverage = function(configArg){
let done = plugins.Q.defer();
plugins.beautylog.log("now uploading coverage data to coveralls");
plugins.beautylog.log("now uploading coverage data to codecov.io");
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
.pipe(plugins.g.coveralls())
.pipe(plugins.g.codecov())
.pipe(plugins.g.gFunction(function(){
plugins.beautylog.ok("Coverage data has been uploaded to Coveralls!");
plugins.beautylog.ok("Coverage data has been uploaded to codecov.io!");
done.resolve(configArg);
},"atEnd"));
return done.promise;
@ -51,8 +51,8 @@ let coverage = function(configArg){
.then(function(percentageArg){
if (percentageArg >= configArg.coverageTreshold){
plugins.beautylog.ok(
"your coverage of " + percentageArg + "% " + "is within your treshold of " +
configArg.coverageTreshold + "%"
"your coverage of " + percentageArg.toString().blue + "% ".blue + "exceeds your treshold of " +
configArg.coverageTreshold.toString().blue + "%".blue
);
} else {
plugins.beautylog.warn(