stim 1.2.0 → 1.3.1
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 +34 -3
- package/dist/{android-Bcmev2s2.mjs → android-CT-PkXUh.mjs} +157 -62
- package/dist/{android-cas-D6HPZ6UQ.mjs → android-cas-DXorPCi_.mjs} +5 -5
- package/dist/android-hMj83VpN.mjs +1374 -0
- package/dist/{app-install-NFxUahnH.mjs → app-install-DIp9riNx.mjs} +6 -6
- package/dist/{build-slots-D0b6sJyo.mjs → build-slots-C4AouyNz.mjs} +2 -2
- package/dist/{cache-manifest-Cu4_Znw9.mjs → cache-manifest-CXR-Y8pH.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/cli.mjs +13 -13
- package/dist/collector-run.d.mts +3 -1
- package/dist/collector-run.mjs +33 -8
- package/dist/{config-CMtIaTk9.mjs → config-CcefMY2Q.mjs} +93 -12
- package/dist/{deps-BLBsTNDS.mjs → deps-0Yt0Inly.mjs} +1 -1
- package/dist/{dev-client-RpvXxCXV.mjs → dev-client-VfSZNLT4.mjs} +186 -9
- package/dist/{device-CoCPmazS.mjs → device-Bbv45Z9Z.mjs} +19 -11
- package/dist/{device-lease-Dpik41RY.mjs → device-lease-CJwK7OZr.mjs} +107 -83
- package/dist/{device-pool-B5pEVa3t.mjs → device-pool-CcBNTvM7.mjs} +18 -12
- package/dist/{device-remote-E81KAdXf.mjs → device-remote-DAA0Zm6Z.mjs} +7 -7
- package/dist/{doctor-CqPeMsSm.mjs → doctor-B4EITgQB.mjs} +11 -12
- package/dist/{doctor-D_CX7ib5.mjs → doctor-BueDfLYG.mjs} +4 -4
- package/dist/{error-diagnostics-Dw8Gn3yw.mjs → error-diagnostics-DwhNBFDU.mjs} +62 -52
- package/dist/{gc-B7KkDinF.mjs → gc-BRu62v4o.mjs} +66 -57
- package/dist/{guide-BS2Xc24o.mjs → guide-D95E0u3i.mjs} +307 -74
- package/dist/{ios-B7KLgIp5.mjs → ios-DAju3TVy.mjs} +183 -54
- package/dist/{ios-D1h1Di39.mjs → ios-Deh5js5V.mjs} +78 -40
- package/dist/{ios-device-xNt0Lg6v.mjs → ios-device-CWOM_S44.mjs} +1 -1
- package/dist/{logs-DcX9AvRF.mjs → logs-CAdwW6c2.mjs} +34 -6
- package/dist/{logs-query-oqn47Ffx.mjs → logs-query-Cdp5aaCH.mjs} +23 -6
- package/dist/{metro-COslRK_F.mjs → metro-CORqXyTL.mjs} +2 -2
- package/dist/{ndjson-DcAtEx_K.mjs → ndjson-BZwI1NBv.mjs} +5 -2
- package/dist/{ownership-CGPart6T.mjs → ownership-8O073GIC.mjs} +3 -3
- package/dist/{ownership-CYOyqxUo.mjs → ownership-DXcol4oU.mjs} +3 -3
- package/dist/{ownership-claim-7zRxxTfZ.mjs → ownership-claim-BtPtJVmq.mjs} +38 -23
- package/dist/{project-BBTVABUz.mjs → project-fKmuIaMI.mjs} +2 -2
- package/dist/{reclaim-C5Jmuahx.mjs → reclaim-CUmwucWG.mjs} +80 -74
- package/dist/{reload-Z8nKifAk.mjs → reload-CWpXoOgN.mjs} +32 -24
- package/dist/{server-bare-DEk37Mz2.mjs → server-bare-DEzPZLvf.mjs} +2 -2
- package/dist/server-expo-44em5Pmg.mjs +2 -0
- package/dist/{server-expo-C3ktAwUG.mjs → server-expo-DizT4OMk.mjs} +4 -4
- package/dist/{settings-DwU1_U_q.mjs → settings-DEJf6_kJ.mjs} +2 -2
- package/dist/slot-launch-CZklomj6.mjs +19 -0
- package/dist/{start-BrY4EuIg.mjs → start-B5G4NjiA.mjs} +11 -11
- package/dist/{state-CZ-ER-8d.mjs → state-B3XA2wp2.mjs} +9 -9
- package/dist/{stats-BCWEVLrM.mjs → stats-BR-kwj0B.mjs} +1 -1
- package/dist/{stats-BsF15Bti.mjs → stats-CaaQr4yN.mjs} +3 -3
- package/dist/{status-DFI1Hfpg.mjs → status-CI9clRSb.mjs} +55 -24
- package/dist/{stop-B7DR4awK.mjs → stop-CQhffpmX.mjs} +2 -2
- package/dist/{stop-Btg770vV.mjs → stop-CjlgDk0a.mjs} +93 -42
- package/dist/supervisor-run.d.mts +1 -2
- package/dist/supervisor-run.mjs +5 -5
- package/dist/{remote-cache-DDmJ1Roq.mjs → teardown--gESs9ck.mjs} +985 -887
- package/dist/{workspace-process-lock-BKfdys1q.mjs → workspace-process-lock-IBj1Towr.mjs} +1 -1
- package/dist/{worktree-BPTbI-LN.mjs → worktree-DtQGO9-s.mjs} +121 -111
- package/dist/{worktree-C79xx_kM.mjs → worktree-Eq6TLH8N.mjs} +1 -1
- package/dist/{xcode-DeKCribl.mjs → xcode-xnxyvJkD.mjs} +159 -96
- package/package.json +5 -5
- package/dist/android-K63_0UfF.mjs +0 -727
- package/dist/build-lock-BsVoLDaq.mjs +0 -645
- package/dist/server-expo-Drd7ksHu.mjs +0 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-CyylIdq9.mjs";
|
|
2
|
-
import { f as getProject, k as withDirLock } from "./config-
|
|
3
|
-
import { f as readWorkspaceLaunches, p as readWorkspaceState } from "./state-
|
|
2
|
+
import { I as deviceSlotKey, L as deviceSlotPlatforms, f as getProject, k as withDirLock } from "./config-CcefMY2Q.mjs";
|
|
3
|
+
import { f as readWorkspaceLaunches, p as readWorkspaceState } from "./state-B3XA2wp2.mjs";
|
|
4
4
|
import { n as deviceConsoleLevel } from "./ios-device-D3pzTKQE.mjs";
|
|
5
|
-
import { i as resolveProjectMetro } from "./metro-
|
|
5
|
+
import { i as resolveProjectMetro } from "./metro-CORqXyTL.mjs";
|
|
6
6
|
import { n as parseLogcatLine, t as androidClockOffset } from "./android-BW8i_YxU.mjs";
|
|
7
7
|
import { _ as launchErrorPreview } from "./command-output-8wHMEde0.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import {
|
|
8
|
+
import { n as androidHome } from "./android-hMj83VpN.mjs";
|
|
9
|
+
import { a as parseLease, n as fileLeaseIo, t as deviceLeasePath } from "./device-lease-CJwK7OZr.mjs";
|
|
10
|
+
import { l as readLogRecords, t as attachExpoErrorContext } from "./logs-query-Cdp5aaCH.mjs";
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
@@ -333,14 +333,18 @@ function captureNativeCrashes(target, logsDir) {
|
|
|
333
333
|
if (text) records = parseAndroidCrashes(text, target, offset).map((record) => symbolicateAndroid(record, target.root, deadline));
|
|
334
334
|
}
|
|
335
335
|
} catch {}
|
|
336
|
-
for (const record of records)
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
336
|
+
for (const record of records) {
|
|
337
|
+
if (target.slot && target.slot !== "default") record.slot = target.slot;
|
|
338
|
+
try {
|
|
339
|
+
const key = createHash("sha256").update(JSON.stringify([
|
|
340
|
+
record.slot,
|
|
341
|
+
record.deviceId,
|
|
342
|
+
record.incident ?? record.deviceTs,
|
|
343
|
+
record.rawReport
|
|
344
|
+
])).digest("hex");
|
|
345
|
+
writeDiagnosticOnce(join(logsDir, `native-crash-${key}.ndjson`), `${JSON.stringify(record)}\n`);
|
|
346
|
+
} catch {}
|
|
347
|
+
}
|
|
344
348
|
return records;
|
|
345
349
|
}
|
|
346
350
|
function printNativeCrashReport(target, logsDir, emit, remote) {
|
|
@@ -350,45 +354,51 @@ function printNativeCrashReport(target, logsDir, emit, remote) {
|
|
|
350
354
|
function captureWorkspaceCrashes(root, logsDir) {
|
|
351
355
|
const attempts = readLogRecords(logsDir).filter((record) => record.event === "launch_attempt");
|
|
352
356
|
const launches = readWorkspaceLaunches(root);
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
"
|
|
377
|
-
|
|
378
|
-
|
|
357
|
+
const latest = /* @__PURE__ */ new Map();
|
|
358
|
+
for (const attempt of attempts) if (attempt.platform === "ios" || attempt.platform === "android") latest.set(deviceSlotKey(attempt.platform, String(attempt.slot ?? "default")), attempt);
|
|
359
|
+
for (const [key, attempt] of latest) {
|
|
360
|
+
const platform = attempt.platform;
|
|
361
|
+
const slot = String(attempt.slot ?? "default");
|
|
362
|
+
try {
|
|
363
|
+
if (!attempt || attempt.remote) continue;
|
|
364
|
+
const { deviceId, appId } = attempt;
|
|
365
|
+
const since = attempt.ts;
|
|
366
|
+
const until = Date.now();
|
|
367
|
+
if (typeof deviceId !== "string" || typeof appId !== "string" || typeof since !== "number" || !Number.isFinite(since)) continue;
|
|
368
|
+
if (attempt.physical) {
|
|
369
|
+
const holder = fileLeaseIo.readHolder(root)[key];
|
|
370
|
+
const lease = parseLease(fileLeaseIo.readLease(deviceLeasePath(platform, deviceId)));
|
|
371
|
+
if (holder?.id !== deviceId || !lease || lease.platform !== platform || lease.id !== deviceId || lease.holder !== root || lease.token !== holder.token || Date.parse(lease.expiresAt) <= until || !lease.grantedAt || !Number.isFinite(Date.parse(lease.grantedAt)) || Date.parse(lease.grantedAt) > since) continue;
|
|
372
|
+
} else {
|
|
373
|
+
const launch = launches[key];
|
|
374
|
+
if (!launch || launch.deviceId !== deviceId || launch.appId !== appId || Date.parse(launch.launchedAt) !== since) continue;
|
|
375
|
+
const configured = deviceSlotPlatforms(getProject(root), slot)?.[platform];
|
|
376
|
+
if (!configured?.owned) continue;
|
|
377
|
+
if (platform === "ios" && configured.deviceUdid !== deviceId) continue;
|
|
378
|
+
if (platform === "android") {
|
|
379
|
+
if (!configured.avdName) continue;
|
|
380
|
+
if (getExecutor().runFileQuiet("adb", [
|
|
381
|
+
"-s",
|
|
382
|
+
deviceId,
|
|
383
|
+
"emu",
|
|
384
|
+
"avd",
|
|
385
|
+
"name"
|
|
386
|
+
], { timeoutMs: 2e3 })?.split("\n")[0]?.trim() !== configured.avdName) continue;
|
|
387
|
+
}
|
|
379
388
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
captureNativeCrashes({
|
|
390
|
+
root,
|
|
391
|
+
slot,
|
|
392
|
+
platform,
|
|
393
|
+
deviceId,
|
|
394
|
+
appId,
|
|
395
|
+
since: Number(since),
|
|
396
|
+
until,
|
|
397
|
+
physical: attempt?.physical === true,
|
|
398
|
+
appPath: attempt?.appPath ?? readWorkspaceState(root)?.lastBuild?.appPath
|
|
399
|
+
}, logsDir);
|
|
400
|
+
} catch {}
|
|
401
|
+
}
|
|
392
402
|
}
|
|
393
403
|
//#endregion
|
|
394
404
|
//#region src/error-symbolication.ts
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { t as getExecutor } from "./exec-CyylIdq9.mjs";
|
|
2
|
-
import { A as directorySize, M as isOnMountedVolume, N as listMountedVolumes, P as volumeRootFor, g as loadConfig, i as clearDevice, j as formatBytes, u as getConfigDir, v as removeProject } from "./config-
|
|
3
|
-
import { i as registeredCaches } from "./cache-manifest-
|
|
4
|
-
import { T as workspaceDir, k as workspaceStateFile } from "./state-
|
|
5
|
-
import { g as repoRoot, s as gitCommonDir } from "./worktree-
|
|
6
|
-
import { a as findProjectRoot, i as detectIsExpo } from "./project-
|
|
7
|
-
import { S as readParked, _ as teardownParkedIosSim, b as dropParked, d as resolveEasCliBin, g as teardownParkedAvd, h as teardownOwnedIosSim, m as teardownOwnedAvd, v as POOL_SETTING_REMEDY, x as parkedMaxSetting } from "./remote-cache-DDmJ1Roq.mjs";
|
|
8
|
-
import { A as resolveSettings, N as settingShapeErrors, a as SETTING_SHAPE_REMEDY } from "./settings-DwU1_U_q.mjs";
|
|
2
|
+
import { A as directorySize, M as isOnMountedVolume, N as listMountedVolumes, P as volumeRootFor, g as loadConfig, i as clearDevice, j as formatBytes, u as getConfigDir, v as removeProject, z as projectDeviceSlots } from "./config-CcefMY2Q.mjs";
|
|
3
|
+
import { i as registeredCaches } from "./cache-manifest-CXR-Y8pH.mjs";
|
|
4
|
+
import { T as workspaceDir, k as workspaceStateFile } from "./state-B3XA2wp2.mjs";
|
|
5
|
+
import { g as repoRoot, s as gitCommonDir } from "./worktree-Eq6TLH8N.mjs";
|
|
6
|
+
import { a as findProjectRoot, i as detectIsExpo } from "./project-fKmuIaMI.mjs";
|
|
9
7
|
import { m as shortUdid, o as formatLongDuration, u as plural } from "./command-output-8wHMEde0.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { i as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { o as clearFreeClaimSet, u as readClaimSet } from "./ownership-claim-BtPtJVmq.mjs";
|
|
9
|
+
import { B as listBuildLocks, S as listOrphanedAvdDirectories, T as ownedAvdDirectory, b as listAvds } from "./android-hMj83VpN.mjs";
|
|
10
|
+
import { A as resolveSettings, N as settingShapeErrors, a as SETTING_SHAPE_REMEDY } from "./settings-DEJf6_kJ.mjs";
|
|
11
|
+
import { a as POOL_SETTING_REMEDY, c as parkedMaxSetting, i as teardownParkedIosSim, l as readParked, n as teardownOwnedIosSim, r as teardownParkedAvd, s as dropParked, t as teardownOwnedAvd, x as resolveEasCliBin } from "./teardown--gESs9ck.mjs";
|
|
12
|
+
import { d as listIosDeviceTypes, g as parseRuntimeVersion, u as listAllIosSims } from "./ios-Deh5js5V.mjs";
|
|
13
|
+
import { i as listLeaseFiles, r as leaseIsExpired, u as removeExpiredLease } from "./device-lease-CJwK7OZr.mjs";
|
|
14
|
+
import { n as listBuildSlots } from "./build-slots-C4AouyNz.mjs";
|
|
15
|
+
import { C as verifyStoppedSession, S as stopSessionArgs, _ as inspectSessionForTeardown, d as withEasProjectLock, f as easMachineStateRoot, g as getSessionArgs, h as findOrphanedOwnedSessions, m as removeEasSessionClaim, p as readEasSessionLedger, u as withRemoteSessionLock, v as isDefinitiveMissingSessionError, x as parseSessionListPage, y as listOwnedSessionsArgs } from "./device-remote-DAA0Zm6Z.mjs";
|
|
16
|
+
import { n as reclaimProject, t as describeDereferenced } from "./reclaim-CUmwucWG.mjs";
|
|
18
17
|
import { InvalidArgumentError } from "commander";
|
|
19
18
|
import { existsSync, readFileSync, readdirSync, realpathSync, rmSync, statSync } from "fs";
|
|
20
19
|
import { homedir, tmpdir } from "os";
|
|
@@ -413,16 +412,18 @@ function findOrphanedDevices({ sims = [], avds = [], config, isMounted, deadProj
|
|
|
413
412
|
for (const [path, proj] of Object.entries(config?.projects || {})) {
|
|
414
413
|
if (dead.has(path)) continue;
|
|
415
414
|
const mounted = isMounted ? isMounted(path) : true;
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
415
|
+
for (const { platforms } of projectDeviceSlots(proj)) {
|
|
416
|
+
const ios = platforms.ios;
|
|
417
|
+
if (ios?.deviceUdid) referenced.set(ios.deviceUdid, {
|
|
418
|
+
path,
|
|
419
|
+
mounted
|
|
420
|
+
});
|
|
421
|
+
const android = platforms.android;
|
|
422
|
+
if (android?.avdName) referenced.set(android.avdName, {
|
|
423
|
+
path,
|
|
424
|
+
mounted
|
|
425
|
+
});
|
|
426
|
+
}
|
|
426
427
|
}
|
|
427
428
|
for (const sim of readParked("ios", { config })) referenced.set(sim.udid, {
|
|
428
429
|
path: "the simulator pool",
|
|
@@ -481,22 +482,26 @@ function findStaleProjectDevices({ config, sims = [], avds = [], olderThanDays,
|
|
|
481
482
|
const touched = lastTouched(path);
|
|
482
483
|
if (!Number.isFinite(touched) || touched >= cutoff) continue;
|
|
483
484
|
const idleDays = Math.floor((now - touched) / DAY_MS);
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
485
|
+
for (const { slot, platforms } of projectDeviceSlots(proj)) {
|
|
486
|
+
const ios = platforms.ios;
|
|
487
|
+
if (ios?.owned && ios.deviceUdid && liveSims.has(ios.deviceUdid)) stale.push({
|
|
488
|
+
kind: "ios",
|
|
489
|
+
id: ios.deviceUdid,
|
|
490
|
+
name: liveSims.get(ios.deviceUdid),
|
|
491
|
+
project: path,
|
|
492
|
+
...slot === "default" ? {} : { slot },
|
|
493
|
+
idleDays
|
|
494
|
+
});
|
|
495
|
+
const android = platforms.android;
|
|
496
|
+
if (android?.owned && android.avdName && liveAvds.has(android.avdName)) stale.push({
|
|
497
|
+
kind: "android",
|
|
498
|
+
id: android.avdName,
|
|
499
|
+
name: android.avdName,
|
|
500
|
+
project: path,
|
|
501
|
+
idleDays,
|
|
502
|
+
...slot === "default" ? {} : { slot }
|
|
503
|
+
});
|
|
504
|
+
}
|
|
500
505
|
}
|
|
501
506
|
return stale;
|
|
502
507
|
}
|
|
@@ -507,20 +512,24 @@ function findStaleDeviceRecords({ config, sims = [], avds = [], deadProjects = [
|
|
|
507
512
|
const stale = [];
|
|
508
513
|
for (const [path, proj] of Object.entries(config?.projects || {})) {
|
|
509
514
|
if (dead.has(path)) continue;
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
515
|
+
for (const { slot, platforms } of projectDeviceSlots(proj)) {
|
|
516
|
+
const ios = platforms.ios;
|
|
517
|
+
if (simsChecked && ios?.deviceUdid && !liveSims.has(ios.deviceUdid)) stale.push({
|
|
518
|
+
kind: "ios",
|
|
519
|
+
id: ios.deviceUdid,
|
|
520
|
+
project: path,
|
|
521
|
+
...slot === "default" ? {} : { slot },
|
|
522
|
+
owned: Boolean(ios.owned)
|
|
523
|
+
});
|
|
524
|
+
const android = platforms.android;
|
|
525
|
+
if (avdsChecked && android?.avdName && !liveAvds.has(android.avdName)) stale.push({
|
|
526
|
+
kind: "android",
|
|
527
|
+
id: android.avdName,
|
|
528
|
+
project: path,
|
|
529
|
+
...slot === "default" ? {} : { slot },
|
|
530
|
+
owned: Boolean(android.owned)
|
|
531
|
+
});
|
|
532
|
+
}
|
|
524
533
|
}
|
|
525
534
|
return stale;
|
|
526
535
|
}
|
|
@@ -704,12 +713,12 @@ function deleteProjectDevices(orphanedDevices, staleDevices, staleDeviceRecords)
|
|
|
704
713
|
for (const d of staleDevices) {
|
|
705
714
|
const status = reap(d);
|
|
706
715
|
if (status === "torn-down" || status === "missing") {
|
|
707
|
-
clearDevice(d.project, d.kind);
|
|
716
|
+
clearDevice(d.project, d.kind, d.slot);
|
|
708
717
|
console.log(chalk.dim(` cleared the ${d.kind} record for ${d.project}`));
|
|
709
718
|
}
|
|
710
719
|
}
|
|
711
720
|
for (const r of staleDeviceRecords) {
|
|
712
|
-
clearDevice(r.project, r.kind);
|
|
721
|
+
clearDevice(r.project, r.kind, r.slot);
|
|
713
722
|
console.log(chalk.green(`Cleared the ${r.kind} record for ${r.project} (${r.id} is not on this machine)`));
|
|
714
723
|
}
|
|
715
724
|
return deleteFailures;
|