Skip to content

Commit

Permalink
show info on publishing after update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Oct 10, 2017
1 parent 3f871ce commit 02dc1ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,4 @@ _book
###############################################################################

.nyc_output
.vscode
21 changes: 20 additions & 1 deletion tools/update-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ const collateCommitsPackages = commits => {
collated.lernaPackages = commits.updated.packages.filter(
r => collated.realPackages.indexOf(r) < 0
);
collated.forcePackages = collated.realPackages.filter(
r => commits.updated.packages.indexOf(r) < 0
)
return collated;
});
};
Expand Down Expand Up @@ -243,6 +246,21 @@ const updateChangelog = collated => {
Fs.writeFileSync(changeLogFile, `${updateText}${changeLog}`);
};

const showPublishInfo = collated => {
console.log("publish command: node_modules/.bin/lerna publish",
(collated.forcePackages || []).map(p => `--force-publish ${p}`).join(" "));
const generatorNeedUpdate = collated.realPackages.find( p => {
const pkg = collated.packages[mapPkg(p)];
return p.startsWith("electrode-archetype-react") &&
pkg.newVersion.split(".")[0] > pkg.version.split(".")[0];
});
if (generatorNeedUpdate) {
console.log(
"One of the archetype modules had a major bump, make sure generator-electrode is updated before publishing."
);
}
};

const commitChangeLogFile = clean => {
console.log("Change log updated.");
if (!gitClean) {
Expand All @@ -267,5 +285,6 @@ xsh
.then(collateCommitsPackages)
.then(determinePackageVersions)
.tap(checkGitClean)
.then(updateChangelog)
.tap(updateChangelog)
.then(showPublishInfo)
.then(commitChangeLogFile);

0 comments on commit 02dc1ba

Please sign in to comment.