This repository contains:
- a git submodule
data/bazel-central-registrypointing tohttps://github.com/bazelbuild/bazel-central-registry.git - a gazelle extension that runs over
data/bazel-central-registry:- generates rules foreach module version
- fetches github repository metadata
- generates a
module_metadatarule for each{MODULE_NAME}underdata/bazel-central-registry/modules/{MODULE_NAME}. - generates a
module_versionrule for each{MODULE_NAME}/{MODULE_VERSION}underdata/bazel-central-registry/modules/{MODULE_NAME}/{MODULE_VERSION}. - generates a
module_registryrule atdata/bazel-central-registry/modules. - modifies the root
MODULE.bazelfile with additional http archives (for doc generation).
- a user interface for the BCR at
//app/bcr.
To run gazelle:
make bcr_initto initialize the git submodule.make bcr_updateto update to the latest version.make bcrto run the gazelle extension. This is equivalent toGITHUB_TOKEN=XXX bazel run //:bcr. You'll need a github api token to fetch necessary metadata from github. Look the bazel gazelle rule to see various cache files.
To serve the UI:
bazel run //app/bcr:release:- downloads a http archive for each latest version (having starlark files).
- runs a different gazelle extension to collect
.bzlfiles. - extracts documentation for all latest versions.
- builds a single
registry.pbcontaining the full state of the bazel central registry (and docs, this compresses to approx 6MB). - embeds that into the single-page application UI.
- serves it up at :8080.