Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",
"flow": "node ./scripts/tasks/flow.js",
"flow-ci": "node ./scripts/tasks/flow-ci.js",
"prettier": "node ./scripts/prettier/index.js write-changed",
"prettier-all": "node ./scripts/prettier/index.js write",
"version-check": "node ./scripts/tasks/version-check.js"
Expand Down
2 changes: 1 addition & 1 deletion scripts/circleci/test_entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COMMANDS_TO_RUN=()

if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('node ./scripts/prettier/index')
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow')
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow-ci')
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
COMMANDS_TO_RUN+=('yarn test --maxWorkers=2')
COMMANDS_TO_RUN+=('./scripts/circleci/check_license.sh')
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/build-commands/run-automated-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {logPromise, runYarnTask} = require('../utils');
module.exports = async ({cwd}) => {
await logPromise(runYarnTask(cwd, 'lint', 'Lint failed'), 'Running ESLint');
await logPromise(
runYarnTask(cwd, 'flow', 'Flow failed'),
runYarnTask(cwd, 'flow-ci', 'Flow failed'),
'Running Flow checks'
);
await logPromise(
Expand Down
29 changes: 29 additions & 0 deletions scripts/tasks/flow-ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const path = require('path');
const spawn = require('child_process').spawn;

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

// This script forces a complete check.
// Use it for the CI.

spawn(path.join('node_modules', '.bin', 'flow' + extension), ['check', '.'], {
// Allow colors to pass through
stdio: 'inherit',
}).on('close', function(code) {
if (code !== 0) {
console.error('Flow failed');
} else {
console.log('Flow passed');
}

process.exit(code);
});
5 changes: 4 additions & 1 deletion scripts/tasks/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const spawn = require('child_process').spawn;

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

spawn(path.join('node_modules', '.bin', 'flow' + extension), ['check', '.'], {
// This script is using `flow status` for a quick check with a server.
// Use it for local development.

spawn(path.join('node_modules', '.bin', 'flow' + extension), ['status', '.'], {
// Allow colors to pass through
stdio: 'inherit',
}).on('close', function(code) {
Expand Down