stim 1.13.0 → 1.15.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.
Files changed (133) hide show
  1. package/README.md +2 -0
  2. package/dist/{activity-DfVKZTEB.mjs → activity-B2-kb7k0.mjs} +281 -41
  3. package/dist/{android-BHfAu2mf.mjs → android-CYmq0jNi.mjs} +2 -2
  4. package/dist/{android-CD8pr8Q2.mjs → android-Cu_L4RpL.mjs} +524 -412
  5. package/dist/{android-qx_31wJo.mjs → android-Db2eEMaf.mjs} +152 -65
  6. package/dist/android-cas-PnKfAdB2.mjs +167 -0
  7. package/dist/android-cas-compiler.mjs +2 -2
  8. package/dist/{app-install-CDFY2nUL.mjs → app-install-CAAplXAt.mjs} +162 -173
  9. package/dist/{budget-E5o91NR1.mjs → budget-CMiqghig.mjs} +1048 -77
  10. package/dist/{build-plan-BTa93o_r.mjs → build-plan-aeGMFX7e.mjs} +193 -650
  11. package/dist/build-progress-C2Jv1AtA.mjs +872 -0
  12. package/dist/build-slots-Df1ApSuH.mjs +127 -0
  13. package/dist/{cache-manifest-DWPF4RKJ.mjs → cache-manifest-DnUHBJaU.mjs} +2 -2
  14. package/dist/cache-manifest.mjs +1 -1
  15. package/dist/{chrome-B5hWgQJS.mjs → chrome-BrcVWQyD.mjs} +4 -4
  16. package/dist/cli-0cX5s4NM.mjs +45 -0
  17. package/dist/cli.mjs +6 -42
  18. package/dist/client-C2IS36Qf.mjs +1333 -0
  19. package/dist/collector-run.mjs +8 -7
  20. package/dist/{command-output-BIL7rlX7.mjs → command-output-CliHHn7a.mjs} +1 -1
  21. package/dist/{config-0jCcMM0E.mjs → config-D0DbpZtM.mjs} +29 -29
  22. package/dist/{created-devices-Cd558h31.mjs → created-devices-BwVb3liH.mjs} +2 -2
  23. package/dist/{dependency-state-DNN0yfx6.mjs → dependency-state-BmsjKZ2H.mjs} +2 -2
  24. package/dist/{deps-2Wo81np9.mjs → deps-BFlKbOIp.mjs} +3 -3
  25. package/dist/{detached-entry-DJHoca49.mjs → detached-entry-CiTEgMR1.mjs} +1 -1
  26. package/dist/dev-client-CjzLoNs0.mjs +80 -0
  27. package/dist/{device-Cf7vl-so.mjs → device-BZ1IyS5A.mjs} +7 -7
  28. package/dist/device-capacity-DMuKC7nx.mjs +136 -0
  29. package/dist/device-host-worker.d.mts +1 -0
  30. package/dist/device-host-worker.mjs +769 -0
  31. package/dist/device-ios-DMQBUPus.mjs +381 -0
  32. package/dist/{device-lease-CL9dZf73.mjs → device-lease-W5Pi1q38.mjs} +43 -36
  33. package/dist/{device-pool-MuoiyRcu.mjs → device-pool-B2r38YjS.mjs} +4 -4
  34. package/dist/{device-remote-DT9ngZiD.mjs → device-remote-9ulPsdhY.mjs} +68 -162
  35. package/dist/{doctor-D2iysNNH.mjs → doctor-BcE5xsBn.mjs} +191 -99
  36. package/dist/{error-diagnostics-BoiOhck8.mjs → error-diagnostics-Cb0P1WLS.mjs} +12 -11
  37. package/dist/{exec-DK8KaVHK.mjs → exec-CaErVv7t.mjs} +5 -1
  38. package/dist/{gc-eA-PRBX8.mjs → gc-BuL1Genr.mjs} +430 -102
  39. package/dist/{android-cas-B9Kv9aIy.mjs → gradle-CmdOBq1d.mjs} +8 -294
  40. package/dist/{guide-BfZ0OmiP.mjs → guide-cCSGRFd3.mjs} +2052 -240
  41. package/dist/{guide-status-BaMYu55M.mjs → guide-status-CIoWK6mG.mjs} +3 -3
  42. package/dist/hosted-macos-DwowNU7W.mjs +447 -0
  43. package/dist/idle-shutdown-B5LPaNyY.mjs +122 -0
  44. package/dist/in-use-CndPMilN.mjs +110 -0
  45. package/dist/{ios-CmEzZiOj.mjs → ios-3CtCRhwr.mjs} +201 -10
  46. package/dist/{ios-CcfCeZ19.mjs → ios-Chob8ny7.mjs} +560 -259
  47. package/dist/{ios-device-BW-t_Lkv.mjs → ios-device-DERmMmk-.mjs} +12 -7
  48. package/dist/{ios-device-BiOsSVzd.mjs → ios-device-Ee7sDXfp.mjs} +1 -1
  49. package/dist/{launch-verify-CuJaBpEa.mjs → launch-verify-CLlofxRt.mjs} +42 -11
  50. package/dist/{logs-DcSRbC2t.mjs → logs-h9h6MUvE.mjs} +95 -13
  51. package/dist/machine-usage-D_YYMzfR.mjs +283 -0
  52. package/dist/machines-CYtOCqcj.mjs +259 -0
  53. package/dist/macos-BwtbUtTN.mjs +468 -0
  54. package/dist/macos-run.d.mts +5 -0
  55. package/dist/macos-run.mjs +2 -0
  56. package/dist/{merge-state-ytFQCeh4.mjs → merge-state-BnxLNQiM.mjs} +22 -12
  57. package/dist/{metro-BPeY1YMh.mjs → metro-Di8EN2Tb.mjs} +20 -120
  58. package/dist/{named-ports-n7tnJsI8.mjs → named-ports-Dj_XBNaL.mjs} +8 -64
  59. package/dist/native-run-DFDoIRbY.mjs +147 -0
  60. package/dist/{native-runtime-CiiFHt0e.mjs → native-runtime-i6OkVg-w.mjs} +11 -6
  61. package/dist/offload-worker.d.mts +121 -0
  62. package/dist/offload-worker.mjs +601 -0
  63. package/dist/{ownership-Bz2kETAS.mjs → ownership-BkYxUtuj.mjs} +3 -2
  64. package/dist/{page-BTu7I60K.mjs → page-QF_Ke10s.mjs} +7 -2
  65. package/dist/{ports-C5UutqpJ.mjs → ports-DddwttKM.mjs} +3 -3
  66. package/dist/prebuild-BvxDlD6C.mjs +213 -0
  67. package/dist/process-identity-BmRm1qV0.mjs +12 -0
  68. package/dist/{project-DGeclhvO.mjs → project-CV3tDFHl.mjs} +9 -18
  69. package/dist/pull-request-pxnDCQzn.mjs +322 -0
  70. package/dist/pull-requests.d.mts +120 -0
  71. package/dist/pull-requests.mjs +2 -0
  72. package/dist/recordings-GEXp4iBT.mjs +37 -0
  73. package/dist/{reload-C-cV5yy_.mjs → reload-ChPiwvot.mjs} +70 -22
  74. package/dist/{remote-cache--aehr4Pr.mjs → remote-cache-CO2elm_b.mjs} +4 -4
  75. package/dist/run-B-xqRrsg.mjs +119 -0
  76. package/dist/{server-bare-Bq8BpSIo.mjs → server-bare-X7PUgizL.mjs} +60 -13
  77. package/dist/{server-expo-DUCg52-K.mjs → server-expo-DhtX6bom.mjs} +6 -10
  78. package/dist/server-expo-KJeD109I.mjs +2 -0
  79. package/dist/{settings-xB0Frkg6.mjs → settings-CduVcoxj.mjs} +77 -26
  80. package/dist/{settings-ssVBToDR.mjs → settings-DbL6uhH8.mjs} +16 -10
  81. package/dist/settings.schema.json +357 -2
  82. package/dist/{simslim-Bbg9UWrt.mjs → simslim-Ciluxlq4.mjs} +8 -132
  83. package/dist/slot-launch-BY0BrOLh.mjs +65 -0
  84. package/dist/{spawn-claims-PT8aQpCa.mjs → spawn-claims-D0XfSe8u.mjs} +1 -1
  85. package/dist/spawn-entry-DncpJvWL.mjs +16 -0
  86. package/dist/stage-CzaiwFsI.mjs +143 -0
  87. package/dist/start-CPO4wRg7.mjs +2 -0
  88. package/dist/{start-BZhItkiL.mjs → start-CUD9nasA.mjs} +108 -61
  89. package/dist/state-B4PQFXMW.d.mts +12 -0
  90. package/dist/state-BxCgeTQu.mjs +41 -0
  91. package/dist/{state-DwAU2_-D.mjs → state-CaeaHbDA.mjs} +7 -4
  92. package/dist/{state-l1pYwOre.mjs → state-DFm77wRn.mjs} +67 -5
  93. package/dist/stats-DBLLFmKd.mjs +66 -0
  94. package/dist/{status-TJlL0HWo.mjs → status-DYXxNOT0.mjs} +425 -260
  95. package/dist/{status-sszP4XKU.mjs → status-l84Gbvp2.mjs} +122 -20
  96. package/dist/stdout-reader-C8yjre1x.mjs +23 -0
  97. package/dist/stim-desktop-Cnz8CPnl.mjs +63 -0
  98. package/dist/stim-footprint.swift +32 -0
  99. package/dist/{stim-installations-CINXy_su.mjs → stim-installations-QMEI32v1.mjs} +1 -1
  100. package/dist/{stop-BZ2qMiBP.mjs → stop-Bad61z_2.mjs} +128 -19
  101. package/dist/stop-Bvf1MflS.mjs +48 -0
  102. package/dist/{stop-DskDKNTU.mjs → stop-CceYh1yG.mjs} +2 -2
  103. package/dist/stop-cause-CZ_Mr-v9.mjs +665 -0
  104. package/dist/supervisor-run.d.mts +44 -12
  105. package/dist/supervisor-run.mjs +276 -33
  106. package/dist/support-CDQbDkL5.mjs +315 -0
  107. package/dist/support-WLOzVKUv.mjs +176 -0
  108. package/dist/teardown-BYuQafiA.mjs +718 -0
  109. package/dist/{xcode-LM6A8cNZ.mjs → toolchain-DmeYjXD9.mjs} +363 -13
  110. package/dist/warm-progress-DVHLN4uC.mjs +463 -0
  111. package/dist/{idle-DxLi5OkN.mjs → watchman-Bx0wceoF.mjs} +55 -8
  112. package/dist/{web-sWXd5iek.mjs → web-k6w8-HnE.mjs} +39 -22
  113. package/dist/web-run.mjs +326 -13
  114. package/dist/workspace-process-lock-BL7Q0HCO.mjs +57 -0
  115. package/dist/workspace-state-CL2V2Ons.mjs +371 -0
  116. package/dist/worktree-BT_uULFx.mjs +2 -0
  117. package/dist/{worktree-DeBQSVtR.mjs → worktree-C0c5Udwa.mjs} +55 -54
  118. package/dist/{worktree-D4Do_XiQ.mjs → worktree-qXKzADSC.mjs} +161 -255
  119. package/package.json +10 -5
  120. package/shim/bundle-response.cjs +55 -10
  121. package/shim/bundle-response.d.cts +1 -0
  122. package/shim/expo-metro-config.cjs +10 -2
  123. package/dist/build-progress-l7d-X-ZP.mjs +0 -247
  124. package/dist/in-use-wYEaKQM9.mjs +0 -249
  125. package/dist/ownership-PUP4Dwai.mjs +0 -1138
  126. package/dist/server-expo-BeYwP_Xy.mjs +0 -2
  127. package/dist/slot-launch-BIWEW-wI.mjs +0 -19
  128. package/dist/start-Rw2GD3nV.mjs +0 -2
  129. package/dist/stats-CaSwmsSZ.mjs +0 -62
  130. package/dist/stats-D8rUTPHd.mjs +0 -368
  131. package/dist/stim-desktop-CXt8-Z3J.mjs +0 -40
  132. package/dist/worktree-3cBa-bQt.mjs +0 -2
  133. package/dist/{metro-store-DzeWkfqW.mjs → metro-store-CDDZHtPl.mjs} +1 -1
