@geekmidas/cli 10.0.0-alpha.61 → 10.0.0-alpha.63

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 (202) hide show
  1. package/README.md +2 -0
  2. package/dist/{HostingerProvider-DI_Pr2VE.mjs → HostingerProvider-DBBwpDjn.mjs} +2 -2
  3. package/dist/{HostingerProvider-DI_Pr2VE.mjs.map → HostingerProvider-DBBwpDjn.mjs.map} +1 -1
  4. package/dist/{HostingerProvider-CgDaD8VR.cjs → HostingerProvider-mJ7YruxH.cjs} +2 -2
  5. package/dist/{HostingerProvider-CgDaD8VR.cjs.map → HostingerProvider-mJ7YruxH.cjs.map} +1 -1
  6. package/dist/{LegacyStateStore-JbBVFp_2.cjs → LegacyStateStore-CP7SZwTP.cjs} +2 -2
  7. package/dist/{LegacyStateStore-JbBVFp_2.cjs.map → LegacyStateStore-CP7SZwTP.cjs.map} +1 -1
  8. package/dist/{LegacyStateStore-C7vFAxbu.mjs → LegacyStateStore-Q3GmKOdw.mjs} +2 -2
  9. package/dist/{LegacyStateStore-C7vFAxbu.mjs.map → LegacyStateStore-Q3GmKOdw.mjs.map} +1 -1
  10. package/dist/{LocalStateStore-DfUwQsL8.mjs → LocalStateStore-BGIXcrvX.mjs} +2 -2
  11. package/dist/{LocalStateStore-DfUwQsL8.mjs.map → LocalStateStore-BGIXcrvX.mjs.map} +1 -1
  12. package/dist/{LocalStateStore-DHj_-CQB.cjs → LocalStateStore-sS8mvLeq.cjs} +2 -2
  13. package/dist/{LocalStateStore-DHj_-CQB.cjs.map → LocalStateStore-sS8mvLeq.cjs.map} +1 -1
  14. package/dist/{OpenApiTsGenerator-BSrgw7B0.cjs → OpenApiTsGenerator-CjHWFRDd.cjs} +2 -2
  15. package/dist/{OpenApiTsGenerator-BSrgw7B0.cjs.map → OpenApiTsGenerator-CjHWFRDd.cjs.map} +1 -1
  16. package/dist/{OpenApiTsGenerator-q5B0z8Xg.mjs → OpenApiTsGenerator-CnAwhGxi.mjs} +2 -2
  17. package/dist/{OpenApiTsGenerator-q5B0z8Xg.mjs.map → OpenApiTsGenerator-CnAwhGxi.mjs.map} +1 -1
  18. package/dist/{S3StateStore-xqnpUrzy.cjs → S3StateStore-6jqITH2F.cjs} +2 -2
  19. package/dist/{S3StateStore-xqnpUrzy.cjs.map → S3StateStore-6jqITH2F.cjs.map} +1 -1
  20. package/dist/{S3StateStore-Dq6hHtzY.mjs → S3StateStore-D7l_lWJ3.mjs} +2 -2
  21. package/dist/{S3StateStore-Dq6hHtzY.mjs.map → S3StateStore-D7l_lWJ3.mjs.map} +1 -1
  22. package/dist/{SSMStateStore-5dBRwVlJ.cjs → SSMStateStore-B__F7IJa.cjs} +2 -2
  23. package/dist/{SSMStateStore-5dBRwVlJ.cjs.map → SSMStateStore-B__F7IJa.cjs.map} +1 -1
  24. package/dist/{SSMStateStore-SUmvAbLi.mjs → SSMStateStore-CAQDVpoc.mjs} +2 -2
  25. package/dist/{SSMStateStore-SUmvAbLi.mjs.map → SSMStateStore-CAQDVpoc.mjs.map} +1 -1
  26. package/dist/{bundler-DXATpO1T.cjs → bundler-DLfOn0ls.cjs} +3 -3
  27. package/dist/{bundler-DXATpO1T.cjs.map → bundler-DLfOn0ls.cjs.map} +1 -1
  28. package/dist/{bundler-B5VsKW-_.mjs → bundler-DyWI41Iy.mjs} +2 -2
  29. package/dist/{bundler-B5VsKW-_.mjs.map → bundler-DyWI41Iy.mjs.map} +1 -1
  30. package/dist/{cli-DQdrVkj2.cjs → cli-D-ZM-X2s.cjs} +12 -16
  31. package/dist/cli-D-ZM-X2s.cjs.map +1 -0
  32. package/dist/{cli-DEA_J3Sa.mjs → cli-PkVF28LM.mjs} +10 -14
  33. package/dist/cli-PkVF28LM.mjs.map +1 -0
  34. package/dist/{config-DXnkCEq0.cjs → config-BEJYKd4s.cjs} +132 -18
  35. package/dist/config-BEJYKd4s.cjs.map +1 -0
  36. package/dist/config-C2BUosLm.d.mts +256 -0
  37. package/dist/config-C2BUosLm.d.mts.map +1 -0
  38. package/dist/config-CemHVcIr.d.cts +256 -0
  39. package/dist/config-CemHVcIr.d.cts.map +1 -0
  40. package/dist/{config-C5-EEdmr.mjs → config-LKKCVCnC.mjs} +109 -19
  41. package/dist/config-LKKCVCnC.mjs.map +1 -0
  42. package/dist/config.cjs +6 -2
  43. package/dist/config.d.cts +4 -211
  44. package/dist/config.d.mts +4 -211
  45. package/dist/config.mjs +3 -3
  46. package/dist/define-CHBIEc5j.mjs +94 -0
  47. package/dist/define-CHBIEc5j.mjs.map +1 -0
  48. package/dist/define-Cv_QvDrg.cjs +141 -0
  49. package/dist/define-Cv_QvDrg.cjs.map +1 -0
  50. package/dist/deploy/public.cjs +174 -13
  51. package/dist/deploy/public.cjs.map +1 -0
  52. package/dist/deploy/public.d.cts +200 -292
  53. package/dist/deploy/public.d.cts.map +1 -1
  54. package/dist/deploy/public.d.mts +200 -292
  55. package/dist/deploy/public.d.mts.map +1 -1
  56. package/dist/deploy/public.mjs +136 -3
  57. package/dist/deploy/public.mjs.map +1 -0
  58. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  59. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  60. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  61. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  62. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  63. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  64. package/dist/{deploy-BbJdgQ2b.cjs → deploy-ABBI0lf1.cjs} +169 -561
  65. package/dist/deploy-ABBI0lf1.cjs.map +1 -0
  66. package/dist/deploy-BiMrP9i7.cjs +140 -0
  67. package/dist/deploy-BiMrP9i7.cjs.map +1 -0
  68. package/dist/{deploy-BJcLmVTc.mjs → deploy-CG8bfFij.mjs} +152 -532
  69. package/dist/deploy-CG8bfFij.mjs.map +1 -0
  70. package/dist/deploy-CGW-QY9D.mjs +135 -0
  71. package/dist/deploy-CGW-QY9D.mjs.map +1 -0
  72. package/dist/discover-B6yPpvRV.d.mts +99 -0
  73. package/dist/discover-B6yPpvRV.d.mts.map +1 -0
  74. package/dist/discover-B_IkPukx.d.cts +99 -0
  75. package/dist/discover-B_IkPukx.d.cts.map +1 -0
  76. package/dist/discover-BaT6bpnA.mjs +614 -0
  77. package/dist/discover-BaT6bpnA.mjs.map +1 -0
  78. package/dist/discover-C_6COHEv.cjs +729 -0
  79. package/dist/discover-C_6COHEv.cjs.map +1 -0
  80. package/dist/dokploy-CwdmlyQL.mjs +32 -0
  81. package/dist/dokploy-CwdmlyQL.mjs.map +1 -0
  82. package/dist/dokploy-QJxMhxdf.cjs +32 -0
  83. package/dist/dokploy-QJxMhxdf.cjs.map +1 -0
  84. package/dist/{encryption-DaA9gRXr.mjs → encryption-CbQG_ayW.mjs} +4 -4
  85. package/dist/{encryption-DaA9gRXr.mjs.map → encryption-CbQG_ayW.mjs.map} +1 -1
  86. package/dist/{encryption-ojzUo7-z.cjs → encryption-DXw3jj0c.cjs} +4 -4
  87. package/dist/{encryption-ojzUo7-z.cjs.map → encryption-DXw3jj0c.cjs.map} +1 -1
  88. package/dist/fakes-C9RiT6XG.mjs.map +1 -1
  89. package/dist/fakes-zW-jNAbQ.cjs.map +1 -1
  90. package/dist/{github-Cq57poPj.cjs → github-BH_mETav.cjs} +3 -3
  91. package/dist/{github-Cq57poPj.cjs.map → github-BH_mETav.cjs.map} +1 -1
  92. package/dist/{github-DmCj2u95.mjs → github-ciwbIwVa.mjs} +3 -3
  93. package/dist/{github-DmCj2u95.mjs.map → github-ciwbIwVa.mjs.map} +1 -1
  94. package/dist/{index-UiWCaGzU.d.cts → index-BtXDZQuF.d.cts} +2 -2
  95. package/dist/{index-Da1-oa9W.d.mts.map → index-BtXDZQuF.d.cts.map} +1 -1
  96. package/dist/{index-Da1-oa9W.d.mts → index-DrKzpHl-.d.mts} +2 -2
  97. package/dist/{index-UiWCaGzU.d.cts.map → index-DrKzpHl-.d.mts.map} +1 -1
  98. package/dist/index.cjs +60 -52
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.mjs +57 -49
  101. package/dist/index.mjs.map +1 -1
  102. package/dist/{migrate-BScRpCEx.cjs → migrate-6oa9y_f2.cjs} +5 -5
  103. package/dist/{migrate-BScRpCEx.cjs.map → migrate-6oa9y_f2.cjs.map} +1 -1
  104. package/dist/{migrate-5_J5JySj.mjs → migrate-ImBKTBcW.mjs} +5 -5
  105. package/dist/{migrate-5_J5JySj.mjs.map → migrate-ImBKTBcW.mjs.map} +1 -1
  106. package/dist/openapi.cjs +3 -3
  107. package/dist/openapi.d.cts +1 -1
  108. package/dist/openapi.d.mts +1 -1
  109. package/dist/openapi.mjs +3 -3
  110. package/dist/{ready-XlNx-Gbo.cjs → ready-BiG0rt4h.cjs} +3 -3
  111. package/dist/{ready-XlNx-Gbo.cjs.map → ready-BiG0rt4h.cjs.map} +1 -1
  112. package/dist/{ready-DQIy21W5.mjs → ready-Bpdnn2ON.mjs} +3 -3
  113. package/dist/{ready-DQIy21W5.mjs.map → ready-Bpdnn2ON.mjs.map} +1 -1
  114. package/dist/reconcile/public.cjs +1 -1
  115. package/dist/reconcile/public.d.cts +4 -77
  116. package/dist/reconcile/public.d.cts.map +1 -1
  117. package/dist/reconcile/public.d.mts +4 -77
  118. package/dist/reconcile/public.d.mts.map +1 -1
  119. package/dist/reconcile/public.mjs +1 -1
  120. package/dist/resolve-B1T0hUaR.mjs +170 -0
  121. package/dist/resolve-B1T0hUaR.mjs.map +1 -0
  122. package/dist/resolve-xytBTtG4.cjs +217 -0
  123. package/dist/resolve-xytBTtG4.cjs.map +1 -0
  124. package/dist/runtime-CMwtq0AL.cjs +163 -0
  125. package/dist/runtime-CMwtq0AL.cjs.map +1 -0
  126. package/dist/runtime-CXPlkZzs.d.mts +90 -0
  127. package/dist/runtime-CXPlkZzs.d.mts.map +1 -0
  128. package/dist/runtime-DbakJS8u.mjs +134 -0
  129. package/dist/runtime-DbakJS8u.mjs.map +1 -0
  130. package/dist/runtime-Dn_n-29S.d.cts +90 -0
  131. package/dist/runtime-Dn_n-29S.d.cts.map +1 -0
  132. package/dist/sandbox/config-worker.cjs +43 -0
  133. package/dist/sandbox/config-worker.cjs.map +1 -0
  134. package/dist/sandbox/config-worker.d.cts +1 -0
  135. package/dist/sandbox/config-worker.d.mts +1 -0
  136. package/dist/sandbox/config-worker.mjs +44 -0
  137. package/dist/sandbox/config-worker.mjs.map +1 -0
  138. package/dist/sandbox/discover-worker.cjs +44 -0
  139. package/dist/sandbox/discover-worker.cjs.map +1 -0
  140. package/dist/sandbox/discover-worker.d.cts +1 -0
  141. package/dist/sandbox/discover-worker.d.mts +1 -0
  142. package/dist/sandbox/discover-worker.mjs +45 -0
  143. package/dist/sandbox/discover-worker.mjs.map +1 -0
  144. package/dist/sandbox-M8UnLhXE.d.cts +126 -0
  145. package/dist/sandbox-M8UnLhXE.d.cts.map +1 -0
  146. package/dist/sandbox-M8UnLhXE.d.mts +126 -0
  147. package/dist/sandbox-M8UnLhXE.d.mts.map +1 -0
  148. package/dist/{workspace-Bp1xVaOz.mjs → schemas-Ckm_aBnF.cjs} +264 -969
  149. package/dist/schemas-Ckm_aBnF.cjs.map +1 -0
  150. package/dist/{workspace-B64Xk1Mb.cjs → schemas-D2LCF689.mjs} +195 -1155
  151. package/dist/schemas-D2LCF689.mjs.map +1 -0
  152. package/dist/{sniffer-CQmJnNJM.cjs → sniffer-D_SYc_pO.cjs} +379 -214
  153. package/dist/sniffer-D_SYc_pO.cjs.map +1 -0
  154. package/dist/{sniffer-bdleks5l.mjs → sniffer-aO_-s5vq.mjs} +346 -211
  155. package/dist/sniffer-aO_-s5vq.mjs.map +1 -0
  156. package/dist/target/public.cjs +15 -0
  157. package/dist/target/public.d.cts +28 -0
  158. package/dist/target/public.d.cts.map +1 -0
  159. package/dist/target/public.d.mts +28 -0
  160. package/dist/target/public.d.mts.map +1 -0
  161. package/dist/target/public.mjs +4 -0
  162. package/dist/terminal-D0f1u0LG.cjs +576 -0
  163. package/dist/terminal-D0f1u0LG.cjs.map +1 -0
  164. package/dist/terminal-gMxAo9Dj.mjs +517 -0
  165. package/dist/terminal-gMxAo9Dj.mjs.map +1 -0
  166. package/dist/{types-efNLu9xu.d.cts → types-CfLKGfC_.d.mts} +624 -34
  167. package/dist/types-CfLKGfC_.d.mts.map +1 -0
  168. package/dist/{types-Bp1mVxG0.d.mts → types-DIA7Li-J.d.cts} +626 -34
  169. package/dist/types-DIA7Li-J.d.cts.map +1 -0
  170. package/dist/vitest.cjs +2 -2
  171. package/dist/vitest.mjs +2 -2
  172. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  173. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  174. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  175. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  176. package/dist/workspace/index.cjs +1 -1
  177. package/dist/workspace/index.d.cts +3 -3
  178. package/dist/workspace/index.d.mts +3 -3
  179. package/dist/workspace/index.mjs +1 -1
  180. package/dist/workspace-Dh7rr7l4.mjs +1024 -0
  181. package/dist/workspace-Dh7rr7l4.mjs.map +1 -0
  182. package/dist/workspace-Kl4NG9IH.cjs +1196 -0
  183. package/dist/workspace-Kl4NG9IH.cjs.map +1 -0
  184. package/package.json +23 -13
  185. package/dist/cli-DEA_J3Sa.mjs.map +0 -1
  186. package/dist/cli-DQdrVkj2.cjs.map +0 -1
  187. package/dist/config-C5-EEdmr.mjs.map +0 -1
  188. package/dist/config-DXnkCEq0.cjs.map +0 -1
  189. package/dist/config.d.cts.map +0 -1
  190. package/dist/config.d.mts.map +0 -1
  191. package/dist/deploy-BJcLmVTc.mjs.map +0 -1
  192. package/dist/deploy-BbJdgQ2b.cjs.map +0 -1
  193. package/dist/discover-Bc-4eA_p.cjs +0 -299
  194. package/dist/discover-Bc-4eA_p.cjs.map +0 -1
  195. package/dist/discover-FrYvzkeC.mjs +0 -262
  196. package/dist/discover-FrYvzkeC.mjs.map +0 -1
  197. package/dist/sniffer-CQmJnNJM.cjs.map +0 -1
  198. package/dist/sniffer-bdleks5l.mjs.map +0 -1
  199. package/dist/types-Bp1mVxG0.d.mts.map +0 -1
  200. package/dist/types-efNLu9xu.d.cts.map +0 -1
  201. package/dist/workspace-B64Xk1Mb.cjs.map +0 -1
  202. package/dist/workspace-Bp1xVaOz.mjs.map +0 -1
