Merge branch 'master' into 'master'
introduce a merge option See merge request !5
This commit is contained in:
commit
2bd187b704
21
dist/mod00/mod00.check.js
vendored
21
dist/mod00/mod00.check.js
vendored
@ -110,11 +110,20 @@ let checkNodeVersion = (configArg) => {
|
||||
exports.run = (configArg) => {
|
||||
let done = q.defer();
|
||||
plugins.beautylog.ora.text('Check Module: ...');
|
||||
checkProjectTypings(configArg)
|
||||
.then(checkDependencies)
|
||||
.then(checkDevDependencies)
|
||||
.then(checkNodeVersion)
|
||||
.then(done.resolve)
|
||||
.catch((err) => { console.log(err); });
|
||||
// check cli
|
||||
if (configArg.argv.nocheck) {
|
||||
configArg.checkDependencies = false;
|
||||
}
|
||||
if (configArg.checkDependencies) {
|
||||
checkProjectTypings(configArg)
|
||||
.then(checkDependencies)
|
||||
.then(checkDevDependencies)
|
||||
.then(checkNodeVersion)
|
||||
.then(done.resolve)
|
||||
.catch((err) => { console.log(err); });
|
||||
}
|
||||
else {
|
||||
done.resolve(configArg);
|
||||
}
|
||||
return done.promise;
|
||||
};
|
||||
|
9
dist/npmts.config.d.ts
vendored
9
dist/npmts.config.d.ts
vendored
@ -1,7 +1,14 @@
|
||||
export declare type npmtsMode = 'default' | 'custom';
|
||||
/**
|
||||
* specifies the different modes available
|
||||
* default -> uses default options no matterm what
|
||||
* merge -> uses merged default + custom options
|
||||
* custom -> only uses specified options
|
||||
*/
|
||||
export declare type npmtsMode = 'default' | 'custom' | 'merge';
|
||||
export interface INpmtsConfig {
|
||||
argv: any;
|
||||
coverageTreshold: number;
|
||||
checkDependencies: boolean;
|
||||
mode: npmtsMode;
|
||||
test: boolean;
|
||||
testTs: any;
|
||||
|
7
dist/npmts.config.js
vendored
7
dist/npmts.config.js
vendored
@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./npmts.plugins");
|
||||
const paths = require("./npmts.paths");
|
||||
const q = require("smartq");
|
||||
;
|
||||
exports.run = function (argvArg) {
|
||||
let done = q.defer();
|
||||
let defaultConfig = {
|
||||
argv: undefined,
|
||||
coverageTreshold: 70,
|
||||
checkDependencies: true,
|
||||
mode: 'default',
|
||||
test: true,
|
||||
testTs: {},
|
||||
@ -27,16 +27,17 @@ exports.run = function (argvArg) {
|
||||
switch (config.mode) {
|
||||
case 'default':
|
||||
case 'custom':
|
||||
case 'merge':
|
||||
plugins.beautylog.ok('mode is ' + config.mode);
|
||||
done.resolve(config);
|
||||
break;
|
||||
default:
|
||||
plugins.beautylog.error(`mode not recognised!`);
|
||||
plugins.beautylog.error(`mode not recognised! Can be default or custom`);
|
||||
process.exit(1);
|
||||
}
|
||||
;
|
||||
// handle default mode
|
||||
if (config.mode === 'default') {
|
||||
if (config.mode === 'default' || config.mode === 'merge') {
|
||||
config.ts = {
|
||||
'./ts/**/*.ts': './dist/'
|
||||
};
|
||||
|
@ -116,11 +116,21 @@ let checkNodeVersion = (configArg) => {
|
||||
export let run = (configArg) => {
|
||||
let done = q.defer()
|
||||
plugins.beautylog.ora.text('Check Module: ...')
|
||||
checkProjectTypings(configArg)
|
||||
.then(checkDependencies)
|
||||
.then(checkDevDependencies)
|
||||
.then(checkNodeVersion)
|
||||
.then(done.resolve)
|
||||
.catch((err) => { console.log(err) })
|
||||
|
||||
// check cli
|
||||
if (configArg.argv.nocheck) {
|
||||
configArg.checkDependencies = false
|
||||
}
|
||||
if (configArg.checkDependencies) {
|
||||
checkProjectTypings(configArg)
|
||||
.then(checkDependencies)
|
||||
.then(checkDevDependencies)
|
||||
.then(checkNodeVersion)
|
||||
.then(done.resolve)
|
||||
.catch((err) => { console.log(err) })
|
||||
} else {
|
||||
done.resolve(configArg)
|
||||
}
|
||||
|
||||
return done.promise
|
||||
}
|
||||
|
@ -3,28 +3,36 @@ import paths = require('./npmts.paths')
|
||||
|
||||
import * as q from 'smartq'
|
||||
|
||||
export type npmtsMode = 'default' | 'custom'
|
||||
/**
|
||||
* specifies the different modes available
|
||||
* default -> uses default options no matterm what
|
||||
* merge -> uses merged default + custom options
|
||||
* custom -> only uses specified options
|
||||
*/
|
||||
export type npmtsMode = 'default' | 'custom' | 'merge'
|
||||
|
||||
export interface INpmtsConfig {
|
||||
argv: any,
|
||||
coverageTreshold: number,
|
||||
mode: npmtsMode,
|
||||
test: boolean,
|
||||
testTs: any,
|
||||
ts: any,
|
||||
tsOptions: any,
|
||||
argv: any
|
||||
coverageTreshold: number
|
||||
checkDependencies: boolean
|
||||
mode: npmtsMode
|
||||
test: boolean
|
||||
testTs: any
|
||||
ts: any
|
||||
tsOptions: any
|
||||
watch: boolean
|
||||
runData: {
|
||||
coverageLcovInfo?: string,
|
||||
coverageLcovInfo?: string
|
||||
coverageResult?: number
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export let run = function (argvArg) {
|
||||
let done = q.defer()
|
||||
let defaultConfig: INpmtsConfig = {
|
||||
argv: undefined,
|
||||
coverageTreshold: 70,
|
||||
checkDependencies: true,
|
||||
mode: 'default',
|
||||
test: true,
|
||||
testTs: {},
|
||||
@ -50,16 +58,17 @@ export let run = function (argvArg) {
|
||||
switch (config.mode) {
|
||||
case 'default':
|
||||
case 'custom':
|
||||
case 'merge':
|
||||
plugins.beautylog.ok('mode is ' + config.mode)
|
||||
done.resolve(config)
|
||||
break
|
||||
default:
|
||||
plugins.beautylog.error(`mode not recognised!`)
|
||||
plugins.beautylog.error(`mode not recognised! Can be default or custom`)
|
||||
process.exit(1)
|
||||
};
|
||||
|
||||
// handle default mode
|
||||
if (config.mode === 'default') {
|
||||
if (config.mode === 'default' || config.mode === 'merge') {
|
||||
config.ts = {
|
||||
'./ts/**/*.ts': './dist/'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user