Setup grunt flow task and run on travis (#6684)
Paul O’Shannessy committed
May 3, 2016 at 18:16 UTC
c9504d99a55d544b38ad452a776250e3ea6ee68c
5 files changed
+28
-2
.travis.yml
+1
@@ -87,6 +87,7 @@ env:
87
- TEST_TYPE=build
88
- TEST_TYPE=test
89
- TEST_TYPE=lint
90
+ - TEST_TYPE=flow
91
- TEST_TYPE=build_website
92
global:
93
# SERVER
Gruntfile.js
+2
@@ -56,6 +56,8 @@ module.exports = function(grunt) {
56
57
grunt.registerTask('lint', ['eslint']);
58
59
+ grunt.registerTask('flow', require('./grunt/tasks/flow'));
60
+
61
grunt.registerTask('delete-build-modules', function() {
62
// Use gulp here.
63
spawnGulp(['react:clean'], null, this.async());
grunt/tasks/flow.js
new
+22
@@ -0,0 +1,22 @@
1
+'use strict';
2
+
3
+var grunt = require('grunt');
4
+
5
+var extension = process.platform === 'win32' ? '.cmd': '';
6
+
7
+module.exports = function() {
8
+ var done = this.async();
9
+ grunt.util.spawn({
10
+ cmd: 'node_modules/.bin/flow' + extension,
11
+ args: ['check', '.'],
12
+ opts: {stdio: 'inherit'},
13
+ }, function(err, result, code) {
14
+ if (err) {
15
+ grunt.log.error('Flow failed');
16
+ } else {
17
+ grunt.log.ok('Flow passed');
18
+ }
19
+
20
+ done(code === 0);
21
+ });
22
+};
package.json
+2
-1
@@ -36,8 +36,9 @@
36
"eslint": "1.10.3",
37
"eslint-plugin-react": "4.1.0",
38
"eslint-plugin-react-internal": "file:eslint-rules",
39
- "fbjs": "^0.8.0",
39
+ "fbjs": "^0.8.1",
40
"fbjs-scripts": "^0.6.0",
41
+ "flow-bin": "0.24.0",
42
"glob": "^6.0.1",
43
"grunt": "^0.4.5",
44
"grunt-cli": "^0.1.13",
packages/react/package.json
+1
-1
@@ -23,7 +23,7 @@
23
"node": ">=0.10.0"
24
},
25
"dependencies": {
26
- "fbjs": "^0.8.0",
26
+ "fbjs": "^0.8.1",
27
"loose-envify": "^1.1.0",
28
"object-assign": "^4.1.0"
29
},