package/dist/config.d.cts CHANGED
@@ -1,211 +1,4 @@
1
- import { C as WorkspaceConfig, _ as LoadedConfig, b as NormalizedWorkspace, p as DevConfig, r as GkmConfig, y as NormalizedAppConfig } from "./types-efNLu9xu.cjs";
2
- import { i as defineWorkspace } from "./index-UiWCaGzU.cjs";
3
- import { ConstructManifest } from "@geekmidas/manifest";
4
- //#region src/dev/discovery.d.ts
5
- /** Where an app is in its life. `stopped` is a server that exited on its own. */
6
- type AppStatus = 'starting' | 'ready' | 'reloading' | 'stopped';
7
- /** A JSON API an app serves about itself. */
8
- type DataApiKind = 'telescope' | 'database' | 'openapi';
9
- interface DiscoveredDataApi {
10
- kind: DataApiKind;
11
- /** Where the app serves it. */
12
- path: string;
13
- /** The app's own address for it — `http://localhost:<port><path>`. */
14
- url: string;
15
- /** The same API through this endpoint, relative to its origin. */
16
- proxy: string;
17
- }
18
- interface DiscoveredApp {
19
- name: string;
20
- type: 'backend' | 'web' | 'mobile';
21
- port: number;
22
- /** `http://localhost:<port>`. */
23
- url: string;
24
- publicUrl: string | null;
25
- status: AppStatus;
26
- reloads: number;
27
- /** The `gkm dev` running it, when it runs in one of its own. */
28
- pid: number | null;
29
- dataApis: DiscoveredDataApi[];
30
- }
31
- interface DiscoveredWorkspace {
32
- /** Stable for a workspace's root: its name, and a hash of where it is. */
33
- id: string;
34
- name: string;
35
- root: string;
36
- stage: string;
37
- manifest: ConstructManifest | null;
38
- apps: DiscoveredApp[];
39
- }
40
- /** The body of `GET /__gkm`. */
41
- interface DiscoveryResponse {
42
- version: 1;
43
- /** The `gkm dev` serving this endpoint, which may change while you watch. */
44
- host: {
45
- pid: number;
46
- port: number;
47
- };
48
- /** Where the changes stream, as server-sent events. */
49
- events: string;
50
- workspaces: DiscoveredWorkspace[];
51
- }
52
- /** One message on `GET /__gkm/events`; its SSE `event:` is its `type`. */
53
- type DiscoveryEvent = {
54
- type: 'snapshot';
55
- snapshot: DiscoveryResponse;
56
- } | {
57
- type: 'workspace.started' | 'workspace.stopped';
58
- workspace: string;
59
- } | {
60
- type: 'app.started' | 'app.stopped' | 'app.reloaded' | 'app.status';
61
- workspace: string;
62
- app: DiscoveredApp;
63
- };
64
- //#endregion
65
- //#region src/config.d.ts
66
- /**
67
- * Define GKM configuration with full TypeScript support.
68
- * This is an identity function that provides type safety and autocomplete.
69
- *
70
- * @example
71
- * ```ts
72
- * // gkm.config.ts
73
- * import { defineConfig } from '@geekmidas/cli/config';
74
- *
75
- * export default defineConfig({
76
- * routes: './src/endpoints/**\/*.ts',
77
- * envParser: './src/config/env',
78
- * logger: './src/config/logger',
79
- * telescope: true,
80
- * });
81
- * ```
82
- */
83
- export declare function defineConfig(config: GkmConfig): GkmConfig;
84
- export interface ParsedModuleConfig {
85
- path: string;
86
- importPattern: string;
87
- }
88
- /**
89
- * Parse a module config string into path and import pattern.
90
- *
91
- * @param configString - Config string in format "./path/to/module" or "./path/to/module#exportName"
92
- * @param defaultAlias - The default alias name to use if no export name specified
93
- * @returns Object with path and import pattern
94
- *
95
- * @example
96
- * parseModuleConfig('./src/config/env', 'envParser')
97
- * // { path: './src/config/env', importPattern: 'envParser' }
98
- *
99
- * parseModuleConfig('./src/config/env#envParser', 'envParser')
100
- * // { path: './src/config/env', importPattern: '{ envParser }' }
101
- *
102
- * parseModuleConfig('./src/config/env#myEnv', 'envParser')
103
- * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
104
- */
105
- export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
106
- export interface ConfigDiscoveryResult {
107
- configPath: string;
108
- workspaceRoot: string;
109
- }
110
- /** No gkm config in a directory or any of its parents. */
111
- export declare class ConfigNotFound extends Error {
112
- readonly cwd: string;
113
- constructor(cwd: string);
114
- }
115
- /**
116
- * Load configuration file (single-app format).
117
- * For backwards compatibility with existing code.
118
- *
119
- * @deprecated Use loadWorkspaceConfig for new code
120
- */
121
- export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
122
- /**
123
- * Load configuration file and process it as a workspace.
124
- * Works with both single-app and workspace configurations.
125
- *
126
- * Single-app configs are automatically wrapped as a workspace with one app.
127
- *
128
- * @example
129
- * ```ts
130
- * const { type, workspace } = await loadWorkspaceConfig();
131
- *
132
- * if (type === 'workspace') {
133
- * console.log('Multi-app workspace:', workspace.apps);
134
- * } else {
135
- * console.log('Single app wrapped as workspace');
136
- * }
137
- * ```
138
- */
139
- /**
140
- * The workspace a directory belongs to, as its config states it — without
141
- * discovering its constructs.
142
- *
143
- * For callers that need a fact the config holds (where a stage's secrets are
144
- * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
145
- * construct module to derive the apps, which is a cost a secrets read should
146
- * not pay.
147
- */
148
- export declare function loadWorkspaceSettings(cwd?: string): Promise<LoadedConfig['workspace']>;
149
- export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
150
- /**
151
- * A workspace with no `constructs` glob.
152
- *
153
- * In v10 every address, container and app comes from what the workspace
154
- * declares — there is no second path that reads a hand-written compose file or
155
- * an `apps` block's ports. A config that declares nothing has nothing to run.
156
- */
157
- export declare class WorkspaceDeclaresNoConstructs extends Error {
158
- readonly root: string;
159
- constructor(root: string);
160
- }
161
- export interface AppConfigResult {
162
- appName: string;
163
- app: NormalizedAppConfig;
164
- gkmConfig: GkmConfig;
165
- workspace: NormalizedWorkspace;
166
- workspaceRoot: string;
167
- appRoot: string;
168
- }
169
- /** A directory that no app in the workspace lives in. */
170
- export declare class NotInAnApp extends Error {
171
- readonly cwd: string;
172
- readonly apps: Readonly<Record<string, string>>;
173
- constructor(cwd: string, apps: Readonly<Record<string, string>>);
174
- }
175
- /**
176
- * The backend app a directory is part of, with its gkm config — found by the
177
- * `path` its construct declares.
178
- *
179
- * @example
180
- * ```ts
181
- * // From apps/api, where a construct declares `path: 'apps/api'`
182
- * const { app, workspace, workspaceRoot } = await loadAppConfig();
183
- * ```
184
- *
185
- * @throws {NotInAnApp} when no app's path contains the directory.
186
- * @throws {NotABackendApp} when the app it is in has no gkm config to run.
187
- */
188
- export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
189
- /** The app a directory is in has no gkm config — a site, or an entry app. */
190
- export declare class NotABackendApp extends Error {
191
- readonly appName: string;
192
- constructor(appName: string);
193
- }
194
- export interface WorkspaceAppInfo {
195
- /** The app's key in the workspace. */
196
- appName: string;
197
- app: NormalizedAppConfig;
198
- workspace: NormalizedWorkspace;
199
- workspaceRoot: string;
200
- }
201
- /**
202
- * The app a directory is part of, frontend or backend — found by the `path`
203
- * its construct declares. Unlike `loadAppConfig`, the app need not have a
204
- * gkm config, which is what `gkm exec` and `gkm test` from a site need.
205
- *
206
- * @throws {NotInAnApp} when no app's path contains the directory.
207
- */
208
- export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
209
- //#endregion
210
- export { type AppStatus, type DataApiKind, type DevConfig, type DiscoveredApp, type DiscoveredDataApi, type DiscoveredWorkspace, type DiscoveryEvent, type DiscoveryResponse, type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
211
- //# sourceMappingURL=config.d.cts.map
1
+ import { C as WorkspaceConfig, _ as LoadedConfig, p as DevConfig, r as GkmConfig } from "./types-DIA7Li-J.cjs";
2
+ import { i as defineWorkspace } from "./index-BtXDZQuF.cjs";
3
+ import { C as DiscoveredApp, D as DiscoveryResponse, E as DiscoveryEvent, S as DataApiKind, T as DiscoveredWorkspace, _ as loadWorkspaceAppInfo, a as ConfigNotFound, b as parseModuleConfig, c as NotABackendApp, d as WorkspaceAppInfo, f as WorkspaceDeclaresNoConstructs, g as loadConfig, h as loadAppConfig, i as ConfigLoadFailed, l as NotInAnApp, m as findWorkspaceRoot, n as CONFIG_LOAD_TIMEOUT_MS, o as ConfigObjectNotSerializable, p as defineConfig, r as ConfigDiscoveryResult, s as LoadConfigOptions, t as AppConfigResult, u as ParsedModuleConfig, v as loadWorkspaceConfig, w as DiscoveredDataApi, x as AppStatus, y as loadWorkspaceSettings } from "./config-CemHVcIr.cjs";
4
+ export { AppConfigResult, type AppStatus, CONFIG_LOAD_TIMEOUT_MS, ConfigDiscoveryResult, ConfigLoadFailed, ConfigNotFound, ConfigObjectNotSerializable, type DataApiKind, type DevConfig, type DiscoveredApp, type DiscoveredDataApi, type DiscoveredWorkspace, type DiscoveryEvent, type DiscoveryResponse, type GkmConfig, LoadConfigOptions, type LoadedConfig, NotABackendApp, NotInAnApp, ParsedModuleConfig, WorkspaceAppInfo, type WorkspaceConfig, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, findWorkspaceRoot, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
package/dist/config.d.mts CHANGED
@@ -1,211 +1,4 @@
1
- import { C as WorkspaceConfig, _ as LoadedConfig, b as NormalizedWorkspace, p as DevConfig, r as GkmConfig, y as NormalizedAppConfig } from "./types-Bp1mVxG0.mjs";
2
- import { i as defineWorkspace } from "./index-Da1-oa9W.mjs";
3
- import { ConstructManifest } from "@geekmidas/manifest";
4
- //#region src/dev/discovery.d.ts
5
- /** Where an app is in its life. `stopped` is a server that exited on its own. */
6
- type AppStatus = 'starting' | 'ready' | 'reloading' | 'stopped';
7
- /** A JSON API an app serves about itself. */
8
- type DataApiKind = 'telescope' | 'database' | 'openapi';
9
- interface DiscoveredDataApi {
10
- kind: DataApiKind;
11
- /** Where the app serves it. */
12
- path: string;
13
- /** The app's own address for it — `http://localhost:<port><path>`. */
14
- url: string;
15
- /** The same API through this endpoint, relative to its origin. */
16
- proxy: string;
17
- }
18
- interface DiscoveredApp {
19
- name: string;
20
- type: 'backend' | 'web' | 'mobile';
21
- port: number;
22
- /** `http://localhost:<port>`. */
23
- url: string;
24
- publicUrl: string | null;
25
- status: AppStatus;
26
- reloads: number;
27
- /** The `gkm dev` running it, when it runs in one of its own. */
28
- pid: number | null;
29
- dataApis: DiscoveredDataApi[];
30
- }
31
- interface DiscoveredWorkspace {
32
- /** Stable for a workspace's root: its name, and a hash of where it is. */
33
- id: string;
34
- name: string;
35
- root: string;
36
- stage: string;
37
- manifest: ConstructManifest | null;
38
- apps: DiscoveredApp[];
39
- }
40
- /** The body of `GET /__gkm`. */
41
- interface DiscoveryResponse {
42
- version: 1;
43
- /** The `gkm dev` serving this endpoint, which may change while you watch. */
44
- host: {
45
- pid: number;
46
- port: number;
47
- };
48
- /** Where the changes stream, as server-sent events. */
49
- events: string;
50
- workspaces: DiscoveredWorkspace[];
51
- }
52
- /** One message on `GET /__gkm/events`; its SSE `event:` is its `type`. */
53
- type DiscoveryEvent = {
54
- type: 'snapshot';
55
- snapshot: DiscoveryResponse;
56
- } | {
57
- type: 'workspace.started' | 'workspace.stopped';
58
- workspace: string;
59
- } | {
60
- type: 'app.started' | 'app.stopped' | 'app.reloaded' | 'app.status';
61
- workspace: string;
62
- app: DiscoveredApp;
63
- };
64
- //#endregion
65
- //#region src/config.d.ts
66
- /**
67
- * Define GKM configuration with full TypeScript support.
68
- * This is an identity function that provides type safety and autocomplete.
69
- *
70
- * @example
71
- * ```ts
72
- * // gkm.config.ts
73
- * import { defineConfig } from '@geekmidas/cli/config';
74
- *
75
- * export default defineConfig({
76
- * routes: './src/endpoints/**\/*.ts',
77
- * envParser: './src/config/env',
78
- * logger: './src/config/logger',
79
- * telescope: true,
80
- * });
81
- * ```
82
- */
83
- export declare function defineConfig(config: GkmConfig): GkmConfig;
84
- export interface ParsedModuleConfig {
85
- path: string;
86
- importPattern: string;
87
- }
88
- /**
89
- * Parse a module config string into path and import pattern.
90
- *
91
- * @param configString - Config string in format "./path/to/module" or "./path/to/module#exportName"
92
- * @param defaultAlias - The default alias name to use if no export name specified
93
- * @returns Object with path and import pattern
94
- *
95
- * @example
96
- * parseModuleConfig('./src/config/env', 'envParser')
97
- * // { path: './src/config/env', importPattern: 'envParser' }
98
- *
99
- * parseModuleConfig('./src/config/env#envParser', 'envParser')
100
- * // { path: './src/config/env', importPattern: '{ envParser }' }
101
- *
102
- * parseModuleConfig('./src/config/env#myEnv', 'envParser')
103
- * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
104
- */
105
- export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
106
- export interface ConfigDiscoveryResult {
107
- configPath: string;
108
- workspaceRoot: string;
109
- }
110
- /** No gkm config in a directory or any of its parents. */
111
- export declare class ConfigNotFound extends Error {
112
- readonly cwd: string;
113
- constructor(cwd: string);
114
- }
115
- /**
116
- * Load configuration file (single-app format).
117
- * For backwards compatibility with existing code.
118
- *
119
- * @deprecated Use loadWorkspaceConfig for new code
120
- */
121
- export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
122
- /**
123
- * Load configuration file and process it as a workspace.
124
- * Works with both single-app and workspace configurations.
125
- *
126
- * Single-app configs are automatically wrapped as a workspace with one app.
127
- *
128
- * @example
129
- * ```ts
130
- * const { type, workspace } = await loadWorkspaceConfig();
131
- *
132
- * if (type === 'workspace') {
133
- * console.log('Multi-app workspace:', workspace.apps);
134
- * } else {
135
- * console.log('Single app wrapped as workspace');
136
- * }
137
- * ```
138
- */
139
- /**
140
- * The workspace a directory belongs to, as its config states it — without
141
- * discovering its constructs.
142
- *
143
- * For callers that need a fact the config holds (where a stage's secrets are
144
- * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
145
- * construct module to derive the apps, which is a cost a secrets read should
146
- * not pay.
147
- */
148
- export declare function loadWorkspaceSettings(cwd?: string): Promise<LoadedConfig['workspace']>;
149
- export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
150
- /**
151
- * A workspace with no `constructs` glob.
152
- *
153
- * In v10 every address, container and app comes from what the workspace
154
- * declares — there is no second path that reads a hand-written compose file or
155
- * an `apps` block's ports. A config that declares nothing has nothing to run.
156
- */
157
- export declare class WorkspaceDeclaresNoConstructs extends Error {
158
- readonly root: string;
159
- constructor(root: string);
160
- }
161
- export interface AppConfigResult {
162
- appName: string;
163
- app: NormalizedAppConfig;
164
- gkmConfig: GkmConfig;
165
- workspace: NormalizedWorkspace;
166
- workspaceRoot: string;
167
- appRoot: string;
168
- }
169
- /** A directory that no app in the workspace lives in. */
170
- export declare class NotInAnApp extends Error {
171
- readonly cwd: string;
172
- readonly apps: Readonly<Record<string, string>>;
173
- constructor(cwd: string, apps: Readonly<Record<string, string>>);
174
- }
175
- /**
176
- * The backend app a directory is part of, with its gkm config — found by the
177
- * `path` its construct declares.
178
- *
179
- * @example
180
- * ```ts
181
- * // From apps/api, where a construct declares `path: 'apps/api'`
182
- * const { app, workspace, workspaceRoot } = await loadAppConfig();
183
- * ```
184
- *
185
- * @throws {NotInAnApp} when no app's path contains the directory.
186
- * @throws {NotABackendApp} when the app it is in has no gkm config to run.
187
- */
188
- export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
189
- /** The app a directory is in has no gkm config — a site, or an entry app. */
190
- export declare class NotABackendApp extends Error {
191
- readonly appName: string;
192
- constructor(appName: string);
193
- }
194
- export interface WorkspaceAppInfo {
195
- /** The app's key in the workspace. */
196
- appName: string;
197
- app: NormalizedAppConfig;
198
- workspace: NormalizedWorkspace;
199
- workspaceRoot: string;
200
- }
201
- /**
202
- * The app a directory is part of, frontend or backend — found by the `path`
203
- * its construct declares. Unlike `loadAppConfig`, the app need not have a
204
- * gkm config, which is what `gkm exec` and `gkm test` from a site need.
205
- *
206
- * @throws {NotInAnApp} when no app's path contains the directory.
207
- */
208
- export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
209
- //#endregion
210
- export { type AppStatus, type DataApiKind, type DevConfig, type DiscoveredApp, type DiscoveredDataApi, type DiscoveredWorkspace, type DiscoveryEvent, type DiscoveryResponse, type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
211
- //# sourceMappingURL=config.d.mts.map
1
+ import { C as WorkspaceConfig, _ as LoadedConfig, p as DevConfig, r as GkmConfig } from "./types-CfLKGfC_.mjs";
2
+ import { i as defineWorkspace } from "./index-DrKzpHl-.mjs";
3
+ import { C as DiscoveredApp, D as DiscoveryResponse, E as DiscoveryEvent, S as DataApiKind, T as DiscoveredWorkspace, _ as loadWorkspaceAppInfo, a as ConfigNotFound, b as parseModuleConfig, c as NotABackendApp, d as WorkspaceAppInfo, f as WorkspaceDeclaresNoConstructs, g as loadConfig, h as loadAppConfig, i as ConfigLoadFailed, l as NotInAnApp, m as findWorkspaceRoot, n as CONFIG_LOAD_TIMEOUT_MS, o as ConfigObjectNotSerializable, p as defineConfig, r as ConfigDiscoveryResult, s as LoadConfigOptions, t as AppConfigResult, u as ParsedModuleConfig, v as loadWorkspaceConfig, w as DiscoveredDataApi, x as AppStatus, y as loadWorkspaceSettings } from "./config-C2BUosLm.mjs";
4
+ export { AppConfigResult, type AppStatus, CONFIG_LOAD_TIMEOUT_MS, ConfigDiscoveryResult, ConfigLoadFailed, ConfigNotFound, ConfigObjectNotSerializable, type DataApiKind, type DevConfig, type DiscoveredApp, type DiscoveredDataApi, type DiscoveredWorkspace, type DiscoveryEvent, type DiscoveryResponse, type GkmConfig, LoadConfigOptions, type LoadedConfig, NotABackendApp, NotInAnApp, ParsedModuleConfig, WorkspaceAppInfo, type WorkspaceConfig, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, findWorkspaceRoot, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
package/dist/config.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as defineConfig, c as loadWorkspaceAppInfo, d as parseModuleConfig, i as WorkspaceDeclaresNoConstructs, l as loadWorkspaceConfig, n as NotABackendApp, o as loadAppConfig, r as NotInAnApp, s as loadConfig, t as ConfigNotFound, u as loadWorkspaceSettings } from "./config-C5-EEdmr.mjs";
2
- import { i as defineWorkspace } from "./workspace-Bp1xVaOz.mjs";
3
- export { ConfigNotFound, NotABackendApp, NotInAnApp, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
1
+ import { a as NotABackendApp, c as defineConfig, d as loadConfig, f as loadWorkspaceAppInfo, h as parseModuleConfig, i as ConfigObjectNotSerializable, l as findWorkspaceRoot, m as loadWorkspaceSettings, n as ConfigLoadFailed, o as NotInAnApp, p as loadWorkspaceConfig, r as ConfigNotFound, s as WorkspaceDeclaresNoConstructs, t as CONFIG_LOAD_TIMEOUT_MS, u as loadAppConfig } from "./config-LKKCVCnC.mjs";
2
+ import { i as defineWorkspace } from "./workspace-Dh7rr7l4.mjs";
3
+ export { CONFIG_LOAD_TIMEOUT_MS, ConfigLoadFailed, ConfigNotFound, ConfigObjectNotSerializable, NotABackendApp, NotInAnApp, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, findWorkspaceRoot, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
@@ -0,0 +1,94 @@
1
+ //#region src/target/builtins.ts
2
+ const BUILTIN_TARGETS = {
3
+ dokploy: {
4
+ runtime: "server",
5
+ status: "available"
6
+ },
7
+ sst: {
8
+ runtime: "aws",
9
+ status: "external",
10
+ instead: (stage) => `run \`gkm build && sst deploy --stage ${stage}\``
11
+ },
12
+ vercel: {
13
+ runtime: "aws",
14
+ status: "planned"
15
+ },
16
+ cloudflare: {
17
+ runtime: "aws",
18
+ status: "planned"
19
+ }
20
+ };
21
+ /** The built-in target called `name`, if one is. */
22
+ function builtinTarget(name) {
23
+ return Object.hasOwn(BUILTIN_TARGETS, name) ? BUILTIN_TARGETS[name] : void 0;
24
+ }
25
+ /** Built-in names a config may use. */
26
+ function configurableBuiltins() {
27
+ return Object.entries(BUILTIN_TARGETS).filter(([, target]) => target.status !== "planned").map(([name]) => name);
28
+ }
29
+ /** The `deploy.targets` entry called `name`, if the config has one. */
30
+ function configuredTarget(deploy, name) {
31
+ const targets = deploy?.targets;
32
+ return targets && Object.hasOwn(targets, name) ? targets[name] : void 0;
33
+ }
34
+ /** A target name that is neither built in nor in `deploy.targets`. */
35
+ var UnknownDeployTarget = class extends Error {
36
+ target;
37
+ known;
38
+ constructor(target, known) {
39
+ super(`Unknown deploy target "${target}". Use one of ${known.join(", ")}, or name the package that provides it in gkm.config.ts: deploy: { targets: { ${JSON.stringify(target)}: '<package>' } }.`);
40
+ this.target = target;
41
+ this.known = known;
42
+ this.name = "UnknownDeployTarget";
43
+ }
44
+ };
45
+ /** A built-in target `gkm deploy` cannot deploy through yet. */
46
+ var DeployTargetNotYetSupported = class extends Error {
47
+ target;
48
+ instead;
49
+ constructor(target, instead) {
50
+ super(instead ? `gkm deploy cannot deploy through "${target}" yet: ${instead}.` : `Deploy target "${target}" is not supported yet. Deploy with dokploy, or name a target package in deploy.targets.`);
51
+ this.target = target;
52
+ this.instead = instead;
53
+ this.name = "DeployTargetNotYetSupported";
54
+ }
55
+ };
56
+ //#endregion
57
+ //#region src/target/define.ts
58
+ /**
59
+ * A deploy target, typed from what it is written with: the options from its
60
+ * `options` schema, the run state from what `validate` returns. Nothing
61
+ * happens at runtime — it returns the target as given.
62
+ *
63
+ * ```ts
64
+ * export default defineTarget({
65
+ * name: 'fly',
66
+ * runtime: 'server',
67
+ * capabilities: { rollback: true, migrations: 'target', images: true },
68
+ * options: z.object({ org: z.string() }),
69
+ * async validate(ctx) {
70
+ * return { org: ctx.options.org }; // ctx.options: { org: string }
71
+ * },
72
+ * async release(ctx, run) { … }, // run: { org: string }
73
+ * …
74
+ * });
75
+ * ```
76
+ */
77
+ function defineTarget(target) {
78
+ return target;
79
+ }
80
+ /** Whether `value` has the shape of a target. */
81
+ function isDeployTarget(value) {
82
+ if (!value || typeof value !== "object") return false;
83
+ const candidate = value;
84
+ return typeof candidate.name === "string" && (candidate.runtime === "server" || candidate.runtime === "aws") && typeof candidate.capabilities === "object" && candidate.capabilities !== null && [
85
+ "validate",
86
+ "plan",
87
+ "release",
88
+ "result"
89
+ ].every((phase) => typeof candidate[phase] === "function");
90
+ }
91
+ //#endregion
92
+ export { UnknownDeployTarget as a, configuredTarget as c, DeployTargetNotYetSupported as i, isDeployTarget as n, builtinTarget as o, BUILTIN_TARGETS as r, configurableBuiltins as s, defineTarget as t };
93
+
94
+ //# sourceMappingURL=define-CHBIEc5j.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-CHBIEc5j.mjs","names":[],"sources":["../src/target/builtins.ts","../src/target/define.ts"],"sourcesContent":["/**\n * The target names the CLI knows without being told, and how a name is\n * looked up.\n *\n * Plain data, so the config schema and `providerOf` — which `gkm dev` and\n * `gkm build` call synchronously on every start — can ask what a name means\n * without importing a deploy engine.\n */\n\nimport type { DeployRuntime, DeployTargetEntry } from './types';\n\n/**\n * - `available`: `gkm deploy` deploys through it.\n * - `external`: a valid `deploy.default` that builds and runs locally, but is\n * deployed by its own tool — `gkm deploy` refuses it and says which.\n * - `planned`: reserved, and refused everywhere.\n */\nexport type BuiltinStatus = 'available' | 'external' | 'planned';\n\nexport interface BuiltinTarget {\n\treadonly runtime: DeployRuntime;\n\treadonly status: BuiltinStatus;\n\t/** What to do instead, for a target `gkm deploy` cannot deploy through yet. */\n\treadonly instead?: (stage: string) => string;\n}\n\nexport const BUILTIN_TARGETS = {\n\tdokploy: { runtime: 'server', status: 'available' },\n\tsst: {\n\t\truntime: 'aws',\n\t\tstatus: 'external',\n\t\tinstead: (stage) => `run \\`gkm build && sst deploy --stage ${stage}\\``,\n\t},\n\t// Neither runs containers the project controls, so both take the managed\n\t// defaults when they arrive.\n\tvercel: { runtime: 'aws', status: 'planned' },\n\tcloudflare: { runtime: 'aws', status: 'planned' },\n} as const satisfies Record<string, BuiltinTarget>;\n\nexport type BuiltinTargetName = keyof typeof BUILTIN_TARGETS;\n\n/** The built-in target called `name`, if one is. */\nexport function builtinTarget(name: string): BuiltinTarget | undefined {\n\treturn Object.hasOwn(BUILTIN_TARGETS, name)\n\t\t? BUILTIN_TARGETS[name as BuiltinTargetName]\n\t\t: undefined;\n}\n\n/** Built-in names a config may use. */\nexport function configurableBuiltins(): string[] {\n\treturn Object.entries(BUILTIN_TARGETS)\n\t\t.filter(([, target]) => target.status !== 'planned')\n\t\t.map(([name]) => name);\n}\n\n/** The `deploy.targets` entry called `name`, if the config has one. */\nexport function configuredTarget(\n\tdeploy: { targets?: Record<string, DeployTargetEntry> } | undefined,\n\tname: string,\n): DeployTargetEntry | undefined {\n\tconst targets = deploy?.targets;\n\treturn targets && Object.hasOwn(targets, name) ? targets[name] : undefined;\n}\n\n/** A target name that is neither built in nor in `deploy.targets`. */\nexport class UnknownDeployTarget extends Error {\n\tconstructor(\n\t\treadonly target: string,\n\t\t/** The names that would have resolved. */\n\t\treadonly known: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`Unknown deploy target \"${target}\". Use one of ${known.join(', ')}, or name the package that provides it in gkm.config.ts: deploy: { targets: { ${JSON.stringify(target)}: '<package>' } }.`,\n\t\t);\n\t\tthis.name = 'UnknownDeployTarget';\n\t}\n}\n\n/** A built-in target `gkm deploy` cannot deploy through yet. */\nexport class DeployTargetNotYetSupported extends Error {\n\tconstructor(\n\t\treadonly target: string,\n\t\t/** What to do instead, when there is something. */\n\t\treadonly instead?: string,\n\t) {\n\t\tsuper(\n\t\t\tinstead\n\t\t\t\t? `gkm deploy cannot deploy through \"${target}\" yet: ${instead}.`\n\t\t\t\t: `Deploy target \"${target}\" is not supported yet. Deploy with dokploy, or name a target package in deploy.targets.`,\n\t\t);\n\t\tthis.name = 'DeployTargetNotYetSupported';\n\t}\n}\n","import type { AnyDeployTarget, DeployTarget } from './types';\n\n/**\n * A deploy target, typed from what it is written with: the options from its\n * `options` schema, the run state from what `validate` returns. Nothing\n * happens at runtime — it returns the target as given.\n *\n * ```ts\n * export default defineTarget({\n * name: 'fly',\n * runtime: 'server',\n * capabilities: { rollback: true, migrations: 'target', images: true },\n * options: z.object({ org: z.string() }),\n * async validate(ctx) {\n * return { org: ctx.options.org }; // ctx.options: { org: string }\n * },\n * async release(ctx, run) { … }, // run: { org: string }\n * …\n * });\n * ```\n */\nexport function defineTarget<Options = undefined, Run = void>(\n\ttarget: DeployTarget<Options, Run>,\n): DeployTarget<Options, Run> {\n\treturn target;\n}\n\n/** Whether `value` has the shape of a target. */\nexport function isDeployTarget(value: unknown): value is AnyDeployTarget {\n\tif (!value || typeof value !== 'object') return false;\n\tconst candidate = value as Record<string, unknown>;\n\treturn (\n\t\ttypeof candidate.name === 'string' &&\n\t\t(candidate.runtime === 'server' || candidate.runtime === 'aws') &&\n\t\ttypeof candidate.capabilities === 'object' &&\n\t\tcandidate.capabilities !== null &&\n\t\t['validate', 'plan', 'release', 'result'].every(\n\t\t\t(phase) => typeof candidate[phase] === 'function',\n\t\t)\n\t);\n}\n"],"mappings":";AA0BA,MAAa,kBAAkB;CAC9B,SAAS;EAAE,SAAS;EAAU,QAAQ;CAAY;CAClD,KAAK;EACJ,SAAS;EACT,QAAQ;EACR,UAAU,UAAU,yCAAyC,MAAM;CACpE;CAGA,QAAQ;EAAE,SAAS;EAAO,QAAQ;CAAU;CAC5C,YAAY;EAAE,SAAS;EAAO,QAAQ;CAAU;AACjD;;AAKA,SAAgB,cAAc,MAAyC;CACtE,OAAO,OAAO,OAAO,iBAAiB,IAAI,IACvC,gBAAgB,QAChB,KAAA;AACJ;;AAGA,SAAgB,uBAAiC;CAChD,OAAO,OAAO,QAAQ,eAAe,CAAC,CACpC,QAAQ,GAAG,YAAY,OAAO,WAAW,SAAS,CAAC,CACnD,KAAK,CAAC,UAAU,IAAI;AACvB;;AAGA,SAAgB,iBACf,QACA,MACgC;CAChC,MAAM,UAAU,QAAQ;CACxB,OAAO,WAAW,OAAO,OAAO,SAAS,IAAI,IAAI,QAAQ,QAAQ,KAAA;AAClE;;AAGA,IAAa,sBAAb,cAAyC,MAAM;CAEpC;CAEA;CAHV,YACC,QAEA,OACC;EACD,MACC,0BAA0B,OAAO,gBAAgB,MAAM,KAAK,IAAI,EAAE,gFAAgF,KAAK,UAAU,MAAM,EAAE,mBAC1K;EANS,KAAA,SAAA;EAEA,KAAA,QAAA;EAKT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,8BAAb,cAAiD,MAAM;CAE5C;CAEA;CAHV,YACC,QAEA,SACC;EACD,MACC,UACG,qCAAqC,OAAO,SAAS,QAAQ,KAC7D,kBAAkB,OAAO,yFAC7B;EARS,KAAA,SAAA;EAEA,KAAA,UAAA;EAOT,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;;;;;;;;;;ACvEA,SAAgB,aACf,QAC6B;CAC7B,OAAO;AACR;;AAGA,SAAgB,eAAe,OAA0C;CACxE,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;CAChD,MAAM,YAAY;CAClB,OACC,OAAO,UAAU,SAAS,aACzB,UAAU,YAAY,YAAY,UAAU,YAAY,UACzD,OAAO,UAAU,iBAAiB,YAClC,UAAU,iBAAiB,QAC3B;EAAC;EAAY;EAAQ;EAAW;CAAQ,CAAC,CAAC,OACxC,UAAU,OAAO,UAAU,WAAW,UACxC;AAEF"}