@use-voltra/ios-client 1.4.1 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -0
- package/Voltra.podspec +28 -0
- package/build/commonjs/VoltraModule.js +13 -0
- package/build/commonjs/VoltraModule.js.map +1 -0
- package/build/commonjs/components/VoltraLiveActivityPreview.js +30 -0
- package/build/commonjs/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/commonjs/components/VoltraView.js +50 -0
- package/build/commonjs/components/VoltraView.js.map +1 -0
- package/build/commonjs/components/VoltraWidgetPreview.js +58 -0
- package/build/commonjs/components/VoltraWidgetPreview.js.map +1 -0
- package/build/commonjs/events.js +32 -0
- package/build/commonjs/events.js.map +1 -0
- package/build/commonjs/helpers.js +26 -0
- package/build/commonjs/helpers.js.map +1 -0
- package/build/commonjs/index.js +226 -0
- package/build/commonjs/index.js.map +1 -0
- package/build/commonjs/live-activity/api.js +168 -0
- package/build/commonjs/live-activity/api.js.map +1 -0
- package/build/commonjs/logger.js +39 -0
- package/build/commonjs/logger.js.map +1 -0
- package/build/commonjs/native/NativeVoltra.js +15 -0
- package/build/commonjs/native/NativeVoltra.js.map +1 -0
- package/build/commonjs/native/VoltraRNNativeComponent.ts +9 -0
- package/build/commonjs/package.json +1 -0
- package/build/commonjs/preload.js +54 -0
- package/build/commonjs/preload.js.map +1 -0
- package/build/commonjs/types.js +2 -0
- package/build/commonjs/types.js.map +1 -0
- package/build/commonjs/utils/assertRunningOnApple.js +16 -0
- package/build/commonjs/utils/assertRunningOnApple.js.map +1 -0
- package/build/commonjs/utils/helpers.js +19 -0
- package/build/commonjs/utils/helpers.js.map +1 -0
- package/build/commonjs/utils/index.js +28 -0
- package/build/commonjs/utils/index.js.map +1 -0
- package/build/commonjs/utils/useUpdateOnHMR.js +25 -0
- package/build/commonjs/utils/useUpdateOnHMR.js.map +1 -0
- package/build/commonjs/widgets/server-credentials.js +18 -0
- package/build/commonjs/widgets/server-credentials.js.map +1 -0
- package/build/commonjs/widgets/widget-api.js +55 -0
- package/build/commonjs/widgets/widget-api.js.map +1 -0
- package/build/module/VoltraModule.js +4 -0
- package/build/module/VoltraModule.js.map +1 -0
- package/build/module/components/VoltraLiveActivityPreview.js +25 -0
- package/build/module/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/module/components/VoltraView.js +44 -0
- package/build/module/components/VoltraView.js.map +1 -0
- package/build/module/components/VoltraWidgetPreview.js +53 -0
- package/build/module/components/VoltraWidgetPreview.js.map +1 -0
- package/build/module/events.js +28 -0
- package/build/module/events.js.map +1 -0
- package/build/module/helpers.js +21 -0
- package/build/module/helpers.js.map +1 -0
- package/build/module/index.js +17 -0
- package/build/module/index.js.map +1 -0
- package/build/module/live-activity/api.js +158 -0
- package/build/module/live-activity/api.js.map +1 -0
- package/build/module/logger.js +35 -0
- package/build/module/logger.js.map +1 -0
- package/build/module/native/NativeVoltra.js +11 -0
- package/build/module/native/NativeVoltra.js.map +1 -0
- package/build/module/native/VoltraRNNativeComponent.ts +9 -0
- package/build/module/package.json +1 -0
- package/build/module/preload.js +48 -0
- package/build/module/preload.js.map +1 -0
- package/build/module/types.js +2 -0
- package/build/module/types.js.map +1 -0
- package/build/module/utils/assertRunningOnApple.js +11 -0
- package/build/module/utils/assertRunningOnApple.js.map +1 -0
- package/build/module/utils/helpers.js +4 -0
- package/build/module/utils/helpers.js.map +1 -0
- package/build/module/utils/index.js +5 -0
- package/build/module/utils/index.js.map +1 -0
- package/build/module/utils/useUpdateOnHMR.js +20 -0
- package/build/module/utils/useUpdateOnHMR.js.map +1 -0
- package/build/module/widgets/server-credentials.js +13 -0
- package/build/module/widgets/server-credentials.js.map +1 -0
- package/build/module/widgets/widget-api.js +45 -0
- package/build/module/widgets/widget-api.js.map +1 -0
- package/build/typescript/commonjs/VoltraModule.d.ts +3 -0
- package/build/typescript/commonjs/VoltraModule.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraView.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/typescript/commonjs/events.d.ts.map +1 -0
- package/build/typescript/commonjs/helpers.d.ts.map +1 -0
- package/build/{types → typescript/commonjs}/index.d.ts +5 -0
- package/build/typescript/commonjs/index.d.ts.map +1 -0
- package/build/typescript/commonjs/live-activity/api.d.ts.map +1 -0
- package/build/typescript/commonjs/logger.d.ts.map +1 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts +100 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts.map +1 -0
- package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts +8 -0
- package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts.map +1 -0
- package/build/typescript/commonjs/package.json +1 -0
- package/build/typescript/commonjs/preload.d.ts.map +1 -0
- package/build/typescript/commonjs/types.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/helpers.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/index.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/typescript/commonjs/widgets/server-credentials.d.ts.map +1 -0
- package/build/typescript/commonjs/widgets/widget-api.d.ts.map +1 -0
- package/build/typescript/module/VoltraModule.d.ts +3 -0
- package/build/typescript/module/VoltraModule.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts +7 -0
- package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraView.d.ts +12 -0
- package/build/typescript/module/components/VoltraView.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraWidgetPreview.d.ts +9 -0
- package/build/typescript/module/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/typescript/module/events.d.ts +33 -0
- package/build/typescript/module/events.d.ts.map +1 -0
- package/build/typescript/module/helpers.d.ts +3 -0
- package/build/typescript/module/helpers.d.ts.map +1 -0
- package/build/typescript/module/index.d.ts +18 -0
- package/build/typescript/module/index.d.ts.map +1 -0
- package/build/typescript/module/live-activity/api.d.ts +35 -0
- package/build/typescript/module/live-activity/api.d.ts.map +1 -0
- package/build/typescript/module/logger.d.ts +16 -0
- package/build/typescript/module/logger.d.ts.map +1 -0
- package/build/typescript/module/native/NativeVoltra.d.ts +100 -0
- package/build/typescript/module/native/NativeVoltra.d.ts.map +1 -0
- package/build/typescript/module/native/VoltraRNNativeComponent.d.ts +8 -0
- package/build/typescript/module/native/VoltraRNNativeComponent.d.ts.map +1 -0
- package/build/typescript/module/package.json +1 -0
- package/build/typescript/module/preload.d.ts +6 -0
- package/build/typescript/module/preload.d.ts.map +1 -0
- package/build/typescript/module/types.d.ts +2 -0
- package/build/typescript/module/types.d.ts.map +1 -0
- package/build/typescript/module/utils/assertRunningOnApple.d.ts +2 -0
- package/build/typescript/module/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/{esm/utils/helpers.js → typescript/module/utils/helpers.d.ts} +1 -1
- package/build/typescript/module/utils/helpers.d.ts.map +1 -0
- package/build/{esm/utils/index.js → typescript/module/utils/index.d.ts} +1 -1
- package/build/typescript/module/utils/index.d.ts.map +1 -0
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts +5 -0
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/typescript/module/widgets/server-credentials.d.ts +5 -0
- package/build/typescript/module/widgets/server-credentials.d.ts.map +1 -0
- package/build/typescript/module/widgets/widget-api.d.ts +11 -0
- package/build/typescript/module/widgets/widget-api.d.ts.map +1 -0
- package/expo-plugin/app.plugin.js +3 -0
- package/expo-plugin/build/cjs/constants.js +23 -0
- package/expo-plugin/build/cjs/constants.js.map +1 -0
- package/expo-plugin/build/cjs/index.js +51 -0
- package/expo-plugin/build/cjs/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios/eas.js +28 -0
- package/expo-plugin/build/cjs/ios/eas.js.map +1 -0
- package/expo-plugin/build/cjs/ios/entitlements.js +46 -0
- package/expo-plugin/build/cjs/ios/entitlements.js.map +1 -0
- package/expo-plugin/build/cjs/ios/index.js +39 -0
- package/expo-plugin/build/cjs/ios/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios/infoPlist.js +51 -0
- package/expo-plugin/build/cjs/ios/infoPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios/pushNotifications.js +22 -0
- package/expo-plugin/build/cjs/ios/pushNotifications.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/eas.js +66 -0
- package/expo-plugin/build/cjs/ios-widget/eas.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/assets.js +199 -0
- package/expo-plugin/build/cjs/ios-widget/files/assets.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/entitlements.js +77 -0
- package/expo-plugin/build/cjs/ios-widget/files/entitlements.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js +92 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js +91 -0
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js +443 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/fonts.js +151 -0
- package/expo-plugin/build/cjs/ios-widget/fonts.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/index.js +46 -0
- package/expo-plugin/build/cjs/ios-widget/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/podfile.js +41 -0
- package/expo-plugin/build/cjs/ios-widget/podfile.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js +99 -0
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js +247 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js +91 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js +79 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js +155 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js +71 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js +74 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js +113 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js.map +1 -0
- package/expo-plugin/build/cjs/utils/fileDiscovery.js +120 -0
- package/expo-plugin/build/cjs/utils/fileDiscovery.js.map +1 -0
- package/expo-plugin/build/cjs/utils/urlScheme.js +40 -0
- package/expo-plugin/build/cjs/utils/urlScheme.js.map +1 -0
- package/expo-plugin/build/cjs/validation.js +55 -0
- package/expo-plugin/build/cjs/validation.js.map +1 -0
- package/expo-plugin/build/esm/constants.js +20 -0
- package/expo-plugin/build/esm/constants.js.map +1 -0
- package/expo-plugin/build/esm/index.js +49 -0
- package/expo-plugin/build/esm/index.js.map +1 -0
- package/expo-plugin/build/esm/ios/eas.js +24 -0
- package/expo-plugin/build/esm/ios/eas.js.map +1 -0
- package/expo-plugin/build/esm/ios/entitlements.js +42 -0
- package/expo-plugin/build/esm/ios/entitlements.js.map +1 -0
- package/expo-plugin/build/esm/ios/index.js +34 -0
- package/expo-plugin/build/esm/ios/index.js.map +1 -0
- package/expo-plugin/build/esm/ios/infoPlist.js +47 -0
- package/expo-plugin/build/esm/ios/infoPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios/pushNotifications.js +18 -0
- package/expo-plugin/build/esm/ios/pushNotifications.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/eas.js +62 -0
- package/expo-plugin/build/esm/ios-widget/eas.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/assets.js +163 -0
- package/expo-plugin/build/esm/ios-widget/files/assets.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/entitlements.js +37 -0
- package/expo-plugin/build/esm/ios-widget/files/entitlements.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js +55 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js +55 -0
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js +403 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/fonts.js +111 -0
- package/expo-plugin/build/esm/ios-widget/fonts.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/index.js +42 -0
- package/expo-plugin/build/esm/ios-widget/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/podfile.js +37 -0
- package/expo-plugin/build/esm/ios-widget/podfile.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js +92 -0
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js +210 -0
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js +87 -0
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js +75 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/index.js +118 -0
- package/expo-plugin/build/esm/ios-widget/xcode/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js +68 -0
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js +70 -0
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/target.js +108 -0
- package/expo-plugin/build/esm/ios-widget/xcode/target.js.map +1 -0
- package/expo-plugin/build/esm/utils/fileDiscovery.js +83 -0
- package/expo-plugin/build/esm/utils/fileDiscovery.js.map +1 -0
- package/expo-plugin/build/esm/utils/urlScheme.js +37 -0
- package/expo-plugin/build/esm/utils/urlScheme.js.map +1 -0
- package/expo-plugin/build/esm/validation.js +51 -0
- package/expo-plugin/build/esm/validation.js.map +1 -0
- package/expo-plugin/build/types/constants.d.ts +13 -0
- package/expo-plugin/build/types/constants.d.ts.map +1 -0
- package/expo-plugin/build/types/index.d.ts +10 -0
- package/expo-plugin/build/types/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/eas.d.ts +12 -0
- package/expo-plugin/build/types/ios/eas.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/entitlements.d.ts +14 -0
- package/expo-plugin/build/types/ios/entitlements.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/index.d.ts +19 -0
- package/expo-plugin/build/types/ios/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts +21 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/pushNotifications.d.ts +10 -0
- package/expo-plugin/build/types/ios/pushNotifications.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/eas.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/eas.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/assets.d.ts +13 -0
- package/expo-plugin/build/types/ios-widget/files/assets.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts +17 -0
- package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts +24 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts +10 -0
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts +24 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/fonts.d.ts +22 -0
- package/expo-plugin/build/types/ios-widget/fonts.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/index.d.ts +31 -0
- package/expo-plugin/build/types/ios-widget/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/podfile.d.ts +9 -0
- package/expo-plugin/build/types/ios-widget/podfile.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts +25 -0
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts +14 -0
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts +42 -0
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts.map +1 -0
- package/expo-plugin/build/types/types.d.ts +74 -0
- package/expo-plugin/build/types/types.d.ts.map +1 -0
- package/expo-plugin/build/types/utils/fileDiscovery.d.ts +15 -0
- package/expo-plugin/build/types/utils/fileDiscovery.d.ts.map +1 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts +10 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts.map +1 -0
- package/expo-plugin/build/types/validation.d.ts +4 -0
- package/expo-plugin/build/types/validation.d.ts.map +1 -0
- package/expo-plugin/jest.config.js +18 -0
- package/expo-plugin/src/constants.ts +25 -0
- package/expo-plugin/src/index.ts +72 -0
- package/expo-plugin/src/ios/eas.ts +33 -0
- package/expo-plugin/src/ios/entitlements.ts +59 -0
- package/expo-plugin/src/ios/index.ts +47 -0
- package/expo-plugin/src/ios/infoPlist.ts +63 -0
- package/expo-plugin/src/ios/pushNotifications.ts +22 -0
- package/expo-plugin/src/ios-widget/eas.ts +79 -0
- package/expo-plugin/src/ios-widget/files/assets.ts +201 -0
- package/expo-plugin/src/ios-widget/files/entitlements.ts +48 -0
- package/expo-plugin/src/ios-widget/files/index.ts +74 -0
- package/expo-plugin/src/ios-widget/files/infoPlist.ts +57 -0
- package/expo-plugin/src/ios-widget/files/swift.node.test.ts +22 -0
- package/expo-plugin/src/ios-widget/files/swift.ts +476 -0
- package/expo-plugin/src/ios-widget/fonts.ts +132 -0
- package/expo-plugin/src/ios-widget/index.ts +73 -0
- package/expo-plugin/src/ios-widget/podfile.ts +44 -0
- package/expo-plugin/src/ios-widget/widgetPlist.ts +115 -0
- package/expo-plugin/src/ios-widget/xcode/buildPhases.ts +301 -0
- package/expo-plugin/src/ios-widget/xcode/configurationList.ts +127 -0
- package/expo-plugin/src/ios-widget/xcode/groups.ts +101 -0
- package/expo-plugin/src/ios-widget/xcode/index.ts +149 -0
- package/expo-plugin/src/ios-widget/xcode/mainAppSettings.ts +95 -0
- package/expo-plugin/src/ios-widget/xcode/productFile.ts +91 -0
- package/expo-plugin/src/ios-widget/xcode/target.ts +148 -0
- package/expo-plugin/src/types.ts +89 -0
- package/expo-plugin/src/utils/fileDiscovery.ts +96 -0
- package/expo-plugin/src/utils/urlScheme.ts +45 -0
- package/expo-plugin/src/validation.node.test.ts +19 -0
- package/expo-plugin/src/validation.ts +63 -0
- package/expo-plugin/tsconfig.base.json +17 -0
- package/expo-plugin/tsconfig.cjs.json +9 -0
- package/expo-plugin/tsconfig.esm.json +9 -0
- package/expo-plugin/tsconfig.jest.json +8 -0
- package/expo-plugin/tsconfig.typecheck.json +12 -0
- package/expo-plugin/tsconfig.types.json +10 -0
- package/ios/Package.swift +68 -0
- package/ios/Tests/JSGradientParserTests.swift +201 -0
- package/ios/Tests/VoltraSharedTests/SmokeTests.swift +8 -0
- package/ios/VoltraWidget.podspec +30 -0
- package/ios/app/NativeVoltra.h +5 -0
- package/ios/app/NativeVoltra.mm +211 -0
- package/ios/app/VoltraActivity.swift +5 -0
- package/ios/app/VoltraImagePreload.swift +154 -0
- package/ios/app/VoltraLiveActivityManager.swift +228 -0
- package/ios/app/VoltraLiveActivityService.swift +306 -0
- package/ios/app/VoltraModule.swift +215 -0
- package/ios/app/VoltraModuleImpl.swift +331 -0
- package/ios/app/VoltraOptions.swift +27 -0
- package/ios/app/VoltraViewComponentView.h +10 -0
- package/ios/app/VoltraViewComponentView.mm +67 -0
- package/ios/app/VoltraViewRoot.swift +63 -0
- package/ios/app/VoltraWidgetService.swift +154 -0
- package/ios/shared/BrotliCompression.swift +81 -0
- package/ios/shared/ComponentTypeID.swift +117 -0
- package/ios/shared/Data+hexString.swift +8 -0
- package/ios/shared/Date+toTimerInterval.swift +25 -0
- package/ios/shared/JSONValue.swift +128 -0
- package/ios/shared/ShortNames.swift +180 -0
- package/ios/shared/VoltraAttributes.swift +58 -0
- package/ios/shared/VoltraConfig.swift +18 -0
- package/ios/shared/VoltraConstants.swift +45 -0
- package/ios/shared/VoltraElement.swift +153 -0
- package/ios/shared/VoltraEvent.swift +72 -0
- package/ios/shared/VoltraEventBus.swift +80 -0
- package/ios/shared/VoltraImageStore.swift +119 -0
- package/ios/shared/VoltraInitialStateLocale.swift +54 -0
- package/ios/shared/VoltraInteractionIntent.swift +39 -0
- package/ios/shared/VoltraKeychainHelper.swift +178 -0
- package/ios/shared/VoltraLiveActivityPayload.swift +113 -0
- package/ios/shared/VoltraLogger.swift +30 -0
- package/ios/shared/VoltraNode.swift +194 -0
- package/ios/shared/VoltraPayloadMigrator.swift +63 -0
- package/ios/shared/VoltraPersistentEventQueue.swift +67 -0
- package/ios/shared/VoltraRefreshIntent.swift +29 -0
- package/ios/shared/VoltraRegion.swift +37 -0
- package/ios/shared/VoltraWidgetDefaults.swift +114 -0
- package/ios/shared/VoltraWidgetServerFetcher.swift +166 -0
- package/ios/target/VoltraHomeWidget.swift +508 -0
- package/ios/target/VoltraWidget.swift +158 -0
- package/ios/ui/Extensions/View.modifiers.swift +28 -0
- package/ios/ui/Extensions/VoltraNode+Parameters.swift +18 -0
- package/ios/ui/Generated/Parameters/ButtonParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/ChartParameters.swift +33 -0
- package/ios/ui/Generated/Parameters/CircularProgressViewParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/ComponentParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/DividerParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/GaugeParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/GlassContainerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/GroupBoxParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/HStackParameters.swift +34 -0
- package/ios/ui/Generated/Parameters/ImageParameters.swift +29 -0
- package/ios/ui/Generated/Parameters/LabelParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/LinearGradientParameters.swift +27 -0
- package/ios/ui/Generated/Parameters/LinearProgressViewParameters.swift +64 -0
- package/ios/ui/Generated/Parameters/LinkParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/MaskParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/SpacerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/SymbolParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/TextParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/TimerParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/ToggleParameters.swift +24 -0
- package/ios/ui/Generated/Parameters/VStackParameters.swift +34 -0
- package/ios/ui/Generated/Parameters/ViewParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/ZStackParameters.swift +15 -0
- package/ios/ui/Helpers/VoltraDeepLinkResolver.swift +43 -0
- package/ios/ui/Helpers/VoltraProgressDriver.swift +52 -0
- package/ios/ui/Layout/FlexContainerHelper.swift +114 -0
- package/ios/ui/Layout/VoltraFlexStackLayout.swift +417 -0
- package/ios/ui/Protocols/VoltraView.swift +29 -0
- package/ios/ui/Style/BackgroundValue.swift +27 -0
- package/ios/ui/Style/CompositeStyle.swift +81 -0
- package/ios/ui/Style/DecorationStyle.swift +207 -0
- package/ios/ui/Style/FlexEnvironment.swift +35 -0
- package/ios/ui/Style/FontVariant.swift +4 -0
- package/ios/ui/Style/GlassEffect.swift +6 -0
- package/ios/ui/Style/JSColorParser.swift +517 -0
- package/ios/ui/Style/JSGradientParser.swift +674 -0
- package/ios/ui/Style/JSStyleParser.swift +223 -0
- package/ios/ui/Style/LayoutStyle.swift +184 -0
- package/ios/ui/Style/Overflow.swift +4 -0
- package/ios/ui/Style/RenderingStyle.swift +33 -0
- package/ios/ui/Style/StyleConverter.swift +202 -0
- package/ios/ui/Style/TextDecoration.swift +6 -0
- package/ios/ui/Style/TextStyle.swift +50 -0
- package/ios/ui/Style/View+applyStyle.swift +38 -0
- package/ios/ui/Views/VoltraButton.swift +57 -0
- package/ios/ui/Views/VoltraChart.swift +840 -0
- package/ios/ui/Views/VoltraCircularProgressView.swift +103 -0
- package/ios/ui/Views/VoltraDivider.swift +16 -0
- package/ios/ui/Views/VoltraFlexView.swift +33 -0
- package/ios/ui/Views/VoltraGauge.swift +65 -0
- package/ios/ui/Views/VoltraGlassContainer.swift +29 -0
- package/ios/ui/Views/VoltraGroupBox.swift +26 -0
- package/ios/ui/Views/VoltraHStack.swift +70 -0
- package/ios/ui/Views/VoltraImage.swift +109 -0
- package/ios/ui/Views/VoltraLabel.swift +24 -0
- package/ios/ui/Views/VoltraLinearGradient.swift +115 -0
- package/ios/ui/Views/VoltraLinearProgressView.swift +118 -0
- package/ios/ui/Views/VoltraLink.swift +25 -0
- package/ios/ui/Views/VoltraMask.swift +23 -0
- package/ios/ui/Views/VoltraSpacer.swift +16 -0
- package/ios/ui/Views/VoltraSymbol.swift +160 -0
- package/ios/ui/Views/VoltraText.swift +87 -0
- package/ios/ui/Views/VoltraTimer.swift +131 -0
- package/ios/ui/Views/VoltraToggle.swift +39 -0
- package/ios/ui/Views/VoltraVStack.swift +68 -0
- package/ios/ui/Views/VoltraZStack.swift +33 -0
- package/ios/ui/Voltra.swift +86 -0
- package/package.json +105 -19
- package/src/VoltraModule.ts +2 -0
- package/src/components/VoltraLiveActivityPreview.tsx +29 -0
- package/src/components/VoltraView.tsx +49 -0
- package/src/components/VoltraWidgetPreview.tsx +38 -0
- package/src/events.ts +70 -0
- package/src/helpers.ts +21 -0
- package/src/index.ts +52 -0
- package/src/live-activity/api.ts +224 -0
- package/src/logger.ts +35 -0
- package/src/native/NativeVoltra.ts +118 -0
- package/src/native/VoltraRNNativeComponent.ts +9 -0
- package/src/preload.ts +50 -0
- package/src/types.ts +12 -0
- package/src/utils/assertRunningOnApple.ts +10 -0
- package/src/utils/helpers.ts +1 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/useUpdateOnHMR.ts +25 -0
- package/src/widgets/server-credentials.ts +16 -0
- package/src/widgets/widget-api.ts +65 -0
- package/build/cjs/VoltraModule.js +0 -6
- package/build/cjs/VoltraModule.js.map +0 -1
- package/build/cjs/components/VoltraLiveActivityPreview.js +0 -20
- package/build/cjs/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/cjs/components/VoltraView.js +0 -37
- package/build/cjs/components/VoltraView.js.map +0 -1
- package/build/cjs/components/VoltraWidgetPreview.js +0 -26
- package/build/cjs/components/VoltraWidgetPreview.js.map +0 -1
- package/build/cjs/events.js +0 -19
- package/build/cjs/events.js.map +0 -1
- package/build/cjs/helpers.js +0 -30
- package/build/cjs/helpers.js.map +0 -1
- package/build/cjs/index.js +0 -49
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/live-activity/api.js +0 -158
- package/build/cjs/live-activity/api.js.map +0 -1
- package/build/cjs/logger.js +0 -36
- package/build/cjs/logger.js.map +0 -1
- package/build/cjs/preload.js +0 -54
- package/build/cjs/preload.js.map +0 -1
- package/build/cjs/utils/assertRunningOnApple.js +0 -13
- package/build/cjs/utils/assertRunningOnApple.js.map +0 -1
- package/build/cjs/utils/helpers.js +0 -7
- package/build/cjs/utils/helpers.js.map +0 -1
- package/build/cjs/utils/index.js +0 -19
- package/build/cjs/utils/index.js.map +0 -1
- package/build/cjs/utils/useUpdateOnHMR.js +0 -22
- package/build/cjs/utils/useUpdateOnHMR.js.map +0 -1
- package/build/cjs/widgets/server-credentials.js +0 -18
- package/build/cjs/widgets/server-credentials.js.map +0 -1
- package/build/cjs/widgets/widget-api.js +0 -59
- package/build/cjs/widgets/widget-api.js.map +0 -1
- package/build/esm/VoltraModule.js +0 -4
- package/build/esm/VoltraModule.js.map +0 -1
- package/build/esm/components/VoltraLiveActivityPreview.js +0 -17
- package/build/esm/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/esm/components/VoltraView.js +0 -34
- package/build/esm/components/VoltraView.js.map +0 -1
- package/build/esm/components/VoltraWidgetPreview.js +0 -23
- package/build/esm/components/VoltraWidgetPreview.js.map +0 -1
- package/build/esm/events.js +0 -13
- package/build/esm/events.js.map +0 -1
- package/build/esm/helpers.js +0 -23
- package/build/esm/helpers.js.map +0 -1
- package/build/esm/index.js +0 -10
- package/build/esm/index.js.map +0 -1
- package/build/esm/live-activity/api.js +0 -146
- package/build/esm/live-activity/api.js.map +0 -1
- package/build/esm/logger.js +0 -33
- package/build/esm/logger.js.map +0 -1
- package/build/esm/preload.js +0 -46
- package/build/esm/preload.js.map +0 -1
- package/build/esm/utils/assertRunningOnApple.js +0 -9
- package/build/esm/utils/assertRunningOnApple.js.map +0 -1
- package/build/esm/utils/helpers.js.map +0 -1
- package/build/esm/utils/index.js.map +0 -1
- package/build/esm/utils/useUpdateOnHMR.js +0 -18
- package/build/esm/utils/useUpdateOnHMR.js.map +0 -1
- package/build/esm/widgets/server-credentials.js +0 -11
- package/build/esm/widgets/server-credentials.js.map +0 -1
- package/build/esm/widgets/widget-api.js +0 -47
- package/build/esm/widgets/widget-api.js.map +0 -1
- package/build/types/VoltraModule.d.ts +0 -44
- package/build/types/VoltraModule.d.ts.map +0 -1
- package/build/types/components/VoltraLiveActivityPreview.d.ts.map +0 -1
- package/build/types/components/VoltraView.d.ts.map +0 -1
- package/build/types/components/VoltraWidgetPreview.d.ts.map +0 -1
- package/build/types/events.d.ts.map +0 -1
- package/build/types/helpers.d.ts.map +0 -1
- package/build/types/index.d.ts.map +0 -1
- package/build/types/live-activity/api.d.ts.map +0 -1
- package/build/types/logger.d.ts.map +0 -1
- package/build/types/preload.d.ts.map +0 -1
- package/build/types/types.d.ts.map +0 -1
- package/build/types/utils/assertRunningOnApple.d.ts.map +0 -1
- package/build/types/utils/helpers.d.ts.map +0 -1
- package/build/types/utils/index.d.ts.map +0 -1
- package/build/types/utils/useUpdateOnHMR.d.ts.map +0 -1
- package/build/types/widgets/server-credentials.d.ts.map +0 -1
- package/build/types/widgets/widget-api.d.ts.map +0 -1
- /package/build/{types → typescript/commonjs}/components/VoltraLiveActivityPreview.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/components/VoltraView.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/components/VoltraWidgetPreview.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/events.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/helpers.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/live-activity/api.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/logger.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/preload.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/types.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/assertRunningOnApple.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/helpers.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/index.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/useUpdateOnHMR.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/widgets/server-credentials.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/widgets/widget-api.d.ts +0 -0
- /package/{build → expo-plugin/build}/cjs/package.json +0 -0
- /package/{build → expo-plugin/build}/cjs/types.js +0 -0
- /package/{build → expo-plugin/build}/cjs/types.js.map +0 -0
- /package/{build → expo-plugin/build}/esm/package.json +0 -0
- /package/{build → expo-plugin/build}/esm/types.js +0 -0
- /package/{build → expo-plugin/build}/esm/types.js.map +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins'
|
|
2
|
+
|
|
3
|
+
import { addApplicationGroupsEntitlement } from '@use-voltra/expo-plugin'
|
|
4
|
+
|
|
5
|
+
export interface ConfigureEasProps {
|
|
6
|
+
groupIdentifier?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Configures main app for EAS builds.
|
|
11
|
+
*
|
|
12
|
+
* This adds the app group entitlement to the main app's entitlements
|
|
13
|
+
* so that EAS can properly configure provisioning profiles.
|
|
14
|
+
*/
|
|
15
|
+
export const configureEas: ConfigPlugin<ConfigureEasProps> = (config, props = {}) => {
|
|
16
|
+
if (!props.groupIdentifier) {
|
|
17
|
+
// No group identifier provided, skip EAS configuration
|
|
18
|
+
return config
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Ensure ios.entitlements exists in config for EAS to detect
|
|
22
|
+
if (!config.ios) {
|
|
23
|
+
config.ios = {}
|
|
24
|
+
}
|
|
25
|
+
if (!config.ios.entitlements) {
|
|
26
|
+
config.ios.entitlements = {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Add app groups entitlement for EAS
|
|
30
|
+
addApplicationGroupsEntitlement(config.ios.entitlements, props.groupIdentifier)
|
|
31
|
+
|
|
32
|
+
return config
|
|
33
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins'
|
|
2
|
+
|
|
3
|
+
import { addApplicationGroupsEntitlement } from '@use-voltra/expo-plugin'
|
|
4
|
+
|
|
5
|
+
export interface ConfigureEntitlementsProps {
|
|
6
|
+
groupIdentifier?: string
|
|
7
|
+
keychainGroup?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Configures main app entitlements for app groups and keychain sharing.
|
|
12
|
+
*
|
|
13
|
+
* This adds:
|
|
14
|
+
* - com.apple.security.application-groups entitlement for data sharing
|
|
15
|
+
* - keychain-access-groups entitlement for shared credential access (if keychainGroup provided)
|
|
16
|
+
*/
|
|
17
|
+
export const configureEntitlements: ConfigPlugin<ConfigureEntitlementsProps> = (config, props = {}) => {
|
|
18
|
+
if (!props.groupIdentifier && !props.keychainGroup) {
|
|
19
|
+
// Nothing to configure
|
|
20
|
+
return config
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!config.ios) {
|
|
24
|
+
config.ios = {}
|
|
25
|
+
}
|
|
26
|
+
if (!config.ios.entitlements) {
|
|
27
|
+
config.ios.entitlements = {}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (props.groupIdentifier) {
|
|
31
|
+
addApplicationGroupsEntitlement(config.ios.entitlements, props.groupIdentifier)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (props.keychainGroup) {
|
|
35
|
+
addKeychainAccessGroupEntitlement(config.ios.entitlements, props.keychainGroup)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return config
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Adds keychain-access-groups entitlement to an entitlements object.
|
|
43
|
+
* Ensures the group list is deduped and preserves existing order.
|
|
44
|
+
*/
|
|
45
|
+
function addKeychainAccessGroupEntitlement(
|
|
46
|
+
entitlements: Record<string, any>,
|
|
47
|
+
keychainGroup: string
|
|
48
|
+
): Record<string, any> {
|
|
49
|
+
const existingGroups = ((entitlements['keychain-access-groups'] as string[]) ?? []).filter(Boolean)
|
|
50
|
+
const deduped = Array.from(new Set(existingGroups))
|
|
51
|
+
|
|
52
|
+
if (deduped.includes(keychainGroup)) {
|
|
53
|
+
entitlements['keychain-access-groups'] = deduped
|
|
54
|
+
return entitlements
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
entitlements['keychain-access-groups'] = [...deduped, keychainGroup]
|
|
58
|
+
return entitlements
|
|
59
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ExpoConfig } from 'expo/config'
|
|
2
|
+
|
|
3
|
+
import { configureEas } from './eas'
|
|
4
|
+
import { configureEntitlements } from './entitlements'
|
|
5
|
+
import { configureInfoPlist } from './infoPlist'
|
|
6
|
+
|
|
7
|
+
export interface IOSConfigProps {
|
|
8
|
+
groupIdentifier?: string
|
|
9
|
+
widgetIds?: string[]
|
|
10
|
+
widgets?: import('../types').IOSWidgetConfig[]
|
|
11
|
+
keychainGroup?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Main iOS app configuration.
|
|
16
|
+
*
|
|
17
|
+
* This configures the main app (not the widget extension) for:
|
|
18
|
+
* - Live Activities support (Info.plist)
|
|
19
|
+
* - App groups for widget communication (entitlements)
|
|
20
|
+
* - Keychain sharing for widget server credentials (entitlements)
|
|
21
|
+
* - EAS build configuration
|
|
22
|
+
*/
|
|
23
|
+
export function withIOS(config: ExpoConfig, props: IOSConfigProps): ExpoConfig {
|
|
24
|
+
// Configure Info.plist
|
|
25
|
+
config = configureInfoPlist(config, {
|
|
26
|
+
groupIdentifier: props.groupIdentifier,
|
|
27
|
+
widgetIds: props.widgetIds,
|
|
28
|
+
widgets: props.widgets,
|
|
29
|
+
keychainGroup: props.keychainGroup,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Configure entitlements
|
|
33
|
+
config = configureEntitlements(config, {
|
|
34
|
+
groupIdentifier: props.groupIdentifier,
|
|
35
|
+
keychainGroup: props.keychainGroup,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
// Configure EAS
|
|
39
|
+
config = configureEas(config, {
|
|
40
|
+
groupIdentifier: props.groupIdentifier,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
return config
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Re-export for convenience
|
|
47
|
+
export { withPushNotifications } from './pushNotifications'
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ConfigPlugin, withInfoPlist } from '@expo/config-plugins'
|
|
2
|
+
|
|
3
|
+
import type { IOSWidgetConfig } from '../types'
|
|
4
|
+
|
|
5
|
+
export interface ConfigureInfoPlistProps {
|
|
6
|
+
groupIdentifier?: string
|
|
7
|
+
widgetIds?: string[]
|
|
8
|
+
widgets?: IOSWidgetConfig[]
|
|
9
|
+
keychainGroup?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Configures main app Info.plist for Live Activities and widgets.
|
|
14
|
+
*
|
|
15
|
+
* This adds:
|
|
16
|
+
* - NSSupportsLiveActivities: Enables Live Activities support
|
|
17
|
+
* - Voltra_AppGroupIdentifier: App group ID for widget communication (if provided)
|
|
18
|
+
* - Voltra_WidgetIds: Array of widget IDs for native module access (if provided)
|
|
19
|
+
* - Voltra_WidgetServerUrls: Map of widget IDs to server URLs (if any widgets have serverUpdate)
|
|
20
|
+
* - Voltra_WidgetServerIntervals: Map of widget IDs to update intervals (if any widgets have serverUpdate)
|
|
21
|
+
* - Voltra_KeychainGroup: Keychain access group for shared credentials (if provided)
|
|
22
|
+
*/
|
|
23
|
+
export const configureInfoPlist: ConfigPlugin<ConfigureInfoPlistProps> = (config, props = {}) => {
|
|
24
|
+
return withInfoPlist(config, (mod) => {
|
|
25
|
+
mod.modResults.NSSupportsLiveActivities = true
|
|
26
|
+
mod.modResults.NSSupportsLiveActivitiesFrequentUpdates = false
|
|
27
|
+
|
|
28
|
+
// Only add group identifier if provided
|
|
29
|
+
if (props.groupIdentifier) {
|
|
30
|
+
mod.modResults.Voltra_AppGroupIdentifier = props.groupIdentifier
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Store widget IDs in Info.plist for native module to access
|
|
34
|
+
if (props.widgetIds && props.widgetIds.length > 0) {
|
|
35
|
+
mod.modResults.Voltra_WidgetIds = props.widgetIds
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Configure server update URLs and intervals for widgets
|
|
39
|
+
if (props.widgets && props.widgets.length > 0) {
|
|
40
|
+
const serverUrls: Record<string, string> = {}
|
|
41
|
+
const serverIntervals: Record<string, number> = {}
|
|
42
|
+
|
|
43
|
+
for (const widget of props.widgets) {
|
|
44
|
+
if (widget.serverUpdate) {
|
|
45
|
+
serverUrls[widget.id] = widget.serverUpdate.url
|
|
46
|
+
serverIntervals[widget.id] = widget.serverUpdate.intervalMinutes ?? 15
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (Object.keys(serverUrls).length > 0) {
|
|
51
|
+
mod.modResults.Voltra_WidgetServerUrls = serverUrls
|
|
52
|
+
mod.modResults.Voltra_WidgetServerIntervals = serverIntervals
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Store Keychain group identifier for shared credential access
|
|
57
|
+
if (props.keychainGroup) {
|
|
58
|
+
mod.modResults.Voltra_KeychainGroup = props.keychainGroup
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return mod
|
|
62
|
+
})
|
|
63
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfigPlugin, withEntitlementsPlist, withInfoPlist } from '@expo/config-plugins'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Plugin that enables push notification support for Live Activities.
|
|
5
|
+
*
|
|
6
|
+
* This:
|
|
7
|
+
* - Adds the aps-environment entitlement for push notifications
|
|
8
|
+
* - Adds Voltra_EnablePushNotifications flag to Info.plist
|
|
9
|
+
*/
|
|
10
|
+
export const withPushNotifications: ConfigPlugin = (config) =>
|
|
11
|
+
withInfoPlist(
|
|
12
|
+
withEntitlementsPlist(config, (mod) => {
|
|
13
|
+
// NOTE: For App Store builds, provisioning profiles typically inject 'production'.
|
|
14
|
+
// This sets a default for debug/dev builds.
|
|
15
|
+
mod.modResults['aps-environment'] = 'development'
|
|
16
|
+
return mod
|
|
17
|
+
}),
|
|
18
|
+
(mod) => {
|
|
19
|
+
mod.modResults['Voltra_EnablePushNotifications'] = true
|
|
20
|
+
return mod
|
|
21
|
+
}
|
|
22
|
+
)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins'
|
|
2
|
+
|
|
3
|
+
import { addApplicationGroupsEntitlement } from '@use-voltra/expo-plugin'
|
|
4
|
+
import { getWidgetExtensionEntitlements } from './files/entitlements'
|
|
5
|
+
|
|
6
|
+
export interface ConfigureEasBuildProps {
|
|
7
|
+
bundleIdentifier: string
|
|
8
|
+
targetName: string
|
|
9
|
+
groupIdentifier?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Plugin step that configures EAS build settings for the widget extension.
|
|
14
|
+
*
|
|
15
|
+
* This:
|
|
16
|
+
* - Adds the widget extension to the EAS build experimental iOS appExtensions
|
|
17
|
+
* - Configures entitlements for both the extension and main app
|
|
18
|
+
*/
|
|
19
|
+
export const configureEasBuild: ConfigPlugin<ConfigureEasBuildProps> = (
|
|
20
|
+
config,
|
|
21
|
+
{ bundleIdentifier, targetName, groupIdentifier }
|
|
22
|
+
) => {
|
|
23
|
+
let configIndex: null | number = null
|
|
24
|
+
|
|
25
|
+
// Check if extension already exists
|
|
26
|
+
config.extra?.eas?.build?.experimental?.ios?.appExtensions?.forEach((ext: any, index: number) => {
|
|
27
|
+
if (ext.targetName === targetName) {
|
|
28
|
+
configIndex = index
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Add extension if not already present
|
|
33
|
+
if (configIndex === null) {
|
|
34
|
+
config.extra = {
|
|
35
|
+
...config.extra,
|
|
36
|
+
eas: {
|
|
37
|
+
...config.extra?.eas,
|
|
38
|
+
build: {
|
|
39
|
+
...config.extra?.eas?.build,
|
|
40
|
+
experimental: {
|
|
41
|
+
...config.extra?.eas?.build?.experimental,
|
|
42
|
+
ios: {
|
|
43
|
+
...config.extra?.eas?.build?.experimental?.ios,
|
|
44
|
+
appExtensions: [
|
|
45
|
+
...(config.extra?.eas?.build?.experimental?.ios?.appExtensions ?? []),
|
|
46
|
+
{
|
|
47
|
+
targetName,
|
|
48
|
+
bundleIdentifier,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
configIndex = (config.extra?.eas?.build?.experimental?.ios?.appExtensions?.length ?? 1) - 1
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Configure entitlements (may be empty if no groupIdentifier)
|
|
60
|
+
if (configIndex != null && config.extra) {
|
|
61
|
+
const widgetsExtensionConfig = config.extra.eas.build.experimental.ios.appExtensions[configIndex]
|
|
62
|
+
|
|
63
|
+
widgetsExtensionConfig.entitlements = {
|
|
64
|
+
...widgetsExtensionConfig.entitlements,
|
|
65
|
+
...getWidgetExtensionEntitlements(groupIdentifier),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (groupIdentifier) {
|
|
69
|
+
config.ios = {
|
|
70
|
+
...config.ios,
|
|
71
|
+
entitlements: {
|
|
72
|
+
...addApplicationGroupsEntitlement(config.ios?.entitlements ?? {}, groupIdentifier),
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return config
|
|
79
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import * as fs from 'fs'
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
|
|
4
|
+
import { MAX_IMAGE_SIZE_BYTES, logger } from '@use-voltra/expo-plugin'
|
|
5
|
+
|
|
6
|
+
import { DEFAULT_USER_IMAGES_PATH, SUPPORTED_IMAGE_EXTENSIONS } from '../../constants'
|
|
7
|
+
|
|
8
|
+
export interface GenerateAssetsOptions {
|
|
9
|
+
targetPath: string
|
|
10
|
+
userImagesPath?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Main Function
|
|
15
|
+
// ============================================================================
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generates all asset files for the widget extension.
|
|
19
|
+
*
|
|
20
|
+
* This creates:
|
|
21
|
+
* - Assets.xcassets/ directory structure
|
|
22
|
+
* - Copies user images to the asset catalog
|
|
23
|
+
*/
|
|
24
|
+
export function generateAssets(options: GenerateAssetsOptions): void {
|
|
25
|
+
const { targetPath, userImagesPath = DEFAULT_USER_IMAGES_PATH } = options
|
|
26
|
+
|
|
27
|
+
// Generate Assets.xcassets structure
|
|
28
|
+
generateAssetsCatalog(targetPath)
|
|
29
|
+
logger.info('Generated Assets.xcassets')
|
|
30
|
+
|
|
31
|
+
// Copy user images to asset catalog
|
|
32
|
+
const assetsPath = path.join(targetPath, 'Assets.xcassets')
|
|
33
|
+
copyUserImages(userImagesPath, assetsPath)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Asset Catalog
|
|
38
|
+
// ============================================================================
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Contents.json for the root of Assets.xcassets
|
|
42
|
+
*/
|
|
43
|
+
const ASSETS_CATALOG_CONTENTS = {
|
|
44
|
+
info: {
|
|
45
|
+
author: 'xcode',
|
|
46
|
+
version: 1,
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Contents.json for an imageset
|
|
52
|
+
*/
|
|
53
|
+
function createImagesetContents(filename: string) {
|
|
54
|
+
return {
|
|
55
|
+
images: [
|
|
56
|
+
{
|
|
57
|
+
filename,
|
|
58
|
+
idiom: 'universal',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
info: {
|
|
62
|
+
author: 'xcode',
|
|
63
|
+
version: 1,
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Generates the Assets.xcassets directory structure for a widget extension.
|
|
70
|
+
*
|
|
71
|
+
* Creates the minimal required asset catalog structure:
|
|
72
|
+
* - Assets.xcassets/
|
|
73
|
+
* - Contents.json (required root manifest)
|
|
74
|
+
*
|
|
75
|
+
* @param targetPath - Path to the widget extension target directory
|
|
76
|
+
*/
|
|
77
|
+
function generateAssetsCatalog(targetPath: string): void {
|
|
78
|
+
const assetsPath = path.join(targetPath, 'Assets.xcassets')
|
|
79
|
+
|
|
80
|
+
// Create Assets.xcassets directory
|
|
81
|
+
if (!fs.existsSync(assetsPath)) {
|
|
82
|
+
fs.mkdirSync(assetsPath, { recursive: true })
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Write root Contents.json
|
|
86
|
+
fs.writeFileSync(path.join(assetsPath, 'Contents.json'), JSON.stringify(ASSETS_CATALOG_CONTENTS, null, 2))
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Adds an image to the Assets.xcassets catalog as an imageset.
|
|
91
|
+
*
|
|
92
|
+
* Creates:
|
|
93
|
+
* - {imageName}.imageset/
|
|
94
|
+
* - {originalFilename}
|
|
95
|
+
* - Contents.json
|
|
96
|
+
*
|
|
97
|
+
* @param assetsPath - Path to Assets.xcassets directory
|
|
98
|
+
* @param imagePath - Path to the source image file
|
|
99
|
+
*/
|
|
100
|
+
function addImageToAssetsCatalog(assetsPath: string, imagePath: string): void {
|
|
101
|
+
const filename = path.basename(imagePath)
|
|
102
|
+
const imageName = path.basename(filename, path.extname(filename))
|
|
103
|
+
const imagesetPath = path.join(assetsPath, `${imageName}.imageset`)
|
|
104
|
+
|
|
105
|
+
// Create imageset directory
|
|
106
|
+
if (!fs.existsSync(imagesetPath)) {
|
|
107
|
+
fs.mkdirSync(imagesetPath, { recursive: true })
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Copy the image file
|
|
111
|
+
fs.copyFileSync(imagePath, path.join(imagesetPath, filename))
|
|
112
|
+
|
|
113
|
+
// Write Contents.json for the imageset
|
|
114
|
+
fs.writeFileSync(path.join(imagesetPath, 'Contents.json'), JSON.stringify(createImagesetContents(filename), null, 2))
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ============================================================================
|
|
118
|
+
// Image Handling
|
|
119
|
+
// ============================================================================
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Checks if an image file exceeds the size limit for Live Activities.
|
|
123
|
+
* Logs a warning if the image is too large.
|
|
124
|
+
*
|
|
125
|
+
* @param imagePath - Path to the image file
|
|
126
|
+
* @returns true if the image is within the size limit, false otherwise
|
|
127
|
+
*/
|
|
128
|
+
function checkImageSize(imagePath: string): boolean {
|
|
129
|
+
const stats = fs.statSync(imagePath)
|
|
130
|
+
const imageSizeInBytes = stats.size
|
|
131
|
+
|
|
132
|
+
if (imageSizeInBytes >= MAX_IMAGE_SIZE_BYTES) {
|
|
133
|
+
const fileName = path.basename(imagePath)
|
|
134
|
+
logger.warnRed(
|
|
135
|
+
`Image "${fileName}" is ${imageSizeInBytes} bytes (${(imageSizeInBytes / 1024).toFixed(2)}KB). ` +
|
|
136
|
+
`This image will not display correctly in Live Activities as images for Live Activities need to be lower than 4KB.`
|
|
137
|
+
)
|
|
138
|
+
return false
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return true
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Checks if a file is a supported image type.
|
|
146
|
+
*/
|
|
147
|
+
function isSupportedImage(filePath: string): boolean {
|
|
148
|
+
return SUPPORTED_IMAGE_EXTENSIONS.test(path.extname(filePath))
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Copies user images from the source directory to the widget's Assets.xcassets.
|
|
153
|
+
*
|
|
154
|
+
* Images are validated for size (must be < 4KB for Live Activities) and
|
|
155
|
+
* added as imagesets to the asset catalog.
|
|
156
|
+
*
|
|
157
|
+
* @param userImagesPath - Path to directory containing user images (relative to project root)
|
|
158
|
+
* @param targetAssetsPath - Path to the Assets.xcassets directory in the widget target
|
|
159
|
+
* @returns Array of image filenames that were copied
|
|
160
|
+
*/
|
|
161
|
+
function copyUserImages(userImagesPath: string, targetAssetsPath: string): string[] {
|
|
162
|
+
const copiedImages: string[] = []
|
|
163
|
+
|
|
164
|
+
if (!fs.existsSync(userImagesPath)) {
|
|
165
|
+
logger.warn(`Skipping user images: directory does not exist at ${userImagesPath}`)
|
|
166
|
+
return copiedImages
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (!fs.lstatSync(userImagesPath).isDirectory()) {
|
|
170
|
+
logger.warn(`Skipping user images: ${userImagesPath} is not a directory`)
|
|
171
|
+
return copiedImages
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const files = fs.readdirSync(userImagesPath)
|
|
175
|
+
|
|
176
|
+
for (const file of files) {
|
|
177
|
+
const sourcePath = path.join(userImagesPath, file)
|
|
178
|
+
|
|
179
|
+
// Skip directories and non-image files
|
|
180
|
+
if (fs.lstatSync(sourcePath).isDirectory()) {
|
|
181
|
+
continue
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (!isSupportedImage(file)) {
|
|
185
|
+
continue
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Check image size for Live Activity compatibility (warns if too large)
|
|
189
|
+
checkImageSize(sourcePath)
|
|
190
|
+
|
|
191
|
+
// Add to asset catalog
|
|
192
|
+
addImageToAssetsCatalog(targetAssetsPath, sourcePath)
|
|
193
|
+
copiedImages.push(file)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (copiedImages.length > 0) {
|
|
197
|
+
logger.info(`Copied ${copiedImages.length} user image(s) to widget assets`)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return copiedImages
|
|
201
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import plist from '@expo/plist'
|
|
2
|
+
import * as fs from 'fs'
|
|
3
|
+
import * as path from 'path'
|
|
4
|
+
|
|
5
|
+
import { addApplicationGroupsEntitlement } from '@use-voltra/expo-plugin'
|
|
6
|
+
import { logger } from '@use-voltra/expo-plugin'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gets the entitlements for the widget extension.
|
|
10
|
+
*/
|
|
11
|
+
export function getWidgetExtensionEntitlements(groupIdentifier?: string, keychainGroup?: string): Record<string, any> {
|
|
12
|
+
const entitlements: Record<string, any> = {}
|
|
13
|
+
if (groupIdentifier) {
|
|
14
|
+
addApplicationGroupsEntitlement(entitlements, groupIdentifier)
|
|
15
|
+
}
|
|
16
|
+
if (keychainGroup) {
|
|
17
|
+
const existingGroups = ((entitlements['keychain-access-groups'] as string[]) ?? []).filter(Boolean)
|
|
18
|
+
const deduped = Array.from(new Set(existingGroups))
|
|
19
|
+
if (!deduped.includes(keychainGroup)) {
|
|
20
|
+
deduped.push(keychainGroup)
|
|
21
|
+
}
|
|
22
|
+
entitlements['keychain-access-groups'] = deduped
|
|
23
|
+
}
|
|
24
|
+
return entitlements
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GenerateEntitlementsOptions {
|
|
28
|
+
targetPath: string
|
|
29
|
+
targetName: string
|
|
30
|
+
groupIdentifier?: string
|
|
31
|
+
keychainGroup?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Generates the entitlements file for the widget extension.
|
|
36
|
+
*
|
|
37
|
+
* @param options - Generation options
|
|
38
|
+
*/
|
|
39
|
+
export function generateEntitlements(options: GenerateEntitlementsOptions): void {
|
|
40
|
+
const { targetPath, targetName, groupIdentifier, keychainGroup } = options
|
|
41
|
+
const filePath = path.join(targetPath, `${targetName}.entitlements`)
|
|
42
|
+
|
|
43
|
+
const extensionEntitlements = getWidgetExtensionEntitlements(groupIdentifier, keychainGroup)
|
|
44
|
+
|
|
45
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true })
|
|
46
|
+
fs.writeFileSync(filePath, plist.build(extensionEntitlements))
|
|
47
|
+
logger.info(`Generated ${targetName}.entitlements`)
|
|
48
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins'
|
|
2
|
+
import * as fs from 'fs'
|
|
3
|
+
import * as path from 'path'
|
|
4
|
+
|
|
5
|
+
import type { IOSWidgetConfig } from '../../types'
|
|
6
|
+
import { generateAssets } from './assets'
|
|
7
|
+
import { generateEntitlements } from './entitlements'
|
|
8
|
+
import { generateInfoPlist } from './infoPlist'
|
|
9
|
+
import { generateSwiftFiles } from './swift'
|
|
10
|
+
|
|
11
|
+
export interface GenerateWidgetExtensionFilesProps {
|
|
12
|
+
targetName: string
|
|
13
|
+
widgets?: IOSWidgetConfig[]
|
|
14
|
+
groupIdentifier?: string
|
|
15
|
+
keychainGroup?: string
|
|
16
|
+
version: string
|
|
17
|
+
buildNumber: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Plugin step that generates all widget extension files.
|
|
22
|
+
*
|
|
23
|
+
* This creates:
|
|
24
|
+
* - Info.plist (required extension manifest)
|
|
25
|
+
* - Assets.xcassets/ (asset catalog with user images)
|
|
26
|
+
* - VoltraWidgetBundle.swift (widget bundle definition)
|
|
27
|
+
* - VoltraWidgetInitialStates.swift (pre-rendered widget states)
|
|
28
|
+
* - {targetName}.entitlements (entitlements file)
|
|
29
|
+
*
|
|
30
|
+
* This should run before configureXcodeProject so the files exist when Xcode project is configured.
|
|
31
|
+
*/
|
|
32
|
+
export const generateWidgetExtensionFiles: ConfigPlugin<GenerateWidgetExtensionFilesProps> = (config, props) => {
|
|
33
|
+
const { targetName, widgets, groupIdentifier, keychainGroup, version, buildNumber } = props
|
|
34
|
+
|
|
35
|
+
return withDangerousMod(config, [
|
|
36
|
+
'ios',
|
|
37
|
+
async (config) => {
|
|
38
|
+
if (config.modRequest.introspect) {
|
|
39
|
+
return config
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const { platformProjectRoot, projectRoot } = config.modRequest
|
|
43
|
+
const targetPath = path.join(platformProjectRoot, targetName)
|
|
44
|
+
|
|
45
|
+
// Ensure target directory exists
|
|
46
|
+
if (!fs.existsSync(targetPath)) {
|
|
47
|
+
fs.mkdirSync(targetPath, { recursive: true })
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Generate Info.plist
|
|
51
|
+
generateInfoPlist(targetPath, targetName, version, buildNumber)
|
|
52
|
+
|
|
53
|
+
// Generate Assets.xcassets and copy user images
|
|
54
|
+
generateAssets({ targetPath })
|
|
55
|
+
|
|
56
|
+
// Generate Swift files (widget bundle, initial states)
|
|
57
|
+
await generateSwiftFiles({
|
|
58
|
+
targetPath,
|
|
59
|
+
projectRoot,
|
|
60
|
+
widgets,
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// Generate entitlements file (may be empty if no groupIdentifier or keychainGroup)
|
|
64
|
+
generateEntitlements({
|
|
65
|
+
targetPath,
|
|
66
|
+
targetName,
|
|
67
|
+
groupIdentifier,
|
|
68
|
+
keychainGroup,
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
return config
|
|
72
|
+
},
|
|
73
|
+
])
|
|
74
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as fs from 'fs'
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
|
|
4
|
+
import { logger } from '@use-voltra/expo-plugin'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generates the Info.plist content for a WidgetKit extension.
|
|
8
|
+
*
|
|
9
|
+
* This includes version information and the required WidgetKit extension point.
|
|
10
|
+
* Version keys are written directly to the plist following the Expo pattern.
|
|
11
|
+
*/
|
|
12
|
+
function generateInfoPlistContent(targetName: string, version: string, buildNumber: string): string {
|
|
13
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
14
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
15
|
+
<plist version="1.0">
|
|
16
|
+
<dict>
|
|
17
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
18
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
19
|
+
<key>CFBundleDisplayName</key>
|
|
20
|
+
<string>${targetName}</string>
|
|
21
|
+
<key>CFBundleExecutable</key>
|
|
22
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
23
|
+
<key>CFBundleIdentifier</key>
|
|
24
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
25
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
26
|
+
<string>6.0</string>
|
|
27
|
+
<key>CFBundleName</key>
|
|
28
|
+
<string>$(PRODUCT_NAME)</string>
|
|
29
|
+
<key>CFBundlePackageType</key>
|
|
30
|
+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
|
31
|
+
<key>CFBundleShortVersionString</key>
|
|
32
|
+
<string>${version}</string>
|
|
33
|
+
<key>CFBundleVersion</key>
|
|
34
|
+
<string>${buildNumber}</string>
|
|
35
|
+
<key>NSExtension</key>
|
|
36
|
+
<dict>
|
|
37
|
+
<key>NSExtensionPointIdentifier</key>
|
|
38
|
+
<string>com.apple.widgetkit-extension</string>
|
|
39
|
+
</dict>
|
|
40
|
+
</dict>
|
|
41
|
+
</plist>
|
|
42
|
+
`
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generates the Info.plist file for the widget extension.
|
|
47
|
+
*
|
|
48
|
+
* @param targetPath - Path to the widget extension target directory
|
|
49
|
+
* @param targetName - The widget extension target name (used for CFBundleDisplayName)
|
|
50
|
+
* @param version - The app version (CFBundleShortVersionString)
|
|
51
|
+
* @param buildNumber - The build number (CFBundleVersion)
|
|
52
|
+
*/
|
|
53
|
+
export function generateInfoPlist(targetPath: string, targetName: string, version: string, buildNumber: string): void {
|
|
54
|
+
const infoPlistPath = path.join(targetPath, 'Info.plist')
|
|
55
|
+
fs.writeFileSync(infoPlistPath, generateInfoPlistContent(targetName, version, buildNumber))
|
|
56
|
+
logger.info('Generated Info.plist')
|
|
57
|
+
}
|