Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions apps/computer-vision/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');

const monorepoRoot = path.resolve(__dirname, '../..');

/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);

const { transformer, resolver } = config;

config.watchFolders = [monorepoRoot];

config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
Expand All @@ -14,6 +19,23 @@ config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...resolver.sourceExts, 'svg'],
nodeModulesPaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
],
// Always resolve react and react-native from the monorepo root so that
// workspace packages with their own nested node_modules (e.g.
// packages/react-native-executorch/node_modules/react) don't create a
// second React instance and trigger "Invalid hook call".
resolveRequest: (context, moduleName, platform) => {
if (moduleName === 'react' || moduleName === 'react-native') {
return {
filePath: require.resolve(moduleName, { paths: [monorepoRoot] }),
type: 'sourceFile',
};
}
return context.resolveRequest(context, moduleName, platform);
},
};

config.resolver.assetExts.push('pte');
Expand Down
18 changes: 9 additions & 9 deletions apps/computer-vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"dependencies": {
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-native/metro-config": "^0.81.5",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/native": "^7.1.6",
"@shopify/react-native-skia": "2.2.12",
"@react-navigation/drawer": "^7.8.1",
"@react-navigation/native": "^7.1.28",
"@shopify/react-native-skia": "2.4.21",
"expo": "^54.0.27",
"expo-constants": "~18.0.11",
"expo-font": "~14.0.10",
Expand All @@ -25,20 +25,20 @@
"metro-config": "^0.81.5",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-device-info": "^14.0.4",
"react-native-device-info": "^15.0.2",
"react-native-executorch": "workspace:*",
"react-native-gesture-handler": "~2.28.0",
"react-native-image-picker": "^7.2.2",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-reanimated": "~4.1.1",
"react-native-reanimated": "~4.2.2",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-svg": "15.12.1",
"react-native-svg-transformer": "^1.5.0",
"react-native-worklets": "0.5.1"
"react-native-svg": "15.15.3",
"react-native-svg-transformer": "^1.5.3",
"react-native-worklets": "0.7.4"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.29.0",
"@types/pngjs": "^6.0.5",
"@types/react": "~19.1.10"
},
Expand Down
6 changes: 5 additions & 1 deletion apps/llm/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
"package": "com.anonymous.llm",
"permissions": [
"android.permission.READ_CALENDAR",
"android.permission.WRITE_CALENDAR"
"android.permission.WRITE_CALENDAR",
"android.permission.MODIFY_AUDIO_SETTINGS",
"android.permission.FOREGROUND_SERVICE",
"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK",
"android.permission.RECORD_AUDIO"
]
},
"web": {
Expand Down
21 changes: 21 additions & 0 deletions apps/llm/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ const { getDefaultConfig } = require('expo/metro-config');
const {
wrapWithAudioAPIMetroConfig,
} = require('react-native-audio-api/metro-config');
const path = require('path');

const monorepoRoot = path.resolve(__dirname, '../..');
const config = getDefaultConfig(__dirname);

const { transformer, resolver } = config;

config.watchFolders = [monorepoRoot];

config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
Expand All @@ -15,6 +19,23 @@ config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...resolver.sourceExts, 'svg'],
nodeModulesPaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
],
// Always resolve react and react-native from the monorepo root so that
// workspace packages with their own nested node_modules (e.g.
// packages/react-native-executorch/node_modules/react) don't create a
// second React instance and trigger "Invalid hook call".
resolveRequest: (context, moduleName, platform) => {
if (moduleName === 'react' || moduleName === 'react-native') {
return {
filePath: require.resolve(moduleName, { paths: [monorepoRoot] }),
type: 'sourceFile',
};
}
return context.resolveRequest(context, moduleName, platform);
},
};

config.resolver.assetExts.push('pte');
Expand Down
16 changes: 8 additions & 8 deletions apps/llm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
},
"dependencies": {
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-native/metro-config": "^0.81.5",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/native": "^7.1.6",
"@react-native/metro-config": "^0.81.6",
"@react-navigation/drawer": "^7.8.1",
"@react-navigation/native": "^7.1.28",
"expo": "^54.0.27",
"expo-brightness": "~14.0.8",
"expo-calendar": "~15.0.8",
Expand All @@ -27,20 +27,20 @@
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-audio-api": "^0.8.2",
"react-native-device-info": "^14.0.4",
"react-native-device-info": "^15.0.2",
"react-native-executorch": "workspace:*",
"react-native-gesture-handler": "~2.28.0",
"react-native-loading-spinner-overlay": "^3.0.1",
"react-native-markdown-display": "^7.0.2",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-svg": "15.12.1",
"react-native-svg-transformer": "^1.5.0",
"react-native-worklets": "0.5.1"
"react-native-svg": "15.15.3",
"react-native-svg-transformer": "^1.5.3",
"react-native-worklets": "0.7.4"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.29.0",
"@types/react": "~19.1.10"
},
"private": true
Expand Down
21 changes: 21 additions & 0 deletions apps/speech/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ const { getDefaultConfig } = require('expo/metro-config');
const {
wrapWithAudioAPIMetroConfig,
} = require('react-native-audio-api/metro-config');
const path = require('path');

const monorepoRoot = path.resolve(__dirname, '../..');
const config = getDefaultConfig(__dirname);

const { transformer, resolver } = config;

config.watchFolders = [monorepoRoot];

