Compare commits

...

8 Commits

Author SHA1 Message Date
60bed4cb1f 5.5.9 2016-11-25 13:19:02 +01:00
8831a8d173 empty Buffer at end of transpilation 2016-11-25 13:18:59 +01:00
36f540a22e 5.5.8 2016-11-25 13:03:44 +01:00
7e61b49d04 fix 16 file treshold 2016-11-25 13:03:41 +01:00
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
6 changed files with 105 additions and 68 deletions

34
dist/mod02/index.js vendored
View File

@ -14,17 +14,24 @@ let mocha = function (configArg) {
npmts_log_1.npmtsOra.text('Instrumentalizing and testing transpiled JS');
npmts_log_1.npmtsOra.end(); // end npmtsOra for tests.
let done = q.defer();
plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')])
.pipe(plugins.gulpSourcemaps.init())
.pipe(plugins.gulpBabel({
let coverageSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]),
plugins.gulpSourcemaps.init(),
plugins.gulpBabel({
presets: [
require.resolve('babel-preset-es2015')
]
}))
.pipe(plugins.gulpIstanbul({}))
.pipe(plugins.gulpSourcemaps.write())
.pipe(plugins.gulpInjectModules())
.on('finish', function () {
}),
plugins.gulpIstanbul({}),
plugins.gulpSourcemaps.write(),
plugins.gulpInjectModules(),
plugins.through2.obj((file, enc, cb) => {
console.log(file);
cb();
}, (cb) => {
cb();
})
]);
let localSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
plugins.gulpBabel({
@ -39,7 +46,10 @@ let mocha = function (configArg) {
reporters: ['lcovonly', 'json', 'text', 'text-summary']
})
]);
localSmartstream.run()
coverageSmartstream.run()
.then(() => {
plugins.beautylog.info('code is now transpiled to ES5, instrumented with istanbul, and injected for mocha!');
return localSmartstream.run()
.then(() => { done.resolve(configArg); }, (err) => {
plugins.beautylog.error('Tests failed!');
console.log(err);
@ -50,6 +60,8 @@ let mocha = function (configArg) {
process.exit(1);
}
});
}, (err) => {
console.log(err);
});
return done.promise;
};
@ -80,14 +92,14 @@ exports.run = function (configArg) {
let config = configArg;
if (config.test === true) {
npmts_log_1.npmtsOra.text('now starting tests');
plugins.beautylog.log('-------------------------------------------------------\n' +
plugins.beautylog.log('------------------------------------------------------\n' +
'*************************** TESTS: ***************************\n' +
'--------------------------------------------------------------');
mocha(config)
.then(coverage)
.then(() => {
done.resolve(config);
});
}).catch(err => { console.log(err); });
}
else {
npmts_log_1.npmtsOra.end();

View File

@ -13,5 +13,6 @@ import * as smartpath from 'smartpath';
import * as smartstream from 'smartstream';
import * as smartstring from 'smartstring';
import * as smartsystem from 'smartsystem';
import * as through2 from 'through2';
export declare let sourceMapSupport: any;
export { beautylog, depcheck, lodash, npmextra, projectinfo, path, smartcli, smartcov, smartenv, smartfile, smartpath, smartstream, smartstring, smartsystem };
export { beautylog, depcheck, lodash, npmextra, projectinfo, path, smartcli, smartcov, smartenv, smartfile, smartpath, smartstream, smartstring, smartsystem, through2 };

View File

@ -28,4 +28,6 @@ const smartstring = require("smartstring");
exports.smartstring = smartstring;
const smartsystem = require("smartsystem");
exports.smartsystem = smartsystem;
const through2 = require("through2");
exports.through2 = through2;
exports.sourceMapSupport = require('source-map-support').install(); // display errors correctly during testing

View File

@ -1,6 +1,6 @@
{
"name": "npmts",
"version": "5.5.5",
"version": "5.5.9",
"description": "Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.",
"main": "dist/index.js",
"bin": {
@ -10,7 +10,7 @@
"test": "(npm run compile && npm run prepareTest && npm run setupCheck && npm run check && npm run checkVersion && npm run checkNoTest && npm run checkNoDocs)",
"testShort": "(npm run compile && npm run check)",
"prepareTest": "(rm -rf test/)",
"compile": "(rm -r dist/ && tsc)",
"compile": "(rm -rf dist/ && tsc)",
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)",
"typedoc": "(typedoc --out ./pages/api --target ES6 ./ts/)",
"npmpage": "(npmpage)",
@ -41,36 +41,38 @@
"@types/gulp-sourcemaps": "0.0.29",
"@types/minimatch": "^2.0.29",
"@types/q": "^0.x.x",
"@types/shelljs": "^0.3.32",
"@types/shelljs": "^0.3.33",
"@types/through2": "^2.0.32",
"babel-preset-es2015": "^6.18.0",
"beautylog": "6.0.0",
"depcheck": "^0.6.4",
"depcheck": "^0.6.5",
"early": "^2.0.35",
"gulp": "3.9.1",
"gulp-babel": "^6.1.2",
"gulp-function": "^2.2.0",
"gulp-function": "^2.2.2",
"gulp-inject-modules": "^1.0.0",
"gulp-istanbul": "^1.1.1",
"gulp-mocha": "^3.0.1",
"gulp-sourcemaps": "^2.2.0",
"gulp-typedoc": "^2.0.0",
"lodash": "^4.16.4",
"lodash": "^4.17.2",
"npmextra": "^2.0.3",
"projectinfo": "1.0.4",
"q": "^1.4.1",
"shelljs": "^0.7.5",
"smartchok": "^1.0.2",
"smartcli": "1.0.10",
"smartchok": "^1.0.4",
"smartcli": "1.0.15",
"smartcov": "1.0.0",
"smartenv": "1.2.5",
"smartenv": "2.0.0",
"smartfile": "4.1.0",
"smartpath": "3.2.5",
"smartstream": "^1.0.5",
"smartstring": "^2.0.17",
"smartstring": "^2.0.22",
"smartsystem": "^1.0.9",
"source-map-support": "^0.4.5",
"source-map-support": "^0.4.6",
"through2": "^2.0.1",
"tsn": "^2.0.13",
"typedoc": "^0.5.0",
"typedoc": "^0.5.1",
"typescript": "next",
"typings-global": "^1.0.14"
},

View File

@ -17,18 +17,29 @@ let mocha = function (configArg: INpmtsConfig) {
npmtsOra.text('Instrumentalizing and testing transpiled JS')
npmtsOra.end() // end npmtsOra for tests.
let done = q.defer()
plugins.gulp.src([plugins.path.join(paths.cwd, 'dist/*.js')])
.pipe(plugins.gulpSourcemaps.init())
.pipe(plugins.gulpBabel({
let coverageSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]),
plugins.gulpSourcemaps.init(),
plugins.gulpBabel({
presets: [
require.resolve('babel-preset-es2015')
]
}))
.pipe(plugins.gulpIstanbul({
}))
.pipe(plugins.gulpSourcemaps.write())
.pipe(plugins.gulpInjectModules())
.on('finish', function () {
}),
plugins.gulpIstanbul({
}),
plugins.gulpSourcemaps.write(),
plugins.gulpInjectModules(),
plugins.through2.obj(
(file, enc, cb) => {
cb()
},
(cb) => {
cb()
}
)
])
let localSmartstream = new plugins.smartstream.Smartstream([
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
plugins.gulpBabel({
@ -43,7 +54,11 @@ let mocha = function (configArg: INpmtsConfig) {
reporters: ['lcovonly', 'json', 'text', 'text-summary']
})
])
localSmartstream.run()
coverageSmartstream.run()
.then(
() => {
plugins.beautylog.info('code is now transpiled to ES5, instrumented with istanbul, and injected for mocha!')
return localSmartstream.run()
.then(() => { done.resolve(configArg) }, (err) => {
plugins.beautylog.error('Tests failed!')
console.log(err)
@ -53,6 +68,9 @@ let mocha = function (configArg: INpmtsConfig) {
process.exit(1)
}
})
},
(err) => {
console.log(err)
})
return done.promise
}
@ -87,7 +105,7 @@ export let run = function (configArg: INpmtsConfig) {
if (config.test === true) {
npmtsOra.text('now starting tests')
plugins.beautylog.log(
'-------------------------------------------------------\n' +
'------------------------------------------------------\n' +
'*************************** TESTS: ***************************\n' +
'--------------------------------------------------------------'
)
@ -96,7 +114,7 @@ export let run = function (configArg: INpmtsConfig) {
.then(coverage)
.then(() => {
done.resolve(config)
})
}).catch(err => { console.log(err) })
} else {
npmtsOra.end()
done.resolve(config)

View File

@ -14,6 +14,7 @@ import * as smartpath from 'smartpath'
import * as smartstream from 'smartstream'
import * as smartstring from 'smartstring'
import * as smartsystem from 'smartsystem'
import * as through2 from 'through2'
export let sourceMapSupport = require('source-map-support').install() // display errors correctly during testing
export {
@ -30,5 +31,6 @@ export {
smartpath,
smartstream,
smartstring,
smartsystem
smartsystem,
through2
}