Commit 64981a9e authored by tom's avatar tom

[skip ci] update contributing guide

parent b8f0828f
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
Thanks for showing interest to contribute to Blockscout. The following steps will get you up and running. Thanks for showing interest to contribute to Blockscout. The following steps will get you up and running.
 
## Project setup ## Project setup
1. Fork the repo by clicking <kbd>Fork</kbd> button at the top of the repo main page and name it appropriately 1. Fork the repo by clicking <kbd>Fork</kbd> button at the top of the repo main page and name it appropriately
...@@ -23,6 +25,8 @@ Thanks for showing interest to contribute to Blockscout. The following steps wil ...@@ -23,6 +25,8 @@ Thanks for showing interest to contribute to Blockscout. The following steps wil
yarn yarn
``` ```
&nbsp;
## Toolkit ## Toolkit
We are using following technology stack in the project We are using following technology stack in the project
...@@ -36,6 +40,8 @@ We are using following technology stack in the project ...@@ -36,6 +40,8 @@ We are using following technology stack in the project
And of course our premier language is [Typescript](https://www.typescriptlang.org/). And of course our premier language is [Typescript](https://www.typescriptlang.org/).
&nbsp;
## Local development ## Local development
1. Prepare your environment variables: 1. Prepare your environment variables:
...@@ -48,18 +54,27 @@ And of course our premier language is [Typescript](https://www.typescriptlang.or ...@@ -48,18 +54,27 @@ And of course our premier language is [Typescript](https://www.typescriptlang.or
- if your options is "B", use `yarn dev:<config_name>` command - if your options is "B", use `yarn dev:<config_name>` command
3. In browser navigate to the URL from the command output (by default, it is `http://localhost:3000`) 3. In browser navigate to the URL from the command output (by default, it is `http://localhost:3000`)
&nbsp;
## Adding new dependencies ## Adding new dependencies
For all types of dependencies: For all types of dependencies:
- **Do not add** a dependency if the desired functionality is easily implementable - **Do not add** a dependency if the desired functionality is easily implementable
- If adding a dependency is necessary, please be sure that is is well-maintained and trustworthy - If adding a dependency is necessary, please be sure that is is well-maintained and trustworthy
&nbsp;
## Adding new ENV variable ## Adding new ENV variable
*Note*, if the variable should be exposed to the browser don't forget to add prefix `NEXT_PUBLIC_` to its name. *Note*, if the variable should be exposed to the browser don't forget to add prefix `NEXT_PUBLIC_` to its name.
These are the steps that you have to follow to make everything work: These are the steps that you have to follow to make everything work:
1. First and foremost, document variable in the [/docs/ENVS.md](./ENVS.md) file; provide short description, its expected type, requirement flag, default and example value; **do not skip this step** otherwise the app will not receive variable value at run-time 1. First and foremost, document variable in the [/docs/ENVS.md](./ENVS.md) file; provide short description, its expected type, requirement flag, default and example value; **do not skip this step** otherwise the app will not receive variable value at run-time
2. Make sure that you have added a property to React app config (`/configs/app/index.ts`) in appropriate section that is associated with this variable; do not use ENV variable values directly in the application code 2. Make sure that you have added a property to React app config (`/configs/app/index.ts`) in appropriate section that is associated with this variable; do not use ENV variable values directly in the application code; decide where this variable belongs to and place it under the certain section:
- `app` - the front-end app itself
- `api` - the main API configuration
- `UI` - the app UI customization
- `features` - the particular feature of the app
- `services` - some 3rd party service integration which is not related to one particular feature
3. For local development purposes add the variable with its appropriate values to pre-defined ENV configs `/configs/envs` where it is needed 3. For local development purposes add the variable with its appropriate values to pre-defined ENV configs `/configs/envs` where it is needed
4. Add the variable to CI configs where it is needed 4. Add the variable to CI configs where it is needed
- `deploy/values/review/values.yaml.gotmpl` - review development environment - `deploy/values/review/values.yaml.gotmpl` - review development environment
...@@ -68,6 +83,8 @@ These are the steps that you have to follow to make everything work: ...@@ -68,6 +83,8 @@ These are the steps that you have to follow to make everything work:
- `deploy/values/l2-optimism-goerli/values.yaml` - main development environment - `deploy/values/l2-optimism-goerli/values.yaml` - main development environment
5. Don't forget to mention in the PR notes that new ENV variable were added 5. Don't forget to mention in the PR notes that new ENV variable were added
&nbsp;
## Writing & Running Tests ## Writing & Running Tests
Every feature or bugfix should be accompanied by tests, either unit tests or component visual tests, or both, except from trivial fixes (for example, typo fix). All commands for running tests you can find [below](./CONTRIBUTING.md#command-list). Every feature or bugfix should be accompanied by tests, either unit tests or component visual tests, or both, except from trivial fixes (for example, typo fix). All commands for running tests you can find [below](./CONTRIBUTING.md#command-list).
...@@ -93,6 +110,8 @@ We have 3 pre-configured projects. You can run your test with the desired projec ...@@ -93,6 +110,8 @@ We have 3 pre-configured projects. You can run your test with the desired projec
*Note* that, since we are developing not on the same operating system as our CI system, we have to use Docker to generate or update the screenshots. In order to do that use `yarn test:pw:docker <path-to-file> --update-snapshots` command. Please **do not commit** any screenshots generated via `yarn test:pw:local` command, their associated tests will fail in the CI run. *Note* that, since we are developing not on the same operating system as our CI system, we have to use Docker to generate or update the screenshots. In order to do that use `yarn test:pw:docker <path-to-file> --update-snapshots` command. Please **do not commit** any screenshots generated via `yarn test:pw:local` command, their associated tests will fail in the CI run.
&nbsp;
## Making a Pull Request ## Making a Pull Request
### Steps to PR ### Steps to PR
...@@ -130,7 +149,9 @@ We have 3 pre-configured projects. You can run your test with the desired projec ...@@ -130,7 +149,9 @@ We have 3 pre-configured projects. You can run your test with the desired projec
*Note*, if you Pull Request contains any changes that are not backwards compatible with the previous versions of the app, please specify them in PR description and add label ["breaking changes"](https://github.com/blockscout/frontend/labels/breaking%20changes) to it. *Note*, if you Pull Request contains any changes that are not backwards compatible with the previous versions of the app, please specify them in PR description and add label ["breaking changes"](https://github.com/blockscout/frontend/labels/breaking%20changes) to it.
## Command list &nbsp;
## Commands list
| Command | Description | | Command | Description |
| --- | --- | | --- | --- |
...@@ -152,6 +173,8 @@ We have 3 pre-configured projects. You can run your test with the desired projec ...@@ -152,6 +173,8 @@ We have 3 pre-configured projects. You can run your test with the desired projec
| `yarn test:pw:docker` | run Playwright component tests in docker container | | `yarn test:pw:docker` | run Playwright component tests in docker container |
| `yarn test:pw:ci` | run Playwright component tests in CI | | `yarn test:pw:ci` | run Playwright component tests in CI |
&nbsp;
## Tips & Tricks ## Tips & Tricks
### Code Editor ### Code Editor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment