From ef4919217079dae761db9394527172ed06c1d030 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 30 Mar 2018 12:43:03 +0200 Subject: Add check that timestamp has been set before generating MD version --- packages/monorepo-scripts/src/custom_prepublish.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/monorepo-scripts/src') diff --git a/packages/monorepo-scripts/src/custom_prepublish.ts b/packages/monorepo-scripts/src/custom_prepublish.ts index 2e6b78a71..f49b67142 100644 --- a/packages/monorepo-scripts/src/custom_prepublish.ts +++ b/packages/monorepo-scripts/src/custom_prepublish.ts @@ -139,7 +139,12 @@ CHANGELOG `; _.each(changelogs, changelog => { - const date = moment(changelog.timestamp, 'X').format('MMMM D, YYYY'); + if (_.isUndefined(changelog.timestamp)) { + throw new Error( + 'All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version', + ); + } + const date = moment(`${changelog.timestamp}`, 'X').format('MMMM D, YYYY'); const title = `\n## v${changelog.version} - _${date}_\n\n`; changelogMd += title; -- cgit