@@ -0,0 +1,127 @@
1
+ import { n as ownership_claim_exports } from "./process-identity-BmRm1qV0.mjs";
2
+ import { n as declareSpawnsOn, o as stopDeclaringSpawnsOn } from "./spawn-claims-D0XfSe8u.mjs";
3
+ import { a as formatElapsed } from "./command-output-CliHHn7a.mjs";
4
+ import { readdirSync, statSync } from "node:fs";
5
+ import { join } from "node:path";
6
+ import { buildSlotsDir, tryAcquireBuildSlotClaim } from "@stim-cli/core/state";
7
+ //#region src/engine/build-slots.ts
8
+ const SLOT_PREFIX = "slot-";
9
+ const SLOT_POLL_MS = 1e3;
10
+ const SLOT_PROGRESS_MS = 3e4;
11
+ const SLOT_CEILING_MS = 54e5;
12
+ function sleepAsync(ms) {
13
+ return new Promise((resolve) => setTimeout(resolve, ms));
14
+ }
15
+ function toRecord(holder) {
16
+ const details = holder.details;
17
+ return {
18
+ pid: holder.owner.pid,
19
+ index: typeof details.index === "number" ? details.index : null,
20
+ projectRoot: typeof details.projectRoot === "string" ? details.projectRoot : null,
21
+ startedAt: holder.startedAt || null,
22
+ logFile: typeof details.logFile === "string" ? details.logFile : null
23
+ };
24
+ }
25
+ function tryAcquireBuildSlot({ max, root = null, logFile = null }) {
26
+ if (!max || max <= 0) return {
27
+ acquired: true,
28
+ unlimited: true
29
+ };
30
+ const got = tryAcquireBuildSlotClaim({
31
+ max,
32
+ details: {
33
+ projectRoot: root,
34
+ logFile
35
+ }
36
+ });
37
+ if (!got) return null;
38
+ declareSpawnsOn(got.claim);
39
+ return {
40
+ acquired: true,
41
+ path: got.path,
42
+ index: got.index,
43
+ slot: {
44
+ pid: got.claim.owner.pid,
45
+ index: got.index,
46
+ projectRoot: root,
47
+ startedAt: got.claim.startedAt,
48
+ logFile
49
+ },
50
+ claim: got.claim
51
+ };
52
+ }
53
+ function slotWaitingLine({ max, elapsedMs }) {
54
+ return `${"build".padEnd(11)} waiting for a build slot (all ${max} in use, ${formatElapsed(elapsedMs)} elapsed) -- stim guide lifecycle concurrency`;
55
+ }
56
+ async function acquireBuildSlot({ max, root = null, logFile = null, now = Date.now, out = () => {}, sleep = sleepAsync, intervalMs = SLOT_POLL_MS, progressMs = SLOT_PROGRESS_MS, ceilingMs = SLOT_CEILING_MS }) {
57
+ if (!max || max <= 0) return {
58
+ acquired: true,
59
+ unlimited: true
60
+ };
61
+ const started = now();
62
+ let lastProgress = started;
63
+ for (;;) {
64
+ const got = tryAcquireBuildSlot({
65
+ max,
66
+ root,
67
+ logFile
68
+ });
69
+ if (got) return got;
70
+ const elapsed = now() - started;
71
+ if (elapsed >= ceilingMs) {
72
+ const err = /* @__PURE__ */ new Error(`Waited ${formatElapsed(elapsed)} for one of ${max} build slots, and every slot is held by a process that is still running, or by a holder Stim cannot identify. Slots live under ` + buildSlotsDir() + "; remove a slot directory whose builder is not really building, or raise concurrency.maxBuilds.");
73
+ err.code = "STIM_BUILD_SLOT_TIMEOUT";
74
+ throw err;
75
+ }
76
+ if (now() - lastProgress >= progressMs) {
77
+ lastProgress = now();
78
+ out(slotWaitingLine({
79
+ max,
80
+ elapsedMs: elapsed
81
+ }));
82
+ }
83
+ await sleep(intervalMs);
84
+ }
85
+ }
86
+ function releaseBuildSlot(handle) {
87
+ if (!handle || handle.unlimited) return false;
88
+ stopDeclaringSpawnsOn(handle.claim);
89
+ return (0, ownership_claim_exports.releaseClaim)(handle.claim);
90
+ }
91
+ function listBuildSlots() {
92
+ const dir = buildSlotsDir();
93
+ let names;
94
+ try {
95
+ names = readdirSync(dir);
96
+ } catch {
97
+ return [];
98
+ }
99
+ const slots = [];
100
+ for (const name of names) {
101
+ if (!name.startsWith(SLOT_PREFIX)) continue;
102
+ const path = join(dir, name);
103
+ try {
104
+ if (!statSync(path).isDirectory()) continue;
105
+ } catch {
106
+ continue;
107
+ }
108
+ const survey = (0, ownership_claim_exports.readClaimSet)(path);
109
+ const holder = survey.live[0] ?? survey.dead[0];
110
+ const info = holder ? toRecord(holder) : null;
111
+ const index = Number(name.slice(5));
112
+ slots.push({
113
+ path,
114
+ name,
115
+ index: Number.isFinite(index) ? index : null,
116
+ pid: info?.pid ?? null,
117
+ projectRoot: info?.projectRoot ?? null,
118
+ startedAt: info?.startedAt ?? null,
119
+ logFile: info?.logFile ?? null,
120
+ alive: survey.live.length > 0,
121
+ unresolved: survey.unresolved.length > 0
122
+ });
123
+ }
124
+ return slots;
125
+ }
126
+ //#endregion
127
+ export { listBuildSlots as n, releaseBuildSlot as r, acquireBuildSlot as t };
@@ -1,8 +1,8 @@
1
- import { d as getConfigDir } from "./config-0jCcMM0E.mjs";
1
+ import { d as getConfigDir } from "./config-D0DbpZtM.mjs";
2
2
  import { existsSync } from "fs";
