@geekmidas/cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +7 -7
  2. package/dist/{CronGenerator-BPTqNYOR.d.cts → CronGenerator-DWS3CCZt.d.cts} +4 -4
  3. package/dist/{CronGenerator-YAj59JUd.d.mts → CronGenerator-DZjdkEjI.d.mts} +4 -4
  4. package/dist/{EndpointGenerator-ChAD1INz.d.cts → EndpointGenerator-Dh7kMtuL.d.mts} +4 -4
  5. package/dist/{EndpointGenerator-Cj3O1U8-.d.mts → EndpointGenerator-zBsie_7s.d.cts} +4 -4
  6. package/dist/{FunctionGenerator-429-9NER.d.cts → FunctionGenerator-BmDHo27U.d.mts} +4 -4
  7. package/dist/{FunctionGenerator-BQ4ehoID.d.mts → FunctionGenerator-DXjXBxUd.d.cts} +4 -4
  8. package/dist/{Generator-BjHK_qce.d.mts → Generator-BGY-2dgI.d.cts} +3 -3
  9. package/dist/{Generator-DxQMCQp7.d.cts → Generator-yi9DH5TN.d.mts} +3 -3
  10. package/dist/{OpenApiTsGenerator-C4mHHaku.mjs → OpenApiTsGenerator-0ZDYWro5.mjs} +1 -1
  11. package/dist/{OpenApiTsGenerator-C4mHHaku.mjs.map → OpenApiTsGenerator-0ZDYWro5.mjs.map} +1 -1
  12. package/dist/{OpenApiTsGenerator-Be-sKGTT.cjs → OpenApiTsGenerator-wLwpaq_I.cjs} +1 -1
  13. package/dist/{OpenApiTsGenerator-Be-sKGTT.cjs.map → OpenApiTsGenerator-wLwpaq_I.cjs.map} +1 -1
  14. package/dist/{SubscriberGenerator-7uX42xyG.d.mts → SubscriberGenerator-Bb-z3Kvx.d.cts} +4 -4
  15. package/dist/{SubscriberGenerator-Dtb3HS4i.d.cts → SubscriberGenerator-CwsXqCpS.d.mts} +4 -4
  16. package/dist/{api-BKIN0s0S.mjs → api-Bp5TIl1R.mjs} +29 -46
  17. package/dist/api-Bp5TIl1R.mjs.map +1 -0
  18. package/dist/{api-B3SCEHPf.cjs → api-D4W9-tdZ.cjs} +29 -46
  19. package/dist/api-D4W9-tdZ.cjs.map +1 -0
  20. package/dist/build/index.cjs +5 -3
  21. package/dist/build/index.d.cts +1 -1
  22. package/dist/build/index.d.mts +1 -1
  23. package/dist/build/index.mjs +5 -3
  24. package/dist/build/manifests.cjs +1 -1
  25. package/dist/build/manifests.d.cts +1 -1
  26. package/dist/build/manifests.d.mts +1 -1
  27. package/dist/build/manifests.mjs +1 -1
  28. package/dist/build/providerResolver.d.cts +1 -1
  29. package/dist/build/providerResolver.d.mts +1 -1
  30. package/dist/build/types.d.cts +2 -2
  31. package/dist/build/types.d.mts +2 -2
  32. package/dist/{build-B8C_qHir.mjs → build-BLriHKgm.mjs} +3 -3
  33. package/dist/{build-B8C_qHir.mjs.map → build-BLriHKgm.mjs.map} +1 -1
  34. package/dist/{build-D0Wr49bf.cjs → build-Z3yGHcy2.cjs} +3 -3
  35. package/dist/{build-D0Wr49bf.cjs.map → build-Z3yGHcy2.cjs.map} +1 -1
  36. package/dist/{config-CLEDqKO3.cjs → config-BP1IZynR.cjs} +17 -6
  37. package/dist/config-BP1IZynR.cjs.map +1 -0
  38. package/dist/{config-Ba-Gbpbc.d.cts → config-CIzRhm_D.d.mts} +2 -2
  39. package/dist/{config-DBsmMDhf.d.mts → config-CvehIYsb.d.cts} +2 -2
  40. package/dist/{config-Dp8RonV_.mjs → config-UCK12Lrr.mjs} +17 -6
  41. package/dist/config-UCK12Lrr.mjs.map +1 -0
  42. package/dist/config.d.cts +1 -1
  43. package/dist/config.d.mts +1 -1
  44. package/dist/dev/index.cjs +3 -1
  45. package/dist/dev/index.d.cts +2 -2
  46. package/dist/dev/index.d.mts +2 -2
  47. package/dist/dev/index.mjs +3 -1
  48. package/dist/{dev-B734w3L1.mjs → dev-BimlVcuk.mjs} +6 -1
  49. package/dist/dev-BimlVcuk.mjs.map +1 -0
  50. package/dist/{dev-DHqYn8k4.cjs → dev-Dcrb_ZSL.cjs} +6 -1
  51. package/dist/dev-Dcrb_ZSL.cjs.map +1 -0
  52. package/dist/{docker-5d8Yh5_X.cjs → docker-2-ipZDOJ.cjs} +1 -1
  53. package/dist/{docker-5d8Yh5_X.cjs.map → docker-2-ipZDOJ.cjs.map} +1 -1
  54. package/dist/{docker-DlUqdFle.mjs → docker-31GNwU3F.mjs} +1 -1
  55. package/dist/{docker-DlUqdFle.mjs.map → docker-31GNwU3F.mjs.map} +1 -1
  56. package/dist/{env-HfuJRlg5.d.cts → env-CQ3hXAAW.d.mts} +2 -2
  57. package/dist/{env-B-OKjgI4.cjs → env-CS0jvg7k.cjs} +1 -1
  58. package/dist/{env-B-OKjgI4.cjs.map → env-CS0jvg7k.cjs.map} +1 -1
  59. package/dist/{env-nd-iQPYM.d.mts → env-D4YFgMqo.d.cts} +2 -2
  60. package/dist/{env-tv1HlZlw.mjs → env-DEeVOvVu.mjs} +1 -1
  61. package/dist/{env-tv1HlZlw.mjs.map → env-DEeVOvVu.mjs.map} +1 -1
  62. package/dist/generators/CronGenerator.d.cts +4 -4
  63. package/dist/generators/CronGenerator.d.mts +4 -4
  64. package/dist/generators/EndpointGenerator.d.cts +4 -4
  65. package/dist/generators/EndpointGenerator.d.mts +4 -4
  66. package/dist/generators/FunctionGenerator.d.cts +4 -4
  67. package/dist/generators/FunctionGenerator.d.mts +4 -4
  68. package/dist/generators/Generator.d.cts +3 -3
  69. package/dist/generators/Generator.d.mts +3 -3
  70. package/dist/generators/OpenApiTsGenerator.cjs +1 -1
  71. package/dist/generators/OpenApiTsGenerator.mjs +1 -1
  72. package/dist/generators/SubscriberGenerator.d.cts +4 -4
  73. package/dist/generators/SubscriberGenerator.d.mts +4 -4
  74. package/dist/generators/index.d.cts +7 -7
  75. package/dist/generators/index.d.mts +7 -7
  76. package/dist/{index-C523No_B.d.mts → index-DG6xNQMH.d.cts} +25 -8
  77. package/dist/{index-DrzN4xkQ.d.cts → index-DZgrOOOW.d.mts} +25 -8
  78. package/dist/index.cjs +21 -21
  79. package/dist/index.cjs.map +1 -1
  80. package/dist/index.mjs +21 -21
  81. package/dist/index.mjs.map +1 -1
  82. package/dist/init/generators/config.cjs +1 -1
  83. package/dist/init/generators/config.d.cts +2 -2
  84. package/dist/init/generators/config.d.mts +2 -2
  85. package/dist/init/generators/config.mjs +1 -1
  86. package/dist/init/generators/docker.cjs +1 -1
  87. package/dist/init/generators/docker.d.cts +1 -1
  88. package/dist/init/generators/docker.d.mts +1 -1
  89. package/dist/init/generators/docker.mjs +1 -1
  90. package/dist/init/generators/env.cjs +1 -1
  91. package/dist/init/generators/env.d.cts +2 -2
  92. package/dist/init/generators/env.d.mts +2 -2
  93. package/dist/init/generators/env.mjs +1 -1
  94. package/dist/init/generators/index.cjs +9 -4
  95. package/dist/init/generators/index.d.cts +5 -5
  96. package/dist/init/generators/index.d.mts +5 -5
  97. package/dist/init/generators/index.mjs +9 -4
  98. package/dist/init/generators/models.cjs +1 -1
  99. package/dist/init/generators/models.d.cts +1 -1
  100. package/dist/init/generators/models.d.mts +1 -1
  101. package/dist/init/generators/models.mjs +1 -1
  102. package/dist/init/generators/monorepo.cjs +1 -1
  103. package/dist/init/generators/monorepo.d.cts +1 -1
  104. package/dist/init/generators/monorepo.d.mts +1 -1
  105. package/dist/init/generators/monorepo.mjs +1 -1
  106. package/dist/init/generators/package.cjs +6 -1
  107. package/dist/init/generators/package.d.cts +2 -2
  108. package/dist/init/generators/package.d.mts +2 -2
  109. package/dist/init/generators/package.mjs +6 -1
  110. package/dist/init/generators/source.cjs +1 -1
  111. package/dist/init/generators/source.d.cts +2 -2
  112. package/dist/init/generators/source.d.mts +2 -2
  113. package/dist/init/generators/source.mjs +1 -1
  114. package/dist/init/index.cjs +14 -14
  115. package/dist/init/index.d.cts +1 -1
  116. package/dist/init/index.d.mts +1 -1
  117. package/dist/init/index.mjs +14 -14
  118. package/dist/init/templates/api.cjs +1 -1
  119. package/dist/init/templates/api.d.cts +1 -1
  120. package/dist/init/templates/api.d.mts +1 -1
  121. package/dist/init/templates/api.mjs +1 -1
  122. package/dist/init/templates/index.cjs +8 -6
  123. package/dist/init/templates/index.d.cts +2 -2
  124. package/dist/init/templates/index.d.mts +2 -2
  125. package/dist/init/templates/index.mjs +6 -6
  126. package/dist/init/templates/minimal.cjs +1 -1
  127. package/dist/init/templates/minimal.d.cts +1 -1
  128. package/dist/init/templates/minimal.d.mts +1 -1
  129. package/dist/init/templates/minimal.mjs +1 -1
  130. package/dist/init/templates/serverless.cjs +1 -1
  131. package/dist/init/templates/serverless.d.cts +1 -1
  132. package/dist/init/templates/serverless.d.mts +1 -1
  133. package/dist/init/templates/serverless.mjs +1 -1
  134. package/dist/init/templates/worker.cjs +1 -1
  135. package/dist/init/templates/worker.d.cts +1 -1
  136. package/dist/init/templates/worker.d.mts +1 -1
  137. package/dist/init/templates/worker.mjs +1 -1
  138. package/dist/init/utils.cjs +1 -1
  139. package/dist/init/utils.mjs +1 -1
  140. package/dist/{init-CtOnZn3G.mjs → init-BMA7xi8r.mjs} +37 -21
  141. package/dist/init-BMA7xi8r.mjs.map +1 -0
  142. package/dist/{init-qLFsWR-R.cjs → init-D-7WEk-b.cjs} +37 -21
  143. package/dist/init-D-7WEk-b.cjs.map +1 -0
  144. package/dist/{manifests-DIA_2QYd.mjs → manifests-BNKG6AXf.mjs} +1 -1
  145. package/dist/{manifests-DIA_2QYd.mjs.map → manifests-BNKG6AXf.mjs.map} +1 -1
  146. package/dist/{manifests-VJ9-2JpW.cjs → manifests-D13Ej8AE.cjs} +1 -1
  147. package/dist/{manifests-VJ9-2JpW.cjs.map → manifests-D13Ej8AE.cjs.map} +1 -1
  148. package/dist/{minimal-C4GsE45s.mjs → minimal-BkyASH_C.mjs} +15 -9
  149. package/dist/minimal-BkyASH_C.mjs.map +1 -0
  150. package/dist/{minimal-Bdhhpp7v.cjs → minimal-CSFggzdH.cjs} +15 -9
  151. package/dist/minimal-CSFggzdH.cjs.map +1 -0
  152. package/dist/{models-cvNg6Oea.mjs → models-BWlDfviw.mjs} +1 -1
  153. package/dist/{models-cvNg6Oea.mjs.map → models-BWlDfviw.mjs.map} +1 -1
  154. package/dist/{models-DyNwdOcz.cjs → models-BapGSoHC.cjs} +1 -1
  155. package/dist/{models-DyNwdOcz.cjs.map → models-BapGSoHC.cjs.map} +1 -1
  156. package/dist/{monorepo-Cknwzj5C.mjs → monorepo-BBOWhkcd.mjs} +1 -1
  157. package/dist/{monorepo-Cknwzj5C.mjs.map → monorepo-BBOWhkcd.mjs.map} +1 -1
  158. package/dist/{monorepo-sEK8gW59.cjs → monorepo-CFtxHeDh.cjs} +1 -1
  159. package/dist/{monorepo-sEK8gW59.cjs.map → monorepo-CFtxHeDh.cjs.map} +1 -1
  160. package/dist/openapi-CTae4ybf.cjs +98 -0
  161. package/dist/openapi-CTae4ybf.cjs.map +1 -0
  162. package/dist/openapi-Dn9MeKg3.mjs +74 -0
  163. package/dist/openapi-Dn9MeKg3.mjs.map +1 -0
  164. package/dist/{openapi-react-query-DxHjXQvg.cjs → openapi-react-query-Cp-w8_05.cjs} +1 -1
  165. package/dist/{openapi-react-query-DxHjXQvg.cjs.map → openapi-react-query-Cp-w8_05.cjs.map} +1 -1
  166. package/dist/{openapi-react-query-o7Mp1Jd5.mjs → openapi-react-query-_-B3s8v_.mjs} +1 -1
  167. package/dist/{openapi-react-query-o7Mp1Jd5.mjs.map → openapi-react-query-_-B3s8v_.mjs.map} +1 -1
  168. package/dist/openapi-react-query.cjs +1 -1
  169. package/dist/openapi-react-query.mjs +1 -1
  170. package/dist/openapi.cjs +6 -3
  171. package/dist/openapi.d.cts +23 -3
  172. package/dist/openapi.d.mts +23 -3
  173. package/dist/openapi.mjs +3 -3
  174. package/dist/{package-C7WhWU8m.d.mts → package-6h-7QfJZ.d.cts} +2 -2
  175. package/dist/{package-DvWEMz6z.d.cts → package-BCe_KvGv.d.mts} +2 -2
  176. package/dist/{package-CIfmeuSW.mjs → package-C3If80n1.mjs} +7 -1
  177. package/dist/package-C3If80n1.mjs.map +1 -0
  178. package/dist/{package-PP-o1nvq.cjs → package-Dk8IMBOB.cjs} +6 -1
  179. package/dist/package-Dk8IMBOB.cjs.map +1 -0
  180. package/dist/{serverless-Yav3GRVz.cjs → serverless-AGOS-l3G.cjs} +15 -10
  181. package/dist/serverless-AGOS-l3G.cjs.map +1 -0
  182. package/dist/{serverless-DkHBF2vC.mjs → serverless-D5HjJByU.mjs} +15 -10
  183. package/dist/serverless-D5HjJByU.mjs.map +1 -0
  184. package/dist/{source-DT5Xhiob.cjs → source-C1cyfHcF.cjs} +1 -1
  185. package/dist/{source-DT5Xhiob.cjs.map → source-C1cyfHcF.cjs.map} +1 -1
  186. package/dist/{source-D6v2BnKT.d.mts → source-C3LiNUV9.d.mts} +2 -2
  187. package/dist/{source-DnaH_MLA.mjs → source-CkQHBpwu.mjs} +1 -1
  188. package/dist/{source-DnaH_MLA.mjs.map → source-CkQHBpwu.mjs.map} +1 -1
  189. package/dist/{source-D8fK9qRo.d.cts → source-Dtcjbokc.d.cts} +2 -2
  190. package/dist/templates-C0EMmhwb.mjs +88 -0
  191. package/dist/templates-C0EMmhwb.mjs.map +1 -0
  192. package/dist/templates-CbgQ9dw0.cjs +123 -0
  193. package/dist/templates-CbgQ9dw0.cjs.map +1 -0
  194. package/dist/{types-Cxl8-uwV.d.mts → types-Bi7VzDUZ.d.mts} +31 -2
  195. package/dist/{types-C4KITv-y.d.mts → types-D2xYkOal.d.mts} +2 -2
  196. package/dist/{types-DLFN49M3.d.cts → types-DA-r8HWZ.d.cts} +2 -2
  197. package/dist/{types-DB99_qIy.d.cts → types-KmjzMgu8.d.cts} +31 -2
  198. package/dist/types.d.cts +2 -2
  199. package/dist/types.d.mts +2 -2
  200. package/dist/{utils-C31-SWHP.mjs → utils-CKEzCxc1.mjs} +1 -1
  201. package/dist/{utils-C31-SWHP.mjs.map → utils-CKEzCxc1.mjs.map} +1 -1
  202. package/dist/{utils-BX3F4fT8.cjs → utils-DSdN2MTt.cjs} +1 -1
  203. package/dist/{utils-BX3F4fT8.cjs.map → utils-DSdN2MTt.cjs.map} +1 -1
  204. package/dist/{worker--8O5a3Hv.cjs → worker-CGhlqNH-.cjs} +15 -9
  205. package/dist/worker-CGhlqNH-.cjs.map +1 -0
  206. package/dist/{worker-Jme7uOOJ.mjs → worker-CiP420As.mjs} +15 -9
  207. package/dist/worker-CiP420As.mjs.map +1 -0
  208. package/examples/gkm.config.ts +3 -5
  209. package/package.json +4 -4
  210. package/src/__tests__/openapi.spec.ts +395 -302
  211. package/src/dev/__tests__/index.spec.ts +114 -119
  212. package/src/dev/index.ts +18 -0
  213. package/src/init/generators/config.ts +23 -5
  214. package/src/init/generators/package.ts +11 -4
  215. package/src/init/index.ts +26 -7
  216. package/src/init/templates/api.ts +38 -56
  217. package/src/init/templates/index.ts +46 -11
  218. package/src/init/templates/minimal.ts +23 -10
  219. package/src/init/templates/serverless.ts +23 -11
  220. package/src/init/templates/worker.ts +23 -10
  221. package/src/openapi.ts +83 -45
  222. package/src/types.ts +30 -0
  223. package/dist/api-B3SCEHPf.cjs.map +0 -1
  224. package/dist/api-BKIN0s0S.mjs.map +0 -1
  225. package/dist/config-CLEDqKO3.cjs.map +0 -1
  226. package/dist/config-Dp8RonV_.mjs.map +0 -1
  227. package/dist/dev-B734w3L1.mjs.map +0 -1
  228. package/dist/dev-DHqYn8k4.cjs.map +0 -1
  229. package/dist/init-CtOnZn3G.mjs.map +0 -1
  230. package/dist/init-qLFsWR-R.cjs.map +0 -1
  231. package/dist/minimal-Bdhhpp7v.cjs.map +0 -1
  232. package/dist/minimal-C4GsE45s.mjs.map +0 -1
  233. package/dist/openapi-BQWPWyNB.cjs +0 -56
  234. package/dist/openapi-BQWPWyNB.cjs.map +0 -1
  235. package/dist/openapi-DBX8cJJ8.mjs +0 -50
  236. package/dist/openapi-DBX8cJJ8.mjs.map +0 -1
  237. package/dist/package-CIfmeuSW.mjs.map +0 -1
  238. package/dist/package-PP-o1nvq.cjs.map +0 -1
  239. package/dist/serverless-DkHBF2vC.mjs.map +0 -1
  240. package/dist/serverless-Yav3GRVz.cjs.map +0 -1
  241. package/dist/templates-CBFUwpBy.mjs +0 -64
  242. package/dist/templates-CBFUwpBy.mjs.map +0 -1
  243. package/dist/templates-DM_rtYYW.cjs +0 -87
  244. package/dist/templates-DM_rtYYW.cjs.map +0 -1
  245. package/dist/worker--8O5a3Hv.cjs.map +0 -1
  246. package/dist/worker-Jme7uOOJ.mjs.map +0 -1
