@kriac/commitlint-config 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/index.cjs +1 -61
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/package.json +5 -4
- package/dist/index.d.mts +0 -16
- package/dist/index.mjs +0 -59
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @kriac/commitlint-config
|
|
2
|
+
|
|
3
|
+
用于 commitlint 的统一配置插件
|
|
4
|
+
|
|
5
|
+
## 使用
|
|
6
|
+
|
|
7
|
+
### commitlint.config.mjs
|
|
8
|
+
|
|
9
|
+
```mjs
|
|
10
|
+
import config from "@kriac/commitlint-config";
|
|
11
|
+
|
|
12
|
+
export default config({
|
|
13
|
+
scopes: [],
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 选项
|
|
18
|
+
|
|
19
|
+
- scopes: 用于配置提交范围,默认值为空数组
|
|
20
|
+
|
|
21
|
+
## 报告错误
|
|
22
|
+
|
|
23
|
+
欢迎提交 issue 与我们讨论。
|
package/dist/index.cjs
CHANGED
|
@@ -1,61 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const czg = require('czg');
|
|
4
|
-
|
|
5
|
-
const types = [
|
|
6
|
-
{
|
|
7
|
-
name: "feat: \u65B0\u529F\u80FD",
|
|
8
|
-
value: "feat"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
name: "fix: \u4FEE\u590D\u95EE\u9898",
|
|
12
|
-
value: "fix"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "style: \u98CE\u683C\u6539\u52A8",
|
|
16
|
-
value: "style"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "performance: \u6027\u80FD\u4F18\u5316",
|
|
20
|
-
value: "perf"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: "refactor: \u4EE3\u7801\u91CD\u6784",
|
|
24
|
-
value: "refactor"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "test: \u6D4B\u8BD5\u4EE3\u7801",
|
|
28
|
-
value: "test"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: "documentation: \u6587\u6863",
|
|
32
|
-
value: "docs"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "chore: \u6742\u9879/\u5DE5\u7A0B\u4F9D\u8D56",
|
|
36
|
-
value: "chore"
|
|
37
|
-
}
|
|
38
|
-
];
|
|
39
|
-
const typeValues = types.map((item) => {
|
|
40
|
-
return item.value;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
function index(opts) {
|
|
44
|
-
return czg.defineConfig({
|
|
45
|
-
// 提交类型
|
|
46
|
-
types,
|
|
47
|
-
// 提交作用域
|
|
48
|
-
scopes: opts?.scopes || [],
|
|
49
|
-
// 跳过问题
|
|
50
|
-
skipQuestions: ["body", "breaking", "footerPrefix", "footer"],
|
|
51
|
-
// 自定义规则
|
|
52
|
-
rules: {
|
|
53
|
-
// 必须要定义类型
|
|
54
|
-
"type-empty": [2, "never"],
|
|
55
|
-
// 类型必须在枚举范围内
|
|
56
|
-
"type-enum": [2, "always", typeValues]
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
module.exports = index;
|
|
1
|
+
"use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var a in t)n(e,a,{get:t[a],enumerable:!0})},y=(e,t,a,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of i(t))!l.call(e,o)&&o!==a&&n(e,o,{get:()=>t[o],enumerable:!(p=u(t,o))||p.enumerable});return e};var c=e=>y(n({},"__esModule",{value:!0}),e);var x={};f(x,{default:()=>v});module.exports=c(x);var m=require("czg");var r=[{name:"feat: \u65B0\u529F\u80FD",value:"feat"},{name:"fix: \u4FEE\u590D\u95EE\u9898",value:"fix"},{name:"style: \u98CE\u683C\u6539\u52A8",value:"style"},{name:"performance: \u6027\u80FD\u4F18\u5316",value:"perf"},{name:"refactor: \u4EE3\u7801\u91CD\u6784",value:"refactor"},{name:"test: \u6D4B\u8BD5\u4EE3\u7801",value:"test"},{name:"documentation: \u6587\u6863",value:"docs"},{name:"chore: \u6742\u9879/\u5DE5\u7A0B\u4F9D\u8D56",value:"chore"}],s=r.map(e=>e.value);function v(e){let{scopes:t=[]}=e||{};return(0,m.defineConfig)({types:r,scopes:t,skipQuestions:["body","breaking","footerPrefix","footer"],rules:{"type-empty":[2,"never"],"type-enum":[2,"always",s]}})}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineConfig as n}from"czg";var t=[{name:"feat: \u65B0\u529F\u80FD",value:"feat"},{name:"fix: \u4FEE\u590D\u95EE\u9898",value:"fix"},{name:"style: \u98CE\u683C\u6539\u52A8",value:"style"},{name:"performance: \u6027\u80FD\u4F18\u5316",value:"perf"},{name:"refactor: \u4EE3\u7801\u91CD\u6784",value:"refactor"},{name:"test: \u6D4B\u8BD5\u4EE3\u7801",value:"test"},{name:"documentation: \u6587\u6863",value:"docs"},{name:"chore: \u6742\u9879/\u5DE5\u7A0B\u4F9D\u8D56",value:"chore"}],o=t.map(e=>e.value);function m(e){let{scopes:a=[]}=e||{};return n({types:t,scopes:a,skipQuestions:["body","breaking","footerPrefix","footer"],rules:{"type-empty":[2,"never"],"type-enum":[2,"always",o]}})}export{m as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kriac/commitlint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"description": "@kriac/commitlint-config",
|
|
6
6
|
"author": "Kriac",
|
|
7
7
|
"homepage": "https://github.com/Kriac/lint-kit",
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"lint": "vue-tsc -b --noEmit",
|
|
18
|
-
"build": "
|
|
18
|
+
"build": "tsup",
|
|
19
19
|
"release": "npm publish --access public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"czg": "1.12.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"
|
|
25
|
+
"@types/node": "25.0.10",
|
|
26
|
+
"tsup": "8.5.1",
|
|
26
27
|
"vue-tsc": "3.2.1"
|
|
27
28
|
},
|
|
28
29
|
"license": "MIT",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"exports": {
|
|
33
34
|
".": {
|
|
34
35
|
"types": "./dist/index.d.ts",
|
|
35
|
-
"import": "./dist/index.
|
|
36
|
+
"import": "./dist/index.js",
|
|
36
37
|
"require": "./dist/index.cjs"
|
|
37
38
|
}
|
|
38
39
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as czg from 'czg';
|
|
2
|
-
|
|
3
|
-
/** 可选项 */
|
|
4
|
-
interface Optional {
|
|
5
|
-
name: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
/** 插件选项 */
|
|
9
|
-
interface PluginOptions {
|
|
10
|
-
/** 扩展作用域 */
|
|
11
|
-
scopes?: Optional[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare function export_default(opts?: PluginOptions): czg.UserConfig;
|
|
15
|
-
|
|
16
|
-
export { export_default as default };
|
package/dist/index.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'czg';
|
|
2
|
-
|
|
3
|
-
const types = [
|
|
4
|
-
{
|
|
5
|
-
name: "feat: \u65B0\u529F\u80FD",
|
|
6
|
-
value: "feat"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: "fix: \u4FEE\u590D\u95EE\u9898",
|
|
10
|
-
value: "fix"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: "style: \u98CE\u683C\u6539\u52A8",
|
|
14
|
-
value: "style"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "performance: \u6027\u80FD\u4F18\u5316",
|
|
18
|
-
value: "perf"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "refactor: \u4EE3\u7801\u91CD\u6784",
|
|
22
|
-
value: "refactor"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "test: \u6D4B\u8BD5\u4EE3\u7801",
|
|
26
|
-
value: "test"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "documentation: \u6587\u6863",
|
|
30
|
-
value: "docs"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "chore: \u6742\u9879/\u5DE5\u7A0B\u4F9D\u8D56",
|
|
34
|
-
value: "chore"
|
|
35
|
-
}
|
|
36
|
-
];
|
|
37
|
-
const typeValues = types.map((item) => {
|
|
38
|
-
return item.value;
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
function index(opts) {
|
|
42
|
-
return defineConfig({
|
|
43
|
-
// 提交类型
|
|
44
|
-
types,
|
|
45
|
-
// 提交作用域
|
|
46
|
-
scopes: opts?.scopes || [],
|
|
47
|
-
// 跳过问题
|
|
48
|
-
skipQuestions: ["body", "breaking", "footerPrefix", "footer"],
|
|
49
|
-
// 自定义规则
|
|
50
|
-
rules: {
|
|
51
|
-
// 必须要定义类型
|
|
52
|
-
"type-empty": [2, "never"],
|
|
53
|
-
// 类型必须在枚举范围内
|
|
54
|
-
"type-enum": [2, "always", typeValues]
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { index as default };
|