Monorepo of Blogging Platform for Coder
- 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:
coderum-dev
: a Next.js app@repo/ui
: a stub React component library shared by bothweb
anddocs
applications@repo/eslint-config
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)@repo/typescript-config
:tsconfig.json
s used throughout the monorepo
Each package/app is 100% TypeScript.
Some additional tools and utilities:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
To build all apps and packages, run the following command:
pnpm build
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...
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:
-
Open the command line and navigate to the repository.
-
Change to the main branch by running:
git checkout main
- Update your local main branch by running:
git pull origin main
- Create a new branch from main
git checkout -b <your-branch-name>
git checkout -b minhc-a-branch
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.
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
.
So, our merge direction is: master <- A <- B <- C
There are two strategies to sync a PR train, git merge
and git rebase
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).
- 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 automaticallyfeat(lang): add Polish language
- this follows common commit conventional
- 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"
Once the PR is reviewed, click Enable Auto-merge to run the necessary CI checks to validate before merging.
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