@geekmidas/cli 9.0.2 → 10.0.0-alpha.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 (390) hide show
  1. package/README.md +71 -120
  2. package/dist/{CachedStateProvider-BdX7klRc.cjs → CachedStateProvider-BLo7zv7S.cjs} +1 -1
  3. package/dist/CachedStateProvider-BxoAm-B2.mjs +3 -0
  4. package/dist/{CachedStateProvider-klLWZXWF.cjs → CachedStateProvider-CqPdW7CB.cjs} +1 -1
  5. package/dist/{CachedStateProvider-klLWZXWF.cjs.map → CachedStateProvider-CqPdW7CB.cjs.map} +1 -1
  6. package/dist/{CachedStateProvider-CzyFct42.mjs → CachedStateProvider-DTniehMP.mjs} +1 -1
  7. package/dist/{CachedStateProvider-CzyFct42.mjs.map → CachedStateProvider-DTniehMP.mjs.map} +1 -1
  8. package/dist/{HostingerProvider-B2ZYz7Yc.mjs → HostingerProvider-Cft7lEYr.mjs} +4 -3
  9. package/dist/HostingerProvider-Cft7lEYr.mjs.map +1 -0
  10. package/dist/{HostingerProvider-CrHfsgz9.cjs → HostingerProvider-h3EbEp-Z.cjs} +4 -3
  11. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +1 -0
  12. package/dist/{LocalStateProvider-CP49rjzt.mjs → LocalStateProvider-Bn6tS-oL.mjs} +1 -1
  13. package/dist/{LocalStateProvider-CP49rjzt.mjs.map → LocalStateProvider-Bn6tS-oL.mjs.map} +1 -1
  14. package/dist/{LocalStateProvider-CalzNfNA.cjs → LocalStateProvider-Db9SEjyH.cjs} +1 -1
  15. package/dist/{LocalStateProvider-CalzNfNA.cjs.map → LocalStateProvider-Db9SEjyH.cjs.map} +1 -1
  16. package/dist/{Route53Provider-tlgBzrRQ.mjs → Route53Provider-RdpUDJQk.mjs} +1 -1
  17. package/dist/{Route53Provider-tlgBzrRQ.mjs.map → Route53Provider-RdpUDJQk.mjs.map} +1 -1
  18. package/dist/{Route53Provider-DwgXiLxt.cjs → Route53Provider-di2fMM5N.cjs} +1 -1
  19. package/dist/{Route53Provider-DwgXiLxt.cjs.map → Route53Provider-di2fMM5N.cjs.map} +1 -1
  20. package/dist/{SSMStateProvider-BlrTiV5m.mjs → SSMStateProvider-BRt2py-A.mjs} +1 -1
  21. package/dist/{SSMStateProvider-BlrTiV5m.mjs.map → SSMStateProvider-BRt2py-A.mjs.map} +1 -1
  22. package/dist/{SSMStateProvider-Bt6r8CTL.cjs → SSMStateProvider-DyX8s9HI.cjs} +1 -1
  23. package/dist/{SSMStateProvider-Bt6r8CTL.cjs.map → SSMStateProvider-DyX8s9HI.cjs.map} +1 -1
  24. package/dist/{backup-provisioner-Xunq-p_8.mjs → backup-provisioner-Bgj5Vi_L.mjs} +2 -2
  25. package/dist/{backup-provisioner-Xunq-p_8.mjs.map → backup-provisioner-Bgj5Vi_L.mjs.map} +1 -1
  26. package/dist/{backup-provisioner-B3HBN-2k.cjs → backup-provisioner-BrsHwYG0.cjs} +2 -2
  27. package/dist/{backup-provisioner-B3HBN-2k.cjs.map → backup-provisioner-BrsHwYG0.cjs.map} +1 -1
  28. package/dist/{bundler-Dufq3uvI.cjs → bundler-BY1OmV1e.cjs} +44 -14
  29. package/dist/bundler-BY1OmV1e.cjs.map +1 -0
  30. package/dist/{bundler-DkA4qzUD.mjs → bundler-Be8Zg4Wd.mjs} +45 -15
  31. package/dist/bundler-Be8Zg4Wd.mjs.map +1 -0
  32. package/dist/config-D8o6I_7Z.mjs +469 -0
  33. package/dist/config-D8o6I_7Z.mjs.map +1 -0
  34. package/dist/config-DbPE1KXF.cjs +535 -0
  35. package/dist/config-DbPE1KXF.cjs.map +1 -0
  36. package/dist/config.cjs +3 -2
  37. package/dist/config.d.cts +2 -2
  38. package/dist/config.d.cts.map +1 -1
  39. package/dist/config.d.mts +2 -2
  40. package/dist/config.d.mts.map +1 -1
  41. package/dist/config.mjs +3 -2
  42. package/dist/{credentials-s1kLcIzK.mjs → credentials-B5zRHdAl.mjs} +21 -6
  43. package/dist/credentials-B5zRHdAl.mjs.map +1 -0
  44. package/dist/{credentials-C8DWtnMY.cjs → credentials-BapzjyV5.cjs} +26 -5
  45. package/dist/credentials-BapzjyV5.cjs.map +1 -0
  46. package/dist/credentials-Dh0Q6HzY.mjs +2548 -0
  47. package/dist/credentials-Dh0Q6HzY.mjs.map +1 -0
  48. package/dist/credentials-K961ThG3.cjs +2680 -0
  49. package/dist/credentials-K961ThG3.cjs.map +1 -0
  50. package/dist/deploy/sniffer-routes-worker.cjs +6 -2
  51. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  52. package/dist/deploy/sniffer-routes-worker.mjs +6 -2
  53. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  54. package/dist/discover-CAlFgYec.mjs +229 -0
  55. package/dist/discover-CAlFgYec.mjs.map +1 -0
  56. package/dist/discover-DTmFeloL.cjs +271 -0
  57. package/dist/discover-DTmFeloL.cjs.map +1 -0
  58. package/dist/dokploy-api-BS2xnJLZ.mjs +3 -0
  59. package/dist/{dokploy-api-CqOIKHme.cjs → dokploy-api-BsVH0y_s.cjs} +141 -32
  60. package/dist/dokploy-api-BsVH0y_s.cjs.map +1 -0
  61. package/dist/dokploy-api-BuxDRo3l.cjs +3 -0
  62. package/dist/{dokploy-api-sfZFlWuE.mjs → dokploy-api-aTFPz7_4.mjs} +141 -32
  63. package/dist/dokploy-api-aTFPz7_4.mjs.map +1 -0
  64. package/dist/emit-CbcRolsa.cjs +236 -0
  65. package/dist/emit-CbcRolsa.cjs.map +1 -0
  66. package/dist/emit-CiZS_5Ub.mjs +206 -0
  67. package/dist/emit-CiZS_5Ub.mjs.map +1 -0
  68. package/dist/{encryption-MfXAiFTm.cjs → encryption-C6jaU0hE.cjs} +1 -1
  69. package/dist/{encryption-MfXAiFTm.cjs.map → encryption-C6jaU0hE.cjs.map} +1 -1
  70. package/dist/{encryption-BVS7Vmzs.cjs → encryption-CHzzeR8a.cjs} +1 -1
  71. package/dist/encryption-CQUncu7v.mjs +3 -0
  72. package/dist/{encryption-CO5Q4Bhf.mjs → encryption-D-abyhZx.mjs} +1 -1
  73. package/dist/{encryption-CO5Q4Bhf.mjs.map → encryption-D-abyhZx.mjs.map} +1 -1
  74. package/dist/fullstack-secrets-C-GGohke.cjs +111 -0
  75. package/dist/fullstack-secrets-C-GGohke.cjs.map +1 -0
  76. package/dist/fullstack-secrets-D1o9-G5l.mjs +87 -0
  77. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +1 -0
  78. package/dist/{fullstack-secrets-BYzi6Hwl.cjs → generator-CNzBw7g5.cjs} +1 -114
  79. package/dist/generator-CNzBw7g5.cjs.map +1 -0
  80. package/dist/{fullstack-secrets-l8s3II_H.mjs → generator-VE2JrFlY.mjs} +2 -85
  81. package/dist/generator-VE2JrFlY.mjs.map +1 -0
  82. package/dist/index-BThUzEIp.d.mts +175 -0
  83. package/dist/index-BThUzEIp.d.mts.map +1 -0
  84. package/dist/index-CHB4tSzX.d.cts +175 -0
  85. package/dist/index-CHB4tSzX.d.cts.map +1 -0
  86. package/dist/index.cjs +2329 -1584
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.mjs +2306 -1561
  89. package/dist/index.mjs.map +1 -1
  90. package/dist/{openapi-Cfwi0fqF.mjs → openapi-CgpMWMmM.mjs} +174 -95
  91. package/dist/openapi-CgpMWMmM.mjs.map +1 -0
  92. package/dist/{openapi-BzNOC7_i.cjs → openapi-CljONd_M.cjs} +175 -108
  93. package/dist/openapi-CljONd_M.cjs.map +1 -0
  94. package/dist/{openapi-react-query-C4iIvpPf.mjs → openapi-react-query-Byltvm_7.mjs} +2 -2
  95. package/dist/openapi-react-query-Byltvm_7.mjs.map +1 -0
  96. package/dist/{openapi-react-query-CYWik72n.cjs → openapi-react-query-CmJ1xDbn.cjs} +2 -2
  97. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +1 -0
  98. package/dist/openapi-react-query.cjs +1 -1
  99. package/dist/openapi-react-query.mjs +1 -1
  100. package/dist/openapi.cjs +4 -3
  101. package/dist/openapi.d.cts +1 -1
  102. package/dist/openapi.d.mts +1 -1
  103. package/dist/openapi.mjs +4 -3
  104. package/dist/reconcile/public.cjs +9 -0
  105. package/dist/reconcile/public.d.cts +125 -0
  106. package/dist/reconcile/public.d.cts.map +1 -0
  107. package/dist/reconcile/public.d.mts +125 -0
  108. package/dist/reconcile/public.d.mts.map +1 -0
  109. package/dist/reconcile/public.mjs +4 -0
  110. package/dist/{reconcile-B2FoJE0a.mjs → reconcile-CFs8C_1a.mjs} +5 -4
  111. package/dist/reconcile-CFs8C_1a.mjs.map +1 -0
  112. package/dist/{reconcile-BzqKJ2Rt.cjs → reconcile-D0pimNiy.cjs} +5 -4
  113. package/dist/reconcile-D0pimNiy.cjs.map +1 -0
  114. package/dist/setup-CJiQM2pX.cjs +473 -0
  115. package/dist/setup-CJiQM2pX.cjs.map +1 -0
  116. package/dist/setup-DMtU3p41.cjs +11 -0
  117. package/dist/setup-DOsYueeQ.mjs +443 -0
  118. package/dist/setup-DOsYueeQ.mjs.map +1 -0
  119. package/dist/setup-DSutDAlt.mjs +11 -0
  120. package/dist/{storage-B1wvztiJ.cjs → storage-BJmzYxt8.cjs} +1 -1
  121. package/dist/{storage-B1wvztiJ.cjs.map → storage-BJmzYxt8.cjs.map} +1 -1
  122. package/dist/{storage-DOEtT2Hr.cjs → storage-BM9hGpgv.cjs} +1 -1
  123. package/dist/{storage-dbb9RyBl.mjs → storage-Bi24WfoW.mjs} +1 -1
  124. package/dist/{storage-dbb9RyBl.mjs.map → storage-Bi24WfoW.mjs.map} +1 -1
  125. package/dist/{storage-Cs4WBsc4.mjs → storage-CYlGwWTj.mjs} +1 -1
  126. package/dist/{sync-CSooqRQ8.mjs → sync-CmEuNZsB.mjs} +2 -2
  127. package/dist/{sync-CSooqRQ8.mjs.map → sync-CmEuNZsB.mjs.map} +1 -1
  128. package/dist/sync-D306yOWu.cjs +4 -0
  129. package/dist/{sync-o_CtEbvR.cjs → sync-SizaChmC.cjs} +2 -2
  130. package/dist/{sync-o_CtEbvR.cjs.map → sync-SizaChmC.cjs.map} +1 -1
  131. package/dist/{sync-B5UHXwRM.mjs → sync-hOqAWHR6.mjs} +1 -1
  132. package/dist/{index-Bw548Bta.d.mts → types-C-arnQ1r.d.mts} +590 -143
  133. package/dist/types-C-arnQ1r.d.mts.map +1 -0
  134. package/dist/{index-DTpkeFb8.d.cts → types-abJQuk7m.d.cts} +590 -143
  135. package/dist/types-abJQuk7m.d.cts.map +1 -0
  136. package/dist/workspace/index.cjs +5 -1
  137. package/dist/workspace/index.d.cts +3 -3
  138. package/dist/workspace/index.d.mts +3 -3
  139. package/dist/workspace/index.mjs +2 -2
  140. package/dist/{workspace-D-37Ylqo.mjs → workspace-7FqprxuJ.mjs} +117 -30
  141. package/dist/workspace-7FqprxuJ.mjs.map +1 -0
  142. package/dist/workspace-8acupeaI.cjs +9 -0
  143. package/dist/{workspace-CQTT7HJQ.cjs → workspace-XvqO9jIv.cjs} +139 -28
  144. package/dist/workspace-XvqO9jIv.cjs.map +1 -0
  145. package/dist/workspace-yP5AHnrn.mjs +8 -0
  146. package/package.json +26 -9
  147. package/CHANGELOG.md +0 -650
  148. package/FUNCTION_CRON_SUPPORT.md +0 -266
  149. package/dist/CachedStateProvider-GcGziXh1.mjs +0 -3
  150. package/dist/HostingerProvider-B2ZYz7Yc.mjs.map +0 -1
  151. package/dist/HostingerProvider-CrHfsgz9.cjs.map +0 -1
  152. package/dist/bundler-DkA4qzUD.mjs.map +0 -1
  153. package/dist/bundler-Dufq3uvI.cjs.map +0 -1
  154. package/dist/config-Bbu1JKvf.mjs +0 -211
  155. package/dist/config-Bbu1JKvf.mjs.map +0 -1
  156. package/dist/config-DujV8DbR.cjs +0 -253
  157. package/dist/config-DujV8DbR.cjs.map +0 -1
  158. package/dist/credentials-C8DWtnMY.cjs.map +0 -1
  159. package/dist/credentials-s1kLcIzK.mjs.map +0 -1
  160. package/dist/dokploy-api-BPYkG-ZZ.cjs +0 -3
  161. package/dist/dokploy-api-BiSzWM4v.mjs +0 -3
  162. package/dist/dokploy-api-CqOIKHme.cjs.map +0 -1
  163. package/dist/dokploy-api-sfZFlWuE.mjs.map +0 -1
  164. package/dist/encryption-Bd_m4q3g.mjs +0 -3
  165. package/dist/fullstack-secrets-BYzi6Hwl.cjs.map +0 -1
  166. package/dist/fullstack-secrets-l8s3II_H.mjs.map +0 -1
  167. package/dist/index-Bw548Bta.d.mts.map +0 -1
  168. package/dist/index-DTpkeFb8.d.cts.map +0 -1
  169. package/dist/openapi-BzNOC7_i.cjs.map +0 -1
  170. package/dist/openapi-Cfwi0fqF.mjs.map +0 -1
  171. package/dist/openapi-react-query-C4iIvpPf.mjs.map +0 -1
  172. package/dist/openapi-react-query-CYWik72n.cjs.map +0 -1
  173. package/dist/reconcile-B2FoJE0a.mjs.map +0 -1
  174. package/dist/reconcile-BzqKJ2Rt.cjs.map +0 -1
  175. package/dist/setup-DDXUXzzl.mjs +0 -765
  176. package/dist/setup-DDXUXzzl.mjs.map +0 -1
  177. package/dist/setup-DLwhfyt-.cjs +0 -8
  178. package/dist/setup-Dh-B7YTX.mjs +0 -8
  179. package/dist/setup-WZ-xqAQO.cjs +0 -849
  180. package/dist/setup-WZ-xqAQO.cjs.map +0 -1
  181. package/dist/sync-BLA94rgC.cjs +0 -4
  182. package/dist/types-B3GQUg3k.d.mts +0 -280
  183. package/dist/types-B3GQUg3k.d.mts.map +0 -1
  184. package/dist/types-BWQDiooe.d.cts +0 -280
  185. package/dist/types-BWQDiooe.d.cts.map +0 -1
  186. package/dist/workspace-CQTT7HJQ.cjs.map +0 -1
  187. package/dist/workspace-D-37Ylqo.mjs.map +0 -1
  188. package/docs/OPENAPI_TYPESCRIPT_DESIGN.md +0 -408
  189. package/docs/dev-server-resilience-design.md +0 -189
  190. package/docs/manifest-refactor-design.md +0 -287
  191. package/examples/cron-example.ts +0 -45
  192. package/examples/env.ts +0 -33
  193. package/examples/function-example.ts +0 -40
  194. package/examples/gkm.config.json +0 -22
  195. package/examples/gkm.config.ts +0 -14
  196. package/examples/gkm.minimal.config.json +0 -7
  197. package/examples/gkm.production.config.json +0 -27
  198. package/examples/logger.ts +0 -10
  199. package/scripts/sync-versions.ts +0 -108
  200. package/src/__tests__/EndpointGenerator.hooks.spec.ts +0 -204
  201. package/src/__tests__/config.spec.ts +0 -422
  202. package/src/__tests__/loadEnvFiles.spec.ts +0 -131
  203. package/src/__tests__/normalizeHooksConfig.spec.ts +0 -63
  204. package/src/__tests__/openapi-react-query.spec.ts +0 -506
  205. package/src/__tests__/openapi.spec.ts +0 -625
  206. package/src/__tests__/test-helpers.ts +0 -181
  207. package/src/auth/__tests__/credentials.spec.ts +0 -331
  208. package/src/auth/__tests__/index.spec.ts +0 -237
  209. package/src/auth/credentials.ts +0 -286
  210. package/src/auth/index.ts +0 -233
  211. package/src/build/__tests__/bundler.spec.ts +0 -446
  212. package/src/build/__tests__/endpoint-analyzer.spec.ts +0 -623
  213. package/src/build/__tests__/handler-templates.spec.ts +0 -1287
  214. package/src/build/__tests__/index-new.spec.ts +0 -550
  215. package/src/build/__tests__/manifests.spec.ts +0 -583
  216. package/src/build/__tests__/partitions.spec.ts +0 -110
  217. package/src/build/__tests__/workspace-build.spec.ts +0 -215
  218. package/src/build/bundler.ts +0 -256
  219. package/src/build/endpoint-analyzer.ts +0 -236
  220. package/src/build/handler-templates.ts +0 -1253
  221. package/src/build/index.ts +0 -616
  222. package/src/build/manifests.ts +0 -285
  223. package/src/build/partitions.ts +0 -58
  224. package/src/build/providerResolver.ts +0 -184
  225. package/src/build/types.ts +0 -104
  226. package/src/config.ts +0 -330
  227. package/src/credentials/__tests__/fullDockerPorts.spec.ts +0 -144
  228. package/src/credentials/__tests__/helpers.ts +0 -112
  229. package/src/credentials/__tests__/prepareEntryCredentials.spec.ts +0 -125
  230. package/src/credentials/__tests__/readonlyDockerPorts.spec.ts +0 -190
  231. package/src/credentials/__tests__/workspaceCredentials.spec.ts +0 -209
  232. package/src/credentials/index.ts +0 -843
  233. package/src/debug.ts +0 -68
  234. package/src/deploy/CachedStateProvider.ts +0 -86
  235. package/src/deploy/LocalStateProvider.ts +0 -57
  236. package/src/deploy/SSMStateProvider.ts +0 -117
  237. package/src/deploy/StateProvider.ts +0 -175
  238. package/src/deploy/__tests__/CachedStateProvider.spec.ts +0 -235
  239. package/src/deploy/__tests__/HostingerProvider.spec.ts +0 -347
  240. package/src/deploy/__tests__/LocalStateProvider.spec.ts +0 -130
  241. package/src/deploy/__tests__/Route53Provider.spec.ts +0 -425
  242. package/src/deploy/__tests__/SSMStateProvider.spec.ts +0 -201
  243. package/src/deploy/__tests__/__fixtures__/entry-apps/async-entry.ts +0 -24
  244. package/src/deploy/__tests__/__fixtures__/entry-apps/nested-config-entry.ts +0 -24
  245. package/src/deploy/__tests__/__fixtures__/entry-apps/no-env-entry.ts +0 -12
  246. package/src/deploy/__tests__/__fixtures__/entry-apps/simple-entry.ts +0 -14
  247. package/src/deploy/__tests__/__fixtures__/entry-apps/throwing-entry.ts +0 -16
  248. package/src/deploy/__tests__/__fixtures__/env-parsers/non-function-export.ts +0 -10
  249. package/src/deploy/__tests__/__fixtures__/env-parsers/optional-env-parser.ts +0 -21
  250. package/src/deploy/__tests__/__fixtures__/env-parsers/parseable-env-parser.ts +0 -18
  251. package/src/deploy/__tests__/__fixtures__/env-parsers/throwing-env-parser.ts +0 -16
  252. package/src/deploy/__tests__/__fixtures__/env-parsers/valid-env-parser.ts +0 -16
  253. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/auth.ts +0 -16
  254. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/health.ts +0 -13
  255. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/users.ts +0 -15
  256. package/src/deploy/__tests__/__fixtures__/route-apps/services.ts +0 -55
  257. package/src/deploy/__tests__/backup-provisioner.spec.ts +0 -428
  258. package/src/deploy/__tests__/createDnsProvider.spec.ts +0 -195
  259. package/src/deploy/__tests__/createStateProvider.spec.ts +0 -126
  260. package/src/deploy/__tests__/dns-orchestration.spec.ts +0 -192
  261. package/src/deploy/__tests__/dns-verification.spec.ts +0 -229
  262. package/src/deploy/__tests__/docker.spec.ts +0 -149
  263. package/src/deploy/__tests__/dokploy-api.spec.ts +0 -697
  264. package/src/deploy/__tests__/dokploy.spec.ts +0 -435
  265. package/src/deploy/__tests__/domain.spec.ts +0 -235
  266. package/src/deploy/__tests__/env-resolver.spec.ts +0 -903
  267. package/src/deploy/__tests__/index.spec.ts +0 -1091
  268. package/src/deploy/__tests__/init.spec.ts +0 -793
  269. package/src/deploy/__tests__/secrets.spec.ts +0 -303
  270. package/src/deploy/__tests__/sniffer.spec.ts +0 -838
  271. package/src/deploy/__tests__/state-e2e.spec.ts +0 -387
  272. package/src/deploy/__tests__/state.spec.ts +0 -876
  273. package/src/deploy/__tests__/undeploy.spec.ts +0 -758
  274. package/src/deploy/backup-provisioner.ts +0 -316
  275. package/src/deploy/dns/DnsProvider.ts +0 -201
  276. package/src/deploy/dns/HostingerProvider.ts +0 -174
  277. package/src/deploy/dns/Route53Provider.ts +0 -340
  278. package/src/deploy/dns/hostinger-api.ts +0 -261
  279. package/src/deploy/dns/index.ts +0 -627
  280. package/src/deploy/docker.ts +0 -260
  281. package/src/deploy/dokploy-api.ts +0 -1101
  282. package/src/deploy/dokploy.ts +0 -177
  283. package/src/deploy/domain.ts +0 -134
  284. package/src/deploy/env-resolver.ts +0 -305
  285. package/src/deploy/index.ts +0 -2094
  286. package/src/deploy/init.ts +0 -427
  287. package/src/deploy/secrets.ts +0 -187
  288. package/src/deploy/sniffer-envkit-patch.ts +0 -61
  289. package/src/deploy/sniffer-hooks.ts +0 -57
  290. package/src/deploy/sniffer-loader.ts +0 -28
  291. package/src/deploy/sniffer-routes-worker.ts +0 -104
  292. package/src/deploy/sniffer-worker.ts +0 -75
  293. package/src/deploy/sniffer.ts +0 -578
  294. package/src/deploy/state-commands.ts +0 -274
  295. package/src/deploy/state.ts +0 -482
  296. package/src/deploy/types.ts +0 -102
  297. package/src/deploy/undeploy.ts +0 -407
  298. package/src/dev/__tests__/entry-integration.spec.ts +0 -347
  299. package/src/dev/__tests__/entry.spec.ts +0 -144
  300. package/src/dev/__tests__/index.spec.ts +0 -2084
  301. package/src/dev/index.ts +0 -1649
  302. package/src/docker/__tests__/compose.spec.ts +0 -1142
  303. package/src/docker/__tests__/templates.spec.ts +0 -694
  304. package/src/docker/compose.ts +0 -808
  305. package/src/docker/index.ts +0 -523
  306. package/src/docker/templates.ts +0 -1067
  307. package/src/exec/index.ts +0 -118
  308. package/src/generators/CronGenerator.ts +0 -105
  309. package/src/generators/EndpointGenerator.ts +0 -954
  310. package/src/generators/FunctionGenerator.ts +0 -117
  311. package/src/generators/Generator.ts +0 -147
  312. package/src/generators/OpenApiTsGenerator.ts +0 -821
  313. package/src/generators/QueueGenerator.ts +0 -245
  314. package/src/generators/SubscriberGenerator.ts +0 -282
  315. package/src/generators/TopicGenerator.ts +0 -45
  316. package/src/generators/__tests__/CronGenerator.spec.ts +0 -445
  317. package/src/generators/__tests__/EndpointGenerator.spec.ts +0 -544
  318. package/src/generators/__tests__/FunctionGenerator.spec.ts +0 -256
  319. package/src/generators/__tests__/Generator.bustCache.spec.ts +0 -72
  320. package/src/generators/__tests__/OpenApiTsGenerator.registry.spec.ts +0 -98
  321. package/src/generators/__tests__/OpenApiTsGenerator.responseType.spec.ts +0 -56
  322. package/src/generators/__tests__/QueueGenerator.spec.ts +0 -141
  323. package/src/generators/__tests__/SubscriberGenerator.spec.ts +0 -410
  324. package/src/generators/index.ts +0 -11
  325. package/src/index.ts +0 -972
  326. package/src/init/__tests__/generators.spec.ts +0 -1070
  327. package/src/init/__tests__/init.spec.ts +0 -577
  328. package/src/init/__tests__/utils.spec.ts +0 -104
  329. package/src/init/generators/auth.ts +0 -225
  330. package/src/init/generators/config.ts +0 -316
  331. package/src/init/generators/docker.ts +0 -388
  332. package/src/init/generators/env.ts +0 -62
  333. package/src/init/generators/index.ts +0 -6
  334. package/src/init/generators/mobile-expo.ts +0 -576
  335. package/src/init/generators/models.ts +0 -153
  336. package/src/init/generators/monorepo.ts +0 -475
  337. package/src/init/generators/package.ts +0 -95
  338. package/src/init/generators/source.ts +0 -15
  339. package/src/init/generators/test.ts +0 -178
  340. package/src/init/generators/ui.ts +0 -1473
  341. package/src/init/generators/web-tanstack.ts +0 -348
  342. package/src/init/generators/web.ts +0 -363
  343. package/src/init/index.ts +0 -542
  344. package/src/init/templates/api.ts +0 -404
  345. package/src/init/templates/index.ts +0 -342
  346. package/src/init/templates/minimal.ts +0 -207
  347. package/src/init/templates/serverless.ts +0 -148
  348. package/src/init/templates/worker.ts +0 -216
  349. package/src/init/utils.ts +0 -197
  350. package/src/init/versions.ts +0 -52
  351. package/src/openapi-react-query.ts +0 -288
  352. package/src/openapi.ts +0 -259
  353. package/src/secrets/__tests__/encryption.spec.ts +0 -226
  354. package/src/secrets/__tests__/generator.spec.ts +0 -575
  355. package/src/secrets/__tests__/index.spec.ts +0 -91
  356. package/src/secrets/__tests__/reconcile.spec.ts +0 -123
  357. package/src/secrets/__tests__/storage.spec.ts +0 -645
  358. package/src/secrets/encryption.ts +0 -91
  359. package/src/secrets/generator.ts +0 -329
  360. package/src/secrets/index.ts +0 -417
  361. package/src/secrets/keystore.ts +0 -144
  362. package/src/secrets/reconcile.ts +0 -53
  363. package/src/secrets/storage.ts +0 -337
  364. package/src/secrets/sync.ts +0 -136
  365. package/src/secrets/types.ts +0 -70
  366. package/src/setup/__tests__/auto-setup.spec.ts +0 -147
  367. package/src/setup/__tests__/reconcile-secrets.spec.ts +0 -439
  368. package/src/setup/fullstack-secrets.ts +0 -140
  369. package/src/setup/index.ts +0 -411
  370. package/src/test/__tests__/__fixtures__/workspace.ts +0 -104
  371. package/src/test/__tests__/api.spec.ts +0 -199
  372. package/src/test/__tests__/auth.spec.ts +0 -162
  373. package/src/test/__tests__/index.spec.ts +0 -502
  374. package/src/test/__tests__/web.spec.ts +0 -210
  375. package/src/test/index.ts +0 -198
  376. package/src/types.ts +0 -363
  377. package/src/upgrade/__tests__/index.spec.ts +0 -354
  378. package/src/upgrade/index.ts +0 -253
  379. package/src/workspace/__tests__/client-generator.spec.ts +0 -326
  380. package/src/workspace/__tests__/index.spec.ts +0 -766
  381. package/src/workspace/__tests__/publicEnv.spec.ts +0 -64
  382. package/src/workspace/__tests__/schema.spec.ts +0 -737
  383. package/src/workspace/__tests__/type-inference.spec.ts +0 -251
  384. package/src/workspace/client-generator.ts +0 -109
  385. package/src/workspace/index.ts +0 -433
  386. package/src/workspace/publicEnv.ts +0 -57
  387. package/src/workspace/schema.ts +0 -861
  388. package/src/workspace/types.ts +0 -943
  389. package/tsconfig.json +0 -9
  390. package/tsdown.config.ts +0 -22
