stim 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -8
- package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
- package/dist/act-DHAw2A2S.mjs +2667 -0
- package/dist/activity-BzVfHSrY.mjs +1376 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
- package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
- package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
- package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
- package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/api.d.mts +740 -8
- package/dist/api.mjs +585 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
- package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
- package/dist/budget-Bs6SxxzO.mjs +9154 -0
- package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
- package/dist/build-cache-DmyR9Zzc.mjs +602 -0
- package/dist/build-plan-CaFskB7_.mjs +188 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-0DYf8QhQ.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-B7QVOlCr.d.mts +253 -0
- package/dist/client-UXD70ZbM.mjs +1406 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
- package/dist/config-CYcBF478.mjs +949 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
- package/dist/device-DCxH7_By.mjs +1068 -0
- package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
- package/dist/device-host-worker.mjs +65 -61
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
- package/dist/doctor-BLHCYxzi.mjs +2 -0
- package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
- package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
- package/dist/exec-H20xSg2T.d.mts +65 -0
- package/dist/exec-_UbtCQcG.mjs +750 -0
- package/dist/gc-C-WwL0yi.mjs +3 -0
- package/dist/{gc-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
- package/dist/git-C3iTsJaZ.mjs +73 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
- package/dist/idle-BVeRGroT.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
- package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
- package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
- package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
- package/dist/ios-signing-DTTIChGs.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
- package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
- package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
- package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
- package/dist/logs-BS00Anxf.mjs +352 -0
- package/dist/logs-CMm05HxN.mjs +255 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
- package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +122 -247
- package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
- package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
- package/dist/native-android-JACyjTZs.mjs +844 -0
- package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-DY_RLx3C.mjs +277 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +1 -46
- package/dist/offload-worker.mjs +197 -66
- package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
- package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
- package/dist/prebuild-uD_ipCxF.mjs +449 -0
- package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
- package/dist/pull-request-zjCSAryH.d.mts +120 -0
- package/dist/pull-requests.d.mts +1 -119
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
- package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
- package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
- package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
- package/dist/reload-DzjSl5P_.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
- package/dist/result-DNiS-tTP.mjs +434 -0
- package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
- package/dist/selection-CSl9i5qU.mjs +619 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
- package/dist/server-expo-C-90EhcG.mjs +2 -0
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
- package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
- package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
- package/dist/settings-T1gtc3bf.mjs +114 -0
- package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
- package/dist/settings.schema.json +163 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-DF8VfT64.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-BIS0ydsV.mjs +183 -0
- package/dist/{start-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
- package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
- package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
- package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
- package/dist/stats-report-BFfMpWWF.mjs +16 -0
- package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
- package/dist/status-CSi6tlRq.mjs +2 -0
- package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-GDCfqpTE.mjs} +187 -22
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-C12we7lz.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
- package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
- package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +63 -27
- package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
- package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
- package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
- package/dist/toolchain-DhKwp9iI.mjs +2 -0
- package/dist/toolchain-Hp9sCpK4.mjs +873 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
- package/dist/trigger-Bf3uDcpv.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
- package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
- package/dist/web-DknQETPs.mjs +2 -0
- package/dist/web-run.mjs +11 -12
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
- package/dist/worktree-CK2MpJW5.mjs +2 -0
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
- package/dist/xcode-Zlx3qjEs.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
package/dist/api-qvOzWyfO.mjs
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
|
|
2
|
-
import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
|
|
3
|
-
import { realpathSync } from "node:fs";
|
|
4
|
-
import { isAbsolute } from "node:path";
|
|
5
|
-
//#region src/api.ts
|
|
6
|
-
var StimError = class extends Error {
|
|
7
|
-
code;
|
|
8
|
-
remedy;
|
|
9
|
-
details;
|
|
10
|
-
constructor({ code, message, remedy = null, details }) {
|
|
11
|
-
super(message);
|
|
12
|
-
this.name = "StimError";
|
|
13
|
-
this.code = code;
|
|
14
|
-
this.remedy = remedy;
|
|
15
|
-
this.details = details;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Creates a client without starting processes or changing the caller's cwd, environment, or signal handlers.
|
|
20
|
-
* Each operation runs in a separate Stim worker. Resources remain workspace-owned until stop() is called.
|
|
21
|
-
*/
|
|
22
|
-
function createStim(options) {
|
|
23
|
-
let projectRoot;
|
|
24
|
-
try {
|
|
25
|
-
projectRoot = realpathSync(options.projectRoot);
|
|
26
|
-
} catch (error) {
|
|
27
|
-
throw new StimError({
|
|
28
|
-
code: "STIM_NO_PROJECT",
|
|
29
|
-
message: `Could not resolve projectRoot ${options.projectRoot}: ${error instanceof Error ? error.message : String(error)}`,
|
|
30
|
-
remedy: "Pass the path to an existing, readable app directory."
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
for (const [name, path] of [["home", options.home], ["buildCache", options.buildCache]]) if (path !== void 0 && !isAbsolute(path)) throw new StimError({
|
|
34
|
-
code: "STIM_BAD_ARG",
|
|
35
|
-
message: `${name} must be an absolute path.`
|
|
36
|
-
});
|
|
37
|
-
const context = {
|
|
38
|
-
...options,
|
|
39
|
-
projectRoot,
|
|
40
|
-
env: {
|
|
41
|
-
...process.env,
|
|
42
|
-
...options.home === void 0 ? {} : { STIM_HOME: options.home },
|
|
43
|
-
...options.buildCache === void 0 ? {} : { STIM_BUILD_CACHE: options.buildCache },
|
|
44
|
-
FORCE_COLOR: "0"
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
projectRoot,
|
|
49
|
-
build: (({ signal, ...request }) => invoke(context, {
|
|
50
|
-
operation: "build",
|
|
51
|
-
options: request
|
|
52
|
-
}, signal)),
|
|
53
|
-
run: (({ signal, ...request }) => invoke(context, {
|
|
54
|
-
operation: "run",
|
|
55
|
-
options: request
|
|
56
|
-
}, signal)),
|
|
57
|
-
stop({ signal, ...request } = {}) {
|
|
58
|
-
return invoke(context, {
|
|
59
|
-
operation: "stop",
|
|
60
|
-
options: request
|
|
61
|
-
}, signal);
|
|
62
|
-
},
|
|
63
|
-
diagnostics({ signal, ...request } = {}) {
|
|
64
|
-
if (request.tail !== void 0 && (!Number.isSafeInteger(request.tail) || request.tail < 0)) return Promise.reject(new StimError({
|
|
65
|
-
code: "STIM_BAD_ARG",
|
|
66
|
-
message: "tail must be a non-negative integer."
|
|
67
|
-
}));
|
|
68
|
-
return invoke(context, {
|
|
69
|
-
operation: "diagnostics",
|
|
70
|
-
options: request
|
|
71
|
-
}, signal);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function cancelled() {
|
|
76
|
-
return new StimError({
|
|
77
|
-
code: "STIM_CANCELLED",
|
|
78
|
-
message: "The Stim operation was cancelled."
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function invoke(context, request, signal) {
|
|
82
|
-
if (signal?.aborted) return Promise.reject(cancelled());
|
|
83
|
-
return new Promise((resolve, reject) => {
|
|
84
|
-
const child = getExecutor().spawn(process.execPath, [spawnEntry("api-run")], {
|
|
85
|
-
cwd: context.projectRoot,
|
|
86
|
-
env: context.env,
|
|
87
|
-
stdio: [
|
|
88
|
-
"ignore",
|
|
89
|
-
"pipe",
|
|
90
|
-
"pipe",
|
|
91
|
-
"ipc"
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
let response;
|
|
95
|
-
let transportError;
|
|
96
|
-
let callbackError;
|
|
97
|
-
let callbackFailed = false;
|
|
98
|
-
let stderr = "";
|
|
99
|
-
const abort = () => {
|
|
100
|
-
child.send?.({ operation: "cancel" }, (error) => {
|
|
101
|
-
if (error) child.kill("SIGINT");
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
signal?.addEventListener("abort", abort, { once: true });
|
|
105
|
-
if (signal?.aborted) abort();
|
|
106
|
-
const progress = (stream, message) => {
|
|
107
|
-
if (stream === "stderr") stderr = (stderr + message).slice(-16384);
|
|
108
|
-
if (!context.onProgress || callbackFailed) return;
|
|
109
|
-
try {
|
|
110
|
-
context.onProgress({
|
|
111
|
-
stream,
|
|
112
|
-
message
|
|
113
|
-
});
|
|
114
|
-
} catch (error) {
|
|
115
|
-
callbackError = error;
|
|
116
|
-
callbackFailed = true;
|
|
117
|
-
abort();
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
child.stdout?.setEncoding("utf8").on("data", (chunk) => progress("stdout", chunk));
|
|
121
|
-
child.stderr?.setEncoding("utf8").on("data", (chunk) => progress("stderr", chunk));
|
|
122
|
-
child.on("message", (message) => {
|
|
123
|
-
response = message;
|
|
124
|
-
});
|
|
125
|
-
child.on("error", (error) => {
|
|
126
|
-
transportError = error;
|
|
127
|
-
});
|
|
128
|
-
child.on("close", (code, exitSignal) => {
|
|
129
|
-
signal?.removeEventListener("abort", abort);
|
|
130
|
-
if (callbackFailed) return reject(callbackError);
|
|
131
|
-
if (signal?.aborted) return reject(cancelled());
|
|
132
|
-
if (transportError) return reject(new StimError({
|
|
133
|
-
code: "STIM_WORKER_FAILED",
|
|
134
|
-
message: transportError.message,
|
|
135
|
-
details: { stderr }
|
|
136
|
-
}));
|
|
137
|
-
if (response?.ok === false) return reject(new StimError(response.error));
|
|
138
|
-
if (code === 0 && response?.ok) return resolve(response.result);
|
|
139
|
-
reject(new StimError({
|
|
140
|
-
code: "STIM_WORKER_FAILED",
|
|
141
|
-
message: `Stim worker exited without a result (${exitSignal ?? code}).`,
|
|
142
|
-
details: { stderr }
|
|
143
|
-
}));
|
|
144
|
-
});
|
|
145
|
-
child.send?.({
|
|
146
|
-
...request,
|
|
147
|
-
projectRoot: context.projectRoot
|
|
148
|
-
}, (error) => {
|
|
149
|
-
if (error) transportError = error;
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
//#endregion
|
|
154
|
-
export { createStim as n, StimError as t };
|
package/dist/api-run.mjs
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import { E as upsertProject, p as getProject, y as refuseRelativeStimPaths } from "./config-BYDxlMY3.mjs";
|
|
2
|
-
import { t as StimError } from "./api-qvOzWyfO.mjs";
|
|
3
|
-
import { K as resolveProjectSettings, Q as settingShapeErrors, a as SETTING_SHAPE_REMEDY } from "./settings-B717odTD.mjs";
|
|
4
|
-
import { i as recordWorkspaceUse, p as ensureWorkspaceStorage, w as workspaceLogsDir$1, x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
|
|
5
|
-
import { l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
|
|
6
|
-
import { d as projectRegistry } from "./project-_phNIJfs.mjs";
|
|
7
|
-
import { Dt as recordFinishedBuild, Ot as startBuildProgress, kt as tapBuildLog } from "./budget-f7516Zk0.mjs";
|
|
8
|
-
import { S as withNativeBuildRun, x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
|
|
9
|
-
import { n as cancelledError, r as throwIfCancelled } from "./cancellation-C_22VQTH.mjs";
|
|
10
|
-
import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
|
|
11
|
-
import { y as resolveBuildPlacement } from "./client-qQAaXSUs.mjs";
|
|
12
|
-
import { n as macosDir } from "./state-CG_OFoaA.mjs";
|
|
13
|
-
import { n as buildAndroidOperation, t as buildIosOperation } from "./build-DYDbfkk5.mjs";
|
|
14
|
-
import { i as runAndroidOperation } from "./android-DCKZrNvV.mjs";
|
|
15
|
-
import { r as runIosOperation } from "./ios-Ce7bc7br.mjs";
|
|
16
|
-
import { i as buildMacosBundle, n as runMacos } from "./macos-Ch5VJmcS.mjs";
|
|
17
|
-
import { c as stopWorkspaceNow } from "./stop-BNmBMi1F.mjs";
|
|
18
|
-
import { t as runWeb } from "./web-BDBMxDpx.mjs";
|
|
19
|
-
import { mkdirSync, mkdtempSync, realpathSync, rmSync } from "node:fs";
|
|
20
|
-
import { join } from "node:path";
|
|
21
|
-
import { queryJsonLogs } from "@stim-cli/core/state";
|
|
22
|
-
//#region src/commands/macos-build.ts
|
|
23
|
-
const note = (line) => console.error(line);
|
|
24
|
-
async function buildMacosOperation(root, options) {
|
|
25
|
-
if (process.platform !== "darwin") throw new Error("Building a macOS app requires a Mac with Swift installed.");
|
|
26
|
-
root = realpathSync(root);
|
|
27
|
-
const selected = projectRegistry.selectMacos(root);
|
|
28
|
-
if ("problem" in selected) throw Object.assign(new Error(selected.problem.message), {
|
|
29
|
-
code: "STIM_NO_PROJECT",
|
|
30
|
-
remedy: selected.problem.remedy
|
|
31
|
-
});
|
|
32
|
-
const { settings } = resolveProjectSettings(root);
|
|
33
|
-
const [shape] = settingShapeErrors(settings);
|
|
34
|
-
if (shape) throw Object.assign(/* @__PURE__ */ new Error(`${shape} ${SETTING_SHAPE_REMEDY}`), { code: "STIM_BAD_ARG" });
|
|
35
|
-
const placement = resolveBuildPlacement(options.remoteBuild);
|
|
36
|
-
if (placement.failure) throw Object.assign(new Error(placement.failure.message), placement.failure);
|
|
37
|
-
const recipe = (await selected.load()).prepare(settings);
|
|
38
|
-
ensureWorkspaceStorage(root);
|
|
39
|
-
return withNativeBuildRun(root, {
|
|
40
|
-
command: "build",
|
|
41
|
-
platform: "macos"
|
|
42
|
-
}, async (claim) => {
|
|
43
|
-
if (!getProject(root)) upsertProject(root, {});
|
|
44
|
-
recordWorkspaceUse(root);
|
|
45
|
-
const started = Date.now();
|
|
46
|
-
const progress = startBuildProgress({
|
|
47
|
-
root,
|
|
48
|
-
platform: "macos",
|
|
49
|
-
slot: "default",
|
|
50
|
-
claim,
|
|
51
|
-
note
|
|
52
|
-
});
|
|
53
|
-
const logs = workspaceLogsDir$1(root);
|
|
54
|
-
const writer = tapBuildLog(createNdjsonWriter(join(logs, "build-artifact-macos.ndjson"), { truncate: true }), progress);
|
|
55
|
-
const build = {
|
|
56
|
-
state: "running",
|
|
57
|
-
startedAt: new Date(started).toISOString(),
|
|
58
|
-
buildMachine: placement.selected
|
|
59
|
-
};
|
|
60
|
-
let directory;
|
|
61
|
-
let succeeded = false;
|
|
62
|
-
try {
|
|
63
|
-
const artifacts = join(workspaceDir(root), "artifacts");
|
|
64
|
-
mkdirSync(artifacts, { recursive: true });
|
|
65
|
-
directory = mkdtempSync(join(artifacts, "macos-"));
|
|
66
|
-
const bundle = join(directory, `${recipe.product}.app`);
|
|
67
|
-
await buildMacosBundle({
|
|
68
|
-
root,
|
|
69
|
-
recipe,
|
|
70
|
-
bundle,
|
|
71
|
-
bundleId: recipe.bundleId,
|
|
72
|
-
scratch: join(macosDir(root), "build"),
|
|
73
|
-
writer,
|
|
74
|
-
note,
|
|
75
|
-
progress,
|
|
76
|
-
record: build,
|
|
77
|
-
buildMachine: placement.selected
|
|
78
|
-
});
|
|
79
|
-
throwIfCancelled(runCancellationSignal(), "macOS build");
|
|
80
|
-
const executable = realpathSync(join(bundle, "Contents", "MacOS", recipe.product));
|
|
81
|
-
build.state = "ok";
|
|
82
|
-
succeeded = true;
|
|
83
|
-
return {
|
|
84
|
-
product: recipe.product,
|
|
85
|
-
bundle,
|
|
86
|
-
bundleId: recipe.bundleId,
|
|
87
|
-
executable,
|
|
88
|
-
build,
|
|
89
|
-
logs: { dir: logs }
|
|
90
|
-
};
|
|
91
|
-
} catch (error) {
|
|
92
|
-
const failure = runCancellationSignal()?.aborted ? cancelledError("macOS build", error) : error;
|
|
93
|
-
build.state = "failed";
|
|
94
|
-
build.error = failure instanceof Error ? failure.message : String(failure);
|
|
95
|
-
build.errorCode = failure.code;
|
|
96
|
-
throw failure;
|
|
97
|
-
} finally {
|
|
98
|
-
build.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
99
|
-
build.durationMs = Date.now() - started;
|
|
100
|
-
try {
|
|
101
|
-
recordFinishedBuild(root, {
|
|
102
|
-
platform: "macos",
|
|
103
|
-
status: build.state,
|
|
104
|
-
configuration: "Debug",
|
|
105
|
-
fingerprint: null,
|
|
106
|
-
cacheKey: null,
|
|
107
|
-
cacheHit: false,
|
|
108
|
-
cacheSkipped: false,
|
|
109
|
-
durationMs: build.durationMs,
|
|
110
|
-
startedAt: build.startedAt,
|
|
111
|
-
errorCode: build.errorCode,
|
|
112
|
-
buildMachine: build.buildMachine,
|
|
113
|
-
builtOn: build.builtOn,
|
|
114
|
-
offloadedTo: build.offloadedTo,
|
|
115
|
-
offloadFallback: build.offloadFallback,
|
|
116
|
-
compileSteps: progress.steps()
|
|
117
|
-
}, { artifactOnly: true });
|
|
118
|
-
} catch (error) {
|
|
119
|
-
note(phaseLine("state", `could not record the build: ${error?.message || error}`));
|
|
120
|
-
} finally {
|
|
121
|
-
if (!succeeded && directory) rmSync(directory, {
|
|
122
|
-
recursive: true,
|
|
123
|
-
force: true
|
|
124
|
-
});
|
|
125
|
-
writer.close();
|
|
126
|
-
progress.clear();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}, { write: note });
|
|
130
|
-
}
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/api-run.ts
|
|
133
|
-
async function dispatch({ projectRoot: root, ...request }) {
|
|
134
|
-
let directory;
|
|
135
|
-
try {
|
|
136
|
-
refuseRelativeStimPaths();
|
|
137
|
-
directory = workspaceLogsDir$1(root);
|
|
138
|
-
if (request.operation === "diagnostics") {
|
|
139
|
-
const { tail = 200, errors = false } = request.options;
|
|
140
|
-
return {
|
|
141
|
-
ok: true,
|
|
142
|
-
result: {
|
|
143
|
-
directory,
|
|
144
|
-
records: tail === 0 ? [] : queryJsonLogs({
|
|
145
|
-
dir: directory,
|
|
146
|
-
tail,
|
|
147
|
-
errorsOnly: errors
|
|
148
|
-
})
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
if (request.operation === "stop") {
|
|
153
|
-
const result = await stopWorkspaceNow({
|
|
154
|
-
root,
|
|
155
|
-
slot: request.options.slot
|
|
156
|
-
});
|
|
157
|
-
if ("refusal" in result) throw new StimError({
|
|
158
|
-
...result.refusal,
|
|
159
|
-
details: result.remote
|
|
160
|
-
});
|
|
161
|
-
return {
|
|
162
|
-
ok: true,
|
|
163
|
-
result
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
if (request.operation === "build") switch (request.options.platform) {
|
|
167
|
-
case "ios": return {
|
|
168
|
-
ok: true,
|
|
169
|
-
result: {
|
|
170
|
-
platform: "ios",
|
|
171
|
-
facts: await buildIosOperation(root, request.options)
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
case "android": return {
|
|
175
|
-
ok: true,
|
|
176
|
-
result: {
|
|
177
|
-
platform: "android",
|
|
178
|
-
facts: await buildAndroidOperation(root, request.options)
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
case "macos": return {
|
|
182
|
-
ok: true,
|
|
183
|
-
result: {
|
|
184
|
-
platform: "macos",
|
|
185
|
-
facts: await buildMacosOperation(root, request.options)
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
default: throw new StimError({
|
|
189
|
-
code: "STIM_BAD_ARG",
|
|
190
|
-
message: "Unknown Stim build platform."
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
const options = request.options;
|
|
194
|
-
switch (options.platform) {
|
|
195
|
-
case "ios": {
|
|
196
|
-
let error;
|
|
197
|
-
const result = await runIosOperation(root, options, {}, (failure) => {
|
|
198
|
-
error = failure;
|
|
199
|
-
});
|
|
200
|
-
if (!result) throw new StimError({
|
|
201
|
-
code: error?.code ?? "STIM_RUN_FAILED",
|
|
202
|
-
message: error?.message ?? "The iOS run failed.",
|
|
203
|
-
remedy: error?.remedy,
|
|
204
|
-
details: error
|
|
205
|
-
});
|
|
206
|
-
return {
|
|
207
|
-
ok: true,
|
|
208
|
-
result: {
|
|
209
|
-
platform: "ios",
|
|
210
|
-
facts: result.facts
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
case "android": {
|
|
215
|
-
const result = await runAndroidOperation(root, options);
|
|
216
|
-
if (!result.ok || !result.facts) throw new StimError({
|
|
217
|
-
code: result.error?.code ?? "STIM_RUN_FAILED",
|
|
218
|
-
message: result.error?.message ?? "The Android run failed.",
|
|
219
|
-
remedy: result.error?.remedy
|
|
220
|
-
});
|
|
221
|
-
return {
|
|
222
|
-
ok: true,
|
|
223
|
-
result: {
|
|
224
|
-
platform: "android",
|
|
225
|
-
facts: result.facts
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
case "macos": {
|
|
230
|
-
const record = await runMacos(root, console.error, void 0, options.remoteBuild);
|
|
231
|
-
return {
|
|
232
|
-
ok: true,
|
|
233
|
-
result: {
|
|
234
|
-
platform: "macos",
|
|
235
|
-
facts: {
|
|
236
|
-
product: record.product,
|
|
237
|
-
bundle: record.bundle,
|
|
238
|
-
bundleId: record.bundleId,
|
|
239
|
-
executable: record.executable,
|
|
240
|
-
pid: record.app?.pid ?? null,
|
|
241
|
-
launched: record.app !== void 0,
|
|
242
|
-
build: record.build,
|
|
243
|
-
logs: { dir: directory }
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
case "web": {
|
|
249
|
-
const result = await runWeb({
|
|
250
|
-
root,
|
|
251
|
-
headed: options.headed ?? false,
|
|
252
|
-
note: console.error
|
|
253
|
-
});
|
|
254
|
-
if (!result.ok) throw new StimError(result.error);
|
|
255
|
-
return {
|
|
256
|
-
ok: true,
|
|
257
|
-
result: {
|
|
258
|
-
platform: "web",
|
|
259
|
-
facts: result.facts
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
default: throw new StimError({
|
|
264
|
-
code: "STIM_BAD_ARG",
|
|
265
|
-
message: "Unknown Stim platform."
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
} catch (error) {
|
|
269
|
-
const failure = error;
|
|
270
|
-
return {
|
|
271
|
-
ok: false,
|
|
272
|
-
error: {
|
|
273
|
-
code: failure.code ?? "STIM_RUN_FAILED",
|
|
274
|
-
message: error instanceof Error ? error.message : String(error),
|
|
275
|
-
remedy: failure.remedy ?? null,
|
|
276
|
-
details: {
|
|
277
|
-
logs: directory,
|
|
278
|
-
cause: failure.details
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
function interrupt() {
|
|
285
|
-
if (!process.emit("SIGINT")) process.exit(130);
|
|
286
|
-
}
|
|
287
|
-
process.once("disconnect", interrupt);
|
|
288
|
-
process.on("message", async (request) => {
|
|
289
|
-
if (request.operation === "cancel") return interrupt();
|
|
290
|
-
const response = await dispatch(request);
|
|
291
|
-
process.send?.(response, () => process.exit(response.ok ? 0 : 1));
|
|
292
|
-
});
|
|
293
|
-
//#endregion
|
|
294
|
-
export {};
|