How pawankolhe/bold-ui works
Project Root & Monorepo Structure
• Overall monorepo that uses pnpm as the package manager.
• Two main packages: “packages/react” (the component library) and “packages/website” (the demo/documentation site).
Component Library (packages/react)
a. src/components – This is the heart of the library. Inside, each component (Avatar, Button, Checkbox, Drawer, Grid, Input, Modal, Radio, Stack, etc.) is organized into its own folder, typically containing the main component file (tsx), stories (for Storybook), styles (SCSS modules), type definitions, and utility files.
b. Plop Templates – Represent the “plop-templates” directory as an automated code generation tool for creating new components.
c. Rollup Configuration – Include “rollup.config.mjs” and the “rollup-plugin” folder that indicate how the library is bundled for distribution.
d. Storybook Integration – Emphasize the “.storybook” folder which provides a configuration for previewing and testing UI components.
e. Context, Hooks, Utils, Constants, and Types – Show these as supporting modules that play a significant role in shared functionality (e.g., “ThemeContext”, custom hooks, utility functions, common constants).
Demo Website (packages/website)
• A separate module representing the Next.js based website.
• That this package has its own configuration files (e.g., next.config.js, tsconfig.json) and a structured “pages” directory for routing.
• That it likely serves as both documentation and live demo (with Storybook embedded or linked) of the Bold UI components.
Interactions and Data Flow
• Development workflow where “pnpm” commands (install, dev, generate) trigger changes in the component library that subsequently update the live documentation/demo.
Technological & Architectural Patterns
• Modular architecture: The monorepo is clearly separated into multiple packages sharing a common codebase.
• Component-based approach: Each UI component is isolated in its own directory with encapsulated styles, stories, and types.
• Automated scaffolding: Use of plop templates for consistent component generation.
• Bundling & Transpilation: Use of Rollup for bundling the React library.
• Storybook for isolated component development and documentation.
• Next.js framework for the website integration.