stim 1.19.0 → 1.20.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 (172) hide show
  1. package/README.md +20 -3
  2. package/dist/{activity-BSw0x84R.mjs → activity-BrGh9EAI.mjs} +3 -3
  3. package/dist/{agent-device-usage-output-Bjxu_VmX.mjs → agent-device-usage-output-DVyv_hWj.mjs} +7 -7
  4. package/dist/android-0vv-OruW.mjs +6 -0
  5. package/dist/android-Brx6EKvJ.mjs +1258 -0
  6. package/dist/{android-BdQC6zs1.mjs → android-BsYNR81W.mjs} +103 -45
  7. package/dist/{android-DE5g_5gv.mjs → android-CK3fpEyZ.mjs} +2 -2
  8. package/dist/{android-cas-C87geAg-.mjs → android-cas-DCAuXryb.mjs} +9 -5
  9. package/dist/android-cas-compiler.mjs +1 -1
  10. package/dist/api-run.mjs +159 -8
  11. package/dist/{api-DIf_s86s.mjs → api-zuX3ynYN.mjs} +5 -1
  12. package/dist/api.d.mts +98 -4
  13. package/dist/api.mjs +1 -1
  14. package/dist/{app-install-CFI4ptUL.mjs → app-install-0LgaQRT7.mjs} +9 -8
  15. package/dist/artifact-CnC0mfov.mjs +807 -0
  16. package/dist/artifact-DClXJNWx.mjs +772 -0
  17. package/dist/artifact-lifecycle-DzPpBYvK.mjs +30 -0
  18. package/dist/{browser-web-CDhqQxhv.mjs → browser-web-CzBmhmgs.mjs} +19 -19
  19. package/dist/{budget-Dz-kyXLv.mjs → budget-BONq9vXY.mjs} +3101 -3062
  20. package/dist/build-BixRI6sB.mjs +462 -0
  21. package/dist/{build-facts-B87vo-Im.d.mts → build-facts-DcLv2HSd.d.mts} +1 -32
  22. package/dist/build-plan-CP0tckNU.mjs +553 -0
  23. package/dist/{cache-manifest-DiwKSyv9.mjs → cache-manifest-qA3dT2x2.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{manifest-CX0d1IkZ.mjs → ccache-CjHQ5F8g.mjs} +13 -19
  26. package/dist/{chrome-BTUOo8p2.mjs → chrome-Dp2lMLBe.mjs} +1 -1
  27. package/dist/{cli-C9Zvgbdc.mjs → cli-B2R8wH1F.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/{client-CuUo8Nvg.mjs → client-BLy1Pw2V.mjs} +89 -307
  30. package/dist/collector-run.d.mts +4 -0
  31. package/dist/collector-run.mjs +7 -7
  32. package/dist/{command-output-Bt8ygHE7.mjs → command-output-BjPN99ZB.mjs} +2 -2
  33. package/dist/{config-DC5jEtd1.mjs → config-D0LhTY3S.mjs} +8 -12
  34. package/dist/{created-devices-D0s26Hx5.mjs → created-devices-HU_DAb_Q.mjs} +7 -6
  35. package/dist/{dependency-state-DKaS1OM9.mjs → dependency-state-B2m8eqsS.mjs} +2 -2
  36. package/dist/{detached-entry-pB_IPfV4.mjs → detached-entry-BXq4fIl-.mjs} +1 -1
  37. package/dist/{dev-client-CDY_zAmD.mjs → dev-client-ClATaJoH.mjs} +2 -2
  38. package/dist/{device-BHw0WlHl.mjs → device-B7lsC0K1.mjs} +8 -8
  39. package/dist/device-DVCwAFlX.mjs +727 -0
  40. package/dist/{device-capacity-BoN1jQkO.mjs → device-capacity-Ca_ke1LE.mjs} +13 -14
  41. package/dist/device-host-worker.mjs +38 -18
  42. package/dist/device-ios-CRUqPxKw.mjs +413 -0
  43. package/dist/{device-lease-Cu7PtQpZ.mjs → device-lease-DHOBXGgS.mjs} +135 -22
  44. package/dist/{device-lease-run-D38SnZtt.mjs → device-lease-run-CvDeHTkG.mjs} +4 -4
  45. package/dist/{device-pool-CP4rAsHx.mjs → device-pool-L2-5GxMy.mjs} +3 -3
  46. package/dist/{device-remote-B5GiUifk.mjs → device-remote-Bmg42063.mjs} +17 -68
  47. package/dist/doctor-C2MSuMMg.mjs +515 -0
  48. package/dist/{doctor-PRJH94v6.mjs → doctor-DPAqhVCK.mjs} +333 -744
  49. package/dist/{doctor-watchman-wZhyTdp4.mjs → doctor-watchman-CB4NnVZm.mjs} +13 -12
  50. package/dist/{simslim-D9LkJxIO.mjs → eas-build-Dw_ec2Km.mjs} +6 -152
  51. package/dist/{stim-installations-DbmUjsLv.mjs → eas-session-ledger-DZlC-Fq3.mjs} +57 -4
  52. package/dist/{error-diagnostics--v5HGOU0.mjs → error-diagnostics-Du7I_GuY.mjs} +17 -12
  53. package/dist/errors-DzkMYh8Q.mjs +205 -0
  54. package/dist/{exec-i8GDPwq9.mjs → exec-B81Qodjn.mjs} +40 -10
  55. package/dist/{gc-CyHMcKcn.mjs → gc-PWp34zGb.mjs} +21 -20
  56. package/dist/{device-ios-B2ruohE-.mjs → gradle-C2OEKCCI.mjs} +21 -650
  57. package/dist/{guide-dRaQJJk9.mjs → guide-Dai9lphv.mjs} +504 -117
  58. package/dist/{hosted-android-Bs7fytj7.mjs → hosted-android-DQ-Agsd8.mjs} +5 -5
  59. package/dist/{hosted-client-C5G4h_OJ.mjs → hosted-client-Io01s5By.mjs} +9 -3
  60. package/dist/{hosted-ios-Bik035eL.mjs → hosted-ios-DIxFnYp-.mjs} +3 -3
  61. package/dist/{hosted-logs-CI9Az9a4.mjs → hosted-logs-DP-ABU_M.mjs} +8 -8
  62. package/dist/{hosted-macos-DABm3ScO.mjs → hosted-macos-Aziw9T_9.mjs} +7 -6
  63. package/dist/{hosted-native-DbV2aUVw.mjs → hosted-native-BdAQi21M.mjs} +17 -14
  64. package/dist/{idle-shutdown-DYiMBn34.mjs → idle-shutdown-DdMqoSUB.mjs} +7 -7
  65. package/dist/{ios-DYUr9LGc.mjs → ios-BZ9dg2Fr.mjs} +8 -7
  66. package/dist/{ios-BWbHFZVz.mjs → ios-CXLIUxXJ.mjs} +180 -24
  67. package/dist/ios-CZuv6gRv.mjs +1112 -0
  68. package/dist/{ios-DCrkgXEM.mjs → ios-VGvNdsv2.mjs} +1 -1
  69. package/dist/{ios-device-CrW8aMb5.mjs → ios-device-B1B14xND.mjs} +1 -1
  70. package/dist/{ios-device-CJ_ZOGky.mjs → ios-device-BreZOpM0.mjs} +3 -3
  71. package/dist/ios-project-B9drt_aY.mjs +197 -0
  72. package/dist/{ios-state-By0XuLTQ.mjs → ios-state-CjrL2qv-.mjs} +1 -1
  73. package/dist/js-swap-C8icNYIY.mjs +432 -0
  74. package/dist/launch-DxH0THLP.mjs +745 -0
  75. package/dist/{react-native-ios-CSpIxexZ.mjs → launch-YrbqaIFj.mjs} +59 -612
  76. package/dist/{launch-verify-DCveSE6d.mjs → launch-verify-BzRdbuO1.mjs} +26 -7
  77. package/dist/{logs-Bao1HOMy.mjs → logs-DHaRNfg7.mjs} +11 -11
  78. package/dist/macos-C0iljhsN.mjs +2 -0
  79. package/dist/{macos-ciyBdTY5.mjs → macos-V_3Ui7g4.mjs} +42 -50
  80. package/dist/macos-run.mjs +1 -1
  81. package/dist/maintenance-run.mjs +13 -10
  82. package/dist/{metro-DI2AjPF_.mjs → metro-D_j9sN-B.mjs} +18 -5
  83. package/dist/{metro-gateway-BxpJLIwh.mjs → metro-gateway-BBJldOdi.mjs} +2 -2
  84. package/dist/miss-reason-BPAzZS0r.mjs +238 -0
  85. package/dist/{named-ports-B4iWH4E-.mjs → named-ports-C2lvoPsb.mjs} +3 -3
  86. package/dist/native-android-lHzaew7r.mjs +226 -0
  87. package/dist/native-gradle-inputs-BQnIdAlL.mjs +356 -0
  88. package/dist/{native-runtime-BGxsbfny.mjs → native-runtime-BRmWL7ru.mjs} +9 -8
  89. package/dist/native-xcode-inputs-eutS19jU.mjs +307 -0
  90. package/dist/native-xcode-ios-DP3cHLwu.mjs +434 -0
  91. package/dist/{ndjson-LGZAMsqa.mjs → ndjson-GOnbyvso.mjs} +6 -6
  92. package/dist/offload-worker.d.mts +41 -7
  93. package/dist/offload-worker.mjs +409 -74
  94. package/dist/{ownership-EB0ySdGK.mjs → ownership-DXzMMSx6.mjs} +2 -2
  95. package/dist/{placement-log-Dxe34rJm.mjs → placement-log-reFbjqEr.mjs} +1 -1
  96. package/dist/plan-BDk2AeY_.mjs +260 -0
  97. package/dist/plan-placement-D_YYlE6N.mjs +73 -0
  98. package/dist/{ports-ByPc0_97.mjs → ports-jzvAJXXL.mjs} +3 -3
  99. package/dist/{prebuild-BKJ3wJI1.mjs → prebuild-Bw44QxVh.mjs} +4 -4
  100. package/dist/{preview-BbSottmO.mjs → preview-BaBJ72Al.mjs} +50 -32
  101. package/dist/project-B8_duAzW.mjs +1067 -0
  102. package/dist/project-plan-BPwbLwQu.mjs +10 -0
  103. package/dist/{pull-request-IHNdMnG8.mjs → pull-request-vOhLNmIb.mjs} +1 -1
  104. package/dist/pull-requests.mjs +1 -1
  105. package/dist/react-native-android-chm1DMlA.mjs +921 -0
  106. package/dist/react-native-build-oAw6gQeW.mjs +239 -0
  107. package/dist/react-native-doctor-DYXoh-6I.mjs +78 -0
  108. package/dist/react-native-ios-SCTK_CT5.mjs +595 -0
  109. package/dist/{recordings-Bv8McZN4.mjs → recordings-Bk-VivUV.mjs} +1 -1
  110. package/dist/{reload-rAPdqeRR.mjs → reload-D34GkY78.mjs} +17 -13
  111. package/dist/remote-BU9UyhCJ.mjs +192 -0
  112. package/dist/{remote-cache-N3hAEaAL.mjs → remote-cache-Bsts6f6Y.mjs} +5 -5
  113. package/dist/result-BDoRk1k3.mjs +186 -0
  114. package/dist/{run-lAkle1-c.mjs → run-qvff78hv.mjs} +3 -3
  115. package/dist/{server-bare-CkIjnegq.mjs → server-bare-dWjAarki.mjs} +5 -5
  116. package/dist/server-command-7XIKlWtO.mjs +69 -0
  117. package/dist/{server-expo-n3tUi3Em.mjs → server-expo-CsYu2aKL.mjs} +107 -82
  118. package/dist/server-expo-DV43vep4.mjs +2 -0
  119. package/dist/{settings-CxgngUZk.mjs → settings-Bbztm4oV.mjs} +179 -129
  120. package/dist/{settings-2am7TSxp.mjs → settings-CT3E71-i.mjs} +6 -6
  121. package/dist/{state-lKh8shBp.d.mts → settings-vk3mJGSm.d.mts} +4 -2
  122. package/dist/settings.schema.json +84 -0
  123. package/dist/simslim-ChMfe8rg.mjs +149 -0
  124. package/dist/{slot-launch-HV_KtPIw.mjs → slot-launch-B9hn96wd.mjs} +6 -6
  125. package/dist/{stage-BgaZJVZY.mjs → stage-BNKKdDNc.mjs} +6 -3
  126. package/dist/start-CbQCSnXQ.mjs +2 -0
  127. package/dist/{start-DtxthMfI.mjs → start-CdvcTaXr.mjs} +97 -68
  128. package/dist/{state-Tp4uImDS.mjs → state-Boo0IMJq.mjs} +1 -1
  129. package/dist/{state-D2KtnALG.mjs → state-DI84A-uu.mjs} +29 -10
  130. package/dist/{stats-8EJ5ivFT.mjs → stats-BIIDrjA8.mjs} +5 -5
  131. package/dist/{status-BEeL6IKz.mjs → status-BDGHwkCs.mjs} +3 -1
  132. package/dist/{status-BOyp0CUl.mjs → status-DARMkc9q.mjs} +81 -293
  133. package/dist/status-watch-DvmI3SmN.mjs +296 -0
  134. package/dist/{stim-desktop-C65jk_q2.mjs → stim-desktop-8GQX2OV8.mjs} +1 -1
  135. package/dist/{stop-DRipAg-e.mjs → stop-CCZS-C9m.mjs} +2 -2
  136. package/dist/{stop-D0UIpZuh.mjs → stop-WQPQHLuy.mjs} +5 -5
  137. package/dist/{stop-zDlknFoz.mjs → stop-iNemHsJC.mjs} +21 -20
  138. package/dist/supervisor-run.d.mts +7 -2
  139. package/dist/supervisor-run.mjs +32 -20
  140. package/dist/{support-DsNaFg6D.mjs → support-CnE_SIjt.mjs} +17 -7
  141. package/dist/{support-CNqYkV0y.mjs → support-DCco5fut.mjs} +61 -8
  142. package/dist/{swiftpm-macos-aJzPAj1t.mjs → swiftpm-macos-afeNUExW.mjs} +5 -5
  143. package/dist/tailnet-CoJUb2tB.mjs +265 -0
  144. package/dist/toolchain-BIupIro1.mjs +2 -0
  145. package/dist/{toolchain-C3xSoyUl.mjs → toolchain-DqyDXs30.mjs} +206 -53
  146. package/dist/{trigger-CAhmG-4s.mjs → trigger-C0MWBi8O.mjs} +2 -2
  147. package/dist/trigger-SHLOWJ4O.mjs +2 -0
  148. package/dist/{warm-progress-pFLB2e6P.mjs → warm-progress-C3ASD6z5.mjs} +6 -6
  149. package/dist/{watchman-BL1IdOtq.mjs → watchman-CQl51YZu.mjs} +6 -6
  150. package/dist/{web-DbbrPUn0.mjs → web-B3eldHFH.mjs} +9 -13
  151. package/dist/web-BLXpOe6b.mjs +2 -0
  152. package/dist/web-run.mjs +10 -10
  153. package/dist/{workspace-state-CR9X86xJ.mjs → workspace-state-CSIFuuDa.mjs} +33 -33
  154. package/dist/{workspaces-Djb2gfi9.mjs → workspaces-D2xSHBDY.mjs} +1260 -1258
  155. package/dist/{worktree-BL4M1rhB.mjs → worktree-BxDqaTev.mjs} +84 -48
  156. package/dist/worktree-q7_OZNY0.mjs +2 -0
  157. package/package.json +8 -6
  158. package/shim/native-android.gradle +101 -0
  159. package/dist/android-BXc6BmEi.mjs +0 -3732
  160. package/dist/android-BvV1gGdN.mjs +0 -4
  161. package/dist/ios-ITYno9rO.mjs +0 -2241
  162. package/dist/macos-nIOATJmR.mjs +0 -2
  163. package/dist/metro-store-BAHFcJm6.mjs +0 -106
  164. package/dist/miss-reason-CjQCOKqq.mjs +0 -1743
  165. package/dist/plan-placement-BVY59qa8.mjs +0 -290
  166. package/dist/project-B5eQ1USs.mjs +0 -612
  167. package/dist/react-native-ios-BMh2i25I.mjs +0 -2
  168. package/dist/server-expo-DGsdUGX2.mjs +0 -2
  169. package/dist/start-D8NbxNBb.mjs +0 -2
  170. package/dist/trigger-CoalsMTV.mjs +0 -2
  171. package/dist/web-DFpFeZu5.mjs +0 -2
  172. package/dist/worktree-DV-A0LNL.mjs +0 -2
@@ -0,0 +1,239 @@
1
+ import { r as register } from "./cache-manifest-qA3dT2x2.mjs";
2
+ import { g as sharedCompilationCache } from "./workspace-state-CSIFuuDa.mjs";
3
+ import { l as phaseLine } from "./command-output-BjPN99ZB.mjs";
4
+ import { S as resolvePackageJson } from "./project-B8_duAzW.mjs";
5
+ import { p as resolveOptimizations } from "./errors-DzkMYh8Q.mjs";
6
+ import { a as buildGradle, i as assembleTaskFor, n as BUILD_ERROR, o as parseProductFlavors, s as variantNameOf, t as ASSEMBLE_TASK } from "./gradle-C2OEKCCI.mjs";
7
+ import { C as compilationCacheSettings, N as swiftPrefixMappingSupported, O as pickXcodeProject, T as detectXcodeMajor, b as SWIFT_PREFIX_MAPPING_MIN_SWIFT, w as detectSwiftVersion, x as buildXcode } from "./toolchain-DqyDXs30.mjs";
8
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
9
+ import { join, relative } from "node:path";
10
+ import chalk from "chalk";
11
+ /** The ABI name a build for every ABI has to fit; `stim android` narrows a build to the device's. */
12
+ const LONGEST_ANDROID_ABI = "armeabi-v7a";
13
+ function androidPathRoom(root, { abi = null, variant = null, platform = process.platform } = {}) {
14
+ if (platform !== "win32") return null;
15
+ const abiName = abi ?? LONGEST_ANDROID_ABI;
16
+ const tail = 198 + (/release$/i.test(variant ?? "") ? 14 : 5) - 5 + abiName.length;
17
+ const longest = root.length + tail;
18
+ if (longest < 240) return null;
19
+ return {
20
+ root,
21
+ abi: abiName,
22
+ longest,
23
+ maxRootLength: 239 - tail
24
+ };
25
+ }
26
+ function androidPathRoomMessage({ root, abi, longest, maxRootLength }) {
27
+ return `The project root ${root} is ${root.length} characters, so the longest known Android native object path (react_codegen_safeareacontext for ${abi}) reaches ${longest} characters, past the 239 the NDK's ninja can be given on Windows; the root can be at most ${maxRootLength} characters.`;
28
+ }
29
+ function androidPathRoomRemedy({ root }) {
30
+ return `Map the project to a drive letter (\`subst X: "${root}"\`) and run Stim from X:\\, or move it under a shorter root.`;
31
+ }
32
+ //#endregion
33
+ //#region src/integrations/react-native-build.ts
34
+ function gradlewPath(layout) {
35
+ return join(layout.gradleRoot, process.platform === "win32" ? "gradlew.bat" : "gradlew");
36
+ }
37
+ function apkOutputsDir(layout) {
38
+ return join(layout.moduleDir, "build", "outputs", "apk");
39
+ }
40
+ function discoverAndroidProject(root, layout) {
41
+ const dir = layout.gradleRoot;
42
+ if (!existsSync(dir)) return {
43
+ failed: true,
44
+ code: BUILD_ERROR,
45
+ reason: `No ${relative(root, dir) || "."}/ directory in ${root}.`,
46
+ remedy: "Generate it (`npx expo prebuild -p android`, which `stim android` runs itself on an Expo project) or check out the native sources."
47
+ };
48
+ const gradlew = gradlewPath(layout);
49
+ if (!existsSync(gradlew)) return {
50
+ failed: true,
51
+ code: BUILD_ERROR,
52
+ reason: `${gradlew} does not exist, so there is no gradle wrapper to build with.`,
53
+ remedy: `Restore the wrapper (\`gradle wrapper\` in ${relative(root, dir) || "."}/, or regenerate the project with \`npx expo prebuild -p android --clean\`).`
54
+ };
55
+ return {
56
+ androidDir: dir,
57
+ gradlew
58
+ };
59
+ }
60
+ function readProductFlavors(layout) {
61
+ return parseProductFlavors(readOrNull(join(layout.moduleDir, "build.gradle")));
62
+ }
63
+ function productFlavorRefusal({ flavors, variant }) {
64
+ if (variant) return null;
65
+ if (!flavors.known || flavors.dimensions.length === 0) return null;
66
+ let combinations = [[]];
67
+ for (const group of flavors.dimensions) combinations = combinations.flatMap((combination) => group.map((flavor) => combination.concat(flavor)));
68
+ if (combinations.length < 2) return null;
69
+ const count = flavors.dimensions.reduce((total, group) => total + group.length, 0);
70
+ const variants = combinations.map((combination) => variantNameOf(combination.concat("debug")));
71
+ return {
72
+ code: "STIM_BAD_ARG",
73
+ reason: `android/app/build.gradle declares ${count} product flavors, so \`./gradlew ${ASSEMBLE_TASK}\` builds an APK for each of them and nothing says which flavor to install.`,
74
+ remedy: `Pass \`--variant ${variants[0]}\` or set the android.variant setting -- e.g. {"android": {"variant": "${variants[0]}"}} in .stim.json. The debug variants are: ${variants.join(", ")}.`
75
+ };
76
+ }
77
+ function readOrNull(path) {
78
+ try {
79
+ return readFileSync(path, "utf-8");
80
+ } catch {
81
+ return null;
82
+ }
83
+ }
84
+ async function buildAndroid({ root, layout, logWriter, variant = null, abi = null }, options = {}) {
85
+ const project = discoverAndroidProject(root, layout);
86
+ if (project.failed) return {
87
+ ok: false,
88
+ code: project.code,
89
+ reason: project.reason,
90
+ remedy: project.remedy,
91
+ diagnostics: [],
92
+ truncated: 0,
93
+ lastLines: [],
94
+ durationMs: 0
95
+ };
96
+ const room = androidPathRoom(root, {
97
+ abi,
98
+ variant,
99
+ platform: options.platform ?? process.platform
100
+ });
101
+ return buildGradle({
102
+ root,
103
+ logWriter,
104
+ variant,
105
+ project: {
106
+ directory: project.androidDir,
107
+ gradlew: project.gradlew,
108
+ module: layout.module,
109
+ outputsDir: apkOutputsDir(layout)
110
+ },
111
+ task: layout.custom ? `${layout.module}:${assembleTaskFor(variant)}` : assembleTaskFor(variant),
112
+ projectArgs: abi ? [`-PreactNativeArchitectures=${abi}`] : [],
113
+ preflightFailure: room ? {
114
+ code: "STIM_PATH_TOO_LONG",
115
+ reason: androidPathRoomMessage(room),
116
+ remedy: androidPathRoomRemedy(room)
117
+ } : null
118
+ }, options);
119
+ }
120
+ const PREBUILD_REMEDY = "Generate it with `npx expo prebuild -p ios` (stim ios does this automatically for an Expo project with no ios/ directory), or commit the native project.";
121
+ function buildFailure(message, remedy) {
122
+ return { error: {
123
+ code: "STIM_BUILD_FAILED",
124
+ message,
125
+ remedy
126
+ } };
127
+ }
128
+ function discoverXcodeProject(root, dir) {
129
+ let entries;
130
+ try {
131
+ entries = readdirSync(dir);
132
+ } catch {
133
+ return buildFailure(`No ${relative(root, dir) || "."}/ directory in ${root}.`, PREBUILD_REMEDY);
134
+ }
135
+ const picked = pickXcodeProject(entries);
136
+ if (!picked) return buildFailure(`${dir} contains no .xcworkspace and no .xcodeproj.`, PREBUILD_REMEDY);
137
+ return {
138
+ ...picked,
139
+ dir,
140
+ appRoot: root,
141
+ path: join(dir, picked.file)
142
+ };
143
+ }
144
+ function ccacheEnabled(podfileProperties) {
145
+ if (!podfileProperties || typeof podfileProperties !== "object") return false;
146
+ return podfileProperties["apple.ccacheEnabled"] === "true";
147
+ }
148
+ function readPodfileProperties(iosDir) {
149
+ try {
150
+ const parsed = JSON.parse(readFileSync(join(iosDir, "Podfile.properties.json"), "utf-8"));
151
+ return parsed && typeof parsed === "object" ? parsed : null;
152
+ } catch {
153
+ return null;
154
+ }
155
+ }
156
+ const SWIFT_CACHE_MIN_REACT_NATIVE = {
157
+ major: 0,
158
+ minor: 87
159
+ };
160
+ function reactNativeSupportsSwiftCache(version) {
161
+ if (!version) return false;
162
+ const min = SWIFT_CACHE_MIN_REACT_NATIVE;
163
+ return version.major > min.major || version.major === min.major && version.minor >= min.minor;
164
+ }
165
+ function parseReactNativeVersion(packageJson) {
166
+ if (!packageJson || typeof packageJson !== "object") return null;
167
+ const raw = packageJson.version;
168
+ const m = typeof raw === "string" ? /^(\d+)\.(\d+)\./.exec(raw) : null;
169
+ if (!m || m[1] === void 0 || m[2] === void 0) return null;
170
+ return {
171
+ major: parseInt(m[1], 10),
172
+ minor: parseInt(m[2], 10)
173
+ };
174
+ }
175
+ function detectReactNativeVersion(root) {
176
+ const file = resolvePackageJson(root, "react-native");
177
+ if (!file) return null;
178
+ try {
179
+ return parseReactNativeVersion(JSON.parse(readFileSync(file, "utf-8")));
180
+ } catch {
181
+ return null;
182
+ }
183
+ }
184
+ function reactNativeCompilationCacheSettings({ reactNativeVersion = null, ...options }) {
185
+ return compilationCacheSettings({
186
+ ...options,
187
+ swiftCacheCompatible: reactNativeSupportsSwiftCache(reactNativeVersion)
188
+ });
189
+ }
190
+ function resolveCompilationCacheSettings({ root, iosDir, derivedDataPath, exec = null, casPath = sharedCompilationCache(), optimizations = resolveOptimizations({}, {}).ios, onNote = (line) => console.error(line) }) {
191
+ const xcodeMajor = detectXcodeMajor(exec);
192
+ const ccache = ccacheEnabled(readPodfileProperties(iosDir));
193
+ const probe = xcodeMajor !== null && xcodeMajor >= 26 && !ccache && optimizations.compilationCache && optimizations.swiftCompilationCache !== false;
194
+ const swiftVersion = probe ? detectSwiftVersion(exec) : null;
195
+ const reactNativeVersion = probe ? detectReactNativeVersion(root) : null;
196
+ const settings = reactNativeCompilationCacheSettings({
197
+ workspaceRoot: root,
198
+ derivedDataPath,
199
+ casPath,
200
+ xcodeMajor,
201
+ swiftVersion,
202
+ reactNativeVersion,
203
+ ccache,
204
+ optimizations
205
+ });
206
+ if (settings.length > 0 && optimizations.compilationCache) {
207
+ register({
208
+ dir: casPath,
209
+ name: "Xcode compilation cache",
210
+ prune: "atomic",
211
+ note: "shared Xcode compilation cache"
212
+ });
213
+ const swift = settings.includes("SWIFT_ENABLE_COMPILE_CACHE=YES") ? settings.includes("SWIFT_ENABLE_PREFIX_MAPPING=YES") ? "Swift on" : "Swift on, unmapped" : swiftVersion && !swiftPrefixMappingSupported(swiftVersion) ? `Swift off, ${swiftVersion.major}.${swiftVersion.minor} < ${SWIFT_PREFIX_MAPPING_MIN_SWIFT.major}.${SWIFT_PREFIX_MAPPING_MIN_SWIFT.minor}` : swiftVersion && reactNativeVersion && !reactNativeSupportsSwiftCache(reactNativeVersion) ? `Swift off, react-native ${reactNativeVersion.major}.${reactNativeVersion.minor} < ${SWIFT_CACHE_MIN_REACT_NATIVE.major}.${SWIFT_CACHE_MIN_REACT_NATIVE.minor}` : "Swift off";
214
+ onNote(chalk.dim(phaseLine("cache", `compilation cache on (CAS at ${casPath}, ${swift})`)));
215
+ }
216
+ return settings;
217
+ }
218
+ async function buildIos(inputs) {
219
+ const { root, iosDir, logWriter, udid, destination, now = () => Date.now() } = inputs;
220
+ if (!root || typeof root !== "string") throw new TypeError("buildIos requires {root}");
221
+ if (!logWriter || typeof logWriter.write !== "function") throw new TypeError("buildIos requires {logWriter} with a write() method");
222
+ if (!udid && !destination) throw new TypeError("buildIos requires {udid} (or an explicit {destination})");
223
+ const startedAt = now();
224
+ return buildXcode({
225
+ ...inputs,
226
+ startedAt,
227
+ project: inputs.project ?? discoverXcodeProject(root, iosDir),
228
+ compilationCache: inputs.compilationCache === void 0 ? ({ derivedDataPath, exec }) => resolveCompilationCacheSettings({
229
+ root,
230
+ iosDir,
231
+ derivedDataPath,
232
+ exec,
233
+ optimizations: inputs.optimizations,
234
+ onNote: inputs.onNote
235
+ }) : inputs.compilationCache
236
+ });
237
+ }
238
+ //#endregion
239
+ export { discoverXcodeProject as a, readProductFlavors as c, androidPathRoomRemedy as d, ccacheEnabled as i, androidPathRoom as l, buildAndroid as n, gradlewPath as o, buildIos as r, productFlavorRefusal as s, apkOutputsDir as t, androidPathRoomMessage as u };
@@ -0,0 +1,78 @@
1
+ import { G as resolveIosProjectDir, U as resolveAndroidLayout } from "./settings-Bbztm4oV.mjs";
2
+ import { l as phaseLine } from "./command-output-BjPN99ZB.mjs";
3
+ import { _ as detectIsExpo } from "./project-B8_duAzW.mjs";
4
+ import { I as bundlerPin, i as iosToolchainAsync, n as androidToolchain, t as androidRequirements } from "./toolchain-DqyDXs30.mjs";
5
+ import { a as repairCxxLauncherState, n as detectLinkedLibraryGitMetadata, r as reactNativeDoctorFindings, t as detectFingerprintParity } from "./doctor-DPAqhVCK.mjs";
6
+ import { existsSync } from "node:fs";
7
+ //#region src/integrations/react-native-doctor.ts
8
+ function reactNativeProjectDoctor(root) {
9
+ return {
10
+ inspect: reactNativeDoctorFindings,
11
+ async inspectAsync({ options: { platform }, settings }) {
12
+ const parity = await detectFingerprintParity(root, {
13
+ platform,
14
+ iosProjectPath: resolveIosProjectDir(settings, root).relative
15
+ });
16
+ const linkedGit = await detectLinkedLibraryGitMetadata(root, { platform });
17
+ return [parity, linkedGit?.code === parity?.code ? null : linkedGit].filter((finding) => finding !== null);
18
+ },
19
+ offloadTargets({ options: { platform, host = process.platform }, settings, repoRoot }, iosRuntime) {
20
+ const checksIos = platform !== "android" && host === "darwin";
21
+ const androidDir = resolveAndroidLayout(settings, root, repoRoot ?? root).gradleRoot;
22
+ const checksAndroid = platform === "android" || platform === void 0 && (existsSync(androidDir) || detectIsExpo(root));
23
+ if (!checksIos && !checksAndroid) return null;
24
+ return async () => {
25
+ const targets = [];
26
+ if (checksIos) {
27
+ const [local, runtime] = await Promise.all([iosToolchainAsync(root), iosRuntime()]);
28
+ targets.push({
29
+ platform: "ios",
30
+ local,
31
+ runtime,
32
+ cocoapodsPinned: bundlerPin(root) !== null
33
+ });
34
+ }
35
+ if (checksAndroid) targets.push({
36
+ platform: "android",
37
+ local: androidToolchain(),
38
+ requires: androidRequirements(root)
39
+ });
40
+ return targets;
41
+ };
42
+ },
43
+ repair: (platform, settings, repoRoot) => platform === "ios" ? {
44
+ removed: [],
45
+ refused: []
46
+ } : repairCxxLauncherState(root, settings, resolveAndroidLayout(settings, root, repoRoot ?? root)),
47
+ successLines: reactNativeDoctorSuccessLines
48
+ };
49
+ }
50
+ function reactNativeDoctorSuccessLines(platform) {
51
+ const lines = [
52
+ "",
53
+ "Project",
54
+ phaseLine("project", "source checkout, dependencies, local upstream, nested worktrees Watchman would crawl")
55
+ ];
56
+ if (platform !== "android") {
57
+ lines.push("", "iOS");
58
+ lines.push(phaseLine("setup", "CocoaPods, warm state, effective Debug simulator architectures"));
59
+ lines.push(phaseLine("caches", "Metro, Xcode compilation, ccache, build provider"));
60
+ lines.push(phaseLine("devices", "remote device, SimSlim profile"));
61
+ }
62
+ if (platform !== "ios") {
63
+ lines.push("", "Android");
64
+ lines.push(phaseLine("setup", "Android SDK, warm state"));
65
+ lines.push(phaseLine("caches", "Metro, Gradle, ccache, build provider"));
66
+ lines.push(phaseLine("devices", "remote device"));
67
+ }
68
+ lines.push("", "Expo and React Native");
69
+ lines.push(phaseLine("services", "EAS session"));
70
+ lines.push(phaseLine("fingerprint", "parity when dependencies are absent"));
71
+ lines.push("", "Handled automatically");
72
+ const suppliedCaches = platform === "ios" ? "Metro transform store, Xcode compilation cache" : platform === "android" ? "Metro transform store, Gradle build cache, ccache" : "Metro transform store, Xcode compilation cache, Gradle build cache, ccache";
73
+ lines.push(phaseLine("caches", suppliedCaches));
74
+ lines.push(phaseLine("meaning", "missing project cache settings are healthy"));
75
+ return lines;
76
+ }
77
+ //#endregion
78
+ export { reactNativeProjectDoctor };