expo-targets 0.2.9 → 0.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.
Files changed (273) hide show
  1. package/README.md +5 -7
  2. package/bin/expo-targets.js +2 -0
  3. package/bin/export-safari-bundle.js +2 -0
  4. package/build/metro/src/index.d.ts +1 -1
  5. package/build/metro/src/index.d.ts.map +1 -1
  6. package/build/metro/src/index.js +5 -4
  7. package/build/metro/src/index.js.map +1 -1
  8. package/build/metro/src/{withTargetsMetro.d.ts → withTargets.d.ts} +6 -1
  9. package/build/metro/src/withTargets.d.ts.map +1 -0
  10. package/{metro/build/withTargetsMetro.js → build/metro/src/withTargets.js} +13 -3
  11. package/build/metro/src/withTargets.js.map +1 -0
  12. package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts +31 -0
  13. package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts.map +1 -0
  14. package/build/plugin/src/codegen/collectRuntimeConfigs.js +57 -0
  15. package/build/plugin/src/codegen/collectRuntimeConfigs.js.map +1 -0
  16. package/build/plugin/src/codegen/index.d.ts +7 -0
  17. package/build/plugin/src/codegen/index.d.ts.map +1 -0
  18. package/build/plugin/src/codegen/index.js +13 -0
  19. package/build/plugin/src/codegen/index.js.map +1 -0
  20. package/build/plugin/src/codegen/typedTargets.d.ts +10 -0
  21. package/build/plugin/src/codegen/typedTargets.d.ts.map +1 -0
  22. package/build/plugin/src/codegen/typedTargets.js +41 -0
  23. package/build/plugin/src/codegen/typedTargets.js.map +1 -0
  24. package/build/plugin/src/codegen/warnIfSealedHandEdited.d.ts +12 -0
  25. package/build/plugin/src/codegen/warnIfSealedHandEdited.d.ts.map +1 -0
  26. package/build/plugin/src/codegen/warnIfSealedHandEdited.js +32 -0
  27. package/build/plugin/src/codegen/warnIfSealedHandEdited.js.map +1 -0
  28. package/build/plugin/src/ensureHostAppGroups.d.ts +16 -0
  29. package/build/plugin/src/ensureHostAppGroups.d.ts.map +1 -0
  30. package/build/plugin/src/ensureHostAppGroups.js +95 -0
  31. package/build/plugin/src/ensureHostAppGroups.js.map +1 -0
  32. package/build/plugin/src/ios/apply/fs/applyTargetPlan.d.ts.map +1 -1
  33. package/build/plugin/src/ios/apply/fs/applyTargetPlan.js +3 -1
  34. package/build/plugin/src/ios/apply/fs/applyTargetPlan.js.map +1 -1
  35. package/build/plugin/src/ios/apply/fs/entitlements.d.ts +5 -1
  36. package/build/plugin/src/ios/apply/fs/entitlements.d.ts.map +1 -1
  37. package/build/plugin/src/ios/apply/fs/entitlements.js +13 -1
  38. package/build/plugin/src/ios/apply/fs/entitlements.js.map +1 -1
  39. package/build/plugin/src/ios/apply/fs/safari.d.ts +4 -1
  40. package/build/plugin/src/ios/apply/fs/safari.d.ts.map +1 -1
  41. package/build/plugin/src/ios/apply/fs/safari.js +19 -1
  42. package/build/plugin/src/ios/apply/fs/safari.js.map +1 -1
  43. package/build/plugin/src/ios/apply/fs/swift.d.ts +4 -1
  44. package/build/plugin/src/ios/apply/fs/swift.d.ts.map +1 -1
  45. package/build/plugin/src/ios/apply/fs/swift.js +11 -2
  46. package/build/plugin/src/ios/apply/fs/swift.js.map +1 -1
  47. package/build/plugin/src/ios/apply/pbx/applyTargetPlan.d.ts.map +1 -1
  48. package/build/plugin/src/ios/apply/pbx/applyTargetPlan.js +9 -0
  49. package/build/plugin/src/ios/apply/pbx/applyTargetPlan.js.map +1 -1
  50. package/build/plugin/src/ios/apply/pbx/index.d.ts +1 -0
  51. package/build/plugin/src/ios/apply/pbx/index.d.ts.map +1 -1
  52. package/build/plugin/src/ios/apply/pbx/index.js +4 -1
  53. package/build/plugin/src/ios/apply/pbx/index.js.map +1 -1
  54. package/build/plugin/src/ios/apply/pbx/safariWebBundle.d.ts +15 -0
  55. package/build/plugin/src/ios/apply/pbx/safariWebBundle.d.ts.map +1 -0
  56. package/build/plugin/src/ios/apply/pbx/safariWebBundle.js +99 -0
  57. package/build/plugin/src/ios/apply/pbx/safariWebBundle.js.map +1 -0
  58. package/build/plugin/src/ios/apply/podfile/podfile.d.ts +0 -2
  59. package/build/plugin/src/ios/apply/podfile/podfile.d.ts.map +1 -1
  60. package/build/plugin/src/ios/apply/podfile/podfile.js +0 -2
  61. package/build/plugin/src/ios/apply/podfile/podfile.js.map +1 -1
  62. package/build/plugin/src/ios/config-plugins/withEntitlements.d.ts.map +1 -1
  63. package/build/plugin/src/ios/config-plugins/withEntitlements.js +4 -1
  64. package/build/plugin/src/ios/config-plugins/withEntitlements.js.map +1 -1
  65. package/build/plugin/src/ios/observe/podsRb.d.ts +2 -1
  66. package/build/plugin/src/ios/observe/podsRb.d.ts.map +1 -1
  67. package/build/plugin/src/ios/observe/podsRb.js +2 -1
  68. package/build/plugin/src/ios/observe/podsRb.js.map +1 -1
  69. package/build/plugin/src/ios/plan/buildInfoPlist.js +1 -1
  70. package/build/plugin/src/ios/plan/buildInfoPlist.js.map +1 -1
  71. package/build/plugin/src/ios/plan/compose.d.ts.map +1 -1
  72. package/build/plugin/src/ios/plan/compose.js +3 -0
  73. package/build/plugin/src/ios/plan/compose.js.map +1 -1
  74. package/build/plugin/src/ios/plan/index.d.ts +2 -1
  75. package/build/plugin/src/ios/plan/index.d.ts.map +1 -1
  76. package/build/plugin/src/ios/plan/index.js +3 -1
  77. package/build/plugin/src/ios/plan/index.js.map +1 -1
  78. package/build/plugin/src/ios/plan/safari.d.ts.map +1 -1
  79. package/build/plugin/src/ios/plan/safari.js +1 -0
  80. package/build/plugin/src/ios/plan/safari.js.map +1 -1
  81. package/build/plugin/src/ios/plan/safariWebBundle.d.ts +7 -0
  82. package/build/plugin/src/ios/plan/safariWebBundle.d.ts.map +1 -0
  83. package/build/plugin/src/ios/plan/safariWebBundle.js +53 -0
  84. package/build/plugin/src/ios/plan/safariWebBundle.js.map +1 -0
  85. package/build/plugin/src/ios/plan/types.d.ts +12 -0
  86. package/build/plugin/src/ios/plan/types.d.ts.map +1 -1
  87. package/build/plugin/src/ios/safari/exportSafariWebBundle.d.ts +20 -0
  88. package/build/plugin/src/ios/safari/exportSafariWebBundle.d.ts.map +1 -0
  89. package/build/plugin/src/ios/safari/exportSafariWebBundle.js +119 -0
  90. package/build/plugin/src/ios/safari/exportSafariWebBundle.js.map +1 -0
  91. package/build/plugin/src/ios/safari/exportSafariWebBundleCli.d.ts +2 -0
  92. package/build/plugin/src/ios/safari/exportSafariWebBundleCli.d.ts.map +1 -0
  93. package/build/plugin/src/ios/safari/exportSafariWebBundleCli.js +75 -0
  94. package/build/plugin/src/ios/safari/exportSafariWebBundleCli.js.map +1 -0
  95. package/build/plugin/src/ios/utils/paths.d.ts +2 -0
  96. package/build/plugin/src/ios/utils/paths.d.ts.map +1 -1
  97. package/build/plugin/src/ios/utils/paths.js +6 -1
  98. package/build/plugin/src/ios/utils/paths.js.map +1 -1
  99. package/build/plugin/src/ios/utils/safari.d.ts +11 -4
  100. package/build/plugin/src/ios/utils/safari.d.ts.map +1 -1
  101. package/build/plugin/src/ios/utils/safari.js +57 -21
  102. package/build/plugin/src/ios/utils/safari.js.map +1 -1
  103. package/build/plugin/src/withTargetsDir.d.ts.map +1 -1
  104. package/build/plugin/src/withTargetsDir.js +18 -2
  105. package/build/plugin/src/withTargetsDir.js.map +1 -1
  106. package/cli/build/checks/appGroups.d.ts +3 -0
  107. package/cli/build/checks/appGroups.d.ts.map +1 -0
  108. package/cli/build/checks/appGroups.js +56 -0
  109. package/cli/build/checks/appGroups.js.map +1 -0
  110. package/cli/build/checks/dualWidgets.d.ts +3 -0
  111. package/cli/build/checks/dualWidgets.d.ts.map +1 -0
  112. package/cli/build/checks/dualWidgets.js +31 -0
  113. package/cli/build/checks/dualWidgets.js.map +1 -0
  114. package/cli/build/checks/entries.d.ts +3 -0
  115. package/cli/build/checks/entries.d.ts.map +1 -0
  116. package/cli/build/checks/entries.js +52 -0
  117. package/cli/build/checks/entries.js.map +1 -0
  118. package/cli/build/checks/metro.d.ts +3 -0
  119. package/cli/build/checks/metro.d.ts.map +1 -0
  120. package/cli/build/checks/metro.js +67 -0
  121. package/cli/build/checks/metro.js.map +1 -0
  122. package/cli/build/checks/nameSync.d.ts +3 -0
  123. package/cli/build/checks/nameSync.d.ts.map +1 -0
  124. package/cli/build/checks/nameSync.js +107 -0
  125. package/cli/build/checks/nameSync.js.map +1 -0
  126. package/cli/build/checks/plugin.d.ts +3 -0
  127. package/cli/build/checks/plugin.d.ts.map +1 -0
  128. package/cli/build/checks/plugin.js +27 -0
  129. package/cli/build/checks/plugin.js.map +1 -0
  130. package/cli/build/checks/sealedZone.d.ts +3 -0
  131. package/cli/build/checks/sealedZone.d.ts.map +1 -0
  132. package/cli/build/checks/sealedZone.js +101 -0
  133. package/cli/build/checks/sealedZone.js.map +1 -0
  134. package/cli/build/doctor.d.ts +9 -0
  135. package/cli/build/doctor.d.ts.map +1 -0
  136. package/cli/build/doctor.js +101 -0
  137. package/cli/build/doctor.js.map +1 -0
  138. package/cli/build/exportSafari.d.ts +2 -0
  139. package/cli/build/exportSafari.d.ts.map +1 -0
  140. package/cli/build/exportSafari.js +42 -0
  141. package/cli/build/exportSafari.js.map +1 -0
  142. package/cli/build/generate.d.ts +2 -0
  143. package/cli/build/generate.d.ts.map +1 -0
  144. package/cli/build/generate.js +27 -0
  145. package/cli/build/generate.js.map +1 -0
  146. package/cli/build/index.d.ts +3 -0
  147. package/cli/build/index.d.ts.map +1 -0
  148. package/cli/build/index.js +79 -0
  149. package/cli/build/index.js.map +1 -0
  150. package/cli/build/orphans.d.ts +14 -0
  151. package/cli/build/orphans.d.ts.map +1 -0
  152. package/cli/build/orphans.js +184 -0
  153. package/cli/build/orphans.js.map +1 -0
  154. package/cli/build/project.d.ts +3 -0
  155. package/cli/build/project.d.ts.map +1 -0
  156. package/cli/build/project.js +114 -0
  157. package/cli/build/project.js.map +1 -0
  158. package/cli/build/sync.d.ts +8 -0
  159. package/cli/build/sync.d.ts.map +1 -0
  160. package/cli/build/sync.js +154 -0
  161. package/cli/build/sync.js.map +1 -0
  162. package/cli/build/types.d.ts +44 -0
  163. package/cli/build/types.d.ts.map +1 -0
  164. package/cli/build/types.js +3 -0
  165. package/cli/build/types.js.map +1 -0
  166. package/metro/build/index.d.ts +1 -1
  167. package/metro/build/index.d.ts.map +1 -1
  168. package/metro/build/index.js +5 -4
  169. package/metro/build/index.js.map +1 -1
  170. package/metro/build/{withTargetsMetro.d.ts → withTargets.d.ts} +6 -1
  171. package/metro/build/withTargets.d.ts.map +1 -0
  172. package/{build/metro/src/withTargetsMetro.js → metro/build/withTargets.js} +13 -3
  173. package/metro/build/withTargets.js.map +1 -0
  174. package/package.json +21 -2
  175. package/plugin/build/codegen/collectRuntimeConfigs.d.ts +31 -0
  176. package/plugin/build/codegen/collectRuntimeConfigs.d.ts.map +1 -0
  177. package/plugin/build/codegen/collectRuntimeConfigs.js +57 -0
  178. package/plugin/build/codegen/collectRuntimeConfigs.js.map +1 -0
  179. package/plugin/build/codegen/index.d.ts +7 -0
  180. package/plugin/build/codegen/index.d.ts.map +1 -0
  181. package/plugin/build/codegen/index.js +13 -0
  182. package/plugin/build/codegen/index.js.map +1 -0
  183. package/plugin/build/codegen/typedTargets.d.ts +10 -0
  184. package/plugin/build/codegen/typedTargets.d.ts.map +1 -0
  185. package/plugin/build/codegen/typedTargets.js +41 -0
  186. package/plugin/build/codegen/typedTargets.js.map +1 -0
  187. package/plugin/build/codegen/warnIfSealedHandEdited.d.ts +12 -0
  188. package/plugin/build/codegen/warnIfSealedHandEdited.d.ts.map +1 -0
  189. package/plugin/build/codegen/warnIfSealedHandEdited.js +32 -0
  190. package/plugin/build/codegen/warnIfSealedHandEdited.js.map +1 -0
  191. package/plugin/build/ensureHostAppGroups.d.ts +16 -0
  192. package/plugin/build/ensureHostAppGroups.d.ts.map +1 -0
  193. package/plugin/build/ensureHostAppGroups.js +95 -0
  194. package/plugin/build/ensureHostAppGroups.js.map +1 -0
  195. package/plugin/build/ios/apply/fs/applyTargetPlan.d.ts.map +1 -1
  196. package/plugin/build/ios/apply/fs/applyTargetPlan.js +3 -1
  197. package/plugin/build/ios/apply/fs/applyTargetPlan.js.map +1 -1
  198. package/plugin/build/ios/apply/fs/entitlements.d.ts +5 -1
  199. package/plugin/build/ios/apply/fs/entitlements.d.ts.map +1 -1
  200. package/plugin/build/ios/apply/fs/entitlements.js +13 -1
  201. package/plugin/build/ios/apply/fs/entitlements.js.map +1 -1
  202. package/plugin/build/ios/apply/fs/safari.d.ts +4 -1
  203. package/plugin/build/ios/apply/fs/safari.d.ts.map +1 -1
  204. package/plugin/build/ios/apply/fs/safari.js +19 -1
  205. package/plugin/build/ios/apply/fs/safari.js.map +1 -1
  206. package/plugin/build/ios/apply/fs/swift.d.ts +4 -1
  207. package/plugin/build/ios/apply/fs/swift.d.ts.map +1 -1
  208. package/plugin/build/ios/apply/fs/swift.js +11 -2
  209. package/plugin/build/ios/apply/fs/swift.js.map +1 -1
  210. package/plugin/build/ios/apply/pbx/applyTargetPlan.d.ts.map +1 -1
  211. package/plugin/build/ios/apply/pbx/applyTargetPlan.js +9 -0
  212. package/plugin/build/ios/apply/pbx/applyTargetPlan.js.map +1 -1
  213. package/plugin/build/ios/apply/pbx/index.d.ts +1 -0
  214. package/plugin/build/ios/apply/pbx/index.d.ts.map +1 -1
  215. package/plugin/build/ios/apply/pbx/index.js +4 -1
  216. package/plugin/build/ios/apply/pbx/index.js.map +1 -1
  217. package/plugin/build/ios/apply/pbx/safariWebBundle.d.ts +15 -0
  218. package/plugin/build/ios/apply/pbx/safariWebBundle.d.ts.map +1 -0
  219. package/plugin/build/ios/apply/pbx/safariWebBundle.js +99 -0
  220. package/plugin/build/ios/apply/pbx/safariWebBundle.js.map +1 -0
  221. package/plugin/build/ios/apply/podfile/podfile.d.ts +0 -2
  222. package/plugin/build/ios/apply/podfile/podfile.d.ts.map +1 -1
  223. package/plugin/build/ios/apply/podfile/podfile.js +0 -2
  224. package/plugin/build/ios/apply/podfile/podfile.js.map +1 -1
  225. package/plugin/build/ios/config-plugins/withEntitlements.d.ts.map +1 -1
  226. package/plugin/build/ios/config-plugins/withEntitlements.js +4 -1
  227. package/plugin/build/ios/config-plugins/withEntitlements.js.map +1 -1
  228. package/plugin/build/ios/observe/podsRb.d.ts +2 -1
  229. package/plugin/build/ios/observe/podsRb.d.ts.map +1 -1
  230. package/plugin/build/ios/observe/podsRb.js +2 -1
  231. package/plugin/build/ios/observe/podsRb.js.map +1 -1
  232. package/plugin/build/ios/plan/buildInfoPlist.js +1 -1
  233. package/plugin/build/ios/plan/buildInfoPlist.js.map +1 -1
  234. package/plugin/build/ios/plan/compose.d.ts.map +1 -1
  235. package/plugin/build/ios/plan/compose.js +3 -0
  236. package/plugin/build/ios/plan/compose.js.map +1 -1
  237. package/plugin/build/ios/plan/index.d.ts +2 -1
  238. package/plugin/build/ios/plan/index.d.ts.map +1 -1
  239. package/plugin/build/ios/plan/index.js +3 -1
  240. package/plugin/build/ios/plan/index.js.map +1 -1
  241. package/plugin/build/ios/plan/safari.d.ts.map +1 -1
  242. package/plugin/build/ios/plan/safari.js +1 -0
  243. package/plugin/build/ios/plan/safari.js.map +1 -1
  244. package/plugin/build/ios/plan/safariWebBundle.d.ts +7 -0
  245. package/plugin/build/ios/plan/safariWebBundle.d.ts.map +1 -0
  246. package/plugin/build/ios/plan/safariWebBundle.js +53 -0
  247. package/plugin/build/ios/plan/safariWebBundle.js.map +1 -0
  248. package/plugin/build/ios/plan/types.d.ts +12 -0
  249. package/plugin/build/ios/plan/types.d.ts.map +1 -1
  250. package/plugin/build/ios/safari/exportSafariWebBundle.d.ts +20 -0
  251. package/plugin/build/ios/safari/exportSafariWebBundle.d.ts.map +1 -0
  252. package/plugin/build/ios/safari/exportSafariWebBundle.js +119 -0
  253. package/plugin/build/ios/safari/exportSafariWebBundle.js.map +1 -0
  254. package/plugin/build/ios/safari/exportSafariWebBundleCli.d.ts +2 -0
  255. package/plugin/build/ios/safari/exportSafariWebBundleCli.d.ts.map +1 -0
  256. package/plugin/build/ios/safari/exportSafariWebBundleCli.js +75 -0
  257. package/plugin/build/ios/safari/exportSafariWebBundleCli.js.map +1 -0
  258. package/plugin/build/ios/templates/ReactNativeViewController.swift +58 -19
  259. package/plugin/build/ios/utils/paths.d.ts +2 -0
  260. package/plugin/build/ios/utils/paths.d.ts.map +1 -1
  261. package/plugin/build/ios/utils/paths.js +6 -1
  262. package/plugin/build/ios/utils/paths.js.map +1 -1
  263. package/plugin/build/ios/utils/safari.d.ts +11 -4
  264. package/plugin/build/ios/utils/safari.d.ts.map +1 -1
  265. package/plugin/build/ios/utils/safari.js +57 -21
  266. package/plugin/build/ios/utils/safari.js.map +1 -1
  267. package/plugin/build/withTargetsDir.d.ts.map +1 -1
  268. package/plugin/build/withTargetsDir.js +18 -2
  269. package/plugin/build/withTargetsDir.js.map +1 -1
  270. package/build/metro/src/withTargetsMetro.d.ts.map +0 -1
  271. package/build/metro/src/withTargetsMetro.js.map +0 -1
  272. package/metro/build/withTargetsMetro.d.ts.map +0 -1
  273. package/metro/build/withTargetsMetro.js.map +0 -1