3
+ import { homedir } from "os";
3
4
  import { isAbsolute, join, resolve } from "path";
4
5
  import { readCacheManifest, updateCacheManifest } from "@stim-cli/core";
5
- import { homedir } from "os";
6
6
  //#region src/cache/cache-manifest.ts
7
7
  function manifestPath() {
8
8
  return join(getConfigDir(), "caches.json");
@@ -1,2 +1,2 @@
1
- import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DWPF4RKJ.mjs";
1
+ import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DnUHBJaU.mjs";
2
2
  export { manifestPath, readManifest, register, registeredCaches, unregister };
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DK8KaVHK.mjs";
1
+ import { t as getExecutor } from "./exec-CaErVv7t.mjs";
2
2
  import { existsSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { homedir } from "node:os";
@@ -30,7 +30,7 @@ function findChrome({ host = process.platform, exists = existsSync, findExecutab
30
30
  }
31
31
  return null;
32
32
  }
33
- const DESKTOP_WINDOW = {
33
+ const DESKTOP_PAGE = {
34
34
  width: 1280,
35
35
  height: 800
36
36
  };
@@ -40,7 +40,7 @@ const PHONE_SCREEN = {
40
40
  deviceScaleFactor: 3
41
41
  };
42
42
  function chromeArgs({ profile, port, headless, ignoreCertificateErrors, viewport }) {
43
- const window = viewport === "phone" ? PHONE_SCREEN : DESKTOP_WINDOW;
43
+ const window = viewport === "phone" ? PHONE_SCREEN : DESKTOP_PAGE;
44
44
  return [
45
45
  `--user-data-dir=${profile}`,
46
46
  `--remote-debugging-port=${port}`,
@@ -58,4 +58,4 @@ function chromeArgs({ profile, port, headless, ignoreCertificateErrors, viewport
58
58
  ];
59
59
  }
60
60
  //#endregion
61
- export { findChrome as i, PHONE_SCREEN as n, chromeArgs as r, CHROME_INSTALL_REMEDY as t };
61
+ export { findChrome as a, chromeArgs as i, DESKTOP_PAGE as n, PHONE_SCREEN as r, CHROME_INSTALL_REMEDY as t };
@@ -0,0 +1,45 @@
1
+ import { y as refuseRelativeStimPaths } from "./config-D0DbpZtM.mjs";
2
+ import { readFileSync } from "node:fs";
3
+ import { Command } from "commander";
4
+ //#region bin/cli.ts
5
+ const commands = /* @__PURE__ */ new Map([
6
+ ["doctor", () => import("./doctor-BcE5xsBn.mjs")],
7
+ ["worktree", () => import("./worktree-BT_uULFx.mjs")],
8
+ ["start", () => import("./start-CPO4wRg7.mjs")],
9
+ ["ports", () => import("./ports-DddwttKM.mjs")],
10
+ ["stop", () => import("./stop-CceYh1yG.mjs")],
11
+ ["ios", () => import("./ios-Chob8ny7.mjs")],
12
+ ["android", () => import("./android-Cu_L4RpL.mjs")],
13
+ ["web", () => import("./web-k6w8-HnE.mjs")],
14
+ ["macos", () => import("./macos-BwtbUtTN.mjs")],
15
+ ["reload", () => import("./reload-ChPiwvot.mjs")],
16
+ ["device", () => import("./device-BZ1IyS5A.mjs")],
17
+ ["logs", () => import("./logs-h9h6MUvE.mjs")],
18
+ ["settings", () => import("./settings-DbL6uhH8.mjs")],
19
+ ["status", () => import("./status-DYXxNOT0.mjs")],
20
+ ["stats", () => import("./stats-DBLLFmKd.mjs")],
21
+ ["gc", () => import("./gc-BuL1Genr.mjs")],
22
+ ["guide", () => import("./guide-cCSGRFd3.mjs")]
23
+ ]);
24
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
25
+ const program = new Command();
26
+ program.name("stim").description("Isolated React Native dev environments per project/worktree").version(pkg.version);
27
+ try {
28
+ refuseRelativeStimPaths();
29
+ const first = process.argv[2];
30
+ const loadCommand = commands.get((first === "help" ? process.argv[3] : first) ?? "");
31
+ if (loadCommand) (await loadCommand()).default(program, pkg.version);
32
+ else if (first !== "--version" && first !== "-V") {
33
+ const modules = await Promise.all([...commands.values()].map((load) => load()));
34
+ for (const module of modules) module.default(program, pkg.version);
35
+ }
36
+ await program.parseAsync();
37
+ } catch (err) {
38
+ const code = err?.code;
39
+ const message = err instanceof Error ? err.message : String(err);
40
+ if (typeof code === "string" && code.startsWith("STIM_")) console.error(`${code}: ${message}`);
41
+ else console.error(`Unexpected error: ${message.replace(/\.$/, "")}. Report it at ${pkg.bugs.url}`);
42
+ process.exit(1);
43
+ }
44
+ //#endregion
45
+ export {};
package/dist/cli.mjs CHANGED
@@ -1,45 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { v as refuseRelativeStimPaths } from "./config-0jCcMM0E.mjs";
3
- import { readFileSync } from "node:fs";
4
- import { Command } from "commander";
5
- //#region bin/cli.ts
6
- const commands = /* @__PURE__ */ new Map([
7
- ["doctor", () => import("./doctor-D2iysNNH.mjs")],
8
- ["worktree", () => import("./worktree-3cBa-bQt.mjs")],
9
- ["start", () => import("./start-Rw2GD3nV.mjs")],
10
- ["ports", () => import("./ports-C5UutqpJ.mjs")],
11
- ["stop", () => import("./stop-DskDKNTU.mjs")],
12
- ["ios", () => import("./ios-CcfCeZ19.mjs")],
13
- ["android", () => import("./android-CD8pr8Q2.mjs")],
14
- ["web", () => import("./web-sWXd5iek.mjs")],
15
- ["reload", () => import("./reload-C-cV5yy_.mjs")],
16
- ["device", () => import("./device-Cf7vl-so.mjs")],
17
- ["logs", () => import("./logs-DcSRbC2t.mjs")],
18
- ["settings", () => import("./settings-ssVBToDR.mjs")],
19
- ["status", () => import("./status-TJlL0HWo.mjs")],
20
- ["stats", () => import("./stats-CaSwmsSZ.mjs")],
21
- ["gc", () => import("./gc-eA-PRBX8.mjs")],
22
- ["guide", () => import("./guide-BfZ0OmiP.mjs")]
23
- ]);
24
- const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
25
- const program = new Command();
26
- program.name("stim").description("Isolated React Native dev environments per project/worktree").version(pkg.version);
27
- try {
28
- refuseRelativeStimPaths();
29
- const first = process.argv[2];
30
- const loadCommand = commands.get((first === "help" ? process.argv[3] : first) ?? "");
31
- if (loadCommand) (await loadCommand()).default(program, pkg.version);
32
- else if (first !== "--version" && first !== "-V") {
33
- const modules = await Promise.all([...commands.values()].map((load) => load()));
34
- for (const module of modules) module.default(program, pkg.version);
35
- }
36
- await program.parseAsync();
37
- } catch (err) {
38
- const code = err?.code;
39
- const message = err instanceof Error ? err.message : String(err);
40
- if (typeof code === "string" && code.startsWith("STIM_")) console.error(`${code}: ${message}`);
41
- else console.error(`Unexpected error: ${message.replace(/\.$/, "")}. Report it at ${pkg.bugs.url}`);
42
- process.exit(1);
43
- }
2
+ //#region bin/node-check.ts
3
+ const encode = (version) => version.split(".", 3).reduce((sum, part) => sum * 1e3 + parseInt(part, 10), 0);
4
+ if (encode(process.versions.node) < encode("22.12.0")) {
5
+ process.stderr.write(`STIM_NODE_UNSUPPORTED: Stim needs Node 22.12.0 or later; this is Node ${process.versions.node} at ${process.execPath}. To run Stim where a project pins an older Node, see https://stim.appandflow.com/docs/requirements#older-node-pins\n`);
6
+ process.exitCode = 1;
7
+ } else import("./cli-0cX5s4NM.mjs");
44
8
  //#endregion
45
9
  export {};