# mefengl/vscode-i-dont-care-about-commit-message architecture

> Architecture diagram of the GitHub repository mefengl/vscode-i-dont-care-about-commit-message, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mefengl/vscode-i-dont-care-about-commit-message
- Repository: https://github.com/mefengl/vscode-i-dont-care-about-commit-message

## Overview

##### Main Components

a) VSCode Extension Layer:
- Extension as the primary interface component
- Command palette integration points (`AI Git Commit` and `AI Git Push`)
- Settings/configuration management

b) Core Processing Layer:
- Main extension logic (from src/extension.ts)
- Internationalization system (i18n.ts)
- Pure functions module (pure.ts)

c) External Services Layer:
- OpenAI API integration
- Git integration (via Simple Git)

##### Component Relationships

**[VSCode Editor] → [Extension Commands]**
- ↓
**[Configuration] → [Core Logic] → [Git Operations]**
- ↓
- [OpenAI API]

##### Specific Elements

a) User Interface Components:
- Command Palette Triggers
- Settings Configuration Interface
- Status Bar Updates

b) Processing Components:
- Git Status Checker
- Diff Generator
- Commit Message Generator
- Push Handler

c) External Services:
- OpenAI API Client
- Git Command Interface

##### Important Architectural Aspects to Highlight

- The extension's event-driven architecture
- Clear separation between UI commands and core logic
- Internationalization system supporting 15 languages
- Configuration management for API keys and settings

##### Additional Details

Annotations for:
- Supported git operations (add, commit, push)
- OpenAI model options
- Conventional commits format support
- Language support system

##### Flow Patterns

Main operational flows:
##### Internationalization flow

Keep the abstraction level appropriate for a VSCode extension while ensuring all critical components and their interactions are visible. This will help developers understand both the high-level architecture and the specific implementation details.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph IDE["VSCode Environment"]
        CP["Command Palette"]
        SB["Status Bar"]
        UI["User Interface"]
    end

    subgraph Extension["Extension Layer"]
        CMD["Extension Commands"]
        CONF["Configuration Manager"]:::config
        VSET["VSCode Settings"]:::vscode
    end

    subgraph Core["Core Processing Layer"]
        EL["Extension Logic"]:::extension
        I18["Internationalization"]:::i18n
        PF["Pure Functions"]:::pure
        
        subgraph Handlers["Operation Handlers"]
            GS["Git Status Checker"]
            DG["Diff Generator"]
            CM["Commit Message Generator"]
            PH["Push Handler"]
        end
    end

    subgraph Lang["Language Support"]
        LF["Language Files"]:::lang
        ET["English Template"]:::engtemp
    end

    subgraph External["External Services"]
        OAI["OpenAI API"]
        GIT["Simple Git"]
    end

    subgraph Testing["Testing & CI"]
        TEST["Extension Tests"]:::test
        CI["CI Workflow"]:::ci
    end

    %% Relationships
    CP --> CMD
    UI --> CMD
    SB --> CMD
    
    CMD --> EL
    CONF --> EL
    VSET --> EL
    
    EL --> I18
    EL --> PF
    EL --> Handlers
    
    I18 --> LF
    LF --> ET
    
    Handlers --> OAI
    Handlers --> GIT

    %% Click Events
    click EL "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/src/extension.ts"
    click I18 "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/src/i18n.ts"
    click PF "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/src/pure.ts"
    click CONF "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/package.json"
    click LF "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/tree/main/locales/"
    click TEST "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/test/extension.test.ts"
    click CI "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/.github/workflows/ci.yml"
    click ET "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/blob/main/locales/en.json"
    click VSET "https://github.com/mefengl/vscode-i-dont-care-about-commit-message/tree/main/.vscode/"

    %% Styling
    classDef extension fill:#a8d5ff
    classDef i18n fill:#ffcca8
    classDef pure fill:#a8ffd5
    classDef config fill:#d5a8ff
    classDef lang fill:#ffffa8
    classDef engtemp fill:#ffd5a8
    classDef test fill:#d5ffa8
    classDef ci fill:#ffa8d5
    classDef vscode fill:#a8ffff

    %% Legend
    subgraph Legend
        L1["Extension Components"]:::extension
        L2["Internationalization"]:::i18n
        L3["Pure Functions"]:::pure
        L4["Configuration"]:::config
        L5["Language Support"]:::lang
        L6["Testing & CI"]:::ci
        L7["VSCode Integration"]:::vscode
    end
```
