Compare commits

...

6 Commits

Author SHA1 Message Date
5221d3ee84 5.3.3 2016-06-16 03:02:37 +02:00
1f50f54fe9 now has --notest option 2016-06-16 03:02:33 +02:00
12199a668e 5.3.2 2016-06-12 04:32:00 +02:00
82df431adf improve README 2016-06-12 04:31:43 +02:00
71f0a9d37f 5.3.1 2016-06-12 00:45:49 +02:00
5f16cdd830 now printing font all right 2016-06-12 00:45:33 +02:00
10 changed files with 84 additions and 57 deletions

View File

@ -17,13 +17,14 @@ There is a docker image available that includes npmts to make CI a breeze:
[hosttoday/ht-docker-npmg on Dockerhub](https://hub.docker.com/r/hosttoday/ht-docker-npmg/)
### Install
First install npmts as dev dependency:
First install npmts globally, then install the npmts checker:
```sh
npm install npmts --save-dev
npm install npmts -g # installs npmts globally
npm install npmts-g --save-dev # installs npmts-g checking tool as devDependency
```
Then use it in package.json's script section to trigger a build:
Then add it to your package.json's script section to trigger a build:
```json
"scripts": {
@ -42,8 +43,6 @@ 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 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
the npmts.json is the main config file. You can use it to customize the behaviour of NPMTS.
@ -131,6 +130,12 @@ thanks to autogenerated source maps.
> We will add more options over time.
## Tips and tricks:
* Use [npmts-g](https://www.npmjs.com/package/npmts-g) to use globally installed npmts and install npmts locally if no global npmts is available.
* Use [npmpage](https://www.npmjs.com/package/npmtspage) to create a webpage from coverage reports and JsDocs for the module
* Use [hosttoday/ht-docker-node:npmts](https://hub.docker.com/r/hosttoday/ht-docker-node/) for speedy CI builds
## About the authors:
[![Project Phase](https://mediaserve.lossless.digital/lossless.com/img/createdby_github.svg)](https://lossless.com/)

16
dist/index.js vendored
View File

@ -8,19 +8,21 @@ early.start("NPMTS");
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
early.stop();
var npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
var npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
early.stop()
.then(function () {
var npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
var npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
.then(function (argvArg) {
plugins.beautylog.figletSync("NPMTS");
plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version);
try {
npmts_promisechain_1.promisechain();
npmts_promisechain_1.promisechain(argvArg);
}
catch (err) {
console.log(err);
}
});
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();
});
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();

View File

@ -2,10 +2,13 @@
require("typings-global");
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
exports.run = function () {
exports.run = function (argvArg) {
var done = plugins.Q.defer();
var config = {};
var configPath = plugins.path.join(paths.cwd, "npmts.json");
if (argvArg.notest) {
config.notest = true;
}
if (plugins.smartfile.checks.fileExistsSync(configPath)) {
plugins.beautylog.info("npmts.json".blue + " config file found!");
config = plugins.smartfile.local.toObjectSync(configPath);

View File

@ -11,10 +11,10 @@ var NpmtsJsdoc = require("./npmts.jsdoc");
var NpmtsOptions = require("./npmts.options");
var NpmtsPublish = require("./npmts.publish");
var NpmtsTests = require("./npmts.tests");
exports.promisechain = function () {
exports.promisechain = function (argvArg) {
var done = plugins.Q.defer();
exports.npmtsOra.start();
NpmtsConfigFile.run()
NpmtsConfigFile.run(argvArg)
.then(NpmtsOptions.run)
.then(NpmtsClean.run)
.then(NpmtsInstall.run)

9
dist/npmts.tests.js vendored
View File

@ -56,6 +56,7 @@ var coverage = function (configArg) {
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
if (!config.notest) {
npmts_promisechain_1.npmtsOra.text("now starting tests");
plugins.beautylog.log("-------------------------------------------------------\n" +
"*************************** TESTS: ***************************\n" +
@ -63,6 +64,12 @@ exports.run = function (configArg) {
istanbul(config)
.then(mocha)
.then(coverage)
.then(done.resolve);
.then(function () {
done.resolve(config);
});
}
else {
done.resolve(config);
}
return done.promise;
};

View File

@ -1,6 +1,6 @@
{
"name": "npmts",
"version": "5.3.0",
"version": "5.3.3",
"description": "write npm modules with TypeScript",
"main": "dist/index.js",
"bin": {
@ -27,14 +27,14 @@
},
"homepage": "https://gitlab.com/pushrocks/npmts#readme",
"dependencies": {
"beautylog": "5.0.8",
"early": "^2.0.7",
"beautylog": "5.0.11",
"early": "^2.0.13",
"fs-extra": "^0.30.0",
"gulp": "3.9.1",
"gulp-concat": "^2.6.0",
"gulp-function": "^1.3.5",
"gulp-function": "^1.3.6",
"gulp-if": "^2.0.1",
"gulp-istanbul": "^0.10.4",
"gulp-istanbul": "^1.0.0",
"gulp-jsdoc3": "^0.3.0",
"gulp-mocha": "^2.2.0",
"gulp-replace": "^0.5.4",
@ -47,7 +47,7 @@
"q": "^1.4.1",
"shelljs": "^0.7.0",
"smartci": "0.0.1",
"smartcli": "1.0.1",
"smartcli": "1.0.2",
"smartcov": "0.0.6",
"smartenv": "1.2.5",
"smartfile": "3.0.10",

View File

@ -8,22 +8,23 @@ early.start("NPMTS");
import * as plugins from "./npmts.plugins"
import * as paths from "./npmts.paths";
import {promisechain} from "./npmts.promisechain";
early.stop();
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
let npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
early.stop()
.then(() => {
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
let npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask()
.then((argvArg) => {
plugins.beautylog.figletSync("NPMTS");
plugins.beautylog.info("npmts version: " + npmtsProjectInfo.version);
try {
promisechain();
promisechain(argvArg);
}
catch(err){
console.log(err);
}
});
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();
npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse();
});

View File

@ -1,10 +1,13 @@
import "typings-global";
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
export var run = function(){
export var run = function(argvArg){
var done = plugins.Q.defer();
var config:any = {};
var configPath = plugins.path.join(paths.cwd,"npmts.json");
if(argvArg.notest){
config.notest = true;
}
if(plugins.smartfile.checks.fileExistsSync(configPath)){
plugins.beautylog.info("npmts.json".blue + " config file found!");
config = plugins.smartfile.local.toObjectSync(configPath);

View File

@ -13,10 +13,10 @@ import NpmtsOptions = require("./npmts.options");
import NpmtsPublish = require("./npmts.publish");
import NpmtsTests = require("./npmts.tests");
export let promisechain = function(){
export let promisechain = function(argvArg){
let done = plugins.Q.defer();
npmtsOra.start();
NpmtsConfigFile.run()
NpmtsConfigFile.run(argvArg)
.then(NpmtsOptions.run)
.then(NpmtsClean.run)
.then(NpmtsInstall.run)

View File

@ -62,6 +62,7 @@ let coverage = function(configArg){
export let run = function(configArg) {
let done = plugins.Q.defer();
let config = configArg;
if(!config.notest){
npmtsOra.text("now starting tests");
plugins.beautylog.log(
@ -73,6 +74,11 @@ export let run = function(configArg) {
istanbul(config)
.then(mocha)
.then(coverage)
.then(done.resolve);
.then(() => {
done.resolve(config);
});
} else {
done.resolve(config);
}
return done.promise;
};