Skip to content

Commit

Permalink
feat: add pnpm section to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
manegame committed Jan 25, 2025
1 parent bce4e22 commit 31aead2
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ yarn add expo-share-intent
npm install expo-share-intent
```



**Requirement: `patch-package`**

For the moment this package need a post-install script
For the moment this package needs a patch.

There are two methods to achieve this.

If you are using `yarn` or `npm`, you should use method 1
If you are using `pnpm`, you can only use method 2

## Method 1: post-install script
- copy the [xcode patch](https://github.com/achorein/expo-share-intent/blob/main/example/basic/patches/xcode%2B3.0.1.patch) in you `patches` project directory (like example)
- add post-install script to `package.json`

Expand All @@ -69,6 +77,43 @@ yarn add patch-package

> More info in [#13](https://github.com/achorein/expo-share-intent/issues/13) and [FAQ](https://github.com/achorein/expo-share-intent/edit/main/README.md#config-sync-failed)
## Method 2: pnpm patch

pnpm provides a simple command to create a `node_module` patch.

In your directory, run

`pnpm install [email protected]`

and then

`pnpm patch [email protected]`

You will now be prompted to make the patch changes. The file path should show up and look something like this:

`/{YOUR_DIRECTORY}/node_modules/.pnpm_patches/[email protected]`

Go into this file and change one line:

```
- if (project.pbxGroupByName(group).path)
+ if (project.pbxGroupByName(group)&&project.pbxGroupByName(group).path)
```

As prompted, when you're done you will run a command to commit your changes:

`pnpm patch-commit /{YOUR_DIRECTORY}/node_modules/.pnpm_patches/[email protected]`

You should now have an entry in your `package.json` file that looks like this:

```
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
```

**Requirement: `expo-linking`**

Since Expo52, you also need to install `expo-linking` in your app :
Expand Down

0 comments on commit 31aead2

Please sign in to comment.