stim 1.20.2 → 1.21.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 +88 -8
- package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
- package/dist/act-DHAw2A2S.mjs +2667 -0
- package/dist/activity-BzVfHSrY.mjs +1376 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
- package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
- package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
- package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
- package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/api.d.mts +740 -8
- package/dist/api.mjs +585 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
- package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
- package/dist/budget-Bs6SxxzO.mjs +9154 -0
- package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
- package/dist/build-cache-DmyR9Zzc.mjs +602 -0
- package/dist/build-plan-CaFskB7_.mjs +188 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-0DYf8QhQ.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-B7QVOlCr.d.mts +253 -0
- package/dist/client-UXD70ZbM.mjs +1406 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
- package/dist/config-CYcBF478.mjs +949 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
- package/dist/device-DCxH7_By.mjs +1068 -0
- package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
- package/dist/device-host-worker.mjs +65 -61
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
- package/dist/doctor-BLHCYxzi.mjs +2 -0
- package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
- package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
- package/dist/exec-H20xSg2T.d.mts +65 -0
- package/dist/exec-_UbtCQcG.mjs +750 -0
- package/dist/gc-C-WwL0yi.mjs +3 -0
- package/dist/{gc-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
- package/dist/git-C3iTsJaZ.mjs +73 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
- package/dist/idle-BVeRGroT.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
- package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
- package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
- package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
- package/dist/ios-signing-DTTIChGs.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
- package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
- package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
- package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
- package/dist/logs-BS00Anxf.mjs +352 -0
- package/dist/logs-CMm05HxN.mjs +255 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
- package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +122 -247
- package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
- package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
- package/dist/native-android-JACyjTZs.mjs +844 -0
- package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-DY_RLx3C.mjs +277 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +1 -46
- package/dist/offload-worker.mjs +197 -66
- package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
- package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
- package/dist/prebuild-uD_ipCxF.mjs +449 -0
- package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
- package/dist/pull-request-zjCSAryH.d.mts +120 -0
- package/dist/pull-requests.d.mts +1 -119
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
- package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
- package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
- package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
- package/dist/reload-DzjSl5P_.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
- package/dist/result-DNiS-tTP.mjs +434 -0
- package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
- package/dist/selection-CSl9i5qU.mjs +619 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
- package/dist/server-expo-C-90EhcG.mjs +2 -0
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
- package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
- package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
- package/dist/settings-T1gtc3bf.mjs +114 -0
- package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
- package/dist/settings.schema.json +163 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-DF8VfT64.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-BIS0ydsV.mjs +183 -0
- package/dist/{start-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
- package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
- package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
- package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
- package/dist/stats-report-BFfMpWWF.mjs +16 -0
- package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
- package/dist/status-CSi6tlRq.mjs +2 -0
- package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-GDCfqpTE.mjs} +187 -22
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-C12we7lz.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
- package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
- package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +63 -27
- package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
- package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
- package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
- package/dist/toolchain-DhKwp9iI.mjs +2 -0
- package/dist/toolchain-Hp9sCpK4.mjs +873 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
- package/dist/trigger-Bf3uDcpv.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
- package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
- package/dist/web-DknQETPs.mjs +2 -0
- package/dist/web-run.mjs +11 -12
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
- package/dist/worktree-CK2MpJW5.mjs +2 -0
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
- package/dist/xcode-Zlx3qjEs.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { i as
|
|
11
|
-
import { a as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-B1UrjZHL.mjs";
|
|
2
|
+
import { H as remoteEasFallbackSetting, K as resolveIosProjectDir, R as publicUrlSetting, U as remoteIosSetting, a as SETTING_SHAPE_REMEDY, et as settingShapeErrors, p as cacheProviderSettingError, rt as tunnelModeSetting } from "./settings-CsJDEXgK.mjs";
|
|
3
|
+
import { Y as statsProjectKey } from "./budget-Bs6SxxzO.mjs";
|
|
4
|
+
import { d as runCancellationSignal } from "./native-run-DY_RLx3C.mjs";
|
|
5
|
+
import { c as fingerprintDiffRecord, i as configInputsChanged, m as refingerprintAfterMutation, n as buildCacheKey, r as changedDuringBuildLine, s as filesystemBuildCapability, u as inputsChangedDuringBuild, y as untrackedMissLine } from "./build-cache-DmyR9Zzc.mjs";
|
|
6
|
+
import { d as optimizationBuildProfile, l as artifactCachePolicy, p as resolveOptimizations } from "./errors-ccaPc4ox.mjs";
|
|
7
|
+
import { b as bundlerPin } from "./xcode-Zlx3qjEs.mjs";
|
|
8
|
+
import { i as iosToolchainAsync } from "./toolchain-Hp9sCpK4.mjs";
|
|
9
|
+
import { a as deviceModelRefusal, c as iosProjectPathError, f as podAction, h as resolveDeviceType, l as iosProviderRunOptions, m as resolveConfiguration, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-Dlu37g6H.mjs";
|
|
10
|
+
import { i as planEasDevelopmentBuild, n as easDeviceBuildRemedy } from "./eas-build-BomfRnFT.mjs";
|
|
11
|
+
import { a as explainBuildMiss, i as staleNativeDirRefusal, n as recordPrebuild, o as fingerprintErrorMissReason } from "./prebuild-uD_ipCxF.mjs";
|
|
12
|
+
import { r as planPayload, t as planCachedBuild } from "./build-plan-CaFskB7_.mjs";
|
|
13
|
+
import { t as IosRecipeRefusal } from "./ios-project-WuwwBdvW.mjs";
|
|
14
|
+
import { i as hostedIosSelectors } from "./remote-ByYkXdGD.mjs";
|
|
15
|
+
import { c as copyAppAside, i as DEFAULT_DEPS, n as iosMetroRuntime, r as iosProcessRuntime, u as writeIpTxt } from "./launch-Zq2mOSDy.mjs";
|
|
16
|
+
import { t as planHostedDevice } from "./plan-placement-Bwj-IjY1.mjs";
|
|
16
17
|
import { rmSync } from "node:fs";
|
|
17
18
|
import chalk from "chalk";
|
|
18
19
|
//#region src/integrations/react-native-ios-plan.ts
|
|
@@ -106,7 +107,7 @@ async function planReactNativeIos(root, opts, d, schemeProblem, { context: setti
|
|
|
106
107
|
remedy: "Run `stim ios` to build for the remote device, or unset ios.remote to plan the owned simulator."
|
|
107
108
|
});
|
|
108
109
|
const scheme = resolveSchemeSelection(opts, settings);
|
|
109
|
-
const refusal = schemeProblem(scheme);
|
|
110
|
+
const refusal = await schemeProblem(scheme);
|
|
110
111
|
if (refusal) return refuse({
|
|
111
112
|
code: refusal.code,
|
|
112
113
|
message: refusal.message ?? "",
|
|
@@ -197,7 +198,7 @@ async function planReactNativeIos(root, opts, d, schemeProblem, { context: setti
|
|
|
197
198
|
//#endregion
|
|
198
199
|
//#region src/integrations/react-native-ios.ts
|
|
199
200
|
const PLATFORM = "ios";
|
|
200
|
-
function reactNativeIosSchemeProblem(root, iosDir, scheme, isExpo, d) {
|
|
201
|
+
async function reactNativeIosSchemeProblem(root, iosDir, scheme, isExpo, d) {
|
|
201
202
|
if (scheme === void 0) return null;
|
|
202
203
|
if (!scheme.trim()) return {
|
|
203
204
|
code: "STIM_BAD_ARG",
|
|
@@ -207,7 +208,7 @@ function reactNativeIosSchemeProblem(root, iosDir, scheme, isExpo, d) {
|
|
|
207
208
|
if (isExpo) return null;
|
|
208
209
|
const project = d.discoverXcodeProject(root, iosDir);
|
|
209
210
|
if (project.error) return project.error;
|
|
210
|
-
return d.resolveScheme(project, { scheme }).error ?? null;
|
|
211
|
+
return (await d.resolveScheme(project, { scheme })).error ?? null;
|
|
211
212
|
}
|
|
212
213
|
const runtimeKind = (configuration) => isReleaseConfiguration(configuration) ? "embedded-js" : "metro";
|
|
213
214
|
function reactNativeIosProject(root, settings, dependencies = {}) {
|
|
@@ -240,7 +241,11 @@ function reactNativeIosProject(root, settings, dependencies = {}) {
|
|
|
240
241
|
function fail(failure) {
|
|
241
242
|
throw new IosRecipeRefusal(failure);
|
|
242
243
|
}
|
|
243
|
-
function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, buildProfile, target, device, easProfile, optimizations, cache: cachePolicy, phase, note, logWriter, estimates, step, setPodsMs }, isExpo, iosProject, d) {
|
|
244
|
+
function reactNativeIosArtifact({ operation, root, logFile, configuration, buildScheme, buildProfile, target, device, easProfile, optimizations, cache: cachePolicy, phase, note, logWriter, estimates, step, setPodsMs }, isExpo, iosProject, d) {
|
|
245
|
+
const signingOptions = {
|
|
246
|
+
env: operation?.env,
|
|
247
|
+
signal: runCancellationSignal(operation) ?? operation?.signal
|
|
248
|
+
};
|
|
244
249
|
const physical = device !== null;
|
|
245
250
|
const { udid } = target;
|
|
246
251
|
const release = isReleaseConfiguration(configuration);
|
|
@@ -275,8 +280,9 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
275
280
|
note(chalk.dim(phaseLine("", remedy)));
|
|
276
281
|
return null;
|
|
277
282
|
};
|
|
278
|
-
const gateProfile = () => {
|
|
279
|
-
const gate = d.gateProfileForDevice({
|
|
283
|
+
const gateProfile = async () => {
|
|
284
|
+
const gate = await d.gateProfileForDevice({
|
|
285
|
+
...signingOptions,
|
|
280
286
|
appPath: path,
|
|
281
287
|
udid: physicalDevice.udid,
|
|
282
288
|
configuration
|
|
@@ -299,7 +305,8 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
299
305
|
}
|
|
300
306
|
ownTemporary(copy.tmpDir);
|
|
301
307
|
writeIpTxt(copy.appPath, lanAddress, metroPort);
|
|
302
|
-
const sealed = d.sealAppForDevice({
|
|
308
|
+
const sealed = await d.sealAppForDevice({
|
|
309
|
+
...signingOptions,
|
|
303
310
|
appPath: copy.appPath,
|
|
304
311
|
udid: physicalDevice.udid,
|
|
305
312
|
configuration,
|
|
@@ -324,6 +331,8 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
324
331
|
if (!release) return cachedPath;
|
|
325
332
|
phase("swap", `regenerating this workspace's JS for the cached ${configuration} app`);
|
|
326
333
|
const swap = await d.swapJsBundle({
|
|
334
|
+
context: operation,
|
|
335
|
+
onHeartbeat: note,
|
|
327
336
|
root,
|
|
328
337
|
iosDir: iosProject.dir,
|
|
329
338
|
isExpo,
|
|
@@ -373,13 +382,15 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
373
382
|
return identity();
|
|
374
383
|
},
|
|
375
384
|
cache: () => filesystemBuildCapability({
|
|
385
|
+
context: operation,
|
|
376
386
|
resolve: d.resolveBuild,
|
|
377
387
|
store: d.storeBuild,
|
|
378
388
|
sources: storeSources
|
|
379
389
|
}),
|
|
380
|
-
validateExternal(path) {
|
|
390
|
+
async validateExternal(path) {
|
|
381
391
|
if (device) {
|
|
382
|
-
const gate = d.gateProfileForDevice({
|
|
392
|
+
const gate = await d.gateProfileForDevice({
|
|
393
|
+
...signingOptions,
|
|
383
394
|
appPath: path,
|
|
384
395
|
udid: device.udid,
|
|
385
396
|
configuration
|
|
@@ -426,7 +437,7 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
426
437
|
if (isExpo && buildScheme !== void 0) {
|
|
427
438
|
const project = d.discoverXcodeProject(root, iosProject.dir);
|
|
428
439
|
if (project.error) fail({ ...project.error });
|
|
429
|
-
const schemeError = d.resolveScheme(project, { scheme: buildScheme }).error;
|
|
440
|
+
const schemeError = (await d.resolveScheme(project, { scheme: buildScheme })).error;
|
|
430
441
|
if (schemeError) fail({ ...schemeError });
|
|
431
442
|
}
|
|
432
443
|
const podState = d.readPodState(root, iosProject.dir);
|
|
@@ -435,6 +446,7 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
435
446
|
if (action.install) {
|
|
436
447
|
step("pods");
|
|
437
448
|
const result = await d.runPodInstall(root, logWriter(), {
|
|
449
|
+
onHeartbeat: note,
|
|
438
450
|
estimateMs: estimates().podsMs,
|
|
439
451
|
directory: iosProject.dir
|
|
440
452
|
});
|
|
@@ -511,6 +523,7 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
511
523
|
return identity();
|
|
512
524
|
},
|
|
513
525
|
compile: () => d.buildIos({
|
|
526
|
+
context: operation,
|
|
514
527
|
root,
|
|
515
528
|
iosDir: iosProject.dir,
|
|
516
529
|
scheme: buildScheme,
|
|
@@ -521,6 +534,8 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
521
534
|
logWriter: logWriter(),
|
|
522
535
|
...configuration ? { configuration } : {},
|
|
523
536
|
estimateMs: estimates().coldBuildMs,
|
|
537
|
+
onHeartbeat: note,
|
|
538
|
+
onNote: note,
|
|
524
539
|
optimizations
|
|
525
540
|
}),
|
|
526
541
|
explain(rekeyedBy) {
|
|
@@ -549,7 +564,10 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
549
564
|
iosProjectPath: iosProject.relative
|
|
550
565
|
})),
|
|
551
566
|
legacyCache: physical || !cachePolicy.remote || buildProfile || buildScheme ? null : {
|
|
552
|
-
load: () => d.loadProjectProvider(root, {
|
|
567
|
+
load: () => d.loadProjectProvider(root, {
|
|
568
|
+
context: operation,
|
|
569
|
+
isExpo
|
|
570
|
+
}),
|
|
553
571
|
runOptions: iosProviderRunOptions(configuration, target.keyArch)
|
|
554
572
|
},
|
|
555
573
|
offload: {
|
|
@@ -560,10 +578,10 @@ function reactNativeIosArtifact({ root, logFile, configuration, buildScheme, bui
|
|
|
560
578
|
unsupported: target.offloadRefusal ?? (release ? `${configuration} builds build here` : !cachePolicy.write ? "the build cache is off" : !runtime ? udid ? `the runtime of simulator ${udid} is unknown` : "no simulator runtime is available for worker selection" : null)
|
|
561
579
|
};
|
|
562
580
|
},
|
|
563
|
-
target: (runtime) => ({
|
|
581
|
+
target: async (runtime) => ({
|
|
564
582
|
platform: "ios",
|
|
565
583
|
local: {
|
|
566
|
-
...
|
|
584
|
+
...await iosToolchainAsync(root),
|
|
567
585
|
...target.hostedArchitecture ? { arch: target.hostedArchitecture === "x86_64" ? "x64" : "arm64" } : {}
|
|
568
586
|
},
|
|
569
587
|
runtime,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { existsSync
|
|
1
|
+
import { bt as gitCommonDirOnDisk } from "./settings-CsJDEXgK.mjs";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
3
|
import { loadConfig, recordingEnabled, workspaceRecordingsDir } from "@stim-cli/core/state";
|
|
4
|
+
import { rm } from "node:fs/promises";
|
|
4
5
|
//#region src/workspace/recordings.ts
|
|
5
6
|
/** `recording.enabled` for one registered workspace, from `STIM_RECORDING` and its workspace, repo and machine layers. */
|
|
6
7
|
function workspaceRecordingEnabled(path, project, config, env) {
|
|
@@ -21,17 +22,19 @@ function recordingLayers() {
|
|
|
21
22
|
* (`before`, from {@link recordingLayers}) and after it, and returns those workspaces. stim-server stops
|
|
22
23
|
* recording them once `stim status` shows the change.
|
|
23
24
|
*/
|
|
24
|
-
function deleteTurnedOffRecordings(before) {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
async function deleteTurnedOffRecordings(before) {
|
|
26
|
+
const deleted = [];
|
|
27
|
+
for (const [path, enabled] of recordingLayers()) {
|
|
28
|
+
if (enabled || before.get(path) === false) continue;
|
|
27
29
|
const dir = workspaceRecordingsDir(path);
|
|
28
|
-
if (!existsSync(dir))
|
|
29
|
-
|
|
30
|
+
if (!existsSync(dir)) continue;
|
|
31
|
+
await rm(dir, {
|
|
30
32
|
recursive: true,
|
|
31
33
|
force: true
|
|
32
34
|
});
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
+
deleted.push(path);
|
|
36
|
+
}
|
|
37
|
+
return deleted;
|
|
35
38
|
}
|
|
36
39
|
//#endregion
|
|
37
40
|
export { recordingLayers as n, workspaceRecordingEnabled as r, deleteTurnedOffRecordings as t };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { r as
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
1
|
+
import { U as deviceSlotPlatforms, W as parseDeviceSlotKey, p as getProject } from "./config-CYcBF478.mjs";
|
|
2
|
+
import { f as refuseNoProject, l as phaseLine } from "./command-output-B1UrjZHL.mjs";
|
|
3
|
+
import { a as recordWorkspaceUseAsync, r as readWorkspaceState$1 } from "./workspace-state-Cjuigeeu.mjs";
|
|
4
|
+
import { $t as cancelledError, It as repoRootAsync, Qt as cancellableSleep, en as throwIfCancelled } from "./settings-CsJDEXgK.mjs";
|
|
5
|
+
import { I as readWorkspaceLaunches, r as findCommandWorkspaceAsync } from "./project-BZNjmW_8.mjs";
|
|
6
|
+
import { d as processCwds, f as resolveProjectMetro, g as isMetroRunning, o as listeningPidsAsync } from "./metro-DEXpIhHC.mjs";
|
|
7
|
+
import { d as webFactsAsync, o as readWebRecord, r as cdpEndpoint } from "./state-C4ZtUisW.mjs";
|
|
8
|
+
import { Sn as iosAppProcess, _n as ensureMetroReverse, dn as androidAppProcess } from "./budget-Bs6SxxzO.mjs";
|
|
9
|
+
import { Q as resolveOwnedAvdSerialAsync } from "./android-DUYkNF4u.mjs";
|
|
10
|
+
import { E as resolveOwnedIosSim, f as listAllIosSimsAsync } from "./ios-CpByZy12.mjs";
|
|
11
|
+
import { f as probeHostedSession } from "./hosted-client-DB_gBPfY.mjs";
|
|
12
|
+
import { r as readHostedNative } from "./ios-state-DvFX-K_l.mjs";
|
|
13
|
+
import { r as reopenHostedAndroidMetro } from "./hosted-android-Bw-honsd.mjs";
|
|
14
|
+
import { n as nativeRunCommand } from "./slot-launch-DF8VfT64.mjs";
|
|
15
|
+
import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CPaHeYqj.mjs";
|
|
15
16
|
import { hostedAndroidDeviceName, hostedNativeRecords } from "@stim-cli/core/state";
|
|
16
|
-
import chalk from "chalk";
|
|
17
17
|
import { WebSocket } from "ws";
|
|
18
|
+
import chalk from "chalk";
|
|
18
19
|
//#region src/engine/reload.ts
|
|
19
20
|
const METRO_TIMEOUT_MS = 2e3;
|
|
20
21
|
function describe$1(error) {
|
|
@@ -39,9 +40,10 @@ function peerMatches(query, role, appId) {
|
|
|
39
40
|
* Asks Metro for its peers and reloads the ones matching `role` and `appId`. With `peersOnly`, it sends nothing and
|
|
40
41
|
* only reports the outcome a reload would have, so a caller can wait for the app to connect.
|
|
41
42
|
*/
|
|
42
|
-
function reloadThroughMetro(port, { role, appId, timeoutMs = METRO_TIMEOUT_MS, peersOnly = false }) {
|
|
43
|
+
function reloadThroughMetro(port, { role, appId, timeoutMs = METRO_TIMEOUT_MS, peersOnly = false, signal }) {
|
|
44
|
+
if (signal?.aborted) return Promise.reject(cancelledError("reload"));
|
|
43
45
|
const roleName = ROLE_NAMES[role];
|
|
44
|
-
return new Promise((resolve) => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
45
47
|
const requestId = `stim-reload-${process.pid}-${Date.now()}`;
|
|
46
48
|
const socket = new WebSocket(`ws://127.0.0.1:${port}/message`);
|
|
47
49
|
let settled = false;
|
|
@@ -49,6 +51,7 @@ function reloadThroughMetro(port, { role, appId, timeoutMs = METRO_TIMEOUT_MS, p
|
|
|
49
51
|
if (settled) return;
|
|
50
52
|
settled = true;
|
|
51
53
|
clearTimeout(timer);
|
|
54
|
+
signal?.removeEventListener("abort", abort);
|
|
52
55
|
socket.close();
|
|
53
56
|
resolve(result);
|
|
54
57
|
};
|
|
@@ -57,7 +60,18 @@ function reloadThroughMetro(port, { role, appId, timeoutMs = METRO_TIMEOUT_MS, p
|
|
|
57
60
|
unreachable: true,
|
|
58
61
|
reason: `Metro did not answer on port ${port}.`
|
|
59
62
|
}), timeoutMs);
|
|
63
|
+
const abort = () => {
|
|
64
|
+
if (settled) return;
|
|
65
|
+
settled = true;
|
|
66
|
+
clearTimeout(timer);
|
|
67
|
+
signal?.removeEventListener("abort", abort);
|
|
68
|
+
socket.once("close", () => reject(cancelledError("reload")));
|
|
69
|
+
socket.terminate();
|
|
70
|
+
};
|
|
71
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
72
|
+
if (signal?.aborted) abort();
|
|
60
73
|
socket.once("open", () => {
|
|
74
|
+
if (settled || signal?.aborted) return;
|
|
61
75
|
socket.send(JSON.stringify({
|
|
62
76
|
version: 2,
|
|
63
77
|
method: "getpeers",
|
|
@@ -66,6 +80,7 @@ function reloadThroughMetro(port, { role, appId, timeoutMs = METRO_TIMEOUT_MS, p
|
|
|
66
80
|
}));
|
|
67
81
|
});
|
|
68
82
|
socket.on("message", (data) => {
|
|
83
|
+
if (settled || signal?.aborted) return;
|
|
69
84
|
let message;
|
|
70
85
|
try {
|
|
71
86
|
message = JSON.parse(data.toString());
|
|
@@ -129,22 +144,31 @@ function reloadThroughMetro(port, { role, appId, timeoutMs = METRO_TIMEOUT_MS, p
|
|
|
129
144
|
unreachable: true,
|
|
130
145
|
reason: `Metro reload failed: ${describe$1(error)}`
|
|
131
146
|
}));
|
|
147
|
+
socket.once("close", () => finish({
|
|
148
|
+
failed: true,
|
|
149
|
+
unreachable: true,
|
|
150
|
+
reason: `Metro closed before answering on port ${port}.`
|
|
151
|
+
}));
|
|
132
152
|
});
|
|
133
153
|
}
|
|
134
154
|
//#endregion
|
|
135
155
|
//#region src/commands/reload.ts
|
|
136
156
|
const DEFAULT_DEPS = {
|
|
137
|
-
findWorkspace:
|
|
157
|
+
findWorkspace: (cwd) => findCommandWorkspaceAsync(cwd, repoRootAsync, (line) => console.error(line)),
|
|
138
158
|
getProject,
|
|
139
159
|
readLaunches: readWorkspaceLaunches,
|
|
140
|
-
resolveIos: resolveOwnedIosSim,
|
|
141
|
-
resolveAndroid:
|
|
160
|
+
resolveIos: async (udid) => resolveOwnedIosSim(udid, await listAllIosSimsAsync({})),
|
|
161
|
+
resolveAndroid: resolveOwnedAvdSerialAsync,
|
|
142
162
|
iosProcess: iosAppProcess,
|
|
143
163
|
androidProcess: androidAppProcess,
|
|
144
|
-
resolveMetro: resolveProjectMetro,
|
|
164
|
+
resolveMetro: (port, root, signal) => resolveProjectMetro(port, root, {
|
|
165
|
+
probe: (candidate) => isMetroRunning(candidate, signal),
|
|
166
|
+
pidsOf: listeningPidsAsync,
|
|
167
|
+
cwdOf: async (pid) => (await processCwds([pid])).get(pid) ?? null
|
|
168
|
+
}),
|
|
145
169
|
reloadMetro: reloadThroughMetro,
|
|
146
|
-
readBrowser: (root) => {
|
|
147
|
-
const facts =
|
|
170
|
+
readBrowser: async (root) => {
|
|
171
|
+
const facts = await webFactsAsync(readWebRecord(root));
|
|
148
172
|
return facts?.status === "unverified" ? "unverified" : liveWebRecord(facts?.record ?? null);
|
|
149
173
|
},
|
|
150
174
|
reloadPage: (record) => sendToOwnedPage(record, "Page.reload"),
|
|
@@ -168,11 +192,12 @@ function failure(code, message, remedy) {
|
|
|
168
192
|
function describe(error) {
|
|
169
193
|
return error instanceof Error ? error.message : String(error);
|
|
170
194
|
}
|
|
171
|
-
async function reloadBrowser(browser, metroPort, d) {
|
|
195
|
+
async function reloadBrowser(browser, metroPort, d, signal) {
|
|
172
196
|
let pageUrl;
|
|
173
197
|
try {
|
|
174
198
|
pageUrl = await d.reloadPage(browser);
|
|
175
199
|
} catch (error) {
|
|
200
|
+
throwIfCancelled(signal, "reload");
|
|
176
201
|
return {
|
|
177
202
|
ok: false,
|
|
178
203
|
error: failure("STIM_RELOAD_FAILED", `The owned Chrome did not accept the reload: ${describe(error)}`, "Run `stim web` to reopen the page.")
|
|
@@ -192,8 +217,8 @@ async function reloadBrowser(browser, metroPort, d) {
|
|
|
192
217
|
}
|
|
193
218
|
};
|
|
194
219
|
}
|
|
195
|
-
function processFailure(platform, record, d, slot = "default") {
|
|
196
|
-
const { state } = platform === "ios" ? d.iosProcess(record.deviceId, record.appId) : d.androidProcess(record.deviceId, record.appId);
|
|
220
|
+
async function processFailure(platform, record, d, slot = "default") {
|
|
221
|
+
const { state } = platform === "ios" ? await d.iosProcess(record.deviceId, record.appId) : await d.androidProcess(record.deviceId, record.appId);
|
|
197
222
|
if (state === "unknown") {
|
|
198
223
|
const probe = platform === "ios" ? `xcrun simctl spawn ${record.deviceId} launchctl list` : `adb -s ${record.deviceId} shell pidof ${record.appId}`;
|
|
199
224
|
return failure("STIM_RELOAD_PROBE_FAILED", `Stim could not determine whether ${record.appId} is running on ${record.deviceId}.`, `Run \`${probe}\` and retry when the device tool responds.`);
|
|
@@ -201,7 +226,7 @@ function processFailure(platform, record, d, slot = "default") {
|
|
|
201
226
|
if (state === "stopped") return failure("STIM_RELOAD_STOPPED", `${record.appId} is not running on ${record.deviceId}.`, `Run \`${nativeRunCommand(platform, slot)}\` to launch it.`);
|
|
202
227
|
return null;
|
|
203
228
|
}
|
|
204
|
-
function inspectTarget(platform, record, project, d, slot = "default") {
|
|
229
|
+
async function inspectTarget(platform, record, project, d, slot = "default") {
|
|
205
230
|
const runCommand = nativeRunCommand(platform, slot);
|
|
206
231
|
if (platform === "ios") {
|
|
207
232
|
const configured = project.platforms?.ios;
|
|
@@ -211,7 +236,7 @@ function inspectTarget(platform, record, project, d, slot = "default") {
|
|
|
211
236
|
};
|
|
212
237
|
let resolved;
|
|
213
238
|
try {
|
|
214
|
-
resolved = d.resolveIos(record.deviceId);
|
|
239
|
+
resolved = await d.resolveIos(record.deviceId);
|
|
215
240
|
} catch (error) {
|
|
216
241
|
return {
|
|
217
242
|
platform,
|
|
@@ -222,7 +247,7 @@ function inspectTarget(platform, record, project, d, slot = "default") {
|
|
|
222
247
|
platform,
|
|
223
248
|
error: failure("STIM_RELOAD_STOPPED", `The recorded iOS app is not running on a booted owned simulator.`, `Run \`${runCommand}\` to boot, install, and launch it.`)
|
|
224
249
|
};
|
|
225
|
-
const stopped = processFailure(platform, record, d, slot);
|
|
250
|
+
const stopped = await processFailure(platform, record, d, slot);
|
|
226
251
|
if (stopped) return {
|
|
227
252
|
platform,
|
|
228
253
|
error: stopped
|
|
@@ -241,7 +266,7 @@ function inspectTarget(platform, record, project, d, slot = "default") {
|
|
|
241
266
|
};
|
|
242
267
|
let resolved;
|
|
243
268
|
try {
|
|
244
|
-
resolved = d.resolveAndroid(configured.avdName);
|
|
269
|
+
resolved = await d.resolveAndroid(configured.avdName);
|
|
245
270
|
} catch (error) {
|
|
246
271
|
return {
|
|
247
272
|
platform,
|
|
@@ -252,7 +277,7 @@ function inspectTarget(platform, record, project, d, slot = "default") {
|
|
|
252
277
|
platform,
|
|
253
278
|
error: failure("STIM_RELOAD_STOPPED", `The recorded Android app is not running on this workspace's owned emulator.`, `Run \`${runCommand}\` to boot, install, and launch it.`)
|
|
254
279
|
};
|
|
255
|
-
const stopped = processFailure(platform, record, d, slot);
|
|
280
|
+
const stopped = await processFailure(platform, record, d, slot);
|
|
256
281
|
if (stopped) return {
|
|
257
282
|
platform,
|
|
258
283
|
error: stopped
|
|
@@ -267,9 +292,16 @@ function inspectTarget(platform, record, project, d, slot = "default") {
|
|
|
267
292
|
function isTargetFailure(value) {
|
|
268
293
|
return "error" in value;
|
|
269
294
|
}
|
|
270
|
-
async function runReload({ root, platform = null, deps = {} }) {
|
|
295
|
+
async function runReload({ root, platform = null, deps = {}, signal }) {
|
|
296
|
+
throwIfCancelled(signal, "reload");
|
|
271
297
|
const d = {
|
|
272
298
|
...DEFAULT_DEPS,
|
|
299
|
+
reloadPage: (record) => sendToOwnedPage(record, "Page.reload", {}, signal),
|
|
300
|
+
reopenHostedMetro: (projectRoot, placement, port) => reopenHostedAndroidMetro(projectRoot, placement, port, signal),
|
|
301
|
+
sleep: (ms) => cancellableSleep(ms, {
|
|
302
|
+
signal,
|
|
303
|
+
what: "reload"
|
|
304
|
+
}),
|
|
273
305
|
...deps
|
|
274
306
|
};
|
|
275
307
|
const project = d.getProject(root);
|
|
@@ -277,13 +309,14 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
277
309
|
ok: false,
|
|
278
310
|
error: failure("STIM_NO_PROJECT", `No Stim environment is registered for ${root}.`, "Run `stim start` first.")
|
|
279
311
|
};
|
|
280
|
-
const read = platform === null || platform === "web" ? d.readBrowser(root) : null;
|
|
312
|
+
const read = platform === null || platform === "web" ? await d.readBrowser(root) : null;
|
|
313
|
+
throwIfCancelled(signal, "reload");
|
|
281
314
|
if (platform === "web" && read === "unverified") return {
|
|
282
315
|
ok: false,
|
|
283
316
|
error: failure("STIM_RELOAD_PROBE_FAILED", "Stim could not verify the owned Chrome's supervisor or Chrome process.", "Run `stim status`, then follow `stim guide errors teardown`.")
|
|
284
317
|
};
|
|
285
318
|
const browser = read === "unverified" ? null : read;
|
|
286
|
-
if (platform === "web") return browser ? reloadBrowser(browser, project.metroPort ?? null, d) : {
|
|
319
|
+
if (platform === "web") return browser ? reloadBrowser(browser, project.metroPort ?? null, d, signal) : {
|
|
287
320
|
ok: false,
|
|
288
321
|
error: failure("STIM_RELOAD_STOPPED", "No owned Chrome is running for this workspace.", "Run `stim web` first.")
|
|
289
322
|
};
|
|
@@ -309,9 +342,10 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
309
342
|
const hostedProbes = Object.fromEntries(await Promise.all(["ios", "android"].flatMap((native) => Object.entries(hosted[native]).map(async ([slot, placement]) => [`${native}:${slot}`, await probeHostedSession({
|
|
310
343
|
...placement,
|
|
311
344
|
platform: native
|
|
312
|
-
})]))));
|
|
345
|
+
}, signal ? { ttlMs: 0 } : void 0)]))));
|
|
346
|
+
throwIfCancelled(signal, "reload");
|
|
313
347
|
const launches = d.readLaunches(root);
|
|
314
|
-
const inspected = Object.entries(launches).
|
|
348
|
+
const inspected = (await Promise.all(Object.entries(launches).map(async ([key, record]) => {
|
|
315
349
|
const parsed = parseDeviceSlotKey(key);
|
|
316
350
|
if (!parsed || platform && parsed.platform !== platform) return [];
|
|
317
351
|
if (hostedFailures[`${parsed.platform}:${parsed.slot}`]) return [];
|
|
@@ -330,11 +364,12 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
330
364
|
error: failure("STIM_RELOAD_PROBE_FAILED", `The ${parsed.platform} session on ${placement.machine} is ${probe.state}.`, `Run stim ${parsed.platform} --remote ${placement.machine} or stim stop to reconcile it.`)
|
|
331
365
|
}];
|
|
332
366
|
}
|
|
333
|
-
return [inspectTarget(parsed.platform, record, {
|
|
367
|
+
return [await inspectTarget(parsed.platform, record, {
|
|
334
368
|
...project,
|
|
335
369
|
platforms: deviceSlotPlatforms(project, parsed.slot)
|
|
336
370
|
}, d, parsed.slot)];
|
|
337
|
-
});
|
|
371
|
+
}))).flat();
|
|
372
|
+
throwIfCancelled(signal, "reload");
|
|
338
373
|
inspected.push(...Object.values(hostedFailures));
|
|
339
374
|
const live = inspected.filter((target) => !isTargetFailure(target));
|
|
340
375
|
const livePlatforms = new Set(live.map((target) => target.platform));
|
|
@@ -346,7 +381,7 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
346
381
|
error: failure("STIM_RELOAD_AMBIGUOUS", `More than one platform is live: ${names.join(", ")}.`, `Choose one with ${names.map((name) => `\`stim reload ${name}\``).join(" or ")}.`)
|
|
347
382
|
};
|
|
348
383
|
}
|
|
349
|
-
if (browser && inspected.length === 0) return reloadBrowser(browser, project.metroPort ?? null, d);
|
|
384
|
+
if (browser && inspected.length === 0) return reloadBrowser(browser, project.metroPort ?? null, d, signal);
|
|
350
385
|
if (read === "unverified" && inspected.length === 0) return {
|
|
351
386
|
ok: false,
|
|
352
387
|
error: failure("STIM_RELOAD_PROBE_FAILED", "Stim could not verify the owned Chrome's supervisor or Chrome process.", "Run `stim status`, then follow `stim guide errors teardown`.")
|
|
@@ -375,11 +410,14 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
375
410
|
ok: false,
|
|
376
411
|
error: failure("STIM_NO_METRO", `The launch does not point at this workspace's current Metro reservation.`, "Run `stim start`, then launch the app again.")
|
|
377
412
|
};
|
|
378
|
-
|
|
413
|
+
const metro = await d.resolveMetro(port, root, signal);
|
|
414
|
+
throwIfCancelled(signal, "reload");
|
|
415
|
+
if (!metro.metro) return {
|
|
379
416
|
ok: false,
|
|
380
417
|
error: failure("STIM_NO_METRO", `Port ${port} is not serving this workspace's Metro.`, "Run `stim start`, then retry.")
|
|
381
418
|
};
|
|
382
|
-
const stopped = target.hosted ? null : processFailure(target.platform, target.record, d, target.slot);
|
|
419
|
+
const stopped = target.hosted ? null : await processFailure(target.platform, target.record, d, target.slot);
|
|
420
|
+
throwIfCancelled(signal, "reload");
|
|
383
421
|
if (stopped) return {
|
|
384
422
|
ok: false,
|
|
385
423
|
error: stopped
|
|
@@ -388,11 +426,14 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
388
426
|
let hostedReopened = false;
|
|
389
427
|
const reverseChecked = target.platform === "android" ? live.filter((c) => c.platform === "android" && !c.record.release && c.record.metroPort === port) : [];
|
|
390
428
|
for (const candidate of reverseChecked) {
|
|
429
|
+
throwIfCancelled(signal, "reload");
|
|
391
430
|
if (candidate.hostedAndroid) {
|
|
392
431
|
try {
|
|
393
432
|
await d.reopenHostedMetro(root, candidate.hostedAndroid, port);
|
|
433
|
+
throwIfCancelled(signal, "reload");
|
|
394
434
|
hostedReopened = true;
|
|
395
435
|
} catch (error) {
|
|
436
|
+
throwIfCancelled(signal, "reload");
|
|
396
437
|
return {
|
|
397
438
|
ok: false,
|
|
398
439
|
error: failure("STIM_HOSTING_REFUSED", describe(error), `Retry stim reload android when ${candidate.hostedAndroid.machine} answers, or run stim stop to reconcile the session.`)
|
|
@@ -401,7 +442,8 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
401
442
|
continue;
|
|
402
443
|
}
|
|
403
444
|
const serial = candidate.record.deviceId;
|
|
404
|
-
const ensured = d.ensureReverse(serial, port);
|
|
445
|
+
const ensured = await d.ensureReverse(serial, port);
|
|
446
|
+
throwIfCancelled(signal, "reload");
|
|
405
447
|
if (ensured.failed) return {
|
|
406
448
|
ok: false,
|
|
407
449
|
error: failure("STIM_RELOAD_FAILED", `Stim could not check or restore the adb reverse for Metro port ${port} on ${serial}: ${ensured.reason}`, `Run \`adb -s ${serial} reverse tcp:${port} tcp:${port}\`, then \`stim reload android\` again.`)
|
|
@@ -410,23 +452,27 @@ async function runReload({ root, platform = null, deps = {} }) {
|
|
|
410
452
|
}
|
|
411
453
|
const request = {
|
|
412
454
|
role: target.platform,
|
|
413
|
-
appId: target.record.appId
|
|
455
|
+
appId: target.record.appId,
|
|
456
|
+
...signal ? { signal } : {}
|
|
414
457
|
};
|
|
415
458
|
const expectedPeers = reverseChecked.filter((c) => c.record.appId === target.record.appId).length;
|
|
416
459
|
const awaitReconnect = reverseRestored.length > 0 || hostedReopened;
|
|
417
460
|
for (let poll = 0; poll < RECONNECT_POLLS; poll++) {
|
|
461
|
+
throwIfCancelled(signal, "reload");
|
|
418
462
|
if (!awaitReconnect) break;
|
|
419
463
|
const peers = await d.reloadMetro(port, {
|
|
420
464
|
...request,
|
|
421
465
|
peersOnly: true
|
|
422
466
|
});
|
|
467
|
+
throwIfCancelled(signal, "reload");
|
|
423
468
|
if (peers.broadcast) await d.sleep(RECONNECT_UNOBSERVED_MS);
|
|
424
469
|
if (peers.unreachable || peers.broadcast || peers.ok && peers.targets >= expectedPeers) break;
|
|
425
470
|
await d.sleep(RECONNECT_POLL_MS);
|
|
426
471
|
}
|
|
472
|
+
throwIfCancelled(signal, "reload");
|
|
427
473
|
const reloaded = await d.reloadMetro(port, request);
|
|
428
474
|
if (!reloaded.ok) {
|
|
429
|
-
const stoppedAfterMetro = target.hosted ? null : processFailure(target.platform, target.record, d, target.slot);
|
|
475
|
+
const stoppedAfterMetro = target.hosted ? null : await processFailure(target.platform, target.record, d, target.slot);
|
|
430
476
|
if (stoppedAfterMetro) return {
|
|
431
477
|
ok: false,
|
|
432
478
|
error: stoppedAfterMetro
|
|
@@ -472,12 +518,12 @@ function registerReload(program, deps = {}) {
|
|
|
472
518
|
process.exitCode = 1;
|
|
473
519
|
return;
|
|
474
520
|
}
|
|
475
|
-
const root = (deps.findWorkspace ?? DEFAULT_DEPS.findWorkspace)(process.cwd());
|
|
521
|
+
const root = await (deps.findWorkspace ?? DEFAULT_DEPS.findWorkspace)(process.cwd());
|
|
476
522
|
if (!root) {
|
|
477
523
|
refuseNoProject({ json: Boolean(opts.json) });
|
|
478
524
|
return;
|
|
479
525
|
}
|
|
480
|
-
|
|
526
|
+
await recordWorkspaceUseAsync(root);
|
|
481
527
|
const result = await runReload({
|
|
482
528
|
root,
|
|
483
529
|
platform: value ?? null,
|
|
@@ -509,4 +555,4 @@ function reloadCommand(program) {
|
|
|
509
555
|
registerReload(program);
|
|
510
556
|
}
|
|
511
557
|
//#endregion
|
|
512
|
-
export { reloadCommand as
|
|
558
|
+
export { reloadCommand as n, runReload as r, registerReload as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
1
|
+
import { U as deviceSlotPlatforms } from "./config-CYcBF478.mjs";
|
|
2
|
+
import { l as phaseLine } from "./command-output-B1UrjZHL.mjs";
|
|
3
|
+
import { F as parseIosRemote, H as remoteEasFallbackSetting, R as publicUrlSetting, U as remoteIosSetting, rt as tunnelModeSetting } from "./settings-CsJDEXgK.mjs";
|
|
4
|
+
import "./budget-Bs6SxxzO.mjs";
|
|
5
|
+
import { b as resolveSimulatorAppFlag } from "./support-Dlu37g6H.mjs";
|
|
6
|
+
import { n as devicePlacementRecord } from "./placement-log-BqGbTa61.mjs";
|
|
7
|
+
import { r as devicePlacementLine } from "./eas-fallback-DJwZpy0c.mjs";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
//#region src/commands/ios/remote.ts
|
|
10
10
|
function resolveIosRemote({ opts, settings, physical, recorded }) {
|
|
@@ -82,6 +82,8 @@ async function selectIosPlacement(args) {
|
|
|
82
82
|
...easFallback ? { eas: () => d.checkEasFallback({
|
|
83
83
|
root,
|
|
84
84
|
platform: "ios",
|
|
85
|
+
env: args.env,
|
|
86
|
+
operation: args.operation,
|
|
85
87
|
slot,
|
|
86
88
|
release,
|
|
87
89
|
isExpo: d.detectIsExpo(root),
|
|
@@ -149,7 +151,7 @@ async function connectIosTarget(selection, selectors, d, appMode) {
|
|
|
149
151
|
} };
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
|
-
async function iosPlacementBudget(d, root, note, hosted, automatic, simSnapshot) {
|
|
154
|
+
async function iosPlacementBudget(d, root, note, hosted, automatic, simSnapshot, env) {
|
|
153
155
|
if (automatic) return {
|
|
154
156
|
...automatic,
|
|
155
157
|
refusal: hosted ? null : automatic.refusal
|
|
@@ -160,14 +162,15 @@ async function iosPlacementBudget(d, root, note, hosted, automatic, simSnapshot)
|
|
|
160
162
|
} : d.budgetGate({
|
|
161
163
|
root,
|
|
162
164
|
note,
|
|
163
|
-
simSnapshot
|
|
165
|
+
simSnapshot,
|
|
166
|
+
env
|
|
164
167
|
});
|
|
165
168
|
}
|
|
166
169
|
function hostedIosMetroNote(hosted, settings, note, simulatorApp) {
|
|
167
170
|
if (hosted && (settings.iosSimulatorApp !== void 0 || simulatorApp !== void 0)) note(chalk.dim(phaseLine("device", "iosSimulatorApp is ignored on a hosting Mac; the simulator boots headless.")));
|
|
168
171
|
if (hosted && (publicUrlSetting(settings) || tunnelModeSetting(settings))) note(chalk.dim(phaseLine("metro", "metro.publicUrl and metro.tunnel are ignored on a hosting Mac; Metro uses the private tailnet bridge.")));
|
|
169
172
|
}
|
|
170
|
-
async function connectIosBackend(root, backend, deviceType, d) {
|
|
173
|
+
async function connectIosBackend(root, backend, deviceType, d, env, operation) {
|
|
171
174
|
if (!backend) return {
|
|
172
175
|
remote: null,
|
|
173
176
|
arch: null
|
|
@@ -175,6 +178,8 @@ async function connectIosBackend(root, backend, deviceType, d) {
|
|
|
175
178
|
const resolved = await d.resolveRemoteContext({
|
|
176
179
|
root,
|
|
177
180
|
backend,
|
|
181
|
+
env,
|
|
182
|
+
operation,
|
|
178
183
|
easBin: d.resolveEasCliBin(root)?.file ?? null,
|
|
179
184
|
deviceType: deviceType?.trim() || null
|
|
180
185
|
});
|