Skip to content

Latest commit

Β 

History

History
69 lines (59 loc) Β· 3.7 KB

ARCHITECTURE.md

File metadata and controls

69 lines (59 loc) Β· 3.7 KB

πŸ“ Architecture

ATM follows a strict modular architecture where each extension is an independent module with its own core/ (business logic) and ui/ (presentation) layers.

src/
β”œβ”€β”€ extension.ts            ← Entry point
β”œβ”€β”€ extensions/
β”‚   β”œβ”€β”€ extensions.ts       ← Central registry
β”‚   β”œβ”€β”€ ai-data-id/         ← 🧠  AI data & consumption
β”‚   β”œβ”€β”€ code-spell/         ← πŸ”  Spell checker
β”‚   β”œβ”€β”€ color-box/          ← 🎨  Color decorations
β”‚   β”œβ”€β”€ color-debugging/    ← πŸ›  Debug colors
β”‚   β”œβ”€β”€ comments-code/      ← βœ…  TODO/FIXME indexer
β”‚   β”œβ”€β”€ env-lens/           ← πŸ”  Secure .env visibility
β”‚   β”œβ”€β”€ error-lens/         ← β›”  Inline diagnostics
β”‚   β”œβ”€β”€ git-better/         ← πŸ”—  Git blame + GitHub tools
β”‚   β”œβ”€β”€ image-preview/      ← πŸ–ΌοΈ  Gutter previews
β”‚   β”œβ”€β”€ markdown-mdx/       ← πŸ“  MDX support
β”‚   β”œβ”€β”€ markdown-md/        ← πŸ“„  Markdown preview enhancements
β”‚   β”œβ”€β”€ screenshot-code/    ← πŸ“Έ  Code screenshots
β”‚   β”œβ”€β”€ svg-better/         ← ⚑  SVG optimizer
β”‚   β”œβ”€β”€ translate-doc/      ← 🌐  Translation engine
β”‚   β”œβ”€β”€ version-package/    ← πŸ“¦  Dependency checker
β”‚   β”œβ”€β”€ voice-tts/          ← πŸ”Š  Text-to-speech
β”‚   └── shared/             ← πŸ› οΈ  Shared utilities & models
└── settings/
    β”œβ”€β”€ code/               ← Editor styling & coding enhancements
    β”‚   β”œβ”€β”€ auto-tag-x2/    ← 🏷️  Auto‑close/rename HTML/JSX tags
    β”‚   β”œβ”€β”€ color-bg-tag/   ← 🟩  HTML tag background colors
    β”‚   β”œβ”€β”€ copy-tag/       ← πŸ“‹  Copy highlight animations
    β”‚   └── line-bg-tag/    ← βž–  Current line styling
    └── native/             ← Native VS Code config overrides
        β”œβ”€β”€ breadcrumbs/    ← 🍞  Breadcrumbs navigation tweaks
        β”œβ”€β”€ cursor/         ← πŸ–±οΈ  Cursor animations & styles
        └── files/          ← πŸ“‚  File explorer configuration

🧠 System Workflow

The following diagram illustrates how the ATM toolkit is instantiated and how it handles dependencies internally without bloating the editor:

graph TD
    classDef core fill:#0a0a0a,stroke:#3b82f6,stroke-width:2px,color:#fff
    classDef registry fill:#1f2937,stroke:#10b981,stroke-width:2px,color:#fff
    classDef module fill:#374151,stroke:#6366f1,stroke-width:2px,color:#fff
    classDef settings fill:#374151,stroke:#f59e0b,stroke-width:2px,color:#fff

    A[ATM Core\nextension.ts]:::core --> B(Settings Engine\nsrc/settings):::settings
    A --> C(Extensions Registry\nsrc/extensions.ts):::registry
    
    B --> B1[Native Configs\nCursor, Files, Breadcrumbs]:::module
    B --> B2[Code Styling\nTags, Line BG, Copy]:::module
    
    C --> D1[Visual DX Tools\nErrorLens, ColorBox, ImagePreview]:::module
    C --> D2[AI & Intelligence\nTTS, Translator, AI Data]:::module
    C --> D3[Utility Mappers\nGitBetter, Markdown, SVG]:::module
    
    Z[shared\nShared Models/Utils]:::settings -.-> C
    Z -.-> D1
    Z -.-> D2
    Z -.-> D3
Loading

Key Highlights:

  • Lazy Loading & Performance: Through the extensions.ts central registry, each module manages its own subscription. Memory leaks are avoided by ensuring every module registers its disposables correctly.
  • Independent Modules: Extensions inside src/extensions don't depend on each other (with the exception of shared), which means a visual bug in color-box will never crash voice-tts.
  • Native Enhancements: The settings module actively rewrites workspace configurations to provide a "Cursor IDE-like" feeling immediately upon activation.