Vite React Library Starter is a boilerplate for building and publishing React component libraries. It leverages modern tooling, including Vite for bundling, TypeScript for type safety, Tailwind CSS for styling, and Storybook for documentation. This starter kit provides a streamlined development experience with built-in linting, formatting, and unit testing.
Clone the repository and install dependencies:
git clone https://github.com/your-repo/vite-react-library-starter.git
cd vite-react-library-starter
npm install
To start Storybook for interactive component documentation:
npm run storybook
Build the component library for distribution:
npm run build
Run unit tests with Vitest:
npm test
To watch tests:
npm run test:watch
Lint and format code using ESLint and Prettier:
npm run lint
npm run format
To remove generated files:
npm run clean
├── src/ # Component source code
│ ├── components/ # React components
│ ├── hooks/ # Custom hooks (if any)
│ ├── utils/ # Utility functions
│ ├── index.ts # Library entry point
├── .storybook/ # Storybook configuration
├── tests/ # Unit tests
├── dist/ # Compiled library output
├── package.json # Project metadata and scripts
└── README.md # Documentation
Ensure the package is built before publishing:
npm run build
npm publish
This project is licensed under the MIT License.