How jdf2e/nutui-react works
Primary components
• Monorepo Structure & Package Management – Show the central role of the pnpm-workspace that manages multiple packages (each UI component, tooling, codemod, and demo) under the “packages” directory.
• UI Component Library – Represent the individual UI component packages (e.g., button, cell, dialog, calendar, etc.) and note that each of these contains its own source, tests, documentation, styling (SCSS), and Taro-specific versions.
• Demo & Example Applications – Include the “src/sites” folder and the “packages/nutui-taro-demo” as distinct demo applications which showcase the components in H5 and mini-program contexts. In addition, note the “nutui-templates” subfolders that provide starter projects (create-app-demo, next-demo, vite-demo, with-rsbuild).
• Testing & Quality Assurance – Show the integrated test infrastructure (all the “__tests__” and snapshot directories, Vitest and commitlint configurations) that ensure high coverage (90%+ unit test coverage).
• Utility & Style System – Mark the “src/utils” and “src/styles” directories as key support areas for shared functions (such as event handling, hooks, merging props, etc.) and styling (global SCSS themes, typography, animations, etc.).
• Documentation & Site – Represent the “src/sites” folder which contains separate demos, docs, themes, and configuration for both mobile and desktop demo sites. These serve as live example apps and documentation resources for users.
Interactions and relationships
• Many components have parallel implementations (e.g., standard React and Taro versions) – connect these to a common “Component Library” block.
• CI/CD workflows (shown in the .github folder) continuously test, build, and deploy the library. Represent these as an external process linking the repository (via GitHub Actions) to the publishing process.
Architectural patterns & design principles
• Modular Architecture – Emphasize the use of a monorepo with clear separation between UI components, utility libraries, demos, and build configuration.
• Code Reusability & Custom Theming – Show that shared styles, utilities, and theming solutions are centralized in “src/styles” and “src/utils”.
• Testing & Continuous Integration – Highlight that every component includes its own set of tests and that CI pipelines (GitHub Workflows) are critical to the project’s health.