@@ -0,0 +1,184 @@
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.cleanOrphans = exports.findOrphans = void 0;
30
+ const fs = __importStar(require("node:fs"));
31
+ const path = __importStar(require("node:path"));
32
+ // @ts-expect-error - no types available for xcode package
33
+ const xcode_1 = __importDefault(require("xcode"));
34
+ const pbx_1 = require("../../plugin/build/ios/apply/pbx");
35
+ const podfile_1 = require("../../plugin/build/ios/apply/podfile");
36
+ const paths_1 = require("../../plugin/build/ios/utils/paths");
37
+ function configuredProductNames(ctx) {
38
+ const names = new Set();
39
+ for (const target of ctx.targets) {
40
+ if (!target.config.platforms?.includes('ios')) {
41
+ continue;
42
+ }
43
+ const displayName = target.config.displayName || target.config.name || target.dirName;
44
+ names.add((0, paths_1.sanitizeTargetName)(displayName));
45
+ }
46
+ return names;
47
+ }
48
+ function listSealedProducts(platformProjectRoot, projectName) {
49
+ const generatedRoot = path.join(platformProjectRoot, projectName, paths_1.GENERATED_DIR_NAME);
50
+ if (!fs.existsSync(generatedRoot)) {
51
+ return [];
52
+ }
53
+ return fs
54
+ .readdirSync(generatedRoot, { withFileTypes: true })
55
+ .filter((entry) => entry.isDirectory())
56
+ .map((entry) => entry.name);
57
+ }
58
+ function unquote(value) {
59
+ if (typeof value !== 'string') {
60
+ return;
61
+ }
62
+ return value.replace(/^"|"$/g, '');
63
+ }
64
+ function sealedProductFromInfoPlist(infoPlist) {
65
+ if (!infoPlist.includes(`${paths_1.GENERATED_DIR_NAME}/`)) {
66
+ return;
67
+ }
68
+ const match = infoPlist.match(new RegExp(`${paths_1.GENERATED_DIR_NAME}/([^/]+)/`));
69
+ return match?.[1];
70
+ }
71
+ function collectOrphanFromTarget(opts) {
72
+ const targetName = unquote(opts.target?.name);
73
+ if (!targetName) {
74
+ return;
75
+ }
76
+ const listUuid = opts.target.buildConfigurationList;
77
+ if (!listUuid) {
78
+ return;
79
+ }
80
+ const configList = opts.objects.XCConfigurationList?.[listUuid];
81
+ for (const entry of configList?.buildConfigurations || []) {
82
+ const settings = opts.configs[entry.value]?.buildSettings || {};
83
+ const infoPlist = unquote(settings.INFOPLIST_FILE);
84
+ if (!infoPlist) {
85
+ continue;
86
+ }
87
+ const productName = sealedProductFromInfoPlist(infoPlist);
88
+ if (productName && !opts.configured.has(productName)) {
89
+ opts.orphans.add(targetName);
90
+ }
91
+ }
92
+ }
93
+ function findOrphanXcodeTargets(platformProjectRoot, configured) {
94
+ const xcodeProjects = fs
95
+ .readdirSync(platformProjectRoot)
96
+ .filter((name) => name.endsWith('.xcodeproj'));
97
+ if (xcodeProjects.length !== 1) {
98
+ return [];
99
+ }
100
+ const pbxprojPath = path.join(platformProjectRoot, xcodeProjects[0], 'project.pbxproj');
101
+ if (!fs.existsSync(pbxprojPath)) {
102
+ return [];
103
+ }
104
+ const project = xcode_1.default.project(pbxprojPath);
105
+ project.parseSync();
106
+ const objects = project.hash.project.objects;
107
+ const nativeTargets = objects.PBXNativeTarget || {};
108
+ const configs = objects.XCBuildConfiguration || {};
109
+ const orphans = new Set();
110
+ for (const key of Object.keys(nativeTargets)) {
111
+ if (key.endsWith('_comment')) {
112
+ continue;
113
+ }
114
+ collectOrphanFromTarget({
115
+ target: nativeTargets[key],
116
+ objects,
117
+ configs,
118
+ configured,
119
+ orphans,
120
+ });
121
+ }
122
+ return [...orphans].sort();
123
+ }
124
+ function findOrphanPodfileTargets(projectRoot, platformProjectRoot, configured) {
125
+ const podfilePath = path.join(platformProjectRoot, 'Podfile');
126
+ if (!fs.existsSync(podfilePath)) {
127
+ return [];
128
+ }
129
+ const podfile = fs.readFileSync(podfilePath, 'utf8');
130
+ const mainTargetName = (0, pbx_1.getProjectName)(projectRoot);
131
+ const refs = [
132
+ ...(0, podfile_1.findReactNativeExtensionTargets)(podfile, {
133
+ mainTargetName,
134
+ fallbackDeploymentTarget: '15.1',
135
+ }),
136
+ ...(0, podfile_1.findStandaloneExtensionTargets)(podfile, mainTargetName),
137
+ ];
138
+ return [...new Set(refs.map((ref) => ref.targetName))]
139
+ .filter((name) => !configured.has(name))
140
+ .sort((a, b) => a.localeCompare(b));
141
+ }
142
+ function findOrphans(projectRoot, ctx) {
143
+ const configured = configuredProductNames(ctx);
144
+ const platformProjectRoot = path.join(projectRoot, 'ios');
145
+ const projectName = (0, pbx_1.getProjectName)(projectRoot);
146
+ return {
147
+ sealedProducts: listSealedProducts(platformProjectRoot, projectName).filter((name) => !configured.has(name)),
148
+ xcodeTargets: findOrphanXcodeTargets(platformProjectRoot, configured),
149
+ podfileTargets: findOrphanPodfileTargets(projectRoot, platformProjectRoot, configured),
150
+ };
151
+ }
152
+ exports.findOrphans = findOrphans;
153
+ function cleanOrphans(projectRoot, report) {
154
+ const platformProjectRoot = path.join(projectRoot, 'ios');
155
+ const projectName = (0, pbx_1.getProjectName)(projectRoot);
156
+ const removedSealed = [];
157
+ const removedPodfileTargets = [];
158
+ for (const productName of report.sealedProducts) {
159
+ const productDir = path.join(platformProjectRoot, projectName, paths_1.GENERATED_DIR_NAME, productName);
160
+ if (fs.existsSync(productDir)) {
161
+ fs.rmSync(productDir, { recursive: true, force: true });
162
+ removedSealed.push(productName);
163
+ }
164
+ }
165
+ const podfilePath = path.join(platformProjectRoot, 'Podfile');
166
+ if (fs.existsSync(podfilePath) && report.podfileTargets.length > 0) {
167
+ let podfile = fs.readFileSync(podfilePath, 'utf8');
168
+ for (const targetName of report.podfileTargets) {
169
+ const next = (0, podfile_1.removeTargetBlock)(podfile, targetName);
170
+ if (next !== podfile) {
171
+ removedPodfileTargets.push(targetName);
172
+ podfile = next;
173
+ }
174
+ }
175
+ fs.writeFileSync(podfilePath, podfile);
176
+ }
177
+ return {
178
+ removedSealed,
179
+ removedPodfileTargets,
180
+ skippedXcodeTargets: report.xcodeTargets,
181
+ };
182
+ }
183
+ exports.cleanOrphans = c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I,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnE,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACnD,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC/C,MAAM,IAAI,GAAG,IAAA,2BAAiB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACpD,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACrB,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACvC,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;QACD,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACL,aAAa;QACb,qBAAqB;QACrB,mBAAmB,EAAE,MAAM,CAAC,YAAY;KACzC,CAAC;AACJ,CAAC;AAxCD,oCAwCC"}
@@ -0,0 +1,3 @@
1
+ import type { ProjectContext } from './types';
2
+ export declare function loadProject(projectRoot: string): ProjectContext;
3
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,cAAc,EAAgB,MAAM,SAAS,CAAC;AA8F9E,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAS/D"}
@@ -0,0 +1,114 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.loadProject = void 0;
27
+ const fs = __importStar(require("node:fs"));
28
+ const path = __importStar(require("node:path"));
29
+ const glob_1 = require("glob");
30
+ const APP_GROUP_KEY = 'com.apple.security.application-groups';
31
+ function readJson(filePath) {
32
+ if (!fs.existsSync(filePath)) {
33
+ return null;
34
+ }
35
+ try {
36
+ return JSON.parse(fs.readFileSync(filePath, 'utf8'));
37
+ }
38
+ catch {
39
+ return null;
40
+ }
41
+ }
42
+ function expoRoot(raw) {
43
+ if (raw?.expo && typeof raw.expo === 'object') {
44
+ return raw.expo;
45
+ }
46
+ return raw ?? {};
47
+ }
48
+ function loadExpoConfig(projectRoot) {
49
+ for (const name of ['app.json', 'app.config.json']) {
50
+ const root = expoRoot(readJson(path.join(projectRoot, name)));
51
+ if (Object.keys(root).length > 0) {
52
+ return root;
53
+ }
54
+ }
55
+ const jsConfig = path.join(projectRoot, 'app.config.js');
56
+ if (fs.existsSync(jsConfig)) {
57
+ try {
58
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
59
+ const mod = require(jsConfig);
60
+ const cfg = typeof mod === 'function' ? mod({}) : mod;
61
+ return expoRoot(cfg);
62
+ }
63
+ catch {
64
+ return {};
65
+ }
66
+ }
67
+ return {};
68
+ }
69
+ function readHostAppGroups(expo) {
70
+ const ios = expo.ios;
71
+ const entitlements = ios?.entitlements;
72
+ const groups = entitlements?.[APP_GROUP_KEY];
73
+ if (!Array.isArray(groups)) {
74
+ return [];
75
+ }
76
+ return groups.filter((g) => typeof g === 'string');
77
+ }
78
+ function evaluateTargetConfig(configPath, expo) {
79
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
80
+ let evaluated = require(configPath);
81
+ if (evaluated?.default) {
82
+ evaluated = evaluated.default;
83
+ }
84
+ if (typeof evaluated === 'function') {
85
+ evaluated = evaluated(expo);
86
+ }
87
+ return evaluated;
88
+ }
89
+ function discoverTargets(projectRoot, expo) {
90
+ const files = (0, glob_1.globSync)('./targets/*/expo-target.config.@(js|ts|json)', {
91
+ cwd: projectRoot,
92
+ absolute: true,
93
+ });
94
+ return files.map((configPath) => {
95
+ const dirName = path.basename(path.dirname(configPath));
96
+ return {
97
+ dirName,
98
+ configPath,
99
+ config: evaluateTargetConfig(configPath, expo),
100
+ };
101
+ });
102
+ }
103
+ function loadProject(projectRoot) {
104
+ const expo = loadExpoConfig(projectRoot);
105
+ return {
106
+ projectRoot,
107
+ expo,
108
+ plugins: Array.isArray(expo.plugins) ? expo.plugins : [],
109
+ hostAppGroups: readHostAppGroups(expo),
110
+ targets: discoverTargets(projectRoot, expo),
111
+ };
112
+ }
113
+ exports.loadProject = loadProject;
114
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,gDAAkC;AAClC,+BAAgC;AAIhC,MAAM,aAAa,GAAG,uCAAuC,CAAC;AAE9D,SAAS,QAAQ,CAAC,QAAgB;IAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAA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IAC7C,MAAM,IAAI,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO;QACL,WAAW;QACX,IAAI;QACJ,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACxD,aAAa,EAAE,iBAAiB,CAAC,IAAI,CAAC;QACtC,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,IAAI,CAAC;KAC5C,CAAC;AACJ,CAAC;AATD,kCASC"}
@@ -0,0 +1,8 @@
1
+ export interface SyncOptions {
2
+ clean?: boolean;
3
+ dryRun?: boolean;
4
+ verbose?: boolean;
5
+ targetsRoot?: string;
6
+ }
7
+ export declare function runSync(options?: SyncOptions, projectRoot?: string): Promise<number>;
8
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAwHD,wBAAsB,OAAO,CAC3B,OAAO,GAAE,WAAgB,EACzB,WAAW,SAAgB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA8CjB"}
@@ -0,0 +1,154 @@
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.runSync = void 0;
30
+ const fs = __importStar(require("node:fs"));
31
+ const path = __importStar(require("node:path"));
32
+ const node_process_1 = __importDefault(require("node:process"));
33
+ const config_1 = require("@expo/config");
34
+ const config_plugins_1 = require("@expo/config-plugins");
35
+ const index_1 = __importDefault(require("../../plugin/build/index"));
36
+ const orphans_1 = require("./orphans");
37
+ const project_1 = require("./project");
38
+ function validateIosDirectory(projectRoot) {
39
+ const iosPath = path.join(projectRoot, 'ios');
40
+ if (!fs.existsSync(iosPath)) {
41
+ throw new Error('No ios/ directory found. This command is for bare React Native projects.\n' +
42
+ 'For Expo managed projects, use: npx expo prebuild');
43
+ }
44
+ }
45
+ function logVerbose(verbose, message) {
46
+ if (verbose) {
47
+ console.log(message);
48
+ }
49
+ }
50
+ function printOrphans(report, { clean, dryRun }) {
51
+ const hasOrphans = report.sealedProducts.length > 0 ||
52
+ report.xcodeTargets.length > 0 ||
53
+ report.podfileTargets.length > 0;
54
+ if (!hasOrphans) {
55
+ return;
56
+ }
57
+ console.log('\nOrphaned expo-targets artifacts (no matching targets/*/config):');
58
+ for (const product of report.sealedProducts) {
59
+ console.log(` • sealed: ExpoTargetsGenerated/${product}/`);
60
+ }
61
+ for (const target of report.xcodeTargets) {
62
+ console.log(` • xcode target: ${target}`);
63
+ }
64
+ for (const target of report.podfileTargets) {
65
+ console.log(` • podfile target: ${target}`);
66
+ }
67
+ if (dryRun) {
68
+ console.log('\nDry run — no orphans removed.');
69
+ return;
70
+ }
71
+ if (!clean) {
72
+ console.log('\nPass --clean to remove sealed dirs and Podfile targets.');
73
+ if (report.xcodeTargets.length > 0) {
74
+ console.log('Xcode native targets are report-only; remove them manually or re-sync after deleting configs.');
75
+ }
76
+ return;
77
+ }
78
+ console.log('');
79
+ }
80
+ function printCleanResult(result) {
81
+ if (result.removedSealed.length > 0) {
82
+ console.log(`Removed sealed dirs: ${result.removedSealed.map((name) => `ExpoTargetsGenerated/${name}/`).join(', ')}`);
83
+ }
84
+ if (result.removedPodfileTargets.length > 0) {
85
+ console.log(`Removed Podfile targets: ${result.removedPodfileTargets.join(', ')}`);
86
+ }
87
+ if (result.skippedXcodeTargets.length > 0) {
88
+ console.log(`Xcode targets not removed automatically: ${result.skippedXcodeTargets.join(', ')}`);
89
+ }
90
+ }
91
+ function printDryRunTargets(projectRoot, targetsRoot) {
92
+ const ctx = (0, project_1.loadProject)(projectRoot);
93
+ const iosTargets = ctx.targets.filter((target) => target.config.platforms?.includes('ios'));
94
+ if (iosTargets.length === 0) {
95
+ console.log('No iOS targets found to sync.');
96
+ return;
97
+ }
98
+ console.log('Would sync iOS targets:');
99
+ for (const target of iosTargets) {
100
+ const name = target.config.displayName || target.config.name || target.dirName;
101
+ console.log(` • ${name} (${path.relative(projectRoot, target.configPath)})`);
102
+ }
103
+ console.log(`\nTargets root: ${targetsRoot}\n` +
104
+ 'Dry run lists targets and orphans only — no ios/ writes.');
105
+ }
106
+ async function buildPluginConfig(projectRoot, options) {
107
+ const { exp } = (0, config_1.getConfig)(projectRoot, {
108
+ skipSDKVersionRequirement: true,
109
+ skipPlugins: true,
110
+ });
111
+ return (0, index_1.default)(exp, {
112
+ targetsRoot: options.targetsRoot,
113
+ debug: options.verbose,
114
+ });
115
+ }
116
+ async function runSync(options = {}, projectRoot = node_process_1.default.cwd()) {
117
+ validateIosDirectory(projectRoot);
118
+ const targetsRoot = options.targetsRoot ?? './targets';
119
+ const ctx = (0, project_1.loadProject)(projectRoot);
120
+ const iosTargets = ctx.targets.filter((target) => target.config.platforms?.includes('ios'));
121
+ if (iosTargets.length === 0) {
122
+ console.log(`No iOS targets found under ${targetsRoot}/`);
123
+ const orphans = (0, orphans_1.findOrphans)(projectRoot, ctx);
124
+ printOrphans(orphans, options);
125
+ if (options.clean && !options.dryRun) {
126
+ printCleanResult((0, orphans_1.cleanOrphans)(projectRoot, orphans));
127
+ }
128
+ return 0;
129
+ }
130
+ logVerbose(options.verbose, `Project root: ${projectRoot}`);
131
+ logVerbose(options.verbose, `iOS targets: ${iosTargets.length}`);
132
+ if (options.dryRun) {
133
+ printDryRunTargets(projectRoot, targetsRoot);
134
+ const orphans = (0, orphans_1.findOrphans)(projectRoot, ctx);
135
+ printOrphans(orphans, options);
136
+ console.log('\nDry run complete — no files written.');
137
+ return 0;
138
+ }
139
+ const config = await buildPluginConfig(projectRoot, options);
140
+ logVerbose(options.verbose, 'Applying iOS config plugin mods…');
141
+ await (0, config_plugins_1.compileModsAsync)(config, {
142
+ projectRoot,
143
+ platforms: ['ios'],
144
+ });
145
+ const orphans = (0, orphans_1.findOrphans)(projectRoot, (0, project_1.loadProject)(projectRoot));
146
+ printOrphans(orphans, options);
147
+ if (options.clean) {
148
+ printCleanResult((0, orphans_1.cleanOrphans)(projectRoot, orphans));
149
+ }
150
+ console.log('\nSync complete. Run `pod install` in ios/ if Podfile changed.');
151
+ return 0;
152
+ }
153
+ exports.runSync = runSync;
154
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,gDAAkC;AAClC,gEAAmC;AACnC,yCAAyC;AACzC,yDAAwD;AAEx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AAgB,EAAC,MAAM,EAAE;QAC7B,WAAW;QACX,SAAS,EAAE,CAAC,KAAK,CAAC;KACnB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,WAAW,EAAE,IAAA,qBAAW,EAAC,WAAW,CAAC,CAAC,CAAC;IACnE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,gBAAgB,CAAC,IAAA,sBAAY,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;IAC9E,OAAO,CAAC,CAAC;AACX,CAAC;AAjDD,0BAiDC"}
@@ -0,0 +1,44 @@
1
+ export type CheckLevel = 'error' | 'warn';
2
+ export interface CheckResult {
3
+ ok: boolean;
4
+ level: CheckLevel;
5
+ title: string;
6
+ message: string;
7
+ fix?: string;
8
+ }
9
+ export interface TargetConfig {
10
+ type?: string;
11
+ name?: string;
12
+ displayName?: string;
13
+ platforms?: string[];
14
+ entry?: string;
15
+ appGroup?: string;
16
+ liveActivity?: {
17
+ attributesName?: string;
18
+ };
19
+ ios?: {
20
+ intents?: {
21
+ ui?: boolean | {
22
+ name?: string;
23
+ };
24
+ };
25
+ wallet?: {
26
+ ui?: boolean | {
27
+ name?: string;
28
+ };
29
+ };
30
+ };
31
+ }
32
+ export interface DiscoveredTarget {
33
+ dirName: string;
34
+ configPath: string;
35
+ config: TargetConfig;
36
+ }
37
+ export interface ProjectContext {
38
+ projectRoot: string;
39
+ expo: Record<string, unknown>;
40
+ plugins: unknown[];
41
+ hostAppGroups: string[];
42
+ targets: DiscoveredTarget[];
43
+ }
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAA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 //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- export { type ScanResult, scanTargetsDirectory, type TargetConfig, withTargetsMetro, } from './withTargetsMetro';
1
+ export { type ScanResult, scanTargetsDirectory, type TargetConfig, withTargets, withTargetsMetro, } from './withTargets';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,oBAAoB,EACpB,KAAK,YAAY,EACjB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,oBAAoB,EACpB,KAAK,YAAY,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withTargetsMetro = exports.scanTargetsDirectory = void 0;
4
- var withTargetsMetro_1 = require("./withTargetsMetro");
5
- Object.defineProperty(exports, "scanTargetsDirectory", { enumerable: true, get: function () { return withTargetsMetro_1.scanTargetsDirectory; } });
6
- Object.defineProperty(exports, "withTargetsMetro", { enumerable: true, get: function () { return withTargetsMetro_1.withTargetsMetro; } });
3
+ exports.withTargetsMetro = exports.withTargets = exports.scanTargetsDirectory = void 0;
4
+ var withTargets_1 = require("./withTargets");
5
+ Object.defineProperty(exports, "scanTargetsDirectory", { enumerable: true, get: function () { return withTargets_1.scanTargetsDirectory; } });
6
+ Object.defineProperty(exports, "withTargets", { enumerable: true, get: function () { return withTargets_1.withTargets; } });
7
+ Object.defineProperty(exports, "withTargetsMetro", { enumerable: true, get: function () { return withTargets_1.withTargetsMetro; } });
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAK4B;AAH1B,wHAAA,oBAAoB,OAAA;AAEpB,oHAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6CAMuB;AAJrB,mHAAA,oBAAoB,OAAA;AAEpB,0GAAA,WAAW,OAAA;AACX,+GAAA,gBAAgB,OAAA"}
@@ -12,8 +12,13 @@ export interface ScanResult {
12
12
  * Exported for tests and tooling.
13
13
  */
14
14
  export declare function scanTargetsDirectory(projectRoot: string): ScanResult;
15
+ export declare function withTargets(metroConfig: MetroConfig, options?: {
16
+ projectRoot?: string;
17
+ silent?: boolean;
18
+ }): MetroConfig;
19
+ /** @deprecated Use `withTargets` instead. */
15
20
  export declare function withTargetsMetro(metroConfig: MetroConfig, options?: {
16
21
  projectRoot?: string;
17
22
  silent?: boolean;
18
23
  }): MetroConfig;
19
- //# sourceMappingURL=withTargetsMetro.d.ts.map
24
+ //# sourceMappingURL=withTargets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withTargets.d.ts","sourceRoot":"","sources":["../src/withTargets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAiDD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAoCpE;AAmBD,wBAAgB,WAAW,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACnD,WAAW,CA8Bb;AAID,6CAA6C;AAC7C,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACnD,WAAW,CAQb"}
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.withTargetsMetro = exports.scanTargetsDirectory = void 0;
29
+ exports.withTargetsMetro = exports.withTargets = exports.scanTargetsDirectory = void 0;
30
30
  const fs = __importStar(require("node:fs"));
31
31
  const path = __importStar(require("node:path"));
32
32
  const node_process_1 = __importDefault(require("node:process"));
@@ -101,7 +101,7 @@ function logScanSummary(entryMap, warnings) {
101
101
  const noun = roots.length === 1 ? 'y' : 'ies';
102
102
  console.log(`[expo-targets/metro] Resolved ${roots.length} RN extension entr${noun}`);
103
103
  }
104
- function withTargetsMetro(metroConfig, options) {
104
+ function withTargets(metroConfig, options) {
105
105
  const projectRoot = options?.projectRoot || node_process_1.default.cwd();
106
106
  const { entryMap, warnings } = scanTargetsDirectory(projectRoot);
107
107
  if (!options?.silent) {
@@ -126,5 +126,15 @@ function withTargetsMetro(metroConfig, options) {
126
126
  },
127
127
  };
128
128
  }
129
+ exports.withTargets = withTargets;
130
+ let metroAliasWarned = false;
131
+ /** @deprecated Use `withTargets` instead. */
132
+ function withTargetsMetro(metroConfig, options) {
133
+ if (!metroAliasWarned) {
134
+ metroAliasWarned = true;
135
+ console.warn('[expo-targets/metro] withTargetsMetro is deprecated; use withTargets instead');
136
+ }
137
+ return withTargets(metroConfig, options);
138
+ }
129
139
  exports.withTargetsMetro = withTargetsMetro;
130
- //# sourceMappingURL=withTargetsMetro.js.map
140
+ //# sourceMappingURL=withTargets.js.map