From 2bfa138d1aa663995b8ec11f66898e5538b2501d Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Tue, 28 Nov 2023 21:11:18 -0500 Subject: [PATCH 1/4] docs: update CONTRIBUTING guide, fix PR template, and clean up README --- ...t_template.md => PULL_REQUEST_TEMPLATE.md} | 5 +- CONTRIBUTING.md | 66 ++++++++++++++----- README.md | 45 ++----------- 3 files changed, 58 insertions(+), 58 deletions(-) rename .github/{PULL_REQUEST_TEMPLATE/pull_request_template.md => PULL_REQUEST_TEMPLATE.md} (67%) diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 67% rename from .github/PULL_REQUEST_TEMPLATE/pull_request_template.md rename to .github/PULL_REQUEST_TEMPLATE.md index 8b5d472ca1..18082f2f19 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,10 @@ # Pull Request Checklist - [ ] Did you add new tests and confirm existing tests pass? (`yarn test`) -- [ ] Did you update relevant docs? (docs are found in the `site` folder, see guidleines below) +- [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)) - [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? -- [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples? (e.g. `feat!: breaking change`) +- [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples)? (e.g. `feat!: breaking change`) - [ ] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:fix`) - [ ] Is the base branch you're merging into `development` and not `main`? +- [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)? diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47c5469041..1f761f6c28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,24 +1,58 @@ # Contributing -We welcome any and all contributions. To get started, +We're excited to have you contribute to the `aa-sdk`. Here's a step-by-step guide to help you get started. -1. Make sure you have `yarn` installed. We are still using version 1.x. The installation instructions can be found here: https://classic.yarnpkg.com/lang/en/docs/install -2. [Fork](https://github.com/alchemyplatform/aa-sdk/fork) this repo -3. Run `yarn` to install dependencies -4. Make changes to packages +## Getting Started -## Pull Request Checklist +1. **Fork and Clone**: First, [fork the `aa-sdk` repository](https://github.com/alchemyplatform/aa-sdk/fork). Then, clone your forked repo to your local machine. -- [ ] Did you add new tests and confirm existing tests pass? (`yarn test`) -- [ ] Did you update relevant docs? (docs are found in the `site` folder, see guidleines below) -- [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? -- [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? -- [ ] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples? (e.g. `feat!: breaking change`) -- [ ] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:fix`) -- [ ] Is the base branch you're merging into `development` and not `main`? +2. **Install Dependencies**: Ensure you have `yarn` installed (we use version 1.x). Installation instructions are available [here](https://classic.yarnpkg.com/lang/en/docs/install). Run `yarn` in the project root to install all necessary dependencies. -## Docs guidelines +3. **Testing Environment**: Before making changes, make sure to verify the testing environment. -We leverage `vitepress` to build our docs. You can find the docs in the `site` folder. To run the docs locally, run `yarn docs:dev` from the `site` folder. To build the docs, run `yarn docs:build`. Docs are automatically deployed with each package published. + - Use the Node version specified in `package.json` (currently 18.10). Run `node -v` to check your version. + - Build the project with `yarn build`. + - Run existing tests using `yarn test` to ensure everything is working correctly. -When updating code, be sure to update the relevant doc within `site/packages/*`. The `packages` directory is broken down by the relevant package found within this repository. When adding new functionality, be sure to add a new doc outlining the method or class that you've added! +4. **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've worked on to document the changes. + +5. **Re-verify Tests**: After making your changes, re-run `yarn test` to ensure all tests still pass. + +6. **Code Formatting**: + + - Format your code changes with `yarn run lint:write`. + - Confirm that your code passes format checks with `yarn run lint:check`. + +7. **Docs Changes**: + + - We use `vitepress` for our docs located in the `site` folder. + - To run docs locally: `yarn dev` from the `site` folder. + - To build docs: `yarn build` from the `site` folder. + - When editing or adding new docs, make sure you follow the guidelines mentioned below: + - Follow the [Google style guidelines](https://developers.google.com/style) for docs content. + - Additional Guidelines: + - Use terms consistently (e.g., "smart account", not "Smart Account"). + - Refer to "Account Kit" correctly, without "the" or "AccountKit". + - Use `LightAccount` for code references, "Light Account" in text. + - Use "gasless" over "gas-less". + - Write documentation in the [second person voice](https://developers.google.com/style/person). + - Use "aa-sdk" or "Account Kit" depending on context, not "Account Kit SDK". + - Capitalize "Gas Manager API" and "Bundler API". + - Capitalize definitions for type primitives like `Provider`, `Signer`, `Account`. + +8. **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 log` to see more examples and acceptable subject-types. + - For more details on semantic PR titles, refer to [Flank's guide on PR titles](https://flank.github.io/flank/pr_titles/). + +9. **Creating a Pull Request**: + + - Push your changes to your GitHub fork. + - Create a pull request against the original `aa-sdk` repository's `development` branch. + - Ensure the pull request title follows the Enforce PR Title Format: `[subject-type]: [description starting with lowercase letters]`. You can check this using `echo "[YOUR_PR_TITLE_HERE] | yarn commitlint`. + +10. **Celebrate** your contribution! diff --git a/README.md b/README.md index 19732d50d8..e4e79b2ad0 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,15 @@ -# Account Abstraction SDK (aa-sdk) +# aa-sdk -The `aa-sdk` is a type-safe and performant TypeScript library built on top of [viem](https://viem.sh/) to provide ergonomic methods for sending user operations, sponsoring gas, and deploying smart accounts. It handles all the complexity of ERC-4337 under the hood to make account abstraction simple. +The `aa-sdk` is a type-safe and performant TypeScript library built on top of [viem](https://viem.sh/) to provide ergonomic methods for sending user operations, sponsoring gas, and deploying smart contract accounts. It handles all the complexity of ERC-4337 under the hood to make account abstraction simple. The SDK also implements an EIP-1193 provider interface to easily plug into any popular dapp or wallet connect libraries such as RainbowKit, Wagmi, and Web3Modal. It also includes ethers.js adapters to provide full support for ethers.js apps. -The `aa-sdk` is modular at every layer of the stack and can be easily extended to fit your custom needs. You can plug in any [smart account](https://accountkit.alchemy.com/smart-accounts/accounts/using-your-own) implementation, [Signer](https://accountkit.alchemy.com/smart-accounts/signers/overview), [Gas Manager API](https://accountkit.alchemy.com/overview/introduction.html#gas-manager-api), RPC provider. +The `aa-sdk` is modular at every layer of the stack and can be easily extended to fit your custom needs. You can plug in any [smart account](https://accountkit.alchemy.com/smart-accounts/accounts/using-your-own) implementation, [Signer](https://accountkit.alchemy.com/smart-accounts/signers/overview), Gas Manager API and RPC Provider. ## Getting Started -### Install the Packages - -```bash [yarn] -yarn add @alchemy/aa-accounts @alchemy/aa-core -``` - -### [Light Account Example](https://accountkit.alchemy.com/overview/getting-started#a-simple-light-account-example) - -## Docs - -The `aa-sdk` is part of Account Kit. For more information, check out the [Account Kit docs](https://accountkit.alchemy.com). +The `aa-sdk` is part of [Account Kit](https://accountkit.alchemy.com). Check out this [quickstart guide](https://accountkit.alchemy.com/getting-started.html) to get started. ## Contributing -1. clone the repo -2. run `yarn` -3. verify tests pass - - be sure to use the node version specified in package.json, currently 18.16 - - run `node -v` - - run `yarn build` - - run `yarn test` -4. make changes to packages -5. reverify that all tests pass -6. format code changes - - run `yarn run lint:write` -7. confirm code passes format checks - - run `yarn run lint:check` -8. commit code with a standardized commit message - - format: `[subject-type]: [description starting with lowercase letters] (#[issue number])` - - example: `feat: add sanity check on provider connect for clearer error message (#181)` - - note: run `git log` to see more examples and acceptable subject-types -9. push to your github fork -10. create a pull request with the original github repo - -- note: pull request title must pass the Enforce PR Title Format -- format: `[subject-type]: [description starting with lowercase letters]` -- run `echo "[YOUR_PR_TITLE_HERE] | yarn commitlint` -- passing example: run `echo "docs: add build and test documentation update (#195)" | yarn commitlint` - -11. celebrate +We welcome contributions to `aa-sdk`. Please see our [contributing guidelines](CONTRIBUTING.md) for more information. From 716eaadcb9b3540eea09e8d7096fb59569ce0ae5 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Tue, 28 Nov 2023 22:06:32 -0500 Subject: [PATCH 2/4] Update CONTRIBUTING.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f761f6c28..28e6252033 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ We're excited to have you contribute to the `aa-sdk`. Here's a step-by-step guid 3. **Testing Environment**: Before making changes, make sure to verify the testing environment. - - Use the Node version specified in `package.json` (currently 18.10). Run `node -v` to check your version. + - Use the Node version specified in `package.json` (currently 18.16.0). Run `node -v` to check your version. - Build the project with `yarn build`. - Run existing tests using `yarn test` to ensure everything is working correctly. From e189cc9b4f302585fad89fa70986f27a541e7b78 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Tue, 28 Nov 2023 22:07:06 -0500 Subject: [PATCH 3/4] Update README.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4e79b2ad0..d20b048f2c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # aa-sdk -The `aa-sdk` is a type-safe and performant TypeScript library built on top of [viem](https://viem.sh/) to provide ergonomic methods for sending user operations, sponsoring gas, and deploying smart contract accounts. It handles all the complexity of ERC-4337 under the hood to make account abstraction simple. +The `aa-sdk` is a type-safe and performant TypeScript library built on top of [viem](https://viem.sh/) to provide ergonomic methods for sending user operations, sponsoring gas, and deploying smart accounts. It handles all the complexity of ERC-4337 under the hood to make account abstraction simple. The SDK also implements an EIP-1193 provider interface to easily plug into any popular dapp or wallet connect libraries such as RainbowKit, Wagmi, and Web3Modal. It also includes ethers.js adapters to provide full support for ethers.js apps. From dc0eed5e9d16ea56d8c342c1fadb92467f35370c Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Tue, 28 Nov 2023 22:08:34 -0500 Subject: [PATCH 4/4] docs: make requested changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d20b048f2c..6bf960331f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The `aa-sdk` is a type-safe and performant TypeScript library built on top of [v The SDK also implements an EIP-1193 provider interface to easily plug into any popular dapp or wallet connect libraries such as RainbowKit, Wagmi, and Web3Modal. It also includes ethers.js adapters to provide full support for ethers.js apps. -The `aa-sdk` is modular at every layer of the stack and can be easily extended to fit your custom needs. You can plug in any [smart account](https://accountkit.alchemy.com/smart-accounts/accounts/using-your-own) implementation, [Signer](https://accountkit.alchemy.com/smart-accounts/signers/overview), Gas Manager API and RPC Provider. +The `aa-sdk` is modular at every layer of the stack and can be easily extended to fit your custom needs. You can plug in any [smart account](https://accountkit.alchemy.com/smart-accounts/accounts/using-your-own) implementation, [Signer](https://accountkit.alchemy.com/smart-accounts/signers/overview), [Gas Manager API](https://accountkit.alchemy.com/overview/introduction.html#gas-manager-api) and RPC Provider. ## Getting Started