Skip to content

Commit

Permalink
feat: add conventional commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XionWCFM committed Dec 1, 2024
1 parent 9184e79 commit 168364a
Show file tree
Hide file tree
Showing 9 changed files with 805 additions and 23 deletions.
2 changes: 1 addition & 1 deletion apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint",
"dev:xion": "next dev --turbo",
"test": "vitest",
"test:ci": "vitest run --coverage",
"ci:test": "vitest run --coverage",
"next-dev": "next dev",
"watch-content": "node ./watcher.cjs"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/grasshopper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "next build",
"start": "next start",
"test": "vitest",
"test:ci": "vitest run --coverage",
"ci:test": "vitest run --coverage",
"lint": "next lint"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
3 changes: 3 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json"
}
26 changes: 25 additions & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pre-push:
parallel: true
commands:
test:
run: pnpm run test:ci
run: pnpm run ci:test
format:
run: |
pnpm run check:biome
Expand All @@ -11,3 +11,27 @@ pre-push:
git commit -m 'format code by biome'
fi
stage_fixed: true

commit-msg:
commands:
lint-commit-msg:
run: |
npx commitlint --edit || {
echo "❌ 커밋 메시지가 형식에 맞지 않아요"
echo ""
echo "🔍 Conventinal Commits Docs"
echo "https://www.conventionalcommits.org/ko/v1.0.0"
echo ""
echo "Conventional Commit 규칙에 맞게 메시지를 작성해주세요."
echo ""
echo "✅ Examples:"
echo " feat: ~~기능을 개발했어요"
echo " fix: ~~버그를 고쳤어요"
echo " docs: 문서를 수정했어요"
echo " style: 코드 포맷을 변경했어요"
echo " refactor: 기능 변경을 하지 않고 코드를 개선했어요"
echo ""
echo "👀 사용 가능한 옵션이에요:"
echo " feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert"
exit 1
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"lint": "turbo lint",
"dev:xion": "turbo dev:xion",
"test": "turbo run test",
"test:ci": "turbo run test:ci",
"ci:test": "turbo run ci:test",
"ci:knip": "pnpm knip --no-exit-code",
"lint:biome": "npx @biomejs/biome lint .",
"check:biome": "npx @biomejs/biome check --write .",
"format:biome": "npx @biomejs/biome format --write .",
Expand All @@ -20,6 +21,9 @@
"devDependencies": {
"@biomejs/biome": "1.9.3",
"@repo/typescript-config": "workspace:*",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"knip": "^5.38.3",
"lefthook": "^1.8.4",
"turbo": "^2.3.3",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scripts": {
"build": "tsup",
"test": "vitest",
"test:ci": "vitest run --coverage"
"ci:test": "vitest run --coverage"
},
"devDependencies": {
"@vitest/coverage-v8": "^2.1.6",
Expand Down
Loading

0 comments on commit 168364a

Please sign in to comment.