6.7 KiB
Contributing to thirdweb
Getting Started
To get started, read the How this repo works section below to learn about the structure of this repo.
From there, you can take a look at our Good First Issues board and find an issue that interests you!
If you have any questions about the issue, feel free to ask on our Discord server in the #contributors channel; where you'll be able to get help from our team and other contributors.
How this repo works
@thirdweb-dev/js is a monorepo, meaning it contains many projects within it.
We use Turborepo to manage the monorepo, and help speed up the CI/CD pipeline to ship to production faster 🚢.
You can see a quick outline of each of the projects within this repo below, which each live within the /packages directory:
| Package | Description | Latest Version |
|---|---|---|
| /sdk | Best in class web3 SDK for Browser, Node and Mobile apps | |
| /react | Ultimate collection of React hooks for your web3 apps | |
| /auth | Best in class wallet authentication for Node backends | |
| /storage | Best in class decentralized storage SDK for Browser and Node | |
| /cli | Publish and deploy smart contracts without dealing with private keys | |
| /solana | Solana SDK for Browser, Node and React Native |
How to contribute
Let's explore how you can set up the repo on your local machine and start contributing!
This section requires some existing knowledge of Git, Node.js and Yarn.
Getting the repo
For OSS contributions, we use a Forking Workflow, meaning each developer will fork the repo and work on their own fork; and then submit a PR to the main repo when they're ready to merge their changes.
To begin:
-
Create a fork of this repository to your own GitHub account.
-
Clone your fork to your local device.
-
Create a new branch on your fork to start working on your changes:
git checkout -b MY_BRANCH_NAME -
Install the dependencies:
yarn
Now you have got the repo on your local machine, and you're ready to start making your changes!
Publish Your Changes
-
Use changeset to generate a changeset file:
yarn changesetWe follow semantic versioning for generating versioned releases of our packages (i.e. version =
MAJOR.MINOR.PATCH)- Update
majorfor breaking changes - Update
minorfor new features, - Update
patchfor non-breaking bug fixes, etc)
- Update
-
Commit the changeset along with your changes:
git commit -am "My commit message" -
Push your changes to the SDK:
git push origin MY_BRANCH_NAME -
Create a pull request to the
mainbranch of the official (not your fork) SDK repo.It's helpful to tag PRs with
[SDK],[REACT],[AUTH], (the name of the package you're modifying) to indicate the package that you are engaging with.
Testing Your Changes
When you make a pull request, your changes will be tested automatically by our CI/CD pipeline using GitHub Actions.
On your pull request, you can release your changes to a dev version by adding a comment with the following text:
/release-pr
This comment triggers the release-pr GitHub Action that publishes your changes to a dev version of the package(s) you are modifying.
Once this is done, you can test your changes by installing the dev version of the package(s).
If you don't already have a test project, you can use the CLI to create one:
npx thirdweb create
Inside your test project, you can install the dev version of the package(s) you are modifying.
For example, if you are modifying the @thirdweb-dev/react package, you can install the dev version of the package by running:
yarn add @thirdweb-dev/sdk@dev
This will install the dev version of the @thirdweb-dev/react package in your project, as you can see in the package.json file:
"dependencies": {
- "@thirdweb-dev/react": "^2",
+ "@thirdweb-dev/react": "^2.9.7-dev-b073878",
}
You can now test your changes in your test project!