Skip to content

Commit

Permalink
Setup grunt flow task and run on travis (facebook#6684)
Browse files Browse the repository at this point in the history
  • Loading branch information
zpao committed May 4, 2016
1 parent 7cf61db commit c9504d9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ env:
- TEST_TYPE=build
- TEST_TYPE=test
- TEST_TYPE=lint
- TEST_TYPE=flow
- TEST_TYPE=build_website
global:
# SERVER
Expand Down
2 changes: 2 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module.exports = function(grunt) {

grunt.registerTask('lint', ['eslint']);

grunt.registerTask('flow', require('./grunt/tasks/flow'));

grunt.registerTask('delete-build-modules', function() {
// Use gulp here.
spawnGulp(['react:clean'], null, this.async());
Expand Down
22 changes: 22 additions & 0 deletions grunt/tasks/flow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

var grunt = require('grunt');

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

module.exports = function() {
var done = this.async();
grunt.util.spawn({
cmd: 'node_modules/.bin/flow' + extension,
args: ['check', '.'],
opts: {stdio: 'inherit'},
}, function(err, result, code) {
if (err) {
grunt.log.error('Flow failed');
} else {
grunt.log.ok('Flow passed');
}

done(code === 0);
});
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
"eslint": "1.10.3",
"eslint-plugin-react": "4.1.0",
"eslint-plugin-react-internal": "file:eslint-rules",
"fbjs": "^0.8.0",
"fbjs": "^0.8.1",
"fbjs-scripts": "^0.6.0",
"flow-bin": "0.24.0",
"glob": "^6.0.1",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"node": ">=0.10.0"
},
"dependencies": {
"fbjs": "^0.8.0",
"fbjs": "^0.8.1",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.0"
},
Expand Down

0 comments on commit c9504d9

Please sign in to comment.