1.0.4 ⢠Published 1 year ago
@devtostes/design-system-test v1.0.4
React Design System
A modern React component library built with Vite, TypeScript, Tailwind CSS, and shadcn/ui. This project implements Atomic Design principles and includes comprehensive testing and documentation.
š Technologies
- Vite: Lightning fast build tool and dev server
- React 18: Modern UI development
- TypeScript: Type safety and better developer experience
- Tailwind CSS: Utility-first CSS framework
- shadcn/ui: Beautifully designed components
- Storybook: Component documentation and testing
- Vitest: Unit testing with coverage reports
- Testing Library: React component testing
š Project Structure
src/
āāā components/
ā āāā atoms/ # Basic building blocks (buttons, inputs)
ā āāā molecules/ # Simple combinations of atoms
ā āāā organisms/ # Complex combinations of molecules
ā āāā templates/ # Page layouts
ā āāā ui/ # shadcn/ui components
āāā lib/ # Utilities and helpers
āāā pages/ # Application pages
āāā styles/ # Global styles
āāā test/ # Test setup and utilitiesš ļø Scripts
"scripts": {
"dev": "Start development server",
"build": "Build for production",
"test": "Run tests with coverage",
"storybook": "Start Storybook development server",
"build-storybook": "Build Storybook for deployment",
"prepare": "Build types and bundle",
"release": "Build and publish to npm"
}šØ Atomic Design
This project follows Atomic Design methodology:
- Atoms: Basic UI components like buttons and inputs
- Molecules: Simple component combinations (e.g., search bar)
- Organisms: Complex UI sections (e.g., header)
- Templates: Page layouts and structure
- Pages: Complete page implementations
š Component Documentation
Components are documented using Storybook. Each component includes:
- Interactive examples
- Props documentation
- Different variants/states
- Responsive design previews
To view the documentation:
npm run storybookā Testing
The project uses Vitest and Testing Library for comprehensive testing:
- Unit tests for components
- Integration tests for pages
- 80% minimum coverage requirement
- Snapshot testing
Run tests with:
npm testšÆ Code Coverage
Current test coverage:
- Statements: 100%
- Branches: 100%
- Functions: 100%
- Lines: 100%
š§ Configuration
Vite
typescript:vite.config.tsTailwind
json:tsconfig.app.jsonTypeScript
json:tsconfig.app.jsonš¦ Installation
Install dependencies
npm install
Start development server
npm run dev
Build for production
npm run build
š¤ Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
š License
MIT License - see the LICENSE file for details.