You can find a full video tutorial on how to contribute to thirdweb below:
https://www.youtube.com/watch?v=TXsQ3qok3B0
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.
@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, each living 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 |
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 pnpm.
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:
pnpm install
If you are on windows, use the
--ignore-scripts
flagpnpm install --ignore-scripts
Now you have got the repo on your local machine, and you're ready to start making your changes!
We use yalc to test changes locally.
Install the yalc CLI globally:
pnpm add yalc -g
First, create a test project where you can experiment with your changes:
You can create a basic starter project with the sdk
and react
packages installed using the CLI:
npx thirdweb create --app
Use yalc
to link your local changes in the monorepo to the test project, by running the following command from your test repo:
yalc add @thirdweb-dev/react # Link the react package
yalc add @thirdweb-dev/sdk # Link the sdk package
# etc...
From the monorepo, run the following command to publish your local changes to the test project:
pnpm push
Now, each time you make a change to the monorepo, you can run pnpm push
to publish your changes to the test project.
In your test project, you need to:
- Delete the dependencies cache. If you're using Next.js, that is the
.next
directory, and if you're using CRA, that is thenode_modules/.cache
directory. - Restart the development server.
Once you're satisfied with your changes, you are ready to submit them for review!
- Use changeset to generate a changeset file:
pnpm changeset
We follow semantic versioning for generating versioned releases of our packages (i.e. version = MAJOR.MINOR.PATCH
)
- Update
major
for breaking changes - Update
minor
for new features, - Update
patch
for non-breaking bug fixes, etc)
- 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
main
branch 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.