stim 1.32.0 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acquire-artifact-CI9fIokp.mjs → acquire-artifact-B0SWoVNt.mjs} +2 -2
- package/dist/{act-BfChMxcU.mjs → act-7f7wIvCQ.mjs} +22 -22
- package/dist/{activity-yjH7Q3zn.mjs → activity-DkS-Ir6V.mjs} +6 -6
- package/dist/{agent-device-usage-output-DO412bsG.mjs → agent-device-usage-output-BVdgKbfz.mjs} +5 -5
- package/dist/{android-BeeC15Ve.mjs → android-B2DSKg-A.mjs} +2 -2
- package/dist/{android-D56S_GX3.mjs → android-BU4uBX8I.mjs} +5 -5
- package/dist/{android-BNm5A40S.mjs → android-D7qjT2fq.mjs} +87 -53
- package/dist/{android-DsEj2CCs.mjs → android-Iq0M2t2d.mjs} +27 -15
- package/dist/{android-cas-CbumHXIq.mjs → android-cas-Dhcjkys1.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/android-image-DFk26aY6.mjs +254 -0
- package/dist/{android-project-CCEQyYJK.d.mts → android-project-DhO6el8N.d.mts} +2 -2
- package/dist/api.d.mts +2 -1
- package/dist/api.mjs +28 -28
- package/dist/{apk-signed-tail-B9Usseps.mjs → apk-signed-tail-CPpA-3vu.mjs} +2 -2
- package/dist/{artifact-k1x9Jrn0.mjs → artifact-CNnTZs3R.mjs} +34 -21
- package/dist/{artifact-C8Nvp07y.mjs → artifact-DmRtKFXW.mjs} +13 -13
- package/dist/{artifact-platform-BO2Uvk_A.mjs → artifact-platform-DqCWUieN.mjs} +1 -1
- package/dist/{auto-placement--nfdQ9rp.mjs → auto-placement-DA65VQH7.mjs} +11 -9
- package/dist/{browser-web-6RDAeH0z.mjs → browser-web-Dn_hgKZC.mjs} +15 -15
- package/dist/{build-VXX_dtl5.mjs → build-D7SuVoRX.mjs} +23 -23
- package/dist/build-artifact-cache-D7B6seMj.mjs +174 -0
- package/dist/build-artifact-cache.d.mts +25 -0
- package/dist/build-artifact-cache.mjs +2 -0
- package/dist/{build-cache-BsKim4V7.mjs → build-cache-Cqj4FGnX.mjs} +20 -8
- package/dist/{build-plan-BK34X2iY.mjs → build-plan-Ct1FiA3E.mjs} +7 -7
- package/dist/{cache-manifest-CfiEny4T.mjs → cache-manifest-8JX9S1QJ.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-BrwGIxmV.mjs → ccache-ChBMXlBq.mjs} +35 -67
- package/dist/{cdp-C3svvXiE.mjs → cdp-C216kOAn.mjs} +1 -1
- package/dist/{chrome-DyDWurWG.mjs → chrome-C8sC5tdl.mjs} +1 -1
- package/dist/{cli-Jc7obreB.mjs → cli-DjdvQG5U.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-lDmA-5jx.mjs → client-kU37gURU.mjs} +70 -13
- package/dist/collector-run.mjs +7 -7
- package/dist/{command-output-CfPW1bKP.mjs → command-output-DjExb_tZ.mjs} +1 -1
- package/dist/{config-D5qNWJEP.mjs → config-BW0fAtoK.mjs} +256 -246
- package/dist/{dependencies-DkZ8681S.mjs → dependencies-CZ7c8XX_.mjs} +39 -39
- package/dist/{dependency-state-DZVln1P9.mjs → dependency-state-mL5g4H6K.mjs} +2 -2
- package/dist/{detached-entry-BPlSaCwC.mjs → detached-entry-tfrgGVWb.mjs} +1 -1
- package/dist/{dev-client-eDZy6RoX.mjs → dev-client-D3wOllNd.mjs} +2 -2
- package/dist/{device-CeIikWac.mjs → device-CWPFAqs0.mjs} +13 -13
- package/dist/{device-CTozKhU0.mjs → device-DH5yf6TU.mjs} +11 -11
- package/dist/{device-android-zgD9We85.mjs → device-android-ChfF5I9A.mjs} +10 -10
- package/dist/{device-capacity-Bki6B-7h.mjs → device-capacity-CHC3dKWg.mjs} +9 -9
- package/dist/device-host-worker.mjs +58 -17
- package/dist/{device-ios-TE5ejeXx.mjs → device-ios-B3-Ah--R.mjs} +9 -9
- package/dist/{device-lease-run-DeNGjJZM.mjs → device-lease-run-i3FNX4OE.mjs} +5 -5
- package/dist/{device-pool-mjyUYaau.mjs → device-pool-EZziQ0uS.mjs} +3 -3
- package/dist/{device-provision-j_B7G0e6.mjs → device-provision-CfpEy-Vm.mjs} +10 -10
- package/dist/{doctor-sSLtn-j1.mjs → doctor-B5uEZiKp.mjs} +30 -17
- package/dist/{doctor-CNZuvTSe.mjs → doctor-CGBsS_68.mjs} +1 -1
- package/dist/{doctor-BlrcoQ7B.mjs → doctor-dwRboaXx.mjs} +54 -25
- package/dist/{doctor-fingerprint-o7ZI9YLn.mjs → doctor-fingerprint-DqWvIhMb.mjs} +1 -1
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-CCuboyj1.mjs → doctor-watchman-r7M9UPi0.mjs} +5 -5
- package/dist/{eas-build-CaG-Sfs9.mjs → eas-build-BpHIt_M3.mjs} +4 -4
- package/dist/{eas-fallback-BpX1lpco.mjs → eas-fallback-CNPcjq3K.mjs} +6 -6
- package/dist/{eas-session-ledger-B-nTfdfk.mjs → eas-session-ledger-CXwagcQ7.mjs} +6 -6
- package/dist/{error-diagnostics-q56Im4D8.mjs → error-diagnostics-Ym2mjmJ0.mjs} +10 -10
- package/dist/{exec-aULwtNly.mjs → exec-CGuDzt40.mjs} +103 -103
- package/dist/{gc-By2Kc-Ek.mjs → gc-B464w_a5.mjs} +2 -2
- package/dist/{gc-Dv6nb9nf.mjs → gc-C7YxKNci.mjs} +25 -54
- package/dist/{guide-CwpsGWTJ.mjs → guide-BFW-cB7R.mjs} +141 -44
- package/dist/{hosted-android-c5nPJA6S.mjs → hosted-android-B7yfqXEy.mjs} +4 -4
- package/dist/{hosted-client-Hs-fD4L3.mjs → hosted-client-CQuzZwAu.mjs} +6 -5
- package/dist/{hosted-logs-BteXG8rm.mjs → hosted-logs-DfYCqrrR.mjs} +7 -7
- package/dist/{hosted-logs-sync-B8bjLEMs.mjs → hosted-logs-sync-Dlpa2mQF.mjs} +5 -5
- package/dist/{hosted-macos-B4byscei.mjs → hosted-macos-JKefapEm.mjs} +6 -6
- package/dist/{hosted-native-Bh9IJ_t5.mjs → hosted-native-B7OFt5gB.mjs} +14 -10
- package/dist/{idle-shutdown-BaeCo4ps.mjs → idle-shutdown-DPD8oV36.mjs} +6 -6
- package/dist/{ios-CdAV4-1E.mjs → ios-BdZdNsAj.mjs} +6 -6
- package/dist/{ios-D3oK9-O4.mjs → ios-DSBs9c6d.mjs} +28 -28
- package/dist/{ios-CsRVik64.mjs → ios-Qam0bT9n.mjs} +1 -1
- package/dist/{ios-device-CiBA-er9.mjs → ios-device-DLdEDWJj.mjs} +1 -1
- package/dist/{ios-device-D7Gi3e1I.mjs → ios-device-Drplrgzo.mjs} +3 -3
- package/dist/{ios-project-DDQlX_jX.mjs → ios-project-DoTQYghg.mjs} +7 -7
- package/dist/{ios-D1XKSITX.mjs → ios-sUPbWqEh.mjs} +8 -8
- package/dist/ios-signing-R34vbrNU.mjs +202 -0
- package/dist/{ios-state-BEIJRJ7P.mjs → ios-state-CWsBysyN.mjs} +1 -1
- package/dist/{js-swap-C8N5DXHl.mjs → js-swap-DrokhOfo.mjs} +6 -6
- package/dist/{launch-DxpvL6il.mjs → launch-Cy-MWEZc.mjs} +20 -20
- package/dist/{lightened-Df6II_XI.mjs → lightened-ALwQcQtV.mjs} +5 -5
- package/dist/{logs-zv3ge7c6.mjs → logs-DWT7jGpF.mjs} +6 -6
- package/dist/{logs-CuWJWF88.mjs → logs-DuED-01Z.mjs} +7 -7
- package/dist/{macos-C6U-4Iip.mjs → macos-CtBtA_hW.mjs} +22 -22
- package/dist/{macos-CbRZheLw.mjs → macos-kWGcfLzx.mjs} +1 -1
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +6 -6
- package/dist/{metro-mKHEMO-a.mjs → metro-B5PVz0Wv.mjs} +4 -4
- package/dist/{metro-request-DODHNXCN.mjs → metro-request-2LmFpC1z.mjs} +2 -2
- package/dist/{named-ports-B0hCk2v-.mjs → named-ports-CA0nB9Yw.mjs} +3 -3
- package/dist/{native-android-9dVFqvTT.mjs → native-android-tISP2EVp.mjs} +29 -19
- package/dist/{native-gradle-artifact-inputs-BlY97pt8.mjs → native-gradle-artifact-inputs-DVoeZkrw.mjs} +5 -5
- package/dist/{native-runtime-DQfxW5Au.mjs → native-runtime-CNgxeOCG.mjs} +6 -6
- package/dist/{native-source-D1AzWiuP.mjs → native-source-ChAGj7R1.mjs} +1 -1
- package/dist/{native-xcode-inputs-tDuUvSU8.mjs → native-xcode-inputs-DGzkhpu4.mjs} +3 -3
- package/dist/{native-xcode-ios-CG-PD-7g.mjs → native-xcode-ios-B9nsfId2.mjs} +17 -17
- package/dist/offload-worker.d.mts +8 -1
- package/dist/offload-worker.mjs +62 -23
- package/dist/{operation-exec-Dp4FuIGR.mjs → operation-exec-DKlBcKAL.mjs} +1 -1
- package/dist/{ownership-CCfiBfOP.mjs → ownership-hC7xvvxF.mjs} +3 -3
- package/dist/{page-CQJlcj3x.mjs → page-Dj8IqvGM.mjs} +2 -2
- package/dist/{phone-reverses-CnNwdz9A.mjs → phone-reverses-Bo0EzJ-P.mjs} +4 -4
- package/dist/{placement-log-CRL0IY-k.mjs → placement-log-BsGvKLtU.mjs} +1 -1
- package/dist/{plan-placement-2imvnlWP.mjs → plan-placement-Am0IjuxB.mjs} +6 -6
- package/dist/{ports-CKktj5lV.mjs → ports-CNzg1LYD.mjs} +3 -3
- package/dist/{prebuild-CyNrUWgV.mjs → prebuild-BfJII57G.mjs} +12 -12
- package/dist/{project-Crtcbfl0.mjs → project-DU3jjnBE.mjs} +16 -16
- package/dist/{pull-request-BzLmzAIQ.mjs → pull-request-BpMTNkMB.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-Cabe2YER.mjs → react-native-android-3dZiJv-4.mjs} +37 -33
- package/dist/{react-native-build-DhWBUV_H.mjs → react-native-build-CuvNPt-q.mjs} +10 -10
- package/dist/{react-native-doctor-D-twmBon.mjs → react-native-doctor-a35BwMUO.mjs} +6 -6
- package/dist/{react-native-ios-u_ley41B.mjs → react-native-ios-CqnReM1t.mjs} +22 -17
- package/dist/{recordings-BWnIlhZH.mjs → recordings-AKZfsW2W.mjs} +1 -1
- package/dist/{registration-BwCe64PH.mjs → registration-DKjJGQ6p.mjs} +1 -1
- package/dist/{reload-D2TpUlns.mjs → reload-CC3sNo10.mjs} +17 -17
- package/dist/{reload-f9hvEHE9.mjs → reload-YPnvXGlB.mjs} +1 -1
- package/dist/{remote-BsBAjlD2.mjs → remote-BfaIHnhM.mjs} +9 -9
- package/dist/{result-EOsWV6sp.mjs → result-H-AxY7Ud.mjs} +24 -20
- package/dist/{run-2CHAJ9Oj.mjs → run-N-BbRxnC.mjs} +2 -2
- package/dist/{selection-C4ZQz_ER.mjs → selection-CH-MUVGD.mjs} +5 -4
- package/dist/{server-bare-CFyVFZXJ.mjs → server-bare-BTlICuaX.mjs} +2 -2
- package/dist/{server-command-BMyKtnjH.mjs → server-command-Bn_gOObU.mjs} +5 -5
- package/dist/server-expo-B59N16uT.mjs +2 -0
- package/dist/{server-expo-BLxcN2x2.mjs → server-expo-CUJ2fuv1.mjs} +3 -3
- package/dist/{settings-C6UTYW2K.mjs → settings-B5IBDfTx.mjs} +4 -4
- package/dist/{settings-jeS0WmUF.mjs → settings-DoWHJopy.mjs} +2 -2
- package/dist/{settings-payload-CrX933Xi.mjs → settings-payload-Bxw3hid5.mjs} +5 -5
- package/dist/{settings-write-DMcT23Kl.mjs → settings-write-C6d7EC54.mjs} +6 -6
- package/dist/settings.schema.json +38 -0
- package/dist/{simslim-93xmPh-d.mjs → simslim-DKdJx0LL.mjs} +2 -2
- package/dist/{slot-launch-CSpQcFZw.mjs → slot-launch-kq0-7w9C.mjs} +6 -6
- package/dist/{stage-Cf9uSM1a.mjs → stage-CBfMTUK3.mjs} +2 -2
- package/dist/{start-CquYgzVf.mjs → start-Diu8q6_U.mjs} +1 -1
- package/dist/{start-CLN_r9EG.mjs → start-WTMumMHi.mjs} +12 -12
- package/dist/{state-CM_HvvkS.mjs → state-CtmYTRWm.mjs} +4 -4
- package/dist/{state-CiflgxTP.mjs → state-DSOUqO-o.mjs} +2 -2
- package/dist/{stats-BVEZuSlg.mjs → stats-D4cW247z.mjs} +5 -5
- package/dist/{stats-report-B86Cv7Uc.mjs → stats-report-BVRCqwWA.mjs} +1 -1
- package/dist/{status-Bhdy07v0.mjs → status-B-oeWS0Z.mjs} +1 -1
- package/dist/{status-D0ruTmPl.mjs → status-CEwxo-PS.mjs} +37 -28
- package/dist/{status-GQ-JqvRi.mjs → status-DTFhDnd1.mjs} +1 -1
- package/dist/{status-watch-DSu_hhg6.mjs → status-watch-D63R5nSI.mjs} +5 -5
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-1XxET4S8.mjs → stim-desktop-_WTria-r.mjs} +2 -2
- package/dist/{stop-RZqER_Ww.mjs → stop-Dm9ON6Os.mjs} +2 -2
- package/dist/{stop-B616ZyTv.mjs → stop-HL2RvhrE.mjs} +5 -5
- package/dist/{stop-W4DK8qZq.mjs → stop-vX4w3_8V.mjs} +16 -16
- package/dist/supervisor-run.mjs +16 -16
- package/dist/{support-S_5nkkzs.mjs → support-BNe1_Hg7.mjs} +18 -8
- package/dist/{support-NxnD8QXd.mjs → support-ivsfDj0v.mjs} +9 -9
- package/dist/{swiftpm-artifact-inputs-yp8D5LE4.mjs → swiftpm-artifact-inputs-uq5oV7xR.mjs} +4 -4
- package/dist/{swiftpm-macos-Gtq9bNQb.mjs → swiftpm-macos-ClF203_2.mjs} +11 -11
- package/dist/{toolchain-B2bN8jEo.mjs → toolchain-CECahBDa.mjs} +1 -1
- package/dist/{toolchain-Bnm8vUCV.mjs → toolchain-CYonNjd_.mjs} +429 -20
- package/dist/{trigger-CfnOfpDd.mjs → trigger-BtB4kbe0.mjs} +2 -2
- package/dist/trigger-D8B7QR0q.mjs +2 -0
- package/dist/{warm-progress-_aTMvkIH.mjs → warm-progress-q11Vdvhh.mjs} +6 -6
- package/dist/{web-BdWG8b5_.mjs → web-BdaMBr2O.mjs} +9 -9
- package/dist/web-CIpHpGp8.mjs +2 -0
- package/dist/web-run.mjs +8 -8
- package/dist/windows-report.mjs +1 -1
- package/dist/{workspace-state-3bF4TB8P.mjs → workspace-state-BdZ-QgmB.mjs} +3 -3
- package/dist/{workspaces-C59v9bpD.mjs → workspaces-B9v5V7Es.mjs} +14 -14
- package/dist/{worktree-CinoSsGy.mjs → worktree-C3N86KpI.mjs} +77 -31
- package/dist/{worktree-K9F50fD_.mjs → worktree-C4MBOMz7.mjs} +1 -1
- package/package.json +12 -7
- package/dist/ios-signing-BJzvDPfU.mjs +0 -489
- package/dist/server-expo-DwR3eD-a.mjs +0 -2
- package/dist/trigger-DBZ-GBrl.mjs +0 -2
- package/dist/web-DwuluWJt.mjs +0 -2
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
|
+
import { isDeepStrictEqual } from "node:util";
|
|
4
|
+
import { basename, join } from "node:path";
|
|
5
|
+
import { reactNativeArtifactIdentity } from "@stim-cli/core";
|
|
6
|
+
import { isJsonObject } from "@stim-cli/core/state";
|
|
7
|
+
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
8
|
+
import { createFilesystemFileCache } from "@stim-cli/cache";
|
|
9
|
+
//#region src/offload/build-artifact-cache.ts
|
|
10
|
+
const androidPackage = (value) => typeof value === "string" && /^[A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+$/.test(value);
|
|
11
|
+
function gradleQueryKey(query) {
|
|
12
|
+
const { android, inputs } = query;
|
|
13
|
+
return createHash("sha256").update(JSON.stringify([
|
|
14
|
+
query.project,
|
|
15
|
+
query.sourceDigest,
|
|
16
|
+
inputs.ignored,
|
|
17
|
+
inputs.outputs,
|
|
18
|
+
android.variant,
|
|
19
|
+
android.abi === "all" ? null : android.abi,
|
|
20
|
+
android.compilerCache,
|
|
21
|
+
android.gradleBuildCache,
|
|
22
|
+
android.pch,
|
|
23
|
+
android.gradleRoot ?? null,
|
|
24
|
+
android.module ?? null
|
|
25
|
+
])).digest("hex");
|
|
26
|
+
}
|
|
27
|
+
const completedKind = (query) => "build" in query ? "swiftpm" : "sourceDigest" in query ? "gradle" : "react-native";
|
|
28
|
+
const completedKey = (query) => "sourceDigest" in query && !("build" in query) ? gradleQueryKey(query) : createHash("sha256").update(JSON.stringify(query)).digest("hex");
|
|
29
|
+
function validArtifactIdentity(value) {
|
|
30
|
+
return isJsonObject(value) && typeof value.fingerprint === "string" && value.fingerprint.length > 0 && value.fingerprint.length <= 256 && typeof value.cacheKey === "string" && value.cacheKey.length > 0 && value.cacheKey.length <= 1024;
|
|
31
|
+
}
|
|
32
|
+
async function verified(path, artifact, signal) {
|
|
33
|
+
const digest = createHash("sha256");
|
|
34
|
+
let size = 0;
|
|
35
|
+
for await (const chunk of createReadStream(path, { signal })) {
|
|
36
|
+
size += chunk.length;
|
|
37
|
+
digest.update(chunk);
|
|
38
|
+
}
|
|
39
|
+
return size === artifact.size && digest.digest("hex") === artifact.sha256;
|
|
40
|
+
}
|
|
41
|
+
/** Completed immutable archives within one authenticated client's repository area. */
|
|
42
|
+
var BuildArtifactCache = class {
|
|
43
|
+
files;
|
|
44
|
+
directory;
|
|
45
|
+
constructor(directory) {
|
|
46
|
+
this.directory = directory;
|
|
47
|
+
this.files = createFilesystemFileCache(join(directory, "files"));
|
|
48
|
+
}
|
|
49
|
+
record(identity) {
|
|
50
|
+
const key = createHash("sha256").update(JSON.stringify([identity.fingerprint, identity.cacheKey])).digest("hex");
|
|
51
|
+
return join(this.directory, `${key}.json`);
|
|
52
|
+
}
|
|
53
|
+
async lookup(identity, signal) {
|
|
54
|
+
signal.throwIfAborted();
|
|
55
|
+
try {
|
|
56
|
+
const record = JSON.parse(await readFile(this.record(identity), {
|
|
57
|
+
encoding: "utf8",
|
|
58
|
+
signal
|
|
59
|
+
}));
|
|
60
|
+
if (!isJsonObject(record) || record.fingerprint !== identity.fingerprint || record.cacheKey !== identity.cacheKey || typeof record.name !== "string" || basename(record.name) !== record.name || !(record.name.endsWith(".app") || record.name.endsWith(".apk") && androidPackage(record.androidPackage)) || typeof record.size !== "number" || !Number.isSafeInteger(record.size) || record.size <= 0 || typeof record.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(record.sha256)) return null;
|
|
61
|
+
if ((await this.files.stat({
|
|
62
|
+
key: record.sha256,
|
|
63
|
+
signal
|
|
64
|
+
}))?.size !== record.size) return null;
|
|
65
|
+
return {
|
|
66
|
+
...identity,
|
|
67
|
+
name: record.name,
|
|
68
|
+
size: record.size,
|
|
69
|
+
sha256: record.sha256,
|
|
70
|
+
...record.name.endsWith(".apk") && androidPackage(record.androidPackage) ? { androidPackage: record.androidPackage } : {}
|
|
71
|
+
};
|
|
72
|
+
} catch {
|
|
73
|
+
signal.throwIfAborted();
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async store(identity, parameters, archive, artifact, signal) {
|
|
78
|
+
if (!validArtifactIdentity(identity) || !await verified(archive, artifact, signal)) return false;
|
|
79
|
+
await this.files.store({
|
|
80
|
+
key: artifact.sha256,
|
|
81
|
+
sourcePath: archive,
|
|
82
|
+
overwrite: true,
|
|
83
|
+
signal
|
|
84
|
+
});
|
|
85
|
+
await mkdir(this.directory, {
|
|
86
|
+
recursive: true,
|
|
87
|
+
mode: 448
|
|
88
|
+
});
|
|
89
|
+
const temporary = join(this.directory, `${randomUUID()}.partial`);
|
|
90
|
+
try {
|
|
91
|
+
await writeFile(temporary, JSON.stringify({
|
|
92
|
+
...identity,
|
|
93
|
+
...artifact,
|
|
94
|
+
parameters
|
|
95
|
+
}), {
|
|
96
|
+
mode: 384,
|
|
97
|
+
signal
|
|
98
|
+
});
|
|
99
|
+
signal.throwIfAborted();
|
|
100
|
+
await rename(temporary, this.record(identity));
|
|
101
|
+
return true;
|
|
102
|
+
} finally {
|
|
103
|
+
await rm(temporary, { force: true });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async storeCompleted(query, identity, receipt, archive, artifact, signal) {
|
|
107
|
+
if (!("build" in query) && ("sourceDigest" in query || query.platform === "android")) {
|
|
108
|
+
if (!artifact.name.endsWith(".apk") || !androidPackage(artifact.androidPackage)) return;
|
|
109
|
+
} else if (!artifact.name.endsWith(".app")) return;
|
|
110
|
+
if (!await this.store(identity, { ...query }, archive, artifact, signal)) return;
|
|
111
|
+
const key = completedKey(query);
|
|
112
|
+
const temporary = join(this.directory, `${randomUUID()}.partial`);
|
|
113
|
+
try {
|
|
114
|
+
await writeFile(temporary, JSON.stringify({
|
|
115
|
+
query: key,
|
|
116
|
+
receipt
|
|
117
|
+
}), {
|
|
118
|
+
mode: 384,
|
|
119
|
+
signal
|
|
120
|
+
});
|
|
121
|
+
signal.throwIfAborted();
|
|
122
|
+
await rename(temporary, join(this.directory, `${key}.${completedKind(query)}.json`));
|
|
123
|
+
} finally {
|
|
124
|
+
await rm(temporary, { force: true });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
async completedRecord(query, signal) {
|
|
128
|
+
signal.throwIfAborted();
|
|
129
|
+
try {
|
|
130
|
+
const key = completedKey(query);
|
|
131
|
+
const record = JSON.parse(await readFile(join(this.directory, `${key}.${completedKind(query)}.json`), {
|
|
132
|
+
encoding: "utf8",
|
|
133
|
+
signal
|
|
134
|
+
}));
|
|
135
|
+
return isJsonObject(record) && record.query === key && isJsonObject(record.receipt) ? record : null;
|
|
136
|
+
} catch {
|
|
137
|
+
signal.throwIfAborted();
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async receipt(query, signal) {
|
|
142
|
+
return (await this.completedRecord(query, signal))?.receipt ?? null;
|
|
143
|
+
}
|
|
144
|
+
async lookupReactNative(query, signal) {
|
|
145
|
+
const record = await this.completedRecord(query, signal);
|
|
146
|
+
if (!record || !isJsonObject(record.receipt) || !isJsonObject(record.receipt.toolchain) || !isDeepStrictEqual(record.receipt.query, query)) return null;
|
|
147
|
+
return this.lookup(reactNativeArtifactIdentity({
|
|
148
|
+
query,
|
|
149
|
+
toolchain: record.receipt.toolchain
|
|
150
|
+
}), signal);
|
|
151
|
+
}
|
|
152
|
+
async fetch(identity, destinationDir, signal) {
|
|
153
|
+
const artifact = await this.lookup(identity, signal);
|
|
154
|
+
if (!artifact) return null;
|
|
155
|
+
const path = await this.files.resolve({
|
|
156
|
+
key: artifact.sha256,
|
|
157
|
+
destinationDir,
|
|
158
|
+
signal
|
|
159
|
+
});
|
|
160
|
+
if (!path) return null;
|
|
161
|
+
let complete = false;
|
|
162
|
+
try {
|
|
163
|
+
complete = await verified(path, artifact, signal);
|
|
164
|
+
return complete ? {
|
|
165
|
+
path,
|
|
166
|
+
artifact
|
|
167
|
+
} : null;
|
|
168
|
+
} finally {
|
|
169
|
+
if (!complete) await rm(path, { force: true });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
export { validArtifactIdentity as n, BuildArtifactCache as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BuildArtifactIdentity, BuildArtifactResult, BuildGradleArtifactQuery, BuildReactNativeArtifactQuery, BuildSwiftpmArtifactQuery, CachedBuildArtifact } from "@stim-cli/core/protocol";
|
|
2
|
+
//#region src/offload/build-artifact-cache.d.ts
|
|
3
|
+
type CompletedQuery = BuildGradleArtifactQuery | BuildReactNativeArtifactQuery | BuildSwiftpmArtifactQuery;
|
|
4
|
+
declare function validArtifactIdentity(value: unknown): value is BuildArtifactIdentity;
|
|
5
|
+
/** Completed immutable archives within one authenticated client's repository area. */
|
|
6
|
+
declare class BuildArtifactCache {
|
|
7
|
+
private readonly files;
|
|
8
|
+
private readonly directory;
|
|
9
|
+
constructor(directory: string);
|
|
10
|
+
private record;
|
|
11
|
+
lookup(identity: BuildArtifactIdentity, signal: AbortSignal): Promise<CachedBuildArtifact | null>;
|
|
12
|
+
store(identity: BuildArtifactIdentity, parameters: Record<string, unknown>, archive: string, artifact: BuildArtifactResult, signal: AbortSignal): Promise<boolean>;
|
|
13
|
+
storeCompleted(query: CompletedQuery, identity: BuildArtifactIdentity, receipt: unknown, archive: string, artifact: BuildArtifactResult & {
|
|
14
|
+
androidPackage?: string;
|
|
15
|
+
}, signal: AbortSignal): Promise<void>;
|
|
16
|
+
private completedRecord;
|
|
17
|
+
receipt(query: CompletedQuery, signal: AbortSignal): Promise<unknown | null>;
|
|
18
|
+
lookupReactNative(query: BuildReactNativeArtifactQuery, signal: AbortSignal): Promise<CachedBuildArtifact | null>;
|
|
19
|
+
fetch(identity: BuildArtifactIdentity, destinationDir: string, signal: AbortSignal): Promise<{
|
|
20
|
+
path: string;
|
|
21
|
+
artifact: CachedBuildArtifact;
|
|
22
|
+
} | null>;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { BuildArtifactCache, validArtifactIdentity };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { y as sharedBuildCache } from "./workspace-state-
|
|
3
|
-
import { a as killOnAbort, c as gitQuiet, o as git, r as childEnvironment, s as gitAsync } from "./operation-exec-
|
|
4
|
-
import { m as defaultAndroidLayout } from "./settings-
|
|
5
|
-
import { r as register } from "./cache-manifest-
|
|
6
|
-
import { r as writeSignedTail, t as computeSignedTail } from "./apk-signed-tail-
|
|
1
|
+
import { d as throwIfCancelled, t as getExecutor, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { y as sharedBuildCache } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { a as killOnAbort, c as gitQuiet, o as git, r as childEnvironment, s as gitAsync } from "./operation-exec-DKlBcKAL.mjs";
|
|
4
|
+
import { m as defaultAndroidLayout } from "./settings-B5IBDfTx.mjs";
|
|
5
|
+
import { r as register } from "./cache-manifest-8JX9S1QJ.mjs";
|
|
6
|
+
import { r as writeSignedTail, t as computeSignedTail } from "./apk-signed-tail-CPpA-3vu.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
@@ -701,6 +701,9 @@ function mergeMovedPackages(changes) {
|
|
|
701
701
|
return kept;
|
|
702
702
|
}
|
|
703
703
|
function compareSourceLists(previous, current) {
|
|
704
|
+
return mergeMovedPackages(sourceListChanges(previous, current));
|
|
705
|
+
}
|
|
706
|
+
function sourceListChanges(previous, current) {
|
|
704
707
|
const previousByName = /* @__PURE__ */ new Map();
|
|
705
708
|
for (const source of previous) {
|
|
706
709
|
const name = sourceName(source);
|
|
@@ -733,7 +736,16 @@ function compareSourceLists(previous, current) {
|
|
|
733
736
|
change: "removed",
|
|
734
737
|
reasons: before.reasons
|
|
735
738
|
});
|
|
736
|
-
return
|
|
739
|
+
return changes;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Whether `current` differs from `previous` in at least one source, and only in file or directory sources whose
|
|
743
|
+
* normalized path lies inside `dir`.
|
|
744
|
+
*/
|
|
745
|
+
function changedOnlyInside(previous, current, dir) {
|
|
746
|
+
const contents = new Set(current.flatMap((source) => typeof source === "object" && source !== null && "type" in source && source.type === "contents" && "id" in source && typeof source.id === "string" ? [source.id] : []));
|
|
747
|
+
const changes = sourceListChanges(previous, current);
|
|
748
|
+
return dir !== "." && changes.length > 0 && changes.every(({ name }) => !contents.has(name) && posix$1.normalize(name) === name && (name === dir || name.startsWith(`${dir}/`)));
|
|
737
749
|
}
|
|
738
750
|
function diffFingerprintSources({ previous, previousHash = null, current, differ = null }) {
|
|
739
751
|
if (typeof differ === "function") try {
|
|
@@ -854,4 +866,4 @@ function fingerprintDiffRecord({ changed, previousHash, hash }) {
|
|
|
854
866
|
};
|
|
855
867
|
}
|
|
856
868
|
//#endregion
|
|
857
|
-
export {
|
|
869
|
+
export { untrackedMissLine as A, refingerprintAfterMutation as C, storedAssetManifest as D, storedAppId as E, readAssetManifest as F, assetDiffReason as M, captureAssetManifest as N, storedSources as O, compareAssetManifests as P, providerUploadOutcome as S, storeBuild as T, ignoredFingerprintPaths as _, compareSourceLists as a, prepareProviderDownloadDir as b, entryDir as c, expoEnvFiles as d, filesystemBuildCapability as f, gitignoredFingerprintInputs as g, fingerprintProject as h, changedOnlyInside as i, untrackedNativeFiles as j, trackedFingerprintPaths as k, evictBuild as l, fingerprintOptions as m, buildCacheKey as n, configInputsChanged as o, fingerprintDiffRecord as p, changedDuringBuildLine as r, diffFingerprintSources as s, artifactIn as t, expoConfigContents as u, inputsChangedDuringBuild as v, resolveBuild as w, providerDownloadPath as x, packageIn as y };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-
|
|
3
|
-
import { an as makeTemporaryDirectory, sn as removeTemporaryEntryAsync } from "./settings-
|
|
4
|
-
import {
|
|
5
|
-
import { at as readStats, q as estimateBuild } from "./workspaces-
|
|
6
|
-
import {
|
|
7
|
-
import { l as predictBuildMiss, o as staleNativeDirRefusal } from "./prebuild-
|
|
1
|
+
import { a as trackReportResource } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-DjExb_tZ.mjs";
|
|
3
|
+
import { an as makeTemporaryDirectory, sn as removeTemporaryEntryAsync } from "./settings-B5IBDfTx.mjs";
|
|
4
|
+
import { On as easAuthNote } from "./ccache-ChBMXlBq.mjs";
|
|
5
|
+
import { at as readStats, q as estimateBuild } from "./workspaces-B9v5V7Es.mjs";
|
|
6
|
+
import { c as entryDir, t as artifactIn } from "./build-cache-Cqj4FGnX.mjs";
|
|
7
|
+
import { l as predictBuildMiss, o as staleNativeDirRefusal } from "./prebuild-BfJII57G.mjs";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, resolveTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
|
|
10
10
|
//#region src/commands/build-plan.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as getConfigDir } from "./config-
|
|
1
|
+
import { d as getConfigDir } from "./config-BW0fAtoK.mjs";
|
|
2
2
|
import { cacheDirRefusal, readCacheManifest, updateCacheManifest } from "@stim-cli/core";
|
|
3
3
|
import { join, resolve } from "path";
|
|
4
4
|
import { existsSync } from "fs";
|
package/dist/cache-manifest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-
|
|
1
|
+
import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-8JX9S1QJ.mjs";
|
|
2
2
|
export { manifestPath, readManifest, register, registeredCaches, unregister };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { D as ownership_claim_exports, E as debugLog, S as
|
|
2
|
-
import { D as workspaceId$1, E as workspaceDir, M as withDirLock$1, b as sharedCcache$1, d as writeWorkspaceState, j as workspaceStateFile$1, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1, t as clearWorkspaceStateKey, y as sharedBuildCache } from "./workspace-state-
|
|
3
|
-
import { F as formatBytes, I as isOnMountedVolume, K as projectDeviceSlots, N as directorySize, P as directorySizeAsync, R as measuredDirectorySizeAsync, U as deviceSlotPlatforms, a as clearDevice, d as getConfigDir, k as withConfigLockAsync$1, m as getProject, o as clearSupervisor, v as loadConfig$1, z as volumeRootFor } from "./config-D5qNWJEP.mjs";
|
|
1
|
+
import { C as operationState, D as ownership_claim_exports, E as debugLog, S as isTermination, T as process_identity_exports, d as throwIfCancelled, f as WorkspaceProcessCleanupError, l as cancellableSleep, m as workspaceProcessLockError, n as isTimeoutError, p as withWorkspaceProcessLock, t as getExecutor, u as cancelledError } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { D as workspaceId$1, E as workspaceDir, M as withDirLock$1, b as sharedCcache$1, d as writeWorkspaceState, j as workspaceStateFile$1, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1, t as clearWorkspaceStateKey, y as sharedBuildCache } from "./workspace-state-BdZ-QgmB.mjs";
|
|
4
3
|
import { n as stripAnsi } from "./process-output-Fpl8PYi8.mjs";
|
|
5
|
-
import { a as formatElapsed, l as phaseLine, o as formatLongDuration, s as isAppLaunchError, u as plural } from "./command-output-
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { a as formatElapsed, l as phaseLine, o as formatLongDuration, s as isAppLaunchError, u as plural } from "./command-output-DjExb_tZ.mjs";
|
|
5
|
+
import { a as clearDevice, at as isOnMountedVolume, ct as volumeRootFor, d as getConfigDir, ft as deviceSlotPlatforms, ht as projectDeviceSlots, k as withConfigLockAsync$1, m as getProject, nt as directorySizeAsync, o as clearSupervisor, rt as formatBytes, st as measuredDirectorySizeAsync, tt as directorySize, v as loadConfig$1 } from "./config-BW0fAtoK.mjs";
|
|
6
|
+
import { a as killOnAbort, n as runOperationFileQuiet, r as childEnvironment, t as runOperationFile } from "./operation-exec-DKlBcKAL.mjs";
|
|
7
|
+
import { Z as resolveProjectSettingsAsync, d as androidLayoutSetting, ft as planMetroReach, m as defaultAndroidLayout } from "./settings-B5IBDfTx.mjs";
|
|
8
|
+
import { C as resolvePackageJson, M as readMetroTunnel, N as readPidFile, P as readRemoteSession, i as findProjectRoot$1, j as clearWorkspaceSupervisor, k as clearRemoteSession, s as ownedDeviceLabel, v as detectIsExpo } from "./project-DU3jjnBE.mjs";
|
|
9
|
+
import { R as listAvdsAsync, U as ownedAvdDirectory, X as parseAvdSystemImage, Y as parseAvdDeviceProfile, d as androidToolPath, ft as isStimOwnedAvd, gt as dropParked, m as avdIniPaths, o as androidHome, pt as isStimOwnedSim, q as ownedAvdSerialResolverAsync, xt as readParked, y as avdStorageRoots, z as listInstalledSystemImages } from "./android-Iq0M2t2d.mjs";
|
|
10
|
+
import { a as listeningPidsAsync, c as pidExists, d as resolveProjectMetro, h as isMetroRunning, r as killMetroTreeAsync, u as processCwds } from "./metro-B5PVz0Wv.mjs";
|
|
11
11
|
import { c as readNdjsonGenerations$1, i as createNdjsonWriter, r as createNdjsonTail } from "./ndjson-CrjIsGzw.mjs";
|
|
12
|
-
import { T as formatSpace, a as removeEasSessionClaim, d as parseWatchRoots, f as parseWatchmanClients, i as recordEasSessionClaim, l as parseSubscriberNames, n as easMachineStateRoot$1, o as removeEasSessionClaimAsync, p as parseWatchmanPid, r as readEasSessionLedger$1, s as compareStimVersions, t as assertEasMachineRootWritable, u as parseTriggerCount, w as environmentState, y as capacity } from "./eas-session-ledger-
|
|
13
|
-
import { i as registeredCaches, r as register } from "./cache-manifest-
|
|
14
|
-
import { At as mapLimited, B as workspaceBuildInProgress, Dt as createGcResults, Et as GC_OUTPUT, F as collectOwnedDeviceActivityAsync, L as idleShutdownCandidates, Mt as sizeConcurrency, N as collectIdleDevicesAsync, _t as teardownParkedIosSim, bt as measureDu, dt as eraseParkedIosSim, gt as teardownParkedAvd, ht as teardownOwnedIosSim, i as clearWorkspaceOutputs, l as keptByLock, o as collectWorkspaceOutputs, pt as teardownOwnedAvd, ut as eraseParkedAvd, v as withIdleWorkspace, vt as probePublicHttp, wt as listBuildSlots, x as resolveSupervisorTarget, xt as writeUsageCache, yt as canonical$1, z as shutDownIdleDevices } from "./workspaces-
|
|
12
|
+
import { T as formatSpace, a as removeEasSessionClaim, d as parseWatchRoots, f as parseWatchmanClients, i as recordEasSessionClaim, l as parseSubscriberNames, n as easMachineStateRoot$1, o as removeEasSessionClaimAsync, p as parseWatchmanPid, r as readEasSessionLedger$1, s as compareStimVersions, t as assertEasMachineRootWritable, u as parseTriggerCount, w as environmentState, y as capacity } from "./eas-session-ledger-CXwagcQ7.mjs";
|
|
13
|
+
import { i as registeredCaches, r as register } from "./cache-manifest-8JX9S1QJ.mjs";
|
|
14
|
+
import { At as mapLimited, B as workspaceBuildInProgress, Dt as createGcResults, Et as GC_OUTPUT, F as collectOwnedDeviceActivityAsync, L as idleShutdownCandidates, Mt as sizeConcurrency, N as collectIdleDevicesAsync, _t as teardownParkedIosSim, bt as measureDu, dt as eraseParkedIosSim, gt as teardownParkedAvd, ht as teardownOwnedIosSim, i as clearWorkspaceOutputs, l as keptByLock, o as collectWorkspaceOutputs, pt as teardownOwnedAvd, ut as eraseParkedAvd, v as withIdleWorkspace, vt as probePublicHttp, wt as listBuildSlots, x as resolveSupervisorTarget, xt as writeUsageCache, yt as canonical$1, z as shutDownIdleDevices } from "./workspaces-B9v5V7Es.mjs";
|
|
15
15
|
import { t as canonicalPath } from "./paths-BsJMoPP2.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import { N as listBuildLocks, b as leaseIsExpired, g as workspaceActivity, o as envDir, p as readHostProcessTableAsync, x as listLeaseFiles } from "./activity-
|
|
18
|
-
import {
|
|
19
|
-
import { G as deviceHoldsBundle, O as sanitizeDeviceLabel, W as deviceHoldsApk, b as parseSimctlList, f as listAllIosSimsAsync, g as listUserApps, j as uninstallIosApp, p as listIosDeviceTypesAsync, u as iosSimulatorFailureAdvice, y as parseRuntimeVersion } from "./ios-
|
|
16
|
+
import { $ as readBundleSchemes, Z as approvableSchemes, _t as runCancellationSignal, bt as claimForEmptying, mt as nativeRunWaitNotice } from "./toolchain-CYonNjd_.mjs";
|
|
17
|
+
import { N as listBuildLocks, b as leaseIsExpired, g as workspaceActivity, o as envDir, p as readHostProcessTableAsync, x as listLeaseFiles } from "./activity-DkS-Ir6V.mjs";
|
|
18
|
+
import { u as expoConfigContents } from "./build-cache-Cqj4FGnX.mjs";
|
|
19
|
+
import { G as deviceHoldsBundle, O as sanitizeDeviceLabel, W as deviceHoldsApk, b as parseSimctlList, f as listAllIosSimsAsync, g as listUserApps, j as uninstallIosApp, p as listIosDeviceTypesAsync, u as iosSimulatorFailureAdvice, y as parseRuntimeVersion } from "./ios-BdZdNsAj.mjs";
|
|
20
20
|
import { n as supervisorError } from "./errors-DHm_U5gv.mjs";
|
|
21
|
-
import { c as findBinUpward, n as expoBinFromPackage, r as expoBinPath, s as expoTelemetryEnv } from "./server-expo-
|
|
22
|
-
import { t as DEV_MENU_LAUNCH_ARGS } from "./ios-device-
|
|
21
|
+
import { c as findBinUpward, n as expoBinFromPackage, r as expoBinPath, s as expoTelemetryEnv } from "./server-expo-CUJ2fuv1.mjs";
|
|
22
|
+
import { t as DEV_MENU_LAUNCH_ARGS } from "./ios-device-DLdEDWJj.mjs";
|
|
23
23
|
import { t as resolveMaintenanceSettings } from "./settings-D9LtQaUw.mjs";
|
|
24
24
|
import { createRequire } from "node:module";
|
|
25
25
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -27,11 +27,11 @@ import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, re
|
|
|
27
27
|
import { homedir, platform, totalmem } from "node:os";
|
|
28
28
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
29
29
|
import { LOG_ROTATE_BYTES, METRO_NAMED_CACHE_LAYOUT, ambientContext, cacheDirRefusal, compiledHelper, configDir, ensurePrivateDir, rotatedLogPath, withAmbientContext, withDirLock } from "@stim-cli/core";
|
|
30
|
-
import { DEV_SERVER_STOP_REQUEST_KEY, MACHINE_OWNER_KINDS, MAINTENANCE_LOG_NAME, budgetSweepFile, budgetSweepLock, buildWorkerRoot, gcLogFile, isJsonObject, loadConfig, machineCacheUsageFile, maintenanceNdjsonFile, readDevServerStop, readDevServerStopRequest, readJsonObject, readMachineCacheUsage, runId, settingDefinition, settingValueError, workspaceLogsDir } from "@stim-cli/core/state";
|
|
30
|
+
import { DEV_SERVER_STOP_REQUEST_KEY, MACHINE_OWNER_KINDS, MAINTENANCE_LOG_NAME, budgetSweepFile, budgetSweepLock, buildWorkerRoot, gcLogFile, isJsonObject, loadConfig, machineCacheUsageFile, maintenanceNdjsonFile, readCreatedDevices, readDevServerStop, readDevServerStopRequest, readJsonObject, readMachineCacheUsage, runId, settingDefinition, settingValueError, workspaceLogsDir } from "@stim-cli/core/state";
|
|
31
31
|
import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, relative as relative$1, resolve as resolve$1 } from "path";
|
|
32
|
-
import { fileURLToPath } from "node:url";
|
|
33
32
|
import chalk from "chalk";
|
|
34
33
|
import { existsSync as existsSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, statSync as statSync$1 } from "fs";
|
|
34
|
+
import { fileURLToPath } from "node:url";
|
|
35
35
|
import { access, lstat, readFile, readdir, rm, stat, statfs } from "node:fs/promises";
|
|
36
36
|
import { homedir as homedir$1, tmpdir as tmpdir$1 } from "os";
|
|
37
37
|
//#region src/budget-sweep.ts
|
|
@@ -2761,48 +2761,6 @@ async function readRemoteSimulatorArch(daemon, { fetch: fetchImpl = fetch, timeo
|
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
2763
|
//#endregion
|
|
2764
|
-
//#region src/engine/app-schemes.ts
|
|
2765
|
-
function schemesFromInfoPlist(plist) {
|
|
2766
|
-
const types = plist?.CFBundleURLTypes;
|
|
2767
|
-
if (!Array.isArray(types)) return [];
|
|
2768
|
-
const out = [];
|
|
2769
|
-
for (const type of types) {
|
|
2770
|
-
const schemes = type?.CFBundleURLSchemes;
|
|
2771
|
-
if (Array.isArray(schemes)) out.push(...schemes.filter((s) => typeof s === "string" && s.trim() !== ""));
|
|
2772
|
-
}
|
|
2773
|
-
return out;
|
|
2774
|
-
}
|
|
2775
|
-
function readBundleSchemes(appPath, { exec = null } = {}) {
|
|
2776
|
-
if (typeof appPath !== "string" || appPath.trim() === "") return [];
|
|
2777
|
-
const e = exec || getExecutor();
|
|
2778
|
-
let out;
|
|
2779
|
-
try {
|
|
2780
|
-
out = e.runFile("plutil", [
|
|
2781
|
-
"-convert",
|
|
2782
|
-
"json",
|
|
2783
|
-
"-o",
|
|
2784
|
-
"-",
|
|
2785
|
-
join(appPath, "Info.plist")
|
|
2786
|
-
], { timeoutMs: 1e4 });
|
|
2787
|
-
} catch {
|
|
2788
|
-
return [];
|
|
2789
|
-
}
|
|
2790
|
-
try {
|
|
2791
|
-
return schemesFromInfoPlist(JSON.parse(String(out)));
|
|
2792
|
-
} catch {
|
|
2793
|
-
return [];
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
const THIRD_PARTY_SCHEME = /^(?:fb\d+|com\.googleusercontent\.apps\.|msauth\.|msauthv2|twitterkit-|db-[a-z0-9]+$|spotify|snapchat|com\.facebook)/i;
|
|
2797
|
-
function approvableSchemes(schemes) {
|
|
2798
|
-
return (Array.isArray(schemes) ? schemes : []).filter((s) => typeof s === "string" && s.trim() !== "").map((s) => s.trim()).filter((s) => !/^(?:https?|mailto|tel|sms|itms(?:-apps)?)$/i.test(s) && !THIRD_PARTY_SCHEME.test(s));
|
|
2799
|
-
}
|
|
2800
|
-
function pickDevClientScheme(schemes) {
|
|
2801
|
-
const all = approvableSchemes(schemes);
|
|
2802
|
-
const expo = all.filter((s) => s.startsWith("exp+"));
|
|
2803
|
-
return (expo.length ? expo : all).toSorted((a, b) => b.length - a.length)[0] ?? null;
|
|
2804
|
-
}
|
|
2805
|
-
//#endregion
|
|
2806
2764
|
//#region src/engine/app-install.ts
|
|
2807
2765
|
const INSTALL_ERROR = "STIM_INSTALL_FAILED";
|
|
2808
2766
|
const LAUNCH_ERROR = "STIM_LAUNCH_FAILED";
|
|
@@ -6184,6 +6142,7 @@ function buildInventory({ sims, avds, runtimes, systemImages, config, deadProjec
|
|
|
6184
6142
|
package: image.pkg,
|
|
6185
6143
|
directory: image.directory,
|
|
6186
6144
|
avdCount: avdsByImage.get(image.pkg) ?? 0,
|
|
6145
|
+
stimInstalled: image.stimInstalled,
|
|
6187
6146
|
command: sdkmanagerCommand(image.pkg, env)
|
|
6188
6147
|
}))
|
|
6189
6148
|
};
|
|
@@ -6297,10 +6256,19 @@ async function collectInventory(config, deadProjects, env = process.env, operati
|
|
|
6297
6256
|
}
|
|
6298
6257
|
}
|
|
6299
6258
|
const imagesRoot = join(androidHome(env), "system-images");
|
|
6300
|
-
const
|
|
6301
|
-
|
|
6302
|
-
directory
|
|
6303
|
-
|
|
6259
|
+
const installedByStim = readCreatedDevices().systemImages;
|
|
6260
|
+
const images = listInstalledSystemImages((error) => notices.push(unreadableNotice("Android system images", error, env)), env, { includePartial: true }).map((image) => {
|
|
6261
|
+
const directory = join(imagesRoot, `android-${image.api}`, image.tag, image.arch);
|
|
6262
|
+
let canonical = directory;
|
|
6263
|
+
try {
|
|
6264
|
+
canonical = realpathSync(directory);
|
|
6265
|
+
} catch {}
|
|
6266
|
+
return {
|
|
6267
|
+
pkg: image.pkg,
|
|
6268
|
+
directory,
|
|
6269
|
+
stimInstalled: installedByStim.has(canonical)
|
|
6270
|
+
};
|
|
6271
|
+
});
|
|
6304
6272
|
return {
|
|
6305
6273
|
...buildInventory({
|
|
6306
6274
|
sims,
|
|
@@ -8505,4 +8473,4 @@ function resolveCcache({ root, layout = defaultAndroidLayout(root), dir = shared
|
|
|
8505
8473
|
};
|
|
8506
8474
|
}
|
|
8507
8475
|
//#endregion
|
|
8508
|
-
export { gradleVersionLines as $,
|
|
8476
|
+
export { gradleVersionLines as $, memorySweepIsScoped as $n, INSTALL_ERROR as $t, diskPressureLevel as A, loadProjectProvider as An, ensureRemoteBootOwned as At, includesArchives as B, MIN_EAS_CLI_DEVICE_VERSION as Bn, RELEASE_VERIFY_WAIT_MS as Bt, devServerStopLevel as C, runProcessOperation as Cn, describeError as Ct, requestDevServerStop as D, checkEasAuth as Dn, bundleEntryPoint as Dt, metroLastStop as E, cacheLevel as En, binOnPath as Et, gcOptionsOf as F, resolveRemote as Fn, withEasProjectLock as Ft, planCacheEmptying as G, parseArchiveSelector as Gn, unattributedLaunchLines as Gt, includesRecordings as H, easCliSupport as Hn, isBundleProof as Ht, maintenanceItem as I, uploadRemote as In, LAUNCH_BUNDLING as It, selectsBeyondCaches as J, collectMemoryReport as Jn, verifyLaunch as Jt, previewScopedEmptying as K, GRADLE_DAEMONS_KIND as Kn, unverifiedLaunchLines as Kt, openGcLog as L, bundleInvocation as Ln, LAUNCH_FATAL as Lt, levelStillShort as M, providerFromConfig as Mn, remoteAndroidDeps as Mt, lowestFree as N, readProjectConfig as Nn, remoteIosDeps as Nt, vanishedSupervisorMessage as O, easAuthNote as On, endRecordedSession as Ot, protectWindowMs as P, resolveEasCliBin as Pn, resolveRemoteContext as Pt, deleteGradleVersions as Q, memoryScope as Qn, DEFAULT_METRO_PORT as Qt, maintenanceLogger as R, remoteCliInvocation as Rn, LAUNCH_UNVERIFIED as Rt, describeMetroLastStop as S, processContext as Sn, deleteEasSessions as St, logVanishedSupervisor as T, UPLOAD_TIMEOUT_MS as Tn, REMOTE_SESSION_ERROR as Tt, includesWorkspaceOutputs as U, easCliUpgradeRemedy as Un, readCollectorRecords as Ut, includesParkedDevices as V, MIN_EAS_CLI_SIMULATOR_VERSION as Vn, VERIFY_TIMEOUT_MS as Vt, isWorkspacesScope as W, ownedSessionName as Wn, readMetroRecords as Wt, collectGradleVersions as X, memoryCacheKind as Xn, APP_READINESS_TIMEOUT_MS as Xt, trimCaches as Y, inspectWatchmanMemory as Yn, verifyReleaseLaunch as Yt, deleteGradleVersion as Z, memoryLines as Zn, ADB_INSTALL_TIMEOUT_MS as Zt, resolveBudget as _, reverseMetroPorts as _n, findStaleDeviceRecords as _t, projectCmakeLauncher as a, devClientUrl as an, attributeMachineUsage as ar, DEVICE_LIST_TIMEOUT_MS$1 as at, stopOwnedMetroForReset as b, gateMetroOrigin as bn, withAndroidAvdSizes as bt, budgetGate as c, hasMetroReverse as cn, pruneCache as cr, collectParkedSims as ct, enforceBudget as d, installIosApp as dn, deleteProjectDevices as dt, IOS_DEV_MENU_OFF_DEFAULTS_PLIST as en, memoryWorkPending as er, gradleVersionsPending as et, inspectBudget as f, iosAppProcess as fn, describeParkedSims as ft, readVolumeSpaceAsync as g, restartedAppNote as gn, findOrphanedDevices as gt, readVolumeSpace as h, launchIosApp as hn, eraseParkedDevices as ht, ccacheInstallCommand as i, clearOtherUserApps as in, phase as ir, collectInventory as it, levelFloors as j, ownerFromConfig as jn, readInstalledEasCliVersionAsync as jt, withdrawDevServerStopRequest as k, isEasAuthFailureText as kn, ensureMetroReachable as kt, budgetLine as l, installAndroidApp as ln, sizeCaches as lr, deleteParkedAvds as lt, peekBudget as m, launchAndroidReleaseApp as mn, deviceSweepIsScoped as mt, CCACHE_UNAVAILABLE as n, androidDevClientUrl as nn, scopedMemoryReport as nr, waitForGradleExit as nt, readCcacheActivity as o, deviceShellArg as on, readFootprints as or, collectDeviceLeases as ot, machineNumber as p, launchAndroidApp as pn, describeUnverifiableDevices as pt, selectCaches as q, WATCHMAN_KIND as qn, verifyAndroidReleaseLaunch as qt, ccacheActivityLine as r, appProcessFromPid as rn, stopIdleGradleDaemons as rr, getMachineCacheReport as rt, resolveCcache as s, ensureMetroReverse as sn, discoverCaches as sr, collectParkedAvds as st, CCACHE_NOT_RUN as t, androidAppProcess as tn, reclaimMemory as tr, includesGradleVersions as tt, cacheLabel as u, installConflictKind as un, deleteParkedSims as ut, trimmableCaches as v, writeDebugHttpHost as vn, findStaleProjectDevices as vt, devServerStopRecord as w, RESOLVE_TIMEOUT_MS as wn, withRemoteSessionGcLocks as wt, describeDevServerStop as x, exitAfterFlush as xn, collectEasSessionSweep as xt, stopOwnedMetro as y, readRemoteSimulatorArch as yn, unverifiedDeviceCommand as yt, emptyCaches as z, remoteCommand as zn, MANIFEST_VERIFY_TIMEOUT_MS as zt };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { E as debugLog } from "./exec-
|
|
2
|
-
import { b as refuseRelativeStimPaths } from "./config-
|
|
1
|
+
import { E as debugLog } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { b as refuseRelativeStimPaths } from "./config-BW0fAtoK.mjs";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { runId, trace } from "@stim-cli/core/state";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
//#region bin/cli.ts
|
|
7
7
|
const commands = /* @__PURE__ */ new Map([
|
|
8
|
-
["doctor", () => import("./doctor-
|
|
9
|
-
["worktree", () => import("./worktree-
|
|
10
|
-
["start", () => import("./start-
|
|
11
|
-
["ports", () => import("./ports-
|
|
12
|
-
["stop", () => import("./stop-
|
|
13
|
-
["ios", () => import("./ios-
|
|
14
|
-
["android", () => import("./android-
|
|
15
|
-
["web", () => import("./web-
|
|
16
|
-
["macos", () => import("./macos-
|
|
17
|
-
["reload", () => import("./reload-
|
|
18
|
-
["device", () => import("./device-
|
|
19
|
-
["logs", () => import("./logs-
|
|
20
|
-
["settings", () => import("./settings-
|
|
21
|
-
["status", () => import("./status-
|
|
22
|
-
["stats", () => import("./stats-
|
|
23
|
-
["gc", () => import("./gc-
|
|
24
|
-
["guide", () => import("./guide-
|
|
8
|
+
["doctor", () => import("./doctor-CGBsS_68.mjs")],
|
|
9
|
+
["worktree", () => import("./worktree-C4MBOMz7.mjs")],
|
|
10
|
+
["start", () => import("./start-Diu8q6_U.mjs")],
|
|
11
|
+
["ports", () => import("./ports-CNzg1LYD.mjs")],
|
|
12
|
+
["stop", () => import("./stop-Dm9ON6Os.mjs")],
|
|
13
|
+
["ios", () => import("./ios-sUPbWqEh.mjs")],
|
|
14
|
+
["android", () => import("./android-BU4uBX8I.mjs")],
|
|
15
|
+
["web", () => import("./web-CIpHpGp8.mjs")],
|
|
16
|
+
["macos", () => import("./macos-kWGcfLzx.mjs")],
|
|
17
|
+
["reload", () => import("./reload-YPnvXGlB.mjs")],
|
|
18
|
+
["device", () => import("./device-CWPFAqs0.mjs")],
|
|
19
|
+
["logs", () => import("./logs-DuED-01Z.mjs")],
|
|
20
|
+
["settings", () => import("./settings-DoWHJopy.mjs")],
|
|
21
|
+
["status", () => import("./status-B-oeWS0Z.mjs")],
|
|
22
|
+
["stats", () => import("./stats-D4cW247z.mjs")],
|
|
23
|
+
["gc", () => import("./gc-B464w_a5.mjs")],
|
|
24
|
+
["guide", () => import("./guide-BFW-cB7R.mjs")]
|
|
25
25
|
]);
|
|
26
26
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
27
27
|
const program = new Command();
|
|
@@ -53,7 +53,7 @@ try {
|
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
55
55
|
try {
|
|
56
|
-
const { triggerMaintenance } = await import("./trigger-
|
|
56
|
+
const { triggerMaintenance } = await import("./trigger-D8B7QR0q.mjs");
|
|
57
57
|
triggerMaintenance(action.name());
|
|
58
58
|
} catch {}
|
|
59
59
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -4,6 +4,6 @@ const encode = (version) => version.split(".", 3).reduce((sum, part) => sum * 1e
|
|
|
4
4
|
if (encode(process.versions.node) < encode("22.12.0")) {
|
|
5
5
|
process.stderr.write(`STIM_NODE_UNSUPPORTED: Stim needs Node 22.12.0 or later; this is Node ${process.versions.node} at ${process.execPath}. To run Stim where a project pins an older Node, see https://stim.appandflow.com/docs/requirements#older-node-pins\n`);
|
|
6
6
|
process.exitCode = 1;
|
|
7
|
-
} else import("./cli-
|
|
7
|
+
} else import("./cli-DjdvQG5U.mjs");
|
|
8
8
|
//#endregion
|
|
9
9
|
export {};
|