Documentation Workflow
This page explains how BUG documentation is built and published, with a focus on how module docs are derived from module files and GitHub Actions.
Sources of Truth
For each module in src/modules/<module-name>, documentation is assembled from three files:
README.md: main documentation body for the module page.CHANGELOG.md: version history appended to the module page.module.json: metadata used in the generated modules index (name, description, version, status).
The docs generator reads these files and creates static pages in docs/pages/modules.
Module Docs Generation
The generator script is docs/scripts/generateModules.js.
It performs the following steps:
- Enumerates all folders in
src/modules. - Reads each module’s
module.jsonfor title, description, version, and status. - If
README.mdexists:- Creates
docs/pages/modules/<module>/index.md. - Prepends Jekyll front matter.
- Injects the README body.
- Appends
CHANGELOG.mdcontent (if present).
- Creates
- Copies
src/modules/<module>/assetstodocs/pages/modules/<module>/assets. - Rebuilds
docs/pages/modules/index.mdas a generated modules table. - Rewrites
docs/_data/sidebar.ymlfor the docs navigation structure.
Important behavior details:
- README placeholders of
{DOCS_BASEURL}are replaced during generation. - Modules without
README.mdstill appear in the modules table, but without a link. docs/pages/modules/index.mdis generated output and should not be treated as hand-authored content.
GitHub Actions Involved
Documentation and Site Publishing
Workflow file: .github/workflows/documentation.yml
Trigger:
- Push to
mainfor docs, storybook, core client component/story paths, andsrc/modules/**/*.md.
Jobs:
codespell: checks spelling indocs.storybook: builds Storybook fromsrc/clientand uploads it as an artifact.pages:- downloads the Storybook artifact,
- copies it to
docs/storybook, - runs
node docs/scripts/generateModules.js, - builds the Jekyll site,
- uploads the Pages artifact.
deploy: deploys the Pages artifact to GitHub Pages.
This means module docs are regenerated at publish time, not manually curated in docs/pages/modules.
Version and Changelog Automation
Workflow file: .github/workflows/versioning.yml
Trigger:
- Push to
mainforsrc/server/**,src/client/**, andsrc/modules/**.
Scripts:
.github/scripts/updateModules.js.github/scripts/updateApp.js
updateModules.js behavior:
- Scans commits per module path.
- Accepts module commits in the format:
[module-name] message
- Deduplicates by changelog description.
- Bumps patch version in
src/modules/<module>/module.json. - Prepends a new section in
src/modules/<module>/CHANGELOG.mdwith commit links.
updateApp.js behavior (non-module/app-wide):
- Accepts commit messages in this format:
[app] message
[app][breaking] message
- Updates root
CHANGELOG.md. - Bumps root and client package versions (
package.jsonandsrc/client/package.json). - Creates and pushes a git tag for the new app version.
Practical Flow for Module Authors
When documenting or changing a module, the typical flow is:
- Update
src/modules/<module>/README.mdand module assets. - Commit module code/docs changes with module-prefixed commit messages, e.g.
[bmd-videohub] improve lock status docs. - Merge to
main. - Versioning workflow updates
module.jsonandCHANGELOG.md. - Documentation workflow regenerates module pages and deploys GitHub Pages.
For local verification before pushing:
npm ci
node docs/scripts/generateModules.js
Then inspect docs/pages/modules/index.md and generated module pages.
Maintenance Notes
- Treat module
README.mdas the primary authored documentation. - Keep module commit messages consistent with
[module-name] ...so changelog/version automation works. - Avoid hand-editing generated module output unless debugging the generator itself.