@callstack/react-native-brownfield 3.2.1 → 3.4.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 (103) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/ios/ExpoHostRuntime.swift +41 -7
  3. package/ios/ReactNativeBrownfield.swift +25 -0
  4. package/ios/ReactNativeHostRuntime.swift +16 -0
  5. package/lib/commonjs/expo-config-plugin/android/index.js +1 -1
  6. package/lib/commonjs/expo-config-plugin/android/{constants.js → utils/constants.js} +1 -1
  7. package/lib/commonjs/expo-config-plugin/android/utils/constants.js.map +1 -0
  8. package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js +2 -0
  9. package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -0
  10. package/lib/commonjs/expo-config-plugin/android/utils/hermes.js +2 -0
  11. package/lib/commonjs/expo-config-plugin/android/utils/hermes.js.map +1 -0
  12. package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js +1 -1
  13. package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -1
  14. package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
  15. package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
  16. package/lib/commonjs/expo-config-plugin/expoUtils.js +2 -0
  17. package/lib/commonjs/expo-config-plugin/expoUtils.js.map +1 -0
  18. package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js +16 -2
  19. package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js.map +1 -1
  20. package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js +1 -1
  21. package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -1
  22. package/lib/commonjs/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -1
  23. package/lib/commonjs/expo-config-plugin/template/android/ReactNativeHostManager.post55.kt +32 -0
  24. package/lib/commonjs/expo-config-plugin/template/android/build.gradle.kts +1 -1
  25. package/lib/module/expo-config-plugin/android/index.js +1 -1
  26. package/lib/module/expo-config-plugin/android/{constants.js → utils/constants.js} +1 -1
  27. package/lib/module/expo-config-plugin/android/utils/constants.js.map +1 -0
  28. package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js +2 -0
  29. package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -0
  30. package/lib/module/expo-config-plugin/android/utils/hermes.js +2 -0
  31. package/lib/module/expo-config-plugin/android/utils/hermes.js.map +1 -0
  32. package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js +1 -1
  33. package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -1
  34. package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
  35. package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
  36. package/lib/module/expo-config-plugin/expoUtils.js +2 -0
  37. package/lib/module/expo-config-plugin/expoUtils.js.map +1 -0
  38. package/lib/module/expo-config-plugin/ios/podfileHelpers.js +16 -2
  39. package/lib/module/expo-config-plugin/ios/podfileHelpers.js.map +1 -1
  40. package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js +1 -1
  41. package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -1
  42. package/lib/module/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -1
  43. package/lib/module/expo-config-plugin/template/android/ReactNativeHostManager.post55.kt +32 -0
  44. package/lib/module/expo-config-plugin/template/android/build.gradle.kts +1 -1
  45. package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts +1 -1
  46. package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts +3 -0
  48. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -0
  50. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/hermes.d.ts +6 -0
  51. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/hermes.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +5 -1
  53. package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/src/expo-config-plugin/expoUtils.d.ts +6 -0
  56. package/lib/typescript/commonjs/src/expo-config-plugin/expoUtils.d.ts.map +1 -0
  57. package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts +2 -1
  58. package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -1
  60. package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts +1 -1
  61. package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts.map +1 -1
  62. package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts +3 -0
  63. package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts.map +1 -0
  64. package/lib/typescript/module/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -0
  65. package/lib/typescript/module/src/expo-config-plugin/android/utils/hermes.d.ts +6 -0
  66. package/lib/typescript/module/src/expo-config-plugin/android/utils/hermes.d.ts.map +1 -0
  67. package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +5 -1
  68. package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
  69. package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
  70. package/lib/typescript/module/src/expo-config-plugin/expoUtils.d.ts +6 -0
  71. package/lib/typescript/module/src/expo-config-plugin/expoUtils.d.ts.map +1 -0
  72. package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts +2 -1
  73. package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -1
  74. package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -1
  75. package/package.json +11 -8
  76. package/src/expo-config-plugin/android/index.ts +4 -1
  77. package/src/expo-config-plugin/android/{constants.ts → utils/constants.ts} +1 -1
  78. package/src/expo-config-plugin/android/{gradleHelpers.ts → utils/gradleHelpers.ts} +1 -1
  79. package/src/expo-config-plugin/android/utils/hermes.ts +83 -0
  80. package/src/expo-config-plugin/android/withAndroidModuleFiles.ts +26 -3
  81. package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +4 -1
  82. package/src/expo-config-plugin/expoUtils.ts +12 -0
  83. package/src/expo-config-plugin/ios/podfileHelpers.ts +45 -2
  84. package/src/expo-config-plugin/ios/withBrownfieldIos.ts +4 -5
  85. package/src/expo-config-plugin/template/android/ReactNativeHostManager.post55.kt +32 -0
  86. package/src/expo-config-plugin/template/android/build.gradle.kts +1 -1
  87. package/lib/commonjs/expo-config-plugin/android/constants.js.map +0 -1
  88. package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js +0 -2
  89. package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js.map +0 -1
  90. package/lib/module/expo-config-plugin/android/constants.js.map +0 -1
  91. package/lib/module/expo-config-plugin/android/gradleHelpers.js +0 -2
  92. package/lib/module/expo-config-plugin/android/gradleHelpers.js.map +0 -1
  93. package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts +0 -3
  94. package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts.map +0 -1
  95. package/lib/typescript/commonjs/src/expo-config-plugin/android/gradleHelpers.d.ts.map +0 -1
  96. package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts +0 -3
  97. package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts.map +0 -1
  98. package/lib/typescript/module/src/expo-config-plugin/android/gradleHelpers.d.ts.map +0 -1
  99. /package/lib/commonjs/expo-config-plugin/template/android/{ReactNativeHostManager.kt → ReactNativeHostManager.pre55.kt} +0 -0
  100. /package/lib/module/expo-config-plugin/template/android/{ReactNativeHostManager.kt → ReactNativeHostManager.pre55.kt} +0 -0
  101. /package/lib/typescript/commonjs/src/expo-config-plugin/android/{gradleHelpers.d.ts → utils/gradleHelpers.d.ts} +0 -0
  102. /package/lib/typescript/module/src/expo-config-plugin/android/{gradleHelpers.d.ts → utils/gradleHelpers.d.ts} +0 -0
  103. /package/src/expo-config-plugin/template/android/{ReactNativeHostManager.kt → ReactNativeHostManager.pre55.kt} +0 -0
@@ -4,7 +4,10 @@ import {
4
4
  type ConfigPlugin,
5
5
  } from '@expo/config-plugins';
6
6
 
7
- import { modifyRootBuildGradle, modifySettingsGradle } from './gradleHelpers';
7
+ import {
8
+ modifyRootBuildGradle,
9
+ modifySettingsGradle,
10
+ } from './utils/gradleHelpers';
8
11
  import { withAndroidModuleFiles } from './withAndroidModuleFiles';
9
12
  import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
10
13
 
@@ -0,0 +1,12 @@
1
+ import type { ExpoConfig } from '@expo/config-types';
2
+
3
+ export function getExpoInfo(config: ExpoConfig) {
4
+ const expoMajor = config.sdkVersion
5
+ ? parseInt(config.sdkVersion.split('.')[0], 10)
6
+ : -1;
7
+ const isExpoPre55 = expoMajor < 55;
8
+ return {
9
+ expoMajor,
10
+ isExpoPre55,
11
+ };
12
+ }
@@ -6,6 +6,10 @@ const BROWNFIELD_POD_HOOK_MARKER_START =
6
6
  '# >>> react-native-brownfield expo phase ordering >>>';
7
7
  const BROWNFIELD_POD_HOOK_MARKER_END =
8
8
  '# <<< react-native-brownfield expo phase ordering <<<';
9
+ const BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START =
10
+ '# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';
11
+ const BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END =
12
+ '# <<< react-native-brownfield Expo SDK 55+ swift defines <<<';
9
13
  const BROWNFIELD_POST_INTEGRATE_REQUIRE = `require File.join(File.dirname(\`node --print "require.resolve('@callstack/react-native-brownfield/package.json')"\`), "scripts/react_native_brownfield_post_integrate")`;
10
14
  const REACT_NATIVE_PODS_REQUIRE_REGEX =
11
15
  /^require File\.join\(File\.dirname\(`node --print "require\.resolve\('react-native\/package\.json'\)"`\), "scripts\/react_native_pods"\)\s*$/m;
@@ -49,16 +53,52 @@ ${BROWNFIELD_POD_HOOK_MARKER_END}
49
53
  return modifiedPodfile;
50
54
  }
51
55
 
56
+ function ensureExpoDefinesForSDK55AndAbove(podfile: string): string {
57
+ if (podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)) {
58
+ return podfile;
59
+ }
60
+
61
+ const hook = `
62
+ ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START}
63
+ installer.pods_project.targets.each do |target|
64
+ if target.name == 'ReactBrownfield'
65
+ puts "[Brownfield] Adding definition of EXPO_SDK_GTE_55 to target: #{target.name}"
66
+
67
+ target.build_configurations.each do |config|
68
+ conditions = config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] || '$(inherited)'
69
+ conditions = conditions.to_s
70
+ config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = "#{conditions} EXPO_SDK_GTE_55"
71
+ end
72
+ end
73
+ end
74
+ ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END}
75
+ `;
76
+
77
+ const postInstallMatch = podfile.match(
78
+ /(post_install\s+do\s+\|installer\|\s*\n)((?:(?!^\s*end\s*$)[\s\S])*)(^\s*end\s*$)/m
79
+ );
80
+
81
+ if (postInstallMatch) {
82
+ const [whole, start, content, end] = postInstallMatch;
83
+ const updated = `${start}${content.trimEnd()}\n${hook}\n${end}`;
84
+ return podfile.replace(whole, updated);
85
+ }
86
+
87
+ // if there is no post_install, append one
88
+ return `${podfile.trimEnd()}\n\npost_install do |installer|\n${hook}\nend\n`;
89
+ }
90
+
52
91
  /**
53
92
  * Modifies the Podfile to include the Brownfield framework target
54
93
  * @param podfile The original Podfile content
55
94
  * @param frameworkName The name of the framework target to add
95
+ * @param expoMajor The major version of the Expo SDK
56
96
  * @returns The modified Podfile content
57
97
  */
