@geekmidas/cli 10.0.0-alpha.4 → 10.0.0-alpha.41

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 (257) hide show
  1. package/README.md +52 -74
  2. package/bin/adjacent-tsconfig.mjs +97 -0
  3. package/bin/gkm.mjs +7 -1
  4. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
  5. package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
  6. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-Bh6K7QYz.mjs} +20 -21
  7. package/dist/HostingerProvider-Bh6K7QYz.mjs.map +1 -0
  8. package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
  9. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
  10. package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
  11. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
  12. package/dist/{openapi-CA0yJUTN.cjs → OpenApiTsGenerator-B4Kj_qNU.cjs} +142 -303
  13. package/dist/OpenApiTsGenerator-B4Kj_qNU.cjs.map +1 -0
  14. package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-CEh3EKN3.mjs} +113 -255
  15. package/dist/OpenApiTsGenerator-CEh3EKN3.mjs.map +1 -0
  16. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  17. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  18. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  19. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  20. package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
  21. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
  22. package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
  23. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
  24. package/dist/aws-DkHdTV-p.cjs +61 -0
  25. package/dist/aws-DkHdTV-p.cjs.map +1 -0
  26. package/dist/aws-DojzQnLd.mjs +61 -0
  27. package/dist/aws-DojzQnLd.mjs.map +1 -0
  28. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  29. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  30. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  31. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  32. package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
  33. package/dist/bundler--fyybf1N.mjs.map +1 -0
  34. package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
  35. package/dist/bundler-By6_sXiL.cjs.map +1 -0
  36. package/dist/{config-WRdsQYZK.mjs → config-5watB1D0.mjs} +142 -154
  37. package/dist/config-5watB1D0.mjs.map +1 -0
  38. package/dist/{config-C21ocYNd.cjs → config-CJ-PAb7M.cjs} +209 -210
  39. package/dist/config-CJ-PAb7M.cjs.map +1 -0
  40. package/dist/config.cjs +9 -6
  41. package/dist/config.d.cts +62 -33
  42. package/dist/config.d.cts.map +1 -1
  43. package/dist/config.d.mts +62 -33
  44. package/dist/config.d.mts.map +1 -1
  45. package/dist/config.mjs +3 -5
  46. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  47. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  48. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  49. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  50. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  51. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  52. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  53. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  54. package/dist/deploy/sniffer-hooks.cjs +13 -7
  55. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  56. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  57. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  58. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  59. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  60. package/dist/deploy/sniffer-hooks.mjs +9 -2
  61. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  62. package/dist/deploy/sniffer-loader.cjs +16 -7
  63. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  64. package/dist/deploy/sniffer-loader.d.cts +1 -1
  65. package/dist/deploy/sniffer-loader.d.mts +1 -1
  66. package/dist/deploy/sniffer-loader.mjs +13 -2
  67. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  68. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  69. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  70. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  71. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  72. package/dist/deploy/sniffer-routes-worker.mjs +3 -3
  73. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  74. package/dist/deploy/sniffer-worker.cjs +15 -6
  75. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  76. package/dist/deploy/sniffer-worker.d.cts +1 -3
  77. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  78. package/dist/deploy/sniffer-worker.d.mts +1 -3
  79. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  80. package/dist/deploy/sniffer-worker.mjs +15 -4
  81. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  82. package/dist/{discover-DTmFeloL.cjs → discover-B0f_kuNN.cjs} +118 -66
  83. package/dist/discover-B0f_kuNN.cjs.map +1 -0
  84. package/dist/{discover-CAlFgYec.mjs → discover-BLhf7V_J.mjs} +67 -22
  85. package/dist/discover-BLhf7V_J.mjs.map +1 -0
  86. package/dist/{emit-CbcRolsa.cjs → emit-BdoPFjZf.cjs} +53 -36
  87. package/dist/emit-BdoPFjZf.cjs.map +1 -0
  88. package/dist/{emit-CiZS_5Ub.mjs → emit-Bzq7JsMP.mjs} +24 -6
  89. package/dist/emit-Bzq7JsMP.mjs.map +1 -0
  90. package/dist/github-BAr8WGkR.cjs +213 -0
  91. package/dist/github-BAr8WGkR.cjs.map +1 -0
  92. package/dist/github-D5MthUlR.mjs +213 -0
  93. package/dist/github-D5MthUlR.mjs.map +1 -0
  94. package/dist/{index-DCtipn2h.d.cts → index-B3PeGOQp.d.cts} +4 -23
  95. package/dist/index-B3PeGOQp.d.cts.map +1 -0
  96. package/dist/{index-BThUzEIp.d.mts → index-BOyaGcCm.d.mts} +4 -23
  97. package/dist/index-BOyaGcCm.d.mts.map +1 -0
  98. package/dist/index.cjs +7071 -4519
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.d.cts +1 -1
  101. package/dist/index.d.mts +1 -1
  102. package/dist/index.mjs +7117 -4586
  103. package/dist/index.mjs.map +1 -1
  104. package/dist/migrate-BVI3yqcE.mjs +736 -0
  105. package/dist/migrate-BVI3yqcE.mjs.map +1 -0
  106. package/dist/migrate-CFOUApUt.cjs +743 -0
  107. package/dist/migrate-CFOUApUt.cjs.map +1 -0
  108. package/dist/openapi.cjs +197 -8
  109. package/dist/openapi.cjs.map +1 -0
  110. package/dist/openapi.d.cts +47 -14
  111. package/dist/openapi.d.cts.map +1 -1
  112. package/dist/openapi.d.mts +47 -14
  113. package/dist/openapi.d.mts.map +1 -1
  114. package/dist/openapi.mjs +191 -5
  115. package/dist/openapi.mjs.map +1 -0
  116. package/dist/ready-D8UXsP6q.mjs +516 -0
  117. package/dist/ready-D8UXsP6q.mjs.map +1 -0
  118. package/dist/ready-mcxamf73.cjs +563 -0
  119. package/dist/ready-mcxamf73.cjs.map +1 -0
  120. package/dist/reconcile/public.cjs +4 -4
  121. package/dist/reconcile/public.d.cts +27 -26
  122. package/dist/reconcile/public.d.cts.map +1 -1
  123. package/dist/reconcile/public.d.mts +27 -26
  124. package/dist/reconcile/public.d.mts.map +1 -1
  125. package/dist/reconcile/public.mjs +3 -4
  126. package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
  127. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  128. package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  129. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  130. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  131. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  132. package/dist/storage-BzaUxmqe.mjs +124 -0
  133. package/dist/storage-BzaUxmqe.mjs.map +1 -0
  134. package/dist/storage-CSGoC3bK.cjs +152 -0
  135. package/dist/storage-CSGoC3bK.cjs.map +1 -0
  136. package/dist/store-DQgxT_WR.cjs +211 -0
  137. package/dist/store-DQgxT_WR.cjs.map +1 -0
  138. package/dist/store-DeGATCS-.mjs +182 -0
  139. package/dist/store-DeGATCS-.mjs.map +1 -0
  140. package/dist/types-0R124hrY.d.mts +6324 -0
  141. package/dist/types-0R124hrY.d.mts.map +1 -0
  142. package/dist/types-DfdYe31u.d.cts +6325 -0
  143. package/dist/types-DfdYe31u.d.cts.map +1 -0
  144. package/dist/vitest.cjs +65 -0
  145. package/dist/vitest.cjs.map +1 -0
  146. package/dist/vitest.d.cts +29 -0
  147. package/dist/vitest.d.cts.map +1 -0
  148. package/dist/vitest.d.mts +29 -0
  149. package/dist/vitest.d.mts.map +1 -0
  150. package/dist/vitest.mjs +65 -0
  151. package/dist/vitest.mjs.map +1 -0
  152. package/dist/workspace/index.cjs +3 -4
  153. package/dist/workspace/index.d.cts +3 -3
  154. package/dist/workspace/index.d.mts +3 -3
  155. package/dist/workspace/index.mjs +2 -3
  156. package/dist/{credentials-G1JwBoXH.cjs → workspace-BIqeeqcR.cjs} +2248 -1809
  157. package/dist/workspace-BIqeeqcR.cjs.map +1 -0
  158. package/dist/{workspace-BFMrAKqI.mjs → workspace-DOmIhiau.mjs} +863 -952
  159. package/dist/workspace-DOmIhiau.mjs.map +1 -0
  160. package/dist/{credentials-BBIRJVp4.mjs → workspace-DwS1JK5u.mjs} +2114 -1706
  161. package/dist/workspace-DwS1JK5u.mjs.map +1 -0
  162. package/dist/{workspace-BcucjwvA.cjs → workspace-RYSYtHP7.cjs} +1032 -1098
  163. package/dist/workspace-RYSYtHP7.cjs.map +1 -0
  164. package/package.json +29 -20
  165. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  166. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  167. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  168. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  169. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  170. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  171. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  172. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  173. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  174. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  175. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  176. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  177. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  178. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  179. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  180. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  181. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  182. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  183. package/dist/chunk-Duj1WY3L.mjs +0 -7
  184. package/dist/config-C21ocYNd.cjs.map +0 -1
  185. package/dist/config-WRdsQYZK.mjs.map +0 -1
  186. package/dist/credentials-B5zRHdAl.mjs +0 -141
  187. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  188. package/dist/credentials-BBIRJVp4.mjs.map +0 -1
  189. package/dist/credentials-BapzjyV5.cjs +0 -195
  190. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  191. package/dist/credentials-G1JwBoXH.cjs.map +0 -1
  192. package/dist/discover-CAlFgYec.mjs.map +0 -1
  193. package/dist/discover-DTmFeloL.cjs.map +0 -1
  194. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  195. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  196. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  197. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  198. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  199. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  200. package/dist/emit-CbcRolsa.cjs.map +0 -1
  201. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  202. package/dist/encryption-C6jaU0hE.cjs +0 -54
  203. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  204. package/dist/encryption-CHzzeR8a.cjs +0 -4
  205. package/dist/encryption-CQUncu7v.mjs +0 -3
  206. package/dist/encryption-D-abyhZx.mjs +0 -42
  207. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  208. package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
  209. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  210. package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
  211. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  212. package/dist/generator-CNzBw7g5.cjs +0 -289
  213. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  214. package/dist/generator-VE2JrFlY.mjs +0 -253
  215. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  216. package/dist/index-BThUzEIp.d.mts.map +0 -1
  217. package/dist/index-DCtipn2h.d.cts.map +0 -1
  218. package/dist/openapi-CA0yJUTN.cjs.map +0 -1
  219. package/dist/openapi-kkQbsRVj.mjs.map +0 -1
  220. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  221. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  222. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  223. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  224. package/dist/openapi-react-query.cjs +0 -4
  225. package/dist/openapi-react-query.d.cts +0 -11
  226. package/dist/openapi-react-query.d.cts.map +0 -1
  227. package/dist/openapi-react-query.d.mts +0 -11
  228. package/dist/openapi-react-query.d.mts.map +0 -1
  229. package/dist/openapi-react-query.mjs +0 -4
  230. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  231. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  232. package/dist/setup-B5_oHHUj.cjs +0 -11
  233. package/dist/setup-Cm2UnAdh.cjs +0 -473
  234. package/dist/setup-Cm2UnAdh.cjs.map +0 -1
  235. package/dist/setup-DXvRLTZN.mjs +0 -443
  236. package/dist/setup-DXvRLTZN.mjs.map +0 -1
  237. package/dist/setup-ZijS4qeC.mjs +0 -11
  238. package/dist/storage-BJmzYxt8.cjs +0 -363
  239. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  240. package/dist/storage-BM9hGpgv.cjs +0 -7
  241. package/dist/storage-Bi24WfoW.mjs +0 -297
  242. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  243. package/dist/storage-CYlGwWTj.mjs +0 -3
  244. package/dist/sync-CmEuNZsB.mjs +0 -76
  245. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  246. package/dist/sync-D306yOWu.cjs +0 -4
  247. package/dist/sync-SizaChmC.cjs +0 -93
  248. package/dist/sync-SizaChmC.cjs.map +0 -1
  249. package/dist/sync-hOqAWHR6.mjs +0 -3
  250. package/dist/types-BhIl-COG.d.cts +0 -2184
  251. package/dist/types-BhIl-COG.d.cts.map +0 -1
  252. package/dist/types-C-arnQ1r.d.mts +0 -2184
  253. package/dist/types-C-arnQ1r.d.mts.map +0 -1
  254. package/dist/workspace-BFMrAKqI.mjs.map +0 -1
  255. package/dist/workspace-BcucjwvA.cjs.map +0 -1
  256. package/dist/workspace-DdJss8I6.cjs +0 -9
  257. package/dist/workspace-k4l3rsFh.mjs +0 -8
