@callstack/react-native-brownfield 2.2.0 → 3.0.0-rc.2

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 (230) hide show
  1. package/ReactBrownfield.podspec +4 -0
  2. package/ios/BrownfieldBundlePathResolver.swift +21 -0
  3. package/ios/ExpoHostRuntime.swift +140 -0
  4. package/ios/JSBundleLoadObserver.swift +38 -0
  5. package/ios/Notification+Brownfield.swift +12 -0
  6. package/ios/ReactNativeBrownfield.swift +78 -112
  7. package/ios/ReactNativeHostRuntime.swift +138 -0
  8. package/lib/commonjs/expo-config-plugin/android/constants.js +2 -0
  9. package/lib/commonjs/expo-config-plugin/android/constants.js.map +1 -0
  10. package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js +2 -0
  11. package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js.map +1 -0
  12. package/lib/commonjs/expo-config-plugin/android/index.js +2 -0
  13. package/lib/commonjs/expo-config-plugin/android/index.js.map +1 -0
  14. package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js +2 -0
  15. package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -0
  16. package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js +2 -0
  17. package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -0
  18. package/lib/commonjs/expo-config-plugin/app.plugin.js +2 -0
  19. package/lib/commonjs/expo-config-plugin/app.plugin.js.map +1 -0
  20. package/lib/commonjs/expo-config-plugin/errors/SourceModificationError.js +2 -0
  21. package/lib/commonjs/expo-config-plugin/errors/SourceModificationError.js.map +1 -0
  22. package/lib/commonjs/expo-config-plugin/index.js +2 -0
  23. package/lib/commonjs/expo-config-plugin/index.js.map +1 -0
  24. package/lib/commonjs/expo-config-plugin/ios/index.js +2 -0
  25. package/lib/commonjs/expo-config-plugin/ios/index.js.map +1 -0
  26. package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js +8 -0
  27. package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js.map +1 -0
  28. package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js +2 -0
  29. package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -0
  30. package/lib/commonjs/expo-config-plugin/ios/withIosFrameworkFiles.js +2 -0
  31. package/lib/commonjs/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -0
  32. package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js +2 -0
  33. package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js.map +1 -0
  34. package/lib/commonjs/expo-config-plugin/logging.js +2 -0
  35. package/lib/commonjs/expo-config-plugin/logging.js.map +1 -0
  36. package/lib/commonjs/expo-config-plugin/template/android/AndroidManifest.xml +4 -0
  37. package/lib/commonjs/expo-config-plugin/template/android/ReactNativeHostManager.kt +54 -0
  38. package/lib/commonjs/expo-config-plugin/template/android/build.gradle.kts +90 -0
  39. package/lib/commonjs/expo-config-plugin/template/android/consumer-rules.pro +0 -0
  40. package/lib/commonjs/expo-config-plugin/template/android/gradle.properties +8 -0
  41. package/lib/commonjs/expo-config-plugin/template/android/proguard-rules.pro +21 -0
  42. package/lib/commonjs/expo-config-plugin/template/engine.js +2 -0
  43. package/lib/commonjs/expo-config-plugin/template/engine.js.map +1 -0
  44. package/lib/commonjs/expo-config-plugin/template/ios/FrameworkInterface.swift +13 -0
  45. package/lib/commonjs/expo-config-plugin/template/ios/Info.plist +22 -0
  46. package/lib/commonjs/expo-config-plugin/template/ios/PodfileTargetBlock.rb +5 -0
  47. package/lib/commonjs/expo-config-plugin/template/ios/patchExpoPre55.sh +20 -0
  48. package/lib/commonjs/expo-config-plugin/types/BrownfieldPluginConfig.js +2 -0
  49. package/lib/commonjs/expo-config-plugin/types/BrownfieldPluginConfig.js.map +1 -0
  50. package/lib/commonjs/expo-config-plugin/types/RenderedTemplateFile.js +2 -0
  51. package/lib/commonjs/expo-config-plugin/types/RenderedTemplateFile.js.map +1 -0
  52. package/lib/commonjs/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js +2 -0
  53. package/lib/commonjs/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js.map +1 -0
  54. package/lib/commonjs/expo-config-plugin/types/index.js +2 -0
  55. package/lib/commonjs/expo-config-plugin/types/index.js.map +1 -0
  56. package/lib/commonjs/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js +2 -0
  57. package/lib/commonjs/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js.map +1 -0
  58. package/lib/commonjs/expo-config-plugin/withBrownfield.js +2 -0
  59. package/lib/commonjs/expo-config-plugin/withBrownfield.js.map +1 -0
  60. package/lib/commonjs/scripts/brownfield.js +0 -0
  61. package/lib/module/expo-config-plugin/android/constants.js +2 -0
  62. package/lib/module/expo-config-plugin/android/constants.js.map +1 -0
  63. package/lib/module/expo-config-plugin/android/gradleHelpers.js +2 -0
  64. package/lib/module/expo-config-plugin/android/gradleHelpers.js.map +1 -0
  65. package/lib/module/expo-config-plugin/android/index.js +2 -0
  66. package/lib/module/expo-config-plugin/android/index.js.map +1 -0
  67. package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js +2 -0
  68. package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -0
  69. package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js +2 -0
  70. package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -0
  71. package/lib/module/expo-config-plugin/app.plugin.js +2 -0
  72. package/lib/module/expo-config-plugin/app.plugin.js.map +1 -0
  73. package/lib/module/expo-config-plugin/errors/SourceModificationError.js +2 -0
  74. package/lib/module/expo-config-plugin/errors/SourceModificationError.js.map +1 -0
  75. package/lib/module/expo-config-plugin/index.js +2 -0
  76. package/lib/module/expo-config-plugin/index.js.map +1 -0
  77. package/lib/module/expo-config-plugin/ios/index.js +2 -0
  78. package/lib/module/expo-config-plugin/ios/index.js.map +1 -0
  79. package/lib/module/expo-config-plugin/ios/podfileHelpers.js +8 -0
  80. package/lib/module/expo-config-plugin/ios/podfileHelpers.js.map +1 -0
  81. package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js +2 -0
  82. package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -0
  83. package/lib/module/expo-config-plugin/ios/withIosFrameworkFiles.js +2 -0
  84. package/lib/module/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -0
  85. package/lib/module/expo-config-plugin/ios/xcodeHelpers.js +2 -0
  86. package/lib/module/expo-config-plugin/ios/xcodeHelpers.js.map +1 -0
  87. package/lib/module/expo-config-plugin/logging.js +2 -0
  88. package/lib/module/expo-config-plugin/logging.js.map +1 -0
  89. package/lib/module/expo-config-plugin/template/android/AndroidManifest.xml +4 -0
  90. package/lib/module/expo-config-plugin/template/android/ReactNativeHostManager.kt +54 -0
  91. package/lib/module/expo-config-plugin/template/android/build.gradle.kts +90 -0
  92. package/lib/module/expo-config-plugin/template/android/consumer-rules.pro +0 -0
  93. package/lib/module/expo-config-plugin/template/android/gradle.properties +8 -0
  94. package/lib/module/expo-config-plugin/template/android/proguard-rules.pro +21 -0
  95. package/lib/module/expo-config-plugin/template/engine.js +2 -0
  96. package/lib/module/expo-config-plugin/template/engine.js.map +1 -0
  97. package/lib/module/expo-config-plugin/template/ios/FrameworkInterface.swift +13 -0
  98. package/lib/module/expo-config-plugin/template/ios/Info.plist +22 -0
  99. package/lib/module/expo-config-plugin/template/ios/PodfileTargetBlock.rb +5 -0
  100. package/lib/module/expo-config-plugin/template/ios/patchExpoPre55.sh +20 -0
  101. package/lib/module/expo-config-plugin/types/BrownfieldPluginConfig.js +2 -0
  102. package/lib/module/expo-config-plugin/types/BrownfieldPluginConfig.js.map +1 -0
  103. package/lib/module/expo-config-plugin/types/RenderedTemplateFile.js +2 -0
  104. package/lib/module/expo-config-plugin/types/RenderedTemplateFile.js.map +1 -0
  105. package/lib/module/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js +2 -0
  106. package/lib/module/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js.map +1 -0
  107. package/lib/module/expo-config-plugin/types/index.js +2 -0
  108. package/lib/module/expo-config-plugin/types/index.js.map +1 -0
  109. package/lib/module/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js +2 -0
  110. package/lib/module/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js.map +1 -0
  111. package/lib/module/expo-config-plugin/withBrownfield.js +2 -0
  112. package/lib/module/expo-config-plugin/withBrownfield.js.map +1 -0
  113. package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts +3 -0
  114. package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/expo-config-plugin/android/gradleHelpers.d.ts +14 -0
  116. package/lib/typescript/commonjs/src/expo-config-plugin/android/gradleHelpers.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts +4 -0
  118. package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +24 -0
  120. package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts +13 -0
  122. package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/src/expo-config-plugin/app.plugin.d.ts +9 -0
  124. package/lib/typescript/commonjs/src/expo-config-plugin/app.plugin.d.ts.map +1 -0
  125. package/lib/typescript/commonjs/src/expo-config-plugin/errors/SourceModificationError.d.ts +3 -0
  126. package/lib/typescript/commonjs/src/expo-config-plugin/errors/SourceModificationError.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/src/expo-config-plugin/index.d.ts +7 -0
  128. package/lib/typescript/commonjs/src/expo-config-plugin/index.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/src/expo-config-plugin/ios/index.d.ts +5 -0
  130. package/lib/typescript/commonjs/src/expo-config-plugin/ios/index.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts +8 -0
  132. package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts +14 -0
  134. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts +19 -0
  136. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts +33 -0
  138. package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/src/expo-config-plugin/logging.d.ts +9 -0
  140. package/lib/typescript/commonjs/src/expo-config-plugin/logging.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/src/expo-config-plugin/template/engine.d.ts +9 -0
  142. package/lib/typescript/commonjs/src/expo-config-plugin/template/engine.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts +53 -0
  144. package/lib/typescript/commonjs/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/src/expo-config-plugin/types/RenderedTemplateFile.d.ts +5 -0
  146. package/lib/typescript/commonjs/src/expo-config-plugin/types/RenderedTemplateFile.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +50 -0
  148. package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -0
  149. package/lib/typescript/commonjs/src/expo-config-plugin/types/index.d.ts +5 -0
  150. package/lib/typescript/commonjs/src/expo-config-plugin/types/index.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts +36 -0
  152. package/lib/typescript/commonjs/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/src/expo-config-plugin/withBrownfield.d.ts +5 -0
  154. package/lib/typescript/commonjs/src/expo-config-plugin/withBrownfield.d.ts.map +1 -0
  155. package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts +3 -0
  156. package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts.map +1 -0
  157. package/lib/typescript/module/src/expo-config-plugin/android/gradleHelpers.d.ts +14 -0
  158. package/lib/typescript/module/src/expo-config-plugin/android/gradleHelpers.d.ts.map +1 -0
  159. package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts +4 -0
  160. package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts.map +1 -0
  161. package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +24 -0
  162. package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -0
  163. package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts +13 -0
  164. package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -0
  165. package/lib/typescript/module/src/expo-config-plugin/app.plugin.d.ts +9 -0
  166. package/lib/typescript/module/src/expo-config-plugin/app.plugin.d.ts.map +1 -0
  167. package/lib/typescript/module/src/expo-config-plugin/errors/SourceModificationError.d.ts +3 -0
  168. package/lib/typescript/module/src/expo-config-plugin/errors/SourceModificationError.d.ts.map +1 -0
  169. package/lib/typescript/module/src/expo-config-plugin/index.d.ts +7 -0
  170. package/lib/typescript/module/src/expo-config-plugin/index.d.ts.map +1 -0
  171. package/lib/typescript/module/src/expo-config-plugin/ios/index.d.ts +5 -0
  172. package/lib/typescript/module/src/expo-config-plugin/ios/index.d.ts.map +1 -0
  173. package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts +8 -0
  174. package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -0
  175. package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts +14 -0
  176. package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -0
  177. package/lib/typescript/module/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts +19 -0
  178. package/lib/typescript/module/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts.map +1 -0
  179. package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts +33 -0
  180. package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -0
  181. package/lib/typescript/module/src/expo-config-plugin/logging.d.ts +9 -0
  182. package/lib/typescript/module/src/expo-config-plugin/logging.d.ts.map +1 -0
  183. package/lib/typescript/module/src/expo-config-plugin/template/engine.d.ts +9 -0
  184. package/lib/typescript/module/src/expo-config-plugin/template/engine.d.ts.map +1 -0
  185. package/lib/typescript/module/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts +53 -0
  186. package/lib/typescript/module/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts.map +1 -0
  187. package/lib/typescript/module/src/expo-config-plugin/types/RenderedTemplateFile.d.ts +5 -0
  188. package/lib/typescript/module/src/expo-config-plugin/types/RenderedTemplateFile.d.ts.map +1 -0
  189. package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +50 -0
  190. package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -0
  191. package/lib/typescript/module/src/expo-config-plugin/types/index.d.ts +5 -0
  192. package/lib/typescript/module/src/expo-config-plugin/types/index.d.ts.map +1 -0
  193. package/lib/typescript/module/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts +36 -0
  194. package/lib/typescript/module/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts.map +1 -0
  195. package/lib/typescript/module/src/expo-config-plugin/withBrownfield.d.ts +5 -0
  196. package/lib/typescript/module/src/expo-config-plugin/withBrownfield.d.ts.map +1 -0
  197. package/package.json +20 -7
  198. package/scripts/react_native_brownfield_post_integrate.rb +22 -0
  199. package/src/expo-config-plugin/android/constants.ts +2 -0
  200. package/src/expo-config-plugin/android/gradleHelpers.ts +72 -0
  201. package/src/expo-config-plugin/android/index.ts +6 -0
  202. package/src/expo-config-plugin/android/withAndroidModuleFiles.ts +139 -0
  203. package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +48 -0
  204. package/src/expo-config-plugin/app.plugin.ts +10 -0
  205. package/src/expo-config-plugin/errors/SourceModificationError.ts +1 -0
  206. package/src/expo-config-plugin/index.ts +8 -0
  207. package/src/expo-config-plugin/ios/index.ts +7 -0
  208. package/src/expo-config-plugin/ios/podfileHelpers.ts +107 -0
  209. package/src/expo-config-plugin/ios/withBrownfieldIos.ts +94 -0
  210. package/src/expo-config-plugin/ios/withIosFrameworkFiles.ts +91 -0
  211. package/src/expo-config-plugin/ios/xcodeHelpers.ts +433 -0
  212. package/src/expo-config-plugin/logging.ts +29 -0
  213. package/src/expo-config-plugin/template/android/AndroidManifest.xml +4 -0
  214. package/src/expo-config-plugin/template/android/ReactNativeHostManager.kt +54 -0
  215. package/src/expo-config-plugin/template/android/build.gradle.kts +90 -0
  216. package/src/expo-config-plugin/template/android/consumer-rules.pro +0 -0
  217. package/src/expo-config-plugin/template/android/gradle.properties +8 -0
  218. package/src/expo-config-plugin/template/android/proguard-rules.pro +21 -0
  219. package/src/expo-config-plugin/template/engine.ts +26 -0
  220. package/src/expo-config-plugin/template/ios/FrameworkInterface.swift +13 -0
  221. package/src/expo-config-plugin/template/ios/Info.plist +22 -0
  222. package/src/expo-config-plugin/template/ios/PodfileTargetBlock.rb +5 -0
  223. package/src/expo-config-plugin/template/ios/patchExpoPre55.sh +20 -0
  224. package/src/expo-config-plugin/types/BrownfieldPluginConfig.ts +67 -0
  225. package/src/expo-config-plugin/types/RenderedTemplateFile.ts +4 -0
  226. package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +58 -0
  227. package/src/expo-config-plugin/types/index.ts +6 -0
  228. package/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts +41 -0
  229. package/src/expo-config-plugin/withBrownfield.ts +112 -0
  230. package/CHANGELOG.md +0 -41
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Renders a template file for the specified platform with given parameters
3
+ * @param platform The platform name (specifies the subdirectory of template/)
4
+ * @param name The template file name (with extension)
5
+ * @param params The params to be replaced in the template
6
+ * @returns The rendered template content
7
+ */
8
+ export declare function renderTemplate(platform: 'ios' | 'android', name: string, params?: Record<`{{${string}}}`, unknown>): string;
9
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/template/engine.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,MAAM,IAAI,EAAE,OAAO,CAAC,GACxC,MAAM,CAWR"}
@@ -0,0 +1,53 @@
1
+ import type { BrownfieldPluginAndroidConfig, ResolvedBrownfieldPluginAndroidConfig } from './android/BrownfieldPluginAndroidConfig';
2
+ import type { BrownfieldPluginIosConfig, ResolvedBrownfieldPluginIosConfig } from './ios/BrownfieldPluginIosConfig';
3
+ /**
4
+ * Main configuration for the Brownfield Expo config plugin
5
+ */
6
+ export interface BrownfieldPluginConfig {
7
+ /**
8
+ * iOS-specific configuration
9
+ */
10
+ ios?: BrownfieldPluginIosConfig;
11
+ /**
12
+ * Android-specific configuration
13
+ */
14
+ android?: BrownfieldPluginAndroidConfig;
15
+ /**
16
+ * Whether to enable debug logging during plugin execution
17
+ * @default false
18
+ */
19
+ debug?: boolean;
20
+ }
21
+ /**
22
+ * Internal configuration with resolved defaults
23
+ * Note that the platform-specific configs can be null if the platform is not configured
24
+ */
25
+ export interface ResolvedBrownfieldPluginConfig extends Required<Omit<BrownfieldPluginConfig, 'ios' | 'android'>> {
26
+ /**
27
+ * iOS-specific configuration
28
+ */
29
+ ios: ResolvedBrownfieldPluginIosConfig | null;
30
+ /**
31
+ * Android-specific configuration
32
+ */
33
+ android: ResolvedBrownfieldPluginAndroidConfig | null;
34
+ }
35
+ /**
36
+ * Resolved Brownfield configuration including Android config
37
+ */
38
+ export interface ResolvedBrownfieldPluginConfigWithAndroid extends ResolvedBrownfieldPluginConfig {
39
+ /**
40
+ * Android-specific configuration
41
+ */
42
+ android: ResolvedBrownfieldPluginAndroidConfig;
43
+ }
44
+ /**
45
+ * Resolved Brownfield configuration including iOS config
46
+ */
47
+ export interface ResolvedBrownfieldPluginConfigWithIos extends ResolvedBrownfieldPluginConfig {
48
+ /**
49
+ * iOS-specific configuration
50
+ */
51
+ ios: ResolvedBrownfieldPluginIosConfig;
52
+ }
53
+ //# sourceMappingURL=BrownfieldPluginConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrownfieldPluginConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/types/BrownfieldPluginConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACV,yBAAyB,EACzB,iCAAiC,EAClC,MAAM,iCAAiC,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,GAAG,CAAC,EAAE,yBAAyB,CAAC;IAEhC;;OAEG;IACH,OAAO,CAAC,EAAE,6BAA6B,CAAC;IAExC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA+B,SAAQ,QAAQ,CAC9D,IAAI,CAAC,sBAAsB,EAAE,KAAK,GAAG,SAAS,CAAC,CAChD;IACC;;OAEG;IACH,GAAG,EAAE,iCAAiC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,OAAO,EAAE,qCAAqC,GAAG,IAAI,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,yCAA0C,SAAQ,8BAA8B;IAC/F;;OAEG;IACH,OAAO,EAAE,qCAAqC,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,qCAAsC,SAAQ,8BAA8B;IAC3F;;OAEG;IACH,GAAG,EAAE,iCAAiC,CAAC;CACxC"}
@@ -0,0 +1,5 @@
1
+ export interface RenderedTemplateFile {
2
+ relativePath: string;
3
+ content: string;
4
+ }
5
+ //# sourceMappingURL=RenderedTemplateFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderedTemplateFile.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/types/RenderedTemplateFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Android-specific configuration for Brownfield config plugin
3
+ */
4
+ export interface BrownfieldPluginAndroidConfig {
5
+ /**
6
+ * The name of the Android library module to create
7
+ * @default "brownfieldlib"
8
+ */
9
+ moduleName?: string;
10
+ /**
11
+ * The package name for the Android library module
12
+ * @default app's package name
13
+ */
14
+ packageName?: string;
15
+ /**
16
+ * Minimum SDK version for the Android library
17
+ * @default 24
18
+ */
19
+ minSdkVersion?: number;
20
+ /**
21
+ * Target SDK version for the Android library
22
+ * @default 35
23
+ */
24
+ targetSdkVersion?: number;
25
+ /**
26
+ * Compile SDK version for the Android library
27
+ * @default 35
28
+ */
29
+ compileSdkVersion?: number;
30
+ /**
31
+ * Group ID for Maven publishing
32
+ * @default package name
33
+ */
34
+ groupId?: string;
35
+ /**
36
+ * Artifact ID for Maven publishing
37
+ * @default module name
38
+ */
39
+ artifactId?: string;
40
+ /**
41
+ * Version string for Maven publishing
42
+ * @default "0.0.1-SNAPSHOT"
43
+ */
44
+ version?: string;
45
+ }
46
+ /**
47
+ * Android configuration with resolved defaults (all fields required)
48
+ */
49
+ export type ResolvedBrownfieldPluginAndroidConfig = Required<BrownfieldPluginAndroidConfig>;
50
+ //# sourceMappingURL=BrownfieldPluginAndroidConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrownfieldPluginAndroidConfig.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC/C,QAAQ,CAAC,6BAA6B,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type * from './android/BrownfieldPluginAndroidConfig';
2
+ export type * from './ios/BrownfieldPluginIosConfig';
3
+ export type * from './BrownfieldPluginConfig';
4
+ export type * from './RenderedTemplateFile';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,yCAAyC,CAAC;AAC7D,mBAAmB,iCAAiC,CAAC;AAErD,mBAAmB,0BAA0B,CAAC;AAE9C,mBAAmB,wBAAwB,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * iOS-specific configuration for Brownfield config plugin
3
+ */
4
+ export interface BrownfieldPluginIosConfig {
5
+ /**
6
+ * The name of the framework to create
7
+ * This will be used as the XCFramework name
8
+ * @default "BrownfieldLib"
9
+ */
10
+ frameworkName?: string;
11
+ /**
12
+ * The bundle identifier for the framework
13
+ * @default app's bundle identifier with ".brownfield" suffix
14
+ */
15
+ bundleIdentifier?: string;
16
+ /**
17
+ * Custom build settings to apply to the framework build
18
+ */
19
+ buildSettings?: Record<string, string | boolean | number>;
20
+ /**
21
+ * Minimum iOS deployment target
22
+ * @default "15.0"
23
+ */
24
+ deploymentTarget?: string;
25
+ /**
26
+ * The version of the framework, must be an integer or floating point (e.g. 1, or 2.1)
27
+ * @default 1
28
+ * @see https://developer.apple.com/documentation/xcode/build-settings-reference#Current-Project-Version
29
+ */
30
+ frameworkVersion?: string;
31
+ }
32
+ /**
33
+ * iOS configuration with resolved defaults (all fields required)
34
+ */
35
+ export type ResolvedBrownfieldPluginIosConfig = Required<BrownfieldPluginIosConfig>;
36
+ //# sourceMappingURL=BrownfieldPluginIosConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrownfieldPluginIosConfig.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;IAE1D;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAC3C,QAAQ,CAAC,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type ConfigPlugin } from '@expo/config-plugins';
2
+ import type { BrownfieldPluginConfig } from './types';
3
+ declare const _default: ConfigPlugin<void | BrownfieldPluginConfig>;
4
+ export default _default;
5
+ //# sourceMappingURL=withBrownfield.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withBrownfield.d.ts","sourceRoot":"","sources":["../../../../../src/expo-config-plugin/withBrownfield.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,SAAS,CAAC;;AA8FjB,wBAIE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/react-native-brownfield",
3
- "version": "2.2.0",
3
+ "version": "3.0.0-rc.2",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "homepage": "https://github.com/callstack/react-native-brownfield",
13
13
  "repository": {
14
- "url": "https://github.com/callstack/react-native-brownfield"
14
+ "url": "git+https://github.com/callstack/react-native-brownfield.git"
15
15
  },
