- Bun v1.3.3 or higher
- Node.js v18 or higher (for compatibility)
- Git
Clone the repository and install dependencies:
git clone https://github.com/CROW-B3/ui-kit.git
cd ui-kit
bun installui-kit/
├── src/
│ ├── components/ # All UI components
│ ├── lib/ # Utility functions
│ ├── index.ts # Main exports
│ └── styles.css # Global styles
├── dist/ # Compiled output
├── docs/ # Documentation
├── package.json
├── tsconfig.json
└── README.md
Build the library for production:
bun run buildWatch mode for development:
bun run build:watchRun ESLint to check for code issues:
bun run lintAuto-fix linting issues:
bun run lint:fixFormat code with Prettier:
bun run formatThe project uses Husky for Git hooks:
- Pre-commit: Runs lint-staged to lint and format changed files
- Commit-msg: Validates commit messages using conventional commits
Hooks are automatically installed after running bun install.
- All components must be fully typed
- Export component prop types
- Use strict TypeScript configuration
- No
anytypes unless absolutely necessary
- Use Tailwind CSS utility classes
- Follow dark theme design system
- Use consistent spacing and sizing
- Prefer composition over configuration
import type { ComponentProps } from 'react';
export interface YourComponentProps {
// Props interface
required: string;
optional?: number;
}
export function YourComponent({ required, optional }: YourComponentProps) {
// Component implementation
return <div>{required}</div>;
}Follow Conventional Commits:
feat: add new component
fix: resolve animation bug
docs: update README
chore: bump dependencies
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringtest: Adding/updating testschore: Maintenance tasks
Link the package locally in a test project:
{
"dependencies": {
"@b3-crow/ui-kit": "file:../ui-kit"
}
}For Next.js projects, add to next.config.ts:
const nextConfig = {
transpilePackages: ['@b3-crow/ui-kit'],
};Test components in different scenarios:
- Dark backgrounds
- Light backgrounds
- Different viewport sizes
- Animation triggers
- Scroll behavior
Update version in package.json:
{
"version": "0.0.25"
}# Build the library
bun run build
# Publish to npm
npm publishThe project uses GitHub Actions for automated publishing:
- Pushes to
maintrigger automatic version bumps - Releases are created automatically
- Package is published to npm registry
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Commit using conventional commits
- Push to your fork
- Open a pull request
- All PRs require review before merging
- Ensure CI passes (linting, building)
- Update documentation if needed
- Add examples for new components
When adding a new component:
- Create component in
src/components/ - Export from
src/index.ts - Add TypeScript types
- Document in
docs/components.md - Add examples in
docs/examples.md - Test locally with a consumer project
- Update version in
package.json
TypeScript errors:
# Check TypeScript configuration
cat tsconfig.json
# Clean and rebuild
rm -rf dist
bun run buildMissing dependencies:
# Clean install
rm -rf node_modules bun.lock
bun installCannot resolve module:
- Ensure component is exported in
src/index.ts - Check
package.jsonexports field - Verify build output in
dist/
Type errors in consumer:
- Ensure
.d.tsfiles are generated - Check
typesfield inpackage.json - Rebuild the library
Module not found:
- Add package to
transpilePackagesinnext.config.ts - Clear Next.js cache:
rm -rf .next - Reinstall dependencies
Tailwind classes not working:
- Ensure consumer project has Tailwind configured
- Check PostCSS configuration
- Verify Tailwind v4 is installed
MIT License - see LICENSE file for details.