Compare commits

...

6 Commits

Author SHA1 Message Date
433fad502d 5.3.28 2016-07-27 16:09:24 +02:00
f583b05f73 now parsing compiler options correctly 2016-07-27 16:08:33 +02:00
3f50311487 5.3.27 2016-07-23 02:06:16 +02:00
ee16740d0b improve coverage reporting 2016-07-23 02:05:56 +02:00
63c73536a2 5.3.26 2016-07-19 20:33:57 +02:00
2f7ebfc47a update dependencies 2016-07-19 20:33:45 +02:00
8 changed files with 45 additions and 36 deletions

18
dist/npmts.compile.js vendored
View File

@ -7,16 +7,22 @@ var promiseArray = [];
var compileTs = function (tsFileArrayArg, tsOptionsArg) { var compileTs = function (tsFileArrayArg, tsOptionsArg) {
if (tsOptionsArg === void 0) { tsOptionsArg = {}; } if (tsOptionsArg === void 0) { tsOptionsArg = {}; }
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var tsOptionsDefault = { var compilerOptionsDefault = {
declaration: true, declaration: true,
target: "ES6", module: "CommonJS",
module: "commonjs" target: "ES6"
}; };
/** /**
* merges default ts options with those found in npmts.json * merges default ts options with those found in npmts.json
*/ */
var tsOptions = function (keyArg) { var compilerOptions = function (keyArg) {
return plugins.lodashObject.assign(tsOptionsDefault, tsOptionsArg); var tsOptionsCombined = plugins.lodashObject.merge(compilerOptionsDefault, tsOptionsArg);
var compilerOptions = {
declaration: tsOptionsCombined.declaration,
module: plugins.tsn.ModuleKind[tsOptionsCombined.module],
target: plugins.tsn.ScriptTarget[tsOptionsCombined.target]
};
return compilerOptions;
}; };
var _loop_1 = function(keyArg) { var _loop_1 = function(keyArg) {
plugins.beautylog.info("TypeScript assignment: transpile from " + keyArg.blue + " to " + tsFileArrayArg[keyArg].blue); plugins.beautylog.info("TypeScript assignment: transpile from " + keyArg.blue + " to " + tsFileArrayArg[keyArg].blue);
@ -25,7 +31,7 @@ var compileTs = function (tsFileArrayArg, tsOptionsArg) {
.then(function (filesToConvertArg) { .then(function (filesToConvertArg) {
var filesToConvertAbsolute = plugins.smartpath.transform.toAbsolute(filesToConvertArg, process.cwd()); var filesToConvertAbsolute = plugins.smartpath.transform.toAbsolute(filesToConvertArg, process.cwd());
var destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg], process.cwd()); var destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg], process.cwd());
var filesCompiledPromise = plugins.tsn.compile(filesToConvertAbsolute, destDir); var filesCompiledPromise = plugins.tsn.compile(filesToConvertAbsolute, destDir, compilerOptions(keyArg));
promiseArray.push(filesCompiledPromise); promiseArray.push(filesCompiledPromise);
}); });
promiseArray.push(filesReadPromise); promiseArray.push(filesReadPromise);

View File

@ -11,7 +11,7 @@ export declare let g: {
sourcemaps: any; sourcemaps: any;
typedoc: any; typedoc: any;
}; };
export declare let lodashObject: any; export import lodashObject = require('lodash');
export import npmextra = require("npmextra"); export import npmextra = require("npmextra");
export import projectinfo = require("projectinfo"); export import projectinfo = require("projectinfo");
export import path = require("path"); export import path = require("path");
@ -19,7 +19,7 @@ export import Q = require("q");
export import shelljs = require("shelljs"); export import shelljs = require("shelljs");
export declare let smartci: any; export declare let smartci: any;
export import smartcli = require("smartcli"); export import smartcli = require("smartcli");
export declare let smartcov: any; export import smartcov = require("smartcov");
export import smartenv = require("smartenv"); export import smartenv = require("smartenv");
export import smartfile = require("smartfile"); export import smartfile = require("smartfile");
export import smartpath = require("smartpath"); export import smartpath = require("smartpath");

View File

