Skip to content

Commit

Permalink
Fix Resolutions
Browse files Browse the repository at this point in the history
Problem:
NPM forces us to jump through number of hoops
We seen an issue when dealing with React peer dependencies but they do not get handled appropriately

This is actually also seen in new expo modules created through the create-expo-module cli

Solution:
Stop forcing dependencies and working around dependency resolution and simply use yarn

Changes:
Removed package-lock.json
updated docs to point user towards yarn
Fix readme for npm pod-install to npx pod-install
  • Loading branch information
Alex Risch authored and Alex Risch committed Dec 16, 2023
1 parent c51dbba commit f09b5fb
Show file tree
Hide file tree
Showing 9 changed files with 18,260 additions and 25,800 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
node-version: 18.14.0
- name: Install dependencies
run: npm ci
run: yarn install --frozen-lockfile
- name: Build typedocs
run: npm run typedoc
- name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install dependencies
run: npm ci
run: yarn install --frozen-lockfile
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
# Note: this triggers `prepare` which compiles the types.
- run: npm ci
- run: yarn install --frozen-lockfile
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Use the [XMTP React Native example app](example) as a tool to start building an
Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment.

```bash
npm install
yarn
cd example
npm install --force
npm run [ios or android]
yarn
yarn run [ios or android]
```

## Install in a managed Expo project
Expand All @@ -41,10 +41,10 @@ npx expo prebuild

For bare React Native projects, [install and configure the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.

### Add the package to your npm dependencies
### Add the package to your yarn dependencies

```bash
npm i @xmtp/react-native-sdk
yarn i @xmtp/react-native-sdk
```

### Configure for iOS
Expand All @@ -55,7 +55,7 @@ In the `ios` directory, update your `Podfile` file as follows:
- Add this line: `pod 'secp256k1.swift', :modular_headers => true`. This is required for web3.swift.

```bash
npm pod-install
npx pod-install
```

### Configure for Android
Expand Down
7 changes: 4 additions & 3 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ Follow the [React Native guide](https://reactnative.dev/docs/environment-setup)
To use the example app, run:

```bash
npm install
yarn
cd example
npm install --force
npm run [ios or android]
yarn
npx pod-install
yarn run [ios or android]
```

## Run example app unit tests on local emulators
Expand Down
1 change: 0 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "xmtp-react-native-sdk-example",
"version": "1.0.0",
"scripts": {
"preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions",
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
Expand Down
9,194 changes: 9,194 additions & 0 deletions example/yarn.lock

Large diffs are not rendered by default.

Loading

0 comments on commit f09b5fb

Please sign in to comment.