Skip to content

Commit 49d3b5a

Browse files
Added NPM and PNPM installation in README.md (#1149)
## Description Added NPM and PNPM installation in README.md with details+ summary tag. Atleast new developers won't get scared if they are using npm and suddenly need yarn ### Introduces a breaking change? - [ ] Yes - [x] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [x] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. --> --------- Co-authored-by: Mateusz Słuszniak <mateusz.sluszniak@swmansion.com>
1 parent 70957aa commit 49d3b5a

8 files changed

Lines changed: 148 additions & 35 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down
9797
yarn < ios | android >
9898
```
9999

100+
> npm and pnpm work too — use `npm install` or `pnpm add` for the packages, and `npm run <ios|android>` / `pnpm <ios|android>` for the run step.
101+
100102
### :two: Setup & Initialization
101103

102104
Add this to your component file:

docs/docs/01-fundamentals/01-getting-started.md

Lines changed: 87 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,45 +38,85 @@ For supported React Native and Expo versions, see the [Compatibility table](../0
3838

3939
## Installation
4040

41-
Installation is pretty straightforward, use your package manager of choice to install the package and some peer dependencies required to streamline model downloads. If you want to implement your custom model fetching logic, see [this document](../08-resource-fetcher/02-custom-adapter.md).
41+
Installation takes two steps: install the core package, then install a resource fetcher adapter that matches your project type. If you want to implement your own model fetching logic instead, see [this document](../08-resource-fetcher/02-custom-adapter.md).
4242

43-
<Tabs>
44-
<TabItem value="npm" label="NPM">
43+
### 1. Install the core package
44+
45+
<Tabs groupId="package-manager">
46+
<TabItem value="npm" label="npm">
4547

4648
```bash
4749
npm install react-native-executorch
48-
# For Expo projects, you need to install expo resource fetcher
49-
npm install react-native-executorch-expo-resource-fetcher
50-
npm install expo-file-system expo-asset
51-
# For bare React Native projects, you need to install bare resource fetcher
52-
npm install react-native-executorch-bare-resource-fetcher
53-
npm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
5450
```
5551

5652
</TabItem>
57-
<TabItem value="pnpm" label="PNPM">
53+
<TabItem value="pnpm" label="pnpm">
5854

5955
```bash
60-
pnpm install react-native-executorch
61-
# For Expo projects, you need to install expo resource fetcher
62-
pnpm install react-native-executorch-expo-resource-fetcher
63-
pnpm install expo-file-system expo-asset
64-
# For bare React Native projects, you need to install bare resource fetcher
65-
pnpm install react-native-executorch-bare-resource-fetcher
66-
pnpm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
56+
pnpm add react-native-executorch
6757
```
6858

6959
</TabItem>
70-
<TabItem value="yarn" label="YARN">
60+
<TabItem value="yarn" label="yarn">
7161

7262
```bash
7363
yarn add react-native-executorch
74-
# For Expo projects, you need to install expo resource fetcher
75-
yarn add react-native-executorch-expo-resource-fetcher
76-
yarn add expo-file-system expo-asset
77-
# For bare React Native projects, you need to install bare resource fetcher
78-
yarn add react-native-executorch-bare-resource-fetcher
79-
yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
64+
```
65+
66+
</TabItem>
67+
</Tabs>
68+
69+
### 2. Install a resource fetcher
70+
71+
Pick the adapter that matches your project. We recommend the Expo adapter when your app uses Expo; use the bare adapter for projects without Expo.
72+
73+
#### Expo projects
74+
75+
<Tabs groupId="package-manager">
76+
<TabItem value="npm" label="npm">
77+
78+
```bash
79+
npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
80+
```
81+
82+
</TabItem>
83+
<TabItem value="pnpm" label="pnpm">
84+
85+
```bash
86+
pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
87+
```
88+
89+
</TabItem>
90+
<TabItem value="yarn" label="yarn">
91+
92+
```bash
93+
yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
94+
```
95+
96+
</TabItem>
97+
</Tabs>
98+
99+
#### Bare React Native projects
100+
101+
<Tabs groupId="package-manager">
102+
<TabItem value="npm" label="npm">
103+
104+
```bash
105+
npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
106+
```
107+
108+
</TabItem>
109+
<TabItem value="pnpm" label="pnpm">
110+
111+
```bash
112+
pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
113+
```
114+
115+
</TabItem>
116+
<TabItem value="yarn" label="yarn">
117+
118+
```bash
119+
yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
80120
```
81121

82122
</TabItem>
@@ -120,9 +160,29 @@ Because we are using ExecuTorch under the hood, you won't be able to build iOS a
120160

121161
Running the app with the library:
122162

123-
```bash
124-
yarn <ios | android> -d
125-
```
163+
<Tabs groupId="package-manager">
164+
<TabItem value="npm" label="npm">
165+
166+
```bash
167+
npm run <ios | android> -- -d
168+
```
169+
170+
</TabItem>
171+
<TabItem value="pnpm" label="pnpm">
172+
173+
```bash
174+
pnpm <ios | android> -d
175+
```
176+
177+
</TabItem>
178+
<TabItem value="yarn" label="yarn">
179+
180+
```bash
181+
yarn <ios | android> -d
182+
```
183+
184+
</TabItem>
185+
</Tabs>
126186

127187
## Supporting new models in React Native ExecuTorch
128188

docs/docs/01-fundamentals/02-loading-models.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: Loading Models
33
---
44

5+
import Tabs from '@theme/Tabs';
6+
import TabItem from '@theme/TabItem';
7+
58
There are three different methods available for loading model files, depending on their size and location.
69

710
## Prerequisites
@@ -10,10 +13,29 @@ In our library, you can use two different resource fetching mechanisms. One is i
1013

1114
To use the Expo adapter, please add these libraries:
1215

13-
```bash
14-
yarn add react-native-executorch-expo-resource-fetcher
15-
yarn add expo-file-system expo-asset
16-
```
16+
<Tabs groupId="package-manager">
17+
<TabItem value="npm" label="npm">
18+
19+
```bash
20+
npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
21+
```
22+
23+
</TabItem>
24+
<TabItem value="pnpm" label="pnpm">
25+
26+
```bash
27+
pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
28+
```
29+
30+
</TabItem>
31+
<TabItem value="yarn" label="yarn">
32+
33+
```bash
34+
yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset
35+
```
36+
37+
</TabItem>
38+
</Tabs>
1739

1840
and then add the following code in your React Native app:
1941

@@ -28,10 +50,29 @@ initExecutorch({
2850

2951
If you cannot use Expo in your project, proceed with the following steps:
3052

31-
```bash
32-
yarn add react-native-executorch-bare-resource-fetcher
33-
yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
34-
```
53+
<Tabs groupId="package-manager">
54+
<TabItem value="npm" label="npm">
55+
56+
```bash
57+
npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
58+
```
59+
60+
</TabItem>
61+
<TabItem value="pnpm" label="pnpm">
62+
63+
```bash
64+
pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
65+
```
66+
67+
</TabItem>
68+
<TabItem value="yarn" label="yarn">
69+
70+
```bash
71+
yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader
72+
```
73+
74+
</TabItem>
75+
</Tabs>
3576

3677
and
3778

readmes/README_cn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down
9393
yarn < ios | android >
9494
```
9595

96+
> npm 和 pnpm 同样适用 — 使用 `npm install``pnpm add` 安装包,使用 `npm run <ios|android>` / `pnpm <ios|android>` 运行应用。
97+
9698
### :two: 设置和初始化
9799

98100
将此添加到您的组件文件中:

readmes/README_es.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down
9393
yarn < ios | android >
9494
```
9595

96+
> npm y pnpm también funcionan — usa `npm install` o `pnpm add` para los paquetes, y `npm run <ios|android>` / `pnpm <ios|android>` para el paso de ejecución.
97+
9698
### :two: Configuración e inicialización
9799

98100
Agrega esto a tu archivo de componente:

readmes/README_fr.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down
9393
yarn < ios | android >
9494
```
9595

96+
> npm et pnpm fonctionnent aussi — utilisez `npm install` ou `pnpm add` pour les packages, et `npm run <ios|android>` / `pnpm <ios|android>` pour l'étape d'exécution.
97+
9698
### :two: Configuration et Initialisation
9799

98100
Ajoutez ceci à votre fichier de composant :

readmes/README_in.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down
9393
yarn < ios | android >
9494
```
9595

96+
> npm और pnpm भी काम करते हैं — पैकेजों के लिए `npm install` या `pnpm add` का उपयोग करें, और रन स्टेप के लिए `npm run <ios|android>` / `pnpm <ios|android>` का उपयोग करें।
97+
9698
### :two: सेटअप और आरंभिककरण
9799

98100
अपने घटक फाइल में यह जोड़ें:

readmes/README_pt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down
9393
yarn < ios | android >
9494
```
9595

96+
> npm e pnpm também funcionam — use `npm install` ou `pnpm add` para os pacotes, e `npm run <ios|android>` / `pnpm <ios|android>` para o passo de execução.
97+
9698
### :two: Configuração e Inicialização
9799

98100
Adicione isso ao seu arquivo de componente:

0 commit comments

Comments
 (0)