@xrnjs/app-template 0.0.1
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/$package.json +51 -0
- package/.env +6 -0
- package/.env.prod +6 -0
- package/LICENSE +202 -0
- package/android/app/build.gradle +176 -0
- package/android/app/build_defs.bzl +19 -0
- package/android/app/debug.keystore +0 -0
- package/android/app/proguard-rules.pro +10 -0
- package/android/app/src/debug/AndroidManifest.xml +13 -0
- package/android/app/src/debug/java/com/xrn/template/ReactNativeFlipper.java +73 -0
- package/android/app/src/main/AndroidManifest.xml +46 -0
- package/android/app/src/main/assets/index.main-bundle.bundle +178940 -0
- package/android/app/src/main/assets/index.sub-bundle.bundle +178928 -0
- package/android/app/src/main/assets/xrn-manifest.json +1 -0
- package/android/app/src/main/java/com/xrn/template/MainActivity.kt +52 -0
- package/android/app/src/main/java/com/xrn/template/MainApplication.kt +91 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XBundleInfoHook.kt +9 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XDevSupportParams.kt +6 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XRNHostParams.kt +81 -0
- package/android/app/src/main/java/com/xrn/template/navigation/MainClazzFactory.kt +14 -0
- package/android/app/src/main/java/com/xrn/template/navigation/XBundleActivity.kt +56 -0
- package/android/app/src/main/java/com/xrn/template/navigation/XMainActivity.kt +4 -0
- package/android/app/src/main/java/com/xrn/template/utils/DevEntryUtil.kt +29 -0
- package/android/app/src/main/java/com/xrn/template/utils/LifecycleAwareRunnable.kt +37 -0
- package/android/app/src/main/jni/CMakeLists.txt +7 -0
- package/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -0
- package/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
- package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
- package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
- package/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -0
- package/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
- package/android/app/src/main/jni/OnLoad.cpp +11 -0
- package/android/app/src/main/res/drawable/bg_debug_entry.xml +15 -0
- package/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_alerttriangle.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_chevronleft.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_chevronright.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_close.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnative_libraries_logbox_ui_logboximages_loader.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_elements_src_assets_backiconmask.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_images_fail_icon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_images_success_icon.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_close.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_filter.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_more.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_search.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_devtools_assets_network_share.png +0 -0
- package/android/app/src/main/res/drawable-mdpi/node_modules_xrn_navigation_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_copy_icon.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_app_info.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_app_start_time.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_file.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_fps.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_h5.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_health.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_kadun.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_net.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_qingchu.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_scan.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_self.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_setting.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_view_check.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_view_level.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_doraemon_viewmetrics.png +0 -0
- package/android/app/src/main/res/drawable-xxhdpi/node_modules_xrn_devtools_assets_images_rebackwhiteicon.png +0 -0
- package/android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_elements_src_assets_backicon.png +0 -0
- package/android/app/src/main/res/layout/activity_splash.xml +16 -0
- package/android/app/src/main/res/layout/layout_rn_dev_float.xml +18 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/app/src/main/res/raw/bundle_config.json +23 -0
- package/android/app/src/main/res/raw/launch_screen.json +1 -0
- package/android/app/src/main/res/values/strings.xml +3 -0
- package/android/app/src/main/res/values/styles.xml +9 -0
- package/android/build.gradle +83 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +63 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/settings.gradle +18 -0
- package/harmony/.clang-format +64 -0
- package/harmony/.clang-tidy +1 -0
- package/harmony/.clangd +13 -0
- package/harmony/AppScope/app.json5 +10 -0
- package/harmony/AppScope/resources/base/element/string.json +8 -0
- package/harmony/AppScope/resources/base/media/app_icon.png +0 -0
- package/harmony/XRNTemplate-dev.cer +52 -0
- package/harmony/XRNTemplate-devDebug.p7b +0 -0
- package/harmony/XRNTemplate.p12 +0 -0
- package/harmony/build-profile.json5 +91 -0
- package/harmony/code-linter.json5 +20 -0
- package/harmony/entry/build-profile.json5 +33 -0
- package/harmony/entry/hvigorfile.ts +6 -0
- package/harmony/entry/obfuscation-rules.txt +23 -0
- package/harmony/entry/oh-package-lock.json5 +486 -0
- package/harmony/entry/oh-package.json5 +59 -0
- package/harmony/entry/src/main/cpp/CMakeLists.txt +72 -0
- package/harmony/entry/src/main/cpp/PackageProvider.cpp +51 -0
- package/harmony/entry/src/main/cpp/generated/BundleNavigation.cpp +25 -0
- package/harmony/entry/src/main/cpp/generated/BundleNavigation.h +21 -0
- package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/ImageResizer.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/ImageResizer.h +21 -0
- package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.h +21 -0
- package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.cpp +31 -0
- package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.cpp +28 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.cpp +26 -0
- package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewComponentDescriptor.h +43 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewJSIBinder.h +120 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewModule.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/RNCWebViewModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.cpp +137 -0
- package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.cpp +24 -0
- package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonComponentDescriptor.h +43 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonJSIBinder.h +38 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.cpp +28 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewComponentDescriptor.h +43 -0
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewJSIBinder.h +31 -0
- package/harmony/entry/src/main/cpp/generated/RNLocalize.cpp +31 -0
- package/harmony/entry/src/main/cpp/generated/RNLocalize.h +21 -0
- package/harmony/entry/src/main/cpp/generated/RNOHGeneratedPackage.h +191 -0
- package/harmony/entry/src/main/cpp/generated/RTNCodePush.cpp +48 -0
- package/harmony/entry/src/main/cpp/generated/RTNCodePush.h +21 -0
- package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.cpp +51 -0
- package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNAppUtilsModule.cpp +29 -0
- package/harmony/entry/src/main/cpp/generated/XRNAppUtilsModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNBundleModule.cpp +27 -0
- package/harmony/entry/src/main/cpp/generated/XRNBundleModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNDebugToolsModule.cpp +32 -0
- package/harmony/entry/src/main/cpp/generated/XRNDebugToolsModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNFileModule.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/XRNFileModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNLoadingModule.cpp +25 -0
- package/harmony/entry/src/main/cpp/generated/XRNLoadingModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNMultiBundleModule.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNMultiBundleModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNNativeStorageModule.cpp +26 -0
- package/harmony/entry/src/main/cpp/generated/XRNNativeStorageModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNNavigation.cpp +23 -0
- package/harmony/entry/src/main/cpp/generated/XRNNavigation.h +21 -0
- package/harmony/entry/src/main/cpp/generated/XRNToastModule.cpp +22 -0
- package/harmony/entry/src/main/cpp/generated/XRNToastModule.h +21 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/RNOH/generated/BaseReactNativeOhTplAsyncStoragePackage.h +68 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/RNOH/generated/turbo_modules/RNCAsyncStorage.cpp +26 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/RNOH/generated/turbo_modules/RNCAsyncStorage.h +21 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/ComponentDescriptors.h +22 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/EventEmitters.cpp +18 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/EventEmitters.h +19 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/Props.cpp +21 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/Props.h +20 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/ShadowNodes.cpp +19 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/ShadowNodes.h +25 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/States.cpp +18 -0
- package/harmony/entry/src/main/cpp/generated/_react_native_oh_tpl_async_storage/react/renderer/components/_react_native_oh_tpl_async_storage/States.h +23 -0
- package/harmony/entry/src/main/ets/BundleHelper.ets +198 -0
- package/harmony/entry/src/main/ets/Constants.ets +2 -0
- package/harmony/entry/src/main/ets/MainAbilityStage.ets +60 -0
- package/harmony/entry/src/main/ets/entryability/EntryAbility.ets +57 -0
- package/harmony/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +12 -0
- package/harmony/entry/src/main/ets/lottie/launch_screen.json +1 -0
- package/harmony/entry/src/main/ets/module/devtools/components/FloatBall.ets +359 -0
- package/harmony/entry/src/main/ets/navDestination/BizModuleContainer.ets +8 -0
- package/harmony/entry/src/main/ets/navDestination/MainModuleContainer.ets +8 -0
- package/harmony/entry/src/main/ets/navDestination/Splash.ets +79 -0
- package/harmony/entry/src/main/ets/pages/Index.ets +66 -0
- package/harmony/entry/src/main/module.json5 +68 -0
- package/harmony/entry/src/main/resources/base/element/color.json +12 -0
- package/harmony/entry/src/main/resources/base/element/string.json +19 -0
- package/harmony/entry/src/main/resources/base/media/background.png +0 -0
- package/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
- package/harmony/entry/src/main/resources/base/media/ic_back.png +0 -0
- package/harmony/entry/src/main/resources/base/media/layered_image.json +7 -0
- package/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/harmony/entry/src/main/resources/base/profile/backup_config.json +3 -0
- package/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
- package/harmony/entry/src/main/resources/en_US/element/string.json +16 -0
- package/harmony/entry/src/main/resources/rawfile/bundle_config.json5 +23 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/AntDesign.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Entypo.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/EvilIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Feather.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome5_Brands.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome5_Regular.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome5_Solid.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome6_Brands.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome6_Regular.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/FontAwesome6_Solid.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Fontisto.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Foundation.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Ionicons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/MaterialCommunityIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/MaterialIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Octicons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/SimpleLineIcons.ttf +0 -0
- package/harmony/entry/src/main/resources/rawfile/fonts/Zocial.ttf +0 -0
- package/harmony/entry/src/main/resources/zh_CN/element/string.json +16 -0
- package/harmony/entry/src/mock/mock-config.json5 +2 -0
- package/harmony/entry/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/harmony/entry/src/ohosTest/ets/test/List.test.ets +5 -0
- package/harmony/entry/src/ohosTest/module.json5 +13 -0
- package/harmony/entry/src/test/List.test.ets +5 -0
- package/harmony/entry/src/test/LocalUnit.test.ets +33 -0
- package/harmony/hvigor/hvigor-config.json5 +22 -0
- package/harmony/hvigorfile.ts +6 -0
- package/harmony/material/ac/6a282c38039b44b2949441a85986c35d +1 -0
- package/harmony/material/ce/b2a765b7b925475797f45ae55c8d3ad3 +0 -0
- package/harmony/material/fd/0/9cbed212f275489b874de30a02692f59 +1 -0
- package/harmony/material/fd/1/dc8ea45ef44142d09bca7eeacdc5ecac +1 -0
- package/harmony/material/fd/2/d34888210a5846829d745f65295f90b7 +1 -0
- package/harmony/oh-package-lock.json5 +27 -0
- package/harmony/oh-package.json5 +17 -0
- package/ios/.xcode.env +11 -0
- package/ios/BundleEventCenter/XTBundleProvider.h +17 -0
- package/ios/BundleEventCenter/XTBundleProvider.m +129 -0
- package/ios/BundleEventCenter/XTBundleViewControllerFactory.h +18 -0
- package/ios/BundleEventCenter/XTBundleViewControllerFactory.m +39 -0
- package/ios/BundleEventCenter/bundleController/XTBundleViewController.h +16 -0
- package/ios/BundleEventCenter/bundleController/XTBundleViewController.m +35 -0
- package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.h +16 -0
- package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.m +41 -0
- package/ios/BundleEventCenter/bundleController/xtBundles.plist +14 -0
- package/ios/Podfile +221 -0
- package/ios/Podfile.lock +955 -0
- package/ios/RNDebug/DebugPlugin/XTPluginManage.h +24 -0
- package/ios/RNDebug/DebugPlugin/XTPluginManage.m +93 -0
- package/ios/RNDebug/Views/XTLoadJSErrorTipPanel.swift +231 -0
- package/ios/RNDebug/Views/XTScanQRPlugin.swift +122 -0
- package/ios/RNDebug/Views/XTSuspendBall.h +34 -0
- package/ios/RNDebug/Views/XTSuspendBall.m +357 -0
- package/ios/XRNTemplate/AppDelegate.h +8 -0
- package/ios/XRNTemplate/AppDelegate.mm +168 -0
- package/ios/XRNTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +55 -0
- package/ios/XRNTemplate/Images.xcassets/AppIcon.appiconset/icon120_120@2x.png +0 -0
- package/ios/XRNTemplate/Images.xcassets/AppIcon.appiconset/icon180_180@3x.png +0 -0
- package/ios/XRNTemplate/Images.xcassets/Contents.json +6 -0
- package/ios/XRNTemplate/Images.xcassets/launch_icon.imageset/Contents.json +21 -0
- package/ios/XRNTemplate/Images.xcassets/launch_icon.imageset/launch_icon@2x.png +0 -0
- package/ios/XRNTemplate/Info.plist +82 -0
- package/ios/XRNTemplate/LaunchScreen.storyboard +43 -0
- package/ios/XRNTemplate/main.m +10 -0
- package/ios/XRNTemplate-Bridging-Header.h +29 -0
- package/ios/XRNTemplate.xcodeproj/project.pbxproj +1022 -0
- package/ios/XRNTemplate.xcodeproj/xcshareddata/xcschemes/XRNTemplate.xcscheme +88 -0
- package/ios/XRNTemplate.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/XRNTemplate.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/XRNTemplateTests/Info.plist +24 -0
- package/ios/XRNTemplateTests/XRNTemplateTests.m +66 -0
- package/main-bundle/App.tsx +29 -0
- package/main-bundle/app.json +15 -0
- package/main-bundle/babel.config.js +4 -0
- package/main-bundle/index.ts +3 -0
- package/main-bundle/metro.config.js +21 -0
- package/main-bundle/package.json +35 -0
- package/main-bundle/router.ts +18 -0
- package/main-bundle/tsconfig.json +26 -0
- package/main-bundle/xrn.config.ts +13 -0
- package/main-bundle/yarn.lock +13622 -0
- package/package.json +16 -0
- package/react-native.config.js +36 -0
- package/sub-bundle/App.tsx +23 -0
- package/sub-bundle/app.json +15 -0
- package/sub-bundle/babel.config.js +4 -0
- package/sub-bundle/index.ts +3 -0
- package/sub-bundle/metro.config.js +21 -0
- package/sub-bundle/package.json +36 -0
- package/sub-bundle/router.ts +18 -0
- package/sub-bundle/tsconfig.json +26 -0
- package/sub-bundle/xrn.config.ts +13 -0
- package/sub-bundle/yarn.lock +13652 -0
- package/xrn-react-native-xcode.sh +172 -0
- package/xrn.config.json +46 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"project": {
|
|
3
|
+
"name": "XRNTemplate"
|
|
4
|
+
},
|
|
5
|
+
"defaultOptions": {
|
|
6
|
+
"bundleType": "sub"
|
|
7
|
+
},
|
|
8
|
+
"bundles": [
|
|
9
|
+
{
|
|
10
|
+
"bundleName": "main-bundle",
|
|
11
|
+
"bundlePackageRelativePath": "./main-bundle",
|
|
12
|
+
"bundleType": "main",
|
|
13
|
+
"codePushKey": "0NzkdHaOp6RhCDWjD1G3KogLieV54ksvOXqog",
|
|
14
|
+
"port": 8081
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"bundleName": "sub-bundle",
|
|
18
|
+
"bundlePackageRelativePath": "./sub-bundle",
|
|
19
|
+
"codePushKey": "KpWDtkf7lssWGGhFVlubzRq9gAg74ksvOXqog",
|
|
20
|
+
"port": 6061
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { hilog } from '@kit.PerformanceAnalysisKit';
|
|
2
|
+
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
|
|
3
|
+
|
|
4
|
+
export default function abilityTest() {
|
|
5
|
+
describe('ActsAbilityTest', () => {
|
|
6
|
+
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
|
|
7
|
+
beforeAll(() => {
|
|
8
|
+
// Presets an action, which is performed only once before all test cases of the test suite start.
|
|
9
|
+
// This API supports only one parameter: preset action function.
|
|
10
|
+
})
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
// Presets an action, which is performed before each unit test case starts.
|
|
13
|
+
// The number of execution times is the same as the number of test cases defined by **it**.
|
|
14
|
+
// This API supports only one parameter: preset action function.
|
|
15
|
+
})
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
// Presets a clear action, which is performed after each unit test case ends.
|
|
18
|
+
// The number of execution times is the same as the number of test cases defined by **it**.
|
|
19
|
+
// This API supports only one parameter: clear action function.
|
|
20
|
+
})
|
|
21
|
+
afterAll(() => {
|
|
22
|
+
// Presets a clear action, which is performed after all test cases of the test suite end.
|
|
23
|
+
// This API supports only one parameter: clear action function.
|
|
24
|
+
})
|
|
25
|
+
it('assertContain', 0, () => {
|
|
26
|
+
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
|
|
27
|
+
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
|
|
28
|
+
let a = 'abc';
|
|
29
|
+
let b = 'b';
|
|
30
|
+
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
|
|
31
|
+
expect(a).assertContain(b);
|
|
32
|
+
expect(a).assertEqual(a);
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
|
|
2
|
+
|
|
3
|
+
export default function localUnitTest() {
|
|
4
|
+
describe('localUnitTest', () => {
|
|
5
|
+
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
|
|
6
|
+
beforeAll(() => {
|
|
7
|
+
// Presets an action, which is performed only once before all test cases of the test suite start.
|
|
8
|
+
// This API supports only one parameter: preset action function.
|
|
9
|
+
});
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
// Presets an action, which is performed before each unit test case starts.
|
|
12
|
+
// The number of execution times is the same as the number of test cases defined by **it**.
|
|
13
|
+
// This API supports only one parameter: preset action function.
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
// Presets a clear action, which is performed after each unit test case ends.
|
|
17
|
+
// The number of execution times is the same as the number of test cases defined by **it**.
|
|
18
|
+
// This API supports only one parameter: clear action function.
|
|
19
|
+
});
|
|
20
|
+
afterAll(() => {
|
|
21
|
+
// Presets a clear action, which is performed after all test cases of the test suite end.
|
|
22
|
+
// This API supports only one parameter: clear action function.
|
|
23
|
+
});
|
|
24
|
+
it('assertContain', 0, () => {
|
|
25
|
+
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
|
|
26
|
+
let a = 'abc';
|
|
27
|
+
let b = 'b';
|
|
28
|
+
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
|
|
29
|
+
expect(a).assertContain(b);
|
|
30
|
+
expect(a).assertEqual(a);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelVersion": "5.0.0",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
},
|
|
5
|
+
"execution": {
|
|
6
|
+
// "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */
|
|
7
|
+
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
|
|
8
|
+
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
|
|
9
|
+
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
|
|
10
|
+
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
|
|
11
|
+
},
|
|
12
|
+
"logging": {
|
|
13
|
+
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
|
14
|
+
},
|
|
15
|
+
"debugging": {
|
|
16
|
+
// "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
|
|
17
|
+
},
|
|
18
|
+
"nodeOptions": {
|
|
19
|
+
// "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
|
|
20
|
+
// "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ȑb-p�xӌ�]
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(I�&�:)�`U��{�A
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
��ˀցBҘ"p��o
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$�b�ɬr��"�FB
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"stableOrder": true
|
|
4
|
+
},
|
|
5
|
+
"lockfileVersion": 3,
|
|
6
|
+
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
|
7
|
+
"specifiers": {
|
|
8
|
+
"@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0",
|
|
9
|
+
"@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19"
|
|
10
|
+
},
|
|
11
|
+
"packages": {
|
|
12
|
+
"@ohos/hamock@1.0.0": {
|
|
13
|
+
"name": "@ohos/hamock",
|
|
14
|
+
"version": "1.0.0",
|
|
15
|
+
"integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==",
|
|
16
|
+
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har",
|
|
17
|
+
"registryType": "ohpm"
|
|
18
|
+
},
|
|
19
|
+
"@ohos/hypium@1.0.19": {
|
|
20
|
+
"name": "@ohos/hypium",
|
|
21
|
+
"version": "1.0.19",
|
|
22
|
+
"integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==",
|
|
23
|
+
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har",
|
|
24
|
+
"registryType": "ohpm"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelVersion": "5.0.0",
|
|
3
|
+
"description": "Please describe the basic information.",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
},
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@ohos/hypium": "1.0.19",
|
|
8
|
+
"@ohos/hamock": "1.0.0"
|
|
9
|
+
},
|
|
10
|
+
"overrides": {
|
|
11
|
+
// "@rnoh/react-native-openharmony": "0.72.38",
|
|
12
|
+
"@rnoh/react-native-openharmony": "../node_modules/@react-native-oh/react-native-harmony/react_native_openharmony.har",
|
|
13
|
+
"xrn-multi-bundle": "../node_modules/@xrn/multi-bundle/harmony/xrn_multi_bundle",
|
|
14
|
+
"xrn-navigation": "../node_modules/@xrn/navigation/harmony/xrn_navigation",
|
|
15
|
+
"xrn-code-push": "../node_modules/@xrn/react-native-code-push/harmony/codePush"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/ios/.xcode.env
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This `.xcode.env` file is versioned and is used to source the environment
|
|
2
|
+
# used when running script phases inside Xcode.
|
|
3
|
+
# To customize your local environment, you can create an `.xcode.env.local`
|
|
4
|
+
# file that is not versioned.
|
|
5
|
+
|
|
6
|
+
# NODE_BINARY variable contains the PATH to the node executable.
|
|
7
|
+
#
|
|
8
|
+
# Customize the NODE_BINARY variable here.
|
|
9
|
+
# For example, to use nvm with brew, add the following line
|
|
10
|
+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
|
11
|
+
export NODE_BINARY=$(command -v node)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTBundleProvider.h
|
|
3
|
+
// XRNTemplate
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/6/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <react-native-xrn-multi-bundle/XTMultiBundle.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@interface XTBundleProvider : NSObject<XTBundleProvider>
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTBundleProvider.m
|
|
3
|
+
// XRNTemplate
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/6/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "XTBundleProvider.h"
|
|
9
|
+
#import <CodePush/CodePush.h>
|
|
10
|
+
#import "XTJSBundleModel.h"
|
|
11
|
+
#import "XTJSBundleTool.h"
|
|
12
|
+
#import "RCTBridge+XTExtension.h"
|
|
13
|
+
#import "XRNTemplate-Swift.h"
|
|
14
|
+
#import "XTPluginManage.h"
|
|
15
|
+
|
|
16
|
+
@interface XTBundleProvider ()
|
|
17
|
+
|
|
18
|
+
@property (nonatomic, weak) XTBundleData *bundleData;
|
|
19
|
+
@property (strong, nonatomic) CodePush *codePush;
|
|
20
|
+
@property (strong, nonatomic) NSURL *bizBundleURL;
|
|
21
|
+
|
|
22
|
+
#if DEBUG
|
|
23
|
+
@property (assign, nonatomic) BOOL isDebug;
|
|
24
|
+
#endif
|
|
25
|
+
@end
|
|
26
|
+
|
|
27
|
+
@implementation XTBundleProvider
|
|
28
|
+
|
|
29
|
+
- (instancetype)init {
|
|
30
|
+
self = [super init];
|
|
31
|
+
if (self) {
|
|
32
|
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didLoadJS:) name:RCTJavaScriptDidLoadNotification object:nil];
|
|
33
|
+
}
|
|
34
|
+
return self;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (void)dealloc {
|
|
38
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTJavaScriptDidLoadNotification object:nil];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
- (void)didLoadJS:(NSNotification *)notification {
|
|
43
|
+
if ([notification.object isKindOfClass:RCTBridge.class]) {
|
|
44
|
+
RCTBridge *bridge = (RCTBridge *)notification.object;
|
|
45
|
+
NSString *bizBundleName = self.bundleData.jsBundleName;
|
|
46
|
+
// if ([bridge.xt_jsBundleName isEqualToString:bizBundleName] &&
|
|
47
|
+
// bridge.isLoading) {
|
|
48
|
+
// //NSURL *bizBundleURL = [self.codePush bundleURLForResource:bizBundleName];
|
|
49
|
+
// NSURL *bizBundleURL = self.bizBundleURL;
|
|
50
|
+
// #if DEBUG
|
|
51
|
+
// [bridge loadAndExecuteSplitBundleURL:bizBundleURL onError:^(NSError *error) {
|
|
52
|
+
// NSLog(@"🐯 error---%@", error);
|
|
53
|
+
// [[XTPluginManage shareInstance] pushJSErrorTipPanel:bridge.xt_jsBundleName];
|
|
54
|
+
// } onComplete:^{
|
|
55
|
+
// NSLog(@"🐯 complete---");
|
|
56
|
+
// }];
|
|
57
|
+
// #else
|
|
58
|
+
// NSData *subBundleData = [NSData dataWithContentsOfURL:bizBundleURL];
|
|
59
|
+
// [bridge.batchedBridge executeSourceCode:subBundleData withSourceURL:bizBundleURL sync:NO];
|
|
60
|
+
// #endif
|
|
61
|
+
// }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/// RCTBridge RCTBridgeDelegate
|
|
67
|
+
/// - Parameters:
|
|
68
|
+
/// - bridge: bridge description
|
|
69
|
+
/// - bundleData: bundleData description
|
|
70
|
+
- (NSURL *_Nonnull)sourceURLForBridge:(RCTBridge *_Nonnull)bridge bundleData:(XTBundleData *_Nonnull)bundleData {
|
|
71
|
+
self.bundleData = bundleData;
|
|
72
|
+
|
|
73
|
+
NSString *deploymentKey = bundleData.codePushKey;
|
|
74
|
+
NSString *localCodePsuhKey = [[XTPluginManage shareInstance] getLocalCodePushKey:bundleData.jsBundleName];
|
|
75
|
+
deploymentKey = localCodePsuhKey ?: deploymentKey;
|
|
76
|
+
|
|
77
|
+
#if DEBUG
|
|
78
|
+
deploymentKey = @"";
|
|
79
|
+
#endif
|
|
80
|
+
|
|
81
|
+
self.codePush = [[CodePush alloc] initWithDeploymentKey:deploymentKey];
|
|
82
|
+
|
|
83
|
+
NSURL *bizBundleURL = [self.codePush bundleURLForResource:bundleData.jsBundleName];
|
|
84
|
+
self.bizBundleURL = bizBundleURL;
|
|
85
|
+
#if DEBUG
|
|
86
|
+
self.isDebug = NO;
|
|
87
|
+
NSString *localBundleDebug = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"%@-debug", bundleData.jsBundleName]];
|
|
88
|
+
if (localBundleDebug) {
|
|
89
|
+
self.isDebug = [localBundleDebug boolValue];
|
|
90
|
+
}
|
|
91
|
+
self.isDebug = YES;
|
|
92
|
+
if (self.isDebug) {
|
|
93
|
+
BOOL supportCommon = [bridge.delegate supportCommonBundle];
|
|
94
|
+
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
|
|
95
|
+
NSString *appVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
|
|
96
|
+
NSString *appVersionParam = supportCommon ? [NSString stringWithFormat:@"&appVersion=%@", appVersion] : @"";
|
|
97
|
+
NSString *host = [[XTPluginManage shareInstance] getLocalHost];
|
|
98
|
+
host = @"192.168.68.131";
|
|
99
|
+
NSURL *bundleUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%@/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=XRNTemplate%@", host, bundleData.portNum, appVersionParam]];
|
|
100
|
+
bizBundleURL = bundleUrl;
|
|
101
|
+
self.bizBundleURL = bizBundleURL;
|
|
102
|
+
bridge.bizBundleURL = bizBundleURL;
|
|
103
|
+
return supportCommon ? [[NSBundle mainBundle] URLForResource:[XTJSBundleTool.shared getCommonBundleName] withExtension:@"jsbundle"] : bizBundleURL;
|
|
104
|
+
}
|
|
105
|
+
#endif
|
|
106
|
+
bridge.bizBundleURL = bizBundleURL;
|
|
107
|
+
// return [[NSBundle mainBundle] URLForResource:[XTJSBundleTool.shared getCommonBundleName] withExtension:@"jsbundle"];
|
|
108
|
+
// return [[NSBundle mainBundle] URLForResource:bundleData.jsBundleName withExtension:@"jsbundle"];
|
|
109
|
+
return bizBundleURL;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
- (NSArray<id<RCTBridgeModule>> *_Nonnull)extraModulesForBridge:(RCTBridge *_Nonnull)bridge bundleData:(XTBundleData *_Nonnull)bundleData {
|
|
113
|
+
return @[self.codePush];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
- (BOOL)supportCommonBundleForBundleData:(XTBundleData *_Nonnull)bundleModel {
|
|
117
|
+
// BOOL supportCommon = YES;
|
|
118
|
+
// #if DEBUG
|
|
119
|
+
// if (!self.isDebug) {
|
|
120
|
+
// return YES;
|
|
121
|
+
// }
|
|
122
|
+
// NSString *enbaleCommon = [NSUserDefaults.standardUserDefaults stringForKey:[NSString stringWithFormat:@"%@-supportCommon", bundleModel.jsBundleName]];
|
|
123
|
+
// supportCommon = ![enbaleCommon isEqualToString:@"0"];
|
|
124
|
+
// #endif
|
|
125
|
+
// return supportCommon;
|
|
126
|
+
return NO;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTBundleViewControllerFactory.h
|
|
3
|
+
// XRNTemplate
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/5/7.
|
|
6
|
+
// Copyright © 2025 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "XTBundleViewControllerProtocol.h"
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface XTBundleViewControllerFactory : NSObject<XTBundleViewControllerProtocol>
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTBundleViewControllerFactory.m
|
|
3
|
+
// XRNTemplate
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/5/7.
|
|
6
|
+
// Copyright © 2025 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "XTBundleViewControllerFactory.h"
|
|
10
|
+
#import "XTMainBundleViewController.h"
|
|
11
|
+
#import "XTBundleViewController.h"
|
|
12
|
+
#import "XRNToastView.h"
|
|
13
|
+
#import "JSONUtils.h"
|
|
14
|
+
#import "XTJSBundleTool.h"
|
|
15
|
+
#import "RCTBridge+XTExtension.h"
|
|
16
|
+
|
|
17
|
+
@implementation XTBundleViewControllerFactory
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/// create bundle controller
|
|
21
|
+
/// - Parameters:
|
|
22
|
+
/// - isMain: isMain description
|
|
23
|
+
/// - bridge: bridge description
|
|
24
|
+
/// - moduleName: moduleName description
|
|
25
|
+
/// - initialProperties: initialProperties description
|
|
26
|
+
- (UIViewController<XTViewControllerProtocol> *)createViewControllerWithIsMain:(BOOL)isMain bridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties {
|
|
27
|
+
if (isMain) {
|
|
28
|
+
return [[XTMainBundleViewController alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
|
29
|
+
} else {
|
|
30
|
+
return [[XTBundleViewController alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- (void)bundleNotFoundWith:(nonnull NSString *)bundleName moduleName:(nonnull NSString *)moduleName initialProperties:(nullable NSDictionary *)initialProperties {
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTBundleViewController.h
|
|
3
|
+
// xrngo
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/6/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "XTBaseBundleViewController.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface XTBundleViewController : XTBaseBundleViewController
|
|
13
|
+
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTBundleViewController.m
|
|
3
|
+
// xrngo
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/6/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "XTBundleViewController.h"
|
|
9
|
+
#import <React/RCTRootView.h>
|
|
10
|
+
|
|
11
|
+
@interface XTBundleViewController ()
|
|
12
|
+
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
@implementation XTBundleViewController
|
|
16
|
+
|
|
17
|
+
- (void)loadView {
|
|
18
|
+
[super loadView];
|
|
19
|
+
|
|
20
|
+
NSMutableDictionary *mutInitialProps = [NSMutableDictionary dictionaryWithDictionary:self.initialProperties ?: @{}];
|
|
21
|
+
[mutInitialProps setObject:self.moduleName ?: @"" forKey:@"moduleName"];
|
|
22
|
+
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:self.bridge
|
|
23
|
+
moduleName:self.moduleName
|
|
24
|
+
initialProperties:mutInitialProps];
|
|
25
|
+
rootView.backgroundColor = UIColor.whiteColor;
|
|
26
|
+
self.view = rootView;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (void)viewDidLoad {
|
|
30
|
+
[super viewDidLoad];
|
|
31
|
+
// Do any additional setup after loading the view.
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTMainBundleViewController.h
|
|
3
|
+
// xrngo
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/6/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "XTBaseBundleViewController.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface XTMainBundleViewController : XTBaseBundleViewController
|
|
13
|
+
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// XTMainBundleViewController.m
|
|
3
|
+
// xrngo
|
|
4
|
+
//
|
|
5
|
+
// Created by xtgq on 2025/6/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "XTMainBundleViewController.h"
|
|
9
|
+
#import <React/RCTRootView.h>
|
|
10
|
+
|
|
11
|
+
@interface XTMainBundleViewController ()
|
|
12
|
+
|
|
13
|
+
@end
|
|
14
|
+
|
|
15
|
+
@implementation XTMainBundleViewController
|
|
16
|
+
|
|
17
|
+
- (void)viewDidLoad {
|
|
18
|
+
[super viewDidLoad];
|
|
19
|
+
// Do any additional setup after loading the view.
|
|
20
|
+
|
|
21
|
+
[self loadMainView];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (void)loadMainView {
|
|
25
|
+
NSMutableDictionary *mutInitialProps = [NSMutableDictionary dictionaryWithDictionary:self.initialProperties];
|
|
26
|
+
[mutInitialProps setObject:self.moduleName ?: @"" forKey:@"moduleName"];
|
|
27
|
+
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:self.bridge
|
|
28
|
+
moduleName:self.moduleName
|
|
29
|
+
initialProperties:mutInitialProps];
|
|
30
|
+
rootView.backgroundColor = [UIColor whiteColor];
|
|
31
|
+
rootView.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height);
|
|
32
|
+
self.view = rootView;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (BOOL)concurrentRootEnabled
|
|
36
|
+
{
|
|
37
|
+
// Switch this bool to turn on and off the concurrent root
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<array>
|
|
5
|
+
<dict>
|
|
6
|
+
<key>port</key>
|
|
7
|
+
<string>6061</string>
|
|
8
|
+
<key>jsBundleName</key>
|
|
9
|
+
<string>sub-bundle</string>
|
|
10
|
+
<key>codePushKey</key>
|
|
11
|
+
<string>3pnCxHlgP89xjIo9K1GoyHkU0HAZ4ksvOXqog</string>
|
|
12
|
+
</dict>
|
|
13
|
+
</array>
|
|
14
|
+
</plist>
|