Skip to content

Commit

Permalink
feat(git): add a git commit cli to generate standardised commit messages
Browse files Browse the repository at this point in the history
  • Loading branch information
derecklhw committed Aug 23, 2024
1 parent 1dae196 commit a536a12
Show file tree
Hide file tree
Showing 5 changed files with 8,270 additions and 13,913 deletions.
66 changes: 66 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// .commitlintrc.js
/** @type {import('cz-git').UserConfig} */
module.exports = {
rules: {
// @see: https://commitlint.js.org/#/reference-rules
},
prompt: {
alias: { fd: "docs: fix typos" },
messages: {
type: "Select the type of change that you're committing:",
scope: "Denote the SCOPE of this change (optional):",
customScope: "Denote the SCOPE of this change:",
subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
footerPrefixesSelect: "Select the ISSUES type of changeList by this change (optional):",
customFooterPrefix: "Input ISSUES prefix:",
footer: "List any ISSUES by this change. E.g.: #31, #34:\n",
generatingByAI: 'Generating your AI commit subject...',
generatedSelectByAI: 'Select suitable subject by AI generated:',
confirmCommit: "Are you sure you want to proceed with the commit above?"
},
types: [
{ value: "feat", name: "feat: ✨ A new feature", emoji: ":sparkles:" },
{ value: "fix", name: "fix: 🐛 A bug fix", emoji: ":bug:" },
{ value: "docs", name: "docs: 📝 Documentation only changes", emoji: ":memo:" },
{ value: "style", name: "style: 💄 Changes that do not affect the meaning of the code", emoji: ":lipstick:" },
{ value: "refactor", name: "refactor: ♻️ A code change that neither fixes a bug nor adds a feature", emoji: ":recycle:" },
{ value: "perf", name: "perf: ⚡️ A code change that improves performance", emoji: ":zap:" },
{ value: "test", name: "test: ✅ Adding missing tests or correcting existing tests", emoji: ":white_check_mark:" },
{ value: "build", name: "build: 📦️ Changes that affect the build system or external dependencies", emoji: ":package:" },
{ value: "ci", name: "ci: 🎡 Changes to our CI configuration files and scripts", emoji: ":ferris_wheel:" },
{ value: "chore", name: "chore: 🔨 Other changes that don't modify src or test files", emoji: ":hammer:" },
{ value: "revert", name: "revert: ⏪️ Reverts a previous commit", emoji: ":rewind:" }
],
useEmoji: false,
emojiAlign: "center",
useAI: false,
aiNumber: 1,
themeColorCode: "",
scopes: [],
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: "bottom",
customScopesAlias: "custom",
emptyScopesAlias: "empty",
upperCaseSubject: false,
markBreakingChangeMode: false,
allowBreakingChanges: ['feat', 'fix'],
breaklineNumber: 100,
breaklineChar: "|",
skipQuestions: [],
issuePrefixes: [{ value: "closed", name: "closed: ISSUES has been processed" }],
customIssuePrefixAlign: "top",
emptyIssuePrefixAlias: "skip",
customIssuePrefixAlias: "custom",
allowCustomIssuePrefix: true,
allowEmptyIssuePrefix: true,
confirmColorize: true,
scopeOverrides: undefined,
defaultBody: "",
defaultIssues: "",
defaultScope: "",
defaultSubject: ""
}
};
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@
"scripts": {
"astro": "pnpm --filter @frontend.mu/astro",
"nuxt": "pnpm --filter @frontend.mu/nuxt",
"data": "pnpm --filter @frontend.mu/data"
"data": "pnpm --filter @frontend.mu/data",
"commit": "cz"
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@9.2.0+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771"
}
"packageManager": "pnpm@9.2.0+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771",
"devDependencies": {
"@commitlint/cli": "^19.4.0",
"commitizen": "^4.3.0",
"cz-git": "^1.9.4"
}
}
10 changes: 5 additions & 5 deletions packages/frontendmu-astro/src/data/contributors.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"username": "MrSunshyne",
"contributions": 633
"contributions": 643
},
{
"username": "houzyk",
Expand All @@ -27,6 +27,10 @@
"username": "derecklhw",
"contributions": 18
},
{
"username": "k3ii",
"contributions": 16
},
{
"username": "cedpoilly",
"contributions": 13
Expand All @@ -39,10 +43,6 @@
"username": "Aurazor",
"contributions": 12
},
{
"username": "k3ii",
"contributions": 11
},
{
"username": "github-actions[bot]",
"contributions": 9
Expand Down
10 changes: 5 additions & 5 deletions packages/frontendmu-data/data/contributors.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"username": "MrSunshyne",
"contributions": 633
"contributions": 643
},
{
"username": "houzyk",
Expand All @@ -27,6 +27,10 @@
"username": "derecklhw",
"contributions": 18
},
{
"username": "k3ii",
"contributions": 16
},
{
"username": "cedpoilly",
"contributions": 13
Expand All @@ -39,10 +43,6 @@
"username": "Aurazor",
"contributions": 12
},
{
"username": "k3ii",
"contributions": 11
},
{
"username": "github-actions[bot]",
"contributions": 9
Expand Down
Loading

0 comments on commit a536a12

Please sign in to comment.