stim 1.20.2 → 1.22.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 (231) hide show
  1. package/README.md +141 -8
  2. package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
  3. package/dist/act-DsuqEkiM.mjs +2801 -0
  4. package/dist/activity-CMLmzp7o.mjs +1397 -0
  5. package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
  6. package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
  7. package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
  8. package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
  9. package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
  10. package/dist/android-cas-compiler.mjs +2 -2
  11. package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/android-project-DVWyCbWU.d.mts +391 -0
  14. package/dist/api.d.mts +810 -64
  15. package/dist/api.mjs +782 -1
  16. package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
  17. package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
  18. package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
  19. package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
  20. package/dist/budget-Cvwn54qV.mjs +9285 -0
  21. package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
  22. package/dist/build-cache-Dv7RN200.mjs +602 -0
  23. package/dist/build-plan-DUC8Ka9y.mjs +248 -0
  24. package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
  25. package/dist/cache-manifest.mjs +1 -1
  26. package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
  27. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
  28. package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
  29. package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
  30. package/dist/cli.mjs +1 -1
  31. package/dist/client-OyRoEuSr.mjs +1577 -0
  32. package/dist/collector-run.d.mts +4 -40
  33. package/dist/collector-run.mjs +9 -8
  34. package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
  35. package/dist/config-DlrsduwG.mjs +955 -0
  36. package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
  37. package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
  38. package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
  39. package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
  40. package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
  41. package/dist/device-DklWZLqb.mjs +1068 -0
  42. package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
  43. package/dist/device-host-worker.mjs +76 -79
  44. package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
  45. package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
  46. package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
  47. package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
  48. package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
  49. package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
  50. package/dist/doctor-fingerprint.mjs +19 -0
  51. package/dist/doctor-thjWAV0z.mjs +2 -0
  52. package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
  53. package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
  54. package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
  55. package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
  56. package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
  57. package/dist/exec-DEoAhcze.mjs +858 -0
  58. package/dist/exec-DnYc4HGH.d.mts +78 -0
  59. package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
  60. package/dist/gc-DnNDQyaP.mjs +3 -0
  61. package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
  62. package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
  63. package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
  64. package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
  65. package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
  66. package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
  67. package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
  68. package/dist/idle-C4cZ757K.d.mts +24 -0
  69. package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
  70. package/dist/ios-CDvlmUs7.d.mts +24 -0
  71. package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
  72. package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
  73. package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
  74. package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
  75. package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
  76. package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
  77. package/dist/ios-signing-BtAffm0A.mjs +489 -0
  78. package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
  79. package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
  80. package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
  81. package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
  82. package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
  83. package/dist/logs-BfwwadsZ.mjs +479 -0
  84. package/dist/logs-jTS_lHSo.mjs +248 -0
  85. package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
  86. package/dist/macos-NfV2D7dO.mjs +694 -0
  87. package/dist/macos-run.mjs +1 -1
  88. package/dist/maintenance-run.mjs +123 -248
  89. package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
  90. package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
  91. package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
  92. package/dist/native-android-CqgnOgsT.mjs +645 -0
  93. package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
  94. package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
  95. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  96. package/dist/native-run-NwUuxbkg.mjs +276 -0
  97. package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
  98. package/dist/native-source-Y0yLhFyQ.mjs +133 -0
  99. package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
  100. package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
  101. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  102. package/dist/offload-worker.d.mts +59 -41
  103. package/dist/offload-worker.mjs +478 -115
  104. package/dist/operation-exec-BW0em61G.mjs +171 -0
  105. package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
  106. package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
  107. package/dist/paths-BsJMoPP2.mjs +12 -0
  108. package/dist/paths-DQtTgsBf.mjs +42 -0
  109. package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
  110. package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
  111. package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
  112. package/dist/prebuild-D4JoEAEs.mjs +484 -0
  113. package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
  114. package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
  115. package/dist/pull-request-eODyIqZF.d.mts +124 -0
  116. package/dist/pull-requests.d.mts +2 -120
  117. package/dist/pull-requests.mjs +2 -2
  118. package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
  119. package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
  120. package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
  121. package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
  122. package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
  123. package/dist/registration-BcRgF6Ox.mjs +51 -0
  124. package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
  125. package/dist/reload-D7AVlb8N.mjs +2 -0
  126. package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
  127. package/dist/result-D2Ykz_iD.mjs +435 -0
  128. package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
  129. package/dist/selection-DSMbWEX2.mjs +620 -0
  130. package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
  131. package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
  132. package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
  133. package/dist/server-expo-D58c9L0M.mjs +2 -0
  134. package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
  135. package/dist/settings-DpR-1Wnn.mjs +114 -0
  136. package/dist/settings-write-CzD60rOD.mjs +360 -0
  137. package/dist/settings.schema.json +176 -16
  138. package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
  139. package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
  140. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  141. package/dist/stage-Bps5oius.mjs +200 -0
  142. package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
  143. package/dist/start-EojN4WFz.mjs +1364 -0
  144. package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
  145. package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
  146. package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
  147. package/dist/stats-report-BzaPrRm6.mjs +16 -0
  148. package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
  149. package/dist/status-EvrK72L2.mjs +2 -0
  150. package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
  151. package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
  152. package/dist/status-worker.d.mts +1 -0
  153. package/dist/status-worker.mjs +19 -0
  154. package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
  155. package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
  156. package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
  157. package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
  158. package/dist/supervisor-run.d.mts +8 -17
  159. package/dist/supervisor-run.mjs +56 -28
  160. package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
  161. package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
  162. package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
  163. package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
  164. package/dist/toolchain-BY8X8HXx.mjs +2 -0
  165. package/dist/toolchain-DpJMHq0n.mjs +876 -0
  166. package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
  167. package/dist/trigger-yb_nFzPF.mjs +2 -0
  168. package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
  169. package/dist/web-CZ07gd77.mjs +2 -0
  170. package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
  171. package/dist/web-run.mjs +13 -12
  172. package/dist/windows-report.d.mts +1 -0
  173. package/dist/windows-report.mjs +18 -0
  174. package/dist/windows-report.ps1 +43 -0
  175. package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
  176. package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
  177. package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
  178. package/dist/worktree-ZqZVjD9K.mjs +2 -0
  179. package/dist/xcode-BXn9-xYx.mjs +896 -0
  180. package/package.json +7 -5
  181. package/shim/android-audio/Main.java +24 -0
  182. package/shim/android-audio/README.md +17 -0
  183. package/shim/android-audio.jar +0 -0
  184. package/shim/android-optimizations.gradle +7 -5
  185. package/dist/activity-BSV745Kz.mjs +0 -629
  186. package/dist/api-qvOzWyfO.mjs +0 -154
  187. package/dist/api-run.mjs +0 -294
  188. package/dist/app-install-BIKtMfPq.mjs +0 -896
  189. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  190. package/dist/budget-f7516Zk0.mjs +0 -4106
  191. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  192. package/dist/cancellation-C_22VQTH.mjs +0 -24
  193. package/dist/client-qQAaXSUs.mjs +0 -1771
  194. package/dist/config-BYDxlMY3.mjs +0 -562
  195. package/dist/device-DuiPJQSn.mjs +0 -290
  196. package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
  197. package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
  198. package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
  199. package/dist/exec-DqKo9GKJ.mjs +0 -268
  200. package/dist/git-DDfFzkMm.mjs +0 -45
  201. package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
  202. package/dist/logs-BGrEUaEs.mjs +0 -383
  203. package/dist/macos-Ch5VJmcS.mjs +0 -584
  204. package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
  205. package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
  206. package/dist/native-android-D5qc3-_v.mjs +0 -226
  207. package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
  208. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  209. package/dist/plan-C4TjdPsR.mjs +0 -260
  210. package/dist/prebuild-DYbucPXy.mjs +0 -212
  211. package/dist/preview-78a9kR_-.mjs +0 -1011
  212. package/dist/react-native-build-CtCccJtb.mjs +0 -239
  213. package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
  214. package/dist/remote-cache-OyOyVIS3.mjs +0 -526
  215. package/dist/result-CaJg5Iat.mjs +0 -186
  216. package/dist/server-expo-Bigriskl.mjs +0 -2
  217. package/dist/settings-BORNaaCO.mjs +0 -402
  218. package/dist/settings-vk3mJGSm.d.mts +0 -13
  219. package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
  220. package/dist/stage-KNTQopqv.mjs +0 -157
  221. package/dist/start-BWqzODpb.mjs +0 -1116
  222. package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
  223. package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
  224. package/dist/tailnet-Dh-qiYzG.mjs +0 -265
  225. package/dist/toolchain-BFkAcstd.mjs +0 -2
  226. package/dist/toolchain-DxSsNssu.mjs +0 -1657
  227. package/dist/trigger-9_USgmxz.mjs +0 -2
  228. package/dist/web-Dq-i3wzJ.mjs +0 -2
  229. package/dist/worktree-DpLdCHga.mjs +0 -2
  230. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  231. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
