# インフラ構成図

## システム全体構成図

```mermaid
flowchart TB
    subgraph "開発者環境"
        DEV[開発者PC]
        subgraph "Docker"
            DC[Dev Container<br/>hhvm/hhvm:nightly]
        end
        DEV --> DC
    end

    subgraph "GitHub"
        GH_REPO[GitHub Repository<br/>hhvm/hsl]
        subgraph "GitHub Actions"
            GA_RUNNER[GitHub Actions Runner<br/>ubuntu-latest]
        end
        GH_REPO --> GA_RUNNER
    end

    subgraph "外部サービス"
        DOCKER_HUB[Docker Hub<br/>hhvm/hhvm:nightly]
    end

    DEV -->|push/PR| GH_REPO
    GA_RUNNER -->|pull image| DOCKER_HUB
    DC -->|pull image| DOCKER_HUB
```

## CI/CDパイプラインフロー

```mermaid
flowchart LR
    subgraph "トリガー"
        PUSH[Push]
        PR[Pull Request]
        CRON[Schedule<br/>毎日15:42 UTC]
    end

    subgraph "GitHub Actions"
        CHECKOUT[Checkout]
        INSTALL_HACK[Install HHVM/Hack<br/>nightly]
        INSTALL_WATCHMAN[Install Watchman]
        INSTALL_LOCALE[Install Locale Support]
        TYPECHECK[Type Check<br/>hh_client]
        TEST[Run Tests<br/>minitest.sh]
    end

    PUSH --> CHECKOUT
    PR --> CHECKOUT
    CRON --> CHECKOUT
    CHECKOUT --> INSTALL_HACK
    INSTALL_HACK --> INSTALL_WATCHMAN
    INSTALL_WATCHMAN --> INSTALL_LOCALE
    INSTALL_LOCALE --> TYPECHECK
    TYPECHECK --> TEST
```

## Dev Container構成図

```mermaid
flowchart TB
    subgraph "ホストマシン"
        VSCODE[VS Code]
        DOCKER_ENGINE[Docker Engine]
    end

    subgraph "Dev Container"
        HHVM[HHVM Runtime<br/>nightly]
        WATCHMAN[Watchman]
        LOCALE[Locale Packs<br/>en, fr, tr, da]
        HACK_EXT[VS Code Hack Extension]
    end

    VSCODE -->|Remote Connection| HACK_EXT
    DOCKER_ENGINE -->|run| HHVM
    HHVM --- WATCHMAN
    HHVM --- LOCALE
```

## プロジェクトディレクトリ構成

```mermaid
flowchart TB
    ROOT[hsl-main/]

    ROOT --> SRC[src/]
    ROOT --> TESTS[tests/]
    ROOT --> MINITEST[minitest/]
    ROOT --> GITHUB[.github/]
    ROOT --> DEVCONTAINER[.devcontainer/]
    ROOT --> DOCS[docs/]

    SRC --> ASYNC[async/]
    SRC --> C[c/]
    SRC --> DICT[dict/]
    SRC --> FILE[file/]
    SRC --> IO[io/]
    SRC --> KEYSET[keyset/]
    SRC --> LOCALE[locale/]
    SRC --> MATH[math/]
    SRC --> NETWORK[network/]
    SRC --> OS[os/]
    SRC --> RANDOM[random/]
    SRC --> REGEX[regex/]
    SRC --> STR[str/]
    SRC --> TCP[tcp/]
    SRC --> UNIX[unix/]
    SRC --> VEC[vec/]

    GITHUB --> WORKFLOWS[workflows/<br/>build-and-test.yml]
    DEVCONTAINER --> DEVJSON[devcontainer.json]
```

## ビルドマトリックス構成

```mermaid
flowchart LR
    subgraph "マトリックス構成"
        OS[OS: ubuntu-latest]
        HHVM_VER[HHVM: nightly]
    end

    subgraph "実行環境"
        RUNNER[GitHub Actions Runner]
    end

    OS --> RUNNER
    HHVM_VER --> RUNNER
```
