Compare commits

...

7 Commits

Author SHA1 Message Date
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 38 additions and 29 deletions

View File

@ -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. Instrumentalize created JavaScript files with istanbul
1. Run Tests 1. Run Tests
1. Create Coverage report 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) 1. Upload JsDoc Documentation to gh-pages branch on GitHub. (Tests must pass, requires GitHub Token)
#### npmts.json #### 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. * **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. * **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 plugins = require("./npmts.plugins");
var paths = require("./npmts.paths"); var paths = require("./npmts.paths");
exports.run = function (configArg) { 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(); var done = plugins.Q.defer();
plugins.smartfile.fsaction.remove(paths.distDir) plugins.smartfile.fsaction.remove(paths.distDir)
.then(function () { .then(function () {
plugins.beautylog.ok("Cleaned up!");
done.resolve(configArg); done.resolve(configArg);
}); });
return done.promise; return done.promise;

View File

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

View File

@ -12,7 +12,7 @@ exports.doPublish = function () {
exports.run = function (configArg) { exports.run = function (configArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config = configArg; var config = configArg;
plugins.beautylog.log("now determining build options"); plugins.beautylog.log("now determining build options...");
//handle default mode //handle default mode
if (config.mode == "default") { if (config.mode == "default") {
config.typings = [ config.typings = [
@ -31,13 +31,14 @@ exports.run = function (configArg) {
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 and docs when tests succeed!")
: plugins.beautylog.info("We are not publishing anything!"); : plugins.beautylog.info("We are not publishing anything!");
// handle coveralls // handle coveralls
config.coveralls ? void (0) : config.coveralls = false; config.codecov ? void (0) : config.codecov = true;
exports.doPublish() ? void (0) : config.coveralls = false; exports.doPublish() ? void (0) : config.codecov = false;
config.coverageTreshold ? void (0) : config.coverageTreshold = 70; config.coverageTreshold ? void (0) : config.coverageTreshold = 70;
// handle docs // handle docs
config.docs ? void (0) : config.docs = {}; config.docs ? void (0) : config.docs = {};
config.docs.publish ? void (0) : config.docs.publish = false; config.docs.publish ? void (0) : config.docs.publish = false;
exports.doPublish() ? void (0) : config.docs.publish = false; exports.doPublish() ? void (0) : config.docs.publish = false;
plugins.beautylog.ok("build options are ready!");
done.resolve(config); done.resolve(config);
return done.promise; return done.promise;
var _a; var _a;

View File

@ -4,7 +4,7 @@ exports.beautylog = require("beautylog");
exports.fs = require("fs-extra"); exports.fs = require("fs-extra");
exports.gulp = require("gulp"); exports.gulp = require("gulp");
exports.g = { exports.g = {
coveralls: require("gulp-coveralls"), codecov: require("gulp-codecov"),
gFunction: require("gulp-function"), gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
jsdoc3: require("gulp-jsdoc3"), jsdoc3: require("gulp-jsdoc3"),
@ -15,7 +15,6 @@ exports.g = {
}; };
exports.merge2 = require("merge2"); exports.merge2 = require("merge2");
exports.projectinfo = require("projectinfo"); exports.projectinfo = require("projectinfo");
exports.sourceMapSupport = require("source-map-support").install();
exports.path = require("path"); exports.path = require("path");
exports.Q = require("q"); exports.Q = require("q");
exports.shelljs = require("shelljs"); exports.shelljs = require("shelljs");
@ -25,3 +24,4 @@ exports.smartcov = require("smartcov");
exports.smartenv = require("smartenv"); exports.smartenv = require("smartenv");
exports.smartfile = require("smartfile"); exports.smartfile = require("smartfile");
exports.smartpath = require("smartpath"); 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 done = plugins.Q.defer();
var config = configArg; var config = configArg;
var promiseArray = []; 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); config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void (0);
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void (0); promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void (0);
plugins.Q.all(promiseArray).then(done.resolve); plugins.Q.all(promiseArray).then(done.resolve);

6
dist/npmts.tests.js vendored
View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "npmts", "name": "npmts",
"version": "3.6.9", "version": "4.0.0",
"description": "write npm modules with TypeScript", "description": "write npm modules with TypeScript",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {
@ -28,8 +28,8 @@
"beautylog": "3.1.2", "beautylog": "3.1.2",
"fs-extra": "^0.26.7", "fs-extra": "^0.26.7",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-codecov": "^2.0.1",
"gulp-concat": "^2.6.0", "gulp-concat": "^2.6.0",
"gulp-coveralls": "^0.1.4",
"gulp-function": "^1.2.0", "gulp-function": "^1.2.0",
"gulp-if": "^2.0.0", "gulp-if": "^2.0.0",
"gulp-istanbul": "^0.10.3", "gulp-istanbul": "^0.10.3",
@ -44,7 +44,7 @@
"shelljs": "^0.6.0", "shelljs": "^0.6.0",
"smartci": "0.0.1", "smartci": "0.0.1",
"smartcli": "0.0.11", "smartcli": "0.0.11",
"smartcov": "0.0.3", "smartcov": "0.0.4",
"smartenv": "1.2.0", "smartenv": "1.2.0",
"smartfile": "2.2.0", "smartfile": "2.2.0",
"smartpath": "3.0.3", "smartpath": "3.0.3",

View File

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

View File

@ -3,10 +3,11 @@ import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths"); import paths = require("./npmts.paths");
export let run = function(configArg){ 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(); let done = plugins.Q.defer();
plugins.smartfile.fsaction.remove(paths.distDir) plugins.smartfile.fsaction.remove(paths.distDir)
.then(function(){ .then(function(){
plugins.beautylog.ok("Cleaned up!");
done.resolve(configArg); done.resolve(configArg);
}); });
return done.promise; return done.promise;

View File

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

View File

@ -15,7 +15,7 @@ export var run = function(configArg){
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var config = configArg; var config = configArg;
plugins.beautylog.log("now determining build options"); plugins.beautylog.log("now determining build options...");
//handle default mode //handle default mode
if (config.mode == "default"){ if (config.mode == "default"){
@ -37,8 +37,8 @@ export var run = function(configArg){
: plugins.beautylog.info("We are not publishing anything!"); : plugins.beautylog.info("We are not publishing anything!");
// handle coveralls // handle coveralls
config.coveralls ? void(0) : config.coveralls = false; config.codecov ? void(0) : config.codecov = true;
doPublish() ? void(0) : config.coveralls = false; doPublish() ? void(0) : config.codecov = false;
config.coverageTreshold ? void(0) : config.coverageTreshold = 70; config.coverageTreshold ? void(0) : config.coverageTreshold = 70;
@ -47,6 +47,7 @@ export var run = function(configArg){
config.docs.publish ? void(0) : config.docs.publish = false; config.docs.publish ? void(0) : config.docs.publish = false;
doPublish() ? void(0) : config.docs.publish = false; doPublish() ? void(0) : config.docs.publish = false;
plugins.beautylog.ok("build options are ready!");
done.resolve(config); done.resolve(config);
return done.promise; return done.promise;
}; };

View File

@ -3,7 +3,7 @@ export let beautylog = require("beautylog");
export let fs = require("fs-extra"); export let fs = require("fs-extra");
export let gulp = require("gulp"); export let gulp = require("gulp");
export let g = { export let g = {
coveralls: require("gulp-coveralls"), codecov: require("gulp-codecov"),
gFunction: require("gulp-function"), gFunction: require("gulp-function"),
istanbul: require("gulp-istanbul"), istanbul: require("gulp-istanbul"),
jsdoc3: require("gulp-jsdoc3"), jsdoc3: require("gulp-jsdoc3"),
@ -15,7 +15,6 @@ export let g = {
}; };
export let merge2 = require("merge2"); export let merge2 = require("merge2");
export let projectinfo = require("projectinfo"); export let projectinfo = require("projectinfo");
export let sourceMapSupport = require("source-map-support").install();
export let path = require("path"); export let path = require("path");
export let Q = require("q"); export let Q = require("q");
export let shelljs = require("shelljs"); export let shelljs = require("shelljs");
@ -24,4 +23,5 @@ export let smartcli = require("smartcli");
export let smartcov = require("smartcov"); export let smartcov = require("smartcov");
export let smartenv = require("smartenv"); export let smartenv = require("smartenv");
export let smartfile = require("smartfile"); 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 done = plugins.Q.defer();
let config = configArg; let config = configArg;
let promiseArray = []; 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); config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void(0);
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0); promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0);

View File

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