@use-voltra/expo-plugin 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/build/cjs/android/files/assets.js +259 -0
- package/build/cjs/android/files/assets.js.map +1 -0
- package/build/cjs/android/files/fonts.js +69 -0
- package/build/cjs/android/files/fonts.js.map +1 -0
- package/build/cjs/android/files/index.js +81 -0
- package/build/cjs/android/files/index.js.map +1 -0
- package/build/cjs/android/files/initialStates.js +83 -0
- package/build/cjs/android/files/initialStates.js.map +1 -0
- package/build/cjs/android/files/kotlin.js +142 -0
- package/build/cjs/android/files/kotlin.js.map +1 -0
- package/build/cjs/android/files/xml.js +247 -0
- package/build/cjs/android/files/xml.js.map +1 -0
- package/build/cjs/android/index.js +33 -0
- package/build/cjs/android/index.js.map +1 -0
- package/build/cjs/android/manifest.js +63 -0
- package/build/cjs/android/manifest.js.map +1 -0
- package/build/cjs/constants.js +48 -0
- package/build/cjs/constants.js.map +1 -0
- package/build/cjs/index.js +71 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/ios/eas.js +28 -0
- package/build/cjs/ios/eas.js.map +1 -0
- package/build/cjs/ios/entitlements.js +46 -0
- package/build/cjs/ios/entitlements.js.map +1 -0
- package/build/cjs/ios/index.js +39 -0
- package/build/cjs/ios/index.js.map +1 -0
- package/build/cjs/ios/infoPlist.js +51 -0
- package/build/cjs/ios/infoPlist.js.map +1 -0
- package/build/cjs/ios/pushNotifications.js +22 -0
- package/build/cjs/ios/pushNotifications.js.map +1 -0
- package/build/cjs/ios-widget/eas.js +66 -0
- package/build/cjs/ios-widget/eas.js.map +1 -0
- package/build/cjs/ios-widget/files/assets.js +199 -0
- package/build/cjs/ios-widget/files/assets.js.map +1 -0
- package/build/cjs/ios-widget/files/entitlements.js +77 -0
- package/build/cjs/ios-widget/files/entitlements.js.map +1 -0
- package/build/cjs/ios-widget/files/index.js +92 -0
- package/build/cjs/ios-widget/files/index.js.map +1 -0
- package/build/cjs/ios-widget/files/infoPlist.js +91 -0
- package/build/cjs/ios-widget/files/infoPlist.js.map +1 -0
- package/build/cjs/ios-widget/files/swift.js +256 -0
- package/build/cjs/ios-widget/files/swift.js.map +1 -0
- package/build/cjs/ios-widget/fonts.js +151 -0
- package/build/cjs/ios-widget/fonts.js.map +1 -0
- package/build/cjs/ios-widget/index.js +46 -0
- package/build/cjs/ios-widget/index.js.map +1 -0
- package/build/cjs/ios-widget/podfile.js +43 -0
- package/build/cjs/ios-widget/podfile.js.map +1 -0
- package/build/cjs/ios-widget/widgetPlist.js +99 -0
- package/build/cjs/ios-widget/widgetPlist.js.map +1 -0
- package/build/cjs/ios-widget/xcode/buildPhases.js +245 -0
- package/build/cjs/ios-widget/xcode/buildPhases.js.map +1 -0
- package/build/cjs/ios-widget/xcode/configurationList.js +91 -0
- package/build/cjs/ios-widget/xcode/configurationList.js.map +1 -0
- package/build/cjs/ios-widget/xcode/groups.js +65 -0
- package/build/cjs/ios-widget/xcode/groups.js.map +1 -0
- package/build/cjs/ios-widget/xcode/index.js +155 -0
- package/build/cjs/ios-widget/xcode/index.js.map +1 -0
- package/build/cjs/ios-widget/xcode/mainAppSettings.js +71 -0
- package/build/cjs/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/build/cjs/ios-widget/xcode/productFile.js +74 -0
- package/build/cjs/ios-widget/xcode/productFile.js.map +1 -0
- package/build/cjs/ios-widget/xcode/target.js +113 -0
- package/build/cjs/ios-widget/xcode/target.js.map +1 -0
- package/build/cjs/package.json +3 -0
- package/build/cjs/types.js +3 -0
- package/build/cjs/types.js.map +1 -0
- package/build/cjs/utils/entitlements.js +21 -0
- package/build/cjs/utils/entitlements.js.map +1 -0
- package/build/cjs/utils/fileDiscovery.js +107 -0
- package/build/cjs/utils/fileDiscovery.js.map +1 -0
- package/build/cjs/utils/fonts.js +75 -0
- package/build/cjs/utils/fonts.js.map +1 -0
- package/build/cjs/utils/logger.js +51 -0
- package/build/cjs/utils/logger.js.map +1 -0
- package/build/cjs/utils/prerender.js +191 -0
- package/build/cjs/utils/prerender.js.map +1 -0
- package/build/cjs/utils/urlScheme.js +40 -0
- package/build/cjs/utils/urlScheme.js.map +1 -0
- package/build/cjs/validation.js +231 -0
- package/build/cjs/validation.js.map +1 -0
- package/build/esm/android/files/assets.js +223 -0
- package/build/esm/android/files/assets.js.map +1 -0
- package/build/esm/android/files/fonts.js +33 -0
- package/build/esm/android/files/fonts.js.map +1 -0
- package/build/esm/android/files/index.js +77 -0
- package/build/esm/android/files/index.js.map +1 -0
- package/build/esm/android/files/initialStates.js +44 -0
- package/build/esm/android/files/initialStates.js.map +1 -0
- package/build/esm/android/files/kotlin.js +103 -0
- package/build/esm/android/files/kotlin.js.map +1 -0
- package/build/esm/android/files/xml.js +206 -0
- package/build/esm/android/files/xml.js.map +1 -0
- package/build/esm/android/index.js +29 -0
- package/build/esm/android/index.js.map +1 -0
- package/build/esm/android/manifest.js +59 -0
- package/build/esm/android/manifest.js.map +1 -0
- package/build/esm/constants.js +45 -0
- package/build/esm/constants.js.map +1 -0
- package/build/esm/index.js +69 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/ios/eas.js +24 -0
- package/build/esm/ios/eas.js.map +1 -0
- package/build/esm/ios/entitlements.js +42 -0
- package/build/esm/ios/entitlements.js.map +1 -0
- package/build/esm/ios/index.js +34 -0
- package/build/esm/ios/index.js.map +1 -0
- package/build/esm/ios/infoPlist.js +47 -0
- package/build/esm/ios/infoPlist.js.map +1 -0
- package/build/esm/ios/pushNotifications.js +18 -0
- package/build/esm/ios/pushNotifications.js.map +1 -0
- package/build/esm/ios-widget/eas.js +62 -0
- package/build/esm/ios-widget/eas.js.map +1 -0
- package/build/esm/ios-widget/files/assets.js +163 -0
- package/build/esm/ios-widget/files/assets.js.map +1 -0
- package/build/esm/ios-widget/files/entitlements.js +37 -0
- package/build/esm/ios-widget/files/entitlements.js.map +1 -0
- package/build/esm/ios-widget/files/index.js +55 -0
- package/build/esm/ios-widget/files/index.js.map +1 -0
- package/build/esm/ios-widget/files/infoPlist.js +55 -0
- package/build/esm/ios-widget/files/infoPlist.js.map +1 -0
- package/build/esm/ios-widget/files/swift.js +217 -0
- package/build/esm/ios-widget/files/swift.js.map +1 -0
- package/build/esm/ios-widget/fonts.js +111 -0
- package/build/esm/ios-widget/fonts.js.map +1 -0
- package/build/esm/ios-widget/index.js +42 -0
- package/build/esm/ios-widget/index.js.map +1 -0
- package/build/esm/ios-widget/podfile.js +39 -0
- package/build/esm/ios-widget/podfile.js.map +1 -0
- package/build/esm/ios-widget/widgetPlist.js +92 -0
- package/build/esm/ios-widget/widgetPlist.js.map +1 -0
- package/build/esm/ios-widget/xcode/buildPhases.js +208 -0
- package/build/esm/ios-widget/xcode/buildPhases.js.map +1 -0
- package/build/esm/ios-widget/xcode/configurationList.js +87 -0
- package/build/esm/ios-widget/xcode/configurationList.js.map +1 -0
- package/build/esm/ios-widget/xcode/groups.js +61 -0
- package/build/esm/ios-widget/xcode/groups.js.map +1 -0
- package/build/esm/ios-widget/xcode/index.js +118 -0
- package/build/esm/ios-widget/xcode/index.js.map +1 -0
- package/build/esm/ios-widget/xcode/mainAppSettings.js +68 -0
- package/build/esm/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/build/esm/ios-widget/xcode/productFile.js +70 -0
- package/build/esm/ios-widget/xcode/productFile.js.map +1 -0
- package/build/esm/ios-widget/xcode/target.js +108 -0
- package/build/esm/ios-widget/xcode/target.js.map +1 -0
- package/build/esm/package.json +3 -0
- package/build/esm/types.js +2 -0
- package/build/esm/types.js.map +1 -0
- package/build/esm/utils/entitlements.js +18 -0
- package/build/esm/utils/entitlements.js.map +1 -0
- package/build/esm/utils/fileDiscovery.js +71 -0
- package/build/esm/utils/fileDiscovery.js.map +1 -0
- package/build/esm/utils/fonts.js +39 -0
- package/build/esm/utils/fonts.js.map +1 -0
- package/build/esm/utils/logger.js +48 -0
- package/build/esm/utils/logger.js.map +1 -0
- package/build/esm/utils/prerender.js +152 -0
- package/build/esm/utils/prerender.js.map +1 -0
- package/build/esm/utils/urlScheme.js +37 -0
- package/build/esm/utils/urlScheme.js.map +1 -0
- package/build/esm/validation.js +193 -0
- package/build/esm/validation.js.map +1 -0
- package/build/types/android/files/assets.d.ts +26 -0
- package/build/types/android/files/assets.d.ts.map +1 -0
- package/build/types/android/files/fonts.d.ts +19 -0
- package/build/types/android/files/fonts.d.ts.map +1 -0
- package/build/types/android/files/index.d.ts +21 -0
- package/build/types/android/files/index.d.ts.map +1 -0
- package/build/types/android/files/initialStates.d.ts +14 -0
- package/build/types/android/files/initialStates.d.ts.map +1 -0
- package/build/types/android/files/kotlin.d.ts +11 -0
- package/build/types/android/files/kotlin.d.ts.map +1 -0
- package/build/types/android/files/xml.d.ts +25 -0
- package/build/types/android/files/xml.d.ts.map +1 -0
- package/build/types/android/index.d.ts +12 -0
- package/build/types/android/index.d.ts.map +1 -0
- package/build/types/android/manifest.d.ts +15 -0
- package/build/types/android/manifest.d.ts.map +1 -0
- package/build/types/constants.d.ts +29 -0
- package/build/types/constants.d.ts.map +1 -0
- package/build/types/index.d.ts +13 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/ios/eas.d.ts +12 -0
- package/build/types/ios/eas.d.ts.map +1 -0
- package/build/types/ios/entitlements.d.ts +14 -0
- package/build/types/ios/entitlements.d.ts.map +1 -0
- package/build/types/ios/index.d.ts +19 -0
- package/build/types/ios/index.d.ts.map +1 -0
- package/build/types/ios/infoPlist.d.ts +21 -0
- package/build/types/ios/infoPlist.d.ts.map +1 -0
- package/build/types/ios/pushNotifications.d.ts +10 -0
- package/build/types/ios/pushNotifications.d.ts.map +1 -0
- package/build/types/ios-widget/eas.d.ts +15 -0
- package/build/types/ios-widget/eas.d.ts.map +1 -0
- package/build/types/ios-widget/files/assets.d.ts +13 -0
- package/build/types/ios-widget/files/assets.d.ts.map +1 -0
- package/build/types/ios-widget/files/entitlements.d.ts +17 -0
- package/build/types/ios-widget/files/entitlements.d.ts.map +1 -0
- package/build/types/ios-widget/files/index.d.ts +24 -0
- package/build/types/ios-widget/files/index.d.ts.map +1 -0
- package/build/types/ios-widget/files/infoPlist.d.ts +10 -0
- package/build/types/ios-widget/files/infoPlist.d.ts.map +1 -0
- package/build/types/ios-widget/files/swift.d.ts +15 -0
- package/build/types/ios-widget/files/swift.d.ts.map +1 -0
- package/build/types/ios-widget/fonts.d.ts +22 -0
- package/build/types/ios-widget/fonts.d.ts.map +1 -0
- package/build/types/ios-widget/index.d.ts +31 -0
- package/build/types/ios-widget/index.d.ts.map +1 -0
- package/build/types/ios-widget/podfile.d.ts +9 -0
- package/build/types/ios-widget/podfile.d.ts.map +1 -0
- package/build/types/ios-widget/widgetPlist.d.ts +20 -0
- package/build/types/ios-widget/widgetPlist.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/buildPhases.d.ts +25 -0
- package/build/types/ios-widget/xcode/buildPhases.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/configurationList.d.ts +20 -0
- package/build/types/ios-widget/xcode/configurationList.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/groups.d.ts +15 -0
- package/build/types/ios-widget/xcode/groups.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/index.d.ts +20 -0
- package/build/types/ios-widget/xcode/index.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/mainAppSettings.d.ts +15 -0
- package/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/productFile.d.ts +14 -0
- package/build/types/ios-widget/xcode/productFile.d.ts.map +1 -0
- package/build/types/ios-widget/xcode/target.d.ts +42 -0
- package/build/types/ios-widget/xcode/target.d.ts.map +1 -0
- package/build/types/types.d.ts +261 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/types/utils/entitlements.d.ts +9 -0
- package/build/types/utils/entitlements.d.ts.map +1 -0
- package/build/types/utils/fileDiscovery.d.ts +13 -0
- package/build/types/utils/fileDiscovery.d.ts.map +1 -0
- package/build/types/utils/fonts.d.ts +2 -0
- package/build/types/utils/fonts.d.ts.map +1 -0
- package/build/types/utils/logger.d.ts +30 -0
- package/build/types/utils/logger.d.ts.map +1 -0
- package/build/types/utils/prerender.d.ts +25 -0
- package/build/types/utils/prerender.d.ts.map +1 -0
- package/build/types/utils/urlScheme.d.ts +10 -0
- package/build/types/utils/urlScheme.d.ts.map +1 -0
- package/build/types/validation.d.ts +17 -0
- package/build/types/validation.d.ts.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureEas = void 0;
|
|
4
|
+
const entitlements_1 = require("../utils/entitlements");
|
|
5
|
+
/**
|
|
6
|
+
* Configures main app for EAS builds.
|
|
7
|
+
*
|
|
8
|
+
* This adds the app group entitlement to the main app's entitlements
|
|
9
|
+
* so that EAS can properly configure provisioning profiles.
|
|
10
|
+
*/
|
|
11
|
+
const configureEas = (config, props = {}) => {
|
|
12
|
+
if (!props.groupIdentifier) {
|
|
13
|
+
// No group identifier provided, skip EAS configuration
|
|
14
|
+
return config;
|
|
15
|
+
}
|
|
16
|
+
// Ensure ios.entitlements exists in config for EAS to detect
|
|
17
|
+
if (!config.ios) {
|
|
18
|
+
config.ios = {};
|
|
19
|
+
}
|
|
20
|
+
if (!config.ios.entitlements) {
|
|
21
|
+
config.ios.entitlements = {};
|
|
22
|
+
}
|
|
23
|
+
// Add app groups entitlement for EAS
|
|
24
|
+
(0, entitlements_1.addApplicationGroupsEntitlement)(config.ios.entitlements, props.groupIdentifier);
|
|
25
|
+
return config;
|
|
26
|
+
};
|
|
27
|
+
exports.configureEas = configureEas;
|
|
28
|
+
//# sourceMappingURL=eas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eas.js","sourceRoot":"","sources":["../../../src/ios/eas.ts"],"names":[],"mappings":";;;AAEA,wDAAuE;AAMvE;;;;;GAKG;AACI,MAAM,YAAY,GAAoC,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IAClF,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QAC3B,uDAAuD;QACvD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,6DAA6D;IAC7D,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,GAAG,GAAG,EAAE,CAAA;IACjB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,YAAY,GAAG,EAAE,CAAA;IAC9B,CAAC;IAED,qCAAqC;IACrC,IAAA,8CAA+B,EAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAE/E,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAlBY,QAAA,YAAY,gBAkBxB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureEntitlements = void 0;
|
|
4
|
+
const entitlements_1 = require("../utils/entitlements");
|
|
5
|
+
/**
|
|
6
|
+
* Configures main app entitlements for app groups and keychain sharing.
|
|
7
|
+
*
|
|
8
|
+
* This adds:
|
|
9
|
+
* - com.apple.security.application-groups entitlement for data sharing
|
|
10
|
+
* - keychain-access-groups entitlement for shared credential access (if keychainGroup provided)
|
|
11
|
+
*/
|
|
12
|
+
const configureEntitlements = (config, props = {}) => {
|
|
13
|
+
if (!props.groupIdentifier && !props.keychainGroup) {
|
|
14
|
+
// Nothing to configure
|
|
15
|
+
return config;
|
|
16
|
+
}
|
|
17
|
+
if (!config.ios) {
|
|
18
|
+
config.ios = {};
|
|
19
|
+
}
|
|
20
|
+
if (!config.ios.entitlements) {
|
|
21
|
+
config.ios.entitlements = {};
|
|
22
|
+
}
|
|
23
|
+
if (props.groupIdentifier) {
|
|
24
|
+
(0, entitlements_1.addApplicationGroupsEntitlement)(config.ios.entitlements, props.groupIdentifier);
|
|
25
|
+
}
|
|
26
|
+
if (props.keychainGroup) {
|
|
27
|
+
addKeychainAccessGroupEntitlement(config.ios.entitlements, props.keychainGroup);
|
|
28
|
+
}
|
|
29
|
+
return config;
|
|
30
|
+
};
|
|
31
|
+
exports.configureEntitlements = configureEntitlements;
|
|
32
|
+
/**
|
|
33
|
+
* Adds keychain-access-groups entitlement to an entitlements object.
|
|
34
|
+
* Ensures the group list is deduped and preserves existing order.
|
|
35
|
+
*/
|
|
36
|
+
function addKeychainAccessGroupEntitlement(entitlements, keychainGroup) {
|
|
37
|
+
const existingGroups = (entitlements['keychain-access-groups'] ?? []).filter(Boolean);
|
|
38
|
+
const deduped = Array.from(new Set(existingGroups));
|
|
39
|
+
if (deduped.includes(keychainGroup)) {
|
|
40
|
+
entitlements['keychain-access-groups'] = deduped;
|
|
41
|
+
return entitlements;
|
|
42
|
+
}
|
|
43
|
+
entitlements['keychain-access-groups'] = [...deduped, keychainGroup];
|
|
44
|
+
return entitlements;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=entitlements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitlements.js","sourceRoot":"","sources":["../../../src/ios/entitlements.ts"],"names":[],"mappings":";;;AAEA,wDAAuE;AAOvE;;;;;;GAMG;AACI,MAAM,qBAAqB,GAA6C,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IACpG,IAAI,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACnD,uBAAuB;QACvB,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,GAAG,GAAG,EAAE,CAAA;IACjB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,YAAY,GAAG,EAAE,CAAA;IAC9B,CAAC;IAED,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;QAC1B,IAAA,8CAA+B,EAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IACjF,CAAC;IAED,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACxB,iCAAiC,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IACjF,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAtBY,QAAA,qBAAqB,yBAsBjC;AAED;;;GAGG;AACH,SAAS,iCAAiC,CACxC,YAAiC,EACjC,aAAqB;IAErB,MAAM,cAAc,GAAG,CAAE,YAAY,CAAC,wBAAwB,CAAc,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACnG,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC,CAAA;IAEnD,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACpC,YAAY,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAA;QAChD,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,YAAY,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,CAAA;IACpE,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withPushNotifications = void 0;
|
|
4
|
+
exports.withIOS = withIOS;
|
|
5
|
+
const eas_1 = require("./eas");
|
|
6
|
+
const entitlements_1 = require("./entitlements");
|
|
7
|
+
const infoPlist_1 = require("./infoPlist");
|
|
8
|
+
/**
|
|
9
|
+
* Main iOS app configuration.
|
|
10
|
+
*
|
|
11
|
+
* This configures the main app (not the widget extension) for:
|
|
12
|
+
* - Live Activities support (Info.plist)
|
|
13
|
+
* - App groups for widget communication (entitlements)
|
|
14
|
+
* - Keychain sharing for widget server credentials (entitlements)
|
|
15
|
+
* - EAS build configuration
|
|
16
|
+
*/
|
|
17
|
+
function withIOS(config, props) {
|
|
18
|
+
// Configure Info.plist
|
|
19
|
+
config = (0, infoPlist_1.configureInfoPlist)(config, {
|
|
20
|
+
groupIdentifier: props.groupIdentifier,
|
|
21
|
+
widgetIds: props.widgetIds,
|
|
22
|
+
widgets: props.widgets,
|
|
23
|
+
keychainGroup: props.keychainGroup,
|
|
24
|
+
});
|
|
25
|
+
// Configure entitlements
|
|
26
|
+
config = (0, entitlements_1.configureEntitlements)(config, {
|
|
27
|
+
groupIdentifier: props.groupIdentifier,
|
|
28
|
+
keychainGroup: props.keychainGroup,
|
|
29
|
+
});
|
|
30
|
+
// Configure EAS
|
|
31
|
+
config = (0, eas_1.configureEas)(config, {
|
|
32
|
+
groupIdentifier: props.groupIdentifier,
|
|
33
|
+
});
|
|
34
|
+
return config;
|
|
35
|
+
}
|
|
36
|
+
// Re-export for convenience
|
|
37
|
+
var pushNotifications_1 = require("./pushNotifications");
|
|
38
|
+
Object.defineProperty(exports, "withPushNotifications", { enumerable: true, get: function () { return pushNotifications_1.withPushNotifications; } });
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ios/index.ts"],"names":[],"mappings":";;;AAsBA,0BAqBC;AAzCD,+BAAoC;AACpC,iDAAsD;AACtD,2CAAgD;AAShD;;;;;;;;GAQG;AACH,SAAgB,OAAO,CAAC,MAAkB,EAAE,KAAqB;IAC/D,uBAAuB;IACvB,MAAM,GAAG,IAAA,8BAAkB,EAAC,MAAM,EAAE;QAClC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAC,CAAA;IAEF,yBAAyB;IACzB,MAAM,GAAG,IAAA,oCAAqB,EAAC,MAAM,EAAE;QACrC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAC,CAAA;IAEF,gBAAgB;IAChB,MAAM,GAAG,IAAA,kBAAY,EAAC,MAAM,EAAE;QAC5B,eAAe,EAAE,KAAK,CAAC,eAAe;KACvC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAED,4BAA4B;AAC5B,yDAA2D;AAAlD,0HAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureInfoPlist = void 0;
|
|
4
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
+
/**
|
|
6
|
+
* Configures main app Info.plist for Live Activities and widgets.
|
|
7
|
+
*
|
|
8
|
+
* This adds:
|
|
9
|
+
* - NSSupportsLiveActivities: Enables Live Activities support
|
|
10
|
+
* - Voltra_AppGroupIdentifier: App group ID for widget communication (if provided)
|
|
11
|
+
* - Voltra_WidgetIds: Array of widget IDs for native module access (if provided)
|
|
12
|
+
* - Voltra_WidgetServerUrls: Map of widget IDs to server URLs (if any widgets have serverUpdate)
|
|
13
|
+
* - Voltra_WidgetServerIntervals: Map of widget IDs to update intervals (if any widgets have serverUpdate)
|
|
14
|
+
* - Voltra_KeychainGroup: Keychain access group for shared credentials (if provided)
|
|
15
|
+
*/
|
|
16
|
+
const configureInfoPlist = (config, props = {}) => {
|
|
17
|
+
return (0, config_plugins_1.withInfoPlist)(config, (mod) => {
|
|
18
|
+
mod.modResults.NSSupportsLiveActivities = true;
|
|
19
|
+
mod.modResults.NSSupportsLiveActivitiesFrequentUpdates = false;
|
|
20
|
+
// Only add group identifier if provided
|
|
21
|
+
if (props.groupIdentifier) {
|
|
22
|
+
mod.modResults.Voltra_AppGroupIdentifier = props.groupIdentifier;
|
|
23
|
+
}
|
|
24
|
+
// Store widget IDs in Info.plist for native module to access
|
|
25
|
+
if (props.widgetIds && props.widgetIds.length > 0) {
|
|
26
|
+
mod.modResults.Voltra_WidgetIds = props.widgetIds;
|
|
27
|
+
}
|
|
28
|
+
// Configure server update URLs and intervals for widgets
|
|
29
|
+
if (props.widgets && props.widgets.length > 0) {
|
|
30
|
+
const serverUrls = {};
|
|
31
|
+
const serverIntervals = {};
|
|
32
|
+
for (const widget of props.widgets) {
|
|
33
|
+
if (widget.serverUpdate) {
|
|
34
|
+
serverUrls[widget.id] = widget.serverUpdate.url;
|
|
35
|
+
serverIntervals[widget.id] = widget.serverUpdate.intervalMinutes ?? 15;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (Object.keys(serverUrls).length > 0) {
|
|
39
|
+
mod.modResults.Voltra_WidgetServerUrls = serverUrls;
|
|
40
|
+
mod.modResults.Voltra_WidgetServerIntervals = serverIntervals;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Store Keychain group identifier for shared credential access
|
|
44
|
+
if (props.keychainGroup) {
|
|
45
|
+
mod.modResults.Voltra_KeychainGroup = props.keychainGroup;
|
|
46
|
+
}
|
|
47
|
+
return mod;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.configureInfoPlist = configureInfoPlist;
|
|
51
|
+
//# sourceMappingURL=infoPlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoPlist.js","sourceRoot":"","sources":["../../../src/ios/infoPlist.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAWlE;;;;;;;;;;GAUG;AACI,MAAM,kBAAkB,GAA0C,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IAC9F,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/D,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxB,GAAG,CAAC,UAAU,CAAC,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAA;QAC3D,CAAC;QAED,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAxCY,QAAA,kBAAkB,sBAwC9B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withPushNotifications = void 0;
|
|
4
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
+
/**
|
|
6
|
+
* Plugin that enables push notification support for Live Activities.
|
|
7
|
+
*
|
|
8
|
+
* This:
|
|
9
|
+
* - Adds the aps-environment entitlement for push notifications
|
|
10
|
+
* - Adds Voltra_EnablePushNotifications flag to Info.plist
|
|
11
|
+
*/
|
|
12
|
+
const withPushNotifications = (config) => (0, config_plugins_1.withInfoPlist)((0, config_plugins_1.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
|
+
}), (mod) => {
|
|
18
|
+
mod.modResults['Voltra_EnablePushNotifications'] = true;
|
|
19
|
+
return mod;
|
|
20
|
+
});
|
|
21
|
+
exports.withPushNotifications = withPushNotifications;
|
|
22
|
+
//# sourceMappingURL=pushNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pushNotifications.js","sourceRoot":"","sources":["../../../src/ios/pushNotifications.ts"],"names":[],"mappings":";;;AAAA,yDAAyF;AAEzF;;;;;;GAMG;AACI,MAAM,qBAAqB,GAAiB,CAAC,MAAM,EAAE,EAAE,CAC5D,IAAA,8BAAa,EACX,IAAA,sCAAqB,EAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;IACpC,mFAAmF;IACnF,4CAA4C;IAC5C,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAA;IACjD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAC,EACF,CAAC,GAAG,EAAE,EAAE;IACN,GAAG,CAAC,UAAU,CAAC,gCAAgC,CAAC,GAAG,IAAI,CAAA;IACvD,OAAO,GAAG,CAAA;AACZ,CAAC,CACF,CAAA;AAZU,QAAA,qBAAqB,yBAY/B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureEasBuild = void 0;
|
|
4
|
+
const entitlements_1 = require("../utils/entitlements");
|
|
5
|
+
const entitlements_2 = require("./files/entitlements");
|
|
6
|
+
/**
|
|
7
|
+
* Plugin step that configures EAS build settings for the widget extension.
|
|
8
|
+
*
|
|
9
|
+
* This:
|
|
10
|
+
* - Adds the widget extension to the EAS build experimental iOS appExtensions
|
|
11
|
+
* - Configures entitlements for both the extension and main app
|
|
12
|
+
*/
|
|
13
|
+
const configureEasBuild = (config, { bundleIdentifier, targetName, groupIdentifier }) => {
|
|
14
|
+
let configIndex = null;
|
|
15
|
+
// Check if extension already exists
|
|
16
|
+
config.extra?.eas?.build?.experimental?.ios?.appExtensions?.forEach((ext, index) => {
|
|
17
|
+
if (ext.targetName === targetName) {
|
|
18
|
+
configIndex = index;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
// Add extension if not already present
|
|
22
|
+
if (configIndex === null) {
|
|
23
|
+
config.extra = {
|
|
24
|
+
...config.extra,
|
|
25
|
+
eas: {
|
|
26
|
+
...config.extra?.eas,
|
|
27
|
+
build: {
|
|
28
|
+
...config.extra?.eas?.build,
|
|
29
|
+
experimental: {
|
|
30
|
+
...config.extra?.eas?.build?.experimental,
|
|
31
|
+
ios: {
|
|
32
|
+
...config.extra?.eas?.build?.experimental?.ios,
|
|
33
|
+
appExtensions: [
|
|
34
|
+
...(config.extra?.eas?.build?.experimental?.ios?.appExtensions ?? []),
|
|
35
|
+
{
|
|
36
|
+
targetName,
|
|
37
|
+
bundleIdentifier,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
configIndex = (config.extra?.eas?.build?.experimental?.ios?.appExtensions?.length ?? 1) - 1;
|
|
46
|
+
}
|
|
47
|
+
// Configure entitlements (may be empty if no groupIdentifier)
|
|
48
|
+
if (configIndex != null && config.extra) {
|
|
49
|
+
const widgetsExtensionConfig = config.extra.eas.build.experimental.ios.appExtensions[configIndex];
|
|
50
|
+
widgetsExtensionConfig.entitlements = {
|
|
51
|
+
...widgetsExtensionConfig.entitlements,
|
|
52
|
+
...(0, entitlements_2.getWidgetExtensionEntitlements)(groupIdentifier),
|
|
53
|
+
};
|
|
54
|
+
if (groupIdentifier) {
|
|
55
|
+
config.ios = {
|
|
56
|
+
...config.ios,
|
|
57
|
+
entitlements: {
|
|
58
|
+
...(0, entitlements_1.addApplicationGroupsEntitlement)(config.ios?.entitlements ?? {}, groupIdentifier),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return config;
|
|
64
|
+
};
|
|
65
|
+
exports.configureEasBuild = configureEasBuild;
|
|
66
|
+
//# sourceMappingURL=eas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eas.js","sourceRoot":"","sources":["../../../src/ios-widget/eas.ts"],"names":[],"mappings":";;;AAEA,wDAAuE;AACvE,uDAAqE;AAQrE;;;;;;GAMG;AACI,MAAM,iBAAiB,GAAyC,CACrE,MAAM,EACN,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,EACjD,EAAE;IACF,IAAI,WAAW,GAAkB,IAAI,CAAA;IAErC,oCAAoC;IACpC,MAAM,CAAC,KAAK,EAAE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,WAAW,CAAC,CAAA;QAEjG,sBAAsB,CAAC,YAAY,GAAG;YACpC,GAAG,sBAAsB,CAAC,YAAY;YACtC,GAAG,IAAA,6CAA8B,EAAC,eAAe,CAAC;SACnD,CAAA;QAED,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,CAAC,GAAG,GAAG;gBACX,GAAG,MAAM,CAAC,GAAG;gBACb,YAAY,EAAE;oBACZ,GAAG,IAAA,8CAA+B,EAAC,MAAM,CAAC,GAAG,EAAE,YAAY,IAAI,EAAE,EAAE,eAAe,CAAC;iBACpF;aACF,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA5DY,QAAA,iBAAiB,qBA4D7B"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateAssets = generateAssets;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const constants_1 = require("../../constants");
|
|
40
|
+
const logger_1 = require("../../utils/logger");
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// Main Function
|
|
43
|
+
// ============================================================================
|
|
44
|
+
/**
|
|
45
|
+
* Generates all asset files for the widget extension.
|
|
46
|
+
*
|
|
47
|
+
* This creates:
|
|
48
|
+
* - Assets.xcassets/ directory structure
|
|
49
|
+
* - Copies user images to the asset catalog
|
|
50
|
+
*/
|
|
51
|
+
function generateAssets(options) {
|
|
52
|
+
const { targetPath, userImagesPath = constants_1.DEFAULT_USER_IMAGES_PATH } = options;
|
|
53
|
+
// Generate Assets.xcassets structure
|
|
54
|
+
generateAssetsCatalog(targetPath);
|
|
55
|
+
logger_1.logger.info('Generated Assets.xcassets');
|
|
56
|
+
// Copy user images to asset catalog
|
|
57
|
+
const assetsPath = path.join(targetPath, 'Assets.xcassets');
|
|
58
|
+
copyUserImages(userImagesPath, assetsPath);
|
|
59
|
+
}
|
|
60
|
+
// ============================================================================
|
|
61
|
+
// Asset Catalog
|
|
62
|
+
// ============================================================================
|
|
63
|
+
/**
|
|
64
|
+
* Contents.json for the root of Assets.xcassets
|
|
65
|
+
*/
|
|
66
|
+
const ASSETS_CATALOG_CONTENTS = {
|
|
67
|
+
info: {
|
|
68
|
+
author: 'xcode',
|
|
69
|
+
version: 1,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Contents.json for an imageset
|
|
74
|
+
*/
|
|
75
|
+
function createImagesetContents(filename) {
|
|
76
|
+
return {
|
|
77
|
+
images: [
|
|
78
|
+
{
|
|
79
|
+
filename,
|
|
80
|
+
idiom: 'universal',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
info: {
|
|
84
|
+
author: 'xcode',
|
|
85
|
+
version: 1,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Generates the Assets.xcassets directory structure for a widget extension.
|
|
91
|
+
*
|
|
92
|
+
* Creates the minimal required asset catalog structure:
|
|
93
|
+
* - Assets.xcassets/
|
|
94
|
+
* - Contents.json (required root manifest)
|
|
95
|
+
*
|
|
96
|
+
* @param targetPath - Path to the widget extension target directory
|
|
97
|
+
*/
|
|
98
|
+
function generateAssetsCatalog(targetPath) {
|
|
99
|
+
const assetsPath = path.join(targetPath, 'Assets.xcassets');
|
|
100
|
+
// Create Assets.xcassets directory
|
|
101
|
+
if (!fs.existsSync(assetsPath)) {
|
|
102
|
+
fs.mkdirSync(assetsPath, { recursive: true });
|
|
103
|
+
}
|
|
104
|
+
// Write root Contents.json
|
|
105
|
+
fs.writeFileSync(path.join(assetsPath, 'Contents.json'), JSON.stringify(ASSETS_CATALOG_CONTENTS, null, 2));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Adds an image to the Assets.xcassets catalog as an imageset.
|
|
109
|
+
*
|
|
110
|
+
* Creates:
|
|
111
|
+
* - {imageName}.imageset/
|
|
112
|
+
* - {originalFilename}
|
|
113
|
+
* - Contents.json
|
|
114
|
+
*
|
|
115
|
+
* @param assetsPath - Path to Assets.xcassets directory
|
|
116
|
+
* @param imagePath - Path to the source image file
|
|
117
|
+
*/
|
|
118
|
+
function addImageToAssetsCatalog(assetsPath, imagePath) {
|
|
119
|
+
const filename = path.basename(imagePath);
|
|
120
|
+
const imageName = path.basename(filename, path.extname(filename));
|
|
121
|
+
const imagesetPath = path.join(assetsPath, `${imageName}.imageset`);
|
|
122
|
+
// Create imageset directory
|
|
123
|
+
if (!fs.existsSync(imagesetPath)) {
|
|
124
|
+
fs.mkdirSync(imagesetPath, { recursive: true });
|
|
125
|
+
}
|
|
126
|
+
// Copy the image file
|
|
127
|
+
fs.copyFileSync(imagePath, path.join(imagesetPath, filename));
|
|
128
|
+
// Write Contents.json for the imageset
|
|
129
|
+
fs.writeFileSync(path.join(imagesetPath, 'Contents.json'), JSON.stringify(createImagesetContents(filename), null, 2));
|
|
130
|
+
}
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// Image Handling
|
|
133
|
+
// ============================================================================
|
|
134
|
+
/**
|
|
135
|
+
* Checks if an image file exceeds the size limit for Live Activities.
|
|
136
|
+
* Logs a warning if the image is too large.
|
|
137
|
+
*
|
|
138
|
+
* @param imagePath - Path to the image file
|
|
139
|
+
* @returns true if the image is within the size limit, false otherwise
|
|
140
|
+
*/
|
|
141
|
+
function checkImageSize(imagePath) {
|
|
142
|
+
const stats = fs.statSync(imagePath);
|
|
143
|
+
const imageSizeInBytes = stats.size;
|
|
144
|
+
if (imageSizeInBytes >= constants_1.MAX_IMAGE_SIZE_BYTES) {
|
|
145
|
+
const fileName = path.basename(imagePath);
|
|
146
|
+
logger_1.logger.warnRed(`Image "${fileName}" is ${imageSizeInBytes} bytes (${(imageSizeInBytes / 1024).toFixed(2)}KB). ` +
|
|
147
|
+
`This image will not display correctly in Live Activities as images for Live Activities need to be lower than 4KB.`);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Checks if a file is a supported image type.
|
|
154
|
+
*/
|
|
155
|
+
function isSupportedImage(filePath) {
|
|
156
|
+
return constants_1.SUPPORTED_IMAGE_EXTENSIONS.test(path.extname(filePath));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Copies user images from the source directory to the widget's Assets.xcassets.
|
|
160
|
+
*
|
|
161
|
+
* Images are validated for size (must be < 4KB for Live Activities) and
|
|
162
|
+
* added as imagesets to the asset catalog.
|
|
163
|
+
*
|
|
164
|
+
* @param userImagesPath - Path to directory containing user images (relative to project root)
|
|
165
|
+
* @param targetAssetsPath - Path to the Assets.xcassets directory in the widget target
|
|
166
|
+
* @returns Array of image filenames that were copied
|
|
167
|
+
*/
|
|
168
|
+
function copyUserImages(userImagesPath, targetAssetsPath) {
|
|
169
|
+
const copiedImages = [];
|
|
170
|
+
if (!fs.existsSync(userImagesPath)) {
|
|
171
|
+
logger_1.logger.warn(`Skipping user images: directory does not exist at ${userImagesPath}`);
|
|
172
|
+
return copiedImages;
|
|
173
|
+
}
|
|
174
|
+
if (!fs.lstatSync(userImagesPath).isDirectory()) {
|
|
175
|
+
logger_1.logger.warn(`Skipping user images: ${userImagesPath} is not a directory`);
|
|
176
|
+
return copiedImages;
|
|
177
|
+
}
|
|
178
|
+
const files = fs.readdirSync(userImagesPath);
|
|
179
|
+
for (const file of files) {
|
|
180
|
+
const sourcePath = path.join(userImagesPath, file);
|
|
181
|
+
// Skip directories and non-image files
|
|
182
|
+
if (fs.lstatSync(sourcePath).isDirectory()) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (!isSupportedImage(file)) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
// Check image size for Live Activity compatibility (warns if too large)
|
|
189
|
+
checkImageSize(sourcePath);
|
|
190
|
+
// Add to asset catalog
|
|
191
|
+
addImageToAssetsCatalog(targetAssetsPath, sourcePath);
|
|
192
|
+
copiedImages.push(file);
|
|
193
|
+
}
|
|
194
|
+
if (copiedImages.length > 0) {
|
|
195
|
+
logger_1.logger.info(`Copied ${copiedImages.length} user image(s) to widget assets`);
|
|
196
|
+
}
|
|
197
|
+
return copiedImages;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../../../src/ios-widget/files/assets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,wCAUC;AAhCD,uCAAwB;AACxB,2CAA4B;AAE5B,+CAA4G;AAC5G,+CAA2C;AAO3C,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,OAA8B;IAC3D,MAAM,EAAE,UAAU,EAAE,cAAc,GAAG,oCAAwB,EAAE,GAAG,OAAO,CAAA;IAEzE,qCAAqC;IACrC,qBAAqB,CAAC,UAAU,CAAC,CAAA;IACjC,eAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;IAExC,oCAAoC;IACpC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;IAC3D,cAAc,CAAC,cAAc,EAAE,UAAU,CAAC,CAAA;AAC5C,CAAC;AAED,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE;QACJ,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,CAAC;KACX;CACF,CAAA;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,QAAgB;IAC9C,OAAO;QACL,MAAM,EAAE;YACN;gBACE,QAAQ;gBACR,KAAK,EAAE,WAAW;aACnB;SACF;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,CAAC;SACX;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,iBAAiB,CAAC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AK,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;QAElD,uCAAuC;QACvC,IAAI,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC3C,SAAQ;QACV,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,SAAQ;QACV,CAAC;QAED,wEAAwE;QACxE,cAAc,CAAC,UAAU,CAAC,CAAA;QAE1B,uBAAuB;QACvB,uBAAuB,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;QACrD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,eAAM,CAAC,IAAI,CAAC,UAAU,YAAY,CAAC,MAAM,iCAAiC,CAAC,CAAA;IAC7E,CAAC;IAED,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getWidgetExtensionEntitlements = getWidgetExtensionEntitlements;
|
|
40
|
+
exports.generateEntitlements = generateEntitlements;
|
|
41
|
+
const plist_1 = __importDefault(require("@expo/plist"));
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const entitlements_1 = require("../../utils/entitlements");
|
|
45
|
+
const logger_1 = require("../../utils/logger");
|
|
46
|
+
/**
|
|
47
|
+
* Gets the entitlements for the widget extension.
|
|
48
|
+
*/
|
|
49
|
+
function getWidgetExtensionEntitlements(groupIdentifier, keychainGroup) {
|
|
50
|
+
const entitlements = {};
|
|
51
|
+
if (groupIdentifier) {
|
|
52
|
+
(0, entitlements_1.addApplicationGroupsEntitlement)(entitlements, groupIdentifier);
|
|
53
|
+
}
|
|
54
|
+
if (keychainGroup) {
|
|
55
|
+
const existingGroups = (entitlements['keychain-access-groups'] ?? []).filter(Boolean);
|
|
56
|
+
const deduped = Array.from(new Set(existingGroups));
|
|
57
|
+
if (!deduped.includes(keychainGroup)) {
|
|
58
|
+
deduped.push(keychainGroup);
|
|
59
|
+
}
|
|
60
|
+
entitlements['keychain-access-groups'] = deduped;
|
|
61
|
+
}
|
|
62
|
+
return entitlements;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Generates the entitlements file for the widget extension.
|
|
66
|
+
*
|
|
67
|
+
* @param options - Generation options
|
|
68
|
+
*/
|
|
69
|
+
function generateEntitlements(options) {
|
|
70
|
+
const { targetPath, targetName, groupIdentifier, keychainGroup } = options;
|
|
71
|
+
const filePath = path.join(targetPath, `${targetName}.entitlements`);
|
|
72
|
+
const extensionEntitlements = getWidgetExtensionEntitlements(groupIdentifier, keychainGroup);
|
|
73
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
74
|
+
fs.writeFileSync(filePath, plist_1.default.build(extensionEntitlements));
|
|
75
|
+
logger_1.logger.info(`Generated ${targetName}.entitlements`);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=entitlements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitlements.js","sourceRoot":"","sources":["../../../../src/ios-widget/files/entitlements.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,wEAcC;AAcD,oDASC;AA/CD,wDAA+B;AAC/B,uCAAwB;AACxB,2CAA4B;AAE5B,2DAA0E;AAC1E,+CAA2C;AAE3C;;GAEG;AACH,SAAgB,8BAA8B,CAAC,eAAwB,EAAE,aAAsB;IAC7F,MAAM,YAAY,GAAwB,EAAE,CAAA;IAC5C,IAAI,eAAe,EAAE,CAAC;QACpB,IAAA,8CAA+B,EAAC,YAAY,EAAE,eAAe,CAAC,CAAA;IAChE,CAAC;IACD,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,cAAc,GAAG,CAAE,YAAY,CA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