chore(repo): add --local to release and publish script #2323
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The best way to test fully test new Nx builds locally (especially migrations etc) is by releasing it to a local npm repo.
This PR adds some flags to the
nx-release.js
as well aspublish.sh
to automate some parts of the local release.How does it work
Install Verdaccio & set it up
Installing Verdaccio is quite simple. Just add it as a global package:
(Using Docker could be an alternative. There's an official docker image for it)
Run it with
Setup a dummy user:
You can just use username:
nrwl
, pwd:nrwl
and email:a@a.com
.Set the npm registry
Make your yarn & npm registry point to the local Verdaccio server with
You can always roll it back to the originals with
I've created a simple script for that in case (which you can add to your PATH):
Releasing a new Nx version locally
First make sure you set the NPM / Yarn registry
With this PR, to release a new version locally, just do
The release-it process will ask a couple of questions:
When asked for the credentials, just add the one of ur local repo (i.e.
nrwl:nrwl
)You can then go to http://localhost:4873 which opens Verdaccio's web interface to see the published versions
Want to delete all locally published packages (for whatever reason)?
All the packages are stored in Verdaccio's storage folder which (if you didn't change it) by default resides in
~/.local/share/verdaccio/storage
.As a result, executing...
...removes all
@nrwl
packages