Skip to content

cungminh2710/coderum.dev

Repository files navigation

coderum.dev

Monorepo of Blogging Platform for Coder

What's inside?

Tech stack

  • TypeScript
  • React - Library for web
  • Next.js - The React framework for full stack development
  • Storybook - Frontend workshop for UI development
  • libSQL - fork of SQLite for scaling edge databases

This monorepo includes the following packages/apps:

Apps and Packages

  • coderum-dev: a Next.js app
  • @repo/ui: a stub React component library shared by both web and docs applications
  • @repo/eslint-config: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • @repo/typescript-config: tsconfig.jsons used throughout the monorepo

Each package/app is 100% TypeScript.

Utilities

Some additional tools and utilities:

Contributing

Build

To build all apps and packages, run the following command:

pnpm build

Develop

To develop all apps and packages, run the following command:

pnpm dev

To develop a app and its dependencies, run the following command:

pnpm dev --filter=<app-name>...

pnpm dev --filter=@repo/ui...

Contributing Guideline

Make a code change

All daily code changes happen on lightweight, short-lived feature branches. This way of working is called trunk-based development; the main branch is the default trunk.

  • To create a branch:
  1. Open the command line and navigate to the repository.

  2. Change to the main branch by running:

git checkout main
  1. Update your local main branch by running:
git pull origin main
  1. Create a new branch from main
git checkout -b <your-branch-name>

git checkout -b minhc-a-branch

Pull Request

A pull request (PR) lets you inform others about changes you’ve made and pushed to a branch in a GitHub repository and invite the appropriate reviews. After opening your PR, you can discuss your changes and receive feedback from owners and interested stakeholders.

Pull request trains

When your changes have many components and are too big to review, splitting them into multiple smaller pull requests is better. This will help code reviewers understand your changes better.

In a PR train, you base each PR on the previous PR, with the head PR based on main.

image

So, our merge direction is: master <- A <- B <- C

image

There are two strategies to sync a PR train, git merge and git rebase

Create Pull Request

You’ve created a branch for your changes and tested your changes locally, and things are looking good. You now need to push your changes to the remote repository.

git push origin <your-branch-name>

You can open a PR in multiple ways, depending on your computer’s operating system and the technology you use (for example, a CLI or GitHub Desktop).

  1. PR Title

Your PR title (probably the final commit message of your PR on master) should indicate what components your commit primarily affects (for example, the packages). It should be easily understandable and provide enough information for someone to know what to expect from the code changes in the PR without actually having to dive into the code.

Some examples of bad titles include:

  • soft fail
  • add swiftfile
  • rm storyboard

None of these titles adequately explain the changes or indicate the affected packages.

Some example good titles include:

  • PD-365: Improve Worldmap
  • chore(docs): Add Contributing guideline
  • IOS-347: Story component

These titles include the affected package, a precise explanation of the changes, and, where relevant, the corresponding Jira ticket number.

Some standard title formats that teams use include:

  • [JIRA-999] <description> - this will link PR status to our JIRA automatically
  • feat(lang): add Polish language - this follows common commit conventional
  1. PR Description

The description should give reviewers the context to effectively review the PR.

A good description includes:

  • Overview: A brief summary of your PR (think TL;DR).
  • Problem: The problem you’re trying to fix.
  • Solution: Explains your solution, as well as other possible solutions, and why you chose the one you did. If there’s a design doc, include a link to it.
  • Preview: Any GIFs or screenshots if applicable.
  • PR train: The PR train details if using one.
  • Jira ticket link: A link to the Jira ticket if available.

Once entered the appropriate title and description, click "Create Pull Request"

Status Check

Once the PR is reviewed, click Enable Auto-merge to run the necessary CI checks to validate before merging.

Your PR is reviewed and merged!

Congratulations 🎉🎉 The Coderum team thanks you ✨.

Once your PR is merged, your contributions will be publicly visible and we will tag the appropriate version to deploy your changes