UNPKG

expo-modules-autolinking

Version:
32 lines (29 loc) 1.04 kB
import { getLinkingImplementationForPlatform } from '../platforms'; import type { ModuleDescriptor, ModuleDescriptorIos, SupportedPlatform } from '../types'; interface GenerateModulesProviderParams { platform: SupportedPlatform; targetPath: string; entitlementPath: string | null; watchedDirectories: string[]; inlineModulesTargets: { mainTarget?: string; targets: string[] }; appRoot: string; } /** Generates ExpoModulesProvider file listing all packages to link (Apple-only) */ export async function generateModulesProviderAsync( modules: ModuleDescriptor[], params: GenerateModulesProviderParams ) { const platformLinking = getLinkingImplementationForPlatform(params.platform); if (!('generateModulesProviderAsync' in platformLinking)) { throw new Error( `Generating modules provider is not available for platform "${params.platform}"` ); } await platformLinking.generateModulesProviderAsync( modules as ModuleDescriptorIos[], params.targetPath, params.entitlementPath, params ); }