expo-targets 0.2.0 → 0.2.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.
Files changed (194) hide show
  1. package/build/metro/src/withTargetsMetro.d.ts +0 -1
  2. package/build/metro/src/withTargetsMetro.d.ts.map +1 -1
  3. package/build/metro/src/withTargetsMetro.js +21 -114
  4. package/build/metro/src/withTargetsMetro.js.map +1 -1
  5. package/build/plugin/src/config.d.ts +23 -1
  6. package/build/plugin/src/config.d.ts.map +1 -1
  7. package/build/plugin/src/config.js +3 -1
  8. package/build/plugin/src/config.js.map +1 -1
  9. package/build/plugin/src/ios/config-plugins/withIOSTarget.d.ts.map +1 -1
  10. package/build/plugin/src/ios/config-plugins/withIOSTarget.js +17 -5
  11. package/build/plugin/src/ios/config-plugins/withIOSTarget.js.map +1 -1
  12. package/build/plugin/src/ios/config-plugins/withPodfile.d.ts.map +1 -1
  13. package/build/plugin/src/ios/config-plugins/withPodfile.js +3 -5
  14. package/build/plugin/src/ios/config-plugins/withPodfile.js.map +1 -1
  15. package/build/plugin/src/ios/config-plugins/withXcodeChanges.d.ts.map +1 -1
  16. package/build/plugin/src/ios/config-plugins/withXcodeChanges.js +63 -2
  17. package/build/plugin/src/ios/config-plugins/withXcodeChanges.js.map +1 -1
  18. package/build/plugin/src/ios/target.d.ts.map +1 -1
  19. package/build/plugin/src/ios/target.js +71 -11
  20. package/build/plugin/src/ios/target.js.map +1 -1
  21. package/build/plugin/src/ios/utils/index.d.ts +1 -0
  22. package/build/plugin/src/ios/utils/index.d.ts.map +1 -1
  23. package/build/plugin/src/ios/utils/index.js +2 -1
  24. package/build/plugin/src/ios/utils/index.js.map +1 -1
  25. package/build/plugin/src/ios/utils/plist.d.ts.map +1 -1
  26. package/build/plugin/src/ios/utils/plist.js +1 -0
  27. package/build/plugin/src/ios/utils/plist.js.map +1 -1
  28. package/build/plugin/src/ios/utils/podfile.d.ts.map +1 -1
  29. package/build/plugin/src/ios/utils/podfile.js +55 -22
  30. package/build/plugin/src/ios/utils/podfile.js.map +1 -1
  31. package/build/plugin/src/ios/utils/safari.d.ts +69 -0
  32. package/build/plugin/src/ios/utils/safari.d.ts.map +1 -0
  33. package/build/plugin/src/ios/utils/safari.js +359 -0
  34. package/build/plugin/src/ios/utils/safari.js.map +1 -0
  35. package/build/plugin/src/withTargetsDir.d.ts.map +1 -1
  36. package/build/plugin/src/withTargetsDir.js +34 -0
  37. package/build/plugin/src/withTargetsDir.js.map +1 -1
  38. package/build/src/Target.d.ts +8 -1
  39. package/build/src/Target.d.ts.map +1 -1
  40. package/build/src/Target.js +136 -26
  41. package/build/src/Target.js.map +1 -1
  42. package/build/src/index.d.ts +3 -1
  43. package/build/src/index.d.ts.map +1 -1
  44. package/build/src/index.js +14 -1
  45. package/build/src/index.js.map +1 -1
  46. package/build/src/modules/safari/index.d.ts +109 -0
  47. package/build/src/modules/safari/index.d.ts.map +1 -0
  48. package/build/src/modules/safari/index.js +288 -0
  49. package/build/src/modules/safari/index.js.map +1 -0
  50. package/metro/{src/index.ts → build/index.d.ts} +1 -0
  51. package/metro/build/index.d.ts.map +1 -0
  52. package/metro/build/index.js +6 -0
  53. package/metro/build/index.js.map +1 -0
  54. package/metro/build/withTargetsMetro.d.ts +5 -0
  55. package/metro/build/withTargetsMetro.d.ts.map +1 -0
  56. package/metro/build/withTargetsMetro.js +78 -0
  57. package/metro/build/withTargetsMetro.js.map +1 -0
  58. package/package.json +11 -1
  59. package/plugin/build/android/withAndroidAppBuildGradle.d.ts +7 -0
  60. package/plugin/build/android/withAndroidAppBuildGradle.d.ts.map +1 -0
  61. package/plugin/build/android/withAndroidAppBuildGradle.js +31 -0
  62. package/plugin/build/android/withAndroidAppBuildGradle.js.map +1 -0
  63. package/plugin/build/android/withAndroidTarget.d.ts +10 -0
  64. package/plugin/build/android/withAndroidTarget.d.ts.map +1 -0
  65. package/plugin/build/android/withAndroidTarget.js +22 -0
  66. package/plugin/build/android/withAndroidTarget.js.map +1 -0
  67. package/plugin/build/android/withAndroidWidget.d.ts +13 -0
  68. package/plugin/build/android/withAndroidWidget.d.ts.map +1 -0
  69. package/plugin/build/android/withAndroidWidget.js +564 -0
  70. package/plugin/build/android/withAndroidWidget.js.map +1 -0
  71. package/plugin/build/config.d.ts +163 -0
  72. package/plugin/build/config.d.ts.map +1 -0
  73. package/plugin/build/config.js +56 -0
  74. package/plugin/build/config.js.map +1 -0
  75. package/plugin/build/index.d.ts +9 -0
  76. package/plugin/build/index.d.ts.map +1 -0
  77. package/plugin/build/index.js +11 -0
  78. package/plugin/build/index.js.map +1 -0
  79. package/plugin/build/ios/config-plugins/withEntitlements.d.ts +11 -0
  80. package/plugin/build/ios/config-plugins/withEntitlements.d.ts.map +1 -0
  81. package/plugin/build/ios/config-plugins/withEntitlements.js +49 -0
  82. package/plugin/build/ios/config-plugins/withEntitlements.js.map +1 -0
  83. package/plugin/build/ios/config-plugins/withIOSTarget.d.ts +17 -0
  84. package/plugin/build/ios/config-plugins/withIOSTarget.d.ts.map +1 -0
  85. package/plugin/build/ios/config-plugins/withIOSTarget.js +164 -0
  86. package/plugin/build/ios/config-plugins/withIOSTarget.js.map +1 -0
  87. package/plugin/build/ios/config-plugins/withIosColorset.d.ts +8 -0
  88. package/plugin/build/ios/config-plugins/withIosColorset.d.ts.map +1 -0
  89. package/plugin/build/ios/config-plugins/withIosColorset.js +25 -0
  90. package/plugin/build/ios/config-plugins/withIosColorset.js.map +1 -0
  91. package/plugin/build/ios/config-plugins/withIosStickerPack.d.ts +8 -0
  92. package/plugin/build/ios/config-plugins/withIosStickerPack.d.ts.map +1 -0
  93. package/plugin/build/ios/config-plugins/withIosStickerPack.js +52 -0
  94. package/plugin/build/ios/config-plugins/withIosStickerPack.js.map +1 -0
  95. package/plugin/build/ios/config-plugins/withPodfile.d.ts +12 -0
  96. package/plugin/build/ios/config-plugins/withPodfile.d.ts.map +1 -0
  97. package/plugin/build/ios/config-plugins/withPodfile.js +160 -0
  98. package/plugin/build/ios/config-plugins/withPodfile.js.map +1 -0
  99. package/plugin/build/ios/config-plugins/withXcodeChanges.d.ts +15 -0
  100. package/plugin/build/ios/config-plugins/withXcodeChanges.d.ts.map +1 -0
  101. package/plugin/build/ios/config-plugins/withXcodeChanges.js +707 -0
  102. package/plugin/build/ios/config-plugins/withXcodeChanges.js.map +1 -0
  103. package/plugin/build/ios/target.d.ts +41 -0
  104. package/plugin/build/ios/target.d.ts.map +1 -0
  105. package/plugin/build/ios/target.js +634 -0
  106. package/plugin/build/ios/target.js.map +1 -0
  107. package/plugin/build/ios/utils/asset.d.ts +60 -0
  108. package/plugin/build/ios/utils/asset.d.ts.map +1 -0
  109. package/plugin/build/ios/utils/asset.js +375 -0
  110. package/plugin/build/ios/utils/asset.js.map +1 -0
  111. package/plugin/build/ios/utils/file.d.ts +33 -0
  112. package/plugin/build/ios/utils/file.d.ts.map +1 -0
  113. package/plugin/build/ios/utils/file.js +88 -0
  114. package/plugin/build/ios/utils/file.js.map +1 -0
  115. package/plugin/{src/ios/utils/index.ts → build/ios/utils/index.d.ts} +2 -1
  116. package/plugin/build/ios/utils/index.d.ts.map +1 -0
  117. package/plugin/build/ios/utils/index.js +39 -0
  118. package/plugin/build/ios/utils/index.js.map +1 -0
  119. package/plugin/build/ios/utils/paths.d.ts +128 -0
  120. package/plugin/build/ios/utils/paths.d.ts.map +1 -0
  121. package/plugin/build/ios/utils/paths.js +141 -0
  122. package/plugin/build/ios/utils/paths.js.map +1 -0
  123. package/plugin/build/ios/utils/plist.d.ts +29 -0
  124. package/plugin/build/ios/utils/plist.d.ts.map +1 -0
  125. package/plugin/build/ios/utils/plist.js +115 -0
  126. package/plugin/build/ios/utils/plist.js.map +1 -0
  127. package/plugin/build/ios/utils/podfile.d.ts +82 -0
  128. package/plugin/build/ios/utils/podfile.d.ts.map +1 -0
  129. package/plugin/build/ios/utils/podfile.js +441 -0
  130. package/plugin/build/ios/utils/podfile.js.map +1 -0
  131. package/plugin/build/ios/utils/reactNativeSwift.d.ts +11 -0
  132. package/plugin/build/ios/utils/reactNativeSwift.d.ts.map +1 -0
  133. package/plugin/build/ios/utils/reactNativeSwift.js +263 -0
  134. package/plugin/build/ios/utils/reactNativeSwift.js.map +1 -0
  135. package/plugin/build/ios/utils/safari.d.ts +69 -0
  136. package/plugin/build/ios/utils/safari.d.ts.map +1 -0
  137. package/plugin/build/ios/utils/safari.js +359 -0
  138. package/plugin/build/ios/utils/safari.js.map +1 -0
  139. package/plugin/build/ios/utils/xcode.d.ts +185 -0
  140. package/plugin/build/ios/utils/xcode.d.ts.map +1 -0
  141. package/plugin/build/ios/utils/xcode.js +706 -0
  142. package/plugin/build/ios/utils/xcode.js.map +1 -0
  143. package/plugin/build/logger.d.ts +10 -0
  144. package/plugin/build/logger.d.ts.map +1 -0
  145. package/plugin/build/logger.js +62 -0
  146. package/plugin/build/logger.js.map +1 -0
  147. package/plugin/build/parseTargetConfig.d.ts +3 -0
  148. package/plugin/build/parseTargetConfig.d.ts.map +1 -0
  149. package/plugin/build/parseTargetConfig.js +113 -0
  150. package/plugin/build/parseTargetConfig.js.map +1 -0
  151. package/plugin/build/withTargetsDir.d.ts +6 -0
  152. package/plugin/build/withTargetsDir.d.ts.map +1 -0
  153. package/plugin/build/withTargetsDir.js +124 -0
  154. package/plugin/build/withTargetsDir.js.map +1 -0
  155. package/.eslintrc.js +0 -2
  156. package/metro/src/withTargetsMetro.ts +0 -247
  157. package/metro/tsconfig.build.json +0 -9
  158. package/plugin/src/android/withAndroidAppBuildGradle.ts +0 -34
  159. package/plugin/src/android/withAndroidTarget.ts +0 -26
  160. package/plugin/src/android/withAndroidWidget.ts +0 -778
  161. package/plugin/src/config.ts +0 -255
  162. package/plugin/src/index.ts +0 -19
  163. package/plugin/src/ios/config-plugins/withEntitlements.ts +0 -69
  164. package/plugin/src/ios/config-plugins/withIOSTarget.ts +0 -179
  165. package/plugin/src/ios/config-plugins/withIosColorset.ts +0 -29
  166. package/plugin/src/ios/config-plugins/withIosStickerPack.ts +0 -65
  167. package/plugin/src/ios/config-plugins/withPodfile.ts +0 -238
  168. package/plugin/src/ios/config-plugins/withXcodeChanges.ts +0 -891
  169. package/plugin/src/ios/target.ts +0 -668
  170. package/plugin/src/ios/utils/asset.ts +0 -490
  171. package/plugin/src/ios/utils/file.ts +0 -80
  172. package/plugin/src/ios/utils/paths.ts +0 -253
  173. package/plugin/src/ios/utils/plist.ts +0 -101
  174. package/plugin/src/ios/utils/podfile.ts +0 -534
  175. package/plugin/src/ios/utils/reactNativeSwift.ts +0 -283
  176. package/plugin/src/ios/utils/xcode.ts +0 -989
  177. package/plugin/src/logger.ts +0 -63
  178. package/plugin/src/parseTargetConfig.ts +0 -115
  179. package/plugin/src/types/normalize-colors.d.ts +0 -3
  180. package/plugin/src/withTargetsDir.ts +0 -120
  181. package/plugin/tsconfig.build.json +0 -9
  182. package/plugin/tsconfig.json +0 -9
  183. package/src/Target.ts +0 -239
  184. package/src/index.ts +0 -52
  185. package/src/modules/extension/index.ts +0 -54
  186. package/src/modules/messages/index.ts +0 -124
  187. package/src/modules/storage/index.ts +0 -126
  188. package/tsconfig.json +0 -8
  189. /package/plugin/{src → build}/ios/templates/MessagesViewController.swift +0 -0
  190. /package/plugin/{src → build}/ios/templates/ReactNativeViewController.swift +0 -0
  191. /package/plugin/{src → build}/ios/templates/action-extension-data.swift +0 -0
  192. /package/plugin/{src → build}/ios/templates/clip-extension-data.swift +0 -0
  193. /package/plugin/{src → build}/ios/templates/messages-extension-data.swift +0 -0
  194. /package/plugin/{src → build}/ios/templates/share-extension-data.swift +0 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * iOS asset utilities for creating colorsets, imagesets, etc.