@ -12,7 +12,7 @@ exports.g = {
sourcemaps: require("gulp-sourcemaps"), sourcemaps: require("gulp-sourcemaps"),
typedoc: require("gulp-typedoc") typedoc: require("gulp-typedoc")
}; };
exports.lodashObject = require('lodash/fp/object'); exports.lodashObject = require('lodash');
exports.npmextra = require("npmextra"); exports.npmextra = require("npmextra");
exports.projectinfo = require("projectinfo"); exports.projectinfo = require("projectinfo");
exports.path = require("path"); exports.path = require("path");

8
dist/npmts.tests.js vendored
View File

@ -43,15 +43,13 @@ var mocha = function (configArg) {
}; };
var coverage = function (configArg) { var coverage = function (configArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir, "lcov.info")) plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir, "lcov.info"), 2)
.then(function (percentageArg) { .then(function (percentageArg) {
if (percentageArg >= configArg.coverageTreshold) { if (percentageArg >= configArg.coverageTreshold) {
plugins.beautylog.ok("your coverage of " + percentageArg.toString().blue + "% ".blue + "exceeds your treshold of " + plugins.beautylog.ok(percentageArg.toString() + "% coverage exceeds your treshold of " + configArg.coverageTreshold.toString() + "%");
configArg.coverageTreshold.toString().blue + "%".blue);
} }
else { else {
plugins.beautylog.warn("your coverage of " + percentageArg + "% " + "fails your treshold of " + plugins.beautylog.warn(percentageArg.toString() + "% coverage fails your treshold of " + configArg.coverageTreshold.toString() + "%");
configArg.coverageTreshold + "%");
plugins.beautylog.error("exiting due to coverage failure"); plugins.beautylog.error("exiting due to coverage failure");
process.exit(1); process.exit(1);
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "npmts", "name": "npmts",
"version": "5.3.25", "version": "5.3.28",
"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": {
@ -33,7 +33,7 @@
"@types/q": "^0.0.27", "@types/q": "^0.0.27",
"@types/shelljs": "^0.3.27", "@types/shelljs": "^0.3.27",
"babel-preset-es2015": "^6.9.0", "babel-preset-es2015": "^6.9.0",
"beautylog": "5.0.14", "beautylog": "5.0.18",
"early": "^2.0.13", "early": "^2.0.13",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-babel": "^6.1.2", "gulp-babel": "^6.1.2",
@ -46,20 +46,20 @@
"gulp-replace": "^0.5.4", "gulp-replace": "^0.5.4",
"gulp-sourcemaps": "^1.6.0", "gulp-sourcemaps": "^1.6.0",
"gulp-typedoc": "^2.0.0", "gulp-typedoc": "^2.0.0",
"lodash": "^4.13.1", "lodash": "^4.14.0",
"npmextra": "^1.0.7", "npmextra": "^1.0.8",
"projectinfo": "1.0.3", "projectinfo": "1.0.3",
"q": "^1.4.1", "q": "^1.4.1",
"shelljs": "^0.7.0", "shelljs": "^0.7.2",
"smartci": "0.0.1", "smartci": "0.0.1",
"smartcli": "1.0.4", "smartcli": "1.0.4",
"smartcov": "0.0.6", "smartcov": "0.0.9",
"smartenv": "1.2.5", "smartenv": "1.2.5",
"smartfile": "4.0.10", "smartfile": "4.0.12",
"smartpath": "3.2.2", "smartpath": "3.2.2",
"smartstring": "^2.0.14", "smartstring": "^2.0.15",
"source-map-support": "^0.4.2", "source-map-support": "^0.4.2",
"tsn": "^1.0.7", "tsn": "^1.0.9",
"typedoc": "^0.4.4", "typedoc": "^0.4.4",
"typescript": "^2.0.0-dev.20160630", "typescript": "^2.0.0-dev.20160630",
"typings-global": "*" "typings-global": "*"

View File

@ -8,17 +8,23 @@ let promiseArray = [];
let compileTs = (tsFileArrayArg:string[],tsOptionsArg = {}) => { let compileTs = (tsFileArrayArg:string[],tsOptionsArg = {}) => {
let done = plugins.Q.defer(); let done = plugins.Q.defer();
let tsOptionsDefault = { let compilerOptionsDefault = {
declaration: true, declaration: true,
target: "ES6", module: "CommonJS",
module: "commonjs" target: "ES6"
}; };
/** /**
* merges default ts options with those found in npmts.json * merges default ts options with those found in npmts.json
*/ */
let tsOptions = function (keyArg:string) { let compilerOptions = function (keyArg:string) {
return plugins.lodashObject.assign(tsOptionsDefault, tsOptionsArg) let tsOptionsCombined = plugins.lodashObject.merge(compilerOptionsDefault, tsOptionsArg);
let compilerOptions:plugins.tsn.CompilerOptions = {
declaration: tsOptionsCombined.declaration,
module: plugins.tsn.ModuleKind[tsOptionsCombined.module],
target: plugins.tsn.ScriptTarget[tsOptionsCombined.target]
};
return compilerOptions;
}; };
for (let keyArg in tsFileArrayArg) { for (let keyArg in tsFileArrayArg) {
plugins.beautylog.info(`TypeScript assignment: transpile from ${keyArg.blue} to ${tsFileArrayArg[keyArg].blue}`); plugins.beautylog.info(`TypeScript assignment: transpile from ${keyArg.blue} to ${tsFileArrayArg[keyArg].blue}`);
@ -29,7 +35,8 @@ let compileTs = (tsFileArrayArg:string[],tsOptionsArg = {}) => {
let destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg],process.cwd()); let destDir = plugins.smartpath.transform.toAbsolute(tsFileArrayArg[keyArg],process.cwd());
let filesCompiledPromise = plugins.tsn.compile( let filesCompiledPromise = plugins.tsn.compile(
filesToConvertAbsolute, filesToConvertAbsolute,
destDir destDir,
compilerOptions(keyArg)
); );
promiseArray.push(filesCompiledPromise); promiseArray.push(filesCompiledPromise);
}); });

View File

@ -11,7 +11,7 @@ export let g = {
sourcemaps: require("gulp-sourcemaps"), sourcemaps: require("gulp-sourcemaps"),
typedoc: require("gulp-typedoc") typedoc: require("gulp-typedoc")
}; };
export let lodashObject = require('lodash/fp/object'); export import lodashObject = require('lodash');
export import npmextra = require("npmextra"); export import npmextra = require("npmextra");
export import projectinfo = require("projectinfo"); export import projectinfo = require("projectinfo");
export import path = require("path"); export import path = require("path");
@ -19,7 +19,7 @@ export import Q = require("q");
export import shelljs = require("shelljs"); export import shelljs = require("shelljs");
export let smartci = require("smartci"); export let smartci = require("smartci");
export import smartcli = require("smartcli"); export import smartcli = require("smartcli");
export let smartcov = require("smartcov"); export import smartcov = require("smartcov");
export import smartenv = require("smartenv"); export import smartenv = require("smartenv");
export import smartfile = require("smartfile"); export import smartfile = require("smartfile");
export import smartpath = require("smartpath"); export import smartpath = require("smartpath");

View File

@ -45,17 +45,15 @@ let mocha = function (configArg) {
let coverage = function(configArg){ let coverage = function(configArg){
let done = plugins.Q.defer(); let done = plugins.Q.defer();
plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir,"lcov.info")) plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir,"lcov.info"),2)
.then(function(percentageArg){ .then(function(percentageArg){
if (percentageArg >= configArg.coverageTreshold){ if (percentageArg >= configArg.coverageTreshold){
plugins.beautylog.ok( plugins.beautylog.ok(
"your coverage of " + percentageArg.toString().blue + "% ".blue + "exceeds your treshold of " + `${percentageArg.toString()}% coverage exceeds your treshold of ${configArg.coverageTreshold.toString()}%`
configArg.coverageTreshold.toString().blue + "%".blue
); );
} else { } else {
plugins.beautylog.warn( plugins.beautylog.warn(
"your coverage of " + percentageArg + "% " + "fails your treshold of " + `${percentageArg.toString()}% coverage fails your treshold of ${configArg.coverageTreshold.toString()}%`
configArg.coverageTreshold + "%"
); );
plugins.beautylog.error("exiting due to coverage failure"); plugins.beautylog.error("exiting due to coverage failure");
process.exit(1); process.exit(1);