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
package/dist/supervisor-run.mjs
CHANGED
|
@@ -1,25 +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 {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { g as process_identity_exports, i as withWorkspaceProcessLock } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { g as workspaceStateFile$1, m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
|
|
3
|
+
import { G as projectDeviceSlots, T as setSupervisor, U as parseDeviceSlotKey, o as clearSupervisor, p as getProject } from "./config-DlrsduwG.mjs";
|
|
4
|
+
import { c as withWorkspaceStateLock, d as writeWorkspaceState, n as clearWorkspaceStateKeys, o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-U08dEzhG.mjs";
|
|
5
|
+
import { X as runnableMetroCommand, q as resolveProjectSettings } from "./settings-C7O8A6ZI.mjs";
|
|
6
|
+
import { D as clearExpoMetroTunnel, E as MODE_EXPO, N as readPidFile, R as writePidFile, T as MODE_COMMAND, d as nativeProjectIntegration, j as clearWorkspaceSupervisor, v as detectIsExpo, w as MODE_BARE } from "./project-wM_XFTvE.mjs";
|
|
7
|
+
import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
|
|
8
|
+
import { d as parseWatchRoots, l as parseSubscriberNames, m as runWatchman, u as parseTriggerCount } from "./eas-session-ledger-DlY_serQ.mjs";
|
|
9
|
+
import { A as workspaceBuildInProgress, _ as devServerStopRecord, g as devServerStopLevel, m as describeDevServerStop, x as vanishedSupervisorMessage } from "./budget-Cvwn54qV.mjs";
|
|
10
|
+
import { f as withIdleWorkspace } from "./workspaces-CpANmBlq.mjs";
|
|
11
|
+
import { S as parseLease, _ as workspaceDeviceLastUseAt, b as leaseIsExpired, r as createActivityReader, v as deviceLeasePath, w as parseWorkspaceLeases } from "./activity-CMLmzp7o.mjs";
|
|
12
|
+
import { W as ownedAvdSerialResolver } from "./android-C7sVmyI9.mjs";
|
|
13
|
+
import { t as describeError } from "./errors-ccaPc4ox.mjs";
|
|
14
|
+
import { f as probeHostedSession } from "./hosted-client-DZAPrcro.mjs";
|
|
15
|
+
import { o as watchWorkspaceState, t as clearHostedMetro } from "./metro-gateway-CKZqKqx7.mjs";
|
|
16
|
+
import { t as relaunchWithLogFile } from "./detached-entry-BwNEtIrP.mjs";
|
|
17
|
+
import { n as dueIdleDevices, r as shutDownIdleDevices } from "./idle-shutdown-DDg3SdvY.mjs";
|
|
18
|
+
import { t as triggerMaintenance } from "./trigger-Cbyc41d_.mjs";
|
|
18
19
|
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
19
20
|
import { dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
21
|
+
import { LOG_ROTATE_BYTES, createMetroGateway } from "@stim-cli/core";
|
|
20
22
|
import { DEV_SERVER_STOP_REQUEST_KEY, HOSTED_METRO_GATEWAYS_KEY, HOSTED_METRO_REQUESTS_KEY, IDLE_STOP_KEY, hostedAndroidPlacements, hostedIosPlacements, hostedMetroGateways, hostedMetroRequests, hostedNativeRecords, parseHostedNativePlacement, readDevServerStopRequest } from "@stim-cli/core/state";
|
|
21
23
|
import { fileURLToPath } from "node:url";
|
|
22
|
-
import { LOG_ROTATE_BYTES, createMetroGateway } from "@stim-cli/core";
|
|
23
24
|
//#region src/supervisor/hosted-metro.ts
|
|
24
25
|
function reconcileHostedMetro(requests, active) {
|
|
25
26
|
const same = (session) => JSON.stringify(requests[session]) === JSON.stringify(active[session]);
|
|
@@ -35,8 +36,10 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
35
36
|
let running = Promise.resolve();
|
|
36
37
|
let probingAt = 0;
|
|
37
38
|
let probing = false;
|
|
39
|
+
let probeTimer;
|
|
38
40
|
let stamp = "";
|
|
39
41
|
let cached = null;
|
|
42
|
+
let queued = false;
|
|
40
43
|
updateWorkspaceState(root, (state) => state.supervisor?.processToken === processToken ? {
|
|
41
44
|
...state,
|
|
42
45
|
supervisor: {
|
|
@@ -45,7 +48,7 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
45
48
|
}
|
|
46
49
|
} : state);
|
|
47
50
|
const readState = () => {
|
|
48
|
-
const file = statSync(workspaceStateFile(root));
|
|
51
|
+
const file = statSync(workspaceStateFile$1(root));
|
|
49
52
|
const next = `${file.ino}:${file.mtimeMs}:${file.ctimeMs}:${file.size}`;
|
|
50
53
|
if (next !== stamp) {
|
|
51
54
|
cached = readWorkspaceState$1(root);
|
|
@@ -65,6 +68,7 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
65
68
|
});
|
|
66
69
|
const reconcile = async () => {
|
|
67
70
|
if (closed) return;
|
|
71
|
+
observer.refresh();
|
|
68
72
|
const state = readState();
|
|
69
73
|
if (state?.supervisor?.processToken !== processToken) return;
|
|
70
74
|
const placements = [...Object.values(hostedIosPlacements(state)), ...Object.values(hostedAndroidPlacements(state)).map((placement) => Object.assign({ platform: "android" }, placement))];
|
|
@@ -121,23 +125,36 @@ function watchHostedMetro(root, metroPort, processToken) {
|
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
if (!probing && Date.now() >= probingAt) {
|
|
128
|
+
clearTimeout(probeTimer);
|
|
124
129
|
probingAt = Date.now() + 1e4;
|
|
125
130
|
probing = true;
|
|
126
131
|
Promise.all(placements.map(async (placement) => {
|
|
127
132
|
if ((await probeHostedSession(placement)).state === "stopped" && !closed) clearHostedMetro(root, placement.session);
|
|
128
133
|
})).catch(() => {}).finally(() => {
|
|
129
134
|
probing = false;
|
|
135
|
+
if (!closed) {
|
|
136
|
+
probeTimer = setTimeout(tick, Math.max(0, probingAt - Date.now()));
|
|
137
|
+
probeTimer.unref();
|
|
138
|
+
}
|
|
130
139
|
});
|
|
131
140
|
}
|
|
132
141
|
};
|
|
133
142
|
const tick = () => {
|
|
134
|
-
|
|
143
|
+
if (closed || queued) return;
|
|
144
|
+
queued = true;
|
|
145
|
+
running = running.then(() => {
|
|
146
|
+
queued = false;
|
|
147
|
+
return reconcile();
|
|
148
|
+
}).catch(() => {});
|
|
135
149
|
};
|
|
136
|
-
const
|
|
150
|
+
const observer = watchWorkspaceState(root, tick);
|
|
151
|
+
const timer = setInterval(tick, 1e4);
|
|
137
152
|
timer.unref();
|
|
138
153
|
tick();
|
|
139
154
|
return async () => {
|
|
140
155
|
closed = true;
|
|
156
|
+
observer.close();
|
|
157
|
+
clearTimeout(probeTimer);
|
|
141
158
|
clearInterval(timer);
|
|
142
159
|
await running;
|
|
143
160
|
await Promise.all([...bridges.values()].map((bridge) => bridge.close()));
|
|
@@ -409,6 +426,7 @@ function trackMetroWatchRoots({ workspaceRoot, writer, watchman = runWatchman, p
|
|
|
409
426
|
}
|
|
410
427
|
//#endregion
|
|
411
428
|
//#region src/supervisor/run.ts
|
|
429
|
+
const MAINTENANCE_TRIGGER_MS = 6e4;
|
|
412
430
|
const USAGE = "Usage: run.js --root <path> --port <n> [--tunnel] [--reset-cache] [--idle-stop-minutes <n>] [--device-idle-minutes <n>]";
|
|
413
431
|
function parseArgs(argv) {
|
|
414
432
|
let root;
|
|
@@ -518,6 +536,11 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
518
536
|
let stopWatchingIdle = null;
|
|
519
537
|
let stopWatchingDevices = null;
|
|
520
538
|
let closeHostedMetro = null;
|
|
539
|
+
const maintenanceTimer = setInterval(() => triggerMaintenance("supervisor", {
|
|
540
|
+
argv: [],
|
|
541
|
+
warn: false
|
|
542
|
+
}), MAINTENANCE_TRIGGER_MS);
|
|
543
|
+
maintenanceTimer.unref?.();
|
|
521
544
|
const stopCause = (trigger) => {
|
|
522
545
|
const request = readDevServerStopRequest(readWorkspaceState$1(root));
|
|
523
546
|
return devServerStopRecord(trigger, request?.processToken === processToken ? request : null, new Date(now()).toISOString());
|
|
@@ -525,6 +548,7 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
525
548
|
const finish = (code, event, level, msg, stop) => {
|
|
526
549
|
stopWatchingIdle?.();
|
|
527
550
|
stopWatchingDevices?.();
|
|
551
|
+
clearInterval(maintenanceTimer);
|
|
528
552
|
writer.write({
|
|
529
553
|
src: "metro",
|
|
530
554
|
level,
|
|
@@ -559,9 +583,7 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
559
583
|
const shutdown = async (code, event, msg, stop) => {
|
|
560
584
|
if (stopping || !server) return;
|
|
561
585
|
stopping = true;
|
|
562
|
-
|
|
563
|
-
stopWatchingDevices?.();
|
|
564
|
-
await closeHostedMetro?.();
|
|
586
|
+
maintenanceTimer.ref();
|
|
565
587
|
await watchRoots.beforeClose();
|
|
566
588
|
try {
|
|
567
589
|
await server.close();
|
|
@@ -572,7 +594,13 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
572
594
|
event: "server_close_failed",
|
|
573
595
|
msg: describeError(err)
|
|
574
596
|
});
|
|
597
|
+
stopping = false;
|
|
598
|
+
return;
|
|
575
599
|
}
|
|
600
|
+
await closeHostedMetro?.();
|
|
601
|
+
stopWatchingIdle?.();
|
|
602
|
+
stopWatchingDevices?.();
|
|
603
|
+
clearInterval(maintenanceTimer);
|
|
576
604
|
await watchRoots.afterClose();
|
|
577
605
|
finish(code, event, stop ? devServerStopLevel(stop) : code === 0 ? "info" : "error", msg, stop);
|
|
578
606
|
};
|
|
@@ -601,7 +629,7 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
601
629
|
try {
|
|
602
630
|
let start;
|
|
603
631
|
if (command) {
|
|
604
|
-
const startServer = startCommand ?? (await import("./server-command-
|
|
632
|
+
const startServer = startCommand ?? (await import("./server-command-C6QjeupS.mjs")).startCommandServer;
|
|
605
633
|
start = (opts) => startServer({
|
|
606
634
|
...opts,
|
|
607
635
|
command
|
|
@@ -677,8 +705,8 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
677
705
|
hasDue: () => deviceIdle.due(root, deviceIdleMs).length > 0,
|
|
678
706
|
onDue: async () => {
|
|
679
707
|
try {
|
|
680
|
-
await withIdleWorkspace(root, () => {
|
|
681
|
-
if (!stopping) shutDownIdleDevices(deviceIdleMs);
|
|
708
|
+
await withIdleWorkspace(root, async () => {
|
|
709
|
+
if (!stopping) await shutDownIdleDevices(deviceIdleMs);
|
|
682
710
|
}, {
|
|
683
711
|
purpose: "device idle shutdown",
|
|
684
712
|
supervisor: false,
|
|
@@ -699,7 +727,7 @@ async function runSupervisor({ root, port, tunnel = false, resetCache = false, i
|
|
|
699
727
|
const idleMinutes = idleMinutesNow();
|
|
700
728
|
if (stopping || idleMinutes === null) return;
|
|
701
729
|
if (deviceIdleMinutes > 0) try {
|
|
702
|
-
shutDownIdleDevices(Math.min(deviceIdleMs, idleStopMinutes * 6e4));
|
|
730
|
+
await shutDownIdleDevices(Math.min(deviceIdleMs, idleStopMinutes * 6e4));
|
|
703
731
|
} catch (err) {
|
|
704
732
|
stderr(`Stim supervisor: could not shut down idle devices: ${describeError(err)}`);
|
|
705
733
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as IosDeviceMismatchError } from "./device-ios-
|
|
1
|
+
import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
|
|
2
|
+
import { h as shortUdid, l as phaseLine } from "./command-output-gwpm28fu.mjs";
|
|
3
|
+
import { a as SETTING_SHAPE_REMEDY, b as iosProjectDirSettingError, et as settingShapeErrors, it as unknownSettingKeys, p as cacheProviderSettingError, y as iosProjectDirSetting } from "./settings-C7O8A6ZI.mjs";
|
|
4
|
+
import { j as parseIosSimulatorApp } from "./ios-hcBpnEGk.mjs";
|
|
5
|
+
import { p as resolveOptimizations } from "./errors-ccaPc4ox.mjs";
|
|
6
|
+
import { y as describeDiagnostic } from "./xcode-BXn9-xYx.mjs";
|
|
7
|
+
import { s as resolveBuildPlacement } from "./selection-DSMbWEX2.mjs";
|
|
8
|
+
import { l as parseDeviceWait } from "./device-lease-run-xJPQ_QQG.mjs";
|
|
9
|
+
import { f as unknownIosDeviceTypeRefusal, p as unknownIosRuntimeRefusal, s as layerNote, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-DK5_EwRS.mjs";
|
|
10
|
+
import { t as IosDeviceMismatchError } from "./device-ios-DoB6KFCO.mjs";
|
|
11
11
|
import { basename, join } from "node:path";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
function buildLogFile(root) {
|
|
@@ -18,7 +18,7 @@ function iosProjectPathError(settings, root, isExpo) {
|
|
|
18
18
|
if (error || !iosProjectDirSetting(settings, root).custom || !isExpo()) return error;
|
|
19
19
|
return "ios.projectPath applies to bare React Native apps only: expo prebuild generates and builds ios/. Remove it for this Expo app.";
|
|
20
20
|
}
|
|
21
|
-
function resolveIosBuildSetup(remoteBuild, settings, warn) {
|
|
21
|
+
function resolveIosBuildSetup(remoteBuild, settings, warn, env) {
|
|
22
22
|
const [shapeError, ...lines] = settingShapeErrors(settings);
|
|
23
23
|
if (shapeError) return {
|
|
24
24
|
ok: false,
|
|
@@ -39,7 +39,7 @@ function resolveIosBuildSetup(remoteBuild, settings, warn) {
|
|
|
39
39
|
};
|
|
40
40
|
let optimizations;
|
|
41
41
|
try {
|
|
42
|
-
optimizations = resolveOptimizations(settings);
|
|
42
|
+
optimizations = resolveOptimizations(settings, env);
|
|
43
43
|
} catch (error) {
|
|
44
44
|
return {
|
|
45
45
|
ok: false,
|
|
@@ -115,7 +115,7 @@ function resolveSimulatorAppFlag(flag, physical, remoteBackend, automatic = fals
|
|
|
115
115
|
} };
|
|
116
116
|
return { simulatorApp };
|
|
117
117
|
}
|
|
118
|
-
function deviceModelRefusal({ slot, deviceTypeFlag, runtimeFlag, deviceType, runtime, deviceTypeOrigin = null, runtimeOrigin = null, physical, remoteBackend, hosted = false, listRuntimes }) {
|
|
118
|
+
async function deviceModelRefusal({ slot, deviceTypeFlag, runtimeFlag, deviceType, runtime, deviceTypeOrigin = null, runtimeOrigin = null, physical, remoteBackend, hosted = false, listRuntimes, signal }) {
|
|
119
119
|
if (slot && slot !== "default" && remoteBackend) return {
|
|
120
120
|
code: "STIM_BAD_ARG",
|
|
121
121
|
message: "Named slots currently support local simulators and physical devices.",
|
|
@@ -145,7 +145,7 @@ function deviceModelRefusal({ slot, deviceTypeFlag, runtimeFlag, deviceType, run
|
|
|
145
145
|
if (!deviceType && !runtime) return null;
|
|
146
146
|
let runtimes;
|
|
147
147
|
try {
|
|
148
|
-
runtimes = listRuntimes();
|
|
148
|
+
runtimes = await listRuntimes({ signal });
|
|
149
149
|
} catch (error) {
|
|
150
150
|
return {
|
|
151
151
|
code: "STIM_NO_DEVICE",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { l as
|
|
5
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { a as killOnAbort } from "./operation-exec-BW0em61G.mjs";
|
|
3
|
+
import { kn as pickDevClientScheme } from "./budget-Cvwn54qV.mjs";
|
|
4
|
+
import { C as emulatorDiskSpaceRemedy, E as findBuildTool, Q as profileNeedsFoldFeature, R as memoizeEmulatorProbe, T as extractEmulatorFailure, X as pickDefaultSystemImage, c as androidPoolNoCandidatesRefusal, k as hostSystemImageArch, l as androidSystemImageAbi, o as androidHome, s as androidPoolCandidates, w as emulatorFailureRemedy } from "./android-C7sVmyI9.mjs";
|
|
5
|
+
import { d as unknownAndroidSystemImageRefusal, s as layerNote, u as unknownAndroidDeviceProfileRefusal } from "./device-capacity-DK5_EwRS.mjs";
|
|
6
|
+
import { t as devClientScheme } from "./dev-client-BSDR5h3F.mjs";
|
|
6
7
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
7
8
|
import { relative } from "node:path";
|
|
8
9
|
//#region src/commands/android/support.ts
|
|
@@ -73,7 +74,7 @@ function resolveDeviceProfile(flag, settings) {
|
|
|
73
74
|
const raw = android && typeof android === "object" && !Array.isArray(android) ? android["deviceProfile"] : void 0;
|
|
74
75
|
return fromFlag || (typeof raw === "string" && raw.trim() !== "" ? raw.trim() : null);
|
|
75
76
|
}
|
|
76
|
-
function deviceProfileRefusal({ flag, resolved, origin = null, physical, remoteBackend, listProfiles }) {
|
|
77
|
+
async function deviceProfileRefusal({ flag, resolved, origin = null, physical, remoteBackend, listProfiles, signal }) {
|
|
77
78
|
if (typeof flag === "string" && flag.trim() === "") return {
|
|
78
79
|
code: "STIM_BAD_ARG",
|
|
79
80
|
message: "--device-profile was given an empty id.",
|
|
@@ -82,7 +83,7 @@ function deviceProfileRefusal({ flag, resolved, origin = null, physical, remoteB
|
|
|
82
83
|
if (physical || remoteBackend || !resolved) return null;
|
|
83
84
|
let profiles;
|
|
84
85
|
try {
|
|
85
|
-
profiles = listProfiles();
|
|
86
|
+
profiles = await listProfiles({ signal });
|
|
86
87
|
} catch (error) {
|
|
87
88
|
return {
|
|
88
89
|
code: NO_DEVICE,
|
|
@@ -133,9 +134,10 @@ function findAapt(home = androidHome(), { readDir = readdirSync, exists = exists
|
|
|
133
134
|
version: found.version
|
|
134
135
|
} : null;
|
|
135
136
|
}
|
|
136
|
-
function dumpApkManifest(apkPath, { exec = null, aapt = null } = {}) {
|
|
137
|
+
async function dumpApkManifest(apkPath, { exec = null, aapt = null, context } = {}) {
|
|
137
138
|
if (typeof apkPath !== "string" || apkPath.trim() === "") return null;
|
|
138
|
-
|
|
139
|
+
context?.signal.throwIfAborted();
|
|
140
|
+
const tool = aapt || findAapt(androidHome(context?.env));
|
|
139
141
|
if (!tool) return null;
|
|
140
142
|
const e = exec || getExecutor();
|
|
141
143
|
const args = tool.tool === "aapt2" ? [
|
|
@@ -151,7 +153,11 @@ function dumpApkManifest(apkPath, { exec = null, aapt = null } = {}) {
|
|
|
151
153
|
"AndroidManifest.xml"
|
|
152
154
|
];
|
|
153
155
|
try {
|
|
154
|
-
const out = e.
|
|
156
|
+
const out = await e.runFileAsync(tool.path, args, {
|
|
157
|
+
timeoutMs: 3e4,
|
|
158
|
+
declareFor: context,
|
|
159
|
+
onSpawn: killOnAbort(context?.signal)
|
|
160
|
+
});
|
|
155
161
|
return typeof out === "string" && out.includes("E: manifest") ? out : null;
|
|
156
162
|
} catch {
|
|
157
163
|
return null;
|
|
@@ -221,10 +227,11 @@ function apkDevClientFacts(text) {
|
|
|
221
227
|
});
|
|
222
228
|
return facts;
|
|
223
229
|
}
|
|
224
|
-
function androidDevClientScheme(root, apkPath, { exec = null, dump = dumpApkManifest, aapt = null } = {}) {
|
|
225
|
-
const text = dump(apkPath, {
|
|
230
|
+
async function androidDevClientScheme(root, apkPath, { exec = null, dump = dumpApkManifest, aapt = null, context } = {}) {
|
|
231
|
+
const text = await dump(apkPath, {
|
|
226
232
|
exec,
|
|
227
|
-
aapt
|
|
233
|
+
aapt,
|
|
234
|
+
context
|
|
228
235
|
});
|
|
229
236
|
if (text) {
|
|
230
237
|
const facts = apkDevClientFacts(text);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { t as getExecutor } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { s as gitAsync } from "./operation-exec-BW0em61G.mjs";
|
|
3
|
+
import { n as buildCacheKey } from "./build-cache-Dv7RN200.mjs";
|
|
4
|
+
import { n as fingerprintNativeInputs, r as manifestDigest } from "./native-inputs-TRTTTRxt.mjs";
|
|
5
|
+
import { a as sourceManifest, r as nativeFileDigest } from "./native-source-Y0yLhFyQ.mjs";
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
8
|
+
import { isJsonObject } from "@stim-cli/core/state";
|
|
9
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
10
|
+
//#region src/integrations/swiftpm-artifact-inputs.ts
|
|
11
|
+
const SWIFTPM_CACHE_LIMIT = "SwiftPM artifact caching requires macos.artifactInputs with complete: true and a complete declaration of pinned, repeatable inputs producing a relocatable app.";
|
|
12
|
+
async function readSwiftpmArtifactToolchain(context, signal, cwd) {
|
|
13
|
+
const run = (file, args) => getExecutor().runFileAsync(file, args, {
|
|
14
|
+
cwd,
|
|
15
|
+
timeoutMs: 3e4,
|
|
16
|
+
signal,
|
|
17
|
+
declareFor: context
|
|
18
|
+
});
|
|
19
|
+
const swift = await run("swift", ["--version"]);
|
|
20
|
+
const sdkPath = context.env.SDKROOT ?? context.env.SWIFTPM_SDKROOT_macosx;
|
|
21
|
+
return {
|
|
22
|
+
swift,
|
|
23
|
+
sdk: await run("xcrun", [
|
|
24
|
+
"--sdk",
|
|
25
|
+
sdkPath === void 0 ? "macosx" : await realpath(sdkPath),
|
|
26
|
+
"--show-sdk-build-version"
|
|
27
|
+
]),
|
|
28
|
+
xcode: await run("xcodebuild", ["-version"]),
|
|
29
|
+
arch: process.arch
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function repositoryPath(value) {
|
|
33
|
+
return typeof value === "string" && value.length > 0 && !value.includes("\\") && !value.includes(":") && !value.includes("\0") && !value.split("/").some((part) => !part || part === "." || part === ".." || part.toLowerCase() === ".git");
|
|
34
|
+
}
|
|
35
|
+
function swiftpmArtifactInputs(value) {
|
|
36
|
+
if (!isJsonObject(value) || value.complete !== true) throw new Error(SWIFTPM_CACHE_LIMIT);
|
|
37
|
+
const record = value;
|
|
38
|
+
if (Object.keys(record).some((key) => ![
|
|
39
|
+
"complete",
|
|
40
|
+
"ignored",
|
|
41
|
+
"outputs",
|
|
42
|
+
"localFiles",
|
|
43
|
+
"environment"
|
|
44
|
+
].includes(key))) throw new Error(SWIFTPM_CACHE_LIMIT);
|
|
45
|
+
const strings = (name, valid) => {
|
|
46
|
+
const values = record[name] ?? [];
|
|
47
|
+
if (!Array.isArray(values) || !values.every(valid)) throw new Error(SWIFTPM_CACHE_LIMIT);
|
|
48
|
+
return [...new Set(values)].toSorted();
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
complete: true,
|
|
52
|
+
ignored: strings("ignored", repositoryPath),
|
|
53
|
+
outputs: strings("outputs", repositoryPath),
|
|
54
|
+
localFiles: strings("localFiles", (path) => typeof path === "string" && !!path && !path.includes("\0")),
|
|
55
|
+
environment: strings("environment", (name) => typeof name === "string" && /^[A-Za-z_][A-Za-z0-9_]*$/.test(name))
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async function regularInput(repository, path, signal) {
|
|
59
|
+
const parts = path.split("/");
|
|
60
|
+
for (let index = 1; index <= parts.length; index++) {
|
|
61
|
+
signal?.throwIfAborted();
|
|
62
|
+
const entry = await lstat(join(repository, ...parts.slice(0, index)));
|
|
63
|
+
if (entry.isSymbolicLink()) throw new Error(`SwiftPM cache input ${path} contains a symbolic link.`);
|
|
64
|
+
if (index === parts.length ? !entry.isFile() : !entry.isDirectory()) throw new Error(`SwiftPM cache input ${path} must be an exact regular file with real directory parents.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const below = (path, directory) => path === directory || path.startsWith(`${directory}/`);
|
|
68
|
+
async function swiftpmArtifactSnapshot(root, value, build, toolchain, env, signal) {
|
|
69
|
+
signal?.throwIfAborted();
|
|
70
|
+
const declaration = swiftpmArtifactInputs(value);
|
|
71
|
+
const repository = await realpath(await gitAsync(root, ["rev-parse", "--show-toplevel"], { signal }));
|
|
72
|
+
const project = relative(repository, await realpath(root)).split(sep).join("/");
|
|
73
|
+
if (project && !repositoryPath(project)) throw new Error("The SwiftPM project leaves its repository.");
|
|
74
|
+
if (Object.values(toolchain).some((version) => !version.trim())) throw new Error("The SwiftPM toolchain identity is unavailable.");
|
|
75
|
+
const files = new Map((await sourceManifest(repository, true, signal)).map((file) => [file.path, file]));
|
|
76
|
+
for (const path of declaration.ignored) {
|
|
77
|
+
await regularInput(repository, path, signal);
|
|
78
|
+
const info = await lstat(join(repository, path));
|
|
79
|
+
files.set(path, {
|
|
80
|
+
path,
|
|
81
|
+
kind: info.mode & 73 ? "exec" : "file",
|
|
82
|
+
...await nativeFileDigest(join(repository, path), signal)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
for (const file of files.values()) {
|
|
86
|
+
if (!repositoryPath(file.path)) throw new Error("SwiftPM cache inputs must be repository-relative.");
|
|
87
|
+
await regularInput(repository, file.path, signal);
|
|
88
|
+
if (declaration.outputs.some((output) => below(file.path, output) || below(output, file.path))) throw new Error(`SwiftPM source ${file.path} overlaps a declared generated output; ignore generated outputs in Git.`);
|
|
89
|
+
}
|
|
90
|
+
const bundled = [
|
|
91
|
+
{
|
|
92
|
+
name: "info-plist",
|
|
93
|
+
path: resolve(root, build.infoPlist)
|
|
94
|
+
},
|
|
95
|
+
...Object.entries(build.resources).map(([destination, source]) => ({
|
|
96
|
+
name: `resource/${destination}`,
|
|
97
|
+
path: resolve(root, source)
|
|
98
|
+
})),
|
|
99
|
+
...build.assetCatalog ? [{
|
|
100
|
+
name: "asset-catalog",
|
|
101
|
+
path: resolve(root, build.assetCatalog)
|
|
102
|
+
}] : []
|
|
103
|
+
];
|
|
104
|
+
for (const input of bundled) if (!repositoryPath(relative(repository, await realpath(input.path)).split(sep).join("/"))) throw new Error("SwiftPM bundle inputs must stay inside the repository.");
|
|
105
|
+
for (const path of declaration.localFiles) {
|
|
106
|
+
const info = await lstat(resolve(root, path)).catch((error) => {
|
|
107
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return null;
|
|
108
|
+
throw error;
|
|
109
|
+
});
|
|
110
|
+
if (info && !info.isFile()) throw new Error("macos.artifactInputs.localFiles must name exact regular files.");
|
|
111
|
+
}
|
|
112
|
+
const local = await fingerprintNativeInputs([
|
|
113
|
+
...bundled,
|
|
114
|
+
{
|
|
115
|
+
name: "package-resolved",
|
|
116
|
+
path: join(root, "Package.resolved"),
|
|
117
|
+
optional: true
|
|
118
|
+
},
|
|
119
|
+
...declaration.localFiles.map((path, index) => ({
|
|
120
|
+
name: `local/${index}`,
|
|
121
|
+
path: resolve(root, path),
|
|
122
|
+
optional: true
|
|
123
|
+
}))
|
|
124
|
+
], {
|
|
125
|
+
parameters: Object.fromEntries([.../* @__PURE__ */ new Set([
|
|
126
|
+
...declaration.environment,
|
|
127
|
+
"DEVELOPER_DIR",
|
|
128
|
+
"TOOLCHAINS",
|
|
129
|
+
"SDKROOT",
|
|
130
|
+
"SWIFT_EXEC",
|
|
131
|
+
"MACOSX_DEPLOYMENT_TARGET"
|
|
132
|
+
])].toSorted().map((name) => [name, env[name] ?? null])),
|
|
133
|
+
signal
|
|
134
|
+
});
|
|
135
|
+
const hash = createHash("sha256").update("stim-swiftpm-artifact-v1\0").update(JSON.stringify({
|
|
136
|
+
project,
|
|
137
|
+
source: manifestDigest([...files.values()]),
|
|
138
|
+
local: local.hash,
|
|
139
|
+
declaration,
|
|
140
|
+
build: {
|
|
141
|
+
...build,
|
|
142
|
+
resources: Object.fromEntries(Object.entries(build.resources).toSorted(([a], [b]) => a.localeCompare(b)))
|
|
143
|
+
},
|
|
144
|
+
toolchain
|
|
145
|
+
})).digest("hex");
|
|
146
|
+
signal?.throwIfAborted();
|
|
147
|
+
return {
|
|
148
|
+
hash,
|
|
149
|
+
key: buildCacheKey("macos", hash, { configuration: "debug" })
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { swiftpmArtifactInputs as n, swiftpmArtifactSnapshot as r, readSwiftpmArtifactToolchain as t };
|