aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/monorepo-scripts/src/publish.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 45dea9796..36970f85b 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -122,9 +122,9 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
const packageName = lernaPackage.package.name;
const changelogJSONPath = path.join(lernaPackage.location, 'CHANGELOG.json');
const changelogJSON = utils.getChangelogJSONOrCreateIfMissing(changelogJSONPath);
- let changelogs: Changelog;
+ let changelog: Changelog;
try {
- changelogs = JSON.parse(changelogJSON);
+ changelog = JSON.parse(changelogJSON);
} catch (err) {
throw new Error(
`${lernaPackage.package.name}'s CHANGELOG.json contains invalid JSON. Please fix and try again.`,
@@ -132,7 +132,7 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
}
const currentVersion = lernaPackage.package.version;
- const shouldAddNewEntry = changelogUtils.shouldAddNewChangelogEntry(currentVersion, changelogs);
+ const shouldAddNewEntry = changelogUtils.shouldAddNewChangelogEntry(currentVersion, changelog);
if (shouldAddNewEntry) {
// Create a new entry for a patch version with generic changelog entry.
const nextPatchVersion = utils.getNextPatchVersion(currentVersion);
@@ -145,27 +145,27 @@ async function updateChangeLogsAsync(updatedPublicLernaPackages: LernaPackage[])
},
],
};
- changelogs = [newChangelogEntry, ...changelogs];
+ changelog = [newChangelogEntry, ...changelog];
packageToVersionChange[packageName] = semverDiff(currentVersion, nextPatchVersion);
} else {
// Update existing entry with timestamp
- const lastEntry = changelogs[0];
+ const lastEntry = changelog[0];
if (_.isUndefined(lastEntry.timestamp)) {
lastEntry.timestamp = TODAYS_TIMESTAMP;
}
// Check version number is correct.
const proposedNextVersion = lastEntry.version;
lastEntry.version = updateVersionNumberIfNeeded(currentVersion, proposedNextVersion);
- changelogs[0] = lastEntry;
+ changelog[0] = lastEntry;
packageToVersionChange[packageName] = semverDiff(currentVersion, lastEntry.version);
}
// Save updated CHANGELOG.json
- fs.writeFileSync(changelogJSONPath, JSON.stringify(changelogs, null, '\t'));
+ fs.writeFileSync(changelogJSONPath, JSON.stringify(changelog, null, '\t'));
await utils.prettifyAsync(changelogJSONPath, constants.monorepoRootPath);
utils.log(`${packageName}: Updated CHANGELOG.json`);
// Generate updated CHANGELOG.md
- const changelogMd = changelogUtils.generateChangelogMd(changelogs);
+ const changelogMd = changelogUtils.generateChangelogMd(changelog);
const changelogMdPath = path.join(lernaPackage.location, 'CHANGELOG.md');
fs.writeFileSync(changelogMdPath, changelogMd);
await utils.prettifyAsync(changelogMdPath, constants.monorepoRootPath);