Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
36f540a22e | |||
7e61b49d04 | |||
57aa38af89 | |||
12cf37f01f | |||
44150f4d83 | |||
3fd755691d | |||
00983205ce | |||
a0b1b1847c | |||
be9e98ad0c | |||
84578e8dd0 | |||
6d759706ac | |||
2bd4063d22 | |||
c274590184 | |||
de8992da84 | |||
dc598e1627 | |||
bfcd78b169 |
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Push.Rocks
|
Copyright (c) 2016 Lossless GmbH
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -10,6 +10,8 @@ Write npm modules with TypeScript without hassle. TypeScript ready. Fully ES6.
|
|||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||||
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
[](https://gitlab.com/pushrocks/npmts/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/npmts)
|
||||||
|
[](https://hub.docker.com/r/hosttoday/ht-docker-node/)
|
||||||
[](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)
|
||||||
|
2
dist/mod00/mod00.check.js
vendored
2
dist/mod00/mod00.check.js
vendored
@ -49,7 +49,7 @@ let checkDependencies = (configArg) => {
|
|||||||
plugins.beautylog.warn(`Watch out: unused dependency "${item}"`);
|
plugins.beautylog.warn(`Watch out: unused dependency "${item}"`);
|
||||||
}
|
}
|
||||||
for (let item in unused.missing) {
|
for (let item in unused.missing) {
|
||||||
plugins.beautylog.error(`unused devDependency "${item}"`);
|
plugins.beautylog.error(`missing dependency "${item}" in package.json`);
|
||||||
}
|
}
|
||||||
if (unused.missing.length > 0) {
|
if (unused.missing.length > 0) {
|
||||||
plugins.beautylog.info('exiting due to missing dependencies in package.json');
|
plugins.beautylog.info('exiting due to missing dependencies in package.json');
|
||||||
|
67
dist/mod02/index.js
vendored
67
dist/mod02/index.js
vendored
@ -14,32 +14,41 @@ 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 coverageSmartstream = 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.through2.obj((file, enc, cb) => {
|
||||||
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
|
cb(null, file);
|
||||||
plugins.gulpBabel({
|
}, (cb) => {
|
||||||
presets: [
|
cb();
|
||||||
require.resolve('babel-preset-es2015')
|
})
|
||||||
]
|
]);
|
||||||
}),
|
let localSmartstream = new plugins.smartstream.Smartstream([
|
||||||
plugins.gulpInjectModules(),
|
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
|
||||||
plugins.gulpMocha(),
|
plugins.gulpBabel({
|
||||||
plugins.gulpIstanbul.writeReports({
|
presets: [
|
||||||
dir: plugins.path.join(paths.cwd, './coverage'),
|
require.resolve('babel-preset-es2015')
|
||||||
reporters: ['lcovonly', 'json', 'text', 'text-summary']
|
]
|
||||||
})
|
}),
|
||||||
]);
|
plugins.gulpInjectModules(),
|
||||||
localSmartstream.run()
|
plugins.gulpMocha(),
|
||||||
|
plugins.gulpIstanbul.writeReports({
|
||||||
|
dir: plugins.path.join(paths.cwd, './coverage'),
|
||||||
|
reporters: ['lcovonly', 'json', 'text', 'text-summary']
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
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) => {
|
.then(() => { done.resolve(configArg); }, (err) => {
|
||||||
plugins.beautylog.error('Tests failed!');
|
plugins.beautylog.error('Tests failed!');
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@ -50,6 +59,8 @@ let mocha = function (configArg) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}, (err) => {
|
||||||
|
console.log(err);
|
||||||
});
|
});
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
@ -80,14 +91,14 @@ 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)
|
||||||
.then(coverage)
|
.then(coverage)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
});
|
}).catch(err => { console.log(err); });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
npmts_log_1.npmtsOra.end();
|
npmts_log_1.npmtsOra.end();
|
||||||
|
4
dist/npmts.cli.js
vendored
4
dist/npmts.cli.js
vendored
@ -50,7 +50,9 @@ exports.run = () => {
|
|||||||
.then(NpmtsShip.run);
|
.then(NpmtsShip.run);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
})
|
})
|
||||||
.catch((err) => { console.log(err); });
|
.catch((err) => { if (err instanceof Error) {
|
||||||
|
console.log(err);
|
||||||
|
} });
|
||||||
npmtsCli.addVersion(npmtsProjectInfo.version);
|
npmtsCli.addVersion(npmtsProjectInfo.version);
|
||||||
npmtsCli.startParse();
|
npmtsCli.startParse();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
|
3
dist/npmts.plugins.d.ts
vendored
3
dist/npmts.plugins.d.ts
vendored
@ -13,5 +13,6 @@ import * as smartpath from 'smartpath';
|
|||||||
import * as smartstream from 'smartstream';
|
import * as smartstream from 'smartstream';
|
||||||
import * as smartstring from 'smartstring';
|
import * as smartstring from 'smartstring';
|
||||||
import * as smartsystem from 'smartsystem';
|
import * as smartsystem from 'smartsystem';
|
||||||
|
import * as through2 from 'through2';
|
||||||
export declare let sourceMapSupport: any;
|
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 };
|
||||||
|
2
dist/npmts.plugins.js
vendored
2
dist/npmts.plugins.js
vendored
@ -28,4 +28,6 @@ const smartstring = require("smartstring");
|
|||||||
exports.smartstring = smartstring;
|
exports.smartstring = smartstring;
|
||||||
const smartsystem = require("smartsystem");
|
const smartsystem = require("smartsystem");
|
||||||
exports.smartsystem = smartsystem;
|
exports.smartsystem = smartsystem;
|
||||||
|
const through2 = require("through2");
|
||||||
|
exports.through2 = through2;
|
||||||
exports.sourceMapSupport = require('source-map-support').install(); // display errors correctly during testing
|
exports.sourceMapSupport = require('source-map-support').install(); // display errors correctly during testing
|
||||||
|
40
package.json
40
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "5.5.0",
|
"version": "5.5.8",
|
||||||
"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": {
|
||||||
@ -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)",
|
"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)",
|
"testShort": "(npm run compile && npm run check)",
|
||||||
"prepareTest": "(rm -rf test/)",
|
"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/)",
|
"setupCheck": "(git clone https://gitlab.com/sandboxzone/sandbox-npmts.git test/)",
|
||||||
"typedoc": "(typedoc --out ./pages/api --target ES6 ./ts/)",
|
"typedoc": "(typedoc --out ./pages/api --target ES6 ./ts/)",
|
||||||
"npmpage": "(npmpage)",
|
"npmpage": "(npmpage)",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"TypeScript",
|
"TypeScript",
|
||||||
"Declaration"
|
"Declaration"
|
||||||
],
|
],
|
||||||
"author": "Lossless Digital UG (haftungsbeschraenkt)",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/pushrocks/npmts/issues"
|
"url": "https://gitlab.com/pushrocks/npmts/issues"
|
||||||
@ -41,36 +41,38 @@
|
|||||||
"@types/gulp-sourcemaps": "0.0.29",
|
"@types/gulp-sourcemaps": "0.0.29",
|
||||||
"@types/minimatch": "^2.0.29",
|
"@types/minimatch": "^2.0.29",
|
||||||
"@types/q": "^0.x.x",
|
"@types/q": "^0.x.x",
|
||||||
"@types/shelljs": "^0.3.32",
|
"@types/shelljs": "^0.3.33",
|
||||||
"babel-preset-es2015": "^6.16.0",
|
"@types/through2": "^2.0.32",
|
||||||
|
"babel-preset-es2015": "^6.18.0",
|
||||||
"beautylog": "6.0.0",
|
"beautylog": "6.0.0",
|
||||||
"depcheck": "^0.6.4",
|
"depcheck": "^0.6.5",
|
||||||
"early": "^2.0.35",
|
"early": "^2.0.35",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-babel": "^6.1.2",
|
"gulp-babel": "^6.1.2",
|
||||||
"gulp-function": "^2.2.0",
|
"gulp-function": "^2.2.2",
|
||||||
"gulp-inject-modules": "^1.0.0",
|
"gulp-inject-modules": "^1.0.0",
|
||||||
"gulp-istanbul": "^1.1.1",
|
"gulp-istanbul": "^1.1.1",
|
||||||
"gulp-mocha": "^3.0.1",
|
"gulp-mocha": "^3.0.1",
|
||||||
"gulp-sourcemaps": "^2.1.1",
|
"gulp-sourcemaps": "^2.2.0",
|
||||||
"gulp-typedoc": "^2.0.0",
|
"gulp-typedoc": "^2.0.0",
|
||||||
"lodash": "^4.16.4",
|
"lodash": "^4.17.2",
|
||||||
"npmextra": "^2.0.3",
|
"npmextra": "^2.0.3",
|
||||||
"projectinfo": "1.0.3",
|
"projectinfo": "1.0.4",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"shelljs": "^0.7.4",
|
"shelljs": "^0.7.5",
|
||||||
"smartchok": "^1.0.2",
|
"smartchok": "^1.0.4",
|
||||||
"smartcli": "1.0.10",
|
"smartcli": "1.0.15",
|
||||||
"smartcov": "1.0.0",
|
"smartcov": "1.0.0",
|
||||||
"smartenv": "1.2.5",
|
"smartenv": "2.0.0",
|
||||||
"smartfile": "4.0.24",
|
"smartfile": "4.1.0",
|
||||||
"smartpath": "3.2.5",
|
"smartpath": "3.2.5",
|
||||||
"smartstream": "^1.0.5",
|
"smartstream": "^1.0.5",
|
||||||
"smartstring": "^2.0.17",
|
"smartstring": "^2.0.22",
|
||||||
"smartsystem": "^1.0.9",
|
"smartsystem": "^1.0.9",
|
||||||
"source-map-support": "^0.4.5",
|
"source-map-support": "^0.4.6",
|
||||||
"tsn": "^2.0.11",
|
"through2": "^2.0.1",
|
||||||
"typedoc": "^0.5.0",
|
"tsn": "^2.0.13",
|
||||||
|
"typedoc": "^0.5.1",
|
||||||
"typescript": "next",
|
"typescript": "next",
|
||||||
"typings-global": "^1.0.14"
|
"typings-global": "^1.0.14"
|
||||||
},
|
},
|
||||||
|
@ -54,7 +54,7 @@ let checkDependencies = (configArg) => {
|
|||||||
plugins.beautylog.warn(`Watch out: unused dependency "${item}"`)
|
plugins.beautylog.warn(`Watch out: unused dependency "${item}"`)
|
||||||
}
|
}
|
||||||
for (let item in unused.missing) {
|
for (let item in unused.missing) {
|
||||||
plugins.beautylog.error(`unused devDependency "${item}"`)
|
plugins.beautylog.error(`missing dependency "${item}" in package.json`)
|
||||||
}
|
}
|
||||||
if (unused.missing.length > 0) {
|
if (unused.missing.length > 0) {
|
||||||
plugins.beautylog.info('exiting due to missing dependencies in package.json')
|
plugins.beautylog.info('exiting due to missing dependencies in package.json')
|
||||||
|
@ -17,33 +17,48 @@ 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')])
|
|
||||||
.pipe(plugins.gulpSourcemaps.init())
|
let coverageSmartstream = new plugins.smartstream.Smartstream([
|
||||||
.pipe(plugins.gulpBabel({
|
plugins.gulp.src([plugins.path.join(paths.cwd, './dist/**/*.js')]),
|
||||||
|
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 () {
|
plugins.through2.obj(
|
||||||
let localSmartstream = new plugins.smartstream.Smartstream([
|
(file, enc, cb) => {
|
||||||
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
|
cb(null, file)
|
||||||
plugins.gulpBabel({
|
},
|
||||||
presets: [
|
(cb) => {
|
||||||
require.resolve('babel-preset-es2015')
|
cb()
|
||||||
]
|
}
|
||||||
}),
|
)
|
||||||
plugins.gulpInjectModules(),
|
])
|
||||||
plugins.gulpMocha(),
|
|
||||||
plugins.gulpIstanbul.writeReports({
|
let localSmartstream = new plugins.smartstream.Smartstream([
|
||||||
dir: plugins.path.join(paths.cwd, './coverage'),
|
plugins.gulp.src([plugins.path.join(paths.cwd, 'test/test.js')]),
|
||||||
reporters: ['lcovonly', 'json', 'text', 'text-summary']
|
plugins.gulpBabel({
|
||||||
})
|
presets: [
|
||||||
])
|
require.resolve('babel-preset-es2015')
|
||||||
localSmartstream.run()
|
]
|
||||||
|
}),
|
||||||
|
plugins.gulpInjectModules(),
|
||||||
|
plugins.gulpMocha(),
|
||||||
|
plugins.gulpIstanbul.writeReports({
|
||||||
|
dir: plugins.path.join(paths.cwd, './coverage'),
|
||||||
|
reporters: ['lcovonly', 'json', 'text', 'text-summary']
|
||||||
|
})
|
||||||
|
])
|
||||||
|
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) => {
|
.then(() => { done.resolve(configArg) }, (err) => {
|
||||||
plugins.beautylog.error('Tests failed!')
|
plugins.beautylog.error('Tests failed!')
|
||||||
console.log(err)
|
console.log(err)
|
||||||
@ -53,6 +68,9 @@ let mocha = function (configArg: INpmtsConfig) {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
console.log(err)
|
||||||
})
|
})
|
||||||
return done.promise
|
return done.promise
|
||||||
}
|
}
|
||||||
@ -87,7 +105,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' +
|
||||||
'--------------------------------------------------------------'
|
'--------------------------------------------------------------'
|
||||||
)
|
)
|
||||||
@ -96,7 +114,7 @@ export let run = function (configArg: INpmtsConfig) {
|
|||||||
.then(coverage)
|
.then(coverage)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
done.resolve(config)
|
done.resolve(config)
|
||||||
})
|
}).catch(err => { console.log(err) })
|
||||||
} else {
|
} else {
|
||||||
npmtsOra.end()
|
npmtsOra.end()
|
||||||
done.resolve(config)
|
done.resolve(config)
|
||||||
|
@ -53,7 +53,7 @@ export let run = () => {
|
|||||||
|
|
||||||
return done.promise
|
return done.promise
|
||||||
})
|
})
|
||||||
.catch((err) => { console.log(err) })
|
.catch((err) => { if (err instanceof Error) { console.log(err) } } )
|
||||||
npmtsCli.addVersion(npmtsProjectInfo.version)
|
npmtsCli.addVersion(npmtsProjectInfo.version)
|
||||||
npmtsCli.startParse()
|
npmtsCli.startParse()
|
||||||
return done.promise
|
return done.promise
|
||||||
|
@ -14,6 +14,7 @@ import * as smartpath from 'smartpath'
|
|||||||
import * as smartstream from 'smartstream'
|
import * as smartstream from 'smartstream'
|
||||||
import * as smartstring from 'smartstring'
|
import * as smartstring from 'smartstring'
|
||||||
import * as smartsystem from 'smartsystem'
|
import * as smartsystem from 'smartsystem'
|
||||||
|
import * as through2 from 'through2'
|
||||||
export let sourceMapSupport = require('source-map-support').install() // display errors correctly during testing
|
export let sourceMapSupport = require('source-map-support').install() // display errors correctly during testing
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@ -30,5 +31,6 @@ export {
|
|||||||
smartpath,
|
smartpath,
|
||||||
smartstream,
|
smartstream,
|
||||||
smartstring,
|
smartstring,
|
||||||
smartsystem
|
smartsystem,
|
||||||
|
through2
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user