JavaScript (Flow)
The JavaScript/Flow indexer is built into the Flow system. It's also included in the Glean demo Docker image to try out.
Run the indexerβ
The indexer is run via the main glean
CLI tool.
> cabal build exe:glean
And index your Flow repository with:
glean index flow DIR --db NAME/INSTANCE
where
DIR
is the root directory containing the Flow project (with.flowconfig
)name/hash
is the name of the repository to create
Provide the usual --db-root
and --schema
or --service
arguments
to glean
Run the indexer (manually)β
flow glean DIR --output-dir JSON --write-root PREFIX
where
DIR
is the root directory containing the JavaScript/Flow filesJSON
is the directory in which to write the output.json
filesPREFIX
is a prefix to add to the files in the Glean index (this can be empty if you don't need a prefix)
The generated files can be ingested into a Glean database using glean create
.
Derived predicatesβ
Several predicates should be derived after indexing. For each stored
predicate in the schema you should glean derive
the predicate.
In the shellβ
Flow source can also be indexed directly from the Glean shell:
:index flow DIR
Schemaβ
The schema is in glean/schema/source/flow.angle