[ReactNative] Dim packager output

This commit is contained in:
Alex Kotliarskyi
2015-04-17 17:01:18 -07:00
parent ab1efbd4c1
commit f3e7511d2b
3 changed files with 23 additions and 17 deletions

View File

@@ -10,6 +10,7 @@
var chalk = require('chalk');
var exec = require('child_process').exec;
var Activity = require('./react-packager/src/Activity');
var hasWarned = {};
@@ -44,20 +45,10 @@ function getFlowTypeCheckMiddleware(options) {
function doFlowTypecheck(res, flowroot, next) {
var flowCmd = 'cd "' + flowroot + '" && flow --json --timeout 20';
var start = Date.now();
// Log start message if flow is slow to let user know something is happening.
var flowSlow = setTimeout(
function() {
console.log(chalk.gray('flow: Running static typechecks.'));
},
500
);
var eventId = Activity.startEvent('flow static typechecks');
exec(flowCmd, function(flowError, stdout, stderr) {
clearTimeout(flowSlow);
Activity.endEvent(eventId);
if (!flowError) {
console.log(chalk.gray(
'flow: Typechecks passed (' + (Date.now() - start) + 'ms).')
);
return next();
} else {
try {