58
98
  export function modifyPodfile(
59
99
  podfile: string,
60
100
  frameworkName: string,
61
- isExpoPre55: boolean
101
+ expoMajor: number
62
102
  ): string {
63
103
  // check if the framework target is already included
64
104
  if (podfile.includes(`target '${frameworkName}'`)) {
@@ -99,8 +139,11 @@ export function modifyPodfile(
99
139
 
100
140
  Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);
101
141
 
102
- if (isExpoPre55) {
142
+ if (expoMajor < 55) {
103
143
  modifiedPodfile = ensureExpoPhaseOrderingHook(modifiedPodfile);
144
+ } else {
145
+ // Expo SDK >= 55
146
+ modifiedPodfile = ensureExpoDefinesForSDK55AndAbove(modifiedPodfile);
104
147
  }
105
148
 
106
149
  return modifiedPodfile;
@@ -14,6 +14,7 @@ import { modifyPodfile } from './podfileHelpers';
14
14
  import { withIosFrameworkFiles } from './withIosFrameworkFiles';
15
15
  import type { ResolvedBrownfieldPluginConfigWithIos } from '../types';
16
16
  import { Logger } from '../logging';
17
+ import { getExpoInfo } from '../expoUtils';
17
18
 
18
19
  /**
19
20
  * iOS Config Plugin for integration with @callstack/react-native-brownfield.
@@ -28,10 +29,8 @@ import { Logger } from '../logging';
28
29
  export const withBrownfieldIos: ConfigPlugin<
29
30
  ResolvedBrownfieldPluginConfigWithIos
30
31
  > = (config, props) => {
31
- const expoMajor = config.sdkVersion
32
- ? parseInt(config.sdkVersion.split('.')[0], 10)
33
- : -1;
34
- const isExpoPre55 = expoMajor < 55;
32
+ const { isExpoPre55, expoMajor } = getExpoInfo(config);
33
+
35
34
  // Step 1: modify the Xcode project to add framework target &
36
35
  config = withXcodeProject(config, (xcodeConfig) => {
37
36
  const { modResults: project, modRequest } = xcodeConfig;
@@ -81,7 +80,7 @@ export const withBrownfieldIos: ConfigPlugin<
81
80
  podfileConfig.modResults.contents = modifyPodfile(
82
81
  podfileConfig.modResults.contents,
83
82
  frameworkName,
84
- isExpoPre55
83
+ expoMajor
85
84
  );
86
85
 
87
86
  return podfileConfig;
@@ -0,0 +1,32 @@
1
+ package {{PACKAGE_NAME}}
2
+
3
+ import android.app.Application
4
+ import android.content.res.Configuration
5
+ import com.callstack.reactnativebrownfield.OnJSBundleLoaded
6
+ import com.callstack.reactnativebrownfield.ReactNativeBrownfield
7
+ import com.facebook.react.PackageList
8
+ import com.facebook.react.ReactHost
9
+ import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
10
+ import expo.modules.ApplicationLifecycleDispatcher
11
+ import expo.modules.ExpoReactHostFactory
12
+
13
+ object ReactNativeHostManager {
14
+ fun initialize(application: Application, onJSBundleLoaded: OnJSBundleLoaded? = null) {
15
+ loadReactNative(application)
16
+
17
+ ApplicationLifecycleDispatcher.onApplicationCreate(application)
18
+
19
+ val reactHost: ReactHost by lazy {
20
+ ExpoReactHostFactory.getDefaultReactHost(
21
+ context = application.applicationContext,
22
+ packageList = PackageList(application).packages,
23
+ )
24
+ }
25
+
26
+ ReactNativeBrownfield.initialize(application, reactHost, onJSBundleLoaded)
27
+ }
28
+
29
+ fun onConfigurationChanged(application: Application, newConfig: Configuration) {
30
+ ApplicationLifecycleDispatcher.onConfigurationChanged(application, newConfig)
31
+ }
32
+ }
@@ -83,7 +83,7 @@ android {
83
83
 
84
84
  dependencies {
85
85
  api("com.facebook.react:react-android:{{RN_VERSION}}")
86
- api("com.facebook.react:hermes-android:{{RN_VERSION}}")
86
+ api("{{HERMES_ARTIFACT}}")
87
87
 
88
88
  api("io.coil-kt.coil3:coil-compose:3.2.0")
89
89
  api("io.coil-kt.coil3:coil-network-okhttp:3.2.0")
@@ -1 +0,0 @@
1
- {"version":3,"names":["BROWNFIELD_PLUGIN_VERSION","exports","brownfieldGradlePluginDependency"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/constants.ts"],"mappings":"2IAAO,GAAM,CAAAA,yBAAyB,CAAAC,OAAA,CAAAD,yBAAA,CAAG,OAAO,CACzC,GAAM,CAAAE,gCAAgC,CAAAD,OAAA,CAAAC,gCAAA,CAAG,2DAA2DF,yBAAyB,IAAI","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../logging");function modifyRootBuildGradle(contents){if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifySettingsGradle(contents,moduleName){var includeStatement=`include ':${moduleName}'`;if(contents.includes(includeStatement)){_logging.Logger.logDebug(`Module "${moduleName}" already in settings.gradle, skipping`);return contents;}_logging.Logger.logDebug(`Modifying settings.gradle to include module "${moduleName}"`);var modifiedContents=contents+`\n${includeStatement}\n`;_logging.Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);return modifiedContents;}
2
- //# sourceMappingURL=gradleHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_constants","require","_logging","modifyRootBuildGradle","contents","includes","Logger","logDebug","buildscriptDepsRegex","match","Error","insertion","brownfieldGradlePluginDependency","modifiedContents","replace","modifySettingsGradle","moduleName","includeStatement"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/gradleHelpers.ts"],"mappings":"+JAAA,IAAAA,UAAA,CAAAC,OAAA,gBACA,IAAAC,QAAA,CAAAD,OAAA,eAOO,QAAS,CAAAE,qBAAqBA,CAACC,QAAgB,CAAU,CAE9D,GAAIA,QAAQ,CAACC,QAAQ,CAAC,0BAA0B,CAAC,CAAE,CACjDC,eAAM,CAACC,QAAQ,CACb,iEACF,CAAC,CACD,MAAO,CAAAH,QAAQ,CACjB,CAEAE,eAAM,CAACC,QAAQ,CACb,iEACF,CAAC,CAGD,GAAM,CAAAC,oBAAoB,CACxB,yDAAyD,CAC3D,GAAM,CAAAC,KAAK,CAAGL,QAAQ,CAACK,KAAK,CAACD,oBAAoB,CAAC,CAElD,GAAI,CAACC,KAAK,CAAE,CACV,KAAM,IAAI,CAAAC,KAAK,CAAC,yDAAyD,CAAC,CAC5E,CAGA,GAAM,CAAAC,SAAS,CAAG,KAAKC,2CAAgC,MAAM,CAC7D,GAAM,CAAAC,gBAAgB,CAAGT,QAAQ,CAACU,OAAO,CACvCN,oBAAoB,CACpB,KAAKG,SAAS,IAChB,CAAC,CAEDL,eAAM,CAACC,QAAQ,CAAC,qDAAqD,CAAC,CACtE,MAAO,CAAAM,gBAAgB,CACzB,CAQO,QAAS,CAAAE,oBAAoBA,CAClCX,QAAgB,CAChBY,UAAkB,CACV,CACR,GAAM,CAAAC,gBAAgB,CAAG,aAAaD,UAAU,GAAG,CAGnD,GAAIZ,QAAQ,CAACC,QAAQ,CAACY,gBAAgB,CAAC,CAAE,CACvCX,eAAM,CAACC,QAAQ,CACb,WAAWS,UAAU,wCACvB,CAAC,CACD,MAAO,CAAAZ,QAAQ,CACjB,CAEAE,eAAM,CAACC,QAAQ,CACb,gDAAgDS,UAAU,GAC5D,CAAC,CAGD,GAAM,CAAAH,gBAAgB,CAAGT,QAAQ,CAAG,KAAKa,gBAAgB,IAAI,CAE7DX,eAAM,CAACC,QAAQ,CAAC,iBAAiBS,UAAU,sBAAsB,CAAC,CAElE,MAAO,CAAAH,gBAAgB,CACzB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["BROWNFIELD_PLUGIN_VERSION","exports","brownfieldGradlePluginDependency"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/constants.ts"],"mappings":"2IAAO,GAAM,CAAAA,yBAAyB,CAAAC,OAAA,CAAAD,yBAAA,CAAG,OAAO,CACzC,GAAM,CAAAE,gCAAgC,CAAAD,OAAA,CAAAC,gCAAA,CAAG,2DAA2DF,yBAAyB,IAAI","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../logging");function modifyRootBuildGradle(contents){if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifySettingsGradle(contents,moduleName){var includeStatement=`include ':${moduleName}'`;if(contents.includes(includeStatement)){_logging.Logger.logDebug(`Module "${moduleName}" already in settings.gradle, skipping`);return contents;}_logging.Logger.logDebug(`Modifying settings.gradle to include module "${moduleName}"`);var modifiedContents=contents+`\n${includeStatement}\n`;_logging.Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);return modifiedContents;}
2
- //# sourceMappingURL=gradleHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_constants","require","_logging","modifyRootBuildGradle","contents","includes","Logger","logDebug","buildscriptDepsRegex","match","Error","insertion","brownfieldGradlePluginDependency","modifiedContents","replace","modifySettingsGradle","moduleName","includeStatement"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/gradleHelpers.ts"],"mappings":"+JAAA,IAAAA,UAAA,CAAAC,OAAA,gBACA,IAAAC,QAAA,CAAAD,OAAA,eAOO,QAAS,CAAAE,qBAAqBA,CAACC,QAAgB,CAAU,CAE9D,GAAIA,QAAQ,CAACC,QAAQ,CAAC,0BAA0B,CAAC,CAAE,CACjDC,eAAM,CAACC,QAAQ,CACb,iEACF,CAAC,CACD,MAAO,CAAAH,QAAQ,CACjB,CAEAE,eAAM,CAACC,QAAQ,CACb,iEACF,CAAC,CAGD,GAAM,CAAAC,oBAAoB,CACxB,yDAAyD,CAC3D,GAAM,CAAAC,KAAK,CAAGL,QAAQ,CAACK,KAAK,CAACD,oBAAoB,CAAC,CAElD,GAAI,CAACC,KAAK,CAAE,CACV,KAAM,IAAI,CAAAC,KAAK,CAAC,yDAAyD,CAAC,CAC5E,CAGA,GAAM,CAAAC,SAAS,CAAG,KAAKC,2CAAgC,MAAM,CAC7D,GAAM,CAAAC,gBAAgB,CAAGT,QAAQ,CAACU,OAAO,CACvCN,oBAAoB,CACpB,KAAKG,SAAS,IAChB,CAAC,CAEDL,eAAM,CAACC,QAAQ,CAAC,qDAAqD,CAAC,CACtE,MAAO,CAAAM,gBAAgB,CACzB,CAQO,QAAS,CAAAE,oBAAoBA,CAClCX,QAAgB,CAChBY,UAAkB,CACV,CACR,GAAM,CAAAC,gBAAgB,CAAG,aAAaD,UAAU,GAAG,CAGnD,GAAIZ,QAAQ,CAACC,QAAQ,CAACY,gBAAgB,CAAC,CAAE,CACvCX,eAAM,CAACC,QAAQ,CACb,WAAWS,UAAU,wCACvB,CAAC,CACD,MAAO,CAAAZ,QAAQ,CACjB,CAEAE,eAAM,CAACC,QAAQ,CACb,gDAAgDS,UAAU,GAC5D,CAAC,CAGD,GAAM,CAAAH,gBAAgB,CAAGT,QAAQ,CAAG,KAAKa,gBAAgB,IAAI,CAE7DX,eAAM,CAACC,QAAQ,CAAC,iBAAiBS,UAAU,sBAAsB,CAAC,CAElE,MAAO,CAAAH,gBAAgB,CACzB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export declare const BROWNFIELD_PLUGIN_VERSION = "1.0.1";
2
- export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:1.0.1\")";
3
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AACjD,eAAO,MAAM,gCAAgC,sEAA2F,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/gradleHelpers.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA+B9D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAqBR"}
@@ -1,3 +0,0 @@
1
- export declare const BROWNFIELD_PLUGIN_VERSION = "1.0.1";
2
- export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:1.0.1\")";
3
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AACjD,eAAO,MAAM,gCAAgC,sEAA2F,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/gradleHelpers.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA+B9D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAqBR"}