Thanks for your interest in contributing to hookagain! Please take a moment to review this document before submitting a pull request.
hookagain is a collection of reusable React hooks that can be installed using the shadcn CLI.
To develop hookagain locally:
- Fork this repository
- Clone your fork
- Create a new branch
- Run
pnpm install
to install dependencies - Run
pnpm dev
to start the development server
/app
- Next.js app/components
- React components used in the docs/content
- MDX documentation/hooks
- React hooks/lib
- Utility functions/public
- Static assets/registry
- Hook registry and schemas/scripts
- Build and utility scripts
- Create a new hook file in
/registry/hooks/use-[name].ts
- Add hook documentation in
/content/docs/(hooks)/use-[name].mdx
- Add the hook to
/registry/registry-hooks.ts
- Run
pnpm build:registry
to update the registry
- Keep hooks focused and single-purpose
- Include TypeScript types
- Follow React hooks best practices
- Include error handling where appropriate
- Keep dependencies minimal
- Include a clear description
- Provide installation instructions using the
<ComponentInstall />
component - Show practical usage examples
- Create a new branch from
main
- Keep changes focused and atomic
- Add tests if applicable
- Update documentation as needed
- Run
pnpm lint
to check for code style issues - Ensure all tests pass
- Submit a pull request
pnpm dev
- Start development serverpnpm build
- Build for productionpnpm build:registry
- Update hook registrypnpm lint
- Check code stylepnpm start
- Start production server
- Open a discussion for questions
- Open an issue for bugs
- Submit a pull request with improvements
By contributing to hookagain, you agree that your contributions will be licensed under its MIT license.