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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region src/workspace/pull-request.d.ts
|
|
2
|
+
interface GhPullRequest {
|
|
3
|
+
number: number;
|
|
4
|
+
state: string;
|
|
5
|
+
url: string;
|
|
6
|
+
headRefOid: string;
|
|
7
|
+
mergedAt: string | null;
|
|
8
|
+
closedAt: string | null;
|
|
9
|
+
isCrossRepository?: boolean;
|
|
10
|
+
isDraft?: boolean;
|
|
11
|
+
headRepository?: {
|
|
12
|
+
name?: string | null;
|
|
13
|
+
} | null;
|
|
14
|
+
headRepositoryOwner?: {
|
|
15
|
+
login?: string | null;
|
|
16
|
+
} | null;
|
|
17
|
+
title?: string;
|
|
18
|
+
reviewDecision?: string | null;
|
|
19
|
+
commits?: {
|
|
20
|
+
nodes?: {
|
|
21
|
+
commit?: {
|
|
22
|
+
statusCheckRollup?: GhCheckRollup | null;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface GhStateCount {
|
|
28
|
+
state: string;
|
|
29
|
+
count: number;
|
|
30
|
+
}
|
|
31
|
+
interface GhCheckRollup {
|
|
32
|
+
contexts?: {
|
|
33
|
+
checkRunCountsByState?: GhStateCount[];
|
|
34
|
+
statusContextCountsByState?: GhStateCount[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface CheckCounts {
|
|
38
|
+
passing: number;
|
|
39
|
+
failing: number;
|
|
40
|
+
pending: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The pull request whose head branch is the worktree's branch and whose commits include the worktree's HEAD.
|
|
44
|
+
* `containsHead` is false when the pull request's head is an ancestor of HEAD: HEAD has commits the pull request
|
|
45
|
+
* never had. `endedAt` is when it was merged or closed, in epoch milliseconds, and null while it is open.
|
|
46
|
+
*/
|
|
47
|
+
interface PullRequestFact {
|
|
48
|
+
number: number;
|
|
49
|
+
state: "open" | "merged" | "closed";
|
|
50
|
+
draft: boolean;
|
|
51
|
+
url: string;
|
|
52
|
+
head: string;
|
|
53
|
+
containsHead: boolean;
|
|
54
|
+
endedAt: number | null;
|
|
55
|
+
/** Present when the lookup asked for detail. */
|
|
56
|
+
title?: string;
|
|
57
|
+
reviewDecision?: "approved" | "changes-requested" | "review-required" | null;
|
|
58
|
+
checks?: CheckCounts | null;
|
|
59
|
+
}
|
|
60
|
+
/** Sums a head commit's check runs and commit statuses by outcome; null when the commit has no checks. */
|
|
61
|
+
declare function checkCounts(rollup: GhCheckRollup | null | undefined): CheckCounts | null;
|
|
62
|
+
type PullRequestLookup = {
|
|
63
|
+
pullRequest: PullRequestFact | null;
|
|
64
|
+
} | {
|
|
65
|
+
unavailable: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Picks the pull request that describes `head` among those `gh pr list --head <branch>` returned. One whose head is
|
|
69
|
+
* `head` wins, then one whose head contains `head`, then one whose head `head` contains. An open one wins a tier,
|
|
70
|
+
* then the newest. A pull request unrelated to `head` is from an earlier use of the branch name and is ignored. A
|
|
71
|
+
* cross-repository pull request is kept only when its head repository is one of `ownRepos` (this checkout's own git
|
|
72
|
+
* remotes, lowercased "owner/name"); otherwise it only shares the branch name with a stranger's fork and is ignored.
|
|
73
|
+
* `isAncestor(a, b)` answers whether commit `a` is an ancestor of commit `b`, and false when git cannot tell.
|
|
74
|
+
*/
|
|
75
|
+
declare function selectPullRequest(pulls: readonly GhPullRequest[], head: string, isAncestor: (ancestor: string, descendant: string) => boolean, ownRepos?: ReadonlySet<string>): PullRequestFact | null;
|
|
76
|
+
/**
|
|
77
|
+
* "owner/name", lowercased, parsed out of a git remote URL, or null when it doesn't match: https, `ssh://`, or
|
|
78
|
+
* scp-like (`[user@]host:owner/name`, which also covers an `~/.ssh/config` host alias in place of `user@host`).
|
|
79
|
+
*/
|
|
80
|
+
declare function parseRemoteRepo(url: string): string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Asks GitHub, through `gh`, which pull requests have `branch` as their head, run from `cwd` so `gh` picks the
|
|
83
|
+
* repository from its remotes. Each call is one fixed `gh pr list` invocation. Once `gh` is missing, signed out or
|
|
84
|
+
* times out, every later lookup through the same function answers `unavailable` without running it again.
|
|
85
|
+
*/
|
|
86
|
+
declare function pullRequestLookup(): (cwd: string, branch: string, head: string) => PullRequestLookup;
|
|
87
|
+
/** A worktree whose pull request {@link pullRequestLookups} looks up: its path, branch and HEAD commit. */
|
|
88
|
+
interface PullRequestQuery {
|
|
89
|
+
cwd: string;
|
|
90
|
+
branch: string;
|
|
91
|
+
head: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* {@link pullRequestLookup} for every branch of one repository in one fixed `gh api graphql` call run from `repo`,
|
|
95
|
+
* which asks for the same 20 newest pull requests of each head branch that `gh pr list --head` returns. `gh` fills
|
|
96
|
+
* `{owner}` and `{repo}` from the remotes of `repo`; branch names travel as variables. Once `gh` is missing, signed
|
|
97
|
+
* out or times out, every later call through the same function answers `unavailable` without running it again.
|
|
98
|
+
* With `detail`, it also asks for each pull request's title, review decision and head commit check counts.
|
|
99
|
+
*/
|
|
100
|
+
declare function pullRequestLookups({ detail }?: {
|
|
101
|
+
detail?: boolean;
|
|
102
|
+
}): (repo: string, queries: readonly PullRequestQuery[]) => Promise<PullRequestLookup[]>;
|
|
103
|
+
/** The merged or closed pull request whose commits include HEAD, which makes the worktree removable. */
|
|
104
|
+
declare function endedPullRequest(lookup: PullRequestLookup | null): PullRequestFact | null;
|
|
105
|
+
/** "PR #123 merged", for reports. */
|
|
106
|
+
declare function describePullRequest(pr: Pick<PullRequestFact, "number" | "state">): string;
|
|
107
|
+
/** A linked worktree whose pull request {@link worktreePullRequests} looks up. */
|
|
108
|
+
interface WorktreeBranch {
|
|
109
|
+
path: string;
|
|
110
|
+
branch: string;
|
|
111
|
+
repository: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Looks up the pull request of each worktree's branch and HEAD, with one {@link pullRequestLookups} call per
|
|
115
|
+
* repository. The map holds null for a worktree without one, and leaves out a worktree whose HEAD git cannot read
|
|
116
|
+
* or whose lookup was unavailable.
|
|
117
|
+
*/
|
|
118
|
+
declare function worktreePullRequests(): (worktrees: readonly WorktreeBranch[]) => Promise<Map<string, PullRequestFact | null>>;
|
|
119
|
+
//#endregion
|
|
120
|
+
export { PullRequestLookup as a, checkCounts as c, parseRemoteRepo as d, pullRequestLookup as f, worktreePullRequests as h, PullRequestFact as i, describePullRequest as l, selectPullRequest as m, GhCheckRollup as n, PullRequestQuery as o, pullRequestLookups as p, GhPullRequest as r, WorktreeBranch as s, CheckCounts as t, endedPullRequest as u };
|
package/dist/pull-requests.d.mts
CHANGED
|
@@ -1,120 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
interface GhPullRequest {
|
|
3
|
-
number: number;
|
|
4
|
-
state: string;
|
|
5
|
-
url: string;
|
|
6
|
-
headRefOid: string;
|
|
7
|
-
mergedAt: string | null;
|
|
8
|
-
closedAt: string | null;
|
|
9
|
-
isCrossRepository?: boolean;
|
|
10
|
-
isDraft?: boolean;
|
|
11
|
-
headRepository?: {
|
|
12
|
-
name?: string | null;
|
|
13
|
-
} | null;
|
|
14
|
-
headRepositoryOwner?: {
|
|
15
|
-
login?: string | null;
|
|
16
|
-
} | null;
|
|
17
|
-
title?: string;
|
|
18
|
-
reviewDecision?: string | null;
|
|
19
|
-
commits?: {
|
|
20
|
-
nodes?: {
|
|
21
|
-
commit?: {
|
|
22
|
-
statusCheckRollup?: GhCheckRollup | null;
|
|
23
|
-
};
|
|
24
|
-
}[];
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
interface GhStateCount {
|
|
28
|
-
state: string;
|
|
29
|
-
count: number;
|
|
30
|
-
}
|
|
31
|
-
interface GhCheckRollup {
|
|
32
|
-
contexts?: {
|
|
33
|
-
checkRunCountsByState?: GhStateCount[];
|
|
34
|
-
statusContextCountsByState?: GhStateCount[];
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
interface CheckCounts {
|
|
38
|
-
passing: number;
|
|
39
|
-
failing: number;
|
|
40
|
-
pending: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The pull request whose head branch is the worktree's branch and whose commits include the worktree's HEAD.
|
|
44
|
-
* `containsHead` is false when the pull request's head is an ancestor of HEAD: HEAD has commits the pull request
|
|
45
|
-
* never had. `endedAt` is when it was merged or closed, in epoch milliseconds, and null while it is open.
|
|
46
|
-
*/
|
|
47
|
-
interface PullRequestFact {
|
|
48
|
-
number: number;
|
|
49
|
-
state: "open" | "merged" | "closed";
|
|
50
|
-
draft: boolean;
|
|
51
|
-
url: string;
|
|
52
|
-
head: string;
|
|
53
|
-
containsHead: boolean;
|
|
54
|
-
endedAt: number | null;
|
|
55
|
-
/** Present when the lookup asked for detail. */
|
|
56
|
-
title?: string;
|
|
57
|
-
reviewDecision?: "approved" | "changes-requested" | "review-required" | null;
|
|
58
|
-
checks?: CheckCounts | null;
|
|
59
|
-
}
|
|
60
|
-
/** Sums a head commit's check runs and commit statuses by outcome; null when the commit has no checks. */
|
|
61
|
-
declare function checkCounts(rollup: GhCheckRollup | null | undefined): CheckCounts | null;
|
|
62
|
-
type PullRequestLookup = {
|
|
63
|
-
pullRequest: PullRequestFact | null;
|
|
64
|
-
} | {
|
|
65
|
-
unavailable: string;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Picks the pull request that describes `head` among those `gh pr list --head <branch>` returned. One whose head is
|
|
69
|
-
* `head` wins, then one whose head contains `head`, then one whose head `head` contains. An open one wins a tier,
|
|
70
|
-
* then the newest. A pull request unrelated to `head` is from an earlier use of the branch name and is ignored. A
|
|
71
|
-
* cross-repository pull request is kept only when its head repository is one of `ownRepos` (this checkout's own git
|
|
72
|
-
* remotes, lowercased "owner/name"); otherwise it only shares the branch name with a stranger's fork and is ignored.
|
|
73
|
-
* `isAncestor(a, b)` answers whether commit `a` is an ancestor of commit `b`, and false when git cannot tell.
|
|
74
|
-
*/
|
|
75
|
-
declare function selectPullRequest(pulls: readonly GhPullRequest[], head: string, isAncestor: (ancestor: string, descendant: string) => boolean, ownRepos?: ReadonlySet<string>): PullRequestFact | null;
|
|
76
|
-
/**
|
|
77
|
-
* "owner/name", lowercased, parsed out of a git remote URL, or null when it doesn't match: https, `ssh://`, or
|
|
78
|
-
* scp-like (`[user@]host:owner/name`, which also covers an `~/.ssh/config` host alias in place of `user@host`).
|
|
79
|
-
*/
|
|
80
|
-
declare function parseRemoteRepo(url: string): string | null;
|
|
81
|
-
/**
|
|
82
|
-
* Asks GitHub, through `gh`, which pull requests have `branch` as their head, run from `cwd` so `gh` picks the
|
|
83
|
-
* repository from its remotes. Each call is one fixed `gh pr list` invocation. Once `gh` is missing, signed out or
|
|
84
|
-
* times out, every later lookup through the same function answers `unavailable` without running it again.
|
|
85
|
-
*/
|
|
86
|
-
declare function pullRequestLookup(): (cwd: string, branch: string, head: string) => PullRequestLookup;
|
|
87
|
-
/** A worktree whose pull request {@link pullRequestLookups} looks up: its path, branch and HEAD commit. */
|
|
88
|
-
interface PullRequestQuery {
|
|
89
|
-
cwd: string;
|
|
90
|
-
branch: string;
|
|
91
|
-
head: string;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* {@link pullRequestLookup} for every branch of one repository in one fixed `gh api graphql` call run from `repo`,
|
|
95
|
-
* which asks for the same 20 newest pull requests of each head branch that `gh pr list --head` returns. `gh` fills
|
|
96
|
-
* `{owner}` and `{repo}` from the remotes of `repo`; branch names travel as variables. Once `gh` is missing, signed
|
|
97
|
-
* out or times out, every later call through the same function answers `unavailable` without running it again.
|
|
98
|
-
* With `detail`, it also asks for each pull request's title, review decision and head commit check counts.
|
|
99
|
-
*/
|
|
100
|
-
declare function pullRequestLookups({ detail }?: {
|
|
101
|
-
detail?: boolean;
|
|
102
|
-
}): (repo: string, queries: readonly PullRequestQuery[]) => Promise<PullRequestLookup[]>;
|
|
103
|
-
/** The merged or closed pull request whose commits include HEAD, which makes the worktree removable. */
|
|
104
|
-
declare function endedPullRequest(lookup: PullRequestLookup | null): PullRequestFact | null;
|
|
105
|
-
/** "PR #123 merged", for reports. */
|
|
106
|
-
declare function describePullRequest(pr: Pick<PullRequestFact, "number" | "state">): string;
|
|
107
|
-
/** A linked worktree whose pull request {@link worktreePullRequests} looks up. */
|
|
108
|
-
interface WorktreeBranch {
|
|
109
|
-
path: string;
|
|
110
|
-
branch: string;
|
|
111
|
-
repository: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Looks up the pull request of each worktree's branch and HEAD, with one {@link pullRequestLookups} call per
|
|
115
|
-
* repository. The map holds null for a worktree without one, and leaves out a worktree whose HEAD git cannot read
|
|
116
|
-
* or whose lookup was unavailable.
|
|
117
|
-
*/
|
|
118
|
-
declare function worktreePullRequests(): (worktrees: readonly WorktreeBranch[]) => Promise<Map<string, PullRequestFact | null>>;
|
|
119
|
-
//#endregion
|
|
1
|
+
import { a as PullRequestLookup, c as checkCounts, d as parseRemoteRepo, f as pullRequestLookup, h as worktreePullRequests, i as PullRequestFact, l as describePullRequest, m as selectPullRequest, n as GhCheckRollup, o as PullRequestQuery, p as pullRequestLookups, r as GhPullRequest, s as WorktreeBranch, t as CheckCounts, u as endedPullRequest } from "./pull-request-zjCSAryH.mjs";
|
|
120
2
|
export { CheckCounts, GhCheckRollup, GhPullRequest, PullRequestFact, PullRequestLookup, PullRequestQuery, WorktreeBranch, checkCounts, describePullRequest, endedPullRequest, parseRemoteRepo, pullRequestLookup, pullRequestLookups, selectPullRequest, worktreePullRequests };
|
package/dist/pull-requests.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as pullRequestLookup, c as worktreePullRequests, i as parseRemoteRepo, n as describePullRequest, o as pullRequestLookups, r as endedPullRequest, s as selectPullRequest, t as checkCounts } from "./pull-request-
|
|
1
|
+
import { a as pullRequestLookup, c as worktreePullRequests, i as parseRemoteRepo, n as describePullRequest, o as pullRequestLookups, r as endedPullRequest, s as selectPullRequest, t as checkCounts } from "./pull-request-Lfetn8Kr.mjs";
|
|
2
2
|
export { checkCounts, describePullRequest, endedPullRequest, parseRemoteRepo, pullRequestLookup, pullRequestLookups, selectPullRequest, worktreePullRequests };
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Ft as makeTemporaryDirectory, It as removeTemporaryEntry, L as publicUrlSetting, U as resolveAndroidLayout, V as remoteEasFallbackSetting, Z as settingOriginScope, et as settingsLayers, m as defaultAndroidLayout, tt as tunnelModeSetting, z as realpathInside } from "./settings-B717odTD.mjs";
|
|
4
|
-
import { B as captureAssetManifest, D as fingerprintProject, E as fingerprintDiffRecord, F as storedAssetManifest, H as readAssetManifest, L as untrackedMissLine, M as refingerprintAfterMutation, N as resolveBuild, O as inputsChangedDuringBuild, P as storeBuild, R as untrackedNativeFiles, S as configInputsChanged, T as filesystemBuildCapability, V as compareAssetManifests, b as buildCacheKey, x as changedDuringBuildLine, z as assetDiffReason } from "./device-lease-BX1sJQ2E.mjs";
|
|
5
|
-
import { r as readWorkspaceState } from "./workspace-state-DJt_MMvf.mjs";
|
|
1
|
+
import { s as spawnDeclared, t as getExecutor, u as operationState } from "./exec-_UbtCQcG.mjs";
|
|
2
|
+
import { J as validateDeviceSlot, U as deviceSlotPlatforms, p as getProject } from "./config-CYcBF478.mjs";
|
|
6
3
|
import { r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
7
|
-
import { i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { c as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { o as resolveCcache } from "./ccache-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { i as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { t as
|
|
26
|
-
import {
|
|
4
|
+
import { i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-B1UrjZHL.mjs";
|
|
5
|
+
import { r as readWorkspaceState } from "./workspace-state-Cjuigeeu.mjs";
|
|
6
|
+
import { $ as settingOriginScope, B as realpathInside, H as remoteEasFallbackSetting, R as publicUrlSetting, W as resolveAndroidLayout, Xt as removeTemporaryEntry, Yt as makeTemporaryDirectory, en as throwIfCancelled, m as defaultAndroidLayout, nt as settingsLayers, qt as killOnAbort, rt as tunnelModeSetting } from "./settings-CsJDEXgK.mjs";
|
|
7
|
+
import { v as detectIsExpo } from "./project-BZNjmW_8.mjs";
|
|
8
|
+
import { Bn as checkEasAuth, Jn as resolveRemote, Un as loadProjectProvider, Xn as bundleInvocation, Y as statsProjectKey } from "./budget-Bs6SxxzO.mjs";
|
|
9
|
+
import { C as compareAssetManifests, S as captureAssetManifest, _ as storedAssetManifest, b as untrackedNativeFiles, c as fingerprintDiffRecord, g as storeBuild, h as resolveBuild, i as configInputsChanged, l as fingerprintProject, m as refingerprintAfterMutation, n as buildCacheKey, r as changedDuringBuildLine, s as filesystemBuildCapability, u as inputsChangedDuringBuild, w as readAssetManifest, x as assetDiffReason, y as untrackedMissLine } from "./build-cache-DmyR9Zzc.mjs";
|
|
10
|
+
import { J as pickDefaultSystemImage, M as listAvds, O as hostSystemImageArch, P as listInstalledSystemImages, T as findBuildTool, W as ownedAvdSystemImage, l as androidSystemImageAbi, r as androidBuildToolName, z as ownedAvdDirectory } from "./android-DUYkNF4u.mjs";
|
|
11
|
+
import { t as cleanLine } from "./server-expo-DT_F_uVI.mjs";
|
|
12
|
+
import { o as resolveCcache } from "./ccache-BJRZ9pG3.mjs";
|
|
13
|
+
import { _ as tailLines, h as startBuildHeartbeat, r as HEARTBEAT_INTERVAL_MS } from "./xcode-Zlx3qjEs.mjs";
|
|
14
|
+
import { r as androidToolchainAsync, t as androidRequirements } from "./toolchain-Hp9sCpK4.mjs";
|
|
15
|
+
import { c as readProductFlavors, n as buildAndroid, s as productFlavorRefusal } from "./react-native-build-rhk4smwQ.mjs";
|
|
16
|
+
import { i as planEasDevelopmentBuild } from "./eas-build-BomfRnFT.mjs";
|
|
17
|
+
import { h as detectAppIds, m as detectAndroidPackage } from "./start-7lpH7hmN.mjs";
|
|
18
|
+
import { a as explainBuildMiss, i as staleNativeDirRefusal, n as recordPrebuild, o as fingerprintErrorMissReason, r as runPrebuild, t as planPrebuild } from "./prebuild-uD_ipCxF.mjs";
|
|
19
|
+
import { a as PLATFORM, c as androidGradleProject, h as displayPath, i as NO_FINGERPRINT, l as androidJobLayout, o as androidBuildOptions, r as NO_DEVICE } from "./support-67vraa1Q.mjs";
|
|
20
|
+
import { t as AndroidRecipeRefusal } from "./android-project-BCAAmMwz.mjs";
|
|
21
|
+
import { c as resolveAndroidRunPlan } from "./result-DNiS-tTP.mjs";
|
|
22
|
+
import { t as checkEasFallback } from "./eas-fallback-DJwZpy0c.mjs";
|
|
23
|
+
import { n as androidProcessRuntime, t as androidMetroRuntime } from "./launch-CD1yVc7U.mjs";
|
|
24
|
+
import { n as planFlagRefusal, r as planPayload, t as planCachedBuild } from "./build-plan-CaFskB7_.mjs";
|
|
25
|
+
import { a as runOperationFile, n as detectEntryFile, r as refreshUpdatesManifestFile, t as UPDATES_MANIFEST_NAME } from "./js-swap-Cc1dttps.mjs";
|
|
26
|
+
import { t as planHostedDevice } from "./plan-placement-Bwj-IjY1.mjs";
|
|
27
|
+
import { constants, existsSync, mkdirSync, readFileSync, renameSync } from "node:fs";
|
|
27
28
|
import { basename, dirname, isAbsolute, join, relative } from "node:path";
|
|
28
|
-
import { loadCacheProvider } from "@stim-cli/cache";
|
|
29
29
|
import chalk from "chalk";
|
|
30
|
+
import { copyFile } from "node:fs/promises";
|
|
31
|
+
import { loadCacheProvider } from "@stim-cli/cache";
|
|
30
32
|
//#region src/engine/apk-swap.ts
|
|
31
33
|
const ANDROID_BUNDLE_NAME = "index.android.bundle";
|
|
32
34
|
const LAST_LINES = 5;
|
|
@@ -176,7 +178,7 @@ function apksignerArgs({ keystore, apkPath }) {
|
|
|
176
178
|
apkPath
|
|
177
179
|
];
|
|
178
180
|
}
|
|
179
|
-
async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter = null, exec = null, spawnFn = null, mkdtemp = () => makeTemporaryDirectory(cachedApkPath, "stim-apk-swap-"), exists = existsSync, hermesEnabled = null, layout = defaultAndroidLayout(root), buildTools = null, findTool = findBuildTool, storedAssets = null, readManifest = readAssetManifest, now = Date.now, heartbeatMs = HEARTBEAT_INTERVAL_MS, onHeartbeat = (line) => console.error(line), platform = process.platform }) {
|
|
181
|
+
async function swapApkBundle({ context, root, isExpo, cachedApkPath, keystore, logWriter = null, exec = null, spawnFn = null, mkdtemp = () => makeTemporaryDirectory(cachedApkPath, "stim-apk-swap-"), exists = existsSync, hermesEnabled = null, layout = defaultAndroidLayout(root), buildTools = null, findTool = findBuildTool, storedAssets = null, readManifest = readAssetManifest, now = Date.now, heartbeatMs = HEARTBEAT_INTERVAL_MS, onHeartbeat = (line) => console.error(line), platform = process.platform }) {
|
|
180
182
|
const e = exec || getExecutor();
|
|
181
183
|
const startedAt = now();
|
|
182
184
|
const elapsed = () => now() - startedAt;
|
|
@@ -204,7 +206,7 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
204
206
|
const base = basename(cachedApkPath);
|
|
205
207
|
work = join(tmp, `unaligned-${base}`);
|
|
206
208
|
final = join(tmp, base);
|
|
207
|
-
copyApk(e, cachedApkPath, work, platform);
|
|
209
|
+
await copyApk(context, e, cachedApkPath, work, platform);
|
|
208
210
|
} catch (err) {
|
|
209
211
|
return fail("copy", `could not copy ${cachedApkPath} aside: ${describe(err)}`);
|
|
210
212
|
}
|
|
@@ -245,7 +247,8 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
245
247
|
};
|
|
246
248
|
let child;
|
|
247
249
|
try {
|
|
248
|
-
|
|
250
|
+
const invocation = bundleInvocation(root, isExpo, command.args.slice(1));
|
|
251
|
+
child = spawnDeclared(context, () => spawn(invocation.file, invocation.args, {
|
|
249
252
|
cwd: root,
|
|
250
253
|
stdio: [
|
|
251
254
|
"ignore",
|
|
@@ -253,10 +256,11 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
253
256
|
"pipe"
|
|
254
257
|
],
|
|
255
258
|
env: {
|
|
256
|
-
...process.env,
|
|
259
|
+
...context?.env ?? process.env,
|
|
257
260
|
FORCE_COLOR: "0"
|
|
258
261
|
}
|
|
259
|
-
});
|
|
262
|
+
}));
|
|
263
|
+
killOnAbort(context ? operationState(context).runSignal ?? context.signal : void 0)(child);
|
|
260
264
|
} catch (err) {
|
|
261
265
|
return fail("bundle", `could not run ${command.file} ${command.args[0]}: ${describe(err)}`);
|
|
262
266
|
}
|
|
@@ -296,7 +300,7 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
296
300
|
else {
|
|
297
301
|
const hbc = `${bundleOutput}.hbc`;
|
|
298
302
|
try {
|
|
299
|
-
e
|
|
303
|
+
await runOperationFile(context, e, hermesc, androidHermescArgs({
|
|
300
304
|
bundle: bundleOutput,
|
|
301
305
|
out: hbc
|
|
302
306
|
}), { timeoutMs: "unbounded" });
|
|
@@ -328,10 +332,10 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
328
332
|
if (!fresh) return fail("assets", `could not hash the assets emitted into ${assetsDest}, so the asset set cannot be verified`);
|
|
329
333
|
const diff = compareAssetManifests(fresh, storedAssets);
|
|
330
334
|
if (!diff.same) return refuse(assetDiffReason(diff), diff);
|
|
331
|
-
const jar = jarPath();
|
|
335
|
+
const jar = jarPath({ javaHome: (context?.env ?? process.env).JAVA_HOME ?? "" });
|
|
332
336
|
const updatesManifest = join(stage, "assets", UPDATES_MANIFEST_NAME);
|
|
333
337
|
try {
|
|
334
|
-
e
|
|
338
|
+
await runOperationFile(context, e, jar, [
|
|
335
339
|
"--extract",
|
|
336
340
|
"--file",
|
|
337
341
|
work,
|
|
@@ -345,7 +349,7 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
345
349
|
return fail("updates", `could not refresh the expo-updates manifest from ${work}: ${describe(err)}`);
|
|
346
350
|
}
|
|
347
351
|
try {
|
|
348
|
-
e
|
|
352
|
+
await runOperationFile(context, e, jar, [
|
|
349
353
|
"--update",
|
|
350
354
|
"--file",
|
|
351
355
|
work,
|
|
@@ -360,7 +364,7 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
360
364
|
const tools = buildTools ?? findTool(["zipalign"]);
|
|
361
365
|
if (!tools) return fail("zipalign", "no zipalign found under the Android SDK build-tools; install one with `sdkmanager \"build-tools;36.0.0\"`");
|
|
362
366
|
try {
|
|
363
|
-
e
|
|
367
|
+
await runOperationFile(context, e, tools.path, zipalignArgs({
|
|
364
368
|
buildToolsMajor: tools.major,
|
|
365
369
|
input: work,
|
|
366
370
|
output: final
|
|
@@ -374,10 +378,19 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
374
378
|
} : findTool(["apksigner"]);
|
|
375
379
|
if (!signer) return fail("apksigner", "no apksigner found under the Android SDK build-tools; install one with `sdkmanager \"build-tools;36.0.0\"`");
|
|
376
380
|
try {
|
|
377
|
-
|
|
381
|
+
let signerFile = signer.path;
|
|
382
|
+
const signerArgs = apksignerArgs({
|
|
378
383
|
keystore,
|
|
379
384
|
apkPath: final
|
|
380
|
-
})
|
|
385
|
+
});
|
|
386
|
+
if (platform === "win32") {
|
|
387
|
+
const javaHome = ((context?.env ?? process.env).JAVA_HOME ?? "").replaceAll("\"", "");
|
|
388
|
+
signerFile = javaHome ? join(javaHome, "bin", "java.exe") : "java.exe";
|
|
389
|
+
const fallbackJar = join(dirname(signer.path), "..", "framework", "apksigner.jar");
|
|
390
|
+
const signerJar = [join(dirname(signer.path), "apksigner.jar"), join(dirname(signer.path), "lib", "apksigner.jar")].find(exists) ?? fallbackJar;
|
|
391
|
+
signerArgs.unshift("-Xmx1024M", "-Xss1m", "-jar", signerJar);
|
|
392
|
+
}
|
|
393
|
+
await runOperationFile(context, e, signerFile, signerArgs, keystore.password === null ? { timeoutMs: "unbounded" } : {
|
|
381
394
|
timeoutMs: "unbounded",
|
|
382
395
|
env: { [KEYSTORE_PASSWORD_ENV]: keystore.password },
|
|
383
396
|
redact: [keystore.password]
|
|
@@ -401,16 +414,20 @@ async function swapApkBundle({ root, isExpo, cachedApkPath, keystore, logWriter
|
|
|
401
414
|
if (note) result.note = note;
|
|
402
415
|
return result;
|
|
403
416
|
}
|
|
404
|
-
function copyApk(e, from, to, platform) {
|
|
417
|
+
async function copyApk(context, e, from, to, platform) {
|
|
405
418
|
if (platform === "darwin") try {
|
|
406
|
-
e
|
|
419
|
+
await runOperationFile(context, e, "cp", [
|
|
407
420
|
"-c",
|
|
408
421
|
from,
|
|
409
422
|
to
|
|
410
423
|
], { timeoutMs: "unbounded" });
|
|
411
424
|
return;
|
|
412
|
-
} catch {
|
|
413
|
-
|
|
425
|
+
} catch {
|
|
426
|
+
throwIfCancelled(context ? operationState(context).runSignal ?? context.signal : void 0, "APK swap");
|
|
427
|
+
}
|
|
428
|
+
throwIfCancelled(context ? operationState(context).runSignal ?? context.signal : void 0, "APK swap");
|
|
429
|
+
await copyFile(from, to, constants.COPYFILE_FICLONE);
|
|
430
|
+
throwIfCancelled(context ? operationState(context).runSignal ?? context.signal : void 0, "APK swap");
|
|
414
431
|
}
|
|
415
432
|
function describe(err) {
|
|
416
433
|
const e = err;
|
|
@@ -670,7 +687,7 @@ function reactNativeAndroidProject(root, { context, settings }, dependencies = {
|
|
|
670
687
|
artifact: (artifactContext) => reactNativeAndroidArtifact(artifactContext, isExpo, layout, context, dependencies)
|
|
671
688
|
};
|
|
672
689
|
}
|
|
673
|
-
function reactNativeAndroidArtifact({ root, buildLog, writer, settings, buildPlan, target, phase, out, step, estimates }, isExpo, layout, context, { fingerprint = fingerprintProject, untracked = untrackedNativeFiles, resolveCached = resolveBuild, storeCached = storeBuild, storedAssets = storedAssetManifest, captureAssets = captureAssetManifest, loadProvider = loadProjectProvider, planPrebuildFor = planPrebuild, prebuild = runPrebuild, build = buildAndroid, ccacheFor = resolveCcache, swapApk = swapApkBundle, readState = readWorkspaceState }) {
|
|
690
|
+
function reactNativeAndroidArtifact({ operation, root, buildLog, writer, settings, buildPlan, target, phase, out, step, estimates }, isExpo, layout, context, { fingerprint = fingerprintProject, untracked = untrackedNativeFiles, resolveCached = resolveBuild, storeCached = storeBuild, storedAssets = storedAssetManifest, captureAssets = captureAssetManifest, loadProvider = loadProjectProvider, planPrebuildFor = planPrebuild, prebuild = runPrebuild, build = buildAndroid, ccacheFor = resolveCcache, swapApk = swapApkBundle, readState = readWorkspaceState }) {
|
|
674
691
|
const { variant, release, profile, cas } = buildPlan;
|
|
675
692
|
const runOptions = {
|
|
676
693
|
...variant ? { variant } : {},
|
|
@@ -702,6 +719,8 @@ function reactNativeAndroidArtifact({ root, buildLog, writer, settings, buildPla
|
|
|
702
719
|
return null;
|
|
703
720
|
}
|
|
704
721
|
const swap = await swapApk({
|
|
722
|
+
context: operation,
|
|
723
|
+
onHeartbeat: out,
|
|
705
724
|
root,
|
|
706
725
|
isExpo,
|
|
707
726
|
cachedApkPath: cachedPath,
|
|
@@ -751,6 +770,7 @@ function reactNativeAndroidArtifact({ root, buildLog, writer, settings, buildPla
|
|
|
751
770
|
return identity();
|
|
752
771
|
},
|
|
753
772
|
cache: (compiled = false) => filesystemBuildCapability({
|
|
773
|
+
context: operation,
|
|
754
774
|
resolve: resolveCached,
|
|
755
775
|
store: storeCached,
|
|
756
776
|
sources,
|
|
@@ -816,7 +836,7 @@ function reactNativeAndroidArtifact({ root, buildLog, writer, settings, buildPla
|
|
|
816
836
|
identity: identity(),
|
|
817
837
|
rekeyedBy,
|
|
818
838
|
cacheRefusal: editedConfig.length ? "prebuild changed config inputs, so the APK cannot be cached" : null,
|
|
819
|
-
...prebuildRan ? { androidPackage: detectAndroidPackage(root, layout.moduleDir) } : {}
|
|
839
|
+
...prebuildRan ? { androidPackage: await detectAndroidPackage(root, layout.moduleDir) } : {}
|
|
820
840
|
};
|
|
821
841
|
},
|
|
822
842
|
async validate() {
|
|
@@ -854,10 +874,13 @@ function reactNativeAndroidArtifact({ root, buildLog, writer, settings, buildPla
|
|
|
854
874
|
abi: target.abi
|
|
855
875
|
}, {
|
|
856
876
|
estimateMs: estimates().coldBuildMs,
|
|
877
|
+
onHeartbeat: out,
|
|
878
|
+
onNote: out,
|
|
857
879
|
ccache: buildPlan.compilerCache === "ccache" ? ccacheFor({
|
|
858
880
|
root,
|
|
859
881
|
layout,
|
|
860
|
-
onNote: out
|
|
882
|
+
onNote: out,
|
|
883
|
+
env: operation?.env
|
|
861
884
|
}) : null,
|
|
862
885
|
cas,
|
|
863
886
|
buildCache: buildPlan.gradleBuildCache,
|
|
@@ -886,14 +909,17 @@ function reactNativeAndroidArtifact({ root, buildLog, writer, settings, buildPla
|
|
|
886
909
|
},
|
|
887
910
|
untrackedLine: () => untrackedMissLine(untracked({ projectRoot: root })),
|
|
888
911
|
legacyCache: target.abi || cas || profile || !buildPlan.cache.remote ? null : {
|
|
889
|
-
load: () => loadProvider(root, {
|
|
912
|
+
load: () => loadProvider(root, {
|
|
913
|
+
context: operation,
|
|
914
|
+
isExpo
|
|
915
|
+
}),
|
|
890
916
|
runOptions: Object.keys(runOptions).length ? runOptions : null
|
|
891
917
|
},
|
|
892
918
|
offload: {
|
|
893
919
|
unsupported: release ? `${variant} builds build here` : cas ? "Apple Clang CAS builds build here" : !buildPlan.cache.write ? "the build cache is off" : null,
|
|
894
|
-
target: () => ({
|
|
920
|
+
target: async () => ({
|
|
895
921
|
platform: "android",
|
|
896
|
-
local:
|
|
922
|
+
local: await androidToolchainAsync(operation?.env),
|
|
897
923
|
requires: androidRequirements(root)
|
|
898
924
|
}),
|
|
899
925
|
request: {
|