Skip to content

Allow skipping packages in a release #1505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions scripts/release/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ const { argv } = require('yargs');
);
versions = await prompt(versionUpdates);

/**
* Remove the skipped packages
*/
Object.keys(versions).forEach(name => {
if (versions[name] === 'skip') {
delete versions[name];
}
});

/**
* Verify that the versions selected are correct
*/
Expand Down
24 changes: 24 additions & 0 deletions scripts/release/utils/inquirer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@ exports.packageVersionUpdate = async (package, releaseType) => {
];
}

/**
* Skip a pacakage
*
* Reason:
* Lerna doesn't work well with merge commits and may mark a package as changed
* even though it's not changed except for the version bump from the last release.
* https://github.com/lerna/lerna/issues/1377
*
* Background:
* We introduced a release branch as a staging area for the next release
* while development continues in the master branch. Eventually we publish the packages from
* the release branch and make the version bumps in package.json and tags. It creats a merge
* commit in the master branch when we merge the release branch back.
*
* Only skip a package if you are sure Lerna listed the package in mistake.
* If you skipped a package, it won't show up in the candidate list going forward
* unless additional changes are made in this package.
*
*/
choices.push({
name: chalk`Skip`,
value: 'skip'
});

/**
* Create prompts
*/
Expand Down