Make sure private packages have a next version

This commit is contained in:
Fabio Berger 2018-07-23 20:36:03 +02:00
parent c9ee526d8b
commit 15bbbb3762

View File

@ -122,6 +122,14 @@ async function updateChangeLogsAsync(updatedPublicPackages: Package[]): Promise<
currentVersion,
changelog,
);
if (pkg.packageJson.private) {
const nextPatchVersionIfValid = semver.inc(currentVersion, 'patch');
if (!_.isNull(nextPatchVersionIfValid)) {
packageToNextVersion[packageName] = nextPatchVersionIfValid;
} else {
throw new Error(`Encountered invalid semver version: ${currentVersion} for package: ${packageName}`);
}
}
if (shouldAddNewEntry) {
// Create a new entry for a patch version with generic changelog entry.
const nextPatchVersionIfValid = semver.inc(currentVersion, 'patch');