Skip to content
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

Project management: Add prepublish packages command for npm releases #19214

merged 4 commits into from Dec 19, 2019


Copy link

gziolo commented Dec 18, 2019


This PR adds a new command which handles prepublish to npm steps for a stable version of WordPress packages.

At the moment it only covers those steps which handle git management before Lerna takes over publishing to npm.

Check more details about the manual process in

How has this been tested?

./bin/commander.js prepublish-packages-stable


  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .
@gziolo gziolo requested a review from youknowriad Dec 18, 2019
@gziolo gziolo requested review from ajitbohra, nerrad and ntwb as code owners Dec 18, 2019
@gziolo gziolo self-assigned this Dec 18, 2019
await runPushGitChangesStep( releaseBranch, abortMessage );

abortMessage = 'Aborting! The release is finished though.';
await runCleanLocalCloneStep( abortMessage );

This comment has been minimized.

Copy link

gziolo Dec 18, 2019

Author Member

This references svn folder which doesn’t exist in this context causing errors.

bin/commander.js Outdated Show resolved Hide resolved
Copy link

youknowriad left a comment

I haven't tested, but it's looking good.

Good job.

gziolo and others added 2 commits Dec 19, 2019
Co-Authored-By: Riad Benguella <>
].map( async ( directoryPath ) => {
if ( fs.existsSync( directoryPath ) ) {
await rimraf( directoryPath, ( err ) => {

This comment has been minimized.

Copy link

gziolo Dec 19, 2019

Author Member

They do the same trick in rimraf in their bin implementation:

This comment has been minimized.

Copy link

gziolo Dec 19, 2019

Author Member

It fixes the following error I observed locally:

The following error happened during the "Cleaning the temporary folder" step:
 AssertionError [ERR_ASSERTION]: rimraf: callback function required
    at rimraf (/Users/gziolo/PhpstormProjects/gutenberg/node_modules/rimraf/rimraf.js:52:10)

This comment has been minimized.

Copy link
Member Author

gziolo commented Dec 19, 2019

It was tested already on wp/trunk branch and everything worked properly, see:


@gziolo gziolo merged commit d3fcb4a into master Dec 19, 2019
1 of 2 checks passed
1 of 2 checks passed
Travis CI - Pull Request Build Errored
@gziolo gziolo deleted the update/publish-npm-packages branch Dec 19, 2019
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.