@@ -32,6 +32,22 @@ const apiTemplate = {
32
32
  "fmt:check": "biome format ."
33
33
  },
34
34
  files: (options) => {
35
+ const { loggerType, routesStructure } = options;
36
+ const loggerContent = `import { createLogger } from '@geekmidas/logger/${loggerType}';
37
+
38
+ export const logger = createLogger();
39
+ `;
40
+ const getRoutePath = (file) => {
41
+ switch (routesStructure) {
42
+ case "centralized-endpoints": return `src/endpoints/${file}`;
43
+ case "centralized-routes": return `src/routes/${file}`;
44
+ case "domain-based": {
45
+ const parts = file.split("/");
46
+ if (parts.length === 1) return `src/${file.replace(".ts", "")}/routes/index.ts`;
47
+ return `src/${parts[0]}/routes/${parts.slice(1).join("/")}`;
48
+ }
49
+ }
50
+ };
35
51
  const files = [
36
52
  {
37
53
  path: "src/config/env.ts",
@@ -53,16 +69,10 @@ export const config = envParser
53
69
  },
54
70
  {
55
71
  path: "src/config/logger.ts",
56
- content: `import { PinoLogger } from '@geekmidas/logger/pino';
57
-
58
- export const logger = new PinoLogger({
59
- app: '${options.name}',
60
- level: process.env.LOG_LEVEL || 'info',
61
- });
62
- `
72
+ content: loggerContent
63
73
  },
64
74
  {
65
- path: "src/endpoints/health.ts",
75
+ path: getRoutePath("health.ts"),
66
76
  content: `import { e } from '@geekmidas/constructs/endpoints';
67
77
 
68
78
  export default e
@@ -72,39 +82,10 @@ export default e
72
82
  timestamp: new Date().toISOString(),
73
83
  }));
74
84
  `
75
- }
76
- ];
77
- if (options.routeStyle === "flat") files.push({
78
- path: "src/endpoints/users-list.ts",
79
- content: `import { e } from '@geekmidas/constructs/endpoints';
80
-
81
- export default e
82
- .get('/users')
83
- .handle(async () => ({
84
- users: [
85
- { id: '1', name: 'Alice' },
86
- { id: '2', name: 'Bob' },
87
- ],
88
- }));
89
- `
90
- }, {
91
- path: "src/endpoints/users-get.ts",
92
- content: `import { e } from '@geekmidas/constructs/endpoints';
93
- import { z } from 'zod';
94
-
95
- export default e
96
- .get('/users/:id')
97
- .params(z.object({ id: z.string() }))
98
- .handle(async ({ params }) => ({
99
- id: params.id,
100
- name: 'Alice',
101
- email: 'alice@example.com',
102
- }));
103
- `
104
- });
105
- else files.push({
106
- path: "src/endpoints/users/list.ts",
107
- content: `import { e } from '@geekmidas/constructs/endpoints';
85
+ },
86
+ {
87
+ path: getRoutePath("users/list.ts"),
88
+ content: `import { e } from '@geekmidas/constructs/endpoints';
108
89
 
109
90
  export default e
110
91
  .get('/users')
@@ -115,9 +96,10 @@ export default e
115
96
  ],
116
97
  }));
