-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
const chalk = require('chalk'); | ||
const spawn = require('child_process').spawn; | ||
const extension = process.platform === 'win32' ? '.cmd' : ''; | ||
|
||
require('./createFlowConfigs'); | ||
|
||
async function runFlow(renderer, args) { | ||
return new Promise(resolve => { | ||
console.log( | ||
'Running Flow for the ' + chalk.cyan(renderer) + ' renderer...', | ||
); | ||
spawn('../../../node_modules/.bin/flow' + extension, args, { | ||
// Allow colors to pass through: | ||
stdio: 'inherit', | ||
// Use a specific renderer config: | ||
cwd: process.cwd() + '/scripts/flow/' + renderer + '/', | ||
}).on('close', function(code) { | ||
if (code !== 0) { | ||
console.error( | ||
'Flow failed for the ' + chalk.red(renderer) + ' renderer', | ||
); | ||
console.log(); | ||
process.exit(code); | ||
} else { | ||
console.log( | ||
'Flow passed for the ' + chalk.green(renderer) + ' renderer', | ||
); | ||
console.log(); | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
module.exports = runFlow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
exports.typedRenderers = ['dom', 'fabric', 'native', 'test']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters