aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/monorepo-scripts/src')
-rw-r--r--packages/monorepo-scripts/src/custom_prepublish.ts7
1 files changed, 6 insertions, 1 deletions
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;