From bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 2 Jul 2018 13:32:22 +0200 Subject: Throw if changelog version is below package.json version --- packages/monorepo-scripts/src/utils/utils.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/monorepo-scripts/src') diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts index 20bc57bae..b5d139de3 100644 --- a/packages/monorepo-scripts/src/utils/utils.ts +++ b/packages/monorepo-scripts/src/utils/utils.ts @@ -44,6 +44,9 @@ export const utils = { nextVersionIfValid = semver.inc(currentVersion, 'patch'); } const lastEntry = changelog[0]; + if (semver.gt(currentVersion, lastEntry.version)) { + throw new Error(`Package.json version cannot be greater then last CHANGELOG entry. Check: ${packageName}`); + } nextVersionIfValid = semver.eq(lastEntry.version, currentVersion) ? semver.inc(currentVersion, 'patch') : lastEntry.version; -- cgit