|
1 |
| -/* @see: https://cz-git.qbenben.com/zh/guide */ |
2 |
| -/** @type {import('cz-git').UserConfig} */ |
3 |
| -/* CHANGELOG.md @see: https://www.5axxw.com/wiki/content/yy4uxs#96t5oseui9?w */ |
4 |
| -/** |
5 |
| - * feat:新特性、新功能 |
6 |
| - * fix:修改 Bug |
7 |
| - * perf:优化相关,比如提升性能、体验 |
8 |
| - * style:代码格式修改, 注意不是 CSS 修改 |
9 |
| - * docs:仅文档新增、改动 |
10 |
| - * test:测试用例修改 |
11 |
| - * refactor:代码重构 |
12 |
| - * build:编译相关的修改,例如发布版本、对项目构建或者依赖的改动 |
13 |
| - * ci:持续集成修改 |
14 |
| - * chore:其他修改, 比如改变构建流程、或者增加依赖库、工具等 |
15 |
| - * revert:回滚到上一个版本 |
16 |
| - * optimize: 优化构建工具或运行时性能 |
17 |
| - * wip: 开发中 |
18 |
| - * types: 类型定义文件更改 |
19 |
| - */ |
20 |
| -/** |
21 |
| - * git commit -m <type>[optional scope]: <subject> |
22 |
| - * |
23 |
| - type :用于表明我们这次提交的改动类型,是新增了功能?还是修改了测试代码?又或者是更新了文档 |
24 |
| - optional scope:一个可选的修改范围。用于标识此次提交主要涉及到代码中哪个模块。 |
25 |
| - subject:一句话描述此次提交的主要内容,做到言简意赅 |
26 |
| - 如: |
27 |
| - * git commit -m 'fix(hooks): 修复 xxx 的 bug' |
28 |
| - * git commit -m 'refactor: 重构整个项目' |
29 |
| - */ |
30 |
| -export default { |
| 1 | +// docs:https://cz-git.qbb.sh/zh |
| 2 | +import { defineConfig } from "cz-git"; |
| 3 | + |
| 4 | +export default defineConfig({ |
31 | 5 | ignores: [commit => commit.includes("init")],
|
32 | 6 | extends: ["@commitlint/config-conventional"],
|
33 | 7 | rules: {
|
34 |
| - "body-leading-blank": [2, "always"], // body 换行 |
35 |
| - "footer-leading-blank": [1, "always"], // footer 以空行开头 |
36 |
| - "header-max-length": [2, "always", 108], // header 最长 108 |
37 |
| - "subject-empty": [2, "never"], // subject 不能为空 |
38 |
| - "type-empty": [2, "never"], // type 不能为空 |
39 | 8 | "type-enum": [
|
40 | 9 | 2,
|
41 | 10 | "always",
|
42 |
| - [ |
43 |
| - "feat", |
44 |
| - "fix", |
45 |
| - "perf", |
46 |
| - "style", |
47 |
| - "docs", |
48 |
| - "test", |
49 |
| - "refactor", |
50 |
| - "build", |
51 |
| - "ci", |
52 |
| - "chore", |
53 |
| - "revert", |
54 |
| - "optimize", |
55 |
| - "wip", |
56 |
| - "types", |
57 |
| - ], |
| 11 | + ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "revert", "chore"], |
58 | 12 | ],
|
59 | 13 | },
|
60 | 14 | prompt: {
|
61 | 15 | messages: {
|
62 |
| - // type: "Select the type of change that you're committing:", |
63 |
| - // scope: "Denote the SCOPE of this change (optional):", |
64 |
| - // customScope: "Denote the SCOPE of this change:", |
65 |
| - // subject: "Write a SHORT, IMPERATIVE tense description of the change:\n", |
66 |
| - // body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n', |
67 |
| - // breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n', |
68 |
| - // footerPrefixsSelect: "Select the ISSUES type of changeList by this change (optional):", |
69 |
| - // customFooterPrefixs: "Input ISSUES prefix:", |
70 |
| - // footer: "List any ISSUES by this change. E.g.: #31, #34:\n", |
71 |
| - // confirmCommit: "Are you sure you want to proceed with the commit above?", |
72 |
| - // 中文版 |
73 |
| - type: "选择你要提交的类型 :", |
74 |
| - scope: "选择一个提交范围(可选):", |
75 |
| - customScope: "请输入自定义的提交范围 :", |
76 |
| - subject: "填写简短精炼的变更描述 :\n", |
77 |
| - body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n', |
78 |
| - breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n', |
79 |
| - footerPrefixsSelect: "选择关联 issue 前缀(可选):", |
80 |
| - customFooterPrefixs: "输入自定义 issue 前缀 :", |
81 |
| - footer: "列举关联issue (可选) 例如: #31, #I3244 :\n", |
| 16 | + type: "选择你要提交的类型: ", |
| 17 | + scope: "选择一个提交范围(可选): ", |
| 18 | + customScope: "请输入自定义的提交范围: ", |
| 19 | + subject: "填写简短精炼的变更描述:\n", |
| 20 | + body: '填写更加详细的变更描述(可选)。使用 "|" 换行:\n', |
| 21 | + breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行:\n', |
| 22 | + footerPrefixesSelect: "选择关联 Issue 前缀(可选): ", |
| 23 | + customFooterPrefix: "输入自定义 Issue 前缀: ", |
| 24 | + footer: "列举关联 Issue (可选) 例如: #31, #I3244:\n", |
82 | 25 | confirmCommit: "是否提交或修改 commit ?",
|
83 | 26 | },
|
84 | 27 | types: [
|
85 |
| - // { value: "feat", name: "feat: 🚀 A new feature", emoji: "🚀" }, |
86 |
| - // { value: "fix", name: "fix: 🐞 A bug fix", emoji: "🐞" }, |
87 |
| - // { value: "docs", name: "docs: 📚 Documentation only changes", emoji: "📚" }, |
88 |
| - // { value: "style", name: "style: 🎨 Changes that do not affect the meaning of the code", emoji: "🎨" }, |
89 |
| - // { |
90 |
| - // value: "refactor", |
91 |
| - // name: "refactor: ♻️ A code change that neither fixes a bug nor adds a feature", |
92 |
| - // emoji: "♻️", |
93 |
| - // }, |
94 |
| - // { value: "perf", name: "perf: ⚡️ A code change that improves performance", emoji: "⚡️" }, |
95 |
| - // { value: "test", name: "test: ✅ Adding missing tests or correcting existing tests", emoji: "✅" }, |
96 |
| - // { |
97 |
| - // value: "build", |
98 |
| - // name: "build: 📦️ Changes that affect the build system or external dependencies", |
99 |
| - // emoji: "📦️", |
100 |
| - // }, |
101 |
| - // { value: "ci", name: "ci: 🎡 Changes to our CI configuration files and scripts", emoji: "🎡" }, |
102 |
| - // { value: "chore", name: "chore: 🔨 Other changes that don't modify src or test files", emoji: "🔨" }, |
103 |
| - // { value: "revert", name: "revert: ⏪️ Reverts a previous commit", emoji: "⏪️" }, |
104 |
| - // { value: "wip", name: "wip: 🥗 Code development in progress", emoji: "🥗" }, |
105 |
| - // { value: "types", name: "types: 💎 TypeScript Definition File Change", emoji: "💎" }, |
106 |
| - // 中文版 |
107 |
| - { value: "feat", name: "feat: 🚀 新增功能", emoji: "🚀" }, |
108 |
| - { value: "fix", name: "fix: 🐞 修复缺陷(Bug)", emoji: "🐞" }, |
109 |
| - { value: "docs", name: "docs: 📚 文档变更", emoji: "📚" }, |
110 |
| - { value: "style", name: "style: 🎨 代码格式(不影响功能,例如空格、分号等格式修正)", emoji: "🎨" }, |
111 |
| - { value: "refactor", name: "refactor: ♻️ 代码重构(不包括 bug 修复、功能新增)", emoji: "♻️" }, |
112 |
| - { value: "perf", name: "perf: ⚡️ 性能优化", emoji: "⚡️" }, |
113 |
| - { value: "test", name: "test: ✅ 添加疏漏测试或已有测试改动", emoji: "✅" }, |
| 28 | + { value: "feat", name: "feat: 🚀 新增功能 | A new feature", emoji: "🚀" }, |
| 29 | + { value: "fix", name: "fix: 🐞 修复缺陷 | A bug fix", emoji: "🐞" }, |
| 30 | + { value: "docs", name: "docs: 📚 文档更新 | Documentation only changes", emoji: "📚" }, |
| 31 | + { |
| 32 | + value: "style", |
| 33 | + name: "style: 🎨 代码格式 | Changes that do not affect the meaning of the code", |
| 34 | + emoji: "🎨", |
| 35 | + }, |
| 36 | + { |
| 37 | + value: "refactor", |
| 38 | + name: "refactor: ♻️ 代码重构 | A code change that neither fixes a bug nor adds a feature", |
| 39 | + emoji: "♻️", |
| 40 | + }, |
| 41 | + { value: "perf", name: "perf: ⚡️ 性能优化 | A code change that improves performance", emoji: "⚡️" }, |
| 42 | + { |
| 43 | + value: "test", |
| 44 | + name: "test: ✅ 测试相关 | Adding missing tests or correcting existing tests", |
| 45 | + emoji: "✅", |
| 46 | + }, |
114 | 47 | {
|
115 | 48 | value: "build",
|
116 |
| - name: "build: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)", |
| 49 | + name: "build: 📦️ 构建相关 | Changes that affect the build system or external dependencies", |
117 | 50 | emoji: "📦️",
|
118 | 51 | },
|
119 |
| - { value: "ci", name: "ci: 🎡 修改 CI 配置、脚本", emoji: "🎡" }, |
120 |
| - { value: "chore", name: "chore: 🔨 回滚 commit", emoji: "⏪️" }, |
121 |
| - { value: "revert", name: "revert: ⏪️ 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: "🔨" }, |
122 |
| - { value: "wip", name: "wip: 🥗 代码正在开发中", emoji: "🥗" }, |
123 |
| - { value: "types", name: "types: 💎 类型定义文件更改", emoji: "💎" }, |
124 |
| - // 纯中文版 |
125 |
| - // { value: "特性", name: "特性: 🚀 新增功能", emoji: "🚀" }, |
126 |
| - // { value: "修复", name: "修复: 🐞 修复缺陷", emoji: "🐞" }, |
127 |
| - // { value: "文档", name: "文档: 📚 文档变更", emoji: "📚" }, |
128 |
| - // { value: "格式", name: "格式: 🎨 代码格式(不影响功能,例如空格、分号等格式修正)", emoji: "🎨" }, |
129 |
| - // { value: "重构", name: "重构: ♻️ 代码重构(不包括 bug 修复、功能新增)", emoji: "♻️" }, |
130 |
| - // { value: "性能", name: "性能: ⚡️ 性能优化", emoji: "⚡️" }, |
131 |
| - // { value: "测试", name: "测试: ✅ 添加疏漏测试或已有测试改动", emoji: "✅" }, |
132 |
| - // { value: "构建", name: "构建: 📦️ 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)", emoji: "📦️" }, |
133 |
| - // { value: "集成", name: "集成: 🎡 修改 CI 配置、脚本", emoji: "🎡" }, |
134 |
| - // { value: "回退", name: "回退: ⏪️ 回滚 commit", emoji: "⏪️" }, |
135 |
| - // { value: "其他", name: "其他: 🔨 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: "🔨" }, |
136 |
| - // { value: "开发中", name: "开发中: 🥗 代码正在开发中", emoji: "🥗" }, |
137 |
| - // { value: "类型", name: "类型: 💎 类型定义文件更改", emoji: "💎" }, |
| 52 | + { value: "ci", name: "ci: 🎡 持续集成 | Changes to our CI configuration files and scripts", emoji: "🎡" }, |
| 53 | + { value: "revert", name: "revert: ⏪️ 回退代码 | Revert to a commit", emoji: "⏪️" }, |
| 54 | + { |
| 55 | + value: "chore", |
| 56 | + name: "chore: 🔨 其他修改 | Other changes that do not modify src or test files", |
| 57 | + emoji: "🔨", |
| 58 | + }, |
138 | 59 | ],
|
139 | 60 | useEmoji: true,
|
| 61 | + emojiAlign: "center", |
140 | 62 | themeColorCode: "",
|
| 63 | + useAI: false, |
| 64 | + aiNumber: 1, |
141 | 65 | scopes: [],
|
142 | 66 | allowCustomScopes: true,
|
143 | 67 | allowEmptyScopes: true,
|
144 | 68 | customScopesAlign: "bottom",
|
145 | 69 | customScopesAlias: "custom",
|
146 | 70 | emptyScopesAlias: "empty",
|
147 | 71 | upperCaseSubject: false,
|
| 72 | + markBreakingChangeMode: false, |
148 | 73 | allowBreakingChanges: ["feat", "fix"],
|
149 | 74 | breaklineNumber: 100,
|
150 | 75 | breaklineChar: "|",
|
151 | 76 | skipQuestions: [],
|
152 |
| - issuePrefixs: [{ value: "closed", name: "closed: ISSUES has been processed" }], |
153 |
| - customIssuePrefixsAlign: "top", |
154 |
| - emptyIssuePrefixsAlias: "skip", |
155 |
| - customIssuePrefixsAlias: "custom", |
156 |
| - allowCustomIssuePrefixs: true, |
157 |
| - allowEmptyIssuePrefixs: true, |
| 77 | + issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }], |
| 78 | + customIssuePrefixAlign: "top", |
| 79 | + emptyIssuePrefixAlias: "skip", |
| 80 | + customIssuePrefixAlias: "custom", |
| 81 | + allowCustomIssuePrefix: true, |
| 82 | + allowEmptyIssuePrefix: true, |
158 | 83 | confirmColorize: true,
|
159 |
| - maxHeaderLength: Infinity, |
160 |
| - maxSubjectLength: Infinity, |
161 |
| - minSubjectLength: 0, |
162 | 84 | scopeOverrides: undefined,
|
163 | 85 | defaultBody: "",
|
164 | 86 | defaultIssues: "",
|
165 | 87 | defaultScope: "",
|
166 | 88 | defaultSubject: "",
|
167 | 89 | },
|
168 |
| -}; |
| 90 | +}); |
0 commit comments