Compare commits

..

6 Commits

Author SHA1 Message Date
57aa38af89 5.5.7 2016-11-25 00:52:25 +01:00
12cf37f01f update messages for better feedback 2016-11-25 00:52:17 +01:00
44150f4d83 5.5.6 2016-11-25 00:36:50 +01:00
3fd755691d now catching babel errors 2016-11-25 00:36:44 +01:00
00983205ce 5.5.5 2016-11-22 18:54:56 +01:00
a0b1b1847c improve README 2016-11-22 18:54:35 +01:00
4 changed files with 69 additions and 54 deletions

View File

@ -10,7 +10,7 @@ Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.
## Status for master ## Status for master
[![build status](https://gitlab.com/pushrocks/npmts/badges/master/build.svg)](https://gitlab.com/pushrocks/npmts/commits/master) [![build status](https://gitlab.com/pushrocks/npmts/badges/master/build.svg)](https://gitlab.com/pushrocks/npmts/commits/master)
[![coverage report](https://gitlab.com/pushrocks/npmts/badges/master/coverage.svg)](https://gitlab.com/pushrocks/npmts/commits/master) [![coverage report](https://gitlab.com/pushrocks/npmts/badges/master/coverage.svg)](https://gitlab.com/pushrocks/npmts/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/localeval.svg)](https://www.npmjs.com/package/npmts) [![npm downloads per month](https://img.shields.io/npm/dm/npmts.svg)](https://www.npmjs.com/package/npmts)
[![docker pulls](https://img.shields.io/docker/pulls/hosttoday/ht-docker-node.svg)](https://hub.docker.com/r/hosttoday/ht-docker-node/) [![docker pulls](https://img.shields.io/docker/pulls/hosttoday/ht-docker-node.svg)](https://hub.docker.com/r/hosttoday/ht-docker-node/)
[![Dependency Status](https://david-dm.org/pushrocks/npmts.svg)](https://david-dm.org/pushrocks/npmts) [![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 Dependencies](https://www.bithound.io/github/pushrocks/npmts/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/npmts/master/dependencies/npm)

60
dist/mod02/index.js vendored
View File

@ -14,32 +14,36 @@ let mocha = function (configArg) {
npmts_log_1.npmtsOra.text('Instrumentalizing and testing transpiled JS'); npmts_log_1.npmtsOra.text('Instrumentalizing and testing transpiled JS');
npmts_log_1.npmtsOra.end(); // end npmtsOra for tests. npmts_log_1.npmtsOra.end(); // end npmtsOra for tests.
let done = q.defer(); let done = q.defer();
plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')]) let babelCoverageSmartstream = new plugins.smartstream.Smartstream([
.pipe(plugins.gulpSourcemaps.init()) plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')]),
.pipe(plugins.gulpBabel({ plugins.gulpSourcemaps.init(),
presets: [ plugins.gulpBabel({
require.resolve('babel-preset-es2015') presets: [
] require.resolve('babel-preset-es2015')
})) ]
.pipe(plugins.gulpIstanbul({})) }),
.pipe(plugins.gulpSourcemaps.write()) plugins.gulpIstanbul({}),
.pipe(plugins.gulpInjectModules()) plugins.gulpSourcemaps.write(),
.on('finish', function () { plugins.gulpInjectModules()
let localSmartstream = new plugins.smartstream.Smartstream([ ]);
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]), let localSmartstream = new plugins.smartstream.Smartstream([
plugins.gulpBabel({ plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
presets: [ plugins.gulpBabel({
require.resolve('babel-preset-es2015') presets: [
] require.resolve('babel-preset-es2015')
}), ]
plugins.gulpInjectModules(), }),
plugins.gulpMocha(), plugins.gulpInjectModules(),
plugins.gulpIstanbul.writeReports({ plugins.gulpMocha(),
dir: plugins.path.join(paths.cwd, './coverage'), plugins.gulpIstanbul.writeReports({
reporters: ['lcovonly', 'json', 'text', 'text-summary'] dir: plugins.path.join(paths.cwd, './coverage'),
}) reporters: ['lcovonly', 'json', 'text', 'text-summary']
]); })
localSmartstream.run() ]);
babelCoverageSmartstream.run()
.then(() => {
plugins.beautylog.info('transpiled code to ES5 for use in mocha');
return localSmartstream.run()
.then(() => { done.resolve(configArg); }, (err) => { .then(() => { done.resolve(configArg); }, (err) => {
plugins.beautylog.error('Tests failed!'); plugins.beautylog.error('Tests failed!');
console.log(err); console.log(err);
@ -50,6 +54,8 @@ let mocha = function (configArg) {
process.exit(1); process.exit(1);
} }
}); });
}, (err) => {
console.log(err);
}); });
return done.promise; return done.promise;
}; };
@ -80,7 +86,7 @@ exports.run = function (configArg) {
let config = configArg; let config = configArg;
if (config.test === true) { if (config.test === true) {
npmts_log_1.npmtsOra.text('now starting tests'); npmts_log_1.npmtsOra.text('now starting tests');
plugins.beautylog.log('-------------------------------------------------------\n' + plugins.beautylog.log('------------------------------------------------------\n' +
'*************************** TESTS: ***************************\n' + '*************************** TESTS: ***************************\n' +
'--------------------------------------------------------------'); '--------------------------------------------------------------');
mocha(config) mocha(config)

View File

@ -1,6 +1,6 @@
{ {
"name": "npmts", "name": "npmts",
"version": "5.5.4", "version": "5.5.7",
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.", "description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {

View File

@ -17,33 +17,39 @@ let mocha = function (configArg: INpmtsConfig) {
npmtsOra.text('Instrumentalizing and testing transpiled JS') npmtsOra.text('Instrumentalizing and testing transpiled JS')
npmtsOra.end() // end npmtsOra for tests. npmtsOra.end() // end npmtsOra for tests.
let done = q.defer() let done = q.defer()
plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')]) let babelCoverageSmartstream = new plugins.smartstream.Smartstream([
.pipe(plugins.gulpSourcemaps.init()) plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')]),
.pipe(plugins.gulpBabel({ plugins.gulpSourcemaps.init(),
plugins.gulpBabel({
presets: [ presets: [
require.resolve('babel-preset-es2015') require.resolve('babel-preset-es2015')
] ]
})) }),
.pipe(plugins.gulpIstanbul({ plugins.gulpIstanbul({
})) }),
.pipe(plugins.gulpSourcemaps.write()) plugins.gulpSourcemaps.write(),
.pipe(plugins.gulpInjectModules()) plugins.gulpInjectModules()
.on('finish', function () { ])
let localSmartstream = new plugins.smartstream.Smartstream([ let localSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]), plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
plugins.gulpBabel({ plugins.gulpBabel({
presets: [ presets: [
require.resolve('babel-preset-es2015') require.resolve('babel-preset-es2015')
] ]
}), }),
plugins.gulpInjectModules(), plugins.gulpInjectModules(),
plugins.gulpMocha(), plugins.gulpMocha(),
plugins.gulpIstanbul.writeReports({ plugins.gulpIstanbul.writeReports({
dir: plugins.path.join(paths.cwd, './coverage'), dir: plugins.path.join(paths.cwd, './coverage'),
reporters: ['lcovonly', 'json', 'text', 'text-summary'] reporters: ['lcovonly', 'json', 'text', 'text-summary']
}) })
]) ])
localSmartstream.run()
babelCoverageSmartstream.run()
.then(
() => {
plugins.beautylog.info('transpiled code to ES5 for use in mocha')
return localSmartstream.run()
.then(() => { done.resolve(configArg) }, (err) => { .then(() => { done.resolve(configArg) }, (err) => {
plugins.beautylog.error('Tests failed!') plugins.beautylog.error('Tests failed!')
console.log(err) console.log(err)
@ -53,6 +59,9 @@ let mocha = function (configArg: INpmtsConfig) {
process.exit(1) process.exit(1)
} }
}) })
},
(err) => {
console.log(err)
}) })
return done.promise return done.promise
} }
@ -87,7 +96,7 @@ export let run = function (configArg: INpmtsConfig) {
if (config.test === true) { if (config.test === true) {
npmtsOra.text('now starting tests') npmtsOra.text('now starting tests')
plugins.beautylog.log( plugins.beautylog.log(
'-------------------------------------------------------\n' + '------------------------------------------------------\n' +
'*************************** TESTS: ***************************\n' + '*************************** TESTS: ***************************\n' +
'--------------------------------------------------------------' '--------------------------------------------------------------'
) )