stim 1.17.2 → 1.19.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 +50 -1
- package/dist/{activity-IRvJY_ru.mjs → activity-BSw0x84R.mjs} +4 -4
- package/dist/{agent-device-usage-output-BK41vnzN.mjs → agent-device-usage-output-Bjxu_VmX.mjs} +8 -8
- package/dist/{android-B9yaNKwa.mjs → android-BXc6BmEi.mjs} +658 -404
- package/dist/{android-B_YNZy61.mjs → android-BdQC6zs1.mjs} +9 -9
- package/dist/android-BvV1gGdN.mjs +4 -0
- package/dist/{android-DE4v59Mb.mjs → android-DE5g_5gv.mjs} +2 -2
- package/dist/{android-cas-ZFpjJBL_.mjs → android-cas-C87geAg-.mjs} +5 -5
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/api-DIf_s86s.mjs +150 -0
- package/dist/api-run.d.mts +1 -0
- package/dist/api-run.mjs +145 -0
- package/dist/api.d.mts +218 -0
- package/dist/api.mjs +2 -0
- package/dist/{app-install-VPkI5WEg.mjs → app-install-CFI4ptUL.mjs} +33 -13
- package/dist/{attempt-Bk2ouQVL.mjs → attempt-DW-mQqM7.mjs} +14 -4
- package/dist/{web-Dl0KSRHf.mjs → browser-web-CDhqQxhv.mjs} +138 -176
- package/dist/{budget-DfcgFdQB.mjs → budget-Dz-kyXLv.mjs} +1391 -58
- package/dist/build-facts-B87vo-Im.d.mts +142 -0
- package/dist/{cache-manifest-DnUHBJaU.mjs → cache-manifest-DiwKSyv9.mjs} +3 -3
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{chrome-BrcVWQyD.mjs → chrome-BTUOo8p2.mjs} +1 -1
- package/dist/cli-C9Zvgbdc.mjs +68 -0
- package/dist/cli.mjs +1 -1
- package/dist/{client-SvBdgObD.mjs → client-CuUo8Nvg.mjs} +381 -49
- package/dist/collector-run.d.mts +6 -0
- package/dist/collector-run.mjs +9 -9
- package/dist/{command-output-CDAIFD-8.mjs → command-output-Bt8ygHE7.mjs} +2 -2
- package/dist/{config-D0DbpZtM.mjs → config-DC5jEtd1.mjs} +9 -5
- package/dist/{created-devices-CpvzBL25.mjs → created-devices-D0s26Hx5.mjs} +2 -2
- package/dist/{dependency-state-CLcBHH2M.mjs → dependency-state-DKaS1OM9.mjs} +2 -2
- package/dist/{detached-entry-CiTEgMR1.mjs → detached-entry-pB_IPfV4.mjs} +1 -1
- package/dist/{dev-client-B-XC4uRH.mjs → dev-client-CDY_zAmD.mjs} +2 -2
- package/dist/{device-C8IOoJPv.mjs → device-BHw0WlHl.mjs} +8 -8
- package/dist/{device-capacity-ZC4XSZ4R.mjs → device-capacity-BoN1jQkO.mjs} +25 -14
- package/dist/device-host-worker.mjs +19 -19
- package/dist/{gradle-dJpre3Yn.mjs → device-ios-B2ruohE-.mjs} +661 -107
- package/dist/{device-lease-DpoS36_u.mjs → device-lease-Cu7PtQpZ.mjs} +9 -9
- package/dist/{device-lease-run-B8YltIH_.mjs → device-lease-run-D38SnZtt.mjs} +4 -4
- package/dist/{device-pool-3o7s5lo4.mjs → device-pool-CP4rAsHx.mjs} +3 -3
- package/dist/{device-remote-hFSkpfQu.mjs → device-remote-B5GiUifk.mjs} +15 -16
- package/dist/{doctor-CFv1fCrF.mjs → doctor-PRJH94v6.mjs} +61 -34
- package/dist/doctor-watchman-wZhyTdp4.mjs +259 -0
- package/dist/{error-diagnostics-C-NMnhrk.mjs → error-diagnostics--v5HGOU0.mjs} +11 -11
- package/dist/{exec-CaErVv7t.mjs → exec-i8GDPwq9.mjs} +93 -6
- package/dist/{gc-DEmkg3Xh.mjs → gc-CyHMcKcn.mjs} +25 -471
- package/dist/{guide-CSmhMTf8.mjs → guide-dRaQJJk9.mjs} +681 -507
- package/dist/{hosted-android-E1Heoqnv.mjs → hosted-android-Bs7fytj7.mjs} +3 -3
- package/dist/{hosted-client-Bp4knSwu.mjs → hosted-client-C5G4h_OJ.mjs} +2 -2
- package/dist/{hosted-ios-BnbeYOUD.mjs → hosted-ios-Bik035eL.mjs} +1 -1
- package/dist/{hosted-logs-OcgIBvCT.mjs → hosted-logs-CI9Az9a4.mjs} +9 -9
- package/dist/{hosted-macos-DcxKjtfH.mjs → hosted-macos-DABm3ScO.mjs} +5 -5
- package/dist/{hosted-native-1Ebbig4w.mjs → hosted-native-DbV2aUVw.mjs} +13 -9
- package/dist/{idle-shutdown-IGyNV8Cr.mjs → idle-shutdown-DYiMBn34.mjs} +7 -8
- package/dist/{ios-DSfnPfse.mjs → ios-BWbHFZVz.mjs} +19 -7
- package/dist/{ios-Cr1h5gnO.mjs → ios-DCrkgXEM.mjs} +1 -1
- package/dist/ios-DYUr9LGc.mjs +8 -0
- package/dist/ios-ITYno9rO.mjs +2241 -0
- package/dist/{ios-device-pAN4t54-.mjs → ios-device-CJ_ZOGky.mjs} +3 -3
- package/dist/{ios-device-Ee7sDXfp.mjs → ios-device-CrW8aMb5.mjs} +1 -1
- package/dist/{ios-state-8L3lgum6.mjs → ios-state-By0XuLTQ.mjs} +1 -1
- package/dist/{launch-verify-lTnWZikR.mjs → launch-verify-DCveSE6d.mjs} +5 -5
- package/dist/{logs-BAaS7gS2.mjs → logs-Bao1HOMy.mjs} +13 -13
- package/dist/{macos-BIRQS90f.mjs → macos-ciyBdTY5.mjs} +194 -132
- package/dist/macos-nIOATJmR.mjs +2 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +349 -47
- package/dist/manifest-CX0d1IkZ.mjs +148 -0
- package/dist/{metro-g8NqiJp-.mjs → metro-DI2AjPF_.mjs} +196 -43
- package/dist/{metro-gateway-C-ijGI2F.mjs → metro-gateway-BxpJLIwh.mjs} +4 -4
- package/dist/{metro-store-CDDZHtPl.mjs → metro-store-BAHFcJm6.mjs} +16 -2
- package/dist/{build-plan-BDsSi09V.mjs → miss-reason-CjQCOKqq.mjs} +207 -249
- package/dist/{named-ports-C8m8EQs2.mjs → named-ports-B4iWH4E-.mjs} +70 -8
- package/dist/{native-runtime-BEK171xQ.mjs → native-runtime-BGxsbfny.mjs} +6 -6
- package/dist/{ndjson-PclOIwVY.mjs → ndjson-LGZAMsqa.mjs} +8 -4
- package/dist/offload-worker.d.mts +3 -45
- package/dist/offload-worker.mjs +11 -11
- package/dist/{ownership-DyRQru0q.mjs → ownership-EB0ySdGK.mjs} +3 -3
- package/dist/{page-QF_Ke10s.mjs → page-Bv9s2KwY.mjs} +1 -1
- package/dist/placement-log-Dxe34rJm.mjs +88 -0
- package/dist/plan-placement-BVY59qa8.mjs +290 -0
- package/dist/{ports-4nYqxPWC.mjs → ports-ByPc0_97.mjs} +3 -3
- package/dist/{prebuild-D7RUMkwN.mjs → prebuild-BKJ3wJI1.mjs} +5 -5
- package/dist/preview-BbSottmO.mjs +986 -0
- package/dist/{rolldown-runtime-BsOwBuO_.mjs → process-identity-Biv3arCO.mjs} +11 -1
- package/dist/project-B5eQ1USs.mjs +612 -0
- package/dist/{pull-request-pxnDCQzn.mjs → pull-request-IHNdMnG8.mjs} +1 -1
- package/dist/pull-requests.mjs +1 -1
- package/dist/react-native-ios-BMh2i25I.mjs +2 -0
- package/dist/react-native-ios-CSpIxexZ.mjs +2083 -0
- package/dist/{recordings-BNgsD1Tr.mjs → recordings-Bv8McZN4.mjs} +1 -1
- package/dist/{reload-DcRxj3qG.mjs → reload-rAPdqeRR.mjs} +14 -15
- package/dist/{remote-cache-Ci4DQYYj.mjs → remote-cache-N3hAEaAL.mjs} +5 -5
- package/dist/{run-CkE9y0nc.mjs → run-lAkle1-c.mjs} +5 -5
- package/dist/{server-bare-BkrSxSsZ.mjs → server-bare-CkIjnegq.mjs} +5 -6
- package/dist/server-expo-DGsdUGX2.mjs +2 -0
- package/dist/{server-expo-CHTyXD0G.mjs → server-expo-n3tUi3Em.mjs} +5 -6
- package/dist/{settings-SR9OmW9h.mjs → settings-2am7TSxp.mjs} +5 -5
- package/dist/{settings-Cfd-0r2d.mjs → settings-CxgngUZk.mjs} +116 -103
- package/dist/{settings-BBpMcDbD.mjs → settings-Djl-mpjX.mjs} +1 -1
- package/dist/settings.schema.json +198 -9
- package/dist/{simslim-BWNrc3M3.mjs → simslim-D9LkJxIO.mjs} +7 -7
- package/dist/{slot-launch-DmjBmpQV.mjs → slot-launch-HV_KtPIw.mjs} +6 -6
- package/dist/{spawn-claims-D0XfSe8u.mjs → spawn-claims-Kqiifsk2.mjs} +1 -1
- package/dist/{spawn-entry-jw19m8Nl.mjs → spawn-entry-Dcb7sDUz.mjs} +1 -0
- package/dist/{stage-CzaiwFsI.mjs → stage-BgaZJVZY.mjs} +14 -3
- package/dist/{start-AlfCPRVU.mjs → start-D8NbxNBb.mjs} +1 -1
- package/dist/{start-DUz3mYdb.mjs → start-DtxthMfI.mjs} +34 -27
- package/dist/{state-PeQiJuIu.mjs → state-D2KtnALG.mjs} +4 -4
- package/dist/{state-DyaNTgfR.mjs → state-Tp4uImDS.mjs} +5 -3
- package/dist/{state-B4PQFXMW.d.mts → state-lKh8shBp.d.mts} +2 -3
- package/dist/{stats-Bq4fJOdB.mjs → stats-8EJ5ivFT.mjs} +6 -6
- package/dist/{status-DlKvVJBE.mjs → status-BEeL6IKz.mjs} +6 -4
- package/dist/{status-BA2pehwf.mjs → status-BOyp0CUl.mjs} +31 -34
- package/dist/{stim-desktop-Cnz8CPnl.mjs → stim-desktop-C65jk_q2.mjs} +1 -1
- package/dist/{stim-installations-QMEI32v1.mjs → stim-installations-DbmUjsLv.mjs} +1 -1
- package/dist/stop-D0UIpZuh.mjs +72 -0
- package/dist/{stop-zF1y04f2.mjs → stop-DRipAg-e.mjs} +2 -2
- package/dist/{stop-DQIasgKp.mjs → stop-zDlknFoz.mjs} +79 -33
- package/dist/supervisor-run.d.mts +24 -22
- package/dist/supervisor-run.mjs +21 -22
- package/dist/{support-CsJNVfOc.mjs → support-CNqYkV0y.mjs} +7 -7
- package/dist/{support-WvD__tSV.mjs → support-DsNaFg6D.mjs} +5 -5
- package/dist/swiftpm-macos-aJzPAj1t.mjs +119 -0
- package/dist/{toolchain-DNyR3NPq.mjs → toolchain-C3xSoyUl.mjs} +475 -269
- package/dist/{trigger-Bemu8ytw.mjs → trigger-CAhmG-4s.mjs} +6 -6
- package/dist/trigger-CoalsMTV.mjs +2 -0
- package/dist/{warm-progress-DF4JRvYI.mjs → warm-progress-pFLB2e6P.mjs} +135 -38
- package/dist/{status-CzS4bPO9.mjs → watchman-BL1IdOtq.mjs} +75 -7
- package/dist/web-DFpFeZu5.mjs +2 -0
- package/dist/web-DbbrPUn0.mjs +127 -0
- package/dist/web-run.mjs +10 -10
- package/dist/{workspace-state-DqcCbpE7.mjs → workspace-state-CR9X86xJ.mjs} +3 -3
- package/dist/{ownership-BMLqyBgJ.mjs → workspaces-Djb2gfi9.mjs} +661 -23
- package/dist/{worktree-Be_7NLKy.mjs → worktree-BL4M1rhB.mjs} +252 -50
- package/dist/{worktree-j3IcFAI5.mjs → worktree-DV-A0LNL.mjs} +1 -1
- package/package.json +10 -5
- package/shim/bundle-response.cjs +2 -1
- package/shim/bundle-response.d.cts +1 -1
- package/shim/expo-metro-config.cjs +1 -1
- package/dist/build-progress-D0WkjCPd.mjs +0 -1036
- package/dist/build-slots-41v_d2x9.mjs +0 -142
- package/dist/cli-CYXb29oE.mjs +0 -51
- package/dist/deps-iKw0eD4P.mjs +0 -438
- package/dist/device-ios-C2Um-XUR.mjs +0 -412
- package/dist/errors-B6W7FkxQ.mjs +0 -15
- package/dist/guide-status-Du-ZQ3FD.mjs +0 -125
- package/dist/idle-BXG__1BA.mjs +0 -176
- package/dist/in-use-CvGOUn-x.mjs +0 -130
- package/dist/ios-BJ4XUSe1.mjs +0 -3867
- package/dist/native-run-D1Q56rAD.mjs +0 -158
- package/dist/preview-B-g9d7kV.mjs +0 -318
- package/dist/process-identity-BmRm1qV0.mjs +0 -12
- package/dist/project-D47Rh0ly.mjs +0 -276
- package/dist/server-expo-CeakhI8P.mjs +0 -2
- package/dist/state-BKa8wNN5.mjs +0 -148
- package/dist/stop-BIiM49EY.mjs +0 -48
- package/dist/stop-cause-rhmGfwvt.mjs +0 -97
- package/dist/trigger-CXts6qt1.mjs +0 -2
- package/dist/watchman-APYjXSQa.mjs +0 -48
- package/dist/workspace-process-lock-2mNzOlaB.mjs +0 -58
- package/dist/workspaces-Bcib97-6.mjs +0 -306
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
|
|
2
|
+
import { i as INSTALL_ERROR } from "./app-install-CFI4ptUL.mjs";
|
|
3
|
+
import { n as TOOL_ERROR_PREFIX } from "./ios-device-CrW8aMb5.mjs";
|
|
4
4
|
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-
|
|
1
|
+
import { a as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-CR9X86xJ.mjs";
|
|
2
2
|
import { HOSTED_METRO_REQUESTS_KEY, hostedMetroRequests, hostedNativeRecords, isJsonObject, parseHostedNativePlacement, unreadableHostedNative } from "@stim-cli/core/state";
|
|
3
3
|
//#region src/device-host/ios-state.ts
|
|
4
4
|
function readHostedNative(root, platform, slot) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { s as isAppLaunchError } from "./command-output-
|
|
3
|
-
import { o as readNdjsonGenerations } from "./ndjson-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
|
|
2
|
+
import { s as isAppLaunchError } from "./command-output-Bt8ygHE7.mjs";
|
|
3
|
+
import { o as readNdjsonGenerations } from "./ndjson-LGZAMsqa.mjs";
|
|
4
|
+
import { f as deviceShellArg, n as ANDROID_DISABLE_AUTO_LAUNCH_EXTRA, s as androidAppProcess } from "./app-install-CFI4ptUL.mjs";
|
|
5
|
+
import { t as DEV_MENU_LAUNCH_ARGS } from "./ios-device-CrW8aMb5.mjs";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
//#region src/engine/app-readiness.ts
|
|
8
8
|
const APP_READINESS_TIMEOUT_MS = 3e4;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as agentDeviceLiveness, u as readAgentDeviceRecords } from "./activity-
|
|
7
|
-
import { n as SOURCES, t as LEVELS } from "./ndjson-
|
|
8
|
-
import { o as connectHost } from "./hosted-client-
|
|
9
|
-
import { n as pullHostedNativeLogs, t as pullHostedMacosLogs } from "./hosted-logs-
|
|
10
|
-
import "./
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
1
|
+
import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { f as refuseNoProject, l as phaseLine, v as launchErrorPreview } from "./command-output-Bt8ygHE7.mjs";
|
|
3
|
+
import { H as projectDeviceSlots, V as parseDeviceSlotOption, _ as loadConfig$1, g as isPathPrefix } from "./config-DC5jEtd1.mjs";
|
|
4
|
+
import { r as readWorkspaceState$1, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
|
|
5
|
+
import { n as findCommandWorkspace } from "./project-B5eQ1USs.mjs";
|
|
6
|
+
import { n as agentDeviceLiveness, u as readAgentDeviceRecords } from "./activity-BSw0x84R.mjs";
|
|
7
|
+
import { n as SOURCES, t as LEVELS } from "./ndjson-LGZAMsqa.mjs";
|
|
8
|
+
import { o as connectHost } from "./hosted-client-C5G4h_OJ.mjs";
|
|
9
|
+
import { n as pullHostedNativeLogs, t as pullHostedMacosLogs } from "./hosted-logs-CI9Az9a4.mjs";
|
|
10
|
+
import { n as readHostedIos, t as readHostedAndroid } from "./ios-state-By0XuLTQ.mjs";
|
|
11
|
+
import { i as captureWorkspaceCrashes, t as errorDiagnostics } from "./error-diagnostics--v5HGOU0.mjs";
|
|
12
|
+
import "./hosted-macos-DABm3ScO.mjs";
|
|
13
13
|
import { t as watchStdoutReader } from "./stdout-reader-C8yjre1x.mjs";
|
|
14
14
|
import { realpathSync } from "node:fs";
|
|
15
15
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
@@ -251,7 +251,7 @@ const LEVEL_COLOURS = {
|
|
|
251
251
|
fatal: chalk.bgRed
|
|
252
252
|
};
|
|
253
253
|
function logsCommand(program) {
|
|
254
|
-
program.command("logs").description("Query this workspace's merged NDJSON log timeline (bundler, client, device, build, agent actions, maintenance). Prints and exits; an existing timeline with nothing matching is a successful, empty result. Use --follow to stream.").option("--slot <name>", "Only this device slot's records, plus the shared Metro and app client records once it has launched", parseDeviceSlotOption).option("--source <s...>", "Only these sources: metro, client, device, build, agent, maintenance, or all").option("--level <l>", `Minimum level: ${LEVELS.join(", ")}`).option("--since <d>", "Only records newer than this, e.g. 30s, 5m, 2h").option("--grep <re>", "Only records whose message matches this regular expression").option("--tail <n>", "Only the last n matching records").option("--errors", "Errors and fatals since the last marker, from metro, client and build, plus confirmed native app-crash reports and stim web browser errors. Add --source maintenance for maintenance failures, or --source device or --source all for general device errors.").option("--follow", "Keep streaming new records until interrupted").option("--json", "Emit the raw records, one per line (valid NDJSON; zero matches is zero bytes, exit 0)").action(async (opts) => {
|
|
254
|
+
program.command("logs").description("Query this workspace's merged NDJSON log timeline (bundler, client, device, build, agent actions, maintenance). Prints and exits; an existing timeline with nothing matching is a successful, empty result. Use --follow to stream.").option("--slot <name>", "Only this device slot's records, plus the shared Metro and app client records once it has launched", parseDeviceSlotOption).option("--source <s...>", "Only these sources: metro, client, device, build, agent, maintenance, placement, or all").option("--level <l>", `Minimum level: ${LEVELS.join(", ")}`).option("--since <d>", "Only records newer than this, e.g. 30s, 5m, 2h").option("--grep <re>", "Only records whose message matches this regular expression").option("--tail <n>", "Only the last n matching records").option("--errors", "Errors and fatals since the last marker, from metro, client and build, plus confirmed native app-crash reports and stim web browser errors. Add --source maintenance for maintenance failures, or --source device or --source all for general device errors.").option("--follow", "Keep streaming new records until interrupted").option("--json", "Emit the raw records, one per line (valid NDJSON; zero matches is zero bytes, exit 0)").action(async (opts) => {
|
|
255
255
|
const root = findCommandWorkspace(process.cwd());
|
|
256
256
|
if (!root) {
|
|
257
257
|
refuseNoProject({ json: false });
|
|
@@ -1,67 +1,55 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { i as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import { t as
|
|
21
|
-
import {
|
|
22
|
-
import { f as withNativeBuildRun } from "./native-run-D1Q56rAD.mjs";
|
|
23
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
1
|
+
import { t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-i8GDPwq9.mjs";
|
|
3
|
+
import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-Bt8ygHE7.mjs";
|
|
5
|
+
import { E as upsertProject, u as getConcurrencyLimits } from "./config-DC5jEtd1.mjs";
|
|
6
|
+
import { c as writeWorkspaceState, g as workspaceAgentDeviceDir, i as recordWorkspaceUse, u as ensureWorkspaceStorage, v as workspaceDir, x as workspaceLogsDir$1 } from "./workspace-state-CR9X86xJ.mjs";
|
|
7
|
+
import { d as projectRegistry, o as ownedDeviceLabel, r as findProjectRoot } from "./project-B5eQ1USs.mjs";
|
|
8
|
+
import { B as settingShapeErrors, I as resolveSettings, i as SETTING_SHAPE_REMEDY, mt as repoRoot, nt as gitCommonDir } from "./settings-CxgngUZk.mjs";
|
|
9
|
+
import { F as recordFinishedBuild, I as startBuildProgress, L as tapBuildLog, O as NO_BUILD_PROGRESS, P as recordBuildPhase } from "./budget-Dz-kyXLv.mjs";
|
|
10
|
+
import { M as acquireBuildSlot, P as releaseBuildSlot } from "./workspaces-Djb2gfi9.mjs";
|
|
11
|
+
import { a as spawnDeclared } from "./spawn-claims-Kqiifsk2.mjs";
|
|
12
|
+
import { E as sanitizeDeviceLabel } from "./ios-BWbHFZVz.mjs";
|
|
13
|
+
import { a as withWorkspaceProcessLock } from "./named-ports-B4iWH4E-.mjs";
|
|
14
|
+
import { i as macosProcess, n as macosDir, o as requiredMacosRecord, r as macosLogFile } from "./state-Tp4uImDS.mjs";
|
|
15
|
+
import { r as createNdjsonWriter } from "./ndjson-LGZAMsqa.mjs";
|
|
16
|
+
import { A as resolveBuildPlacement, C as setRemoteLogSink, D as parseBuildMachineOption, E as namedBuildMachine, O as requireLocalBuild, S as withNativeBuildRun, a as offloadBuild, c as placementLoad, i as closeOffload, l as remotePhaseText, n as buildPlacementCandidates, r as chooseBuildMachine, s as offloadPlacement, w as OffloadRefusal } from "./client-CuUo8Nvg.mjs";
|
|
17
|
+
import { o as connectHost } from "./hosted-client-C5G4h_OJ.mjs";
|
|
18
|
+
import { t as buildPlacementRecord } from "./placement-log-Dxe34rJm.mjs";
|
|
19
|
+
import { t as placeHostedMacos } from "./hosted-macos-DABm3ScO.mjs";
|
|
20
|
+
import { i as validateInfoPlist, t as resolveBundleExtras } from "./stage-BgaZJVZY.mjs";
|
|
21
|
+
import { r as stopMacosAppHeld, t as stopBundleInstances } from "./stop-D0UIpZuh.mjs";
|
|
24
22
|
import { closeSync, existsSync, mkdirSync, mkdtempSync, openSync, realpathSync, renameSync, rmSync } from "node:fs";
|
|
25
|
-
import { join
|
|
26
|
-
import { LOG_ROTATE_BYTES } from "@stim-cli/core";
|
|
23
|
+
import { join } from "node:path";
|
|
27
24
|
import { machineCapacity, readMacosRecord, validHostedAppArguments } from "@stim-cli/core/state";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
writer.write({
|
|
45
|
-
src: "build",
|
|
46
|
-
platform: "macos",
|
|
47
|
-
level: "debug",
|
|
48
|
-
msg
|
|
49
|
-
});
|
|
50
|
-
note(msg);
|
|
51
|
-
};
|
|
52
|
-
if (child.stdout) logLines(child.stdout, write);
|
|
53
|
-
if (child.stderr) logLines(child.stderr, write);
|
|
54
|
-
await new Promise((done, reject) => {
|
|
55
|
-
child.once("error", reject);
|
|
56
|
-
child.once("close", (code) => code === 0 ? done() : reject(/* @__PURE__ */ new Error(`swift ${args[0]} failed (${code}). See stim logs --source build.`)));
|
|
57
|
-
});
|
|
58
|
-
return stdout.trim();
|
|
25
|
+
import { LOG_ROTATE_BYTES } from "@stim-cli/core";
|
|
26
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
27
|
+
//#region src/macos/app-name.ts
|
|
28
|
+
const DOT = String.fromCodePoint(183);
|
|
29
|
+
const ELLIPSIS = String.fromCodePoint(8230);
|
|
30
|
+
const LABEL_MAX = 24;
|
|
31
|
+
const PRODUCT_MAX = 40;
|
|
32
|
+
function clip(text, max) {
|
|
33
|
+
const chars = [...text];
|
|
34
|
+
return chars.length <= max ? text : `${chars.slice(0, max - 1).join("")}${ELLIPSIS}`;
|
|
35
|
+
}
|
|
36
|
+
/** The visible app name for a run: `<product> <dot> <label>`, or just the product when the label is empty. */
|
|
37
|
+
function macosAppName(product, label) {
|
|
38
|
+
const name = clip(product.replace(/[\p{Cc}/:\\]+/gu, " ").trim(), PRODUCT_MAX) || "App";
|
|
39
|
+
const suffix = clip(sanitizeDeviceLabel(label), LABEL_MAX);
|
|
40
|
+
return suffix ? `${name} ${DOT} ${suffix}` : name;
|
|
59
41
|
}
|
|
60
|
-
|
|
42
|
+
function workspaceAppName(root, product) {
|
|
43
|
+
return macosAppName(product, ownedDeviceLabel(root));
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/macos/build.ts
|
|
47
|
+
async function buildMacosBundle({ root, recipe, bundle, bundleId, displayName, scratch, writer, note, record, buildMachine, progress = NO_BUILD_PROGRESS }) {
|
|
61
48
|
if (record) record.buildMachine = buildMachine;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
setRemoteLogSink((entry) => writer.write({
|
|
50
|
+
...entry,
|
|
51
|
+
platform: "macos"
|
|
52
|
+
}));
|
|
65
53
|
const write = (msg) => {
|
|
66
54
|
writer.write({
|
|
67
55
|
src: "build",
|
|
@@ -72,8 +60,22 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
72
60
|
note(msg);
|
|
73
61
|
};
|
|
74
62
|
let offloadFallback = null;
|
|
63
|
+
let asked = [];
|
|
64
|
+
let failedMachine;
|
|
75
65
|
const fallBack = (reason) => {
|
|
66
|
+
writer.write(buildPlacementRecord({
|
|
67
|
+
platform: "macos",
|
|
68
|
+
buildMachine,
|
|
69
|
+
candidates: asked,
|
|
70
|
+
event: "placement_fallback",
|
|
71
|
+
fallback: {
|
|
72
|
+
code: failedMachine ? "offload-failed" : "no-remote-mac-took-it",
|
|
73
|
+
reason,
|
|
74
|
+
machine: failedMachine
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
76
77
|
if (namedBuildMachine(buildMachine)) throw new OffloadRefusal(buildMachine, reason);
|
|
78
|
+
requireLocalBuild(buildMachine);
|
|
77
79
|
offloadFallback = reason;
|
|
78
80
|
if (record) record.offloadFallback = reason;
|
|
79
81
|
writer.write({
|
|
@@ -102,10 +104,11 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
102
104
|
let choice = null;
|
|
103
105
|
try {
|
|
104
106
|
try {
|
|
105
|
-
const { mode, machines } = buildPlacementCandidates(buildMachine);
|
|
107
|
+
const { mode, machines, localEnabled } = buildPlacementCandidates(buildMachine);
|
|
106
108
|
const here = machineCapacity();
|
|
107
109
|
const placement = offloadPlacement({
|
|
108
110
|
mode,
|
|
111
|
+
localEnabled,
|
|
109
112
|
machines: machines.length,
|
|
110
113
|
here,
|
|
111
114
|
unsupported: null,
|
|
@@ -114,29 +117,30 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
114
117
|
if (placement.offload) {
|
|
115
118
|
const chosen = await chooseBuildMachine({
|
|
116
119
|
projectRoot: root,
|
|
117
|
-
target:
|
|
118
|
-
platform: "macos",
|
|
119
|
-
local: macosToolchain()
|
|
120
|
-
},
|
|
120
|
+
target: recipe.offload.target(),
|
|
121
121
|
mode,
|
|
122
122
|
here,
|
|
123
123
|
machines,
|
|
124
124
|
selected: buildMachine,
|
|
125
|
-
note: (line) => write(`offload: ${line}`)
|
|
125
|
+
note: (line) => write(`offload: ${line}`),
|
|
126
|
+
onCandidates: (each) => asked = each
|
|
126
127
|
});
|
|
127
128
|
if (typeof chosen === "string") throw new Error(chosen);
|
|
128
129
|
choice = chosen;
|
|
130
|
+
failedMachine = chosen.machine;
|
|
131
|
+
writer.write(buildPlacementRecord({
|
|
132
|
+
platform: "macos",
|
|
133
|
+
buildMachine,
|
|
134
|
+
candidates: asked,
|
|
135
|
+
chose: {
|
|
136
|
+
machine: chosen.machine,
|
|
137
|
+
reason: `${placement.reason}${placementLoad(chosen)}`
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
129
140
|
write(`placement: ${choice.machine} (${placement.reason}${placementLoad(choice)})`);
|
|
130
141
|
const outcome = await offloadBuild({
|
|
131
142
|
choice,
|
|
132
|
-
request:
|
|
133
|
-
platform: "macos",
|
|
134
|
-
product,
|
|
135
|
-
infoPlist: relative(root, resolve(root, infoPlist)),
|
|
136
|
-
bundleId,
|
|
137
|
-
resources: Object.fromEntries(Object.entries(extras.resources).map(([destination, source]) => [destination, relative(repository, source)])),
|
|
138
|
-
assetCatalog: extras.assetCatalog ? relative(repository, extras.assetCatalog) : null
|
|
139
|
-
},
|
|
143
|
+
request: recipe.offload.request(bundleId),
|
|
140
144
|
stagingDir: join(staging, "offload"),
|
|
141
145
|
onPhase: (phase, line) => note(remotePhaseText(phase, line, choice.machine)),
|
|
142
146
|
onEnter: (phase) => {
|
|
@@ -161,21 +165,7 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
161
165
|
progress.place(null);
|
|
162
166
|
if (!outcome.ok) throw new Error(`${outcome.machine}: ${outcome.reason}`);
|
|
163
167
|
progress.step("install");
|
|
164
|
-
|
|
165
|
-
const plist = JSON.parse(getExecutor().runFile("plutil", [
|
|
166
|
-
"-convert",
|
|
167
|
-
"json",
|
|
168
|
-
"-o",
|
|
169
|
-
"-",
|
|
170
|
-
join(outcome.artifactPath, "Contents", "Info.plist")
|
|
171
|
-
]));
|
|
172
|
-
if (plist.CFBundleIdentifier !== bundleId || plist.CFBundleExecutable !== product || !existsSync(executable)) throw new Error("The fetched macOS bundle does not match the requested identity and executable.");
|
|
173
|
-
for (const destination of [...Object.keys(extras.resources), ...extras.assetCatalog ? ["Assets.car"] : []]) if (!existsSync(join(outcome.artifactPath, "Contents", "Resources", destination))) throw new Error(`The fetched macOS bundle lacks declared resource ${destination}.`);
|
|
174
|
-
getExecutor().runFile("codesign", [
|
|
175
|
-
"--verify",
|
|
176
|
-
"--strict",
|
|
177
|
-
outcome.artifactPath
|
|
178
|
-
]);
|
|
168
|
+
recipe.validateFetched(outcome.artifactPath, bundleId, displayName);
|
|
179
169
|
promote(outcome.artifactPath);
|
|
180
170
|
if (record) {
|
|
181
171
|
record.offloadedTo = outcome.machine;
|
|
@@ -188,6 +178,14 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
188
178
|
handoff: outcome.handoff ?? null
|
|
189
179
|
};
|
|
190
180
|
}
|
|
181
|
+
writer.write(buildPlacementRecord({
|
|
182
|
+
platform: "macos",
|
|
183
|
+
buildMachine,
|
|
184
|
+
stays: {
|
|
185
|
+
code: placement.code,
|
|
186
|
+
reason: placement.reason
|
|
187
|
+
}
|
|
188
|
+
}));
|
|
191
189
|
write(`placement: here (${placement.reason})`);
|
|
192
190
|
} catch (error) {
|
|
193
191
|
fallBack(error instanceof Error ? error.message : String(error));
|
|
@@ -197,36 +195,24 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
197
195
|
let slot;
|
|
198
196
|
try {
|
|
199
197
|
slot = await acquireBuildSlot({
|
|
198
|
+
automatic: buildMachine === "auto",
|
|
200
199
|
max: getConcurrencyLimits().maxBuilds,
|
|
201
200
|
root,
|
|
202
201
|
logFile: writer.file,
|
|
203
202
|
out: note,
|
|
204
203
|
waitingFor: (info) => progress.waitingFor(info, "build-slot")
|
|
205
204
|
});
|
|
205
|
+
requireLocalBuild(buildMachine);
|
|
206
206
|
if (record) record.builtOn = "here";
|
|
207
207
|
progress.step("compile");
|
|
208
|
-
await
|
|
209
|
-
"build",
|
|
210
|
-
"-c",
|
|
211
|
-
"debug",
|
|
212
|
-
"--product",
|
|
213
|
-
product,
|
|
214
|
-
"--scratch-path",
|
|
215
|
-
scratch,
|
|
216
|
-
"--jobs",
|
|
217
|
-
"2"
|
|
218
|
-
], writer, note);
|
|
219
|
-
const bin = await tool(root, [
|
|
220
|
-
"build",
|
|
221
|
-
"-c",
|
|
222
|
-
"debug",
|
|
223
|
-
"--scratch-path",
|
|
208
|
+
const bin = await recipe.compile({
|
|
224
209
|
scratch,
|
|
225
|
-
|
|
226
|
-
|
|
210
|
+
writer,
|
|
211
|
+
note
|
|
212
|
+
});
|
|
227
213
|
progress.step("install");
|
|
228
|
-
const staged = join(staging, `${product}.app`);
|
|
229
|
-
|
|
214
|
+
const staged = join(staging, `${recipe.product}.app`);
|
|
215
|
+
recipe.stage(bin, staged, bundleId, displayName);
|
|
230
216
|
promote(staged);
|
|
231
217
|
return {
|
|
232
218
|
bundleId,
|
|
@@ -247,6 +233,41 @@ async function buildMacosBundle({ root, product, infoPlist, bundle, bundleId, sc
|
|
|
247
233
|
}
|
|
248
234
|
}
|
|
249
235
|
//#endregion
|
|
236
|
+
//#region src/macos/plan.ts
|
|
237
|
+
function planMacos(root, buildMachineFlag) {
|
|
238
|
+
if (process.platform !== "darwin") throw new Error("stim macos requires a Mac with Swift installed.");
|
|
239
|
+
root = realpathSync(root);
|
|
240
|
+
if (!existsSync(join(root, "Package.swift"))) throw new Error("Run stim macos from the directory containing Package.swift.");
|
|
241
|
+
const repository = repoRoot(root);
|
|
242
|
+
const settings = resolveSettings({
|
|
243
|
+
projectPath: root,
|
|
244
|
+
gitCommonDir: gitCommonDir(root),
|
|
245
|
+
repoRoot: repository
|
|
246
|
+
});
|
|
247
|
+
const [shape] = settingShapeErrors(settings);
|
|
248
|
+
if (shape) throw new Error(`${shape} ${SETTING_SHAPE_REMEDY}`);
|
|
249
|
+
const selected = resolveBuildPlacement(buildMachineFlag);
|
|
250
|
+
if (selected.failure) throw Object.assign(new Error(selected.failure.message), selected.failure);
|
|
251
|
+
const macos = settings.macos;
|
|
252
|
+
if (!macos?.product || !macos.infoPlist) throw Object.assign(/* @__PURE__ */ new Error("Set macos.product and macos.infoPlist explicitly in .stim.json. See stim guide macos."), { code: "STIM_BAD_ARG" });
|
|
253
|
+
validateInfoPlist(root, macos.product, macos.infoPlist);
|
|
254
|
+
resolveBundleExtras(root, repository ?? root, macos.resources, macos.assetCatalog);
|
|
255
|
+
return {
|
|
256
|
+
platform: "macos",
|
|
257
|
+
product: macos.product,
|
|
258
|
+
buildMachine: selected.selected,
|
|
259
|
+
fingerprint: null,
|
|
260
|
+
cacheKey: null,
|
|
261
|
+
cacheHit: false,
|
|
262
|
+
provider: null,
|
|
263
|
+
cacheSkipped: false,
|
|
264
|
+
prebuild: null,
|
|
265
|
+
outcome: null,
|
|
266
|
+
expectedMs: null,
|
|
267
|
+
basis: 0
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
250
271
|
//#region src/commands/macos.ts
|
|
251
272
|
/**
|
|
252
273
|
* Builds the Debug app and launches it here, or with `remote` on that approved remote Mac. A named host never falls
|
|
@@ -258,7 +279,11 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
258
279
|
if (backend === "auto") throw Object.assign(/* @__PURE__ */ new Error("stim macos --remote auto is not available yet: automatic placement has not shipped. Name a hosting Mac from remote.machines."), { code: "STIM_BAD_ARG" });
|
|
259
280
|
if (process.platform !== "darwin") throw new Error("stim macos requires a Mac with Swift installed.");
|
|
260
281
|
root = realpathSync(root);
|
|
261
|
-
|
|
282
|
+
const operation = projectRegistry.selectMacos(root);
|
|
283
|
+
if ("problem" in operation) throw Object.assign(new Error(operation.problem.message), {
|
|
284
|
+
code: "STIM_NO_PROJECT",
|
|
285
|
+
remedy: operation.problem.remedy
|
|
286
|
+
});
|
|
262
287
|
const settings = resolveSettings({
|
|
263
288
|
projectPath: root,
|
|
264
289
|
gitCommonDir: gitCommonDir(root),
|
|
@@ -269,8 +294,7 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
269
294
|
const selected = resolveBuildPlacement(buildMachineFlag);
|
|
270
295
|
if (selected.failure) throw Object.assign(new Error(selected.failure.message), selected.failure);
|
|
271
296
|
const buildMachine = selected.selected;
|
|
272
|
-
const macos = settings
|
|
273
|
-
if (!macos?.product || !macos.infoPlist) throw Object.assign(/* @__PURE__ */ new Error("Set macos.product and macos.infoPlist explicitly in .stim.json. See stim guide macos."), { code: "STIM_BAD_ARG" });
|
|
297
|
+
const macos = (await operation.load()).prepare(settings);
|
|
274
298
|
ensureWorkspaceStorage(root);
|
|
275
299
|
return withNativeBuildRun(root, {
|
|
276
300
|
command: "macos",
|
|
@@ -286,7 +310,7 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
286
310
|
return withWorkspaceProcessLock(workspaceDir(root), "macos-launch", async () => {
|
|
287
311
|
const previous = requiredMacosRecord(root);
|
|
288
312
|
if (previous?.host && previous.host.machine !== remote) throw new Error(`This workspace's macOS app runs on ${previous.host.machine}. Run stim stop first, then stim macos${remote ? ` --remote ${remote}` : ""}.`);
|
|
289
|
-
if (remote && !validHostedAppArguments(macos.arguments
|
|
313
|
+
if (remote && !validHostedAppArguments(macos.arguments)) throw new Error("macos.arguments is too large for a hosted app: at most 32 arguments of 1024 characters (8192 in total), without NUL or line breaks.");
|
|
290
314
|
if (remote) (await connectHost(remote)).connection.close();
|
|
291
315
|
if (!previous?.host) await stopMacosAppHeld(root);
|
|
292
316
|
upsertProject(root, {});
|
|
@@ -298,7 +322,7 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
298
322
|
bundleId: "",
|
|
299
323
|
executable: join(bundle, "Contents", "MacOS", macos.product),
|
|
300
324
|
launchId: randomUUID(),
|
|
301
|
-
arguments: macos.arguments
|
|
325
|
+
arguments: macos.arguments,
|
|
302
326
|
supervisor: macosProcess(process.pid),
|
|
303
327
|
build: {
|
|
304
328
|
state: "running",
|
|
@@ -310,9 +334,20 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
310
334
|
hostLaunched: previous.hostLaunched ?? false
|
|
311
335
|
} : {}
|
|
312
336
|
};
|
|
313
|
-
const handoff = await buildBundle(root, macos
|
|
337
|
+
const handoff = await buildBundle(root, macos, record, remote !== void 0, note, progress);
|
|
314
338
|
progress.step("launch");
|
|
315
|
-
|
|
339
|
+
const launched = () => {
|
|
340
|
+
try {
|
|
341
|
+
recordBuildPhase(root, "macos", record.build.startedAt, "launch", progress.durations().launch ?? 0);
|
|
342
|
+
} catch (error) {
|
|
343
|
+
note(`The launch time could not be recorded in the build history: ${error?.message || error}`);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
if (!remote) {
|
|
347
|
+
const here = await launchHere(root, record);
|
|
348
|
+
launched();
|
|
349
|
+
return here;
|
|
350
|
+
}
|
|
316
351
|
const connection = await connectHost(remote);
|
|
317
352
|
const write = (patch) => writeWorkspaceState(root, { macos: {
|
|
318
353
|
...record,
|
|
@@ -325,7 +360,7 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
325
360
|
bundle: record.bundle,
|
|
326
361
|
bundleId: record.bundleId,
|
|
327
362
|
handoff,
|
|
328
|
-
arguments: macos.arguments
|
|
363
|
+
arguments: macos.arguments,
|
|
329
364
|
recorded: previous?.host,
|
|
330
365
|
reserved: (reserved) => {
|
|
331
366
|
placement = reserved;
|
|
@@ -344,6 +379,7 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
344
379
|
hostLaunched: run.launched
|
|
345
380
|
};
|
|
346
381
|
writeWorkspaceState(root, { macos: placed });
|
|
382
|
+
launched();
|
|
347
383
|
return placed;
|
|
348
384
|
} catch (error) {
|
|
349
385
|
write({
|
|
@@ -364,30 +400,30 @@ async function runMacos(root, note = console.error, remote, buildMachineFlag) {
|
|
|
364
400
|
}).finally(() => progress.clear());
|
|
365
401
|
}, { write: note });
|
|
366
402
|
}
|
|
367
|
-
async function buildBundle(root,
|
|
403
|
+
async function buildBundle(root, recipe, record, hosted, note, progress = NO_BUILD_PROGRESS) {
|
|
368
404
|
const started = Date.parse(record.build.startedAt);
|
|
369
405
|
const scratch = join(macosDir(root), "build");
|
|
370
406
|
writeWorkspaceState(root, { macos: record });
|
|
371
407
|
const writer = tapBuildLog(createNdjsonWriter(macosLogFile(root), { maxBytes: LOG_ROTATE_BYTES }), progress);
|
|
372
408
|
try {
|
|
373
|
-
const
|
|
409
|
+
const base = recipe.bundleId;
|
|
374
410
|
const bundleId = hosted ? base : `${base}.stim.${createHash("sha256").update(root).digest("hex").slice(0, 12)}`;
|
|
411
|
+
const displayName = workspaceAppName(root, record.product);
|
|
375
412
|
const built = await buildMacosBundle({
|
|
376
413
|
root,
|
|
377
|
-
|
|
378
|
-
infoPlist,
|
|
414
|
+
recipe,
|
|
379
415
|
bundle: record.bundle,
|
|
380
416
|
bundleId,
|
|
417
|
+
displayName,
|
|
381
418
|
scratch,
|
|
382
419
|
writer,
|
|
383
420
|
note,
|
|
384
421
|
progress,
|
|
385
422
|
record: record.build,
|
|
386
|
-
buildMachine: record.build.buildMachine
|
|
387
|
-
resources: extras.resources,
|
|
388
|
-
assetCatalog: extras.assetCatalog
|
|
423
|
+
buildMachine: record.build.buildMachine
|
|
389
424
|
});
|
|
390
425
|
record.bundleId = built.bundleId;
|
|
426
|
+
record.displayName = displayName;
|
|
391
427
|
record.bundle = realpathSync(record.bundle);
|
|
392
428
|
record.executable = realpathSync(join(record.bundle, "Contents", "MacOS", record.product));
|
|
393
429
|
record.build = {
|
|
@@ -397,7 +433,7 @@ async function buildBundle(root, infoPlist, record, hosted, note, extras, progre
|
|
|
397
433
|
durationMs: Date.now() - started
|
|
398
434
|
};
|
|
399
435
|
writeWorkspaceState(root, { macos: record });
|
|
400
|
-
recordMacosBuild(root, record.build);
|
|
436
|
+
recordMacosBuild(root, record.build, progress.steps());
|
|
401
437
|
return built.handoff;
|
|
402
438
|
} catch (error) {
|
|
403
439
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -420,13 +456,13 @@ async function buildBundle(root, infoPlist, record, hosted, note, extras, progre
|
|
|
420
456
|
supervisor: void 0,
|
|
421
457
|
build
|
|
422
458
|
} });
|
|
423
|
-
recordMacosBuild(root, build);
|
|
459
|
+
recordMacosBuild(root, build, progress.steps());
|
|
424
460
|
throw error;
|
|
425
461
|
} finally {
|
|
426
462
|
writer.close();
|
|
427
463
|
}
|
|
428
464
|
}
|
|
429
|
-
function recordMacosBuild(root, build) {
|
|
465
|
+
function recordMacosBuild(root, build, compileSteps) {
|
|
430
466
|
recordFinishedBuild(root, {
|
|
431
467
|
platform: "macos",
|
|
432
468
|
status: build.state === "ok" ? "ok" : "failed",
|
|
@@ -441,10 +477,12 @@ function recordMacosBuild(root, build) {
|
|
|
441
477
|
buildMachine: build.buildMachine,
|
|
442
478
|
builtOn: build.builtOn,
|
|
443
479
|
offloadedTo: build.offloadedTo,
|
|
444
|
-
offloadFallback: build.offloadFallback
|
|
480
|
+
offloadFallback: build.offloadFallback,
|
|
481
|
+
...compileSteps === null ? {} : { compileSteps }
|
|
445
482
|
});
|
|
446
483
|
}
|
|
447
484
|
async function launchHere(root, record) {
|
|
485
|
+
await stopBundleInstances(root);
|
|
448
486
|
const fd = openSync(join(workspaceLogsDir$1(root), "macos-supervisor.log"), "a");
|
|
449
487
|
let child;
|
|
450
488
|
try {
|
|
@@ -485,19 +523,43 @@ function launchPayload(root, record) {
|
|
|
485
523
|
platform: "macos",
|
|
486
524
|
...record
|
|
487
525
|
};
|
|
488
|
-
const { product, launchId, build, host } = record;
|
|
526
|
+
const { product, displayName, launchId, build, host } = record;
|
|
489
527
|
return {
|
|
490
528
|
agentDevice,
|
|
491
529
|
platform: "macos",
|
|
492
530
|
product,
|
|
531
|
+
displayName,
|
|
493
532
|
launchId,
|
|
494
533
|
build,
|
|
495
534
|
host
|
|
496
535
|
};
|
|
497
536
|
}
|
|
498
537
|
function macosCommand(program) {
|
|
499
|
-
program.command("macos").description("Build and launch an owned Swift Package macOS Debug app.").option("--remote-build <value>", "Build on auto, local, or one named machine; a name refuses without fallback", parseBuildMachineOption).option("--json", "print one launch payload; build output goes to stderr").option("--remote <machine>", "run it on this approved remote Mac from remote.machines").action(async (options) => {
|
|
500
|
-
const root = findProjectRoot
|
|
538
|
+
program.command("macos").description("Build and launch an owned Swift Package macOS Debug app.").option("--remote-build <value>", "Build on auto, local, or one named machine; a name refuses without fallback", parseBuildMachineOption).option("--json", "print one launch or plan payload; build output goes to stderr").option("--plan", "validate the next SwiftPM Debug build without building or launching").option("--remote <machine>", "run it on this approved remote Mac from remote.machines").action(async (options) => {
|
|
539
|
+
const root = findProjectRoot(process.cwd());
|
|
540
|
+
if (options.plan) {
|
|
541
|
+
try {
|
|
542
|
+
if (!root) throw new Error("Run stim macos from the Swift Package directory.");
|
|
543
|
+
if (options.remote !== void 0) throw Object.assign(/* @__PURE__ */ new Error("--remote selects a launch host and does not apply to --plan."), { code: "STIM_BAD_ARG" });
|
|
544
|
+
const plan = planMacos(root, options.remoteBuild);
|
|
545
|
+
if (options.json) console.log(JSON.stringify(plan));
|
|
546
|
+
else {
|
|
547
|
+
console.log(phaseLine("plan", `macos ${plan.product}: SwiftPM Debug build, then stage and launch`));
|
|
548
|
+
console.log(phaseLine("build", `selection: ${plan.buildMachine}; worker availability is not checked`));
|
|
549
|
+
console.log(phaseLine("expect", "unknown: SwiftPM determines incremental work when the build runs"));
|
|
550
|
+
}
|
|
551
|
+
} catch (error) {
|
|
552
|
+
const failure = {
|
|
553
|
+
code: error.code ?? "STIM_BAD_ARG",
|
|
554
|
+
message: error instanceof Error ? error.message : String(error),
|
|
555
|
+
remedy: error.remedy ?? "Check the macOS project settings in stim guide macos."
|
|
556
|
+
};
|
|
557
|
+
console.error(failure.message);
|
|
558
|
+
if (options.json) console.log(JSON.stringify(failure));
|
|
559
|
+
process.exitCode = 1;
|
|
560
|
+
}
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
501
563
|
if (!root) throw new Error("Run stim macos from the Swift Package directory.");
|
|
502
564
|
const record = await runMacos(root, console.error, options.remote, options.remoteBuild).catch((error) => {
|
|
503
565
|
const remedy = error.remedy;
|
|
@@ -511,4 +573,4 @@ function macosCommand(program) {
|
|
|
511
573
|
});
|
|
512
574
|
}
|
|
513
575
|
//#endregion
|
|
514
|
-
export {
|
|
576
|
+
export { runMacos as n, macosCommand as t };
|
package/dist/macos-run.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as runMacosSupervisor, t as logLines } from "./run-
|
|
1
|
+
import { n as runMacosSupervisor, t as logLines } from "./run-lAkle1-c.mjs";
|
|
2
2
|
export { logLines, runMacosSupervisor };
|