From 15bbbb37623845f5bb425e5ae3dbd0e02154cb0c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 23 Jul 2018 20:36:03 +0200 Subject: Make sure private packages have a next version --- packages/monorepo-scripts/src/publish.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index df93a46a0..9268de796 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -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'); -- cgit v1.2.3