提交 1a6d5ed1 authored 作者: hejie's avatar hejie

ci: 🎡 添加交互式提交功能

上级 05f9b1ba
// @ts-check
/** @type {import("@commitlint/types").UserConfig} */
export default {
ignores: [commit => commit.includes("init")],
extends: ["@commitlint/config-conventional"],
rules: {
"body-leading-blank": [2, "always"],
"footer-leading-blank": [1, "always"],
"header-max-length": [2, "always", 108],
"subject-empty": [2, "never"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"feat",
"fix",
"perf",
"style",
"docs",
"test",
"refactor",
"build",
"ci",
"chore",
"revert",
"wip",
"workflow",
"types",
"release"
]
]
}
};
// @ts-check module.exports = {
/** @type {import("@commitlint/types").UserConfig} */
export default {
ignores: [commit => commit.includes("init")],
extends: ["@commitlint/config-conventional"], extends: ["@commitlint/config-conventional"],
rules: { rules: {
"body-leading-blank": [2, "always"], "body-leading-blank": [2, "always"],
...@@ -16,11 +12,11 @@ export default { ...@@ -16,11 +12,11 @@ export default {
[ [
"feat", "feat",
"fix", "fix",
"perf",
"style",
"docs", "docs",
"test", "style",
"refactor", "refactor",
"perf",
"test",
"build", "build",
"ci", "ci",
"chore", "chore",
...@@ -31,5 +27,83 @@ export default { ...@@ -31,5 +27,83 @@ export default {
"release" "release"
] ]
] ]
},
prompt: {
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',
footerPrefixsSelect:
"Select the ISSUES type of changeList by this change (optional):",
customFooterPrefixs: "Input ISSUES prefix:",
footer: "List any ISSUES by this change. E.g.: #31, #34:\n",
confirmCommit: "Are you sure you want to proceed with the commit above?"
},
types: [
{ value: "feat", name: "feat: 🚀 A new feature", emoji: "🚀" },
{ value: "fix", name: "fix: 🧩 A bug fix", emoji: "🧩" },
{
value: "docs",
name: "docs: 📚 Documentation only changes",
emoji: "📚"
},
{
value: "style",
name: "style: 🎨 Changes that do not affect the meaning of the code",
emoji: "🎨"
},
{
value: "refactor",
name: "refactor: ♻️ A code change that neither fixes a bug nor adds a feature",
emoji: "♻️"
},
{
value: "perf",
name: "perf: ⚡️ A code change that improves performance",
emoji: "⚡️"
},
{
value: "test",
name: "test: ✅ Adding missing tests or correcting existing tests",
emoji: "✅"
},
{
value: "build",
name: "build: 📦️ Changes that affect the build system or external dependencies",
emoji: "📦️"
},
{
value: "ci",
name: "ci: 🎡 Changes to our CI configuration files and scripts",
emoji: "🎡"
},
{
value: "chore",
name: "chore: 🔨 Other changes that don't modify src or test files",
emoji: "🔨"
},
{
value: "revert",
name: "revert: ⏪️ Reverts a previous commit",
emoji: "⏪️"
},
{ value: "wip", name: "wip: 🕔 work in process", emoji: "🕔" },
{
value: "workflow",
name: "workflow: 📋 workflow improvements",
emoji: "📋"
},
{
value: "types",
name: "types: 🔰 type definition file changes",
emoji: "🔰"
}
],
useEmoji: true,
allowBreakingChanges: ["feat", "fix"]
} }
}; };
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
"lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint", "lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint",
"prepare": "husky", "prepare": "husky",
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
"plop": "plop --plopfile ./plop-templates/plopfile.cjs" "plop": "plop --plopfile ./plop-templates/plopfile.cjs",
"commit": "git-cz"
}, },
"keywords": [ "keywords": [
"vue-pure-admin", "vue-pure-admin",
...@@ -138,7 +139,9 @@ ...@@ -138,7 +139,9 @@
"@vitejs/plugin-vue-jsx": "^4.1.2", "@vitejs/plugin-vue-jsx": "^4.1.2",
"boxen": "^8.0.1", "boxen": "^8.0.1",
"code-inspector-plugin": "^0.20.7", "code-inspector-plugin": "^0.20.7",
"commitizen": "^4.3.1",
"cssnano": "^7.0.6", "cssnano": "^7.0.6",
"cz-git": "^1.11.1",
"dagre": "^0.8.5", "dagre": "^0.8.5",
"eslint": "^9.24.0", "eslint": "^9.24.0",
"eslint-config-prettier": "^10.1.1", "eslint-config-prettier": "^10.1.1",
...@@ -205,5 +208,10 @@ ...@@ -205,5 +208,10 @@
"typeit", "typeit",
"vue-demi" "vue-demi"
] ]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-git"
}
} }
} }
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论