stim 1.14.0 → 1.16.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 +2 -0
- package/dist/activity-BxwdD81S.mjs +609 -0
- package/dist/agent-device-usage-output-Dpih1Tfa.mjs +411 -0
- package/dist/{android-d6rGq1pA.mjs → android-B_NumVyQ.mjs} +169 -81
- package/dist/{android-LbPFRWVL.mjs → android-Ift4kVvt.mjs} +517 -413
- package/dist/android-cas-8U4DPqeR.mjs +167 -0
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/{android-XpvCrV7q.mjs → android-r2rBL8kV.mjs} +2 -2
- package/dist/{app-install-BpgSgkJj.mjs → app-install-CKWdbXIX.mjs} +128 -151
- package/dist/attempt-Bk2ouQVL.mjs +39 -0
- package/dist/budget-DjrURfQn.mjs +2700 -0
- package/dist/{build-plan-Dcr-3ie0.mjs → build-plan-DjeSb2Xl.mjs} +192 -653
- package/dist/build-slots-rUk77xqh.mjs +132 -0
- package/dist/{cache-manifest-C68QQ0ua.mjs → cache-manifest-DnUHBJaU.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{chrome-BPCiC3ZX.mjs → chrome-BrcVWQyD.mjs} +1 -1
- package/dist/cli-BkYZ_6hy.mjs +51 -0
- package/dist/cli.mjs +6 -42
- package/dist/client-BTY686R6.mjs +1368 -0
- package/dist/collector-run.mjs +9 -195
- package/dist/{command-output-DVcpw6eE.mjs → command-output-DnJMdEY-.mjs} +1 -1
- package/dist/{config-lvc7d3C2.mjs → config-D0DbpZtM.mjs} +28 -29
- package/dist/{created-devices-CllH_8eb.mjs → created-devices-D5owjN4C.mjs} +2 -2
- package/dist/{dependency-state-DsT7aKeo.mjs → dependency-state-B6cMXZab.mjs} +2 -2
- package/dist/{deps-D9IcKqXS.mjs → deps-urbmfXig.mjs} +3 -3
- package/dist/{detached-entry-DJHoca49.mjs → detached-entry-CiTEgMR1.mjs} +1 -1
- package/dist/dev-client-CroAIjjj.mjs +43 -0
- package/dist/{device-CjuuAJjQ.mjs → device-DZQjF7H5.mjs} +8 -7
- package/dist/device-capacity-BHwxNBlu.mjs +136 -0
- package/dist/device-host-worker.d.mts +1 -0
- package/dist/device-host-worker.mjs +964 -0
- package/dist/device-ios-BadmeL2V.mjs +381 -0
- package/dist/{device-lease-5c3WrVRm.mjs → device-lease-D-hLqx1b.mjs} +43 -36
- package/dist/{device-pool-BiyDyPP-.mjs → device-lease-run-CqjShqWW.mjs} +6 -126
- package/dist/device-pool-CUaEWMMm.mjs +125 -0
- package/dist/{device-remote-D87zEzaq.mjs → device-remote-D5WVWqOq.mjs} +69 -163
- package/dist/{doctor-x9pnU9fq.mjs → doctor-Cimf-gGB.mjs} +241 -103
- package/dist/{error-diagnostics-C5HzcwCW.mjs → error-diagnostics-B9L4Ae0x.mjs} +15 -18
- package/dist/{exec-DK8KaVHK.mjs → exec-CaErVv7t.mjs} +5 -1
- package/dist/{gc-ko6mUAYD.mjs → gc-Bqy4bjEu.mjs} +599 -108
- package/dist/{android-cas-iZK3DOCr.mjs → gradle-BsO1MdsH.mjs} +8 -294
- package/dist/{guide-6R0VNFqI.mjs → guide-B_uyKTxW.mjs} +2511 -239
- package/dist/{guide-status-BZrFPIA_.mjs → guide-status-CjEZMAD4.mjs} +3 -3
- package/dist/hosted-client-a-WmqE2L.mjs +197 -0
- package/dist/hosted-ios-CIWelIqf.mjs +220 -0
- package/dist/hosted-logs-D5g041Q3.mjs +187 -0
- package/dist/hosted-macos-BSZyIb3y.mjs +135 -0
- package/dist/idle-DYVymG92.mjs +1099 -0
- package/dist/idle-shutdown-CTsDnAde.mjs +122 -0
- package/dist/in-use-DvBw0Kxo.mjs +130 -0
- package/dist/{ios-BwDPrnYQ.mjs → ios-BaInn3sW.mjs} +201 -10
- package/dist/ios-Cr1h5gnO.mjs +189 -0
- package/dist/{ios-P1f5nm2n.mjs → ios-aq3QoGI3.mjs} +1159 -633
- package/dist/{ios-device-BiOsSVzd.mjs → ios-device-Ee7sDXfp.mjs} +1 -1
- package/dist/{ios-device-DGglU3E_.mjs → ios-device-FfCN_C8p.mjs} +12 -7
- package/dist/ios-state-DS5UpYTH.mjs +48 -0
- package/dist/{launch-verify-Deg4tB3Z.mjs → launch-verify-2DBRizjo.mjs} +5 -5
- package/dist/logs-CHEVK8zD.mjs +371 -0
- package/dist/machines-BIBUdhpj.mjs +265 -0
- package/dist/macos-CSYEAFmF.mjs +473 -0
- package/dist/macos-run.d.mts +5 -0
- package/dist/macos-run.mjs +2 -0
- package/dist/maintenance-run.d.mts +4 -0
- package/dist/maintenance-run.mjs +254 -0
- package/dist/{metro-CcEo8Fl8.mjs → metro-BeK1ZPz1.mjs} +20 -120
- package/dist/metro-gateway-BJ-rxQAB.mjs +84 -0
- package/dist/{named-ports-Blg8IxOh.mjs → named-ports-Bk_YXEmE.mjs} +6 -59
- package/dist/native-run-NaBrRFtQ.mjs +147 -0
- package/dist/{native-runtime-DjBHRg5m.mjs → native-runtime-DBzRnEKS.mjs} +9 -5
- package/dist/{ndjson-CDY9IkVC.mjs → ndjson-PclOIwVY.mjs} +2 -2
- package/dist/offload-worker.d.mts +122 -0
- package/dist/offload-worker.mjs +606 -0
- package/dist/{ownership-DyYDF5ww.mjs → ownership-DiA16AsN.mjs} +3 -2
- package/dist/ownership-hCkPzGmr.mjs +571 -0
- package/dist/{page-BHUzTDFt.mjs → page-QF_Ke10s.mjs} +7 -2
- package/dist/{ports-BguS83ex.mjs → ports-R2k4Knz3.mjs} +3 -3
- package/dist/prebuild-D2fsca_Z.mjs +213 -0
- package/dist/preview-DhVbvPAZ.mjs +318 -0
- package/dist/process-identity-BmRm1qV0.mjs +12 -0
- package/dist/{project-CWlvEaeN.mjs → project-Du91Ilvc.mjs} +74 -19
- package/dist/pull-request-pxnDCQzn.mjs +322 -0
- package/dist/pull-requests.d.mts +120 -0
- package/dist/pull-requests.mjs +2 -0
- package/dist/recordings-BIXOzVnr.mjs +37 -0
- package/dist/{reload-BiniwsSZ.mjs → reload-rM9jV1fz.mjs} +109 -24
- package/dist/{remote-cache-CcR6o6lI.mjs → remote-cache-C8-V13XN.mjs} +5 -5
- package/dist/run-f4vI6EnK.mjs +119 -0
- package/dist/{server-bare-DGfgyJ5J.mjs → server-bare-CpPGmnmO.mjs} +33 -15
- package/dist/server-expo-CVqO2c35.mjs +2 -0
- package/dist/{server-expo-BVuwQ65v.mjs → server-expo-MC0rHlOC.mjs} +8 -12
- package/dist/settings-BBpMcDbD.mjs +25 -0
- package/dist/{settings-B-fsC-Om.mjs → settings-ZkDzkzvB.mjs} +22 -10
- package/dist/settings-oTSkkNrM.mjs +1439 -0
- package/dist/settings.schema.json +845 -97
- package/dist/{simslim-DrDN4WuV.mjs → simslim-B8-7AoTI.mjs} +8 -132
- package/dist/{slot-launch-D5t8EiMf.mjs → slot-launch-B8VrHxn1.mjs} +11 -8
- package/dist/{spawn-claims-Drw_o-Fb.mjs → spawn-claims-D0XfSe8u.mjs} +1 -1
- package/dist/spawn-entry-jw19m8Nl.mjs +17 -0
- package/dist/stage-CzaiwFsI.mjs +143 -0
- package/dist/start-CX8Ig-U2.mjs +2 -0
- package/dist/{start-s4RXp1wy.mjs → start-ClDfwXa4.mjs} +116 -65
- package/dist/state-3DwSQIBK.mjs +41 -0
- package/dist/state-B4PQFXMW.d.mts +12 -0
- package/dist/{state-Dk9RVXI7.mjs → state-C1jB7Q8q.mjs} +70 -8
- package/dist/{state-DHqvsbqC.mjs → state-DcW6vOd_.mjs} +7 -4
- package/dist/stats-CEZ_i5je.mjs +77 -0
- package/dist/{status-BgAuxESg.mjs → status-BuvBFeII.mjs} +118 -20
- package/dist/{status-BsPAnfOI.mjs → status-Cs7VLg9D.mjs} +542 -283
- package/dist/status-DlKvVJBE.mjs +49 -0
- package/dist/stdout-reader-C8yjre1x.mjs +23 -0
- package/dist/stim-desktop-Cnz8CPnl.mjs +63 -0
- package/dist/stim-footprint.swift +32 -0
- package/dist/{stim-installations-CINXy_su.mjs → stim-installations-QMEI32v1.mjs} +1 -1
- package/dist/stop-B0Yxtmiy.mjs +48 -0
- package/dist/{stop-BzreOWJp.mjs → stop-Bffozsac.mjs} +83 -16
- package/dist/{stop-BWIF_6BK.mjs → stop-Dt_dM16A.mjs} +2 -2
- package/dist/stop-cause-CidxIqup.mjs +97 -0
- package/dist/supervisor-run.d.mts +43 -11
- package/dist/supervisor-run.mjs +363 -24
- package/dist/support-CAP8qDUF.mjs +316 -0
- package/dist/support-D4aYJniO.mjs +201 -0
- package/dist/teardown-CL6vDs2Y.mjs +727 -0
- package/dist/{xcode-Cp5KvK9x.mjs → toolchain-DkUflduf.mjs} +364 -14
- package/dist/trigger-Bemu8ytw.mjs +65 -0
- package/dist/trigger-CXts6qt1.mjs +2 -0
- package/dist/warm-progress-CpGv3Wb6.mjs +732 -0
- package/dist/{web-BsQs1WlO.mjs → web-DWUaMp8P.mjs} +37 -21
- package/dist/web-run.mjs +310 -13
- package/dist/workspace-process-lock-BL7Q0HCO.mjs +57 -0
- package/dist/workspace-state-B8-aJ1_5.mjs +371 -0
- package/dist/workspaces-BV4pdHFz.mjs +306 -0
- package/dist/{worktree-UrQWXSeb.mjs → worktree-K-xj9Db0.mjs} +625 -256
- package/dist/worktree-jnG8Iph5.mjs +2 -0
- package/package.json +10 -5
- package/shim/bundle-response.cjs +28 -12
- package/dist/activity-CYVDcrt3.mjs +0 -356
- package/dist/budget-CGDkhvv_.mjs +0 -1745
- package/dist/build-progress-DxKpwnaS.mjs +0 -247
- package/dist/idle-DXtx3RbX.mjs +0 -191
- package/dist/in-use-DlqBDKqY.mjs +0 -249
- package/dist/logs-Civ4gbBH.mjs +0 -486
- package/dist/merge-state-ytFQCeh4.mjs +0 -262
- package/dist/server-expo-DIHDhvGg.mjs +0 -2
- package/dist/settings-D61iNOsB.mjs +0 -629
- package/dist/start-Cetfvy8l.mjs +0 -2
- package/dist/stats-CFpFGlJV.mjs +0 -62
- package/dist/stats-CX1Z8Tca.mjs +0 -368
- package/dist/stim-desktop-CXt8-Z3J.mjs +0 -40
- package/dist/stop-cause-hjGBOZTG.mjs +0 -1231
- package/dist/worktree-BVrHsYZG.mjs +0 -752
- package/dist/worktree-CHWWvm5v.mjs +0 -2
- package/dist/{metro-store-DzeWkfqW.mjs → metro-store-CDDZHtPl.mjs} +1 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-CaErVv7t.mjs";
|
|
2
|
+
import { d as getConfigDir } from "./config-D0DbpZtM.mjs";
|
|
3
|
+
import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-BmRm1qV0.mjs";
|
|
3
4
|
import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
|
-
import { g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { O as easCliSupport, k as easCliUpgradeRemedy, s as readInstalledEasCliVersion } from "./device-remote-D87zEzaq.mjs";
|
|
5
|
+
import { g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-D-hLqx1b.mjs";
|
|
6
|
+
import { f as resolveEasCliBin } from "./remote-cache-C8-V13XN.mjs";
|
|
7
|
+
import { _ as easCliSupport, s as readInstalledEasCliVersion, v as easCliUpgradeRemedy } from "./device-remote-D5WVWqOq.mjs";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
9
|
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
10
10
|
import { join } from "node:path";
|
|
11
|
-
import { createHash } from "node:crypto";
|
|
12
11
|
//#region src/engine/eas-build.ts
|
|
13
12
|
const MIN_EAS_CLI_BUILD_DOWNLOAD_VERSION = "18.9.0";
|
|
14
13
|
function isEasBuildFailure(result) {
|
|
@@ -229,129 +228,6 @@ async function resolveEasDevelopmentBuild(args) {
|
|
|
229
228
|
}
|
|
230
229
|
}
|
|
231
230
|
//#endregion
|
|
232
|
-
//#region src/engine/device-capacity.ts
|
|
233
|
-
function liveOwnedDeviceCount({ sims = [], adbEmulators = [], config = null } = {}) {
|
|
234
|
-
let count = 0;
|
|
235
|
-
for (const sim of sims) if (sim?.state === "Booted" && sim.name?.startsWith("stim-")) count++;
|
|
236
|
-
const livePorts = new Set(adbEmulators.map((e) => e.consolePort));
|
|
237
|
-
for (const proj of Object.values(config?.projects || {})) for (const { platforms } of projectDeviceSlots(proj)) {
|
|
238
|
-
const android = platforms.android;
|
|
239
|
-
if (android?.owned && android.avdName && typeof android.consolePort === "number" && livePorts.has(android.consolePort)) count++;
|
|
240
|
-
}
|
|
241
|
-
return count;
|
|
242
|
-
}
|
|
243
|
-
function workspaceHasLiveDevice({ platform, project, slot = "default", sims = [], adbEmulators = [] } = {}) {
|
|
244
|
-
if (!platform) return false;
|
|
245
|
-
const record = deviceSlotPlatforms(project, slot)?.[platform];
|
|
246
|
-
if (!record) return false;
|
|
247
|
-
if (platform === "ios") return sims.some((s) => s.udid === record.deviceUdid && s.state === "Booted");
|
|
248
|
-
return typeof record.consolePort === "number" && adbEmulators.some((e) => e.consolePort === record.consolePort);
|
|
249
|
-
}
|
|
250
|
-
function deviceCapacityRefusal({ platform, project, slot = "default", max, sims = [], adb = null, config = null } = {}) {
|
|
251
|
-
if (!max || max <= 0) return null;
|
|
252
|
-
const adbEmulators = adb?.emulators || [];
|
|
253
|
-
if (workspaceHasLiveDevice({
|
|
254
|
-
platform,
|
|
255
|
-
project,
|
|
256
|
-
slot,
|
|
257
|
-
sims,
|
|
258
|
-
adbEmulators
|
|
259
|
-
})) return null;
|
|
260
|
-
const count = liveOwnedDeviceCount({
|
|
261
|
-
sims,
|
|
262
|
-
adbEmulators,
|
|
263
|
-
config
|
|
264
|
-
});
|
|
265
|
-
if (count < max) return null;
|
|
266
|
-
return {
|
|
267
|
-
code: "STIM_AT_CAPACITY",
|
|
268
|
-
message: `${count} Stim device(s) are already booted and concurrency.maxDevices is ${max}, so booting another would exceed the cap.`,
|
|
269
|
-
remedy: "stop an environment (stim stop) or raise concurrency.maxDevices"
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
function checkDeviceCapacity({ platform, project, slot = "default", max, sims = listAllIosSims, adb = listAdbDevices, config = loadConfig } = {}) {
|
|
273
|
-
if (!max || max <= 0) return null;
|
|
274
|
-
let simList = [];
|
|
275
|
-
let adbRes = {
|
|
276
|
-
emulators: [],
|
|
277
|
-
physical: [],
|
|
278
|
-
unhealthy: []
|
|
279
|
-
};
|
|
280
|
-
try {
|
|
281
|
-
simList = typeof sims === "function" ? sims() || [] : sims || [];
|
|
282
|
-
} catch {}
|
|
283
|
-
try {
|
|
284
|
-
adbRes = typeof adb === "function" ? adb() || adbRes : adb || adbRes;
|
|
285
|
-
} catch {}
|
|
286
|
-
let cfg = null;
|
|
287
|
-
try {
|
|
288
|
-
cfg = typeof config === "function" ? config() : config ?? null;
|
|
289
|
-
} catch {}
|
|
290
|
-
return deviceCapacityRefusal({
|
|
291
|
-
platform,
|
|
292
|
-
project,
|
|
293
|
-
slot,
|
|
294
|
-
max,
|
|
295
|
-
sims: simList,
|
|
296
|
-
adb: adbRes,
|
|
297
|
-
config: cfg
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
function deviceTypeMismatch(recordedTypeId, requestedName, deviceTypes) {
|
|
301
|
-
if (!requestedName || !recordedTypeId) return null;
|
|
302
|
-
const wanted = (deviceTypes || []).find((d) => d.name === requestedName);
|
|
303
|
-
if (!wanted) return null;
|
|
304
|
-
if (wanted.identifier === recordedTypeId) return null;
|
|
305
|
-
const recorded = (deviceTypes || []).find((d) => d.identifier === recordedTypeId);
|
|
306
|
-
return `this project's sim is ${recorded ? recorded.name : recordedTypeId}, but --device-type asked for ${requestedName}`;
|
|
307
|
-
}
|
|
308
|
-
function runtimeMismatch(recordedRuntimeId, requested, runtimes) {
|
|
309
|
-
if (!requested || !recordedRuntimeId) return null;
|
|
310
|
-
const wanted = runtimes.find((r) => iosRuntimeMatches(r, requested));
|
|
311
|
-
if (!wanted || wanted.identifier === recordedRuntimeId) return null;
|
|
312
|
-
return `this project's sim runs iOS ${parseRuntimeVersion(recordedRuntimeId)}, but --runtime asked for ${requested}`;
|
|
313
|
-
}
|
|
314
|
-
function installedNames(names) {
|
|
315
|
-
const unique = [...new Set(names.filter((n) => typeof n === "string" && n !== ""))];
|
|
316
|
-
return unique.length > 0 ? unique.join(", ") : "none";
|
|
317
|
-
}
|
|
318
|
-
function unknownIosRuntimeRefusal(requested, runtimes) {
|
|
319
|
-
if (!requested) return null;
|
|
320
|
-
if ((runtimes || []).some((r) => iosRuntimeMatches(r, requested))) return null;
|
|
321
|
-
return {
|
|
322
|
-
message: `No installed simulator runtime matches "${requested}". Installed runtimes: ${installedNames((runtimes || []).map((r) => r.version))}.`,
|
|
323
|
-
remedy: "Pass `--runtime` (or set ios.runtime) a version printed above (\"26.5\") or a runtime's full name (\"iOS 26.5\"); nothing else matches. Install more runtimes through Xcode."
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
function creatableIosDeviceTypeNames(runtimes, runtime) {
|
|
327
|
-
return (runtime ? (runtimes || []).filter((r) => iosRuntimeMatches(r, runtime)) : runtimes || []).flatMap((r) => (r.supportedDeviceTypes || []).map((d) => d.name));
|
|
328
|
-
}
|
|
329
|
-
function unknownIosDeviceTypeRefusal(requested, runtimes, runtime) {
|
|
330
|
-
if (!requested) return null;
|
|
331
|
-
const creatable = creatableIosDeviceTypeNames(runtimes, runtime);
|
|
332
|
-
if (creatable.includes(requested)) return null;
|
|
333
|
-
return {
|
|
334
|
-
message: `No device type named "${requested}" can be created on ${runtime ? `runtime ${runtime}` : "any installed simulator runtime"}. ${runtime ? `Device types runtime ${runtime} supports` : "Device types the installed runtimes support"}: ${installedNames(creatable)}.`,
|
|
335
|
-
remedy: "Pass `--device-type` (or set ios.deviceType) one of the names printed above, exactly as `xcrun simctl list devicetypes` spells it. `xcrun simctl list devicetypes` also lists watchOS, tvOS and visionOS models, which no iOS runtime can create. Install more models through Xcode."
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
function unknownAndroidSystemImageRefusal(requested, images) {
|
|
339
|
-
if (!requested) return null;
|
|
340
|
-
if ((images || []).some((i) => i.pkg === requested)) return null;
|
|
341
|
-
return {
|
|
342
|
-
message: `No installed Android system image is named "${requested}". Installed system images: ${installedNames((images || []).map((i) => i.pkg))}.`,
|
|
343
|
-
remedy: "Pass `--system-image` (or set android.systemImage) to one of the package ids printed above. Install more with `sdkmanager \"system-images;android-36;google_apis;arm64-v8a\"`."
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
function unknownAndroidDeviceProfileRefusal(requested, profiles) {
|
|
347
|
-
if (!requested) return null;
|
|
348
|
-
if (profiles.includes(requested)) return null;
|
|
349
|
-
return {
|
|
350
|
-
message: `No Android hardware profile is named "${requested}". Profiles avdmanager offers: ${installedNames(profiles)}.`,
|
|
351
|
-
remedy: "Pass `--device-profile` (or set android.deviceProfile) to one of the ids printed above, exactly as `avdmanager list device -c` spells it, e.g. \"pixel_fold\" or \"pixel_tablet\"."
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
//#endregion
|
|
355
231
|
//#region src/engine/simslim.ts
|
|
356
232
|
async function reconcileSimSlim({ udid, profile, previouslyManaged = false, out = () => {}, spawn, timeoutMs = 72e4, cleanupMs = 1e4 }) {
|
|
357
233
|
if (!profile && !previouslyManaged) return {
|
|
@@ -495,4 +371,4 @@ function simslimIsOnPath() {
|
|
|
495
371
|
}
|
|
496
372
|
}
|
|
497
373
|
//#endregion
|
|
498
|
-
export {
|
|
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 };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as fileLeaseIo } from "./device-lease-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { B as parseDeviceSlotKey, H as projectDeviceSlots, p as getProject } from "./config-D0DbpZtM.mjs";
|
|
2
|
+
import { r as readWorkspaceState$1 } from "./workspace-state-B8-aJ1_5.mjs";
|
|
3
|
+
import { n as fileLeaseIo } from "./device-lease-D-hLqx1b.mjs";
|
|
4
|
+
import { E as getAvdNameForSerial, O as listAdbDevices } from "./android-B_NumVyQ.mjs";
|
|
5
|
+
import { u as listAllIosSims } from "./ios-BaInn3sW.mjs";
|
|
6
|
+
import { f as deviceShellArg } from "./app-install-CKWdbXIX.mjs";
|
|
7
|
+
import { hostedIosRecords } from "@stim-cli/core/state";
|
|
7
8
|
//#region src/engine/slot-launch.ts
|
|
8
9
|
function launchSlotScope(root, slot = "default") {
|
|
9
10
|
if (slot !== "default") return slot;
|
|
10
11
|
if (Object.keys(getProject(root)?.deviceSlots ?? {}).length) return slot;
|
|
11
|
-
const state = readWorkspaceState(root);
|
|
12
|
+
const state = readWorkspaceState$1(root);
|
|
13
|
+
if (Object.keys(hostedIosRecords(state)).some((other) => other !== "default")) return slot;
|
|
12
14
|
if (Object.keys({
|
|
13
15
|
...state?.collectors,
|
|
14
16
|
...fileLeaseIo.readHolder(root)
|
|
@@ -43,7 +45,8 @@ function ownedDeviceRunning(platform) {
|
|
|
43
45
|
}
|
|
44
46
|
function siblingPlatformSlots(root, platform, slot = "default", { deviceRunning = ownedDeviceRunning(platform) } = {}) {
|
|
45
47
|
const slots = /* @__PURE__ */ new Set();
|
|
46
|
-
const state = readWorkspaceState(root);
|
|
48
|
+
const state = readWorkspaceState$1(root);
|
|
49
|
+
if (platform === "ios") for (const hosted of Object.keys(hostedIosRecords(state))) slots.add(hosted);
|
|
47
50
|
for (const key of Object.keys({
|
|
48
51
|
...state?.collectors,
|
|
49
52
|
...fileLeaseIo.readHolder(root)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-BmRm1qV0.mjs";
|
|
2
2
|
//#region src/engine/spawn-claims.ts
|
|
3
3
|
const declaring = /* @__PURE__ */ new Set();
|
|
4
4
|
const running = /* @__PURE__ */ new Set();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { basename, dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
//#region src/spawn-entry.ts
|
|
4
|
+
const DEV_ENTRIES = {
|
|
5
|
+
"supervisor-run": "./supervisor/run.ts",
|
|
6
|
+
"collector-run": "./collector/run.ts",
|
|
7
|
+
"web-run": "./web/run.ts",
|
|
8
|
+
"maintenance-run": "./maintenance/run.ts",
|
|
9
|
+
"macos-run": "./macos/run.ts"
|
|
10
|
+
};
|
|
11
|
+
function spawnEntry(name) {
|
|
12
|
+
const here = fileURLToPath(import.meta.url);
|
|
13
|
+
if (basename(dirname(here)) === "src") return fileURLToPath(new URL(DEV_ENTRIES[name], import.meta.url));
|
|
14
|
+
return join(dirname(here), `${name}.mjs`);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { spawnEntry as t };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { t as getExecutor } from "./exec-CaErVv7t.mjs";
|
|
2
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, realpathSync, rmSync, statSync } from "node:fs";
|
|
3
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { validMacosResourceDestination } from "@stim-cli/core";
|
|
5
|
+
//#region src/macos/stage.ts
|
|
6
|
+
function validateInfoPlist(root, product, infoPlist) {
|
|
7
|
+
const plist = JSON.parse(getExecutor().runFile("plutil", [
|
|
8
|
+
"-convert",
|
|
9
|
+
"json",
|
|
10
|
+
"-o",
|
|
11
|
+
"-",
|
|
12
|
+
realpathSync(resolve(root, infoPlist))
|
|
13
|
+
]));
|
|
14
|
+
if (typeof plist.CFBundleIdentifier !== "string" || plist.CFBundleExecutable !== product) throw new Error("macos.infoPlist must name a CFBundleIdentifier and the selected product as CFBundleExecutable.");
|
|
15
|
+
if (plist.CFBundleURLTypes || plist.SUFeedURL) throw new Error("Use a development Info.plist without shared URL schemes or an update feed.");
|
|
16
|
+
if (plist.LSMinimumSystemVersion !== void 0 && typeof plist.LSMinimumSystemVersion !== "string") throw new Error("macos.infoPlist LSMinimumSystemVersion must be a string. See stim guide macos.");
|
|
17
|
+
return {
|
|
18
|
+
bundleId: plist.CFBundleIdentifier,
|
|
19
|
+
minimumSystemVersion: plist.LSMinimumSystemVersion
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function resourceError(key, entry, reason) {
|
|
23
|
+
throw new Error(`${key} entry ${JSON.stringify(entry)}: ${reason}. See stim guide macos.`);
|
|
24
|
+
}
|
|
25
|
+
function containsSymlink(dir) {
|
|
26
|
+
return readdirSync(dir, { withFileTypes: true }).some((entry) => entry.isSymbolicLink() || entry.isDirectory() && containsSymlink(join(dir, entry.name)));
|
|
27
|
+
}
|
|
28
|
+
function overlaps(a, b) {
|
|
29
|
+
a = a.normalize("NFC").toLowerCase();
|
|
30
|
+
b = b.normalize("NFC").toLowerCase();
|
|
31
|
+
return a === b || a.startsWith(`${b}/`) || b.startsWith(`${a}/`);
|
|
32
|
+
}
|
|
33
|
+
function resolveBundleExtras(root, repository, resources = {}, assetCatalog) {
|
|
34
|
+
const boundary = realpathSync(repository);
|
|
35
|
+
const sourcePath = (key, entry) => {
|
|
36
|
+
if (typeof entry !== "string" || !entry || isAbsolute(entry) || entry.includes("\0")) resourceError(key, entry, "source must be a non-empty relative path");
|
|
37
|
+
let source;
|
|
38
|
+
try {
|
|
39
|
+
source = realpathSync(resolve(root, entry));
|
|
40
|
+
} catch {
|
|
41
|
+
resourceError(key, entry, "source does not exist");
|
|
42
|
+
}
|
|
43
|
+
const path = relative(boundary, source);
|
|
44
|
+
if (path === ".." || path.startsWith(`..${sep}`) || isAbsolute(path)) resourceError(key, entry, "source leaves the repository");
|
|
45
|
+
if (path === "") resourceError(key, entry, "source is the repository root");
|
|
46
|
+
const stat = statSync(source);
|
|
47
|
+
if (!stat.isFile() && !stat.isDirectory()) resourceError(key, entry, "source must be a regular file or directory");
|
|
48
|
+
if (stat.isDirectory() && containsSymlink(source)) resourceError(key, entry, "source directory contains a symbolic link");
|
|
49
|
+
return source;
|
|
50
|
+
};
|
|
51
|
+
let catalog;
|
|
52
|
+
if (assetCatalog !== void 0 && assetCatalog !== null) {
|
|
53
|
+
catalog = sourcePath("macos.assetCatalog", assetCatalog);
|
|
54
|
+
if (!catalog.endsWith(".xcassets") || !statSync(catalog).isDirectory()) resourceError("macos.assetCatalog", assetCatalog, "catalog must be a .xcassets directory");
|
|
55
|
+
}
|
|
56
|
+
if (!resources || typeof resources !== "object" || Array.isArray(resources)) resourceError("macos.resources", resources, "expected an object");
|
|
57
|
+
const entries = Object.entries(resources);
|
|
58
|
+
if (entries.length > 256) {
|
|
59
|
+
const [destination, source] = entries[256];
|
|
60
|
+
resourceError(`macos.resources[${JSON.stringify(destination)}]`, source, "at most 256 entries are allowed");
|
|
61
|
+
}
|
|
62
|
+
const reserved = catalog ? ["Assets.car"] : [];
|
|
63
|
+
const resolved = [];
|
|
64
|
+
for (const [destination, source] of entries) {
|
|
65
|
+
const key = `macos.resources[${JSON.stringify(destination)}]`;
|
|
66
|
+
if (!validMacosResourceDestination(destination)) resourceError(key, source, "invalid destination");
|
|
67
|
+
if (reserved.some((other) => overlaps(destination, other))) resourceError(key, source, "destination collides with another resource");
|
|
68
|
+
reserved.push(destination);
|
|
69
|
+
resolved.push([destination, sourcePath(key, source)]);
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
resources: Object.fromEntries(resolved),
|
|
73
|
+
assetCatalog: catalog
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function stageBundle(root, product, infoPlist, bin, bundle, bundleId, extras = { resources: {} }) {
|
|
77
|
+
const { minimumSystemVersion } = validateInfoPlist(root, product, infoPlist);
|
|
78
|
+
for (const entry of readdirSync(bin).filter((name) => name.endsWith(".bundle"))) for (const [destination, source] of Object.entries(extras.resources)) if (overlaps(destination, entry)) resourceError(`macos.resources[${JSON.stringify(destination)}]`, source, `destination collides with ${entry}`);
|
|
79
|
+
const exec = getExecutor();
|
|
80
|
+
rmSync(bundle, {
|
|
81
|
+
recursive: true,
|
|
82
|
+
force: true
|
|
83
|
+
});
|
|
84
|
+
const contents = join(bundle, "Contents");
|
|
85
|
+
mkdirSync(join(contents, "MacOS"), { recursive: true });
|
|
86
|
+
mkdirSync(join(contents, "Resources"), { recursive: true });
|
|
87
|
+
mkdirSync(join(contents, "Frameworks"), { recursive: true });
|
|
88
|
+
const executable = join(contents, "MacOS", product);
|
|
89
|
+
cpSync(join(bin, product), executable);
|
|
90
|
+
cpSync(resolve(root, infoPlist), join(contents, "Info.plist"));
|
|
91
|
+
exec.runFile("/usr/libexec/PlistBuddy", [
|
|
92
|
+
"-c",
|
|
93
|
+
`Set :CFBundleIdentifier ${bundleId}`,
|
|
94
|
+
join(contents, "Info.plist")
|
|
95
|
+
]);
|
|
96
|
+
for (const entry of readdirSync(bin)) if (entry.endsWith(".framework")) {
|
|
97
|
+
const target = join(contents, "Frameworks", entry);
|
|
98
|
+
cpSync(join(bin, entry), target, {
|
|
99
|
+
recursive: true,
|
|
100
|
+
dereference: false,
|
|
101
|
+
verbatimSymlinks: true
|
|
102
|
+
});
|
|
103
|
+
exec.runFile("codesign", [
|
|
104
|
+
"--force",
|
|
105
|
+
"--sign",
|
|
106
|
+
"-",
|
|
107
|
+
target
|
|
108
|
+
]);
|
|
109
|
+
} else if (entry.endsWith(".bundle")) cpSync(join(bin, entry), join(contents, "Resources", entry), { recursive: true });
|
|
110
|
+
const frameworkPath = "@executable_path/../Frameworks";
|
|
111
|
+
if (!exec.runFile("otool", ["-l", executable]).includes(frameworkPath)) exec.runFile("install_name_tool", [
|
|
112
|
+
"-add_rpath",
|
|
113
|
+
frameworkPath,
|
|
114
|
+
executable
|
|
115
|
+
]);
|
|
116
|
+
for (const [destination, source] of Object.entries(extras.resources)) {
|
|
117
|
+
const target = join(contents, "Resources", destination);
|
|
118
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
119
|
+
cpSync(source, target, { recursive: true });
|
|
120
|
+
}
|
|
121
|
+
if (extras.assetCatalog) {
|
|
122
|
+
exec.runFile("xcrun", [
|
|
123
|
+
"actool",
|
|
124
|
+
extras.assetCatalog,
|
|
125
|
+
"--compile",
|
|
126
|
+
join(contents, "Resources"),
|
|
127
|
+
"--platform",
|
|
128
|
+
"macosx",
|
|
129
|
+
...minimumSystemVersion === void 0 ? [] : ["--minimum-deployment-target", minimumSystemVersion],
|
|
130
|
+
"--output-partial-info-plist",
|
|
131
|
+
"/dev/null"
|
|
132
|
+
]);
|
|
133
|
+
if (!existsSync(join(contents, "Resources", "Assets.car"))) resourceError("macos.assetCatalog", extras.assetCatalog, "actool did not produce Assets.car");
|
|
134
|
+
}
|
|
135
|
+
exec.runFile("codesign", [
|
|
136
|
+
"--force",
|
|
137
|
+
"--sign",
|
|
138
|
+
"-",
|
|
139
|
+
bundle
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { stageBundle as n, validateInfoPlist as r, resolveBundleExtras as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as registerStart, c as startDevServer, d as tailLines, f as wantsExpoOwnTunnel, i as readLogTail, l as startFacts, n as liveSupervisor, o as resolveWorkspaceMetroPort, r as parseWait, s as startCommand, t as failureEvidence, u as supervisorEntry } from "./start-ClDfwXa4.mjs";
|
|
2
|
+
export { startCommand as default, failureEvidence, liveSupervisor, parseWait, readLogTail, registerStart, resolveWorkspaceMetroPort, startDevServer, startFacts, supervisorEntry, tailLines, wantsExpoOwnTunnel };
|