117
98
  `
118
- }, {
119
- path: "src/endpoints/users/get.ts",
120
- content: `import { e } from '@geekmidas/constructs/endpoints';
99
+ },
100
+ {
101
+ path: getRoutePath("users/get.ts"),
102
+ content: `import { e } from '@geekmidas/constructs/endpoints';
121
103
  import { z } from 'zod';
122
104
 
123
105
  export default e
@@ -129,7 +111,8 @@ export default e
129
111
  email: 'alice@example.com',
130
112
  }));
131
113
  `
132
- });
114
+ }
115
+ ];
133
116
  if (options.database) files.push({
134
117
  path: "src/services/database.ts",
135
118
  content: `import type { Service } from '@geekmidas/services';
@@ -181,4 +164,4 @@ export const telescope = new Telescope({
181
164
 
182
165
  //#endregion
183
166
  export { apiTemplate };
184
- //# sourceMappingURL=api-BKIN0s0S.mjs.map
167
+ //# sourceMappingURL=api-Bp5TIl1R.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-Bp5TIl1R.mjs","names":["apiTemplate: TemplateConfig","options: TemplateOptions","file: string","files: GeneratedFile[]"],"sources":["../src/init/templates/api.ts"],"sourcesContent":["import type {\n GeneratedFile,\n TemplateConfig,\n TemplateOptions,\n} from './index.js';\n\nexport const apiTemplate: TemplateConfig = {\n name: 'api',\n description: 'Full API with auth, database, services',\n\n dependencies: {\n '@geekmidas/constructs': 'workspace:*',\n '@geekmidas/envkit': 'workspace:*',\n '@geekmidas/logger': 'workspace:*',\n '@geekmidas/services': 'workspace:*',\n '@geekmidas/errors': 'workspace:*',\n '@geekmidas/auth': 'workspace:*',\n hono: '~4.8.2',\n pino: '~9.6.0',\n },\n\n devDependencies: {\n '@biomejs/biome': '~1.9.4',\n '@geekmidas/cli': 'workspace:*',\n '@types/node': '~22.0.0',\n tsx: '~4.20.0',\n turbo: '~2.3.0',\n typescript: '~5.8.2',\n vitest: '~4.0.0',\n },\n\n scripts: {\n dev: 'gkm dev',\n build: 'gkm build',\n test: 'vitest',\n 'test:once': 'vitest run',\n typecheck: 'tsc --noEmit',\n lint: 'biome lint .',\n fmt: 'biome format . --write',\n 'fmt:check': 'biome format .',\n },\n\n files: (options: TemplateOptions): GeneratedFile[] => {\n const { loggerType, routesStructure } = options;\n\n const loggerContent = `import { createLogger } from '@geekmidas/logger/${loggerType}';\n\nexport const logger = createLogger();\n`;\n\n // Get route path based on structure\n const getRoutePath = (file: string) => {\n switch (routesStructure) {\n case 'centralized-endpoints':\n return `src/endpoints/${file}`;\n case 'centralized-routes':\n return `src/routes/${file}`;\n case 'domain-based': {\n const parts = file.split('/');\n if (parts.length === 1) {\n return `src/${file.replace('.ts', '')}/routes/index.ts`;\n }\n return `src/${parts[0]}/routes/${parts.slice(1).join('/')}`;\n }\n }\n };\n\n const files: GeneratedFile[] = [\n // src/config/env.ts\n {\n path: 'src/config/env.ts',\n content: `import { EnvironmentParser } from '@geekmidas/envkit';\n\nexport const envParser = new EnvironmentParser(process.env);\n\nexport const config = envParser\n .create((get) => ({\n port: get('PORT').string().transform(Number).default(3000),\n nodeEnv: get('NODE_ENV').string().default('development'),\n jwtSecret: get('JWT_SECRET').string().default('change-me-in-production'),${\n options.database\n ? `\n database: {\n url: get('DATABASE_URL').string().default('postgresql://localhost:5432/mydb'),\n },`\n : ''\n }\n }))\n .parse();\n`,\n },\n\n // src/config/logger.ts\n {\n path: 'src/config/logger.ts',\n content: loggerContent,\n },\n\n // health endpoint\n {\n path: getRoutePath('health.ts'),\n content: `import { e } from '@geekmidas/constructs/endpoints';\n\nexport default e\n .get('/health')\n .handle(async () => ({\n status: 'ok',\n timestamp: new Date().toISOString(),\n }));\n`,\n },\n\n // users endpoints\n {\n path: getRoutePath('users/list.ts'),\n content: `import { e } from '@geekmidas/constructs/endpoints';\n\nexport default e\n .get('/users')\n .handle(async () => ({\n users: [\n { id: '1', name: 'Alice' },\n { id: '2', name: 'Bob' },\n ],\n }));\n`,\n },\n {\n path: getRoutePath('users/get.ts'),\n content: `import { e } from '@geekmidas/constructs/endpoints';\nimport { z } from 'zod';\n\nexport default e\n .get('/users/:id')\n .params(z.object({ id: z.string() }))\n .handle(async ({ params }) => ({\n id: params.id,\n name: 'Alice',\n email: 'alice@example.com',\n }));\n`,\n },\n ];\n\n // Add database service if enabled\n if (options.database) {\n files.push({\n path: 'src/services/database.ts',\n content: `import type { Service } from '@geekmidas/services';\nimport { Kysely, PostgresDialect } from 'kysely';\nimport pg from 'pg';\n\n// Define your database schema\nexport interface Database {\n users: {\n id: string;\n name: string;\n email: string;\n created_at: Date;\n };\n}\n\nexport const databaseService = {\n serviceName: 'database' as const,\n async register(envParser) {\n const config = envParser\n .create((get) => ({\n url: get('DATABASE_URL').string(),\n }))\n .parse();\n\n return new Kysely<Database>({\n dialect: new PostgresDialect({\n pool: new pg.Pool({ connectionString: config.url }),\n }),\n });\n },\n} satisfies Service<'database', Kysely<Database>>;\n`,\n });\n }\n\n // Add Telescope config if enabled\n if (options.telescope) {\n files.push({\n path: 'src/config/telescope.ts',\n content: `import { Telescope } from '@geekmidas/telescope';\nimport { InMemoryStorage } from '@geekmidas/telescope/storage/memory';\n\nexport const telescope = new Telescope({\n storage: new InMemoryStorage({ maxEntries: 100 }),\n enabled: process.env.NODE_ENV === 'development',\n});\n`,\n });\n }\n\n return files;\n },\n};\n"],"mappings":";AAMA,MAAaA,cAA8B;CACzC,MAAM;CACN,aAAa;CAEb,cAAc;EACZ,yBAAyB;EACzB,qBAAqB;EACrB,qBAAqB;EACrB,uBAAuB;EACvB,qBAAqB;EACrB,mBAAmB;EACnB,MAAM;EACN,MAAM;CACP;CAED,iBAAiB;EACf,kBAAkB;EAClB,kBAAkB;EAClB,eAAe;EACf,KAAK;EACL,OAAO;EACP,YAAY;EACZ,QAAQ;CACT;CAED,SAAS;EACP,KAAK;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,WAAW;EACX,MAAM;EACN,KAAK;EACL,aAAa;CACd;CAED,OAAO,CAACC,YAA8C;EACpD,MAAM,EAAE,YAAY,iBAAiB,GAAG;EAExC,MAAM,iBAAiB,kDAAkD,WAAW;;;;EAMpF,MAAM,eAAe,CAACC,SAAiB;AACrC,WAAQ,iBAAR;IACE,KAAK,wBACH,SAAQ,gBAAgB,KAAK;IAC/B,KAAK,qBACH,SAAQ,aAAa,KAAK;IAC5B,KAAK,gBAAgB;KACnB,MAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,SAAI,MAAM,WAAW,EACnB,SAAQ,MAAM,KAAK,QAAQ,OAAO,GAAG,CAAC;AAExC,aAAQ,MAAM,MAAM,GAAG,UAAU,MAAM,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3D;GACF;EACF;EAED,MAAMC,QAAyB;GAE7B;IACE,MAAM;IACN,UAAU;;;;;;;;+EASZ,QAAQ,YACH;;;UAID,GACL;;;;GAIE;GAGD;IACE,MAAM;IACN,SAAS;GACV;GAGD;IACE,MAAM,aAAa,YAAY;IAC/B,UAAU;;;;;;;;;GASX;GAGD;IACE,MAAM,aAAa,gBAAgB;IACnC,UAAU;;;;;;;;;;;GAWX;GACD;IACE,MAAM,aAAa,eAAe;IAClC,UAAU;;;;;;;;;;;;GAYX;EACF;AAGD,MAAI,QAAQ,SACV,OAAM,KAAK;GACT,MAAM;GACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BX,EAAC;AAIJ,MAAI,QAAQ,UACV,OAAM,KAAK;GACT,MAAM;GACN,UAAU;;;;;;;;EAQX,EAAC;AAGJ,SAAO;CACR;AACF"}
@@ -33,6 +33,22 @@ const apiTemplate = {
33
33
  "fmt:check": "biome format ."
34
34
  },
35
35
  files: (options) => {
36
+ const { loggerType, routesStructure } = options;
37
+ const loggerContent = `import { createLogger } from '@geekmidas/logger/${loggerType}';
38
+
39
+ export const logger = createLogger();
40
+ `;
41
+ const getRoutePath = (file) => {
42
+ switch (routesStructure) {
43
+ case "centralized-endpoints": return `src/endpoints/${file}`;
44
+ case "centralized-routes": return `src/routes/${file}`;
45
+ case "domain-based": {
46
+ const parts = file.split("/");
47
+ if (parts.length === 1) return `src/${file.replace(".ts", "")}/routes/index.ts`;
48
+ return `src/${parts[0]}/routes/${parts.slice(1).join("/")}`;
49
+ }
50
+ }
51
+ };
36
52
  const files = [
37
53
  {
38
54
  path: "src/config/env.ts",
@@ -54,16 +70,10 @@ export const config = envParser
54
70
  },
55
71
  {
56
72
  path: "src/config/logger.ts",
57
- content: `import { PinoLogger } from '@geekmidas/logger/pino';
58
-
59
- export const logger = new PinoLogger({
60
- app: '${options.name}',
61
- level: process.env.LOG_LEVEL || 'info',
62
- });
63
- `
73
+ content: loggerContent
64
74
  },
65
75
  {
66
- path: "src/endpoints/health.ts",
76
+ path: getRoutePath("health.ts"),
67
77
  content: `import { e } from '@geekmidas/constructs/endpoints';
68
78
 
69
79
  export default e
@@ -73,39 +83,10 @@ export default e
73
83
  timestamp: new Date().toISOString(),
74
84
  }));
75
85
  `
76
- }
77
- ];
78
- if (options.routeStyle === "flat") files.push({
79
- path: "src/endpoints/users-list.ts",
80
- content: `import { e } from '@geekmidas/constructs/endpoints';
81
-
82
- export default e
83
- .get('/users')
84
- .handle(async () => ({
85
- users: [
86
- { id: '1', name: 'Alice' },
87
- { id: '2', name: 'Bob' },
88
- ],
89
- }));
90
- `
91
- }, {
92
- path: "src/endpoints/users-get.ts",
93
- content: `import { e } from '@geekmidas/constructs/endpoints';
94
- import { z } from 'zod';
95
-
96
- export default e
97
- .get('/users/:id')
98
- .params(z.object({ id: z.string() }))
99
- .handle(async ({ params }) => ({
100
- id: params.id,
101
- name: 'Alice',
102
- email: 'alice@example.com',
103
- }));
104
- `
105
- });
106
- else files.push({
107
- path: "src/endpoints/users/list.ts",
108
- content: `import { e } from '@geekmidas/constructs/endpoints';
86
+ },
87
+ {
88
+ path: getRoutePath("users/list.ts"),
89
+ content: `import { e } from '@geekmidas/constructs/endpoints';
109
90
 
110
91
  export default e
111
92
  .get('/users')
@@ -116,9 +97,10 @@ export default e
116
97
  ],
117
98
  }));
118
99
  `
119
- }, {
120
- path: "src/endpoints/users/get.ts",
121
- content: `import { e } from '@geekmidas/constructs/endpoints';
100
+ },
101
+ {
102
+ path: getRoutePath("users/get.ts"),
103
+ content: `import { e } from '@geekmidas/constructs/endpoints';
122
104
  import { z } from 'zod';
123
105
 
124
106
  export default e
@@ -130,7 +112,8 @@ export default e
130
112
  email: 'alice@example.com',
131
113
  }));
132
114
  `
133
- });
115
+ }
116
+ ];
134
117
  if (options.database) files.push({
135
118
  path: "src/services/database.ts",
136
119
  content: `import type { Service } from '@geekmidas/services';
@@ -187,4 +170,4 @@ Object.defineProperty(exports, 'apiTemplate', {
187
170
  return apiTemplate;
188
171
  }
189
172
  });
190
- //# sourceMappingURL=api-B3SCEHPf.cjs.map
173
+ //# sourceMappingURL=api-D4W9-tdZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-D4W9-tdZ.cjs","names":["apiTemplate: TemplateConfig","options: TemplateOptions","file: string","files: GeneratedFile[]"],"sources":["../src/init/templates/api.ts"],"sourcesContent":["import type {\n GeneratedFile,\n TemplateConfig,\n TemplateOptions,\n} from './index.js';\n\nexport const apiTemplate: TemplateConfig = {\n name: 'api',\n description: 'Full API with auth, database, services',\n\n dependencies: {\n '@geekmidas/constructs': 'workspace:*',\n '@geekmidas/envkit': 'workspace:*',\n '@geekmidas/logger': 'workspace:*',\n '@geekmidas/services': 'workspace:*',\n '@geekmidas/errors': 'workspace:*',\n '@geekmidas/auth': 'workspace:*',\n hono: '~4.8.2',\n pino: '~9.6.0',\n },\n\n devDependencies: {\n '@biomejs/biome': '~1.9.4',\n '@geekmidas/cli': 'workspace:*',\n '@types/node': '~22.0.0',\n tsx: '~4.20.0',\n turbo: '~2.3.0',\n typescript: '~5.8.2',\n vitest: '~4.0.0',\n },\n\n scripts: {\n dev: 'gkm dev',\n build: 'gkm build',\n test: 'vitest',\n 'test:once': 'vitest run',\n typecheck: 'tsc --noEmit',\n lint: 'biome lint .',\n fmt: 'biome format . --write',\n 'fmt:check': 'biome format .',\n },\n\n files: (options: TemplateOptions): GeneratedFile[] => {\n const { loggerType, routesStructure } = options;\n\n const loggerContent = `import { createLogger } from '@geekmidas/logger/${loggerType}';\n\nexport const logger = createLogger();\n`;\n\n // Get route path based on structure\n const getRoutePath = (file: string) => {\n switch (routesStructure) {\n case 'centralized-endpoints':\n return `src/endpoints/${file}`;\n case 'centralized-routes':\n return `src/routes/${file}`;\n case 'domain-based': {\n const parts = file.split('/');\n if (parts.length === 1) {\n return `src/${file.replace('.ts', '')}/routes/index.ts`;\n }\n return `src/${parts[0]}/routes/${parts.slice(1).join('/')}`;\n }\n }\n };\n\n const files: GeneratedFile[] = [\n // src/config/env.ts\n {\n path: 'src/config/env.ts',\n content: `import { EnvironmentParser } from '@geekmidas/envkit';\n\nexport const envParser = new EnvironmentParser(process.env);\n\nexport const config = envParser\n .create((get) => ({\n port: get('PORT').string().transform(Number).default(3000),\n nodeEnv: get('NODE_ENV').string().default('development'),\n jwtSecret: get('JWT_SECRET').string().default('change-me-in-production'),${\n options.database\n ? `\n database: {\n url: get('DATABASE_URL').string().default('postgresql://localhost:5432/mydb'),\n },`\n : ''\n }\n }))\n .parse();\n`,\n },\n\n // src/config/logger.ts\n {\n path: 'src/config/logger.ts',\n content: loggerContent,\n },\n\n // health endpoint\n {\n path: getRoutePath('health.ts'),\n content: `import { e } from '@geekmidas/constructs/endpoints';\n\nexport default e\n .get('/health')\n .handle(async () => ({\n status: 'ok',\n timestamp: new Date().toISOString(),\n }));\n`,\n },\n\n // users endpoints\n {\n path: getRoutePath('users/list.ts'),\n content: `import { e } from '@geekmidas/constructs/endpoints';\n\nexport default e\n .get('/users')\n .handle(async () => ({\n users: [\n { id: '1', name: 'Alice' },\n { id: '2', name: 'Bob' },\n ],\n }));\n`,\n },\n {\n path: getRoutePath('users/get.ts'),\n content: `import { e } from '@geekmidas/constructs/endpoints';\nimport { z } from 'zod';\n\nexport default e\n .get('/users/:id')\n .params(z.object({ id: z.string() }))\n .handle(async ({ params }) => ({\n id: params.id,\n name: 'Alice',\n email: 'alice@example.com',\n }));\n`,\n },\n ];\n\n // Add database service if enabled\n if (options.database) {\n files.push({\n path: 'src/services/database.ts',\n content: `import type { Service } from '@geekmidas/services';\nimport { Kysely, PostgresDialect } from 'kysely';\nimport pg from 'pg';\n\n// Define your database schema\nexport interface Database {\n users: {\n id: string;\n name: string;\n email: string;\n created_at: Date;\n };\n}\n\nexport const databaseService = {\n serviceName: 'database' as const,\n async register(envParser) {\n const config = envParser\n .create((get) => ({\n url: get('DATABASE_URL').string(),\n }))\n .parse();\n\n return new Kysely<Database>({\n dialect: new PostgresDialect({\n pool: new pg.Pool({ connectionString: config.url }),\n }),\n });\n },\n} satisfies Service<'database', Kysely<Database>>;\n`,\n });\n }\n\n // Add Telescope config if enabled\n if (options.telescope) {\n files.push({\n path: 'src/config/telescope.ts',\n content: `import { Telescope } from '@geekmidas/telescope';\nimport { InMemoryStorage } from '@geekmidas/telescope/storage/memory';\n\nexport const telescope = new Telescope({\n storage: new InMemoryStorage({ maxEntries: 100 }),\n enabled: process.env.NODE_ENV === 'development',\n});\n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M;GACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BX,EAAC;AAIJ,MAAI,QAAQ,UACV,OAAM,KAAK;GACT,MAAM;GACN,UAAU;;;;;;;;EAQX,EAAC;AAGJ,SAAO;CACR;AACF"}
@@ -6,8 +6,10 @@ require('../EndpointGenerator-npWEDoK2.cjs');
6
6
  require('../FunctionGenerator-DYTnyr4c.cjs');
7
7
  require('../SubscriberGenerator-D_zpNGFr.cjs');
8
8
  require('../generators-3IemvCLk.cjs');
9
- require('../dev-DHqYn8k4.cjs');
10
- require('../manifests-VJ9-2JpW.cjs');
11
- const require_build = require('../build-D0Wr49bf.cjs');
9
+ require('../OpenApiTsGenerator-wLwpaq_I.cjs');
10
+ require('../openapi-CTae4ybf.cjs');
11
+ require('../dev-Dcrb_ZSL.cjs');
12
+ require('../manifests-D13Ej8AE.cjs');
13
+ const require_build = require('../build-Z3yGHcy2.cjs');
12
14
 
13
15
  exports.buildCommand = require_build.buildCommand;
@@ -1,4 +1,4 @@
1
- import { BuildOptions } from "../types-DB99_qIy.cjs";
1
+ import { BuildOptions } from "../types-KmjzMgu8.cjs";
2
2
 
3
3
  //#region src/build/index.d.ts
4
4
  declare function buildCommand(options: BuildOptions): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { BuildOptions } from "../types-Cxl8-uwV.mjs";
1
+ import { BuildOptions } from "../types-Bi7VzDUZ.mjs";
2
2
 
3
3
  //#region src/build/index.d.ts
4
4
  declare function buildCommand(options: BuildOptions): Promise<void>;
@@ -6,8 +6,10 @@ import "../EndpointGenerator-DGivkPLT.mjs";
6
6
  import "../FunctionGenerator-CVk0h8tO.mjs";
7
7
  import "../SubscriberGenerator-DABaJXML.mjs";
8
8
  import "../generators-FNpdfN6J.mjs";
9
- import "../dev-B734w3L1.mjs";
10
- import "../manifests-DIA_2QYd.mjs";
11
- import { buildCommand } from "../build-B8C_qHir.mjs";
9
+ import "../OpenApiTsGenerator-0ZDYWro5.mjs";
10
+ import "../openapi-Dn9MeKg3.mjs";
11
+ import "../dev-BimlVcuk.mjs";
12
+ import "../manifests-BNKG6AXf.mjs";
13
+ import { buildCommand } from "../build-BLriHKgm.mjs";
12
14
 
13
15
  export { buildCommand };
@@ -1,4 +1,4 @@
1
- const require_manifests = require('../manifests-VJ9-2JpW.cjs');
1
+ const require_manifests = require('../manifests-D13Ej8AE.cjs');
2
2
 
3
3
  exports.generateAwsManifest = require_manifests.generateAwsManifest;
4
4
  exports.generateServerManifest = require_manifests.generateServerManifest;
@@ -1,4 +1,4 @@
1
- import { CronInfo, FunctionInfo, RouteInfo, SubscriberInfo } from "../types-DB99_qIy.cjs";
1
+ import { CronInfo, FunctionInfo, RouteInfo, SubscriberInfo } from "../types-KmjzMgu8.cjs";
2
2
 
3
3
  //#region src/build/manifests.d.ts
4
4
  type ManifestProvider = 'aws' | 'server';
@@ -1,4 +1,4 @@
1
- import { CronInfo, FunctionInfo, RouteInfo, SubscriberInfo } from "../types-Cxl8-uwV.mjs";
1
+ import { CronInfo, FunctionInfo, RouteInfo, SubscriberInfo } from "../types-Bi7VzDUZ.mjs";
2
2
 
3
3
  //#region src/build/manifests.d.ts
4
4
  type ManifestProvider = 'aws' | 'server';
@@ -1,3 +1,3 @@
1
- import { generateAwsManifest, generateServerManifest } from "../manifests-DIA_2QYd.mjs";
1
+ import { generateAwsManifest, generateServerManifest } from "../manifests-BNKG6AXf.mjs";
2
2
 
3
3
  export { generateAwsManifest, generateServerManifest };
@@ -1,4 +1,4 @@
1
- import { AWSApiGatewayConfig, AWSLambdaConfig, BuildOptions, GkmConfig, LegacyProvider, ServerConfig } from "../types-DB99_qIy.cjs";
1
+ import { AWSApiGatewayConfig, AWSLambdaConfig, BuildOptions, GkmConfig, LegacyProvider, ServerConfig } from "../types-KmjzMgu8.cjs";
2
2
 
3
3
  //#region src/build/providerResolver.d.ts
4
4
  interface ResolvedProviders {
@@ -1,4 +1,4 @@
1
- import { AWSApiGatewayConfig, AWSLambdaConfig, BuildOptions, GkmConfig, LegacyProvider, ServerConfig } from "../types-Cxl8-uwV.mjs";
1
+ import { AWSApiGatewayConfig, AWSLambdaConfig, BuildOptions, GkmConfig, LegacyProvider, ServerConfig } from "../types-Bi7VzDUZ.mjs";
2
2
 
3
3
  //#region src/build/providerResolver.d.ts
4
4
  interface ResolvedProviders {
@@ -1,3 +1,3 @@
1
- import "../types-DB99_qIy.cjs";
2
- import { BuildContext, NormalizedTelescopeConfig, ProcessedCron, ProcessedEndpoint, ProcessedFunction, ProviderBuildResult } from "../types-DLFN49M3.cjs";
1
+ import "../types-KmjzMgu8.cjs";
2
+ import { BuildContext, NormalizedTelescopeConfig, ProcessedCron, ProcessedEndpoint, ProcessedFunction, ProviderBuildResult } from "../types-DA-r8HWZ.cjs";
3
3
  export { BuildContext, NormalizedTelescopeConfig, ProcessedCron, ProcessedEndpoint, ProcessedFunction, ProviderBuildResult };
@@ -1,3 +1,3 @@
1
- import "../types-Cxl8-uwV.mjs";
2
- import { BuildContext, NormalizedTelescopeConfig, ProcessedCron, ProcessedEndpoint, ProcessedFunction, ProviderBuildResult } from "../types-C4KITv-y.mjs";
1
+ import "../types-Bi7VzDUZ.mjs";
2
+ import { BuildContext, NormalizedTelescopeConfig, ProcessedCron, ProcessedEndpoint, ProcessedFunction, ProviderBuildResult } from "../types-D2xYkOal.mjs";
3
3
  export { BuildContext, NormalizedTelescopeConfig, ProcessedCron, ProcessedEndpoint, ProcessedFunction, ProviderBuildResult };
@@ -4,8 +4,8 @@ import { CronGenerator } from "./CronGenerator-CCRYptuT.mjs";
4
4
  import { EndpointGenerator } from "./EndpointGenerator-DGivkPLT.mjs";
5
5
  import { FunctionGenerator } from "./FunctionGenerator-CVk0h8tO.mjs";
6
6
  import { SubscriberGenerator } from "./SubscriberGenerator-DABaJXML.mjs";
7
- import { normalizeTelescopeConfig } from "./dev-B734w3L1.mjs";
8
- import { generateAwsManifest, generateServerManifest } from "./manifests-DIA_2QYd.mjs";
7
+ import { normalizeTelescopeConfig } from "./dev-BimlVcuk.mjs";
8
+ import { generateAwsManifest, generateServerManifest } from "./manifests-BNKG6AXf.mjs";
9
9
  import { mkdir } from "node:fs/promises";
10
10
  import { join, relative } from "node:path";
11
11
 
@@ -84,4 +84,4 @@ async function buildForProvider(provider, context, rootOutputDir, endpointGenera
84
84
 
85
85
  //#endregion
86
86
  export { buildCommand };
87
- //# sourceMappingURL=build-B8C_qHir.mjs.map
87
+ //# sourceMappingURL=build-BLriHKgm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-B8C_qHir.mjs","names":["options: BuildOptions","buildContext: BuildContext","provider: LegacyProvider","context: BuildContext","rootOutputDir: string","endpointGenerator: EndpointGenerator","functionGenerator: FunctionGenerator","cronGenerator: CronGenerator","subscriberGenerator: SubscriberGenerator","endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[]","functions: GeneratedConstruct<Function<any, any, any, any>>[]","crons: GeneratedConstruct<Cron<any, any, any, any>>[]","subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[]","enableOpenApi: boolean","routeMetadata: RouteInfo[]","appInfo: ServerAppInfo"],"sources":["../src/build/index.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { join, relative } from 'node:path';\nimport type { Cron } from '@geekmidas/constructs/crons';\nimport type { Endpoint } from '@geekmidas/constructs/endpoints';\nimport type { Function } from '@geekmidas/constructs/functions';\nimport type { Subscriber } from '@geekmidas/constructs/subscribers';\nimport { loadConfig, parseModuleConfig } from '../config';\nimport { normalizeTelescopeConfig } from '../dev';\nimport {\n CronGenerator,\n EndpointGenerator,\n FunctionGenerator,\n type GeneratedConstruct,\n SubscriberGenerator,\n} from '../generators';\nimport type { BuildOptions, LegacyProvider, RouteInfo } from '../types';\nimport {\n type ServerAppInfo,\n generateAwsManifest,\n generateServerManifest,\n} from './manifests';\nimport { resolveProviders } from './providerResolver';\nimport type { BuildContext } from './types';\n\nconst logger = console;\n\nexport async function buildCommand(options: BuildOptions): Promise<void> {\n const config = await loadConfig();\n\n // Resolve providers from new config format\n const resolved = resolveProviders(config, options);\n\n logger.log(`Building with providers: ${resolved.providers.join(', ')}`);\n logger.log(`Loading routes from: ${config.routes}`);\n if (config.functions) {\n logger.log(`Loading functions from: ${config.functions}`);\n }\n if (config.crons) {\n logger.log(`Loading crons from: ${config.crons}`);\n }\n if (config.subscribers) {\n logger.log(`Loading subscribers from: ${config.subscribers}`);\n }\n logger.log(`Using envParser: ${config.envParser}`);\n\n // Parse envParser and logger configuration\n const { path: envParserPath, importPattern: envParserImportPattern } =\n parseModuleConfig(config.envParser, 'envParser');\n const { path: loggerPath, importPattern: loggerImportPattern } =\n parseModuleConfig(config.logger, 'logger');\n\n // Normalize telescope configuration\n const telescope = normalizeTelescopeConfig(config.telescope);\n if (telescope) {\n logger.log(`🔭 Telescope enabled at ${telescope.path}`);\n }\n\n const buildContext: BuildContext = {\n envParserPath,\n envParserImportPattern,\n loggerPath,\n loggerImportPattern,\n telescope,\n };\n\n // Initialize generators\n const endpointGenerator = new EndpointGenerator();\n const functionGenerator = new FunctionGenerator();\n const cronGenerator = new CronGenerator();\n const subscriberGenerator = new SubscriberGenerator();\n\n // Load all constructs in parallel\n const [allEndpoints, allFunctions, allCrons, allSubscribers] =\n await Promise.all([\n endpointGenerator.load(config.routes),\n config.functions ? functionGenerator.load(config.functions) : [],\n config.crons ? cronGenerator.load(config.crons) : [],\n config.subscribers ? subscriberGenerator.load(config.subscribers) : [],\n ]);\n\n logger.log(`Found ${allEndpoints.length} endpoints`);\n logger.log(`Found ${allFunctions.length} functions`);\n logger.log(`Found ${allCrons.length} crons`);\n logger.log(`Found ${allSubscribers.length} subscribers`);\n\n if (\n allEndpoints.length === 0 &&\n allFunctions.length === 0 &&\n allCrons.length === 0 &&\n allSubscribers.length === 0\n ) {\n logger.log(\n 'No endpoints, functions, crons, or subscribers found to process',\n );\n return;\n }\n\n // Ensure .gkm directory exists\n const rootOutputDir = join(process.cwd(), '.gkm');\n await mkdir(rootOutputDir, { recursive: true });\n\n // Build for each provider and generate per-provider manifests\n for (const provider of resolved.providers) {\n await buildForProvider(\n provider,\n buildContext,\n rootOutputDir,\n endpointGenerator,\n functionGenerator,\n cronGenerator,\n subscriberGenerator,\n allEndpoints,\n allFunctions,\n allCrons,\n allSubscribers,\n resolved.enableOpenApi,\n );\n }\n}\n\nasync function buildForProvider(\n provider: LegacyProvider,\n context: BuildContext,\n rootOutputDir: string,\n endpointGenerator: EndpointGenerator,\n functionGenerator: FunctionGenerator,\n cronGenerator: CronGenerator,\n subscriberGenerator: SubscriberGenerator,\n endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[],\n functions: GeneratedConstruct<Function<any, any, any, any>>[],\n crons: GeneratedConstruct<Cron<any, any, any, any>>[],\n subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[],\n enableOpenApi: boolean,\n): Promise<void> {\n const outputDir = join(process.cwd(), '.gkm', provider);\n\n // Ensure output directory exists\n await mkdir(outputDir, { recursive: true });\n\n logger.log(`\\nGenerating handlers for provider: ${provider}`);\n\n // Build all constructs in parallel\n const [routes, functionInfos, cronInfos, subscriberInfos] = await Promise.all(\n [\n endpointGenerator.build(context, endpoints, outputDir, {\n provider,\n enableOpenApi,\n }),\n functionGenerator.build(context, functions, outputDir, { provider }),\n cronGenerator.build(context, crons, outputDir, { provider }),\n subscriberGenerator.build(context, subscribers, outputDir, { provider }),\n ],\n );\n\n logger.log(\n `Generated ${routes.length} routes, ${functionInfos.length} functions, ${cronInfos.length} crons, ${subscriberInfos.length} subscribers for ${provider}`,\n );\n\n // Generate provider-specific manifest\n if (provider === 'server') {\n // For server, collect actual route metadata from endpoint constructs\n const routeMetadata: RouteInfo[] = await Promise.all(\n endpoints.map(async ({ construct }) => ({\n path: construct._path,\n method: construct.method,\n handler: '', // Not needed for server manifest\n authorizer: construct.authorizer?.name ?? 'none',\n })),\n );\n\n const appInfo: ServerAppInfo = {\n handler: relative(process.cwd(), join(outputDir, 'app.ts')),\n endpoints: relative(process.cwd(), join(outputDir, 'endpoints.ts')),\n };\n\n await generateServerManifest(\n rootOutputDir,\n appInfo,\n routeMetadata,\n subscriberInfos,\n );\n } else {\n // For AWS providers, generate AWS manifest\n await generateAwsManifest(\n rootOutputDir,\n routes,\n functionInfos,\n cronInfos,\n subscriberInfos,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,SAAS;AAEf,eAAsB,aAAaA,SAAsC;CACvE,MAAM,SAAS,MAAM,YAAY;CAGjC,MAAM,WAAW,iBAAiB,QAAQ,QAAQ;AAElD,QAAO,KAAK,2BAA2B,SAAS,UAAU,KAAK,KAAK,CAAC,EAAE;AACvE,QAAO,KAAK,uBAAuB,OAAO,OAAO,EAAE;AACnD,KAAI,OAAO,UACT,QAAO,KAAK,0BAA0B,OAAO,UAAU,EAAE;AAE3D,KAAI,OAAO,MACT,QAAO,KAAK,sBAAsB,OAAO,MAAM,EAAE;AAEnD,KAAI,OAAO,YACT,QAAO,KAAK,4BAA4B,OAAO,YAAY,EAAE;AAE/D,QAAO,KAAK,mBAAmB,OAAO,UAAU,EAAE;CAGlD,MAAM,EAAE,MAAM,eAAe,eAAe,wBAAwB,GAClE,kBAAkB,OAAO,WAAW,YAAY;CAClD,MAAM,EAAE,MAAM,YAAY,eAAe,qBAAqB,GAC5D,kBAAkB,OAAO,QAAQ,SAAS;CAG5C,MAAM,YAAY,yBAAyB,OAAO,UAAU;AAC5D,KAAI,UACF,QAAO,KAAK,0BAA0B,UAAU,KAAK,EAAE;CAGzD,MAAMC,eAA6B;EACjC;EACA;EACA;EACA;EACA;CACD;CAGD,MAAM,oBAAoB,IAAI;CAC9B,MAAM,oBAAoB,IAAI;CAC9B,MAAM,gBAAgB,IAAI;CAC1B,MAAM,sBAAsB,IAAI;CAGhC,MAAM,CAAC,cAAc,cAAc,UAAU,eAAe,GAC1D,MAAM,QAAQ,IAAI;EAChB,kBAAkB,KAAK,OAAO,OAAO;EACrC,OAAO,YAAY,k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QAAO,KACJ,YAAY,OAAO,OAAO,WAAW,cAAc,OAAO,cAAc,UAAU,OAAO,UAAU,gBAAgB,OAAO,mBAAmB,SAAS,EACxJ;AAGD,KAAI,aAAa,UAAU;EAEzB,MAAMC,gBAA6B,MAAM,QAAQ,IAC/C,UAAU,IAAI,OAAO,EAAE,WAAW,MAAM;GACtC,MAAM,UAAU;GAChB,QAAQ,UAAU;GAClB,SAAS;GACT,YAAY,UAAU,YAAY,QAAQ;EAC3C,GAAE,CACJ;EAED,MAAMC,UAAyB;GAC7B,SAAS,SAAS,QAAQ,KAAK,EAAE,KAAK,WAAW,SAAS,CAAC;GAC3D,WAAW,SAAS,QAAQ,KAAK,EAAE,KAAK,WAAW,eAAe,CAAC;EACpE;AAED,QAAM,uBACJ,eACA,SACA,eACA,gBACD;CACF,MAEC,OAAM,oBACJ,eACA,QACA,eACA,WACA,gBACD;AAEJ"}
1
+ {"version":3,"file":"build-BLriHKgm.mjs","names":["options: BuildOptions","buildContext: BuildContext","provider: LegacyProvider","context: BuildContext","rootOutputDir: string","endpointGenerator: EndpointGenerator","functionGenerator: FunctionGenerator","cronGenerator: CronGenerator","subscriberGenerator: SubscriberGenerator","endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[]","functions: GeneratedConstruct<Function<any, any, any, any>>[]","crons: GeneratedConstruct<Cron<any, any, any, any>>[]","subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[]","enableOpenApi: boolean","routeMetadata: RouteInfo[]","appInfo: ServerAppInfo"],"sources":["../src/build/index.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { join, relative } from 'node:path';\nimport type { Cron } from '@geekmidas/constructs/crons';\nimport type { Endpoint } from '@geekmidas/constructs/endpoints';\nimport type { Function } from '@geekmidas/constructs/functions';\nimport type { Subscriber } from '@geekmidas/constructs/subscribers';\nimport { loadConfig, parseModuleConfig } from '../config';\nimport { normalizeTelescopeConfig } from '../dev';\nimport {\n CronGenerator,\n EndpointGenerator,\n FunctionGenerator,\n type GeneratedConstruct,\n SubscriberGenerator,\n} from '../generators';\nimport type { BuildOptions, LegacyProvider, RouteInfo } from '../types';\nimport {\n type ServerAppInfo,\n generateAwsManifest,\n generateServerManifest,\n} from './manifests';\nimport { resolveProviders } from './providerResolver';\nimport type { BuildContext } from './types';\n\nconst logger = console;\n\nexport async function buildCommand(options: BuildOptions): Promise<void> {\n const config = await loadConfig();\n\n // Resolve providers from new config format\n const resolved = resolveProviders(config, options);\n\n logger.log(`Building with providers: ${resolved.providers.join(', ')}`);\n logger.log(`Loading routes from: ${config.routes}`);\n if (config.functions) {\n logger.log(`Loading functions from: ${config.functions}`);\n }\n if (config.crons) {\n logger.log(`Loading crons from: ${config.crons}`);\n }\n if (config.subscribers) {\n logger.log(`Loading subscribers from: ${config.subscribers}`);\n }\n logger.log(`Using envParser: ${config.envParser}`);\n\n // Parse envParser and logger configuration\n const { path: envParserPath, importPattern: envParserImportPattern } =\n parseModuleConfig(config.envParser, 'envParser');\n const { path: loggerPath, importPattern: loggerImportPattern } =\n parseModuleConfig(config.logger, 'logger');\n\n // Normalize telescope configuration\n const telescope = normalizeTelescopeConfig(config.telescope);\n if (telescope) {\n logger.log(`🔭 Telescope enabled at ${telescope.path}`);\n }\n\n const buildContext: BuildContext = {\n envParserPath,\n envParserImportPattern,\n loggerPath,\n loggerImportPattern,\n telescope,\n };\n\n // Initialize generators\n const endpointGenerator = new EndpointGenerator();\n const functionGenerator = new FunctionGenerator();\n const cronGenerator = new CronGenerator();\n const subscriberGenerator = new SubscriberGenerator();\n\n // Load all constructs in parallel\n const [allEndpoints, allFunctions, allCrons, allSubscribers] =\n await Promise.all([\n endpointGenerator.load(config.routes),\n config.functions ? functionGenerator.load(config.functions) : [],\n config.crons ? cronGenerator.load(config.crons) : [],\n config.subscribers ? subscriberGenerator.load(config.subscribers) : [],\n ]);\n\n logger.log(`Found ${allEndpoints.length} endpoints`);\n logger.log(`Found ${allFunctions.length} functions`);\n logger.log(`Found ${allCrons.length} crons`);\n logger.log(`Found ${allSubscribers.length} subscribers`);\n\n if (\n allEndpoints.length === 0 &&\n allFunctions.length === 0 &&\n allCrons.length === 0 &&\n allSubscribers.length === 0\n ) {\n logger.log(\n 'No endpoints, functions, crons, or subscribers found to process',\n );\n return;\n }\n\n // Ensure .gkm directory exists\n const rootOutputDir = join(process.cwd(), '.gkm');\n await mkdir(rootOutputDir, { recursive: true });\n\n // Build for each provider and generate per-provider manifests\n for (const provider of resolved.providers) {\n await buildForProvider(\n provider,\n buildContext,\n rootOutputDir,\n endpointGenerator,\n functionGenerator,\n cronGenerator,\n subscriberGenerator,\n allEndpoints,\n allFunctions,\n allCrons,\n allSubscribers,\n resolved.enableOpenApi,\n );\n }\n}\n\nasync function buildForProvider(\n provider: LegacyProvider,\n context: BuildContext,\n rootOutputDir: string,\n endpointGenerator: EndpointGenerator,\n functionGenerator: FunctionGenerator,\n cronGenerator: CronGenerator,\n subscriberGenerator: SubscriberGenerator,\n endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[],\n functions: GeneratedConstruct<Function<any, any, any, any>>[],\n crons: GeneratedConstruct<Cron<any, any, any, any>>[],\n subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[],\n enableOpenApi: boolean,\n): Promise<void> {\n const outputDir = join(process.cwd(), '.gkm', provider);\n\n // Ensure output directory exists\n await mkdir(outputDir, { recursive: true });\n\n logger.log(`\\nGenerating handlers for provider: ${provider}`);\n\n // Build all constructs in parallel\n const [routes, functionInfos, cronInfos, subscriberInfos] = await Promise.all(\n [\n endpointGenerator.build(context, endpoints, outputDir, {\n provider,\n enableOpenApi,\n }),\n functionGenerator.build(context, functions, outputDir, { provider }),\n cronGenerator.build(context, crons, outputDir, { provider }),\n subscriberGenerator.build(context, subscribers, outputDir, { provider }),\n ],\n );\n\n logger.log(\n `Generated ${routes.length} routes, ${functionInfos.length} functions, ${cronInfos.length} crons, ${subscriberInfos.length} subscribers for ${provider}`,\n );\n\n // Generate provider-specific manifest\n if (provider === 'server') {\n // For server, collect actual route metadata from endpoint constructs\n const routeMetadata: RouteInfo[] = await Promise.all(\n endpoints.map(async ({ construct }) => ({\n path: construct._path,\n method: construct.method,\n handler: '', // Not needed for server manifest\n authorizer: construct.authorizer?.name ?? 'none',\n })),\n );\n\n const appInfo: ServerAppInfo = {\n handler: relative(process.cwd(), join(outputDir, 'app.ts')),\n endpoints: relative(process.cwd(), join(outputDir, 'endpoints.ts')),\n };\n\n await generateServerManifest(\n rootOutputDir,\n appInfo,\n routeMetadata,\n subscriberInfos,\n );\n } else {\n // For AWS providers, generate AWS manifest\n await generateAwsManifest(\n rootOutputDir,\n routes,\n functionInfos,\n cronInfos,\n subscriberInfos,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,SAAS;AAEf,eAAsB,aAAaA,SAAsC;CACvE,MAAM,SAAS,MAAM,YAAY;CAGjC,MAAM,WAAW,iBAAiB,QAAQ,QAAQ;AAElD,QAAO,KAAK,2BAA2B,SAAS,UAAU,KAAK,KAAK,CAAC,EAAE;AACvE,QAAO,KAAK,uBAAuB,OAAO,OAAO,EAAE;AACnD,KAAI,OAAO,UACT,QAAO,KAAK,0BAA0B,OAAO,UAAU,EAAE;AAE3D,KAAI,OAAO,MACT,QAAO,KAAK,sBAAsB,OAAO,MAAM,EAAE;AAEnD,KAAI,OAAO,YACT,QAAO,KAAK,4BAA4B,OAAO,YAAY,EAAE;AAE/D,QAAO,KAAK,mBAAmB,OAAO,UAAU,EAAE;CAGlD,MAAM,EAAE,MAAM,eAAe,eAAe,wBAAwB,GAClE,kBAAkB,OAAO,WAAW,YAAY;CAClD,MAAM,EAAE,MAAM,YAAY,eAAe,qBAAqB,GAC5D,kBAAkB,OAAO,QAAQ,SAAS;CAG5C,MAAM,YAAY,yBAAyB,OAAO,UAAU;AAC5D,KAAI,UACF,QAAO,KAAK,0BAA0B,UAAU,KAAK,EAAE;CAGzD,MAAMC,eAA6B;EACjC;EACA;EAC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IACxE;EACE,kBAAkB,MAAM,SAAS,WAAW,WAAW;GACrD;GACA;EACD,EAAC;EACF,kBAAkB,MAAM,SAAS,WAAW,WAAW,EAAE,SAAU,EAAC;EACpE,cAAc,MAAM,SAAS,OAAO,WAAW,EAAE,SAAU,EAAC;EAC5D,oBAAoB,MAAM,SAAS,aAAa,WAAW,EAAE,SAAU,EAAC;CACzE,EACF;AAED,QAAO,KACJ,YAAY,OAAO,OAAO,WAAW,cAAc,OAAO,cAAc,UAAU,OAAO,UAAU,gBAAgB,OAAO,mBAAmB,SAAS,EACxJ;AAGD,KAAI,aAAa,UAAU;EAEzB,MAAMC,gBAA6B,MAAM,QAAQ,IAC/C,UAAU,IAAI,OAAO,EAAE,WAAW,MAAM;GACtC,MAAM,UAAU;GAChB,QAAQ,UAAU;GAClB,SAAS;GACT,YAAY,UAAU,YAAY,QAAQ;EAC3C,GAAE,CACJ;EAED,MAAMC,UAAyB;GAC7B,SAAS,SAAS,QAAQ,KAAK,EAAE,KAAK,WAAW,SAAS,CAAC;GAC3D,WAAW,SAAS,QAAQ,KAAK,EAAE,KAAK,WAAW,eAAe,CAAC;EACpE;AAED,QAAM,uBACJ,eACA,SACA,eACA,gBACD;CACF,MAEC,OAAM,oBACJ,eACA,QACA,eACA,WACA,gBACD;AAEJ"}
@@ -5,8 +5,8 @@ const require_CronGenerator = require('./CronGenerator-D4TWXQbh.cjs');
5
5
  const require_EndpointGenerator = require('./EndpointGenerator-npWEDoK2.cjs');
6
6
  const require_FunctionGenerator = require('./FunctionGenerator-DYTnyr4c.cjs');
7
7
  const require_SubscriberGenerator = require('./SubscriberGenerator-D_zpNGFr.cjs');
8
- const require_dev = require('./dev-DHqYn8k4.cjs');
9
- const require_manifests = require('./manifests-VJ9-2JpW.cjs');
8
+ const require_dev = require('./dev-Dcrb_ZSL.cjs');
9
+ const require_manifests = require('./manifests-D13Ej8AE.cjs');
10
10
  const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
11
11
  const node_path = require_chunk.__toESM(require("node:path"));
12
12
 
@@ -90,4 +90,4 @@ Object.defineProperty(exports, 'buildCommand', {
90
90
  return buildCommand;
91
91
  }
92
92
  });
93
- //# sourceMappingURL=build-D0Wr49bf.cjs.map
93
+ //# sourceMappingURL=build-Z3yGHcy2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-D0Wr49bf.cjs","names":["options: BuildOptions","buildContext: BuildContext","EndpointGenerator","FunctionGenerator","CronGenerator","SubscriberGenerator","provider: LegacyProvider","context: BuildContext","rootOutputDir: string","endpointGenerator: EndpointGenerator","functionGenerator: FunctionGenerator","cronGenerator: CronGenerator","subscriberGenerator: SubscriberGenerator","endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[]","functions: GeneratedConstruct<Function<any, any, any, any>>[]","crons: GeneratedConstruct<Cron<any, any, any, any>>[]","subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[]","enableOpenApi: boolean","routeMetadata: RouteInfo[]","appInfo: ServerAppInfo"],"sources":["../src/build/index.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { join, relative } from 'node:path';\nimport type { Cron } from '@geekmidas/constructs/crons';\nimport type { Endpoint } from '@geekmidas/constructs/endpoints';\nimport type { Function } from '@geekmidas/constructs/functions';\nimport type { Subscriber } from '@geekmidas/constructs/subscribers';\nimport { loadConfig, parseModuleConfig } from '../config';\nimport { normalizeTelescopeConfig } from '../dev';\nimport {\n CronGenerator,\n EndpointGenerator,\n FunctionGenerator,\n type GeneratedConstruct,\n SubscriberGenerator,\n} from '../generators';\nimport type { BuildOptions, LegacyProvider, RouteInfo } from '../types';\nimport {\n type ServerAppInfo,\n generateAwsManifest,\n generateServerManifest,\n} from './manifests';\nimport { resolveProviders } from './providerResolver';\nimport type { BuildContext } from './types';\n\nconst logger = console;\n\nexport async function buildCommand(options: BuildOptions): Promise<void> {\n const config = await loadConfig();\n\n // Resolve providers from new config format\n const resolved = resolveProviders(config, options);\n\n logger.log(`Building with providers: ${resolved.providers.join(', ')}`);\n logger.log(`Loading routes from: ${config.routes}`);\n if (config.functions) {\n logger.log(`Loading functions from: ${config.functions}`);\n }\n if (config.crons) {\n logger.log(`Loading crons from: ${config.crons}`);\n }\n if (config.subscribers) {\n logger.log(`Loading subscribers from: ${config.subscribers}`);\n }\n logger.log(`Using envParser: ${config.envParser}`);\n\n // Parse envParser and logger configuration\n const { path: envParserPath, importPattern: envParserImportPattern } =\n parseModuleConfig(config.envParser, 'envParser');\n const { path: loggerPath, importPattern: loggerImportPattern } =\n parseModuleConfig(config.logger, 'logger');\n\n // Normalize telescope configuration\n const telescope = normalizeTelescopeConfig(config.telescope);\n if (telescope) {\n logger.log(`🔭 Telescope enabled at ${telescope.path}`);\n }\n\n const buildContext: BuildContext = {\n envParserPath,\n envParserImportPattern,\n loggerPath,\n loggerImportPattern,\n telescope,\n };\n\n // Initialize generators\n const endpointGenerator = new EndpointGenerator();\n const functionGenerator = new FunctionGenerator();\n const cronGenerator = new CronGenerator();\n const subscriberGenerator = new SubscriberGenerator();\n\n // Load all constructs in parallel\n const [allEndpoints, allFunctions, allCrons, allSubscribers] =\n await Promise.all([\n endpointGenerator.load(config.routes),\n config.functions ? functionGenerator.load(config.functions) : [],\n config.crons ? cronGenerator.load(config.crons) : [],\n config.subscribers ? subscriberGenerator.load(config.subscribers) : [],\n ]);\n\n logger.log(`Found ${allEndpoints.length} endpoints`);\n logger.log(`Found ${allFunctions.length} functions`);\n logger.log(`Found ${allCrons.length} crons`);\n logger.log(`Found ${allSubscribers.length} subscribers`);\n\n if (\n allEndpoints.length === 0 &&\n allFunctions.length === 0 &&\n allCrons.length === 0 &&\n allSubscribers.length === 0\n ) {\n logger.log(\n 'No endpoints, functions, crons, or subscribers found to process',\n );\n return;\n }\n\n // Ensure .gkm directory exists\n const rootOutputDir = join(process.cwd(), '.gkm');\n await mkdir(rootOutputDir, { recursive: true });\n\n // Build for each provider and generate per-provider manifests\n for (const provider of resolved.providers) {\n await buildForProvider(\n provider,\n buildContext,\n rootOutputDir,\n endpointGenerator,\n functionGenerator,\n cronGenerator,\n subscriberGenerator,\n allEndpoints,\n allFunctions,\n allCrons,\n allSubscribers,\n resolved.enableOpenApi,\n );\n }\n}\n\nasync function buildForProvider(\n provider: LegacyProvider,\n context: BuildContext,\n rootOutputDir: string,\n endpointGenerator: EndpointGenerator,\n functionGenerator: FunctionGenerator,\n cronGenerator: CronGenerator,\n subscriberGenerator: SubscriberGenerator,\n endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[],\n functions: GeneratedConstruct<Function<any, any, any, any>>[],\n crons: GeneratedConstruct<Cron<any, any, any, any>>[],\n subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[],\n enableOpenApi: boolean,\n): Promise<void> {\n const outputDir = join(process.cwd(), '.gkm', provider);\n\n // Ensure output directory exists\n await mkdir(outputDir, { recursive: true });\n\n logger.log(`\\nGenerating handlers for provider: ${provider}`);\n\n // Build all constructs in parallel\n const [routes, functionInfos, cronInfos, subscriberInfos] = await Promise.all(\n [\n endpointGenerator.build(context, endpoints, outputDir, {\n provider,\n enableOpenApi,\n }),\n functionGenerator.build(context, functions, outputDir, { provider }),\n cronGenerator.build(context, crons, outputDir, { provider }),\n subscriberGenerator.build(context, subscribers, outputDir, { provider }),\n ],\n );\n\n logger.log(\n `Generated ${routes.length} routes, ${functionInfos.length} functions, ${cronInfos.length} crons, ${subscriberInfos.length} subscribers for ${provider}`,\n );\n\n // Generate provider-specific manifest\n if (provider === 'server') {\n // For server, collect actual route metadata from endpoint constructs\n const routeMetadata: RouteInfo[] = await Promise.all(\n endpoints.map(async ({ construct }) => ({\n path: construct._path,\n method: construct.method,\n handler: '', // Not needed for server manifest\n authorizer: construct.authorizer?.name ?? 'none',\n })),\n );\n\n const appInfo: ServerAppInfo = {\n handler: relative(process.cwd(), join(outputDir, 'app.ts')),\n endpoints: relative(process.cwd(), join(outputDir, 'endpoints.ts')),\n };\n\n await generateServerManifest(\n rootOutputDir,\n appInfo,\n routeMetadata,\n subscriberInfos,\n );\n } else {\n // For AWS providers, generate AWS manifest\n await generateAwsManifest(\n rootOutputDir,\n routes,\n functionInfos,\n cronInfos,\n subscriberInfos,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAM,SAAS;AAEf,eAAsB,aAAaA,SAAsC;CACvE,MAAM,SAAS,MAAM,2BAAY;CAGjC,MAAM,WAAW,0CAAiB,QAAQ,QAAQ;AAElD,QAAO,KAAK,2BAA2B,SAAS,UAAU,KAAK,KAAK,CAAC,EAAE;AACvE,QAAO,KAAK,uBAAuB,OAAO,OAAO,EAAE;AACnD,KAAI,OAAO,UACT,QAAO,KAAK,0BAA0B,OAAO,UAAU,EAAE;AAE3D,KAAI,OAAO,MACT,QAAO,KAAK,sBAAsB,OAAO,MAAM,EAAE;AAEnD,KAAI,OAAO,YACT,QAAO,KAAK,4BAA4B,OAAO,YAAY,EAAE;AAE/D,QAAO,KAAK,mBAAmB,OAAO,UAAU,EAAE;CAGlD,MAAM,EAAE,MAAM,eAAe,eAAe,wBAAwB,GAClE,iCAAkB,OAAO,WAAW,YAAY;CAClD,MAAM,EAAE,MAAM,YAAY,eAAe,qBAAqB,GAC5D,iCAAkB,OAAO,QAAQ,SAAS;CAG5C,MAAM,YAAY,qCAAyB,OAAO,UAAU;AAC5D,KAAI,UACF,QAAO,KAAK,0BAA0B,UAAU,KAAK,EAAE;CAGzD,MAAMC,eAA6B;EACjC;EACA;EACA;EACA;EACA;CACD;CAGD,MAAM,oBAAoB,IAAIC;CAC9B,MAAM,oBAAoB,IAAIC;CAC9B,MAAM,gBAAgB,IAAIC;CAC1B,MAAM,sBAAsB,IAAIC;CAGhC,MAAM,CAAC,cAAc,cAAc,UAAU,eAAe,GAC1D,MAAM,QAAQ,IAAI;EAChB,kBAAkB,KAAK,OAAO,OAAO;EACrC,OAAO,YAAY,kBAAkB,KAAK,OAAO,UAAU,GAAG,CAAE;EAChE,OAAO,QAAQ,cAAc,K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,OAAO,UAAU,gBAAgB,OAAO,mBAAmB,SAAS,EACxJ;AAGD,KAAI,aAAa,UAAU;EAEzB,MAAMC,gBAA6B,MAAM,QAAQ,IAC/C,UAAU,IAAI,OAAO,EAAE,WAAW,MAAM;GACtC,MAAM,UAAU;GAChB,QAAQ,UAAU;GAClB,SAAS;GACT,YAAY,UAAU,YAAY,QAAQ;EAC3C,GAAE,CACJ;EAED,MAAMC,UAAyB;GAC7B,SAAS,wBAAS,QAAQ,KAAK,EAAE,oBAAK,WAAW,SAAS,CAAC;GAC3D,WAAW,wBAAS,QAAQ,KAAK,EAAE,oBAAK,WAAW,eAAe,CAAC;EACpE;AAED,QAAM,yCACJ,eACA,SACA,eACA,gBACD;CACF,MAEC,OAAM,sCACJ,eACA,QACA,eACA,WACA,gBACD;AAEJ"}
1
+ {"version":3,"file":"build-Z3yGHcy2.cjs","names":["options: BuildOptions","buildContext: BuildContext","EndpointGenerator","FunctionGenerator","CronGenerator","SubscriberGenerator","provider: LegacyProvider","context: BuildContext","rootOutputDir: string","endpointGenerator: EndpointGenerator","functionGenerator: FunctionGenerator","cronGenerator: CronGenerator","subscriberGenerator: SubscriberGenerator","endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[]","functions: GeneratedConstruct<Function<any, any, any, any>>[]","crons: GeneratedConstruct<Cron<any, any, any, any>>[]","subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[]","enableOpenApi: boolean","routeMetadata: RouteInfo[]","appInfo: ServerAppInfo"],"sources":["../src/build/index.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { join, relative } from 'node:path';\nimport type { Cron } from '@geekmidas/constructs/crons';\nimport type { Endpoint } from '@geekmidas/constructs/endpoints';\nimport type { Function } from '@geekmidas/constructs/functions';\nimport type { Subscriber } from '@geekmidas/constructs/subscribers';\nimport { loadConfig, parseModuleConfig } from '../config';\nimport { normalizeTelescopeConfig } from '../dev';\nimport {\n CronGenerator,\n EndpointGenerator,\n FunctionGenerator,\n type GeneratedConstruct,\n SubscriberGenerator,\n} from '../generators';\nimport type { BuildOptions, LegacyProvider, RouteInfo } from '../types';\nimport {\n type ServerAppInfo,\n generateAwsManifest,\n generateServerManifest,\n} from './manifests';\nimport { resolveProviders } from './providerResolver';\nimport type { BuildContext } from './types';\n\nconst logger = console;\n\nexport async function buildCommand(options: BuildOptions): Promise<void> {\n const config = await loadConfig();\n\n // Resolve providers from new config format\n const resolved = resolveProviders(config, options);\n\n logger.log(`Building with providers: ${resolved.providers.join(', ')}`);\n logger.log(`Loading routes from: ${config.routes}`);\n if (config.functions) {\n logger.log(`Loading functions from: ${config.functions}`);\n }\n if (config.crons) {\n logger.log(`Loading crons from: ${config.crons}`);\n }\n if (config.subscribers) {\n logger.log(`Loading subscribers from: ${config.subscribers}`);\n }\n logger.log(`Using envParser: ${config.envParser}`);\n\n // Parse envParser and logger configuration\n const { path: envParserPath, importPattern: envParserImportPattern } =\n parseModuleConfig(config.envParser, 'envParser');\n const { path: loggerPath, importPattern: loggerImportPattern } =\n parseModuleConfig(config.logger, 'logger');\n\n // Normalize telescope configuration\n const telescope = normalizeTelescopeConfig(config.telescope);\n if (telescope) {\n logger.log(`🔭 Telescope enabled at ${telescope.path}`);\n }\n\n const buildContext: BuildContext = {\n envParserPath,\n envParserImportPattern,\n loggerPath,\n loggerImportPattern,\n telescope,\n };\n\n // Initialize generators\n const endpointGenerator = new EndpointGenerator();\n const functionGenerator = new FunctionGenerator();\n const cronGenerator = new CronGenerator();\n const subscriberGenerator = new SubscriberGenerator();\n\n // Load all constructs in parallel\n const [allEndpoints, allFunctions, allCrons, allSubscribers] =\n await Promise.all([\n endpointGenerator.load(config.routes),\n config.functions ? functionGenerator.load(config.functions) : [],\n config.crons ? cronGenerator.load(config.crons) : [],\n config.subscribers ? subscriberGenerator.load(config.subscribers) : [],\n ]);\n\n logger.log(`Found ${allEndpoints.length} endpoints`);\n logger.log(`Found ${allFunctions.length} functions`);\n logger.log(`Found ${allCrons.length} crons`);\n logger.log(`Found ${allSubscribers.length} subscribers`);\n\n if (\n allEndpoints.length === 0 &&\n allFunctions.length === 0 &&\n allCrons.length === 0 &&\n allSubscribers.length === 0\n ) {\n logger.log(\n 'No endpoints, functions, crons, or subscribers found to process',\n );\n return;\n }\n\n // Ensure .gkm directory exists\n const rootOutputDir = join(process.cwd(), '.gkm');\n await mkdir(rootOutputDir, { recursive: true });\n\n // Build for each provider and generate per-provider manifests\n for (const provider of resolved.providers) {\n await buildForProvider(\n provider,\n buildContext,\n rootOutputDir,\n endpointGenerator,\n functionGenerator,\n cronGenerator,\n subscriberGenerator,\n allEndpoints,\n allFunctions,\n allCrons,\n allSubscribers,\n resolved.enableOpenApi,\n );\n }\n}\n\nasync function buildForProvider(\n provider: LegacyProvider,\n context: BuildContext,\n rootOutputDir: string,\n endpointGenerator: EndpointGenerator,\n functionGenerator: FunctionGenerator,\n cronGenerator: CronGenerator,\n subscriberGenerator: SubscriberGenerator,\n endpoints: GeneratedConstruct<Endpoint<any, any, any, any, any, any>>[],\n functions: GeneratedConstruct<Function<any, any, any, any>>[],\n crons: GeneratedConstruct<Cron<any, any, any, any>>[],\n subscribers: GeneratedConstruct<Subscriber<any, any, any, any, any, any>>[],\n enableOpenApi: boolean,\n): Promise<void> {\n const outputDir = join(process.cwd(), '.gkm', provider);\n\n // Ensure output directory exists\n await mkdir(outputDir, { recursive: true });\n\n logger.log(`\\nGenerating handlers for provider: ${provider}`);\n\n // Build all constructs in parallel\n const [routes, functionInfos, cronInfos, subscriberInfos] = await Promise.all(\n [\n endpointGenerator.build(context, endpoints, outputDir, {\n provider,\n enableOpenApi,\n }),\n functionGenerator.build(context, functions, outputDir, { provider }),\n cronGenerator.build(context, crons, outputDir, { provider }),\n subscriberGenerator.build(context, subscribers, outputDir, { provider }),\n ],\n );\n\n logger.log(\n `Generated ${routes.length} routes, ${functionInfos.length} functions, ${cronInfos.length} crons, ${subscriberInfos.length} subscribers for ${provider}`,\n );\n\n // Generate provider-specific manifest\n if (provider === 'server') {\n // For server, collect actual route metadata from endpoint constructs\n const routeMetadata: RouteInfo[] = await Promise.all(\n endpoints.map(async ({ construct }) => ({\n path: construct._path,\n method: construct.method,\n handler: '', // Not needed for server manifest\n authorizer: construct.authorizer?.name ?? 'none',\n })),\n );\n\n const appInfo: ServerAppInfo = {\n handler: relative(process.cwd(), join(outputDir, 'app.ts')),\n endpoints: relative(process.cwd(), join(outputDir, 'endpoints.ts')),\n };\n\n await generateServerManifest(\n rootOutputDir,\n appInfo,\n routeMetadata,\n subscriberInfos,\n );\n } else {\n // For AWS providers, generate AWS manifest\n await generateAwsManifest(\n rootOutputDir,\n routes,\n functionInfos,\n cronInfos,\n subscriberInfos,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAM,SAAS;AAEf,eAAsB,aAAaA,SAAsC;CACvE,MAAM,SAAS,MAAM,2BAAY;CAGjC,MAAM,WAAW,0CAAiB,QAAQ,QAAQ;AAElD,QAAO,KAAK,2BAA2B,SAAS,UAAU,KAAK,KAAK,CAAC,EAAE;AACvE,QAAO,KAAK,uBAAuB,OAAO,OAAO,EAAE;AACnD,KAAI,OAAO,UACT,QAAO,KAAK,0BAA0B,OAAO,UAAU,EAAE;AAE3D,KAAI,OAAO,MACT,QAAO,KAAK,sBAAsB,OAAO,MAAM,EAAE;AAEnD,KAAI,OAAO,YACT,QAAO,KAAK,4BAA4B,OAAO,YAAY,EAAE;AAE/D,QAAO,KAAK,mBAAmB,OAAO,UAAU,EAAE;CAGlD,MAAM,EAAE,MAAM,eAAe,eAAe,wBAAwB,GAClE,iCAAkB,OAAO,WAAW,YAAY;CAClD,MAAM,EAAE,MAAM,YAAY,eAAe,qBAAqB,GAC5D,iCAAkB,OAAO,QAAQ,SAAS;CAG5C,MAAM,YAAY,qCAAyB,OAAO,UAAU;AAC5D,KAAI,UACF,QAAO,KAAK,0BAA0B,UAAU,KAAK,EAAE;CAGzD,MAAMC,eAA6B;EACjC;EACA;EACA;EACA;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,IACxE;EACE,kBAAkB,MAAM,SAAS,WAAW,WAAW;GACrD;GACA;EACD,EAAC;EACF,kBAAkB,MAAM,SAAS,WAAW,WAAW,EAAE,SAAU,EAAC;EACpE,cAAc,MAAM,SAAS,OAAO,WAAW,EAAE,SAAU,EAAC;EAC5D,oBAAoB,MAAM,SAAS,aAAa,WAAW,EAAE,SAAU,EAAC;CACzE,EACF;AAED,QAAO,KACJ,YAAY,OAAO,OAAO,WAAW,cAAc,OAAO,cAAc,UAAU,OAAO,UAAU,gBAAgB,OAAO,mBAAmB,SAAS,EACxJ;AAGD,KAAI,aAAa,UAAU;EAEzB,MAAMC,gBAA6B,MAAM,QAAQ,IAC/C,UAAU,IAAI,OAAO,EAAE,WAAW,MAAM;GACtC,MAAM,UAAU;GAChB,QAAQ,UAAU;GAClB,SAAS;GACT,YAAY,UAAU,YAAY,QAAQ;EAC3C,GAAE,CACJ;EAED,MAAMC,UAAyB;GAC7B,SAAS,wBAAS,QAAQ,KAAK,EAAE,oBAAK,WAAW,SAAS,CAAC;GAC3D,WAAW,wBAAS,QAAQ,KAAK,EAAE,oBAAK,WAAW,eAAe,CAAC;EACpE;AAED,QAAM,yCACJ,eACA,SACA,eACA,gBACD;CACF,MAEC,OAAM,sCACJ,eACA,QACA,eACA,WACA,gBACD;AAEJ"}
@@ -4,15 +4,22 @@
4
4
  * Generate configuration files (gkm.config.ts, tsconfig.json, biome.json, turbo.json)
5
5
  */
6
6
  function generateConfigFiles(options, template) {
7
- const { telescope } = options;
7
+ const { telescope, routesStructure } = options;
8
8
  const isServerless = template.name === "serverless";
9
9
  const hasWorker = template.name === "worker";
10
- let gkmConfig = `import { defineConfig } from '@geekmidas/cli';
10
+ const getRoutesGlob = () => {
11
+ switch (routesStructure) {
12
+ case "centralized-endpoints": return "./src/endpoints/**/*.ts";
13
+ case "centralized-routes": return "./src/routes/**/*.ts";
14
+ case "domain-based": return "./src/**/routes/*.ts";
15
+ }
16
+ };
17
+ let gkmConfig = `import { defineConfig } from '@geekmidas/cli/config';
11
18
 
12
19
  export default defineConfig({
13
- routes: './src/endpoints/**/*.ts',
14
- envParser: './src/config/env',
15
- logger: './src/config/logger',`;
20
+ routes: '${getRoutesGlob()}',
21
+ envParser: './src/config/env#envParser',
22
+ logger: './src/config/logger#logger',`;
16
23
  if (isServerless || hasWorker) gkmConfig += `
17
24
  functions: './src/functions/**/*.ts',`;
18
25
  if (hasWorker) gkmConfig += `
@@ -24,6 +31,10 @@ export default defineConfig({
24
31
  path: '/__telescope',
25
32
  },`;
26
33
  gkmConfig += `
34
+ openapi: {
35
+ enabled: true,
36
+ },`;
37
+ gkmConfig += `
27
38
  });
28
39
  `;
29
40
  const tsConfig = options.monorepo ? {
@@ -154,4 +165,4 @@ Object.defineProperty(exports, 'generateConfigFiles', {
154
165
  return generateConfigFiles;
155
166
  }
156
167
  });
157
- //# sourceMappingURL=config-CLEDqKO3.cjs.map
168
+ //# sourceMappingURL=config-BP1IZynR.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-BP1IZynR.cjs","names":["options: TemplateOptions","template: TemplateConfig"],"sources":["../src/init/generators/config.ts"],"sourcesContent":["import type {\n GeneratedFile,\n TemplateConfig,\n TemplateOptions,\n} from '../templates/index.js';\n\n/**\n * Generate configuration files (gkm.config.ts, tsconfig.json, biome.json, turbo.json)\n */\nexport function generateConfigFiles(\n options: TemplateOptions,\n template: TemplateConfig,\n): GeneratedFile[] {\n const { telescope, routesStructure } = options;\n const isServerless = template.name === 'serverless';\n const hasWorker = template.name === 'worker';\n\n // Get routes glob pattern based on structure\n const getRoutesGlob = () => {\n switch (routesStructure) {\n case 'centralized-endpoints':\n return './src/endpoints/**/*.ts';\n case 'centralized-routes':\n return './src/routes/**/*.ts';\n case 'domain-based':\n return './src/**/routes/*.ts';\n }\n };\n\n // Build gkm.config.ts\n let gkmConfig = `import { defineConfig } from '@geekmidas/cli/config';\n\nexport default defineConfig({\n routes: '${getRoutesGlob()}',\n envParser: './src/config/env#envParser',\n logger: './src/config/logger#logger',`;\n\n if (isServerless || hasWorker) {\n gkmConfig += `\n functions: './src/functions/**/*.ts',`;\n }\n\n if (hasWorker) {\n gkmConfig += `\n crons: './src/crons/**/*.ts',\n subscribers: './src/subscribers/**/*.ts',`;\n }\n\n if (telescope) {\n gkmConfig += `\n telescope: {\n enabled: true,\n path: '/__telescope',\n },`;\n }\n\n // Always add openapi config (output path is fixed to .gkm/openapi.ts)\n gkmConfig += `\n openapi: {\n enabled: true,\n },`;\n\n gkmConfig += `\n});\n`;\n\n // Build tsconfig.json - extends root for monorepo, standalone for non-monorepo\n const tsConfig = options.monorepo\n ? {\n extends: '../../tsconfig.json',\n compilerOptions: {\n outDir: './dist',\n rootDir: './src',\n baseUrl: '.',\n paths: {\n [`@${options.name}/*`]: ['../../packages/*/src'],\n },\n },\n include: ['src/**/*.ts'],\n exclude: ['node_modules', 'dist'],\n }\n : {\n compilerOptions: {\n target: 'ES2022',\n module: 'NodeNext',\n moduleResolution: 'NodeNext',\n lib: ['ES2022'],\n strict: true,\n esModuleInterop: true,\n skipLibCheck: true,\n forceConsistentCasingInFileNames: true,\n resolveJsonModule: true,\n declaration: true,\n declarationMap: true,\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts'],\n exclude: ['node_modules', 'dist'],\n };\n\n // Skip biome.json and turbo.json for monorepo (they're at root)\n if (options.monorepo) {\n return [\n {\n path: 'gkm.config.ts',\n content: gkmConfig,\n },\n {\n path: 'tsconfig.json',\n content: JSON.stringify(tsConfig, null, 2) + '\\n',\n },\n ];\n }\n\n // Build biome.json\n const biomeConfig = {\n $schema: 'https://biomejs.dev/schemas/1.9.4/schema.json',\n vcs: {\n enabled: true,\n clientKind: 'git',\n useIgnoreFile: true,\n },\n organizeImports: {\n enabled: true,\n },\n formatter: {\n enabled: true,\n indentStyle: 'space',\n indentWidth: 2,\n lineWidth: 80,\n },\n javascript: {\n formatter: {\n quoteStyle: 'single',\n trailingCommas: 'all',\n semicolons: 'always',\n arrowParentheses: 'always',\n },\n },\n linter: {\n enabled: true,\n rules: {\n recommended: true,\n correctness: {\n noUnusedImports: 'error',\n noUnusedVariables: 'error',\n },\n style: {\n noNonNullAssertion: 'off',\n },\n },\n },\n files: {\n ignore: ['node_modules', 'dist', '.gkm', 'coverage'],\n },\n };\n\n // Build turbo.json\n const turboConfig = {\n $schema: 'https://turbo.build/schema.json',\n tasks: {\n build: {\n dependsOn: ['^build'],\n outputs: ['dist/**'],\n },\n dev: {\n cache: false,\n persistent: true,\n },\n test: {\n dependsOn: ['^build'],\n cache: false,\n },\n 'test:once': {\n dependsOn: ['^build'],\n outputs: ['coverage/**'],\n },\n typecheck: {\n dependsOn: ['^build'],\n outputs: [],\n },\n lint: {\n outputs: [],\n },\n fmt: {\n outputs: [],\n },\n },\n };\n\n return [\n {\n path: 'gkm.config.ts',\n content: gkmConfig,\n },\n {\n path: 'tsconfig.json',\n content: JSON.stringify(tsConfig, null, 2) + '\\n',\n },\n {\n path: 'biome.json',\n content: JSON.stringify(biomeConfig, null, 2) + '\\n',\n },\n {\n path: 'turbo.json',\n content: JSON.stringify(turboConfig, null, 2) + '\\n',\n },\n ];\n}\n"],"mappings":";;;;;AASA,SAAgB,oBACdA,SACAC,UACiB;CACjB,MAAM,EAAE,WAAW,iBAAiB,GAAG;CACvC,MAAM,eAAe,SAAS,SAAS;CACvC,MAAM,YAAY,SAAS,SAAS;CAGpC,MAAM,gBAAgB,MAAM;AAC1B,UAAQ,iBAAR;GACE,KAAK,wBACH,QAAO;GACT,KAAK,qBACH,QAAO;GACT,KAAK,eACH,QAAO;EACV;CACF;CAGD,IAAI,aAAa;;;aAGN,eAAe,CAAC;;;AAI3B,KAAI,gBAAgB,UAClB,eAAc;;AAIhB,KAAI,UACF,eAAc;;;AAKhB,KAAI,UACF,eAAc;;;;;AAQhB,eAAc;;;;AAKd,eAAc;;;CAKd,MAAM,WAAW,QAAQ,WACrB;EACE,SAAS;EACT,iBAAiB;GACf,QAAQ;GACR,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AC,aAAc;GACzB;GACD,WAAW;IACT,WAAW,CAAC,QAAS;IACrB,SAAS,CAAE;GACZ;GACD,MAAM,EACJ,SAAS,CAAE,EACZ;GACD,KAAK,EACH,SAAS,CAAE,EACZ;EACF;CACF;AAED,QAAO;EACL;GACE,MAAM;GACN,SAAS;EACV;EACD;GACE,MAAM;GACN,SAAS,KAAK,UAAU,UAAU,MAAM,EAAE,GAAG;EAC9C;EACD;GACE,MAAM;GACN,SAAS,KAAK,UAAU,aAAa,MAAM,EAAE,GAAG;EACjD;EACD;GACE,MAAM;GACN,SAAS,KAAK,UAAU,aAAa,MAAM,EAAE,GAAG;EACjD;CACF;AACF"}
@@ -1,4 +1,4 @@
1
- import { GeneratedFile, TemplateConfig, TemplateOptions } from "./index-DrzN4xkQ.cjs";
1
+ import { GeneratedFile, TemplateConfig, TemplateOptions } from "./index-DZgrOOOW.mjs";
2
2
 
3
3
  //#region src/init/generators/config.d.ts
4
4
 
@@ -8,4 +8,4 @@ import { GeneratedFile, TemplateConfig, TemplateOptions } from "./index-DrzN4xkQ
8
8
  declare function generateConfigFiles(options: TemplateOptions, template: TemplateConfig): GeneratedFile[];
9
9
  //#endregion
10
10
  export { generateConfigFiles };
11
- //# sourceMappingURL=config-Ba-Gbpbc.d.cts.map
11
+ //# sourceMappingURL=config-CIzRhm_D.d.mts.map
@@ -1,4 +1,4 @@
1
- import { GeneratedFile, TemplateConfig, TemplateOptions } from "./index-C523No_B.mjs";
1
+ import { GeneratedFile, TemplateConfig, TemplateOptions } from "./index-DG6xNQMH.cjs";
2
2
 
3
3
  //#region src/init/generators/config.d.ts
4
4
 
@@ -8,4 +8,4 @@ import { GeneratedFile, TemplateConfig, TemplateOptions } from "./index-C523No_B
8
8
  declare function generateConfigFiles(options: TemplateOptions, template: TemplateConfig): GeneratedFile[];
9
9
  //#endregion
10
10
  export { generateConfigFiles };
11
- //# sourceMappingURL=config-DBsmMDhf.d.mts.map
11
+ //# sourceMappingURL=config-CvehIYsb.d.cts.map