зеркало из https://github.com/microsoft/beachball.git
Ensure it bumps premajor, preminor and prepatch with a prereleasePrefix (#957)
This commit is contained in:
Родитель
28dd0ad46c
Коммит
8854e98713
|
@ -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;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче