88 mergeResolutionResults ,
99} from '../dependencies' ;
1010import { PackageRevision , SearchResults , SupportedPlatform } from '../types' ;
11- import path from 'path' ;
12- import fs from 'fs' ;
1311
1412export async function resolveExpoModule (
1513 resolution : DependencyResolution ,
@@ -20,7 +18,6 @@ export async function resolveExpoModule(
2018 return null ;
2119 }
2220 const expoModuleConfig = await discoverExpoModuleConfigAsync ( resolution . path ) ;
23-
2421 if ( expoModuleConfig && expoModuleConfig . supportsPlatform ( platform ) ) {
2522 return {
2623 name : resolution . name ,
@@ -44,30 +41,6 @@ interface FindModulesParams {
4441 autolinkingOptions : AutolinkingOptions & { platform : SupportedPlatform } ;
4542}
4643
47- async function localModulesSearchPaths ( appRoot : string ) : Promise < string [ ] > {
48- const modulesPath = path . resolve ( appRoot , 'ios/localModules' ) ;
49- if ( ! fs . existsSync ( modulesPath ) ) {
50- return [ ] ;
51- }
52- const res : string [ ] = [ ] ;
53-
54- const recursivelyScanDirectories = async ( dirPath : string ) => {
55- res . push ( dirPath ) ;
56- const dir = fs . opendirSync ( dirPath ) ;
57- for await ( const dirent of dir ) {
58- if ( ! dirent . isDirectory ( ) ) {
59- continue ;
60- }
61- const childPath = path . resolve ( modulesPath , dirent . name ) ;
62- await recursivelyScanDirectories ( childPath ) ;
63- }
64- } ;
65-
66- await recursivelyScanDirectories ( modulesPath ) ;
67-
68- return res ;
69- }
70-
7144/** Searches for modules to link based on given config. */
7245export async function findModulesAsync ( {
7346 appRoot,
@@ -76,11 +49,10 @@ export async function findModulesAsync({
7649 const excludeNames = new Set ( autolinkingOptions . exclude ) ;
7750
7851 // custom native modules should be resolved first so that they can override other modules
79- const originalSearchPaths = autolinkingOptions . nativeModulesDir
52+ const searchPaths = autolinkingOptions . nativeModulesDir
8053 ? [ autolinkingOptions . nativeModulesDir , ...autolinkingOptions . searchPaths ]
8154 : autolinkingOptions . searchPaths ;
8255
83- const searchPaths = [ ...( await localModulesSearchPaths ( appRoot ) ) , ...originalSearchPaths ] ;
8456 return filterMapResolutionResult (
8557 mergeResolutionResults (
8658 await Promise . all ( [
0 commit comments