@geekmidas/cli 10.0.0-alpha.85 → 10.0.0-alpha.86

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 (175) hide show
  1. package/dist/{HostingerProvider-dxkwynSs.cjs → HostingerProvider-BCB1QJj1.cjs} +2 -2
  2. package/dist/{HostingerProvider-dxkwynSs.cjs.map → HostingerProvider-BCB1QJj1.cjs.map} +1 -1
  3. package/dist/{HostingerProvider-D85ayzTi.mjs → HostingerProvider-CVc3rLPB.mjs} +2 -2
  4. package/dist/{HostingerProvider-D85ayzTi.mjs.map → HostingerProvider-CVc3rLPB.mjs.map} +1 -1
  5. package/dist/{LegacyStateStore-CJ2o18nT.mjs → LegacyStateStore-B0R4LlX_.mjs} +2 -2
  6. package/dist/{LegacyStateStore-CJ2o18nT.mjs.map → LegacyStateStore-B0R4LlX_.mjs.map} +1 -1
  7. package/dist/{LegacyStateStore-xGxPwP-m.cjs → LegacyStateStore-CWG_HVC0.cjs} +7 -7
  8. package/dist/{LegacyStateStore-xGxPwP-m.cjs.map → LegacyStateStore-CWG_HVC0.cjs.map} +1 -1
  9. package/dist/{LocalStateStore-CkjFD-4b.cjs → LocalStateStore-CLwa2DpK.cjs} +8 -8
  10. package/dist/{LocalStateStore-CkjFD-4b.cjs.map → LocalStateStore-CLwa2DpK.cjs.map} +1 -1
  11. package/dist/{LocalStateStore-ByVjUIvS.mjs → LocalStateStore-Q4vXg2ua.mjs} +2 -2
  12. package/dist/{LocalStateStore-ByVjUIvS.mjs.map → LocalStateStore-Q4vXg2ua.mjs.map} +1 -1
  13. package/dist/{S3StateStore-iqMezbES.cjs → S3StateStore-Cea9_5gF.cjs} +5 -5
  14. package/dist/{S3StateStore-iqMezbES.cjs.map → S3StateStore-Cea9_5gF.cjs.map} +1 -1
  15. package/dist/{S3StateStore-kpFlGVLE.mjs → S3StateStore-CksKYKRa.mjs} +2 -2
  16. package/dist/{S3StateStore-kpFlGVLE.mjs.map → S3StateStore-CksKYKRa.mjs.map} +1 -1
  17. package/dist/{SSMStateStore-Bkz5ztfo.mjs → SSMStateStore-BszSCAS2.mjs} +2 -2
  18. package/dist/{SSMStateStore-Bkz5ztfo.mjs.map → SSMStateStore-BszSCAS2.mjs.map} +1 -1
  19. package/dist/{SSMStateStore-Z2OMVCtq.cjs → SSMStateStore-aBOTF018.cjs} +9 -9
  20. package/dist/{SSMStateStore-Z2OMVCtq.cjs.map → SSMStateStore-aBOTF018.cjs.map} +1 -1
  21. package/dist/{add-CM7RLj89.cjs → add-5MZAXybv.cjs} +8 -5
  22. package/dist/add-5MZAXybv.cjs.map +1 -0
  23. package/dist/{add-jpX7M8RB.mjs → add-D_jNqnfZ.mjs} +8 -5
  24. package/dist/add-D_jNqnfZ.mjs.map +1 -0
  25. package/dist/{bundler-lEBH8ENP.cjs → bundler-1REMhKps.cjs} +5 -5
  26. package/dist/{bundler-lEBH8ENP.cjs.map → bundler-1REMhKps.cjs.map} +1 -1
  27. package/dist/{bundler-CaAKsbcN.mjs → bundler-BMo-JP5s.mjs} +5 -5
  28. package/dist/{bundler-CaAKsbcN.mjs.map → bundler-BMo-JP5s.mjs.map} +1 -1
  29. package/dist/{cli-BV3jzbk0.mjs → cli-7edNFwGk.mjs} +5 -13
  30. package/dist/cli-7edNFwGk.mjs.map +1 -0
  31. package/dist/{cli-DQCBcNlN.cjs → cli-BL8ZHsLQ.cjs} +5 -13
  32. package/dist/cli-BL8ZHsLQ.cjs.map +1 -0
  33. package/dist/{compose-CQK6StuE.mjs → compose-DbJhRQlh.mjs} +24 -11
  34. package/dist/compose-DbJhRQlh.mjs.map +1 -0
  35. package/dist/{compose-CSR0yEJm.cjs → compose-xw86kVYi.cjs} +34 -21
  36. package/dist/compose-xw86kVYi.cjs.map +1 -0
  37. package/dist/{config-BzIfP8a-.d.cts → config-CpjsVxru.d.cts} +3 -3
  38. package/dist/{config-BzIfP8a-.d.cts.map → config-CpjsVxru.d.cts.map} +1 -1
  39. package/dist/{config-DhdzmndX.d.mts → config-DrCAyoH5.d.mts} +3 -3
  40. package/dist/{config-DhdzmndX.d.mts.map → config-DrCAyoH5.d.mts.map} +1 -1
  41. package/dist/config.cjs +1 -1
  42. package/dist/config.d.cts +3 -3
  43. package/dist/config.d.mts +3 -3
  44. package/dist/config.mjs +1 -1
  45. package/dist/{credentials-pAtB70k3.mjs → credentials-BgJ5mS_d.mjs} +91 -181
  46. package/dist/credentials-BgJ5mS_d.mjs.map +1 -0
  47. package/dist/{credentials-BVs7mrtw.cjs → credentials-tr26-KML.cjs} +122 -188
  48. package/dist/credentials-tr26-KML.cjs.map +1 -0
  49. package/dist/deploy/public.cjs +24 -20
  50. package/dist/deploy/public.cjs.map +1 -1
  51. package/dist/deploy/public.d.cts +95 -13
  52. package/dist/deploy/public.d.cts.map +1 -1
  53. package/dist/deploy/public.d.mts +95 -13
  54. package/dist/deploy/public.d.mts.map +1 -1
  55. package/dist/deploy/public.mjs +11 -10
  56. package/dist/deploy/public.mjs.map +1 -1
  57. package/dist/{deploy-BuU117CA.mjs → deploy-BTfmXd3g.mjs} +9 -9
  58. package/dist/deploy-BTfmXd3g.mjs.map +1 -0
  59. package/dist/{deploy-Bw2Mm3x3.cjs → deploy-CtbZj4zN.cjs} +13 -13
  60. package/dist/deploy-CtbZj4zN.cjs.map +1 -0
  61. package/dist/{dokploy-C81J1MVK.cjs → dokploy-TGk3oPwr.cjs} +2 -2
  62. package/dist/{dokploy-C81J1MVK.cjs.map → dokploy-TGk3oPwr.cjs.map} +1 -1
  63. package/dist/{dokploy-DWALWk7u.mjs → dokploy-r69yZaIt.mjs} +2 -2
  64. package/dist/{dokploy-DWALWk7u.mjs.map → dokploy-r69yZaIt.mjs.map} +1 -1
  65. package/dist/{encryption-DpAum8W7.mjs → encryption-C-8Tt5Hh.mjs} +3 -3
  66. package/dist/{encryption-DpAum8W7.mjs.map → encryption-C-8Tt5Hh.mjs.map} +1 -1
  67. package/dist/{encryption-B8h8Tna0.cjs → encryption-CDn7BH5O.cjs} +3 -3
  68. package/dist/{encryption-B8h8Tna0.cjs.map → encryption-CDn7BH5O.cjs.map} +1 -1
  69. package/dist/{engine-B01fjhLt.cjs → engine-Bt5k_UMq.cjs} +33 -23
  70. package/dist/engine-Bt5k_UMq.cjs.map +1 -0
  71. package/dist/{engine-BXCtEhSH.mjs → engine-jAINgiOB.mjs} +28 -18
  72. package/dist/engine-jAINgiOB.mjs.map +1 -0
  73. package/dist/{github-8B68qrLs.mjs → github-CZHAtwPT.mjs} +3 -3
  74. package/dist/{github-8B68qrLs.mjs.map → github-CZHAtwPT.mjs.map} +1 -1
  75. package/dist/{github-Cis9tYur.cjs → github-DFhuJQlp.cjs} +3 -3
  76. package/dist/{github-Cis9tYur.cjs.map → github-DFhuJQlp.cjs.map} +1 -1
  77. package/dist/{index-f77HdqN5.d.mts → index-MnUJuUlj.d.mts} +2 -2
  78. package/dist/{index-D1ODeM9s.d.cts.map → index-MnUJuUlj.d.mts.map} +1 -1
  79. package/dist/{index-D1ODeM9s.d.cts → index-elsLJTUv.d.cts} +2 -2
  80. package/dist/{index-f77HdqN5.d.mts.map → index-elsLJTUv.d.cts.map} +1 -1
  81. package/dist/index.cjs +105 -67
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.mjs +99 -61
  84. package/dist/index.mjs.map +1 -1
  85. package/dist/local-Ciq-bTPr.mjs +224 -0
  86. package/dist/local-Ciq-bTPr.mjs.map +1 -0
  87. package/dist/local-Cq8qdgNX.cjs +241 -0
  88. package/dist/local-Cq8qdgNX.cjs.map +1 -0
  89. package/dist/{migrate-CPWn7A51.cjs → migrate-B16qgYTn.cjs} +3 -3
  90. package/dist/{migrate-CPWn7A51.cjs.map → migrate-B16qgYTn.cjs.map} +1 -1
  91. package/dist/{migrate-BBCp5blp.cjs → migrate-B1rVlwj1.cjs} +3 -3
  92. package/dist/{migrate-BBCp5blp.cjs.map → migrate-B1rVlwj1.cjs.map} +1 -1
  93. package/dist/{migrate-sDq7NApJ.mjs → migrate-Dn7nK6sh.mjs} +3 -3
  94. package/dist/{migrate-sDq7NApJ.mjs.map → migrate-Dn7nK6sh.mjs.map} +1 -1
  95. package/dist/{migrate-BeTWLSeC.mjs → migrate-ggkPVJRC.mjs} +3 -3
  96. package/dist/{migrate-BeTWLSeC.mjs.map → migrate-ggkPVJRC.mjs.map} +1 -1
  97. package/dist/openapi.cjs +1 -1
  98. package/dist/openapi.d.cts +1 -1
  99. package/dist/openapi.d.mts +1 -1
  100. package/dist/openapi.mjs +1 -1
  101. package/dist/reconcile/public.d.cts +1 -1
  102. package/dist/reconcile/public.d.mts +1 -1
  103. package/dist/{resolve-CXbwJ_iu.mjs → resolve-BSke45k6.mjs} +4 -4
  104. package/dist/{resolve-CXbwJ_iu.mjs.map → resolve-BSke45k6.mjs.map} +1 -1
  105. package/dist/{resolve-CztIqBOI.cjs → resolve-BXeXzpmU.cjs} +4 -4
  106. package/dist/{resolve-CztIqBOI.cjs.map → resolve-BXeXzpmU.cjs.map} +1 -1
  107. package/dist/{rollback-ByyFE5lV.mjs → rollback-CEE6dse4.mjs} +6 -6
  108. package/dist/{rollback-ByyFE5lV.mjs.map → rollback-CEE6dse4.mjs.map} +1 -1
  109. package/dist/{rollback-CyIJ4xGJ.cjs → rollback-DFMiBWf0.cjs} +8 -8
  110. package/dist/{rollback-CyIJ4xGJ.cjs.map → rollback-DFMiBWf0.cjs.map} +1 -1
  111. package/dist/{runtime-CNu2C2hB.d.mts → runtime-D48ZKk8_.d.cts} +2 -2
  112. package/dist/{runtime-CNu2C2hB.d.mts.map → runtime-D48ZKk8_.d.cts.map} +1 -1
  113. package/dist/{runtime-DMLgL26v.d.cts → runtime-HabiNBtJ.d.mts} +2 -2
  114. package/dist/{runtime-DMLgL26v.d.cts.map → runtime-HabiNBtJ.d.mts.map} +1 -1
  115. package/dist/{seeds-9C5CkDon.mjs → seeds-BYdrtZsC.mjs} +1525 -53
  116. package/dist/seeds-BYdrtZsC.mjs.map +1 -0
  117. package/dist/{seeds-B_Beuv0o.cjs → seeds-CsI0A_Ef.cjs} +1628 -65
  118. package/dist/seeds-CsI0A_Ef.cjs.map +1 -0
  119. package/dist/{sniffer-DgBkaLAu.mjs → sniffer-B0EU73bj.mjs} +5 -360
  120. package/dist/sniffer-B0EU73bj.mjs.map +1 -0
  121. package/dist/{sniffer-3fA0iExx.cjs → sniffer-DJYupBeK.cjs} +4 -413
  122. package/dist/sniffer-DJYupBeK.cjs.map +1 -0
  123. package/dist/{sst-DRi3H5TB.mjs → sst-D1Qj4sIs.mjs} +3 -3
  124. package/dist/{sst-DRi3H5TB.mjs.map → sst-D1Qj4sIs.mjs.map} +1 -1
  125. package/dist/{sst-hBrKouBy.cjs → sst-DAqUoZKG.cjs} +5 -5
  126. package/dist/{sst-hBrKouBy.cjs.map → sst-DAqUoZKG.cjs.map} +1 -1
  127. package/dist/{stages-CS1sjcRb.cjs → stages-Brn3vcdy.cjs} +2 -2
  128. package/dist/{stages-CS1sjcRb.cjs.map → stages-Brn3vcdy.cjs.map} +1 -1
  129. package/dist/{stages-CSXt7N2b.mjs → stages-DoHHz6pS.mjs} +2 -2
  130. package/dist/{stages-CSXt7N2b.mjs.map → stages-DoHHz6pS.mjs.map} +1 -1
  131. package/dist/target/public.cjs +1 -1
  132. package/dist/target/public.d.cts +2 -2
  133. package/dist/target/public.d.mts +2 -2
  134. package/dist/target/public.mjs +1 -1
  135. package/dist/{terminal-BdvrmkaC.mjs → terminal-BTbZlrFV.mjs} +2 -2
  136. package/dist/{terminal-BdvrmkaC.mjs.map → terminal-BTbZlrFV.mjs.map} +1 -1
  137. package/dist/{terminal-BL5E0xbR.cjs → terminal-COv23heb.cjs} +2 -2
  138. package/dist/{terminal-BL5E0xbR.cjs.map → terminal-COv23heb.cjs.map} +1 -1
  139. package/dist/{types-BZn-8ssD.d.mts → types-0oAyFOfR.d.cts} +48 -49
  140. package/dist/types-0oAyFOfR.d.cts.map +1 -0
  141. package/dist/{types-DiZj6hqp.d.cts → types-BZ01tZs-.d.mts} +47 -50
  142. package/dist/types-BZ01tZs-.d.mts.map +1 -0
  143. package/dist/workspace/index.cjs +1 -1
  144. package/dist/workspace/index.d.cts +2 -2
  145. package/dist/workspace/index.d.mts +2 -2
  146. package/dist/workspace/index.mjs +1 -1
  147. package/dist/{workspace-Bic_R3tz.cjs → workspace-CT0JM3Y8.cjs} +333 -1
  148. package/dist/workspace-CT0JM3Y8.cjs.map +1 -0
  149. package/dist/{workspace-Drz4jsvy.mjs → workspace-D2CYLMCW.mjs} +250 -2
  150. package/dist/workspace-D2CYLMCW.mjs.map +1 -0
  151. package/package.json +15 -15
  152. package/dist/add-CM7RLj89.cjs.map +0 -1
  153. package/dist/add-jpX7M8RB.mjs.map +0 -1
  154. package/dist/cli-BV3jzbk0.mjs.map +0 -1
  155. package/dist/cli-DQCBcNlN.cjs.map +0 -1
  156. package/dist/compose-CQK6StuE.mjs.map +0 -1
  157. package/dist/compose-CSR0yEJm.cjs.map +0 -1
  158. package/dist/credentials-BVs7mrtw.cjs.map +0 -1
  159. package/dist/credentials-pAtB70k3.mjs.map +0 -1
  160. package/dist/deploy-BuU117CA.mjs.map +0 -1
  161. package/dist/deploy-Bw2Mm3x3.cjs.map +0 -1
  162. package/dist/engine-B01fjhLt.cjs.map +0 -1
  163. package/dist/engine-BXCtEhSH.mjs.map +0 -1
  164. package/dist/run-BJLIerMM.mjs +0 -133
  165. package/dist/run-BJLIerMM.mjs.map +0 -1
  166. package/dist/run-fVZ-rLnc.cjs +0 -174
  167. package/dist/run-fVZ-rLnc.cjs.map +0 -1
  168. package/dist/seeds-9C5CkDon.mjs.map +0 -1
  169. package/dist/seeds-B_Beuv0o.cjs.map +0 -1
  170. package/dist/sniffer-3fA0iExx.cjs.map +0 -1
  171. package/dist/sniffer-DgBkaLAu.mjs.map +0 -1
  172. package/dist/types-BZn-8ssD.d.mts.map +0 -1
  173. package/dist/types-DiZj6hqp.d.cts.map +0 -1
  174. package/dist/workspace-Bic_R3tz.cjs.map +0 -1
  175. package/dist/workspace-Drz4jsvy.mjs.map +0 -1
