expo-targets 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/.eslintrc.js +2 -0
  2. package/README.md +244 -0
  3. package/android/build.gradle +22 -0
  4. package/android/src/main/java/expo/modules/targets/ExpoTargetsLogger.kt +98 -0
  5. package/android/src/main/java/expo/modules/targets/ExpoTargetsReceiver.kt +136 -0
  6. package/android/src/main/java/expo/modules/targets/ExpoTargetsRemoteViewsProvider.kt +72 -0
  7. package/android/src/main/java/expo/modules/targets/ExpoTargetsWidgetProvider.kt +47 -0
  8. package/android/src/main/java/expo/modules/targets/ExpoTargetsWidgetSync.kt +78 -0
  9. package/android/src/main/java/expo/modules/targets/ExpoTargetsWidgetUpdateReceiver.kt +30 -0
  10. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsExtensionModule.kt +27 -0
  11. package/android/src/main/java/expo/modules/targets/messages/ExpoTargetsMessagesModule.kt +40 -0
  12. package/android/src/main/java/expo/modules/targets/storage/ExpoTargetsStorageModule.kt +119 -0
  13. package/app.plugin.js +1 -0
  14. package/build/metro/src/index.d.ts +2 -0
  15. package/build/metro/src/index.d.ts.map +1 -0
  16. package/build/metro/src/index.js +6 -0
  17. package/build/metro/src/index.js.map +1 -0
  18. package/build/metro/src/withTargetsMetro.d.ts +6 -0
  19. package/build/metro/src/withTargetsMetro.d.ts.map +1 -0
  20. package/build/metro/src/withTargetsMetro.js +171 -0
  21. package/build/metro/src/withTargetsMetro.js.map +1 -0
  22. package/build/plugin/src/android/config-plugins/withAndroidColors.d.ts +7 -0
  23. package/build/plugin/src/android/config-plugins/withAndroidColors.d.ts.map +1 -0
  24. package/build/plugin/src/android/config-plugins/withAndroidColors.js +56 -0
  25. package/build/plugin/src/android/config-plugins/withAndroidColors.js.map +1 -0
  26. package/build/plugin/src/android/config-plugins/withAndroidManifest.d.ts +7 -0
  27. package/build/plugin/src/android/config-plugins/withAndroidManifest.d.ts.map +1 -0
  28. package/build/plugin/src/android/config-plugins/withAndroidManifest.js +70 -0
  29. package/build/plugin/src/android/config-plugins/withAndroidManifest.js.map +1 -0
  30. package/build/plugin/src/android/config-plugins/withAndroidModule.d.ts +7 -0
  31. package/build/plugin/src/android/config-plugins/withAndroidModule.d.ts.map +1 -0
  32. package/build/plugin/src/android/config-plugins/withAndroidModule.js +41 -0
  33. package/build/plugin/src/android/config-plugins/withAndroidModule.js.map +1 -0
  34. package/build/plugin/src/android/config-plugins/withAndroidResources.d.ts +7 -0
  35. package/build/plugin/src/android/config-plugins/withAndroidResources.d.ts.map +1 -0
  36. package/build/plugin/src/android/config-plugins/withAndroidResources.js +75 -0
  37. package/build/plugin/src/android/config-plugins/withAndroidResources.js.map +1 -0
  38. package/build/plugin/src/android/config-plugins/withAndroidTarget.d.ts +28 -0
  39. package/build/plugin/src/android/config-plugins/withAndroidTarget.d.ts.map +1 -0
  40. package/build/plugin/src/android/config-plugins/withAndroidTarget.js +28 -0
  41. package/build/plugin/src/android/config-plugins/withAndroidTarget.js.map +1 -0
  42. package/build/plugin/src/android/config-plugins/withGradleModule.d.ts +7 -0
  43. package/build/plugin/src/android/config-plugins/withGradleModule.d.ts.map +1 -0
  44. package/build/plugin/src/android/config-plugins/withGradleModule.js +86 -0
  45. package/build/plugin/src/android/config-plugins/withGradleModule.js.map +1 -0
  46. package/build/plugin/src/android/config-plugins/withGradleSettings.d.ts +7 -0
  47. package/build/plugin/src/android/config-plugins/withGradleSettings.d.ts.map +1 -0
  48. package/build/plugin/src/android/config-plugins/withGradleSettings.js +23 -0
  49. package/build/plugin/src/android/config-plugins/withGradleSettings.js.map +1 -0
  50. package/build/plugin/src/android/withAndroidAppBuildGradle.d.ts +7 -0
  51. package/build/plugin/src/android/withAndroidAppBuildGradle.d.ts.map +1 -0
  52. package/build/plugin/src/android/withAndroidAppBuildGradle.js +31 -0
  53. package/build/plugin/src/android/withAndroidAppBuildGradle.js.map +1 -0
  54. package/build/plugin/src/android/withAndroidKotlinGradleProperty.d.ts +3 -0
  55. package/build/plugin/src/android/withAndroidKotlinGradleProperty.d.ts.map +1 -0
  56. package/build/plugin/src/android/withAndroidKotlinGradleProperty.js +24 -0
  57. package/build/plugin/src/android/withAndroidKotlinGradleProperty.js.map +1 -0
  58. package/build/plugin/src/android/withAndroidProjectKotlinVersion.d.ts +3 -0
  59. package/build/plugin/src/android/withAndroidProjectKotlinVersion.d.ts.map +1 -0
  60. package/build/plugin/src/android/withAndroidProjectKotlinVersion.js +27 -0
  61. package/build/plugin/src/android/withAndroidProjectKotlinVersion.js.map +1 -0
  62. package/build/plugin/src/android/withAndroidTarget.d.ts +10 -0
  63. package/build/plugin/src/android/withAndroidTarget.d.ts.map +1 -0
  64. package/build/plugin/src/android/withAndroidTarget.js +22 -0
  65. package/build/plugin/src/android/withAndroidTarget.js.map +1 -0
  66. package/build/plugin/src/android/withAndroidWidget.d.ts +13 -0
  67. package/build/plugin/src/android/withAndroidWidget.d.ts.map +1 -0
  68. package/build/plugin/src/android/withAndroidWidget.js +564 -0
  69. package/build/plugin/src/android/withAndroidWidget.js.map +1 -0
  70. package/build/plugin/src/config.d.ts +141 -0
  71. package/build/plugin/src/config.d.ts.map +1 -0
  72. package/build/plugin/src/config.js +54 -0
  73. package/build/plugin/src/config.js.map +1 -0
  74. package/build/plugin/src/index.d.ts +9 -0
  75. package/build/plugin/src/index.d.ts.map +1 -0
  76. package/build/plugin/src/index.js +11 -0
  77. package/build/plugin/src/index.js.map +1 -0
  78. package/build/plugin/src/ios/config-plugins/withEntitlements.d.ts +11 -0
  79. package/build/plugin/src/ios/config-plugins/withEntitlements.d.ts.map +1 -0
  80. package/build/plugin/src/ios/config-plugins/withEntitlements.js +49 -0
  81. package/build/plugin/src/ios/config-plugins/withEntitlements.js.map +1 -0
  82. package/build/plugin/src/ios/config-plugins/withIOSTarget.d.ts +17 -0
  83. package/build/plugin/src/ios/config-plugins/withIOSTarget.d.ts.map +1 -0
  84. package/build/plugin/src/ios/config-plugins/withIOSTarget.js +152 -0
  85. package/build/plugin/src/ios/config-plugins/withIOSTarget.js.map +1 -0
  86. package/build/plugin/src/ios/config-plugins/withIosColorset.d.ts +8 -0
  87. package/build/plugin/src/ios/config-plugins/withIosColorset.d.ts.map +1 -0
  88. package/build/plugin/src/ios/config-plugins/withIosColorset.js +25 -0
  89. package/build/plugin/src/ios/config-plugins/withIosColorset.js.map +1 -0
  90. package/build/plugin/src/ios/config-plugins/withIosStickerPack.d.ts +8 -0
  91. package/build/plugin/src/ios/config-plugins/withIosStickerPack.d.ts.map +1 -0
  92. package/build/plugin/src/ios/config-plugins/withIosStickerPack.js +52 -0
  93. package/build/plugin/src/ios/config-plugins/withIosStickerPack.js.map +1 -0
  94. package/build/plugin/src/ios/config-plugins/withPodfile.d.ts +12 -0
  95. package/build/plugin/src/ios/config-plugins/withPodfile.d.ts.map +1 -0
  96. package/build/plugin/src/ios/config-plugins/withPodfile.js +162 -0
  97. package/build/plugin/src/ios/config-plugins/withPodfile.js.map +1 -0
  98. package/build/plugin/src/ios/config-plugins/withXcodeChanges.d.ts +15 -0
  99. package/build/plugin/src/ios/config-plugins/withXcodeChanges.d.ts.map +1 -0
  100. package/build/plugin/src/ios/config-plugins/withXcodeChanges.js +646 -0
  101. package/build/plugin/src/ios/config-plugins/withXcodeChanges.js.map +1 -0
  102. package/build/plugin/src/ios/target.d.ts +41 -0
  103. package/build/plugin/src/ios/target.d.ts.map +1 -0
  104. package/build/plugin/src/ios/target.js +574 -0
  105. package/build/plugin/src/ios/target.js.map +1 -0
  106. package/build/plugin/src/ios/utils/asset.d.ts +60 -0
  107. package/build/plugin/src/ios/utils/asset.d.ts.map +1 -0
  108. package/build/plugin/src/ios/utils/asset.js +375 -0
  109. package/build/plugin/src/ios/utils/asset.js.map +1 -0
  110. package/build/plugin/src/ios/utils/file.d.ts +33 -0
  111. package/build/plugin/src/ios/utils/file.d.ts.map +1 -0
  112. package/build/plugin/src/ios/utils/file.js +88 -0
  113. package/build/plugin/src/ios/utils/file.js.map +1 -0
  114. package/build/plugin/src/ios/utils/index.d.ts +12 -0
  115. package/build/plugin/src/ios/utils/index.d.ts.map +1 -0
  116. package/build/plugin/src/ios/utils/index.js +38 -0
  117. package/build/plugin/src/ios/utils/index.js.map +1 -0
  118. package/build/plugin/src/ios/utils/paths.d.ts +128 -0
  119. package/build/plugin/src/ios/utils/paths.d.ts.map +1 -0
  120. package/build/plugin/src/ios/utils/paths.js +141 -0
  121. package/build/plugin/src/ios/utils/paths.js.map +1 -0
  122. package/build/plugin/src/ios/utils/plist.d.ts +29 -0
  123. package/build/plugin/src/ios/utils/plist.d.ts.map +1 -0
  124. package/build/plugin/src/ios/utils/plist.js +114 -0
  125. package/build/plugin/src/ios/utils/plist.js.map +1 -0
  126. package/build/plugin/src/ios/utils/podfile.d.ts +82 -0
  127. package/build/plugin/src/ios/utils/podfile.d.ts.map +1 -0
  128. package/build/plugin/src/ios/utils/podfile.js +408 -0
  129. package/build/plugin/src/ios/utils/podfile.js.map +1 -0
  130. package/build/plugin/src/ios/utils/reactNativeSwift.d.ts +11 -0
  131. package/build/plugin/src/ios/utils/reactNativeSwift.d.ts.map +1 -0
  132. package/build/plugin/src/ios/utils/reactNativeSwift.js +263 -0
  133. package/build/plugin/src/ios/utils/reactNativeSwift.js.map +1 -0
  134. package/build/plugin/src/ios/utils/xcode.d.ts +185 -0
  135. package/build/plugin/src/ios/utils/xcode.d.ts.map +1 -0
  136. package/build/plugin/src/ios/utils/xcode.js +706 -0
  137. package/build/plugin/src/ios/utils/xcode.js.map +1 -0
  138. package/build/plugin/src/logger.d.ts +10 -0
  139. package/build/plugin/src/logger.d.ts.map +1 -0
  140. package/build/plugin/src/logger.js +62 -0
  141. package/build/plugin/src/logger.js.map +1 -0
  142. package/build/plugin/src/parseTargetConfig.d.ts +3 -0
  143. package/build/plugin/src/parseTargetConfig.d.ts.map +1 -0
  144. package/build/plugin/src/parseTargetConfig.js +113 -0
  145. package/build/plugin/src/parseTargetConfig.js.map +1 -0
  146. package/build/plugin/src/withTargetsDir.d.ts +6 -0
  147. package/build/plugin/src/withTargetsDir.d.ts.map +1 -0
  148. package/build/plugin/src/withTargetsDir.js +90 -0
  149. package/build/plugin/src/withTargetsDir.js.map +1 -0
  150. package/build/src/Target.d.ts +43 -0
  151. package/build/src/Target.d.ts.map +1 -0
  152. package/build/src/Target.js +128 -0
  153. package/build/src/Target.js.map +1 -0
  154. package/build/src/index.d.ts +9 -0
  155. package/build/src/index.d.ts.map +1 -0
  156. package/build/src/index.js +27 -0
  157. package/build/src/index.js.map +1 -0
  158. package/build/src/modules/extension/index.d.ts +18 -0
  159. package/build/src/modules/extension/index.d.ts.map +1 -0
  160. package/build/src/modules/extension/index.js +44 -0
  161. package/build/src/modules/extension/index.js.map +1 -0
  162. package/build/src/modules/messages/index.d.ts +40 -0
  163. package/build/src/modules/messages/index.d.ts.map +1 -0
  164. package/build/src/modules/messages/index.js +94 -0
  165. package/build/src/modules/messages/index.js.map +1 -0
  166. package/build/src/modules/storage/index.d.ts +16 -0
  167. package/build/src/modules/storage/index.d.ts.map +1 -0
  168. package/build/src/modules/storage/index.js +122 -0
  169. package/build/src/modules/storage/index.js.map +1 -0
  170. package/expo-module.config.json +17 -0
  171. package/ios/ExpoTargetsExtension.podspec +23 -0
  172. package/ios/ExpoTargetsExtensionModule.swift +181 -0
  173. package/ios/ExpoTargetsMessages.podspec +23 -0
  174. package/ios/ExpoTargetsMessagesModule.swift +267 -0
  175. package/ios/ExpoTargetsStorage.podspec +23 -0
  176. package/ios/ExpoTargetsStorageModule.swift +91 -0
  177. package/ios/Tests/.swiftlint.yml +52 -0
  178. package/ios/Tests/Helpers/MockExtensionContext.swift +58 -0
  179. package/ios/Tests/Helpers/MockUserDefaults.swift +70 -0
  180. package/ios/Tests/Helpers/MockWidgetCenter.swift +71 -0
  181. package/ios/Tests/Helpers/TestHelpers.swift +90 -0
  182. package/ios/Tests/Integration/TargetIntegrationTests.swift +478 -0
  183. package/ios/Tests/Main/AllTests.swift +80 -0
  184. package/ios/Tests/Package.swift +66 -0
  185. package/ios/Tests/Performance/StoragePerformanceTests.swift +461 -0
  186. package/ios/Tests/Unit/Extension/ExpoTargetsExtensionModuleTests.swift +501 -0
  187. package/ios/Tests/Unit/Storage/ExpoTargetsStorageModuleTests.swift +578 -0
  188. package/ios/Tests/Unit/Template/ShareExtensionTemplateTests.swift +421 -0
  189. package/ios/Tests/XCTestPlan.xctestplan +87 -0
  190. package/metro/src/index.ts +1 -0
  191. package/metro/src/withTargetsMetro.ts +247 -0
  192. package/metro/tsconfig.build.json +9 -0
  193. package/package.json +74 -0
  194. package/plugin/src/android/withAndroidAppBuildGradle.ts +34 -0
  195. package/plugin/src/android/withAndroidTarget.ts +26 -0
  196. package/plugin/src/android/withAndroidWidget.ts +778 -0
  197. package/plugin/src/config.ts +255 -0
  198. package/plugin/src/index.ts +19 -0
  199. package/plugin/src/ios/config-plugins/withEntitlements.ts +69 -0
  200. package/plugin/src/ios/config-plugins/withIOSTarget.ts +179 -0
  201. package/plugin/src/ios/config-plugins/withIosColorset.ts +29 -0
  202. package/plugin/src/ios/config-plugins/withIosStickerPack.ts +65 -0
  203. package/plugin/src/ios/config-plugins/withPodfile.ts +238 -0
  204. package/plugin/src/ios/config-plugins/withXcodeChanges.ts +891 -0
  205. package/plugin/src/ios/target.ts +668 -0
  206. package/plugin/src/ios/templates/MessagesViewController.swift +120 -0
  207. package/plugin/src/ios/templates/ReactNativeViewController.swift +240 -0
  208. package/plugin/src/ios/templates/action-extension-data.swift +106 -0
  209. package/plugin/src/ios/templates/clip-extension-data.swift +28 -0
  210. package/plugin/src/ios/templates/messages-extension-data.swift +28 -0
  211. package/plugin/src/ios/templates/share-extension-data.swift +113 -0
  212. package/plugin/src/ios/utils/asset.ts +490 -0
  213. package/plugin/src/ios/utils/file.ts +80 -0
  214. package/plugin/src/ios/utils/index.ts +12 -0
  215. package/plugin/src/ios/utils/paths.ts +253 -0
  216. package/plugin/src/ios/utils/plist.ts +101 -0
  217. package/plugin/src/ios/utils/podfile.ts +534 -0
  218. package/plugin/src/ios/utils/reactNativeSwift.ts +283 -0
  219. package/plugin/src/ios/utils/xcode.ts +989 -0
  220. package/plugin/src/logger.ts +63 -0
  221. package/plugin/src/parseTargetConfig.ts +115 -0
  222. package/plugin/src/types/normalize-colors.d.ts +3 -0
  223. package/plugin/src/withTargetsDir.ts +120 -0
  224. package/plugin/tsconfig.build.json +9 -0
  225. package/plugin/tsconfig.json +9 -0
  226. package/src/Target.ts +239 -0
  227. package/src/index.ts +52 -0
  228. package/src/modules/extension/index.ts +54 -0
  229. package/src/modules/messages/index.ts +124 -0
  230. package/src/modules/storage/index.ts +126 -0
  231. package/tsconfig.json +8 -0
