switch to seperate build/test commands to inrpove speed
This commit is contained in:
@ -108,6 +108,10 @@ let handleCoverageData = async (configArg: INpmtsConfig) => {
|
||||
return configArg;
|
||||
};
|
||||
|
||||
/**
|
||||
* run this module
|
||||
* @param configArg some config for how to run this module
|
||||
*/
|
||||
export let run = function(configArg: INpmtsConfig) {
|
||||
let done = q.defer<INpmtsConfig>();
|
||||
let config = configArg;
|
||||
|
@ -51,14 +51,15 @@ export let run = async () => {
|
||||
);
|
||||
plugins.beautylog.log('---------------------------------------------');
|
||||
let npmtsCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
// build
|
||||
npmtsCli
|
||||
.standardTask()
|
||||
.then(argvArg => {
|
||||
plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version);
|
||||
return NpmtsConfig.run(argvArg);
|
||||
})
|
||||
.then((configArg: NpmtsConfig.INpmtsConfig) => {
|
||||
.addCommand('build')
|
||||
.subscribe(async (argvArg) => {
|
||||
let done = q.defer();
|
||||
plugins.beautylog.info('npmts version: ' + npmtsProjectInfo.version);
|
||||
const configArg: NpmtsConfig.INpmtsConfig = await NpmtsConfig.run(argvArg);
|
||||
|
||||
plugins.beautylog.ora.start('loading additional modules...');
|
||||
NpmtsMods.modCompile
|
||||
.load()
|
||||
@ -93,13 +94,21 @@ export let run = async () => {
|
||||
.then(NpmtsShip.run);
|
||||
|
||||
return done.promise;
|
||||
})
|
||||
.catch(err => {
|
||||
}, err => {
|
||||
if (err instanceof Error) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// standard task
|
||||
npmtsCli.standardTask().subscribe(async argvArg => {
|
||||
await npmtsCli.trigger('build')
|
||||
})
|
||||
|
||||
// cli metadata
|
||||
npmtsCli.addVersion(npmtsProjectInfo.version);
|
||||
|
||||
// start parsing
|
||||
npmtsCli.startParse();
|
||||
return await done.promise;
|
||||
};
|
||||
|
@ -32,7 +32,7 @@ export interface INpmtsConfig {
|
||||
}
|
||||
|
||||
export let run = function(argvArg) {
|
||||
let done = smartq.defer();
|
||||
let done = smartq.defer<INpmtsConfig>();
|
||||
let defaultConfig: INpmtsConfig = {
|
||||
argv: undefined,
|
||||
coverageTreshold: 70,
|
||||
|
@ -6,7 +6,7 @@ import * as npmextra from 'npmextra';
|
||||
import * as projectinfo from 'projectinfo';
|
||||
import * as path from 'path';
|
||||
import * as smartanalytics from 'smartanalytics';
|
||||
import * as smartcli from 'smartcli';
|
||||
import * as smartcli from '@pushrocks/smartcli';
|
||||
import * as smarterror from 'smarterror';
|
||||
import * as smartfile from 'smartfile';
|
||||
import * as smartpath from 'smartpath';
|
||||
|
Reference in New Issue
Block a user