stim 1.3.0 → 1.4.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 +17 -3
- package/dist/{android-CqcW1hrP.mjs → android-BTR1KTMP.mjs} +206 -120
- package/dist/{android-BqVIJoG7.mjs → android-BkM4qTaN.mjs} +76 -77
- package/dist/{android-cas-BR5YJBYv.mjs → android-cas-BjLRZyks.mjs} +15 -12
- package/dist/{app-install-DIp9riNx.mjs → app-install--PAocWvq.mjs} +2 -2
- package/dist/{build-slots-C3-R4XQr.mjs → build-slots-D6sDzOe-.mjs} +7 -8
- package/dist/{cache-manifest-CXR-Y8pH.mjs → cache-manifest-D02TpYjA.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/cli.mjs +14 -13
- package/dist/collector-run.mjs +4 -4
- package/dist/{command-output-8wHMEde0.mjs → command-output-BuIb_ZOI.mjs} +1 -4
- package/dist/{config-CcefMY2Q.mjs → config-6vdGngKa.mjs} +51 -51
- package/dist/dependency-state-BMirHEPD.mjs +76 -0
- package/dist/{deps-Spz8ozgo.mjs → deps-Ck4wuTwa.mjs} +1 -1
- package/dist/{dev-client-BjisHDB5.mjs → dev-client-Cd0v7iZk.mjs} +12 -12
- package/dist/{device-BkiW-gkk.mjs → device-CKXLnRRb.mjs} +7 -7
- package/dist/device-CMDFzx7C.mjs +1136 -0
- package/dist/{device-lease-BJYybF-2.mjs → device-lease-DDJr85OK.mjs} +3 -3
- package/dist/{device-pool-CPbLGfrB.mjs → device-pool-DJvbIBGW.mjs} +4 -4
- package/dist/{device-remote-AkYCKS8U.mjs → device-remote-CMfHhoc8.mjs} +7 -6
- package/dist/{doctor-Bmv86UUW.mjs → doctor-B_mfURdt.mjs} +536 -114
- package/dist/{error-diagnostics-DHC31rXA.mjs → error-diagnostics-_VmkqRZo.mjs} +8 -7
- package/dist/{gc-GGu-8ULN.mjs → gc-0AyxmECv.mjs} +61 -27
- package/dist/{guide-92CPA21s.mjs → guide-CGxdmQ0K.mjs} +236 -67
- package/dist/{ios-BSXFeO5H.mjs → ios-CtmGLx3X.mjs} +2667 -2607
- package/dist/{ios-device-CWOM_S44.mjs → ios-device-DJOi9FR5.mjs} +1 -1
- package/dist/{logs-DPNF4C9s.mjs → logs-BF3qPA7w.mjs} +32 -7
- package/dist/{logs-query-R-Cqc6Qv.mjs → logs-query-Cdp5aaCH.mjs} +1 -1
- package/dist/metro-DFLmaVz8.mjs +99 -0
- package/dist/named-ports-BO7Zpjp0.mjs +137 -0
- package/dist/{ownership-8O073GIC.mjs → ownership-BvSpZVBk.mjs} +5 -5
- package/dist/{ownership-BpCKiRlQ.mjs → ownership-C08Yzrp7.mjs} +6 -6
- package/dist/ports-BiKqP92J.mjs +39 -0
- package/dist/ports-ClqG8GPt.mjs +90 -0
- package/dist/{project-fKmuIaMI.mjs → project-CBFCwnN5.mjs} +2 -2
- package/dist/{reclaim-iW9Cad7k.mjs → reclaim-DpDVo-AP.mjs} +20 -13
- package/dist/{reload-DazHDSFA.mjs → reload-ByTqg6ZI.mjs} +8 -8
- package/dist/rolldown-runtime-BsOwBuO_.mjs +30 -0
- package/dist/{server-bare-DEzPZLvf.mjs → server-bare-Buk-k8tI.mjs} +3 -6
- package/dist/{server-expo-DizT4OMk.mjs → server-expo-D4P7iTvf.mjs} +3 -3
- package/dist/server-expo-Dho5Raiw.mjs +2 -0
- package/dist/{settings-DEJf6_kJ.mjs → settings-DwfltIXQ.mjs} +2 -2
- package/dist/{slot-launch-cci0xvmC.mjs → slot-launch-DeKen9e5.mjs} +4 -4
- package/dist/{start-mObjQH2W.mjs → start-BpKUHcU_.mjs} +16 -14
- package/dist/state-CDbvmZdt.mjs +131 -0
- package/dist/{stats-BR-kwj0B.mjs → stats-C59QLKm2.mjs} +1 -1
- package/dist/{stats-CaaQr4yN.mjs → stats-k5qMjyxo.mjs} +4 -4
- package/dist/{status-BxQNqu9t.mjs → status-Y2ij3dm6.mjs} +13 -12
- package/dist/{stop-DimGXEKY.mjs → stop-_P2OQwmZ.mjs} +15 -14
- package/dist/{stop-CrHGcjrV.mjs → stop-vKmmxhea.mjs} +2 -2
- package/dist/supervisor-run.d.mts +3 -27
- package/dist/supervisor-run.mjs +7 -6
- package/dist/{teardown-ClFp1Aax.mjs → teardown-KsPpvldq.mjs} +248 -110
- package/dist/{workspace-process-lock-3NcQnZ0X.mjs → workspace-process-lock-UEIrvZMJ.mjs} +4 -4
- package/dist/workspace-state-Do1e2mOH.mjs +146 -0
- package/dist/{worktree-DxTgN1CJ.mjs → worktree-BvcAIMdJ.mjs} +132 -123
- package/dist/{worktree-Eq6TLH8N.mjs → worktree-DWNx4tUg.mjs} +32 -2
- package/dist/xcode-D9tVItl-.mjs +860 -0
- package/package.json +7 -7
- package/dist/doctor-fAMXC4vl.mjs +0 -530
- package/dist/metro-CORqXyTL.mjs +0 -184
- package/dist/ownership-claim-Bf2CAfw3.mjs +0 -570
- package/dist/server-expo-44em5Pmg.mjs +0 -2
- package/dist/state-B3XA2wp2.mjs +0 -268
- package/dist/xcode-D7sAp-Zy.mjs +0 -1858
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-CyylIdq9.mjs";
|
|
2
|
-
import { u as getConfigDir } from "./config-
|
|
3
|
-
import { r as register } from "./cache-manifest-
|
|
4
|
-
import {
|
|
5
|
-
import { r as pidExists } from "./metro-
|
|
6
|
-
import { a as formatElapsed } from "./command-output-
|
|
7
|
-
import {
|
|
8
|
-
import { c as androidDataPartitionSizeBytes } from "./settings-DEJf6_kJ.mjs";
|
|
2
|
+
import { E as ownership_claim_exports, u as getConfigDir } from "./config-6vdGngKa.mjs";
|
|
3
|
+
import { r as register } from "./cache-manifest-D02TpYjA.mjs";
|
|
4
|
+
import { l as sharedBuildCache } from "./workspace-state-Do1e2mOH.mjs";
|
|
5
|
+
import { r as pidExists } from "./metro-DFLmaVz8.mjs";
|
|
6
|
+
import { a as formatElapsed } from "./command-output-BuIb_ZOI.mjs";
|
|
7
|
+
import { c as androidDataPartitionSizeBytes } from "./settings-DwfltIXQ.mjs";
|
|
9
8
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
9
|
import { createHash } from "node:crypto";
|
|
11
10
|
import { join } from "node:path";
|
|
12
|
-
import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, openSync as openSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, statSync as statSync$1,
|
|
11
|
+
import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, openSync as openSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, statSync as statSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
13
12
|
import { homedir } from "os";
|
|
14
|
-
import {
|
|
15
|
-
import { buildCacheKey } from "@stim-cli/core";
|
|
13
|
+
import { dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, resolve as resolve$1 } from "path";
|
|
14
|
+
import { buildCacheKey, resolveArtifact, storeArtifact } from "@stim-cli/core";
|
|
16
15
|
import * as expoFingerprint from "@expo/fingerprint";
|
|
17
16
|
import { buildUploadTimeoutMs } from "@stim-cli/cache";
|
|
18
17
|
const ASSET_MANIFEST_FILE = "assets-manifest.json";
|
|
@@ -163,16 +162,6 @@ function safeList$1(dir) {
|
|
|
163
162
|
function entryDir(platform, key, root = sharedBuildCache()) {
|
|
164
163
|
return join$1(root, platform, key);
|
|
165
164
|
}
|
|
166
|
-
function artifactIn(dir) {
|
|
167
|
-
if (!existsSync$1(dir)) return null;
|
|
168
|
-
let found;
|
|
169
|
-
try {
|
|
170
|
-
found = readdirSync$1(dir).find((f) => f.endsWith(".app") || f.endsWith(".apk"));
|
|
171
|
-
} catch {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
return found ? join$1(dir, found) : null;
|
|
175
|
-
}
|
|
176
165
|
const FINGERPRINT_PLATFORMS = /* @__PURE__ */ new Set(["ios", "android"]);
|
|
177
166
|
/**
|
|
178
167
|
* Paths that exist in a working checkout and not in a fresh one, which
|
|
@@ -211,55 +200,25 @@ function registerOnce(root) {
|
|
|
211
200
|
} catch {}
|
|
212
201
|
}
|
|
213
202
|
function resolveBuild(platform, key, root = sharedBuildCache()) {
|
|
214
|
-
|
|
215
|
-
if (!hit) return null;
|
|
216
|
-
try {
|
|
217
|
-
utimesSync(dirname$1(hit), /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date());
|
|
218
|
-
} catch {}
|
|
219
|
-
return hit;
|
|
203
|
+
return resolveArtifact(entryDir(platform, key, root));
|
|
220
204
|
}
|
|
221
205
|
function storeBuild(platform, key, buildPath, rootOrOptions = {}) {
|
|
222
206
|
const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions || {};
|
|
223
207
|
const root = options.root || sharedBuildCache();
|
|
224
|
-
const overwrite = Boolean(options.overwrite);
|
|
225
208
|
if (!buildPath || !existsSync$1(buildPath)) throw new Error(`No build to store at ${buildPath}`);
|
|
226
209
|
registerOnce(root);
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
"-c",
|
|
239
|
-
"-R",
|
|
240
|
-
buildPath,
|
|
241
|
-
join$1(staging, basename$1(buildPath))
|
|
242
|
-
]);
|
|
243
|
-
} catch {
|
|
244
|
-
getExecutor().runFile("cp", [
|
|
245
|
-
"-R",
|
|
246
|
-
buildPath,
|
|
247
|
-
join$1(staging, basename$1(buildPath))
|
|
248
|
-
]);
|
|
249
|
-
}
|
|
250
|
-
if (Array.isArray(options.sources)) try {
|
|
251
|
-
writeFileSync$1(join$1(staging, SOURCES_FILE), JSON.stringify(options.sources));
|
|
252
|
-
} catch {}
|
|
253
|
-
if (options.assetManifest) try {
|
|
254
|
-
writeFileSync$1(join$1(staging, ASSET_MANIFEST_FILE), JSON.stringify(options.assetManifest));
|
|
255
|
-
} catch {}
|
|
256
|
-
mkdirSync$1(dirname$1(dest), { recursive: true });
|
|
257
|
-
rmSync$1(dest, {
|
|
258
|
-
recursive: true,
|
|
259
|
-
force: true
|
|
210
|
+
return storeArtifact(entryDir(platform, key, root), buildPath, {
|
|
211
|
+
runFile: getExecutor().runFile,
|
|
212
|
+
overwrite: Boolean(options.overwrite),
|
|
213
|
+
writeMetadata: (staging) => {
|
|
214
|
+
if (Array.isArray(options.sources)) try {
|
|
215
|
+
writeFileSync$1(join$1(staging, SOURCES_FILE), JSON.stringify(options.sources));
|
|
216
|
+
} catch {}
|
|
217
|
+
if (options.assetManifest) try {
|
|
218
|
+
writeFileSync$1(join$1(staging, ASSET_MANIFEST_FILE), JSON.stringify(options.assetManifest));
|
|
219
|
+
} catch {}
|
|
220
|
+
}
|
|
260
221
|
});
|
|
261
|
-
renameSync$1(staging, dest);
|
|
262
|
-
return artifactIn(dest);
|
|
263
222
|
}
|
|
264
223
|
const PROVIDER_DOWNLOAD_DIR = "cache-provider";
|
|
265
224
|
function providerDownloadPath(workspacePath) {
|
|
@@ -498,13 +457,13 @@ function toRecord(holder) {
|
|
|
498
457
|
}
|
|
499
458
|
function readBuildLock(pathOrSpec) {
|
|
500
459
|
const path = typeof pathOrSpec === "string" ? pathOrSpec : buildLockPath(pathOrSpec.platform, pathOrSpec.key);
|
|
501
|
-
const survey = readClaimSet(path);
|
|
460
|
+
const survey = (0, ownership_claim_exports.readClaimSet)(path);
|
|
502
461
|
const holder = survey.live[0] ?? survey.dead[0];
|
|
503
462
|
return holder ? toRecord(holder) : null;
|
|
504
463
|
}
|
|
505
464
|
function acquireBuildLock({ platform, key, root = null, logFile = null }) {
|
|
506
465
|
const path = buildLockPath(platform, key);
|
|
507
|
-
const attempt = tryAcquireClaim({
|
|
466
|
+
const attempt = (0, ownership_claim_exports.tryAcquireClaim)({
|
|
508
467
|
root: path,
|
|
509
468
|
mode: "exclusive",
|
|
510
469
|
label: label(platform),
|
|
@@ -531,7 +490,7 @@ function acquireBuildLock({ platform, key, root = null, logFile = null }) {
|
|
|
531
490
|
tookOver: toRecord(reaped)
|
|
532
491
|
} : handle;
|
|
533
492
|
}
|
|
534
|
-
if (attempt.pending) releaseClaim(attempt.pending);
|
|
493
|
+
if (attempt.pending) (0, ownership_claim_exports.releaseClaim)(attempt.pending);
|
|
535
494
|
const holder = attempt.held ?? attempt.waitingFor?.[0];
|
|
536
495
|
return holder ? {
|
|
537
496
|
held: toRecord(holder),
|
|
@@ -539,7 +498,7 @@ function acquireBuildLock({ platform, key, root = null, logFile = null }) {
|
|
|
539
498
|
} : { path };
|
|
540
499
|
}
|
|
541
500
|
function releaseBuildLock(handle) {
|
|
542
|
-
return releaseClaim(handle?.claim);
|
|
501
|
+
return (0, ownership_claim_exports.releaseClaim)(handle?.claim);
|
|
543
502
|
}
|
|
544
503
|
function listBuildLocks() {
|
|
545
504
|
const dir = buildLocksDir();
|
|
@@ -560,7 +519,7 @@ function listBuildLocks() {
|
|
|
560
519
|
}
|
|
561
520
|
const stem = name.slice(0, -5);
|
|
562
521
|
const cut = stem.indexOf("-");
|
|
563
|
-
const survey = readClaimSet(path);
|
|
522
|
+
const survey = (0, ownership_claim_exports.readClaimSet)(path);
|
|
564
523
|
const holder = survey.live[0] ?? survey.dead[0];
|
|
565
524
|
const info = holder ? toRecord(holder) : null;
|
|
566
525
|
locks.push({
|
|
@@ -601,9 +560,9 @@ async function waitForBuild({ platform, key, resolve = resolveBuild, intervalMs
|
|
|
601
560
|
hit,
|
|
602
561
|
waitedMs: now() - started
|
|
603
562
|
};
|
|
604
|
-
const survey = readClaimSet(path);
|
|
563
|
+
const survey = (0, ownership_claim_exports.readClaimSet)(path);
|
|
605
564
|
const unresolved = survey.unresolved[0];
|
|
606
|
-
if (unresolved) throw new ClaimRefusedError({
|
|
565
|
+
if (unresolved) throw new ownership_claim_exports.ClaimRefusedError({
|
|
607
566
|
claimPath: unresolved.path,
|
|
608
567
|
root: path,
|
|
609
568
|
label: label(platform),
|
|
@@ -626,7 +585,7 @@ async function waitForBuild({ platform, key, resolve = resolveBuild, intervalMs
|
|
|
626
585
|
}
|
|
627
586
|
const elapsed = now() - started;
|
|
628
587
|
if (elapsed >= ceilingMs) {
|
|
629
|
-
const err = /* @__PURE__ */ new Error(`Waited ${formatElapsed(elapsed)} for ${holder?.projectRoot || "another workspace"}'s ${platform} build of ${key} without an artifact, and pid ${holder?.pid} is still the live holder. The lock is ${path}; remove it if that process is not really building:\n ${claimRemoveCommand(path)}`);
|
|
588
|
+
const err = /* @__PURE__ */ new Error(`Waited ${formatElapsed(elapsed)} for ${holder?.projectRoot || "another workspace"}'s ${platform} build of ${key} without an artifact, and pid ${holder?.pid} is still the live holder. The lock is ${path}; remove it if that process is not really building:\n ${(0, ownership_claim_exports.claimRemoveCommand)(path)}`);
|
|
630
589
|
err.code = "STIM_BUILD_WAIT_TIMEOUT";
|
|
631
590
|
err.lockPath = path;
|
|
632
591
|
err.holder = holder ?? void 0;
|
|
@@ -750,14 +709,48 @@ function pickDefaultSystemImage(images, { systemImage, hostArch } = {}) {
|
|
|
750
709
|
if (matching.length === 0) return null;
|
|
751
710
|
return matching.toSorted((a, b) => pageSizeRank(a) - pageSizeRank(b) || b.api - a.api || (b.tag === "google_apis" ? 1 : 0) - (a.tag === "google_apis" ? 1 : 0))[0] ?? null;
|
|
752
711
|
}
|
|
753
|
-
function createOwnedAvd(label, { systemImage } = {}) {
|
|
712
|
+
async function createOwnedAvd(label, { systemImage, spawn = (...args) => getExecutor().spawn(...args) } = {}) {
|
|
754
713
|
const pick = pickDefaultSystemImage(listInstalledSystemImages(), { systemImage });
|
|
755
714
|
if (!pick) {
|
|
756
715
|
const arch = hostSystemImageArch();
|
|
757
716
|
throw new Error(`No ${arch} Android system image is installed. Install one, e.g.: sdkmanager "system-images;android-36;google_apis;${arch}"`);
|
|
758
717
|
}
|
|
759
718
|
const avdName = ownedAvdName(label);
|
|
760
|
-
|
|
719
|
+
const tool = androidToolPath("avdmanager");
|
|
720
|
+
const args = [
|
|
721
|
+
"create",
|
|
722
|
+
"avd",
|
|
723
|
+
"-n",
|
|
724
|
+
avdName,
|
|
725
|
+
"-k",
|
|
726
|
+
pick.pkg,
|
|
727
|
+
"--device",
|
|
728
|
+
DEFAULT_AVD_DEVICE
|
|
729
|
+
];
|
|
730
|
+
const child = spawn(tool, args, {
|
|
731
|
+
detached: true,
|
|
732
|
+
stdio: [
|
|
733
|
+
"pipe",
|
|
734
|
+
"pipe",
|
|
735
|
+
"pipe"
|
|
736
|
+
]
|
|
737
|
+
});
|
|
738
|
+
let stderr = "";
|
|
739
|
+
child.stdout?.on("data", () => {});
|
|
740
|
+
child.stderr?.on("data", (chunk) => {
|
|
741
|
+
stderr = (stderr + String(chunk)).slice(-67108864);
|
|
742
|
+
});
|
|
743
|
+
const completed = new Promise((finish, reject) => {
|
|
744
|
+
child.once("error", reject);
|
|
745
|
+
child.once("close", (code, signal) => finish({
|
|
746
|
+
code,
|
|
747
|
+
signal
|
|
748
|
+
}));
|
|
749
|
+
});
|
|
750
|
+
child.stdin?.on("error", () => {});
|
|
751
|
+
child.stdin?.end("no\n");
|
|
752
|
+
const result = await completed;
|
|
753
|
+
if (result.code !== 0) throw new Error(`Command failed: ${tool} ${args.join(" ")} (${result.signal ?? result.code})\n${stderr.trim()}`);
|
|
761
754
|
return {
|
|
762
755
|
avdName,
|
|
763
756
|
systemImage: pick.pkg
|
|
@@ -1275,15 +1268,21 @@ async function waitForBoot(serial, timeoutMs = 6e4, { aborted = () => false, pol
|
|
|
1275
1268
|
}
|
|
1276
1269
|
await new Promise((r) => setTimeout(r, commandTimeoutMs === void 0 ? pollMs : Math.min(pollMs, Math.max(0, timeoutMs - (Date.now() - start)))));
|
|
1277
1270
|
}
|
|
1278
|
-
const
|
|
1271
|
+
const diagnosticDeadline = Date.now() + Math.min(commandTimeoutMs ?? 5e3, 5e3);
|
|
1272
|
+
const diagnosticQuery = (args) => {
|
|
1273
|
+
const remaining = diagnosticDeadline - Date.now();
|
|
1274
|
+
if (remaining <= 0) return "";
|
|
1275
|
+
const value = exec.runQuiet(`${androidTool("adb")} ${args}`, { timeoutMs: remaining });
|
|
1276
|
+
return typeof value === "string" ? value.trim() : "";
|
|
1277
|
+
};
|
|
1279
1278
|
return {
|
|
1280
1279
|
ok: false,
|
|
1281
1280
|
...exited ? { exited: true } : {},
|
|
1282
1281
|
diagnostic: {
|
|
1283
|
-
devices:
|
|
1284
|
-
sysBoot:
|
|
1285
|
-
devBoot:
|
|
1286
|
-
bootAnim:
|
|
1282
|
+
devices: diagnosticQuery("devices"),
|
|
1283
|
+
sysBoot: diagnosticQuery(`-s ${serial} shell getprop sys.boot_completed`),
|
|
1284
|
+
devBoot: diagnosticQuery(`-s ${serial} shell getprop dev.bootcomplete`),
|
|
1285
|
+
bootAnim: diagnosticQuery(`-s ${serial} shell getprop init.svc.bootanim`)
|
|
1287
1286
|
}
|
|
1288
1287
|
};
|
|
1289
1288
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-CyylIdq9.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { r as register } from "./cache-manifest-
|
|
4
|
-
import {
|
|
2
|
+
import { D as withDirLock, u as getConfigDir } from "./config-6vdGngKa.mjs";
|
|
3
|
+
import { r as register } from "./cache-manifest-D02TpYjA.mjs";
|
|
4
|
+
import { _ as workspaceLogsDir, c as ensureWorkspaceStorage, u as sharedCcache } from "./workspace-state-Do1e2mOH.mjs";
|
|
5
5
|
import { n as stripAnsi, r as waitForChild, t as createLineReader } from "./process-output-C7IlIzd7.mjs";
|
|
6
|
-
import { l as phaseLine } from "./command-output-
|
|
7
|
-
import { n as androidHome } from "./android-
|
|
8
|
-
import {
|
|
6
|
+
import { l as phaseLine } from "./command-output-BuIb_ZOI.mjs";
|
|
7
|
+
import { n as androidHome } from "./android-BkM4qTaN.mjs";
|
|
8
|
+
import { d as startBuildHeartbeat, n as HEARTBEAT_INTERVAL_MS } from "./xcode-D9tVItl-.mjs";
|
|
9
9
|
import { accessSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { createHash, randomUUID } from "node:crypto";
|
|
11
11
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
@@ -717,7 +717,10 @@ function gradleArgs(task, { buildCache = true, abi = null } = {}) {
|
|
|
717
717
|
async function buildAndroid({ root, logWriter, variant = null, abi = null }, { spawnFn = null, now = Date.now, env = process.env, buildCache = true, ccache = null, cas = null, pch = "auto", compilerCacheDisabled = false, heartbeatMs = HEARTBEAT_INTERVAL_MS, estimateMs = null, onHeartbeat = (line) => console.error(line), onNote = (line) => console.error(line) } = {}) {
|
|
718
718
|
const project = discoverAndroidProject(root);
|
|
719
719
|
if (project.failed) return {
|
|
720
|
-
|
|
720
|
+
ok: false,
|
|
721
|
+
code: project.code,
|
|
722
|
+
reason: project.reason,
|
|
723
|
+
remedy: project.remedy,
|
|
721
724
|
diagnostics: [],
|
|
722
725
|
truncated: 0,
|
|
723
726
|
lastLines: [],
|
|
@@ -730,7 +733,7 @@ async function buildAndroid({ root, logWriter, variant = null, abi = null }, { s
|
|
|
730
733
|
hasLocalProperties: existsSync(join(project.androidDir, "local.properties"))
|
|
731
734
|
});
|
|
732
735
|
if (refusal) return {
|
|
733
|
-
|
|
736
|
+
ok: false,
|
|
734
737
|
...refusal,
|
|
735
738
|
diagnostics: [],
|
|
736
739
|
truncated: 0,
|
|
@@ -841,7 +844,7 @@ async function buildAndroid({ root, logWriter, variant = null, abi = null }, { s
|
|
|
841
844
|
const how = result.signal ? `signal ${result.signal}` : `exit code ${result.code}`;
|
|
842
845
|
const { shown, truncated } = capDiagnostics(extractGradleDiagnostics(transcript));
|
|
843
846
|
return {
|
|
844
|
-
|
|
847
|
+
ok: false,
|
|
845
848
|
code: BUILD_ERROR,
|
|
846
849
|
reason: `\`./gradlew ${task}\` failed (${how}).`,
|
|
847
850
|
diagnostics: shown,
|
|
@@ -853,7 +856,7 @@ async function buildAndroid({ root, logWriter, variant = null, abi = null }, { s
|
|
|
853
856
|
}
|
|
854
857
|
const located = locateApk(root, transcript, variant);
|
|
855
858
|
if (!located.apkPath && located.candidates?.length) return {
|
|
856
|
-
|
|
859
|
+
ok: false,
|
|
857
860
|
code: BUILD_ERROR,
|
|
858
861
|
reason: `\`./gradlew ${task}\` left ${located.candidates.length} debug APKs under ${apkOutputsDir(root)}, and nothing says which flavor to install.`,
|
|
859
862
|
remedy: `Set the android.variant setting to the variant to install -- e.g. {"android": {"variant": "${variantNameOf(relative(apkOutputsDir(root), located.candidates[0]).split("/").slice(0, -1))}"}} in .stim.json.`,
|
|
@@ -864,7 +867,7 @@ async function buildAndroid({ root, logWriter, variant = null, abi = null }, { s
|
|
|
864
867
|
ccache: ccacheActivity
|
|
865
868
|
};
|
|
866
869
|
if (!located.apkPath) return {
|
|
867
|
-
|
|
870
|
+
ok: false,
|
|
868
871
|
code: BUILD_ERROR,
|
|
869
872
|
reason: variant ? `\`./gradlew ${task}\` succeeded but produced no APK under ${apkOutputsDir(root)} for variant "${variant}".` : `\`./gradlew ${task}\` succeeded but produced no APK in ${debugApkDir(root)}.`,
|
|
870
873
|
remedy: variant ? `Check that the android.variant setting ("${variant}") names a real variant (\`./gradlew :app:tasks\` lists the assemble tasks).` : `Check that ${task} builds the app module (\`./gradlew :app:${task}\` in android/) and that no flavour redirects the output.`,
|
|
@@ -894,7 +897,7 @@ function spawnFailure(err, project, durationMs) {
|
|
|
894
897
|
const message = String(nodeErr?.message || err || "");
|
|
895
898
|
const permissionDenied = nodeErr?.code === "EACCES" || /EACCES|permission denied/i.test(message);
|
|
896
899
|
return {
|
|
897
|
-
|
|
900
|
+
ok: false,
|
|
898
901
|
code: BUILD_ERROR,
|
|
899
902
|
reason: `Could not run ${project.gradlew}: ${message}`,
|
|
900
903
|
remedy: permissionDenied ? `Make the wrapper executable: \`chmod +x ${project.gradlew}\`.` : "Check that the gradle wrapper is intact (android/gradlew and android/gradle/wrapper/) and that JAVA_HOME points at a JDK 17 install.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-CyylIdq9.mjs";
|
|
2
2
|
import { o as parseNdjsonText } from "./ndjson-BZwI1NBv.mjs";
|
|
3
3
|
import { t as DEV_MENU_LAUNCH_ARGS } from "./ios-device-D3pzTKQE.mjs";
|
|
4
|
-
import { s as isAppLaunchError } from "./command-output-
|
|
4
|
+
import { s as isAppLaunchError } from "./command-output-BuIb_ZOI.mjs";
|
|
5
5
|
import { l as iosSimulatorFailureAdvice, p as listUserApps, w as uninstallIosApp } from "./ios-Deh5js5V.mjs";
|
|
6
6
|
import { closeSync, lstatSync, openSync, readFileSync, readSync, readdirSync } from "node:fs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
@@ -1136,7 +1136,7 @@ function unverifiedLaunchLines({ platform, metroPort, waitedMs = VERIFY_TIMEOUT_
|
|
|
1136
1136
|
if (platform === "ios") {
|
|
1137
1137
|
push(picker);
|
|
1138
1138
|
if (url && udid) push(`Retry the deep link: xcrun simctl openurl ${udid} '${url}'`);
|
|
1139
|
-
else if (udid && bundleId) push(`Re-launch: xcrun simctl launch --
|
|
1139
|
+
else if (udid && bundleId) push(`Re-launch: xcrun simctl launch --terminate-running-process ${udid} ${bundleId}`);
|
|
1140
1140
|
} else {
|
|
1141
1141
|
if (url && serial) push(`Re-send the dev-client deep link -- this is the command that points the app at THIS workspace's Metro: adb -s ${serial} shell am start -a android.intent.action.VIEW -d ${deviceShellArg(deviceShellArg(url))} --ez ${ANDROID_DISABLE_AUTO_LAUNCH_EXTRA} true`);
|
|
1142
1142
|
push(picker);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { u as getConfigDir } from "./config-
|
|
2
|
-
import { a as formatElapsed } from "./command-output-
|
|
3
|
-
import { d as readClaimSet, f as releaseClaim, h as tryAcquireClaim, s as isClaimRefusal } from "./ownership-claim-Bf2CAfw3.mjs";
|
|
1
|
+
import { E as ownership_claim_exports, u as getConfigDir } from "./config-6vdGngKa.mjs";
|
|
2
|
+
import { a as formatElapsed } from "./command-output-BuIb_ZOI.mjs";
|
|
4
3
|
import { readdirSync, statSync } from "node:fs";
|
|
5
4
|
import { join } from "node:path";
|
|
6
5
|
//#region src/engine/build-slots.ts
|
|
@@ -39,7 +38,7 @@ function tryAcquireBuildSlot({ max, root = null, logFile = null }) {
|
|
|
39
38
|
const path = buildSlotPath(index);
|
|
40
39
|
let attempt;
|
|
41
40
|
try {
|
|
42
|
-
attempt = tryAcquireClaim({
|
|
41
|
+
attempt = (0, ownership_claim_exports.tryAcquireClaim)({
|
|
43
42
|
root: path,
|
|
44
43
|
mode: "exclusive",
|
|
45
44
|
label: SLOT_LABEL,
|
|
@@ -50,11 +49,11 @@ function tryAcquireBuildSlot({ max, root = null, logFile = null }) {
|
|
|
50
49
|
}
|
|
51
50
|
});
|
|
52
51
|
} catch (err) {
|
|
53
|
-
if (!isClaimRefusal(err)) throw err;
|
|
52
|
+
if (!(0, ownership_claim_exports.isClaimRefusal)(err)) throw err;
|
|
54
53
|
refusal ??= err;
|
|
55
54
|
continue;
|
|
56
55
|
}
|
|
57
|
-
if (attempt.pending) releaseClaim(attempt.pending);
|
|
56
|
+
if (attempt.pending) (0, ownership_claim_exports.releaseClaim)(attempt.pending);
|
|
58
57
|
if (!attempt.acquired) {
|
|
59
58
|
busy = true;
|
|
60
59
|
continue;
|
|
@@ -111,7 +110,7 @@ async function acquireBuildSlot({ max, root = null, logFile = null, now = Date.n
|
|
|
111
110
|
}
|
|
112
111
|
function releaseBuildSlot(handle) {
|
|
113
112
|
if (!handle || handle.unlimited) return false;
|
|
114
|
-
return releaseClaim(handle.claim);
|
|
113
|
+
return (0, ownership_claim_exports.releaseClaim)(handle.claim);
|
|
115
114
|
}
|
|
116
115
|
function listBuildSlots() {
|
|
117
116
|
const dir = buildSlotsDir();
|
|
@@ -130,7 +129,7 @@ function listBuildSlots() {
|
|
|
130
129
|
} catch {
|
|
131
130
|
continue;
|
|
132
131
|
}
|
|
133
|
-
const survey = readClaimSet(path);
|
|
132
|
+
const survey = (0, ownership_claim_exports.readClaimSet)(path);
|
|
134
133
|
const holder = survey.live[0] ?? survey.dead[0];
|
|
135
134
|
const info = holder ? toRecord(holder) : null;
|
|
136
135
|
const index = Number(name.slice(5));
|
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-D02TpYjA.mjs";
|
|
2
2
|
export { manifestPath, readManifest, register, registeredCaches, unregister };
|
package/dist/cli.mjs
CHANGED
|
@@ -3,19 +3,20 @@ import { readFileSync } from "node:fs";
|
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
//#region bin/cli.ts
|
|
5
5
|
const commands = /* @__PURE__ */ new Map([
|
|
6
|
-
["doctor", () => import("./doctor-
|
|
7
|
-
["worktree", () => import("./worktree-
|
|
8
|
-
["start", () => import("./start-
|
|
9
|
-
["
|
|
10
|
-
["
|
|
11
|
-
["
|
|
12
|
-
["
|
|
13
|
-
["
|
|
14
|
-
["
|
|
15
|
-
["
|
|
16
|
-
["
|
|
17
|
-
["
|
|
18
|
-
["
|
|
6
|
+
["doctor", () => import("./doctor-B_mfURdt.mjs")],
|
|
7
|
+
["worktree", () => import("./worktree-BvcAIMdJ.mjs")],
|
|
8
|
+
["start", () => import("./start-BpKUHcU_.mjs")],
|
|
9
|
+
["ports", () => import("./ports-BiKqP92J.mjs")],
|
|
10
|
+
["stop", () => import("./stop-vKmmxhea.mjs")],
|
|
11
|
+
["ios", () => import("./ios-CtmGLx3X.mjs")],
|
|
12
|
+
["android", () => import("./android-BTR1KTMP.mjs")],
|
|
13
|
+
["reload", () => import("./reload-ByTqg6ZI.mjs")],
|
|
14
|
+
["device", () => import("./device-CKXLnRRb.mjs")],
|
|
15
|
+
["logs", () => import("./logs-BF3qPA7w.mjs")],
|
|
16
|
+
["status", () => import("./status-Y2ij3dm6.mjs")],
|
|
17
|
+
["stats", () => import("./stats-k5qMjyxo.mjs")],
|
|
18
|
+
["gc", () => import("./gc-0AyxmECv.mjs")],
|
|
19
|
+
["guide", () => import("./guide-CGxdmQ0K.mjs")]
|
|
19
20
|
]);
|
|
20
21
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
21
22
|
const program = new Command();
|
package/dist/collector-run.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-CyylIdq9.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { P as deviceSlotKey, w as process_identity_exports, z as validateDeviceSlot } from "./config-6vdGngKa.mjs";
|
|
3
3
|
import { r as createNdjsonWriter } from "./ndjson-BZwI1NBv.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { _ as workspaceLogsDir } from "./workspace-state-Do1e2mOH.mjs";
|
|
5
5
|
import { t as createLineReader } from "./process-output-C7IlIzd7.mjs";
|
|
6
6
|
import { i as startIosDeviceConsole, r as parseDeviceConsoleLine } from "./ios-device-D3pzTKQE.mjs";
|
|
7
|
-
import { a as unregisterCollector, i as registerCollector, r as readCollectors, t as collectorProcessTitle } from "./ownership-
|
|
7
|
+
import { a as unregisterCollector, i as registerCollector, r as readCollectors, t as collectorProcessTitle } from "./ownership-BvSpZVBk.mjs";
|
|
8
8
|
import { a as watchAppPid, i as waitForAppPid, n as parseLogcatLine, r as startAndroidLogcat, t as androidClockOffset } from "./android-BW8i_YxU.mjs";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { isAbsolute, join, resolve } from "node:path";
|
|
@@ -301,7 +301,7 @@ async function runCollector({ slot = "default", platform, root, udid = null, app
|
|
|
301
301
|
};
|
|
302
302
|
const writer = createNdjsonWriter(join(workspaceLogsDir(root), "device.ndjson"));
|
|
303
303
|
const startedAt = new Date(now()).toISOString();
|
|
304
|
-
const processToken = captureProcessToken(process.pid);
|
|
304
|
+
const processToken = (0, process_identity_exports.captureProcessToken)(process.pid);
|
|
305
305
|
if (!processToken) {
|
|
306
306
|
stderr("Stim collector: could not capture process identity; refusing to start an unmanaged collector.");
|
|
307
307
|
writer.close();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as stripAnsi } from "./process-output-C7IlIzd7.mjs";
|
|
2
|
+
import { quotedPath } from "@stim-cli/core";
|
|
2
3
|
//#region src/launch-error-preview.ts
|
|
3
4
|
function framePriority(frame, root) {
|
|
4
5
|
const normalized = frame.replaceAll("\\", "/");
|
|
@@ -244,10 +245,6 @@ function releasedLeaseFact(lease) {
|
|
|
244
245
|
function phaseLine(label, text) {
|
|
245
246
|
return ` ${String(label).padEnd(LABEL_WIDTH)} ${text}`;
|
|
246
247
|
}
|
|
247
|
-
/** Quote a path for a shell command Stim prints for a human to copy and run. */
|
|
248
|
-
function quotedPath(path) {
|
|
249
|
-
return `'${path.replaceAll("'", "'\\''")}'`;
|
|
250
|
-
}
|
|
251
248
|
function shortUdid(udid) {
|
|
252
249
|
const text = String(udid ?? "");
|
|
253
250
|
return text.length > 4 ? `${text.slice(0, 4)}..` : text;
|