You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although not recommended, you can also install Flow globally (for example, perhaps you don't use npm or package.json).
The best way to install globally is via flow-bin:
npm install -g flow-bin
flow # make sure `npm bin -g` is on your path
On Mac OS X, you can install Flow via the Homebrew package manager:
brew update
brew install flow
You can also build and install Flow via the OCaml OPAM package manager. Since Flow has some non-OCaml dependencies, you need to use the depext package like so:
If you don't have a new enough version of OCaml to compile Flow, you can also use OPAM to bootstrap a modern version. Install OPAM via the binary packages for your operating system and run:
In powershell, run iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/appveyor-install.ps1")) which will likely run a cygwin setup installer with a bunch of cygwin packages and stuff. This helps make sure that every package that opam needs is available.
Install Opam
Open the cygwin64 terminal
Download opam with curl -fsSL -o opam64.tar.xz https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.1/opam64.tar.xz
tar -xf opam64.tar.xz
cd opam64
Install opam ./install.sh
Initialize opam to point to a mingw fork: opam init -a default "https://github.com/fdopen/opam-repository-mingw.git" --comp "4.03.0+mingw64c" --switch "4.03.0+mingw64c"
Make sure opam stuff is in your path: eval `opam config env`
While Flow is written in OCaml, its parser is available as a compiled-to-JavaScript module published to npm, named flow-parser. Most end users of Flow
will not need to use this parser directly (and should install flow-bin from npm above), but JavaScript packages which make use of parsing
Flow-typed JavaScript can use this to generate Flow's syntax tree with annotated types attached.
Running the tests
To run the tests, first compile flow using make. Then run bash ./runtests.sh bin/flow
There is a make test target that compiles and runs tests.
To run a subset of the tests you can pass a second argument to the runtests.sh file.
For example: bash runtests.sh bin/flow class | grep -v 'SKIP'