Hi! We're really excited that you're interested in contributing to VueHooks Plus! Before submitting your contribution, please read through the following guide.
The VueHooks Plus repo is a monorepo using pnpm workspaces. The package manager used to install and link dependencies must be pnpm.
To develop and test the core VueHooks Plus
package:
-
Run
pnpm i
in VueHooks Plus's root folder. -
packages/hooks/src
folder add hook function. -
Export hook function from
packages/hooks/src/index.ts
. -
Run
pnpm test
in VueHooks Plus's root folder. -
Run
pnpm run build
in VueHooks Plus's root folder.
-
packages/hooks/src
folder adds a folder starting with anuseXxx
. -
Add
en-US.md
andzh-CN.md
as a document. -
Add
demo
folder as a document example. -
Add
__tests__
folder as Unit Tests. -
Import the hook file you created in
packages/hooks/src/index.ts
.
you can Run pnpm test
or pnpm test:ui
in VueHooks Plus's root folder.
Start documentation via Dev Document Guide.
-
Run
pnpm docs:dev
in VueHooks Plus's root folder or Runpnpm initial
andpnpm docs:dev
packages/hooks
folder. -
.md
must add a mapping path.
---
map:
# Path mapped to docs
path: /useBoolean
---
packages/hooks/docs/.vitepress/router.ts
add hooks router info.
-
Checkout a topic branch from a base branch (e.g.
master
), and merge back against that branch. -
If adding a new feature:
- Add accompanying test case.
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first, and have it approved before working on it.
- PR title
feat: xxxxx
-
If fixing a bug:
- If you are resolving a special issue, add
(fix #xxxx[,#xxxx])
(#xxxx is the issue id) in your PR title for a better release log (e.g.fix: update entities encoding/decoding (fix #3899)
). - Provide a detailed description of the bug in the PR. Live demo preferred.
- Add appropriate test coverage if applicable.
- If you are resolving a special issue, add
-
It's OK to have multiple small commits as you work on the PR. GitHub can automatically squash them before merging.
-
Commit template English
-
Make sure tests pass!
-
Select the corresponding template
-
Use either the 中文 or the English language