Flow and Continuous IntegrationSat, Jul 25, 2015
So you’ve decided to use Flow on your team. Congrats! Static analysis is a great way to improve code quality.
- How will developers install the
- What about the build?
Flow-bin is an npm module which wraps Flow and its binaries for OSX and 64-bit unix.
Install it with
npm i --save-dev flow-bin.
Now, devs just need to
npm install as usual. Everyone will be on the same version.
flow-bin ships with examples - which will throw distracting warnings. Ignore them in
When your code changes, you’ll want to check it immediately. Fast feedback loops are the key to fun productive development – especially when learning a new tool.
onchange is an npm module to trigger actions when files change. We want to run flow whenever our files change. First install it:
npm i --save-dev onchange
Then start running flow whenever files change-
./node_modules/onchange/cli.js '**/*' -- ./node_modules/.bin/flow
What about the Build Machine?
No need for
apt-get to install binaries. Just run
This way, Flow violations will fail the build - a guaranteed way to get people’s attention.
flow-bin you can distribute Flow to all dev’s machines painlessly. More importantly: executing Flow checks on the build server will keep code quality high.