config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
Expand All @@ -15,6 +19,23 @@ config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...resolver.sourceExts, 'svg'],
nodeModulesPaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
],
// Always resolve react and react-native from the monorepo root so that
// workspace packages with their own nested node_modules (e.g.
// packages/react-native-executorch/node_modules/react) don't create a
// second React instance and trigger "Invalid hook call".
resolveRequest: (context, moduleName, platform) => {
if (moduleName === 'react' || moduleName === 'react-native') {
return {
filePath: require.resolve(moduleName, { paths: [monorepoRoot] }),
type: 'sourceFile',
};
}
return context.resolveRequest(context, moduleName, platform);
},
};

config.resolver.assetExts.push('pte');
Expand Down
18 changes: 9 additions & 9 deletions apps/speech/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
},
"dependencies": {
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-native/metro-config": "^0.81.5",
"@react-native/metro-config": "^0.84.0",
"buffer": "^6.0.3",
"expo": "^54.0.27",
"expo-font": "~14.0.10",
"expo-status-bar": "~3.0.9",
"metro-config": "^0.81.5",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-audio-api": "0.11.3",
"react-native-device-info": "^14.0.4",
"react-native-audio-api": "0.11.5",
"react-native-device-info": "^15.0.2",
"react-native-executorch": "workspace:*",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-svg": "15.12.1",
"react-native-svg-transformer": "^1.5.0",
"react-native-worklets": "0.5.1"
"react-native-reanimated": "~4.2.2",
"react-native-safe-area-context": "~5.7.0",
"react-native-svg": "15.15.3",
"react-native-svg-transformer": "^1.5.3",
"react-native-worklets": "0.7.4"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.29.0",
"@types/react": "~19.1.10"
},
"private": true
Expand Down
2 changes: 1 addition & 1 deletion apps/text-embeddings/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function _layout() {
}}
>
<Drawer
drawerContent={(props) => (
drawerContent={(props: DrawerContentComponentProps) => (
<CustomDrawerContent {...props} isGenerating={isGenerating} />
)}
screenOptions={{
Expand Down
22 changes: 22 additions & 0 deletions apps/text-embeddings/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');

const monorepoRoot = path.resolve(__dirname, '../..');

/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);

const { transformer, resolver } = config;

config.watchFolders = [monorepoRoot];

config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
Expand All @@ -14,6 +19,23 @@ config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...resolver.sourceExts, 'svg'],
nodeModulesPaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(monorepoRoot, 'node_modules'),
],
// Always resolve react and react-native from the monorepo root so that
// workspace packages with their own nested node_modules (e.g.
// packages/react-native-executorch/node_modules/react) don't create a
// second React instance and trigger "Invalid hook call".
resolveRequest: (context, moduleName, platform) => {
if (moduleName === 'react' || moduleName === 'react-native') {
return {
filePath: require.resolve(moduleName, { paths: [monorepoRoot] }),
type: 'sourceFile',
};
}
return context.resolveRequest(context, moduleName, platform);
},
};

config.resolver.assetExts.push('pte');
Expand Down
18 changes: 8 additions & 10 deletions apps/text-embeddings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
"typecheck": "tsc",
"lint": "eslint . --ext .ts,.tsx --fix"
},
"peerDependencies": {
"@react-navigation/native": "*"
},
"dependencies": {
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/drawer": "^7.8.1",
"@react-navigation/native": "^7.1.28",
"expo": "^54.0.27",
"expo-constants": "~18.0.11",
"expo-linking": "~8.0.10",
Expand All @@ -24,16 +22,16 @@
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-executorch": "workspace:*",
"react-native-gesture-handler": "~2.28.0",
"react-native-gesture-handler": "~2.30.0",
"react-native-image-picker": "^7.2.2",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-reanimated": "~4.2.2",
"react-native-safe-area-context": "~5.7.0",
"react-native-screens": "~4.16.0",
"react-native-svg": "15.12.1",
"react-native-worklets": "0.5.1"
"react-native-svg": "15.15.3",
"react-native-worklets": "0.7.4"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.29.0",
"@types/react": "~19.1.10"
},
"private": true
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/06-api-reference/classes/ClassificationModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ The input shape as an array of numbers.

### load()

> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>

Defined in: [modules/computer_vision/ClassificationModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L21)

Expand All @@ -162,7 +162,7 @@ Object containing `modelSource`.

[`ResourceSource`](../type-aliases/ResourceSource.md)

##### onDownloadProgressCallback
##### onDownloadProgressCallback?

(`progress`) => `void`

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/06-api-reference/classes/ExecutorchModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ The input shape as an array of numbers.

### load()

> **load**(`modelSource`, `onDownloadProgressCallback`): `Promise`\<`void`\>
> **load**(`modelSource`, `onDownloadProgressCallback?`): `Promise`\<`void`\>

Defined in: [modules/general/ExecutorchModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L22)

Expand All @@ -161,7 +161,7 @@ Optionally accepts a download progress callback.

Source of the model to be loaded.

##### onDownloadProgressCallback
##### onDownloadProgressCallback?

(`progress`) => `void`

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/06-api-reference/classes/ImageEmbeddingsModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ The input shape as an array of numbers.

### load()

> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
> **load**(`model`, `onDownloadProgressCallback?`): `Promise`\<`void`\>

Defined in: [modules/computer_vision/ImageEmbeddingsModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L20)

Expand All @@ -161,7 +161,7 @@ Object containing `modelSource`.

[`ResourceSource`](../type-aliases/ResourceSource.md)

##### onDownloadProgressCallback
##### onDownloadProgressCallback?

(`progress`) => `void`

Expand Down
Loading
Loading