@10stars/config 15.0.5 → 15.0.7
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/package.json +2 -1
- package/src/index.ts +20 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10stars/config",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"config": "./src/index.ts"
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"oxfmt": "0.21.0",
|
|
24
24
|
"oxlint": "1.36.0",
|
|
25
25
|
"oxlint-tsgolint": "0.10.0",
|
|
26
|
+
"tsx": "^4.21.0",
|
|
26
27
|
"type-fest": "^5.0.0",
|
|
27
28
|
"typescript": "~5.9.3"
|
|
28
29
|
}
|
package/src/index.ts
CHANGED
|
@@ -69,8 +69,26 @@ const actions = {
|
|
|
69
69
|
const commitMsgFile = process.argv[3] || `.git/COMMIT_EDITMSG`
|
|
70
70
|
const message = fs.readFileSync(commitMsgFile, `utf8`)
|
|
71
71
|
const firstLine = message.split(`\n`)[0] || ``
|
|
72
|
-
const VALID_LABELS = [
|
|
73
|
-
|
|
72
|
+
const VALID_LABELS = [
|
|
73
|
+
// labels from keepachangelog
|
|
74
|
+
`ADDED`,
|
|
75
|
+
`CHANGED`,
|
|
76
|
+
`DEPRECATED`,
|
|
77
|
+
`REMOVED`,
|
|
78
|
+
`FIXED`,
|
|
79
|
+
`SECURITY`,
|
|
80
|
+
`FIX`, // not in keepachangelog, but a common convention `fix:`
|
|
81
|
+
`DOCS`, // not in keepachangelog, but a common convention `docs:`
|
|
82
|
+
`CHORE`, // not in keepachangelog, but a common convention `chore:`
|
|
83
|
+
`REFACTOR`, // not in keepachangelog, but a common convention `refactor:`
|
|
84
|
+
`REFACTORED`, // not in keepachangelog
|
|
85
|
+
`PERF`, // not in keepachangelog, but a common convention `perf:`
|
|
86
|
+
`TEST`, // not in keepachangelog, but a common convention `test:`
|
|
87
|
+
]
|
|
88
|
+
const isValid = VALID_LABELS.some(
|
|
89
|
+
(label) =>
|
|
90
|
+
firstLine.startsWith(`${label}:`) || firstLine.startsWith(`${label.toLowerCase()}:`),
|
|
91
|
+
)
|
|
74
92
|
|
|
75
93
|
if (!isValid) {
|
|
76
94
|
console.error(`Invalid commit message format.`)
|