3
+ */
4
+ /**
5
+ * Color components for iOS colorset.
6
+ */
7
+ interface ColorComponents {
8
+ red: string;
9
+ green: string;
10
+ blue: string;
11
+ alpha: string;
12
+ }
13
+ /**
14
+ * Normalize a color string to RGBA components for iOS.
15
+ */
16
+ export declare function normalizeColorToComponents(color: string): ColorComponents;
17
+ /**
18
+ * Create a colorset in Assets.xcassets.
19
+ */
20
+ export declare function createColorset({ colorsetPath, color, darkColor, }: {
21
+ colorsetPath: string;
22
+ color: string;
23
+ darkColor?: string;
24
+ }): void;
25
+ /**
26
+ * Create an empty imageset in Assets.xcassets.
27
+ */
28
+ export declare function createImageset({ imagesetPath, imageFilename, }: {
29
+ imagesetPath: string;
30
+ imageFilename?: string;
31
+ }): void;
32
+ /**
33
+ * Create the root Contents.json for Assets.xcassets.
34
+ */
35
+ export declare function createAssetsXcassetsRoot(assetsPath: string): void;
36
+ /**
37
+ * Create an individual sticker in a sticker pack.
38
+ */
39
+ export declare function createSticker({ stickerPath, filename, }: {
40
+ stickerPath: string;
41
+ filename: string;
42
+ }): void;
43
+ /**
44
+ * Create a sticker pack in Assets.xcassets.
45
+ */
46
+ export declare function createStickerPack({ stickerPackPath, name, assets, }: {
47
+ stickerPackPath: string;
48
+ name: string;
49
+ assets: string[];
50
+ }): void;
51
+ /**
52
+ * Create iMessage App Icon set in Assets.xcassets.
53
+ * Generates all 13 required icon sizes with proper cropping to maintain aspect ratio.
54
+ */
55
+ export declare function createIMessageAppIcon({ iconsetPath, sourceIconPath, }: {
56
+ iconsetPath: string;
57
+ sourceIconPath?: string;
58
+ }): void;
59
+ export {};
60
+ //# sourceMappingURL=asset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/ios/utils/asset.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;GAEG;AACH,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAezE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,SAAS,GACV,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAiCP;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,aAAa,GACd,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,IAAI,CA6BP;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAWjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAcP;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,eAAe,EACf,IAAI,EACJ,MAAM,GACP,EAAE;IACD,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,GAAG,IAAI,CAsBP;AAmGD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,cAAc,GACf,EAAE;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAqLP"}
@@ -0,0 +1,375 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.createIMessageAppIcon = exports.createStickerPack = exports.createSticker = exports.createAssetsXcassetsRoot = exports.createImageset = exports.createColorset = exports.normalizeColorToComponents = void 0;
30
+ const normalize_colors_1 = __importDefault(require("@react-native/normalize-colors"));
31
+ const path_1 = __importDefault(require("path"));
32
+ const FileUtils = __importStar(require("./file"));
33
+ /**
34
+ * Normalize a color string to RGBA components for iOS.
35
+ */
36
+ function normalizeColorToComponents(color) {
37
+ const normalized = (0, normalize_colors_1.default)(color);
38
+ if (normalized === null || normalized === undefined) {
39
+ throw new Error(`Invalid color: ${color}`);
40
+ }
41
+ const r = ((normalized >> 16) & 0xff) / 255;
42
+ const g = ((normalized >> 8) & 0xff) / 255;
43
+ const b = (normalized & 0xff) / 255;
44
+ const a = ((normalized >> 24) & 0xff) / 255;
45
+ return {
46
+ red: r.toFixed(3),
47
+ green: g.toFixed(3),
48
+ blue: b.toFixed(3),
49
+ alpha: a.toFixed(3),
50
+ };
51
+ }
52
+ exports.normalizeColorToComponents = normalizeColorToComponents;
53
+ /**
54
+ * Create a colorset in Assets.xcassets.
55
+ */
56
+ function createColorset({ colorsetPath, color, darkColor, }) {
57
+ FileUtils.ensureDirectoryExists(colorsetPath);
58
+ const colors = [
59
+ {
60
+ color: {
61
+ 'color-space': 'srgb',
62
+ components: normalizeColorToComponents(color),
63
+ },
64
+ idiom: 'universal',
65
+ },
66
+ ];
67
+ if (darkColor) {
68
+ colors.push({
69
+ appearances: [{ appearance: 'luminosity', value: 'dark' }],
70
+ color: {
71
+ 'color-space': 'srgb',
72
+ components: normalizeColorToComponents(darkColor),
73
+ },
74
+ idiom: 'universal',
75
+ });
76
+ }
77
+ const contentsJson = {
78
+ colors,
79
+ info: { author: 'xcode', version: 1 },
80
+ };
81
+ FileUtils.writeFileSafe(path_1.default.join(colorsetPath, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
82
+ }
83
+ exports.createColorset = createColorset;
84
+ /**
85
+ * Create an empty imageset in Assets.xcassets.
86
+ */
87
+ function createImageset({ imagesetPath, imageFilename, }) {
88
+ FileUtils.ensureDirectoryExists(imagesetPath);
89
+ const contentsJson = {
90
+ images: [
91
+ {
92
+ idiom: 'universal',
93
+ scale: '1x',
94
+ },
95
+ {
96
+ idiom: 'universal',
97
+ scale: '2x',
98
+ },
99
+ {
100
+ idiom: 'universal',
101
+ scale: '3x',
102
+ },
103
+ ],
104
+ info: { author: 'xcode', version: 1 },
105
+ };
106
+ if (imageFilename) {
107
+ contentsJson.images[0].filename = imageFilename;
108
+ }
109
+ FileUtils.writeFileSafe(path_1.default.join(imagesetPath, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
110
+ }
111
+ exports.createImageset = createImageset;
112
+ /**
113
+ * Create the root Contents.json for Assets.xcassets.
114
+ */
115
+ function createAssetsXcassetsRoot(assetsPath) {
116
+ FileUtils.ensureDirectoryExists(assetsPath);
117
+ const contentsJson = {
118
+ info: { author: 'xcode', version: 1 },
119
+ };
120
+ FileUtils.writeFileSafe(path_1.default.join(assetsPath, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
121
+ }
122
+ exports.createAssetsXcassetsRoot = createAssetsXcassetsRoot;
123
+ /**
124
+ * Create an individual sticker in a sticker pack.
125
+ */
126
+ function createSticker({ stickerPath, filename, }) {
127
+ FileUtils.ensureDirectoryExists(stickerPath);
128
+ const contentsJson = {
129
+ info: { author: 'xcode', version: 1 },
130
+ properties: {
131
+ filename,
132
+ },
133
+ };
134
+ FileUtils.writeFileSafe(path_1.default.join(stickerPath, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
135
+ }
136
+ exports.createSticker = createSticker;
137
+ /**
138
+ * Create a sticker pack in Assets.xcassets.
139
+ */
140
+ function createStickerPack({ stickerPackPath, name, assets, }) {
141
+ FileUtils.ensureDirectoryExists(stickerPackPath);
142
+ const stickers = assets.map((asset) => {
143
+ const baseName = path_1.default.basename(asset, path_1.default.extname(asset));
144
+ return {
145
+ filename: `${baseName}.sticker`,
146
+ };
147
+ });
148
+ const contentsJson = {
149
+ properties: {
150
+ 'grid-size': 'regular',
151
+ },
152
+ stickers,
153
+ info: { author: 'xcode', version: 1 },
154
+ };
155
+ FileUtils.writeFileSafe(path_1.default.join(stickerPackPath, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
156
+ }
157
+ exports.createStickerPack = createStickerPack;
158
+ /**
159
+ * Generate a single icon size using sips with proper cropping.
160
+ */
161
+ function generateIcon({ sourceIconPath, outputPath, width, height, }) {
162
+ try {
163
+ const { execSync } = require('child_process');
164
+ // Use sips -Z to crop to aspect ratio, then resize
165
+ // First crop to match aspect ratio, then resize to exact dimensions
166
+ const targetRatio = width / height;
167
+ // Create a temporary intermediate file for the cropped version
168
+ const tempPath = outputPath + '.temp.png';
169
+ // Get source dimensions
170
+ const sizeOutput = execSync(`sips -g pixelWidth -g pixelHeight "${sourceIconPath}"`, { encoding: 'utf-8' });
171
+ const widthMatch = sizeOutput.match(/pixelWidth: (\d+)/);
172
+ const heightMatch = sizeOutput.match(/pixelHeight: (\d+)/);
173
+ if (!widthMatch || !heightMatch) {
174
+ throw new Error('Could not determine source image dimensions');
175
+ }
176
+ const sourceWidth = parseInt(widthMatch[1], 10);
177
+ const sourceHeight = parseInt(heightMatch[1], 10);
178
+ const sourceRatio = sourceWidth / sourceHeight;
179
+ let cropWidth;
180
+ let cropHeight;
181
+ if (sourceRatio > targetRatio) {
182
+ // Source is wider, crop width
183
+ cropHeight = sourceHeight;
184
+ cropWidth = Math.round(sourceHeight * targetRatio);
185
+ }
186
+ else {
187
+ // Source is taller, crop height
188
+ cropWidth = sourceWidth;
189
+ cropHeight = Math.round(sourceWidth / targetRatio);
190
+ }
191
+ // Calculate crop position (center crop)
192
+ const cropX = Math.round((sourceWidth - cropWidth) / 2);
193
+ const cropY = Math.round((sourceHeight - cropHeight) / 2);
194
+ // Crop the image to the correct aspect ratio
195
+ execSync(`sips -c ${cropHeight} ${cropWidth} --cropOffset ${cropY} ${cropX} "${sourceIconPath}" --out "${tempPath}"`, { stdio: 'ignore' });
196
+ // Now resize to exact dimensions
197
+ execSync(`sips -z ${height} ${width} "${tempPath}" --out "${outputPath}"`, {
198
+ stdio: 'ignore',
199
+ });
200
+ // Clean up temp file
201
+ const fs = require('fs');
202
+ if (fs.existsSync(tempPath)) {
203
+ fs.unlinkSync(tempPath);
204
+ }
205
+ return true;
206
+ }
207
+ catch (error) {
208
+ console.error(`[expo-targets] Failed to generate icon ${outputPath}:`, error);
209
+ return false;
210
+ }
211
+ }
212
+ /**
213
+ * Create iMessage App Icon set in Assets.xcassets.
214
+ * Generates all 13 required icon sizes with proper cropping to maintain aspect ratio.
215
+ */
216
+ function createIMessageAppIcon({ iconsetPath, sourceIconPath, }) {
217
+ FileUtils.ensureDirectoryExists(iconsetPath);
218
+ // All required icon sizes for iMessage sticker packs
219
+ const iconSizes = [
220
+ {
221
+ filename: 'icon-iphone-29x29@2x.png',
222
+ width: 58,
223
+ height: 58,
224
+ size: '29x29',
225
+ idiom: 'iphone',
226
+ scale: '2x',
227
+ },
228
+ {
229
+ filename: 'icon-iphone-29x29@3x.png',
230
+ width: 87,
231
+ height: 87,
232
+ size: '29x29',
233
+ idiom: 'iphone',
234
+ scale: '3x',
235
+ },
236
+ {
237
+ filename: 'icon-iphone-60x45@2x.png',
238
+ width: 120,
239
+ height: 90,
240
+ size: '60x45',
241
+ idiom: 'iphone',
242
+ scale: '2x',
243
+ },
244
+ {
245
+ filename: 'icon-iphone-60x45@3x.png',
246
+ width: 180,
247
+ height: 135,
248
+ size: '60x45',
249
+ idiom: 'iphone',
250
+ scale: '3x',
251
+ },
252
+ {
253
+ filename: 'icon-ipad-29x29@2x.png',
254
+ width: 58,
255
+ height: 58,
256
+ size: '29x29',
257
+ idiom: 'ipad',
258
+ scale: '2x',
259
+ },
260
+ {
261
+ filename: 'icon-ipad-67x50@2x.png',
262
+ width: 134,
263
+ height: 100,
264
+ size: '67x50',
265
+ idiom: 'ipad',
266
+ scale: '2x',
267
+ },
268
+ {
269
+ filename: 'icon-ipad-74x55@2x.png',
270
+ width: 148,
271
+ height: 110,
272
+ size: '74x55',
273
+ idiom: 'ipad',
274
+ scale: '2x',
275
+ },
276
+ {
277
+ filename: 'icon-ios-marketing-1024x1024.png',
278
+ width: 1024,
279
+ height: 1024,
280
+ size: '1024x1024',
281
+ idiom: 'ios-marketing',
282
+ scale: '1x',
283
+ },
284
+ {
285
+ filename: 'icon-ios-27x20@2x.png',
286
+ width: 54,
287
+ height: 40,
288
+ size: '27x20',
289
+ idiom: 'universal',
290
+ scale: '2x',
291
+ platform: 'ios',
292
+ },
293
+ {
294
+ filename: 'icon-ios-27x20@3x.png',
295
+ width: 81,
296
+ height: 60,
297
+ size: '27x20',
298
+ idiom: 'universal',
299
+ scale: '3x',
300
+ platform: 'ios',
301
+ },
302
+ {
303
+ filename: 'icon-ios-32x24@2x.png',
304
+ width: 64,
305
+ height: 48,
306
+ size: '32x24',
307
+ idiom: 'universal',
308
+ scale: '2x',
309
+ platform: 'ios',
310
+ },
311
+ {
312
+ filename: 'icon-ios-32x24@3x.png',
313
+ width: 96,
314
+ height: 72,
315
+ size: '32x24',
316
+ idiom: 'universal',
317
+ scale: '3x',
318
+ platform: 'ios',
319
+ },
320
+ {
321
+ filename: 'icon-ios-1024x768.png',
322
+ width: 1024,
323
+ height: 768,
324
+ size: '1024x768',
325
+ idiom: 'ios-marketing',
326
+ scale: '1x',
327
+ platform: 'ios',
328
+ },
329
+ ];
330
+ // Create Contents.json with all icon references
331
+ const images = iconSizes.map((iconSize) => {
332
+ const entry = {
333
+ size: iconSize.size,
334
+ idiom: iconSize.idiom,
335
+ filename: iconSize.filename,
336
+ scale: iconSize.scale,
337
+ };
338
+ if (iconSize.platform) {
339
+ entry.platform = iconSize.platform;
340
+ }
341
+ return entry;
342
+ });
343
+ const contentsJson = {
344
+ images,
345
+ info: { author: 'xcode', version: 1 },
346
+ };
347
+ FileUtils.writeFileSafe(path_1.default.join(iconsetPath, 'Contents.json'), JSON.stringify(contentsJson, null, 2));
348
+ // Generate all icon sizes from source
349
+ if (sourceIconPath && FileUtils.isFile(sourceIconPath)) {
350
+ console.log(`[expo-targets] Generating iMessage App Icons from ${path_1.default.basename(sourceIconPath)}...`);
351
+ let successCount = 0;
352
+ for (const iconSize of iconSizes) {
353
+ const outputPath = path_1.default.join(iconsetPath, iconSize.filename);
354
+ const success = generateIcon({
355
+ sourceIconPath,
356
+ outputPath,
357
+ width: iconSize.width,
358
+ height: iconSize.height,
359
+ });
360
+ if (success) {
361
+ successCount++;
362
+ }
363
+ }
364
+ console.log(`[expo-targets] Generated ${successCount}/${iconSizes.length} iMessage App Icons`);
365
+ if (successCount < iconSizes.length) {
366
+ console.warn(`[expo-targets] Warning: Failed to generate ${iconSizes.length - successCount} icons. Build may fail.`);
367
+ }
368
+ }
369
+ else if (sourceIconPath) {
370
+ console.warn(`[expo-targets] iMessage App Icon source not found: ${sourceIconPath}`);
371
+ console.warn(`[expo-targets] Build will fail without proper icons. Please provide a valid icon source.`);
372
+ }
373
+ }
374
+ exports.createIMessageAppIcon = createIMessageAppIcon;
375
+ //# sourceMappingURL=asset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.js","sourceRoot":"","sources":["../../../src/ios/utils/asset.ts"],"names":[],"mappings":";;;;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O,EAAE,CAAC;gBACZ,YAAY,EAAE,CAAC;YACjB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CACT,4BAA4B,YAAY,IAAI,SAAS,CAAC,MAAM,qBAAqB,CAClF,CAAC;QAEF,IAAI,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CACV,8CAA8C,SAAS,CAAC,MAAM,GAAG,YAAY,yBAAyB,CACvG,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,cAAc,EAAE,CAAC;QAC1B,OAAO,CAAC,IAAI,CACV,sDAAsD,cAAc,EAAE,CACvE,CAAC;QACF,OAAO,CAAC,IAAI,CACV,0FAA0F,CAC3F,CAAC;IACJ,CAAC;AACH,CAAC;AA3LD,sDA2LC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * File system utilities for iOS target plugin operations.
3
+ * Provides safe, convenient wrappers for common file operations.
4
+ */
5
+ /**
6
+ * Ensure a directory exists, creating it recursively if needed.
7
+ */
8
+ export declare function ensureDirectoryExists(dirPath: string): void;
9
+ /**
10
+ * Write content to a file, ensuring the directory exists first.
11
+ */
12
+ export declare function writeFileSafe(filePath: string, content: string): void;
13
+ /**
14
+ * Copy a file, ensuring the destination directory exists.
15
+ */
16
+ export declare function copyFileSafe(source: string, destination: string): void;
17
+ /**
18
+ * Copy a directory recursively, ensuring the destination exists.
19
+ */
20
+ export declare function copyDirectorySafe(source: string, destination: string): void;
21
+ /**
22
+ * Read a file if it exists, otherwise return undefined.
23
+ */
24
+ export declare function readFileIfExists(filePath: string): string | undefined;
25
+ /**
26
+ * Check if a file exists and is a file (not a directory).
27
+ */
28
+ export declare function isFile(filePath: string): boolean;
29
+ /**
30
+ * Check if a path exists and is a directory.
31
+ */
32
+ export declare function isDirectory(dirPath: string): boolean;
33
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/ios/utils/file.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAGrE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAMtE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAM3E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKrE;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOhD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOpD"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isDirectory = exports.isFile = exports.readFileIfExists = exports.copyDirectorySafe = exports.copyFileSafe = exports.writeFileSafe = exports.ensureDirectoryExists = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ /**
10
+ * File system utilities for iOS target plugin operations.
11
+ * Provides safe, convenient wrappers for common file operations.
12
+ */
13
+ /**
14
+ * Ensure a directory exists, creating it recursively if needed.
15
+ */
16
+ function ensureDirectoryExists(dirPath) {
17
+ if (!fs_1.default.existsSync(dirPath)) {
18
+ fs_1.default.mkdirSync(dirPath, { recursive: true });
19
+ }
20
+ }
21
+ exports.ensureDirectoryExists = ensureDirectoryExists;
22
+ /**
23
+ * Write content to a file, ensuring the directory exists first.
24
+ */
25
+ function writeFileSafe(filePath, content) {
26
+ ensureDirectoryExists(path_1.default.dirname(filePath));
27
+ fs_1.default.writeFileSync(filePath, content);
28
+ }
29
+ exports.writeFileSafe = writeFileSafe;
30
+ /**
31
+ * Copy a file, ensuring the destination directory exists.
32
+ */
33
+ function copyFileSafe(source, destination) {
34
+ if (!fs_1.default.existsSync(source)) {
35
+ throw new Error(`Source file does not exist: ${source}`);
36
+ }
37
+ ensureDirectoryExists(path_1.default.dirname(destination));
38
+ fs_1.default.copyFileSync(source, destination);
39
+ }
40
+ exports.copyFileSafe = copyFileSafe;
41
+ /**
42
+ * Copy a directory recursively, ensuring the destination exists.
43
+ */
44
+ function copyDirectorySafe(source, destination) {
45
+ if (!fs_1.default.existsSync(source)) {
46
+ throw new Error(`Source directory does not exist: ${source}`);
47
+ }
48
+ ensureDirectoryExists(path_1.default.dirname(destination));
49
+ fs_1.default.cpSync(source, destination, { recursive: true });
50
+ }
51
+ exports.copyDirectorySafe = copyDirectorySafe;
52
+ /**
53
+ * Read a file if it exists, otherwise return undefined.
54
+ */
55
+ function readFileIfExists(filePath) {
56
+ if (fs_1.default.existsSync(filePath)) {
57
+ return fs_1.default.readFileSync(filePath, 'utf-8');
58
+ }
59
+ return undefined;
60
+ }
61
+ exports.readFileIfExists = readFileIfExists;
62
+ /**
63
+ * Check if a file exists and is a file (not a directory).
64
+ */
65
+ function isFile(filePath) {
66
+ try {
67
+ const stat = fs_1.default.statSync(filePath);
68
+ return stat.isFile();
69
+ }
70
+ catch {
71
+ return false;
72
+ }
73
+ }
74
+ exports.isFile = isFile;
75
+ /**
76
+ * Check if a path exists and is a directory.
77
+ */
78
+ function isDirectory(dirPath) {
79
+ try {
80
+ const stat = fs_1.default.statSync(dirPath);
81
+ return stat.isDirectory();
82
+ }
83
+ catch {
84
+ return false;
85
+ }
86
+ }
87
+ exports.isDirectory = isDirectory;
88
+ //# sourceMappingURL=file.js.map
@@ -0,0 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AAE,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACtD,CAAC;AAND,8CAMC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,IAAI,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AALD,4CAKC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,QAAgB;IACrC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAPD,wBAOC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,OAAe;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAPD,kCAOC"}
@@ -2,7 +2,6 @@
2
2
  * Centralized utilities for iOS plugin operations.
3
3
  * Re-exports all utility modules for convenient access.
4
4
  */
5
-
6
5
  export * as Xcode from './xcode';
7
6
  export * as Paths from './paths';
8
7
  export * as File from './file';
@@ -10,3 +9,5 @@ export * as Plist from './plist';
10
9
  export * as Podfile from './podfile';
11
10
  export * as Asset from './asset';
12
11
  export * as ReactNativeSwift from './reactNativeSwift';
12
+ export * as Safari from './safari';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ios/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Centralized utilities for iOS plugin operations.
4
+ * Re-exports all utility modules for convenient access.
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.Safari = exports.ReactNativeSwift = exports.Asset = exports.Podfile = exports.Plist = exports.File = exports.Paths = exports.Xcode = void 0;
31
+ exports.Xcode = __importStar(require("./xcode"));
32
+ exports.Paths = __importStar(require("./paths"));
33
+ exports.File = __importStar(require("./file"));
34
+ exports.Plist = __importStar(require("./plist"));
35
+ exports.Podfile = __importStar(require("./podfile"));
36
+ exports.Asset = __importStar(require("./asset"));
37
+ exports.ReactNativeSwift = __importStar(require("./reactNativeSwift"));
38
+ exports.Safari = __importStar(require("./safari"));
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ios/utils/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAiC;AACjC,iDAAiC;AACjC,+CAA+B;AAC/B,iDAAiC;AACjC,qDAAqC;AACrC,iDAAiC;AACjC,uEAAuD;AACvD,mDAAmC"}