expo-targets 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/android/build.gradle +4 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsActivityHolder.kt +37 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsExtensionModule.kt +59 -8
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsHarnessActivity.kt +28 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsReactTargetActivity.kt +123 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsSharedIntent.kt +89 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsTargetActivity.kt +363 -0
- package/android/src/main/java/expo/modules/targets/liveActivity/ExpoTargetsLiveActivityModule.kt +153 -0
- package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationModule.kt +134 -0
- package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationRouter.kt +192 -0
- package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationService.kt +92 -0
- package/android/src/main/java/expo/modules/targets/storage/ExpoTargetsStorageModule.kt +127 -42
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsAutofillService.kt +28 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsCallScreeningService.kt +47 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsDocumentsProvider.kt +148 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsFileProviderUiActivity.kt +47 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsInputMethodService.kt +41 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsPrintService.kt +34 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsVpnService.kt +32 -0
- package/android/src/main/res/layout/expo_targets_notification_content.xml +29 -0
- package/android/src/main/res/xml/expo_targets_autofill_service.xml +3 -0
- package/android/src/main/res/xml/expo_targets_method.xml +9 -0
- package/android/src/main/res/xml/expo_targets_print_service.xml +4 -0
- package/build/metro/src/withTargets.d.ts.map +1 -1
- package/build/metro/src/withTargets.js +37 -11
- package/build/metro/src/withTargets.js.map +1 -1
- package/build/plugin/src/android/activationMime.d.ts +12 -0
- package/build/plugin/src/android/activationMime.d.ts.map +1 -0
- package/build/plugin/src/android/activationMime.js +47 -0
- package/build/plugin/src/android/activationMime.js.map +1 -0
- package/build/plugin/src/android/resolveUserClass.d.ts +14 -0
- package/build/plugin/src/android/resolveUserClass.d.ts.map +1 -0
- package/build/plugin/src/android/resolveUserClass.js +48 -0
- package/build/plugin/src/android/resolveUserClass.js.map +1 -0
- package/build/plugin/src/android/targetSourceSets.d.ts +9 -0
- package/build/plugin/src/android/targetSourceSets.d.ts.map +1 -0
- package/build/plugin/src/android/targetSourceSets.js +90 -0
- package/build/plugin/src/android/targetSourceSets.js.map +1 -0
- package/build/plugin/src/android/withAndroidNotification.d.ts +12 -0
- package/build/plugin/src/android/withAndroidNotification.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidNotification.js +192 -0
- package/build/plugin/src/android/withAndroidNotification.js.map +1 -0
- package/build/plugin/src/android/withAndroidShareAction.d.ts +11 -0
- package/build/plugin/src/android/withAndroidShareAction.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidShareAction.js +172 -0
- package/build/plugin/src/android/withAndroidShareAction.js.map +1 -0
- package/build/plugin/src/android/withAndroidSystemService.d.ts +12 -0
- package/build/plugin/src/android/withAndroidSystemService.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidSystemService.js +332 -0
- package/build/plugin/src/android/withAndroidSystemService.js.map +1 -0
- package/build/plugin/src/android/withAndroidTarget.d.ts +2 -1
- package/build/plugin/src/android/withAndroidTarget.d.ts.map +1 -1
- package/build/plugin/src/android/withAndroidTarget.js +25 -3
- package/build/plugin/src/android/withAndroidTarget.js.map +1 -1
- package/build/plugin/src/android/withAndroidTargetsConfig.d.ts +9 -0
- package/build/plugin/src/android/withAndroidTargetsConfig.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidTargetsConfig.js +52 -0
- package/build/plugin/src/android/withAndroidTargetsConfig.js.map +1 -0
- package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts +3 -0
- package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts.map +1 -1
- package/build/plugin/src/codegen/collectRuntimeConfigs.js.map +1 -1
- package/build/plugin/src/codegen/index.d.ts +1 -1
- package/build/plugin/src/codegen/index.d.ts.map +1 -1
- package/build/plugin/src/codegen/index.js +2 -1
- package/build/plugin/src/codegen/index.js.map +1 -1
- package/build/plugin/src/codegen/typedTargets.d.ts +11 -1
- package/build/plugin/src/codegen/typedTargets.d.ts.map +1 -1
- package/build/plugin/src/codegen/typedTargets.js +102 -12
- package/build/plugin/src/codegen/typedTargets.js.map +1 -1
- package/build/plugin/src/config.d.ts +37 -6
- package/build/plugin/src/config.d.ts.map +1 -1
- package/build/plugin/src/config.js.map +1 -1
- package/build/plugin/src/domain/characteristics.d.ts +8 -0
- package/build/plugin/src/domain/characteristics.d.ts.map +1 -1
- package/build/plugin/src/domain/characteristics.js +81 -10
- package/build/plugin/src/domain/characteristics.js.map +1 -1
- package/build/plugin/src/domain/index.d.ts +1 -1
- package/build/plugin/src/domain/index.d.ts.map +1 -1
- package/build/plugin/src/domain/index.js.map +1 -1
- package/build/plugin/src/ios/apply/podfile/podfile.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/podfile/podfile.js +21 -4
- package/build/plugin/src/ios/apply/podfile/podfile.js.map +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.d.ts +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.d.ts.map +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.js +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.js.map +1 -1
- package/build/plugin/src/ios/plan/swiftSources.d.ts.map +1 -1
- package/build/plugin/src/ios/plan/swiftSources.js +10 -0
- package/build/plugin/src/ios/plan/swiftSources.js.map +1 -1
- package/build/plugin/src/ios/plan/types.d.ts +6 -0
- package/build/plugin/src/ios/plan/types.d.ts.map +1 -1
- package/build/plugin/src/ios/utils/reactNativeSwift.d.ts +3 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.d.ts.map +1 -1
- package/build/plugin/src/ios/utils/reactNativeSwift.js +3 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.js.map +1 -1
- package/build/plugin/src/resolveExcludedPackages.d.ts +15 -0
- package/build/plugin/src/resolveExcludedPackages.d.ts.map +1 -0
- package/build/plugin/src/resolveExcludedPackages.js +30 -0
- package/build/plugin/src/resolveExcludedPackages.js.map +1 -0
- package/build/plugin/src/withTargetsDir.d.ts +5 -0
- package/build/plugin/src/withTargetsDir.d.ts.map +1 -1
- package/build/plugin/src/withTargetsDir.js +114 -47
- package/build/plugin/src/withTargetsDir.js.map +1 -1
- package/build/src/Target.d.ts +11 -6
- package/build/src/Target.d.ts.map +1 -1
- package/build/src/Target.js +4 -1
- package/build/src/Target.js.map +1 -1
- package/build/src/generatedNames.d.ts +23 -0
- package/build/src/generatedNames.d.ts.map +1 -0
- package/build/src/generatedNames.js +3 -0
- package/build/src/generatedNames.js.map +1 -0
- package/build/src/index.d.ts +8 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +43 -17
- package/build/src/index.js.map +1 -1
- package/build/src/modules/extension/index.d.ts +1 -0
- package/build/src/modules/extension/index.d.ts.map +1 -1
- package/build/src/modules/extension/index.js +9 -5
- package/build/src/modules/extension/index.js.map +1 -1
- package/build/src/modules/extensionBundle/ExtensionUpdates.d.ts +72 -0
- package/build/src/modules/extensionBundle/ExtensionUpdates.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/ExtensionUpdates.js +165 -0
- package/build/src/modules/extensionBundle/ExtensionUpdates.js.map +1 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.d.ts +33 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.js +87 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.js.map +1 -0
- package/build/src/modules/extensionBundle/constants.d.ts +21 -0
- package/build/src/modules/extensionBundle/constants.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/constants.js +30 -0
- package/build/src/modules/extensionBundle/constants.js.map +1 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.d.ts +42 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.js +114 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.js.map +1 -0
- package/build/src/modules/extensionBundle/fsInstall.d.ts +50 -0
- package/build/src/modules/extensionBundle/fsInstall.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/fsInstall.js +180 -0
- package/build/src/modules/extensionBundle/fsInstall.js.map +1 -0
- package/build/src/modules/extensionBundle/nativeInstall.d.ts +12 -0
- package/build/src/modules/extensionBundle/nativeInstall.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/nativeInstall.js +33 -0
- package/build/src/modules/extensionBundle/nativeInstall.js.map +1 -0
- package/build/src/modules/liveActivity/index.d.ts +13 -6
- package/build/src/modules/liveActivity/index.d.ts.map +1 -1
- package/build/src/modules/liveActivity/index.js +2 -2
- package/build/src/modules/liveActivity/index.js.map +1 -1
- package/build/src/modules/notification/index.d.ts +21 -0
- package/build/src/modules/notification/index.d.ts.map +1 -0
- package/build/src/modules/notification/index.js +32 -0
- package/build/src/modules/notification/index.js.map +1 -0
- package/build/src/modules/storage/index.d.ts +2 -0
- package/build/src/modules/storage/index.d.ts.map +1 -1
- package/build/src/modules/storage/index.js +11 -1
- package/build/src/modules/storage/index.js.map +1 -1
- package/cli/build/checks/easCredentials.d.ts +5 -0
- package/cli/build/checks/easCredentials.d.ts.map +1 -0
- package/cli/build/checks/easCredentials.js +150 -0
- package/cli/build/checks/easCredentials.js.map +1 -0
- package/cli/build/checks/heavyExclusions.d.ts +5 -0
- package/cli/build/checks/heavyExclusions.d.ts.map +1 -0
- package/cli/build/checks/heavyExclusions.js +186 -0
- package/cli/build/checks/heavyExclusions.js.map +1 -0
- package/cli/build/checks/nameSync.d.ts.map +1 -1
- package/cli/build/checks/nameSync.js +31 -2
- package/cli/build/checks/nameSync.js.map +1 -1
- package/cli/build/checks/plugin.js +1 -1
- package/cli/build/checks/plugin.js.map +1 -1
- package/cli/build/checks/updateScript.d.ts +7 -0
- package/cli/build/checks/updateScript.d.ts.map +1 -0
- package/cli/build/checks/updateScript.js +91 -0
- package/cli/build/checks/updateScript.js.map +1 -0
- package/cli/build/doctor.d.ts.map +1 -1
- package/cli/build/doctor.js +11 -1
- package/cli/build/doctor.js.map +1 -1
- package/cli/build/exportExtensionBundles.d.ts +21 -0
- package/cli/build/exportExtensionBundles.d.ts.map +1 -0
- package/cli/build/exportExtensionBundles.js +193 -0
- package/cli/build/exportExtensionBundles.js.map +1 -0
- package/cli/build/extensionBundle/constants.d.ts +21 -0
- package/cli/build/extensionBundle/constants.d.ts.map +1 -0
- package/cli/build/extensionBundle/constants.js +30 -0
- package/cli/build/extensionBundle/constants.js.map +1 -0
- package/cli/build/extensionBundle/fsInstall.d.ts +50 -0
- package/cli/build/extensionBundle/fsInstall.d.ts.map +1 -0
- package/cli/build/extensionBundle/fsInstall.js +180 -0
- package/cli/build/extensionBundle/fsInstall.js.map +1 -0
- package/cli/build/extensionBundle/hermesExport.d.ts +37 -0
- package/cli/build/extensionBundle/hermesExport.d.ts.map +1 -0
- package/cli/build/extensionBundle/hermesExport.js +112 -0
- package/cli/build/extensionBundle/hermesExport.js.map +1 -0
- package/cli/build/generate.d.ts.map +1 -1
- package/cli/build/generate.js +7 -1
- package/cli/build/generate.js.map +1 -1
- package/cli/build/index.js +53 -3
- package/cli/build/index.js.map +1 -1
- package/cli/build/scaffold/copyTemplate.d.ts +15 -0
- package/cli/build/scaffold/copyTemplate.d.ts.map +1 -0
- package/cli/build/scaffold/copyTemplate.js +109 -0
- package/cli/build/scaffold/copyTemplate.js.map +1 -0
- package/cli/build/scaffold/expoConfigIO.d.ts +15 -0
- package/cli/build/scaffold/expoConfigIO.d.ts.map +1 -0
- package/cli/build/scaffold/expoConfigIO.js +104 -0
- package/cli/build/scaffold/expoConfigIO.js.map +1 -0
- package/cli/build/scaffold/generateConfig.d.ts +13 -0
- package/cli/build/scaffold/generateConfig.d.ts.map +1 -0
- package/cli/build/scaffold/generateConfig.js +169 -0
- package/cli/build/scaffold/generateConfig.js.map +1 -0
- package/cli/build/scaffold/index.d.ts +3 -0
- package/cli/build/scaffold/index.d.ts.map +1 -0
- package/cli/build/scaffold/index.js +8 -0
- package/cli/build/scaffold/index.js.map +1 -0
- package/cli/build/scaffold/prompts.d.ts +3 -0
- package/cli/build/scaffold/prompts.d.ts.map +1 -0
- package/cli/build/scaffold/prompts.js +92 -0
- package/cli/build/scaffold/prompts.js.map +1 -0
- package/cli/build/scaffold/reactNativeTemplate.d.ts +3 -0
- package/cli/build/scaffold/reactNativeTemplate.d.ts.map +1 -0
- package/cli/build/scaffold/reactNativeTemplate.js +56 -0
- package/cli/build/scaffold/reactNativeTemplate.js.map +1 -0
- package/cli/build/scaffold/resolveAndroidPackage.d.ts +5 -0
- package/cli/build/scaffold/resolveAndroidPackage.d.ts.map +1 -0
- package/cli/build/scaffold/resolveAndroidPackage.js +42 -0
- package/cli/build/scaffold/resolveAndroidPackage.js.map +1 -0
- package/cli/build/scaffold/resolveAppGroup.d.ts +6 -0
- package/cli/build/scaffold/resolveAppGroup.d.ts.map +1 -0
- package/cli/build/scaffold/resolveAppGroup.js +68 -0
- package/cli/build/scaffold/resolveAppGroup.js.map +1 -0
- package/cli/build/scaffold/scaffoldTarget.d.ts +14 -0
- package/cli/build/scaffold/scaffoldTarget.d.ts.map +1 -0
- package/cli/build/scaffold/scaffoldTarget.js +267 -0
- package/cli/build/scaffold/scaffoldTarget.js.map +1 -0
- package/cli/build/scaffold/templates/android.d.ts +33 -0
- package/cli/build/scaffold/templates/android.d.ts.map +1 -0
- package/cli/build/scaffold/templates/android.js +117 -0
- package/cli/build/scaffold/templates/android.js.map +1 -0
- package/cli/build/scaffold/templates/ios.d.ts +20 -0
- package/cli/build/scaffold/templates/ios.d.ts.map +1 -0
- package/cli/build/scaffold/templates/ios.js +505 -0
- package/cli/build/scaffold/templates/ios.js.map +1 -0
- package/cli/build/scaffold/templates/liveActivity.d.ts +11 -0
- package/cli/build/scaffold/templates/liveActivity.d.ts.map +1 -0
- package/cli/build/scaffold/templates/liveActivity.js +71 -0
- package/cli/build/scaffold/templates/liveActivity.js.map +1 -0
- package/cli/build/scaffold/utils.d.ts +3 -0
- package/cli/build/scaffold/utils.d.ts.map +1 -0
- package/cli/build/scaffold/utils.js +15 -0
- package/cli/build/scaffold/utils.js.map +1 -0
- package/cli/build/scaffold/wireExpoConfig.d.ts +12 -0
- package/cli/build/scaffold/wireExpoConfig.d.ts.map +1 -0
- package/cli/build/scaffold/wireExpoConfig.js +49 -0
- package/cli/build/scaffold/wireExpoConfig.js.map +1 -0
- package/cli/build/scaffold/wireHost.d.ts +21 -0
- package/cli/build/scaffold/wireHost.d.ts.map +1 -0
- package/cli/build/scaffold/wireHost.js +89 -0
- package/cli/build/scaffold/wireHost.js.map +1 -0
- package/cli/build/scaffold/wireMetro.d.ts +11 -0
- package/cli/build/scaffold/wireMetro.d.ts.map +1 -0
- package/cli/build/scaffold/wireMetro.js +64 -0
- package/cli/build/scaffold/wireMetro.js.map +1 -0
- package/cli/build/scaffold/wirePackageJson.d.ts +2 -0
- package/cli/build/scaffold/wirePackageJson.d.ts.map +1 -0
- package/cli/build/scaffold/wirePackageJson.js +24 -0
- package/cli/build/scaffold/wirePackageJson.js.map +1 -0
- package/cli/build/types.d.ts +1 -0
- package/cli/build/types.d.ts.map +1 -1
- package/expo-module.config.json +4 -1
- package/ios/ExpoTargetsExtensionBundleModule.swift +172 -0
- package/ios/ExpoTargetsMessagesModule.swift +4 -3
- package/ios/ExpoTargetsStorage.podspec +1 -0
- package/ios/ExpoTargetsStorageModule.swift +13 -0
- package/metro/build/withTargets.d.ts.map +1 -1
- package/metro/build/withTargets.js +37 -11
- package/metro/build/withTargets.js.map +1 -1
- package/package.json +5 -1
- package/plugin/build/android/activationMime.d.ts +12 -0
- package/plugin/build/android/activationMime.d.ts.map +1 -0
- package/plugin/build/android/activationMime.js +47 -0
- package/plugin/build/android/activationMime.js.map +1 -0
- package/plugin/build/android/resolveUserClass.d.ts +14 -0
- package/plugin/build/android/resolveUserClass.d.ts.map +1 -0
- package/plugin/build/android/resolveUserClass.js +48 -0
- package/plugin/build/android/resolveUserClass.js.map +1 -0
- package/plugin/build/android/targetSourceSets.d.ts +9 -0
- package/plugin/build/android/targetSourceSets.d.ts.map +1 -0
- package/plugin/build/android/targetSourceSets.js +90 -0
- package/plugin/build/android/targetSourceSets.js.map +1 -0
- package/plugin/build/android/withAndroidNotification.d.ts +12 -0
- package/plugin/build/android/withAndroidNotification.d.ts.map +1 -0
- package/plugin/build/android/withAndroidNotification.js +192 -0
- package/plugin/build/android/withAndroidNotification.js.map +1 -0
- package/plugin/build/android/withAndroidShareAction.d.ts +11 -0
- package/plugin/build/android/withAndroidShareAction.d.ts.map +1 -0
- package/plugin/build/android/withAndroidShareAction.js +172 -0
- package/plugin/build/android/withAndroidShareAction.js.map +1 -0
- package/plugin/build/android/withAndroidSystemService.d.ts +12 -0
- package/plugin/build/android/withAndroidSystemService.d.ts.map +1 -0
- package/plugin/build/android/withAndroidSystemService.js +332 -0
- package/plugin/build/android/withAndroidSystemService.js.map +1 -0
- package/plugin/build/android/withAndroidTarget.d.ts +2 -1
- package/plugin/build/android/withAndroidTarget.d.ts.map +1 -1
- package/plugin/build/android/withAndroidTarget.js +25 -3
- package/plugin/build/android/withAndroidTarget.js.map +1 -1
- package/plugin/build/android/withAndroidTargetsConfig.d.ts +9 -0
- package/plugin/build/android/withAndroidTargetsConfig.d.ts.map +1 -0
- package/plugin/build/android/withAndroidTargetsConfig.js +52 -0
- package/plugin/build/android/withAndroidTargetsConfig.js.map +1 -0
- package/plugin/build/codegen/collectRuntimeConfigs.d.ts +3 -0
- package/plugin/build/codegen/collectRuntimeConfigs.d.ts.map +1 -1
- package/plugin/build/codegen/collectRuntimeConfigs.js.map +1 -1
- package/plugin/build/codegen/index.d.ts +1 -1
- package/plugin/build/codegen/index.d.ts.map +1 -1
- package/plugin/build/codegen/index.js +2 -1
- package/plugin/build/codegen/index.js.map +1 -1
- package/plugin/build/codegen/typedTargets.d.ts +11 -1
- package/plugin/build/codegen/typedTargets.d.ts.map +1 -1
- package/plugin/build/codegen/typedTargets.js +102 -12
- package/plugin/build/codegen/typedTargets.js.map +1 -1
- package/plugin/build/config.d.ts +37 -6
- package/plugin/build/config.d.ts.map +1 -1
- package/plugin/build/config.js.map +1 -1
- package/plugin/build/domain/characteristics.d.ts +8 -0
- package/plugin/build/domain/characteristics.d.ts.map +1 -1
- package/plugin/build/domain/characteristics.js +81 -10
- package/plugin/build/domain/characteristics.js.map +1 -1
- package/plugin/build/domain/index.d.ts +1 -1
- package/plugin/build/domain/index.d.ts.map +1 -1
- package/plugin/build/domain/index.js.map +1 -1
- package/plugin/build/ios/apply/podfile/podfile.d.ts.map +1 -1
- package/plugin/build/ios/apply/podfile/podfile.js +21 -4
- package/plugin/build/ios/apply/podfile/podfile.js.map +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.d.ts +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.d.ts.map +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.js +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.js.map +1 -1
- package/plugin/build/ios/plan/swiftSources.d.ts.map +1 -1
- package/plugin/build/ios/plan/swiftSources.js +10 -0
- package/plugin/build/ios/plan/swiftSources.js.map +1 -1
- package/plugin/build/ios/plan/types.d.ts +6 -0
- package/plugin/build/ios/plan/types.d.ts.map +1 -1
- package/plugin/build/ios/templates/ReactNativeViewController.swift +45 -7
- package/plugin/build/ios/utils/reactNativeSwift.d.ts +3 -0
- package/plugin/build/ios/utils/reactNativeSwift.d.ts.map +1 -1
- package/plugin/build/ios/utils/reactNativeSwift.js +3 -0
- package/plugin/build/ios/utils/reactNativeSwift.js.map +1 -1
- package/plugin/build/resolveExcludedPackages.d.ts +15 -0
- package/plugin/build/resolveExcludedPackages.d.ts.map +1 -0
- package/plugin/build/resolveExcludedPackages.js +30 -0
- package/plugin/build/resolveExcludedPackages.js.map +1 -0
- package/plugin/build/withTargetsDir.d.ts +5 -0
- package/plugin/build/withTargetsDir.d.ts.map +1 -1
- package/plugin/build/withTargetsDir.js +114 -47
- package/plugin/build/withTargetsDir.js.map +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatAppGroupSnippet = exports.wireExpoConfig = void 0;
|
|
4
|
+
const expoConfigIO_1 = require("./expoConfigIO");
|
|
5
|
+
const PLUGIN_SNIPPET = `Add to your app config plugins array:
|
|
6
|
+
"plugins": ["expo-targets"]`;
|
|
7
|
+
const APP_GROUP_SNIPPET = `Add App Groups to ios.entitlements in your app config:
|
|
8
|
+
"ios": {
|
|
9
|
+
"entitlements": {
|
|
10
|
+
"com.apple.security.application-groups": ["group.<bundleIdentifier>"]
|
|
11
|
+
}
|
|
12
|
+
}`;
|
|
13
|
+
function inventAppGroup(bundleId) {
|
|
14
|
+
return `group.${bundleId}`;
|
|
15
|
+
}
|
|
16
|
+
function wireExpoConfig(projectRoot) {
|
|
17
|
+
if ((0, expoConfigIO_1.hasJsExpoConfig)(projectRoot)) {
|
|
18
|
+
return {
|
|
19
|
+
ok: false,
|
|
20
|
+
reason: 'js-config',
|
|
21
|
+
snippet: `${PLUGIN_SNIPPET}\n\n${APP_GROUP_SNIPPET}`,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const jsonConfig = (0, expoConfigIO_1.findJsonExpoConfig)(projectRoot);
|
|
25
|
+
if (!jsonConfig) {
|
|
26
|
+
return {
|
|
27
|
+
ok: false,
|
|
28
|
+
reason: 'js-config',
|
|
29
|
+
snippet: `Create app.json with expo.plugins and ios.entitlements.\n\n${PLUGIN_SNIPPET}\n\n${APP_GROUP_SNIPPET}`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const { path: configPath, expo } = jsonConfig;
|
|
33
|
+
const pluginAdded = (0, expoConfigIO_1.ensurePluginOnExpo)(expo);
|
|
34
|
+
let appGroupAdded = false;
|
|
35
|
+
const bundleId = (0, expoConfigIO_1.readBundleIdentifier)(expo);
|
|
36
|
+
if (bundleId) {
|
|
37
|
+
appGroupAdded = (0, expoConfigIO_1.ensureAppGroupOnExpo)(expo, inventAppGroup(bundleId));
|
|
38
|
+
}
|
|
39
|
+
if (pluginAdded || appGroupAdded) {
|
|
40
|
+
(0, expoConfigIO_1.writeJsonExpoConfig)(configPath, expo);
|
|
41
|
+
}
|
|
42
|
+
return { ok: true, pluginAdded, appGroupAdded };
|
|
43
|
+
}
|
|
44
|
+
exports.wireExpoConfig = wireExpoConfig;
|
|
45
|
+
function formatAppGroupSnippet(bundleId) {
|
|
46
|
+
return ` "${expoConfigIO_1.APP_GROUP_ENTITLEMENT_KEY}": ["group.${bundleId}"]`;
|
|
47
|
+
}
|
|
48
|
+
exports.formatAppGroupSnippet = formatAppGroupSnippet;
|
|
49
|
+
//# sourceMappingURL=wireExpoConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireExpoConfig.js","sourceRoot":"","sources":["../../src/scaffold/wireExpoConfig.ts"],"names":[],"mappings":";;;AAAA,iDAQwB;AAExB,MAAM,cAAc,GAAG;8BACO,CAAC;AAE/B,MAAM,iBAAiB,GAAG;;;;;IAKtB,CAAC;AAML,SAAS,cAAc,CAAC,QAAgB;IACt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HostResult {
|
|
2
|
+
dependencyAdded: boolean;
|
|
3
|
+
expo: {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
pluginAdded?: boolean;
|
|
6
|
+
appGroupAdded?: boolean;
|
|
7
|
+
snippet?: string;
|
|
8
|
+
};
|
|
9
|
+
metro: {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
created?: boolean;
|
|
12
|
+
patched?: boolean;
|
|
13
|
+
snippet?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function wireHost(projectRoot: string): WireHostResult;
|
|
17
|
+
/** Hard-fail only when Metro cannot be wired (app.config.js/ts is soft-fail). */
|
|
18
|
+
export declare function wireHostFailed(result: WireHostResult): boolean;
|
|
19
|
+
export declare function printWireFailures(result: WireHostResult): void;
|
|
20
|
+
export declare function printWireSuccess(targetName: string, result: WireHostResult): void;
|
|
21
|
+
//# sourceMappingURL=wireHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireHost.d.ts","sourceRoot":"","sources":["../../src/scaffold/wireHost.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,IAAI,EAAE;QACJ,EAAE,EAAE,OAAO,CAAC;QACZ,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,KAAK,EAAE;QACL,EAAE,EAAE,OAAO,CAAC;QACZ,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,wBAAgB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAsB5D;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAE9D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAe9D;AA+BD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,GACrB,IAAI,CAUN"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printWireSuccess = exports.printWireFailures = exports.wireHostFailed = exports.wireHost = void 0;
|
|
4
|
+
const wireExpoConfig_1 = require("./wireExpoConfig");
|
|
5
|
+
const wireMetro_1 = require("./wireMetro");
|
|
6
|
+
const wirePackageJson_1 = require("./wirePackageJson");
|
|
7
|
+
function wireHost(projectRoot) {
|
|
8
|
+
const dependencyAdded = (0, wirePackageJson_1.ensureExpoTargetsDependency)(projectRoot);
|
|
9
|
+
const expoResult = (0, wireExpoConfig_1.wireExpoConfig)(projectRoot);
|
|
10
|
+
const metroResult = (0, wireMetro_1.wireMetroConfig)(projectRoot);
|
|
11
|
+
return {
|
|
12
|
+
dependencyAdded,
|
|
13
|
+
expo: expoResult.ok
|
|
14
|
+
? {
|
|
15
|
+
ok: true,
|
|
16
|
+
pluginAdded: expoResult.pluginAdded,
|
|
17
|
+
appGroupAdded: expoResult.appGroupAdded,
|
|
18
|
+
}
|
|
19
|
+
: { ok: false, snippet: expoResult.snippet },
|
|
20
|
+
metro: metroResult.ok
|
|
21
|
+
? {
|
|
22
|
+
ok: true,
|
|
23
|
+
created: metroResult.created,
|
|
24
|
+
patched: metroResult.patched,
|
|
25
|
+
}
|
|
26
|
+
: { ok: false, snippet: metroResult.snippet },
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.wireHost = wireHost;
|
|
30
|
+
/** Hard-fail only when Metro cannot be wired (app.config.js/ts is soft-fail). */
|
|
31
|
+
function wireHostFailed(result) {
|
|
32
|
+
return !result.metro.ok;
|
|
33
|
+
}
|
|
34
|
+
exports.wireHostFailed = wireHostFailed;
|
|
35
|
+
function printWireFailures(result) {
|
|
36
|
+
if (!result.expo.ok && result.expo.snippet) {
|
|
37
|
+
console.warn('\n⚠ Could not auto-patch app config (dynamic app.config.js/ts or missing JSON).');
|
|
38
|
+
console.warn('Add the plugin and App Groups manually:\n');
|
|
39
|
+
console.warn(result.expo.snippet);
|
|
40
|
+
console.warn('\nThen run: npx expo-targets doctor');
|
|
41
|
+
}
|
|
42
|
+
if (!result.metro.ok) {
|
|
43
|
+
console.error('\n✗ Could not wire metro.config.js');
|
|
44
|
+
if (result.metro.snippet) {
|
|
45
|
+
console.error(result.metro.snippet);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.printWireFailures = printWireFailures;
|
|
50
|
+
function wireBulletLines(result) {
|
|
51
|
+
return [
|
|
52
|
+
result.dependencyAdded
|
|
53
|
+
? 'Added expo-targets to package.json — run install to fetch it'
|
|
54
|
+
: null,
|
|
55
|
+
result.expo.ok && result.expo.pluginAdded
|
|
56
|
+
? 'Added expo-targets plugin to app config'
|
|
57
|
+
: null,
|
|
58
|
+
result.expo.ok && result.expo.appGroupAdded
|
|
59
|
+
? 'Added App Group entitlements to app config'
|
|
60
|
+
: null,
|
|
61
|
+
result.expo.ok
|
|
62
|
+
? null
|
|
63
|
+
: 'Skipped app config auto-patch (see warning above) — doctor will gate',
|
|
64
|
+
result.metro.ok && result.metro.created
|
|
65
|
+
? 'Created metro.config.js with withTargets'
|
|
66
|
+
: null,
|
|
67
|
+
result.metro.ok && result.metro.patched
|
|
68
|
+
? 'Patched metro.config.js to use withTargets'
|
|
69
|
+
: null,
|
|
70
|
+
].filter((line) => Boolean(line));
|
|
71
|
+
}
|
|
72
|
+
function logWireBullets(result) {
|
|
73
|
+
for (const line of wireBulletLines(result)) {
|
|
74
|
+
console.log(` • ${line}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function printWireSuccess(targetName, result) {
|
|
78
|
+
console.log(`\n✓ Created target: targets/${targetName}/`);
|
|
79
|
+
logWireBullets(result);
|
|
80
|
+
console.log('\nNext steps:');
|
|
81
|
+
if (result.dependencyAdded) {
|
|
82
|
+
console.log(' 1. Install dependencies (npm install / bun install / yarn)');
|
|
83
|
+
}
|
|
84
|
+
console.log(' 2. npx expo-targets doctor');
|
|
85
|
+
console.log(' 3. npx expo prebuild');
|
|
86
|
+
console.log(' 4. npx expo run:ios');
|
|
87
|
+
}
|
|
88
|
+
exports.printWireSuccess = printWireSuccess;
|
|
89
|
+
//# sourceMappingURL=wireHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireHost.js","sourceRoot":"","sources":["../../src/scaffold/wireHost.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAClD,2CAA8C;AAC9C,uDAAgE;AAkBhE,SAAgB,QAAQ,CAAC,WAAmB;IAC1C,MAAM,eAAe,GAAG,IAAA,6CAA2B,EAAC,WAAW,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,IAAA,+BAAc,EAAC,WAAW,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,IAAA,2BAAe,EAAC,WAAW,CAAC,CAAC;IAEjD,OAAO;QACL,eAAe;QACf,IAAI,EAAE,UAAU,CAAC,EAAE;YACjB,CAAC,CAAC;gBACE,EAAE,EAAE,IAAI;gBACR,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,aAAa,EAAE,UAAU,CAAC,aAAa;aACxC;YACH,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE;QAC9C,KAAK,EAAE,WAAW,CAAC,EAAE;YACnB,CAAC,CAAC;gBACE,EAAE,EAAE,IAAI;gBACR,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,OAAO,EAAE,WAAW,CAAC,OAAO;aAC7B;YACH,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE;KAChD,CAAC;AAC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|
9
|
+
};
|
|
10
|
+
export declare function wireMetroConfig(projectRoot: string): MetroWireResult;
|
|
11
|
+
//# sourceMappingURL=wireMetro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireMetro.d.ts","sourceRoot":"","sources":["../../src/scaffold/wireMetro.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,eAAe,GACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAClD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AA0CrD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAyBpE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.wireMetroConfig = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const METRO_SNIPPET = `const { getDefaultConfig } = require('expo/metro-config');
|
|
10
|
+
const { withTargets } = require('expo-targets/metro');
|
|
11
|
+
|
|
12
|
+
module.exports = withTargets(getDefaultConfig(__dirname));
|
|
13
|
+
`;
|
|
14
|
+
const METRO_REQUIRE = `const { withTargets } = require('expo-targets/metro');`;
|
|
15
|
+
function alreadyWrapped(content) {
|
|
16
|
+
return (content.includes('withTargets') || content.includes('withTargetsMetro'));
|
|
17
|
+
}
|
|
18
|
+
function patchDirectExport(content) {
|
|
19
|
+
const direct = /module\.exports\s*=\s*getDefaultConfig\(\s*__dirname\s*\)/;
|
|
20
|
+
if (!direct.test(content)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (!content.includes(METRO_REQUIRE)) {
|
|
24
|
+
content = content.replace(/const\s*\{\s*getDefaultConfig\s*\}\s*=\s*require\(\s*['"]expo\/metro-config['"]\s*\);?/, `$&\n${METRO_REQUIRE}`);
|
|
25
|
+
}
|
|
26
|
+
return content.replace(direct, 'module.exports = withTargets(getDefaultConfig(__dirname))');
|
|
27
|
+
}
|
|
28
|
+
function patchConfigExport(content) {
|
|
29
|
+
const exportConfig = /module\.exports\s*=\s*config\s*;?/;
|
|
30
|
+
if (!exportConfig.test(content)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (!content.includes('getDefaultConfig')) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (!content.includes(METRO_REQUIRE)) {
|
|
37
|
+
content = content.replace(/const\s*\{\s*getDefaultConfig\s*\}\s*=\s*require\(\s*['"]expo\/metro-config['"]\s*\);?/, `$&\n${METRO_REQUIRE}`);
|
|
38
|
+
}
|
|
39
|
+
return content.replace(exportConfig, 'module.exports = withTargets(config);');
|
|
40
|
+
}
|
|
41
|
+
function wireMetroConfig(projectRoot) {
|
|
42
|
+
const metroPath = node_path_1.default.join(projectRoot, 'metro.config.js');
|
|
43
|
+
if (!fs_extra_1.default.existsSync(metroPath)) {
|
|
44
|
+
fs_extra_1.default.writeFileSync(metroPath, METRO_SNIPPET);
|
|
45
|
+
return { ok: true, created: true };
|
|
46
|
+
}
|
|
47
|
+
const content = fs_extra_1.default.readFileSync(metroPath, 'utf8');
|
|
48
|
+
if (alreadyWrapped(content)) {
|
|
49
|
+
return { ok: true };
|
|
50
|
+
}
|
|
51
|
+
const directPatched = patchDirectExport(content);
|
|
52
|
+
if (directPatched) {
|
|
53
|
+
fs_extra_1.default.writeFileSync(metroPath, directPatched);
|
|
54
|
+
return { ok: true, patched: true };
|
|
55
|
+
}
|
|
56
|
+
const configPatched = patchConfigExport(content);
|
|
57
|
+
if (configPatched) {
|
|
58
|
+
fs_extra_1.default.writeFileSync(metroPath, configPatched);
|
|
59
|
+
return { ok: true, patched: true };
|
|
60
|
+
}
|
|
61
|
+
return { ok: false, reason: 'exotic', snippet: METRO_SNIPPET };
|
|
62
|
+
}
|
|
63
|
+
exports.wireMetroConfig = wireMetroConfig;
|
|
64
|
+
//# sourceMappingURL=wireMetro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireMetro.js","sourceRoot":"","sources":["../../src/scaffold/wireMetro.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,wDAA0B;AAE1B,MAAM,aAAa,GAAG;;;;CAIrB,CAAC;AAEF,MAAM,aAAa,GAAG,wDAAwD,CAAC;AAM/E,SAAS,cAAc,CAAC,OAAe;IACrC,OAAO,CACL,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CACxE,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,MAAM,GAAG,2DAA2D,CAAC;IAC3E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CACvB,wFAAwF,EACxF,OAAO,aAAa,EAAE,CACvB,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CACpB,MAAM,EACN,2DAA2D,CAC5D,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,YAAY,GAAG,mCAAmC,CAAC;IACzD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAC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AAC,CAAC;QAC3C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AACjE,CAAC;AAzBD,0CAyBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirePackageJson.d.ts","sourceRoot":"","sources":["../../src/scaffold/wirePackageJson.ts"],"names":[],"mappings":"AAGA,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAmBxE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ensureExpoTargetsDependency = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
function ensureExpoTargetsDependency(projectRoot) {
|
|
10
|
+
const pkgPath = node_path_1.default.join(projectRoot, 'package.json');
|
|
11
|
+
if (!fs_extra_1.default.existsSync(pkgPath)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const pkg = JSON.parse(fs_extra_1.default.readFileSync(pkgPath, 'utf8'));
|
|
15
|
+
const deps = pkg.dependencies ?? {};
|
|
16
|
+
if (deps['expo-targets']) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
pkg.dependencies = { ...deps, 'expo-targets': '*' };
|
|
20
|
+
fs_extra_1.default.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
exports.ensureExpoTargetsDependency = ensureExpoTargetsDependency;
|
|
24
|
+
//# sourceMappingURL=wirePackageJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirePackageJson.js","sourceRoot":"","sources":["../../src/scaffold/wirePackageJson.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,wDAA0B;AAE1B,SAAgB,2BAA2B,CAAC,WAAmB;IAC7D,MAAM,OAAO,GAAG,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACvD,IAAI,CAAC,kBAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAGtD,CAAC;IAEF,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;IACpC,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,GAAG,CAAC,YAAY,GAAG,EAAE,GAAG,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;IACpD,kBAAE,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC;AAnBD,kEAmBC"}
|
package/cli/build/types.d.ts
CHANGED
package/cli/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAA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
"ExpoTargetsStorageModule",
|
|
6
|
+
"ExpoTargetsExtensionBundleModule",
|
|
6
7
|
"ExpoTargetsExtensionModule",
|
|
7
8
|
"ExpoTargetsMessagesModule",
|
|
8
9
|
"ExpoTargetsFileProviderModule",
|
|
@@ -14,7 +15,9 @@
|
|
|
14
15
|
"modules": [
|
|
15
16
|
"expo.modules.targets.storage.ExpoTargetsStorageModule",
|
|
16
17
|
"expo.modules.targets.extension.ExpoTargetsExtensionModule",
|
|
17
|
-
"expo.modules.targets.messages.ExpoTargetsMessagesModule"
|
|
18
|
+
"expo.modules.targets.messages.ExpoTargetsMessagesModule",
|
|
19
|
+
"expo.modules.targets.notification.ExpoTargetsNotificationModule",
|
|
20
|
+
"expo.modules.targets.liveActivity.ExpoTargetsLiveActivityModule"
|
|
18
21
|
]
|
|
19
22
|
}
|
|
20
23
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import CryptoKit
|
|
2
|
+
import ExpoModulesCore
|
|
3
|
+
import Foundation
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
Host-only: atomically install a sideloaded extension `main.jsbundle` into the
|
|
7
|
+
App Group container for Release appex load. Mirrors Node `fsInstall` layout:
|
|
8
|
+
`{container}/expo-targets/bundles/{targetName}/{main.jsbundle,manifest.json}`.
|
|
9
|
+
*/
|
|
10
|
+
public class ExpoTargetsExtensionBundleModule: Module {
|
|
11
|
+
private static let errorDomain = "ExpoTargetsExtensionBundle"
|
|
12
|
+
|
|
13
|
+
private static let maxBytesByType: [String: Int] = [
|
|
14
|
+
"share": 5 * 1024 * 1024,
|
|
15
|
+
"action": 5 * 1024 * 1024,
|
|
16
|
+
"messages": 5 * 1024 * 1024,
|
|
17
|
+
"notification-content": 5 * 1024 * 1024,
|
|
18
|
+
"clip": 8 * 1024 * 1024,
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
private func fail(_ message: String, code: Int = 1) -> NSError {
|
|
22
|
+
NSError(
|
|
23
|
+
domain: Self.errorDomain,
|
|
24
|
+
code: code,
|
|
25
|
+
userInfo: [NSLocalizedDescriptionKey: message]
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private func maxBytes(for type: String) throws -> Int {
|
|
30
|
+
guard let max = Self.maxBytesByType[type] else {
|
|
31
|
+
throw fail(
|
|
32
|
+
"No sideload size cap for extension type \"\(type)\". Supported: \(Self.maxBytesByType.keys.sorted().joined(separator: ", "))"
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
return max
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private func containerURL(appGroup: String) throws -> URL {
|
|
39
|
+
guard
|
|
40
|
+
let url = FileManager.default.containerURL(
|
|
41
|
+
forSecurityApplicationGroupIdentifier: appGroup
|
|
42
|
+
)
|
|
43
|
+
else {
|
|
44
|
+
throw fail(
|
|
45
|
+
"App Group container unavailable for \"\(appGroup)\". Check entitlements."
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
return url
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private func normalizeLocalPath(_ localPath: String) -> String {
|
|
52
|
+
if localPath.hasPrefix("file://"),
|
|
53
|
+
let url = URL(string: localPath),
|
|
54
|
+
url.isFileURL
|
|
55
|
+
{
|
|
56
|
+
return url.path
|
|
57
|
+
}
|
|
58
|
+
// JS may already have stripped file:// but left percent-encoding
|
|
59
|
+
// (e.g. Application%20Support).
|
|
60
|
+
if let decoded = localPath.removingPercentEncoding {
|
|
61
|
+
return decoded
|
|
62
|
+
}
|
|
63
|
+
return localPath
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private func sha256Hex(_ data: Data) -> String {
|
|
67
|
+
SHA256.hash(data: data).map { String(format: "%02x", $0) }.joined()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private func bundleDir(container: URL, targetName: String) -> URL {
|
|
71
|
+
container
|
|
72
|
+
.appendingPathComponent("expo-targets", isDirectory: true)
|
|
73
|
+
.appendingPathComponent("bundles", isDirectory: true)
|
|
74
|
+
.appendingPathComponent(targetName, isDirectory: true)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public func definition() -> ModuleDefinition {
|
|
78
|
+
Name("ExpoTargetsExtensionBundle")
|
|
79
|
+
|
|
80
|
+
AsyncFunction("install") {
|
|
81
|
+
(
|
|
82
|
+
appGroup: String,
|
|
83
|
+
targetName: String,
|
|
84
|
+
type: String,
|
|
85
|
+
runtimeVersion: String,
|
|
86
|
+
localPath: String
|
|
87
|
+
) -> [String: Any] in
|
|
88
|
+
if runtimeVersion.isEmpty {
|
|
89
|
+
throw self.fail(
|
|
90
|
+
"runtimeVersion is required to install an extension bundle (fail closed)"
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let max = try self.maxBytes(for: type)
|
|
95
|
+
let sourcePath = self.normalizeLocalPath(localPath)
|
|
96
|
+
let sourceURL = URL(fileURLWithPath: sourcePath)
|
|
97
|
+
guard FileManager.default.fileExists(atPath: sourceURL.path) else {
|
|
98
|
+
throw self.fail("Extension bundle not found: \(sourcePath)")
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let attrs = try FileManager.default.attributesOfItem(atPath: sourceURL.path)
|
|
102
|
+
let byteLength = (attrs[.size] as? NSNumber)?.intValue ?? 0
|
|
103
|
+
if byteLength > max {
|
|
104
|
+
throw self.fail(
|
|
105
|
+
"Extension bundle for \"\(targetName)\" is \(byteLength) bytes; max for type \"\(type)\" is \(max)"
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let data = try Data(contentsOf: sourceURL)
|
|
110
|
+
let sha256 = self.sha256Hex(data)
|
|
111
|
+
let container = try self.containerURL(appGroup: appGroup)
|
|
112
|
+
let destDir = self.bundleDir(container: container, targetName: targetName)
|
|
113
|
+
let tmpDir = URL(
|
|
114
|
+
fileURLWithPath:
|
|
115
|
+
destDir.path + ".tmp-\(ProcessInfo.processInfo.processIdentifier)"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
let fm = FileManager.default
|
|
119
|
+
try? fm.removeItem(at: tmpDir)
|
|
120
|
+
try fm.createDirectory(at: tmpDir, withIntermediateDirectories: true)
|
|
121
|
+
|
|
122
|
+
let destBundle = tmpDir.appendingPathComponent("main.jsbundle")
|
|
123
|
+
try data.write(to: destBundle, options: .atomic)
|
|
124
|
+
|
|
125
|
+
let installedAt = ISO8601DateFormatter().string(from: Date())
|
|
126
|
+
let manifest: [String: Any] = [
|
|
127
|
+
"byteLength": byteLength,
|
|
128
|
+
"sha256": sha256,
|
|
129
|
+
"installedAt": installedAt,
|
|
130
|
+
"runtimeVersion": runtimeVersion,
|
|
131
|
+
"targetName": targetName,
|
|
132
|
+
"type": type,
|
|
133
|
+
]
|
|
134
|
+
let manifestData = try JSONSerialization.data(
|
|
135
|
+
withJSONObject: manifest,
|
|
136
|
+
options: [.prettyPrinted, .sortedKeys]
|
|
137
|
+
)
|
|
138
|
+
try manifestData.write(
|
|
139
|
+
to: tmpDir.appendingPathComponent("manifest.json"),
|
|
140
|
+
options: .atomic
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
try? fm.removeItem(at: destDir)
|
|
144
|
+
try fm.createDirectory(
|
|
145
|
+
at: destDir.deletingLastPathComponent(),
|
|
146
|
+
withIntermediateDirectories: true
|
|
147
|
+
)
|
|
148
|
+
try fm.moveItem(at: tmpDir, to: destDir)
|
|
149
|
+
|
|
150
|
+
return manifest
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
Function("clear") { (appGroup: String, targetName: String) in
|
|
154
|
+
let container = try self.containerURL(appGroup: appGroup)
|
|
155
|
+
let destDir = self.bundleDir(container: container, targetName: targetName)
|
|
156
|
+
try? FileManager.default.removeItem(at: destDir)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
Function("getInfo") { (appGroup: String, targetName: String) -> [String: Any]? in
|
|
160
|
+
let container = try self.containerURL(appGroup: appGroup)
|
|
161
|
+
let manifestURL = self.bundleDir(container: container, targetName: targetName)
|
|
162
|
+
.appendingPathComponent("manifest.json")
|
|
163
|
+
guard FileManager.default.fileExists(atPath: manifestURL.path),
|
|
164
|
+
let data = try? Data(contentsOf: manifestURL),
|
|
165
|
+
let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any]
|
|
166
|
+
else {
|
|
167
|
+
return nil
|
|
168
|
+
}
|
|
169
|
+
return json
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -2,7 +2,7 @@ import ExpoModulesCore
|
|
|
2
2
|
import Messages
|
|
3
3
|
import UIKit
|
|
4
4
|
|
|
5
|
-
public class ExpoTargetsMessagesModule: Module {
|
|
5
|
+
public class ExpoTargetsMessagesModule: Module, @unchecked Sendable {
|
|
6
6
|
private var notificationObserver: NSObjectProtocol?
|
|
7
7
|
|
|
8
8
|
deinit {
|
|
@@ -158,8 +158,9 @@ public class ExpoTargetsMessagesModule: Module {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
return try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Bool, Error>) in
|
|
161
|
-
DispatchQueue.main.async {
|
|
162
|
-
guard let
|
|
161
|
+
DispatchQueue.main.async { [weak self] in
|
|
162
|
+
guard let self,
|
|
163
|
+
let msViewController = self.findMessagesViewController(),
|
|
163
164
|
let conversation = msViewController.activeConversation else {
|
|
164
165
|
continuation.resume(returning: false)
|
|
165
166
|
return
|
|
@@ -21,6 +21,7 @@ Pod::Spec.new do |s|
|
|
|
21
21
|
# or Live Activity bridge registration and the JS module resolve to different copies.
|
|
22
22
|
s.source_files = [
|
|
23
23
|
'ExpoTargetsStorageModule.swift',
|
|
24
|
+
'ExpoTargetsExtensionBundleModule.swift',
|
|
24
25
|
'ExpoTargetsFileProviderModule.swift',
|
|
25
26
|
'ExpoTargetsContentBlockerModule.swift',
|
|
26
27
|
'ExpoTargetsLiveActivityModule.swift',
|
|
@@ -120,5 +120,18 @@ public class ExpoTargetsStorageModule: Module {
|
|
|
120
120
|
}
|
|
121
121
|
return config
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
/// Host vs appex: ExtensionBundle ships in this pod and is linked into RN
|
|
125
|
+
/// extensions — callers must not treat its presence as "running on host".
|
|
126
|
+
Function("isAppExtension") { () -> Bool in
|
|
127
|
+
if Bundle.main.bundlePath.hasSuffix(".appex") {
|
|
128
|
+
return true
|
|
129
|
+
}
|
|
130
|
+
// Share/action/etc. use package type "XPC!"; host apps use "APPL".
|
|
131
|
+
if let package = Bundle.main.object(forInfoDictionaryKey: "CFBundlePackageType") as? String {
|
|
132
|
+
return package == "XPC!"
|
|
133
|
+
}
|
|
134
|
+
return false
|
|
135
|
+
}
|
|
123
136
|
}
|
|
124
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTargets.d.ts","sourceRoot":"","sources":["../src/withTargets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAiDD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAoCpE;
|
|
1
|
+
{"version":3,"file":"withTargets.d.ts","sourceRoot":"","sources":["../src/withTargets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAiDD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAoCpE;AAyED,wBAAgB,WAAW,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACnD,WAAW,CA4Bb;AAID,6CAA6C;AAC7C,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACnD,WAAW,CAQb"}
|
|
@@ -101,6 +101,35 @@ function logScanSummary(entryMap, warnings) {
|
|
|
101
101
|
const noun = roots.length === 1 ? 'y' : 'ies';
|
|
102
102
|
console.log(`[expo-targets/metro] Resolved ${roots.length} RN extension entr${noun}`);
|
|
103
103
|
}
|
|
104
|
+
function resolveExtensionBundleAssets(projectRoot) {
|
|
105
|
+
const extensionAssets = path.join(projectRoot, 'assets', 'expo-targets', 'extensionBundleModules.js');
|
|
106
|
+
const stubAssets = path.join(projectRoot, '.expo', 'expo-targets-extension-bundle-assets.js');
|
|
107
|
+
if (fs.existsSync(extensionAssets)) {
|
|
108
|
+
return { type: 'sourceFile', filePath: extensionAssets };
|
|
109
|
+
}
|
|
110
|
+
fs.mkdirSync(path.dirname(stubAssets), { recursive: true });
|
|
111
|
+
if (!fs.existsSync(stubAssets)) {
|
|
112
|
+
fs.writeFileSync(stubAssets, 'module.exports = {};\n');
|
|
113
|
+
}
|
|
114
|
+
return { type: 'sourceFile', filePath: stubAssets };
|
|
115
|
+
}
|
|
116
|
+
function createTargetsResolveRequest(projectRoot, entryMap, previousResolveRequest) {
|
|
117
|
+
return (context, moduleName, platform) => {
|
|
118
|
+
if (moduleName === 'expo-targets/extension-bundle-assets' ||
|
|
119
|
+
moduleName === 'expo-targets/extension-bundle-assets.js') {
|
|
120
|
+
return resolveExtensionBundleAssets(projectRoot);
|
|
121
|
+
}
|
|
122
|
+
const entryKey = moduleName.replace(/^\.\//, '');
|
|
123
|
+
const entryPath = entryMap.get(entryKey);
|
|
124
|
+
if (entryPath) {
|
|
125
|
+
return { type: 'sourceFile', filePath: entryPath };
|
|
126
|
+
}
|
|
127
|
+
if (previousResolveRequest) {
|
|
128
|
+
return previousResolveRequest(context, moduleName, platform);
|
|
129
|
+
}
|
|
130
|
+
return context.resolveRequest(context, moduleName, platform);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
104
133
|
function withTargets(metroConfig, options) {
|
|
105
134
|
const projectRoot = options?.projectRoot || node_process_1.default.cwd();
|
|
106
135
|
const { entryMap, warnings } = scanTargetsDirectory(projectRoot);
|
|
@@ -108,21 +137,18 @@ function withTargets(metroConfig, options) {
|
|
|
108
137
|
logScanSummary(entryMap, warnings);
|
|
109
138
|
}
|
|
110
139
|
const previousResolveRequest = metroConfig.resolver?.resolveRequest;
|
|
140
|
+
const assetExts = metroConfig.resolver?.assetExts
|
|
141
|
+
? [...metroConfig.resolver.assetExts]
|
|
142
|
+
: undefined;
|
|
143
|
+
if (assetExts && !assetExts.includes('jsbundle')) {
|
|
144
|
+
assetExts.push('jsbundle');
|
|
145
|
+
}
|
|
111
146
|
return {
|
|
112
147
|
...metroConfig,
|
|
113
148
|
resolver: {
|
|
114
149
|
...metroConfig.resolver,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const entryPath = entryMap.get(normalized);
|
|
118
|
-
if (entryPath) {
|
|
119
|
-
return { type: 'sourceFile', filePath: entryPath };
|
|
120
|
-
}
|
|
121
|
-
if (previousResolveRequest) {
|
|
122
|
-
return previousResolveRequest(context, moduleName, platform);
|
|
123
|
-
}
|
|
124
|
-
return context.resolveRequest(context, moduleName, platform);
|
|
125
|
-
},
|
|
150
|
+
...(assetExts ? { assetExts } : {}),
|
|
151
|
+
resolveRequest: createTargetsResolveRequest(projectRoot, entryMap, previousResolveRequest),
|
|
126
152
|
},
|
|
127
153
|
};
|
|
128
154
|
}
|