Популярные практики контроля качества веб-проекта. Гайд разбит на Системмы Качества (набор практик для контроля определенной части проекта) и Точки Интерации.
A. (quality system) Code - Исходный код, документация, тесты
- (integration point) IntelliSense via [IDE Extensions]
- (integration point) IDE Status Bar via [IDE Tasks]
- (integration point) Git via [Git Hooks]
- (integration point) GitHub via [GitHub Workflow]
B. (quality system) Repository - Комиты, ветки и реквесты
- (integration point) Git via [Git Hooks]
- (integration point) GitHub via [GitHub Workflow]
C. (quality system) Releases - Семантическое версионирование и changelogs, deploy на прод и в NPM
- (integration point) GitHub via [GitHub Workflow]
solution \ point | IntelliSense | IDE Status Bar | Git | GitHub Workflow |
---|---|---|---|---|
ESLint | ✅ | ✅ | ✅ | ✅ |
Prettier | ✅ | ✅ | ✅ | ✅ |
TypeScript | ✅ | ✅ | ✅ | ✅ |
node:test | ✅ | ✅ | ✅ | ✅ |
solution \ point | Git | GitHub | Git Client |
---|---|---|---|
Conventional Commits | ✅ | ✅ | ✅ |
Semantic PR | - | ✅ | - |
Есть два решения для контроля качества в этой области: Conventional Commits
и Semantic PR
.
Conventional Commits можно интегрировать через три точки интеграции: [Git
| GitHub Workflow
| Git Client
]
Semantic PR можно интегрировать только через GitHub Workflow
via Git Hooks
+husky
+@commitlint
// file: /package.json
{
"type": "module",
"devDependencies": {
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"husky": "^9.1.7"
},
"scripts": {
"prepare": "husky",
"commitlint": "commitlint --edit"
}
}
// file: /commitlint.config.js
export default { extends: ["@commitlint/config-conventional"] };
# file: /.husky/commit-msg
#!/bin/sh
# Temporarily add Git Bash to PATH if it's not already in the PATH
if ! command -v bash &> /dev/null
then
export PATH="$PATH:/c/Program Files/Git/usr/bin"
fi
npm run commitlint ${1}
Use VSCode extension vivaxy.vscode-conventional-commits
:
// file: /.vscode/extensions.json
{
"recommendations": ["vivaxy.vscode-conventional-commits"]
}
solution \ point | GitHub |
---|---|
release-please | ✅ |