@@ -1,1473 +0,0 @@
1
- import type { GeneratedFile, TemplateOptions } from '../templates/index.js';
2
-
3
- /**
4
- * Generate UI package files for fullstack template
5
- * Based on @geekmidas/ui with shadcn/ui, Tailwind CSS v4, and Storybook
6
- */
7
- export function generateUiPackageFiles(
8
- options: TemplateOptions,
9
- ): GeneratedFile[] {
10
- if (!options.monorepo || options.template !== 'fullstack') {
11
- return [];
12
- }
13
-
14
- const packageName = `@${options.name}/ui`;
15
-
16
- // package.json for UI package
17
- const packageJson = {
18
- name: packageName,
19
- version: '0.0.1',
20
- private: true,
21
- type: 'module',
22
- exports: {
23
- '.': './src/index.ts',
24
- './components': './src/components/index.ts',
25
- './lib/utils': './src/lib/utils.ts',
26
- './styles': './src/styles/globals.css',
27
- },
28
- scripts: {
29
- 'ts:check': 'tsc --noEmit',
30
- storybook: 'storybook dev -p 6006',
31
- 'build:storybook': 'storybook build -o dist/storybook',
32
- },
33
- dependencies: {
34
- '@radix-ui/react-dialog': '~1.1.4',
35
- '@radix-ui/react-label': '~2.1.2',
36
- '@radix-ui/react-separator': '~1.1.2',
37
- '@radix-ui/react-slot': '~1.2.4',
38
- '@radix-ui/react-tabs': '~1.1.2',
39
- '@radix-ui/react-tooltip': '~1.1.6',
40
- 'class-variance-authority': '~0.7.1',
41
- clsx: '^2.1.1',
42
- 'lucide-react': '~0.562.0',
43
- 'tailwind-merge': '~3.4.0',
44
- },
45
- devDependencies: {
46
- '@storybook/addon-a11y': '^8.4.7',
47
- '@storybook/addon-essentials': '^8.4.7',
48
- '@storybook/addon-interactions': '^8.4.7',
49
- '@storybook/react': '^8.4.7',
50
- '@storybook/react-vite': '^8.4.7',
51
- '@tailwindcss/vite': '^4.0.0',
52
- '@types/react': '^19.0.0',
53
- '@types/react-dom': '^19.0.0',
54
- react: '^19.0.0',
55
- 'react-dom': '^19.0.0',
56
- storybook: '^8.4.7',
57
- tailwindcss: '^4.0.0',
58
- typescript: '^5.8.2',
59
- vite: '^6.0.0',
60
- },
61
- peerDependencies: {
62
- react: '>=18.0.0',
63
- 'react-dom': '>=18.0.0',
64
- tailwindcss: '>=4.0.0',
65
- },
66
- };
67
-
68
- // tsconfig.json for UI package
69
- const tsConfig = {
70
- extends: '../../tsconfig.json',
71
- compilerOptions: {
72
- jsx: 'react-jsx',
73
- lib: ['ES2023', 'DOM', 'DOM.Iterable'],
74
- noEmit: true,
75
- allowImportingTsExtensions: true,
76
- baseUrl: '.',
77
- paths: {
78
- '~/*': ['./src/*'],
79
- },
80
- },
81
- include: ['src/**/*'],
82
- exclude: ['node_modules', 'dist', '**/*.stories.tsx'],
83
- };
84
-
85
- // components.json (shadcn config)
86
- const componentsJson = {
87
- $schema: 'https://ui.shadcn.com/schema.json',
88
- style: 'new-york',
89
- rsc: false,
90
- tsx: true,
91
- tailwind: {
92
- config: '',
93
- css: 'src/styles/globals.css',
94
- baseColor: 'neutral',
95
- cssVariables: true,
96
- prefix: '',
97
- },
98
- aliases: {
99
- components: '~/components',
100
- utils: '~/lib/utils',
101
- ui: '~/components/ui',
102
- lib: '~/lib',
103
- hooks: '~/hooks',
104
- },
105
- iconLibrary: 'lucide',
106
- };
107
-
108
- // .storybook/main.ts
109
- const storybookMain = `import type { StorybookConfig } from '@storybook/react-vite';
110
-
111
- const config: StorybookConfig = {
112
- stories: ['../src/**/*.stories.@(ts|tsx)'],
113
- addons: [
114
- '@storybook/addon-essentials',
115
- '@storybook/addon-interactions',
116
- '@storybook/addon-a11y',
117
- ],
118
- framework: {
119
- name: '@storybook/react-vite',
120
- options: {},
121
- },
122
- docs: {
123
- autodocs: 'tag',
124
- },
125
- viteFinal: async (config) => {
126
- // Add Tailwind CSS v4 plugin
127
- const tailwindcss = await import('@tailwindcss/vite');
128
- config.plugins = config.plugins || [];
129
- config.plugins.push(tailwindcss.default());
130
- return config;
131
- },
132
- };
133
-
134
- export default config;
135
- `;
136
-
137
- // .storybook/preview.ts
138
- const storybookPreview = `import type { Preview } from '@storybook/react';
139
- import '../src/styles/globals.css';
140
-
141
- const preview: Preview = {
142
- parameters: {
143
- backgrounds: {
144
- default: 'dark',
145
- values: [
146
- { name: 'dark', value: '#171717' },
147
- { name: 'surface', value: '#1c1c1c' },
148
- { name: 'light', value: '#fafafa' },
149
- ],
150
- },
151
- controls: {
152
- matchers: {
153
- color: /(background|color)$/i,
154
- date: /Date$/i,
155
- },
156
- },
157
- layout: 'centered',
158
- },
159
- };
160
-
161
- export default preview;
162
- `;
163
-
164
- // src/styles/globals.css (Tailwind v4 format)
165
- const globalsCss = `@import "tailwindcss";
166
-
167
- @theme {
168
- --color-background: hsl(var(--background));
169
- --color-foreground: hsl(var(--foreground));
170
- --color-card: hsl(var(--card));
171
- --color-card-foreground: hsl(var(--card-foreground));
172
- --color-popover: hsl(var(--popover));
173
- --color-popover-foreground: hsl(var(--popover-foreground));
174
- --color-primary: hsl(var(--primary));
175
- --color-primary-foreground: hsl(var(--primary-foreground));
176
- --color-secondary: hsl(var(--secondary));
177
- --color-secondary-foreground: hsl(var(--secondary-foreground));
178
- --color-muted: hsl(var(--muted));
179
- --color-muted-foreground: hsl(var(--muted-foreground));
180
- --color-accent: hsl(var(--accent));
181
- --color-accent-foreground: hsl(var(--accent-foreground));
182
- --color-destructive: hsl(var(--destructive));
183
- --color-destructive-foreground: hsl(var(--destructive-foreground));
184
- --color-border: hsl(var(--border));
185
- --color-input: hsl(var(--input));
186
- --color-ring: hsl(var(--ring));
187
- --radius-sm: calc(var(--radius) - 4px);
188
- --radius-md: calc(var(--radius) - 2px);
189
- --radius-lg: var(--radius);
190
- --radius-xl: calc(var(--radius) + 4px);
191
- }
192
-
193
- @layer base {
194
- :root {
195
- --background: 0 0% 100%;
196
- --foreground: 0 0% 3.9%;
197
- --card: 0 0% 100%;
198
- --card-foreground: 0 0% 3.9%;
199
- --popover: 0 0% 100%;
200
- --popover-foreground: 0 0% 3.9%;
201
- --primary: 160 84% 39%;
202
- --primary-foreground: 0 0% 98%;
203
- --secondary: 0 0% 96.1%;
204
- --secondary-foreground: 0 0% 9%;
205
- --muted: 0 0% 96.1%;
206
- --muted-foreground: 0 0% 45.1%;
207
- --accent: 0 0% 96.1%;
208
- --accent-foreground: 0 0% 9%;
209
- --destructive: 0 84.2% 60.2%;
210
- --destructive-foreground: 0 0% 98%;
211
- --border: 0 0% 89.8%;
212
- --input: 0 0% 89.8%;
213
- --ring: 160 84% 39%;
214
- --radius: 0.5rem;
215
- }
216
-
217
- .dark {
218
- --background: 0 0% 9%;
219
- --foreground: 0 0% 98%;
220
- --card: 0 0% 11%;
221
- --card-foreground: 0 0% 98%;
222
- --popover: 0 0% 11%;
223
- --popover-foreground: 0 0% 98%;
224
- --primary: 160 84% 52%;
225
- --primary-foreground: 0 0% 9%;
226
- --secondary: 0 0% 15%;
227
- --secondary-foreground: 0 0% 98%;
228
- --muted: 0 0% 15%;
229
- --muted-foreground: 0 0% 64%;
230
- --accent: 0 0% 15%;
231
- --accent-foreground: 0 0% 98%;
232
- --destructive: 0 62.8% 50.6%;
233
- --destructive-foreground: 0 0% 98%;
234
- --border: 0 0% 18%;
235
- --input: 0 0% 18%;
236
- --ring: 160 84% 52%;
237
- }
238
- }
239
-
240
- @layer base {
241
- * {
242
- @apply border-border;
243
- }
244
- body {
245
- @apply bg-background text-foreground;
246
- }
247
- }
248
- `;
249
-
250
- // src/lib/utils.ts
251
- const utilsTs = `import { type ClassValue, clsx } from 'clsx';
252
- import { twMerge } from 'tailwind-merge';
253
-
254
- export function cn(...inputs: ClassValue[]) {
255
- return twMerge(clsx(inputs));
256
- }
257
- `;
258
-
259
- // src/components/ui/button.tsx
260
- const buttonTsx = `import { Slot } from '@radix-ui/react-slot';
261
- import { cva, type VariantProps } from 'class-variance-authority';
262
- import * as React from 'react';
263
-
264
- import { cn } from '~/lib/utils';
265
-
266
- const buttonVariants = cva(
267
- 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
268
- {
269
- variants: {
270
- variant: {
271
- default:
272
- 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
273
- destructive:
274
- 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
275
- outline:
276
- 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
277
- secondary:
278
- 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
279
- ghost: 'hover:bg-accent hover:text-accent-foreground',
280
- link: 'text-primary underline-offset-4 hover:underline',
281
- },
282
- size: {
283
- default: 'h-9 px-4 py-2',
284
- sm: 'h-8 rounded-md px-3 text-xs',
285
- lg: 'h-10 rounded-md px-8',
286
- icon: 'h-9 w-9',
287
- },
288
- },
289
- defaultVariants: {
290
- variant: 'default',
291
- size: 'default',
292
- },
293
- },
294
- );
295
-
296
- export interface ButtonProps
297
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
298
- VariantProps<typeof buttonVariants> {
299
- asChild?: boolean;
300
- }
301
-
302
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
303
- ({ className, variant, size, asChild = false, ...props }, ref) => {
304
- const Comp = asChild ? Slot : 'button';
305
- return (
306
- <Comp
307
- className={cn(buttonVariants({ variant, size, className }))}
308
- ref={ref}
309
- {...props}
310
- />
311
- );
312
- },
313
- );
314
- Button.displayName = 'Button';
315
-
316
- export { Button, buttonVariants };
317
- `;
318
-
319
- // src/components/ui/button/button.stories.tsx
320
- const buttonStories = `import type { Meta, StoryObj } from '@storybook/react';
321
- import { Button } from '~/components/ui/button';
322
-
323
- const meta: Meta<typeof Button> = {
324
- title: 'Components/Button',
325
- component: Button,
326
- tags: ['autodocs'],
327
- argTypes: {
328
- variant: {
329
- control: 'select',
330
- options: ['default', 'destructive', 'outline', 'secondary', 'ghost', 'link'],
331
- },
332
- size: {
333
- control: 'select',
334
- options: ['default', 'sm', 'lg', 'icon'],
335
- },
336
- },
337
- };
338
-
339
- export default meta;
340
- type Story = StoryObj<typeof Button>;
341
-
342
- export const Default: Story = {
343
- args: {
344
- children: 'Button',
345
- variant: 'default',
346
- size: 'default',
347
- },
348
- };
349
-
350
- export const Secondary: Story = {
351
- args: {
352
- children: 'Secondary',
353
- variant: 'secondary',
354
- },
355
- };
356
-
357
- export const Destructive: Story = {
358
- args: {
359
- children: 'Destructive',
360
- variant: 'destructive',
361
- },
362
- };
363
-
364
- export const Outline: Story = {
365
- args: {
366
- children: 'Outline',
367
- variant: 'outline',
368
- },
369
- };
370
-
371
- export const Ghost: Story = {
372
- args: {
373
- children: 'Ghost',
374
- variant: 'ghost',
375
- },
376
- };
377
-
378
- export const Link: Story = {
379
- args: {
380
- children: 'Link',
381
- variant: 'link',
382
- },
383
- };
384
- `;
385
-
386
- // src/components/ui/input.tsx
387
- const inputTsx = `import * as React from 'react';
388
-
389
- import { cn } from '~/lib/utils';
390
-
391
- const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
392
- ({ className, type, ...props }, ref) => {
393
- return (
394
- <input
395
- type={type}
396
- className={cn(
397
- 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
398
- className,
399
- )}
400
- ref={ref}
401
- {...props}
402
- />
403
- );
404
- },
405
- );
406
- Input.displayName = 'Input';
407
-
408
- export { Input };
409
- `;
410
-
411
- // src/components/ui/card.tsx
412
- const cardTsx = `import * as React from 'react';
413
-
414
- import { cn } from '~/lib/utils';
415
-
416
- const Card = React.forwardRef<
417
- HTMLDivElement,
418
- React.HTMLAttributes<HTMLDivElement>
419
- >(({ className, ...props }, ref) => (
420
- <div
421
- ref={ref}
422
- className={cn(
423
- 'rounded-xl border bg-card text-card-foreground shadow',
424
- className,
425
- )}
426
- {...props}
427
- />
428
- ));
429
- Card.displayName = 'Card';
430
-
431
- const CardHeader = React.forwardRef<
432
- HTMLDivElement,
433
- React.HTMLAttributes<HTMLDivElement>
434
- >(({ className, ...props }, ref) => (
435
- <div
436
- ref={ref}
437
- className={cn('flex flex-col space-y-1.5 p-6', className)}
438
- {...props}
439
- />
440
- ));
441
- CardHeader.displayName = 'CardHeader';
442
-
443
- const CardTitle = React.forwardRef<
444
- HTMLDivElement,
445
- React.HTMLAttributes<HTMLDivElement>
446
- >(({ className, ...props }, ref) => (
447
- <div
448
- ref={ref}
449
- className={cn('font-semibold leading-none tracking-tight', className)}
450
- {...props}
451
- />
452
- ));
453
- CardTitle.displayName = 'CardTitle';
454
-
455
- const CardDescription = React.forwardRef<
456
- HTMLDivElement,
457
- React.HTMLAttributes<HTMLDivElement>
458
- >(({ className, ...props }, ref) => (
459
- <div
460
- ref={ref}
461
- className={cn('text-sm text-muted-foreground', className)}
462
- {...props}
463
- />
464
- ));
465
- CardDescription.displayName = 'CardDescription';
466
-
467
- const CardContent = React.forwardRef<
468
- HTMLDivElement,
469
- React.HTMLAttributes<HTMLDivElement>
470
- >(({ className, ...props }, ref) => (
471
- <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
472
- ));
473
- CardContent.displayName = 'CardContent';
474
-
475
- const CardFooter = React.forwardRef<
476
- HTMLDivElement,
477
- React.HTMLAttributes<HTMLDivElement>
478
- >(({ className, ...props }, ref) => (
479
- <div
480
- ref={ref}
481
- className={cn('flex items-center p-6 pt-0', className)}
482
- {...props}
483
- />
484
- ));
485
- CardFooter.displayName = 'CardFooter';
486
-
487
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
488
- `;
489
-
490
- // src/components/ui/input/input.stories.tsx
491
- const inputStories = `import type { Meta, StoryObj } from '@storybook/react';
492
- import { Input } from '~/components/ui/input';
493
-
494
- const meta: Meta<typeof Input> = {
495
- title: 'Components/Input',
496
- component: Input,
497
- tags: ['autodocs'],
498
- argTypes: {
499
- type: {
500
- control: 'select',
501
- options: ['text', 'email', 'password', 'number', 'search', 'tel', 'url'],
502
- },
503
- disabled: {
504
- control: 'boolean',
505
- },
506
- },
507
- };
508
-
509
- export default meta;
510
- type Story = StoryObj<typeof Input>;
511
-
512
- export const Default: Story = {
513
- args: {
514
- placeholder: 'Enter text...',
515
- },
516
- };
517
-
518
- export const Email: Story = {
519
- args: {
520
- type: 'email',
521
- placeholder: 'Enter email...',
522
- },
523
- };
524
-
525
- export const Password: Story = {
526
- args: {
527
- type: 'password',
528
- placeholder: 'Enter password...',
529
- },
530
- };
531
-
532
- export const Disabled: Story = {
533
- args: {
534
- placeholder: 'Disabled input',
535
- disabled: true,
536
- },
537
- };
538
-
539
- export const WithValue: Story = {
540
- args: {
541
- defaultValue: 'Hello World',
542
- },
543
- };
544
- `;
545
-
546
- // src/components/ui/card/card.stories.tsx
547
- const cardStories = `import type { Meta, StoryObj } from '@storybook/react';
548
- import { Button } from '~/components/ui/button';
549
- import {
550
- Card,
551
- CardContent,
552
- CardDescription,
553
- CardFooter,
554
- CardHeader,
555
- CardTitle,
556
- } from '~/components/ui/card';
557
- import { Input } from '~/components/ui/input';
558
-
559
- const meta: Meta<typeof Card> = {
560
- title: 'Components/Card',
561
- component: Card,
562
- tags: ['autodocs'],
563
- };
564
-
565
- export default meta;
566
- type Story = StoryObj<typeof Card>;
567
-
568
- export const Default: Story = {
569
- render: () => (
570
- <Card className="w-[350px]">
571
- <CardHeader>
572
- <CardTitle>Card Title</CardTitle>
573
- <CardDescription>Card description goes here.</CardDescription>
574
- </CardHeader>
575
- <CardContent>
576
- <p>Card content goes here.</p>
577
- </CardContent>
578
- </Card>
579
- ),
580
- };
581
-
582
- export const WithFooter: Story = {
583
- render: () => (
584
- <Card className="w-[350px]">
585
- <CardHeader>
586
- <CardTitle>Create Account</CardTitle>
587
- <CardDescription>Enter your details below.</CardDescription>
588
- </CardHeader>
589
- <CardContent className="space-y-4">
590
- <Input placeholder="Email" type="email" />
591
- <Input placeholder="Password" type="password" />
592
- </CardContent>
593
- <CardFooter className="flex justify-between">
594
- <Button variant="outline">Cancel</Button>
595
- <Button>Create</Button>
596
- </CardFooter>
597
- </Card>
598
- ),
599
- };
600
-
601
- export const Simple: Story = {
602
- render: () => (
603
- <Card className="w-[350px] p-6">
604
- <p>Simple card with just content.</p>
605
- </Card>
606
- ),
607
- };
608
- `;
609
-
610
- // src/components/ui/label/index.tsx
611
- const labelTsx = `import * as LabelPrimitive from '@radix-ui/react-label';
612
- import { cva, type VariantProps } from 'class-variance-authority';
613
- import * as React from 'react';
614
-
615
- import { cn } from '~/lib/utils';
616
-
617
- const labelVariants = cva(
618
- 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
619
- );
620
-
621
- const Label = React.forwardRef<
622
- React.ElementRef<typeof LabelPrimitive.Root>,
623
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
624
- VariantProps<typeof labelVariants>
625
- >(({ className, ...props }, ref) => (
626
- <LabelPrimitive.Root
627
- ref={ref}
628
- className={cn(labelVariants(), className)}
629
- {...props}
630
- />
631
- ));
632
- Label.displayName = LabelPrimitive.Root.displayName;
633
-
634
- export { Label };
635
- `;
636
-
637
- // src/components/ui/label/label.stories.tsx
638
- const labelStories = `import type { Meta, StoryObj } from '@storybook/react';
639
- import { Input } from '~/components/ui/input';
640
- import { Label } from '~/components/ui/label';
641
-
642
- const meta: Meta<typeof Label> = {
643
- title: 'Components/Label',
644
- component: Label,
645
- tags: ['autodocs'],
646
- };
647
-
648
- export default meta;
649
- type Story = StoryObj<typeof Label>;
650
-
651
- export const Default: Story = {
652
- args: {
653
- children: 'Label',
654
- },
655
- };
656
-
657
- export const WithInput: Story = {
658
- render: () => (
659
- <div className="grid w-full max-w-sm items-center gap-1.5">
660
- <Label htmlFor="email">Email</Label>
661
- <Input type="email" id="email" placeholder="Email" />
662
- </div>
663
- ),
664
- };
665
-
666
- export const Disabled: Story = {
667
- render: () => (
668
- <div className="grid w-full max-w-sm items-center gap-1.5">
669
- <Label htmlFor="disabled" className="peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
670
- Disabled
671
- </Label>
672
- <Input type="text" id="disabled" placeholder="Disabled" disabled className="peer" />
673
- </div>
674
- ),
675
- };
676
- `;
677
-
678
- // src/components/ui/badge/index.tsx
679
- const badgeTsx = `import { cva, type VariantProps } from 'class-variance-authority';
680
- import * as React from 'react';
681
-
682
- import { cn } from '~/lib/utils';
683
-
684
- const badgeVariants = cva(
685
- 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
686
- {
687
- variants: {
688
- variant: {
689
- default:
690
- 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',
691
- secondary:
692
- 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
693
- destructive:
694
- 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
695
- outline: 'text-foreground',
696
- },
697
- },
698
- defaultVariants: {
699
- variant: 'default',
700
- },
701
- },
702
- );
703
-
704
- export interface BadgeProps
705
- extends React.HTMLAttributes<HTMLDivElement>,
706
- VariantProps<typeof badgeVariants> {}
707
-
708
- function Badge({ className, variant, ...props }: BadgeProps) {
709
- return (
710
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
711
- );
712
- }
713
-
714
- export { Badge, badgeVariants };
715
- `;
716
-
717
- // src/components/ui/badge/badge.stories.tsx
718
- const badgeStories = `import type { Meta, StoryObj } from '@storybook/react';
719
- import { Badge } from '~/components/ui/badge';
720
-
721
- const meta: Meta<typeof Badge> = {
722
- title: 'Components/Badge',
723
- component: Badge,
724
- tags: ['autodocs'],
725
- argTypes: {
726
- variant: {
727
- control: 'select',
728
- options: ['default', 'secondary', 'destructive', 'outline'],
729
- },
730
- },
731
- };
732
-
733
- export default meta;
734
- type Story = StoryObj<typeof Badge>;
735
-
736
- export const Default: Story = {
737
- args: {
738
- children: 'Badge',
739
- variant: 'default',
740
- },
741
- };
742
-
743
- export const Secondary: Story = {
744
- args: {
745
- children: 'Secondary',
746
- variant: 'secondary',
747
- },
748
- };
749
-
750
- export const Destructive: Story = {
751
- args: {
752
- children: 'Destructive',
753
- variant: 'destructive',
754
- },
755
- };
756
-
757
- export const Outline: Story = {
758
- args: {
759
- children: 'Outline',
760
- variant: 'outline',
761
- },
762
- };
763
- `;
764
-
765
- // src/components/ui/separator/index.tsx
766
- const separatorTsx = `import * as SeparatorPrimitive from '@radix-ui/react-separator';
767
- import * as React from 'react';
768
-
769
- import { cn } from '~/lib/utils';
770
-
771
- const Separator = React.forwardRef<
772
- React.ElementRef<typeof SeparatorPrimitive.Root>,
773
- React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
774
- >(
775
- (
776
- { className, orientation = 'horizontal', decorative = true, ...props },
777
- ref,
778
- ) => (
779
- <SeparatorPrimitive.Root
780
- ref={ref}
781
- decorative={decorative}
782
- orientation={orientation}
783
- className={cn(
784
- 'shrink-0 bg-border',
785
- orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
786
- className,
787
- )}
788
- {...props}
789
- />
790
- ),
791
- );
792
- Separator.displayName = SeparatorPrimitive.Root.displayName;
793
-
794
- export { Separator };
795
- `;
796
-
797
- // src/components/ui/separator/separator.stories.tsx
798
- const separatorStories = `import type { Meta, StoryObj } from '@storybook/react';
799
- import { Separator } from '~/components/ui/separator';
800
-
801
- const meta: Meta<typeof Separator> = {
802
- title: 'Components/Separator',
803
- component: Separator,
804
- tags: ['autodocs'],
805
- argTypes: {
806
- orientation: {
807
- control: 'select',
808
- options: ['horizontal', 'vertical'],
809
- },
810
- },
811
- };
812
-
813
- export default meta;
814
- type Story = StoryObj<typeof Separator>;
815
-
816
- export const Horizontal: Story = {
817
- render: () => (
818
- <div className="w-[300px]">
819
- <div className="space-y-1">
820
- <h4 className="text-sm font-medium leading-none">Radix Primitives</h4>
821
- <p className="text-sm text-muted-foreground">
822
- An open-source UI component library.
823
- </p>
824
- </div>
825
- <Separator className="my-4" />
826
- <div className="flex h-5 items-center space-x-4 text-sm">
827
- <div>Blog</div>
828
- <Separator orientation="vertical" />
829
- <div>Docs</div>
830
- <Separator orientation="vertical" />
831
- <div>Source</div>
832
- </div>
833
- </div>
834
- ),
835
- };
836
-
837
- export const Vertical: Story = {
838
- render: () => (
839
- <div className="flex h-5 items-center space-x-4 text-sm">
840
- <div>Blog</div>
841
- <Separator orientation="vertical" />
842
- <div>Docs</div>
843
- <Separator orientation="vertical" />
844
- <div>Source</div>
845
- </div>
846
- ),
847
- };
848
- `;
849
-
850
- // src/components/ui/tabs/index.tsx
851
- const tabsTsx = `import * as TabsPrimitive from '@radix-ui/react-tabs';
852
- import * as React from 'react';
853
-
854
- import { cn } from '~/lib/utils';
855
-
856
- const Tabs = TabsPrimitive.Root;
857
-
858
- const TabsList = React.forwardRef<
859
- React.ElementRef<typeof TabsPrimitive.List>,
860
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
861
- >(({ className, ...props }, ref) => (
862
- <TabsPrimitive.List
863
- ref={ref}
864
- className={cn(
865
- 'inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground',
866
- className,
867
- )}
868
- {...props}
869
- />
870
- ));
871
- TabsList.displayName = TabsPrimitive.List.displayName;
872
-
873
- const TabsTrigger = React.forwardRef<
874
- React.ElementRef<typeof TabsPrimitive.Trigger>,
875
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
876
- >(({ className, ...props }, ref) => (
877
- <TabsPrimitive.Trigger
878
- ref={ref}
879
- className={cn(
880
- 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow',
881
- className,
882
- )}
883
- {...props}
884
- />
885
- ));
886
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
887
-
888
- const TabsContent = React.forwardRef<
889
- React.ElementRef<typeof TabsPrimitive.Content>,
890
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
891
- >(({ className, ...props }, ref) => (
892
- <TabsPrimitive.Content
893
- ref={ref}
894
- className={cn(
895
- 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
896
- className,
897
- )}
898
- {...props}
899
- />
900
- ));
901
- TabsContent.displayName = TabsPrimitive.Content.displayName;
902
-
903
- export { Tabs, TabsList, TabsTrigger, TabsContent };
904
- `;
905
-
906
- // src/components/ui/tabs/tabs.stories.tsx
907
- const tabsStories = `import type { Meta, StoryObj } from '@storybook/react';
908
- import { Tabs, TabsContent, TabsList, TabsTrigger } from '~/components/ui/tabs';
909
- import { Button } from '~/components/ui/button';
910
- import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '~/components/ui/card';
911
- import { Input } from '~/components/ui/input';
912
- import { Label } from '~/components/ui/label';
913
-
914
- const meta: Meta<typeof Tabs> = {
915
- title: 'Components/Tabs',
916
- component: Tabs,
917
- tags: ['autodocs'],
918
- };
919
-
920
- export default meta;
921
- type Story = StoryObj<typeof Tabs>;
922
-
923
- export const Default: Story = {
924
- render: () => (
925
- <Tabs defaultValue="account" className="w-[400px]">
926
- <TabsList>
927
- <TabsTrigger value="account">Account</TabsTrigger>
928
- <TabsTrigger value="password">Password</TabsTrigger>
929
- </TabsList>
930
- <TabsContent value="account">
931
- <Card>
932
- <CardHeader>
933
- <CardTitle>Account</CardTitle>
934
- <CardDescription>
935
- Make changes to your account here. Click save when you're done.
936
- </CardDescription>
937
- </CardHeader>
938
- <CardContent className="space-y-2">
939
- <div className="space-y-1">
940
- <Label htmlFor="name">Name</Label>
941
- <Input id="name" defaultValue="Pedro Duarte" />
942
- </div>
943
- <div className="space-y-1">
944
- <Label htmlFor="username">Username</Label>
945
- <Input id="username" defaultValue="@peduarte" />
946
- </div>
947
- </CardContent>
948
- <CardFooter>
949
- <Button>Save changes</Button>
950
- </CardFooter>
951
- </Card>
952
- </TabsContent>
953
- <TabsContent value="password">
954
- <Card>
955
- <CardHeader>
956
- <CardTitle>Password</CardTitle>
957
- <CardDescription>
958
- Change your password here. After saving, you'll be logged out.
959
- </CardDescription>
960
- </CardHeader>
961
- <CardContent className="space-y-2">
962
- <div className="space-y-1">
963
- <Label htmlFor="current">Current password</Label>
964
- <Input id="current" type="password" />
965
- </div>
966
- <div className="space-y-1">
967
- <Label htmlFor="new">New password</Label>
968
- <Input id="new" type="password" />
969
- </div>
970
- </CardContent>
971
- <CardFooter>
972
- <Button>Save password</Button>
973
- </CardFooter>
974
- </Card>
975
- </TabsContent>
976
- </Tabs>
977
- ),
978
- };
979
- `;
980
-
981
- // src/components/ui/tooltip/index.tsx
982
- const tooltipTsx = `import * as TooltipPrimitive from '@radix-ui/react-tooltip';
983
- import * as React from 'react';
984
-
985
- import { cn } from '~/lib/utils';
986
-
987
- const TooltipProvider = TooltipPrimitive.Provider;
988
-
989
- const Tooltip = TooltipPrimitive.Root;
990
-
991
- const TooltipTrigger = TooltipPrimitive.Trigger;
992
-
993
- const TooltipContent = React.forwardRef<
994
- React.ElementRef<typeof TooltipPrimitive.Content>,
995
- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
996
- >(({ className, sideOffset = 4, ...props }, ref) => (
997
- <TooltipPrimitive.Portal>
998
- <TooltipPrimitive.Content
999
- ref={ref}
1000
- sideOffset={sideOffset}
1001
- className={cn(
1002
- 'z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
1003
- className,
1004
- )}
1005
- {...props}
1006
- />
1007
- </TooltipPrimitive.Portal>
1008
- ));
1009
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
1010
-
1011
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
1012
- `;
1013
-
1014
- // src/components/ui/tooltip/tooltip.stories.tsx
1015
- const tooltipStories = `import type { Meta, StoryObj } from '@storybook/react';
1016
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '~/components/ui/tooltip';
1017
- import { Button } from '~/components/ui/button';
1018
-
1019
- const meta: Meta<typeof Tooltip> = {
1020
- title: 'Components/Tooltip',
1021
- component: Tooltip,
1022
- tags: ['autodocs'],
1023
- decorators: [
1024
- (Story) => (
1025
- <TooltipProvider>
1026
- <Story />
1027
- </TooltipProvider>
1028
- ),
1029
- ],
1030
- };
1031
-
1032
- export default meta;
1033
- type Story = StoryObj<typeof Tooltip>;
1034
-
1035
- export const Default: Story = {
1036
- render: () => (
1037
- <Tooltip>
1038
- <TooltipTrigger asChild>
1039
- <Button variant="outline">Hover me</Button>
1040
- </TooltipTrigger>
1041
- <TooltipContent>
1042
- <p>Add to library</p>
1043
- </TooltipContent>
1044
- </Tooltip>
1045
- ),
1046
- };
1047
-
1048
- export const Positions: Story = {
1049
- render: () => (
1050
- <div className="flex gap-4">
1051
- <Tooltip>
1052
- <TooltipTrigger asChild>
1053
- <Button variant="outline">Top</Button>
1054
- </TooltipTrigger>
1055
- <TooltipContent side="top">
1056
- <p>Top tooltip</p>
1057
- </TooltipContent>
1058
- </Tooltip>
1059
- <Tooltip>
1060
- <TooltipTrigger asChild>
1061
- <Button variant="outline">Bottom</Button>
1062
- </TooltipTrigger>
1063
- <TooltipContent side="bottom">
1064
- <p>Bottom tooltip</p>
1065
- </TooltipContent>
1066
- </Tooltip>
1067
- <Tooltip>
1068
- <TooltipTrigger asChild>
1069
- <Button variant="outline">Left</Button>
1070
- </TooltipTrigger>
1071
- <TooltipContent side="left">
1072
- <p>Left tooltip</p>
1073
- </TooltipContent>
1074
- </Tooltip>
1075
- <Tooltip>
1076
- <TooltipTrigger asChild>
1077
- <Button variant="outline">Right</Button>
1078
- </TooltipTrigger>
1079
- <TooltipContent side="right">
1080
- <p>Right tooltip</p>
1081
- </TooltipContent>
1082
- </Tooltip>
1083
- </div>
1084
- ),
1085
- };
1086
- `;
1087
-
1088
- // src/components/ui/dialog/index.tsx
1089
- const dialogTsx = `import * as DialogPrimitive from '@radix-ui/react-dialog';
1090
- import { X } from 'lucide-react';
1091
- import * as React from 'react';
1092
-
1093
- import { cn } from '~/lib/utils';
1094
-
1095
- const Dialog = DialogPrimitive.Root;
1096
-
1097
- const DialogTrigger = DialogPrimitive.Trigger;
1098
-
1099
- const DialogPortal = DialogPrimitive.Portal;
1100
-
1101
- const DialogClose = DialogPrimitive.Close;
1102
-
1103
- const DialogOverlay = React.forwardRef<
1104
- React.ElementRef<typeof DialogPrimitive.Overlay>,
1105
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
1106
- >(({ className, ...props }, ref) => (
1107
- <DialogPrimitive.Overlay
1108
- ref={ref}
1109
- className={cn(
1110
- 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
1111
- className,
1112
- )}
1113
- {...props}
1114
- />
1115
- ));
1116
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
1117
-
1118
- const DialogContent = React.forwardRef<
1119
- React.ElementRef<typeof DialogPrimitive.Content>,
1120
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
1121
- >(({ className, children, ...props }, ref) => (
1122
- <DialogPortal>
1123
- <DialogOverlay />
1124
- <DialogPrimitive.Content
1125
- ref={ref}
1126
- className={cn(
1127
- 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
1128
- className,
1129
- )}
1130
- {...props}
1131
- >
1132
- {children}
1133
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
1134
- <X className="h-4 w-4" />
1135
- <span className="sr-only">Close</span>
1136
- </DialogPrimitive.Close>
1137
- </DialogPrimitive.Content>
1138
- </DialogPortal>
1139
- ));
1140
- DialogContent.displayName = DialogPrimitive.Content.displayName;
1141
-
1142
- const DialogHeader = ({
1143
- className,
1144
- ...props
1145
- }: React.HTMLAttributes<HTMLDivElement>) => (
1146
- <div
1147
- className={cn(
1148
- 'flex flex-col space-y-1.5 text-center sm:text-left',
1149
- className,
1150
- )}
1151
- {...props}
1152
- />
1153
- );
1154
- DialogHeader.displayName = 'DialogHeader';
1155
-
1156
- const DialogFooter = ({
1157
- className,
1158
- ...props
1159
- }: React.HTMLAttributes<HTMLDivElement>) => (
1160
- <div
1161
- className={cn(
1162
- 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
1163
- className,
1164
- )}
1165
- {...props}
1166
- />
1167
- );
1168
- DialogFooter.displayName = 'DialogFooter';
1169
-
1170
- const DialogTitle = React.forwardRef<
1171
- React.ElementRef<typeof DialogPrimitive.Title>,
1172
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
1173
- >(({ className, ...props }, ref) => (
1174
- <DialogPrimitive.Title
1175
- ref={ref}
1176
- className={cn(
1177
- 'text-lg font-semibold leading-none tracking-tight',
1178
- className,
1179
- )}
1180
- {...props}
1181
- />
1182
- ));
1183
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
1184
-
1185
- const DialogDescription = React.forwardRef<
1186
- React.ElementRef<typeof DialogPrimitive.Description>,
1187
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
1188
- >(({ className, ...props }, ref) => (
1189
- <DialogPrimitive.Description
1190
- ref={ref}
1191
- className={cn('text-sm text-muted-foreground', className)}
1192
- {...props}
1193
- />
1194
- ));
1195
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
1196
-
1197
- export {
1198
- Dialog,
1199
- DialogPortal,
1200
- DialogOverlay,
1201
- DialogTrigger,
1202
- DialogClose,
1203
- DialogContent,
1204
- DialogHeader,
1205
- DialogFooter,
1206
- DialogTitle,
1207
- DialogDescription,
1208
- };
1209
- `;
1210
-
1211
- // src/components/ui/dialog/dialog.stories.tsx
1212
- const dialogStories = `import type { Meta, StoryObj } from '@storybook/react';
1213
- import {
1214
- Dialog,
1215
- DialogContent,
1216
- DialogDescription,
1217
- DialogFooter,
1218
- DialogHeader,
1219
- DialogTitle,
1220
- DialogTrigger,
1221
- } from '~/components/ui/dialog';
1222
- import { Button } from '~/components/ui/button';
1223
- import { Input } from '~/components/ui/input';
1224
- import { Label } from '~/components/ui/label';
1225
-
1226
- const meta: Meta<typeof Dialog> = {
1227
- title: 'Components/Dialog',
1228
- component: Dialog,
1229
- tags: ['autodocs'],
1230
- };
1231
-
1232
- export default meta;
1233
- type Story = StoryObj<typeof Dialog>;
1234
-
1235
- export const Default: Story = {
1236
- render: () => (
1237
- <Dialog>
1238
- <DialogTrigger asChild>
1239
- <Button variant="outline">Edit Profile</Button>
1240
- </DialogTrigger>
1241
- <DialogContent className="sm:max-w-[425px]">
1242
- <DialogHeader>
1243
- <DialogTitle>Edit profile</DialogTitle>
1244
- <DialogDescription>
1245
- Make changes to your profile here. Click save when you're done.
1246
- </DialogDescription>
1247
- </DialogHeader>
1248
- <div className="grid gap-4 py-4">
1249
- <div className="grid grid-cols-4 items-center gap-4">
1250
- <Label htmlFor="name" className="text-right">
1251
- Name
1252
- </Label>
1253
- <Input id="name" defaultValue="Pedro Duarte" className="col-span-3" />
1254
- </div>
1255
- <div className="grid grid-cols-4 items-center gap-4">
1256
- <Label htmlFor="username" className="text-right">
1257
- Username
1258
- </Label>
1259
- <Input id="username" defaultValue="@peduarte" className="col-span-3" />
1260
- </div>
1261
- </div>
1262
- <DialogFooter>
1263
- <Button type="submit">Save changes</Button>
1264
- </DialogFooter>
1265
- </DialogContent>
1266
- </Dialog>
1267
- ),
1268
- };
1269
-
1270
- export const Alert: Story = {
1271
- render: () => (
1272
- <Dialog>
1273
- <DialogTrigger asChild>
1274
- <Button variant="destructive">Delete Account</Button>
1275
- </DialogTrigger>
1276
- <DialogContent>
1277
- <DialogHeader>
1278
- <DialogTitle>Are you absolutely sure?</DialogTitle>
1279
- <DialogDescription>
1280
- This action cannot be undone. This will permanently delete your
1281
- account and remove your data from our servers.
1282
- </DialogDescription>
1283
- </DialogHeader>
1284
- <DialogFooter>
1285
- <Button variant="outline">Cancel</Button>
1286
- <Button variant="destructive">Delete</Button>
1287
- </DialogFooter>
1288
- </DialogContent>
1289
- </Dialog>
1290
- ),
1291
- };
1292
- `;
1293
-
1294
- // src/components/ui/index.ts
1295
- const componentsUiIndex = `export { Button, type ButtonProps, buttonVariants } from './button.tsx';
1296
- export { Input } from './input.tsx';
1297
- export {
1298
- Card,
1299
- CardHeader,
1300
- CardFooter,
1301
- CardTitle,
1302
- CardDescription,
1303
- CardContent,
1304
- } from './card.tsx';
1305
- export { Label } from './label.tsx';
1306
- export { Badge, type BadgeProps, badgeVariants } from './badge.tsx';
1307
- export { Separator } from './separator.tsx';
1308
- export { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.tsx';
1309
- export {
1310
- Tooltip,
1311
- TooltipTrigger,
1312
- TooltipContent,
1313
- TooltipProvider,
1314
- } from './tooltip.tsx';
1315
- export {
1316
- Dialog,
1317
- DialogPortal,
1318
- DialogOverlay,
1319
- DialogTrigger,
1320
- DialogClose,
1321
- DialogContent,
1322
- DialogHeader,
1323
- DialogFooter,
1324
- DialogTitle,
1325
- DialogDescription,
1326
- } from './dialog.tsx';
1327
- `;
1328
-
1329
- // Rename component files to index.tsx (same content)
1330
- const buttonIndexTsx = buttonTsx;
1331
- const inputIndexTsx = inputTsx;
1332
- const cardIndexTsx = cardTsx;
1333
-
1334
- // src/components/index.ts
1335
- const componentsIndex = `export * from './ui/index.ts';
1336
- `;
1337
-
1338
- // src/index.ts
1339
- const indexTs = `// @${options.name}/ui - Shared UI component library
1340
-
1341
- // shadcn/ui components
1342
- export * from './components/index.ts';
1343
-
1344
- // Utilities
1345
- export { cn } from './lib/utils.ts';
1346
- `;
1347
-
1348
- // .gitignore for UI package
1349
- const gitignore = `node_modules/
1350
- dist/
1351
- storybook-static/
1352
- *.log
1353
- `;
1354
-
1355
- return [
1356
- {
1357
- path: 'packages/ui/package.json',
1358
- content: `${JSON.stringify(packageJson, null, 2)}\n`,
1359
- },
1360
- {
1361
- path: 'packages/ui/tsconfig.json',
1362
- content: `${JSON.stringify(tsConfig, null, 2)}\n`,
1363
- },
1364
- {
1365
- path: 'packages/ui/components.json',
1366
- content: `${JSON.stringify(componentsJson, null, 2)}\n`,
1367
- },
1368
- {
1369
- path: 'packages/ui/.storybook/main.ts',
1370
- content: storybookMain,
1371
- },
1372
- {
1373
- path: 'packages/ui/.storybook/preview.ts',
1374
- content: storybookPreview,
1375
- },
1376
- {
1377
- path: 'packages/ui/src/styles/globals.css',
1378
- content: globalsCss,
1379
- },
1380
- {
1381
- path: 'packages/ui/src/lib/utils.ts',
1382
- content: utilsTs,
1383
- },
1384
- {
1385
- path: 'packages/ui/src/components/ui/button/index.tsx',
1386
- content: buttonIndexTsx,
1387
- },
1388
- {
1389
- path: 'packages/ui/src/components/ui/button/button.stories.tsx',
1390
- content: buttonStories,
1391
- },
1392
- {
1393
- path: 'packages/ui/src/components/ui/input/index.tsx',
1394
- content: inputIndexTsx,
1395
- },
1396
- {
1397
- path: 'packages/ui/src/components/ui/input/input.stories.tsx',
1398
- content: inputStories,
1399
- },
1400
- {
1401
- path: 'packages/ui/src/components/ui/card/index.tsx',
1402
- content: cardIndexTsx,
1403
- },
1404
- {
1405
- path: 'packages/ui/src/components/ui/card/card.stories.tsx',
1406
- content: cardStories,
1407
- },
1408
- {
1409
- path: 'packages/ui/src/components/ui/label/index.tsx',
1410
- content: labelTsx,
1411
- },
1412
- {
1413
- path: 'packages/ui/src/components/ui/label/label.stories.tsx',
1414
- content: labelStories,
1415
- },
1416
- {
1417
- path: 'packages/ui/src/components/ui/badge/index.tsx',
1418
- content: badgeTsx,
1419
- },
1420
- {
1421
- path: 'packages/ui/src/components/ui/badge/badge.stories.tsx',
1422
- content: badgeStories,
1423
- },
1424
- {
1425
- path: 'packages/ui/src/components/ui/separator/index.tsx',
1426
- content: separatorTsx,
1427
- },
1428
- {
1429
- path: 'packages/ui/src/components/ui/separator/separator.stories.tsx',
1430
- content: separatorStories,
1431
- },
1432
- {
1433
- path: 'packages/ui/src/components/ui/tabs/index.tsx',
1434
- content: tabsTsx,
1435
- },
1436
- {
1437
- path: 'packages/ui/src/components/ui/tabs/tabs.stories.tsx',
1438
- content: tabsStories,
1439
- },
1440
- {
1441
- path: 'packages/ui/src/components/ui/tooltip/index.tsx',
1442
- content: tooltipTsx,
1443
- },
1444
- {
1445
- path: 'packages/ui/src/components/ui/tooltip/tooltip.stories.tsx',
1446
- content: tooltipStories,
1447
- },
1448
- {
1449
- path: 'packages/ui/src/components/ui/dialog/index.tsx',
1450
- content: dialogTsx,
1451
- },
1452
- {
1453
- path: 'packages/ui/src/components/ui/dialog/dialog.stories.tsx',
1454
- content: dialogStories,
1455
- },
1456
- {
1457
- path: 'packages/ui/src/components/ui/index.ts',
1458
- content: componentsUiIndex,
1459
- },
1460
- {
1461
- path: 'packages/ui/src/components/index.ts',
1462
- content: componentsIndex,
1463
- },
1464
- {
1465
- path: 'packages/ui/src/index.ts',
1466
- content: indexTs,
1467
- },
1468
- {
1469
- path: 'packages/ui/.gitignore',
1470
- content: gitignore,
1471
- },
1472
- ];
1473
- }