aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-02 19:32:22 +0800
committerFabio Berger <me@fabioberger.com>2018-07-02 19:32:22 +0800
commitbdda1f2992ac41ea62ad4bfe2d48988a8e98bf42 (patch)
tree9c9b1b65fd0ce546fd57bf2fef94e5277d79451c /packages
parent9c7289d7a3824e32cb0e88a27e3fa8585da8e1ec (diff)
downloaddexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.tar
dexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.tar.gz
dexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.tar.bz2
dexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.tar.lz
dexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.tar.xz
dexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.tar.zst
dexon-sol-tools-bdda1f2992ac41ea62ad4bfe2d48988a8e98bf42.zip
Throw if changelog version is below package.json version
Diffstat (limited to 'packages')
-rw-r--r--packages/monorepo-scripts/src/utils/utils.ts3
1 files changed, 3 insertions, 0 deletions
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;