Skip to content

Commit

Permalink
feat(none): 🎸 增加 commit 提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Maidang1 committed Sep 24, 2024
1 parent 7870a99 commit 298e851
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 2 deletions.
88 changes: 88 additions & 0 deletions changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module.exports = {
disableEmoji: false,
format: "{type}{scope}: {emoji}{subject}",
list: [
"test",
"feat",
"fix",
"chore",
"docs",
"refactor",
"style",
"ci",
"perf",
],
maxMessageLength: 64,
minMessageLength: 3,
questions: [
"type",
"scope",
"subject",
"body",
"breaking",
"issues",
"lerna",
],
scopes: ["js-plugins", "rust-plugins", "all", "none"],
types: {
chore: {
description: "Build process or auxiliary tool changes",
emoji: "🤖",
value: "chore",
},
ci: {
description: "CI related changes",
emoji: "🎡",
value: "ci",
},
docs: {
description: "Documentation only changes",
emoji: "✏️",
value: "docs",
},
feat: {
description: "A new feature",
emoji: "🎸",
value: "feat",
},
fix: {
description: "A bug fix",
emoji: "🐛",
value: "fix",
},
perf: {
description: "A code change that improves performance",
emoji: "⚡️",
value: "perf",
},
refactor: {
description: "A code change that neither fixes a bug or adds a feature",
emoji: "💡",
value: "refactor",
},
release: {
description: "Create a release commit",
emoji: "🏹",
value: "release",
},
style: {
description: "Markup, white-space, formatting, missing semi-colons...",
emoji: "💄",
value: "style",
},
test: {
description: "Adding missing tests",
emoji: "💍",
value: "test",
},
messages: {
type: "Select the type of change that you're committing:",
customScope: "Select the scope this component affects:",
subject: "Write a short, imperative mood description of the change:\n",
body: "Provide a longer description of the change:\n ",
breaking: "List any breaking changes:\n",
footer: "Issues this commit closes, e.g #123:",
confirmCommit: "The packages that this commit has affected\n",
},
},
};
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const scoreRule = (parsed) => {

return [
isValid,
`current scope is ${pc.yellow(parsed.scope)}, ${pc.green(
`current scope is ${pc.red(parsed.scope)}, ${pc.green(
"because we need the right scope to do CI dispatch"
)} .Mark ${pc.yellowBright(
"js-plugins"
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"packageManager": "[email protected]",
"scripts": {
"release": "npx changeset && npx changeset version",
"prepare": "husky"
"prepare": "husky",
"commit": "git cz"
},
"keywords": [],
"author": "",
Expand All @@ -14,7 +15,13 @@
"@changesets/cli": "^2.27.7",
"@farmfe/plugin-tools": "latest",
"commitlint": "^19.5.0",
"git-cz": "^4.9.0",
"husky": "^9.1.6",
"picocolors": "^1.1.0"
},
"config": {
"commitizen": {
"path": "git-cz"
}
}
}
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 298e851

Please sign in to comment.