Skip to content

Commit 2d20dc4

Browse files
authored
Separate yarn flow and yarn flow-ci (#12841)
1 parent d4123b4 commit 2d20dc4

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
119119
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",
120120
"flow": "node ./scripts/tasks/flow.js",
121+
"flow-ci": "node ./scripts/tasks/flow-ci.js",
121122
"prettier": "node ./scripts/prettier/index.js write-changed",
122123
"prettier-all": "node ./scripts/prettier/index.js write",
123124
"version-check": "node ./scripts/tasks/version-check.js"

scripts/circleci/test_entry_point.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ COMMANDS_TO_RUN=()
88

99
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
1010
COMMANDS_TO_RUN+=('node ./scripts/prettier/index')
11-
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow')
11+
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow-ci')
1212
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
1313
COMMANDS_TO_RUN+=('yarn test --maxWorkers=2')
1414
COMMANDS_TO_RUN+=('./scripts/circleci/check_license.sh')

scripts/release/build-commands/run-automated-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {logPromise, runYarnTask} = require('../utils');
77
module.exports = async ({cwd}) => {
88
await logPromise(runYarnTask(cwd, 'lint', 'Lint failed'), 'Running ESLint');
99
await logPromise(
10-
runYarnTask(cwd, 'flow', 'Flow failed'),
10+
runYarnTask(cwd, 'flow-ci', 'Flow failed'),
1111
'Running Flow checks'
1212
);
1313
await logPromise(

scripts/tasks/flow-ci.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright (c) 2013-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
'use strict';
9+
10+
const path = require('path');
11+
const spawn = require('child_process').spawn;
12+
13+
const extension = process.platform === 'win32' ? '.cmd' : '';
14+
15+
// This script forces a complete check.
16+
// Use it for the CI.
17+
18+
spawn(path.join('node_modules', '.bin', 'flow' + extension), ['check', '.'], {
19+
// Allow colors to pass through
20+
stdio: 'inherit',
21+
}).on('close', function(code) {
22+
if (code !== 0) {
23+
console.error('Flow failed');
24+
} else {
25+
console.log('Flow passed');
26+
}
27+
28+
process.exit(code);
29+
});

scripts/tasks/flow.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const spawn = require('child_process').spawn;
1212

1313
const extension = process.platform === 'win32' ? '.cmd' : '';
1414

15-
spawn(path.join('node_modules', '.bin', 'flow' + extension), ['check', '.'], {
15+
// This script is using `flow status` for a quick check with a server.
16+
// Use it for local development.
17+
18+
spawn(path.join('node_modules', '.bin', 'flow' + extension), ['status', '.'], {
1619
// Allow colors to pass through
1720
stdio: 'inherit',
1821
}).on('close', function(code) {

0 commit comments

Comments
 (0)