We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56207b1 commit 19eb5fcCopy full SHA for 19eb5fc
1 file changed
scripts/next-version.ts
@@ -65,15 +65,15 @@ export async function getNextVersion(): Promise<VersionInfo> {
65
66
for (const line of commits) {
67
if (/BREAKING CHANGE|!:/.test(line)) hasBreaking = true
68
- if (/^feat[:(]/.test(line)) hasFeat = true
69
- if (/^fix[:(]/.test(line)) hasFix = true
+ if (/^feat(?:\([^)]*\))?!?:/.test(line)) hasFeat = true
+ if (/^fix(?:\([^)]*\))?!?:/.test(line)) hasFix = true
70
}
71
72
const [major = 0, minor = 0, patch = 0] = current.split('.').map(Number)
73
74
let next: string
75
- if (hasBreaking && major > 0) {
76
- next = `${major + 1}.0.0`
+ if (hasBreaking) {
+ next = major > 0 ? `${major + 1}.0.0` : `${major}.${minor + 1}.0`
77
} else if (hasFeat) {
78
next = `${major}.${minor + 1}.0`
79
} else if (hasFix || commits.length > 0) {
0 commit comments