Contributing
Thanks for your interest in contributing to @lonewolfyx/vue-hooks!
Development Setup
- Fork and clone the repository:
bash
git clone https://github.com/lonewolfyx/vue-hooks.git
cd vue-hooks- Install dependencies:
bash
pnpm install- Start the development build:
bash
pnpm devCommands
| Command | Description |
|---|---|
pnpm dev | Start the library in watch mode |
pnpm build | Build the library |
pnpm test | Run tests |
pnpm lint | Run ESLint |
pnpm lint:fix | Run ESLint with auto-fix |
pnpm docs:dev | Start the documentation dev server |
pnpm docs:build | Build the documentation |
Adding a New Hook
- Create a new directory under
src/(e.g.,src/my-hook/) - Add your hook implementation and tests
- Export from
src/index.ts - Add documentation under
docs/hooks/ - Update
docs/.vitepress/config.tsto include the new hook in the sidebar
Commit Convention
This project uses Conventional Commits. Commit messages are validated automatically.
Examples:
feat: add useToggle hook
fix: correct createContext fallback behavior
docs: update installation guide
test: add tests for createContext null handlingCode Style
This project uses @antfu/eslint-config with:
- 4-space indentation
- Single quotes
- TypeScript enabled
Run pnpm lint:fix to auto-format your code.