stim 1.25.0 → 1.27.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 +1 -1
- package/dist/{acquire-artifact-zA4S7RHE.mjs → acquire-artifact-BKN2Yuhg.mjs} +2 -2
- package/dist/{act-BbHS3oV8.mjs → act-ROviTF_t.mjs} +415 -118
- package/dist/{activity-BpjwrQXU.mjs → activity-Cd-ysFes.mjs} +6 -7
- package/dist/{agent-device-usage-output-Bnkerfod.mjs → agent-device-usage-output-C5nCKWp9.mjs} +5 -5
- package/dist/{android-CNZgRC-4.mjs → android--HBgpvpW.mjs} +5 -5
- package/dist/{android-BGwuK3Mc.mjs → android-Cd6w7_qw.mjs} +134 -57
- package/dist/{android-saBeB4lr.mjs → android-Deb9X3_Y.mjs} +37 -15
- package/dist/{android-Cjcj8MCw.mjs → android-DriNoAVy.mjs} +99 -47
- package/dist/{android-cas-BVqh2Zep.mjs → android-cas-D5e6ecUg.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/{android-project-CTYaETc0.d.mts → android-project-DUGMbq28.d.mts} +55 -1
- package/dist/api.d.mts +20 -7
- package/dist/api.mjs +42 -32
- package/dist/apk-signed-tail-BHQHx3Rm.mjs +142 -0
- package/dist/{artifact-Co8zixVx.mjs → artifact-0AGJYB9O.mjs} +28 -28
- package/dist/{artifact-DN8JNwqS.mjs → artifact-faemIZv5.mjs} +40 -30
- package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
- package/dist/{attempt-DW-mQqM7.mjs → attempt-ClyJlZPT.mjs} +4 -2
- package/dist/auto-placement-z-H5pJza.mjs +350 -0
- package/dist/{browser-web-CCgZsHmI.mjs → browser-web-slD8AvLp.mjs} +16 -17
- package/dist/{build-cache-CKCzxzxA.mjs → build-cache-gBJ-WKzA.mjs} +141 -37
- package/dist/{build-CAiw8Ezm.mjs → build-hS0QyFlQ.mjs} +38 -31
- package/dist/{build-plan-zCuHGlA8.mjs → build-plan-CBqYbzYM.mjs} +7 -6
- package/dist/{cache-manifest-BPXRONJz.mjs → cache-manifest-DEjqGGat.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{budget-HyShrIpL.mjs → ccache-BWTze1Ls.mjs} +634 -1514
- package/dist/{cdp-BG3FJCCx.mjs → cdp-C3svvXiE.mjs} +1 -1
- package/dist/{chrome-BvV8ssI3.mjs → chrome-DyDWurWG.mjs} +1 -1
- package/dist/{cli-C4w607Pz.mjs → cli-ftXDLto1.mjs} +24 -23
- package/dist/cli.mjs +1 -1
- package/dist/{client-BQsmyp_-.mjs → client-xsdxrhWA.mjs} +77 -116
- package/dist/collector-run.d.mts +10 -9
- package/dist/collector-run.mjs +42 -27
- package/dist/{command-output-BBvS1H6v.mjs → command-output-Dj-WT4BP.mjs} +1 -1
- package/dist/{config-BZhXY15H.mjs → config-Cn94Jc0g.mjs} +343 -18
- package/dist/{launch-DscF1QfM.mjs → dependencies-BGokZ-Ng.mjs} +330 -279
- package/dist/{dependency-state-BwNCYG5Q.mjs → dependency-state-C3OtgG94.mjs} +14 -7
- package/dist/{detached-entry-KmieOKgN.mjs → detached-entry-BPlSaCwC.mjs} +1 -1
- package/dist/{dev-client-CHoXXZeg.mjs → dev-client-BMca82xo.mjs} +2 -2
- package/dist/{device-F5-4z9ef.mjs → device-BJm0irrq.mjs} +16 -16
- package/dist/{device-capacity-ZYaRALv5.mjs → device-capacity-6LP7QsaA.mjs} +103 -25
- package/dist/device-host-worker.mjs +19 -21
- package/dist/{device-ios-DkHBrmvH.mjs → device-ios-534c14fz.mjs} +288 -28
- package/dist/{device-lease-run-ogEeJ62K.mjs → device-lease-run-DwsGfjUN.mjs} +5 -5
- package/dist/{device-pool-BIg8MU8l.mjs → device-pool-BnQqvs6o.mjs} +3 -3
- package/dist/{device-B9FqTBYW.mjs → device-tM41-TUq.mjs} +25 -24
- package/dist/{doctor-A_Nr_fDe.mjs → doctor-Dbx1ZpD2.mjs} +1 -1
- package/dist/{doctor-k3P3PizH.mjs → doctor-DyqE9n1J.mjs} +28 -16
- package/dist/{doctor-Bm8TVpGn.mjs → doctor-F-3VUUyN.mjs} +128 -35
- package/dist/{doctor-fingerprint-zlujA1Gs.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +9 -3
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-BovI1y3-.mjs → doctor-watchman-CxDbyrrt.mjs} +5 -5
- package/dist/{eas-build-CyDKNTBP.mjs → eas-build-CjNSWmjo.mjs} +4 -4
- package/dist/eas-fallback-9fqb46kW.mjs +87 -0
- package/dist/{eas-session-ledger-BMCA1gdO.mjs → eas-session-ledger-DrP4OuuM.mjs} +6 -6
- package/dist/{error-diagnostics-B1Mj_-7h.mjs → error-diagnostics-snej9k4j.mjs} +51 -25
- package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
- package/dist/{gc-eaz403W6.mjs → gc-BRwAY3qT.mjs} +2 -2
- package/dist/{gc-B9jcnmIk.mjs → gc-CGZ1Yg88.mjs} +218 -72
- package/dist/{guide-DR0K0xW9.mjs → guide-_rfEh_zM.mjs} +839 -222
- package/dist/{hosted-android-Bvb2-ZxD.mjs → hosted-android-BMKzUNnY.mjs} +4 -4
- package/dist/{hosted-client-rsRqysJc.mjs → hosted-client-D7Pk_Oo1.mjs} +13 -9
- package/dist/{hosted-logs-CWKGYWNX.mjs → hosted-logs-B1gqQuva.mjs} +18 -12
- package/dist/hosted-logs-sync-Dg3qrZmV.mjs +195 -0
- package/dist/{hosted-macos-d0pv9Tth.mjs → hosted-macos-B9w4H8hc.mjs} +6 -6
- package/dist/{hosted-native-BxTizGU2.mjs → hosted-native-CdgaiuyP.mjs} +17 -17
- package/dist/{idle-shutdown-BIyfl0Zj.mjs → idle-shutdown-Cbvo5KEh.mjs} +21 -9
- package/dist/{ios-BRVM8b0P.mjs → ios-B5HlVMhQ.mjs} +138 -55
- package/dist/{ios-Dvt97HgQ.mjs → ios-Bk4mWbtS.mjs} +8 -8
- package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
- package/dist/{ios-BQzvJlzw.mjs → ios-E26qSpkb.mjs} +94 -11
- package/dist/{ios-device-CKSvk0bu.mjs → ios-device-C_QkIf1Z.mjs} +3 -3
- package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
- package/dist/{ios-project-DCUDo06I.mjs → ios-project-D8Jcy_br.mjs} +22 -9
- package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
- package/dist/{ios-state-CT9nV5SP.mjs → ios-state-BZ03NFgF.mjs} +1 -1
- package/dist/{js-swap-Z9HbC4cj.mjs → js-swap-Dg2a945i.mjs} +8 -7
- package/dist/{launch-D0lPvFFu.mjs → launch-CRyBeNsA.mjs} +53 -44
- package/dist/lightened-BCsdAGj_.mjs +171 -0
- package/dist/{logs-BsIRre8x.mjs → logs-CC_-ZzEE.mjs} +10 -174
- package/dist/{logs-Crs9y34Z.mjs → logs-aJQb-RDg.mjs} +112 -38
- package/dist/{macos-CcUlJPMu.mjs → macos-BGmTpnv9.mjs} +1 -1
- package/dist/{macos-D477nfzH.mjs → macos-DlCBhMw5.mjs} +73 -39
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +30 -13
- package/dist/{metro-1pJgCX4U.mjs → metro-CvyD-xwe.mjs} +4 -4
- package/dist/{metro-gateway-Bp9gJQAN.mjs → metro-gateway-BnHdqMO_.mjs} +3 -4
- package/dist/{named-ports-BVbn8SvC.mjs → named-ports-BCyMWA6b.mjs} +3 -3
- package/dist/{native-android-BvMizJn1.mjs → native-android-DlpxCyOP.mjs} +17 -18
- package/dist/{native-gradle-artifact-inputs-BJscK4vN.mjs → native-gradle-artifact-inputs-C13qT7R_.mjs} +5 -5
- package/dist/{native-runtime-B9w_Qyz3.mjs → native-runtime-DqaIBO5w.mjs} +9 -9
- package/dist/{native-source-D-4Dh4JU.mjs → native-source-D1AzWiuP.mjs} +1 -1
- package/dist/{native-xcode-inputs-Cv4l-obn.mjs → native-xcode-inputs-B1W8SrxB.mjs} +3 -3
- package/dist/{native-xcode-ios-DGrg90hE.mjs → native-xcode-ios-QPP0Rm68.mjs} +17 -18
- package/dist/{ndjson-CgE_o3Dl.mjs → ndjson-Dy2W4vRa.mjs} +2 -2
- package/dist/offload-worker.d.mts +3 -1
- package/dist/offload-worker.mjs +34 -25
- package/dist/{operation-exec-CUZifp6Z.mjs → operation-exec-Dp4FuIGR.mjs} +1 -1
- package/dist/{ownership-jxxz-19m.mjs → ownership-Bx-0cku-.mjs} +3 -3
- package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
- package/dist/{phone-reverses-CYb7RRAx.mjs → phone-reverses-C9yAaKEv.mjs} +18 -4
- package/dist/{placement-log-DjOXJRIH.mjs → placement-log-BXUbiZM6.mjs} +3 -3
- package/dist/{plan-placement-BqKgKHCi.mjs → plan-placement-UxnQjv5Z.mjs} +36 -10
- package/dist/{ports-DtS1Amb0.mjs → ports-uUrghqWN.mjs} +3 -3
- package/dist/prebuild-BDpToDgR.mjs +1246 -0
- package/dist/{project-BiC68mIp.mjs → project-DYj-HVx6.mjs} +17 -18
- package/dist/{pull-request-CbNlkFok.mjs → pull-request-BzLmzAIQ.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-DRYqoJc4.mjs → react-native-android-DDBccgJw.mjs} +56 -36
- package/dist/{react-native-build-CwZB-agu.mjs → react-native-build-DaK2IFyP.mjs} +9 -9
- package/dist/{react-native-doctor-BCrytK7h.mjs → react-native-doctor-B-Mw6DcR.mjs} +50 -9
- package/dist/{react-native-ios-Cr1buNFo.mjs → react-native-ios-DjYwUF9U.mjs} +45 -25
- package/dist/{recordings-BaoQ0t-J.mjs → recordings-C20iUZfp.mjs} +1 -1
- package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
- package/dist/{reload-Beftw2X3.mjs → reload-DJBeF_rC.mjs} +1 -1
- package/dist/{reload-FbSgMF8x.mjs → reload-fUdkH2_p.mjs} +16 -16
- package/dist/{remote-BuZj6AyU.mjs → remote-y6n99WMW.mjs} +22 -9
- package/dist/{result-CR2vk2cj.mjs → result-CTqBw2Te.mjs} +32 -21
- package/dist/{run-BtzE09Dl.mjs → run-DaCeNKRm.mjs} +3 -3
- package/dist/{selection-D5cxEl3t.mjs → selection-Bs8phwhN.mjs} +183 -62
- package/dist/{server-bare-CH9X0RLn.mjs → server-bare-BOh-iZEj.mjs} +2 -2
- package/dist/{server-command-CaBbDNU2.mjs → server-command-8CuA51Cv.mjs} +6 -6
- package/dist/{server-expo-Ck8EIidM.mjs → server-expo-ABQs2XFA.mjs} +4 -4
- package/dist/server-expo-Ba_Y21vB.mjs +2 -0
- package/dist/{settings-B5tCoq9N.mjs → settings-BDVI8Ivc.mjs} +331 -62
- package/dist/{settings-DzH9mGQZ.mjs → settings-CMHhQNwI.mjs} +24 -3
- package/dist/settings-payload-cm60Zhib.mjs +257 -0
- package/dist/settings-write-BdNRLlBn.mjs +185 -0
- package/dist/settings.schema.json +84 -39
- package/dist/{simslim-BjxszUAb.mjs → simslim-DCQwzoPy.mjs} +4 -3
- package/dist/{slot-launch-QeuJMlnJ.mjs → slot-launch-0l7RqSpr.mjs} +6 -6
- package/dist/{stage-D8xlRU2D.mjs → stage-F4cAfJGi.mjs} +2 -2
- package/dist/{start-C1JLjkNw.mjs → start-DcqnF9p8.mjs} +1 -1
- package/dist/{start-YMpNwLhh.mjs → start-DrPwER_2.mjs} +27 -23
- package/dist/{state-DMRNP7-4.mjs → state-BX1y5syV.mjs} +4 -5
- package/dist/{state-DPaM3u5K.mjs → state-CZxLyetD.mjs} +2 -3
- package/dist/{stats-CP7STzZw.mjs → stats-GxuCbles.mjs} +5 -5
- package/dist/{stats-report-n2U5plhk.mjs → stats-report-B86Cv7Uc.mjs} +1 -1
- package/dist/{status-Fect2w9R.mjs → status-7ULDEJ1e.mjs} +1 -1
- package/dist/{status-CRLiJ-O_.mjs → status-BfnK9pUd.mjs} +25 -26
- package/dist/{status-cNw6i0_t.mjs → status-Bj7ZYvvc.mjs} +1 -1
- package/dist/{status-watch-Bc2J4TZn.mjs → status-watch-BfabQn03.mjs} +5 -5
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-DS0mzR8U.mjs → stim-desktop-CbWo21kb.mjs} +2 -2
- package/dist/{stop-COP6PQqw.mjs → stop-CH79S3IZ.mjs} +5 -6
- package/dist/{stop-Db9Kh-UA.mjs → stop-D-EAr25B.mjs} +25 -22
- package/dist/{stop-Br7LKxBE.mjs → stop-x1Yu3He4.mjs} +2 -2
- package/dist/supervisor-run.d.mts +1 -0
- package/dist/supervisor-run.mjs +17 -18
- package/dist/{support-qKcbgmI5.mjs → support-Be0UeVZU.mjs} +10 -10
- package/dist/{support-Cxj9CmII.mjs → support-CNg_YsOk.mjs} +6 -6
- package/dist/{swiftpm-artifact-inputs-iY9fsmOc.mjs → swiftpm-artifact-inputs-uPqYvGBv.mjs} +4 -4
- package/dist/{swiftpm-macos-Bp_sn9P4.mjs → swiftpm-macos-Ch4YjY_A.mjs} +11 -12
- package/dist/toolchain-CbCG6C5Z.mjs +2413 -0
- package/dist/toolchain-JYAOquPg.mjs +2 -0
- package/dist/{trigger-CBMe2YLH.mjs → trigger-DMou-X7j.mjs} +3 -3
- package/dist/trigger-qp2ji5wE.mjs +2 -0
- package/dist/{warm-progress-BV3ZPmcY.mjs → warm-progress-C0RsbngN.mjs} +731 -728
- package/dist/{web-B4Yjyt1G.mjs → web-Cq_AQ4DK.mjs} +9 -10
- package/dist/web-Je6abcpz.mjs +2 -0
- package/dist/web-run.mjs +9 -9
- package/dist/windows-report.mjs +1 -1
- package/dist/{workspace-state-CPSp3mav.mjs → workspace-state-BjqdjnJR.mjs} +46 -8
- package/dist/{workspaces-C9w4aeXF.mjs → workspaces-DFbj07jp.mjs} +1801 -76
- package/dist/{worktree-CclFIe1Z.mjs → worktree-COAJ3-OD.mjs} +934 -511
- package/dist/{worktree-Ct9Gk3KL.mjs → worktree-JGUd_53L.mjs} +1 -1
- package/package.json +8 -8
- package/dist/ccache-h1FKhZeg.mjs +0 -143
- package/dist/created-devices-D2Aca-xu.mjs +0 -52
- package/dist/eas-fallback-gaZi-dJL.mjs +0 -381
- package/dist/hosted-ios-RtVcJH3u.mjs +0 -15
- package/dist/native-run-D5OJsGwA.mjs +0 -276
- package/dist/paths-DQtTgsBf.mjs +0 -42
- package/dist/prebuild-JUaqOLpc.mjs +0 -501
- package/dist/server-expo-C16Zf2k7.mjs +0 -2
- package/dist/settings-write-n0zwfohx.mjs +0 -360
- package/dist/toolchain-DB1aeqxO.mjs +0 -2
- package/dist/toolchain-VzLJzZ7O.mjs +0 -908
- package/dist/trigger-BLsHgAGR.mjs +0 -2
- package/dist/web-DS4UDWvf.mjs +0 -2
- package/dist/xcode-CiIIDnuD.mjs +0 -910
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
2
|
-
import { n as METRO_COMMAND_PORT } from "./settings-
|
|
3
|
-
import { T as MODE_COMMAND } from "./project-
|
|
4
|
-
import { f as signalProcessTree } from "./metro-
|
|
5
|
-
import {
|
|
6
|
-
import { g as projectNodeLine, p as recordFromLine, v as withProjectNode, y as superviseChildServer } from "./server-expo-
|
|
1
|
+
import { t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { n as METRO_COMMAND_PORT } from "./settings-BDVI8Ivc.mjs";
|
|
3
|
+
import { T as MODE_COMMAND } from "./project-DYj-HVx6.mjs";
|
|
4
|
+
import { f as signalProcessTree } from "./metro-CvyD-xwe.mjs";
|
|
5
|
+
import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
|
|
6
|
+
import { g as projectNodeLine, p as recordFromLine, v as withProjectNode, y as superviseChildServer } from "./server-expo-ABQs2XFA.mjs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { LOG_ROTATE_BYTES } from "@stim-cli/core";
|
|
9
9
|
//#region src/supervisor/server-command.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { o as cancellableSleep, t as getExecutor } from "./exec-
|
|
1
|
+
import { o as cancellableSleep, t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
2
|
import { n as stripAnsi, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { C as resolvePackageJson } from "./project-
|
|
5
|
-
import {
|
|
3
|
+
import { X as resolveProjectSettings } from "./settings-BDVI8Ivc.mjs";
|
|
4
|
+
import { C as resolvePackageJson } from "./project-DYj-HVx6.mjs";
|
|
5
|
+
import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
|
|
6
6
|
import { a as expoMetroStoreEnv, c as registerMetroStore, f as resolveMetroSharedCache, i as expoMetroConfigPath, n as supervisorError, o as metroStoreConfirmedRoot, s as metroStoreRoot } from "./errors-DHm_U5gv.mjs";
|
|
7
7
|
import { accessSync, constants, existsSync, readFileSync } from "node:fs";
|
|
8
8
|
import { delimiter, dirname, join } from "node:path";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { c as throwIfCancelled, l as WorkspaceProcessCleanupError, n as isTimeoutError, t as getExecutor } from "./exec-
|
|
2
|
-
import { _ as loadConfig$1, d as getConfigDir, f as getConfigPath$1, h as getRepoSettings, m as getProjectSettings } from "./config-
|
|
3
|
-
import { c as gitQuiet, l as gitQuietAsync, n as runOperationFileQuiet, o as git, r as childEnvironment, s as gitAsync, t as runOperationFile } from "./operation-exec-
|
|
4
|
-
import { accessSync, chmodSync, constants, lstatSync, mkdirSync, mkdtempSync, readdirSync, realpathSync, rmSync, statSync } from "node:fs";
|
|
1
|
+
import { D as ownership_claim_exports, c as throwIfCancelled, l as WorkspaceProcessCleanupError, n as isTimeoutError, t as getExecutor } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { _ as loadConfig$1, d as getConfigDir, f as getConfigPath$1, h as getRepoSettings, m as getProjectSettings } from "./config-Cn94Jc0g.mjs";
|
|
3
|
+
import { c as gitQuiet, l as gitQuietAsync, n as runOperationFileQuiet, o as git, r as childEnvironment, s as gitAsync, t as runOperationFile } from "./operation-exec-Dp4FuIGR.mjs";
|
|
4
|
+
import { accessSync, chmodSync, constants, existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, realpathSync, rmSync, statSync } from "node:fs";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
7
7
|
import { ambientEnv, buildCacheRoot, compiledHelper, configDir } from "@stim-cli/core";
|
|
8
|
-
import { REMOTE_DEVICE_BACKENDS, SETTINGS, SETTING_GROUPS, TUNNEL_MODES, WEB_VIEWPORTS, acceptsShape, coerceSettingText, expectedShape, isLayeredSetting, settingDefinition, settingValueError } from "@stim-cli/core/state";
|
|
8
|
+
import { REMOTE_DEVICE_BACKENDS, REPLACED_SETTINGS, SETTINGS, SETTING_GROUPS, TUNNEL_MODES, WEB_VIEWPORTS, acceptsShape, coerceSettingText, expectedShape, isLayeredSetting, placementWord, replacementAdvice, settingDefinition, settingValueError, trashRoot } from "@stim-cli/core/state";
|
|
9
9
|
import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, normalize, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { captureProcessIdentity } from "@stim-cli/core/process-identity";
|
|
11
12
|
import { existsSync as existsSync$1, lstatSync as lstatSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, statSync as statSync$1 } from "fs";
|
|
12
|
-
import { chmod, lstat, mkdir, readdir, realpath, rm, utimes } from "node:fs/promises";
|
|
13
|
+
import { chmod, lstat, mkdir, mkdtemp, readdir, realpath, rename, rm, rmdir, utimes, writeFile } from "node:fs/promises";
|
|
13
14
|
//#region src/temporary.ts
|
|
14
15
|
function existingPath(path) {
|
|
15
16
|
const missing = [];
|
|
@@ -108,6 +109,248 @@ async function removeTemporaryEntryAsync(path, signal) {
|
|
|
108
109
|
signal?.throwIfAborted();
|
|
109
110
|
}
|
|
110
111
|
//#endregion
|
|
112
|
+
//#region src/workspace/worktree-trash.ts
|
|
113
|
+
const TRASH_MANIFEST = "trash.json";
|
|
114
|
+
const TRASH_ENTRY_PREFIX = "remove-";
|
|
115
|
+
const TRASH_ENTRIES = "entries";
|
|
116
|
+
const TRASH_CLAIMS = "claims";
|
|
117
|
+
const LIST_TIMEOUT_MS = 3e4;
|
|
118
|
+
const DELETE_NICENESS = "10";
|
|
119
|
+
function rethrowCancellation(error, signal) {
|
|
120
|
+
if (error instanceof WorkspaceProcessCleanupError || error instanceof Error && "reportCleanup" in error) throw error;
|
|
121
|
+
signal?.throwIfAborted();
|
|
122
|
+
}
|
|
123
|
+
async function isPlainDirectory(path) {
|
|
124
|
+
const stat = await lstat(path).catch(() => null);
|
|
125
|
+
return Boolean(stat?.isDirectory());
|
|
126
|
+
}
|
|
127
|
+
async function ignoredDirectories(worktree, options) {
|
|
128
|
+
const out = await gitAsync(worktree, [
|
|
129
|
+
"ls-files",
|
|
130
|
+
"--others",
|
|
131
|
+
"--ignored",
|
|
132
|
+
"--exclude-standard",
|
|
133
|
+
"--directory",
|
|
134
|
+
"--no-empty-directory",
|
|
135
|
+
"-z"
|
|
136
|
+
], {
|
|
137
|
+
...options.env ? childEnvironment(options.env) : {},
|
|
138
|
+
signal: options.signal,
|
|
139
|
+
declareFor: options.declareFor,
|
|
140
|
+
timeoutMs: LIST_TIMEOUT_MS,
|
|
141
|
+
untrimmed: true
|
|
142
|
+
});
|
|
143
|
+
const found = [];
|
|
144
|
+
for (const entry of out.split("\0")) {
|
|
145
|
+
if (!entry.endsWith("/")) continue;
|
|
146
|
+
const rel = entry.slice(0, -1);
|
|
147
|
+
const parts = rel.split("/");
|
|
148
|
+
let plain = true;
|
|
149
|
+
for (let depth = 1; depth <= parts.length && plain; depth++) plain = await isPlainDirectory(join(worktree, ...parts.slice(0, depth)));
|
|
150
|
+
if (plain) found.push(rel);
|
|
151
|
+
}
|
|
152
|
+
return found;
|
|
153
|
+
}
|
|
154
|
+
async function openTrash(worktree, options, kind) {
|
|
155
|
+
if ((options.platform ?? process.platform) === "win32") return null;
|
|
156
|
+
const root = trashRoot();
|
|
157
|
+
let dir = null;
|
|
158
|
+
let claim = null;
|
|
159
|
+
try {
|
|
160
|
+
await mkdir(root, { recursive: true });
|
|
161
|
+
if (filesystemDevice(root) !== filesystemDevice(worktree)) return null;
|
|
162
|
+
dir = await mkdtemp(join(root, TRASH_ENTRY_PREFIX));
|
|
163
|
+
claim = (0, ownership_claim_exports.tryAcquireClaim)({
|
|
164
|
+
root: join(dir, "claims"),
|
|
165
|
+
mode: "exclusive",
|
|
166
|
+
label: "worktree trash"
|
|
167
|
+
}).acquired ?? null;
|
|
168
|
+
if (!claim) throw new Error("the trash entry claim was not acquired");
|
|
169
|
+
const manifest = {
|
|
170
|
+
worktree,
|
|
171
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
172
|
+
...kind ? { kind } : {}
|
|
173
|
+
};
|
|
174
|
+
await writeFile(join(dir, TRASH_MANIFEST), `${JSON.stringify(manifest)}\n`);
|
|
175
|
+
await mkdir(join(dir, TRASH_ENTRIES));
|
|
176
|
+
} catch (error) {
|
|
177
|
+
if (claim) (0, ownership_claim_exports.releaseClaim)(claim);
|
|
178
|
+
if (dir) await rm(dir, {
|
|
179
|
+
recursive: true,
|
|
180
|
+
force: true
|
|
181
|
+
}).catch(() => {});
|
|
182
|
+
rethrowCancellation(error, options.signal);
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
dir,
|
|
187
|
+
worktree,
|
|
188
|
+
moved: [],
|
|
189
|
+
claim
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Moves the worktree's ignored directories, which `git worktree remove` would delete, into a new entry under
|
|
194
|
+
* `$STIM_HOME/trash` held by an exclusive ownership claim. Null, with nothing moved, when the trash is on another
|
|
195
|
+
* filesystem, the platform is Windows, git cannot list the entries, or the claim cannot be taken. A directory that
|
|
196
|
+
* does not rename stays in the worktree for git to delete.
|
|
197
|
+
*/
|
|
198
|
+
async function moveIgnoredTreesToTrash(worktree, options = {}) {
|
|
199
|
+
if ((options.platform ?? process.platform) === "win32") return null;
|
|
200
|
+
let listed;
|
|
201
|
+
try {
|
|
202
|
+
listed = await ignoredDirectories(worktree, options);
|
|
203
|
+
} catch (error) {
|
|
204
|
+
rethrowCancellation(error, options.signal);
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
if (!listed.length) return null;
|
|
208
|
+
const trash = await openTrash(worktree, options);
|
|
209
|
+
if (!trash) return null;
|
|
210
|
+
for (const from of listed) {
|
|
211
|
+
const to = String(trash.moved.length);
|
|
212
|
+
try {
|
|
213
|
+
await rename(join(worktree, from), join(trash.dir, TRASH_ENTRIES, to));
|
|
214
|
+
trash.moved.push({
|
|
215
|
+
from,
|
|
216
|
+
to
|
|
217
|
+
});
|
|
218
|
+
} catch {}
|
|
219
|
+
}
|
|
220
|
+
if (trash.moved.length) return trash;
|
|
221
|
+
await discardTrash(trash);
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* A trash entry that takes directories out of a live worktree while it warms, so the delete runs in the background.
|
|
226
|
+
* `take` is false, with the directory untouched, when the entry cannot be opened or the rename fails; the caller
|
|
227
|
+
* deletes it in place. gc deletes a crashed entry whatever the state of the worktree.
|
|
228
|
+
*/
|
|
229
|
+
function warmTrash(worktree, options = {}) {
|
|
230
|
+
let trash;
|
|
231
|
+
return {
|
|
232
|
+
async take(path) {
|
|
233
|
+
if (trash === void 0) trash = await openTrash(worktree, options, "warm");
|
|
234
|
+
if (!trash) return false;
|
|
235
|
+
const to = String(trash.moved.length);
|
|
236
|
+
try {
|
|
237
|
+
await rename(path, join(trash.dir, TRASH_ENTRIES, to));
|
|
238
|
+
} catch {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
trash.moved.push({
|
|
242
|
+
from: path,
|
|
243
|
+
to
|
|
244
|
+
});
|
|
245
|
+
return true;
|
|
246
|
+
},
|
|
247
|
+
async dispose(operation) {
|
|
248
|
+
if (!trash) return;
|
|
249
|
+
if (trash.moved.length) await disposeTrash(trash, operation);
|
|
250
|
+
else await discardTrash(trash);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
async function discardTrash(trash) {
|
|
255
|
+
await rmdir(join(trash.dir, TRASH_ENTRIES)).catch(() => {});
|
|
256
|
+
await rm(join(trash.dir, TRASH_MANIFEST), { force: true }).catch(() => {});
|
|
257
|
+
(0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
258
|
+
await rmdir(trash.dir).catch(() => {});
|
|
259
|
+
}
|
|
260
|
+
/** Moves every tree back into the worktree. Returns the relative paths that stay in the trash for gc. */
|
|
261
|
+
async function restoreTrashedTrees(trash) {
|
|
262
|
+
const kept = [];
|
|
263
|
+
for (const entry of trash.moved.toReversed()) {
|
|
264
|
+
const target = join(trash.worktree, entry.from);
|
|
265
|
+
try {
|
|
266
|
+
if (await lstat(target).catch(() => null) || !await isPlainDirectory(dirname(target))) {
|
|
267
|
+
kept.push(entry.from);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
await rename(join(trash.dir, TRASH_ENTRIES, entry.to), target);
|
|
271
|
+
} catch {
|
|
272
|
+
kept.push(entry.from);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (kept.length) (0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
276
|
+
else await discardTrash(trash);
|
|
277
|
+
return kept;
|
|
278
|
+
}
|
|
279
|
+
/** Deletes one trash entry: `rm -rf` for the bulk, then a walk that also clears read-only directories. */
|
|
280
|
+
async function deleteTrashEntry(dir, operation) {
|
|
281
|
+
if (process.platform !== "win32") try {
|
|
282
|
+
await runOperationFile(operation, getExecutor(), "rm", [
|
|
283
|
+
"-rf",
|
|
284
|
+
"--",
|
|
285
|
+
join(dir, TRASH_ENTRIES)
|
|
286
|
+
], {
|
|
287
|
+
timeoutMs: "unbounded",
|
|
288
|
+
signal: operation?.signal,
|
|
289
|
+
cwd: dirname(dir)
|
|
290
|
+
});
|
|
291
|
+
} catch (error) {
|
|
292
|
+
rethrowCancellation(error, operation?.signal);
|
|
293
|
+
}
|
|
294
|
+
await removeTemporaryEntryAsync(dir, operation?.signal);
|
|
295
|
+
}
|
|
296
|
+
function deleteInBackground(trash) {
|
|
297
|
+
try {
|
|
298
|
+
(0, ownership_claim_exports.markClaimChildPending)(trash.claim);
|
|
299
|
+
const child = getExecutor().spawn("nice", [
|
|
300
|
+
"-n",
|
|
301
|
+
DELETE_NICENESS,
|
|
302
|
+
"sh",
|
|
303
|
+
"-c",
|
|
304
|
+
"rm -rf -- \"$1\" && rm -rf -- \"$2\"",
|
|
305
|
+
"--",
|
|
306
|
+
join(trash.dir, TRASH_ENTRIES),
|
|
307
|
+
trash.dir
|
|
308
|
+
], {
|
|
309
|
+
cwd: dirname(trash.dir),
|
|
310
|
+
detached: true,
|
|
311
|
+
stdio: "ignore"
|
|
312
|
+
});
|
|
313
|
+
child.on?.("error", () => {});
|
|
314
|
+
child.unref?.();
|
|
315
|
+
const captured = child.pid === void 0 ? null : captureProcessIdentity(child.pid);
|
|
316
|
+
if (captured?.ok === false && captured.reason.startsWith("NOT_FOUND")) {
|
|
317
|
+
(0, ownership_claim_exports.clearClaimChild)(trash.claim);
|
|
318
|
+
(0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
319
|
+
return existsSync(trash.dir) ? "left" : "deleted";
|
|
320
|
+
}
|
|
321
|
+
if (!captured?.ok || child.pid === void 0) throw new Error("the trash deletion process was not recorded");
|
|
322
|
+
(0, ownership_claim_exports.setClaimChild)(trash.claim, {
|
|
323
|
+
pid: child.pid,
|
|
324
|
+
processToken: captured.token
|
|
325
|
+
});
|
|
326
|
+
return "background";
|
|
327
|
+
} catch {
|
|
328
|
+
try {
|
|
329
|
+
(0, ownership_claim_exports.clearClaimChild)(trash.claim);
|
|
330
|
+
} catch {}
|
|
331
|
+
(0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
332
|
+
return "left";
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Deletes the trash entry once its trees are out of the way. A CLI command starts a detached, low-priority `rm` recorded
|
|
337
|
+
* as the claim's child, so gc reports the entry as in use until `rm` exits. Inside a bounded report, such as the
|
|
338
|
+
* programmatic API, every child is stopped when the report settles, so the entry is deleted before returning.
|
|
339
|
+
* `left` means the entry waits for gc with its claim released.
|
|
340
|
+
*/
|
|
341
|
+
async function disposeTrash(trash, operation) {
|
|
342
|
+
if (!getExecutor().reportSignal?.()) return deleteInBackground(trash);
|
|
343
|
+
try {
|
|
344
|
+
await deleteTrashEntry(trash.dir, operation);
|
|
345
|
+
return "deleted";
|
|
346
|
+
} catch (error) {
|
|
347
|
+
rethrowCancellation(error, operation?.signal);
|
|
348
|
+
return "left";
|
|
349
|
+
} finally {
|
|
350
|
+
(0, ownership_claim_exports.releaseClaim)(trash.claim);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
//#endregion
|
|
111
354
|
//#region src/clonefile.ts
|
|
112
355
|
const SOURCE = "stim-clonefile.c";
|
|
113
356
|
const COMPILE_TIMEOUT_MS = 12e4;
|
|
@@ -397,7 +640,7 @@ function knownCopiedPaths(rel) {
|
|
|
397
640
|
function isMissingError(error) {
|
|
398
641
|
return error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR");
|
|
399
642
|
}
|
|
400
|
-
async function removeCopiedPath(root, rel, signal) {
|
|
643
|
+
async function removeCopiedPath(root, rel, signal, trash) {
|
|
401
644
|
signal.throwIfAborted();
|
|
402
645
|
const path = join$1(root, rel);
|
|
403
646
|
let parent;
|
|
@@ -411,21 +654,22 @@ async function removeCopiedPath(root, rel, signal) {
|
|
|
411
654
|
if (inside === ".." || inside.startsWith(`..${sep$1}`) || isAbsolute$1(inside)) return;
|
|
412
655
|
const stat = await lstat(parent);
|
|
413
656
|
const target = join$1(parent, basename$1(path));
|
|
657
|
+
let targetStat;
|
|
414
658
|
try {
|
|
415
|
-
await lstat(target);
|
|
659
|
+
targetStat = await lstat(target);
|
|
416
660
|
} catch (error) {
|
|
417
661
|
if (isMissingError(error)) return;
|
|
418
662
|
throw error;
|
|
419
663
|
}
|
|
420
664
|
await chmod(parent, stat.mode | 448);
|
|
421
665
|
try {
|
|
422
|
-
await removeTemporaryEntryAsync(target, signal);
|
|
666
|
+
if (!(targetStat.isDirectory() && await trash.take(target))) await removeTemporaryEntryAsync(target, signal);
|
|
423
667
|
} finally {
|
|
424
668
|
await utimes(parent, stat.atime, stat.mtime);
|
|
425
669
|
await chmod(parent, stat.mode);
|
|
426
670
|
}
|
|
427
671
|
}
|
|
428
|
-
async function removeKnownCopiedPaths(path, rel, signal) {
|
|
672
|
+
async function removeKnownCopiedPaths(path, rel, signal, trash) {
|
|
429
673
|
const paths = knownCopiedPaths(rel);
|
|
430
674
|
if (basename$1(rel) === "node_modules") {
|
|
431
675
|
const virtualStore = await readdir(join$1(path, ".pnpm")).catch((error) => {
|
|
@@ -435,7 +679,7 @@ async function removeKnownCopiedPaths(path, rel, signal) {
|
|
|
435
679
|
for (const name of virtualStore) if (name.startsWith("expo-modules-jsi@")) paths.push(`.pnpm/${name}/node_modules/expo-modules-jsi/apple/.DerivedData`);
|
|
436
680
|
}
|
|
437
681
|
const root = await realpath(path);
|
|
438
|
-
for (const known of paths) await removeCopiedPath(root, known, signal);
|
|
682
|
+
for (const known of paths) await removeCopiedPath(root, known, signal, trash);
|
|
439
683
|
}
|
|
440
684
|
async function cloneIgnoredEntries({ root, target, patterns, operation }) {
|
|
441
685
|
const options = {
|
|
@@ -460,58 +704,65 @@ async function cloneIgnoredEntries({ root, target, patterns, operation }) {
|
|
|
460
704
|
let cloned = true;
|
|
461
705
|
let helper;
|
|
462
706
|
const clonefile = () => helper ??= clonefileHelper(operation);
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
copying = true;
|
|
479
|
-
const copiedWith = async (file, args) => {
|
|
480
|
-
try {
|
|
481
|
-
await getExecutor().runFileAsync(file, args, options);
|
|
482
|
-
return true;
|
|
483
|
-
} catch (cause) {
|
|
484
|
-
if (cause instanceof WorkspaceProcessCleanupError || cause instanceof Error && "reportCleanup" in cause) throw cause;
|
|
485
|
-
operation.signal.throwIfAborted();
|
|
486
|
-
await removeTemporaryEntryAsync(to);
|
|
487
|
-
return false;
|
|
707
|
+
const trash = warmTrash(target, { signal: operation.signal });
|
|
708
|
+
try {
|
|
709
|
+
for (const rel of entries) {
|
|
710
|
+
operation.signal.throwIfAborted();
|
|
711
|
+
const from = join$1(root, rel);
|
|
712
|
+
const to = join$1(target, rel);
|
|
713
|
+
let copying = false;
|
|
714
|
+
try {
|
|
715
|
+
const reason = guard.covers(rel) ? "tracked" : overlapsNestedWorktree(rel, nested) ? "nested worktree" : missingDestinationReason(target, rel);
|
|
716
|
+
if (reason) {
|
|
717
|
+
skipped.push({
|
|
718
|
+
file: rel,
|
|
719
|
+
reason
|
|
720
|
+
});
|
|
721
|
+
continue;
|
|
488
722
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
723
|
+
await mkdir(dirname$1(to), { recursive: true });
|
|
724
|
+
copying = true;
|
|
725
|
+
const copiedWith = async (file, args) => {
|
|
726
|
+
try {
|
|
727
|
+
await getExecutor().runFileAsync(file, args, options);
|
|
728
|
+
return true;
|
|
729
|
+
} catch (cause) {
|
|
730
|
+
if (cause instanceof WorkspaceProcessCleanupError || cause instanceof Error && "reportCleanup" in cause) throw cause;
|
|
731
|
+
operation.signal.throwIfAborted();
|
|
732
|
+
await removeTemporaryEntryAsync(to);
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
const directoryClone = (await lstat(from)).isDirectory() ? await clonefile() : null;
|
|
737
|
+
if (!(directoryClone && await copiedWith(directoryClone, [from, to])) && !await copiedWith("cp", [
|
|
738
|
+
"-Rc",
|
|
498
739
|
from,
|
|
499
740
|
to
|
|
500
|
-
]
|
|
501
|
-
|
|
741
|
+
])) {
|
|
742
|
+
await getExecutor().runFileAsync("cp", [
|
|
743
|
+
"-R",
|
|
744
|
+
from,
|
|
745
|
+
to
|
|
746
|
+
], options);
|
|
747
|
+
cloned = false;
|
|
748
|
+
}
|
|
749
|
+
if ((await lstat(to)).isDirectory()) await removeKnownCopiedPaths(to, rel, operation.signal, trash);
|
|
750
|
+
copied.push(rel);
|
|
751
|
+
} catch (cause) {
|
|
752
|
+
if (cause instanceof WorkspaceProcessCleanupError || cause instanceof Error && "reportCleanup" in cause) throw cause;
|
|
753
|
+
if (copying) await removeTemporaryEntryAsync(to);
|
|
754
|
+
operation.signal.throwIfAborted();
|
|
755
|
+
failed.push({
|
|
756
|
+
file: rel,
|
|
757
|
+
error: String(cause?.message || cause)
|
|
758
|
+
});
|
|
502
759
|
}
|
|
503
|
-
if ((await lstat(to)).isDirectory()) await removeKnownCopiedPaths(to, rel, operation.signal);
|
|
504
|
-
copied.push(rel);
|
|
505
|
-
} catch (cause) {
|
|
506
|
-
if (cause instanceof WorkspaceProcessCleanupError || cause instanceof Error && "reportCleanup" in cause) throw cause;
|
|
507
|
-
if (copying) await removeTemporaryEntryAsync(to);
|
|
508
|
-
operation.signal.throwIfAborted();
|
|
509
|
-
failed.push({
|
|
510
|
-
file: rel,
|
|
511
|
-
error: String(cause?.message || cause)
|
|
512
|
-
});
|
|
513
760
|
}
|
|
761
|
+
} catch (error) {
|
|
762
|
+
await trash.dispose(operation).catch(() => {});
|
|
763
|
+
throw error;
|
|
514
764
|
}
|
|
765
|
+
await trash.dispose(operation);
|
|
515
766
|
return {
|
|
516
767
|
copied,
|
|
517
768
|
skipped,
|
|
@@ -1043,7 +1294,7 @@ function settingShapeErrors(settings) {
|
|
|
1043
1294
|
if (SETTINGS_WITH_RESOLVE_TIME_FALLBACK.has(setting.key)) continue;
|
|
1044
1295
|
const value = settingValueAt(settings, setting.key);
|
|
1045
1296
|
if (value === void 0) continue;
|
|
1046
|
-
const expected = setting.key === "ios.remote" || setting.key === "android.remote" || setting.key === "android.deviceProfile" || setting.type.kind === "number" && !BOUNDS_CHECKED_WHEN_USED.has(setting.key) ? settingValueError(setting, value) : acceptsShape(setting, value) ? null : expectedShape(setting.type);
|
|
1297
|
+
const expected = setting.key === "ios.remote" || setting.key === "android.remote" || setting.key === "macos.remote" || setting.key === "android.deviceProfile" || setting.type.kind === "number" && !BOUNDS_CHECKED_WHEN_USED.has(setting.key) ? settingValueError(setting, value) : acceptsShape(setting, value) ? null : expectedShape(setting.type);
|
|
1047
1298
|
if (expected) errors.push(`Invalid ${setting.key} setting ${JSON.stringify(value)}. Expected ${expected}.`);
|
|
1048
1299
|
}
|
|
1049
1300
|
return errors;
|
|
@@ -1440,6 +1691,10 @@ function unknownSettingKeys(settings, prefix = "") {
|
|
|
1440
1691
|
}
|
|
1441
1692
|
return unknown;
|
|
1442
1693
|
}
|
|
1694
|
+
function inertSettingWarning(settings, key) {
|
|
1695
|
+
const advice = replacementAdvice(key, settingValueAt(settings, key));
|
|
1696
|
+
return `Warning: setting "${key}" is not read by Stim and will be ignored.${advice ? advice.command ? ` Run \`${advice.command}\` instead.` : ` Use ${advice.key} instead.` : ""}`;
|
|
1697
|
+
}
|
|
1443
1698
|
function readCommittedSettings(directory) {
|
|
1444
1699
|
if (!directory) return {};
|
|
1445
1700
|
const p = join$1(directory, ".stim.json");
|
|
@@ -1462,8 +1717,16 @@ function setSettingValueAt(settings, path, value) {
|
|
|
1462
1717
|
node[segments[segments.length - 1]] = value;
|
|
1463
1718
|
}
|
|
1464
1719
|
const MACHINE_READABLE_SETTINGS = SETTINGS.filter((setting) => isLayeredSetting(setting) && setting.scopes.includes("machine") && !setting.key.startsWith("optimizations."));
|
|
1465
|
-
function
|
|
1720
|
+
function removedMachineSettings(machine) {
|
|
1466
1721
|
const settings = {};
|
|
1722
|
+
for (const key of Object.keys(REPLACED_SETTINGS)) {
|
|
1723
|
+
const value = settingValueAt(machine, key);
|
|
1724
|
+
if (value !== void 0) setSettingValueAt(settings, key, value);
|
|
1725
|
+
}
|
|
1726
|
+
return settings;
|
|
1727
|
+
}
|
|
1728
|
+
function machineLayerSettings(machine) {
|
|
1729
|
+
const settings = removedMachineSettings(machine);
|
|
1467
1730
|
const optimizations = settingValueAt(machine, "optimizations");
|
|
1468
1731
|
if (optimizations !== void 0) settings.optimizations = optimizations;
|
|
1469
1732
|
for (const setting of MACHINE_READABLE_SETTINGS) {
|
|
@@ -1635,13 +1898,19 @@ function cacheProviderSettingError(settings) {
|
|
|
1635
1898
|
function parseIosRemote(remote) {
|
|
1636
1899
|
const selected = remote.trim();
|
|
1637
1900
|
const reserved = selected.toLowerCase();
|
|
1638
|
-
|
|
1901
|
+
const word = placementWord(selected);
|
|
1902
|
+
if (word === "local") return null;
|
|
1903
|
+
if (word) return {
|
|
1904
|
+
kind: "machine",
|
|
1905
|
+
machine: "auto",
|
|
1906
|
+
placement: word
|
|
1907
|
+
};
|
|
1639
1908
|
return REMOTE_DEVICE_BACKENDS.includes(reserved) ? {
|
|
1640
1909
|
kind: "backend",
|
|
1641
1910
|
backend: reserved
|
|
1642
1911
|
} : {
|
|
1643
1912
|
kind: "machine",
|
|
1644
|
-
machine:
|
|
1913
|
+
machine: selected
|
|
1645
1914
|
};
|
|
1646
1915
|
}
|
|
1647
1916
|
function remoteIosSetting(settings) {
|
|
@@ -1742,4 +2011,4 @@ function webSettings(settings) {
|
|
|
1742
2011
|
};
|
|
1743
2012
|
}
|
|
1744
2013
|
//#endregion
|
|
1745
|
-
export {
|
|
2014
|
+
export { runnableMetroCommand as $, makeTemporaryDirectory as $t, metroCommandSetting as A, listWorktreesAsync as At, publicUrlSetting as B, resolveSourceCheckoutAsync as Bt, iosSigningIdentitySettingError as C, hasPopulatedSubmodulesAsync as Ct, iosSimSlimProfileSetting as D, linkedWorktreesOnDisk as Dt, iosSimSlimDefaultSetting as E, isPodInstallChurn as Et, metroWarmupUrlSetting as F, removeWorktreeAsync as Ft, remoteIosSetting as G, TRASH_CLAIMS as Gt, realpathInside as H, sourceCheckoutOf as Ht, ngrokUrlSetting as I, repoRoot as It, resolveCacheProviderConfig as J, deleteTrashEntry as Jt, removedMachineSettings as K, TRASH_ENTRY_PREFIX as Kt, parseIosRemote as L, repoRootAsync as Lt, metroIdleStopMinutesSetting as M, locallyKnownUpstreamAsync as Mt, metroPortSetting as N, podsOutOfSync as Nt, maintenanceKeepSetting as O, listCarryableIgnoredEntries as Ot, metroTunnelSettingError as P, readWorktreeExclude as Pt, resolveSettings as Q, filesystemDevice as Qt, projectSettingsContext as R, resolveFullRef as Rt, iosSigningIdentitySetting as S, gitCommonDirOnDisk as St, iosSigningIdentitySha1SettingError as T, hasUncommittedWorkAsync as Tt, remoteAndroidSetting as U, unpushedCommitsAsync as Ut, readCommittedSettings as V, restoreFileAsync as Vt, remoteEasFallbackSetting as W, warmWorktreePaths as Wt, resolveProjectSettings as X, moveIgnoredTreesToTrash as Xt, resolveIosProjectDir as Y, disposeTrash as Yt, resolveProjectSettingsAsync as Z, restoreTrashedTrees as Zt, inertSettingWarning as _, depsOutOfSync as _t, SETTING_SHAPE_REMEDY as a, settingsLayers as at, iosProjectDirSetting as b, gitCommonDir as bt, androidDataPartitionSizeBytes as c, webSettings as ct, androidLayoutSetting as d, detectProviders as dt, removeTemporaryEntry as en, settingFile as et, androidLayoutSettingError as f, planMetroReach as ft, deviceReclaimIdleMinutesSetting as g, deleteBranchAsync as gt, deviceIdleShutdownMinutesSetting as h, cloneIgnoredEntries as ht, SETTINGS_WITH_RESOLVE_TIME_FALLBACK as i, settingValueAt as it, metroCommandSettingError as j, locallyKnownUpstream as jt, mergeSettingsLayers as k, listWorktrees as kt, androidDataPartitionSizeGbSetting as l, workspaceHiddenSetting as lt, defaultAndroidLayout as m, branchExistsAsync as mt, METRO_COMMAND_PORT as n, temporaryRoot as nn, settingOriginScope as nt, androidAvdConfigSetting as o, tunnelModeSetting as ot, cacheProviderSettingError as p, resolveTailscaleBinary as pt, resolveAndroidLayout as q, TRASH_MANIFEST as qt, PATH_SETTINGS as r, settingShapeErrors as rt, androidAvdConfigSettingError as s, unknownSettingKeys as st, ANDROID_AVD_CONFIG_HELP as t, removeTemporaryEntryAsync as tn, settingOrigin as tt, androidDataPartitionSizeGbSettingError as u, PUBLIC_METRO_ENV as ut, iosLanHostSetting as v, dirtyFingerprintFiles as vt, iosSigningIdentitySha1Setting as w, hasRemoteAsync as wt, iosProjectDirSettingError as x, gitCommonDirAsync as xt, iosLanHostSettingError as y, dirtyPathsAsync as yt, projectSettingsContextAsync as z, resolveFullRefAsync as zt };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as readSettingsPayload, l as settingEntry, o as layerFile, s as readSettingsContext, t as SettingsRefusal } from "./settings-payload-cm60Zhib.mjs";
|
|
2
|
+
import { i as unsetReplacedSetting, n as readScope, r as requireSetting, t as mutateSetting } from "./settings-write-BdNRLlBn.mjs";
|
|
3
|
+
import { REPLACED_SETTINGS, SETTING_SCOPES } from "@stim-cli/core/state";
|
|
3
4
|
import chalk from "chalk";
|
|
4
5
|
//#region src/commands/settings.ts
|
|
5
6
|
function formatValue(value) {
|
|
@@ -45,7 +46,7 @@ function registerSettings(program, io = CONSOLE, env = process.env) {
|
|
|
45
46
|
const shown = entry.origin === null ? "" : formatValue(entry.value);
|
|
46
47
|
io.out(`${entry.key.padEnd(width)} ${shown}${shown ? " " : ""}${chalk.dim(`(${formatOrigin(entry)})`)}`);
|
|
47
48
|
}
|
|
48
|
-
for (const entry of payload.unknown) io.note(chalk.yellow(`Warning: ${entry.key} in ${entry.file} is not read by Stim.`));
|
|
49
|
+
for (const entry of payload.unknown) io.note(chalk.yellow(`Warning: ${entry.key} in ${entry.file} is not read by Stim.${entry.replacement ? ` Run \`${entry.replacement}\` instead.` : ""}`));
|
|
49
50
|
}));
|
|
50
51
|
settings.command("get <key>").description("Print the effective value of a setting, or its value in one layer").option("--scope <scope>", `read one layer: ${SETTING_SCOPES.join(", ")}`).option("--json", "print the setting entry as JSON").action((key, opts, command) => run(wantsJson(opts, command), io, async () => {
|
|
51
52
|
const setting = requireSetting(key);
|
|
@@ -80,6 +81,18 @@ function registerSettings(program, io = CONSOLE, env = process.env) {
|
|
|
80
81
|
report(io, wantsJson(opts, command), result, "set");
|
|
81
82
|
}));
|
|
82
83
|
settings.command("unset <key>").description("Remove a setting from one layer").option("--scope <scope>", `the layer to clear: ${SETTING_SCOPES.join(", ")}`).option("--json", "print the setting after removal as JSON").action((key, opts, command) => run(wantsJson(opts, command), io, async () => {
|
|
84
|
+
if (Object.hasOwn(REPLACED_SETTINGS, key)) {
|
|
85
|
+
const removal = await unsetReplacedSetting({
|
|
86
|
+
key,
|
|
87
|
+
scope: opts.scope
|
|
88
|
+
}, {
|
|
89
|
+
cwd: process.cwd(),
|
|
90
|
+
env,
|
|
91
|
+
note: io.note
|
|
92
|
+
});
|
|
93
|
+
reportRemoval(io, wantsJson(opts, command), removal, opts.scope);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
83
96
|
const result = await mutateSetting({
|
|
84
97
|
action: "unset",
|
|
85
98
|
key,
|
|
@@ -92,6 +105,14 @@ function registerSettings(program, io = CONSOLE, env = process.env) {
|
|
|
92
105
|
report(io, wantsJson(opts, command), result, "unset");
|
|
93
106
|
}));
|
|
94
107
|
}
|
|
108
|
+
function reportRemoval(io, json, removal, scope) {
|
|
109
|
+
if (json) {
|
|
110
|
+
io.out(JSON.stringify(removal));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
for (const { file } of removal.removed) io.out(`unset ${removal.key} in ${file}`);
|
|
114
|
+
if (removal.removed.length === 0) io.out(`${removal.key} was not set in ${scope ? `the ${scope} layer` : "any layer"}.`);
|
|
115
|
+
}
|
|
95
116
|
function report(io, json, result, verb) {
|
|
96
117
|
const { setting: entry, recordingsDeleted, ...write } = result;
|
|
97
118
|
if (json) {
|