Common

Verdaccio

Verdaccio is an open source local NPM registry. We use it to test out publishing and link together projects internally before publishing

  • NOTE: only run verdaccio when you need to test publishing. otherwise, this will pollute the yarn.lock file with localhost entries which will fail in CI/CD

Setup Verdaccio

npm install -g verdaccio

No note with name dendron.dev.cook.common found in cache during parsing.

  • create a user
npm login {user}
# follow login instructions
# this allows you to run `npm publish`
CTRL+C

Switch to local npm

# source helpers 
. bootstrap/scripts/helpers.sh
# change registry to local endpoint
setRegLocal

Switch back to remote endpoint

# switch back to remote endpoint
setRegRemote

Publishing Packages Locally

After you setup a local npm registry, you can run the following commands to publish locally

lerna publish from-package --ignore-scripts
# updates meta.json with latest package versions
node bootstrap/scripts/genMeta.js

Backlinks