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
merged 4 commits into from
Dec 19, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Dec 18, 2019

Description

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 https://github.com/WordPress/gutenberg/blob/master/docs/contributors/release.md#synchronizing-wordpress-trunk.

How has this been tested?

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

Checklist:

  • 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 self-assigned this Dec 18, 2019
@gziolo gziolo added the [Type] Project Management Meta-issues related to project management of Gutenberg label Dec 18, 2019
await runPushGitChangesStep( releaseBranch, abortMessage );

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Good job.

gziolo and others added 2 commits December 19, 2019 11:52
Co-Authored-By: Riad Benguella <benguella@gmail.com>
svnWorkingDirectoryPath,
].map( async ( directoryPath ) => {
if ( fs.existsSync( directoryPath ) ) {
await rimraf( directoryPath, ( err ) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do the same trick in rimraf in their bin implementation:
https://github.com/isaacs/rimraf/blob/d82bc81f251ba2cc86dc26361a820631091b3e9e/bin.js#L44-L48

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@gziolo
Copy link
Member Author

gziolo commented Dec 19, 2019

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

94a0c81

@gziolo gziolo merged commit d3fcb4a into master Dec 19, 2019
@gziolo gziolo deleted the update/publish-npm-packages branch December 19, 2019 11:31
@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
Labels
[Type] Project Management Meta-issues related to project management of Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants