Thanks for your interest in contributing to useWallet! Please take a moment to review this document before submitting a pull request.
If you want to contribute, but aren't sure where to start, you can create a new discussion.
Note
Please ask first before starting work on any significant new features. This includes things like adding new connectors, hooks, chains, API providers, etc.
It's never a fun experience to have your pull request declined after investing time and effort into a new feature. To avoid this from happening, we request that contributors create a feature request to first discuss any API changes or significant new ideas.
This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.
To start contributing to the project, clone it to your local machine using git:
git clone https://github.com/CasperDash/useWallet --recurse-submodulesOr the GitHub CLI:
gh repo clone CasperDash/useWallet -- --recurse-submodulesuseWallet uses pnpm workspaces to manage multiple projects. You need to install Node.js v16 or higher and pnpm v7 or higher.
You can run the following commands in your terminal to check your local Node.js and npm versions:
node -v
pnpm -vIf the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:
- Install Node.js using fnm or from the official website
- Install pnpm
Once in the project's root directory, run the following command to install the project's dependencies:
pnpm installAfter the install completes, pnpm links packages across the project for development and git hooks are set up.
To start the local development playground, run the following. This will run a Next.js app (located at examples/example-react) that is set up for playing around with code while making changes.
pnpm playOnce the Next.js dev server is running, you can make changes to any of the package source files (e.g. packages/react) and it will automatically update the playground. (If the playground isn't automatically updating, try running pnpm dev to relink packages in development mode.)
Next, in a different terminal session, you have the following options for running tests:
pnpm test— runs tests in watch modepnpm test:run— performs single run without watch mode
When adding new features or fixing bugs, it's important to add test cases to cover the new/updated behavior.
Documentation is crucial to helping developers of all experience levels use useWallet. useWallet uses Nextra and MDX for the documentation site (located at docs). To start the site in dev mode, run:
pnpm docs:devTry to keep documentation brief and use plain language so folks of all experience levels can understand. If you think something is unclear or could be explained better, you are welcome to open a pull request.
When you're ready to submit a pull request, you can follow these naming conventions:
- Pull request titles use the Imperative Mood (e.g.,
Add something,Fix something). - Changesets use past tense verbs (e.g.,
Added something,Fixed something).
When you submit a pull request, GitHub will automatically lint, build, and test your changes. If you see an ❌, it's most likely a bug in your code. Please, inspect the logs through the GitHub UI to find the cause.