BREAKING CHANGE(package): update scope and build standards

This commit is contained in:
2018-07-17 23:12:12 +02:00
parent ce99e04b45
commit 278eda4869
14 changed files with 1013 additions and 451 deletions

View File

@@ -1,37 +1,36 @@
import 'typings-global'
import * as beautycolor from 'beautycolor'
import * as smartq from 'smartq'
import { HrtMeasurement } from './early.hrtMeasurement'
import * as beautycolor from 'beautycolor';
import * as smartpromise from '@pushrocks/smartpromise';
import { HrtMeasurement } from './early.hrtMeasurement';
export {
HrtMeasurement
}
export { HrtMeasurement };
let doText: boolean = false
let moduleName: string = 'undefined module name'
let startHrt: HrtMeasurement
let doText: boolean = false;
let moduleName: string = 'undefined module name';
let startHrt: HrtMeasurement;
if (process.argv.indexOf('-v') === -1) {
doText = true
doText = true;
}
/**
* start the loading
*/
export let start = function (moduleNameArg: string = '', loaderLengthArg: string = '10') {
moduleName = moduleNameArg
startHrt = new HrtMeasurement()
startHrt.start()
export let start = function(moduleNameArg: string = '', loaderLengthArg: string = '10') {
moduleName = moduleNameArg;
startHrt = new HrtMeasurement();
startHrt.start();
if (doText) {
console.log(`**** starting ${beautycolor.coloredString(moduleNameArg, 'green')} ****`)
console.log(`**** starting ${beautycolor.coloredString(moduleNameArg, 'green')} ****`);
}
}
};
export let stop = (): Promise<number> => {
let done = smartq.defer<number>()
let earlyExecutionTime = startHrt.stop().milliSeconds
let earlyExecutionTimeString: string = (earlyExecutionTime / 1000).toString()
console.log(`OK! -> finished loading within ${beautycolor.coloredString(earlyExecutionTimeString, 'blue')}`)
done.resolve(earlyExecutionTime)
return done.promise
}
let done = smartpromise.defer<number>();
let earlyExecutionTime = startHrt.stop().milliSeconds;
let earlyExecutionTimeString: string = (earlyExecutionTime / 1000).toString();
console.log(
`OK! -> finished loading within ${beautycolor.coloredString(earlyExecutionTimeString, 'blue')}`
);
done.resolve(earlyExecutionTime);
return done.promise;
};