aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/publish.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-24 02:36:03 +0800
committerFabio Berger <me@fabioberger.com>2018-07-24 02:36:03 +0800
commit15bbbb37623845f5bb425e5ae3dbd0e02154cb0c (patch)
treed773902c7fea6879049eb73cb0796d90145bfa13 /packages/monorepo-scripts/src/publish.ts
parentc9ee526d8b34638e457db32b9df801c05c197eea (diff)
downloaddexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.tar
dexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.tar.gz
dexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.tar.bz2
dexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.tar.lz
dexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.tar.xz
dexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.tar.zst
dexon-sol-tools-15bbbb37623845f5bb425e5ae3dbd0e02154cb0c.zip
Make sure private packages have a next version
Diffstat (limited to 'packages/monorepo-scripts/src/publish.ts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts8
1 files changed, 8 insertions, 0 deletions
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');