/** * Podfile manipulation utilities. * Provides helpers for injecting target blocks into Podfile. */ /** * Ensure resource bundle targets have code signing disabled for Xcode 14+. * Starting from Xcode 14, resource bundles are signed by default, which requires * setting the development team for each resource bundle target. This fix disables * code signing for resource bundles to avoid build failures. * * Uses START/END markers for reliable, idempotent injection. */ export declare function ensureResourceBundleCodeSigning(podfileContent: string): string; /** * Parseable marker: packages to strip from this nested target's ExpoModulesProvider. * Must not be a prefix of the post_integrate fence markers, and those fences * must not contain a Ruby `\bend\b` (standalone insert used to splice there). */ export declare const EXCLUDED_PACKAGES_MARKER = "# [expo-targets-excluded-packages-list]"; export declare const EXCLUDED_LINKER_MARKER = "# [expo-targets-excluded-linker-list]"; /** * Generate a Podfile target block for a React Native extension. * Extension targets only inherit search paths, with no explicit pod dependencies. * This avoids linking incompatible modules like Expo that contain UIApplication APIs. * * `excludedPackages` and `linkerTokens` are recorded as comment markers so a * `post_integrate` hook can strip those names from `expo-configure-project.sh`, * regenerate the provider, and drop unused `-l` / `-framework` / module maps * on `Pods-`. Nested `use_expo_modules!(exclude:)` is a no-op. * * @param podsRbContent - Optional content from a pods.rb file in the target directory. * Allows custom CocoaPods configuration (e.g., Firebase, third-party SDKs). */ export declare function generateReactNativeTargetBlock({ targetName, deploymentTarget, extensionType, podsRbContent, excludedPackages, linkerTokens, }: { targetName: string; deploymentTarget: string; extensionType: string; podsRbContent?: string; excludedPackages?: string[]; linkerTokens?: string[]; }): string; /** * Check if main app target uses frameworks. * Returns true if use_frameworks! is found in the main target block. */ export declare function mainTargetUsesFrameworks(podfileContent: string, mainTargetName: string): boolean; /** * Generate a Podfile target block for a standalone (non-RN) extension. * Standalone targets use native code only (Swift/Obj-C), no React Native or Expo modules. * Must match main app's use_frameworks! setting for CocoaPods integration. * * @param podsRbContent - Optional content from a pods.rb file in the target directory. * Allows custom CocoaPods configuration (e.g., Firebase, third-party SDKs). */ export declare function generateStandaloneTargetBlock({ targetName, deploymentTarget, useFrameworks, podsRbContent, }: { targetName: string; deploymentTarget: string; useFrameworks?: boolean; podsRbContent?: string; }): string; /** * Podfile block for expo-ui widgets — mirrors expo-widgets `withPodsLinking` * (`use_expo_modules_widgets!` + thin RN host for the layout sandbox). */ export declare function generateExpoUiWidgetTargetBlock({ targetName, deploymentTarget, podsRbContent, }: { targetName: string; deploymentTarget: string; podsRbContent?: string; }): string; /** * Ensure `expo_widgets_post_install` runs so ExpoModulesCore / ExpoUI / React * can set APPLICATION_EXTENSION_API_ONLY = No for the widget sandbox. */ export declare function ensureExpoWidgetsPostInstall(podfileContent: string): string; /** * Insert a target block into a Podfile. * React Native targets are nested inside main app to inherit dependencies. * Standalone targets are inserted as siblings to avoid Expo module autolinking. */ export declare function insertTargetBlock(podfileContent: string, targetBlock: string, options?: { standalone?: boolean; logger?: { log: (message: string) => void; }; mainTargetName?: string; }): string; /** * Check if a Podfile already contains a target block. */ export declare function hasTargetBlock(podfileContent: string, targetName: string): boolean; /** * Remove an existing target block from a Podfile. * Finds the target declaration and removes it along with its entire do/end block. */ export declare function removeTargetBlock(podfileContent: string, targetName: string): string; /** * Ensure main app target has use_frameworks! to match extension requirements. * CocoaPods requires host app and extensions to have matching use_frameworks! settings. */ export declare function ensureMainTargetUsesFrameworks(podfileContent: string, mainTargetName: string): string; /** * Update the Podfile platform line to match the highest deployment target. * This ensures consistency between the main app platform and extension targets. * * Fixes deployment target mismatch where Podfile defaults to 15.1 but extension * targets require a higher version (e.g., 17.0), causing linker errors. */ export declare function updatePodfilePlatform(podfileContent: string, deploymentTarget: string): string; /** * Inject deployment target fixes into the main app's existing post_install hook. * This ensures extension targets maintain their correct deployment targets even after * react_native_post_install runs, which might override them. * * Fixes both the Pods Xcode project targets AND the xcconfig files that extensions reference. */ export declare function ensureExtensionDeploymentTargets(podfileContent: string, extensions: { targetName: string; deploymentTarget: string; }[]): string; /** * Ensure React Native extension targets have proper framework search paths. * Uses START/END markers for reliable, idempotent injection. */ export declare function ensureReactNativeExtensionFrameworkPaths(podfileContent: string, extensions: { targetName: string; deploymentTarget: string; }[], mainTargetName: string): string; /** * Ruby that mutates `xc` for each linker `token`. Exported so tests run the * same gsub as `pod install` (unanchored `"?token"?` smashed OTHER_LDFLAGS). */ export declare const EXCLUDED_LINKER_STRIP_RUBY: readonly [" tokens.each do |token|", " next if token.to_s.empty?", " escaped = Regexp.escape(token)", " xc.gsub!(/\\s*-l(?:\"#{escaped}\"|#{escaped}(?=[\\s\"]|$))/, '')", " xc.gsub!(/\\s*-framework\\s+(?:\"#{escaped}\"|#{escaped}(?=[\\s\"]|$))/, '')", " xc.gsub!(/\\s*-Xcc\\s+-fmodule-map-file=\"[^\"]*[\\/\"]#{escaped}(?:\\.modulemap|[\\/\"])[^\"]*\"/, '')", " xc.gsub!(/\\s*-fmodule-map-file=\"[^\"]*[\\/\"]#{escaped}(?:\\.modulemap|[\\/\"])[^\"]*\"/, '')", " end"]; /** * Ensure a top-level `post_integrate` hook strips `excludedPackages` from each * nested RN target's `expo-configure-project.sh` and regenerates its provider. * Idempotent via START/END markers. No exclusions → remove any prior hook. */ export declare function ensureExcludedPackagesPostIntegrate(podfileContent: string, exclusions: { targetName: string; packages: string[]; linkerTokens?: string[]; }[]): string; //# sourceMappingURL=podfile.d.ts.map