package/dist/config.d.cts CHANGED
@@ -1,8 +1,6 @@
1
- import { GkmConfig, LoadedConfig, NormalizedAppConfig, NormalizedWorkspace, WorkspaceConfig } from "./types-BhIl-COG.cjs";
2
- import { defineWorkspace } from "./index-DCtipn2h.cjs";
3
-
1
+ import { S as WorkspaceConfig, g as LoadedConfig, r as GkmConfig, v as NormalizedAppConfig, y as NormalizedWorkspace } from "./types-DfdYe31u.cjs";
2
+ import { i as defineWorkspace } from "./index-B3PeGOQp.cjs";
4
3
  //#region src/config.d.ts
5
-
6
4
  /**
7
5
  * Define GKM configuration with full TypeScript support.
8
6
  * This is an identity function that provides type safety and autocomplete.
@@ -20,8 +18,8 @@ import { defineWorkspace } from "./index-DCtipn2h.cjs";
20
18
  * });
21
19
  * ```
22
20
  */
23
- declare function defineConfig(config: GkmConfig): GkmConfig;
24
- interface ParsedModuleConfig {
21
+ export declare function defineConfig(config: GkmConfig): GkmConfig;
22
+ export interface ParsedModuleConfig {
25
23
  path: string;
26
24
  importPattern: string;
27
25
  }
@@ -42,28 +40,23 @@ interface ParsedModuleConfig {
42
40
  * parseModuleConfig('./src/config/env#myEnv', 'envParser')
43
41
  * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
44
42
  */
45
- declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
46
- interface ConfigDiscoveryResult {
43
+ export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
44
+ export interface ConfigDiscoveryResult {
47
45
  configPath: string;
48
46
  workspaceRoot: string;
49
47
  }
50
- /**
51
- * Get app name from package.json in the given directory.
52
- * Handles scoped packages by extracting the name after the scope.
53
- *
54
- * @example
55
- * getAppNameFromCwd('/path/to/apps/api')
56
- * // package.json: { "name": "@myorg/api" }
57
- * // Returns: 'api'
58
- */
59
- declare function getAppNameFromCwd(cwd?: string): string | null;
48
+ /** No gkm config in a directory or any of its parents. */
49
+ export declare class ConfigNotFound extends Error {
50
+ readonly cwd: string;
51
+ constructor(cwd: string);
52
+ }
60
53
  /**
61
54
  * Load configuration file (single-app format).
62
55
  * For backwards compatibility with existing code.
63
56
  *
64
57
  * @deprecated Use loadWorkspaceConfig for new code
65
58
  */
66
- declare function loadConfig(cwd?: string): Promise<GkmConfig>;
59
+ export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
67
60
  /**
68
61
  * Load configuration file and process it as a workspace.
69
62
  * Works with both single-app and workspace configurations.
@@ -81,8 +74,29 @@ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
81
74
  * }
82
75
  * ```
83
76
  */
84
- declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
85
- interface AppConfigResult {
77
+ /**
78
+ * The workspace a directory belongs to, as its config states it — without
79
+ * discovering its constructs.
80
+ *
81
+ * For callers that need a fact the config holds (where a stage's secrets are
82
+ * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
83
+ * construct module to derive the apps, which is a cost a secrets read should
84
+ * not pay.
85
+ */
86
+ export declare function loadWorkspaceSettings(cwd?: string): Promise<LoadedConfig['workspace']>;
87
+ export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
88
+ /**
89
+ * A workspace with no `constructs` glob.
90
+ *
91
+ * In v10 every address, container and app comes from what the workspace
92
+ * declares — there is no second path that reads a hand-written compose file or
93
+ * an `apps` block's ports. A config that declares nothing has nothing to run.
94
+ */
95
+ export declare class WorkspaceDeclaresNoConstructs extends Error {
96
+ readonly root: string;
97
+ constructor(root: string);
98
+ }
99
+ export interface AppConfigResult {
86
100
  appName: string;
87
101
  app: NormalizedAppConfig;
88
102
  gkmConfig: GkmConfig;
@@ -90,31 +104,46 @@ interface AppConfigResult {
90
104
  workspaceRoot: string;
91
105
  appRoot: string;
92
106
  }
107
+ /** A directory that no app in the workspace lives in. */
108
+ export declare class NotInAnApp extends Error {
109
+ readonly cwd: string;
110
+ readonly apps: Readonly<Record<string, string>>;
111
+ constructor(cwd: string, apps: Readonly<Record<string, string>>);
112
+ }
93
113
  /**
94
- * Load app-specific configuration from workspace.
95
- * Uses the app name from package.json to find the correct app config.
114
+ * The backend app a directory is part of, with its gkm config — found by the
115
+ * `path` its construct declares.
96
116
  *
97
117
  * @example
98
118
  * ```ts
99
- * // From apps/api directory with package.json: { "name": "@myorg/api" }
119
+ * // From apps/api, where a construct declares `path: 'apps/api'`
100
120
  * const { app, workspace, workspaceRoot } = await loadAppConfig();
101
- * console.log(app.routes); // './src/endpoints/**\/*.ts'
102
121
  * ```
122
+ *
123
+ * @throws {NotInAnApp} when no app's path contains the directory.
124
+ * @throws {NotABackendApp} when the app it is in has no gkm config to run.
103
125
  */
104
- declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
105
- interface WorkspaceAppInfo {
126
+ export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
127
+ /** The app a directory is in has no gkm config — a site, or an entry app. */
128
+ export declare class NotABackendApp extends Error {
129
+ readonly appName: string;
130
+ constructor(appName: string);
131
+ }
132
+ export interface WorkspaceAppInfo {
133
+ /** The app's key in the workspace. */
106
134
  appName: string;
107
135
  app: NormalizedAppConfig;
108
136
  workspace: NormalizedWorkspace;
109
137
  workspaceRoot: string;
110
138
  }
111
139
  /**
112
- * Load workspace info for any app (frontend or backend).
113
- * Unlike loadAppConfig, this does NOT require the app to have a gkm config
114
- * (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.
140
+ * The app a directory is part of, frontend or backend — found by the `path`
141
+ * its construct declares. Unlike `loadAppConfig`, the app need not have a
142
+ * gkm config, which is what `gkm exec` and `gkm test` from a site need.
143
+ *
144
+ * @throws {NotInAnApp} when no app's path contains the directory.
115
145
  */
116
- declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
117
- //# sourceMappingURL=config.d.ts.map
146
+ export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
118
147
  //#endregion
119
- export { AppConfigResult, ConfigDiscoveryResult, GkmConfig, LoadedConfig, ParsedModuleConfig, WorkspaceAppInfo, WorkspaceConfig, defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };
148
+ export { type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
120
149
  //# sourceMappingURL=config.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoC0D;AAI1D;AAsBA;AAgBA;AAuDA;AAsDA;;;;AAEU;AA8BV;;;;AAEU,iBAzLM,YAAA,CAyLN,MAAA,EAzL2B,SAyL3B,CAAA,EAzLuC,SAyLvC;AAmDO,UAxOA,kBAAA,CAwOe;EAAA,IAAA,EAAA,MAAA;EAAA,aAE1B,EAAA,MAAA;;;AAEyB;AA4C/B;;;;AAEU;AA+CV;;;;AAG+B;AAS/B;;;;AAEU;iBAjUM,iBAAA,8CAGb;UAac,qBAAA;;;;;;;;;;;;;iBAuDD,iBAAA;;;;;;;iBAsDM,UAAA,gBAEnB,QAAQ;;;;;;;;;;;;;;;;;;iBA8BW,mBAAA,gBAEnB,QAAQ;UAmDM,eAAA;;OAEX;aACM;aACA;;;;;;;;;;;;;;;iBA4CU,aAAA,gBAEnB,QAAQ;UA+CM,gBAAA;;OAEX;aACM;;;;;;;;iBASU,oBAAA,gBAEnB,QAAQ"}
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,QAAQ,YAAY;iBAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;wBAoBe,kBACf,sBACA,uBACE;iBAac;EAChB;EACA;;;qBA2CY,uBAAuB;WACd;EAArB,YAAqB;;;;;;;;wBAoCA,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuCW,sBACrB,eACE,QAAQ;wBAKW,oBACrB,eACE,QAAQ;;;;;;;;qBA4DE,sCAAsC;WAC7B;EAArB,YAAqB;;iBAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;qBAqCY,mBAAmB;WAErB;WACA,MAAM,SAAS;EAFzB,YACU,aACA,MAAM,SAAS;;;;;;;;;;;;;;;wBAoCJ,cACrB,eACE,QAAQ;;qBAkBE,uBAAuB;WACd;EAArB,YAAqB;;iBAQL;;EAEhB;EACA,KAAK;EACL,WAAW;EACX;;;;;;;;;wBAUqB,qBACrB,eACE,QAAQ"}
package/dist/config.d.mts CHANGED
@@ -1,8 +1,6 @@
1
- import { GkmConfig, LoadedConfig, NormalizedAppConfig, NormalizedWorkspace, WorkspaceConfig } from "./types-C-arnQ1r.mjs";
2
- import { defineWorkspace } from "./index-BThUzEIp.mjs";
3
-
1
+ import { S as WorkspaceConfig, g as LoadedConfig, r as GkmConfig, v as NormalizedAppConfig, y as NormalizedWorkspace } from "./types-0R124hrY.mjs";
2
+ import { i as defineWorkspace } from "./index-BOyaGcCm.mjs";
4
3
  //#region src/config.d.ts
5
-
6
4
  /**
7
5
  * Define GKM configuration with full TypeScript support.
8
6
  * This is an identity function that provides type safety and autocomplete.
@@ -20,8 +18,8 @@ import { defineWorkspace } from "./index-BThUzEIp.mjs";
20
18
  * });
21
19
  * ```
22
20
  */
23
- declare function defineConfig(config: GkmConfig): GkmConfig;
24
- interface ParsedModuleConfig {
21
+ export declare function defineConfig(config: GkmConfig): GkmConfig;
22
+ export interface ParsedModuleConfig {
25
23
  path: string;
26
24
  importPattern: string;
27
25
  }
@@ -42,28 +40,23 @@ interface ParsedModuleConfig {
42
40
  * parseModuleConfig('./src/config/env#myEnv', 'envParser')
43
41
  * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
44
42
  */
45
- declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
46
- interface ConfigDiscoveryResult {
43
+ export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
44
+ export interface ConfigDiscoveryResult {
47
45
  configPath: string;
48
46
  workspaceRoot: string;
49
47
  }
50
- /**
51
- * Get app name from package.json in the given directory.
52
- * Handles scoped packages by extracting the name after the scope.
53
- *
54
- * @example
55
- * getAppNameFromCwd('/path/to/apps/api')
56
- * // package.json: { "name": "@myorg/api" }
57
- * // Returns: 'api'
58
- */
59
- declare function getAppNameFromCwd(cwd?: string): string | null;
48
+ /** No gkm config in a directory or any of its parents. */
49
+ export declare class ConfigNotFound extends Error {
50
+ readonly cwd: string;
51
+ constructor(cwd: string);
52
+ }
60
53
  /**
61
54
  * Load configuration file (single-app format).
62
55
  * For backwards compatibility with existing code.
63
56
  *
64
57
  * @deprecated Use loadWorkspaceConfig for new code
65
58
  */
66
- declare function loadConfig(cwd?: string): Promise<GkmConfig>;
59
+ export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
67
60
  /**
68
61
  * Load configuration file and process it as a workspace.
69
62
  * Works with both single-app and workspace configurations.
@@ -81,8 +74,29 @@ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
81
74
  * }
82
75
  * ```
83
76
  */
84
- declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
85
- interface AppConfigResult {
77
+ /**
78
+ * The workspace a directory belongs to, as its config states it — without
79
+ * discovering its constructs.
80
+ *
81
+ * For callers that need a fact the config holds (where a stage's secrets are
82
+ * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
83
+ * construct module to derive the apps, which is a cost a secrets read should
84
+ * not pay.
85
+ */
86
+ export declare function loadWorkspaceSettings(cwd?: string): Promise<LoadedConfig['workspace']>;
87
+ export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
88
+ /**
89
+ * A workspace with no `constructs` glob.
90
+ *
91
+ * In v10 every address, container and app comes from what the workspace
92
+ * declares — there is no second path that reads a hand-written compose file or
93
+ * an `apps` block's ports. A config that declares nothing has nothing to run.
94
+ */
95
+ export declare class WorkspaceDeclaresNoConstructs extends Error {
96
+ readonly root: string;
97
+ constructor(root: string);
98
+ }
99
+ export interface AppConfigResult {
86
100
  appName: string;
87
101
  app: NormalizedAppConfig;
88
102
  gkmConfig: GkmConfig;
@@ -90,31 +104,46 @@ interface AppConfigResult {
90
104
  workspaceRoot: string;
91
105
  appRoot: string;
92
106
  }
107
+ /** A directory that no app in the workspace lives in. */
108
+ export declare class NotInAnApp extends Error {
109
+ readonly cwd: string;
110
+ readonly apps: Readonly<Record<string, string>>;
111
+ constructor(cwd: string, apps: Readonly<Record<string, string>>);
112
+ }
93
113
  /**
94
- * Load app-specific configuration from workspace.
95
- * Uses the app name from package.json to find the correct app config.
114
+ * The backend app a directory is part of, with its gkm config — found by the
115
+ * `path` its construct declares.
96
116
  *
97
117
  * @example
98
118
  * ```ts
99
- * // From apps/api directory with package.json: { "name": "@myorg/api" }
119
+ * // From apps/api, where a construct declares `path: 'apps/api'`
100
120
  * const { app, workspace, workspaceRoot } = await loadAppConfig();
101
- * console.log(app.routes); // './src/endpoints/**\/*.ts'
102
121
  * ```
122
+ *
123
+ * @throws {NotInAnApp} when no app's path contains the directory.
124
+ * @throws {NotABackendApp} when the app it is in has no gkm config to run.
103
125
  */
104
- declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
105
- interface WorkspaceAppInfo {
126
+ export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
127
+ /** The app a directory is in has no gkm config — a site, or an entry app. */
128
+ export declare class NotABackendApp extends Error {
129
+ readonly appName: string;
130
+ constructor(appName: string);
131
+ }
132
+ export interface WorkspaceAppInfo {
133
+ /** The app's key in the workspace. */
106
134
  appName: string;
107
135
  app: NormalizedAppConfig;
108
136
  workspace: NormalizedWorkspace;
109
137
  workspaceRoot: string;
110
138
  }
111
139
  /**
112
- * Load workspace info for any app (frontend or backend).
113
- * Unlike loadAppConfig, this does NOT require the app to have a gkm config
114
- * (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.
140
+ * The app a directory is part of, frontend or backend — found by the `path`
141
+ * its construct declares. Unlike `loadAppConfig`, the app need not have a
142
+ * gkm config, which is what `gkm exec` and `gkm test` from a site need.
143
+ *
144
+ * @throws {NotInAnApp} when no app's path contains the directory.
115
145
  */
116
- declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
117
- //# sourceMappingURL=config.d.ts.map
146
+ export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
118
147
  //#endregion
119
- export { AppConfigResult, ConfigDiscoveryResult, GkmConfig, LoadedConfig, ParsedModuleConfig, WorkspaceAppInfo, WorkspaceConfig, defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };
148
+ export { type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
120
149
  //# sourceMappingURL=config.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoC0D;AAI1D;AAsBA;AAgBA;AAuDA;AAsDA;;;;AAEU;AA8BV;;;;AAEU,iBAzLM,YAAA,CAyLN,MAAA,EAzL2B,SAyL3B,CAAA,EAzLuC,SAyLvC;AAmDO,UAxOA,kBAAA,CAwOe;EAAA,IAAA,EAAA,MAAA;EAAA,aAE1B,EAAA,MAAA;;;AAEyB;AA4C/B;;;;AAEU;AA+CV;;;;AAG+B;AAS/B;;;;AAEU;iBAjUM,iBAAA,8CAGb;UAac,qBAAA;;;;;;;;;;;;;iBAuDD,iBAAA;;;;;;;iBAsDM,UAAA,gBAEnB,QAAQ;;;;;;;;;;;;;;;;;;iBA8BW,mBAAA,gBAEnB,QAAQ;UAmDM,eAAA;;OAEX;aACM;aACA;;;;;;;;;;;;;;;iBA4CU,aAAA,gBAEnB,QAAQ;UA+CM,gBAAA;;OAEX;aACM;;;;;;;;iBASU,oBAAA,gBAEnB,QAAQ"}
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,QAAQ,YAAY;iBAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;wBAoBe,kBACf,sBACA,uBACE;iBAac;EAChB;EACA;;;qBA2CY,uBAAuB;WACd;EAArB,YAAqB;;;;;;;;wBAoCA,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuCW,sBACrB,eACE,QAAQ;wBAKW,oBACrB,eACE,QAAQ;;;;;;;;qBA4DE,sCAAsC;WAC7B;EAArB,YAAqB;;iBAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;qBAqCY,mBAAmB;WAErB;WACA,MAAM,SAAS;EAFzB,YACU,aACA,MAAM,SAAS;;;;;;;;;;;;;;;wBAoCJ,cACrB,eACE,QAAQ;;qBAkBE,uBAAuB;WACd;EAArB,YAAqB;;iBAQL;;EAEhB;EACA,KAAK;EACL,WAAW;EACX;;;;;;;;;wBAUqB,qBACrB,eACE,QAAQ"}
package/dist/config.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import "./discover-CAlFgYec.mjs";
2
- import { defineConfig, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig } from "./config-WRdsQYZK.mjs";
3
- import { defineWorkspace } from "./workspace-BFMrAKqI.mjs";
4
-
5
- export { defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };
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-5watB1D0.mjs";
2
+ import { i as defineWorkspace } from "./workspace-DOmIhiau.mjs";
3
+ export { ConfigNotFound, NotABackendApp, NotInAnApp, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
@@ -1,8 +1,16 @@
1
- const require_chunk = require('../chunk-CUT6urMc.cjs');
2
- const __geekmidas_envkit_sniffer = require_chunk.__toESM(require("@geekmidas/envkit/sniffer"));
3
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _geekmidas_envkit_sniffer = require("@geekmidas/envkit/sniffer");
4
3
  //#region src/deploy/sniffer-envkit-patch.ts
5
- if (!globalThis.__envSniffer) globalThis.__envSniffer = new __geekmidas_envkit_sniffer.SnifferEnvironmentParser();
4
+ /**
5
+ * Patched @geekmidas/envkit module for entry app sniffing.
6
+ *
7
+ * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,
8
+ * allowing entry apps to be imported while capturing their env var usage.
9
+ *
10
+ * The actual sniffer instance is stored in globalThis.__envSniffer
11
+ * so the worker script can retrieve the captured variables.
12
+ */
13
+ if (!globalThis.__envSniffer) globalThis.__envSniffer = new _geekmidas_envkit_sniffer.SnifferEnvironmentParser();
6
14
  /**
7
15
  * Patched EnvironmentParser that uses the global sniffer instance.
8
16
  *
@@ -15,13 +23,13 @@ var PatchedEnvironmentParser = class {
15
23
  return globalThis.__envSniffer.create(builder);
16
24
  }
17
25
  };
18
-
19
26
  //#endregion
20
27
  exports.EnvironmentParser = PatchedEnvironmentParser;
21
- Object.defineProperty(exports, 'SnifferEnvironmentParser', {
22
- enumerable: true,
23
- get: function () {
24
- return __geekmidas_envkit_sniffer.SnifferEnvironmentParser;
25
- }
28
+ Object.defineProperty(exports, "SnifferEnvironmentParser", {
29
+ enumerable: true,
30
+ get: function() {
31
+ return _geekmidas_envkit_sniffer.SnifferEnvironmentParser;
32
+ }
26
33
  });
34
+
27
35
  //# sourceMappingURL=sniffer-envkit-patch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-envkit-patch.cjs","names":["SnifferEnvironmentParser","builder: (get: EnvFetcher) => TReturn"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;;AAoBA,KAAK,WAAW,aACf,YAAW,eAAe,IAAIA;;;;;;;;AAyB/B,IAAM,2BAAN,MAA+B;CAC9B,OACCC,SACwB;AACxB,SAAO,WAAW,aAAc,OAC/B,QACA;CACD;AACD"}
1
+ {"version":3,"file":"sniffer-envkit-patch.cjs","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAI,CAAC,WAAW,cACf,WAAW,eAAe,IAAIA,0BAAAA,yBAAyB;;;;;;;;AAyBxD,IAAM,2BAAN,MAA+B;CAC9B,OACC,SACwB;EACxB,OAAO,WAAW,aAAc,OAC/B,OACD;CACD;AACD"}
@@ -1,7 +1,5 @@
1
1
  import { SnifferEnvironmentParser, SnifferEnvironmentParser as SnifferEnvironmentParser$1 } from "@geekmidas/envkit/sniffer";
2
-
3
2
  //#region src/deploy/sniffer-envkit-patch.d.ts
4
-
5
3
  declare global {
6
4
  var __envSniffer: SnifferEnvironmentParser$1 | undefined;
7
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-envkit-patch.d.cts","names":[],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":[],"mappings":";;;;QA0BU,MAAA,CAAA;EAAC,IAC0B,YAAA,EAZlB,0BAYkB,GAAA,SAAA;;AAAoC,UAF/D,YAE+D,CAAA,CAAA,CAAA,CAAA;EAIpE,KAAA,EAAA,EALK,CAKL;EAAU,SAAA,EAAA,EAAA;IAIF,OAAA,EAAA,IAAA;IACa,IAAA,EATW,CASX;EAAU,CAAA,GAAA;IAU9B,OAAA,EAAA,KAAA;IAAwB,KAAA,EAnBsC,KAmBtC;EAAA,CAAA;;KAfzB,UAAA,GAiB2B,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA;EAAO,MACtB,EAAA,EAAA;IAAb,KAAA,EAAA,EAAA,MAAA;IAAY,SAAA,EAAA,EAAA,OAAA;;;;;;;;;;cAdH;2BACa;;;;;;;;;cAUpB,wBAAA;yBACkB,wCACP,eAAe,UAC5B,aAAa"}
1
+ {"version":3,"file":"sniffer-envkit-patch.d.cts","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"mappings":";;QAaQ;MAEH,cAAcA;;UAUT,aAAa;EACtB,SAAS;EACT;IAAe;IAAe,MAAM;;IAAQ;IAAgB,OAAO;;;KAI/D,cAAc;EAClB;IAAY;IAAiB;;EAC7B;IAAY;IAAiB;;EAC7B;IAAa;IAAkB;;EAC/B,YAAY;EACZ,QAAQ,iBAAiB;;;;;;;;;cAUpB;EACL,OAAO,gBAAgB,yBACtB,UAAU,KAAK,eAAe,UAC5B,aAAa"}
@@ -1,7 +1,5 @@
1
1
  import { SnifferEnvironmentParser, SnifferEnvironmentParser as SnifferEnvironmentParser$1 } from "@geekmidas/envkit/sniffer";
2
-
3
2
  //#region src/deploy/sniffer-envkit-patch.d.ts
4
-
5
3
  declare global {
6
4
  var __envSniffer: SnifferEnvironmentParser$1 | undefined;
7
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-envkit-patch.d.mts","names":[],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":[],"mappings":";;;;QA0BU,MAAA,CAAA;EAAC,IAC0B,YAAA,EAZlB,0BAYkB,GAAA,SAAA;;AAAoC,UAF/D,YAE+D,CAAA,CAAA,CAAA,CAAA;EAIpE,KAAA,EAAA,EALK,CAKL;EAAU,SAAA,EAAA,EAAA;IAIF,OAAA,EAAA,IAAA;IACa,IAAA,EATW,CASX;EAAU,CAAA,GAAA;IAU9B,OAAA,EAAA,KAAA;IAAwB,KAAA,EAnBsC,KAmBtC;EAAA,CAAA;;KAfzB,UAAA,GAiB2B,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA;EAAO,MACtB,EAAA,EAAA;IAAb,KAAA,EAAA,EAAA,MAAA;IAAY,SAAA,EAAA,EAAA,OAAA;;;;;;;;;;cAdH;2BACa;;;;;;;;;cAUpB,wBAAA;yBACkB,wCACP,eAAe,UAC5B,aAAa"}
1
+ {"version":3,"file":"sniffer-envkit-patch.d.mts","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"mappings":";;QAaQ;MAEH,cAAcA;;UAUT,aAAa;EACtB,SAAS;EACT;IAAe;IAAe,MAAM;;IAAQ;IAAgB,OAAO;;;KAI/D,cAAc;EAClB;IAAY;IAAiB;;EAC7B;IAAY;IAAiB;;EAC7B;IAAa;IAAkB;;EAC/B,YAAY;EACZ,QAAQ,iBAAiB;;;;;;;;;cAUpB;EACL,OAAO,gBAAgB,yBACtB,UAAU,KAAK,eAAe,UAC5B,aAAa"}
@@ -1,6 +1,14 @@
1
1
  import { SnifferEnvironmentParser, SnifferEnvironmentParser as SnifferEnvironmentParser$1 } from "@geekmidas/envkit/sniffer";
2
-
3
2
  //#region src/deploy/sniffer-envkit-patch.ts
3
+ /**
4
+ * Patched @geekmidas/envkit module for entry app sniffing.
5
+ *
6
+ * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,
7
+ * allowing entry apps to be imported while capturing their env var usage.
8
+ *
9
+ * The actual sniffer instance is stored in globalThis.__envSniffer
10
+ * so the worker script can retrieve the captured variables.
11
+ */
4
12
  if (!globalThis.__envSniffer) globalThis.__envSniffer = new SnifferEnvironmentParser$1();
5
13
  /**
6
14
  * Patched EnvironmentParser that uses the global sniffer instance.
@@ -14,7 +22,7 @@ var PatchedEnvironmentParser = class {
14
22
  return globalThis.__envSniffer.create(builder);
15
23
  }
16
24
  };
17
-
18
25
  //#endregion
19
26
  export { PatchedEnvironmentParser as EnvironmentParser, SnifferEnvironmentParser };
27
+
20
28
  //# sourceMappingURL=sniffer-envkit-patch.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-envkit-patch.mjs","names":["SnifferEnvironmentParser","builder: (get: EnvFetcher) => TReturn"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;AAoBA,KAAK,WAAW,aACf,YAAW,eAAe,IAAIA;;;;;;;;AAyB/B,IAAM,2BAAN,MAA+B;CAC9B,OACCC,SACwB;AACxB,SAAO,WAAW,aAAc,OAC/B,QACA;CACD;AACD"}
1
+ {"version":3,"file":"sniffer-envkit-patch.mjs","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;;;;;;;;;AAoBA,IAAI,CAAC,WAAW,cACf,WAAW,eAAe,IAAIA,2BAAyB;;;;;;;;AAyBxD,IAAM,2BAAN,MAA+B;CAC9B,OACC,SACwB;EACxB,OAAO,WAAW,aAAc,OAC/B,OACD;CACD;AACD"}
@@ -1,10 +1,16 @@
1
- const require_chunk = require('../chunk-CUT6urMc.cjs');
2
- const node_fs = require_chunk.__toESM(require("node:fs"));
3
- const node_path = require_chunk.__toESM(require("node:path"));
4
- const node_url = require_chunk.__toESM(require("node:url"));
5
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let node_fs = require("node:fs");
3
+ let node_path = require("node:path");
6
4
  //#region src/deploy/sniffer-hooks.ts
7
- const __filename$1 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
5
+ /**
6
+ * Module loader hooks for entry app sniffing.
7
+ *
8
+ * This module provides the resolve hook that intercepts '@geekmidas/envkit'
9
+ * imports and redirects them to the patched sniffer version.
10
+ *
11
+ * This file is registered via module.register() from sniffer-loader.ts.
12
+ */
13
+ const __filename$1 = (0, require("node:url").fileURLToPath)(require("url").pathToFileURL(__filename).href);
8
14
  const __dirname$1 = (0, node_path.dirname)(__filename$1);
9
15
  const mjsPath = (0, node_path.join)(__dirname$1, "sniffer-envkit-patch.mjs");
10
16
  const tsPath = (0, node_path.join)(__dirname$1, "sniffer-envkit-patch.ts");
@@ -19,7 +25,7 @@ async function resolve(specifier, context, nextResolve) {
19
25
  };
20
26
  return nextResolve(specifier, context);
21
27
  }
22
-
23
28
  //#endregion
24
29
  exports.resolve = resolve;
30
+
25
31
  //# sourceMappingURL=sniffer-hooks.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-hooks.cjs","names":["__filename","__dirname","specifier: string","context: ResolveContext","nextResolve: NextResolve"],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;AAcA,MAAMA,eAAa,0EAA8B;AACjD,MAAMC,cAAY,uBAAQD,aAAW;AAGrC,MAAM,UAAU,oBAAKC,aAAW,2BAA2B;AAC3D,MAAM,SAAS,oBAAKA,aAAW,0BAA0B;AACzD,MAAM,oBAAoB,wBAAW,QAAQ,GAAG,UAAU;;;;AAsB1D,eAAsB,QACrBC,WACAC,SACAC,aACyB;AAEzB,KAAI,cAAc,oBACjB,QAAO;EACN,MAAM,SAAS,kBAAkB;EACjC,cAAc;CACd;AAGF,QAAO,YAAY,WAAW,QAAQ;AACtC"}
1
+ {"version":3,"file":"sniffer-hooks.cjs","names":["__filename","fileURLToPath","__dirname","dirname","join","existsSync"],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,gBAAAA,qBAAaC,CAAAA,CAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AAChD,MAAMC,eAAAA,GAAYC,UAAAA,QAAAA,CAAQH,YAAU;AAGpC,MAAM,WAAA,GAAUI,UAAAA,KAAAA,CAAKF,aAAW,0BAA0B;AAC1D,MAAM,UAAA,GAASE,UAAAA,KAAAA,CAAKF,aAAW,yBAAyB;AACxD,MAAM,qBAAA,GAAoBG,QAAAA,WAAAA,CAAW,OAAO,IAAI,UAAU;;;;AAsB1D,eAAsB,QACrB,WACA,SACA,aACyB;CAEzB,IAAI,cAAc,qBACjB,OAAO;EACN,KAAK,UAAU;EACf,cAAc;CACf;CAGD,OAAO,YAAY,WAAW,OAAO;AACtC"}
@@ -21,7 +21,6 @@ type NextResolve = (specifier: string, context: ResolveContext) => Promise<Resol
21
21
  /**
22
22
  * Resolve hook - intercepts module resolution for @geekmidas/envkit
23
23
  */
24
- declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
24
+ export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
25
25
  //#endregion
26
- export { resolve };
27
26
  //# sourceMappingURL=sniffer-hooks.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-hooks.d.cts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":[],"mappings":";;;AAwByB;AAIP;;;;;AASN,KAfP,cAAA,GAeO;EAKU,UAAO,EAAA,MAAA,EAAA;EAAA,gBAAA,EAlBV,MAkBU,CAAA,MAAA,EAAA,MAAA,CAAA;EAAA,SAEnB,CAAA,EAAA,MAAA;CAAc;KAhBnB,aAAA,GAkBM;EAAa,GAArB,EAAA,MAAA;EAAO,YAAA,CAAA,EAAA,OAAA;;;KAZL,WAAA,gCAEK,mBACL,QAAQ;;;;iBAKS,OAAA,6BAEZ,6BACI,cACX,QAAQ"}
1
+ {"version":3,"file":"sniffer-hooks.d.cts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"mappings":";;;;;;;;;KAsBK;EACJ;EACA,kBAAkB;EAClB;;KAGI;EACJ;EACA;EACA;;KAGI,eACJ,mBACA,SAAS,mBACL,QAAQ;;;;wBAKS,QACrB,mBACA,SAAS,gBACT,aAAa,cACX,QAAQ"}
@@ -21,7 +21,6 @@ type NextResolve = (specifier: string, context: ResolveContext) => Promise<Resol
21
21
  /**
22
22
  * Resolve hook - intercepts module resolution for @geekmidas/envkit
23
23
  */
24
- declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
24
+ export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
25
25
  //#endregion
26
- export { resolve };
27
26
  //# sourceMappingURL=sniffer-hooks.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-hooks.d.mts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":[],"mappings":";;;AAwByB;AAIP;;;;;AASN,KAfP,cAAA,GAeO;EAKU,UAAO,EAAA,MAAA,EAAA;EAAA,gBAAA,EAlBV,MAkBU,CAAA,MAAA,EAAA,MAAA,CAAA;EAAA,SAEnB,CAAA,EAAA,MAAA;CAAc;KAhBnB,aAAA,GAkBM;EAAa,GAArB,EAAA,MAAA;EAAO,YAAA,CAAA,EAAA,OAAA;;;KAZL,WAAA,gCAEK,mBACL,QAAQ;;;;iBAKS,OAAA,6BAEZ,6BACI,cACX,QAAQ"}
1
+ {"version":3,"file":"sniffer-hooks.d.mts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"mappings":";;;;;;;;;KAsBK;EACJ;EACA,kBAAkB;EAClB;;KAGI;EACJ;EACA;EACA;;KAGI,eACJ,mBACA,SAAS,mBACL,QAAQ;;;;wBAKS,QACrB,mBACA,SAAS,gBACT,aAAa,cACX,QAAQ"}
@@ -1,8 +1,15 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
-
5
4
  //#region src/deploy/sniffer-hooks.ts
5
+ /**
6
+ * Module loader hooks for entry app sniffing.
7
+ *
8
+ * This module provides the resolve hook that intercepts '@geekmidas/envkit'
9
+ * imports and redirects them to the patched sniffer version.
10
+ *
11
+ * This file is registered via module.register() from sniffer-loader.ts.
12
+ */
6
13
  const __filename = fileURLToPath(import.meta.url);
7
14
  const __dirname = dirname(__filename);
8
15
  const mjsPath = join(__dirname, "sniffer-envkit-patch.mjs");
@@ -18,7 +25,7 @@ async function resolve(specifier, context, nextResolve) {
18
25
  };
19
26
  return nextResolve(specifier, context);
20
27
  }
21
-
22
28
  //#endregion
23
29
  export { resolve };
30
+
24
31
  //# sourceMappingURL=sniffer-hooks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sniffer-hooks.mjs","names":["specifier: string","context: ResolveContext","nextResolve: NextResolve"],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;AAcA,MAAM,aAAa,cAAc,OAAO,KAAK,IAAI;AACjD,MAAM,YAAY,QAAQ,WAAW;AAGrC,MAAM,UAAU,KAAK,WAAW,2BAA2B;AAC3D,MAAM,SAAS,KAAK,WAAW,0BAA0B;AACzD,MAAM,oBAAoB,WAAW,QAAQ,GAAG,UAAU;;;;AAsB1D,eAAsB,QACrBA,WACAC,SACAC,aACyB;AAEzB,KAAI,cAAc,oBACjB,QAAO;EACN,MAAM,SAAS,kBAAkB;EACjC,cAAc;CACd;AAGF,QAAO,YAAY,WAAW,QAAQ;AACtC"}
1
+ {"version":3,"file":"sniffer-hooks.mjs","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAGpC,MAAM,UAAU,KAAK,WAAW,0BAA0B;AAC1D,MAAM,SAAS,KAAK,WAAW,yBAAyB;AACxD,MAAM,oBAAoB,WAAW,OAAO,IAAI,UAAU;;;;AAsB1D,eAAsB,QACrB,WACA,SACA,aACyB;CAEzB,IAAI,cAAc,qBACjB,OAAO;EACN,KAAK,UAAU;EACf,cAAc;CACf;CAGD,OAAO,YAAY,WAAW,OAAO;AACtC"}
@@ -1,16 +1,25 @@
1
- const require_chunk = require('../chunk-CUT6urMc.cjs');
2
- const node_fs = require_chunk.__toESM(require("node:fs"));
3
- const node_path = require_chunk.__toESM(require("node:path"));
4
- const node_url = require_chunk.__toESM(require("node:url"));
5
- const node_module = require_chunk.__toESM(require("node:module"));
6
-
1
+ let node_fs = require("node:fs");
2
+ let node_path = require("node:path");
3
+ let node_module = require("node:module");
4
+ let node_url = require("node:url");
7
5
  //#region src/deploy/sniffer-loader.ts
6
+ /**
7
+ * Node.js module loader registration for entry app sniffing.
8
+ *
9
+ * This module registers a custom loader hook that intercepts imports of
10
+ * '@geekmidas/envkit' and replaces the EnvironmentParser with
11
+ * SnifferEnvironmentParser, allowing us to capture which environment
12
+ * variables an entry app accesses.
13
+ *
14
+ * Usage:
15
+ * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts
16
+ */
8
17
  const __filename$1 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
9
18
  const __dirname$1 = (0, node_path.dirname)(__filename$1);
10
19
  const mjsPath = (0, node_path.join)(__dirname$1, "sniffer-hooks.mjs");
11
20
  const tsPath = (0, node_path.join)(__dirname$1, "sniffer-hooks.ts");
12
21
  const hooksPath = (0, node_fs.existsSync)(mjsPath) ? mjsPath : tsPath;
13
22
  (0, node_module.register)((0, node_url.pathToFileURL)(hooksPath).href, require("url").pathToFileURL(__filename).href);
14
-
15
23
  //#endregion
24
+
16
25
  //# sourceMappingURL=sniffer-loader.cjs.map