stim 1.18.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.
- package/README.md +21 -4
- package/dist/{activity-BxnkDZDi.mjs → activity-BrGh9EAI.mjs} +3 -3
- package/dist/{agent-device-usage-output-CZ66YA4T.mjs → agent-device-usage-output-DVyv_hWj.mjs} +7 -7
- package/dist/android-0vv-OruW.mjs +6 -0
- package/dist/android-Brx6EKvJ.mjs +1258 -0
- package/dist/{android-DC3ZLuw0.mjs → android-BsYNR81W.mjs} +103 -45
- package/dist/{android-CBwCNicO.mjs → android-CK3fpEyZ.mjs} +2 -2
- package/dist/{android-cas-BBFyr9CA.mjs → android-cas-DCAuXryb.mjs} +9 -5
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/api-run.mjs +159 -8
- package/dist/{api-D0VtFhqk.mjs → api-zuX3ynYN.mjs} +9 -7
- package/dist/api.d.mts +104 -4
- package/dist/api.mjs +1 -1
- package/dist/{app-install-D-PUENug.mjs → app-install-0LgaQRT7.mjs} +39 -18
- package/dist/artifact-CnC0mfov.mjs +807 -0
- package/dist/artifact-DClXJNWx.mjs +772 -0
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +30 -0
- package/dist/{web-DTU0uiWj.mjs → browser-web-CzBmhmgs.mjs} +136 -174
- package/dist/{budget-DIhL2BKx.mjs → budget-BONq9vXY.mjs} +3096 -3244
- package/dist/build-BixRI6sB.mjs +462 -0
- package/dist/build-plan-CP0tckNU.mjs +553 -0
- package/dist/{cache-manifest-BI7ozfmH.mjs → cache-manifest-qA3dT2x2.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/ccache-CjHQ5F8g.mjs +142 -0
- package/dist/{chrome-DJnmnS5q.mjs → chrome-Dp2lMLBe.mjs} +1 -1
- package/dist/{cli-DNJMwADx.mjs → cli-B2R8wH1F.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-DzhapoMB.mjs → client-BLy1Pw2V.mjs} +172 -165
- package/dist/collector-run.d.mts +10 -0
- package/dist/collector-run.mjs +7 -7
- package/dist/{command-output-CBtzyIgF.mjs → command-output-BjPN99ZB.mjs} +2 -2
- package/dist/{config-CgYMahz7.mjs → config-D0LhTY3S.mjs} +13 -13
- package/dist/{created-devices-DKbeWsiK.mjs → created-devices-HU_DAb_Q.mjs} +7 -6
- package/dist/{dependency-state-xKoOypBm.mjs → dependency-state-B2m8eqsS.mjs} +2 -2
- package/dist/{detached-entry-BLfcgc4O.mjs → detached-entry-BXq4fIl-.mjs} +1 -1
- package/dist/{dev-client-CLnIH02x.mjs → dev-client-ClATaJoH.mjs} +2 -2
- package/dist/{device-D7oCHGWi.mjs → device-B7lsC0K1.mjs} +8 -8
- package/dist/device-DVCwAFlX.mjs +727 -0
- package/dist/{device-capacity-EUOOYr8T.mjs → device-capacity-Ca_ke1LE.mjs} +25 -15
- package/dist/device-host-worker.mjs +38 -18
- package/dist/{device-ios-6MewKKnc.mjs → device-ios-CRUqPxKw.mjs} +12 -11
- package/dist/{device-lease-Co-EwifR.mjs → device-lease-DHOBXGgS.mjs} +135 -22
- package/dist/{device-lease-run-w1xhCqIW.mjs → device-lease-run-CvDeHTkG.mjs} +4 -4
- package/dist/{device-pool-F5WvRPtD.mjs → device-pool-L2-5GxMy.mjs} +3 -3
- package/dist/{device-remote-tHbd1fKy.mjs → device-remote-Bmg42063.mjs} +17 -69
- package/dist/doctor-C2MSuMMg.mjs +515 -0
- package/dist/{doctor-B9ckYUoU.mjs → doctor-DPAqhVCK.mjs} +334 -721
- package/dist/doctor-watchman-CB4NnVZm.mjs +260 -0
- package/dist/{simslim-EHBQ2R4G.mjs → eas-build-Dw_ec2Km.mjs} +6 -152
- package/dist/{stim-installations-aR_WsNOA.mjs → eas-session-ledger-DZlC-Fq3.mjs} +57 -4
- package/dist/{error-diagnostics-BRXOqDzG.mjs → error-diagnostics-Du7I_GuY.mjs} +17 -12
- package/dist/errors-DzkMYh8Q.mjs +205 -0
- package/dist/{exec-DWhCZDGm.mjs → exec-B81Qodjn.mjs} +69 -15
- package/dist/{gc-Dh6mXOKC.mjs → gc-PWp34zGb.mjs} +23 -22
- package/dist/{gradle-C6GKnunQ.mjs → gradle-C2OEKCCI.mjs} +50 -125
- package/dist/{guide-tm6igAaa.mjs → guide-Dai9lphv.mjs} +862 -538
- package/dist/{hosted-android-Bv285t_t.mjs → hosted-android-DQ-Agsd8.mjs} +5 -5
- package/dist/{hosted-client-C-rMtppF.mjs → hosted-client-Io01s5By.mjs} +9 -3
- package/dist/{hosted-ios-D5mNmtj4.mjs → hosted-ios-DIxFnYp-.mjs} +3 -3
- package/dist/{hosted-logs-DN8Iz4mJ.mjs → hosted-logs-DP-ABU_M.mjs} +8 -8
- package/dist/{hosted-macos-B-wEjlwG.mjs → hosted-macos-Aziw9T_9.mjs} +7 -6
- package/dist/{hosted-native-DeeOG8xZ.mjs → hosted-native-BdAQi21M.mjs} +23 -16
- package/dist/{idle-shutdown-jjtxAn5C.mjs → idle-shutdown-DdMqoSUB.mjs} +7 -7
- package/dist/ios-BZ9dg2Fr.mjs +9 -0
- package/dist/{ios-B3SbOWdw.mjs → ios-CXLIUxXJ.mjs} +180 -24
- package/dist/ios-CZuv6gRv.mjs +1112 -0
- package/dist/{ios-Bvbf0SGY.mjs → ios-VGvNdsv2.mjs} +1 -1
- package/dist/{ios-device-Bn7jWDB1.mjs → ios-device-B1B14xND.mjs} +1 -1
- package/dist/{ios-device-vOaByMhw.mjs → ios-device-BreZOpM0.mjs} +3 -3
- package/dist/ios-project-B9drt_aY.mjs +197 -0
- package/dist/{ios-state-B2pES6Vs.mjs → ios-state-CjrL2qv-.mjs} +1 -1
- package/dist/js-swap-C8icNYIY.mjs +432 -0
- package/dist/launch-DxH0THLP.mjs +745 -0
- package/dist/launch-YrbqaIFj.mjs +1530 -0
- package/dist/{launch-verify-hskNcWkZ.mjs → launch-verify-BzRdbuO1.mjs} +26 -7
- package/dist/{logs-1Ylc1Ri6.mjs → logs-DHaRNfg7.mjs} +11 -11
- package/dist/macos-C0iljhsN.mjs +2 -0
- package/dist/{macos-DF6C7wUU.mjs → macos-V_3Ui7g4.mjs} +125 -155
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +13 -10
- package/dist/{metro-Dh8T4Ytd.mjs → metro-D_j9sN-B.mjs} +209 -43
- package/dist/{metro-gateway-CEUw9RMH.mjs → metro-gateway-BBJldOdi.mjs} +2 -2
- package/dist/miss-reason-BPAzZS0r.mjs +238 -0
- package/dist/{named-ports-BFIz1Shz.mjs → named-ports-C2lvoPsb.mjs} +12 -5
- package/dist/native-android-lHzaew7r.mjs +226 -0
- package/dist/native-gradle-inputs-BQnIdAlL.mjs +356 -0
- package/dist/{native-runtime-D_603JiC.mjs → native-runtime-BRmWL7ru.mjs} +9 -8
- package/dist/native-xcode-inputs-eutS19jU.mjs +307 -0
- package/dist/native-xcode-ios-DP3cHLwu.mjs +434 -0
- package/dist/{ndjson-LGZAMsqa.mjs → ndjson-GOnbyvso.mjs} +6 -6
- package/dist/offload-worker.d.mts +12 -6
- package/dist/offload-worker.mjs +409 -73
- package/dist/{ownership-D6Se7gg_.mjs → ownership-DXzMMSx6.mjs} +2 -2
- package/dist/{placement-log-BcPhRwR4.mjs → placement-log-reFbjqEr.mjs} +7 -3
- package/dist/plan-BDk2AeY_.mjs +260 -0
- package/dist/plan-placement-D_YYlE6N.mjs +73 -0
- package/dist/{ports-BLTtfBq-.mjs → ports-jzvAJXXL.mjs} +3 -3
- package/dist/{prebuild-juCyreaR.mjs → prebuild-Bw44QxVh.mjs} +4 -4
- package/dist/{preview-D5V07Nrl.mjs → preview-BaBJ72Al.mjs} +51 -34
- package/dist/project-B8_duAzW.mjs +1067 -0
- package/dist/project-plan-BPwbLwQu.mjs +10 -0
- package/dist/{pull-request-u4vp7zmK.mjs → pull-request-vOhLNmIb.mjs} +1 -1
- package/dist/pull-requests.mjs +1 -1
- package/dist/react-native-android-chm1DMlA.mjs +921 -0
- package/dist/react-native-build-oAw6gQeW.mjs +239 -0
- package/dist/react-native-doctor-DYXoh-6I.mjs +78 -0
- package/dist/react-native-ios-SCTK_CT5.mjs +595 -0
- package/dist/{recordings-BAWltsVt.mjs → recordings-Bk-VivUV.mjs} +1 -1
- package/dist/{reload-DvyWzVjJ.mjs → reload-D34GkY78.mjs} +17 -14
- package/dist/remote-BU9UyhCJ.mjs +192 -0
- package/dist/{remote-cache-BGg7aGIZ.mjs → remote-cache-Bsts6f6Y.mjs} +5 -5
- package/dist/result-BDoRk1k3.mjs +186 -0
- package/dist/{run-vhtDgpHO.mjs → run-qvff78hv.mjs} +3 -3
- package/dist/{server-bare-B9E7S1aR.mjs → server-bare-dWjAarki.mjs} +6 -6
- package/dist/server-command-7XIKlWtO.mjs +69 -0
- package/dist/{server-expo-DoBHhuzK.mjs → server-expo-CsYu2aKL.mjs} +107 -82
- package/dist/server-expo-DV43vep4.mjs +2 -0
- package/dist/settings-Bbztm4oV.mjs +1503 -0
- package/dist/{settings-Byp2AQ_E.mjs → settings-CT3E71-i.mjs} +6 -7
- package/dist/{state-lKh8shBp.d.mts → settings-vk3mJGSm.d.mts} +4 -2
- package/dist/settings.schema.json +156 -6
- package/dist/simslim-ChMfe8rg.mjs +149 -0
- package/dist/{slot-launch-C1nqh4mu.mjs → slot-launch-B9hn96wd.mjs} +6 -6
- package/dist/{stage-g_WqWeaE.mjs → stage-BNKKdDNc.mjs} +6 -3
- package/dist/start-CbQCSnXQ.mjs +2 -0
- package/dist/{start-D-IeOyoK.mjs → start-CdvcTaXr.mjs} +113 -77
- package/dist/{state-xnqpx3AD.mjs → state-Boo0IMJq.mjs} +4 -2
- package/dist/{state-BG-aAk4k.mjs → state-DI84A-uu.mjs} +29 -10
- package/dist/{stats-DY6ekz8F.mjs → stats-BIIDrjA8.mjs} +6 -6
- package/dist/{status-BEeL6IKz.mjs → status-BDGHwkCs.mjs} +3 -1
- package/dist/{status-DCjZeE-K.mjs → status-DARMkc9q.mjs} +80 -294
- package/dist/status-watch-DvmI3SmN.mjs +296 -0
- package/dist/{stim-desktop-Behws_fi.mjs → stim-desktop-8GQX2OV8.mjs} +1 -1
- package/dist/{stop-DIJtD2GL.mjs → stop-CCZS-C9m.mjs} +2 -2
- package/dist/stop-WQPQHLuy.mjs +72 -0
- package/dist/{stop-BTjs3xbc.mjs → stop-iNemHsJC.mjs} +81 -33
- package/dist/supervisor-run.d.mts +7 -2
- package/dist/supervisor-run.mjs +32 -20
- package/dist/{support-Bwvbrq5-.mjs → support-CnE_SIjt.mjs} +17 -7
- package/dist/{support-BaayeYCf.mjs → support-DCco5fut.mjs} +61 -8
- package/dist/swiftpm-macos-afeNUExW.mjs +119 -0
- package/dist/{native-run-B06FkmZx.mjs → tailnet-CoJUb2tB.mjs} +113 -6
- package/dist/toolchain-BIupIro1.mjs +2 -0
- package/dist/{toolchain-Bnyd_K3A.mjs → toolchain-DqyDXs30.mjs} +225 -315
- package/dist/{trigger-CJMhwXe8.mjs → trigger-C0MWBi8O.mjs} +3 -3
- package/dist/trigger-SHLOWJ4O.mjs +2 -0
- package/dist/{warm-progress-CjB-MP6H.mjs → warm-progress-C3ASD6z5.mjs} +134 -37
- package/dist/{status-Dcr0Qexd.mjs → watchman-CQl51YZu.mjs} +75 -7
- package/dist/web-B3eldHFH.mjs +123 -0
- package/dist/web-BLXpOe6b.mjs +2 -0
- package/dist/web-run.mjs +10 -10
- package/dist/{workspace-state-C59dqG-Z.mjs → workspace-state-CSIFuuDa.mjs} +33 -33
- package/dist/{workspaces-xXItD8Dj.mjs → workspaces-D2xSHBDY.mjs} +1297 -1211
- package/dist/{worktree-BSYlofkq.mjs → worktree-BxDqaTev.mjs} +102 -63
- package/dist/worktree-q7_OZNY0.mjs +2 -0
- package/package.json +8 -6
- package/shim/bundle-response.cjs +2 -1
- package/shim/bundle-response.d.cts +1 -1
- package/shim/expo-metro-config.cjs +1 -1
- package/shim/native-android.gradle +101 -0
- package/dist/android-BKA16DTf.mjs +0 -4
- package/dist/android-BvwuMUJ9.mjs +0 -3572
- package/dist/guide-status-Bhf9SJXc.mjs +0 -125
- package/dist/ios-CPdkoKaa.mjs +0 -3953
- package/dist/ios-DNpdygiv.mjs +0 -7
- package/dist/macos-Ck7OBMNY.mjs +0 -2
- package/dist/metro-store-BAHFcJm6.mjs +0 -106
- package/dist/plan-placement-CtxkCO54.mjs +0 -1859
- package/dist/project-C3ChRLZy.mjs +0 -212
- package/dist/projects-DD7dBTCj.mjs +0 -92
- package/dist/server-expo-Db9HBUoa.mjs +0 -2
- package/dist/settings-CQyMElEP.mjs +0 -701
- package/dist/start-NTc1Ifqs.mjs +0 -2
- package/dist/stop-BGhKMOuH.mjs +0 -48
- package/dist/trigger-DWAq9hkw.mjs +0 -2
- package/dist/web-B6_bFDn7.mjs +0 -2
- package/dist/worktree-BJfnU6r5.mjs +0 -2
- package/dist/worktree-CsKYexJM.mjs +0 -753
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { t as getExecutor } from "./exec-B81Qodjn.mjs";
|
|
2
|
+
import { E as upsertProject, d as getConfigDir, p as getProject } from "./config-D0LhTY3S.mjs";
|
|
3
|
+
import { Et as repoRoot, xt as listWorktrees } from "./settings-Bbztm4oV.mjs";
|
|
4
|
+
import { d as projectRegistry } from "./project-B8_duAzW.mjs";
|
|
5
|
+
import { o as runWatchman, r as parseWatchRoots } from "./watchman-CQl51YZu.mjs";
|
|
6
|
+
import { o as compareStimVersions } from "./eas-session-ledger-DZlC-Fq3.mjs";
|
|
7
|
+
import { mkdirSync, readFileSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
9
|
+
//#region src/guide-status.ts
|
|
10
|
+
const DAY_MS = 864e5;
|
|
11
|
+
const DOCTOR_STALE_MS = 7 * DAY_MS;
|
|
12
|
+
const UPDATE_CHECK_INTERVAL_MS = DAY_MS;
|
|
13
|
+
const UPDATE_CHECK_TIMEOUT_MS = 2e3;
|
|
14
|
+
const LATEST_URL = "https://registry.npmjs.org/stim/latest";
|
|
15
|
+
function recordDoctorRun(projectRoot, platform, version, now = /* @__PURE__ */ new Date(), platforms) {
|
|
16
|
+
const run = {
|
|
17
|
+
at: now.toISOString(),
|
|
18
|
+
version
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
const targets = platforms ?? projectRegistry.selectDoctor(projectRoot, platform).platforms;
|
|
22
|
+
if (targets.length === 0) return;
|
|
23
|
+
upsertProject(projectRoot, (existing) => {
|
|
24
|
+
const doctorRuns = { ...existing.doctorRuns };
|
|
25
|
+
for (const target of targets) doctorRuns[target] = run;
|
|
26
|
+
return { doctorRuns };
|
|
27
|
+
});
|
|
28
|
+
} catch {}
|
|
29
|
+
}
|
|
30
|
+
function doctorDueReason(record, running, now) {
|
|
31
|
+
const at = record ? Date.parse(record.at) : NaN;
|
|
32
|
+
if (!record || Number.isNaN(at)) return "never run";
|
|
33
|
+
if (record.version !== running) return `last run with stim ${record.version}`;
|
|
34
|
+
const age = now.getTime() - at;
|
|
35
|
+
if (age > DOCTOR_STALE_MS) return `last run ${Math.floor(age / DAY_MS)} days ago`;
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function updateCacheFile() {
|
|
39
|
+
return join(getConfigDir(), "update-check.json");
|
|
40
|
+
}
|
|
41
|
+
function readUpdateCache() {
|
|
42
|
+
try {
|
|
43
|
+
const parsed = JSON.parse(readFileSync(updateCacheFile(), "utf-8"));
|
|
44
|
+
if (typeof parsed?.checkedAt !== "string") return null;
|
|
45
|
+
return {
|
|
46
|
+
checkedAt: parsed.checkedAt,
|
|
47
|
+
latest: typeof parsed.latest === "string" ? parsed.latest : null
|
|
48
|
+
};
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function writeUpdateCache(cache) {
|
|
54
|
+
const target = updateCacheFile();
|
|
55
|
+
const tmp = `${target}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
56
|
+
try {
|
|
57
|
+
mkdirSync(getConfigDir(), { recursive: true });
|
|
58
|
+
writeFileSync(tmp, `${JSON.stringify(cache)}\n`);
|
|
59
|
+
renameSync(tmp, target);
|
|
60
|
+
} catch {
|
|
61
|
+
try {
|
|
62
|
+
unlinkSync(tmp);
|
|
63
|
+
} catch {}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function fetchLatest(fetchImpl) {
|
|
67
|
+
const res = await fetchImpl(LATEST_URL, { signal: AbortSignal.timeout(UPDATE_CHECK_TIMEOUT_MS) });
|
|
68
|
+
if (!res.ok) return null;
|
|
69
|
+
const body = await res.json();
|
|
70
|
+
return typeof body.version === "string" ? body.version : null;
|
|
71
|
+
}
|
|
72
|
+
async function checkForUpdate(running, { now = /* @__PURE__ */ new Date(), fetch: fetchImpl = fetch } = {}) {
|
|
73
|
+
if (process.env.STIM_NO_UPDATE_CHECK) return null;
|
|
74
|
+
const cached = readUpdateCache();
|
|
75
|
+
const checkedAt = cached ? Date.parse(cached.checkedAt) : NaN;
|
|
76
|
+
let latest = cached?.latest ?? null;
|
|
77
|
+
if (Number.isNaN(checkedAt) || now.getTime() - checkedAt > UPDATE_CHECK_INTERVAL_MS) {
|
|
78
|
+
try {
|
|
79
|
+
latest = await fetchLatest(fetchImpl);
|
|
80
|
+
} catch {
|
|
81
|
+
latest = null;
|
|
82
|
+
}
|
|
83
|
+
writeUpdateCache({
|
|
84
|
+
checkedAt: now.toISOString(),
|
|
85
|
+
latest
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (!latest) return null;
|
|
89
|
+
const comparison = compareStimVersions(latest, running);
|
|
90
|
+
return comparison !== null && comparison > 0 ? latest : null;
|
|
91
|
+
}
|
|
92
|
+
function renderGuideStatus({ running, doctor, latest }) {
|
|
93
|
+
const lines = [];
|
|
94
|
+
if (doctor.length) {
|
|
95
|
+
const named = doctor.map((due) => `${due.platform} (${due.reason})`).join(" and ");
|
|
96
|
+
const command = doctor.length === 1 ? `stim doctor --platform ${doctor[0]?.platform}` : "stim doctor";
|
|
97
|
+
lines.push(` Doctor is due for ${named}.`, ` Run before native work: ${command}`);
|
|
98
|
+
}
|
|
99
|
+
if (latest) lines.push(` stim ${latest} is available (running ${running}): npm install -g stim@latest`);
|
|
100
|
+
if (!lines.length) return null;
|
|
101
|
+
return ["STATUS", ...lines].join("\n");
|
|
102
|
+
}
|
|
103
|
+
async function guideStatus({ projectRoot, running, now = /* @__PURE__ */ new Date(), fetch: fetchImpl = fetch }) {
|
|
104
|
+
const doctor = [];
|
|
105
|
+
if (projectRoot) {
|
|
106
|
+
const platforms = projectRegistry.selectDoctor(projectRoot).platforms;
|
|
107
|
+
let runs = null;
|
|
108
|
+
try {
|
|
109
|
+
runs = getProject(projectRoot)?.doctorRuns ?? {};
|
|
110
|
+
} catch {}
|
|
111
|
+
if (runs) for (const platform of platforms) {
|
|
112
|
+
const reason = doctorDueReason(runs[platform], running, now);
|
|
113
|
+
if (reason) doctor.push({
|
|
114
|
+
platform,
|
|
115
|
+
reason
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return renderGuideStatus({
|
|
120
|
+
running,
|
|
121
|
+
doctor,
|
|
122
|
+
latest: await checkForUpdate(running, {
|
|
123
|
+
now,
|
|
124
|
+
fetch: fetchImpl
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/diagnostics/doctor-watchman.ts
|
|
130
|
+
const WATCHMAN_NESTED_WORKTREES = "watchman-nested-worktrees";
|
|
131
|
+
function isPlainObject(value) {
|
|
132
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
133
|
+
}
|
|
134
|
+
function ignoreDirsOf(config) {
|
|
135
|
+
if (config.kind !== "object" || !Array.isArray(config.value.ignore_dirs)) return [];
|
|
136
|
+
return config.value.ignore_dirs.filter((entry) => typeof entry === "string");
|
|
137
|
+
}
|
|
138
|
+
function covered(path, ignoreDirs) {
|
|
139
|
+
return ignoreDirs.some((entry) => path === entry || path.startsWith(`${entry}/`));
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Watchman joins each ignore_dirs entry to the root without normalizing it, so `.worktrees/` or `./.worktrees`
|
|
143
|
+
* ignores nothing; only an entry spelled exactly as the relative path, or as one of its ancestors, covers it.
|
|
144
|
+
*/
|
|
145
|
+
function nestedWorktreeIgnores(checkout, worktrees, ignoreDirs, holdsSource) {
|
|
146
|
+
const nested = worktrees.map((path) => relative(checkout, path)).filter((rel) => rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel)).map((rel) => rel.split(sep).join("/")).filter((rel) => !covered(rel, ignoreDirs)).toSorted();
|
|
147
|
+
const parents = new Set(nested.map((rel) => dirname(rel)));
|
|
148
|
+
const [parent] = parents;
|
|
149
|
+
return {
|
|
150
|
+
nested,
|
|
151
|
+
add: parents.size === 1 && parent !== void 0 && parent !== "." && !holdsSource(parent) ? [parent] : nested
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function mergeIgnoreDirs(config, add) {
|
|
155
|
+
if (config.kind === "invalid") return { refusal: config.reason };
|
|
156
|
+
const existing = config.kind === "object" ? config.value : {};
|
|
157
|
+
if ("ignore_dirs" in existing && !Array.isArray(existing.ignore_dirs)) return { refusal: "holds an ignore_dirs that is not an array" };
|
|
158
|
+
const current = Array.isArray(existing.ignore_dirs) ? existing.ignore_dirs : [];
|
|
159
|
+
return { value: {
|
|
160
|
+
...existing,
|
|
161
|
+
ignore_dirs: [.../* @__PURE__ */ new Set([...current, ...add])]
|
|
162
|
+
} };
|
|
163
|
+
}
|
|
164
|
+
function readWatchmanConfig(path) {
|
|
165
|
+
let raw;
|
|
166
|
+
try {
|
|
167
|
+
raw = readFileSync(path, "utf-8");
|
|
168
|
+
} catch (error) {
|
|
169
|
+
const code = error.code;
|
|
170
|
+
return code === "ENOENT" ? { kind: "absent" } : {
|
|
171
|
+
kind: "invalid",
|
|
172
|
+
reason: `cannot be read (${code})`
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
let parsed;
|
|
176
|
+
try {
|
|
177
|
+
parsed = JSON.parse(raw);
|
|
178
|
+
} catch {
|
|
179
|
+
parsed = null;
|
|
180
|
+
}
|
|
181
|
+
return isPlainObject(parsed) ? {
|
|
182
|
+
kind: "object",
|
|
183
|
+
value: parsed
|
|
184
|
+
} : {
|
|
185
|
+
kind: "invalid",
|
|
186
|
+
reason: "is not a JSON object"
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function canonical(path) {
|
|
190
|
+
try {
|
|
191
|
+
return realpathSync(path);
|
|
192
|
+
} catch {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function inspectNestedWorktrees(projectRoot) {
|
|
197
|
+
const worktrees = listWorktrees(repoRoot(projectRoot) ?? projectRoot).filter((entry) => !entry.prunable && !entry.bare).flatMap((entry) => canonical(entry.path) ?? []);
|
|
198
|
+
return worktrees.flatMap((checkout) => {
|
|
199
|
+
const configPath = join(checkout, ".watchmanconfig");
|
|
200
|
+
const config = readWatchmanConfig(configPath);
|
|
201
|
+
const { nested, add } = nestedWorktreeIgnores(checkout, worktrees, ignoreDirsOf(config), (dir) => Boolean(getExecutor().runFileQuiet("git", [
|
|
202
|
+
"-C",
|
|
203
|
+
checkout,
|
|
204
|
+
"ls-files",
|
|
205
|
+
"--",
|
|
206
|
+
dir
|
|
207
|
+
]) ?? true));
|
|
208
|
+
return nested.length > 0 ? [{
|
|
209
|
+
checkout,
|
|
210
|
+
configPath,
|
|
211
|
+
config,
|
|
212
|
+
nested,
|
|
213
|
+
add
|
|
214
|
+
}] : [];
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
async function watchedCheckouts(checkouts, watchman = runWatchman) {
|
|
218
|
+
if (checkouts.length === 0) return /* @__PURE__ */ new Set();
|
|
219
|
+
try {
|
|
220
|
+
const roots = parseWatchRoots(await watchman(["watch-list"], 5e3)) ?? [];
|
|
221
|
+
const canonicalRoots = new Set(roots.map((root) => canonical(root) ?? root));
|
|
222
|
+
return new Set(checkouts.filter((checkout) => canonicalRoots.has(checkout)));
|
|
223
|
+
} catch {
|
|
224
|
+
return /* @__PURE__ */ new Set();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function list(items) {
|
|
228
|
+
return items.map((item) => `\`${item}\``).join(", ");
|
|
229
|
+
}
|
|
230
|
+
function nestedWorktreeFinding(entry, watched) {
|
|
231
|
+
const count = entry.nested.length;
|
|
232
|
+
const now = watched ? ` Watchman watches ${entry.checkout} now; \`watchman watch-del ${entry.checkout}\` and a watchman restart free that memory.` : "";
|
|
233
|
+
const merge = mergeIgnoreDirs(entry.config, entry.add);
|
|
234
|
+
const fix = "refusal" in merge ? `${entry.configPath} ${merge.refusal}, so Stim will not edit it. Add ${list(entry.add)} to its ignore_dirs by hand, then commit it.` : `Run \`stim doctor --fix\` to add ${list(entry.add)} to ignore_dirs in ${entry.configPath}, then commit that file. Watchman reads it only when it adds a root, so an existing root needs \`watchman watch-del ${entry.checkout}\` before the ignore applies.`;
|
|
235
|
+
return {
|
|
236
|
+
code: WATCHMAN_NESTED_WORKTREES,
|
|
237
|
+
level: "cost",
|
|
238
|
+
title: `${count} linked worktree${count === 1 ? " sits" : "s sit"} inside a checkout that Watchman would crawl`,
|
|
239
|
+
detail: `${list(entry.nested)} ${count === 1 ? "is" : "are"} inside ${entry.checkout}, and its .watchmanconfig does not ignore them. A Watchman root at that checkout, as Jest or a Metro started there registers, crawls every worktree's files, node_modules and build output, which grows the shared daemon's memory and its recrawls.${now}`,
|
|
240
|
+
fix
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function writeIgnoreDirs(entry) {
|
|
244
|
+
const merge = mergeIgnoreDirs(entry.config, entry.add);
|
|
245
|
+
if ("refusal" in merge) return {
|
|
246
|
+
status: "refused",
|
|
247
|
+
reason: `${entry.configPath} ${merge.refusal}`
|
|
248
|
+
};
|
|
249
|
+
const tmp = `${entry.configPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
250
|
+
try {
|
|
251
|
+
writeFileSync(tmp, `${JSON.stringify(merge.value, null, 2)}\n`);
|
|
252
|
+
renameSync(tmp, entry.configPath);
|
|
253
|
+
} catch (error) {
|
|
254
|
+
rmSync(tmp, { force: true });
|
|
255
|
+
throw error;
|
|
256
|
+
}
|
|
257
|
+
return { status: entry.config.kind === "absent" ? "created" : "updated" };
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
export { writeIgnoreDirs as a, watchedCheckouts as i, inspectNestedWorktrees as n, guideStatus as o, nestedWorktreeFinding as r, recordDoctorRun as s, WATCHMAN_NESTED_WORKTREES as t };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { n as ownership_claim_exports
|
|
2
|
-
import { t as getExecutor } from "./exec-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { g as
|
|
6
|
-
import { f as resolveEasCliBin } from "./remote-cache-BGg7aGIZ.mjs";
|
|
7
|
-
import { _ as easCliSupport, s as readInstalledEasCliVersion, v as easCliUpgradeRemedy } from "./device-remote-tHbd1fKy.mjs";
|
|
1
|
+
import { n as ownership_claim_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-B81Qodjn.mjs";
|
|
3
|
+
import { g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-DHOBXGgS.mjs";
|
|
4
|
+
import { f as resolveEasCliBin } from "./remote-cache-Bsts6f6Y.mjs";
|
|
5
|
+
import { g as easCliUpgradeRemedy, h as easCliSupport, s as readInstalledEasCliVersion } from "./device-remote-Bmg42063.mjs";
|
|
8
6
|
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
9
|
-
import { join } from "node:path";
|
|
10
7
|
import { createHash } from "node:crypto";
|
|
11
8
|
//#region src/engine/eas-build.ts
|
|
12
9
|
const MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION = "18.9.0";
|
|
@@ -228,147 +225,4 @@ async function resolveEasDevelopmentBuild(args) {
|
|
|
228
225
|
}
|
|
229
226
|
}
|
|
230
227
|
//#endregion
|
|
231
|
-
|
|
232
|
-
async function reconcileSimSlim({ udid, profile, previouslyManaged = false, out = () => {}, spawn, timeoutMs = 72e4, cleanupMs = 1e4 }) {
|
|
233
|
-
if (!profile && !previouslyManaged) return {
|
|
234
|
-
managed: false,
|
|
235
|
-
profile: null
|
|
236
|
-
};
|
|
237
|
-
const action = profile ? "on" : "off";
|
|
238
|
-
const args = profile ? [
|
|
239
|
-
"on",
|
|
240
|
-
udid,
|
|
241
|
-
"--profile",
|
|
242
|
-
profile
|
|
243
|
-
] : ["off", udid];
|
|
244
|
-
const lines = [];
|
|
245
|
-
const onLine = (raw) => {
|
|
246
|
-
const line = stripAnsi(raw).trim();
|
|
247
|
-
if (!line) return;
|
|
248
|
-
lines.push(line);
|
|
249
|
-
if (lines.length > 20) lines.shift();
|
|
250
|
-
out(`SimSlim: ${line}`);
|
|
251
|
-
};
|
|
252
|
-
const stdout = createLineReader(onLine);
|
|
253
|
-
const stderr = createLineReader(onLine);
|
|
254
|
-
const root = join(getConfigDir(), "simslim-locks", `${encodeURIComponent(udid.toLowerCase())}.lock`);
|
|
255
|
-
const label = `SimSlim for ${udid}`;
|
|
256
|
-
const attempt = (0, ownership_claim_exports.tryAcquireClaim)({
|
|
257
|
-
root,
|
|
258
|
-
mode: "exclusive",
|
|
259
|
-
label
|
|
260
|
-
});
|
|
261
|
-
if (attempt.pending) (0, ownership_claim_exports.releaseClaim)(attempt.pending);
|
|
262
|
-
const claim = attempt.acquired;
|
|
263
|
-
if (!claim) throw new ownership_claim_exports.ClaimRefusedError({
|
|
264
|
-
root,
|
|
265
|
-
claimPath: attempt.held?.path ?? root,
|
|
266
|
-
label,
|
|
267
|
-
reason: "another SimSlim operation is still using this simulator"
|
|
268
|
-
});
|
|
269
|
-
let child;
|
|
270
|
-
let result;
|
|
271
|
-
let identity;
|
|
272
|
-
let cancellation;
|
|
273
|
-
const stopGroup = () => {
|
|
274
|
-
if (child?.pid !== void 0 && identity && (0, process_identity_exports.inspectProcessIdentity)(identity) === "same") try {
|
|
275
|
-
process.kill(-child.pid, "SIGKILL");
|
|
276
|
-
} catch {}
|
|
277
|
-
};
|
|
278
|
-
const cancel = (signal) => {
|
|
279
|
-
cancellation ??= signal;
|
|
280
|
-
stopGroup();
|
|
281
|
-
};
|
|
282
|
-
const onInterrupt = () => cancel("SIGINT");
|
|
283
|
-
const onTerminate = () => cancel("SIGTERM");
|
|
284
|
-
const groupAlive = () => child?.pid !== void 0 && (0, ownership_claim_exports.processGroupAlive)(child.pid);
|
|
285
|
-
const settled = () => result !== void 0 && !groupAlive();
|
|
286
|
-
const waitUntil = async (deadline, cancellable = false) => {
|
|
287
|
-
while (!settled() && Date.now() < deadline) {
|
|
288
|
-
if (cancellable && cancellation) break;
|
|
289
|
-
await new Promise((resolve) => setTimeout(resolve, Math.min(50, deadline - Date.now())));
|
|
290
|
-
}
|
|
291
|
-
return settled();
|
|
292
|
-
};
|
|
293
|
-
process.on("SIGINT", onInterrupt);
|
|
294
|
-
process.on("SIGTERM", onTerminate);
|
|
295
|
-
process.on("exit", stopGroup);
|
|
296
|
-
try {
|
|
297
|
-
(0, ownership_claim_exports.markClaimChildPending)(claim);
|
|
298
|
-
try {
|
|
299
|
-
child = (spawn ?? ((cmd, childArgs, opts) => getExecutor().spawn(cmd, childArgs, opts)))("simslim", args, {
|
|
300
|
-
stdio: [
|
|
301
|
-
"ignore",
|
|
302
|
-
"pipe",
|
|
303
|
-
"pipe"
|
|
304
|
-
],
|
|
305
|
-
detached: true
|
|
306
|
-
});
|
|
307
|
-
} catch (error) {
|
|
308
|
-
throw simslimLaunchError(error);
|
|
309
|
-
}
|
|
310
|
-
child.stdout?.on("data", (chunk) => stdout.push(chunk));
|
|
311
|
-
child.stderr?.on("data", (chunk) => stderr.push(chunk));
|
|
312
|
-
waitForChild(child).then((value) => {
|
|
313
|
-
result = value;
|
|
314
|
-
});
|
|
315
|
-
if (child.pid !== void 0) {
|
|
316
|
-
const captured = (0, process_identity_exports.captureProcessIdentity)(child.pid);
|
|
317
|
-
if (captured.ok) {
|
|
318
|
-
identity = {
|
|
319
|
-
pid: child.pid,
|
|
320
|
-
processToken: captured.token
|
|
321
|
-
};
|
|
322
|
-
try {
|
|
323
|
-
(0, ownership_claim_exports.setClaimChild)(claim, identity);
|
|
324
|
-
} catch {}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
const completed = await waitUntil(Date.now() + timeoutMs, true);
|
|
328
|
-
if (cancellation || !completed) {
|
|
329
|
-
stopGroup();
|
|
330
|
-
const stopped = await waitUntil(Date.now() + cleanupMs);
|
|
331
|
-
const detail = lines.length ? ` ${lines.join(" | ")}` : "";
|
|
332
|
-
const recovery = stopped ? "Its process group has stopped. Retry stim ios to reconcile the retained simulator settings." : `Its process group could not be confirmed stopped. The claim remains at ${claim.path}. Inspect the SimSlim process group ${child.pid ?? "unknown"} before retrying. Only when nothing is using it, remove the claim: ${(0, ownership_claim_exports.claimRemoveCommand)(claim.path)}`;
|
|
333
|
-
const message = `SimSlim ${action} ${cancellation ? `interrupted by ${cancellation}` : `exceeded ${Math.round(timeoutMs / 1e3)}s`}. ${recovery}${detail}`;
|
|
334
|
-
if (cancellation) out(message);
|
|
335
|
-
throw Object.assign(new Error(message), { code: cancellation ? "EINTR" : "ETIMEDOUT" });
|
|
336
|
-
}
|
|
337
|
-
} finally {
|
|
338
|
-
if (!child || settled()) (0, ownership_claim_exports.releaseClaim)(claim);
|
|
339
|
-
else {
|
|
340
|
-
child.stdout?.destroy?.();
|
|
341
|
-
child.stderr?.destroy?.();
|
|
342
|
-
child.unref();
|
|
343
|
-
}
|
|
344
|
-
process.off("SIGINT", onInterrupt);
|
|
345
|
-
process.off("SIGTERM", onTerminate);
|
|
346
|
-
process.off("exit", stopGroup);
|
|
347
|
-
if (cancellation) process.exit(cancellation === "SIGINT" ? 130 : 143);
|
|
348
|
-
}
|
|
349
|
-
stdout.flush();
|
|
350
|
-
stderr.flush();
|
|
351
|
-
if (result?.error) throw simslimLaunchError(result.error);
|
|
352
|
-
if (result?.code !== 0) {
|
|
353
|
-
const detail = lines.length ? ` ${lines.join(" | ")}` : "";
|
|
354
|
-
throw new Error(`SimSlim ${action} failed with exit code ${result?.code ?? "unknown"}.${detail}`);
|
|
355
|
-
}
|
|
356
|
-
return {
|
|
357
|
-
managed: Boolean(profile),
|
|
358
|
-
profile: profile ?? null
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
function simslimLaunchError(error) {
|
|
362
|
-
const cause = error;
|
|
363
|
-
if (cause?.code === "ENOENT") return new Error("SimSlim is configured but the `simslim` command is not installed. Run `brew install mobai-app/tap/simslim`.", { cause });
|
|
364
|
-
return new Error(`Could not start SimSlim: ${String(cause?.message || cause)}`, { cause });
|
|
365
|
-
}
|
|
366
|
-
function simslimIsOnPath() {
|
|
367
|
-
try {
|
|
368
|
-
return Boolean(getExecutor().findExecutable("simslim"));
|
|
369
|
-
} catch {
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
//#endregion
|
|
374
|
-
export { isEasBuildFailure as a, easDeviceBuildRemedy as i, simslimIsOnPath as n, planEasDevelopmentBuild as o, MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION as r, resolveEasDevelopmentBuild as s, reconcileSimSlim as t };
|
|
228
|
+
export { resolveEasDevelopmentBuild as a, planEasDevelopmentBuild as i, easDeviceBuildRemedy as n, isEasBuildFailure as r, MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION as t };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-B81Qodjn.mjs";
|
|
2
|
+
import { D as withDirLock } from "./workspace-state-CSIFuuDa.mjs";
|
|
3
|
+
import { accessSync, constants, existsSync, mkdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { delimiter, dirname, join, resolve } from "node:path";
|
|
5
|
+
import { easMachineStateRoot, easMachineStateRoot as easMachineStateRoot$1, easSessionLedgerFile, easSessionLedgerLock, readEasSessionLedger, readEasSessionLedger as readEasSessionLedger$1, validEasSessionClaim } from "@stim-cli/core/state";
|
|
4
6
|
//#region src/diagnostics/stim-installations.ts
|
|
5
7
|
const VERSION_OUTPUT_LIMIT = 4096;
|
|
6
8
|
function parsedVersion(version) {
|
|
@@ -149,4 +151,55 @@ async function inspectStimVersions(runningVersion, { pathValue = process.env.PAT
|
|
|
149
151
|
return analyzeStimVersions(runningVersion, canonicalPath(runningPath), installations);
|
|
150
152
|
}
|
|
151
153
|
//#endregion
|
|
152
|
-
|
|
154
|
+
//#region src/engine/eas-machine-root-guard-env.ts
|
|
155
|
+
const EAS_TEST_GUARD_ROOT_ENV = "STIM_TEST_GUARD_REAL_EAS_ROOT";
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/engine/eas-session-ledger.ts
|
|
158
|
+
function assertEasMachineRootWritable(root) {
|
|
159
|
+
const guardedRoot = process.env[EAS_TEST_GUARD_ROOT_ENV];
|
|
160
|
+
if (!guardedRoot || resolve(root) !== resolve(guardedRoot)) return;
|
|
161
|
+
throw new Error(`Refusing to write the real EAS machine root ${root} from a test process. Pass a temporary ledgerRoot, machineRoot, or easLedgerRoot, or point HOME (and USERPROFILE on Windows) at a temporary directory.`);
|
|
162
|
+
}
|
|
163
|
+
function writeLedger(root, ledger) {
|
|
164
|
+
mkdirSync(root, { recursive: true });
|
|
165
|
+
const file = easSessionLedgerFile(root);
|
|
166
|
+
const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
167
|
+
writeFileSync(tmp, `${JSON.stringify(ledger, null, 2)}\n`);
|
|
168
|
+
try {
|
|
169
|
+
renameSync(tmp, file);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
rmSync(tmp, { force: true });
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function recordEasSessionClaim(claim, root = easMachineStateRoot()) {
|
|
176
|
+
assertEasMachineRootWritable(root);
|
|
177
|
+
const normalized = validEasSessionClaim(claim.sessionId, claim);
|
|
178
|
+
if (!normalized) throw new Error(`Invalid EAS session claim for ${claim.sessionId}.`);
|
|
179
|
+
withDirLock(easSessionLedgerLock(root), () => {
|
|
180
|
+
const current = readEasSessionLedger(root);
|
|
181
|
+
if (!current.safe) throw new Error(current.notice ?? "EAS ownership ledger is unreadable.");
|
|
182
|
+
current.claims.set(normalized.sessionId, normalized);
|
|
183
|
+
writeLedger(root, {
|
|
184
|
+
version: 1,
|
|
185
|
+
claims: Object.fromEntries(current.claims)
|
|
186
|
+
});
|
|
187
|
+
}, { ensureParent: () => mkdirSync(dirname(easSessionLedgerLock(root)), { recursive: true }) });
|
|
188
|
+
}
|
|
189
|
+
function removeEasSessionClaim(sessionId, root = easMachineStateRoot()) {
|
|
190
|
+
const file = easSessionLedgerFile(root);
|
|
191
|
+
if (!existsSync(file)) return false;
|
|
192
|
+
assertEasMachineRootWritable(root);
|
|
193
|
+
return withDirLock(easSessionLedgerLock(root), () => {
|
|
194
|
+
const current = readEasSessionLedger(root);
|
|
195
|
+
if (!current.safe) return false;
|
|
196
|
+
if (!current.claims.delete(sessionId)) return false;
|
|
197
|
+
writeLedger(root, {
|
|
198
|
+
version: 1,
|
|
199
|
+
claims: Object.fromEntries(current.claims)
|
|
200
|
+
});
|
|
201
|
+
return true;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
export { removeEasSessionClaim as a, recordEasSessionClaim as i, easMachineStateRoot$1 as n, compareStimVersions as o, readEasSessionLedger$1 as r, inspectStimVersions as s, assertEasMachineRootWritable as t };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { r as deviceConsoleLevel } from "./ios-device-
|
|
10
|
-
import { n as parseLogcatLine, t as androidClockOffset } from "./android-
|
|
1
|
+
import { t as getExecutor } from "./exec-B81Qodjn.mjs";
|
|
2
|
+
import { R as deviceSlotKey, p as getProject, z as deviceSlotPlatforms } from "./config-D0LhTY3S.mjs";
|
|
3
|
+
import { a as parseLease, n as fileLeaseIo, t as deviceLeasePath } from "./device-lease-DHOBXGgS.mjs";
|
|
4
|
+
import { D as withDirLock, r as readWorkspaceState$1 } from "./workspace-state-CSIFuuDa.mjs";
|
|
5
|
+
import { v as launchErrorPreview } from "./command-output-BjPN99ZB.mjs";
|
|
6
|
+
import { F as readWorkspaceLaunches } from "./project-B8_duAzW.mjs";
|
|
7
|
+
import { o as androidHome, u as androidToolCwd } from "./android-BsYNR81W.mjs";
|
|
8
|
+
import { u as resolveProjectMetro } from "./metro-D_j9sN-B.mjs";
|
|
9
|
+
import { r as deviceConsoleLevel } from "./ios-device-B1B14xND.mjs";
|
|
10
|
+
import { n as parseLogcatLine, t as androidClockOffset } from "./android-CK3fpEyZ.mjs";
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
13
13
|
import { NATIVE_CRASH_LOG_PREFIX, attachExpoErrorContext, readLogRecords, readLogTimeline } from "@stim-cli/core/state";
|
|
14
|
-
import { homedir } from "node:os";
|
|
15
14
|
import { createHash, randomUUID } from "node:crypto";
|
|
15
|
+
import { homedir } from "node:os";
|
|
16
16
|
//#region src/diagnostics/diagnostic-store.ts
|
|
17
17
|
/** Publishes an immutable diagnostic snapshot atomically; existing evidence wins. */
|
|
18
18
|
function writeDiagnosticOnce(path, content) {
|
|
@@ -617,7 +617,12 @@ async function errorDiagnostics(input, { root, logsDir, port, allowRequest = fal
|
|
|
617
617
|
"bundle_response_started",
|
|
618
618
|
"bundle_response_finished",
|
|
619
619
|
"bundle_response_failed"
|
|
620
|
-
].includes(String(event.event)) || [
|
|
620
|
+
].includes(String(event.event)) || [
|
|
621
|
+
"expo_stdout",
|
|
622
|
+
"expo_stderr",
|
|
623
|
+
"command_stdout",
|
|
624
|
+
"command_stderr"
|
|
625
|
+
].includes(String(event.event)) && /\bBundl(?:ing|ed)\b/.test(event.msg ?? "")) && Number(event.ts) > Number(record.ts) && (!event.platform || !record.platform || event.platform === record.platform))) {
|
|
621
626
|
rendered[index] = {
|
|
622
627
|
...record,
|
|
623
628
|
symbolicationNote: "Metro rebuilt after this error; captured coordinates retained rather than mapping against a different bundle."
|