Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
d8fb9747cd | |||
53209b18a9 | |||
3e3561f4bb | |||
099b513e0a | |||
cf15c428c1 | |||
3bd876a201 | |||
af62f20614 | |||
69eba08b27 | |||
6635265f4b | |||
ebdda5f969 | |||
f3a24154b4 |
@ -6,7 +6,7 @@ Write npm modules with TypeScript without hassle.
|
|||||||
[](https://david-dm.org/pushrocks/npmts)
|
[](https://david-dm.org/pushrocks/npmts)
|
||||||
[](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
[](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)
|
||||||
[](https://www.bithound.io/github/pushrocks/npmts)
|
[](https://www.bithound.io/github/pushrocks/npmts)
|
||||||
[](https://coveralls.io/github/pushrocks/npmts?branch=master)
|
[](https://codecov.io/github/pushrocks/npmts?branch=master)
|
||||||
|
|
||||||
## What is NPMTS?
|
## What is NPMTS?
|
||||||
NPMTS is your friend when it comes to write, test, publish and document NPM modules written in TypeScript.
|
NPMTS is your friend when it comes to write, test, publish and document NPM modules written in TypeScript.
|
||||||
|
7
dist/npmts.options.js
vendored
7
dist/npmts.options.js
vendored
@ -1,6 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
var plugins = require("./npmts.plugins");
|
var plugins = require("./npmts.plugins");
|
||||||
|
exports.isCi = function () {
|
||||||
|
return plugins.smartci.check.isCi();
|
||||||
|
};
|
||||||
exports.isRelease = function () {
|
exports.isRelease = function () {
|
||||||
return plugins.smartci.check.isCi()
|
return plugins.smartci.check.isCi()
|
||||||
&& plugins.smartci.check.isTaggedCommit();
|
&& plugins.smartci.check.isTaggedCommit();
|
||||||
@ -28,11 +31,11 @@ exports.run = function (configArg) {
|
|||||||
// handle state of current build
|
// handle state of current build
|
||||||
exports.isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
|
exports.isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
|
||||||
: plugins.beautylog.info("NOT 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!");
|
: plugins.beautylog.info("We are not publishing anything!");
|
||||||
// handle coveralls
|
// handle coveralls
|
||||||
config.codecov ? void (0) : config.codecov = true;
|
config.codecov ? void (0) : config.codecov = true;
|
||||||
exports.doPublish() ? void (0) : config.codecov = false;
|
exports.isCi() ? 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 = {};
|
||||||
|
4
dist/npmts.tests.js
vendored
4
dist/npmts.tests.js
vendored
@ -4,11 +4,11 @@ var plugins = require("./npmts.plugins");
|
|||||||
var paths = require("./npmts.paths");
|
var paths = require("./npmts.paths");
|
||||||
exports.publishCoverage = function (configArg) {
|
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 codecov.io");
|
||||||
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.codecov())
|
.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 codecov.io!");
|
||||||
done.resolve(configArg);
|
done.resolve(configArg);
|
||||||
}, "atEnd"));
|
}, "atEnd"));
|
||||||
return done.promise;
|
return done.promise;
|
||||||
|
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "4.0.0",
|
"version": "5.0.1",
|
||||||
"description": "write npm modules with TypeScript",
|
"description": "write npm modules with TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -25,29 +25,29 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/npmts#readme",
|
"homepage": "https://github.com/pushrocks/npmts#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"beautylog": "3.1.2",
|
"beautylog": "4.1.0",
|
||||||
"fs-extra": "^0.26.7",
|
"fs-extra": "^0.26.7",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-codecov": "^2.0.1",
|
"gulp-codecov": "^2.0.1",
|
||||||
"gulp-concat": "^2.6.0",
|
"gulp-concat": "^2.6.0",
|
||||||
"gulp-function": "^1.2.0",
|
"gulp-function": "^1.2.3",
|
||||||
"gulp-if": "^2.0.0",
|
"gulp-if": "^2.0.0",
|
||||||
"gulp-istanbul": "^0.10.3",
|
"gulp-istanbul": "^0.10.3",
|
||||||
"gulp-jsdoc3": "^0.2.1",
|
"gulp-jsdoc3": "^0.2.1",
|
||||||
"gulp-mocha": "^2.2.0",
|
"gulp-mocha": "^2.2.0",
|
||||||
"gulp-sourcemaps": "^1.6.0",
|
"gulp-sourcemaps": "^1.6.0",
|
||||||
"gulp-typescript": "2.12.1",
|
"gulp-typescript": "2.12.2",
|
||||||
"gulp-typings": "1.3.0",
|
"gulp-typings": "1.3.0",
|
||||||
"merge2": "1.0.1",
|
"merge2": "1.0.2",
|
||||||
"projectinfo": "1.0.1",
|
"projectinfo": "1.0.1",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"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.4",
|
"smartcov": "0.0.4",
|
||||||
"smartenv": "1.2.0",
|
"smartenv": "1.2.1",
|
||||||
"smartfile": "2.2.0",
|
"smartfile": "2.3.0",
|
||||||
"smartpath": "3.0.3",
|
"smartpath": "3.1.1",
|
||||||
"source-map-support": "^0.4.0"
|
"source-map-support": "^0.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {}
|
"devDependencies": {}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
import plugins = require("./npmts.plugins");
|
import plugins = require("./npmts.plugins");
|
||||||
|
|
||||||
|
export let isCi = function(){
|
||||||
|
return plugins.smartci.check.isCi();
|
||||||
|
};
|
||||||
|
|
||||||
export let isRelease = function():boolean {
|
export let isRelease = function():boolean {
|
||||||
return plugins.smartci.check.isCi()
|
return plugins.smartci.check.isCi()
|
||||||
&& plugins.smartci.check.isTaggedCommit();
|
&& plugins.smartci.check.isTaggedCommit();
|
||||||
@ -33,12 +37,12 @@ export var run = function(configArg){
|
|||||||
|
|
||||||
isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
|
isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
|
||||||
: plugins.beautylog.info("NOT 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!");
|
: plugins.beautylog.info("We are not publishing anything!");
|
||||||
|
|
||||||
// handle coveralls
|
// handle coveralls
|
||||||
config.codecov ? void(0) : config.codecov = true;
|
config.codecov ? void(0) : config.codecov = true;
|
||||||
doPublish() ? void(0) : config.codecov = false;
|
isCi() ? void(0) : config.codecov = false;
|
||||||
|
|
||||||
config.coverageTreshold ? void(0) : config.coverageTreshold = 70;
|
config.coverageTreshold ? void(0) : config.coverageTreshold = 70;
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@ import paths = require("./npmts.paths");
|
|||||||
|
|
||||||
export let publishCoverage = function(configArg){
|
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 codecov.io");
|
||||||
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.codecov())
|
.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 codecov.io!");
|
||||||
done.resolve(configArg);
|
done.resolve(configArg);
|
||||||
},"atEnd"));
|
},"atEnd"));
|
||||||
return done.promise;
|
return done.promise;
|
||||||
|
Reference in New Issue
Block a user