@@ -1,133 +0,0 @@
1
- import { join, resolve } from "node:path";
2
- import { homedir } from "node:os";
3
- import { spawn } from "node:child_process";
4
- //#region src/home.ts
5
- /**
6
- * Where the CLI keeps what belongs to a person rather than a project: stage
7
- * keys and stored provider credentials.
8
- *
9
- * `GKM_HOME` names it, so a CI job, a shared build runner or a test can give
10
- * every run its own instead of reaching into whoever's home directory the
11
- * process happens to have. Unset, it is `~/.gkm`, where it has always been.
12
- */
13
- /** The environment variable that moves the CLI's home. */
14
- const GKM_HOME_ENV = "GKM_HOME";
15
- /** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
16
- function gkmHome(env = process.env) {
17
- const configured = env[GKM_HOME_ENV];
18
- return configured ? resolve(configured) : join(homedir(), ".gkm");
19
- }
20
- //#endregion
21
- //#region src/run.ts
22
- /**
23
- * Start a program with an argument array, never a shell string.
24
- *
25
- * `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the
26
- * workspace — image refs, tags, build args, package names — to `docker` and
27
- * `turbo`. Joined into a string and handed to a shell, a package named
28
- * `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which
29
- * matters most where the CLI builds a repository it didn't write: a CI job for a
30
- * fork, a shared build runner. Here every value reaches the program as one
31
- * `argv` element, whatever it contains.
32
- */
33
- /** Long enough for a cold image build; short enough that a hung one ends. */
34
- const DEFAULT_TIMEOUT_MS = 18e5;
35
- /** How long a timed-out child has to exit on SIGTERM before it is killed. */
36
- const KILL_GRACE_MS = 5e3;
37
- /** The command line as a person would read it — for messages, never to run. */
38
- function display(command, args) {
39
- return [command, ...args].join(" ");
40
- }
41
- /** The program ran and exited unsuccessfully; its own output said why. */
42
- var CommandFailed = class extends Error {
43
- command;
44
- args;
45
- exitCode;
46
- signal;
47
- constructor(command, args, exitCode, signal) {
48
- super(`\`${display(command, args)}\` ${exitCode === null ? `was stopped by ${signal ?? "a signal"}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`);
49
- this.command = command;
50
- this.args = args;
51
- this.exitCode = exitCode;
52
- this.signal = signal;
53
- this.name = "CommandFailed";
54
- }
55
- };
56
- /** The program ran past its timeout and was killed. */
57
- var CommandTimedOut = class extends Error {
58
- command;
59
- args;
60
- timeoutMs;
61
- constructor(command, args, timeoutMs) {
62
- super(`\`${display(command, args)}\` was still running after ${Math.round(timeoutMs / 1e3)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`);
63
- this.command = command;
64
- this.args = args;
65
- this.timeoutMs = timeoutMs;
66
- this.name = "CommandTimedOut";
67
- }
68
- };
69
- /**
70
- * Run `command` with `args`, resolving when it exits 0.
71
- *
72
- * Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}
73
- * once `timeoutMs` passes (after the child is gone), and with the spawn error
74
- * itself when the program cannot be started at all — `ENOENT` already names it.
75
- */
76
- async function run(command, args, options = {}) {
77
- await spawnChild(command, args, options, false);
78
- }
79
- /**
80
- * {@link run}, resolving with what the program wrote to stdout — for a value
81
- * the CLI reads back, such as the digest `docker inspect` reports. stderr still
82
- * reaches the terminal, so a failure explains itself the same way.
83
- */
84
- function runOutput(command, args, options = {}) {
85
- return spawnChild(command, args, options, true);
86
- }
87
- function spawnChild(command, args, options, capture) {
88
- const { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;
89
- return new Promise((resolve, reject) => {
90
- const child = spawn(command, [...args], {
91
- stdio: "inherit",
92
- ...spawnOptions,
93
- ...capture ? { stdio: [
94
- "ignore",
95
- "pipe",
96
- "inherit"
97
- ] } : {},
98
- shell: false
99
- });
100
- let stdout = "";
101
- child.stdout?.on("data", (chunk) => {
102
- stdout += chunk.toString();
103
- });
104
- let timedOut = false;
105
- let killer;
106
- const timer = setTimeout(() => {
107
- timedOut = true;
108
- child.kill("SIGTERM");
109
- killer = setTimeout(() => child.kill("SIGKILL"), KILL_GRACE_MS);
110
- killer.unref?.();
111
- }, timeoutMs);
112
- timer.unref?.();
113
- const settle = () => {
114
- clearTimeout(timer);
115
- if (killer) clearTimeout(killer);
116
- };
117
- child.on("error", (error) => {
118
- settle();
119
- reject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);
120
- });
121
- child.on("close", (code, signal) => {
122
- settle();
123
- if (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);
124
- else if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));
125
- else if (code === 0) resolve(stdout);
126
- else reject(new CommandFailed(command, args, code, signal));
127
- });
128
- });
129
- }
130
- //#endregion
131
- export { runOutput as a, run as i, CommandTimedOut as n, GKM_HOME_ENV as o, DEFAULT_TIMEOUT_MS as r, gkmHome as s, CommandFailed as t };
132
-
133
- //# sourceMappingURL=run-BJLIerMM.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-BJLIerMM.mjs","names":[],"sources":["../src/home.ts","../src/run.ts"],"sourcesContent":["/**\n * Where the CLI keeps what belongs to a person rather than a project: stage\n * keys and stored provider credentials.\n *\n * `GKM_HOME` names it, so a CI job, a shared build runner or a test can give\n * every run its own instead of reaching into whoever's home directory the\n * process happens to have. Unset, it is `~/.gkm`, where it has always been.\n */\n\nimport { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/** The environment variable that moves the CLI's home. */\nexport const GKM_HOME_ENV = 'GKM_HOME';\n\n/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */\nexport function gkmHome(env: NodeJS.ProcessEnv = process.env): string {\n\tconst configured = env[GKM_HOME_ENV];\n\treturn configured ? resolve(configured) : join(homedir(), '.gkm');\n}\n","/**\n * Start a program with an argument array, never a shell string.\n *\n * `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the\n * workspace — image refs, tags, build args, package names — to `docker` and\n * `turbo`. Joined into a string and handed to a shell, a package named\n * `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which\n * matters most where the CLI builds a repository it didn't write: a CI job for a\n * fork, a shared build runner. Here every value reaches the program as one\n * `argv` element, whatever it contains.\n */\n\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\n/** Long enough for a cold image build; short enough that a hung one ends. */\nexport const DEFAULT_TIMEOUT_MS = 30 * 60_000;\n\n/** How long a timed-out child has to exit on SIGTERM before it is killed. */\nconst KILL_GRACE_MS = 5_000;\n\nexport interface RunOptions {\n\tcwd?: string;\n\tenv?: NodeJS.ProcessEnv;\n\tstdio?: SpawnOptions['stdio'];\n\t/** Kill the child after this long. Defaults to {@link DEFAULT_TIMEOUT_MS}. */\n\ttimeoutMs?: number;\n\t/**\n\t * Kills the child when aborted, and rejects with the signal's reason — the\n\t * same as a stopped deploy's other calls.\n\t */\n\tsignal?: AbortSignal;\n}\n\n/** The command line as a person would read it — for messages, never to run. */\nfunction display(command: string, args: readonly string[]): string {\n\treturn [command, ...args].join(' ');\n}\n\n/** The program ran and exited unsuccessfully; its own output said why. */\nexport class CommandFailed extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly exitCode: number | null,\n\t\treadonly signal: NodeJS.Signals | null,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` ${exitCode === null ? `was stopped by ${signal ?? 'a signal'}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`,\n\t\t);\n\t\tthis.name = 'CommandFailed';\n\t}\n}\n\n/** The program ran past its timeout and was killed. */\nexport class CommandTimedOut extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly timeoutMs: number,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` was still running after ${Math.round(timeoutMs / 1000)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`,\n\t\t);\n\t\tthis.name = 'CommandTimedOut';\n\t}\n}\n\n/**\n * Run `command` with `args`, resolving when it exits 0.\n *\n * Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}\n * once `timeoutMs` passes (after the child is gone), and with the spawn error\n * itself when the program cannot be started at all — `ENOENT` already names it.\n */\nexport async function run(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions = {},\n): Promise<void> {\n\tawait spawnChild(command, args, options, false);\n}\n\n/**\n * {@link run}, resolving with what the program wrote to stdout — for a value\n * the CLI reads back, such as the digest `docker inspect` reports. stderr still\n * reaches the terminal, so a failure explains itself the same way.\n */\nexport function runOutput(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: Omit<RunOptions, 'stdio'> = {},\n): Promise<string> {\n\treturn spawnChild(command, args, options, true);\n}\n\nfunction spawnChild(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions,\n\tcapture: boolean,\n): Promise<string> {\n\tconst { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;\n\n\treturn new Promise<string>((resolve, reject) => {\n\t\tconst child = spawn(command, [...args], {\n\t\t\tstdio: 'inherit',\n\t\t\t...spawnOptions,\n\t\t\t...(capture ? { stdio: ['ignore', 'pipe', 'inherit'] } : {}),\n\t\t\tshell: false,\n\t\t});\n\n\t\tlet stdout = '';\n\t\tchild.stdout?.on('data', (chunk: Buffer) => {\n\t\t\tstdout += chunk.toString();\n\t\t});\n\n\t\tlet timedOut = false;\n\t\tlet killer: NodeJS.Timeout | undefined;\n\t\tconst timer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tchild.kill('SIGTERM');\n\t\t\t// A child that ignores SIGTERM would hold the deploy open forever.\n\t\t\tkiller = setTimeout(() => child.kill('SIGKILL'), KILL_GRACE_MS);\n\t\t\tkiller.unref?.();\n\t\t}, timeoutMs);\n\t\ttimer.unref?.();\n\n\t\tconst settle = () => {\n\t\t\tclearTimeout(timer);\n\t\t\tif (killer) clearTimeout(killer);\n\t\t};\n\n\t\tchild.on('error', (error) => {\n\t\t\tsettle();\n\t\t\t// Node reports an abort as its own `AbortError`; the caller asked\n\t\t\t// with a reason, and that is what it should get back.\n\t\t\treject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);\n\t\t});\n\n\t\tchild.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n\t\t\tsettle();\n\t\t\tif (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);\n\t\t\telse if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));\n\t\t\telse if (code === 0) resolve(stdout);\n\t\t\telse reject(new CommandFailed(command, args, code, signal));\n\t\t});\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,eAAe;;AAG5B,SAAgB,QAAQ,MAAyB,QAAQ,KAAa;CACrE,MAAM,aAAa,IAAI;CACvB,OAAO,aAAa,QAAQ,UAAU,IAAI,KAAK,QAAQ,GAAG,MAAM;AACjE;;;;;;;;;;;;;;;ACJA,MAAa,qBAAqB;;AAGlC,MAAM,gBAAgB;;AAgBtB,SAAS,QAAQ,SAAiB,MAAiC;CAClE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,KAAK,GAAG;AACnC;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CAE9B;CACA;CACA;CACA;CAJV,YACC,SACA,MACA,UACA,QACC;EACD,MACC,KAAK,QAAQ,SAAS,IAAI,EAAE,KAAK,aAAa,OAAO,kBAAkB,UAAU,eAAe,oBAAoB,WAAW,6DAChI;EAPS,KAAA,UAAA;EACA,KAAA,OAAA;EACA,KAAA,WAAA;EACA,KAAA,SAAA;EAKT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,kBAAb,cAAqC,MAAM;CAEhC;CACA;CACA;CAHV,YACC,SACA,MACA,WACC;EACD,MACC,KAAK,QAAQ,SAAS,IAAI,EAAE,6BAA6B,KAAK,MAAM,YAAY,GAAI,EAAE,8GACvF;EANS,KAAA,UAAA;EACA,KAAA,OAAA;EACA,KAAA,YAAA;EAKT,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,eAAsB,IACrB,SACA,MACA,UAAsB,CAAC,GACP;CAChB,MAAM,WAAW,SAAS,MAAM,SAAS,KAAK;AAC/C;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child_process = require("node:child_process");
4
- //#region src/home.ts
5
- /**
6
- * Where the CLI keeps what belongs to a person rather than a project: stage
7
- * keys and stored provider credentials.
8
- *
9
- * `GKM_HOME` names it, so a CI job, a shared build runner or a test can give
10
- * every run its own instead of reaching into whoever's home directory the
11
- * process happens to have. Unset, it is `~/.gkm`, where it has always been.
12
- */
13
- /** The environment variable that moves the CLI's home. */
14
- const GKM_HOME_ENV = "GKM_HOME";
15
- /** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
16
- function gkmHome(env = process.env) {
17
- const configured = env[GKM_HOME_ENV];
18
- return configured ? (0, node_path.resolve)(configured) : (0, node_path.join)((0, node_os.homedir)(), ".gkm");
19
- }
20
- //#endregion
21
- //#region src/run.ts
22
- /**
23
- * Start a program with an argument array, never a shell string.
24
- *
25
- * `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the
26
- * workspace — image refs, tags, build args, package names — to `docker` and
27
- * `turbo`. Joined into a string and handed to a shell, a package named
28
- * `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which
29
- * matters most where the CLI builds a repository it didn't write: a CI job for a
30
- * fork, a shared build runner. Here every value reaches the program as one
31
- * `argv` element, whatever it contains.
32
- */
33
- /** Long enough for a cold image build; short enough that a hung one ends. */
34
- const DEFAULT_TIMEOUT_MS = 18e5;
35
- /** How long a timed-out child has to exit on SIGTERM before it is killed. */
36
- const KILL_GRACE_MS = 5e3;
37
- /** The command line as a person would read it — for messages, never to run. */
38
- function display(command, args) {
39
- return [command, ...args].join(" ");
40
- }
41
- /** The program ran and exited unsuccessfully; its own output said why. */
42
- var CommandFailed = class extends Error {
43
- command;
44
- args;
45
- exitCode;
46
- signal;
47
- constructor(command, args, exitCode, signal) {
48
- super(`\`${display(command, args)}\` ${exitCode === null ? `was stopped by ${signal ?? "a signal"}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`);
49
- this.command = command;
50
- this.args = args;
51
- this.exitCode = exitCode;
52
- this.signal = signal;
53
- this.name = "CommandFailed";
54
- }
55
- };
56
- /** The program ran past its timeout and was killed. */
57
- var CommandTimedOut = class extends Error {
58
- command;
59
- args;
60
- timeoutMs;
61
- constructor(command, args, timeoutMs) {
62
- super(`\`${display(command, args)}\` was still running after ${Math.round(timeoutMs / 1e3)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`);
63
- this.command = command;
64
- this.args = args;
65
- this.timeoutMs = timeoutMs;
66
- this.name = "CommandTimedOut";
67
- }
68
- };
69
- /**
70
- * Run `command` with `args`, resolving when it exits 0.
71
- *
72
- * Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}
73
- * once `timeoutMs` passes (after the child is gone), and with the spawn error
74
- * itself when the program cannot be started at all — `ENOENT` already names it.
75
- */
76
- async function run(command, args, options = {}) {
77
- await spawnChild(command, args, options, false);
78
- }
79
- /**
80
- * {@link run}, resolving with what the program wrote to stdout — for a value
81
- * the CLI reads back, such as the digest `docker inspect` reports. stderr still
82
- * reaches the terminal, so a failure explains itself the same way.
83
- */
84
- function runOutput(command, args, options = {}) {
85
- return spawnChild(command, args, options, true);
86
- }
87
- function spawnChild(command, args, options, capture) {
88
- const { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;
89
- return new Promise((resolve, reject) => {
90
- const child = (0, node_child_process.spawn)(command, [...args], {
91
- stdio: "inherit",
92
- ...spawnOptions,
93
- ...capture ? { stdio: [
94
- "ignore",
95
- "pipe",
96
- "inherit"
97
- ] } : {},
98
- shell: false
99
- });
100
- let stdout = "";
101
- child.stdout?.on("data", (chunk) => {
102
- stdout += chunk.toString();
103
- });
104
- let timedOut = false;
105
- let killer;
106
- const timer = setTimeout(() => {
107
- timedOut = true;
108
- child.kill("SIGTERM");
109
- killer = setTimeout(() => child.kill("SIGKILL"), KILL_GRACE_MS);
110
- killer.unref?.();
111
- }, timeoutMs);
112
- timer.unref?.();
113
- const settle = () => {
114
- clearTimeout(timer);
115
- if (killer) clearTimeout(killer);
116
- };
117
- child.on("error", (error) => {
118
- settle();
119
- reject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);
120
- });
121
- child.on("close", (code, signal) => {
122
- settle();
123
- if (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);
124
- else if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));
125
- else if (code === 0) resolve(stdout);
126
- else reject(new CommandFailed(command, args, code, signal));
127
- });
128
- });
129
- }
130
- //#endregion
131
- Object.defineProperty(exports, "CommandFailed", {
132
- enumerable: true,
133
- get: function() {
134
- return CommandFailed;
135
- }
136
- });
137
- Object.defineProperty(exports, "CommandTimedOut", {
138
- enumerable: true,
139
- get: function() {
140
- return CommandTimedOut;
141
- }
142
- });
143
- Object.defineProperty(exports, "DEFAULT_TIMEOUT_MS", {
144
- enumerable: true,
145
- get: function() {
146
- return DEFAULT_TIMEOUT_MS;
147
- }
148
- });
149
- Object.defineProperty(exports, "GKM_HOME_ENV", {
150
- enumerable: true,
151
- get: function() {
152
- return GKM_HOME_ENV;
153
- }
154
- });
155
- Object.defineProperty(exports, "gkmHome", {
156
- enumerable: true,
157
- get: function() {
158
- return gkmHome;
159
- }
160
- });
161
- Object.defineProperty(exports, "run", {
162
- enumerable: true,
163
- get: function() {
164
- return run;
165
- }
166
- });
167
- Object.defineProperty(exports, "runOutput", {
168
- enumerable: true,
169
- get: function() {
170
- return runOutput;
171
- }
172
- });
173
-
174
- //# sourceMappingURL=run-fVZ-rLnc.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-fVZ-rLnc.cjs","names":["resolve","join","homedir","spawn"],"sources":["../src/home.ts","../src/run.ts"],"sourcesContent":["/**\n * Where the CLI keeps what belongs to a person rather than a project: stage\n * keys and stored provider credentials.\n *\n * `GKM_HOME` names it, so a CI job, a shared build runner or a test can give\n * every run its own instead of reaching into whoever's home directory the\n * process happens to have. Unset, it is `~/.gkm`, where it has always been.\n */\n\nimport { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/** The environment variable that moves the CLI's home. */\nexport const GKM_HOME_ENV = 'GKM_HOME';\n\n/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */\nexport function gkmHome(env: NodeJS.ProcessEnv = process.env): string {\n\tconst configured = env[GKM_HOME_ENV];\n\treturn configured ? resolve(configured) : join(homedir(), '.gkm');\n}\n","/**\n * Start a program with an argument array, never a shell string.\n *\n * `gkm build`, `gkm docker` and `gkm deploy` pass values that come from the\n * workspace — image refs, tags, build args, package names — to `docker` and\n * `turbo`. Joined into a string and handed to a shell, a package named\n * `x;curl …|sh` or a tag holding `$(…)` became part of the command line, which\n * matters most where the CLI builds a repository it didn't write: a CI job for a\n * fork, a shared build runner. Here every value reaches the program as one\n * `argv` element, whatever it contains.\n */\n\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\n/** Long enough for a cold image build; short enough that a hung one ends. */\nexport const DEFAULT_TIMEOUT_MS = 30 * 60_000;\n\n/** How long a timed-out child has to exit on SIGTERM before it is killed. */\nconst KILL_GRACE_MS = 5_000;\n\nexport interface RunOptions {\n\tcwd?: string;\n\tenv?: NodeJS.ProcessEnv;\n\tstdio?: SpawnOptions['stdio'];\n\t/** Kill the child after this long. Defaults to {@link DEFAULT_TIMEOUT_MS}. */\n\ttimeoutMs?: number;\n\t/**\n\t * Kills the child when aborted, and rejects with the signal's reason — the\n\t * same as a stopped deploy's other calls.\n\t */\n\tsignal?: AbortSignal;\n}\n\n/** The command line as a person would read it — for messages, never to run. */\nfunction display(command: string, args: readonly string[]): string {\n\treturn [command, ...args].join(' ');\n}\n\n/** The program ran and exited unsuccessfully; its own output said why. */\nexport class CommandFailed extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly exitCode: number | null,\n\t\treadonly signal: NodeJS.Signals | null,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` ${exitCode === null ? `was stopped by ${signal ?? 'a signal'}` : `exited with code ${exitCode}`}. Its output above says why; run it by hand to see it again.`,\n\t\t);\n\t\tthis.name = 'CommandFailed';\n\t}\n}\n\n/** The program ran past its timeout and was killed. */\nexport class CommandTimedOut extends Error {\n\tconstructor(\n\t\treadonly command: string,\n\t\treadonly args: readonly string[],\n\t\treadonly timeoutMs: number,\n\t) {\n\t\tsuper(\n\t\t\t`\\`${display(command, args)}\\` was still running after ${Math.round(timeoutMs / 1000)}s and was stopped. Check what it was waiting on — a registry, the Docker daemon, a prompt — and run it again.`,\n\t\t);\n\t\tthis.name = 'CommandTimedOut';\n\t}\n}\n\n/**\n * Run `command` with `args`, resolving when it exits 0.\n *\n * Rejects with {@link CommandFailed} on any other exit, {@link CommandTimedOut}\n * once `timeoutMs` passes (after the child is gone), and with the spawn error\n * itself when the program cannot be started at all — `ENOENT` already names it.\n */\nexport async function run(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions = {},\n): Promise<void> {\n\tawait spawnChild(command, args, options, false);\n}\n\n/**\n * {@link run}, resolving with what the program wrote to stdout — for a value\n * the CLI reads back, such as the digest `docker inspect` reports. stderr still\n * reaches the terminal, so a failure explains itself the same way.\n */\nexport function runOutput(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: Omit<RunOptions, 'stdio'> = {},\n): Promise<string> {\n\treturn spawnChild(command, args, options, true);\n}\n\nfunction spawnChild(\n\tcommand: string,\n\targs: readonly string[],\n\toptions: RunOptions,\n\tcapture: boolean,\n): Promise<string> {\n\tconst { timeoutMs = DEFAULT_TIMEOUT_MS, ...spawnOptions } = options;\n\n\treturn new Promise<string>((resolve, reject) => {\n\t\tconst child = spawn(command, [...args], {\n\t\t\tstdio: 'inherit',\n\t\t\t...spawnOptions,\n\t\t\t...(capture ? { stdio: ['ignore', 'pipe', 'inherit'] } : {}),\n\t\t\tshell: false,\n\t\t});\n\n\t\tlet stdout = '';\n\t\tchild.stdout?.on('data', (chunk: Buffer) => {\n\t\t\tstdout += chunk.toString();\n\t\t});\n\n\t\tlet timedOut = false;\n\t\tlet killer: NodeJS.Timeout | undefined;\n\t\tconst timer = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tchild.kill('SIGTERM');\n\t\t\t// A child that ignores SIGTERM would hold the deploy open forever.\n\t\t\tkiller = setTimeout(() => child.kill('SIGKILL'), KILL_GRACE_MS);\n\t\t\tkiller.unref?.();\n\t\t}, timeoutMs);\n\t\ttimer.unref?.();\n\n\t\tconst settle = () => {\n\t\t\tclearTimeout(timer);\n\t\t\tif (killer) clearTimeout(killer);\n\t\t};\n\n\t\tchild.on('error', (error) => {\n\t\t\tsettle();\n\t\t\t// Node reports an abort as its own `AbortError`; the caller asked\n\t\t\t// with a reason, and that is what it should get back.\n\t\t\treject(spawnOptions.signal?.aborted ? spawnOptions.signal.reason : error);\n\t\t});\n\n\t\tchild.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n\t\t\tsettle();\n\t\t\tif (spawnOptions.signal?.aborted) reject(spawnOptions.signal.reason);\n\t\t\telse if (timedOut) reject(new CommandTimedOut(command, args, timeoutMs));\n\t\t\telse if (code === 0) resolve(stdout);\n\t\t\telse reject(new CommandFailed(command, args, code, signal));\n\t\t});\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,eAAe;;AAG5B,SAAgB,QAAQ,MAAyB,QAAQ,KAAa;CACrE,MAAM,aAAa,IAAI;CACvB,OAAO,cAAA,GAAaA,UAAAA,QAAAA,CAAQ,UAAU,KAAA,GAAIC,UAAAA,KAAAA,EAAAA,GAAKC,QAAAA,QAAAA,CAAQ,GAAG,MAAM;AACjE;;;;;;;;;;;;;;;ACJA,MAAa,qBAAqB;;AAGlC,MAAM,gBAAgB;;AAgBtB,SAAS,QAAQ,SAAiB,MAAiC;CAClE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,KAAK,GAAG;AACnC;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CAE9B;CACA;CACA;CACA;CAJV,YACC,SACA,MACA,UACA,QACC;EACD,MACC,KAAK,QAAQ,SAAS,I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