diff --git a/README.md b/README.md index eea5c09aae..691df0cd33 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm and pnpm work too — use `npm install` or `pnpm add` for the packages, and `npm run ` / `pnpm ` for the run step. + ### :two: Setup & Initialization Add this to your component file: diff --git a/docs/docs/01-fundamentals/01-getting-started.md b/docs/docs/01-fundamentals/01-getting-started.md index c1d04e1ec1..0f5abf8cae 100644 --- a/docs/docs/01-fundamentals/01-getting-started.md +++ b/docs/docs/01-fundamentals/01-getting-started.md @@ -38,45 +38,85 @@ For supported React Native and Expo versions, see the [Compatibility table](../0 ## Installation -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). +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). - - +### 1. Install the core package + + + ```bash npm install react-native-executorch - # For Expo projects, you need to install expo resource fetcher - npm install react-native-executorch-expo-resource-fetcher - npm install expo-file-system expo-asset - # For bare React Native projects, you need to install bare resource fetcher - npm install react-native-executorch-bare-resource-fetcher - npm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader ``` - + ```bash - pnpm install react-native-executorch - # For Expo projects, you need to install expo resource fetcher - pnpm install react-native-executorch-expo-resource-fetcher - pnpm install expo-file-system expo-asset - # For bare React Native projects, you need to install bare resource fetcher - pnpm install react-native-executorch-bare-resource-fetcher - pnpm install @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + pnpm add react-native-executorch ``` - + ```bash yarn add react-native-executorch - # For Expo projects, you need to install expo resource fetcher - yarn add react-native-executorch-expo-resource-fetcher - yarn add expo-file-system expo-asset - # For bare React Native projects, you need to install bare resource fetcher - yarn add react-native-executorch-bare-resource-fetcher - yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + +### 2. Install a resource fetcher + +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. + +#### Expo projects + + + + + ```bash + npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + +#### Bare React Native projects + + + + + ```bash + npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader ``` @@ -120,9 +160,29 @@ Because we are using ExecuTorch under the hood, you won't be able to build iOS a Running the app with the library: -```bash -yarn -d -``` + + + + ```bash + npm run -- -d + ``` + + + + + ```bash + pnpm -d + ``` + + + + + ```bash + yarn -d + ``` + + + ## Supporting new models in React Native ExecuTorch diff --git a/docs/docs/01-fundamentals/02-loading-models.md b/docs/docs/01-fundamentals/02-loading-models.md index 3a3eaab722..28df1d8d6d 100644 --- a/docs/docs/01-fundamentals/02-loading-models.md +++ b/docs/docs/01-fundamentals/02-loading-models.md @@ -2,6 +2,9 @@ title: Loading Models --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + There are three different methods available for loading model files, depending on their size and location. ## Prerequisites @@ -10,10 +13,29 @@ In our library, you can use two different resource fetching mechanisms. One is i To use the Expo adapter, please add these libraries: -```bash -yarn add react-native-executorch-expo-resource-fetcher -yarn add expo-file-system expo-asset -``` + + + + ```bash + npm install react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + pnpm add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + + + ```bash + yarn add react-native-executorch-expo-resource-fetcher expo-file-system expo-asset + ``` + + + and then add the following code in your React Native app: @@ -28,10 +50,29 @@ initExecutorch({ If you cannot use Expo in your project, proceed with the following steps: -```bash -yarn add react-native-executorch-bare-resource-fetcher -yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader -``` + + + + ```bash + npm install react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + pnpm add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + + + ```bash + yarn add react-native-executorch-bare-resource-fetcher @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloader + ``` + + + and diff --git a/readmes/README_cn.md b/readmes/README_cn.md index c8d869404e..e148e18aa0 100644 --- a/readmes/README_cn.md +++ b/readmes/README_cn.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm 和 pnpm 同样适用 — 使用 `npm install` 或 `pnpm add` 安装包,使用 `npm run ` / `pnpm ` 运行应用。 + ### :two: 设置和初始化 将此添加到您的组件文件中: diff --git a/readmes/README_es.md b/readmes/README_es.md index 4b9337bd26..63dfd5a3b7 100644 --- a/readmes/README_es.md +++ b/readmes/README_es.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm y pnpm también funcionan — usa `npm install` o `pnpm add` para los paquetes, y `npm run ` / `pnpm ` para el paso de ejecución. + ### :two: Configuración e inicialización Agrega esto a tu archivo de componente: diff --git a/readmes/README_fr.md b/readmes/README_fr.md index 8e3efdd63b..9447a91dc3 100644 --- a/readmes/README_fr.md +++ b/readmes/README_fr.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm et pnpm fonctionnent aussi — utilisez `npm install` ou `pnpm add` pour les packages, et `npm run ` / `pnpm ` pour l'étape d'exécution. + ### :two: Configuration et Initialisation Ajoutez ceci à votre fichier de composant : diff --git a/readmes/README_in.md b/readmes/README_in.md index dbc0085482..0bf15c1d96 100644 --- a/readmes/README_in.md +++ b/readmes/README_in.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm और pnpm भी काम करते हैं — पैकेजों के लिए `npm install` या `pnpm add` का उपयोग करें, और रन स्टेप के लिए `npm run ` / `pnpm ` का उपयोग करें। + ### :two: सेटअप और आरंभिककरण अपने घटक फाइल में यह जोड़ें: diff --git a/readmes/README_pt.md b/readmes/README_pt.md index b3ef308924..e8eda02f8e 100644 --- a/readmes/README_pt.md +++ b/readmes/README_pt.md @@ -93,6 +93,8 @@ yarn add @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-down yarn < ios | android > ``` +> npm e pnpm também funcionam — use `npm install` ou `pnpm add` para os pacotes, e `npm run ` / `pnpm ` para o passo de execução. + ### :two: Configuração e Inicialização Adicione isso ao seu arquivo de componente: