Skip to content

Commit 12ae512

Browse files
Revert "chore: use nx local-registry executor (#183)" (#184)
This reverts commit c2f6cbc.
1 parent c2f6cbc commit 12ae512

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,16 @@ After your pull request is merged, you can safely delete your branch and pull th
143143
To test if your changes will actually work once the changes are published,
144144
it can be useful to publish to a local registry.
145145

146-
- Run `pnpm exec nx run qwik-nx-repo:local-registry` in Terminal 1 (keep it running)
146+
- Run `pnpm run local-registry start` in Terminal 1 (keep it running)
147147
- Run `npm adduser --registry http://localhost:4873` in Terminal 2 (real credentials are not required, you just need to
148148
be logged in. You can use test/test/[email protected].)
149+
- Run `pnpm run local-registry enable` in Terminal 2
149150
- Run `pnpm exec nx run qwik-nx:publish:local` in Terminal 2. You can set the version you want to publish in the package's package.json file.
150151

151152
If you have problems publishing, make sure you use Node 18 and NPM 8. Alternatively to running the project's "publish" target you can build and publish manually by running `pnpm exec nx build:qwik-nx && cd dist/projects/qwik-nx && npm publish --registry=http://localhost:4873`
152153

154+
**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 registry using `pnpm run local-registry disable`. Keeping local registry enabled will change your lock file resolutions to `localhost:4873` on the next `pnpm install`. You can also run `pnpm run local-registry clear` to clean all packages in that local registry.
155+
153156
**NOTE:** To use this newly published local version, you need to make a new workspace or change your target package to this new version, eg: `"qwik-nx": "^1.0.0",` and re-run `pnpm install` in your testing project.
154157

155158
### ▶ 10. That's it! Thank you for your contribution! 🙏💓

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"build": "nx build",
77
"commit": "git-cz",
88
"format:fix": "pretty-quick --staged",
9+
"local-registry": "sh ./scripts/local-registry.sh",
910
"prepare": "husky install",
1011
"start": "nx serve",
1112
"test": "nx test",
@@ -84,8 +85,5 @@
8485
"commitizen": {
8586
"path": "./node_modules/cz-conventional-changelog"
8687
}
87-
},
88-
"nx": {
89-
"includedScripts": []
9088
}
9189
}

project.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

scripts/local-registry.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# source: https://github.com/nrwl/nx/blob/master/scripts/local-registry.sh
3+
4+
COMMAND=$1
5+
6+
if [[ $COMMAND == "enable" ]]; then
7+
echo "Setting registry to local registry"
8+
echo "To Disable: pnpm run local-registry disable"
9+
npm config set registry http://localhost:4873/ --location user
10+
yarn config set registry http://localhost:4873/
11+
fi
12+
13+
if [[ $COMMAND == "disable" ]]; then
14+
npm config delete registry --location user
15+
yarn config delete registry
16+
CURRENT_NPM_REGISTRY=$(npm config get registry --location user)
17+
CURRENT_YARN_REGISTRY=$(yarn config get registry)
18+
19+
echo "Reverting registries"
20+
echo " > NPM: $CURRENT_NPM_REGISTRY"
21+
echo " > YARN: $CURRENT_YARN_REIGSTRY"
22+
fi
23+
24+
if [[ $COMMAND == "clear" ]]; then
25+
echo "Clearing Local Registry"
26+
rm -rf ./tmp/local-registry/storage
27+
fi
28+
29+
if [[ $COMMAND == "start" ]]; then
30+
echo "Starting Local Registry"
31+
pwd
32+
VERDACCIO_HANDLE_KILL_SIGNALS=true
33+
pnpm exec verdaccio --config ./.verdaccio/config.yml
34+
fi

0 commit comments

Comments
 (0)