Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Add pre-publishing script and bump version to 2.0.0-rc1 #494

Merged
merged 3 commits into from
Mar 15, 2019

Conversation

ryelle
Copy link
Member

@ryelle ryelle commented Mar 15, 2019

This PR is technically doing two things for the sake of speed– version bumping for 2.0.0-rc1, and adding some publishing helpers.

The prepack script is called when npm pack and npm publish are run, and I've set it up to re-install dependencies, run linting on PHP, CSS, and JS, run the JS tests, and lastly build the production bundle. This basically checks everything one last time before making sure the build files are up to date. Then it builds the package to either a .tgz file (pack), or pushes it to npm (publish).

This means the only things needed to release a version is to do the version bump (manually, in package.json and woocommerce-gutenberg-products-block.php), and run npm publish

How to test the changes in this Pull Request:

  1. Run npm pack
  2. Expect the steps above to run
  3. You can also try introducing errors, and it will halt the packaging process with the error.

This will re-install dependencies, run linting on PHP, CSS, and JS, run the JS tests, and lastly build the production bundle.
@ryelle ryelle added [Status] Needs Review tools Used for work on build or release tools. labels Mar 15, 2019
@ryelle ryelle added this to the 2.0 + Core Merge milestone Mar 15, 2019
@ryelle ryelle self-assigned this Mar 15, 2019
@ryelle ryelle changed the title Add pre-publishing script and bump version to RC1 Add pre-publishing script and bump version to 2.0.0-rc1 Mar 15, 2019
Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

👍 nice additions here - simplifying and adding in one last sanity check!

@@ -16,9 +16,11 @@
},
"license": "GPL-3.0+",
"scripts": {
"prepack": "npm install && npm run lint && npm run test && npm run build",
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the last safety check before the release, nice addition.

@ryelle ryelle merged commit 52ffc10 into master Mar 15, 2019
@ryelle ryelle deleted the add/prepack-steps branch March 15, 2019 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tools Used for work on build or release tools.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants