# tencent/tdesign-vue-next architecture

> Architecture diagram of the GitHub repository tencent/tdesign-vue-next, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tencent/tdesign-vue-next
- Repository: https://github.com/tencent/tdesign-vue-next

## Overview

##### Project type and purpose
- This is a monorepo for a Vue 3 UI component library (“tdesign-vue-next”) plus related supporting packages (hooks, shared utils, pro-components, chat plugin) and documentation/demo sites.
- Its purpose is to provide a high-quality, themable, tree-shakeable set of Vue components, plus related composables, utilities, and site generators.

##### File structure
- Top-level:
- pnpm-workspace.yaml, tsconfig.json, .github/workflows → define workspace and CI/CD.
- script/, internal/ → custom build & test tooling.
- packages/ → all published modules.
- packages/:
- components/ → the core Vue UI components (each in its own subfolder).
- hooks/ → reusable Vue 3 composables.
- shared/ → cross-package utility functions.
- pro-components/ → advanced “pro” level components (chat, etc.).
- tdesign-vue-next-chat & tdesign-vue-next → higher-level plugin packages and site demos.
- Config/build files: rollup.config.ts, babel.config.js, vite.config.ts inside site folders.

##### README
- Confirms it’s a Vue 3 UI component library.
- Mentions various bundles, tree-shaking, demos, starters, and installation via npm.
- Points to documentation sites for guidance.

##### Detail is key
- Layer and flow rather than lumping everything into one blob.
- If space allows, drill down one level in “packages/components” to illustrate the per-component convention (src, style, tests, examples).
- How internal scripts & configs (rollup.config.ts, babel.config.js) are used by all packages.

[Monorepo Root] → [Shared Utils] → [Hooks] → [Core Components] → [Pro & Chat Components] → [Library Bundles] → [Documentation Sites]

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Monorepo Root"
        Workspace["pnpm-workspace.yaml"]:::config
        CI[".github/workflows/"]:::config
        Scripts["script/"]:::tooling
        Internal["internal/"]:::tooling
    end

    subgraph "Packages"
        Shared["packages/shared/"]:::package
        Hooks["packages/hooks/"]:::package
        Components["packages/components/"]:::package
        Pro["packages/pro-components/"]:::package
        ChatPkg["packages/tdesign-vue-next-chat/"]:::package
        MainLib["packages/tdesign-vue-next/"]:::package
    end

    subgraph "Documentation & Demo Sites"
        SiteMain["packages/tdesign-vue-next/site/"]:::site
        SiteChat["packages/tdesign-vue-next-chat/site/"]:::site
    end

    Npm["npm registry"]:::external
    Tests["Test Suite (Jest/Vitest/Cypress)"]:::tooling
    Build["Rollup + Babel Build"]:::tooling
    Dist["dist outputs"]:::external
    Publish["npm publish"]:::tooling

    %% Dependency Flow
    Shared --> Hooks
    Shared --> Components
    Hooks --> Components
    Hooks --> Pro
    Components --> Pro
    Hooks --> ChatPkg
    Components --> ChatPkg
    Components --> MainLib
    Hooks --> MainLib

    %% Build Pipeline
    Scripts --> Build
    Internal --> Build
    CI --> Tests
    Tests --> Build
    Build --> Dist
    Build --> SiteMain
    Build --> SiteChat
    Build --> Publish
    Publish --> Npm

    %% Site Consumption
    Dist --> SiteMain
    Dist --> SiteChat

    %% Click Events
    click Workspace "https://github.com/tencent/tdesign-vue-next/blob/develop/pnpm-workspace.yaml"
    click CI "https://github.com/tencent/tdesign-vue-next/tree/develop/.github/workflows/"
    click Scripts "https://github.com/tencent/tdesign-vue-next/tree/develop/script/"
    click Internal "https://github.com/tencent/tdesign-vue-next/tree/develop/internal/"
    click Shared "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/shared/"
    click Hooks "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/hooks/"
    click Components "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/components/"
    click Pro "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/pro-components/"
    click ChatPkg "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/tdesign-vue-next-chat/"
    click MainLib "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/tdesign-vue-next/"
    click SiteMain "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/tdesign-vue-next/site/"
    click SiteChat "https://github.com/tencent/tdesign-vue-next/tree/develop/packages/tdesign-vue-next-chat/site/"

    classDef config fill:#fde2e2,stroke:#b02a37;
    classDef tooling fill:#e2f0cb,stroke:#587c0c;
    classDef package fill:#cfe2f3,stroke:#084b8a;
    classDef site fill:#fce5cd,stroke:#b45f06;
    classDef external fill:#fff2cc,stroke:#7f6000;
```
