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β
Ensure that you have built and installed Glean and
the glean executable is on your PATH.
You can index your Flow repository with:
glean index flow DIR --db-root DB --db NAME/INSTANCE
where
DBis the directory you want to store your Glean DBsDIRis the root directory containing the Flow project (with.flowconfig)NAME/INSTANCEis the name of the repository to create
Run the indexer (manually)β
flow glean DIR --output-dir JSON --write-root PREFIX
where
DIRis the root directory containing the JavaScript/Flow filesJSONis the directory in which to write the output.jsonfilesPREFIXis 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