stim 1.17.2 → 1.18.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 +50 -1
- package/dist/{activity-IRvJY_ru.mjs → activity-BxnkDZDi.mjs} +4 -4
- package/dist/{agent-device-usage-output-BK41vnzN.mjs → agent-device-usage-output-CZ66YA4T.mjs} +8 -8
- package/dist/android-BKA16DTf.mjs +4 -0
- package/dist/{android-B9yaNKwa.mjs → android-BvwuMUJ9.mjs} +192 -98
- package/dist/{android-DE4v59Mb.mjs → android-CBwCNicO.mjs} +2 -2
- package/dist/{android-B_YNZy61.mjs → android-DC3ZLuw0.mjs} +9 -9
- package/dist/{android-cas-ZFpjJBL_.mjs → android-cas-BBFyr9CA.mjs} +5 -5
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/api-D0VtFhqk.mjs +152 -0
- package/dist/api-run.d.mts +1 -0
- package/dist/api-run.mjs +145 -0
- package/dist/api.d.mts +212 -0
- package/dist/api.mjs +2 -0
- package/dist/{app-install-VPkI5WEg.mjs → app-install-D-PUENug.mjs} +3 -3
- package/dist/{attempt-Bk2ouQVL.mjs → attempt-DW-mQqM7.mjs} +14 -4
- package/dist/{budget-DfcgFdQB.mjs → budget-DIhL2BKx.mjs} +1578 -58
- package/dist/build-facts-DcLv2HSd.d.mts +111 -0
- package/dist/{cache-manifest-DnUHBJaU.mjs → cache-manifest-BI7ozfmH.mjs} +3 -3
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{chrome-BrcVWQyD.mjs → chrome-DJnmnS5q.mjs} +1 -1
- package/dist/cli-DNJMwADx.mjs +68 -0
- package/dist/cli.mjs +1 -1
- package/dist/{client-SvBdgObD.mjs → client-DzhapoMB.mjs} +139 -32
- package/dist/collector-run.mjs +9 -9
- package/dist/{command-output-CDAIFD-8.mjs → command-output-CBtzyIgF.mjs} +2 -2
- package/dist/{config-D0DbpZtM.mjs → config-CgYMahz7.mjs} +5 -5
- package/dist/{created-devices-CpvzBL25.mjs → created-devices-DKbeWsiK.mjs} +2 -2
- package/dist/{dependency-state-CLcBHH2M.mjs → dependency-state-xKoOypBm.mjs} +2 -2
- package/dist/{detached-entry-CiTEgMR1.mjs → detached-entry-BLfcgc4O.mjs} +1 -1
- package/dist/{dev-client-B-XC4uRH.mjs → dev-client-CLnIH02x.mjs} +2 -2
- package/dist/{device-C8IOoJPv.mjs → device-D7oCHGWi.mjs} +8 -8
- package/dist/{device-capacity-ZC4XSZ4R.mjs → device-capacity-EUOOYr8T.mjs} +13 -13
- package/dist/device-host-worker.mjs +19 -19
- package/dist/{device-ios-C2Um-XUR.mjs → device-ios-6MewKKnc.mjs} +13 -13
- package/dist/{device-lease-DpoS36_u.mjs → device-lease-Co-EwifR.mjs} +9 -9
- package/dist/{device-lease-run-B8YltIH_.mjs → device-lease-run-w1xhCqIW.mjs} +4 -4
- package/dist/{device-pool-3o7s5lo4.mjs → device-pool-F5WvRPtD.mjs} +3 -3
- package/dist/{device-remote-hFSkpfQu.mjs → device-remote-tHbd1fKy.mjs} +15 -15
- package/dist/{doctor-CFv1fCrF.mjs → doctor-B9ckYUoU.mjs} +33 -30
- package/dist/{error-diagnostics-C-NMnhrk.mjs → error-diagnostics-BRXOqDzG.mjs} +11 -11
- package/dist/{exec-CaErVv7t.mjs → exec-DWhCZDGm.mjs} +65 -2
- package/dist/{gc-DEmkg3Xh.mjs → gc-Dh6mXOKC.mjs} +23 -469
- package/dist/{gradle-dJpre3Yn.mjs → gradle-C6GKnunQ.mjs} +6 -6
- package/dist/{guide-status-Du-ZQ3FD.mjs → guide-status-Bhf9SJXc.mjs} +3 -3
- package/dist/{guide-CSmhMTf8.mjs → guide-tm6igAaa.mjs} +290 -53
- package/dist/{hosted-android-E1Heoqnv.mjs → hosted-android-Bv285t_t.mjs} +3 -3
- package/dist/{hosted-client-Bp4knSwu.mjs → hosted-client-C-rMtppF.mjs} +2 -2
- package/dist/{hosted-ios-BnbeYOUD.mjs → hosted-ios-D5mNmtj4.mjs} +1 -1
- package/dist/{hosted-logs-OcgIBvCT.mjs → hosted-logs-DN8Iz4mJ.mjs} +9 -9
- package/dist/{hosted-macos-DcxKjtfH.mjs → hosted-macos-B-wEjlwG.mjs} +5 -5
- package/dist/{hosted-native-1Ebbig4w.mjs → hosted-native-DeeOG8xZ.mjs} +6 -6
- package/dist/{idle-shutdown-IGyNV8Cr.mjs → idle-shutdown-jjtxAn5C.mjs} +7 -8
- package/dist/{ios-DSfnPfse.mjs → ios-B3SbOWdw.mjs} +19 -7
- package/dist/{ios-Cr1h5gnO.mjs → ios-Bvbf0SGY.mjs} +1 -1
- package/dist/{ios-BJ4XUSe1.mjs → ios-CPdkoKaa.mjs} +181 -95
- package/dist/ios-DNpdygiv.mjs +7 -0
- package/dist/{ios-device-Ee7sDXfp.mjs → ios-device-Bn7jWDB1.mjs} +1 -1
- package/dist/{ios-device-pAN4t54-.mjs → ios-device-vOaByMhw.mjs} +3 -3
- package/dist/{ios-state-8L3lgum6.mjs → ios-state-B2pES6Vs.mjs} +1 -1
- package/dist/{launch-verify-lTnWZikR.mjs → launch-verify-hskNcWkZ.mjs} +5 -5
- package/dist/{logs-BAaS7gS2.mjs → logs-1Ylc1Ri6.mjs} +13 -13
- package/dist/macos-Ck7OBMNY.mjs +2 -0
- package/dist/{macos-BIRQS90f.mjs → macos-DF6C7wUU.mjs} +118 -34
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +349 -47
- package/dist/{metro-g8NqiJp-.mjs → metro-Dh8T4Ytd.mjs} +5 -5
- package/dist/{metro-gateway-C-ijGI2F.mjs → metro-gateway-CEUw9RMH.mjs} +4 -4
- package/dist/{metro-store-CDDZHtPl.mjs → metro-store-BAHFcJm6.mjs} +16 -2
- package/dist/{named-ports-C8m8EQs2.mjs → named-ports-BFIz1Shz.mjs} +61 -6
- package/dist/{native-run-D1Q56rAD.mjs → native-run-B06FkmZx.mjs} +4 -4
- package/dist/{native-runtime-BEK171xQ.mjs → native-runtime-D_603JiC.mjs} +6 -6
- package/dist/{ndjson-PclOIwVY.mjs → ndjson-LGZAMsqa.mjs} +8 -4
- package/dist/offload-worker.d.mts +3 -17
- package/dist/offload-worker.mjs +10 -11
- package/dist/{ownership-DyRQru0q.mjs → ownership-D6Se7gg_.mjs} +3 -3
- package/dist/{page-QF_Ke10s.mjs → page-Bv9s2KwY.mjs} +1 -1
- package/dist/placement-log-BcPhRwR4.mjs +84 -0
- package/dist/{build-plan-BDsSi09V.mjs → plan-placement-CtxkCO54.mjs} +122 -48
- package/dist/{ports-4nYqxPWC.mjs → ports-BLTtfBq-.mjs} +3 -3
- package/dist/{prebuild-D7RUMkwN.mjs → prebuild-juCyreaR.mjs} +5 -5
- package/dist/preview-D5V07Nrl.mjs +987 -0
- package/dist/{rolldown-runtime-BsOwBuO_.mjs → process-identity-Biv3arCO.mjs} +11 -1
- package/dist/{project-D47Rh0ly.mjs → project-C3ChRLZy.mjs} +4 -68
- package/dist/projects-DD7dBTCj.mjs +92 -0
- package/dist/{pull-request-pxnDCQzn.mjs → pull-request-u4vp7zmK.mjs} +1 -1
- package/dist/pull-requests.mjs +1 -1
- package/dist/{recordings-BNgsD1Tr.mjs → recordings-BAWltsVt.mjs} +1 -1
- package/dist/{reload-DcRxj3qG.mjs → reload-DvyWzVjJ.mjs} +15 -15
- package/dist/{remote-cache-Ci4DQYYj.mjs → remote-cache-BGg7aGIZ.mjs} +5 -5
- package/dist/{run-CkE9y0nc.mjs → run-vhtDgpHO.mjs} +5 -5
- package/dist/{server-bare-BkrSxSsZ.mjs → server-bare-B9E7S1aR.mjs} +4 -5
- package/dist/server-expo-Db9HBUoa.mjs +2 -0
- package/dist/{server-expo-CHTyXD0G.mjs → server-expo-DoBHhuzK.mjs} +5 -6
- package/dist/{settings-SR9OmW9h.mjs → settings-Byp2AQ_E.mjs} +6 -5
- package/dist/{settings-Cfd-0r2d.mjs → settings-CQyMElEP.mjs} +24 -763
- package/dist/{settings-BBpMcDbD.mjs → settings-Djl-mpjX.mjs} +1 -1
- package/dist/settings.schema.json +126 -3
- package/dist/{simslim-BWNrc3M3.mjs → simslim-EHBQ2R4G.mjs} +7 -7
- package/dist/{slot-launch-DmjBmpQV.mjs → slot-launch-C1nqh4mu.mjs} +6 -6
- package/dist/{spawn-claims-D0XfSe8u.mjs → spawn-claims-Kqiifsk2.mjs} +1 -1
- package/dist/{spawn-entry-jw19m8Nl.mjs → spawn-entry-Dcb7sDUz.mjs} +1 -0
- package/dist/{stage-CzaiwFsI.mjs → stage-g_WqWeaE.mjs} +14 -3
- package/dist/{start-DUz3mYdb.mjs → start-D-IeOyoK.mjs} +19 -19
- package/dist/{start-AlfCPRVU.mjs → start-NTc1Ifqs.mjs} +1 -1
- package/dist/{state-PeQiJuIu.mjs → state-BG-aAk4k.mjs} +4 -4
- package/dist/{state-B4PQFXMW.d.mts → state-lKh8shBp.d.mts} +2 -3
- package/dist/{state-DyaNTgfR.mjs → state-xnqpx3AD.mjs} +2 -2
- package/dist/{stats-Bq4fJOdB.mjs → stats-DY6ekz8F.mjs} +5 -5
- package/dist/{status-DlKvVJBE.mjs → status-BEeL6IKz.mjs} +6 -4
- package/dist/{status-BA2pehwf.mjs → status-DCjZeE-K.mjs} +33 -34
- package/dist/{status-CzS4bPO9.mjs → status-Dcr0Qexd.mjs} +5 -5
- package/dist/{stim-desktop-Cnz8CPnl.mjs → stim-desktop-Behws_fi.mjs} +1 -1
- package/dist/{stim-installations-QMEI32v1.mjs → stim-installations-aR_WsNOA.mjs} +1 -1
- package/dist/{stop-BIiM49EY.mjs → stop-BGhKMOuH.mjs} +5 -5
- package/dist/{stop-DQIasgKp.mjs → stop-BTjs3xbc.mjs} +17 -18
- package/dist/{stop-zF1y04f2.mjs → stop-DIJtD2GL.mjs} +2 -2
- package/dist/supervisor-run.d.mts +24 -22
- package/dist/supervisor-run.mjs +21 -22
- package/dist/{support-CsJNVfOc.mjs → support-BaayeYCf.mjs} +7 -7
- package/dist/{support-WvD__tSV.mjs → support-Bwvbrq5-.mjs} +5 -5
- package/dist/{toolchain-DNyR3NPq.mjs → toolchain-Bnyd_K3A.mjs} +471 -22
- package/dist/{trigger-Bemu8ytw.mjs → trigger-CJMhwXe8.mjs} +5 -5
- package/dist/trigger-DWAq9hkw.mjs +2 -0
- package/dist/{warm-progress-DF4JRvYI.mjs → warm-progress-CjB-MP6H.mjs} +7 -7
- package/dist/web-B6_bFDn7.mjs +2 -0
- package/dist/{web-Dl0KSRHf.mjs → web-DTU0uiWj.mjs} +22 -22
- package/dist/web-run.mjs +10 -10
- package/dist/{workspace-state-DqcCbpE7.mjs → workspace-state-C59dqG-Z.mjs} +3 -3
- package/dist/{ownership-BMLqyBgJ.mjs → workspaces-xXItD8Dj.mjs} +577 -23
- package/dist/{worktree-j3IcFAI5.mjs → worktree-BJfnU6r5.mjs} +1 -1
- package/dist/{worktree-Be_7NLKy.mjs → worktree-BSYlofkq.mjs} +234 -35
- package/dist/worktree-CsKYexJM.mjs +753 -0
- package/package.json +10 -5
- package/dist/build-progress-D0WkjCPd.mjs +0 -1036
- package/dist/build-slots-41v_d2x9.mjs +0 -142
- package/dist/cli-CYXb29oE.mjs +0 -51
- package/dist/deps-iKw0eD4P.mjs +0 -438
- package/dist/errors-B6W7FkxQ.mjs +0 -15
- package/dist/idle-BXG__1BA.mjs +0 -176
- package/dist/in-use-CvGOUn-x.mjs +0 -130
- package/dist/preview-B-g9d7kV.mjs +0 -318
- package/dist/process-identity-BmRm1qV0.mjs +0 -12
- package/dist/server-expo-CeakhI8P.mjs +0 -2
- package/dist/state-BKa8wNN5.mjs +0 -148
- package/dist/stop-cause-rhmGfwvt.mjs +0 -97
- package/dist/trigger-CXts6qt1.mjs +0 -2
- package/dist/watchman-APYjXSQa.mjs +0 -48
- package/dist/workspace-process-lock-2mNzOlaB.mjs +0 -58
- package/dist/workspaces-Bcib97-6.mjs +0 -306
|
@@ -1,44 +1,222 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { o as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { a as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { n as verifyCollectorOwnership } from "./ownership-
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-
|
|
29
|
-
import { a as forgetStatusMeasures, s as mergeState, t as startWarmProgress } from "./warm-progress-DF4JRvYI.mjs";
|
|
30
|
-
import { r as workspaceRecordingEnabled } from "./recordings-BNgsD1Tr.mjs";
|
|
31
|
-
import { r as stopHostedIos } from "./hosted-ios-BnbeYOUD.mjs";
|
|
32
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
1
|
+
import { n as ownership_claim_exports, t as process_identity_exports } from "./process-identity-Biv3arCO.mjs";
|
|
2
|
+
import { t as getExecutor } from "./exec-DWhCZDGm.mjs";
|
|
3
|
+
import { a as formatElapsed, h as shortUdid, i as formatDuration, l as phaseLine, p as releasedLeaseFact, u as plural } from "./command-output-CBtzyIgF.mjs";
|
|
4
|
+
import { E as upsertProject, H as projectDeviceSlots, S as removeProject, _ as loadConfig$1, a as clearDevice, d as getConfigDir, g as isPathPrefix, k as acquireAvdClaim, p as getProject } from "./config-CgYMahz7.mjs";
|
|
5
|
+
import { C as sourceCheckoutOf, S as restoreFile, T as warmWorktreePaths, _ as readWorktreeExclude, b as resolveFullRef, c as gitCommonDirOnDisk, d as hasUncommittedWork, f as isPodInstallChurn, g as podsOutOfSync, h as locallyKnownUpstream, i as depsOutOfSync, l as hasPopulatedSubmodules, m as listWorktrees, n as cloneIgnoredEntries, o as dirtyPaths, r as deleteBranch, s as gitCommonDir, t as branchExists, u as hasRemote, v as removeWorktree, w as unpushedCommits } from "./worktree-CsKYexJM.mjs";
|
|
6
|
+
import { n as appProjectProblem, s as findProjectRoot$1 } from "./project-C3ChRLZy.mjs";
|
|
7
|
+
import { l as resolveProjectMetro, o as pidExists, r as killMetroTree, u as signalProcessTree } from "./metro-Dh8T4Ytd.mjs";
|
|
8
|
+
import { g as workspaceAgentDeviceDir, i as recordWorkspaceUse, r as readWorkspaceState$1, v as workspaceDir } from "./workspace-state-C59dqG-Z.mjs";
|
|
9
|
+
import { o as readWebRecord } from "./state-BG-aAk4k.mjs";
|
|
10
|
+
import { Gt as readRemoteSessionId, Ht as readMetroTunnel, Rt as clearManagedMetroTunnel, Wt as readRemoteSession, b as withdrawDevServerStopRequest, o as machineNumber, v as requestDevServerStop, zt as clearRemoteSession } from "./budget-DIhL2BKx.mjs";
|
|
11
|
+
import { D as teardownOwnedBrowser, E as teardownOwnedAvd, O as teardownOwnedIosSim, d as emptyWorkspaceDir, f as withIdleWorkspace, g as stopTunnel, m as resolveSupervisorTarget, x as withManagedTunnelRemovalLock, y as withManagedRemoteWorktreeRemovalLock } from "./workspaces-xXItD8Dj.mjs";
|
|
12
|
+
import { t as agentDeviceDaemon } from "./activity-BxnkDZDi.mjs";
|
|
13
|
+
import { u as releaseWorkspaceLeases } from "./device-lease-Co-EwifR.mjs";
|
|
14
|
+
import { ft as parkedMaxSetting, ot as POOL_SETTING_REMEDY } from "./android-DC3ZLuw0.mjs";
|
|
15
|
+
import { a as workspaceLinks, i as workspaceLinkLine } from "./stim-desktop-Behws_fi.mjs";
|
|
16
|
+
import { F as resolveSettings, U as unknownSettingKeys, i as SETTING_SHAPE_REMEDY, j as readCommittedSettings, z as settingShapeErrors } from "./settings-CQyMElEP.mjs";
|
|
17
|
+
import { t as clearNamedPorts } from "./named-ports-BFIz1Shz.mjs";
|
|
18
|
+
import { c as DEPS_ERROR, f as runCaptured, g as HEARTBEAT_INTERVAL_MS, k as podInstallCommand, l as podsAreStale, p as runPodInstall, u as readPodState } from "./toolchain-Bnyd_K3A.mjs";
|
|
19
|
+
import { i as stopHostedAndroid } from "./hosted-android-Bv285t_t.mjs";
|
|
20
|
+
import { f as resolveEasCliBin } from "./remote-cache-BGg7aGIZ.mjs";
|
|
21
|
+
import { i as endRecordedSession } from "./device-remote-tHbd1fKy.mjs";
|
|
22
|
+
import { n as verifyCollectorOwnership } from "./ownership-D6Se7gg_.mjs";
|
|
23
|
+
import { r as stopHostedIos } from "./hosted-ios-D5mNmtj4.mjs";
|
|
24
|
+
import { t as stopMacosApp } from "./stop-BGhKMOuH.mjs";
|
|
25
|
+
import { a as pullRequestLookup, r as endedPullRequest } from "./pull-request-u4vp7zmK.mjs";
|
|
26
|
+
import { a as forgetStatusMeasures, s as mergeState, t as startWarmProgress } from "./warm-progress-CjB-MP6H.mjs";
|
|
27
|
+
import { r as workspaceRecordingEnabled } from "./recordings-BAWltsVt.mjs";
|
|
28
|
+
import { n as hasInstalledDependencies, r as installedNpmTreeIsValid, t as dependencyState } from "./dependency-state-xKoOypBm.mjs";
|
|
33
29
|
import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
|
|
34
30
|
import { basename, dirname, join, relative } from "node:path";
|
|
35
|
-
import { existsSync as existsSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1 } from "fs";
|
|
36
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";
|
|
37
|
-
import { withDirLock, workspaceName } from "@stim-cli/core";
|
|
38
32
|
import { LAST_BUILD_KEYS, archiveDir, archiveEnabled, archiveLock, archiveRoot, archivedUsage, countErrorEntries, endedAgentSessionOf, listRecordedDevices, loadConfig, queryLogs, readArchives, readBuildHistory, readJsonObject, readLastBuilds, readMacosRecord, readPullRequestCache, readWorkspaceState, recordingEnabled, sortByTs } from "@stim-cli/core/state";
|
|
39
|
-
import { claimRemoveCommand, clearFreeClaimSet, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
40
33
|
import { homedir } from "node:os";
|
|
41
34
|
import chalk from "chalk";
|
|
35
|
+
import { existsSync as existsSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, readlinkSync as readlinkSync$1, realpathSync as realpathSync$1, renameSync as renameSync$1, rmSync as rmSync$1, symlinkSync as symlinkSync$1, unlinkSync as unlinkSync$1, writeFileSync as writeFileSync$1 } from "fs";
|
|
36
|
+
import { withDirLock, workspaceName } from "@stim-cli/core";
|
|
37
|
+
import { claimRemoveCommand, clearFreeClaimSet, readClaimSet, releaseClaim, tryAcquireClaim } from "@stim-cli/core/ownership-claim";
|
|
38
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
39
|
+
import { createHash as createHash$1 } from "crypto";
|
|
40
|
+
//#region src/workspace/pods-relocate.ts
|
|
41
|
+
const CHECKSUMS_HEADER = "SPEC CHECKSUMS:\n";
|
|
42
|
+
const GENERATED_DIRS = [
|
|
43
|
+
"Target Support Files",
|
|
44
|
+
"Pods.xcodeproj",
|
|
45
|
+
"Local Podspecs"
|
|
46
|
+
];
|
|
47
|
+
function normalize$1(text) {
|
|
48
|
+
return text.replace(/\r\n/g, "\n").trimEnd() + "\n";
|
|
49
|
+
}
|
|
50
|
+
function splitChecksums(text) {
|
|
51
|
+
const start = text.indexOf(`\n${CHECKSUMS_HEADER}`);
|
|
52
|
+
if (start === -1) return null;
|
|
53
|
+
const bodyStart = start + 1 + 16;
|
|
54
|
+
const lines = text.slice(bodyStart).split("\n");
|
|
55
|
+
const entries = /* @__PURE__ */ new Map();
|
|
56
|
+
let used = 0;
|
|
57
|
+
for (const line of lines) {
|
|
58
|
+
const match = /^ {2}"?([^":\s]+)"?: ([0-9a-f]{40})$/.exec(line);
|
|
59
|
+
if (!match) break;
|
|
60
|
+
entries.set(match[1], match[2]);
|
|
61
|
+
used += line.length + 1;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
before: text.slice(0, bodyStart),
|
|
65
|
+
entries,
|
|
66
|
+
after: text.slice(bodyStart + used)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function pathPattern(root, flags = "") {
|
|
70
|
+
const escaped = root.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
71
|
+
return new RegExp(`(?:(?<![\\p{L}\\p{N}_.-])|(?<=-[IFL]))${escaped}(?![\\p{L}\\p{N}_.-])`, `u${flags}`);
|
|
72
|
+
}
|
|
73
|
+
function sha1(text) {
|
|
74
|
+
return createHash$1("sha1").update(text).digest("hex");
|
|
75
|
+
}
|
|
76
|
+
function relocatePath(text, from, to) {
|
|
77
|
+
return text.replace(pathPattern(from, "g"), () => to);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Decides whether a carried Pods directory differs from the checkout's Podfile.lock only by
|
|
81
|
+
* checksums of podspecs that embed the source checkout's absolute path. Any other difference,
|
|
82
|
+
* a missing podspec, a podspec that does not embed the path, or a carried checksum that does
|
|
83
|
+
* not match the carried podspec refuses.
|
|
84
|
+
*/
|
|
85
|
+
function planPodsRelocation({ podfileLock, manifest, sourceRoot, readPodspec }) {
|
|
86
|
+
const lock = splitChecksums(normalize$1(podfileLock));
|
|
87
|
+
const carried = splitChecksums(normalize$1(manifest));
|
|
88
|
+
if (!lock || !carried) return { ok: false };
|
|
89
|
+
if (lock.before !== carried.before || lock.after !== carried.after) return { ok: false };
|
|
90
|
+
if (lock.entries.size !== carried.entries.size) return { ok: false };
|
|
91
|
+
const pods = [];
|
|
92
|
+
for (const [pod, checksum] of lock.entries) {
|
|
93
|
+
const carriedChecksum = carried.entries.get(pod);
|
|
94
|
+
if (carriedChecksum === void 0) return { ok: false };
|
|
95
|
+
if (carriedChecksum === checksum) continue;
|
|
96
|
+
if (!/^[\w.+-]+$/.test(pod)) return { ok: false };
|
|
97
|
+
const podspec = readPodspec(pod);
|
|
98
|
+
if (podspec === null || sha1(podspec) !== carriedChecksum) return { ok: false };
|
|
99
|
+
if (!pathPattern(sourceRoot).test(podspec)) return { ok: false };
|
|
100
|
+
pods.push(pod);
|
|
101
|
+
}
|
|
102
|
+
return pods.length > 0 ? {
|
|
103
|
+
ok: true,
|
|
104
|
+
pods
|
|
105
|
+
} : { ok: false };
|
|
106
|
+
}
|
|
107
|
+
function walkTextFiles(dir, visit) {
|
|
108
|
+
for (const entry of readdirSync$1(dir, { withFileTypes: true })) {
|
|
109
|
+
const path = join$1(dir, entry.name);
|
|
110
|
+
if (entry.isDirectory()) walkTextFiles(path, visit);
|
|
111
|
+
else if (entry.isFile()) visit(path);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function sourceNamer(sourceRoot, targetRoot, encoding) {
|
|
115
|
+
const encode = (value) => Buffer.from(value, "utf-8").toString(encoding);
|
|
116
|
+
const pattern = pathPattern(encode(sourceRoot));
|
|
117
|
+
const nested = targetRoot.startsWith(`${sourceRoot}/`) ? pathPattern(encode(targetRoot), "g") : null;
|
|
118
|
+
return (text) => pattern.test(nested ? text.replace(nested, "") : text);
|
|
119
|
+
}
|
|
120
|
+
function findPath(dir, text, bytes) {
|
|
121
|
+
for (const entry of readdirSync$1(dir, { withFileTypes: true })) {
|
|
122
|
+
const path = join$1(dir, entry.name);
|
|
123
|
+
if (entry.isSymbolicLink() && text(readlinkSync$1(path))) return path;
|
|
124
|
+
if (entry.isDirectory()) {
|
|
125
|
+
const found = findPath(path, text, bytes);
|
|
126
|
+
if (found) return found;
|
|
127
|
+
} else if (entry.isFile() && bytes(readFileSync$1(path).toString("latin1"))) return path;
|
|
128
|
+
}
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
function walkSymlinks(dir, visit) {
|
|
132
|
+
for (const entry of readdirSync$1(dir, { withFileTypes: true })) {
|
|
133
|
+
const path = join$1(dir, entry.name);
|
|
134
|
+
if (entry.isSymbolicLink()) visit(path);
|
|
135
|
+
else if (entry.isDirectory()) walkSymlinks(path, visit);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Makes a Pods directory cloned from `sourceRoot` read as one CocoaPods generated for
|
|
140
|
+
* `targetRoot`: it rewrites the source path in the generated text files and absolute symlinks,
|
|
141
|
+
* then points Pods/Manifest.lock at the checkout's Podfile.lock. When the locks already match,
|
|
142
|
+
* `pod install` would be skipped over Pods that still name the source path, so the same rewrite
|
|
143
|
+
* runs for them. Manifest.lock is removed before any rewrite and written back last, only after
|
|
144
|
+
* no file or symlink in Pods names the source path, so a refused, failed or interrupted run
|
|
145
|
+
* leaves it differing or absent and `pod install` still runs. `canRelocate: false` only
|
|
146
|
+
* withholds a matching Manifest.lock from Pods that name the source path.
|
|
147
|
+
*/
|
|
148
|
+
function relocatePods({ podsDir, podfileLockPath, sourceRoot, targetRoot, canRelocate = true }) {
|
|
149
|
+
const manifestPath = join$1(podsDir, "Manifest.lock");
|
|
150
|
+
if (!existsSync$1(manifestPath) || !existsSync$1(podfileLockPath)) return { ok: false };
|
|
151
|
+
const podfileLock = readFileSync$1(podfileLockPath, "utf-8");
|
|
152
|
+
const manifest = readFileSync$1(manifestPath, "utf-8");
|
|
153
|
+
const pattern = pathPattern(sourceRoot);
|
|
154
|
+
const textNamesSource = sourceNamer(sourceRoot, targetRoot, "utf-8");
|
|
155
|
+
const bytesNameSource = sourceNamer(sourceRoot, targetRoot, "latin1");
|
|
156
|
+
let pods = [];
|
|
157
|
+
if (normalize$1(podfileLock) === normalize$1(manifest)) {
|
|
158
|
+
let names;
|
|
159
|
+
try {
|
|
160
|
+
names = findPath(podsDir, textNamesSource, bytesNameSource);
|
|
161
|
+
} catch (error) {
|
|
162
|
+
unlinkSync$1(manifestPath);
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
if (!names) return { ok: false };
|
|
166
|
+
unlinkSync$1(manifestPath);
|
|
167
|
+
if (!canRelocate) return {
|
|
168
|
+
ok: false,
|
|
169
|
+
withheld: true
|
|
170
|
+
};
|
|
171
|
+
} else {
|
|
172
|
+
if (!canRelocate) return { ok: false };
|
|
173
|
+
const plan = planPodsRelocation({
|
|
174
|
+
podfileLock,
|
|
175
|
+
manifest,
|
|
176
|
+
sourceRoot,
|
|
177
|
+
readPodspec: (pod) => {
|
|
178
|
+
try {
|
|
179
|
+
return readFileSync$1(join$1(podsDir, "Local Podspecs", `${pod}.podspec.json`), "utf-8");
|
|
180
|
+
} catch {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
if (!plan.ok) return plan;
|
|
186
|
+
pods = plan.pods;
|
|
187
|
+
}
|
|
188
|
+
for (const name of GENERATED_DIRS) {
|
|
189
|
+
const dir = join$1(podsDir, name);
|
|
190
|
+
if (!existsSync$1(dir)) continue;
|
|
191
|
+
walkTextFiles(dir, (file) => {
|
|
192
|
+
const buffer = readFileSync$1(file);
|
|
193
|
+
if (buffer.includes(0)) return;
|
|
194
|
+
const text = buffer.toString("utf-8");
|
|
195
|
+
if (!pattern.test(text)) return;
|
|
196
|
+
writeFileSync$1(file, relocatePath(text, sourceRoot, targetRoot));
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
walkSymlinks(podsDir, (link) => {
|
|
200
|
+
const target = readlinkSync$1(link);
|
|
201
|
+
if (!pattern.test(target)) return;
|
|
202
|
+
const next = `${link}.stim-relocate`;
|
|
203
|
+
symlinkSync$1(relocatePath(target, sourceRoot, targetRoot), next);
|
|
204
|
+
try {
|
|
205
|
+
renameSync$1(next, link);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
unlinkSync$1(next);
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
const leftover = findPath(podsDir, textNamesSource, bytesNameSource);
|
|
212
|
+
if (leftover) throw new Error(`${leftover} still names ${sourceRoot}`);
|
|
213
|
+
writeFileSync$1(manifestPath, podfileLock);
|
|
214
|
+
return {
|
|
215
|
+
ok: true,
|
|
216
|
+
pods
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
42
220
|
//#region src/archive.ts
|
|
43
221
|
const DAY = 864e5;
|
|
44
222
|
const KINDS = [
|
|
@@ -1724,6 +1902,26 @@ function dependencyInstallCommand(target, dir = ".") {
|
|
|
1724
1902
|
else if (existsSync$1(resolve$1(installRoot, "package-lock.json"))) command = "npm ci";
|
|
1725
1903
|
return `cd '${installRoot.replaceAll("'", "'\\''")}' && ${command}`;
|
|
1726
1904
|
}
|
|
1905
|
+
function relocateCarriedPods(root, target, copied) {
|
|
1906
|
+
const canRelocate = depsOutOfSync(root, target, copied).length === 0;
|
|
1907
|
+
for (const rel of copied) {
|
|
1908
|
+
if (rel !== "Pods" && !rel.endsWith("/Pods")) continue;
|
|
1909
|
+
const iosDir = rel === "Pods" ? "" : rel.slice(0, -5);
|
|
1910
|
+
try {
|
|
1911
|
+
const result = relocatePods({
|
|
1912
|
+
podsDir: join$1(target, rel),
|
|
1913
|
+
podfileLockPath: join$1(target, iosDir, "Podfile.lock"),
|
|
1914
|
+
sourceRoot: root,
|
|
1915
|
+
targetRoot: target,
|
|
1916
|
+
canRelocate
|
|
1917
|
+
});
|
|
1918
|
+
if (result.ok) console.error(chalk.dim(phaseLine("carry", result.pods.length > 0 ? `moved ${rel} to this checkout's path; ${result.pods.join(", ")} checksum depends on the checkout path, so pod install is not needed` : `moved ${rel} to this checkout's path; the locks match, so pod install is not needed`)));
|
|
1919
|
+
else if (result.withheld) console.error(chalk.yellow(phaseLine("carry", `${rel} names the source checkout's path; removed ${rel}/Manifest.lock so pod install runs`)));
|
|
1920
|
+
} catch (error) {
|
|
1921
|
+
console.error(chalk.yellow(phaseLine("carry", `could not move ${rel} to this checkout's path: ${error.message}. pod install will run`)));
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1727
1925
|
function reportCarriedStateHealth(root, target, copied) {
|
|
1728
1926
|
const outOfSync = depsOutOfSync(root, target, copied);
|
|
1729
1927
|
for (const d of outOfSync.filter((dependency) => dependency.reason === "installed")) {
|
|
@@ -1834,6 +2032,7 @@ function registerWarm(worktree) {
|
|
|
1834
2032
|
for (const entry of result.failed) console.error(chalk.yellow(phaseLine("carry", `could not copy ${entry.file}: ${entry.error}`)));
|
|
1835
2033
|
if (result.copied.length) {
|
|
1836
2034
|
console.error(chalk.dim(phaseLine("carry", `copied ${carriedFileList(result.copied)} from ${root}`)));
|
|
2035
|
+
relocateCarriedPods(root, target, result.copied);
|
|
1837
2036
|
reportCarriedStateHealth(root, target, result.copied);
|
|
1838
2037
|
}
|
|
1839
2038
|
console.error(phaseLine("carry", `${result.failed.length ? "incomplete" : "complete"}: ${result.copied.length} ignored entries copied, ${result.skipped.length} kept, ${result.failed.length} failed`));
|