Skip to content

Latest commit

 

History

History
142 lines (89 loc) · 6.6 KB

contributing.md

File metadata and controls

142 lines (89 loc) · 6.6 KB

Contributing to thirdweb

You can find a full video tutorial on how to contribute to thirdweb below:

https://www.youtube.com/watch?v=TXsQ3qok3B0

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, each living within the /packages directory:

Package Description Latest Version
/sdk Best in class web3 SDK for Browser, Node and Mobile apps npm version
/react Ultimate collection of React hooks for your web3 apps npm version
/auth Best in class wallet authentication for Node backends npm version
/storage Best in class decentralized storage SDK for Browser and Node npm version
/cli Publish and deploy smart contracts without dealing with private keys npm version
/solana Solana SDK for Browser, Node and React Native npm version

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 pnpm.


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:

  1. Create a fork of this repository to your own GitHub account.

  2. Clone your fork to your local device.

  3. Create a new branch on your fork to start working on your changes:

    git checkout -b MY_BRANCH_NAME
    
  4. Install the dependencies:

    pnpm install
    

    If you are on windows, use the --ignore-scripts flag

    pnpm install --ignore-scripts
    

Now you have got the repo on your local machine, and you're ready to start making your changes!


Test 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:

  1. Delete the dependencies cache. If you're using Next.js, that is the .next directory, and if you're using CRA, that is the node_modules/.cache directory.
  2. Restart the development server.

Publish Your Changes

Once you're satisfied with your changes, you are ready to submit them for review!

  1. 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)
  1. Commit the changeset along with your changes:
git commit -am "My commit message"
  1. Push your changes to the SDK:
git push origin MY_BRANCH_NAME
  1. 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.