First off, thank you for considering contributing to this project!
See our support guidelines. Do not use GitHub issues for general support or questions.
You will need to agree to our CLA in order to be possible to consider your contribution.
By following the steps bellow you will understand the development process and worflow.
- Forking the repository
- Installing Node and Yarn
- Installing dependencies
- Running the tests
- Using the playground
- Submitting a pull request
The first step would be to fork the repository. This will allow you to get a current copy of the repository state. Follow the steps to also clone your forked repository locally.
For active development we use the development
branch. Our main
branch contains only the currently published code. All new branches should be created from development
.
The Safe{Core} SDK uses Node as development environment and Yarn to manage the dependencies. You will need to make sure you are using the latest Node LTS version and that you have available Yarn v1.
You can check which versions you are using with:
node -v
yarn -v
The Safe{Core} SDK uses a mono-repository structure managed by Yarn Workspaces and Lerna. From the root of the repository you will need to install the whole dependency stack and do the project build. Some packages depend on each other, so even when modifiying only one package it's better to run the full build.
Install all dependencies and build the whole project by using the following commands at the project root.
yarn install
yarn build
There is already a test script that can be launched from the root of the repository and will use Lerna to run all the tests from all the packages.
yarn test
If you would like to test individual packages, once you make sure you did the build from the root, you can:
yarn test --scope=<package-name>
yarn test --scope=@safe-global/protocol-kit
yarn test --scope=@safe-global/api-kit
For some packages you may need to fill a .env file with some configuration. In those packages you will be able to find a .env.example
file specifying the necessary parameters.
You can use the playground section to do some manual testing using a specific Safe or configuration. The playground can be run from the root of the project as follow:
yarn play <playground-command>
You can find more information about the available commands in the specific section.
From the forked repository you can open a pull request to the original repository. Make sure to select the safe-global:development
branch as the target branch.