stim 1.24.0 → 1.26.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 (162) hide show
  1. package/README.md +1 -1
  2. package/dist/{acquire-artifact-CEs02U2o.mjs → acquire-artifact-DVsvSwf7.mjs} +1 -1
  3. package/dist/{act-Cyvm8xYc.mjs → act-C-BqJEpu.mjs} +158 -36
  4. package/dist/{activity-Dq3ZcdD8.mjs → activity-Lnb_EoRY.mjs} +4 -5
  5. package/dist/{agent-device-usage-output-CccomeE0.mjs → agent-device-usage-output-DbXy5tg8.mjs} +4 -4
  6. package/dist/{android-CX5IcRuf.mjs → android-B5P81yI-.mjs} +1 -1
  7. package/dist/{android-DcztblCT.mjs → android-CSbLRD53.mjs} +5 -5
  8. package/dist/{android-BZppyPe_.mjs → android-CiNQw3kq.mjs} +81 -52
  9. package/dist/{android-882m4hxX.mjs → android-DTAcRwBC.mjs} +81 -34
  10. package/dist/{android-cas-BtCOrNqb.mjs → android-cas-BTVhZ0Qs.mjs} +4 -4
  11. package/dist/{android-project-DVWyCbWU.d.mts → android-project-DUGMbq28.d.mts} +61 -3
  12. package/dist/api.d.mts +8 -5
  13. package/dist/api.mjs +27 -27
  14. package/dist/apk-signed-tail-B46U9hXc.mjs +142 -0
  15. package/dist/{artifact-BR5VNArK.mjs → artifact-BxREhAaV.mjs} +25 -19
  16. package/dist/{artifact-Bdt_n9Jc.mjs → artifact-CsAP6AGK.mjs} +36 -21
  17. package/dist/{attempt-DW-mQqM7.mjs → attempt-ClyJlZPT.mjs} +4 -2
  18. package/dist/{browser-web-ycg9qWB8.mjs → browser-web-rYPyqhTf.mjs} +11 -12
  19. package/dist/{budget-dPGuhNai.mjs → budget-k2mZGvvk.mjs} +242 -38
  20. package/dist/{build-CaF574eS.mjs → build-DPhApsjV.mjs} +28 -24
  21. package/dist/{build-cache-HFUQ9eLz.mjs → build-cache-DrXNCy3T.mjs} +123 -23
  22. package/dist/{build-plan-JsDUq4w1.mjs → build-plan-DrMMdayj.mjs} +5 -5
  23. package/dist/{cache-manifest-BPXRONJz.mjs → cache-manifest-BEZ9Bpl1.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{ccache-CCn1S6qG.mjs → ccache-Bx5TbxwG.mjs} +6 -6
  26. package/dist/{cli-xqAidP7O.mjs → cli-BBKFGOFl.mjs} +19 -19
  27. package/dist/cli.mjs +1 -1
  28. package/dist/{client-18-ZowoT.mjs → client-D9CaRks-.mjs} +55 -71
  29. package/dist/collector-run.mjs +4 -4
  30. package/dist/{command-output-DxC0k2rk.mjs → command-output-BF5AR2dL.mjs} +1 -1
  31. package/dist/{config-BZhXY15H.mjs → config-BktkY_zC.mjs} +321 -15
  32. package/dist/{launch-BVlyQw3T.mjs → dependencies-Dw6wfQdv.mjs} +259 -256
  33. package/dist/{dependency-state-C56ll9hY.mjs → dependency-state-DFB41vfr.mjs} +1 -1
  34. package/dist/{dev-client-w_fok0Ek.mjs → dev-client-DXR_tPVY.mjs} +2 -2
  35. package/dist/{device-BktRGdjS.mjs → device-BK-zwyd_.mjs} +64 -33
  36. package/dist/{device-4RUugw5X.mjs → device-BcYeHSFu.mjs} +14 -14
  37. package/dist/{device-capacity-Ic-kdmEV.mjs → device-capacity-DCSvUF0l.mjs} +10 -17
  38. package/dist/device-host-worker.mjs +11 -13
  39. package/dist/{device-ios-DzpSlZyd.mjs → device-ios-BLGfXQeK.mjs} +68 -25
  40. package/dist/{device-lease-run-DUtkbqBQ.mjs → device-lease-run-BmvIl7bI.mjs} +5 -5
  41. package/dist/{device-pool-CgBHk401.mjs → device-pool-Dluix4H3.mjs} +3 -3
  42. package/dist/{doctor-DZgpqR6J.mjs → doctor-Bhg1ii70.mjs} +14 -14
  43. package/dist/{doctor-BZ6oxNum.mjs → doctor-Cp-BhzTS.mjs} +1 -1
  44. package/dist/{doctor-C33AzVfR.mjs → doctor-OnwP94ne.mjs} +81 -26
  45. package/dist/{doctor-fingerprint-zlujA1Gs.mjs → doctor-fingerprint-D3a04Mhu.mjs} +8 -2
  46. package/dist/doctor-fingerprint.mjs +1 -1
  47. package/dist/{doctor-watchman-B453A231.mjs → doctor-watchman-BStK05nt.mjs} +4 -4
  48. package/dist/{eas-build-CxKUNHsb.mjs → eas-build-Dsj93iM9.mjs} +2 -2
  49. package/dist/{eas-fallback-LMxk9Kw0.mjs → eas-fallback-FwkeqqGi.mjs} +13 -12
  50. package/dist/{eas-session-ledger-Ck6YXPAO.mjs → eas-session-ledger-B5vygTiD.mjs} +5 -5
  51. package/dist/{error-diagnostics-BkKCZq4P.mjs → error-diagnostics-BOOm9Db7.mjs} +8 -8
  52. package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
  53. package/dist/{gc-DDWEAj0w.mjs → gc-C_79zvz4.mjs} +2 -2
  54. package/dist/{gc-yVKpAOKM.mjs → gc-ldgr-hXU.mjs} +74 -43
  55. package/dist/{guide-Bggftwc5.mjs → guide-D7K0X6KG.mjs} +374 -78
  56. package/dist/{hosted-android-D4dweBof.mjs → hosted-android-Bk54ej6n.mjs} +3 -3
  57. package/dist/{hosted-client-BBTVe3X6.mjs → hosted-client-fHO8yqzc.mjs} +5 -5
  58. package/dist/{hosted-ios-Sn0djzg8.mjs → hosted-ios-D55QhYaD.mjs} +1 -1
  59. package/dist/{hosted-logs-CYIZ5ubJ.mjs → hosted-logs-BfbmDM4M.mjs} +17 -11
  60. package/dist/hosted-logs-sync-B0pvmOk-.mjs +195 -0
  61. package/dist/{hosted-macos-CXjsUNBR.mjs → hosted-macos-CPl0OZ9h.mjs} +5 -5
  62. package/dist/{hosted-native-Doxbfzem.mjs → hosted-native-CpDB3-PO.mjs} +6 -7
  63. package/dist/{idle-shutdown-BInjLKqm.mjs → idle-shutdown-FfxL1KdG.mjs} +22 -9
  64. package/dist/{ios-BItP6lkn.mjs → ios-B7-lToDu.mjs} +8 -8
  65. package/dist/{ios-CVUFFZ6C.mjs → ios-WxpDJ5T1.mjs} +129 -14
  66. package/dist/{ios-device-BI38NFFH.mjs → ios-device-CsyryvpT.mjs} +1 -1
  67. package/dist/{ios-B1FXRCMX.mjs → ios-ftxdQbJS.mjs} +84 -51
  68. package/dist/{ios-project-KYqeJURj.mjs → ios-project-Ty5pHl9O.mjs} +6 -6
  69. package/dist/{ios-state-DlElquYD.mjs → ios-state-Cw7-WQf2.mjs} +1 -1
  70. package/dist/{js-swap-BvrQvXHY.mjs → js-swap-BMhXYVDS.mjs} +4 -4
  71. package/dist/{launch-SfzGH_s9.mjs → launch-DOp8RjDz.mjs} +32 -27
  72. package/dist/{logs-DXE32kyb.mjs → logs-dQDki6Tt.mjs} +9 -173
  73. package/dist/{logs-ovlU7m7N.mjs → logs-s1dRIG1E.mjs} +85 -36
  74. package/dist/{macos-B3BveDrU.mjs → macos-B0VEV3Gf.mjs} +1 -1
  75. package/dist/{macos-CCfhb-jT.mjs → macos-DBBPNnIA.mjs} +18 -19
  76. package/dist/macos-run.mjs +1 -1
  77. package/dist/maintenance-run.mjs +28 -11
  78. package/dist/{metro-Bu8LBfzS.mjs → metro-CjC10t6E.mjs} +2 -2
  79. package/dist/{metro-gateway-DtsOy-0P.mjs → metro-gateway-B6_PgD0L.mjs} +2 -3
  80. package/dist/{named-ports-BWDuU5oQ.mjs → named-ports-BG0j1X4g.mjs} +2 -2
  81. package/dist/{native-android-96BBizbq.mjs → native-android-CL2NGiik.mjs} +17 -17
  82. package/dist/{native-gradle-artifact-inputs-BcLYBZil.mjs → native-gradle-artifact-inputs-btSUulme.mjs} +3 -3
  83. package/dist/{native-run-BmH7U8pr.mjs → native-run-BfIDFKLH.mjs} +2 -3
  84. package/dist/{native-runtime-DgtJkzIa.mjs → native-runtime-Dq3RBcON.mjs} +6 -7
  85. package/dist/{native-xcode-inputs-irplbQb0.mjs → native-xcode-inputs-BW7H8JGu.mjs} +2 -2
  86. package/dist/{native-xcode-ios-BY-6hh6M.mjs → native-xcode-ios-CBXJAxfC.mjs} +18 -18
  87. package/dist/offload-worker.d.mts +7 -2
  88. package/dist/offload-worker.mjs +34 -23
  89. package/dist/{ownership-DxlZGDcV.mjs → ownership-BjYvMNX_.mjs} +2 -2
  90. package/dist/{phone-reverses-BdsdesVF.mjs → phone-reverses-lmj6kcPm.mjs} +3 -3
  91. package/dist/{placement-log-DUvqqsB-.mjs → placement-log-DIFPQAXp.mjs} +1 -1
  92. package/dist/{plan-placement-4axc0Hs7.mjs → plan-placement-IiiSQhtz.mjs} +3 -3
  93. package/dist/{ports-D-E_OiAO.mjs → ports-C2_w1Z0Z.mjs} +3 -3
  94. package/dist/prebuild-gmouvmJZ.mjs +1247 -0
  95. package/dist/{project-Dz-hWkb-.mjs → project-BUu6Is4k.mjs} +15 -16
  96. package/dist/{react-native-android-DOinxgwB.mjs → react-native-android-Cgg99REN.mjs} +48 -33
  97. package/dist/{react-native-build-AuCu-aAP.mjs → react-native-build-oNwqF5Wb.mjs} +8 -8
  98. package/dist/{react-native-doctor-2ivJUmwZ.mjs → react-native-doctor-BhA3KUte.mjs} +49 -8
  99. package/dist/{react-native-ios-D5zTIuH8.mjs → react-native-ios-B-nf4rjN.mjs} +40 -25
  100. package/dist/{recordings-CdPwYwvs.mjs → recordings-BldzVKq0.mjs} +1 -1
  101. package/dist/{reload-Ck9RJeSq.mjs → reload-C9OduiNc.mjs} +1 -1
  102. package/dist/{reload-C1TTVesC.mjs → reload-CCR7KC_l.mjs} +14 -14
  103. package/dist/{remote-DEZ7AOVq.mjs → remote-C8S7FlPF.mjs} +16 -7
  104. package/dist/{result-DqBrb12U.mjs → result-7F5hEwQJ.mjs} +17 -17
  105. package/dist/{run-BIwoU44q.mjs → run-BqB0v3pt.mjs} +1 -1
  106. package/dist/{selection-BLtvaqxc.mjs → selection-BNPBZ6T5.mjs} +157 -44
  107. package/dist/{server-bare-Z1ToVLPn.mjs → server-bare-A75rDIdD.mjs} +55 -3
  108. package/dist/{server-command-C0pmjNdG.mjs → server-command-CssKFOD7.mjs} +4 -4
  109. package/dist/{server-expo-Tt_hLRpy.mjs → server-expo-eQfOdydb.mjs} +8 -6
  110. package/dist/server-expo-wvcj5tiZ.mjs +2 -0
  111. package/dist/{settings-RKwY33wv.mjs → settings-CosW5X-S.mjs} +59 -61
  112. package/dist/{settings-kkt0vP4w.mjs → settings-OaGQF-ri.mjs} +1 -1
  113. package/dist/{settings-write--gj6MACV.mjs → settings-write-QjYfSrjF.mjs} +5 -5
  114. package/dist/settings.schema.json +71 -6
  115. package/dist/{simslim-CdWKT3vA.mjs → simslim-Bax1qcxu.mjs} +22 -6
  116. package/dist/{slot-launch-A1BgotaM.mjs → slot-launch-CYCEhfBY.mjs} +6 -6
  117. package/dist/{stage-ERTMh88n.mjs → stage-jKQ7CP_B.mjs} +1 -1
  118. package/dist/{start-Bmg_qmHi.mjs → start-C_wefNKB.mjs} +1 -1
  119. package/dist/{start-BKGrEhzG.mjs → start-_BdJ32cZ.mjs} +9 -10
  120. package/dist/{state-B1ig0Kqy.mjs → state-C1i2nMOP.mjs} +2 -3
  121. package/dist/{state-BfAltYJP.mjs → state-C4OdpOTF.mjs} +1 -2
  122. package/dist/{stats-B-ckuiUg.mjs → stats-tEpEEH-u.mjs} +4 -4
  123. package/dist/{status-Pw-807f0.mjs → status-B9M7x4CZ.mjs} +1 -1
  124. package/dist/{status-Fect2w9R.mjs → status-CRXz-Gtj.mjs} +1 -1
  125. package/dist/{status-DfFp6a76.mjs → status-DQrqodLj.mjs} +22 -23
  126. package/dist/{status-watch-XC7F-AMf.mjs → status-watch-B5wDIH_o.mjs} +4 -4
  127. package/dist/status-worker.mjs +1 -1
  128. package/dist/{stim-desktop-DS0mzR8U.mjs → stim-desktop-6Dqp-gjX.mjs} +1 -1
  129. package/dist/{stop-BFu7X_Do.mjs → stop-CmdNhGlC.mjs} +2 -2
  130. package/dist/{stop-CL1kDHds.mjs → stop-DRqQVqDJ.mjs} +74 -53
  131. package/dist/{stop-DhclRwOO.mjs → stop-ySNQHXMG.mjs} +4 -5
  132. package/dist/supervisor-run.d.mts +1 -0
  133. package/dist/supervisor-run.mjs +15 -16
  134. package/dist/{support-B3tzVhKn.mjs → support-BGSCBoib.mjs} +4 -4
  135. package/dist/{support-B1W-hmC2.mjs → support-CVOCp0Ft.mjs} +15 -12
  136. package/dist/{swiftpm-artifact-inputs-BWYPj9Sn.mjs → swiftpm-artifact-inputs-CfUzt_0Z.mjs} +1 -1
  137. package/dist/{swiftpm-macos-BVCP5mO4.mjs → swiftpm-macos-x6HPpl_2.mjs} +10 -10
  138. package/dist/toolchain-DoavrvIA.mjs +2 -0
  139. package/dist/toolchain-J4J8MrAr.mjs +2107 -0
  140. package/dist/trigger-DzJu208Q.mjs +2 -0
  141. package/dist/{trigger-CBMe2YLH.mjs → trigger-KVaWWNyn.mjs} +1 -1
  142. package/dist/{warm-progress-ol0ZypEu.mjs → warm-progress-DvhTX_eu.mjs} +3 -4
  143. package/dist/web-BFLueSh-.mjs +2 -0
  144. package/dist/{web-BH7peScT.mjs → web-Bihbf7-u.mjs} +8 -9
  145. package/dist/web-run.mjs +4 -4
  146. package/dist/{workspace-state-CeBpIZgr.mjs → workspace-state-pUg3_RRA.mjs} +45 -7
  147. package/dist/{workspaces-CSV2Orf4.mjs → workspaces-g2lhdBXF.mjs} +17 -17
  148. package/dist/{worktree-Dw8kfacb.mjs → worktree-BKuklFh_.mjs} +34 -31
  149. package/dist/{worktree-DEDUzO_L.mjs → worktree-Bm4cb-nU.mjs} +1 -1
  150. package/package.json +8 -8
  151. package/shim/bundle-response.cjs +53 -1
  152. package/shim/bundle-response.d.cts +1 -1
  153. package/shim/expo-metro-config.cjs +23 -1
  154. package/dist/created-devices-D2Aca-xu.mjs +0 -52
  155. package/dist/paths-DQtTgsBf.mjs +0 -42
  156. package/dist/prebuild-DmVCf5xb.mjs +0 -501
  157. package/dist/server-expo-CEntXzRw.mjs +0 -2
  158. package/dist/toolchain-BjgKdoEf.mjs +0 -2
  159. package/dist/toolchain-D3bmRMia.mjs +0 -897
  160. package/dist/trigger-BLsHgAGR.mjs +0 -2
  161. package/dist/web-BdOFlTJr.mjs +0 -2
  162. package/dist/xcode-DHu41qQ4.mjs +0 -910
@@ -1,501 +0,0 @@
1
- import { _ as spawnDeclared, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
- import { i as sharedBuildCache } from "./paths-DQtTgsBf.mjs";
3
- import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
4
- import { o as git, s as gitAsync } from "./operation-exec-CUZifp6Z.mjs";
5
- import { l as withWorkspaceStateLockAsync, o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-CeBpIZgr.mjs";
6
- import { yt as gitCommonDirOnDisk } from "./settings-RKwY33wv.mjs";
7
- import { v as detectIsExpo } from "./project-Dz-hWkb-.mjs";
8
- import { $n as remoteCliInvocation } from "./budget-dPGuhNai.mjs";
9
- import { S as storedSources, o as diffFingerprintSources } from "./build-cache-HFUQ9eLz.mjs";
10
- import { i as expoBinRefusal, o as expoSdkMajor, r as expoBinPath, s as expoTelemetryEnv } from "./server-expo-Tt_hLRpy.mjs";
11
- import { existsSync, realpathSync } from "node:fs";
12
- import { dirname, join, relative } from "node:path";
13
- import { ambientContext } from "@stim-cli/core";
14
- import { LAST_BUILD_KEYS, loadConfig, readWorkspaceState } from "@stim-cli/core/state";
15
- import * as expoFingerprint from "@expo/fingerprint";
16
- //#region src/cache/miss-reason.ts
17
- const MISS_CHANGE_CAP = 20;
18
- function recordedBuilds(state, platform) {
19
- const builds = [];
20
- for (const value of [state?.[LAST_BUILD_KEYS[platform]], state?.lastBuild]) {
21
- const record = value;
22
- if (record?.platform !== platform) continue;
23
- const startedAt = typeof record.startedAt === "string" ? record.startedAt : "";
24
- if (typeof record.fingerprint === "string" && typeof record.cacheKey === "string") builds.push({
25
- fingerprint: record.fingerprint,
26
- cacheKey: record.cacheKey,
27
- startedAt
28
- });
29
- const carried = record.missReason?.baseline;
30
- if (typeof carried?.fingerprint === "string" && typeof carried.cacheKey === "string") builds.push({
31
- fingerprint: carried.fingerprint,
32
- cacheKey: carried.cacheKey,
33
- startedAt
34
- });
35
- }
36
- return builds;
37
- }
38
- function projectIdentity(root) {
39
- let real;
40
- try {
41
- real = realpathSync.native(root);
42
- } catch {
43
- return null;
44
- }
45
- for (let dir = real;; dir = dirname(dir)) {
46
- if (existsSync(join(dir, ".git"))) {
47
- const common = gitCommonDirOnDisk(dir);
48
- return common ? `${common}\n${relative(dir, real)}` : null;
49
- }
50
- if (dirname(dir) === dir) return null;
51
- }
52
- }
53
- function findMissBaseline(root, platform, { readState = readWorkspaceState, projectRoots = () => Object.keys(loadConfig()?.projects ?? {}), identity = projectIdentity, sourcesOf = (p, key) => storedSources(p, key, sharedBuildCache()) } = {}) {
54
- for (const build of recordedBuilds(readState(root), platform)) {
55
- const sources = sourcesOf(platform, build.cacheKey);
56
- if (sources) return {
57
- fingerprint: build.fingerprint,
58
- cacheKey: build.cacheKey,
59
- sources,
60
- from: "workspace"
61
- };
62
- }
63
- const project = identity(root);
64
- if (!project) return null;
65
- const others = [];
66
- for (const other of projectRoots()) {
67
- if (other === root || identity(other) !== project) continue;
68
- others.push(...recordedBuilds(readState(other), platform));
69
- }
70
- for (const build of others.toSorted((a, b) => (Date.parse(b.startedAt) || 0) - (Date.parse(a.startedAt) || 0))) {
71
- const sources = sourcesOf(platform, build.cacheKey);
72
- if (sources) return {
73
- fingerprint: build.fingerprint,
74
- cacheKey: build.cacheKey,
75
- sources,
76
- from: "project"
77
- };
78
- }
79
- return null;
80
- }
81
- const CATEGORY_RANK = {
82
- "native-dependency": 0,
83
- "app-config": 1,
84
- "config-plugin": 2,
85
- package: 3,
86
- "native-dir": 4,
87
- file: 5,
88
- "app-asset": 6,
89
- other: 7,
90
- "package-scripts": 8,
91
- autolinking: 9
92
- };
93
- function packageIn(path) {
94
- return [...path.matchAll(/(?:^|\/)node_modules\/((?:@[^/]+\/)?[^/]+)/g)].at(-1)?.[1] ?? null;
95
- }
96
- function describeChange({ name, change, reasons }) {
97
- const pkg = packageIn(name);
98
- if (name === "expoConfig" || reasons.includes("expoConfig")) return {
99
- category: "app-config",
100
- label: "app config changed"
101
- };
102
- if (pkg && reasons.some((reason) => /^(expo|rncore)Autolinking(Ios|Android)?$/.test(reason))) return {
103
- category: "native-dependency",
104
- label: `native dependency ${change}: ${pkg}`
105
- };
106
- if (pkg && reasons.includes("expoConfigPlugins")) return {
107
- category: "config-plugin",
108
- label: `config plugin ${change}: ${pkg}`
109
- };
110
- if (/^(expoAutolinkingConfig|rncoreAutolinkingConfig)(:|$)/.test(name)) return {
111
- category: "autolinking",
112
- label: "autolinking config changed"
113
- };
114
- if (name.startsWith("package:")) return {
115
- category: "package",
116
- label: `${name.slice(8)} ${change}`
117
- };
118
- if (name === "packageJson:scripts") return {
119
- category: "package-scripts",
120
- label: "package.json scripts changed"
121
- };
122
- if (reasons.includes("expoConfigExternalFile")) return {
123
- category: "app-asset",
124
- label: `app asset ${change}: ${name}`
125
- };
126
- if (reasons.includes("bareNativeDir")) return {
127
- category: "native-dir",
128
- label: `${name}/ ${change}`
129
- };
130
- if (reasons.length || name.includes("/") || name.includes(".")) return {
131
- category: "file",
132
- label: `${name} ${change}`
133
- };
134
- return {
135
- category: "other",
136
- label: `${name} ${change}`
137
- };
138
- }
139
- function rekeyPrefix(rekeyedBy) {
140
- return rekeyedBy.length ? `${rekeyedBy.join(" and ")} changed native inputs; ` : "";
141
- }
142
- function missReasonFromChanges({ changes, baseline, rekeyedBy = [] }) {
143
- const prefix = rekeyPrefix(rekeyedBy);
144
- if (!baseline) return {
145
- kind: "no-baseline",
146
- summary: `${prefix}no earlier build of this project in the cache to compare with`,
147
- changes: [],
148
- changeCount: 0,
149
- baseline: null,
150
- rekeyedBy
151
- };
152
- if (!changes.length) return {
153
- kind: "same-sources",
154
- summary: `${prefix}native inputs match the last build; no cached app for this configuration or target`,
155
- changes: [],
156
- changeCount: 0,
157
- baseline,
158
- rekeyedBy
159
- };
160
- const described = changes.map((change, index) => ({
161
- change,
162
- index,
163
- ...describeChange(change)
164
- })).toSorted((a, b) => CATEGORY_RANK[a.category] - CATEGORY_RANK[b.category] || a.index - b.index);
165
- const dependencyMoved = described.some((entry) => entry.category === "native-dependency");
166
- const labels = [...new Set(described.filter((entry) => !(dependencyMoved && entry.category === "autolinking")).map((entry) => entry.label))];
167
- const more = labels.length > 1 ? ` (+${labels.length - 1} more)` : "";
168
- return {
169
- kind: "changed",
170
- summary: `${prefix}${labels[0]}${more}`,
171
- changes: described.slice(0, MISS_CHANGE_CAP).map(({ change, category }) => ({
172
- source: change.name,
173
- change: change.change,
174
- category
175
- })),
176
- changeCount: changes.length,
177
- baseline,
178
- rekeyedBy
179
- };
180
- }
181
- function explainBuildMiss({ root, platform, current, rekeyedBy = [], baselineDeps, differ = expoFingerprint.diffFingerprints }) {
182
- const baseline = findMissBaseline(root, platform, baselineDeps);
183
- const changes = baseline ? diffFingerprintSources({
184
- previous: baseline.sources,
185
- previousHash: baseline.fingerprint,
186
- current,
187
- differ
188
- }) : [];
189
- return {
190
- reason: missReasonFromChanges({
191
- changes,
192
- baseline: baseline ? {
193
- fingerprint: baseline.fingerprint,
194
- cacheKey: baseline.cacheKey,
195
- from: baseline.from
196
- } : null,
197
- rekeyedBy
198
- }),
199
- changedNames: changes.map((change) => change.name),
200
- previousHash: baseline?.fingerprint ?? null
201
- };
202
- }
203
- function predictBuildMiss({ root, platform, current, prebuild }) {
204
- const { reason } = explainBuildMiss({
205
- root,
206
- platform,
207
- current
208
- });
209
- const baseline = reason.baseline && {
210
- fingerprint: reason.baseline.fingerprint,
211
- from: reason.baseline.from
212
- };
213
- if (!prebuild || !baseline) return {
214
- ...reason,
215
- baseline
216
- };
217
- const dir = platform === "ios" ? "ios/" : "android/";
218
- return {
219
- ...reason,
220
- kind: "prebuild-pending",
221
- summary: `${reason.summary} (before prebuild ${prebuild}s ${dir})`,
222
- baseline
223
- };
224
- }
225
- function skippedMissReason(summary) {
226
- return {
227
- kind: "cache-skipped",
228
- summary,
229
- changes: [],
230
- changeCount: 0,
231
- baseline: null,
232
- rekeyedBy: []
233
- };
234
- }
235
- function fingerprintErrorMissReason(message) {
236
- return {
237
- kind: "fingerprint-error",
238
- summary: `fingerprinting failed: ${message}`,
239
- changes: [],
240
- changeCount: 0,
241
- baseline: null,
242
- rekeyedBy: []
243
- };
244
- }
245
- //#endregion
246
- //#region src/engine/prebuild.ts
247
- const PREBUILD_ERROR = "STIM_PREBUILD_FAILED";
248
- const LAST_LINES = 20;
249
- function nativeDirName(platform) {
250
- return platform === "android" ? "android" : "ios";
251
- }
252
- function nativeDir(root, platform) {
253
- return join(root, nativeDirName(platform));
254
- }
255
- function nativeDirInFingerprint(sources, platform) {
256
- const dir = nativeDirName(platform);
257
- return sources.some((source) => source.type === "dir" && source.filePath === dir && source.hash != null);
258
- }
259
- /**
260
- * @expo/fingerprint leaves a native directory out of the hash when git ignores it (CNG), so the cache
261
- * key only covers that directory when this workspace's recorded prebuild ran on the same fingerprint.
262
- */
263
- function prebuildAction({ isExpo, nativeDirExists, nativeDirFingerprinted, nativeDirTracked, generatedFrom, fingerprint }) {
264
- if (!isExpo) return "none";
265
- if (!nativeDirExists) return "generate";
266
- if (nativeDirFingerprinted || generatedFrom === fingerprint) return "none";
267
- return nativeDirTracked ? "refuse" : "regenerate";
268
- }
269
- function prebuildRecord(state) {
270
- const record = state?.prebuild;
271
- return record && typeof record === "object" ? record : {};
272
- }
273
- function unreadableGitTracksNativeDir(error) {
274
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
275
- return !/not a git repository \(or any (of the parent directories|parent up to mount point)/.test(error instanceof Error ? error.message : String(error));
276
- }
277
- function gitTracksNativeDir(root, platform) {
278
- try {
279
- return git(root, [
280
- "ls-files",
281
- "--",
282
- nativeDirName(platform)
283
- ], { env: {
284
- LC_ALL: "C",
285
- LANGUAGE: "C"
286
- } }).trim() !== "";
287
- } catch (error) {
288
- return unreadableGitTracksNativeDir(error);
289
- }
290
- }
291
- function prebuildInputs(root, platform, { isExpo, fingerprint, sources }) {
292
- const nativeDirExists = existsSync(nativeDir(root, platform));
293
- const fingerprinted = nativeDirInFingerprint(sources, platform);
294
- const generatedFrom = prebuildRecord(readWorkspaceState$1(root))[platform];
295
- return {
296
- isExpo,
297
- nativeDirExists,
298
- nativeDirFingerprinted: fingerprinted,
299
- generatedFrom: typeof generatedFrom === "string" ? generatedFrom : null,
300
- fingerprint
301
- };
302
- }
303
- function planPrebuild(root, platform, options) {
304
- const inputs = prebuildInputs(root, platform, options);
305
- return prebuildAction({
306
- ...inputs,
307
- nativeDirTracked: inputs.nativeDirExists && !inputs.nativeDirFingerprinted && gitTracksNativeDir(root, platform)
308
- });
309
- }
310
- async function planPrebuildAsync(root, platform, options, signal) {
311
- signal?.throwIfAborted();
312
- const untracked = prebuildAction({
313
- ...prebuildInputs(root, platform, options),
314
- nativeDirTracked: false
315
- });
316
- if (untracked !== "regenerate") return untracked;
317
- let tracked;
318
- try {
319
- tracked = (await gitAsync(root, [
320
- "ls-files",
321
- "--",
322
- nativeDirName(platform)
323
- ], {
324
- env: {
325
- LC_ALL: "C",
326
- LANGUAGE: "C"
327
- },
328
- signal
329
- })).trim() !== "";
330
- } catch (error) {
331
- signal?.throwIfAborted();
332
- tracked = unreadableGitTracksNativeDir(error);
333
- }
334
- return tracked ? "refuse" : "regenerate";
335
- }
336
- function recordPrebuild(root, platform, fingerprint) {
337
- updateWorkspaceState(root, (state) => ({
338
- ...state,
339
- prebuild: {
340
- ...prebuildRecord(state),
341
- [platform]: fingerprint
342
- }
343
- }));
344
- }
345
- /** Records the prebuild fingerprint after waiting for the workspace state lock without blocking the event loop. */
346
- function recordPrebuildAsync(root, platform, fingerprint) {
347
- return withWorkspaceStateLockAsync(root, () => recordPrebuild(root, platform, fingerprint));
348
- }
349
- /**
350
- * @expo/cli 57 made `expo prebuild` delete existing native folders by default and added `--no-clean`
351
- * to keep them (expo/expo#47209); earlier CLIs keep them by default and reject `--no-clean`.
352
- */
353
- function keepNativeDirArgs(root) {
354
- return (expoSdkMajor(root) ?? 0) >= 57 ? ["--no-clean"] : [];
355
- }
356
- function staleNativeDirRemedy(platform) {
357
- const dir = nativeDirName(platform);
358
- return `Fix what the output above reports. Stim ran \`expo prebuild\` over the existing ${dir}/ without deleting it, which keeps what earlier config plugins wrote there. If ${dir}/ predates a removed config plugin or an Expo SDK upgrade, delete ${dir}/ and run again so Stim generates it fresh.`;
359
- }
360
- function staleNativeDirRefusal(platform) {
361
- const dir = nativeDirName(platform);
362
- return {
363
- code: PREBUILD_ERROR,
364
- message: `The fingerprint leaves ${dir}/ out of the cache key, and Stim cannot show that ${dir}/ was generated from the current app config. Git tracks files in it, or could not say whether it does, so Stim will not run \`expo prebuild\` over it.`,
365
- remedy: `Stop excluding ${dir}/ from the fingerprint (check .fingerprintignore) so the cache key covers its files, or add ${dir}/ to .gitignore and untrack it so Stim regenerates it from the app config.`
366
- };
367
- }
368
- function prebuildRefusal({ isExpo, platform, nativeDirExists }) {
369
- if (nativeDirExists || isExpo) return null;
370
- const dir = nativeDirName(platform);
371
- return {
372
- code: PREBUILD_ERROR,
373
- message: `This project has no ${dir}/ directory and is not an Expo (CNG) project, so Stim cannot generate one.`,
374
- remedy: `Check out or generate the native project (\`npx @react-native-community/cli init\` produced one originally), or add \`expo\` to the project so \`expo prebuild\` can create ${dir}/.`
375
- };
376
- }
377
- function prebuildFailure(logWriter, result) {
378
- logWriter?.write?.({
379
- src: "build",
380
- level: "error",
381
- msg: result.reason || "Expo prebuild failed.",
382
- event: "prebuild_failed"
383
- });
384
- return result;
385
- }
386
- async function runPrebuild(root, platform, logWriter, { spawnFn = null, now = Date.now, isExpo = null, clean = false } = {}) {
387
- const dirExists = existsSync(nativeDir(root, platform));
388
- const refusal = prebuildRefusal({
389
- isExpo: isExpo === null ? detectIsExpo(root) : isExpo,
390
- platform,
391
- nativeDirExists: dirExists
392
- });
393
- if (refusal) return prebuildFailure(logWriter, {
394
- failed: true,
395
- code: refusal.code,
396
- reason: refusal.message,
397
- remedy: refusal.remedy,
398
- error: refusal,
399
- lastLines: []
400
- });
401
- const bin = expoBinPath(root);
402
- if (!bin) {
403
- const binRefusal = expoBinRefusal(root, "prebuild");
404
- return prebuildFailure(logWriter, {
405
- failed: true,
406
- code: PREBUILD_ERROR,
407
- reason: binRefusal.message,
408
- remedy: binRefusal.remedy,
409
- lastLines: []
410
- });
411
- }
412
- const spawn = spawnFn || ((cmd, args, opts) => getExecutor().spawn(cmd, args, opts));
413
- const startedAt = now();
414
- const tail = [];
415
- const push = (line) => {
416
- const msg = stripAnsi(String(line)).trimEnd();
417
- if (!msg.trim()) return;
418
- tail.push(msg);
419
- if (tail.length > LAST_LINES) tail.shift();
420
- logWriter?.write?.({
421
- src: "build",
422
- level: "debug",
423
- msg,
424
- raw: true,
425
- event: "prebuild"
426
- });
427
- };
428
- let child;
429
- try {
430
- const invocation = remoteCliInvocation(bin, [
431
- "prebuild",
432
- "-p",
433
- platform,
434
- "--no-install",
435
- ...clean ? ["--clean"] : dirExists ? keepNativeDirArgs(root) : []
436
- ], "expo");
437
- child = spawnDeclared(ambientContext(), () => spawn(invocation.file, invocation.args, {
438
- cwd: root,
439
- stdio: [
440
- "ignore",
441
- "pipe",
442
- "pipe"
443
- ],
444
- env: {
445
- ...ambientContext()?.env ?? process.env,
446
- ...expoTelemetryEnv(ambientContext()?.env ?? process.env),
447
- FORCE_COLOR: "0",
448
- CI: "1"
449
- }
450
- }));
451
- } catch (err) {
452
- return prebuildFailure(logWriter, {
453
- failed: true,
454
- code: PREBUILD_ERROR,
455
- reason: `Could not run \`expo prebuild\`: ${err?.message || err}`,
456
- lastLines: []
457
- });
458
- }
459
- const outReader = createLineReader(push);
460
- const errReader = createLineReader(push);
461
- child.stdout?.setEncoding?.("utf-8");
462
- child.stderr?.setEncoding?.("utf-8");
463
- child.stdout?.on("data", (chunk) => outReader.push(chunk));
464
- child.stderr?.on("data", (chunk) => errReader.push(chunk));
465
- const result = await waitForChild(child);
466
- outReader.flush();
467
- errReader.flush();
468
- const durationMs = now() - startedAt;
469
- if (result.error) return prebuildFailure(logWriter, {
470
- failed: true,
471
- code: PREBUILD_ERROR,
472
- reason: `Could not run \`expo prebuild\`: ${result.error?.message || result.error}`,
473
- lastLines: tail.slice(),
474
- durationMs
475
- });
476
- if (result.code !== 0) {
477
- const how = result.signal ? `signal ${result.signal}` : `exit code ${result.code}`;
478
- return prebuildFailure(logWriter, {
479
- failed: true,
480
- code: PREBUILD_ERROR,
481
- reason: `\`expo prebuild -p ${platform}\` failed (${how}).`,
482
- ...dirExists && !clean ? { remedy: staleNativeDirRemedy(platform) } : {},
483
- lastLines: tail.slice(),
484
- durationMs
485
- });
486
- }
487
- if (!existsSync(nativeDir(root, platform))) return prebuildFailure(logWriter, {
488
- failed: true,
489
- code: PREBUILD_ERROR,
490
- reason: `\`expo prebuild -p ${platform}\` succeeded but did not create ${nativeDirName(platform)}/.`,
491
- lastLines: tail.slice(),
492
- durationMs
493
- });
494
- return {
495
- ok: true,
496
- durationMs,
497
- nativeDir: nativeDir(root, platform)
498
- };
499
- }
500
- //#endregion
501
- export { runPrebuild as a, fingerprintErrorMissReason as c, recordPrebuildAsync as i, predictBuildMiss as l, planPrebuildAsync as n, staleNativeDirRefusal as o, recordPrebuild as r, explainBuildMiss as s, planPrebuild as t, skippedMissReason as u };
@@ -1,2 +0,0 @@
1
- import { m as startExpoServer } from "./server-expo-Tt_hLRpy.mjs";
2
- export { startExpoServer };
@@ -1,2 +0,0 @@
1
- import { c as macosToolchain, l as macosToolchainAsync } from "./toolchain-D3bmRMia.mjs";
2
- export { macosToolchain, macosToolchainAsync };