forked from juliencrn/usehooks-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<img src="./screenshot.png" alt="usehooks-ts banner" align="center" /> | ||
<img src="./.github/screenshot.png" alt="usehooks-ts banner" align="center" /> | ||
|
||
<br /> | ||
|
||
|
@@ -89,7 +89,7 @@ If you need to make any other substantial changes, then follow the project setup | |
Before starting, make sure you have the good system dependencies: | ||
|
||
- `[email protected]` | ||
- `npm@^8` | ||
- `pnpm@^8` | ||
|
||
**Note**: To easily switch node version, consider Node Version Manager (nvm). | ||
|
||
|
@@ -98,37 +98,27 @@ Then fork the repository, clone it and install. | |
```bash | ||
git clone https://github.com/{your_username}/usehooks-ts.git | ||
cd usehooks-ts | ||
npm install | ||
pnpm install | ||
``` | ||
|
||
### Create or update a new hook | ||
|
||
```bash | ||
# This command generates boilerplate for new hooks. | ||
# Skip if updating an existed hook. | ||
npm run plop | ||
|
||
# Then develop the hook (aka test:watch) | ||
npm run dev | ||
|
||
# Once the hooks is ready | ||
# Launch the documentation website | ||
# Note: to build the website, you have to compile the usehooks-ts lib | ||
# first, which create website content in the `website/generated` folder, | ||
# used by Gatsby to create pages | ||
cd website | ||
npm install | ||
npm run start | ||
|
||
# Before commit: exec types-checking, linters and tests | ||
cd .. | ||
npm run test | ||
pnpm gen-hook | ||
|
||
# Develop | ||
pnpm build | ||
pnpm types-check | ||
pnpm lint | ||
pnpm test | ||
``` | ||
|
||
### How is structured a hook ? | ||
|
||
```bash | ||
📂 ./src | ||
📂 ./packages/usehooks-ts | ||
├── 📂 useHookName | ||
│ ├── 📄 useHookName.demo.tsx # working demo | ||
│ ├── 📝 useHookName.mdx # the documentation content | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters