-
Couldn't load subscription status.
- Fork 452
chore: revise contributing doc and PR template #1158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits Select commit Hold shift + click to select a range
5111de2 chore: update contributing doc
drewcook 646aad9 Merge branch 'main' into chore/contributing-doc
drewcook 260a273 chore: lint
drewcook 41369ac chore: add default PR template + labels
drewcook 4638879 chore: move to be used as default
drewcook 04b550a chore: lowercase labels
drewcook a09215a fix: typo
drewcook 0b43e50 chore: add project, remove frontmatter from pr template
drewcook 17c0d08 chore: projects fix
drewcook 7e6f419 chore: remove projects from frontmatter
drewcook 7d4e472 chore: update fork link
drewcook 8e03897 chore: use js code block
drewcook 1e85935 Merge branch 'main' into chore/contributing-doc
drewcook bfef0ff feat: add in wallet fork config section
drewcook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ## General Changes | ||
| | ||
| - Fixes XYZ bug | ||
| - Adds XYZ feature | ||
| - … | ||
| | ||
| ## Developer Notes | ||
| | ||
| Add any notes here that may be helpful for reviewers. | ||
| | ||
| ## Author Checklist | ||
| | ||
| - [ ] The base branch is set to `main` | ||
| - [ ] The title is using [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) formatting | ||
| - [ ] The Github issue has been linked to the PR in the Development section | ||
| - [ ] The General Changes section has been filled out | ||
| - [ ] Developer Notes have been added (optional) | ||
| | ||
| ## Reviewer Checklist | ||
| | ||
| - [ ] End-to-end tests are passing without any errors | ||
| - [ ] Code style generally follows existing patterns | ||
| - [ ] Code changes do not significantly increase the application bundle size | ||
| - [ ] New third-party packages, if any, do not introduce potential security threats | ||
| - [ ] There are no CI changes, or they have been OK’d by the devops team | ||
| - [ ] Code changes have been quality checked in the ephemeral URL | ||
| - [ ] There are two or more approvals from the core team | ||
| - [ ] Squash and merge has been checked | ||
This file contains hidden or 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,109 +1,156 @@ | ||
| # Contributing | ||
| | ||
| ## Initial setup | ||
| We use Github issues for tracking new features, bug fixes, and enhancements related to the Aave Interface. We are currently working on a UI/UX Integrations framework for integrating third-party services and entities within the Aave Interface. Please stay tuned for new information around this. | ||
| | ||
| ```sh | ||
| # potentially you can user other node versions, but it's only tested on what's currently listed in nvmrc | ||
| ## Pre-Requisites | ||
| | ||
| ### Install Node | ||
| | ||
| We are using a Next.js application, which relies on Node. You must have Node installed and set to use the specified version in `.nvmrc`. You can potentially use other versions, but we don’t recommend differing here. | ||
| | ||
| You can download from the [NodeJS website](https://nodejs.org/en/download/), but we recommend installing nvm and running the following command at root, after cloning or downloading the repo. | ||
| | ||
| ```bash | ||
| nvm use | ||
| ``` | ||
| | ||
| ### Install Dependencies | ||
| | ||
| Download [Yarn Package Manager](https://yarnpkg.com/) and install the dependencies. | ||
| | ||
| ```bash | ||
| yarn install | ||
| ``` | ||
| | ||
| ### Setup Environment Variables | ||
| | ||
| There are a few environment variables that we store for the interface. Before starting development, copy over the environment variables from the provided dummy file to a local copy. | ||
| | ||
| ```bash | ||
| cp .env.example .env.local | ||
| ``` | ||
| | ||
| ## Running the interface | ||
| ## Get Up & Running Locally | ||
| | ||
| Once you’ve completed the pre-requisites above, you should be able to start running the interface locally. There are several variations of running locally. | ||
| | ||
| ```sh | ||
| ### Development Mode | ||
| | ||
| Development builds are run with a watcher and an open server listening on `localhost:3000`. | ||
| | ||
| ```bash | ||
| yarn dev | ||
| ``` | ||
| | ||
| ## Build | ||
| ### Production Mode | ||
| | ||
| ```sh | ||
| # builds the app for usage on serverless & containered hosting platforms like vercel | ||
| Production-based builds are great for usage on serverless & container-based hosting platforms like [Vercel](https://vercel.com) or [Heroku](https://heroku.com). To compile the source files into minified, production-ready asset bundles, run the build command. | ||
| | ||
| ```bash | ||
| yarn build | ||
| # builds the app as a static bundle to be hosted on ipfs | ||
| yarn build:static | ||
| ``` | ||
| | ||
| ### Environment | ||
| There is also the option to build the application for usages as a static site on platforms like IPFS, AWS, Vercel, etc. This essentially builds the application as above and additionally uses the `next export` command. More information around Next’s export command can be found [here](https://nextjs.org/docs/advanced-features/static-html-export). | ||
| | ||
| ```sh | ||
| # setting the environment to 'staging' will enable testnet markets, disabling governance, staking, and production markets | ||
| NEXT_PUBLIC_ENV=prod | ||
| # you can also disable staking & governance by altering | ||
| NEXT_PUBLIC_ENABLE_GOVERNANCE=true | ||
| NEXT_PUBLIC_ENABLE_STAKING=true | ||
| ```bash | ||
| yarn build:static | ||
| ``` | ||
| | ||
| ## Test | ||
| To start the server in production mode and use these bundled, minified assets, run the following command. This will start the web server listening on `localhost:3000`. | ||
| | ||
| The integration test suite runs against tenderly forks of various networks. To setup the local environment you need to add environment variables accordingly: | ||
| | ||
| ```sh | ||
| TENDERLY_KEY=<api key> | ||
| TENDERLY_ACCOUNT=<account name> | ||
| TENDERLY_PROJECT=<project name> | ||
| ```bash | ||
| yarn start | ||
| ``` | ||
| | ||
| For setup env with staking page (to get positive result for staking test coverage), need to execute: | ||
| You can also serve up the static site assets with the following command, which can be viewable on `localhost:3000`. | ||
| | ||
| ```bash | ||
| yarn serve:static | ||
| ``` | ||
| cp .env.example .env.local | ||
| | ||
| ### Test Mode | ||
| | ||
| The integration test suite runs against [Tenderly](https://tenderly.co/) forks of various networks. To setup the local environment, you’ll first need to create an account and obtain an access key. Then fill in the three environment variables accordingly: | ||
| | ||
| ```bash | ||
| TENDERLY_KEY=<your access key> | ||
| TENDERLY_ACCOUNT=<your account/organization name> | ||
| TENDERLY_PROJECT=<your project name> | ||
| ``` | ||
| | ||
| For running the integration test suite you need to run the app. You can either run again `yarn dev` which will be a bit more resource intensive as the app will be build on the fly or run against a static build via `yarn build:static` & `yarn serve:static`. | ||
| For running the integration test suite, you’ll need to have the application running locally in a separate terminal. You may choose to either run it in development mode via `yarn dev` or against a static production build via `yarn build:static` & `yarn serve:static`. The caveat to running in development mode is that it will be more resource-intensive, since the application will be built on the fly. | ||
| | ||
| ```sh | ||
| ```bash | ||
| # open interactive cypress test suite | ||
| yarn test:open | ||
| | ||
| # run all tests in headless mode | ||
| yarn test:headless | ||
| ``` | ||
| | ||
| ## Run on a fork | ||
| ## Environment Variables | ||
| | ||
| Some environment variables can be adjusted to suite your needs during development, depending on the scenarios you want to test or build in. | ||
| | ||
| ```bash | ||
| # setting the environment to 'staging' will enable testnet markets, disabling governance, staking, and production markets | ||
| NEXT_PUBLIC_ENV=prod | ||
| | ||
| # you can also disable staking & governance by altering | ||
| NEXT_PUBLIC_ENABLE_GOVERNANCE=true | ||
| NEXT_PUBLIC_ENABLE_STAKING=true | ||
| ``` | ||
| | ||
| You can run the ui against a forked network similar to what the tests do which allows you to play around on the ui without spending actual funds. | ||
| To enable forks in the ui, you have to run the following commands in console. | ||
| ## Running Against a Chain Fork | ||
| | ||
| You can run the UI locally against a forked chain network, similar to what the tests do with Tenderly. This will allow you to build and interact with the UI without spending actual funds. This is very useful for testing many protocol scenarios. | ||
| | ||
| First, you’ll need to create a fork of a network, which can be done with a few different tools. We suggest using the one created by Bored Ghost Labs, where you can follow the steps and get set up [here](https://github.com/bgd-labs/aave-tenderly-cli). | ||
| | ||
| Second, you’ll need to tell the local application which fork to run against. The easiest way to do this is to copy/paste the following statements. With the application running locally, open up the console in the browser and copy/paste the following with the appropriate values. | ||
| | ||
| ```js | ||
| localStorage.setItem('forkEnabled', 'true'); | ||
| localStorage.setItem('forkBaseChainId', 1); // the networkId you are forking | ||
| localStorage.setItem('forkNetworkId', '3030'); // the networkId on the fork | ||
| localStorage.setItem('forkRPCUrl', <rpcurl>); | ||
| localStorage.setItem('forkBaseChainId', <chainId>); // the ID for the chain you are forking, in numeric format | ||
| localStorage.setItem('forkNetworkId', '3030'); // the ID of the new forked network | ||
| localStorage.setItem('forkRPCUrl', <rpcUrl>); | ||
| ``` | ||
| | ||
| As localeStorage is not observed you need to **reload** after setting the parameters. | ||
| Now the market selection should show forked markets for all the markets that run on `forkBaseChainId`. | ||
| To do actual transactions on the fork you need to setup your wallet to use the same `rpcurl` you provided as `forkRPCUrl`. | ||
| Since `localStorage` changes are not not observed, _you’ll need to reload after setting the parameters_. After reloading, the market selection should show forked markets for all the markets that run on `forkBaseChainId`. To make actual transactions on the fork, you’ll need to setup your wallet to use the same `rpcUrl` you provided as `forkRPCUrl`. This will require you to setup your wallet by adding in the new fork network and connecting to the app with it. | ||
drewcook marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
| ## Token addition | ||
| If you are using MetaMask, make sure to configure the Tenderly fork RPC URL into a new network configuration. Give it a network name, and you'll want to use the same values that you copied into `localStorage` for the other fields. See below as an example: | ||
| | ||
| To add a new token to the app, all you have to do is adding a svg token icon inside `public/icons/tokens` please make sure the svg name equals the `lowercase` onchain `symbol`. | ||
| If you want a custom name to appear alongside the icon you can alter `src/ui-config/reservePatches.ts` accordingly. | ||
|  | ||
| | ||
| ## Translations | ||
| Once you have both copied over the values into `localStorage` and have saved the new network configuration in MetaMask (or any other browser wallet), switch to the network in your wallet. | ||
| | ||
| Aave uses [Crowdin](https://crowdin.com/project/aave-interface) for translation management. | ||
| Next, reload the page. The new forked network should appear in the dropdown list for markets in the application. | ||
| | ||
| Feel free to reach out to us on discord to become a translator! | ||
| Finally, switch to the market pertaining to the fork in the dropdown list. Now you are able to interact with the Aave Protocol via the UI without spending any real funds! | ||
| | ||
| We only update strings within the app. Everything else is downloaded from crowdin. | ||
| __NOTE:__ _Always double check the selected network in your wallet provider to make sure transactions are executed only on the fork network_. | ||
| | ||
| [Crowdin Docs](https://support.crowdin.com/enterprise/cli/) for installation of the cli | ||
| | ||
| To upload strings | ||
| ## Token Additions | ||
| | ||
| ```sh | ||
| To add a new token to the app, the process is pretty simple. All you’ll need to do is add a new token icon SVG to the `public/icons/tokens` directory. The only requirement is that the name of the SVG file is equal to the asset’s `symbol` in all lowercase. If you want a custom name to appear alongside the icon, you can alter `src/ui-config/reservePatches.ts` accordingly. | ||
| | ||
| crowdin upload sources | ||
| ## Translations | ||
| | ||
| ``` | ||
| Aave uses [Crowdin](https://crowdin.com/) for translation management and internationalization. We only update strings within the app. Everything else is downloaded from Crowdin. For more information, such as installing their CLI tool, read their [documentation](https://developer.crowdin.com/api/v2/). | ||
| | ||
| To upload strings: | ||
| | ||
| To download strings | ||
| ```bash | ||
| crowdin upload sources | ||
| ``` | ||
| | ||
| ```sh | ||
| To download strings: | ||
| | ||
| ```bash | ||
| crowdin download | ||
| | ||
| ``` | ||
| | ||
| To add a new language first start an issue to check for public interest. | ||
| If the community decides to go forward with your preferred language follow [this pr](https://github.com/aave/interface/pull/447#issue-1165545965) to add support for a new language. | ||
| If you would like to add support for a new language across the app, please [open up an issue](https://github.com/aave/interface/issues/new/choose) and add the `i18n` label to it. This helps us categorize, and it will also help to gauge public interest for the new language. If the community decides to go forward with your preferred language, you may open up a pull request. Please follow the template of [this PR](https://github.com/aave/interface/pull/447#issue-1165545965). | ||
| | ||
| **Feel free to reach out to us on [Discord](https://discord.gg/aave) to become a translator!** | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.