# zuoqiu-yingyi/siyuan-packages-monorepo architecture

> Architecture diagram of the GitHub repository zuoqiu-yingyi/siyuan-packages-monorepo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zuoqiu-yingyi/siyuan-packages-monorepo
- Repository: https://github.com/zuoqiu-yingyi/siyuan-packages-monorepo

## Overview

##### Main Components Identification

The system should be represented with these key components:
- Workspace Core
- Shared Packages
- Plugins
- Widgets
- Build & Development Tools

**┌─────────────────────────────────── Workspace ───────────────────────────────────┐**

- ┌─── Shared Packages ────┐  ┌──── Plugins ─────┐  ┌────── Widgets ─────────┐  │

- Components          ◄├──┤ - Custom Block   │  │ - Metadata Widget      │  │
- Arco              │  │ - Custom Fonts    │  └─────────────────────────┘  │
- SiYuan           ◄├──┤ - Inbox          │                               │
- Jupyter Client │  ┌────── Tools ────────────┐  │
- Types              ◄├──┤ - KeePass        │  │                         │  │
- Electron          │  │ - Monaco Editor  ◄├──┤ - ESLint Config        │  │
- SiYuan           │  │ - OpenAPI         │  │ - TSConfig             │  │
- OpenCC         │  │ - Build Scripts        │  │
- Utils             ◄├──┤ - Template        │  └─────────────────────────┘  │
- DOM              │  │ - Typewriter      │                               │
- Electron         │  │ - WakaTime        │                               │
- File System      │  │ - Webview         │                               │
- ┘  └───────────────────┘                               │

- ┘

##### Additional Details

- Package types and their purposes
- Dependency relationships
- Build/development workflow
- Shared resource utilization

##### Implementation Notes

- Maintain consistent styling and naming
- Version information where relevant
- Document cross-package dependencies

##### Documentation Integration

- Referenced in the main README
- Included in development documentation
- Updated with major architectural changes
- Used in onboarding materials

- The overall project structure
- How components interact
- Where to find specific functionality
- How to add new features/plugins
- The build and deployment process

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Workspace
        Core["Workspace Core"]
        
        subgraph Shared
            direction TB
            Components["Components"]
            Types["Types"]
            Utils["Utils"]
            
            subgraph ComponentsDetail
                direction TB
                Arco["Arco Components"]
                SiyuanComp["SiYuan Components"]
            end
            
            subgraph TypesDetail
                direction TB
                ElectronTypes["Electron Types"]
                SiyuanTypes["SiYuan Types"]
            end
            
            subgraph UtilsDetail
                direction TB
                DOMUtils["DOM Utils"]
                ElectronUtils["Electron Utils"]
                FileUtils["File System Utils"]
            end
            
            Components --> ComponentsDetail
            Types --> TypesDetail
            Utils --> UtilsDetail
        end
        
        subgraph Plugins
            direction TB
            CustomBlock["Custom Block"]
            CustomFonts["Custom Fonts"]
            Inbox["Inbox"]
            JupyterClient["Jupyter Client"]
            KeePass["KeePass"]
            MonacoEditor["Monaco Editor"]
            OpenAPI["OpenAPI"]
            OpenCC["OpenCC"]
            Template["Template"]
            Typewriter["Typewriter"]
            WakaTime["WakaTime"]
            Webview["Webview"]
        end
        
        subgraph Widgets
            MetadataWidget["Metadata Widget"]
        end
        
        subgraph Tools
            ESLintConfig["ESLint Config"]
            TSConfig["TSConfig"]
            BuildScripts["Build Scripts"]
        end
        
        Plugins --> Components
        Plugins --> Types
        Plugins --> Utils
        Widgets --> Components
        Tools --> Core
    end
    
    %% Click events for component mapping
    click Core "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/blob/main/workspace/package.json"
    click Components "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/components"
    click Arco "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/components/arco"
    click SiyuanComp "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/components/siyuan"
    click Types "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/types"
    click ElectronTypes "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/types/electron"
    click SiyuanTypes "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/types/siyuan"
    click Utils "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/utils"
    click DOMUtils "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/utils/dom"
    click ElectronUtils "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/utils/electron"
    click FileUtils "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/packages/utils/file"
    click CustomBlock "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/custom-block"
    click CustomFonts "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/custom-fonts"
    click Inbox "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/inbox"
    click JupyterClient "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/jupyter-client"
    click KeePass "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/keepass"
    click MonacoEditor "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/monaco-editor"
    click OpenAPI "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/open-api"
    click OpenCC "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/opencc"
    click Template "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/template"
    click Typewriter "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/typewriter"
    click WakaTime "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/wakatime"
    click Webview "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/plugins/webview"
    click MetadataWidget "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/widgets/metadata"
    click ESLintConfig "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/tools/eslint-config-custom"
    click TSConfig "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/tools/tsconfig"
    click BuildScripts "https://github.com/Zuoqiu-Yingyi/siyuan-packages-monorepo/tree/main/workspace/scripts"
    
    %% Styling
    classDef core fill:#f9f,stroke:#333,stroke-width:2px
    classDef shared fill:#bbf,stroke:#333
    classDef plugins fill:#bfb,stroke:#333
    classDef widgets fill:#fb8,stroke:#333
    classDef tools fill:#ddd,stroke:#333
    
    class Core core
    class Components,Types,Utils,Arco,SiyuanComp,ElectronTypes,SiyuanTypes,DOMUtils,ElectronUtils,FileUtils shared
    class CustomBlock,CustomFonts,Inbox,JupyterClient,KeePass,MonacoEditor,OpenAPI,OpenCC,Template,Typewriter,WakaTime,Webview plugins
    class MetadataWidget widgets
    class ESLintConfig,TSConfig,BuildScripts tools
```
