2017-11-28 16:33:55 +00:00
|
|
|
/* ------------------------------------------
|
|
|
|
* This module compiles the module's TypeScript files
|
|
|
|
* Note: Test files are only compiled in memory
|
|
|
|
* -------------------------------------------- */
|
2018-04-08 23:03:39 +00:00
|
|
|
import * as q from 'smartq';
|
2017-11-28 16:33:55 +00:00
|
|
|
|
2018-04-08 23:03:39 +00:00
|
|
|
import { INpmtsConfig } from '../npmts.config';
|
2017-11-28 16:33:55 +00:00
|
|
|
|
2018-04-08 23:03:39 +00:00
|
|
|
import * as plugins from './mod.plugins';
|
2017-11-28 16:33:55 +00:00
|
|
|
|
2018-04-08 23:03:39 +00:00
|
|
|
import * as NpmtsAssets from './mod.assets';
|
|
|
|
import * as NpmtsCheck from './mod.check';
|
|
|
|
import * as NpmtsClean from './mod.clean';
|
|
|
|
import * as NpmtsCompile from './mod.compile';
|
2017-11-28 16:33:55 +00:00
|
|
|
|
2018-04-08 23:03:39 +00:00
|
|
|
export let run = function(configArg: INpmtsConfig): Promise<INpmtsConfig> {
|
|
|
|
let done = q.defer<INpmtsConfig>();
|
|
|
|
plugins.beautylog.ora.text('starting TypeScript Compilation');
|
2017-11-28 16:33:55 +00:00
|
|
|
NpmtsClean.run(configArg)
|
|
|
|
.then(NpmtsCheck.run)
|
|
|
|
.then(NpmtsCompile.run)
|
|
|
|
.then(NpmtsAssets.run)
|
2018-04-08 23:03:39 +00:00
|
|
|
.then(function() {
|
|
|
|
done.resolve(configArg);
|
|
|
|
});
|
|
|
|
return done.promise;
|
|
|
|
};
|