Skip to content

Commit

Permalink
docs: document usage of local registry
Browse files Browse the repository at this point in the history
relates #60
  • Loading branch information
twittwer committed Apr 3, 2022
1 parent 896a22b commit 896a037
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
3 changes: 2 additions & 1 deletion verdaccio.json → .verdaccio/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"storage": "./.data/local-registry",
"storage": "../.data/local-registry",
"auth": { "htpasswd": { "file": "./htpasswd" } },
"uplinks": {
"npmjs": {
"url": "https://registry.npmjs.org/",
Expand Down
1 change: 1 addition & 0 deletions .verdaccio/htpasswd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test:$apr1$6pG/Yk6c$EswhDDvYqyCzlO8FqjFzl0
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@
| Project | Description |
| ------------------------------- | ----------------------------------- |
| [Compodoc](./packages/compodoc) | Compodoc executor for Nx workspaces |

## How to try changes locally?

To test changes in a local repository, the package can be published in a local registry:

1. `npm run local-registry start`
2. `npm run local-registry enable`
3. `npm login` (user: test, password: test, email: test@test.io)
4. commit your changes
5. `npx nx run compodoc:release:local`
6. run `npm i -D @twittwer/compodoc@latest` in your local test repository
16 changes: 11 additions & 5 deletions scripts/local-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

COMMAND=$1

status() {
echo "Current registry: $(npm config get registry)"
}

enable() {
echo "Setting registry to local"
echo "To Disable: npm run local-registry disable"
Expand All @@ -13,22 +17,24 @@ enable() {

disable() {
npm config delete registry
CURRENT_NPM_REGISTRY=$(npm config get registry)
echo "Resetting registry to global"
echo "Resetting local registry"
}

start() {
echo "Starting Local Registry"
echo "Starting local registry"
VERDACCIO_HANDLE_KILL_SIGNALS=true
npx verdaccio --config ./verdaccio.json
npx verdaccio --config ./.verdaccio/config.json
}

clear() {
echo "Clearing Local Registry"
echo "Clearing local registry"
rm -rf ./.data/local-registry
}

case $COMMAND in
status)
status
;;
enable)
enable
;;
Expand Down

0 comments on commit 896a037

Please sign in to comment.