# bridge-core/build-mc-project architecture

> Architecture diagram of the GitHub repository bridge-core/build-mc-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bridge-core/build-mc-project
- Repository: https://github.com/bridge-core/build-mc-project

## Overview

##### Project type and purpose
- This is an open-source GitHub Action (“build-mc-project”) designed to automate the build of a Minecraft project (using Dash compiler plugins) and attach the resulting package as a GitHub release artifact.
- Key indicators: the presence of `action.yml`, GitHub‐Actions‐style inputs in the README, and a reference to a “release” trigger.

##### File structure
- Top level:
- LICENSE – license for the action
- README.md – usage guide & example workflow
- action.yml – action metadata (inputs, outputs, runtime)
- No `src/` folder is shown in the file tree, so the action logic is either embedded directly or located beneath (omitted here).
- No other configuration/build scripts at top level, aside from compiler‐config examples in the README.

##### README for additional insights
- Describes how to configure a Dash compiler with a chain of plugins, culminating in `rewriteForPackaging`.
- Shows an example GitHub workflow with three steps: checkout, build-mc-project, and release.
- Shows that the action accepts three inputs: `project-name`, `package-type`, and `compiler-config`.

##### Components
a. Main components
- GitHub Platform
- Release Event (trigger)
- GitHub Actions Runner (ubuntu-latest)
- Workflow Steps
1. actions/checkout@v2
2. build-mc-project Action
– Loads user inputs
– Invokes Dash compiler CLI + plugin chain
3. softprops/action-gh-release@v1
- Dash Compiler & Plugins
- typescript plugin, entityIdentifierAlias, customEntityComponents, …, rewriteForPackaging
- Output Artifact
- `.mctemplate` / `.mcaddon` / `.mcworld` file
- GitHub Release API (to attach artifact)

b. Relationships & data flow
1. User creates a GitHub Release → GitHub emits a `release` event
2. Runner starts the workflow → checks out the user’s repository
3. build-mc-project action reads `compiler-config`, calls Dash CLI with plugin chain
4. Dash compiler produces the packaged artifact in the runner workspace
5. softprops/action-gh-release uploads the artifact back to GitHub Release

c. Architectural patterns & design principles
- Event‐driven pipeline (GitHub release event → modular steps)
- Single-purpose, composable steps (checkout, build, publish)
- Configuration‐driven behavior via action inputs & external compiler config

d. Relevant technologies/frameworks
- GitHub Actions (YAML workflows)
- Node.js or Docker action (inferred from action.yml runtime)
- Dash compiler & its plugin ecosystem
- GitHub Release API

##### Essential architectural elements to capture
- Trigger mechanism (release event)
- Action inputs & configuration file location
- The build action’s dependency on Dash compiler plugin chain
- The final artifact generation and publishing step
- Clear separation between GitHub infrastructure, the runner environment, and external tooling

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "GitHub Platform"
        Release["Release Event"]:::github
        Runner["GitHub Actions Runner\n(ubuntu-latest)"]:::github
    end
    Release --> Runner
    Runner --> Checkout["actions/checkout@v2"]:::github
    Checkout --> Build["build-mc-project Action"]:::user
    Build -->|"reads inputs"| Config["Action Inputs\n(project-name, package-type,\ncompiler-config)"]:::config
    Build --> CLI["Dash Compiler CLI + Plugin Chain"]:::external
    CLI --> Artifact["Packaged Artifact\n(.mctemplate/.mcaddon/.mcworld)"]:::user
    Artifact --> Publish["softprops/action-gh-release@v1"]:::github
    Publish --> ReleaseAPI["GitHub Release API"]:::external

    subgraph "Documentation"
        README["Usage Guide & Example Workflow"]:::user
        License["Action License"]:::user
    end
    Documentation -.-> Build

    click Build "https://github.com/bridge-core/build-mc-project/blob/main/action.yml"
    click README "https://github.com/bridge-core/build-mc-project/blob/main/README.md"
    click License "https://github.com/bridge-core/build-mc-project/tree/main/LICENSE"

    classDef github fill:#cce5ff,stroke:#004085,color:#004085;
    classDef user fill:#d4edda,stroke:#155724,color:#155724;
    classDef external fill:#ffe5b4,stroke:#ff8c00,color:#ff8c00;
    classDef config fill:#f0f0f0,stroke-dasharray:5 5,color:#2d572c;
```
