@brainervirus/workit-core 1.3.2 → 2.0.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/package.json
CHANGED
|
@@ -39,13 +39,12 @@ const TYPE_LEVEL: Record<string, Level> = { fix: "patch", perf: "patch", feat: "
|
|
|
39
39
|
|
|
40
40
|
const subjectLevel = (commit: string): Level | null => {
|
|
41
41
|
const firstLine = commit.split("\n")[0] ?? "";
|
|
42
|
-
const m = /^(
|
|
42
|
+
const m = /^([a-z][a-z0-9-]*)(?:\([^)]*\))?(!)?:/.exec(firstLine);
|
|
43
43
|
if (!m) return null;
|
|
44
|
-
if (m[
|
|
44
|
+
if (m[2]) return "major";
|
|
45
45
|
const body = commit.split("\n").slice(1).join("\n");
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
: TYPE_LEVEL[m[0].split("(")[0].replace("!", "")];
|
|
46
|
+
if (/BREAKING[- ]CHANGE:/.test(body)) return "major";
|
|
47
|
+
return TYPE_LEVEL[m[1]] ?? null;
|
|
49
48
|
};
|
|
50
49
|
|
|
51
50
|
// Two-pass collection (sanctioned by the task brief): the single-pass
|