@@ -0,0 +1,408 @@
1
+ "use strict";
2
+ /**
3
+ * Podfile manipulation utilities.
4
+ * Provides helpers for injecting target blocks into Podfile.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ensureReactNativeExtensionFrameworkPaths = exports.ensureExtensionDeploymentTargets = exports.updatePodfilePlatform = exports.ensureMainTargetUsesFrameworks = exports.removeTargetBlock = exports.hasTargetBlock = exports.insertTargetBlock = exports.generateStandaloneTargetBlock = exports.mainTargetUsesFrameworks = exports.generateReactNativeTargetBlock = void 0;
8
+ /**
9
+ * Generate a Podfile target block for a React Native extension.
10
+ * Extension targets only inherit search paths, with no explicit pod dependencies.
11
+ * This avoids linking incompatible modules like Expo that contain UIApplication APIs.
12
+ *
13
+ * Note: ExpoTargetsMessages is accessed via the main app's autolinking through shared
14
+ * registry defined in generated code, so no direct pod dependency is needed.
15
+ */
16
+ function generateReactNativeTargetBlock({ targetName, deploymentTarget, extensionType, }) {
17
+ return `
18
+ target '${targetName}' do
19
+ platform :ios, '${deploymentTarget}'
20
+ inherit! :search_paths
21
+ end
22
+ `;
23
+ }
24
+ exports.generateReactNativeTargetBlock = generateReactNativeTargetBlock;
25
+ /**
26
+ * Check if main app target uses frameworks.
27
+ * Returns true if use_frameworks! is found in the main target block.
28
+ */
29
+ function mainTargetUsesFrameworks(podfileContent, mainTargetName) {
30
+ const targetRegex = new RegExp(`target\\s+'${mainTargetName}'\\s+do([\\s\\S]*?)(?=\\n\\s*target\\s+|post_install|$)`, 'm');
31
+ const match = podfileContent.match(targetRegex);
32
+ if (!match) {
33
+ return false;
34
+ }
35
+ const targetBlock = match[1];
36
+ return targetBlock.includes('use_frameworks!');
37
+ }
38
+ exports.mainTargetUsesFrameworks = mainTargetUsesFrameworks;
39
+ /**
40
+ * Generate a Podfile target block for a standalone (non-RN) extension.
41
+ * Standalone targets use native code only (Swift/Obj-C), no React Native or Expo modules.
42
+ * Must match main app's use_frameworks! setting for CocoaPods integration.
43
+ */
44
+ function generateStandaloneTargetBlock({ targetName, deploymentTarget, useFrameworks, }) {
45
+ const frameworksLine = useFrameworks
46
+ ? ` use_frameworks! :linkage => :static\n`
47
+ : '';
48
+ return `
49
+ target '${targetName}' do
50
+ ${frameworksLine} platform :ios, '${deploymentTarget}'
51
+ end
52
+ `;
53
+ }
54
+ exports.generateStandaloneTargetBlock = generateStandaloneTargetBlock;
55
+ /**
56
+ * Insert a target block into a Podfile.
57
+ * React Native targets are nested inside main app to inherit dependencies.
58
+ * Standalone targets are inserted as siblings to avoid Expo module autolinking.
59
+ */
60
+ function insertTargetBlock(podfileContent, targetBlock, standalone = false, logger) {
61
+ if (standalone) {
62
+ // Standalone targets: insert as sibling AFTER main target's closing 'end'
63
+ // This prevents CocoaPods from auto-generating Expo module providers
64
+ // Find the last 'end' in the Podfile - this should be the main target's closing 'end'
65
+ // since the main target is the outermost block in a standard Expo Podfile
66
+ const lastEndMatch = podfileContent.match(/\bend\b(?!.*\bend\b)/s);
67
+ if (!lastEndMatch) {
68
+ throw new Error('Could not find any end keyword in Podfile');
69
+ }
70
+ const mainTargetEndIndex = lastEndMatch.index + lastEndMatch[0].length;
71
+ if (logger) {
72
+ logger.log(`Inserting standalone target after main target's closing 'end' at position ${mainTargetEndIndex}`);
73
+ }
74
+ else {
75
+ console.log(`[expo-targets] Inserting standalone target after main target's closing 'end' at position ${mainTargetEndIndex}`);
76
+ }
77
+ // Insert after main target's closing 'end'
78
+ return (podfileContent.slice(0, mainTargetEndIndex) +
79
+ '\n\n' +
80
+ targetBlock.trim() +
81
+ podfileContent.slice(mainTargetEndIndex));
82
+ }
83
+ if (logger) {
84
+ logger.log('Inserting React Native target nested inside main target');
85
+ }
86
+ else {
87
+ console.log('[expo-targets] Inserting React Native target nested inside main target');
88
+ }
89
+ // React Native targets: nest inside main target before post_install
90
+ const postInstallIndex = podfileContent.indexOf('post_install do');
91
+ if (postInstallIndex !== -1) {
92
+ return (podfileContent.slice(0, postInstallIndex) +
93
+ targetBlock +
94
+ '\n ' +
95
+ podfileContent.slice(postInstallIndex));
96
+ }
97
+ // Fallback: insert before the last 'end' of main target
98
+ const lastEndIndex = podfileContent.lastIndexOf('end');
99
+ return (podfileContent.slice(0, lastEndIndex) +
100
+ targetBlock +
101
+ '\n' +
102
+ podfileContent.slice(lastEndIndex));
103
+ }
104
+ exports.insertTargetBlock = insertTargetBlock;
105
+ /**
106
+ * Check if a Podfile already contains a target block.
107
+ */
108
+ function hasTargetBlock(podfileContent, targetName) {
109
+ return podfileContent.includes(`target '${targetName}'`);
110
+ }
111
+ exports.hasTargetBlock = hasTargetBlock;
112
+ /**
113
+ * Remove an existing target block from a Podfile.
114
+ * Finds the target declaration and removes it along with its entire do/end block.
115
+ */
116
+ function removeTargetBlock(podfileContent, targetName) {
117
+ // Find the target block
118
+ const targetRegex = new RegExp(`target\\s+['"]${targetName}['"]\\s+do`, 'g');
119
+ const targetMatch = targetRegex.exec(podfileContent);
120
+ if (!targetMatch) {
121
+ return podfileContent; // Target doesn't exist, nothing to remove
122
+ }
123
+ // Find the corresponding closing 'end' by counting nested block pairs
124
+ const startIndex = targetMatch.index;
125
+ const afterDoIndex = targetMatch.index + targetMatch[0].length;
126
+ // Start at depth 1 because we're already inside the target block (after 'do')
127
+ let depth = 1;
128
+ // Match all Ruby block keywords that require 'end'
129
+ const blockRegex = /\b(do|if|unless|case|begin|class|module|def|end)\b/g;
130
+ blockRegex.lastIndex = afterDoIndex;
131
+ let match;
132
+ let targetEndIndex = -1;
133
+ while ((match = blockRegex.exec(podfileContent)) !== null) {
134
+ if (match[1] === 'end') {
135
+ depth--;
136
+ if (depth === 0) {
137
+ // Found the matching 'end' for target
138
+ targetEndIndex = match.index + match[0].length;
139
+ break;
140
+ }
141
+ }
142
+ else {
143
+ // All other keywords open a block
144
+ depth++;
145
+ }
146
+ }
147
+ if (targetEndIndex === -1) {
148
+ throw new Error(`Could not find closing end for target '${targetName}'`);
149
+ }
150
+ // Remove the target block including surrounding whitespace
151
+ // Look back to remove leading whitespace/newlines
152
+ let removeStart = startIndex;
153
+ while (removeStart > 0 && /[\s\n]/.test(podfileContent[removeStart - 1])) {
154
+ removeStart--;
155
+ }
156
+ // Look forward to remove trailing newlines (but keep one newline if present)
157
+ let removeEnd = targetEndIndex;
158
+ while (removeEnd < podfileContent.length &&
159
+ podfileContent[removeEnd] === '\n') {
160
+ removeEnd++;
161
+ break; // Keep only one trailing newline
162
+ }
163
+ return podfileContent.slice(0, removeStart) + podfileContent.slice(removeEnd);
164
+ }
165
+ exports.removeTargetBlock = removeTargetBlock;
166
+ /**
167
+ * Ensure main app target has use_frameworks! to match extension requirements.
168
+ * CocoaPods requires host app and extensions to have matching use_frameworks! settings.
169
+ */
170
+ function ensureMainTargetUsesFrameworks(podfileContent, mainTargetName) {
171
+ // Check if main target already has use_frameworks!
172
+ const targetRegex = new RegExp(`target\\s+'${mainTargetName}'\\s+do([\\s\\S]*?)(?=\\n\\s*target\\s+|post_install|$)`, 'm');
173
+ const match = podfileContent.match(targetRegex);
174
+ if (!match) {
175
+ return podfileContent;
176
+ }
177
+ const targetBlock = match[1];
178
+ // Check if use_frameworks! already exists in this target
179
+ if (targetBlock.includes('use_frameworks!')) {
180
+ return podfileContent;
181
+ }
182
+ // Find insertion point: after "target 'Name' do" line
183
+ const targetLineRegex = new RegExp(`(target\\s+'${mainTargetName}'\\s+do\\s*\\n)`, 'm');
184
+ return podfileContent.replace(targetLineRegex, `$1 use_frameworks! :linkage => :static\n\n`);
185
+ }
186
+ exports.ensureMainTargetUsesFrameworks = ensureMainTargetUsesFrameworks;
187
+ /**
188
+ * Update the Podfile platform line to match the highest deployment target.
189
+ * This ensures consistency between the main app platform and extension targets.
190
+ *
191
+ * Fixes deployment target mismatch where Podfile defaults to 15.1 but extension
192
+ * targets require a higher version (e.g., 17.0), causing linker errors.
193
+ */
194
+ function updatePodfilePlatform(podfileContent, deploymentTarget) {
195
+ // Match platform line with various formats:
196
+ // - platform :ios, '15.1'
197
+ // - platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
198
+ // - platform :ios, "15.1"
199
+ const platformLineRegex = /(platform\s+:ios\s*,\s*)(?:podfile_properties\[['"]ios\.deploymentTarget['"]\]\s*\|\|\s*)?(['"])([^'"]+)(['"])/;
200
+ const match = podfileContent.match(platformLineRegex);
201
+ if (!match) {
202
+ console.warn('[expo-targets] Could not find platform :ios line in Podfile to update');
203
+ return podfileContent;
204
+ }
205
+ const currentVersion = match[3];
206
+ const quoteChar = match[2]; // Preserve original quote style (' or ")
207
+ const currentVersionNum = parseFloat(currentVersion);
208
+ const newVersionNum = parseFloat(deploymentTarget);
209
+ // Only update if the new version is higher
210
+ if (newVersionNum > currentVersionNum) {
211
+ console.log(`[expo-targets] Updating Podfile platform from iOS ${currentVersion} to ${deploymentTarget}`);
212
+ // Replace the entire platform line with a simple version
213
+ // Use the same quote style as the original
214
+ return podfileContent.replace(platformLineRegex, `$1${quoteChar}${deploymentTarget}${quoteChar}`);
215
+ }
216
+ return podfileContent;
217
+ }
218
+ exports.updatePodfilePlatform = updatePodfilePlatform;
219
+ /**
220
+ * Inject deployment target fixes into the main app's existing post_install hook.
221
+ * This ensures extension targets maintain their correct deployment targets even after
222
+ * react_native_post_install runs, which might override them.
223
+ *
224
+ * Fixes both the Pods Xcode project targets AND the xcconfig files that extensions reference.
225
+ */
226
+ function ensureExtensionDeploymentTargets(podfileContent, extensions) {
227
+ if (extensions.length === 0) {
228
+ return podfileContent;
229
+ }
230
+ // Remove any existing deployment target fix code
231
+ if (podfileContent.includes('# [expo-targets] Fix extension deployment targets')) {
232
+ const fixRegex = /\s*# \[expo-targets\] Fix extension deployment targets[\s\S]*?(?=\n\s{4}\w|\n\s{2}end)/;
233
+ podfileContent = podfileContent.replace(fixRegex, '');
234
+ }
235
+ // Generate the deployment target fix code to inject
236
+ const fixCode = `
237
+ # [expo-targets] Fix extension deployment targets
238
+ installer.pods_project.targets.each do |target|
239
+ ${extensions
240
+ .map((ext) => ` if target.name.include?('${ext.targetName}')
241
+ target.build_configurations.each do |config|
242
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${ext.deploymentTarget}'
243
+ # Also update the xcconfig file
244
+ xcconfig_path = config.base_configuration_reference.real_path
245
+ if xcconfig_path && File.exist?(xcconfig_path)
246
+ xcconfig_content = File.read(xcconfig_path)
247
+ # Remove existing IPHONEOS_DEPLOYMENT_TARGET if present
248
+ xcconfig_content.gsub!(/^IPHONEOS_DEPLOYMENT_TARGET = .*$/, '')
249
+ # Add deployment target
250
+ xcconfig_content += "\\nIPHONEOS_DEPLOYMENT_TARGET = ${ext.deploymentTarget}\\n"
251
+ File.write(xcconfig_path, xcconfig_content)
252
+ end
253
+ end
254
+ end`)
255
+ .join('\n')}
256
+ end
257
+ `;
258
+ // Find the main app's post_install hook and inject our code before the closing 'end'
259
+ // Look for: post_install do |installer| ... react_native_post_install(...) ... end
260
+ const postInstallRegex = /(post_install do \|installer\|[\s\S]*?react_native_post_install\([\s\S]*?\)[\s\S]*?)(\n\s{2}end)/;
261
+ const match = podfileContent.match(postInstallRegex);
262
+ if (match) {
263
+ // Inject our code before the closing 'end' of post_install
264
+ return podfileContent.replace(postInstallRegex, `$1${fixCode}$2`);
265
+ }
266
+ // Fallback: couldn't find the post_install hook, skip modification
267
+ console.warn('[expo-targets] Could not find post_install hook to inject deployment target fixes');
268
+ return podfileContent;
269
+ }
270
+ exports.ensureExtensionDeploymentTargets = ensureExtensionDeploymentTargets;
271
+ /**
272
+ * Ensure React Native extension targets have proper framework search paths.
273
+ * Uses START/END markers for reliable, idempotent injection.
274
+ */
275
+ function ensureReactNativeExtensionFrameworkPaths(podfileContent, extensions, mainTargetName) {
276
+ if (extensions.length === 0) {
277
+ return podfileContent;
278
+ }
279
+ const START_MARKER = ' # [expo-targets-start]';
280
+ const END_MARKER = ' # [expo-targets-end]';
281
+ // Remove any existing block between markers (idempotent)
282
+ const startIndex = podfileContent.indexOf(START_MARKER);
283
+ if (startIndex !== -1) {
284
+ const endIndex = podfileContent.indexOf(END_MARKER, startIndex);
285
+ if (endIndex !== -1) {
286
+ const beforeBlock = podfileContent.substring(0, startIndex);
287
+ const afterBlock = podfileContent.substring(endIndex + END_MARKER.length);
288
+ podfileContent = beforeBlock.trimEnd() + '\n' + afterBlock.trimStart();
289
+ }
290
+ }
291
+ // Generate fresh code with markers
292
+ const mainPodsTarget = `Pods-${mainTargetName}`;
293
+ const fixCode = `${START_MARKER}
294
+ # Fix React Native extension framework search paths
295
+ installer.pods_project.targets.each do |target|
296
+ ${extensions
297
+ .map((ext) => ` if target.name.include?('${ext.targetName}')
298
+ target.build_configurations.each do |config|
299
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '${ext.deploymentTarget}'
300
+ # Copy framework search paths from main app target
301
+ main_target = installer.pods_project.targets.find { |t| t.name == '${mainPodsTarget}' }
302
+ if main_target
303
+ main_config = main_target.build_configurations.find { |c| c.name == config.name }
304
+ if main_config && main_config.build_settings['FRAMEWORK_SEARCH_PATHS']
305
+ existing_paths = config.build_settings['FRAMEWORK_SEARCH_PATHS'] || ['$(inherited)']
306
+ inherited_paths = main_config.build_settings['FRAMEWORK_SEARCH_PATHS']
307
+ # Merge inherited paths, avoiding duplicates
308
+ merged_paths = existing_paths + inherited_paths.reject { |p| existing_paths.include?(p) }
309
+ config.build_settings['FRAMEWORK_SEARCH_PATHS'] = merged_paths
310
+ end
311
+ end
312
+ # Update the xcconfig file with framework search paths and deployment target
313
+ xcconfig_path = config.base_configuration_reference.real_path
314
+ if xcconfig_path && File.exist?(xcconfig_path)
315
+ xcconfig_content = File.read(xcconfig_path)
316
+ # Remove existing IPHONEOS_DEPLOYMENT_TARGET if present
317
+ xcconfig_content.gsub!(/^IPHONEOS_DEPLOYMENT_TARGET = .*$/, '')
318
+ # Add deployment target
319
+ xcconfig_content += "\\nIPHONEOS_DEPLOYMENT_TARGET = ${ext.deploymentTarget}\\n"
320
+ # Copy framework search paths and other Swift-related settings from main app's xcconfig
321
+ if main_target
322
+ main_config = main_target.build_configurations.find { |c| c.name == config.name }
323
+ if main_config
324
+ main_xcconfig_path = main_config.base_configuration_reference.real_path
325
+ if main_xcconfig_path && File.exist?(main_xcconfig_path)
326
+ main_xcconfig_content = File.read(main_xcconfig_path)
327
+ # Copy FRAMEWORK_SEARCH_PATHS (needed for Swift imports)
328
+ framework_paths_match = main_xcconfig_content.match(/^FRAMEWORK_SEARCH_PATHS = (.+)$/m)
329
+ if framework_paths_match
330
+ xcconfig_content.gsub!(/^FRAMEWORK_SEARCH_PATHS = .*$/, '')
331
+ xcconfig_content += "\\nFRAMEWORK_SEARCH_PATHS = #{framework_paths_match[1]}\\n"
332
+ end
333
+ # Copy HEADER_SEARCH_PATHS (includes ExpoModulesCore headers)
334
+ header_paths_match = main_xcconfig_content.match(/^HEADER_SEARCH_PATHS = (.+)$/m)
335
+ if header_paths_match
336
+ xcconfig_content.gsub!(/^HEADER_SEARCH_PATHS = .*$/, '')
337
+ xcconfig_content += "\\nHEADER_SEARCH_PATHS = #{header_paths_match[1]}\\n"
338
+ end
339
+ # Copy OTHER_SWIFT_FLAGS (includes module map files for ExpoModulesCore)
340
+ swift_flags_match = main_xcconfig_content.match(/^OTHER_SWIFT_FLAGS = (.+)$/m)
341
+ if swift_flags_match
342
+ xcconfig_content.gsub!(/^OTHER_SWIFT_FLAGS = .*$/, '')
343
+ xcconfig_content += "\\nOTHER_SWIFT_FLAGS = #{swift_flags_match[1]}\\n"
344
+ end
345
+ # Copy SWIFT_INCLUDE_PATHS (Swift module search paths)
346
+ swift_include_match = main_xcconfig_content.match(/^SWIFT_INCLUDE_PATHS = (.+)$/m)
347
+ if swift_include_match
348
+ xcconfig_content.gsub!(/^SWIFT_INCLUDE_PATHS = .*$/, '')
349
+ xcconfig_content += "\\nSWIFT_INCLUDE_PATHS = #{swift_include_match[1]}\\n"
350
+ end
351
+ end
352
+ end
353
+ end
354
+ File.write(xcconfig_path, xcconfig_content)
355
+ end
356
+ end
357
+ end`)
358
+ .join('\n')}
359
+ end
360
+ ${END_MARKER}`;
361
+ // Find where to inject (after react_native_post_install closing paren)
362
+ // Use line-by-line approach to find the closing paren properly
363
+ const lines = podfileContent.split('\n');
364
+ let reactNativeStartLine = -1;
365
+ let reactNativeEndLine = -1;
366
+ let parenDepth = 0;
367
+ for (let i = 0; i < lines.length; i++) {
368
+ const line = lines[i];
369
+ if (line.includes('react_native_post_install(')) {
370
+ reactNativeStartLine = i;
371
+ parenDepth =
372
+ (line.match(/\(/g) || []).length - (line.match(/\)/g) || []).length;
373
+ continue;
374
+ }
375
+ if (reactNativeStartLine !== -1) {
376
+ const openParens = (line.match(/\(/g) || []).length;
377
+ const closeParens = (line.match(/\)/g) || []).length;
378
+ parenDepth += openParens - closeParens;
379
+ if (parenDepth === 0 && closeParens > 0) {
380
+ reactNativeEndLine = i;
381
+ break;
382
+ }
383
+ }
384
+ }
385
+ if (reactNativeStartLine === -1 || reactNativeEndLine === -1) {
386
+ console.warn('[expo-targets] Could not find react_native_post_install');
387
+ return podfileContent;
388
+ }
389
+ // Find the position after the closing paren
390
+ const beforeLines = lines.slice(0, reactNativeEndLine + 1).join('\n');
391
+ const insertPosition = beforeLines.length;
392
+ const beforeInsert = podfileContent.substring(0, insertPosition);
393
+ const afterInsert = podfileContent.substring(insertPosition);
394
+ // Insert our code with proper newlines
395
+ // Ensure newline before our code
396
+ const needsNewlineBefore = !beforeInsert.endsWith('\n');
397
+ // Check what comes after - preserve any existing closing 'end' for post_install
398
+ const afterTrimmed = afterInsert.trimStart();
399
+ const hasPostInstallEnd = afterTrimmed.startsWith('end');
400
+ // Insert: newline + our code + newline (preserve existing post_install end if present)
401
+ return (beforeInsert.trimEnd() +
402
+ (needsNewlineBefore ? '\n' : '') +
403
+ fixCode +
404
+ '\n' +
405
+ afterInsert.trimStart());
406
+ }
407
+ exports.ensureReactNativeExtensionFrameworkPaths = ensureReactNativeExtensionFrameworkPaths;
408
+ //# sourceMappingURL=podfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"podfile.js","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/podfile.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;GAOG;AACH,SAAgB,8BAA8B,CAAC,EAC7C,UAAU,EACV,gBAAgB,EAChB,aAAa,GAKd;IACC,OAAO;YACG,UAAU;sBACA,gBAAgB;;;CAGrC,CAAC;AACF,CAAC;AAfD,wEAeC;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,cAAsB,EACtB,cAAsB;IAEtB,MAAM,WAAW,GAAG,IAAI,MAAM,CAC5B,cAAc,cAAc,yDAAyD,EACrF,GAAG,CACJ,CAAC;IAEF,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACjD,CAAC;AAhBD,4DAgBC;AAED;;;;GAIG;AACH,SAAgB,6BAA6B,CAAC,EAC5C,UAAU,EACV,gBAAgB,EAChB,aAAa,GAKd;IACC,MAAM,cA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QAC7D,OAAO,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;QACxE,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,4CAA4C;IAC5C,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;IAC1C,MAAM,YAAY,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAE7D,uCAAuC;IACvC,iCAAiC;IACjC,MAAM,kBAAkB,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAExD,gFAAgF;IAChF,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;IAC7C,MAAM,iBAAiB,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAEzD,uFAAuF;IACvF,OAAO,CACL,YAAY,CAAC,OAAO,EAAE;QACtB,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,OAAO;QACP,IAAI;QACJ,WAAW,CAAC,SAAS,EAAE,CACxB,CAAC;AACJ,CAAC;AArJD,4FAqJC"}
@@ -0,0 +1,11 @@
1
+ import type { ExtensionType } from '../../config';
2
+ export interface ReactNativeViewControllerOptions {
3
+ type: ExtensionType;
4
+ moduleName: string;
5
+ targetName: string;
6
+ preprocessingFile?: string;
7
+ entry?: string;
8
+ }
9
+ export declare function generateMessagesViewController(): string;
10
+ export declare function generateReactNativeViewController(options: ReactNativeViewControllerOptions): string;
11
+ //# sourceMappingURL=reactNativeSwift.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactNativeSwift.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/ios/utils/reactNativeSwift.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA2ND,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,gCAAgC,GACxC,MAAM,CA4CR"}