Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.66 KB

PUBLISH.md

File metadata and controls

62 lines (40 loc) · 1.66 KB

Publishing packages

Since enonic-npm-modules is a monorepo, all packages should be published using Lerna. It's still possible to publish with npm or yarn, but it's not recommended.

Prepare

npm

Check if you are logged in to the npm from terminal:

npm whoami

...and login, if you haven't yet:

npm login

For more information read the documentation.

Lerna

To publish packages with Lerna, you can just run the npm script:

npm run publish:all

Lerna will try to publish each package, that has changes since the last release, even if the README file is the only file that has changes. Unfortunately, it can't be avoided.

To use lerna commands directly, you may need to install it globally.

Publish

Here are the common steps for changing and publishing your code:

  1. Update something in the packages and commit your changes;
  2. Run npm run publish:all;
  3. Proceed with the steps in the prompt.

Something went wrong

Don't panic! Your problem may have a solution below.

Publishing failed

If publishing failed on the last step and Lerna already updated package.json, created commit with tags, you may want to fix the problem and try again:

lerna publish --force-publish $(ls packages/)

..or remove the tags and commit and start from scratch with two commands:

git tag -d $(git tag -l --points-at HEAD)

git reset --hard HEAD~1

Other issues

Look at the official Lerna FAQ.