From 13d61f47d9e89c1d831dd3c0ba73a634ab3853f4 Mon Sep 17 00:00:00 2001 From: MaxKless <34165455+MaxKless@users.noreply.github.com> Date: Wed, 28 Sep 2022 20:53:34 +0200 Subject: [PATCH] docs(core): update contributing.md guide on local publishing (#12283) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(core): update contributing.md guide on local publishing * docs(misc): add note about disabling local registry Co-authored-by: Miroslav Jonaš --- CONTRIBUTING.md | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 303d0ae1b7..ef94a12bf6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,30 +56,18 @@ it can be useful to publish to a local registry. Check out [this video for a live walkthrough](https://youtu.be/Tx257WpNsxc) or follow the instructions below: -```bash -# Starts the local registry. Keep this running in a separate terminal. -yarn local-registry start - -# Set npm and yarn to use the local registry. -# Note: This reroutes your installs to your local registry -yarn local-registry enable - -# Revert npm and yarn to use their default registries -yarn local-registry disable -``` - -To publish packages to a local registry, do the following: - - Run `yarn local-registry start` in Terminal 1 (keep it running) - Run `npm adduser --registry http://localhost:4873` in Terminal 2 (real credentials are not required, you just need to be logged in. You can use test/test/test@test.io.) - Run `yarn local-registry enable` in Terminal 2 -- Run `yarn nx-release 999.9.9 --local` in Terminal 2 +- Run `yarn nx-release 15.0.0 --local` in Terminal 2 - you can choose any nonexistent version number here, but it's recommended to use the next major - Run `cd ./tmp` in Terminal 2 -- Run `npx create-nx-workspace@999.9.9` in Terminal 2 +- Run `npx create-nx-workspace@15.0.0` in Terminal 2 If you have problems publishing, make sure you use Node 16 and NPM 6 or 8. +**NOTE:** After you finish with local testing don't forget to stop the local registry (either closing the Terminal 1 or running `yarn local-registry stop`) and disabling the local registy using `yarn local-registry disable`. Keeping local registry enabled will change your lock file resolutions to `localhost:4873` on the next `yarn install`. + ### Publishing for Yarn 2+ (Berry) Yarn Berry operates slightly differently than Yarn Classic. In order to publish packages for Berry follow next steps: