How douyinfe/semi-design works
This project is a large-scale monorepo for Semi‑UI – a modern design system and comprehensive React component library that connects design with development. Its architecture is split into multiple packages (via a Lerna-managed monorepo), a documentation and demo site, and various tooling integrations (testing, build scripts, Storybook, Figma integration, etc).
Overview and layers
• At the top level, identify the “Design System” and “Component Library” domain. Highlight that the project supports both design tokens (DSM), design-to-code, and extensive testing/devops capabilities.
Main components
a. Core UI Libraries and Foundations:
• “semi-ui”: The main component library containing the React components and their demos.
• “semi-foundation”: Provides design tokens, CSS/SCSS styling foundations, theming and variables used by many components.
• “semi-animation” (including its variants such as semi-animation-react and semi-animation-styled): These packages give the library its animation features.
b. Tooling & Build Ecosystem:
• Other packages such as “semi-eslint-plugin”, “semi-rspack”, “semi-scss-compile”, and “semi-webpack”. These encapsulate build configuration, linting, CSS compilation and bundling solutions.
• Utility packages like “semi-json-viewer-core” provide specific functionality.
c. Documentation & Demos:
• The “src” folder contains documentation, demo pages (using Gatsby) and live examples.
• Storybook configuration (in .storybook) and codesandbox examples to show interactive component demos.
d. Testing and CI/CD:
• Directories for Jest tests, Cypress end-to-end testing (cypress/), and GitHub workflow configurations.
• Tools like Chromatic are integrated for visual regression testing.
e. External Integration:
• Figma plugin for design‑to‑code and DSM support.
• References to design token tools and external testing platforms (Cypress, Chromatic).
• The site’s pages (Gatsby) for documentation and component demos.
Establish the relationships and interactions
• The “semi-ui” library depends on “semi-foundation” for consistent styling and theming.
• The animation packages provide effect modules that can be optionally used by UI components.
• Build and tooling packages (eslint plugin, webpack, scss-compile) are integrated into the CI/CD pipelines and the overall development workflow (as seen via the GitHub workflows, lerna.json, and build scripts).
• The Demo Website (using Gatsby in the src folder) connects to all component packages; it also interacts with the design system documentation and live example demos.
• External testing platforms (Chromatic, Cypress) operate on the built artifacts from several packages.