Skip to content

Commit 0283dfe

Browse files
authored
chore: update verdaccio config and react native development guide (#2690)
* chore: proxy @bugsnag/cli in verdaccio config * chore: move verdaccio config to test directory * chore: update dev instructions in React Native contributing guide
1 parent 38044c8 commit 0283dfe

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"test:build-node-container": "docker compose up --build minimal-packager && docker compose build --pull node-maze-runner",
9191
"test:build-react-native-maze-runner": "docker-compose build --pull react-native-maze-runner",
9292
"test:node": "npm run test:build-node-container && docker compose run --use-aliases node-maze-runner",
93-
"local-npm:start": "verdaccio --config test/electron/local-npm-config.yml --listen 0.0.0.0:5539",
93+
"local-npm:start": "verdaccio --config test/local-npm-config.yml --listen 0.0.0.0:5539",
9494
"local-npm:publish-all": "lerna publish \"$VERSION_IDENTIFIER\" --yes --force-publish --exact --no-push --no-git-reset --no-git-tag-version --registry 'http://0.0.0.0:5539'",
9595
"local-npm:publish-all-win32": "lerna publish %VERSION_IDENTIFIER% --yes --force-publish --exact --no-push --no-git-reset --no-git-tag-version --registry 'http://0.0.0.0:5539'",
9696
"test:electron": "xvfb-maybe --auto-servernum -- cucumber-js test/electron/features --retry 3 --retry-tag-filter @flaky"

packages/react-native/CONTRIBUTING.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,46 +37,43 @@ To solve this problem we publish to a local npm clone, which proxies requests fo
3737

3838
#### Prerequisites
3939

40-
The proxy of choice is [verdaccio](https://verdaccio.org/):
40+
The proxy of choice is [verdaccio](https://verdaccio.org/). This is already included as a dev dependency in the bugsnag-js repository, along with a config file at `test/local-npm.config.yml`.
4141

42-
```sh
43-
# install it globally on your system
44-
npm i -g verdaccio
42+
To start the verdaccio server, run the `local-npm:start` npm script from the repo root:
4543

46-
# starts the on the default port
47-
verdaccio
48-
49-
# log in to the registry
50-
# (you can enter anything, just be sure to remember them when
51-
# your session times out and you need to "sign in" again)
52-
npm adduser --registry http://localhost:4873
5344
```
45+
npm run local-npm:start
46+
```
47+
48+
This will start verdaccio running on port `5539`. You will need to keep this running for the following steps.
5449

55-
On the project you want to install the development notifier, create an a `.npmrc` file at the project root alongside `package.json`:
50+
In the project where you want to install the development notifier, create an a `.npmrc` file at the project root alongside `package.json` and set the local registry URL:
5651

5752
```
58-
registry=http://localhost:4873
53+
registry=http://localhost:5539
5954
```
6055

61-
Alternatively you can just supply the `--registry=http://localhost:4873` to each npm/yarn command you issue.
56+
Alternatively you can just supply the `--registry=http://localhost:5539` to each npm/yarn command you issue.
6257

63-
#### Installing the development notifier on a React Native project
58+
#### Installing the development notifier in a React Native project
6459

6560
1. Make changes.
66-
2. Run the following command to publish to the local registry:
61+
2. In a new terminal window, from the repo root, run the `local-npm:publish-all` npm script to publish to the local registry:
6762

6863
```
69-
npx lerna publish v99.99.99-canary.`git rev-parse HEAD` --no-push --exact --no-git-tag-version --registry http://localhost:4873/
64+
VERSION_IDENTIFIER=8.99.99 npm run local-npm:publish-all
7065
```
7166
72-
This should prompt you for each module that has changed since the last proper publish.
67+
This will publish all of the packages in the repo to verdaccio with the specified version.
68+
69+
Note: You'll need to ensure you publish using the same major version as is currently in the repository. This is because some packages declare a peer dependency on `@bugsnag/core`, and lerna does not update peer dependencies when versioning, so changing the major version will mean the packages fail to install (since the peer dependency cannot be resolved from the local registry).
7370
74-
4. Reset the changes that were made to `lerna.json` and `package-lock.json`s `git reset --hard HEAD` (we don't want to store these throwaway versions)
71+
4. Reset the changes that were made to `package.json`, `lerna.json` and `package-lock.json` files with `git reset --hard HEAD` (we don't want to commit these throwaway versions)
7572
76-
On the project you want to install `@bugsnag/react-native` substitute the version's output from above:
73+
In the project where you want to install `@bugsnag/react-native` substitute the version's output from above:
7774
7875
```
79-
yarn add @bugsnag/react-native@99.99.99-canary.<hash>
76+
yarn add @bugsnag/react-native@8.99.99
8077
# or
81-
npm i @bugsnag/react-native@99.99.99-canary.<hash>
78+
npm i @bugsnag/react-native@8.99.99
8279
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ packages:
1313
'@bugsnag/cuid':
1414
access: $anonymous
1515
proxy: npmjs
16+
'@bugsnag/cli':
17+
access: $anonymous
18+
proxy: npmjs
1619
'bugsnag-expo-cli':
1720
access: $anonymous
1821
publish: $anonymous

0 commit comments

Comments
 (0)