We are excited to have you contribute to the aa-sdk. Here's a step-by-step guide to help you get started.
-
Fork and Clone: First, fork the
aa-sdkrepository. Then, clone your forked repo to your local machine. -
Set Up Environment Variables: Create
.envfile in the root directory using the template.env.exampleand fill in the values with your Alchemy API key and Paymaster Policy ID where indicated. -
Install Dependencies: Ensure you have
yarninstalled (we use version 1.x). Installation instructions are available here. Runyarnin the project root to install all necessary dependencies. -
Testing Environment: Before making changes, make sure to verify the testing environment.
- Use the Node version specified in
package.json(currently 18.16.0). Runnode -vto check your version. - Build the project with
yarn build. - Run existing tests using
yarn test&yarn test:typecheckto ensure everything is working correctly.
- Use the Node version specified in
-
Make Changes: Now, you can start making changes to the packages or docs. When updating or adding new functionality, update or add a new doc in
site/packages/*corresponding to the package you have worked on to document the changes. -
Re-verify Tests: After making your changes, re-run
yarn test&yarn test:typecheckto ensure all tests still pass. -
Code Formatting:
- Format your code changes with
yarn run lint:write. - Confirm that your code passes format checks with
yarn run lint:check.
- Format your code changes with
-
Docs Changes:
- To run docs locally:
yarn docs:dev. - To build SDK docs:
yarn docs:sdk. - When editing or adding new docs, make sure you follow the docs contributing guidelines
- To run docs locally:
-
Committing Changes: Commit your changes using a standardized message format.
- Format:
[subject-type]: [description starting with lowercase letters] (#[issue number]). - For breaking changes, clearly reflect in your commit message (e.g.,
feat!: breaking change). - Example:
feat: add sanity check on provider connect for clearer error message (#181). - Example:
docs: add new section on gasless transactions (#189). - Use
git logto see more examples and acceptable subject-types. - For more details on semantic PR titles, refer to Flank's guide on PR titles.
- Format:
-
Creating a Pull Request:
- Push your changes to your GitHub fork.
- Create a pull request against the original
aa-sdkrepository'sdevelopmentbranch. - Ensure the pull request title follows the Enforce PR Title Format:
[subject-type]: [description starting with lowercase letters]. You can check this usingecho "[YOUR_PR_TITLE_HERE] | yarn commitlint.
- Celebrate your contribution!