Ensure it bumps premajor, preminor and prepatch with a prereleasePrefix (#957)

This commit is contained in:
Kjell 2024-04-10 02:07:27 +02:00 коммит произвёл GitHub
Родитель 28dd0ad46c
Коммит 8854e98713
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Ensure we can bump premajor, preminor and prepatch with a prereleasePrefix",
"packageName": "beachball",
"email": "kjell.knapen@craftzing.com",
"dependentChangeType": "patch"
}

Просмотреть файл

@ -17,10 +17,16 @@ export function bumpPackageInfoVersion(pkgName: string, bumpInfo: BumpInfo, opti
} else if (info.private) { } else if (info.private) {
console.log(`Skipping bumping private package "${pkgName}"`); console.log(`Skipping bumping private package "${pkgName}"`);
} else { } else {
// Ensure we can bump the correct versions
let bumpAsPrerelease = false;
if (options.prereleasePrefix && ! ["premajor", "preminor", "prepatch"].includes(changeType)) {
bumpAsPrerelease = true;
}
// Version should be updated // Version should be updated
info.version = semver.inc( info.version = semver.inc(
info.version, info.version,
options.prereleasePrefix ? 'prerelease' : changeType, bumpAsPrerelease ? 'prerelease' : changeType,
options.prereleasePrefix || undefined, options.prereleasePrefix || undefined,
options.identifierBase options.identifierBase
) as string; ) as string;