# bedrock-apis/bds-docs architecture

> Architecture diagram of the GitHub repository bedrock-apis/bds-docs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bedrock-apis/bds-docs
- Repository: https://github.com/bedrock-apis/bds-docs

## Overview

This is a Bedrock documentation generator. Its main workflow prepares a Bedrock Dedicated Server installation, runs generators to collect and normalize documentation, then derives TypeScript declarations from script-module metadata and publishes generated files to version branches. The README also documents module mappings and block data as generator capabilities, but their implementation is not present in the sampled source; those branches are shown as documented, unverified stages. GitHub publishing is conditional on running in GitHub Actions.

Main entry points: [`modules/main.ts`](https://github.com/bedrock-apis/bds-docs/blob/main/modules/main.ts) (Generator runner), [`modules/dump-types/index.ts`](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/index.ts) (Declaration dumper), [`modules/dump-metadata/index.ts`](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-metadata/index.ts) (Metadata dumper), [`modules/utils/github.ts`](https://github.com/bedrock-apis/bds-docs/blob/main/modules/utils/github.ts) (GitHub branch operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Generation orchestration"]
  node_runner["Generator runner<br/>[main.ts]"]
  node_bds_release["BDS release lookup"]
  node_server_install["Server installation"]
  node_dumper_contract["Dumper contract<br/>[dumper.ts]"]
end

subgraph group_metadata["Metadata generation"]
  node_metadata_dumper["Metadata dumper<br/>[index.ts]"]
  node_metadata_files["Normalized metadata<br/>[index.ts]"]
  node_file_iterator["Recursive file reader<br/>[io.ts]"]
  node_mapping_generation["Module mapping"]
  node_block_generation["Block data"]
end

subgraph group_types["Declaration generation"]
  node_script_metadata["Script module schema"]
  node_type_dumper["Declaration dumper<br/>[index.ts]"]
  node_type_printer["TypeScript printer<br/>[printer.ts]"]
  node_declaration_files["Type declarations<br/>[index.ts]"]
end

subgraph group_publishing["Version publishing"]
  node_exist_manifest["Version manifest<br/>[exist.json]"]
  node_github_utils["GitHub branch operations<br/>[github.ts]"]
end

node_github[("GitHub repository")]
node_operator(("Generator operator"))

node_operator -->|"starts"| node_runner
node_runner -->|"prepares branch"| node_github_utils
node_runner -->|"looks up release"| node_bds_release
node_runner -->|"installs or loads"| node_server_install
node_runner -->|"runs dumpers"| node_dumper_contract
node_runner -->|"initializes and runs"| node_metadata_dumper
node_runner -->|"initializes and runs"| node_type_dumper
node_metadata_dumper -->|"runs server"| node_server_install
node_metadata_dumper -->|"enumerates docs"| node_file_iterator
node_metadata_dumper -->|"normalizes and writes"| node_metadata_files
node_type_dumper -->|"enumerates modules"| node_file_iterator
node_type_dumper -->|"reads script metadata"| node_metadata_files
node_type_dumper -->|"parses as schema"| node_script_metadata
node_type_dumper -->|"prints declarations"| node_type_printer
node_type_dumper -->|"writes"| node_declaration_files
node_type_printer -->|"uses definitions"| node_script_metadata
node_runner -->|"writes version"| node_exist_manifest
node_runner -->|"publishes generated files"| node_github_utils
node_github_utils -->|"pushes branches"| node_github
node_runner -.->|"generates mapping"| node_mapping_generation
node_runner -.->|"generates block data"| node_block_generation

click node_runner "https://github.com/bedrock-apis/bds-docs/blob/main/modules/main.ts"
click node_dumper_contract "https://github.com/bedrock-apis/bds-docs/blob/main/modules/dumper.ts"
click node_metadata_dumper "https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-metadata/index.ts"
click node_metadata_files "https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-metadata/index.ts"
click node_file_iterator "https://github.com/bedrock-apis/bds-docs/blob/main/modules/utils/io.ts"
click node_script_metadata "https://github.com/bedrock-apis/bds-docs/blob/main/modules/script-module-metadata.ts"
click node_type_dumper "https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/index.ts"
click node_type_printer "https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/printer.ts"
click node_declaration_files "https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/index.ts"
click node_mapping_generation "https://github.com/bedrock-apis/bds-docs/tree/main/modules"
click node_block_generation "https://github.com/bedrock-apis/bds-docs/tree/main/modules"
click node_exist_manifest "https://github.com/bedrock-apis/bds-docs/blob/main/exist.json"
click node_github_utils "https://github.com/bedrock-apis/bds-docs/blob/main/modules/utils/github.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_bds_release,node_server_install,node_dumper_contract toneBlue
class node_metadata_dumper,node_metadata_files,node_file_iterator,node_mapping_generation,node_block_generation,node_github toneAmber
class node_script_metadata,node_type_dumper,node_type_printer,node_declaration_files toneMint
class node_exist_manifest,node_github_utils toneRose
class node_operator toneIndigo
```

## Components

### Generation orchestration

- [Generator runner](https://github.com/bedrock-apis/bds-docs/blob/main/modules/main.ts): `modules/main.ts`
- **BDS release lookup**
- **Server installation**
- [Dumper contract](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dumper.ts): `modules/dumper.ts`

### Metadata generation

- [Metadata dumper](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-metadata/index.ts): `modules/dump-metadata/index.ts`
- [Normalized metadata](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-metadata/index.ts): `modules/dump-metadata/index.ts`
- [Recursive file reader](https://github.com/bedrock-apis/bds-docs/blob/main/modules/utils/io.ts): `modules/utils/io.ts`
- [Module mapping](https://github.com/bedrock-apis/bds-docs/tree/main/modules): `modules`
- [Block data](https://github.com/bedrock-apis/bds-docs/tree/main/modules): `modules`

### Declaration generation

- [Script module schema](https://github.com/bedrock-apis/bds-docs/blob/main/modules/script-module-metadata.ts): `modules/script-module-metadata.ts`
- [Declaration dumper](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/index.ts): `modules/dump-types/index.ts`
- [TypeScript printer](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/printer.ts): `modules/dump-types/printer.ts`
- [Type declarations](https://github.com/bedrock-apis/bds-docs/blob/main/modules/dump-types/index.ts): `modules/dump-types/index.ts`

### Version publishing

- [Version manifest](https://github.com/bedrock-apis/bds-docs/blob/main/exist.json): `exist.json`
- [GitHub branch operations](https://github.com/bedrock-apis/bds-docs/blob/main/modules/utils/github.ts): `modules/utils/github.ts`

### Other components

- **GitHub repository**
- **Generator operator**

## Connections

- Generator operator → Generator runner: starts (evidence: `modules/main.ts`)
- Generator runner → GitHub branch operations: prepares branch (evidence: `modules/main.ts`)
- Generator runner → BDS release lookup: looks up release (evidence: `modules/main.ts`)
- Generator runner → Server installation: installs or loads (evidence: `modules/main.ts`)
- Generator runner → Dumper contract: runs dumpers (evidence: `modules/main.ts`)
- Generator runner → Metadata dumper: initializes and runs (evidence: `modules/main.ts`)
- Generator runner → Declaration dumper: initializes and runs (evidence: `modules/main.ts`)
- Metadata dumper → Server installation: runs server (evidence: `modules/dump-metadata/index.ts`)
- Metadata dumper → Recursive file reader: enumerates docs (evidence: `modules/dump-metadata/index.ts`)
- Metadata dumper → Normalized metadata: normalizes and writes (evidence: `modules/dump-metadata/index.ts`)
- Declaration dumper → Recursive file reader: enumerates modules (evidence: `modules/dump-types/index.ts`)
- Declaration dumper → Normalized metadata: reads script metadata (evidence: `modules/dump-types/index.ts`)
- Declaration dumper → Script module schema: parses as schema (evidence: `modules/dump-types/index.ts`)
- Declaration dumper → TypeScript printer: prints declarations (evidence: `modules/dump-types/index.ts`)
- Declaration dumper → Type declarations: writes (evidence: `modules/dump-types/index.ts`)
- TypeScript printer → Script module schema: uses definitions (evidence: `modules/dump-types/printer.ts`)
- Generator runner → Version manifest: writes version (evidence: `modules/main.ts`)
- Generator runner → GitHub branch operations: publishes generated files (evidence: `modules/main.ts`)
- GitHub branch operations → GitHub repository: pushes branches (evidence: `modules/utils/github.ts`)
- Generator runner → Module mapping: generates mapping (evidence: `README.md`)
- Generator runner → Block data: generates block data (evidence: `README.md`)
