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 for us to consider your contribution.
By following the steps below you will understand the development process and workflow.
- Forking the repository
- Installing Node and pnpm
- Installing dependencies
- Running the tests
- Using the playground
- Adding a changeset
- 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 pnpm to manage the dependencies. You will need to make sure you are using the latest Node LTS version and that you have available pnpm 10.16+.
You can check which versions you are using with:
node -v
pnpm -vThe Safe{Core} SDK uses a mono-repository structure managed by pnpm workspaces, with Changesets handling independent versioning and publishing of each package. 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 modifying 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.
pnpm install
pnpm buildThere is already a test script that can be launched from the root of the repository and will run all the tests from all the packages.
pnpm testIf you would like to test individual packages, once you make sure you did the build from the root, you can:
pnpm --filter <package-name> test
pnpm --filter @safe-global/protocol-kit test
pnpm --filter @safe-global/api-kit testFor 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:
pnpm play <playground-command>You can find more information about the available commands in the specific section.
Any pull request that changes the public behavior of one or more published packages must include a changeset describing the change. Changesets drive both the per-package version bumps and the auto-generated CHANGELOG.md entries.
From the root of the repository run:
pnpm changesetThe interactive prompt will ask:
- Which packages are affected by the change.
- The bump type for each affected package (
patch,minor, ormajor, following semver). - A short summary of the change. This text becomes the changelog entry, so write it for the consumers of the package.
This creates a new markdown file under .changeset/ that you should commit as part of your pull request.
Changes that don't affect any published package (CI config, internal scripts, docs, tests, etc.) don't need a changeset.
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.