stim 1.20.2 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -8
- package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
- package/dist/act-DsuqEkiM.mjs +2801 -0
- package/dist/activity-CMLmzp7o.mjs +1397 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
- package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
- package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
- package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
- package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/android-project-DVWyCbWU.d.mts +391 -0
- package/dist/api.d.mts +810 -64
- package/dist/api.mjs +782 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
- package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
- package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
- package/dist/budget-Cvwn54qV.mjs +9285 -0
- package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
- package/dist/build-cache-Dv7RN200.mjs +602 -0
- package/dist/build-plan-DUC8Ka9y.mjs +248 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-OyRoEuSr.mjs +1577 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
- package/dist/config-DlrsduwG.mjs +955 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
- package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
- package/dist/device-DklWZLqb.mjs +1068 -0
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
- package/dist/device-host-worker.mjs +76 -79
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
- package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
- package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
- package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/doctor-thjWAV0z.mjs +2 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
- package/dist/exec-DEoAhcze.mjs +858 -0
- package/dist/exec-DnYc4HGH.d.mts +78 -0
- package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
- package/dist/gc-DnNDQyaP.mjs +3 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
- package/dist/idle-C4cZ757K.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
- package/dist/ios-CDvlmUs7.d.mts +24 -0
- package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
- package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
- package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
- package/dist/ios-signing-BtAffm0A.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
- package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
- package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
- package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
- package/dist/logs-BfwwadsZ.mjs +479 -0
- package/dist/logs-jTS_lHSo.mjs +248 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
- package/dist/macos-NfV2D7dO.mjs +694 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +123 -248
- package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
- package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
- package/dist/native-android-CqgnOgsT.mjs +645 -0
- package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
- package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-NwUuxbkg.mjs +276 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
- package/dist/native-source-Y0yLhFyQ.mjs +133 -0
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +59 -41
- package/dist/offload-worker.mjs +478 -115
- package/dist/operation-exec-BW0em61G.mjs +171 -0
- package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
- package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
- package/dist/prebuild-D4JoEAEs.mjs +484 -0
- package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
- package/dist/pull-request-eODyIqZF.d.mts +124 -0
- package/dist/pull-requests.d.mts +2 -120
- package/dist/pull-requests.mjs +2 -2
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
- package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
- package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
- package/dist/registration-BcRgF6Ox.mjs +51 -0
- package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
- package/dist/reload-D7AVlb8N.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
- package/dist/result-D2Ykz_iD.mjs +435 -0
- package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
- package/dist/selection-DSMbWEX2.mjs +620 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
- package/dist/server-expo-D58c9L0M.mjs +2 -0
- package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
- package/dist/settings-DpR-1Wnn.mjs +114 -0
- package/dist/settings-write-CzD60rOD.mjs +360 -0
- package/dist/settings.schema.json +176 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-Bps5oius.mjs +200 -0
- package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
- package/dist/start-EojN4WFz.mjs +1364 -0
- package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
- package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
- package/dist/stats-report-BzaPrRm6.mjs +16 -0
- package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
- package/dist/status-EvrK72L2.mjs +2 -0
- package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
- package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
- package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +56 -28
- package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
- package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
- package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
- package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
- package/dist/toolchain-BY8X8HXx.mjs +2 -0
- package/dist/toolchain-DpJMHq0n.mjs +876 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
- package/dist/trigger-yb_nFzPF.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
- package/dist/web-CZ07gd77.mjs +2 -0
- package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
- package/dist/web-run.mjs +13 -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-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
- package/dist/worktree-ZqZVjD9K.mjs +2 -0
- package/dist/xcode-BXn9-xYx.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-audio/Main.java +24 -0
- package/shim/android-audio/README.md +17 -0
- package/shim/android-audio.jar +0 -0
- 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/macos-Ch5VJmcS.mjs +0 -584
- package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
- 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/settings-vk3mJGSm.d.mts +0 -13
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/start-BWqzODpb.mjs +0 -1116
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
- 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,23 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
1
|
+
import { g as process_identity_exports, i as withWorkspaceProcessLock, r as WorkspaceProcessCleanupError, t as getExecutor, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { d as workspaceDir, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
|
|
3
|
+
import { p as getProject } from "./config-DlrsduwG.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-gwpm28fu.mjs";
|
|
5
|
+
import { d as cancelledError, f as throwIfCancelled } from "./operation-exec-BW0em61G.mjs";
|
|
6
|
+
import { r as readWorkspaceState$1 } from "./workspace-state-U08dEzhG.mjs";
|
|
7
|
+
import { a as SETTING_SHAPE_REMEDY, at as webSettings, j as metroPortSetting } from "./settings-C7O8A6ZI.mjs";
|
|
8
|
+
import { b as isPackageResolvable, v as detectIsExpo } from "./project-wM_XFTvE.mjs";
|
|
9
|
+
import { s as readNdjsonGenerations$1 } from "./ndjson-CgE_o3Dl.mjs";
|
|
10
|
+
import { d as resolveProjectMetro } from "./metro-DiXtA3Ty.mjs";
|
|
11
|
+
import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state--smjFSTL.mjs";
|
|
12
|
+
import { en as readMetroRecords } from "./budget-Cvwn54qV.mjs";
|
|
13
|
+
import { E as teardownBrowserHeld, h as resolveSupervisorTarget } from "./workspaces-CpANmBlq.mjs";
|
|
14
|
+
import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-DkEzOfzO.mjs";
|
|
15
|
+
import { n as sendToOwnedPage, t as liveWebRecord } from "./page-DBL2PiUU.mjs";
|
|
16
|
+
import { o as resolveWorkspaceMetroPort } from "./start-EojN4WFz.mjs";
|
|
17
|
+
import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
|
|
18
|
+
import { n as windowsLauncherArgs } from "./detached-entry-BwNEtIrP.mjs";
|
|
19
|
+
import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-Bbw689-6.mjs";
|
|
20
20
|
import { randomUUID } from "node:crypto";
|
|
21
|
+
import { mkdirSync, openSync, statSync, watch } from "node:fs";
|
|
22
|
+
import { ambientEnv } from "@stim-cli/core";
|
|
23
|
+
import { followLogs } from "@stim-cli/core/state";
|
|
21
24
|
import chalk from "chalk";
|
|
22
25
|
//#region src/web/launch.ts
|
|
23
26
|
const PORT_PLACEHOLDER = /\{port:([^}]*)\}/g;
|
|
@@ -139,7 +142,7 @@ function webLaunchRemedy(verdict, { url, template, usesMetro, serve }) {
|
|
|
139
142
|
//#endregion
|
|
140
143
|
//#region src/web/runtime.ts
|
|
141
144
|
const REGISTER_WAIT_MS = 3e4;
|
|
142
|
-
const POLL_MS
|
|
145
|
+
const POLL_MS = 250;
|
|
143
146
|
function failure$1(code, message, remedy) {
|
|
144
147
|
return {
|
|
145
148
|
ok: false,
|
|
@@ -170,7 +173,7 @@ function startSupervisor(root, { url, port, config, launchId }) {
|
|
|
170
173
|
if (!config.headless) args.push("--headed");
|
|
171
174
|
if (config.viewport !== "desktop") args.push("--viewport", config.viewport);
|
|
172
175
|
if (config.ignoreCertificateErrors) args.push("--ignore-certificate-errors");
|
|
173
|
-
mkdirSync(workspaceLogsDir(root), { recursive: true });
|
|
176
|
+
mkdirSync(workspaceLogsDir$1(root), { recursive: true });
|
|
174
177
|
const logFile = webSupervisorLogFile(root);
|
|
175
178
|
if (process.platform === "win32") {
|
|
176
179
|
const launcher = windowsLauncherArgs({
|
|
@@ -183,7 +186,7 @@ function startSupervisor(root, { url, port, config, launchId }) {
|
|
|
183
186
|
cwd: root,
|
|
184
187
|
stdio: "ignore",
|
|
185
188
|
env: {
|
|
186
|
-
...
|
|
189
|
+
...ambientEnv(),
|
|
187
190
|
...launcher.env
|
|
188
191
|
},
|
|
189
192
|
windowsHide: true
|
|
@@ -196,34 +199,67 @@ function startSupervisor(root, { url, port, config, launchId }) {
|
|
|
196
199
|
stdio: [
|
|
197
200
|
"ignore",
|
|
198
201
|
fd,
|
|
199
|
-
fd
|
|
202
|
+
fd,
|
|
203
|
+
"ipc"
|
|
200
204
|
],
|
|
201
|
-
env:
|
|
205
|
+
env: ambientEnv()
|
|
202
206
|
});
|
|
203
207
|
child.unref?.();
|
|
204
208
|
return child;
|
|
205
209
|
}
|
|
206
|
-
|
|
207
|
-
let exited = false;
|
|
208
|
-
if (process.platform !== "win32") child.once("exit", () => {
|
|
209
|
-
exited = true;
|
|
210
|
-
});
|
|
210
|
+
function waitForSupervisor(root, child, launchId, signal) {
|
|
211
211
|
const deadline = Date.now() + REGISTER_WAIT_MS;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
212
|
+
return new Promise((resolve) => {
|
|
213
|
+
let settled = false;
|
|
214
|
+
let repairTimer;
|
|
215
|
+
const finish = (record) => {
|
|
216
|
+
if (settled) return;
|
|
217
|
+
settled = true;
|
|
218
|
+
clearTimeout(repairTimer);
|
|
219
|
+
clearTimeout(deadlineTimer);
|
|
220
|
+
child.removeListener("message", onMessage);
|
|
221
|
+
child.removeListener("exit", onExit);
|
|
222
|
+
child.removeListener("error", onExit);
|
|
223
|
+
child.removeListener("disconnect", check);
|
|
224
|
+
signal?.removeEventListener("abort", check);
|
|
225
|
+
resolve(record);
|
|
226
|
+
};
|
|
227
|
+
const check = () => {
|
|
228
|
+
if (settled) return;
|
|
229
|
+
if (Date.now() >= deadline) return finish(null);
|
|
230
|
+
const record = readWebRecord(root);
|
|
231
|
+
if (record?.launchId === launchId && (record.targetId || signal?.aborted)) return finish(record);
|
|
232
|
+
if (process.platform !== "win32" && (child.exitCode !== null || child.signalCode !== null)) finish(null);
|
|
233
|
+
};
|
|
234
|
+
const onExit = () => {
|
|
235
|
+
check();
|
|
236
|
+
finish(null);
|
|
237
|
+
};
|
|
238
|
+
const onMessage = (message) => {
|
|
239
|
+
if (message === "web-registered") check();
|
|
240
|
+
};
|
|
241
|
+
const repair = () => {
|
|
242
|
+
check();
|
|
243
|
+
if (!settled) repairTimer = setTimeout(repair, process.platform === "win32" ? POLL_MS : 1e3);
|
|
244
|
+
};
|
|
245
|
+
const deadlineTimer = setTimeout(() => finish(null), REGISTER_WAIT_MS);
|
|
246
|
+
child.on("message", onMessage);
|
|
247
|
+
if (process.platform !== "win32") child.once("exit", onExit);
|
|
248
|
+
child.once("error", onExit);
|
|
249
|
+
child.once("disconnect", check);
|
|
250
|
+
signal?.addEventListener("abort", check);
|
|
251
|
+
check();
|
|
252
|
+
if (!settled) repairTimer = setTimeout(repair, process.platform === "win32" ? POLL_MS : 1e3);
|
|
253
|
+
});
|
|
219
254
|
}
|
|
220
|
-
async function launchOwnedBrowser({ url, config }, { root, note }) {
|
|
221
|
-
return withWorkspaceProcessLock(workspaceDir(root), "web", async () => {
|
|
255
|
+
async function launchOwnedBrowser({ url, config }, { root, note, signal }) {
|
|
256
|
+
return withWorkspaceProcessLock(workspaceDir(root), "web", async (claim) => {
|
|
257
|
+
throwIfCancelled(signal, "browser launch");
|
|
222
258
|
const live = liveWebRecord(readWebRecord(root));
|
|
223
259
|
if (live && sameLaunch(live, config)) {
|
|
224
260
|
const since = Date.now();
|
|
225
261
|
try {
|
|
226
|
-
await sendToOwnedPage(live, "Page.navigate", { url });
|
|
262
|
+
await sendToOwnedPage(live, "Page.navigate", { url }, signal);
|
|
227
263
|
updateWebRecord(root, live, { url });
|
|
228
264
|
note(chalk.dim(phaseLine("device", `reusing the owned Chrome (pid ${live.chromeProcess?.pid})`)));
|
|
229
265
|
return {
|
|
@@ -236,21 +272,53 @@ async function launchOwnedBrowser({ url, config }, { root, note }) {
|
|
|
236
272
|
reused: true
|
|
237
273
|
};
|
|
238
274
|
} catch (error) {
|
|
275
|
+
throwIfCancelled(signal, "browser launch");
|
|
239
276
|
note(chalk.dim(phaseLine("device", `restarting the owned Chrome: ${error.message}`)));
|
|
240
277
|
}
|
|
241
278
|
}
|
|
279
|
+
throwIfCancelled(signal, "browser launch");
|
|
242
280
|
const stopped = await teardownBrowserHeld(root);
|
|
243
281
|
if (stopped.status === "failed" || stopped.status === "skipped") return failure$1("STIM_WEB_BROWSER_HELD", `The previous owned Chrome could not be stopped: ${stopped.reason ?? "unknown reason"}.`, "Run `stim status` and `stim guide errors teardown`.");
|
|
282
|
+
throwIfCancelled(signal, "browser launch");
|
|
244
283
|
const port = await reserveBrowserPort(root);
|
|
245
284
|
const since = Date.now();
|
|
246
285
|
note(chalk.dim(phaseLine("device", `starting ${config.headless ? "headless " : ""}Chrome on DevTools port ${port}`)));
|
|
247
286
|
const launchId = randomUUID();
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
287
|
+
throwIfCancelled(signal, "browser launch");
|
|
288
|
+
(0, ownership_claim_exports.markClaimChildPending)(claim);
|
|
289
|
+
let child;
|
|
290
|
+
try {
|
|
291
|
+
child = startSupervisor(root, {
|
|
292
|
+
url,
|
|
293
|
+
port,
|
|
294
|
+
config,
|
|
295
|
+
launchId
|
|
296
|
+
});
|
|
297
|
+
} catch (error) {
|
|
298
|
+
(0, ownership_claim_exports.clearClaimChild)(claim);
|
|
299
|
+
throw error;
|
|
300
|
+
}
|
|
301
|
+
let record;
|
|
302
|
+
try {
|
|
303
|
+
const captured = child.pid === void 0 ? null : (0, process_identity_exports.captureProcessIdentity)(child.pid);
|
|
304
|
+
if (captured?.ok) try {
|
|
305
|
+
(0, ownership_claim_exports.setClaimChild)(claim, {
|
|
306
|
+
pid: child.pid,
|
|
307
|
+
processToken: captured.token
|
|
308
|
+
});
|
|
309
|
+
} catch {
|
|
310
|
+
throw new WorkspaceProcessCleanupError([claim], "The browser supervisor could not be recorded.", "Run `stim stop`.");
|
|
311
|
+
}
|
|
312
|
+
record = await waitForSupervisor(root, child, launchId, signal);
|
|
313
|
+
} finally {
|
|
314
|
+
if (child.connected) child.disconnect();
|
|
315
|
+
}
|
|
316
|
+
if (signal?.aborted) {
|
|
317
|
+
const cleanup = record ? await teardownBrowserHeld(root) : null;
|
|
318
|
+
if (!cleanup || cleanup.status === "failed" || cleanup.status === "skipped") throw new WorkspaceProcessCleanupError([claim], "The cancelled browser launch could not be stopped.", "Run `stim stop`.");
|
|
319
|
+
(0, ownership_claim_exports.clearClaimChild)(claim);
|
|
320
|
+
throwIfCancelled(signal, "browser launch");
|
|
321
|
+
}
|
|
254
322
|
if (!record) return failure$1("STIM_WEB_LAUNCH_FAILED", "The owned Chrome did not start.", `Read ${webSupervisorLogFile(root)} and \`stim logs --errors\`, then run \`stim web\` again.`);
|
|
255
323
|
return {
|
|
256
324
|
ok: true,
|
|
@@ -260,12 +328,86 @@ async function launchOwnedBrowser({ url, config }, { root, note }) {
|
|
|
260
328
|
};
|
|
261
329
|
}, {
|
|
262
330
|
external: true,
|
|
263
|
-
ownerPurpose: "stim web"
|
|
331
|
+
ownerPurpose: "stim web",
|
|
332
|
+
signal
|
|
264
333
|
});
|
|
265
334
|
}
|
|
266
335
|
//#endregion
|
|
267
336
|
//#region src/integrations/browser-web.ts
|
|
268
|
-
|
|
337
|
+
async function verifyLaunch(root, since, expectBundle, signal) {
|
|
338
|
+
signal?.throwIfAborted();
|
|
339
|
+
const startedAt = Date.now();
|
|
340
|
+
let stop;
|
|
341
|
+
let fileWatch;
|
|
342
|
+
let timer;
|
|
343
|
+
let queued;
|
|
344
|
+
let onAbort;
|
|
345
|
+
try {
|
|
346
|
+
return await new Promise((resolve, reject) => {
|
|
347
|
+
const schedule = () => {
|
|
348
|
+
queued ??= setImmediate(check);
|
|
349
|
+
};
|
|
350
|
+
const watchFile = () => {
|
|
351
|
+
try {
|
|
352
|
+
const file = webLogFile(root);
|
|
353
|
+
const stat = statSync(file);
|
|
354
|
+
if (fileWatch?.dev === stat.dev && fileWatch.ino === stat.ino) return;
|
|
355
|
+
fileWatch?.watcher.close();
|
|
356
|
+
fileWatch = void 0;
|
|
357
|
+
const watcher = watch(file, { persistent: false }, schedule);
|
|
358
|
+
fileWatch = {
|
|
359
|
+
watcher,
|
|
360
|
+
dev: stat.dev,
|
|
361
|
+
ino: stat.ino
|
|
362
|
+
};
|
|
363
|
+
const lost = () => {
|
|
364
|
+
if (fileWatch?.watcher === watcher) fileWatch = void 0;
|
|
365
|
+
watcher.close();
|
|
366
|
+
};
|
|
367
|
+
watcher.once("error", lost);
|
|
368
|
+
watcher.once("close", lost);
|
|
369
|
+
} catch {
|
|
370
|
+
fileWatch?.watcher.close();
|
|
371
|
+
fileWatch = void 0;
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
const check = () => {
|
|
375
|
+
clearImmediate(queued);
|
|
376
|
+
queued = void 0;
|
|
377
|
+
clearTimeout(timer);
|
|
378
|
+
try {
|
|
379
|
+
signal?.throwIfAborted();
|
|
380
|
+
watchFile();
|
|
381
|
+
const elapsedMs = Date.now() - startedAt;
|
|
382
|
+
const measured = webLaunchVerdict({
|
|
383
|
+
records: readNdjsonGenerations$1(webLogFile(root)),
|
|
384
|
+
metroRecords: expectBundle ? readMetroRecords(workspaceLogsDir$1(root)) : [],
|
|
385
|
+
since,
|
|
386
|
+
expectBundle,
|
|
387
|
+
elapsedMs
|
|
388
|
+
});
|
|
389
|
+
if (measured) resolve(measured);
|
|
390
|
+
else timer = setTimeout(check, Math.max(0, (elapsedMs < 2e4 ? VERIFY_WAIT_MS : LOADING_WAIT_MS) - elapsedMs));
|
|
391
|
+
} catch (error) {
|
|
392
|
+
reject(error);
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
stop = followLogs({
|
|
396
|
+
dir: workspaceLogsDir$1(root),
|
|
397
|
+
onRecord: schedule
|
|
398
|
+
});
|
|
399
|
+
onAbort = () => reject(cancelledError("wait"));
|
|
400
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
401
|
+
check();
|
|
402
|
+
});
|
|
403
|
+
} finally {
|
|
404
|
+
stop?.();
|
|
405
|
+
fileWatch?.watcher.close();
|
|
406
|
+
clearTimeout(timer);
|
|
407
|
+
clearImmediate(queued);
|
|
408
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
269
411
|
function failure(code, message, remedy) {
|
|
270
412
|
return {
|
|
271
413
|
ok: false,
|
|
@@ -277,13 +419,13 @@ function failure(code, message, remedy) {
|
|
|
277
419
|
};
|
|
278
420
|
}
|
|
279
421
|
function browserWebProject(root) {
|
|
280
|
-
return { runtime: ({ settings, headed, note }) => ({
|
|
422
|
+
return { runtime: ({ settings, headed, note, context }) => ({
|
|
281
423
|
async prepare() {
|
|
282
424
|
const web = webSettings(settings);
|
|
283
425
|
const usesMetro = web.url === null || web.url.includes("{port:metro}");
|
|
284
|
-
const pin = usesMetro ? metroPortSetting(settings) : null;
|
|
426
|
+
const pin = usesMetro ? metroPortSetting(settings, context?.env) : null;
|
|
285
427
|
if (pin?.error) return failure("STIM_BAD_ARG", pin.error, SETTING_SHAPE_REMEDY);
|
|
286
|
-
const chrome = findChrome();
|
|
428
|
+
const chrome = findChrome({ env: context?.env });
|
|
287
429
|
if (!chrome) return failure("STIM_WEB_NO_CHROME", "Google Chrome or Chromium is not installed.", CHROME_INSTALL_REMEDY);
|
|
288
430
|
if (web.url === null && !detectIsExpo(root)) return failure("STIM_WEB_NO_URL", "This is not an Expo app, so Stim does not know which page to open.", "Start your web dev server on a named port, then set the page: `stim settings set web.url 'http://localhost:{port:web}/' --scope workspace`. See `stim guide web`.");
|
|
289
431
|
if (web.url === null && !isPackageResolvable(root, "react-native-web")) return failure("STIM_WEB_DEPS_MISSING", "This Expo app cannot render on the web: react-native-web is not installed.", `Run \`${EXPO_WEB_DEPENDENCIES}\` and \`stim start\`, then run \`stim web\` again.`);
|
|
@@ -295,7 +437,7 @@ function browserWebProject(root) {
|
|
|
295
437
|
}
|
|
296
438
|
const metro = usesMetro && metroPort !== null ? await resolveProjectMetro(metroPort, root) : null;
|
|
297
439
|
const supervisor = resolveSupervisorTarget({
|
|
298
|
-
state: readWorkspaceState(root)?.supervisor,
|
|
440
|
+
state: readWorkspaceState$1(root)?.supervisor,
|
|
299
441
|
record: getProject(root)?.supervisor,
|
|
300
442
|
reservedPort: metroPort
|
|
301
443
|
});
|
|
@@ -336,19 +478,7 @@ function browserWebProject(root) {
|
|
|
336
478
|
},
|
|
337
479
|
launch: launchOwnedBrowser,
|
|
338
480
|
async verify({ url, verification: { template, expectBundle, serve, foreign } }, { since }) {
|
|
339
|
-
const
|
|
340
|
-
let measured;
|
|
341
|
-
for (;;) {
|
|
342
|
-
measured = webLaunchVerdict({
|
|
343
|
-
records: readNdjsonGenerations(webLogFile(root)),
|
|
344
|
-
metroRecords: expectBundle ? readMetroRecords(workspaceLogsDir(root)) : [],
|
|
345
|
-
since,
|
|
346
|
-
expectBundle,
|
|
347
|
-
elapsedMs: Date.now() - startedAt
|
|
348
|
-
});
|
|
349
|
-
if (measured) break;
|
|
350
|
-
await cancellableSleep(POLL_MS);
|
|
351
|
-
}
|
|
481
|
+
const measured = await verifyLaunch(root, since, expectBundle, context?.signal);
|
|
352
482
|
const verdict = foreign ? {
|
|
353
483
|
launched: "unverified",
|
|
354
484
|
kind: "no-response",
|