SuperAPI AI Directory

ssd-git-commit

Coding & development

View repository

Updated 10-15 21:40

About this skill

SSD Git Commit — Commit Message Standard

Context

SSD uses Conventional Commits as the commit message standard and Semantic Versioning for versioning, using release-it to manage releases automatically.

Commit Message Format

<type>[optional scope]: <description>

[optional body]

[optional footer]

Type

Type Used when
feat Add a new feature
fix Fix a bug
docs Edit documentation
style Changes that do not affect logic (color, position)
refactor Change code structure without changing function
perf Improve performance
test Add or edit tests
build Change build system or config
ci Change CI configuration
chore Work not related to code or tests
revert Revert changes

Scope

Specify the changed part in parentheses (optional)

Scope Meaning
(service) Change service layer
(controller) Change controller
(model) Change model/entity
(redux) Change redux slice
(api) Change api client
(merge) merge code
(release) release version
(config) Change configuration
(deps) Change dependencies/packages

Breaking Change

If there is a change everyone must know about (adding required config, changing API signature):

  • Add ! before : such as feat!: or feat(api)!:
  • or add BREAKING CHANGE: คำอธิบาย in the footer

Commit Message Writing Rules

  1. Must always start with type
  2. feat — use only when adding a new feature
  3. fix — use only when fixing a bug
  4. description must come immediately after type:scope
  5. description no more than 50 words in Thai or English (English uses imperative form, no subject)
  6. body can be added, with 1 blank line after the description
  7. footer for reference such as fixes #13, #5 leave 1 blank line

Commit Message Examples

General

chore: initial project
docs: clean up code
docs: update README.md
chore(merge): pull request #1
chore(release): v1.0.1
chore(config): update appsetting.json
chore(deps): update restsharp version to 109.0.5
perf: improve performance of order service
test: add test for order service

Backend

feat: add new feature (api-1)
feat(service): add order service
feat(controller): add order controller
feat(model): add order table
fix: fix bug in order service
refactor: change folder structure
refactor: change order status to enum

Frontend

feat: add new feature (ui-1)
feat(redux): add new auth slice
feat(api): add new api client
fix: fix bug in login page
style: change color of button

Breaking Change

feat(api)!: change response format of order endpoint

BREAKING CHANGE: Response now returns array instead of object.
Update all frontend clients to handle the new format.

Semantic Versioning

Format: MAJOR.MINOR.PATCH

Part Add when Example
MAJOR Breaking change — old code no longer works 1.0.0 → 2.0.0
MINOR add a new feature (backward compatible) 1.0.0 → 1.1.0
PATCH fix a bug (backward compatible) 1.0.0 → 1.0.1

Example:

  • 1.0.0 — first version
  • 1.1.0 — add feature
  • 1.1.1 — fix bug
  • 2.0.0 — a change that makes old code no longer work

Release-it

Installation

npm install -g @release-it/conventional-changelog@8.0.1 release-it@17.3.0

Conditions of use

  • Repository must contain only 1 program per 1 Repository
  • Git on the machine must already be connected to SiamSmileDev's GitHub
  • If there is more than 1 program, notify the team lead to separate the Repository

Configuration

  1. Edit package.json to version to match the current version
  2. Download and place the file .release-it.json at the root folder
  3. commit: build: add release-it

Usage

# 1. Switch ไป develop branch ก่อน
git checkout develop

# 2. รัน release-it
release-it

# 3. เลือก version type: major / minor / patch

# 4. ตอบคำถาม:
# Commit? Yes
# Tag? Yes
# Push? Yes
# Create a release on GitHub? Yes