- Naming conventions
- Conventional commits
- Initial setup
- How'd you start a new feature, bug fix, etc.?
- What about
staging
? - And what about releases?
Some things you should know before cloning the repository and making changes:
main
is for production code only.staging
is the pre-release branch tested before merging into production.develop
is for development, anything goes. Pull requests should be made against this branch.
graph TD
A[Naming]
A1[`main`: Production code only]
A2[`staging`: Step before merging into production]
A3[`develop`: Development, anything goes]
A --> A1
A --> A2
A --> A3
We follow and enforce the usage of conventional commits for commit messages and pull requests titles.
PR titles are validated with the help of Github actions. More info here.
Commit messages are validated using a Husky commit-msg
hook and commitlint. More info here.
- Ensure
pnpm
is installed (https://pnpm.io/) - Fork the repository, then pull it down to your disk:
# Clone the repository
git clone [email protected]:YOUR_USERNAME/dAppBooster.git
# Change the directory
cd dAppBooster
# Checkout the development branch
git checkout develop
# Set the base repository as upstream (makes it easier to pull updates to your fork)
git remote add upstream [email protected]:BootNodeDev/dAppBooster.git
# Create a local .env file
cp .env.example .env.local
# Install the dependencies
pnpm i
- Find some issue you're interested in, a bug you want to fix, or a new feature you want to implement (make sure that no one else is already working on it!).
# Update your local copy of the develop branch with the latest code changes
git checkout develop
git pull -f upstream/develop
# Run pnpm i to get any dependency updates
pnpm i
# Create a new branch from develop. Give it a meaningful name (`feat/new-feature`, `fix/bug-fix`, `feature/#192`, etc.)
git checkout -b fix/something
# Work on the branch, commit your changes, push them... you know the drill.
# Finally, push the branch.
git push -u origin fix/something
- Submit a pull request to the upstream dAppBooster repository.
- Choose a descriptive title following the conventional commits guidelines and write a detailed description of the changes you made using the PR template.
- Wait for a maintainer to review your PR, make changes if asked, and get it merged.
graph LR
B[New feature or bug fix]
B1[Create new branch from `develop`]
B2[Name branch descriptively]
B3[Work on the branch]
B4[Create pull request]
B5[Pull request approved]
B6[Merge branch into `develop`]
B --> B1
B1 --> B2
B2 --> B3
B3 --> B4
B4 --> B5
B5 --> B6
Once we reach a point where we feel like a new release is worth creating, we'll submit a pull request asking to merge develop
into staging
. This is the branch where things should be tested and fixed before merging into main
. Consider it a pre-production environment.
We'll test staging
thoroughly, fix all the (relevant) bugs and once everything is ready we will:
- Merge
staging
's fixes intodevelop
so the development branch is up-to-date. - Submit a pull request asking to merge
staging
intomain
.
- First, make sure the latest changes from
staging
are merged intomain
- Commit a version bump into the
package.json
file following Semantic Versioning's guidelines: https://semver.org/ - Then tag
main
using the version set in the previous step. - Push the changes to
main
. - Create a new release using that tag.
That's it, everybody can see now that a new version is ready to use and if something's wrong they can go back to a previous version temporarily.
graph TD
C[Staging Process]
C1[Merge `develop` into `staging`]
C2[Test and fix bugs in `staging`]
C3[Merge `staging` into `develop`]
C4[Merge `staging` into `main`]
D[Releasing a New Version]
D0[Commit a version bump to `package.json`]
D1[Tag `main` following Semantic Versioning]
D2[Create a new release using the tag]
D3[New version is available]
C --> C1
C1 --> C2
C2 --> C3
C2 --> C4
D --> D0
D0 --> D1
D1 --> D2
D2 --> D3
C4 --> D