# bosssloth/steamtypes architecture

> Architecture diagram of the GitHub repository bosssloth/steamtypes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bosssloth/steamtypes
- Repository: https://github.com/bosssloth/steamtypes

## Overview

##### Main Components
- Type Definitions Module: Represented by the src/types directory where all the TypeScript definitions for SteamClient and its submodules (UI, System, etc.) reside.
- Automation Scripts: This includes the scripts/convert-to-typescript and scripts/compare directories. These scripts are responsible for converting runtime JS objects into TypeScript interfaces, comparing generated definitions, and validating type consistency.
- Testing Framework: The tests folder contains subdirectories for testing both the conversion and comparison processes. These tests ensure that changes in the runtime objects correctly reflect in the generated type definitions.
- CI/CD and Configuration: The .github/workflows (and other config files like package.json, tsconfig.json, etc.) represent integration with continuous integration processes and build/deployment configurations.

##### Relationships and Interactions
- Configuration/Utilities: Tools like ESLint (.eslint.config.mjs), Prettier (.prettierrc.json), and project configuration files (package.json, tsconfig.json) should be shown as supporting elements that ensure code quality and standard compliance but are not directly part of the type generation flow.

##### Architectural Patterns and Design Principles
- Extensibility: The design allows for easy extension of the type definitions since additional modules can be added under src/types without affecting the automation and testing scripts.

##### Additional Elements
- Details about technology usage:
- TypeScript as the primary language.
- That the project uses bun (and/or pnpm) for package management.
- References to configuration files that inform how scripts and tests are executed.
- Iterative development and validation feedback cycle that’s central to the project’s purpose.

## Diagram (Mermaid)

```mermaid
graph TD
    %% CI/CD & Configurations
    subgraph "CI/CD & Configurations"
        CI["CI/CD Workflow"] 
        subgraph "Project Configs"
            PKG["package.json"]
            TS_CONF["tsconfig.json"]
            ESLINT["ESLint Config"]
            PRETT["Prettier Config"]
        end
    end

    %% Automation Scripts
    subgraph "Automation Scripts"
        A1["Automation Scripts (Conversion)"]
        A2["Automation Scripts (Comparison)"]
    end

    %% Testing Suite
    subgraph "Testing Suite"
        T1["Testing Suite (Conversion)"]
        T2["Testing Suite (Comparison)"]
    end

    %% Type Definitions Library
    TD["Type Definitions (src/types)"]

    %% Arrows from CI/CD to Automation Scripts and Testing Suite
    CI --> A1
    CI --> A2
    CI --> T1
    CI --> T2

    %% Bidirectional relationships between Automation Scripts and Testing Suite
    A1 -->|"validate"| T1
    T1 -->|"feedback"| A1
    A2 -->|"validate"| T2
    T2 -->|"feedback"| A2

    %% Automation Scripts generate Type Definitions
    A1 -->|"generate"| TD
    A2 -->|"generate"| TD

    %% Styles
    classDef cicd fill:#fff2cc,stroke:#f1c232,stroke-width:2px,color:#000;
    classDef automation fill:#cfe2f3,stroke:#6fa8dc,stroke-width:2px,color:#000;
    classDef tests fill:#d9ead3,stroke:#6aa84f,stroke-width:2px,color:#000;
    classDef library fill:#f9e2d2,stroke:#e69138,stroke-width:2px,color:#000;

    class CI,PKG,TS_CONF,ESLINT,PRETT cicd;
    class A1,A2 automation;
    class T1,T2 tests;
    class TD library;

    %% Click Events
    click TD "https://github.com/bosssloth/steamtypes/tree/main/src/types"
    click A1 "https://github.com/bosssloth/steamtypes/tree/main/scripts/convert-to-typescript"
    click A2 "https://github.com/bosssloth/steamtypes/tree/main/scripts/compare"
    click T1 "https://github.com/bosssloth/steamtypes/tree/main/tests/convert"
    click T2 "https://github.com/bosssloth/steamtypes/tree/main/tests/compare"
    click CI "https://github.com/bosssloth/steamtypes/blob/main/.github/workflows/release.yml"
    click PKG "https://github.com/bosssloth/steamtypes/blob/main/package.json"
    click TS_CONF "https://github.com/bosssloth/steamtypes/blob/main/tsconfig.json"
    click ESLINT "https://github.com/bosssloth/steamtypes/blob/main/eslint.config.mjs"
    click PRETT "https://github.com/bosssloth/steamtypes/blob/main/.prettierrc.json"
```