@@ -1,238 +0,0 @@
1
- import { gt as gitCommonDirOnDisk } from "./settings-B717odTD.mjs";
2
- import { C as diffFingerprintSources, I as storedSources } from "./device-lease-BX1sJQ2E.mjs";
3
- import { m as sharedBuildCache } from "./workspace-state-DJt_MMvf.mjs";
4
- import { existsSync, realpathSync } from "node:fs";
5
- import { dirname, join, relative } from "node:path";
6
- import { LAST_BUILD_KEYS, loadConfig, readWorkspaceState } from "@stim-cli/core/state";
7
- import * as expoFingerprint from "@expo/fingerprint";
8
- //#region src/cache/miss-reason.ts
9
- const MISS_CHANGE_CAP = 20;
10
- function recordedBuilds(state, platform) {
11
- const builds = [];
12
- for (const value of [state?.[LAST_BUILD_KEYS[platform]], state?.lastBuild]) {
13
- const record = value;
14
- if (record?.platform !== platform) continue;
15
- const startedAt = typeof record.startedAt === "string" ? record.startedAt : "";
16
- if (typeof record.fingerprint === "string" && typeof record.cacheKey === "string") builds.push({
17
- fingerprint: record.fingerprint,
18
- cacheKey: record.cacheKey,
19
- startedAt
20
- });
21
- const carried = record.missReason?.baseline;
22
- if (typeof carried?.fingerprint === "string" && typeof carried.cacheKey === "string") builds.push({
23
- fingerprint: carried.fingerprint,
24
- cacheKey: carried.cacheKey,
25
- startedAt
26
- });
27
- }
28
- return builds;
29
- }
30
- function projectIdentity(root) {
31
- let real;
32
- try {
33
- real = realpathSync.native(root);
34
- } catch {
35
- return null;
36
- }
37
- for (let dir = real;; dir = dirname(dir)) {
38
- if (existsSync(join(dir, ".git"))) {
39
- const common = gitCommonDirOnDisk(dir);
40
- return common ? `${common}\n${relative(dir, real)}` : null;
41
- }
42
- if (dirname(dir) === dir) return null;
43
- }
44
- }
45
- function findMissBaseline(root, platform, { readState = readWorkspaceState, projectRoots = () => Object.keys(loadConfig()?.projects ?? {}), identity = projectIdentity, sourcesOf = (p, key) => storedSources(p, key, sharedBuildCache()) } = {}) {
46
- for (const build of recordedBuilds(readState(root), platform)) {
47
- const sources = sourcesOf(platform, build.cacheKey);
48
- if (sources) return {
49
- fingerprint: build.fingerprint,
50
- cacheKey: build.cacheKey,
51
- sources,
52
- from: "workspace"
53
- };
54
- }
55
- const project = identity(root);
56
- if (!project) return null;
57
- const others = [];
58
- for (const other of projectRoots()) {
59
- if (other === root || identity(other) !== project) continue;
60
- others.push(...recordedBuilds(readState(other), platform));
61
- }
62
- for (const build of others.toSorted((a, b) => (Date.parse(b.startedAt) || 0) - (Date.parse(a.startedAt) || 0))) {
63
- const sources = sourcesOf(platform, build.cacheKey);
64
- if (sources) return {
65
- fingerprint: build.fingerprint,
66
- cacheKey: build.cacheKey,
67
- sources,
68
- from: "project"
69
- };
70
- }
71
- return null;
72
- }
73
- const CATEGORY_RANK = {
74
- "native-dependency": 0,
75
- "app-config": 1,
76
- "config-plugin": 2,
77
- package: 3,
78
- "native-dir": 4,
79
- file: 5,
80
- "app-asset": 6,
81
- other: 7,
82
- "package-scripts": 8,
83
- autolinking: 9
84
- };
85
- function packageIn(path) {
86
- return [...path.matchAll(/(?:^|\/)node_modules\/((?:@[^/]+\/)?[^/]+)/g)].at(-1)?.[1] ?? null;
87
- }
88
- function describeChange({ name, change, reasons }) {
89
- const pkg = packageIn(name);
90
- if (name === "expoConfig" || reasons.includes("expoConfig")) return {
91
- category: "app-config",
92
- label: "app config changed"
93
- };
94
- if (pkg && reasons.some((reason) => /^(expo|rncore)Autolinking(Ios|Android)?$/.test(reason))) return {
95
- category: "native-dependency",
96
- label: `native dependency ${change}: ${pkg}`
97
- };
98
- if (pkg && reasons.includes("expoConfigPlugins")) return {
99
- category: "config-plugin",
100
- label: `config plugin ${change}: ${pkg}`
101
- };
102
- if (/^(expoAutolinkingConfig|rncoreAutolinkingConfig)(:|$)/.test(name)) return {
103
- category: "autolinking",
104
- label: "autolinking config changed"
105
- };
106
- if (name.startsWith("package:")) return {
107
- category: "package",
108
- label: `${name.slice(8)} ${change}`
109
- };
110
- if (name === "packageJson:scripts") return {
111
- category: "package-scripts",
112
- label: "package.json scripts changed"
113
- };
114
- if (reasons.includes("expoConfigExternalFile")) return {
115
- category: "app-asset",
116
- label: `app asset ${change}: ${name}`
117
- };
118
- if (reasons.includes("bareNativeDir")) return {
119
- category: "native-dir",
120
- label: `${name}/ ${change}`
121
- };
122
- if (reasons.length || name.includes("/") || name.includes(".")) return {
123
- category: "file",
124
- label: `${name} ${change}`
125
- };
126
- return {
127
- category: "other",
128
- label: `${name} ${change}`
129
- };
130
- }
131
- function rekeyPrefix(rekeyedBy) {
132
- return rekeyedBy.length ? `${rekeyedBy.join(" and ")} changed native inputs; ` : "";
133
- }
134
- function missReasonFromChanges({ changes, baseline, rekeyedBy = [] }) {
135
- const prefix = rekeyPrefix(rekeyedBy);
136
- if (!baseline) return {
137
- kind: "no-baseline",
138
- summary: `${prefix}no earlier build of this project in the cache to compare with`,
139
- changes: [],
140
- changeCount: 0,
141
- baseline: null,
142
- rekeyedBy
143
- };
144
- if (!changes.length) return {
145
- kind: "same-sources",
146
- summary: `${prefix}native inputs match the last build; no cached app for this configuration or target`,
147
- changes: [],
148
- changeCount: 0,
149
- baseline,
150
- rekeyedBy
151
- };
152
- const described = changes.map((change, index) => ({
153
- change,
154
- index,
155
- ...describeChange(change)
156
- })).toSorted((a, b) => CATEGORY_RANK[a.category] - CATEGORY_RANK[b.category] || a.index - b.index);
157
- const dependencyMoved = described.some((entry) => entry.category === "native-dependency");
158
- const labels = [...new Set(described.filter((entry) => !(dependencyMoved && entry.category === "autolinking")).map((entry) => entry.label))];
159
- const more = labels.length > 1 ? ` (+${labels.length - 1} more)` : "";
160
- return {
161
- kind: "changed",
162
- summary: `${prefix}${labels[0]}${more}`,
163
- changes: described.slice(0, MISS_CHANGE_CAP).map(({ change, category }) => ({
164
- source: change.name,
165
- change: change.change,
166
- category
167
- })),
168
- changeCount: changes.length,
169
- baseline,
170
- rekeyedBy
171
- };
172
- }
173
- function explainBuildMiss({ root, platform, current, rekeyedBy = [], baselineDeps, differ = expoFingerprint.diffFingerprints }) {
174
- const baseline = findMissBaseline(root, platform, baselineDeps);
175
- const changes = baseline ? diffFingerprintSources({
176
- previous: baseline.sources,
177
- previousHash: baseline.fingerprint,
178
- current,
179
- differ
180
- }) : [];
181
- return {
182
- reason: missReasonFromChanges({
183
- changes,
184
- baseline: baseline ? {
185
- fingerprint: baseline.fingerprint,
186
- cacheKey: baseline.cacheKey,
187
- from: baseline.from
188
- } : null,
189
- rekeyedBy
190
- }),
191
- changedNames: changes.map((change) => change.name),
192
- previousHash: baseline?.fingerprint ?? null
193
- };
194
- }
195
- function predictBuildMiss({ root, platform, current, prebuild }) {
196
- const { reason } = explainBuildMiss({
197
- root,
198
- platform,
199
- current
200
- });
201
- const baseline = reason.baseline && {
202
- fingerprint: reason.baseline.fingerprint,
203
- from: reason.baseline.from
204
- };
205
- if (!prebuild || !baseline) return {
206
- ...reason,
207
- baseline
208
- };
209
- const dir = platform === "ios" ? "ios/" : "android/";
210
- return {
211
- ...reason,
212
- kind: "prebuild-pending",
213
- summary: `${reason.summary} (before prebuild ${prebuild}s ${dir})`,
214
- baseline
215
- };
216
- }
217
- function skippedMissReason(summary) {
218
- return {
219
- kind: "cache-skipped",
220
- summary,
221
- changes: [],
222
- changeCount: 0,
223
- baseline: null,
224
- rekeyedBy: []
225
- };
226
- }
227
- function fingerprintErrorMissReason(message) {
228
- return {
229
- kind: "fingerprint-error",
230
- summary: `fingerprinting failed: ${message}`,
231
- changes: [],
232
- changeCount: 0,
233
- baseline: null,
234
- rekeyedBy: []
235
- };
236
- }
237
- //#endregion
238
- export { skippedMissReason as i, fingerprintErrorMissReason as n, predictBuildMiss as r, explainBuildMiss as t };
@@ -1,226 +0,0 @@
1
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
2
- import { $ as settingValueAt } from "./settings-B717odTD.mjs";
3
- import { x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
4
- import { T as findBuildTool, o as androidHome } from "./android-Mz_Inn3w.mjs";
5
- import { i as skippedMissReason } from "./miss-reason-mKzZ4VvN.mjs";
6
- import { o as resolveCcache } from "./ccache-zdKiYQ3E.mjs";
7
- import { a as buildGradle, r as androidSdkRefusal } from "./gradle-DSrXb6lG.mjs";
8
- import { n as androidToolchain } from "./toolchain-DxSsNssu.mjs";
9
- import { i as nativeGradleTransfer, t as gradleOffloadInputs } from "./native-gradle-inputs-BsLRrl7u.mjs";
10
- import { n as androidProcessRuntime } from "./launch-F4sOqAhB.mjs";
11
- import { existsSync, readFileSync, statSync } from "node:fs";
12
- import { isAbsolute, join } from "node:path";
13
- import { fileURLToPath } from "node:url";
14
- //#region src/integrations/native-android.ts
15
- const CACHE_LIMIT = "Native Gradle inputs can include arbitrary external files and plugins; Stim artifact caching is unavailable. Offload requires a complete android.offloadInputs declaration. Gradle still owns incremental and task-cache reuse.";
16
- const MODEL_LIMIT = "Native Android requires AGP with androidComponents, one application module and configuration-on-demand disabled. Gradle resolves the exact variant and APK outputs during the build.";
17
- function refusal(reason) {
18
- return {
19
- code: "STIM_BUILD_FAILED",
20
- reason,
21
- remedy: "Select one signed standalone APK for the requested variant and target ABI in the Android application module, then retry. Stim does not sign APKs or install split APK sets."
22
- };
23
- }
24
- function selectNativeApk(value, variant, abi) {
25
- const model = value;
26
- if (!model || model.schema !== 1 || typeof model.module !== "string" || !model.module.startsWith(":") || model.variant !== variant || typeof model.applicationId !== "string" || !/^[A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+$/.test(model.applicationId) || typeof model.sdkDirectory !== "string" || !isAbsolute(model.sdkDirectory) || !Array.isArray(model.elements) || !model.elements.every((element) => element && typeof element.path === "string" && isAbsolute(element.path) && element.path.endsWith(".apk") && Array.isArray(element.filters) && element.filters.every((filter) => filter && typeof filter.type === "string" && typeof filter.value === "string"))) return refusal("Gradle did not export a valid model for the requested native Android variant.");
27
- const universal = model.elements.filter((element) => element.filters.length === 0);
28
- const candidates = universal.length ? universal : model.elements.filter((element) => abi !== null && element.filters.length === 1 && element.filters[0].type === "ABI" && element.filters[0].value === abi);
29
- if (candidates.length !== 1) return refusal(`Native variant "${variant}" has ${candidates.length} installable APK candidates for ${abi ?? "an unspecified ABI"}. Density splits and ambiguous output sets are unsupported.`);
30
- return {
31
- apkPath: candidates[0].path,
32
- androidPackage: model.applicationId
33
- };
34
- }
35
- async function locateNativeApk(modelFile, variant, abi) {
36
- let value;
37
- try {
38
- value = JSON.parse(readFileSync(modelFile, "utf8"));
39
- } catch {
40
- return refusal("Gradle succeeded without exporting the native Android APK model.");
41
- }
42
- const located = selectNativeApk(value, variant, abi);
43
- if ("code" in located) return located;
44
- try {
45
- if (!statSync(located.apkPath).isFile()) return refusal("The APK selected by Gradle is not a file.");
46
- } catch {
47
- return refusal("The APK selected by Gradle does not exist.");
48
- }
49
- const signer = findBuildTool(["apksigner"], { home: value.sdkDirectory });
50
- if (!signer) return refusal("No Android SDK apksigner is available to verify the native APK signature.");
51
- try {
52
- await getExecutor().runFileAsync(signer.path, ["verify", located.apkPath], { timeoutMs: 3e4 });
53
- } catch (error) {
54
- return refusal(`The native APK signature could not be verified: ${error.message}`);
55
- }
56
- return located;
57
- }
58
- function nativeAndroidProject(root) {
59
- return {
60
- isExpo: false,
61
- packageRemedy: "Check the applicationId reported by AGP for the selected application variant.",
62
- appIds: () => ({
63
- bundleId: null,
64
- androidPackage: null
65
- }),
66
- variantProblem: () => null,
67
- targets: [
68
- "emulator",
69
- "physical",
70
- "hosted"
71
- ],
72
- eas: false,
73
- runtimeKind: () => "process",
74
- plan: async () => ({ refusal: {
75
- code: "STIM_BAD_ARG",
76
- message: `${MODEL_LIMIT} --plan does not execute Gradle. ${CACHE_LIMIT}`,
77
- remedy: "Run `stim android` with an exact --variant to resolve and build the native app."
78
- } }),
79
- runtime: ({ phase }) => androidProcessRuntime(async () => {
80
- phase("metro", "skipped (native process)");
81
- return {
82
- ok: true,
83
- prepared: { metroPort: null }
84
- };
85
- }),
86
- artifact: ({ writer, buildPlan, target, out, estimates, settings }) => {
87
- const variant = buildPlan.variant ?? "debug";
88
- const inputs = settingValueAt(settings, "android.offloadInputs");
89
- let transfer = null;
90
- const modelFile = join(workspaceDir(root), "gradle-build", `native-apk-${encodeURIComponent(variant)}.json`);
91
- return {
92
- identity: async () => ({ cacheIneligible: CACHE_LIMIT }),
93
- cache: () => {
94
- throw new Error(CACHE_LIMIT);
95
- },
96
- prepare: async () => {},
97
- reconcile: async () => ({
98
- identity: null,
99
- rekeyedBy: [],
100
- cacheRefusal: null
101
- }),
102
- validate: async () => null,
103
- materialize: async () => null,
104
- explain: () => ({
105
- reason: skippedMissReason(CACHE_LIMIT),
106
- diff: null
107
- }),
108
- untrackedLine: () => null,
109
- legacyCache: null,
110
- offload: {
111
- supportsUncachedArtifacts: true,
112
- get unsupported() {
113
- if (buildPlan.cas) return "Apple Clang CAS builds build here";
114
- try {
115
- gradleOffloadInputs(inputs);
116
- return null;
117
- } catch (error) {
118
- return error.message;
119
- }
120
- },
121
- target: () => {
122
- transfer = nativeGradleTransfer(root, inputs);
123
- return {
124
- platform: "android",
125
- native: "gradle",
126
- local: androidToolchain(),
127
- requires: {
128
- ndk: null,
129
- buildTools: null,
130
- compileSdk: null
131
- }
132
- };
133
- },
134
- get request() {
135
- if (!transfer) throw new Error("Native Gradle offload needs a declared source inventory.");
136
- return {
137
- platform: "android",
138
- isExpo: false,
139
- native: {
140
- provider: "gradle",
141
- transfer
142
- },
143
- android: {
144
- variant,
145
- abi: target.abi,
146
- gradleBuildCache: buildPlan.gradleBuildCache,
147
- pch: buildPlan.pch,
148
- compilerCache: buildPlan.compilerCache === "none" ? "none" : "ccache"
149
- }
150
- };
151
- },
152
- unchanged: async () => transfer !== null && nativeGradleTransfer(root, inputs).digest === transfer.digest
153
- },
154
- compile: async () => {
155
- const script = ["../shim/native-android.gradle", "../../shim/native-android.gradle"].map((path) => fileURLToPath(new URL(path, import.meta.url))).find(existsSync);
156
- if (!script) throw new Error("Stim installation is missing shim/native-android.gradle.");
157
- return buildGradle({
158
- root,
159
- logWriter: writer,
160
- variant,
161
- project: {
162
- directory: root,
163
- gradlew: join(root, process.platform === "win32" ? "gradlew.bat" : "gradlew"),
164
- module: ":",
165
- outputsDir: root
166
- },
167
- task: ":stimExportAndroidApk",
168
- projectArgs: [
169
- "--init-script",
170
- script,
171
- `-Pstim.native.variant=${variant}`,
172
- `-Pstim.native.model=${modelFile}`
173
- ],
174
- locate: () => locateNativeApk(modelFile, variant, target.abi)
175
- }, {
176
- estimateMs: estimates().coldBuildMs,
177
- ccache: buildPlan.compilerCache === "ccache" ? resolveCcache({
178
- root,
179
- onNote: out
180
- }) : null,
181
- cas: buildPlan.cas,
182
- buildCache: buildPlan.gradleBuildCache,
183
- pch: buildPlan.pch,
184
- compilerCacheDisabled: buildPlan.compilerCache === "none"
185
- });
186
- }
187
- };
188
- }
189
- };
190
- }
191
- function nativeAndroidDoctor(root) {
192
- return { inspect: () => {
193
- const sdkPath = androidHome();
194
- const sdk = androidSdkRefusal({
195
- sdkPath,
196
- sdkExists: existsSync(sdkPath),
197
- hasLocalProperties: existsSync(join(root, "local.properties")),
198
- localPropertiesPath: "local.properties"
199
- });
200
- const wrapper = join(root, process.platform === "win32" ? "gradlew.bat" : "gradlew");
201
- return [
202
- {
203
- level: "note",
204
- title: "Native Android Gradle project",
205
- detail: `${MODEL_LIMIT} ${CACHE_LIMIT} Metro and EAS are unsupported; local, physical and hosted targets use native process readiness.`,
206
- fix: null
207
- },
208
- ...sdk ? [{
209
- level: "cost",
210
- code: "android-sdk-missing",
211
- title: "No Android SDK was found",
212
- detail: sdk.reason,
213
- fix: sdk.remedy
214
- }] : [],
215
- ...!existsSync(wrapper) ? [{
216
- level: "cost",
217
- code: "android-wrapper-missing",
218
- title: "The Gradle wrapper for this host is missing",
219
- detail: wrapper,
220
- fix: "Restore the project Gradle wrapper."
221
- }] : []
222
- ];
223
- } };
224
- }
225
- //#endregion
226
- export { nativeAndroidDoctor, nativeAndroidProject };