@yikoyu/commitlint-config
Version:
yikoyu's commitlint config
17 lines (16 loc) • 3.8 kB
JavaScript
import{execSync as c}from"node:child_process";var o=[{value:"feat",name:"feat: \u2728 \u65B0\u589E\u529F\u80FD | A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \u{1F41B} \u4FEE\u590D\u7F3A\u9677 | A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \u{1F4DD} \u6587\u6863\u66F4\u65B0 | Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \u{1F484} \u4EE3\u7801\u683C\u5F0F | Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F \u4EE3\u7801\u91CD\u6784 | A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F \u6027\u80FD\u63D0\u5347 | A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 \u6D4B\u8BD5\u76F8\u5173 | Adding missing tests or correcting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \u{1F4E6}\uFE0F \u6784\u5EFA\u76F8\u5173 | Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \u{1F3A1} \u6301\u7EED\u96C6\u6210 | Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"revert",name:"revert: \u{1F528} \u56DE\u9000\u4EE3\u7801 | Revert to a commit",emoji:":hammer:"},{value:"chore",name:"chore: \u23EA\uFE0F \u5176\u4ED6\u4FEE\u6539 | Other changes that do not modify src or test files",emoji:":rewind:"}],n={type:`\u9009\u62E9\u4F60\u8981\u63D0\u4EA4\u7684\u7C7B\u578B
Select the type of change that you're committing:`,scope:`\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u8303\u56F4\uFF08\u53EF\u9009\uFF09
Denote the SCOPE of this change (optional):`,customScope:`\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u7684\u63D0\u4EA4\u8303\u56F4
Denote the SCOPE of this change:`,subject:`\u586B\u5199\u7B80\u77ED\u7CBE\u70BC\u7684\u53D8\u66F4\u63CF\u8FF0
Write a SHORT, IMPERATIVE tense description of the change:
`,body:`\u586B\u5199\u66F4\u52A0\u8BE6\u7EC6\u7684\u53D8\u66F4\u63CF\u8FF0\uFF08\u53EF\u9009\uFF09\u3002\u4F7F\u7528 "|" \u6362\u884C
Provide a LONGER description of the change (optional). Use "|" to break new line:
`,breaking:`\u5217\u4E3E\u975E\u517C\u5BB9\u6027\u91CD\u5927\u7684\u53D8\u66F4\uFF08\u53EF\u9009\uFF09\u3002\u4F7F\u7528 "|" \u6362\u884C
List any BREAKING CHANGES (optional). Use "|" to break new line:
`,footerPrefixesSelect:`\u9009\u62E9\u5173\u8054issue\u524D\u7F00\uFF08\u53EF\u9009\uFF09
Select the ISSUES type of changeList by this change (optional):`,customFooterPrefix:`\u8F93\u5165\u81EA\u5B9A\u4E49issue\u524D\u7F00
Input ISSUES prefix:`,footer:`\u5217\u4E3E\u5173\u8054issue (\u53EF\u9009) \u4F8B\u5982: #31, #32
List any ISSUES by this change. E.g.: #31, #34:
`,confirmCommit:`\u662F\u5426\u63D0\u4EA4\u6216\u4FEE\u6539commit ?
Are you sure you want to proceed with the commit above?`};var m=c("git status --porcelain || true").toString().trim().split(`
`),i=m.find(e=>~e.indexOf("M packages"))?.replace(/\//g,"%%")?.match(/packages%%((\w|-)*)/)?.[1];function p(e={}){let s={ignores:[t=>t.includes("init")],extends:["@commitlint/config-conventional"],rules:{"type-enum":[2,"always",o.map(t=>t.value)]},prompt:{alias:{f:"docs: :memo: fix typos",r:"docs: :memo: update README",s:"style: :lipstick: update code format",b:"build: :package: bump dependencies",c:"chore: :rewind: update config"},messages:n,types:o,useEmoji:!0,emojiAlign:"center",customScopesAlign:i?"bottom":"top",defaultScope:i,issuePrefixs:[{value:"link",name:"link: \u94FE\u63A5 ISSUES \u8FDB\u884C\u4E2D | ISSUES has been processed"},{value:"closed",name:"closed: \u6807\u8BB0 ISSUES \u5DF2\u5B8C\u6210 | ISSUES has been completed"}]}};return Object.assign(s,e)}var h=p;export{h as default,p as yikoyu};