16
16
  "description": "Brownfield helpers for React Native",
17
17
  "main": "lib/commonjs/index",
@@ -20,6 +20,7 @@
20
20
  "react-native": "src/index",
21
21
  "exports": {
22
22
  ".": {
23
+ "source": "./src/index.ts",
23
24
  "import": {
24
25
  "types": "./lib/typescript/module/src/index.d.ts",
25
26
  "default": "./lib/module/index.js"
@@ -29,13 +30,24 @@
29
30
  "default": "./lib/commonjs/index.js"
30
31
  }
31
32
  },
33
+ "./app.plugin.js": {
34
+ "source": "./src/expo-config-plugin/app.plugin.ts",
35
+ "import": {
36
+ "types": "./lib/typescript/module/src/expo-config-plugin/app.plugin.d.ts",
37
+ "default": "./lib/module/expo-config-plugin/app.plugin.js"
38
+ },
39
+ "require": {
40
+ "types": "./lib/typescript/commonjs/src/expo-config-plugin/app.plugin.d.ts",
41
+ "default": "./lib/commonjs/expo-config-plugin/app.plugin.js"
42
+ }
43
+ },
32
44
  "./package.json": "./package.json"
33
45
  },
34
46
  "scripts": {
35
47
  "lint": "eslint .",
36
48
  "typecheck": "tsc --noEmit",
37
49
  "build": "bob build",
38
- "dev": "nodemon --watch src --ext js,ts,json --exec \"bob build\"",
50
+ "dev": "nodemon --ext '*' --watch src --exec \"bob build\"",
39
51
  "build:brownfield": "yarn run build",
40
52
  "prepack": "cp ../../README.md ./README.md",
41
53
  "postpack": "rm ./README.md"
@@ -49,6 +61,7 @@
49
61
  "files": [
50
62
  "src",
51
63
  "lib",
64
+ "scripts",
52
65
  "android",
53
66
  "ios",
54
67
  "cpp",
@@ -69,16 +82,16 @@
69
82
  "access": "public"
70
83
  },
71
84
  "peerDependencies": {
72
- "react": "*",
73
- "react-native": "*"
85
+ "@expo/config-plugins": "^54.0.4"
74
86
  },
75
87
  "dependencies": {
76
- "@callstack/brownfield-cli": "^1.0.4"
88
+ "@callstack/brownfield-cli": "workspace:^"
77
89
  },
78
90
  "devDependencies": {
79
91
  "@babel/core": "^7.25.2",
80
92
  "@babel/preset-env": "^7.25.3",
81
93
  "@babel/runtime": "^7.25.0",
94
+ "@expo/config-plugins": "^54.0.4",
82
95
  "@react-native/babel-preset": "0.82.1",
83
96
  "@types/jest": "^30.0.0",
84
97
  "@types/react": "^19.1.1",
@@ -102,4 +115,4 @@
102
115
  "engines": {
103
116
  "node": ">=20"
104
117
  }
105
- }
118
+ }
@@ -0,0 +1,22 @@
1
+ def react_native_brownfield_post_integrate(installer)
2
+ projects = installer.aggregate_targets.map(&:user_project).compact.uniq
3
+ projects.each do |project|
4
+ modified = false
5
+
6
+ project.native_targets.each do |target|
7
+ phases = target.build_phases
8
+ expo_idx = phases.index { |p| p.respond_to?(:name) && p.name == '[Expo] Configure project' }
9
+ patch_idx = phases.index { |p| p.respond_to?(:name) && p.name == 'Patch ExpoModulesProvider' }
10
+
11
+ next if expo_idx.nil? || patch_idx.nil?
12
+ next if patch_idx > expo_idx
13
+
14
+ patch = phases.delete_at(patch_idx)
15
+ expo_idx = phases.index { |p| p.respond_to?(:name) && p.name == '[Expo] Configure project' }
16
+ phases.insert(expo_idx + 1, patch)
17
+ modified = true
18
+ end
19
+
20
+ project.save if modified
21
+ end
22
+ end
@@ -0,0 +1,2 @@
1
+ export const BROWNFIELD_PLUGIN_VERSION = '1.0.0';
2
+ export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
@@ -0,0 +1,72 @@
1
+ import { brownfieldGradlePluginDependency } from './constants';
2
+ import { Logger } from '../logging';
3
+
4
+ /**
5
+ * Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
6
+ * @param contents The original build.gradle content
7
+ * @returns The modified build.gradle content
8
+ */
9
+ export function modifyRootBuildGradle(contents: string): string {
10
+ // check if already added
11
+ if (contents.includes('brownfield-gradle-plugin')) {
12
+ Logger.logDebug(
13
+ 'Brownfield Gradle plugin already in root build.gradle, skipping'
14
+ );
15
+ return contents;
16
+ }
17
+
18
+ Logger.logDebug(
19
+ `Modifying root build.gradle to add the Gradle Brownfield plugin`
20
+ );
21
+
22
+ // find the buildscript dependencies block
23
+ const buildscriptDepsRegex =
24
+ /(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;
25
+ const match = contents.match(buildscriptDepsRegex);
26
+
27
+ if (!match) {
28
+ throw new Error('Could not locate buildscript block in root build.gradle');
29
+ }
30
+
31
+ // insert before the closing brace of dependencies
32
+ const insertion = `\t${brownfieldGradlePluginDependency}\n\t`;
33
+ const modifiedContents = contents.replace(
34
+ buildscriptDepsRegex,
35
+ `$1${insertion}$2`
36
+ );
37
+
38
+ Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');
39
+ return modifiedContents;
40
+ }
41
+
42
+ /**
43
+ * Modifies settings.gradle to include the Brownfield module
44
+ * @param contents The original settings.gradle content
45
+ * @param moduleName The name of the Brownfield module to include
46
+ * @returns The modified settings.gradle content
47
+ */
48
+ export function modifySettingsGradle(
49
+ contents: string,
50
+ moduleName: string
51
+ ): string {
52
+ const includeStatement = `include ':${moduleName}'`;
53
+
54
+ // check if already included
55
+ if (contents.includes(includeStatement)) {
56
+ Logger.logDebug(
57
+ `Module "${moduleName}" already in settings.gradle, skipping`
58
+ );
59
+ return contents;
60
+ }
61
+
62
+ Logger.logDebug(
63
+ `Modifying settings.gradle to include module "${moduleName}"`
64
+ );
65
+
66
+ // add the include statement at the end
67
+ const modifiedContents = contents + `\n${includeStatement}\n`;
68
+
69
+ Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);
70
+
71
+ return modifiedContents;
72
+ }
@@ -0,0 +1,6 @@
1
+ export { withBrownfieldAndroid } from './withBrownfieldAndroid';
2
+ export {
3
+ withAndroidModuleFiles,
4
+ createAndroidModule,
5
+ } from './withAndroidModuleFiles';
6
+ export { modifyRootBuildGradle, modifySettingsGradle } from './gradleHelpers';
@@ -0,0 +1,139 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+
4
+ import { withDangerousMod, type ConfigPlugin } from '@expo/config-plugins';
5
+
6
+ import type {
7
+ RenderedTemplateFile,
8
+ ResolvedBrownfieldPluginConfigWithAndroid,
9
+ } from '../types';
10
+ import { Logger } from '../logging';
11
+ import { renderTemplate } from '../template/engine';
12
+
13
+ /**
14
+ * Creates the Android library module directory structure and files
15
+ */
16
+ export function createAndroidModule({
17
+ androidDir,
18
+ config,
19
+ rnVersion,
20
+ }: {
21
+ /**
22
+ * The root Android directory path
23
+ */
24
+ androidDir: string;
25
+
26
+ /**
27
+ * The resolved RN version
28
+ */
29
+ rnVersion: string;
30
+
31
+ /**
32
+ * The resolved Brownfield plugin configuration
33
+ */
34
+ config: ResolvedBrownfieldPluginConfigWithAndroid;
35
+ }): void {
36
+ const { android } = config;
37
+ const moduleDir = path.join(androidDir, android.moduleName);
38
+
39
+ Logger.logDebug(`Creating Android module in: ${androidDir}`);
40
+
41
+ // generate module files
42
+ const files: RenderedTemplateFile[] = [
43
+ {
44
+ relativePath: 'build.gradle.kts',
45
+ content: renderTemplate('android', 'build.gradle.kts', {
46
+ '{{PACKAGE_NAME}}': android.packageName,
47
+ '{{MIN_SDK_VERSION}}': android.minSdkVersion.toString(),
48
+ '{{COMPILE_SDK_VERSION}}': android.compileSdkVersion.toString(),
49
+ '{{GROUP_ID}}': android.groupId,
50
+ '{{ARTIFACT_ID}}': android.artifactId,
51
+ '{{ARTIFACT_VERSION}}': android.version,
52
+ '{{RN_VERSION}}': rnVersion,
53
+ }),
54
+ },
55
+ {
56
+ relativePath: 'gradle.properties',
57
+ content: renderTemplate('android', 'gradle.properties', {}),
58
+ },
59
+ {
60
+ relativePath: 'src/main/AndroidManifest.xml',
61
+ content: renderTemplate('android', 'AndroidManifest.xml', {}),
62
+ },
63
+ {
64
+ relativePath: `src/main/java/${config.android.packageName.replace(/\./g, '/')}/ReactNativeHostManager.kt`,
65
+ content: renderTemplate('android', 'ReactNativeHostManager.kt', {
66
+ '{{PACKAGE_NAME}}': android.packageName,
67
+ }),
68
+ },
69
+ {
70
+ relativePath: 'consumer-rules.pro',
71
+ content: renderTemplate('android', 'consumer-rules.pro', {}),
72
+ },
73
+ {
74
+ relativePath: 'proguard-rules.pro',
75
+ content: renderTemplate('android', 'proguard-rules.pro', {}),
76
+ },
77
+ ];
78
+
79
+ // write files, possibly creating directories
80
+ for (const file of files) {
81
+ const filePath = path.join(moduleDir, file.relativePath);
82
+ const fileDir = path.dirname(filePath);
83
+
84
+ // create directory if it doesn't exist
85
+ if (!fs.existsSync(fileDir)) {
86
+ fs.mkdirSync(fileDir, { recursive: true });
87
+ }
88
+
89
+ fs.writeFileSync(filePath, file.content, 'utf8');
90
+
91
+ Logger.logDebug(`Created file: ${filePath}`);
92
+ }
93
+
94
+ Logger.logDebug(
95
+ `Android module "${android.moduleName}" created at ${moduleDir}`
96
+ );
97
+ }
98
+
99
+ /**
100
+ * Dangerous mod that creates the Android module directory and files
101
+ */
102
+ export const withAndroidModuleFiles: ConfigPlugin<
103
+ ResolvedBrownfieldPluginConfigWithAndroid
104
+ > = (config, props) => {
105
+ return withDangerousMod(config, [
106
+ 'android',
107
+ async (dangerousConfig) => {
108
+ const androidDir = path.join(
109
+ dangerousConfig.modRequest.projectRoot,
110
+ 'android'
111
+ );
112
+
113
+ let rnVersion: string;
114
+ try {
115
+ const rnPkgPath = require.resolve('react-native/package.json', {
116
+ paths: [dangerousConfig.modRequest.projectRoot],
117
+ });
118
+
119
+ const rnPkg = require(rnPkgPath);
120
+
121
+ rnVersion = rnPkg.version;
122
+
123
+ Logger.logDebug(`Resolved react-native version: ${rnVersion}`);
124
+ } catch {
125
+ throw new Error(
126
+ 'Could not resolve react-native package version. Please ensure you have installed dependencies.'
127
+ );
128
+ }
129
+
130
+ createAndroidModule({
131
+ androidDir,
132
+ config: props,
133
+ rnVersion,
134
+ });
135
+
136
+ return dangerousConfig;
137
+ },
138
+ ]);
139
+ };
@@ -0,0 +1,48 @@
1
+ import {
2
+ withProjectBuildGradle,
3
+ withSettingsGradle,
4
+ type ConfigPlugin,
5
+ } from '@expo/config-plugins';
6
+
7
+ import { modifyRootBuildGradle, modifySettingsGradle } from './gradleHelpers';
8
+ import { withAndroidModuleFiles } from './withAndroidModuleFiles';
9
+ import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
10
+
11
+ /**
12
+ * Android Config Plugin for integration with @callstack/react-native-brownfield.
13
+ *
14
+ * This plugin:
15
+ * 1. Creates a new Android Library module for the Brownfield AAR
16
+ * 3. Modifies settings.gradle to include the new module
17
+ * 4. Modifies root build.gradle to add Brownfield Gradle plugin
18
+ * 5. Generates the ReactNativeHostManager class inside the module
19
+ */
20
+ export const withBrownfieldAndroid: ConfigPlugin<
21
+ ResolvedBrownfieldPluginConfigWithAndroid
22
+ > = (config, props) => {
23
+ const androidConfig = props.android;
24
+
25
+ // Step 1: modify root build.gradle to add Brownfield Gradle plugin dependency
26
+ config = withProjectBuildGradle(config, (gradleConfig) => {
27
+ gradleConfig.modResults.contents = modifyRootBuildGradle(
28
+ gradleConfig.modResults.contents
29
+ );
30
+
31
+ return gradleConfig;
32
+ });
33
+
34
+ // Step 2: modify settings.gradle to include the new module
35
+ config = withSettingsGradle(config, (settingsConfig) => {
36
+ settingsConfig.modResults.contents = modifySettingsGradle(
37
+ settingsConfig.modResults.contents,
38
+ androidConfig.moduleName
39
+ );
40
+
41
+ return settingsConfig;
42
+ });
43
+
44
+ // Step 3: create the Android module files using dangerous mod
45
+ config = withAndroidModuleFiles(config, props);
46
+
47
+ return config;
48
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Expo config plugin entry point
3
+ *
4
+ * This file is the entry point for the Expo config plugin.
5
+ * It's referenced in the package.json under "./app.plugin" export.
6
+ */
7
+
8
+ import withBrownfield from './withBrownfield';
9
+
10
+ export default withBrownfield;
@@ -0,0 +1 @@
1
+ export class SourceModificationError extends Error {}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Expo Config Plugin for integration with @callstack/react-native-brownfield.
3
+ * This plugin configures your Expo project to be packaged as an AAR (Android) or XCFramework (iOS).
4
+ */
5
+
6
+ import withBrownfield from './withBrownfield';
7
+
8
+ export default withBrownfield;
@@ -0,0 +1,7 @@
1
+ export { withBrownfieldIos } from './withBrownfieldIos';
2
+ export {
3
+ withIosFrameworkFiles,
4
+ createIosFramework,
5
+ } from './withIosFrameworkFiles';
6
+ export { addFrameworkTarget } from './xcodeHelpers';
7
+ export { modifyPodfile } from './podfileHelpers';