Skip to content

Commit

Permalink
chore(repo): change workspace to use verdaccio executor (nrwl#17280)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi authored May 30, 2023
1 parent a7c6d5a commit b7410e6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 39 deletions.
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,15 @@ 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:

- Run `pnpm local-registry start` in Terminal 1 (keep it running)
- Run `pnpm local-registry` 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/[email protected].)
- Run `pnpm local-registry enable` in Terminal 2
- Run `pnpm nx-release 16.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@16.0.0` in Terminal 2
- Run `npx create-nx-workspace@17.0.0` in Terminal 2

If you have problems publishing, make sure you use Node 18 and NPM 8.

**NOTE:** After you finish with local testing don't forget to stop the local registry (e.g. closing the Terminal 1) and disabling the local registy using `pnpm local-registry disable`. Keeping local registry enabled will change your lock file resolutions to `localhost:4873` on the next `pnpm i`. You can also run `pnpm local-registry clear` to clean all packages in that local registry.

**NOTE:** To use this newly published local version, you need to make a new workspace or change all of your target packages to this new version, eg: `"nx": "^16.0.0",` and re-run `pnpm i` in your testing project.

### Publishing for Yarn 2+ (Berry)
Expand All @@ -101,7 +98,7 @@ Yarn Berry operates slightly differently than Yarn Classic. In order to publish
- localhost
```
- Run `pnpm local-registry start` in Terminal 1 (keep it running)
- Run `pnpm local-registry` in Terminal 1 (keep it running)
- If you are creating nx workspace outside of your nx repo, make sure to add npm registry info to your root yarnrc (
usually in ~/.yarnrc.yml). The file should look something like this:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prepublishOnly": "node ./scripts/update-package-group.js",
"version": "pnpm prettier lerna.json --write",
"depcheck": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/depcheck",
"local-registry": "./scripts/local-registry.sh",
"local-registry": "nx local-registry @nx/nx-source",
"documentation": "ts-node -P scripts/tsconfig.scripts.json ./scripts/documentation/generators/main.ts && pnpm check-documentation-map",
"submit-plugin": "node ./scripts/submit-plugin.js",
"prepare": "is-ci || husky install",
Expand Down
14 changes: 14 additions & 0 deletions project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@nx/nx-source",
"$schema": "node_modules/nx/schemas/project-schema.json",
"targets": {
"local-registry": {
"executor": "@nx/js:verdaccio",
"options": {
"port": 4873,
"config": ".verdaccio/config.yml",
"storage": "build/local-registry/storage"
}
}
}
}
32 changes: 0 additions & 32 deletions scripts/local-registry.sh

This file was deleted.

0 comments on commit b7410e6

Please sign in to comment.