@astral/commitlint-config 2.6.0 → 2.6.2
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 +3 -1
- package/{index.js → config.js} +10 -6
- package/package.json +6 -10
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ module.exports = createConfig({
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### Message example
|
|
38
|
+
|
|
38
39
|
#### Valid
|
|
39
40
|
```feat(UIKIT-222,ui): Title```
|
|
40
41
|
```feat: Title```
|
|
@@ -62,8 +63,8 @@ Default ENUM:
|
|
|
62
63
|
- test - написаны или изменены тесты проекта
|
|
63
64
|
- major - breaking changes. Полезен для пакетов. Можно связать с релизом major версии
|
|
64
65
|
|
|
65
|
-
|
|
66
66
|
# API
|
|
67
|
+
|
|
67
68
|
## createConfig
|
|
68
69
|
```ts
|
|
69
70
|
const { createConfig } = require('@astral/commitlint-config');
|
|
@@ -91,3 +92,4 @@ type Params = {
|
|
|
91
92
|
|
|
92
93
|
createConfig(params: Params);
|
|
93
94
|
```
|
|
95
|
+
|
package/{index.js → config.js}
RENAMED
|
@@ -64,20 +64,24 @@ const createConfig = ({
|
|
|
64
64
|
2,
|
|
65
65
|
'always',
|
|
66
66
|
({ scope }) => {
|
|
67
|
-
const ticketPrefixes = Array.isArray(ticketPrefix)
|
|
67
|
+
const ticketPrefixes = Array.isArray(ticketPrefix)
|
|
68
|
+
? ticketPrefix
|
|
69
|
+
: [ticketPrefix];
|
|
68
70
|
|
|
69
|
-
const isTicketScope = ticketPrefixes.some((prefix) =>
|
|
71
|
+
const isTicketScope = ticketPrefixes.some((prefix) =>
|
|
72
|
+
scope?.startsWith(`${prefix}-`),
|
|
73
|
+
);
|
|
70
74
|
|
|
71
75
|
if (!scope || scopes.includes(scope) || isTicketScope) {
|
|
72
76
|
return [true];
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
const formattedTickets = ticketPrefixes.map(
|
|
76
|
-
|
|
77
|
-
const scopesEnumsMessage = [...scopes, ...formattedTickets].join(
|
|
78
|
-
', ',
|
|
79
|
+
const formattedTickets = ticketPrefixes.map(
|
|
80
|
+
(ticket) => `${ticket}-XXXX`,
|
|
79
81
|
);
|
|
80
82
|
|
|
83
|
+
const scopesEnumsMessage = [...scopes, ...formattedTickets].join(', ');
|
|
84
|
+
|
|
81
85
|
return [false, `scope must be one of [${scopesEnumsMessage}]`];
|
|
82
86
|
},
|
|
83
87
|
],
|
package/package.json
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/commitlint-config",
|
|
3
|
-
"main": "./
|
|
4
|
-
"version": "2.6.0",
|
|
3
|
+
"main": "./config.js",
|
|
5
4
|
"dependencies": {
|
|
6
|
-
"@commitlint/config-conventional": "^
|
|
7
|
-
"commitlint-plugin-function-rules": "^
|
|
5
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
6
|
+
"commitlint-plugin-function-rules": "^4.0.1"
|
|
8
7
|
},
|
|
9
8
|
"peerDependencies": {
|
|
10
9
|
"commitlint": ">=16.x.x"
|
|
11
10
|
},
|
|
11
|
+
"version": "2.6.2",
|
|
12
12
|
"author": "Astral.Soft",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "
|
|
17
|
-
}
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/kaluga-astral/code-style/issues"
|
|
20
|
-
},
|
|
21
|
-
"keywords": []
|
|
16
|
+
"url": "https://git.astralnalog.ru/frontend.shared/commitlint-config"
|
|
17
|
+
}
|
|
22
18
|
}
|