@geekmidas/cli 10.0.0-alpha.99 → 10.0.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 (676) hide show
  1. package/CHANGELOG.md +667 -0
  2. package/FUNCTION_CRON_SUPPORT.md +266 -0
  3. package/README.md +533 -382
  4. package/bin/gkm.mjs +2 -16
  5. package/dist/CachedStateProvider-BdX7klRc.cjs +3 -0
  6. package/dist/CachedStateProvider-CzyFct42.mjs +54 -0
  7. package/dist/CachedStateProvider-CzyFct42.mjs.map +1 -0
  8. package/dist/CachedStateProvider-GcGziXh1.mjs +3 -0
  9. package/dist/CachedStateProvider-klLWZXWF.cjs +60 -0
  10. package/dist/CachedStateProvider-klLWZXWF.cjs.map +1 -0
  11. package/dist/{HostingerProvider-BNpS9aRJ.mjs → HostingerProvider-B2ZYz7Yc.mjs} +26 -31
  12. package/dist/HostingerProvider-B2ZYz7Yc.mjs.map +1 -0
  13. package/dist/{HostingerProvider-DR1iws1P.cjs → HostingerProvider-CrHfsgz9.cjs} +26 -31
  14. package/dist/HostingerProvider-CrHfsgz9.cjs.map +1 -0
  15. package/dist/LocalStateProvider-CP49rjzt.mjs +42 -0
  16. package/dist/LocalStateProvider-CP49rjzt.mjs.map +1 -0
  17. package/dist/LocalStateProvider-CalzNfNA.cjs +43 -0
  18. package/dist/LocalStateProvider-CalzNfNA.cjs.map +1 -0
  19. package/dist/{Route53Provider-Bllus2NR.cjs → Route53Provider-DwgXiLxt.cjs} +22 -21
  20. package/dist/Route53Provider-DwgXiLxt.cjs.map +1 -0
  21. package/dist/{Route53Provider-QXxjkZO1.mjs → Route53Provider-tlgBzrRQ.mjs} +13 -13
  22. package/dist/Route53Provider-tlgBzrRQ.mjs.map +1 -0
  23. package/dist/SSMStateProvider-BlrTiV5m.mjs +66 -0
  24. package/dist/SSMStateProvider-BlrTiV5m.mjs.map +1 -0
  25. package/dist/SSMStateProvider-Bt6r8CTL.cjs +66 -0
  26. package/dist/SSMStateProvider-Bt6r8CTL.cjs.map +1 -0
  27. package/dist/{backup-provisioner-oDEsPj02.cjs → backup-provisioner-B3HBN-2k.cjs} +20 -22
  28. package/dist/backup-provisioner-B3HBN-2k.cjs.map +1 -0
  29. package/dist/{backup-provisioner-C8DnCmxK.mjs → backup-provisioner-Xunq-p_8.mjs} +9 -12
  30. package/dist/backup-provisioner-Xunq-p_8.mjs.map +1 -0
  31. package/dist/bundler-DkA4qzUD.mjs +135 -0
  32. package/dist/bundler-DkA4qzUD.mjs.map +1 -0
  33. package/dist/bundler-Dufq3uvI.cjs +136 -0
  34. package/dist/bundler-Dufq3uvI.cjs.map +1 -0
  35. package/dist/{rolldown-runtime-C0BPl7ul.cjs → chunk-CUT6urMc.cjs} +10 -23
  36. package/dist/chunk-Duj1WY3L.mjs +7 -0
  37. package/dist/config-Bbu1JKvf.mjs +211 -0
  38. package/dist/config-Bbu1JKvf.mjs.map +1 -0
  39. package/dist/config-DujV8DbR.cjs +253 -0
  40. package/dist/config-DujV8DbR.cjs.map +1 -0
  41. package/dist/config.cjs +10 -421
  42. package/dist/config.d.cts +120 -4
  43. package/dist/config.d.cts.map +1 -0
  44. package/dist/config.d.mts +120 -4
  45. package/dist/config.d.mts.map +1 -0
  46. package/dist/config.mjs +3 -405
  47. package/dist/credentials-C8DWtnMY.cjs +174 -0
  48. package/dist/credentials-C8DWtnMY.cjs.map +1 -0
  49. package/dist/credentials-s1kLcIzK.mjs +126 -0
  50. package/dist/credentials-s1kLcIzK.mjs.map +1 -0
  51. package/dist/deploy/sniffer-envkit-patch.cjs +10 -18
  52. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  53. package/dist/deploy/sniffer-envkit-patch.d.cts +2 -0
  54. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  55. package/dist/deploy/sniffer-envkit-patch.d.mts +2 -0
  56. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  57. package/dist/deploy/sniffer-envkit-patch.mjs +2 -10
  58. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  59. package/dist/deploy/sniffer-hooks.cjs +7 -13
  60. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  61. package/dist/deploy/sniffer-hooks.d.cts +2 -1
  62. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  63. package/dist/deploy/sniffer-hooks.d.mts +2 -1
  64. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  65. package/dist/deploy/sniffer-hooks.mjs +3 -10
  66. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  67. package/dist/deploy/sniffer-loader.cjs +7 -16
  68. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  69. package/dist/deploy/sniffer-loader.d.cts +1 -1
  70. package/dist/deploy/sniffer-loader.d.mts +1 -1
  71. package/dist/deploy/sniffer-loader.mjs +3 -14
  72. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  73. package/dist/deploy/sniffer-routes-worker.cjs +13 -17
  74. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  75. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  76. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  77. package/dist/deploy/sniffer-routes-worker.mjs +6 -10
  78. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  79. package/dist/deploy/sniffer-worker.cjs +6 -15
  80. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  81. package/dist/deploy/sniffer-worker.d.cts +3 -1
  82. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  83. package/dist/deploy/sniffer-worker.d.mts +3 -1
  84. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  85. package/dist/deploy/sniffer-worker.mjs +4 -15
  86. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  87. package/dist/dokploy-api-BPYkG-ZZ.cjs +3 -0
  88. package/dist/dokploy-api-BiSzWM4v.mjs +3 -0
  89. package/dist/dokploy-api-CqOIKHme.cjs +609 -0
  90. package/dist/dokploy-api-CqOIKHme.cjs.map +1 -0
  91. package/dist/dokploy-api-sfZFlWuE.mjs +597 -0
  92. package/dist/dokploy-api-sfZFlWuE.mjs.map +1 -0
  93. package/dist/encryption-BVS7Vmzs.cjs +4 -0
  94. package/dist/encryption-Bd_m4q3g.mjs +3 -0
  95. package/dist/encryption-CO5Q4Bhf.mjs +42 -0
  96. package/dist/encryption-CO5Q4Bhf.mjs.map +1 -0
  97. package/dist/encryption-MfXAiFTm.cjs +54 -0
  98. package/dist/encryption-MfXAiFTm.cjs.map +1 -0
  99. package/dist/fullstack-secrets-BYzi6Hwl.cjs +402 -0
  100. package/dist/fullstack-secrets-BYzi6Hwl.cjs.map +1 -0
  101. package/dist/fullstack-secrets-l8s3II_H.mjs +336 -0
  102. package/dist/fullstack-secrets-l8s3II_H.mjs.map +1 -0
  103. package/dist/index-CoVW_fFS.d.cts +1737 -0
  104. package/dist/index-CoVW_fFS.d.cts.map +1 -0
  105. package/dist/index-oWibAYQY.d.mts +1737 -0
  106. package/dist/index-oWibAYQY.d.mts.map +1 -0
  107. package/dist/index.cjs +11324 -10240
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.d.cts +1 -1
  110. package/dist/index.d.mts +1 -1
  111. package/dist/index.mjs +11327 -10231
  112. package/dist/index.mjs.map +1 -1
  113. package/dist/openapi-BzNOC7_i.cjs +1931 -0
  114. package/dist/openapi-BzNOC7_i.cjs.map +1 -0
  115. package/dist/openapi-Cfwi0fqF.mjs +1883 -0
  116. package/dist/openapi-Cfwi0fqF.mjs.map +1 -0
  117. package/dist/openapi-react-query-C4iIvpPf.mjs +167 -0
  118. package/dist/openapi-react-query-C4iIvpPf.mjs.map +1 -0
  119. package/dist/openapi-react-query-CYWik72n.cjs +173 -0
  120. package/dist/openapi-react-query-CYWik72n.cjs.map +1 -0
  121. package/dist/openapi-react-query.cjs +4 -0
  122. package/dist/openapi-react-query.d.cts +11 -0
  123. package/dist/openapi-react-query.d.cts.map +1 -0
  124. package/dist/openapi-react-query.d.mts +11 -0
  125. package/dist/openapi-react-query.d.mts.map +1 -0
  126. package/dist/openapi-react-query.mjs +4 -0
  127. package/dist/openapi.cjs +7 -214
  128. package/dist/openapi.d.cts +15 -72
  129. package/dist/openapi.d.cts.map +1 -1
  130. package/dist/openapi.d.mts +15 -72
  131. package/dist/openapi.d.mts.map +1 -1
  132. package/dist/openapi.mjs +4 -208
  133. package/dist/{reconcile--I7V4Klj.mjs → reconcile-B2FoJE0a.mjs} +8 -6
  134. package/dist/reconcile-B2FoJE0a.mjs.map +1 -0
  135. package/dist/{reconcile-CuCQBa5-.cjs → reconcile-BzqKJ2Rt.cjs} +8 -6
  136. package/dist/reconcile-BzqKJ2Rt.cjs.map +1 -0
  137. package/dist/setup-DDXUXzzl.mjs +765 -0
  138. package/dist/setup-DDXUXzzl.mjs.map +1 -0
  139. package/dist/setup-DLwhfyt-.cjs +8 -0
  140. package/dist/setup-Dh-B7YTX.mjs +8 -0
  141. package/dist/setup-WZ-xqAQO.cjs +849 -0
  142. package/dist/setup-WZ-xqAQO.cjs.map +1 -0
  143. package/dist/storage-B1wvztiJ.cjs +363 -0
  144. package/dist/storage-B1wvztiJ.cjs.map +1 -0
  145. package/dist/storage-Cs4WBsc4.mjs +3 -0
  146. package/dist/storage-DOEtT2Hr.cjs +7 -0
  147. package/dist/storage-dbb9RyBl.mjs +297 -0
  148. package/dist/storage-dbb9RyBl.mjs.map +1 -0
  149. package/dist/sync-B5UHXwRM.mjs +3 -0
  150. package/dist/sync-BLA94rgC.cjs +4 -0
  151. package/dist/sync-CSooqRQ8.mjs +76 -0
  152. package/dist/sync-CSooqRQ8.mjs.map +1 -0
  153. package/dist/sync-o_CtEbvR.cjs +93 -0
  154. package/dist/sync-o_CtEbvR.cjs.map +1 -0
  155. package/dist/types-B3GQUg3k.d.mts +280 -0
  156. package/dist/types-B3GQUg3k.d.mts.map +1 -0
  157. package/dist/types-BWQDiooe.d.cts +280 -0
  158. package/dist/types-BWQDiooe.d.cts.map +1 -0
  159. package/dist/workspace/index.cjs +4 -12
  160. package/dist/workspace/index.d.cts +3 -3
  161. package/dist/workspace/index.d.mts +3 -3
  162. package/dist/workspace/index.mjs +3 -2
  163. package/dist/workspace-CQTT7HJQ.cjs +4361 -0
  164. package/dist/workspace-CQTT7HJQ.cjs.map +1 -0
  165. package/dist/workspace-D-37Ylqo.mjs +4236 -0
  166. package/dist/workspace-D-37Ylqo.mjs.map +1 -0
  167. package/docs/OPENAPI_TYPESCRIPT_DESIGN.md +408 -0
  168. package/docs/dev-server-resilience-design.md +189 -0
  169. package/docs/manifest-refactor-design.md +287 -0
  170. package/examples/cron-example.ts +45 -0
  171. package/examples/env.ts +33 -0
  172. package/examples/function-example.ts +40 -0
  173. package/examples/gkm.config.json +22 -0
  174. package/examples/gkm.config.ts +14 -0
  175. package/examples/gkm.minimal.config.json +7 -0
  176. package/examples/gkm.production.config.json +27 -0
  177. package/examples/logger.ts +10 -0
  178. package/package.json +37 -87
  179. package/scripts/sync-versions.ts +108 -0
  180. package/src/__tests__/EndpointGenerator.hooks.spec.ts +204 -0
  181. package/src/__tests__/config.spec.ts +422 -0
  182. package/src/__tests__/loadEnvFiles.spec.ts +131 -0
  183. package/src/__tests__/normalizeHooksConfig.spec.ts +63 -0
  184. package/src/__tests__/openapi-react-query.spec.ts +506 -0
  185. package/src/__tests__/openapi.spec.ts +625 -0
  186. package/src/__tests__/test-helpers.ts +180 -0
  187. package/src/auth/__tests__/credentials.spec.ts +331 -0
  188. package/src/auth/__tests__/index.spec.ts +237 -0
  189. package/src/auth/credentials.ts +286 -0
  190. package/src/auth/index.ts +233 -0
  191. package/src/build/__tests__/bundler.spec.ts +446 -0
  192. package/src/build/__tests__/endpoint-analyzer.spec.ts +623 -0
  193. package/src/build/__tests__/handler-templates.spec.ts +1287 -0
  194. package/src/build/__tests__/index-new.spec.ts +550 -0
  195. package/src/build/__tests__/manifests.spec.ts +583 -0
  196. package/src/build/__tests__/partitions.spec.ts +110 -0
  197. package/src/build/__tests__/workspace-build.spec.ts +215 -0
  198. package/src/build/bundler.ts +256 -0
  199. package/src/build/endpoint-analyzer.ts +236 -0
  200. package/src/build/handler-templates.ts +1253 -0
  201. package/src/build/index.ts +616 -0
  202. package/src/build/manifests.ts +285 -0
  203. package/src/build/partitions.ts +58 -0
  204. package/src/build/providerResolver.ts +184 -0
  205. package/src/build/types.ts +104 -0
  206. package/src/config.ts +330 -0
  207. package/src/credentials/__tests__/fullDockerPorts.spec.ts +144 -0
  208. package/src/credentials/__tests__/helpers.ts +112 -0
  209. package/src/credentials/__tests__/prepareEntryCredentials.spec.ts +125 -0
  210. package/src/credentials/__tests__/readonlyDockerPorts.spec.ts +190 -0
  211. package/src/credentials/__tests__/workspaceCredentials.spec.ts +209 -0
  212. package/src/credentials/index.ts +843 -0
  213. package/src/debug.ts +68 -0
  214. package/src/deploy/CachedStateProvider.ts +86 -0
  215. package/src/deploy/LocalStateProvider.ts +57 -0
  216. package/src/deploy/SSMStateProvider.ts +117 -0
  217. package/src/deploy/StateProvider.ts +175 -0
  218. package/src/deploy/__tests__/CachedStateProvider.spec.ts +235 -0
  219. package/src/deploy/__tests__/HostingerProvider.spec.ts +347 -0
  220. package/src/deploy/__tests__/LocalStateProvider.spec.ts +130 -0
  221. package/src/deploy/__tests__/Route53Provider.spec.ts +425 -0
  222. package/src/deploy/__tests__/SSMStateProvider.spec.ts +201 -0
  223. package/src/deploy/__tests__/__fixtures__/entry-apps/async-entry.ts +24 -0
  224. package/src/deploy/__tests__/__fixtures__/entry-apps/nested-config-entry.ts +24 -0
  225. package/src/deploy/__tests__/__fixtures__/entry-apps/no-env-entry.ts +12 -0
  226. package/src/deploy/__tests__/__fixtures__/entry-apps/simple-entry.ts +14 -0
  227. package/src/deploy/__tests__/__fixtures__/entry-apps/throwing-entry.ts +16 -0
  228. package/src/deploy/__tests__/__fixtures__/env-parsers/non-function-export.ts +10 -0
  229. package/src/deploy/__tests__/__fixtures__/env-parsers/optional-env-parser.ts +21 -0
  230. package/src/deploy/__tests__/__fixtures__/env-parsers/parseable-env-parser.ts +18 -0
  231. package/src/deploy/__tests__/__fixtures__/env-parsers/throwing-env-parser.ts +16 -0
  232. package/src/deploy/__tests__/__fixtures__/env-parsers/valid-env-parser.ts +16 -0
  233. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/auth.ts +16 -0
  234. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/health.ts +13 -0
  235. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/users.ts +15 -0
  236. package/src/deploy/__tests__/__fixtures__/route-apps/services.ts +55 -0
  237. package/src/deploy/__tests__/backup-provisioner.spec.ts +428 -0
  238. package/src/deploy/__tests__/createDnsProvider.spec.ts +195 -0
  239. package/src/deploy/__tests__/createStateProvider.spec.ts +126 -0
  240. package/src/deploy/__tests__/dns-orchestration.spec.ts +192 -0
  241. package/src/deploy/__tests__/dns-verification.spec.ts +229 -0
  242. package/src/deploy/__tests__/docker.spec.ts +149 -0
  243. package/src/deploy/__tests__/dokploy-api.spec.ts +697 -0
  244. package/src/deploy/__tests__/dokploy.spec.ts +435 -0
  245. package/src/deploy/__tests__/domain.spec.ts +235 -0
  246. package/src/deploy/__tests__/env-resolver.spec.ts +903 -0
  247. package/src/deploy/__tests__/index.spec.ts +1091 -0
  248. package/src/deploy/__tests__/init.spec.ts +793 -0
  249. package/src/deploy/__tests__/secrets.spec.ts +303 -0
  250. package/src/deploy/__tests__/sniffer.spec.ts +838 -0
  251. package/src/deploy/__tests__/state-e2e.spec.ts +387 -0
  252. package/src/deploy/__tests__/state.spec.ts +876 -0
  253. package/src/deploy/__tests__/undeploy.spec.ts +758 -0
  254. package/src/deploy/backup-provisioner.ts +316 -0
  255. package/src/deploy/dns/DnsProvider.ts +201 -0
  256. package/src/deploy/dns/HostingerProvider.ts +174 -0
  257. package/src/deploy/dns/Route53Provider.ts +340 -0
  258. package/src/deploy/dns/hostinger-api.ts +261 -0
  259. package/src/deploy/dns/index.ts +627 -0
  260. package/src/deploy/docker.ts +260 -0
  261. package/src/deploy/dokploy-api.ts +1101 -0
  262. package/src/deploy/dokploy.ts +177 -0
  263. package/src/deploy/domain.ts +134 -0
  264. package/src/deploy/env-resolver.ts +305 -0
  265. package/src/deploy/index.ts +2094 -0
  266. package/src/deploy/init.ts +427 -0
  267. package/src/deploy/secrets.ts +187 -0
  268. package/src/deploy/sniffer-envkit-patch.ts +61 -0
  269. package/src/deploy/sniffer-hooks.ts +57 -0
  270. package/src/deploy/sniffer-loader.ts +28 -0
  271. package/src/deploy/sniffer-routes-worker.ts +104 -0
  272. package/src/deploy/sniffer-worker.ts +75 -0
  273. package/src/deploy/sniffer.ts +578 -0
  274. package/src/deploy/state-commands.ts +274 -0
  275. package/src/deploy/state.ts +482 -0
  276. package/src/deploy/types.ts +102 -0
  277. package/src/deploy/undeploy.ts +407 -0
  278. package/src/dev/__tests__/entry-integration.spec.ts +347 -0
  279. package/src/dev/__tests__/entry.spec.ts +144 -0
  280. package/src/dev/__tests__/index.spec.ts +2084 -0
  281. package/src/dev/index.ts +1649 -0
  282. package/src/docker/__tests__/compose.spec.ts +1142 -0
  283. package/src/docker/__tests__/templates.spec.ts +694 -0
  284. package/src/docker/compose.ts +812 -0
  285. package/src/docker/index.ts +523 -0
  286. package/src/docker/templates.ts +1067 -0
  287. package/src/exec/index.ts +118 -0
  288. package/src/generators/CronGenerator.ts +105 -0
  289. package/src/generators/EndpointGenerator.ts +954 -0
  290. package/src/generators/FunctionGenerator.ts +117 -0
  291. package/src/generators/Generator.ts +147 -0
  292. package/src/generators/OpenApiTsGenerator.ts +821 -0
  293. package/src/generators/QueueGenerator.ts +245 -0
  294. package/src/generators/SubscriberGenerator.ts +282 -0
  295. package/src/generators/TopicGenerator.ts +45 -0
  296. package/src/generators/__tests__/CronGenerator.spec.ts +445 -0
  297. package/src/generators/__tests__/EndpointGenerator.spec.ts +544 -0
  298. package/src/generators/__tests__/FunctionGenerator.spec.ts +256 -0
  299. package/src/generators/__tests__/Generator.bustCache.spec.ts +72 -0
  300. package/src/generators/__tests__/OpenApiTsGenerator.registry.spec.ts +98 -0
  301. package/src/generators/__tests__/OpenApiTsGenerator.responseType.spec.ts +56 -0
  302. package/src/generators/__tests__/QueueGenerator.spec.ts +141 -0
  303. package/src/generators/__tests__/SubscriberGenerator.spec.ts +410 -0
  304. package/src/generators/index.ts +11 -0
  305. package/src/index.ts +972 -0
  306. package/src/init/__tests__/generators.spec.ts +1072 -0
  307. package/src/init/__tests__/init.spec.ts +577 -0
  308. package/src/init/__tests__/utils.spec.ts +104 -0
  309. package/src/init/generators/auth.ts +225 -0
  310. package/src/init/generators/config.ts +316 -0
  311. package/src/init/generators/docker.ts +388 -0
  312. package/src/init/generators/env.ts +62 -0
  313. package/src/init/generators/index.ts +6 -0
  314. package/src/init/generators/mobile-expo.ts +576 -0
  315. package/src/init/generators/models.ts +153 -0
  316. package/src/init/generators/monorepo.ts +475 -0
  317. package/src/init/generators/package.ts +95 -0
  318. package/src/init/generators/source.ts +15 -0
  319. package/src/init/generators/test.ts +178 -0
  320. package/src/init/generators/ui.ts +1473 -0
  321. package/src/init/generators/web-tanstack.ts +348 -0
  322. package/src/init/generators/web.ts +363 -0
  323. package/src/init/index.ts +542 -0
  324. package/src/init/templates/api.ts +404 -0
  325. package/src/init/templates/index.ts +342 -0
  326. package/src/init/templates/minimal.ts +207 -0
  327. package/src/init/templates/serverless.ts +148 -0
  328. package/src/init/templates/worker.ts +216 -0
  329. package/src/init/utils.ts +197 -0
  330. package/src/init/versions.ts +52 -0
  331. package/src/openapi-react-query.ts +288 -0
  332. package/src/openapi.ts +259 -0
  333. package/src/secrets/__tests__/encryption.spec.ts +226 -0
  334. package/src/secrets/__tests__/generator.spec.ts +575 -0
  335. package/src/secrets/__tests__/index.spec.ts +91 -0
  336. package/src/secrets/__tests__/reconcile.spec.ts +123 -0
  337. package/src/secrets/__tests__/storage.spec.ts +645 -0
  338. package/src/secrets/encryption.ts +91 -0
  339. package/src/secrets/generator.ts +329 -0
  340. package/src/secrets/index.ts +417 -0
  341. package/src/secrets/keystore.ts +144 -0
  342. package/src/secrets/reconcile.ts +53 -0
  343. package/src/secrets/storage.ts +337 -0
  344. package/src/secrets/sync.ts +136 -0
  345. package/src/secrets/types.ts +70 -0
  346. package/src/setup/__tests__/auto-setup.spec.ts +147 -0
  347. package/src/setup/__tests__/reconcile-secrets.spec.ts +439 -0
  348. package/src/setup/fullstack-secrets.ts +140 -0
  349. package/src/setup/index.ts +411 -0
  350. package/src/test/__tests__/__fixtures__/workspace.ts +104 -0
  351. package/src/test/__tests__/api.spec.ts +199 -0
  352. package/src/test/__tests__/auth.spec.ts +162 -0
  353. package/src/test/__tests__/index.spec.ts +502 -0
  354. package/src/test/__tests__/web.spec.ts +210 -0
  355. package/src/test/index.ts +198 -0
  356. package/src/types.ts +363 -0
  357. package/src/upgrade/__tests__/index.spec.ts +354 -0
  358. package/src/upgrade/index.ts +253 -0
  359. package/src/workspace/__tests__/client-generator.spec.ts +326 -0
  360. package/src/workspace/__tests__/index.spec.ts +766 -0
  361. package/src/workspace/__tests__/publicEnv.spec.ts +64 -0
  362. package/src/workspace/__tests__/schema.spec.ts +737 -0
  363. package/src/workspace/__tests__/type-inference.spec.ts +251 -0
  364. package/src/workspace/client-generator.ts +109 -0
  365. package/src/workspace/index.ts +433 -0
  366. package/src/workspace/publicEnv.ts +57 -0
  367. package/src/workspace/schema.ts +861 -0
  368. package/src/workspace/types.ts +943 -0
  369. package/tsconfig.json +9 -0
  370. package/tsdown.config.ts +22 -0
  371. package/bin/adjacent-tsconfig.mjs +0 -97
  372. package/bin/owning-tsconfig-jsx-register.mjs +0 -18
  373. package/bin/owning-tsconfig-jsx.mjs +0 -108
  374. package/dist/EndpointGenerator-Bor2tZCm.mjs +0 -1031
  375. package/dist/EndpointGenerator-Bor2tZCm.mjs.map +0 -1
  376. package/dist/EndpointGenerator-De03t1hd.cjs +0 -1090
  377. package/dist/EndpointGenerator-De03t1hd.cjs.map +0 -1
  378. package/dist/GoDaddyProvider-206NguW1.mjs +0 -388
  379. package/dist/GoDaddyProvider-206NguW1.mjs.map +0 -1
  380. package/dist/GoDaddyProvider-D1aQy2i1.cjs +0 -388
  381. package/dist/GoDaddyProvider-D1aQy2i1.cjs.map +0 -1
  382. package/dist/HostingerProvider-BNpS9aRJ.mjs.map +0 -1
  383. package/dist/HostingerProvider-DR1iws1P.cjs.map +0 -1
  384. package/dist/LegacyStateStore-CgJEr1G7.cjs +0 -124
  385. package/dist/LegacyStateStore-CgJEr1G7.cjs.map +0 -1
  386. package/dist/LegacyStateStore-wmFfdzuh.mjs +0 -124
  387. package/dist/LegacyStateStore-wmFfdzuh.mjs.map +0 -1
  388. package/dist/LocalStateStore-BD14kra9.cjs +0 -178
  389. package/dist/LocalStateStore-BD14kra9.cjs.map +0 -1
  390. package/dist/LocalStateStore-C5mNp91D.mjs +0 -167
  391. package/dist/LocalStateStore-C5mNp91D.mjs.map +0 -1
  392. package/dist/OpenApiTsGenerator-CS_RtWOz.cjs +0 -541
  393. package/dist/OpenApiTsGenerator-CS_RtWOz.cjs.map +0 -1
  394. package/dist/OpenApiTsGenerator-DWAF-7Fu.mjs +0 -536
  395. package/dist/OpenApiTsGenerator-DWAF-7Fu.mjs.map +0 -1
  396. package/dist/Route53Provider-Bllus2NR.cjs.map +0 -1
  397. package/dist/Route53Provider-QXxjkZO1.mjs.map +0 -1
  398. package/dist/S3StateStore-CEGbsDHi.mjs +0 -223
  399. package/dist/S3StateStore-CEGbsDHi.mjs.map +0 -1
  400. package/dist/S3StateStore-Csu_kJCy.cjs +0 -222
  401. package/dist/S3StateStore-Csu_kJCy.cjs.map +0 -1
  402. package/dist/SSMStateStore-Bd62qwp4.mjs +0 -205
  403. package/dist/SSMStateStore-Bd62qwp4.mjs.map +0 -1
  404. package/dist/SSMStateStore-Rp21jtP5.cjs +0 -204
  405. package/dist/SSMStateStore-Rp21jtP5.cjs.map +0 -1
  406. package/dist/SubscriberGenerator-CyN2VF5X.mjs +0 -449
  407. package/dist/SubscriberGenerator-CyN2VF5X.mjs.map +0 -1
  408. package/dist/SubscriberGenerator-Dvz7EzqK.cjs +0 -490
  409. package/dist/SubscriberGenerator-Dvz7EzqK.cjs.map +0 -1
  410. package/dist/add-DyIEYI97.mjs +0 -718
  411. package/dist/add-DyIEYI97.mjs.map +0 -1
  412. package/dist/add-Iuo3ao5E.cjs +0 -720
  413. package/dist/add-Iuo3ao5E.cjs.map +0 -1
  414. package/dist/appPorts-C9z9Pzn9.mjs +0 -223
  415. package/dist/appPorts-C9z9Pzn9.mjs.map +0 -1
  416. package/dist/appPorts-Cu79hJF6.cjs +0 -264
  417. package/dist/appPorts-Cu79hJF6.cjs.map +0 -1
  418. package/dist/aws-8QQ8n-t6.mjs +0 -89
  419. package/dist/aws-8QQ8n-t6.mjs.map +0 -1
  420. package/dist/aws-DY9NqQIT.cjs +0 -100
  421. package/dist/aws-DY9NqQIT.cjs.map +0 -1
  422. package/dist/awsStore-Bx5nCFnS.mjs +0 -121
  423. package/dist/awsStore-Bx5nCFnS.mjs.map +0 -1
  424. package/dist/awsStore-u3ehhMoY.cjs +0 -138
  425. package/dist/awsStore-u3ehhMoY.cjs.map +0 -1
  426. package/dist/backup-provisioner-C8DnCmxK.mjs.map +0 -1
  427. package/dist/backup-provisioner-oDEsPj02.cjs.map +0 -1
  428. package/dist/bundler-Bgoq8IyR.cjs +0 -169
  429. package/dist/bundler-Bgoq8IyR.cjs.map +0 -1
  430. package/dist/bundler-Q6Kp8b0r.mjs +0 -169
  431. package/dist/bundler-Q6Kp8b0r.mjs.map +0 -1
  432. package/dist/cli-B9BudUV0.mjs +0 -71
  433. package/dist/cli-B9BudUV0.mjs.map +0 -1
  434. package/dist/cli-W2DMRIbP.cjs +0 -71
  435. package/dist/cli-W2DMRIbP.cjs.map +0 -1
  436. package/dist/compose-CIrFNWHb.cjs +0 -3147
  437. package/dist/compose-CIrFNWHb.cjs.map +0 -1
  438. package/dist/compose-CLsRcHkA.mjs +0 -3052
  439. package/dist/compose-CLsRcHkA.mjs.map +0 -1
  440. package/dist/config-BVdHfj8b.d.cts +0 -269
  441. package/dist/config-BVdHfj8b.d.cts.map +0 -1
  442. package/dist/config-D2OqCmAM.d.mts +0 -269
  443. package/dist/config-D2OqCmAM.d.mts.map +0 -1
  444. package/dist/config.cjs.map +0 -1
  445. package/dist/config.mjs.map +0 -1
  446. package/dist/credentialSchemas-BJFvfkaz.mjs +0 -237
  447. package/dist/credentialSchemas-BJFvfkaz.mjs.map +0 -1
  448. package/dist/credentialSchemas-CAPKFkrG.cjs +0 -272
  449. package/dist/credentialSchemas-CAPKFkrG.cjs.map +0 -1
  450. package/dist/credentials-B5N5yKk6.mjs +0 -267
  451. package/dist/credentials-B5N5yKk6.mjs.map +0 -1
  452. package/dist/credentials-Zqr3QQYB.cjs +0 -350
  453. package/dist/credentials-Zqr3QQYB.cjs.map +0 -1
  454. package/dist/databases-BeGP5eDh.mjs +0 -495
  455. package/dist/databases-BeGP5eDh.mjs.map +0 -1
  456. package/dist/databases-DGALFDG3.cjs +0 -598
  457. package/dist/databases-DGALFDG3.cjs.map +0 -1
  458. package/dist/define-6poNqm5O.mjs +0 -106
  459. package/dist/define-6poNqm5O.mjs.map +0 -1
  460. package/dist/define-crmMcXFS.cjs +0 -153
  461. package/dist/define-crmMcXFS.cjs.map +0 -1
  462. package/dist/deploy/public.cjs +0 -212
  463. package/dist/deploy/public.cjs.map +0 -1
  464. package/dist/deploy/public.d.cts +0 -653
  465. package/dist/deploy/public.d.cts.map +0 -1
  466. package/dist/deploy/public.d.mts +0 -653
  467. package/dist/deploy/public.d.mts.map +0 -1
  468. package/dist/deploy/public.mjs +0 -145
  469. package/dist/deploy/public.mjs.map +0 -1
  470. package/dist/deploy/sniffer-envparser-worker.cjs +0 -54
  471. package/dist/deploy/sniffer-envparser-worker.cjs.map +0 -1
  472. package/dist/deploy/sniffer-envparser-worker.d.cts +0 -1
  473. package/dist/deploy/sniffer-envparser-worker.d.mts +0 -1
  474. package/dist/deploy/sniffer-envparser-worker.mjs +0 -55
  475. package/dist/deploy/sniffer-envparser-worker.mjs.map +0 -1
  476. package/dist/deploy-CbJMJsgX.cjs +0 -2032
  477. package/dist/deploy-CbJMJsgX.cjs.map +0 -1
  478. package/dist/deploy-n_IB8r6H.mjs +0 -1977
  479. package/dist/deploy-n_IB8r6H.mjs.map +0 -1
  480. package/dist/derive-B4vDpzgP.mjs +0 -150
  481. package/dist/derive-B4vDpzgP.mjs.map +0 -1
  482. package/dist/derive-DAbo49sm.cjs +0 -161
  483. package/dist/derive-DAbo49sm.cjs.map +0 -1
  484. package/dist/discover-Caf6Hnv1.d.cts +0 -108
  485. package/dist/discover-Caf6Hnv1.d.cts.map +0 -1
  486. package/dist/discover-Cd5M2jPv.d.mts +0 -108
  487. package/dist/discover-Cd5M2jPv.d.mts.map +0 -1
  488. package/dist/discover-DPgu-ScS.cjs +0 -600
  489. package/dist/discover-DPgu-ScS.cjs.map +0 -1
  490. package/dist/discover-qjFapetL.mjs +0 -527
  491. package/dist/discover-qjFapetL.mjs.map +0 -1
  492. package/dist/dns-C_LPS3qV.mjs +0 -610
  493. package/dist/dns-C_LPS3qV.mjs.map +0 -1
  494. package/dist/dns-kp8To8Qj.cjs +0 -663
  495. package/dist/dns-kp8To8Qj.cjs.map +0 -1
  496. package/dist/dokploy-Dl_kNVeE.mjs +0 -38
  497. package/dist/dokploy-Dl_kNVeE.mjs.map +0 -1
  498. package/dist/dokploy-gRIae9Ht.cjs +0 -38
  499. package/dist/dokploy-gRIae9Ht.cjs.map +0 -1
  500. package/dist/drivers-CTaWrA_L.mjs +0 -177
  501. package/dist/drivers-CTaWrA_L.mjs.map +0 -1
  502. package/dist/drivers-DDojgzz0.cjs +0 -200
  503. package/dist/drivers-DDojgzz0.cjs.map +0 -1
  504. package/dist/emit-C1e8qD08.mjs +0 -193
  505. package/dist/emit-C1e8qD08.mjs.map +0 -1
  506. package/dist/emit-Dmc1nvdS.cjs +0 -210
  507. package/dist/emit-Dmc1nvdS.cjs.map +0 -1
  508. package/dist/encryption-C3DcVZQs.mjs +0 -89
  509. package/dist/encryption-C3DcVZQs.mjs.map +0 -1
  510. package/dist/encryption-CmQvQOSe.cjs +0 -90
  511. package/dist/encryption-CmQvQOSe.cjs.map +0 -1
  512. package/dist/engine-DBXuhHyf.mjs +0 -3081
  513. package/dist/engine-DBXuhHyf.mjs.map +0 -1
  514. package/dist/engine-Dk19Mxc4.cjs +0 -3194
  515. package/dist/engine-Dk19Mxc4.cjs.map +0 -1
  516. package/dist/errors-D8Gwp5kU.mjs +0 -23
  517. package/dist/errors-D8Gwp5kU.mjs.map +0 -1
  518. package/dist/errors-DMC4Umsb.cjs +0 -34
  519. package/dist/errors-DMC4Umsb.cjs.map +0 -1
  520. package/dist/github-Ds2RYnSU.cjs +0 -819
  521. package/dist/github-Ds2RYnSU.cjs.map +0 -1
  522. package/dist/github-RawRLERq.mjs +0 -819
  523. package/dist/github-RawRLERq.mjs.map +0 -1
  524. package/dist/identity-CBXr4wNi.mjs +0 -129
  525. package/dist/identity-CBXr4wNi.mjs.map +0 -1
  526. package/dist/identity-CbLfgQNT.cjs +0 -182
  527. package/dist/identity-CbLfgQNT.cjs.map +0 -1
  528. package/dist/index-BU4G20G6.d.cts +0 -190
  529. package/dist/index-BU4G20G6.d.cts.map +0 -1
  530. package/dist/index-yDbd1WcM.d.mts +0 -190
  531. package/dist/index-yDbd1WcM.d.mts.map +0 -1
  532. package/dist/local-BwC2v2Y8.mjs +0 -224
  533. package/dist/local-BwC2v2Y8.mjs.map +0 -1
  534. package/dist/local-DNhnkugT.cjs +0 -241
  535. package/dist/local-DNhnkugT.cjs.map +0 -1
  536. package/dist/migrate-CZIGT3kB.mjs +0 -266
  537. package/dist/migrate-CZIGT3kB.mjs.map +0 -1
  538. package/dist/migrate-CxZYzF_u.cjs +0 -181
  539. package/dist/migrate-CxZYzF_u.cjs.map +0 -1
  540. package/dist/migrate-DR1x96I4.mjs +0 -181
  541. package/dist/migrate-DR1x96I4.mjs.map +0 -1
  542. package/dist/migrate-DjrTwWJA.cjs +0 -271
  543. package/dist/migrate-DjrTwWJA.cjs.map +0 -1
  544. package/dist/openapi.cjs.map +0 -1
  545. package/dist/openapi.mjs.map +0 -1
  546. package/dist/projectBucket-BYOxRnHY.mjs +0 -177
  547. package/dist/projectBucket-BYOxRnHY.mjs.map +0 -1
  548. package/dist/projectBucket-CDu5rXjp.cjs +0 -206
  549. package/dist/projectBucket-CDu5rXjp.cjs.map +0 -1
  550. package/dist/provider-BqpjG9QM.cjs +0 -57
  551. package/dist/provider-BqpjG9QM.cjs.map +0 -1
  552. package/dist/provider-CEOKk8NS.mjs +0 -46
  553. package/dist/provider-CEOKk8NS.mjs.map +0 -1
  554. package/dist/ready-D3PIjx3S.cjs +0 -403
  555. package/dist/ready-D3PIjx3S.cjs.map +0 -1
  556. package/dist/ready-naOSJpeJ.mjs +0 -374
  557. package/dist/ready-naOSJpeJ.mjs.map +0 -1
  558. package/dist/reconcile/public.cjs +0 -7
  559. package/dist/reconcile/public.d.cts +0 -49
  560. package/dist/reconcile/public.d.cts.map +0 -1
  561. package/dist/reconcile/public.d.mts +0 -49
  562. package/dist/reconcile/public.d.mts.map +0 -1
  563. package/dist/reconcile/public.mjs +0 -3
  564. package/dist/reconcile--I7V4Klj.mjs.map +0 -1
  565. package/dist/reconcile-CuCQBa5-.cjs.map +0 -1
  566. package/dist/resolve-CNYbGH8g.mjs +0 -263
  567. package/dist/resolve-CNYbGH8g.mjs.map +0 -1
  568. package/dist/resolve-DC98Rl1t.cjs +0 -316
  569. package/dist/resolve-DC98Rl1t.cjs.map +0 -1
  570. package/dist/rollback-BkIkE8Qe.mjs +0 -136
  571. package/dist/rollback-BkIkE8Qe.mjs.map +0 -1
  572. package/dist/rollback-DBfLvC8k.cjs +0 -165
  573. package/dist/rollback-DBfLvC8k.cjs.map +0 -1
  574. package/dist/rolldown-runtime-BhDjJH2R.mjs +0 -15
  575. package/dist/run-BJLIerMM.mjs +0 -133
  576. package/dist/run-BJLIerMM.mjs.map +0 -1
  577. package/dist/run-fVZ-rLnc.cjs +0 -174
  578. package/dist/run-fVZ-rLnc.cjs.map +0 -1
  579. package/dist/runtime-CLz3bf07.d.mts +0 -82
  580. package/dist/runtime-CLz3bf07.d.mts.map +0 -1
  581. package/dist/runtime-CUWf0IUk.d.cts +0 -82
  582. package/dist/runtime-CUWf0IUk.d.cts.map +0 -1
  583. package/dist/s3-BwhQk3QM.mjs +0 -215
  584. package/dist/s3-BwhQk3QM.mjs.map +0 -1
  585. package/dist/s3-DLp0V-Ox.cjs +0 -215
  586. package/dist/s3-DLp0V-Ox.cjs.map +0 -1
  587. package/dist/sandbox/config-worker.cjs +0 -43
  588. package/dist/sandbox/config-worker.cjs.map +0 -1
  589. package/dist/sandbox/config-worker.d.cts +0 -1
  590. package/dist/sandbox/config-worker.d.mts +0 -1
  591. package/dist/sandbox/config-worker.mjs +0 -44
  592. package/dist/sandbox/config-worker.mjs.map +0 -1
  593. package/dist/sandbox/credentials-worker.cjs +0 -54
  594. package/dist/sandbox/credentials-worker.cjs.map +0 -1
  595. package/dist/sandbox/credentials-worker.d.cts +0 -1
  596. package/dist/sandbox/credentials-worker.d.mts +0 -1
  597. package/dist/sandbox/credentials-worker.mjs +0 -55
  598. package/dist/sandbox/credentials-worker.mjs.map +0 -1
  599. package/dist/sandbox/discover-worker.cjs +0 -47
  600. package/dist/sandbox/discover-worker.cjs.map +0 -1
  601. package/dist/sandbox/discover-worker.d.cts +0 -1
  602. package/dist/sandbox/discover-worker.d.mts +0 -1
  603. package/dist/sandbox/discover-worker.mjs +0 -48
  604. package/dist/sandbox/discover-worker.mjs.map +0 -1
  605. package/dist/sandbox/migrate-worker.cjs +0 -75
  606. package/dist/sandbox/migrate-worker.cjs.map +0 -1
  607. package/dist/sandbox/migrate-worker.d.cts +0 -1
  608. package/dist/sandbox/migrate-worker.d.mts +0 -1
  609. package/dist/sandbox/migrate-worker.mjs +0 -76
  610. package/dist/sandbox/migrate-worker.mjs.map +0 -1
  611. package/dist/sandbox-CHv3OYXg.cjs +0 -165
  612. package/dist/sandbox-CHv3OYXg.cjs.map +0 -1
  613. package/dist/sandbox-CbVB7uOD.mjs +0 -118
  614. package/dist/sandbox-CbVB7uOD.mjs.map +0 -1
  615. package/dist/sandbox-CfpLWTPP.d.mts +0 -104
  616. package/dist/sandbox-CfpLWTPP.d.mts.map +0 -1
  617. package/dist/sandbox-D1XeNEJ9.d.cts +0 -104
  618. package/dist/sandbox-D1XeNEJ9.d.cts.map +0 -1
  619. package/dist/schemas-BObwxB_t.cjs +0 -6017
  620. package/dist/schemas-BObwxB_t.cjs.map +0 -1
  621. package/dist/schemas-D-xeKJDD.mjs +0 -5916
  622. package/dist/schemas-D-xeKJDD.mjs.map +0 -1
  623. package/dist/secretsManager-CQORubp9.mjs +0 -97
  624. package/dist/secretsManager-CQORubp9.mjs.map +0 -1
  625. package/dist/secretsManager-RAGcEDX1.cjs +0 -108
  626. package/dist/secretsManager-RAGcEDX1.cjs.map +0 -1
  627. package/dist/seeds-BNHSpjNP.cjs +0 -9096
  628. package/dist/seeds-BNHSpjNP.cjs.map +0 -1
  629. package/dist/seeds-C4bZ8L-T.mjs +0 -8141
  630. package/dist/seeds-C4bZ8L-T.mjs.map +0 -1
  631. package/dist/sniffer-BIBm9dAb.mjs +0 -1825
  632. package/dist/sniffer-BIBm9dAb.mjs.map +0 -1
  633. package/dist/sniffer-Cylp9W2D.cjs +0 -1998
  634. package/dist/sniffer-Cylp9W2D.cjs.map +0 -1
  635. package/dist/sst-CGdjHn2A.mjs +0 -441
  636. package/dist/sst-CGdjHn2A.mjs.map +0 -1
  637. package/dist/sst-DGuHDxVU.cjs +0 -464
  638. package/dist/sst-DGuHDxVU.cjs.map +0 -1
  639. package/dist/stages-CcS9vnNu.mjs +0 -176
  640. package/dist/stages-CcS9vnNu.mjs.map +0 -1
  641. package/dist/stages-DdBV7msu.cjs +0 -176
  642. package/dist/stages-DdBV7msu.cjs.map +0 -1
  643. package/dist/target/public.cjs +0 -15
  644. package/dist/target/public.d.cts +0 -28
  645. package/dist/target/public.d.cts.map +0 -1
  646. package/dist/target/public.d.mts +0 -28
  647. package/dist/target/public.d.mts.map +0 -1
  648. package/dist/target/public.mjs +0 -4
  649. package/dist/terminal-CPHuH4S1.cjs +0 -85
  650. package/dist/terminal-CPHuH4S1.cjs.map +0 -1
  651. package/dist/terminal-iNmAXXjs.mjs +0 -85
  652. package/dist/terminal-iNmAXXjs.mjs.map +0 -1
  653. package/dist/types-BhThob0H.d.mts +0 -7621
  654. package/dist/types-BhThob0H.d.mts.map +0 -1
  655. package/dist/types-DwoLHelT.d.cts +0 -7622
  656. package/dist/types-DwoLHelT.d.cts.map +0 -1
  657. package/dist/utils-D2Nk1Nv2.cjs +0 -205
  658. package/dist/utils-D2Nk1Nv2.cjs.map +0 -1
  659. package/dist/utils-D_fxUqvU.mjs +0 -156
  660. package/dist/utils-D_fxUqvU.mjs.map +0 -1
  661. package/dist/vitest.cjs +0 -65
  662. package/dist/vitest.cjs.map +0 -1
  663. package/dist/vitest.d.cts +0 -29
  664. package/dist/vitest.d.cts.map +0 -1
  665. package/dist/vitest.d.mts +0 -29
  666. package/dist/vitest.d.mts.map +0 -1
  667. package/dist/vitest.mjs +0 -65
  668. package/dist/vitest.mjs.map +0 -1
  669. package/dist/workerRuntime-BXfhbe13.cjs +0 -108
  670. package/dist/workerRuntime-BXfhbe13.cjs.map +0 -1
  671. package/dist/workerRuntime-CsOyBRx2.mjs +0 -79
  672. package/dist/workerRuntime-CsOyBRx2.mjs.map +0 -1
  673. package/dist/workspace-D5CpOp1y.mjs +0 -2108
  674. package/dist/workspace-D5CpOp1y.mjs.map +0 -1
  675. package/dist/workspace-DRjdu1OY.cjs +0 -2514
  676. package/dist/workspace-DRjdu1OY.cjs.map +0 -1
@@ -0,0 +1,1473 @@
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
+ }