stim 1.24.0 → 1.25.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/dist/{acquire-artifact-CEs02U2o.mjs → acquire-artifact-zA4S7RHE.mjs} +1 -1
- package/dist/{act-Cyvm8xYc.mjs → act-BbHS3oV8.mjs} +12 -12
- package/dist/{activity-Dq3ZcdD8.mjs → activity-BpjwrQXU.mjs} +3 -3
- package/dist/{agent-device-usage-output-CccomeE0.mjs → agent-device-usage-output-Bnkerfod.mjs} +3 -3
- package/dist/{android-BZppyPe_.mjs → android-BGwuK3Mc.mjs} +41 -36
- package/dist/{android-DcztblCT.mjs → android-CNZgRC-4.mjs} +5 -5
- package/dist/{android-882m4hxX.mjs → android-Cjcj8MCw.mjs} +2 -2
- package/dist/{android-cas-BtCOrNqb.mjs → android-cas-BVqh2Zep.mjs} +1 -1
- package/dist/{android-project-DVWyCbWU.d.mts → android-project-CTYaETc0.d.mts} +6 -2
- package/dist/{android-CX5IcRuf.mjs → android-saBeB4lr.mjs} +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +22 -22
- package/dist/{artifact-BR5VNArK.mjs → artifact-Co8zixVx.mjs} +14 -13
- package/dist/{artifact-Bdt_n9Jc.mjs → artifact-DN8JNwqS.mjs} +13 -13
- package/dist/{browser-web-ycg9qWB8.mjs → browser-web-CCgZsHmI.mjs} +10 -10
- package/dist/{budget-dPGuhNai.mjs → budget-HyShrIpL.mjs} +62 -21
- package/dist/{build-CaF574eS.mjs → build-CAiw8Ezm.mjs} +22 -21
- package/dist/{build-cache-HFUQ9eLz.mjs → build-cache-CKCzxzxA.mjs} +22 -4
- package/dist/{build-plan-JsDUq4w1.mjs → build-plan-zCuHGlA8.mjs} +5 -5
- package/dist/{ccache-CCn1S6qG.mjs → ccache-h1FKhZeg.mjs} +3 -3
- package/dist/{cli-xqAidP7O.mjs → cli-C4w607Pz.mjs} +17 -17
- package/dist/cli.mjs +1 -1
- package/dist/{client-18-ZowoT.mjs → client-BQsmyp_-.mjs} +26 -17
- package/dist/collector-run.mjs +2 -2
- package/dist/{command-output-DxC0k2rk.mjs → command-output-BBvS1H6v.mjs} +1 -1
- package/dist/{dependency-state-C56ll9hY.mjs → dependency-state-BwNCYG5Q.mjs} +1 -1
- package/dist/{dev-client-w_fok0Ek.mjs → dev-client-CHoXXZeg.mjs} +2 -2
- package/dist/{device-BktRGdjS.mjs → device-B9FqTBYW.mjs} +64 -33
- package/dist/{device-4RUugw5X.mjs → device-F5-4z9ef.mjs} +13 -13
- package/dist/{device-capacity-Ic-kdmEV.mjs → device-capacity-ZYaRALv5.mjs} +7 -7
- package/dist/device-host-worker.mjs +10 -10
- package/dist/{device-ios-DzpSlZyd.mjs → device-ios-DkHBrmvH.mjs} +27 -16
- package/dist/{device-lease-run-DUtkbqBQ.mjs → device-lease-run-ogEeJ62K.mjs} +4 -4
- package/dist/{device-pool-CgBHk401.mjs → device-pool-BIg8MU8l.mjs} +2 -2
- package/dist/{doctor-BZ6oxNum.mjs → doctor-A_Nr_fDe.mjs} +1 -1
- package/dist/{doctor-C33AzVfR.mjs → doctor-Bm8TVpGn.mjs} +27 -21
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-DZgpqR6J.mjs → doctor-k3P3PizH.mjs} +12 -12
- package/dist/{doctor-watchman-B453A231.mjs → doctor-watchman-BovI1y3-.mjs} +3 -3
- package/dist/{eas-build-CxKUNHsb.mjs → eas-build-CyDKNTBP.mjs} +2 -2
- package/dist/{eas-fallback-LMxk9Kw0.mjs → eas-fallback-gaZi-dJL.mjs} +12 -11
- package/dist/{eas-session-ledger-Ck6YXPAO.mjs → eas-session-ledger-BMCA1gdO.mjs} +3 -3
- package/dist/{error-diagnostics-BkKCZq4P.mjs → error-diagnostics-B1Mj_-7h.mjs} +7 -7
- package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
- package/dist/{gc-yVKpAOKM.mjs → gc-B9jcnmIk.mjs} +15 -15
- package/dist/{gc-DDWEAj0w.mjs → gc-eaz403W6.mjs} +2 -2
- package/dist/{guide-Bggftwc5.mjs → guide-DR0K0xW9.mjs} +113 -37
- package/dist/{hosted-android-D4dweBof.mjs → hosted-android-Bvb2-ZxD.mjs} +3 -3
- package/dist/{hosted-client-BBTVe3X6.mjs → hosted-client-rsRqysJc.mjs} +2 -2
- package/dist/{hosted-ios-Sn0djzg8.mjs → hosted-ios-RtVcJH3u.mjs} +1 -1
- package/dist/{hosted-logs-CYIZ5ubJ.mjs → hosted-logs-CWKGYWNX.mjs} +4 -4
- package/dist/{hosted-macos-CXjsUNBR.mjs → hosted-macos-d0pv9Tth.mjs} +5 -5
- package/dist/{hosted-native-Doxbfzem.mjs → hosted-native-BxTizGU2.mjs} +6 -6
- package/dist/{idle-shutdown-BInjLKqm.mjs → idle-shutdown-BIyfl0Zj.mjs} +6 -6
- package/dist/{ios-CVUFFZ6C.mjs → ios-BQzvJlzw.mjs} +59 -11
- package/dist/{ios-B1FXRCMX.mjs → ios-BRVM8b0P.mjs} +37 -32
- package/dist/{ios-BItP6lkn.mjs → ios-Dvt97HgQ.mjs} +8 -8
- package/dist/{ios-device-BI38NFFH.mjs → ios-device-CKSvk0bu.mjs} +1 -1
- package/dist/{ios-project-KYqeJURj.mjs → ios-project-DCUDo06I.mjs} +4 -4
- package/dist/{ios-state-DlElquYD.mjs → ios-state-CT9nV5SP.mjs} +1 -1
- package/dist/{js-swap-BvrQvXHY.mjs → js-swap-Z9HbC4cj.mjs} +4 -4
- package/dist/{launch-SfzGH_s9.mjs → launch-D0lPvFFu.mjs} +16 -16
- package/dist/{launch-BVlyQw3T.mjs → launch-DscF1QfM.mjs} +35 -35
- package/dist/{logs-DXE32kyb.mjs → logs-BsIRre8x.mjs} +7 -7
- package/dist/{logs-ovlU7m7N.mjs → logs-Crs9y34Z.mjs} +5 -5
- package/dist/{macos-B3BveDrU.mjs → macos-CcUlJPMu.mjs} +1 -1
- package/dist/{macos-CCfhb-jT.mjs → macos-D477nfzH.mjs} +17 -17
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +5 -5
- package/dist/{metro-Bu8LBfzS.mjs → metro-1pJgCX4U.mjs} +1 -1
- package/dist/{metro-gateway-DtsOy-0P.mjs → metro-gateway-Bp9gJQAN.mjs} +1 -1
- package/dist/{named-ports-BWDuU5oQ.mjs → named-ports-BVbn8SvC.mjs} +1 -1
- package/dist/{native-android-96BBizbq.mjs → native-android-BvMizJn1.mjs} +14 -14
- package/dist/{native-gradle-artifact-inputs-BcLYBZil.mjs → native-gradle-artifact-inputs-BJscK4vN.mjs} +3 -3
- package/dist/{native-run-BmH7U8pr.mjs → native-run-D5OJsGwA.mjs} +2 -2
- package/dist/{native-runtime-DgtJkzIa.mjs → native-runtime-B9w_Qyz3.mjs} +6 -6
- package/dist/{native-xcode-inputs-irplbQb0.mjs → native-xcode-inputs-Cv4l-obn.mjs} +1 -1
- package/dist/{native-xcode-ios-BY-6hh6M.mjs → native-xcode-ios-DGrg90hE.mjs} +17 -16
- package/dist/offload-worker.d.mts +5 -2
- package/dist/offload-worker.mjs +21 -20
- package/dist/{ownership-DxlZGDcV.mjs → ownership-jxxz-19m.mjs} +2 -2
- package/dist/{phone-reverses-BdsdesVF.mjs → phone-reverses-CYb7RRAx.mjs} +2 -2
- package/dist/{placement-log-DUvqqsB-.mjs → placement-log-DjOXJRIH.mjs} +1 -1
- package/dist/{plan-placement-4axc0Hs7.mjs → plan-placement-BqKgKHCi.mjs} +3 -3
- package/dist/{ports-D-E_OiAO.mjs → ports-DtS1Amb0.mjs} +2 -2
- package/dist/{prebuild-DmVCf5xb.mjs → prebuild-JUaqOLpc.mjs} +6 -6
- package/dist/{project-Dz-hWkb-.mjs → project-BiC68mIp.mjs} +14 -14
- package/dist/{react-native-android-DOinxgwB.mjs → react-native-android-DRYqoJc4.mjs} +23 -22
- package/dist/{react-native-build-AuCu-aAP.mjs → react-native-build-CwZB-agu.mjs} +6 -6
- package/dist/{react-native-doctor-2ivJUmwZ.mjs → react-native-doctor-BCrytK7h.mjs} +6 -6
- package/dist/{react-native-ios-D5zTIuH8.mjs → react-native-ios-Cr1buNFo.mjs} +18 -17
- package/dist/{recordings-CdPwYwvs.mjs → recordings-BaoQ0t-J.mjs} +1 -1
- package/dist/{reload-Ck9RJeSq.mjs → reload-Beftw2X3.mjs} +1 -1
- package/dist/{reload-C1TTVesC.mjs → reload-FbSgMF8x.mjs} +13 -13
- package/dist/{remote-DEZ7AOVq.mjs → remote-BuZj6AyU.mjs} +15 -6
- package/dist/{result-DqBrb12U.mjs → result-CR2vk2cj.mjs} +14 -14
- package/dist/{run-BIwoU44q.mjs → run-BtzE09Dl.mjs} +1 -1
- package/dist/{selection-BLtvaqxc.mjs → selection-D5cxEl3t.mjs} +2 -2
- package/dist/{server-bare-Z1ToVLPn.mjs → server-bare-CH9X0RLn.mjs} +55 -3
- package/dist/{server-command-C0pmjNdG.mjs → server-command-CaBbDNU2.mjs} +4 -4
- package/dist/server-expo-C16Zf2k7.mjs +2 -0
- package/dist/{server-expo-Tt_hLRpy.mjs → server-expo-Ck8EIidM.mjs} +8 -6
- package/dist/{settings-RKwY33wv.mjs → settings-B5tCoq9N.mjs} +58 -60
- package/dist/{settings-kkt0vP4w.mjs → settings-DzH9mGQZ.mjs} +1 -1
- package/dist/{settings-write--gj6MACV.mjs → settings-write-n0zwfohx.mjs} +3 -3
- package/dist/settings.schema.json +38 -0
- package/dist/{simslim-CdWKT3vA.mjs → simslim-BjxszUAb.mjs} +20 -5
- package/dist/{slot-launch-A1BgotaM.mjs → slot-launch-QeuJMlnJ.mjs} +5 -5
- package/dist/{stage-ERTMh88n.mjs → stage-D8xlRU2D.mjs} +1 -1
- package/dist/{start-Bmg_qmHi.mjs → start-C1JLjkNw.mjs} +1 -1
- package/dist/{start-BKGrEhzG.mjs → start-YMpNwLhh.mjs} +7 -7
- package/dist/{state-B1ig0Kqy.mjs → state-DMRNP7-4.mjs} +2 -2
- package/dist/{state-BfAltYJP.mjs → state-DPaM3u5K.mjs} +1 -1
- package/dist/{stats-B-ckuiUg.mjs → stats-CP7STzZw.mjs} +3 -3
- package/dist/{status-DfFp6a76.mjs → status-CRLiJ-O_.mjs} +19 -19
- package/dist/{status-Pw-807f0.mjs → status-cNw6i0_t.mjs} +1 -1
- package/dist/{status-watch-XC7F-AMf.mjs → status-watch-Bc2J4TZn.mjs} +4 -4
- package/dist/status-worker.mjs +1 -1
- package/dist/{stop-BFu7X_Do.mjs → stop-Br7LKxBE.mjs} +2 -2
- package/dist/{stop-DhclRwOO.mjs → stop-COP6PQqw.mjs} +4 -4
- package/dist/{stop-CL1kDHds.mjs → stop-Db9Kh-UA.mjs} +69 -50
- package/dist/supervisor-run.mjs +13 -13
- package/dist/{support-B3tzVhKn.mjs → support-Cxj9CmII.mjs} +4 -4
- package/dist/{support-B1W-hmC2.mjs → support-qKcbgmI5.mjs} +14 -11
- package/dist/{swiftpm-artifact-inputs-BWYPj9Sn.mjs → swiftpm-artifact-inputs-iY9fsmOc.mjs} +1 -1
- package/dist/{swiftpm-macos-BVCP5mO4.mjs → swiftpm-macos-Bp_sn9P4.mjs} +8 -8
- package/dist/{toolchain-BjgKdoEf.mjs → toolchain-DB1aeqxO.mjs} +1 -1
- package/dist/{toolchain-D3bmRMia.mjs → toolchain-VzLJzZ7O.mjs} +14 -3
- package/dist/{warm-progress-ol0ZypEu.mjs → warm-progress-BV3ZPmcY.mjs} +3 -3
- package/dist/{web-BH7peScT.mjs → web-B4Yjyt1G.mjs} +6 -6
- package/dist/web-DS4UDWvf.mjs +2 -0
- package/dist/web-run.mjs +3 -3
- package/dist/{workspace-state-CeBpIZgr.mjs → workspace-state-CPSp3mav.mjs} +1 -1
- package/dist/{workspaces-CSV2Orf4.mjs → workspaces-C9w4aeXF.mjs} +10 -10
- package/dist/{worktree-Dw8kfacb.mjs → worktree-CclFIe1Z.mjs} +25 -25
- package/dist/{worktree-DEDUzO_L.mjs → worktree-Ct9Gk3KL.mjs} +1 -1
- package/dist/{xcode-DHu41qQ4.mjs → xcode-CiIIDnuD.mjs} +4 -4
- package/package.json +7 -7
- package/shim/bundle-response.cjs +53 -1
- package/shim/bundle-response.d.cts +1 -1
- package/shim/expo-metro-config.cjs +23 -1
- package/dist/server-expo-CEntXzRw.mjs +0 -2
- package/dist/web-BdOFlTJr.mjs +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as spawnDeclared, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
3
3
|
import { a as killOnAbort } from "./operation-exec-CUZifp6Z.mjs";
|
|
4
|
-
import { o as androidHome } from "./android-
|
|
5
|
-
import { b as bundlerPin, h as startBuildHeartbeat, r as HEARTBEAT_INTERVAL_MS } from "./xcode-
|
|
4
|
+
import { o as androidHome } from "./android-Cjcj8MCw.mjs";
|
|
5
|
+
import { b as bundlerPin, h as startBuildHeartbeat, r as HEARTBEAT_INTERVAL_MS } from "./xcode-CiIIDnuD.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { existsSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
|
|
8
8
|
import { homedir, tmpdir } from "node:os";
|
|
@@ -574,6 +574,13 @@ function missingPod(err) {
|
|
|
574
574
|
//#endregion
|
|
575
575
|
//#region src/offload/toolchain.ts
|
|
576
576
|
const distDir = dirname(fileURLToPath(import.meta.url));
|
|
577
|
+
/**
|
|
578
|
+
* What a client and a remote machine must agree on to build for each other: what a worker builds and how, the
|
|
579
|
+
* artifacts it returns and the build and artifact messages. It lives in the `stim` package, whose own code does the
|
|
580
|
+
* build, because `@stim-cli/core` is a ranged dependency that can resolve newer than the installed `stim`.
|
|
581
|
+
* `scripts/build-compat.json` records the files a change to which needs a bump or a recorded no-bump.
|
|
582
|
+
*/
|
|
583
|
+
const STIM_BUILD_COMPAT = 1;
|
|
577
584
|
function quiet(file, args) {
|
|
578
585
|
return getExecutor().runFileQuiet(file, args, { timeoutMs: 2e4 });
|
|
579
586
|
}
|
|
@@ -607,6 +614,7 @@ function iosToolchainForRuby(rubyVersion, native) {
|
|
|
607
614
|
function assembleIosToolchain(xcode, simulatorSdk, cocoapods) {
|
|
608
615
|
return {
|
|
609
616
|
stimBuild: stimBuildDigest(distDir),
|
|
617
|
+
compat: STIM_BUILD_COMPAT,
|
|
610
618
|
arch: process.arch,
|
|
611
619
|
xcode: xcode ? xcode.trim().replace(/\n/g, " / ") : null,
|
|
612
620
|
simulatorSdk: simulatorSdk?.trim() ?? null,
|
|
@@ -656,6 +664,7 @@ async function macosToolchainAsync() {
|
|
|
656
664
|
function assembleMacosToolchain(xcode, macosSdk) {
|
|
657
665
|
return {
|
|
658
666
|
stimBuild: stimBuildDigest(distDir),
|
|
667
|
+
compat: STIM_BUILD_COMPAT,
|
|
659
668
|
arch: process.arch,
|
|
660
669
|
xcode: xcode ? xcode.trim().replace(/\n/g, " / ") : null,
|
|
661
670
|
macosSdk: macosSdk?.trim() ?? null
|
|
@@ -689,6 +698,7 @@ function localJdk(env = process.env) {
|
|
|
689
698
|
function androidToolchain() {
|
|
690
699
|
return {
|
|
691
700
|
stimBuild: stimBuildDigest(distDir),
|
|
701
|
+
compat: STIM_BUILD_COMPAT,
|
|
692
702
|
arch: process.arch,
|
|
693
703
|
jdk: localJdk()
|
|
694
704
|
};
|
|
@@ -708,6 +718,7 @@ async function androidToolchainAsync(env = process.env) {
|
|
|
708
718
|
}
|
|
709
719
|
return {
|
|
710
720
|
stimBuild: stimBuildDigest(distDir),
|
|
721
|
+
compat: STIM_BUILD_COMPAT,
|
|
711
722
|
arch: process.arch,
|
|
712
723
|
jdk
|
|
713
724
|
};
|
|
@@ -830,7 +841,7 @@ function versionMismatch(tool, there, here) {
|
|
|
830
841
|
function toolchainMismatches(target, worker) {
|
|
831
842
|
const { local } = target;
|
|
832
843
|
const out = [];
|
|
833
|
-
if (!local.stimBuild || worker.stimBuild !== local.stimBuild) out.push({
|
|
844
|
+
if (!local.stimBuild || (worker.compat !== void 0 ? worker.compat !== local.compat : worker.stimBuild !== local.stimBuild)) out.push({
|
|
834
845
|
code: "stim-build",
|
|
835
846
|
reason: `Stim build ${worker.stimBuild ?? "unknown"} there, ${local.stimBuild ?? "unknown"} here`
|
|
836
847
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, E as debugLog, l as WorkspaceProcessCleanupError, n as isTimeoutError, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { d as workspaceDir, n as ensureWorkspaceStorage, v as withDirLock } from "./paths-DQtTgsBf.mjs";
|
|
3
3
|
import { l as gitQuietAsync, o as git$1, s as gitAsync } from "./operation-exec-CUZifp6Z.mjs";
|
|
4
|
-
import { h as discoverAgentSessions, m as attributeAgentSessions, o as updateWorkspaceState, p as agentKey } from "./workspace-state-
|
|
5
|
-
import {
|
|
6
|
-
import { V as ownedAvdDirectory } from "./android-
|
|
4
|
+
import { h as discoverAgentSessions, m as attributeAgentSessions, o as updateWorkspaceState, p as agentKey } from "./workspace-state-CPSp3mav.mjs";
|
|
5
|
+
import { Tt as linkedWorktreesOnDisk, bt as gitCommonDirOnDisk } from "./settings-B5tCoq9N.mjs";
|
|
6
|
+
import { V as ownedAvdDirectory } from "./android-Cjcj8MCw.mjs";
|
|
7
7
|
import { s as pullRequestLookups } from "./pull-request-CbNlkFok.mjs";
|
|
8
8
|
import { clearClaimChild, markClaimChildPending, releaseClaim, setClaimChild, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
|
|
2
2
|
import { E as upsertProject, O as withConfigLockAsync, p as getProject } from "./config-BZhXY15H.mjs";
|
|
3
|
-
import { f as refuseNoProject, l as phaseLine } from "./command-output-
|
|
4
|
-
import { i as recordWorkspaceUse } from "./workspace-state-
|
|
5
|
-
import {
|
|
6
|
-
import { f as projectRegistry, n as findCommandWorkspace } from "./project-
|
|
3
|
+
import { f as refuseNoProject, l as phaseLine } from "./command-output-BBvS1H6v.mjs";
|
|
4
|
+
import { i as recordWorkspaceUse } from "./workspace-state-CPSp3mav.mjs";
|
|
5
|
+
import { Y as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY, tt as settingShapeErrors } from "./settings-B5tCoq9N.mjs";
|
|
6
|
+
import { f as projectRegistry, n as findCommandWorkspace } from "./project-BiC68mIp.mjs";
|
|
7
7
|
import { a as workspaceLinkLine, o as workspaceLinks } from "./stim-desktop-DS0mzR8U.mjs";
|
|
8
|
-
import { o as readWebRecord, r as cdpEndpoint } from "./state-
|
|
8
|
+
import { o as readWebRecord, r as cdpEndpoint } from "./state-DMRNP7-4.mjs";
|
|
9
9
|
import { t as liveWebRecord } from "./page-CzEA_-5_.mjs";
|
|
10
|
-
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-
|
|
10
|
+
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-B9w_Qyz3.mjs";
|
|
11
11
|
import chalk from "chalk";
|
|
12
12
|
//#region src/commands/web.ts
|
|
13
13
|
const printNote = (line) => console.error(line);
|
package/dist/web-run.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, S as process_identity_exports, o as cancellableSleep, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { i as recordCreatedDevice } from "./created-devices-D2Aca-xu.mjs";
|
|
3
|
-
import { f as signalProcessTree } from "./metro-
|
|
3
|
+
import { f as signalProcessTree } from "./metro-1pJgCX4U.mjs";
|
|
4
4
|
import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
|
|
5
|
-
import { c as webClaimRoot, f as webLogFile, g as chromeProcessState, h as writeWebRecord, i as clearWebRecord, l as webDir, n as browserLogFile, p as webProfileDir, s as updateWebRecord, v as liveProfileHolder, y as removeSingletonFiles } from "./state-
|
|
6
|
-
import { l as probeWebDrivers } from "./activity-
|
|
5
|
+
import { c as webClaimRoot, f as webLogFile, g as chromeProcessState, h as writeWebRecord, i as clearWebRecord, l as webDir, n as browserLogFile, p as webProfileDir, s as updateWebRecord, v as liveProfileHolder, y as removeSingletonFiles } from "./state-DMRNP7-4.mjs";
|
|
6
|
+
import { l as probeWebDrivers } from "./activity-BpjwrQXU.mjs";
|
|
7
7
|
import { t as connectOwnedBrowser } from "./cdp-BG3FJCCx.mjs";
|
|
8
8
|
import { t as relaunchWithLogFile } from "./detached-entry-KmieOKgN.mjs";
|
|
9
9
|
import { i as chromeArgs, n as DESKTOP_PAGE, r as PHONE_SCREEN } from "./chrome-BvV8ssI3.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as process_identity_exports, t as getExecutor } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { _ as workspaceStateLock, g as workspaceStateFile$1, n as ensureWorkspaceStorage, r as ensureWorkspaceStorageAsync, v as withDirLock, y as withDirLockAsync } from "./paths-DQtTgsBf.mjs";
|
|
3
3
|
import { A as writeConfigSettingAsync, k as writeConfigSetting, m as getProjectSettings } from "./config-BZhXY15H.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { st as workspaceHiddenSetting } from "./settings-B5tCoq9N.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
@@ -2,19 +2,19 @@ import { D as ownership_claim_exports, S as process_identity_exports, c as throw
|
|
|
2
2
|
import { d as workspaceDir, h as workspaceName$1, l as workspaceAgentDeviceDir } from "./paths-DQtTgsBf.mjs";
|
|
3
3
|
import { F as isOnMountedVolume, G as projectDeviceSlots, H as deviceSlotPlatforms, I as listMountedVolumes, L as measuredDirectorySizeAsync, O as withConfigLockAsync$1, P as formatBytes, _ as loadConfig$1, d as getConfigDir, g as isPathPrefix, j as acquireAvdClaim, p as getProject } from "./config-BZhXY15H.mjs";
|
|
4
4
|
import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
5
|
-
import { a as formatElapsed, l as phaseLine } from "./command-output-
|
|
5
|
+
import { a as formatElapsed, l as phaseLine } from "./command-output-BBvS1H6v.mjs";
|
|
6
6
|
import { t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
|
|
7
|
-
import { l as withWorkspaceStateLockAsync, r as readWorkspaceState$1, u as workspaceLastUsed } from "./workspace-state-
|
|
8
|
-
import {
|
|
9
|
-
import { a as macosRuntimeClaim, n as macosDir } from "./state-
|
|
10
|
-
import { H as ownedAvdMatchesConfiguration, K as ownedAvdSystemImage, L as listOrphanedAvdDirectories, S as deleteAvd, V as ownedAvdDirectory, _t as parkSim, bt as removeParkedAfter, g as avdPathExists, ht as eraseParkedAfter, it as shutdownAndroidEmulator, j as listAdbDevicesAsync, lt as wipeAvdUserData, nt as resolveOwnedAvdSerialAsync, p as assertOwnedAvdStoppedAsync, st as waitForAndroidEmulatorShutdown, ut as isStimOwnedAvd, v as avdStorageRoots, yt as readParked } from "./android-
|
|
7
|
+
import { l as withWorkspaceStateLockAsync, r as readWorkspaceState$1, u as workspaceLastUsed } from "./workspace-state-CPSp3mav.mjs";
|
|
8
|
+
import { Pt as repoRootAsync, dt as resolveTailscaleBinary } from "./settings-B5tCoq9N.mjs";
|
|
9
|
+
import { a as macosRuntimeClaim, n as macosDir } from "./state-DPaM3u5K.mjs";
|
|
10
|
+
import { H as ownedAvdMatchesConfiguration, K as ownedAvdSystemImage, L as listOrphanedAvdDirectories, S as deleteAvd, V as ownedAvdDirectory, _t as parkSim, bt as removeParkedAfter, g as avdPathExists, ht as eraseParkedAfter, it as shutdownAndroidEmulator, j as listAdbDevicesAsync, lt as wipeAvdUserData, nt as resolveOwnedAvdSerialAsync, p as assertOwnedAvdStoppedAsync, st as waitForAndroidEmulatorShutdown, ut as isStimOwnedAvd, v as avdStorageRoots, yt as readParked } from "./android-Cjcj8MCw.mjs";
|
|
11
11
|
import { i as recordCreatedDevice, n as forgetCreatedDeviceAsync, r as readCreatedDevices$1, t as forgetCreatedDevice } from "./created-devices-D2Aca-xu.mjs";
|
|
12
|
-
import { c as pidExists, f as signalProcessTree, p as signalProcessTreeAsync } from "./metro-
|
|
13
|
-
import { _ as chromeProcessStateAsync, c as webClaimRoot, i as clearWebRecord, o as readWebRecord, p as webProfileDir, t as CDP_PORT_LABEL, u as webFacts, v as liveProfileHolder, y as removeSingletonFiles } from "./state-
|
|
12
|
+
import { c as pidExists, f as signalProcessTree, p as signalProcessTreeAsync } from "./metro-1pJgCX4U.mjs";
|
|
13
|
+
import { _ as chromeProcessStateAsync, c as webClaimRoot, i as clearWebRecord, o as readWebRecord, p as webProfileDir, t as CDP_PORT_LABEL, u as webFacts, v as liveProfileHolder, y as removeSingletonFiles } from "./state-DMRNP7-4.mjs";
|
|
14
14
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
15
|
-
import { N as listBuildLocks, d as readAgentDeviceRecords, t as agentDeviceDaemon } from "./activity-
|
|
16
|
-
import { E as resolveOwnedIosSim, O as shutdownIosSim, S as renameIosSim, c as eraseIosSim, f as listAllIosSimsAsync, o as deleteIosSim, p as listIosDeviceTypesAsync, s as deleteParkedIosSim, v as parkedSimName, y as parseRuntimeVersion } from "./ios-
|
|
17
|
-
import { r as releaseBrowserPort } from "./named-ports-
|
|
15
|
+
import { N as listBuildLocks, d as readAgentDeviceRecords, t as agentDeviceDaemon } from "./activity-BpjwrQXU.mjs";
|
|
16
|
+
import { E as resolveOwnedIosSim, O as shutdownIosSim, S as renameIosSim, c as eraseIosSim, f as listAllIosSimsAsync, o as deleteIosSim, p as listIosDeviceTypesAsync, s as deleteParkedIosSim, v as parkedSimName, y as parseRuntimeVersion } from "./ios-BQzvJlzw.mjs";
|
|
17
|
+
import { r as releaseBrowserPort } from "./named-ports-BVbn8SvC.mjs";
|
|
18
18
|
import { createHash, randomUUID } from "node:crypto";
|
|
19
19
|
import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, unlinkSync, watch, writeFileSync } from "node:fs";
|
|
20
20
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, S as process_identity_exports, b as operationState, l as WorkspaceProcessCleanupError, m as declareSpawnsOn, n as isTimeoutError, t as getExecutor, v as stopDeclaringSpawnsOn } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { d as workspaceDir, l as workspaceAgentDeviceDir } from "./paths-DQtTgsBf.mjs";
|
|
3
3
|
import { E as upsertProject, G as projectDeviceSlots, L as measuredDirectorySizeAsync, O as withConfigLockAsync$1, S as removeProject, _ as loadConfig$1, a as clearDevice, d as getConfigDir, g as isPathPrefix, j as acquireAvdClaim, p as getProject } from "./config-BZhXY15H.mjs";
|
|
4
|
-
import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-
|
|
4
|
+
import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-BBvS1H6v.mjs";
|
|
5
5
|
import { c as gitQuiet, o as git, r as childEnvironment, s as gitAsync, t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
|
|
6
|
-
import { a as recordWorkspaceUseAsync, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-
|
|
7
|
-
import { At as
|
|
8
|
-
import { F as readRemoteSessionId, M as readMetroTunnel, O as clearManagedMetroTunnel, P as readRemoteSession, T as MODE_COMMAND, i as findProjectRoot$1, k as clearRemoteSession, o as isMobileProject } from "./project-
|
|
9
|
-
import { t as macosAppPresent } from "./state-
|
|
6
|
+
import { a as recordWorkspaceUseAsync, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-CPSp3mav.mjs";
|
|
7
|
+
import { At as podsOutOfSync, B as readCommittedSettings, Bt as unpushedCommitsAsync, Ct as hasUncommittedWorkAsync, Dt as listWorktreesAsync, Ft as resolveFullRef, Gt as removeTemporaryEntryAsync, Ht as filesystemDevice, It as resolveFullRefAsync, J as resolveProjectSettings, Mt as removeWorktreeAsync, Ot as locallyKnownUpstream, Rt as restoreFileAsync, St as hasRemoteAsync, Vt as warmWorktreePaths, X as resolveSettings, _t as dirtyPathsAsync, a as SETTING_SHAPE_REMEDY, at as unknownSettingKeys, bt as gitCommonDirOnDisk, ft as branchExistsAsync, ht as depsOutOfSync, jt as readWorktreeExclude, mt as deleteBranchAsync, pt as cloneIgnoredEntries, q as resolveIosProjectDir, tt as settingShapeErrors, wt as isPodInstallChurn, xt as hasPopulatedSubmodulesAsync, yt as gitCommonDirAsync, zt as sourceCheckoutOf } from "./settings-B5tCoq9N.mjs";
|
|
8
|
+
import { F as readRemoteSessionId, M as readMetroTunnel, O as clearManagedMetroTunnel, P as readRemoteSession, T as MODE_COMMAND, i as findProjectRoot$1, k as clearRemoteSession, o as isMobileProject } from "./project-BiC68mIp.mjs";
|
|
9
|
+
import { t as macosAppPresent } from "./state-DPaM3u5K.mjs";
|
|
10
10
|
import { a as workspaceLinkLine, o as workspaceLinks } from "./stim-desktop-DS0mzR8U.mjs";
|
|
11
|
-
import { ft as POOL_SETTING_REMEDY, vt as parkedMaxSetting } from "./android-
|
|
12
|
-
import { c as pidExists, d as resolveProjectMetro, p as signalProcessTreeAsync, r as killMetroTreeAsync } from "./metro-
|
|
13
|
-
import { o as readWebRecord } from "./state-
|
|
14
|
-
import {
|
|
11
|
+
import { ft as POOL_SETTING_REMEDY, vt as parkedMaxSetting } from "./android-Cjcj8MCw.mjs";
|
|
12
|
+
import { c as pidExists, d as resolveProjectMetro, p as signalProcessTreeAsync, r as killMetroTreeAsync } from "./metro-1pJgCX4U.mjs";
|
|
13
|
+
import { o as readWebRecord } from "./state-DMRNP7-4.mjs";
|
|
14
|
+
import { Cr as discoverCaches, S as withdrawDevServerStopRequest, Vt as endRecordedSession, Xn as resolveEasCliBin, b as requestDevServerStop, c as readVolumeSpace, it as planCacheEmptying, l as readVolumeSpaceAsync, o as machineNumber, u as resolveBudget, zn as runProcessOperation } from "./budget-HyShrIpL.mjs";
|
|
15
15
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
16
|
-
import { p as cacheUser } from "./native-run-
|
|
17
|
-
import { A as teardownOwnedIosSim, C as withManagedTunnelRemovalLock, O as teardownOwnedAvd, a as collectWorkspaceOutputs, f as emptyWorkspaceDir, g as resolveSupervisorTarget, k as teardownOwnedBrowser, p as withIdleWorkspace, v as stopTunnel, x as withManagedRemoteWorktreeRemovalLock } from "./workspaces-
|
|
18
|
-
import { D as releaseWorkspaceLeases, t as agentDeviceDaemon } from "./activity-
|
|
19
|
-
import {
|
|
20
|
-
import { t as clearNamedPorts } from "./named-ports-
|
|
21
|
-
import { r as HEARTBEAT_INTERVAL_MS, x as podInstallCommand } from "./xcode-
|
|
16
|
+
import { p as cacheUser } from "./native-run-D5OJsGwA.mjs";
|
|
17
|
+
import { A as teardownOwnedIosSim, C as withManagedTunnelRemovalLock, O as teardownOwnedAvd, a as collectWorkspaceOutputs, f as emptyWorkspaceDir, g as resolveSupervisorTarget, k as teardownOwnedBrowser, p as withIdleWorkspace, v as stopTunnel, x as withManagedRemoteWorktreeRemovalLock } from "./workspaces-C9w4aeXF.mjs";
|
|
18
|
+
import { D as releaseWorkspaceLeases, t as agentDeviceDaemon } from "./activity-BpjwrQXU.mjs";
|
|
19
|
+
import { I as readHostMemoryPressure, L as readHostMemoryPressureAsync } from "./ios-BQzvJlzw.mjs";
|
|
20
|
+
import { t as clearNamedPorts } from "./named-ports-BVbn8SvC.mjs";
|
|
21
|
+
import { r as HEARTBEAT_INTERVAL_MS, x as podInstallCommand } from "./xcode-CiIIDnuD.mjs";
|
|
22
22
|
import { t as resolveMaintenanceSettings } from "./settings-Djl-mpjX.mjs";
|
|
23
|
-
import { _ as runCaptured, h as readPodState, m as podsAreStale, p as DEPS_ERROR, v as runPodInstall } from "./toolchain-
|
|
24
|
-
import { i as stopHostedAndroid } from "./hosted-android-
|
|
25
|
-
import { r as stopHostedIos } from "./hosted-ios-
|
|
26
|
-
import { n as stopMacosApp } from "./stop-
|
|
27
|
-
import { n as verifyCollectorOwnership } from "./ownership-
|
|
28
|
-
import { n as removePhoneReverses } from "./phone-reverses-
|
|
29
|
-
import { a as discoverXcodeProject } from "./react-native-build-
|
|
30
|
-
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-
|
|
31
|
-
import { a as forgetStatusMeasures, p as mergeStateAsync, t as startWarmProgress } from "./warm-progress-
|
|
23
|
+
import { _ as runCaptured, h as readPodState, m as podsAreStale, p as DEPS_ERROR, v as runPodInstall } from "./toolchain-VzLJzZ7O.mjs";
|
|
24
|
+
import { i as stopHostedAndroid } from "./hosted-android-Bvb2-ZxD.mjs";
|
|
25
|
+
import { r as stopHostedIos } from "./hosted-ios-RtVcJH3u.mjs";
|
|
26
|
+
import { n as stopMacosApp } from "./stop-COP6PQqw.mjs";
|
|
27
|
+
import { n as verifyCollectorOwnership } from "./ownership-jxxz-19m.mjs";
|
|
28
|
+
import { n as removePhoneReverses } from "./phone-reverses-CYb7RRAx.mjs";
|
|
29
|
+
import { a as discoverXcodeProject } from "./react-native-build-CwZB-agu.mjs";
|
|
30
|
+
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-BwNCYG5Q.mjs";
|
|
31
|
+
import { a as forgetStatusMeasures, p as mergeStateAsync, t as startWarmProgress } from "./warm-progress-BV3ZPmcY.mjs";
|
|
32
32
|
import { o as pullRequestLookupAsync, r as endedPullRequest } from "./pull-request-CbNlkFok.mjs";
|
|
33
|
-
import { r as workspaceRecordingEnabled } from "./recordings-
|
|
33
|
+
import { r as workspaceRecordingEnabled } from "./recordings-BaoQ0t-J.mjs";
|
|
34
34
|
import { claimRemoveCommand, clearFreeClaimSet, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
35
35
|
import { createHash, randomUUID } from "node:crypto";
|
|
36
36
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as worktreeCommand, a as matchWorktreeEntry, c as reclaimKeys, d as removalBlockers, f as removalPath, g as warmedWorkspace, h as warmWorktreeTarget, i as excludeWatchmanCookies, l as registerRemove, m as removeWorktreeTarget, n as dependencyInstallCommand, o as nestedWorktrees, p as removalRemedy, r as excludePodChurn, s as porcelainPath, t as customIosDirs, u as registerWarm } from "./worktree-
|
|
1
|
+
import { _ as worktreeCommand, a as matchWorktreeEntry, c as reclaimKeys, d as removalBlockers, f as removalPath, g as warmedWorkspace, h as warmWorktreeTarget, i as excludeWatchmanCookies, l as registerRemove, m as removeWorktreeTarget, n as dependencyInstallCommand, o as nestedWorktrees, p as removalRemedy, r as excludePodChurn, s as porcelainPath, t as customIosDirs, u as registerWarm } from "./worktree-CclFIe1Z.mjs";
|
|
2
2
|
export { customIosDirs, worktreeCommand as default, dependencyInstallCommand, excludePodChurn, excludeWatchmanCookies, matchWorktreeEntry, nestedWorktrees, porcelainPath, reclaimKeys, registerRemove, registerWarm, removalBlockers, removalPath, removalRemedy, removeWorktreeTarget, warmWorktreeTarget, warmedWorkspace };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, _ as spawnDeclared, m as declareSpawnsOn, t as getExecutor, v as stopDeclaringSpawnsOn } from "./exec-VFRpu1iA.mjs";
|
|
2
2
|
import { u as workspaceDerivedData } from "./paths-DQtTgsBf.mjs";
|
|
3
3
|
import { t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
4
|
-
import { a as formatElapsed, l as phaseLine } from "./command-output-
|
|
4
|
+
import { a as formatElapsed, l as phaseLine } from "./command-output-BBvS1H6v.mjs";
|
|
5
5
|
import { a as killOnAbort } from "./operation-exec-CUZifp6Z.mjs";
|
|
6
|
-
import { d as runCancellationSignal, h as shareCompilationCache } from "./native-run-
|
|
7
|
-
import { p as resolveOptimizations } from "./errors-
|
|
8
|
-
import { t as cleanLine } from "./server-expo-
|
|
6
|
+
import { d as runCancellationSignal, h as shareCompilationCache } from "./native-run-D5OJsGwA.mjs";
|
|
7
|
+
import { p as resolveOptimizations } from "./errors-DHm_U5gv.mjs";
|
|
8
|
+
import { t as cleanLine } from "./server-expo-Ck8EIidM.mjs";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
11
11
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stim",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Stim: fast, isolated React Native environments for coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@expo/fingerprint": "^0.20.10",
|
|
56
|
-
"@stim-cli/agent-driver": "
|
|
57
|
-
"@stim-cli/agent-driver-agent-device": "
|
|
58
|
-
"@stim-cli/cache": "
|
|
59
|
-
"@stim-cli/core": "
|
|
60
|
-
"@stim-cli/metro": "
|
|
56
|
+
"@stim-cli/agent-driver": "1.25.0",
|
|
57
|
+
"@stim-cli/agent-driver-agent-device": "1.25.0",
|
|
58
|
+
"@stim-cli/cache": "1.25.0",
|
|
59
|
+
"@stim-cli/core": "1.25.0",
|
|
60
|
+
"@stim-cli/metro": "1.25.0",
|
|
61
61
|
"@xmldom/xmldom": "0.9.12",
|
|
62
62
|
"chalk": "^6.0.0",
|
|
63
63
|
"commander": "^15.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"ws": "^8.21.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@stim-cli/expo-build-cache": "1.
|
|
69
|
+
"@stim-cli/expo-build-cache": "1.25.0",
|
|
70
70
|
"@types/cross-spawn": "^6.0.6",
|
|
71
71
|
"@types/which": "^3.0.4",
|
|
72
72
|
"@types/ws": "^8.18.1",
|
package/shim/bundle-response.cjs
CHANGED
|
@@ -7,6 +7,8 @@ const LOOPBACK = new Set(['127.0.0.1', '::1', '::ffff:127.0.0.1']);
|
|
|
7
7
|
// https://github.com/facebook/metro/blob/main/packages/metro/src/Server.js (`writeChunk` with done, total, percent).
|
|
8
8
|
const PROGRESS_PART = /^\{"done":(\d+),"total":(\d+),"percent":(\d+)\}$/;
|
|
9
9
|
const PROGRESS_INTERVAL_MS = 1000;
|
|
10
|
+
const MANIFEST_PATHS = new Set(['/', '/manifest', '/index.exp']);
|
|
11
|
+
const observedServers = new WeakSet();
|
|
10
12
|
|
|
11
13
|
function clientPidFromLsof(output, clientPort, serverPort) {
|
|
12
14
|
const connection = new RegExp(`:${clientPort}->\\S*:${serverPort}$`);
|
|
@@ -28,9 +30,58 @@ function lookupClientPid(req, runLsof) {
|
|
|
28
30
|
.catch(() => null);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
function
|
|
33
|
+
function manifestPlatform(req) {
|
|
34
|
+
if (req.method !== 'GET') return null;
|
|
35
|
+
let url;
|
|
36
|
+
try {
|
|
37
|
+
url = new URL(req.url, 'http://localhost');
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (!MANIFEST_PATHS.has(url.pathname)) return null;
|
|
42
|
+
const platform = url.searchParams.get('platform') || req.headers['expo-platform'] || req.headers['exponent-platform'];
|
|
43
|
+
return platform === 'ios' || platform === 'android' ? platform : null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// @expo/cli mounts ManifestMiddleware ahead of Metro's middleware and answers without calling next(),
|
|
47
|
+
// so only a listener on the HTTP server itself sees a manifest request.
|
|
48
|
+
function observeManifestRequests(server, write) {
|
|
49
|
+
if (!server || observedServers.has(server)) return;
|
|
50
|
+
observedServers.add(server);
|
|
51
|
+
server.prependListener('request', (req, res) => {
|
|
52
|
+
const platform = manifestPlatform(req);
|
|
53
|
+
if (!platform || req.headers['x-stim-metro-warmup'] === '1') return;
|
|
54
|
+
const requestId = randomUUID();
|
|
55
|
+
const emit = (stage, statusCode) => {
|
|
56
|
+
try {
|
|
57
|
+
write({
|
|
58
|
+
ts: Date.now(),
|
|
59
|
+
src: 'metro',
|
|
60
|
+
level: 'debug',
|
|
61
|
+
event: `manifest_request_${stage}`,
|
|
62
|
+
platform,
|
|
63
|
+
requestId,
|
|
64
|
+
...(statusCode ? { statusCode } : {}),
|
|
65
|
+
msg: `${platform} manifest request ${stage}`,
|
|
66
|
+
});
|
|
67
|
+
} catch {}
|
|
68
|
+
};
|
|
69
|
+
emit('started');
|
|
70
|
+
let ended = false;
|
|
71
|
+
const finish = (complete) => {
|
|
72
|
+
if (ended) return;
|
|
73
|
+
ended = true;
|
|
74
|
+
emit(complete && res.statusCode === 200 ? 'finished' : 'failed', res.statusCode);
|
|
75
|
+
};
|
|
76
|
+
res.once('finish', () => finish(true));
|
|
77
|
+
res.once('close', () => finish(false));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function bundleResponseMiddleware(write, { runLsof, manifests = false } = {}) {
|
|
32
82
|
return (req, res, next) => {
|
|
33
83
|
if (req.method === 'GET' && req.url === '/_stim/metro-warmup') {
|
|
84
|
+
if (manifests) observeManifestRequests(req.socket.server, write);
|
|
34
85
|
res.end('ready');
|
|
35
86
|
return;
|
|
36
87
|
}
|
|
@@ -59,6 +110,7 @@ function bundleResponseMiddleware(write, { runLsof } = {}) {
|
|
|
59
110
|
requestId,
|
|
60
111
|
...(progress ?? { statusCode }),
|
|
61
112
|
msg: progress ? `${platform} bundle ${progress.percent}%` : `${platform} bundle ${kind} ${stage}`,
|
|
113
|
+
...(stage === 'started' && !prefetch ? { url: `${url.pathname}${url.search}` } : {}),
|
|
62
114
|
...(pid ? { clientPid: pid } : {}),
|
|
63
115
|
});
|
|
64
116
|
} catch {}
|
|
@@ -2,5 +2,5 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
|
2
2
|
|
|
3
3
|
export function bundleResponseMiddleware(
|
|
4
4
|
write: (record: Record<string, unknown>) => unknown,
|
|
5
|
-
options?: { runLsof?: (args: string[]) => Promise<string
|
|
5
|
+
options?: { runLsof?: (args: string[]) => Promise<string>; manifests?: boolean },
|
|
6
6
|
): (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => unknown) => unknown;
|
|
@@ -4,6 +4,7 @@ const fs = require('node:fs');
|
|
|
4
4
|
const os = require('node:os');
|
|
5
5
|
const path = require('node:path');
|
|
6
6
|
const { execFile } = require('node:child_process');
|
|
7
|
+
const http = require('node:http');
|
|
7
8
|
const { createRequire } = require('node:module');
|
|
8
9
|
const { pathToFileURL } = require('node:url');
|
|
9
10
|
const { bundleResponseMiddleware } = require('./bundle-response.cjs');
|
|
@@ -17,6 +18,7 @@ const OK_PREFIX = 'stim-metro-store: sharing Metro transforms through ';
|
|
|
17
18
|
|
|
18
19
|
let announced = false;
|
|
19
20
|
let warned = false;
|
|
21
|
+
let armed = false;
|
|
20
22
|
|
|
21
23
|
function warn(reason) {
|
|
22
24
|
if (warned) return;
|
|
@@ -125,6 +127,25 @@ function runLsof(args) {
|
|
|
125
127
|
);
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
function armManifestObserver() {
|
|
131
|
+
const port = Number(process.env.STIM_METRO_PORT);
|
|
132
|
+
if (armed || !Number.isInteger(port) || port <= 0) return;
|
|
133
|
+
armed = true;
|
|
134
|
+
let attempts = 0;
|
|
135
|
+
const probe = () => {
|
|
136
|
+
const retry = () => {
|
|
137
|
+
if (++attempts < 240) setTimeout(probe, 250).unref();
|
|
138
|
+
};
|
|
139
|
+
const request = http.get({ host: '127.0.0.1', port, path: '/_stim/metro-warmup', timeout: 2000 }, (response) => {
|
|
140
|
+
response.resume();
|
|
141
|
+
if (response.statusCode !== 200) retry();
|
|
142
|
+
});
|
|
143
|
+
request.on('timeout', () => request.destroy());
|
|
144
|
+
request.on('error', retry);
|
|
145
|
+
};
|
|
146
|
+
setTimeout(probe, 0).unref();
|
|
147
|
+
}
|
|
148
|
+
|
|
128
149
|
function appendStore(config, defaultConfig) {
|
|
129
150
|
const output = config && typeof config === 'object' ? config : {};
|
|
130
151
|
const configuredStores = output.cacheStores != null ? output.cacheStores : defaultConfig.cacheStores;
|
|
@@ -139,8 +160,9 @@ function appendStore(config, defaultConfig) {
|
|
|
139
160
|
const enhanced = enhanceMiddleware ? enhanceMiddleware(middleware, metroServer) : middleware;
|
|
140
161
|
const observe = bundleResponseMiddleware(
|
|
141
162
|
(record) => process.stderr.write(`stim-bundle-response: ${JSON.stringify(record)}\n`),
|
|
142
|
-
{ runLsof: process.platform === 'darwin' ? runLsof : undefined },
|
|
163
|
+
{ runLsof: process.platform === 'darwin' ? runLsof : undefined, manifests: true },
|
|
143
164
|
);
|
|
165
|
+
armManifestObserver();
|
|
144
166
|
return (req, res, next) => observe(req, res, (error) => (error ? next(error) : enhanced(req, res, next)));
|
|
145
167
|
},
|
|
146
168
|
},
|
package/dist/web-BdOFlTJr.mjs
DELETED