diff --git a/verdaccio.json b/.verdaccio/config.json similarity index 72% rename from verdaccio.json rename to .verdaccio/config.json index 3b8f7e3..9739ee5 100644 --- a/verdaccio.json +++ b/.verdaccio/config.json @@ -1,5 +1,6 @@ { - "storage": "./.data/local-registry", + "storage": "../.data/local-registry", + "auth": { "htpasswd": { "file": "./htpasswd" } }, "uplinks": { "npmjs": { "url": "https://registry.npmjs.org/", diff --git a/.verdaccio/htpasswd b/.verdaccio/htpasswd new file mode 100644 index 0000000..f0d17ba --- /dev/null +++ b/.verdaccio/htpasswd @@ -0,0 +1 @@ +test:$apr1$6pG/Yk6c$EswhDDvYqyCzlO8FqjFzl0 diff --git a/README.md b/README.md index 2b22acc..07e26ea 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/scripts/local-registry.sh b/scripts/local-registry.sh index 9f97683..457ca5c 100755 --- a/scripts/local-registry.sh +++ b/scripts/local-registry.sh @@ -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" @@ -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 ;;