@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.
- package/CHANGELOG.md +30 -0
- package/ios/ExpoHostRuntime.swift +41 -7
- package/ios/ReactNativeBrownfield.swift +25 -0
- package/ios/ReactNativeHostRuntime.swift +16 -0
- package/lib/commonjs/expo-config-plugin/android/index.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/{constants.js → utils/constants.js} +1 -1
- package/lib/commonjs/expo-config-plugin/android/utils/constants.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/utils/hermes.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/utils/hermes.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/expoUtils.js +2 -0
- package/lib/commonjs/expo-config-plugin/expoUtils.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js +16 -2
- package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js +1 -1
- package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/template/android/ReactNativeHostManager.post55.kt +32 -0
- package/lib/commonjs/expo-config-plugin/template/android/build.gradle.kts +1 -1
- package/lib/module/expo-config-plugin/android/index.js +1 -1
- package/lib/module/expo-config-plugin/android/{constants.js → utils/constants.js} +1 -1
- package/lib/module/expo-config-plugin/android/utils/constants.js.map +1 -0
- package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js +2 -0
- package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -0
- package/lib/module/expo-config-plugin/android/utils/hermes.js +2 -0
- package/lib/module/expo-config-plugin/android/utils/hermes.js.map +1 -0
- package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js +1 -1
- package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -1
- package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
- package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
- package/lib/module/expo-config-plugin/expoUtils.js +2 -0
- package/lib/module/expo-config-plugin/expoUtils.js.map +1 -0
- package/lib/module/expo-config-plugin/ios/podfileHelpers.js +16 -2
- package/lib/module/expo-config-plugin/ios/podfileHelpers.js.map +1 -1
- package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js +1 -1
- package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -1
- package/lib/module/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -1
- package/lib/module/expo-config-plugin/template/android/ReactNativeHostManager.post55.kt +32 -0
- package/lib/module/expo-config-plugin/template/android/build.gradle.kts +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts +3 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/hermes.d.ts +6 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/hermes.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +5 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/expoUtils.d.ts +6 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/expoUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts +2 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts +3 -0
- package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/utils/hermes.d.ts +6 -0
- package/lib/typescript/module/src/expo-config-plugin/android/utils/hermes.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +5 -1
- package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/expoUtils.d.ts +6 -0
- package/lib/typescript/module/src/expo-config-plugin/expoUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts +2 -1
- package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -1
- package/package.json +11 -8
- package/src/expo-config-plugin/android/index.ts +4 -1
- package/src/expo-config-plugin/android/{constants.ts → utils/constants.ts} +1 -1
- package/src/expo-config-plugin/android/{gradleHelpers.ts → utils/gradleHelpers.ts} +1 -1
- package/src/expo-config-plugin/android/utils/hermes.ts +83 -0
- package/src/expo-config-plugin/android/withAndroidModuleFiles.ts +26 -3
- package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +4 -1
- package/src/expo-config-plugin/expoUtils.ts +12 -0
- package/src/expo-config-plugin/ios/podfileHelpers.ts +45 -2
- package/src/expo-config-plugin/ios/withBrownfieldIos.ts +4 -5
- package/src/expo-config-plugin/template/android/ReactNativeHostManager.post55.kt +32 -0
- package/src/expo-config-plugin/template/android/build.gradle.kts +1 -1
- package/lib/commonjs/expo-config-plugin/android/constants.js.map +0 -1
- package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js +0 -2
- package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js.map +0 -1
- package/lib/module/expo-config-plugin/android/constants.js.map +0 -1
- package/lib/module/expo-config-plugin/android/gradleHelpers.js +0 -2
- package/lib/module/expo-config-plugin/android/gradleHelpers.js.map +0 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts +0 -3
- package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/gradleHelpers.d.ts.map +0 -1
- package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts +0 -3
- package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts.map +0 -1
- package/lib/typescript/module/src/expo-config-plugin/android/gradleHelpers.d.ts.map +0 -1
- /package/lib/commonjs/expo-config-plugin/template/android/{ReactNativeHostManager.kt → ReactNativeHostManager.pre55.kt} +0 -0
- /package/lib/module/expo-config-plugin/template/android/{ReactNativeHostManager.kt → ReactNativeHostManager.pre55.kt} +0 -0
- /package/lib/typescript/commonjs/src/expo-config-plugin/android/{gradleHelpers.d.ts → utils/gradleHelpers.d.ts} +0 -0
- /package/lib/typescript/module/src/expo-config-plugin/android/{gradleHelpers.d.ts → utils/gradleHelpers.d.ts} +0 -0
- /package/src/expo-config-plugin/template/android/{ReactNativeHostManager.kt → ReactNativeHostManager.pre55.kt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","withSettingsGradle","settingsConfig","modifySettingsGradle","moduleName","withAndroidModuleFiles"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withBrownfieldAndroid.ts"],"mappings":"8FAAA,IAAAA,cAAA,CAAAC,OAAA,yBAMA,IAAAC,cAAA,CAAAD,OAAA,
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","withSettingsGradle","settingsConfig","modifySettingsGradle","moduleName","withAndroidModuleFiles"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withBrownfieldAndroid.ts"],"mappings":"8FAAA,IAAAA,cAAA,CAAAC,OAAA,yBAMA,IAAAC,cAAA,CAAAD,OAAA,0BAIA,IAAAE,uBAAA,CAAAF,OAAA,6BAYO,GAAM,CAAAG,qBAEZ,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAFS,CAAAA,qBAEZA,CAAIE,MAAM,CAAEC,KAAK,CAAK,CACrB,GAAM,CAAAC,aAAa,CAAGD,KAAK,CAACE,OAAO,CAGnCH,MAAM,CAAG,GAAAI,qCAAsB,EAACJ,MAAM,CAAE,SAACK,YAAY,CAAK,CACxDA,YAAY,CAACC,UAAU,CAACC,QAAQ,CAAG,GAAAC,oCAAqB,EACtDH,YAAY,CAACC,UAAU,CAACC,QAC1B,CAAC,CAED,MAAO,CAAAF,YAAY,CACrB,CAAC,CAAC,CAGFL,MAAM,CAAG,GAAAS,iCAAkB,EAACT,MAAM,CAAE,SAACU,cAAc,CAAK,CACtDA,cAAc,CAACJ,UAAU,CAACC,QAAQ,CAAG,GAAAI,mCAAoB,EACvDD,cAAc,CAACJ,UAAU,CAACC,QAAQ,CAClCL,aAAa,CAACU,UAChB,CAAC,CAED,MAAO,CAAAF,cAAc,CACvB,CAAC,CAAC,CAGFV,MAAM,CAAG,GAAAa,8CAAsB,EAACb,MAAM,CAAEC,KAAK,CAAC,CAE9C,MAAO,CAAAD,MAAM,CACf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.getExpoInfo=getExpoInfo;function getExpoInfo(config){var expoMajor=config.sdkVersion?parseInt(config.sdkVersion.split('.')[0],10):-1;var isExpoPre55=expoMajor<55;return{expoMajor:expoMajor,isExpoPre55:isExpoPre55};}
|
|
2
|
+
//# sourceMappingURL=expoUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getExpoInfo","config","expoMajor","sdkVersion","parseInt","split","isExpoPre55"],"sourceRoot":"../../../src","sources":["expo-config-plugin/expoUtils.ts"],"mappings":"yFAEO,QAAS,CAAAA,WAAWA,CAACC,MAAkB,CAAE,CAC9C,GAAM,CAAAC,SAAS,CAAGD,MAAM,CAACE,UAAU,CAC/BC,QAAQ,CAACH,MAAM,CAACE,UAAU,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,CAC7C,CAAC,CAAC,CACN,GAAM,CAAAC,WAAW,CAAGJ,SAAS,CAAG,EAAE,CAClC,MAAO,CACLA,SAAS,CAATA,SAAS,CACTI,WAAW,CAAXA,WACF,CAAC,CACH","ignoreList":[]}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.modifyPodfile=modifyPodfile;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _SourceModificationError=require("../errors/SourceModificationError");var _logging=require("../logging");var _engine=require("../template/engine");var BROWNFIELD_POD_HOOK_MARKER_START='# >>> react-native-brownfield expo phase ordering >>>';var BROWNFIELD_POD_HOOK_MARKER_END='# <<< react-native-brownfield expo phase ordering <<<';var 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")`;var REACT_NATIVE_PODS_REQUIRE_REGEX=/^require File\.join\(File\.dirname\(`node --print "require\.resolve\('react-native\/package\.json'\)"`\), "scripts\/react_native_pods"\)\s*$/m;function ensureBrownfieldPostIntegrateRequire(podfile){if(podfile.includes('scripts/react_native_brownfield_post_integrate')){return podfile;}var reactNativePodsRequireMatch=podfile.match(REACT_NATIVE_PODS_REQUIRE_REGEX);if(reactNativePodsRequireMatch){var requireLine=reactNativePodsRequireMatch[0];return podfile.replace(requireLine,`${requireLine}\n${BROWNFIELD_POST_INTEGRATE_REQUIRE}\n`);}return`${BROWNFIELD_POST_INTEGRATE_REQUIRE}\n\n${podfile}`;}function ensureExpoPhaseOrderingHook(podfile){var modifiedPodfile=ensureBrownfieldPostIntegrateRequire(podfile);if(modifiedPodfile.includes(BROWNFIELD_POD_HOOK_MARKER_START)){return modifiedPodfile;}var hook=`
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.modifyPodfile=modifyPodfile;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _SourceModificationError=require("../errors/SourceModificationError");var _logging=require("../logging");var _engine=require("../template/engine");var BROWNFIELD_POD_HOOK_MARKER_START='# >>> react-native-brownfield expo phase ordering >>>';var BROWNFIELD_POD_HOOK_MARKER_END='# <<< react-native-brownfield expo phase ordering <<<';var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START='# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END='# <<< react-native-brownfield Expo SDK 55+ swift defines <<<';var 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")`;var REACT_NATIVE_PODS_REQUIRE_REGEX=/^require File\.join\(File\.dirname\(`node --print "require\.resolve\('react-native\/package\.json'\)"`\), "scripts\/react_native_pods"\)\s*$/m;function ensureBrownfieldPostIntegrateRequire(podfile){if(podfile.includes('scripts/react_native_brownfield_post_integrate')){return podfile;}var reactNativePodsRequireMatch=podfile.match(REACT_NATIVE_PODS_REQUIRE_REGEX);if(reactNativePodsRequireMatch){var requireLine=reactNativePodsRequireMatch[0];return podfile.replace(requireLine,`${requireLine}\n${BROWNFIELD_POST_INTEGRATE_REQUIRE}\n`);}return`${BROWNFIELD_POST_INTEGRATE_REQUIRE}\n\n${podfile}`;}function ensureExpoPhaseOrderingHook(podfile){var modifiedPodfile=ensureBrownfieldPostIntegrateRequire(podfile);if(modifiedPodfile.includes(BROWNFIELD_POD_HOOK_MARKER_START)){return modifiedPodfile;}var hook=`
|
|
2
2
|
${BROWNFIELD_POD_HOOK_MARKER_START}
|
|
3
3
|
post_integrate do |installer|
|
|
4
4
|
react_native_brownfield_post_integrate(installer)
|
|
5
5
|
end
|
|
6
6
|
${BROWNFIELD_POD_HOOK_MARKER_END}
|
|
7
|
-
`;modifiedPodfile=`${modifiedPodfile.trimEnd()}\n\n${hook}\n`;return modifiedPodfile;}function
|
|
7
|
+
`;modifiedPodfile=`${modifiedPodfile.trimEnd()}\n\n${hook}\n`;return modifiedPodfile;}function ensureExpoDefinesForSDK55AndAbove(podfile){if(podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)){return podfile;}var hook=`
|
|
8
|
+
${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START}
|
|
9
|
+
installer.pods_project.targets.each do |target|
|
|
10
|
+
if target.name == 'ReactBrownfield'
|
|
11
|
+
puts "[Brownfield] Adding definition of EXPO_SDK_GTE_55 to target: #{target.name}"
|
|
12
|
+
|
|
13
|
+
target.build_configurations.each do |config|
|
|
14
|
+
conditions = config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] || '$(inherited)'
|
|
15
|
+
conditions = conditions.to_s
|
|
16
|
+
config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = "#{conditions} EXPO_SDK_GTE_55"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END}
|
|
21
|
+
`;var postInstallMatch=podfile.match(/(post_install\s+do\s+\|installer\|\s*\n)((?:(?!^\s*end\s*$)[\s\S])*)(^\s*end\s*$)/m);if(postInstallMatch){var _postInstallMatch=(0,_slicedToArray2.default)(postInstallMatch,4),whole=_postInstallMatch[0],start=_postInstallMatch[1],content=_postInstallMatch[2],end=_postInstallMatch[3];var updated=`${start}${content.trimEnd()}\n${hook}\n${end}`;return podfile.replace(whole,updated);}return`${podfile.trimEnd()}\n\npost_install do |installer|\n${hook}\nend\n`;}function modifyPodfile(podfile,frameworkName,expoMajor){if(podfile.includes(`target '${frameworkName}'`)){_logging.Logger.logDebug(`Framework target "${frameworkName}" already in Podfile, skipping modification`);return podfile;}_logging.Logger.logDebug(`Modifying Podfile for framework: ${frameworkName}`);var frameworkTargetBlock=(0,_engine.renderTemplate)('ios','PodfileTargetBlock.rb',{'{{FRAMEWORK_NAME}}':frameworkName});var mainTargetMatch=podfile.match(/(target\s+['"][^'"]+['"]\s+do\s*\n)([\s\S]*?)(^end\s*$)/m);if(!mainTargetMatch){throw new _SourceModificationError.SourceModificationError('Could not find main target in Podfile. Please manually add the framework target.');}var _mainTargetMatch=(0,_slicedToArray2.default)(mainTargetMatch,3),targetStart=_mainTargetMatch[1],targetContent=_mainTargetMatch[2];var insertIndex=podfile.indexOf(mainTargetMatch[0])+targetStart.length+targetContent.length;var modifiedPodfile=podfile.slice(0,insertIndex)+frameworkTargetBlock+podfile.slice(insertIndex);_logging.Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);if(expoMajor<55){modifiedPodfile=ensureExpoPhaseOrderingHook(modifiedPodfile);}else{modifiedPodfile=ensureExpoDefinesForSDK55AndAbove(modifiedPodfile);}return modifiedPodfile;}
|
|
8
22
|
//# sourceMappingURL=podfileHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_SourceModificationError","require","_logging","_engine","BROWNFIELD_POD_HOOK_MARKER_START","BROWNFIELD_POD_HOOK_MARKER_END","BROWNFIELD_POST_INTEGRATE_REQUIRE","REACT_NATIVE_PODS_REQUIRE_REGEX","ensureBrownfieldPostIntegrateRequire","podfile","includes","reactNativePodsRequireMatch","match","requireLine","replace","ensureExpoPhaseOrderingHook","modifiedPodfile","hook","trimEnd","modifyPodfile","frameworkName","
|
|
1
|
+
{"version":3,"names":["_SourceModificationError","require","_logging","_engine","BROWNFIELD_POD_HOOK_MARKER_START","BROWNFIELD_POD_HOOK_MARKER_END","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END","BROWNFIELD_POST_INTEGRATE_REQUIRE","REACT_NATIVE_PODS_REQUIRE_REGEX","ensureBrownfieldPostIntegrateRequire","podfile","includes","reactNativePodsRequireMatch","match","requireLine","replace","ensureExpoPhaseOrderingHook","modifiedPodfile","hook","trimEnd","ensureExpoDefinesForSDK55AndAbove","postInstallMatch","_postInstallMatch","_slicedToArray2","default","whole","start","content","end","updated","modifyPodfile","frameworkName","expoMajor","Logger","logDebug","frameworkTargetBlock","renderTemplate","mainTargetMatch","SourceModificationError","_mainTargetMatch","targetStart","targetContent","insertIndex","indexOf","length","slice"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/podfileHelpers.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldIos=void 0;var _configPlugins=require("@expo/config-plugins");var _xcodeHelpers=require("./xcodeHelpers");var _podfileHelpers=require("./podfileHelpers");var _withIosFrameworkFiles=require("./withIosFrameworkFiles");var _logging=require("../logging");var withBrownfieldIos=exports.withBrownfieldIos=function withBrownfieldIos(config,props){var
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldIos=void 0;var _configPlugins=require("@expo/config-plugins");var _xcodeHelpers=require("./xcodeHelpers");var _podfileHelpers=require("./podfileHelpers");var _withIosFrameworkFiles=require("./withIosFrameworkFiles");var _logging=require("../logging");var _expoUtils=require("../expoUtils");var withBrownfieldIos=exports.withBrownfieldIos=function withBrownfieldIos(config,props){var _getExpoInfo=(0,_expoUtils.getExpoInfo)(config),isExpoPre55=_getExpoInfo.isExpoPre55,expoMajor=_getExpoInfo.expoMajor;config=(0,_configPlugins.withXcodeProject)(config,function(xcodeConfig){var project=xcodeConfig.modResults,modRequest=xcodeConfig.modRequest;var _addFrameworkTarget=(0,_xcodeHelpers.addFrameworkTarget)(project,modRequest,props.ios),frameworkTargetUUID=_addFrameworkTarget.frameworkTargetUUID,targetAlreadyExists=_addFrameworkTarget.targetAlreadyExists;if(targetAlreadyExists){_logging.Logger.logDebug(`Skipping further Xcode modifications as framework target was already present`);return xcodeConfig;}(0,_xcodeHelpers.copyBundleReactNativePhase)(project,frameworkTargetUUID);if(isExpoPre55){_logging.Logger.logDebug(`Adding ExpoModulesProvider patch phase for Expo SDK ${config.sdkVersion}`);(0,_xcodeHelpers.addExpoPre55ShellPatchScriptPhase)(modRequest,project,{frameworkName:props.ios.frameworkName,frameworkTargetUUID:frameworkTargetUUID});}else{_logging.Logger.logDebug(`Skipping ExpoModulesProvider patch phase for Expo SDK ${config.sdkVersion}`);}(0,_xcodeHelpers.addSourceFilesBuildPhase)(project,frameworkTargetUUID,props.ios);return xcodeConfig;});config=(0,_configPlugins.withPodfile)(config,function(podfileConfig){var frameworkName=props.ios.frameworkName;podfileConfig.modResults.contents=(0,_podfileHelpers.modifyPodfile)(podfileConfig.modResults.contents,frameworkName,expoMajor);return podfileConfig;});config=(0,_withIosFrameworkFiles.withIosFrameworkFiles)(config,props);return config;};
|
|
2
2
|
//# sourceMappingURL=withBrownfieldIos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_xcodeHelpers","_podfileHelpers","_withIosFrameworkFiles","_logging","withBrownfieldIos","exports","config","props","
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_xcodeHelpers","_podfileHelpers","_withIosFrameworkFiles","_logging","_expoUtils","withBrownfieldIos","exports","config","props","_getExpoInfo","getExpoInfo","isExpoPre55","expoMajor","withXcodeProject","xcodeConfig","project","modResults","modRequest","_addFrameworkTarget","addFrameworkTarget","ios","frameworkTargetUUID","targetAlreadyExists","Logger","logDebug","copyBundleReactNativePhase","sdkVersion","addExpoPre55ShellPatchScriptPhase","frameworkName","addSourceFilesBuildPhase","withPodfile","podfileConfig","contents","modifyPodfile","withIosFrameworkFiles"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/withBrownfieldIos.ts"],"mappings":"0FAAA,IAAAA,cAAA,CAAAC,OAAA,yBAMA,IAAAC,aAAA,CAAAD,OAAA,mBAMA,IAAAE,eAAA,CAAAF,OAAA,qBACA,IAAAG,sBAAA,CAAAH,OAAA,4BAEA,IAAAI,QAAA,CAAAJ,OAAA,eACA,IAAAK,UAAA,CAAAL,OAAA,iBAYO,GAAM,CAAAM,iBAEZ,CAAAC,OAAA,CAAAD,iBAAA,CAAG,QAFS,CAAAA,iBAEZA,CAAIE,MAAM,CAAEC,KAAK,CAAK,CACrB,IAAAC,YAAA,CAAmC,GAAAC,sBAAW,EAACH,MAAM,CAAC,CAA9CI,WAAW,CAAAF,YAAA,CAAXE,WAAW,CAAEC,SAAS,CAAAH,YAAA,CAATG,SAAS,CAG9BL,MAAM,CAAG,GAAAM,+BAAgB,EAACN,MAAM,CAAE,SAACO,WAAW,CAAK,CACjD,GAAoB,CAAAC,OAAO,CAAiBD,WAAW,CAA/CE,UAAU,CAAWC,UAAU,CAAKH,WAAW,CAA1BG,UAAU,CAEvC,IAAAC,mBAAA,CAAqD,GAAAC,gCAAkB,EACrEJ,OAAO,CACPE,UAAU,CACVT,KAAK,CAACY,GACR,CAAC,CAJOC,mBAAmB,CAAAH,mBAAA,CAAnBG,mBAAmB,CAAEC,mBAAmB,CAAAJ,mBAAA,CAAnBI,mBAAmB,CAMhD,GAAIA,mBAAmB,CAAE,CACvBC,eAAM,CAACC,QAAQ,CACb,8EACF,CAAC,CAED,MAAO,CAAAV,WAAW,CACpB,CAGA,GAAAW,wCAA0B,EAACV,OAAO,CAAEM,mBAAmB,CAAC,CAGxD,GAAIV,WAAW,CAAE,CACfY,eAAM,CAACC,QAAQ,CACb,uDAAuDjB,MAAM,CAACmB,UAAU,EAC1E,CAAC,CAED,GAAAC,+CAAiC,EAACV,UAAU,CAAEF,OAAO,CAAE,CACrDa,aAAa,CAAEpB,KAAK,CAACY,GAAG,CAACQ,aAAa,CACtCP,mBAAmB,CAAEA,mBACvB,CAAC,CAAC,CACJ,CAAC,IAAM,CACLE,eAAM,CAACC,QAAQ,CACb,yDAAyDjB,MAAM,CAACmB,UAAU,EAC5E,CAAC,CACH,CAEA,GAAAG,sCAAwB,EAACd,OAAO,CAAEM,mBAAmB,CAAEb,KAAK,CAACY,GAAG,CAAC,CAEjE,MAAO,CAAAN,WAAW,CACpB,CAAC,CAAC,CAGFP,MAAM,CAAG,GAAAuB,0BAAW,EAACvB,MAAM,CAAE,SAACwB,aAAa,CAAK,CAC9C,GAAQ,CAAAH,aAAa,CAAKpB,KAAK,CAACY,GAAG,CAA3BQ,aAAa,CAErBG,aAAa,CAACf,UAAU,CAACgB,QAAQ,CAAG,GAAAC,6BAAa,EAC/CF,aAAa,CAACf,UAAU,CAACgB,QAAQ,CACjCJ,aAAa,CACbhB,SACF,CAAC,CAED,MAAO,CAAAmB,aAAa,CACtB,CAAC,CAAC,CAGFxB,MAAM,CAAG,GAAA2B,4CAAqB,EAAC3B,MAAM,CAAEC,KAAK,CAAC,CAE7C,MAAO,CAAAD,MAAM,CACf,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getFrameworkSourceFiles","ios","relativePath","frameworkName","content","renderTemplate","bundleIdentifier","createIosFramework","iosDir","config","frameworkDir","join","existsSync","Logger","logDebug","mkdirSync","recursive","file","filePath","writeFileSync","withIosFrameworkFiles","exports","props","withDangerousMod","_ref","_asyncToGenerator2","dangerousConfig","modRequest","projectRoot","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/withIosFrameworkFiles.ts"],"mappings":"yXAAA,IAAAA,EAAA,CAAAC,uBAAA,CAAAC,OAAA,aACA,IAAAC,IAAA,CAAAF,uBAAA,CAAAC,OAAA,eAEA,IAAAE,cAAA,CAAAF,OAAA,yBAMA,IAAAG,QAAA,CAAAH,OAAA,eACA,IAAAI,OAAA,CAAAJ,OAAA,uBAAoD,SAAAD,wBAAAM,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAR,uBAAA,UAAAA,wBAAAM,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAQ,CAAA,IAAAF,CAAA,CAAAL,CAAA,CAAAG,CAAA,CAAAD,CAAA,KAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,SAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,
|
|
1
|
+
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","getFrameworkSourceFiles","ios","relativePath","frameworkName","content","renderTemplate","bundleIdentifier","createIosFramework","iosDir","config","frameworkDir","join","existsSync","Logger","logDebug","mkdirSync","recursive","file","filePath","writeFileSync","withIosFrameworkFiles","exports","props","withDangerousMod","_ref","_asyncToGenerator2","dangerousConfig","modRequest","projectRoot","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/withIosFrameworkFiles.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -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("
|
|
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,4 +1,4 @@
|
|
|
1
1
|
export { withBrownfieldAndroid } from './withBrownfieldAndroid';
|
|
2
2
|
export { withAndroidModuleFiles, createAndroidModule, } from './withAndroidModuleFiles';
|
|
3
|
-
export { modifyRootBuildGradle, modifySettingsGradle } from './gradleHelpers';
|
|
3
|
+
export { modifyRootBuildGradle, modifySettingsGradle, } from './utils/gradleHelpers';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AACjD,eAAO,MAAM,gCAAgC,sEAA2F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/hermes.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM;;;;EAgFlD"}
|
|
@@ -3,7 +3,11 @@ import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Creates the Android library module directory structure and files
|
|
5
5
|
*/
|
|
6
|
-
export declare function createAndroidModule({ androidDir, config, rnVersion, }: {
|
|
6
|
+
export declare function createAndroidModule({ androidDir, config, rnVersion, isExpoPre55, }: {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the Expo project is pre-55
|
|
9
|
+
*/
|
|
10
|
+
isExpoPre55: boolean;
|
|
7
11
|
/**
|
|
8
12
|
* The root Android directory path
|
|
9
13
|
*/
|
package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAMlB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CA0EP;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAC/C,yCAAyC,CAuC1C,CAAC"}
|
package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withBrownfieldAndroid.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withBrownfieldAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"withBrownfieldAndroid.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withBrownfieldAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,yCAAyC,CA2B1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expoUtils.d.ts","sourceRoot":"","sources":["../../../../../src/expo-config-plugin/expoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU;;;EAS7C"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Modifies the Podfile to include the Brownfield framework target
|
|
3
3
|
* @param podfile The original Podfile content
|
|
4
4
|
* @param frameworkName The name of the framework target to add
|
|
5
|
+
* @param expoMajor The major version of the Expo SDK
|
|
5
6
|
* @returns The modified Podfile content
|
|
6
7
|
*/
|
|
7
|
-
export declare function modifyPodfile(podfile: string, frameworkName: string,
|
|
8
|
+
export declare function modifyPodfile(podfile: string, frameworkName: string, expoMajor: number): string;
|
|
8
9
|
//# sourceMappingURL=podfileHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AA0FA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAgDR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withBrownfieldIos.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withBrownfieldIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"withBrownfieldIos.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withBrownfieldIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAItE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,qCAAqC,CA+DtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { withBrownfieldAndroid } from './withBrownfieldAndroid';
|
|
2
2
|
export { withAndroidModuleFiles, createAndroidModule, } from './withAndroidModuleFiles';
|
|
3
|
-
export { modifyRootBuildGradle, modifySettingsGradle } from './gradleHelpers';
|
|
3
|
+
export { modifyRootBuildGradle, modifySettingsGradle, } from './utils/gradleHelpers';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AACjD,eAAO,MAAM,gCAAgC,sEAA2F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/hermes.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM;;;;EAgFlD"}
|
|
@@ -3,7 +3,11 @@ import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Creates the Android library module directory structure and files
|
|
5
5
|
*/
|
|
6
|
-
export declare function createAndroidModule({ androidDir, config, rnVersion, }: {
|
|
6
|
+
export declare function createAndroidModule({ androidDir, config, rnVersion, isExpoPre55, }: {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the Expo project is pre-55
|
|
9
|
+
*/
|
|
10
|
+
isExpoPre55: boolean;
|
|
7
11
|
/**
|
|
8
12
|
* The root Android directory path
|
|
9
13
|
*/
|
package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAMlB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CA0EP;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAC/C,yCAAyC,CAuC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withBrownfieldAndroid.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withBrownfieldAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"withBrownfieldAndroid.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withBrownfieldAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,yCAAyC,CA2B1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expoUtils.d.ts","sourceRoot":"","sources":["../../../../../src/expo-config-plugin/expoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU;;;EAS7C"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Modifies the Podfile to include the Brownfield framework target
|
|
3
3
|
* @param podfile The original Podfile content
|
|
4
4
|
* @param frameworkName The name of the framework target to add
|
|
5
|
+
* @param expoMajor The major version of the Expo SDK
|
|
5
6
|
* @returns The modified Podfile content
|
|
6
7
|
*/
|
|
7
|
-
export declare function modifyPodfile(podfile: string, frameworkName: string,
|
|
8
|
+
export declare function modifyPodfile(podfile: string, frameworkName: string, expoMajor: number): string;
|
|
8
9
|
//# sourceMappingURL=podfileHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AA0FA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAgDR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withBrownfieldIos.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withBrownfieldIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"withBrownfieldIos.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withBrownfieldIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAItE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,qCAAqC,CA+DtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callstack/react-native-brownfield",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Michal Chudziak <mike.chudziak@callstack.com>",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"dev": "nodemon --ext '*' --watch src --exec \"bob build\"",
|
|
51
51
|
"build:brownfield": "yarn run build",
|
|
52
52
|
"prepack": "cp ../../README.md ./README.md",
|
|
53
|
-
"postpack": "rm ./README.md"
|
|
53
|
+
"postpack": "rm ./README.md",
|
|
54
|
+
"test": "vitest run"
|
|
54
55
|
},
|
|
55
56
|
"keywords": [
|
|
56
57
|
"react-native-brownfield",
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"@expo/config-plugins": "^54.0.4"
|
|
86
87
|
},
|
|
87
88
|
"dependencies": {
|
|
88
|
-
"@callstack/brownfield-cli": "^3.
|
|
89
|
+
"@callstack/brownfield-cli": "^3.4.0"
|
|
89
90
|
},
|
|
90
91
|
"devDependencies": {
|
|
91
92
|
"@babel/core": "^7.25.2",
|
|
@@ -95,14 +96,16 @@
|
|
|
95
96
|
"@react-native/babel-preset": "0.82.1",
|
|
96
97
|
"@types/jest": "^30.0.0",
|
|
97
98
|
"@types/react": "^19.1.1",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
99
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
100
|
+
"eslint": "^9.39.3",
|
|
101
|
+
"globals": "^17.3.0",
|
|
100
102
|
"import": "^0.0.6",
|
|
101
|
-
"nodemon": "^3.1.
|
|
103
|
+
"nodemon": "^3.1.14",
|
|
102
104
|
"react": "19.1.1",
|
|
103
105
|
"react-native": "0.82.1",
|
|
104
|
-
"react-native-builder-bob": "^0.40.
|
|
105
|
-
"typescript": "5.9.3"
|
|
106
|
+
"react-native-builder-bob": "^0.40.18",
|
|
107
|
+
"typescript": "5.9.3",
|
|
108
|
+
"vitest": "^4.1.0"
|
|
106
109
|
},
|
|
107
110
|
"codegenConfig": {
|
|
108
111
|
"name": "ReactNativeBrownfield",
|
|
@@ -3,4 +3,7 @@ export {
|
|
|
3
3
|
withAndroidModuleFiles,
|
|
4
4
|
createAndroidModule,
|
|
5
5
|
} from './withAndroidModuleFiles';
|
|
6
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
modifyRootBuildGradle,
|
|
8
|
+
modifySettingsGradle,
|
|
9
|
+
} from './utils/gradleHelpers';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const BROWNFIELD_PLUGIN_VERSION = '1.0.
|
|
1
|
+
export const BROWNFIELD_PLUGIN_VERSION = '1.0.2';
|
|
2
2
|
export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Logger } from '../../logging';
|
|
2
|
+
|
|
3
|
+
export function getHermesArtifact(rnVersion: string) {
|
|
4
|
+
let [rnMajorVersionString, rnMinorVersionString, rnPatchVersionString] =
|
|
5
|
+
rnVersion.split('.') as [string?, string?, string?];
|
|
6
|
+
|
|
7
|
+
const rnMajorVersion = Number(rnMajorVersionString);
|
|
8
|
+
const rnMinorVersion = Number(rnMinorVersionString);
|
|
9
|
+
|
|
10
|
+
if (
|
|
11
|
+
rnPatchVersionString?.includes('-') ||
|
|
12
|
+
rnPatchVersionString?.includes('+')
|
|
13
|
+
) {
|
|
14
|
+
rnPatchVersionString = rnPatchVersionString.split('-')[0].split('+')[0];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const rnPatchVersion = Number(rnPatchVersionString);
|
|
18
|
+
|
|
19
|
+
if (
|
|
20
|
+
Number.isNaN(rnMajorVersion) ||
|
|
21
|
+
Number.isNaN(rnMinorVersion) ||
|
|
22
|
+
Number.isNaN(rnPatchVersion)
|
|
23
|
+
) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Failed to parse React Native version from '${rnVersion}' - resolved components are: ${rnMajorVersion}.${rnMinorVersion}.${rnPatchVersion}`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (rnMajorVersion !== 0) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Unsupported React Native major version '${rnMajorVersion}' in '${rnVersion}'`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// below: 0.84.x
|
|
36
|
+
if (rnMinorVersion >= 84) {
|
|
37
|
+
return {
|
|
38
|
+
groupId: 'com.facebook.hermes',
|
|
39
|
+
artifactId: 'hermes-android',
|
|
40
|
+
version: '0.15.1',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// below: 0.83.x
|
|
45
|
+
if (rnMinorVersion === 83) {
|
|
46
|
+
let version: string;
|
|
47
|
+
|
|
48
|
+
switch (rnPatchVersion) {
|
|
49
|
+
// below: 0.83.0, 0.83.1
|
|
50
|
+
case 0:
|
|
51
|
+
case 1:
|
|
52
|
+
version = '0.14.0';
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
// below: 0.83.2, 0.83.3, 0.83.4
|
|
56
|
+
case 2:
|
|
57
|
+
case 3:
|
|
58
|
+
case 4:
|
|
59
|
+
version = '0.14.1';
|
|
60
|
+
break;
|
|
61
|
+
|
|
62
|
+
default:
|
|
63
|
+
version = '0.14.1';
|
|
64
|
+
Logger.logWarning(
|
|
65
|
+
`This React Native patch version '${rnVersion}' (in ${rnMajorVersion}.${rnMinorVersion}.${rnPatchVersion}) has not been tested with the Brownfield plugin yet - please consider reporting this on GitHub: https://github.com/callstack/react-native-brownfield/. Using the latest version of Hermes that Brownfield has been tested with (0.14.1).`
|
|
66
|
+
);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
groupId: 'com.facebook.hermes',
|
|
72
|
+
artifactId: 'hermes-android',
|
|
73
|
+
version,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// below: 0.82.x and below
|
|
78
|
+
return {
|
|
79
|
+
groupId: 'com.facebook.react',
|
|
80
|
+
artifactId: 'hermes-android',
|
|
81
|
+
version: rnVersion,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -9,6 +9,8 @@ import type {
|
|
|
9
9
|
} from '../types';
|
|
10
10
|
import { Logger } from '../logging';
|
|
11
11
|
import { renderTemplate } from '../template/engine';
|
|
12
|
+
import { getExpoInfo } from '../expoUtils';
|
|
13
|
+
import { getHermesArtifact } from './utils/hermes';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Creates the Android library module directory structure and files
|
|
@@ -17,7 +19,13 @@ export function createAndroidModule({
|
|
|
17
19
|
androidDir,
|
|
18
20
|
config,
|
|
19
21
|
rnVersion,
|
|
22
|
+
isExpoPre55,
|
|
20
23
|
}: {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the Expo project is pre-55
|
|
26
|
+
*/
|
|
27
|
+
isExpoPre55: boolean;
|
|
28
|
+
|
|
21
29
|
/**
|
|
22
30
|
* The root Android directory path
|
|
23
31
|
*/
|
|
@@ -38,6 +46,11 @@ export function createAndroidModule({
|
|
|
38
46
|
|
|
39
47
|
Logger.logDebug(`Creating Android module in: ${androidDir}`);
|
|
40
48
|
|
|
49
|
+
const hermesArtifact = getHermesArtifact(rnVersion);
|
|
50
|
+
Logger.logDebug(
|
|
51
|
+
`Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`
|
|
52
|
+
);
|
|
53
|
+
|
|
41
54
|
// generate module files
|
|
42
55
|
const files: RenderedTemplateFile[] = [
|
|
43
56
|
{
|
|
@@ -50,6 +63,7 @@ export function createAndroidModule({
|
|
|
50
63
|
'{{ARTIFACT_ID}}': android.artifactId,
|
|
51
64
|
'{{ARTIFACT_VERSION}}': android.version,
|
|
52
65
|
'{{RN_VERSION}}': rnVersion,
|
|
66
|
+
'{{HERMES_ARTIFACT}}': `${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`,
|
|
53
67
|
}),
|
|
54
68
|
},
|
|
55
69
|
{
|
|
@@ -62,9 +76,15 @@ export function createAndroidModule({
|
|
|
62
76
|
},
|
|
63
77
|
{
|
|
64
78
|
relativePath: `src/main/java/${config.android.packageName.replace(/\./g, '/')}/ReactNativeHostManager.kt`,
|
|
65
|
-
content: renderTemplate(
|
|
66
|
-
'
|
|
67
|
-
|
|
79
|
+
content: renderTemplate(
|
|
80
|
+
'android',
|
|
81
|
+
isExpoPre55
|
|
82
|
+
? 'ReactNativeHostManager.pre55.kt'
|
|
83
|
+
: 'ReactNativeHostManager.post55.kt',
|
|
84
|
+
{
|
|
85
|
+
'{{PACKAGE_NAME}}': android.packageName,
|
|
86
|
+
}
|
|
87
|
+
),
|
|
68
88
|
},
|
|
69
89
|
{
|
|
70
90
|
relativePath: 'consumer-rules.pro',
|
|
@@ -127,10 +147,13 @@ export const withAndroidModuleFiles: ConfigPlugin<
|
|
|
127
147
|
);
|
|
128
148
|
}
|
|
129
149
|
|
|
150
|
+
const { isExpoPre55 } = getExpoInfo(config);
|
|
151
|
+
|
|
130
152
|
createAndroidModule({
|
|
131
153
|
androidDir,
|
|
132
154
|
config: props,
|
|
133
155
|
rnVersion,
|
|
156
|
+
isExpoPre55,
|
|
134
157
|
});
|
|
135
158
|
|
|
136
159
|
return dangerousConfig;
|