@korajs/cli 0.0.0-canary-20261008174129

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 (310) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/dist/bin.cjs +9465 -0
  4. package/dist/bin.cjs.map +1 -0
  5. package/dist/bin.js +3150 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/chunk-5NI2FEQL.js +92 -0
  8. package/dist/chunk-5NI2FEQL.js.map +1 -0
  9. package/dist/chunk-6C4BHSRA.js +82 -0
  10. package/dist/chunk-6C4BHSRA.js.map +1 -0
  11. package/dist/chunk-7Y4J2GXP.js +796 -0
  12. package/dist/chunk-7Y4J2GXP.js.map +1 -0
  13. package/dist/chunk-BURFQVMV.js +719 -0
  14. package/dist/chunk-BURFQVMV.js.map +1 -0
  15. package/dist/chunk-TVIRMDER.js +2569 -0
  16. package/dist/chunk-TVIRMDER.js.map +1 -0
  17. package/dist/create.cjs +1368 -0
  18. package/dist/create.cjs.map +1 -0
  19. package/dist/create.js +11 -0
  20. package/dist/create.js.map +1 -0
  21. package/dist/index.cjs +3489 -0
  22. package/dist/index.cjs.map +1 -0
  23. package/dist/index.d.cts +772 -0
  24. package/dist/index.d.ts +772 -0
  25. package/dist/index.js +129 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/lab-manager-KUDII6BT.js +280 -0
  28. package/dist/lab-manager-KUDII6BT.js.map +1 -0
  29. package/dist/schema-loader-GGHECMTM.js +9 -0
  30. package/dist/schema-loader-GGHECMTM.js.map +1 -0
  31. package/dist/spectator-manager-FTH2NFSE.js +145 -0
  32. package/dist/spectator-manager-FTH2NFSE.js.map +1 -0
  33. package/dist/studio-server-XLGZNGG5.js +1747 -0
  34. package/dist/studio-server-XLGZNGG5.js.map +1 -0
  35. package/dist/vite.cjs +351 -0
  36. package/dist/vite.cjs.map +1 -0
  37. package/dist/vite.d.cts +161 -0
  38. package/dist/vite.d.ts +161 -0
  39. package/dist/vite.js +321 -0
  40. package/dist/vite.js.map +1 -0
  41. package/package.json +79 -0
  42. package/templates/react-basic/.env.example +3 -0
  43. package/templates/react-basic/AGENTS.md +87 -0
  44. package/templates/react-basic/README.md.hbs +62 -0
  45. package/templates/react-basic/index.html.hbs +12 -0
  46. package/templates/react-basic/kora.config.ts +13 -0
  47. package/templates/react-basic/package.json.hbs +35 -0
  48. package/templates/react-basic/src/App.tsx +132 -0
  49. package/templates/react-basic/src/index.css +287 -0
  50. package/templates/react-basic/src/kora-worker.ts +9 -0
  51. package/templates/react-basic/src/main.tsx +24 -0
  52. package/templates/react-basic/src/modules/todos/todo.mutations.ts +25 -0
  53. package/templates/react-basic/src/modules/todos/todo.queries.ts +5 -0
  54. package/templates/react-basic/src/modules/todos/todo.schema.ts +10 -0
  55. package/templates/react-basic/src/modules/todos/useTodos.ts +31 -0
  56. package/templates/react-basic/src/schema.ts +9 -0
  57. package/templates/react-basic/src/vite-env.d.ts +18 -0
  58. package/templates/react-basic/tsconfig.json.hbs +14 -0
  59. package/templates/react-basic/vite.config.ts +88 -0
  60. package/templates/react-sync/.env.example +25 -0
  61. package/templates/react-sync/AGENTS.md +87 -0
  62. package/templates/react-sync/README.md.hbs +106 -0
  63. package/templates/react-sync/index.html.hbs +12 -0
  64. package/templates/react-sync/kora.config.ts +17 -0
  65. package/templates/react-sync/package.json.hbs +44 -0
  66. package/templates/react-sync/server.ts +141 -0
  67. package/templates/react-sync/src/App.tsx +160 -0
  68. package/templates/react-sync/src/auth.ts +25 -0
  69. package/templates/react-sync/src/index.css +350 -0
  70. package/templates/react-sync/src/kora-worker.ts +9 -0
  71. package/templates/react-sync/src/main.tsx +52 -0
  72. package/templates/react-sync/src/modules/todos/todo.mutations.ts +25 -0
  73. package/templates/react-sync/src/modules/todos/todo.queries.ts +5 -0
  74. package/templates/react-sync/src/modules/todos/todo.schema.ts +10 -0
  75. package/templates/react-sync/src/modules/todos/useTodos.ts +31 -0
  76. package/templates/react-sync/src/schema.ts +9 -0
  77. package/templates/react-sync/src/vite-env.d.ts +19 -0
  78. package/templates/react-sync/tsconfig.json.hbs +14 -0
  79. package/templates/react-sync/vite.config.ts +105 -0
  80. package/templates/react-tailwind/.env.example +3 -0
  81. package/templates/react-tailwind/AGENTS.md +87 -0
  82. package/templates/react-tailwind/README.md.hbs +62 -0
  83. package/templates/react-tailwind/index.html.hbs +12 -0
  84. package/templates/react-tailwind/kora.config.ts +13 -0
  85. package/templates/react-tailwind/package.json.hbs +38 -0
  86. package/templates/react-tailwind/src/App.tsx +201 -0
  87. package/templates/react-tailwind/src/index.css +7 -0
  88. package/templates/react-tailwind/src/kora-worker.ts +9 -0
  89. package/templates/react-tailwind/src/main.tsx +31 -0
  90. package/templates/react-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  91. package/templates/react-tailwind/src/modules/todos/todo.queries.ts +5 -0
  92. package/templates/react-tailwind/src/modules/todos/todo.schema.ts +10 -0
  93. package/templates/react-tailwind/src/modules/todos/useTodos.ts +31 -0
  94. package/templates/react-tailwind/src/schema.ts +9 -0
  95. package/templates/react-tailwind/src/vite-env.d.ts +18 -0
  96. package/templates/react-tailwind/tsconfig.json.hbs +14 -0
  97. package/templates/react-tailwind/vite.config.ts +95 -0
  98. package/templates/react-tailwind-sync/.env.example +25 -0
  99. package/templates/react-tailwind-sync/AGENTS.md +89 -0
  100. package/templates/react-tailwind-sync/README.md.hbs +106 -0
  101. package/templates/react-tailwind-sync/index.html.hbs +12 -0
  102. package/templates/react-tailwind-sync/kora.config.ts +17 -0
  103. package/templates/react-tailwind-sync/package.json.hbs +47 -0
  104. package/templates/react-tailwind-sync/server.ts +141 -0
  105. package/templates/react-tailwind-sync/src/App.tsx +293 -0
  106. package/templates/react-tailwind-sync/src/auth.ts +25 -0
  107. package/templates/react-tailwind-sync/src/index.css +7 -0
  108. package/templates/react-tailwind-sync/src/kora-worker.ts +9 -0
  109. package/templates/react-tailwind-sync/src/kora.ts +32 -0
  110. package/templates/react-tailwind-sync/src/main.tsx +44 -0
  111. package/templates/react-tailwind-sync/src/modules/todos/todo.mutations.ts +21 -0
  112. package/templates/react-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  113. package/templates/react-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  114. package/templates/react-tailwind-sync/src/modules/todos/useTodos.ts +31 -0
  115. package/templates/react-tailwind-sync/src/schema.ts +9 -0
  116. package/templates/react-tailwind-sync/src/vite-env.d.ts +19 -0
  117. package/templates/react-tailwind-sync/tsconfig.json.hbs +14 -0
  118. package/templates/react-tailwind-sync/vite.config.ts +112 -0
  119. package/templates/svelte-basic/.env.example +3 -0
  120. package/templates/svelte-basic/AGENTS.md +76 -0
  121. package/templates/svelte-basic/README.md.hbs +62 -0
  122. package/templates/svelte-basic/index.html.hbs +12 -0
  123. package/templates/svelte-basic/kora.config.ts +12 -0
  124. package/templates/svelte-basic/package.json.hbs +33 -0
  125. package/templates/svelte-basic/src/App.svelte +128 -0
  126. package/templates/svelte-basic/src/Root.svelte +14 -0
  127. package/templates/svelte-basic/src/index.css +287 -0
  128. package/templates/svelte-basic/src/kora-worker.ts +9 -0
  129. package/templates/svelte-basic/src/main.ts +16 -0
  130. package/templates/svelte-basic/src/modules/todos/todo.mutations.ts +25 -0
  131. package/templates/svelte-basic/src/modules/todos/todo.queries.ts +5 -0
  132. package/templates/svelte-basic/src/modules/todos/todo.schema.ts +10 -0
  133. package/templates/svelte-basic/src/modules/todos/useTodos.ts +25 -0
  134. package/templates/svelte-basic/src/schema.ts +9 -0
  135. package/templates/svelte-basic/src/vite-env.d.ts +12 -0
  136. package/templates/svelte-basic/svelte.config.js +5 -0
  137. package/templates/svelte-basic/tsconfig.json.hbs +14 -0
  138. package/templates/svelte-basic/vite.config.ts +57 -0
  139. package/templates/svelte-sync/.env.example +25 -0
  140. package/templates/svelte-sync/AGENTS.md +76 -0
  141. package/templates/svelte-sync/README.md.hbs +106 -0
  142. package/templates/svelte-sync/index.html.hbs +12 -0
  143. package/templates/svelte-sync/kora.config.ts +17 -0
  144. package/templates/svelte-sync/package.json.hbs +43 -0
  145. package/templates/svelte-sync/server.ts +141 -0
  146. package/templates/svelte-sync/src/App.svelte +151 -0
  147. package/templates/svelte-sync/src/Root.svelte +22 -0
  148. package/templates/svelte-sync/src/auth.ts +25 -0
  149. package/templates/svelte-sync/src/index.css +339 -0
  150. package/templates/svelte-sync/src/kora-worker.ts +9 -0
  151. package/templates/svelte-sync/src/main.ts +32 -0
  152. package/templates/svelte-sync/src/modules/todos/todo.mutations.ts +25 -0
  153. package/templates/svelte-sync/src/modules/todos/todo.queries.ts +5 -0
  154. package/templates/svelte-sync/src/modules/todos/todo.schema.ts +10 -0
  155. package/templates/svelte-sync/src/modules/todos/useTodos.ts +25 -0
  156. package/templates/svelte-sync/src/schema.ts +9 -0
  157. package/templates/svelte-sync/src/vite-env.d.ts +22 -0
  158. package/templates/svelte-sync/svelte.config.js +5 -0
  159. package/templates/svelte-sync/tsconfig.json.hbs +14 -0
  160. package/templates/svelte-sync/vite.config.ts +91 -0
  161. package/templates/svelte-tailwind/AGENTS.md +76 -0
  162. package/templates/svelte-tailwind/README.md.hbs +62 -0
  163. package/templates/svelte-tailwind/index.html.hbs +12 -0
  164. package/templates/svelte-tailwind/kora.config.ts +12 -0
  165. package/templates/svelte-tailwind/package.json.hbs +36 -0
  166. package/templates/svelte-tailwind/src/App.svelte +76 -0
  167. package/templates/svelte-tailwind/src/Root.svelte +14 -0
  168. package/templates/svelte-tailwind/src/index.css +7 -0
  169. package/templates/svelte-tailwind/src/kora-worker.ts +9 -0
  170. package/templates/svelte-tailwind/src/main.ts +16 -0
  171. package/templates/svelte-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  172. package/templates/svelte-tailwind/src/modules/todos/todo.queries.ts +5 -0
  173. package/templates/svelte-tailwind/src/modules/todos/todo.schema.ts +10 -0
  174. package/templates/svelte-tailwind/src/modules/todos/useTodos.ts +25 -0
  175. package/templates/svelte-tailwind/src/schema.ts +9 -0
  176. package/templates/svelte-tailwind/src/vite-env.d.ts +12 -0
  177. package/templates/svelte-tailwind/svelte.config.js +5 -0
  178. package/templates/svelte-tailwind/tsconfig.json.hbs +14 -0
  179. package/templates/svelte-tailwind/vite.config.ts +64 -0
  180. package/templates/svelte-tailwind-sync/.env.example +25 -0
  181. package/templates/svelte-tailwind-sync/AGENTS.md +76 -0
  182. package/templates/svelte-tailwind-sync/README.md.hbs +106 -0
  183. package/templates/svelte-tailwind-sync/index.html.hbs +12 -0
  184. package/templates/svelte-tailwind-sync/kora.config.ts +17 -0
  185. package/templates/svelte-tailwind-sync/package.json.hbs +46 -0
  186. package/templates/svelte-tailwind-sync/server.ts +141 -0
  187. package/templates/svelte-tailwind-sync/src/App.svelte +193 -0
  188. package/templates/svelte-tailwind-sync/src/Root.svelte +26 -0
  189. package/templates/svelte-tailwind-sync/src/auth.ts +25 -0
  190. package/templates/svelte-tailwind-sync/src/index.css +7 -0
  191. package/templates/svelte-tailwind-sync/src/kora-worker.ts +9 -0
  192. package/templates/svelte-tailwind-sync/src/main.ts +32 -0
  193. package/templates/svelte-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
  194. package/templates/svelte-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  195. package/templates/svelte-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  196. package/templates/svelte-tailwind-sync/src/modules/todos/useTodos.ts +25 -0
  197. package/templates/svelte-tailwind-sync/src/schema.ts +9 -0
  198. package/templates/svelte-tailwind-sync/src/vite-env.d.ts +22 -0
  199. package/templates/svelte-tailwind-sync/svelte.config.js +5 -0
  200. package/templates/svelte-tailwind-sync/tsconfig.json.hbs +14 -0
  201. package/templates/svelte-tailwind-sync/vite.config.ts +98 -0
  202. package/templates/tauri-react/.env.example +27 -0
  203. package/templates/tauri-react/.github/workflows/release-desktop.yml +107 -0
  204. package/templates/tauri-react/AGENTS.md +91 -0
  205. package/templates/tauri-react/README.md.hbs +183 -0
  206. package/templates/tauri-react/dev.ts +37 -0
  207. package/templates/tauri-react/index.html.hbs +16 -0
  208. package/templates/tauri-react/kora.config.ts +17 -0
  209. package/templates/tauri-react/package.json.hbs +46 -0
  210. package/templates/tauri-react/server.ts +148 -0
  211. package/templates/tauri-react/src/App.tsx +803 -0
  212. package/templates/tauri-react/src/AppShell.tsx +158 -0
  213. package/templates/tauri-react/src/SetupScreen.tsx +288 -0
  214. package/templates/tauri-react/src/auth.ts +45 -0
  215. package/templates/tauri-react/src/main.tsx +9 -0
  216. package/templates/tauri-react/src/modules/todos/todo.mutations.ts +25 -0
  217. package/templates/tauri-react/src/modules/todos/todo.queries.ts +5 -0
  218. package/templates/tauri-react/src/modules/todos/todo.schema.ts +10 -0
  219. package/templates/tauri-react/src/modules/todos/useTodos.ts +31 -0
  220. package/templates/tauri-react/src/schema.ts +9 -0
  221. package/templates/tauri-react/src/sync-config.ts +103 -0
  222. package/templates/tauri-react/src/updater.ts +38 -0
  223. package/templates/tauri-react/src/vite-env.d.ts +19 -0
  224. package/templates/tauri-react/src-tauri/Cargo.toml +19 -0
  225. package/templates/tauri-react/src-tauri/build.rs +3 -0
  226. package/templates/tauri-react/src-tauri/capabilities/default.json +12 -0
  227. package/templates/tauri-react/src-tauri/icons/128x128.png +0 -0
  228. package/templates/tauri-react/src-tauri/icons/128x128@2x.png +0 -0
  229. package/templates/tauri-react/src-tauri/icons/32x32.png +0 -0
  230. package/templates/tauri-react/src-tauri/icons/icon.icns +0 -0
  231. package/templates/tauri-react/src-tauri/icons/icon.ico +0 -0
  232. package/templates/tauri-react/src-tauri/src/lib.rs +8 -0
  233. package/templates/tauri-react/src-tauri/src/main.rs +6 -0
  234. package/templates/tauri-react/src-tauri/tauri.conf.json +44 -0
  235. package/templates/tauri-react/tsconfig.json.hbs +14 -0
  236. package/templates/tauri-react/vite.config.ts +15 -0
  237. package/templates/vue-basic/AGENTS.md +84 -0
  238. package/templates/vue-basic/README.md.hbs +62 -0
  239. package/templates/vue-basic/index.html.hbs +12 -0
  240. package/templates/vue-basic/kora.config.ts +12 -0
  241. package/templates/vue-basic/package.json.hbs +32 -0
  242. package/templates/vue-basic/src/App.vue +117 -0
  243. package/templates/vue-basic/src/index.css +287 -0
  244. package/templates/vue-basic/src/kora-worker.ts +9 -0
  245. package/templates/vue-basic/src/main.ts +20 -0
  246. package/templates/vue-basic/src/modules/todos/todo.mutations.ts +25 -0
  247. package/templates/vue-basic/src/modules/todos/todo.queries.ts +5 -0
  248. package/templates/vue-basic/src/modules/todos/todo.schema.ts +10 -0
  249. package/templates/vue-basic/src/modules/todos/useTodos.ts +32 -0
  250. package/templates/vue-basic/src/schema.ts +9 -0
  251. package/templates/vue-basic/src/vite-env.d.ts +17 -0
  252. package/templates/vue-basic/tsconfig.json.hbs +15 -0
  253. package/templates/vue-basic/vite.config.ts +74 -0
  254. package/templates/vue-sync/.env.example +25 -0
  255. package/templates/vue-sync/AGENTS.md +84 -0
  256. package/templates/vue-sync/README.md.hbs +106 -0
  257. package/templates/vue-sync/index.html.hbs +12 -0
  258. package/templates/vue-sync/kora.config.ts +17 -0
  259. package/templates/vue-sync/package.json.hbs +42 -0
  260. package/templates/vue-sync/server.ts +141 -0
  261. package/templates/vue-sync/src/App.vue +135 -0
  262. package/templates/vue-sync/src/auth.ts +25 -0
  263. package/templates/vue-sync/src/index.css +339 -0
  264. package/templates/vue-sync/src/kora-worker.ts +9 -0
  265. package/templates/vue-sync/src/main.ts +47 -0
  266. package/templates/vue-sync/src/modules/todos/todo.mutations.ts +25 -0
  267. package/templates/vue-sync/src/modules/todos/todo.queries.ts +5 -0
  268. package/templates/vue-sync/src/modules/todos/todo.schema.ts +10 -0
  269. package/templates/vue-sync/src/modules/todos/useTodos.ts +32 -0
  270. package/templates/vue-sync/src/schema.ts +9 -0
  271. package/templates/vue-sync/src/vite-env.d.ts +27 -0
  272. package/templates/vue-sync/tsconfig.json.hbs +15 -0
  273. package/templates/vue-sync/vite.config.ts +91 -0
  274. package/templates/vue-tailwind/AGENTS.md +84 -0
  275. package/templates/vue-tailwind/README.md.hbs +62 -0
  276. package/templates/vue-tailwind/index.html.hbs +12 -0
  277. package/templates/vue-tailwind/kora.config.ts +12 -0
  278. package/templates/vue-tailwind/package.json.hbs +35 -0
  279. package/templates/vue-tailwind/src/App.vue +135 -0
  280. package/templates/vue-tailwind/src/index.css +7 -0
  281. package/templates/vue-tailwind/src/kora-worker.ts +9 -0
  282. package/templates/vue-tailwind/src/main.ts +31 -0
  283. package/templates/vue-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  284. package/templates/vue-tailwind/src/modules/todos/todo.queries.ts +5 -0
  285. package/templates/vue-tailwind/src/modules/todos/todo.schema.ts +10 -0
  286. package/templates/vue-tailwind/src/modules/todos/useTodos.ts +32 -0
  287. package/templates/vue-tailwind/src/schema.ts +9 -0
  288. package/templates/vue-tailwind/src/vite-env.d.ts +17 -0
  289. package/templates/vue-tailwind/tsconfig.json.hbs +15 -0
  290. package/templates/vue-tailwind/vite.config.ts +75 -0
  291. package/templates/vue-tailwind-sync/.env.example +25 -0
  292. package/templates/vue-tailwind-sync/AGENTS.md +84 -0
  293. package/templates/vue-tailwind-sync/README.md.hbs +106 -0
  294. package/templates/vue-tailwind-sync/index.html.hbs +12 -0
  295. package/templates/vue-tailwind-sync/kora.config.ts +17 -0
  296. package/templates/vue-tailwind-sync/package.json.hbs +45 -0
  297. package/templates/vue-tailwind-sync/server.ts +141 -0
  298. package/templates/vue-tailwind-sync/src/App.vue +245 -0
  299. package/templates/vue-tailwind-sync/src/auth.ts +25 -0
  300. package/templates/vue-tailwind-sync/src/index.css +7 -0
  301. package/templates/vue-tailwind-sync/src/kora-worker.ts +9 -0
  302. package/templates/vue-tailwind-sync/src/main.ts +56 -0
  303. package/templates/vue-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
  304. package/templates/vue-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  305. package/templates/vue-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  306. package/templates/vue-tailwind-sync/src/modules/todos/useTodos.ts +32 -0
  307. package/templates/vue-tailwind-sync/src/schema.ts +9 -0
  308. package/templates/vue-tailwind-sync/src/vite-env.d.ts +27 -0
  309. package/templates/vue-tailwind-sync/tsconfig.json.hbs +15 -0
  310. package/templates/vue-tailwind-sync/vite.config.ts +92 -0
@@ -0,0 +1,796 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/types.ts
4
+ var PACKAGE_MANAGERS = ["pnpm", "npm", "yarn", "bun"];
5
+ var TEMPLATES = [
6
+ "react-tailwind-sync",
7
+ "react-tailwind",
8
+ "react-sync",
9
+ "react-basic",
10
+ "vue-sync",
11
+ "vue-basic",
12
+ "vue-tailwind-sync",
13
+ "vue-tailwind",
14
+ "svelte-sync",
15
+ "svelte-basic",
16
+ "svelte-tailwind-sync",
17
+ "svelte-tailwind",
18
+ "tauri-react"
19
+ ];
20
+ var TEMPLATE_INFO = [
21
+ {
22
+ name: "react-tailwind-sync",
23
+ label: "React + Tailwind (with sync)",
24
+ description: "Polished dark-themed app with Tailwind CSS and sync server (Recommended)"
25
+ },
26
+ {
27
+ name: "react-tailwind",
28
+ label: "React + Tailwind (local-only)",
29
+ description: "Polished dark-themed app with Tailwind CSS \u2014 no sync server"
30
+ },
31
+ {
32
+ name: "react-sync",
33
+ label: "React + CSS (with sync)",
34
+ description: "Clean CSS app with sync server included"
35
+ },
36
+ {
37
+ name: "react-basic",
38
+ label: "React + CSS (local-only)",
39
+ description: "Clean CSS app \u2014 no sync server"
40
+ },
41
+ {
42
+ name: "vue-sync",
43
+ label: "Vue 3 + CSS (with sync)",
44
+ description: "Vue composables with sync server included"
45
+ },
46
+ {
47
+ name: "vue-basic",
48
+ label: "Vue 3 + CSS (local-only)",
49
+ description: "Vue composables \u2014 no sync server"
50
+ },
51
+ {
52
+ name: "vue-tailwind-sync",
53
+ label: "Vue 3 + Tailwind (with sync)",
54
+ description: "Polished Vue app with Tailwind CSS and sync server"
55
+ },
56
+ {
57
+ name: "vue-tailwind",
58
+ label: "Vue 3 + Tailwind (local-only)",
59
+ description: "Polished Vue app with Tailwind CSS \u2014 no sync server"
60
+ },
61
+ {
62
+ name: "svelte-sync",
63
+ label: "Svelte 5 + CSS (with sync)",
64
+ description: "Svelte stores with sync server included"
65
+ },
66
+ {
67
+ name: "svelte-basic",
68
+ label: "Svelte 5 + CSS (local-only)",
69
+ description: "Svelte stores \u2014 no sync server"
70
+ },
71
+ {
72
+ name: "svelte-tailwind-sync",
73
+ label: "Svelte 5 + Tailwind (with sync)",
74
+ description: "Polished Svelte app with Tailwind CSS and sync server"
75
+ },
76
+ {
77
+ name: "svelte-tailwind",
78
+ label: "Svelte 5 + Tailwind (local-only)",
79
+ description: "Polished Svelte app with Tailwind CSS \u2014 no sync server"
80
+ },
81
+ {
82
+ name: "tauri-react",
83
+ label: "Tauri Desktop (native SQLite)",
84
+ description: "Desktop app with native SQLite \u2014 no WASM, includes sync server"
85
+ }
86
+ ];
87
+
88
+ // src/errors.ts
89
+ import { KoraError } from "@korajs/core";
90
+ var CliError = class extends KoraError {
91
+ constructor(message, context) {
92
+ super(message, "CLI_ERROR", context);
93
+ this.name = "CliError";
94
+ }
95
+ };
96
+ var DeployPlatformUnavailableError = class extends KoraError {
97
+ constructor(platform, available) {
98
+ super(
99
+ `Deploying to "${platform}" is coming soon and not available yet. Choose one of: ${available.join(", ")}. To self-host, run the production server (\`pnpm build && pnpm start\`) in any Node 20+ environment.`,
100
+ "DEPLOY_PLATFORM_UNAVAILABLE",
101
+ { platform, available }
102
+ );
103
+ this.platform = platform;
104
+ this.available = available;
105
+ this.name = "DeployPlatformUnavailableError";
106
+ }
107
+ platform;
108
+ available;
109
+ };
110
+ var ProjectExistsError = class extends KoraError {
111
+ constructor(directory) {
112
+ super(
113
+ `Directory "${directory}" already exists. Choose a different name or remove the existing directory.`,
114
+ "PROJECT_EXISTS",
115
+ { directory }
116
+ );
117
+ this.directory = directory;
118
+ this.name = "ProjectExistsError";
119
+ }
120
+ directory;
121
+ };
122
+ var SchemaNotFoundError = class extends KoraError {
123
+ constructor(searchedPaths) {
124
+ super(
125
+ `Could not find a schema file. Searched: ${searchedPaths.join(", ")}. Create a schema file using defineSchema() from @korajs/core.`,
126
+ "SCHEMA_NOT_FOUND",
127
+ { searchedPaths }
128
+ );
129
+ this.searchedPaths = searchedPaths;
130
+ this.name = "SchemaNotFoundError";
131
+ }
132
+ searchedPaths;
133
+ };
134
+ var InvalidProjectError = class extends KoraError {
135
+ constructor(directory) {
136
+ super(
137
+ `"${directory}" is not a valid Kora project. No package.json with a kora dependency found. Run this command from inside a Kora project.`,
138
+ "INVALID_PROJECT",
139
+ { directory }
140
+ );
141
+ this.directory = directory;
142
+ this.name = "InvalidProjectError";
143
+ }
144
+ directory;
145
+ };
146
+ var DevServerError = class extends KoraError {
147
+ constructor(binary, searchPath) {
148
+ super(
149
+ `Could not find required binary "${binary}" at ${searchPath}. Install project dependencies and try again.`,
150
+ "DEV_SERVER_ERROR",
151
+ { binary, searchPath }
152
+ );
153
+ this.binary = binary;
154
+ this.searchPath = searchPath;
155
+ this.name = "DevServerError";
156
+ }
157
+ binary;
158
+ searchPath;
159
+ };
160
+
161
+ // src/prompts/prompt-client.ts
162
+ import {
163
+ cancel as clackCancel,
164
+ confirm as clackConfirm,
165
+ intro as clackIntro,
166
+ isCancel as clackIsCancel,
167
+ outro as clackOutro,
168
+ select as clackSelect,
169
+ text as clackText
170
+ } from "@clack/prompts";
171
+
172
+ // src/utils/prompt.ts
173
+ import { createInterface } from "readline";
174
+ function promptText(message, defaultValue, options) {
175
+ return new Promise((resolve) => {
176
+ const rl = createReadline(options);
177
+ const suffix = defaultValue !== void 0 ? ` (${defaultValue})` : "";
178
+ rl.question(` ? ${message}${suffix}: `, (answer) => {
179
+ rl.close();
180
+ const trimmed = answer.trim();
181
+ resolve(trimmed || defaultValue || "");
182
+ });
183
+ });
184
+ }
185
+ function promptSelect(message, choices, options) {
186
+ return new Promise((resolve) => {
187
+ const rl = createReadline(options);
188
+ const out = options?.output ?? process.stdout;
189
+ out.write(` ? ${message}
190
+ `);
191
+ for (let i = 0; i < choices.length; i++) {
192
+ const choice = choices[i];
193
+ if (choice) {
194
+ out.write(` ${i + 1}) ${choice.label}
195
+ `);
196
+ }
197
+ }
198
+ const ask = () => {
199
+ rl.question(" > ", (answer) => {
200
+ const index = Number.parseInt(answer.trim(), 10) - 1;
201
+ const selected = choices[index];
202
+ if (selected) {
203
+ rl.close();
204
+ resolve(selected.value);
205
+ } else {
206
+ out.write(` Please enter a number between 1 and ${choices.length}
207
+ `);
208
+ ask();
209
+ }
210
+ });
211
+ };
212
+ ask();
213
+ });
214
+ }
215
+ function promptConfirm(message, defaultValue = false, options) {
216
+ return new Promise((resolve) => {
217
+ const rl = createReadline(options);
218
+ const suffix = defaultValue ? "Y/n" : "y/N";
219
+ const ask = () => {
220
+ rl.question(` ? ${message} (${suffix}): `, (answer) => {
221
+ const normalized = answer.trim().toLowerCase();
222
+ if (normalized.length === 0) {
223
+ rl.close();
224
+ resolve(defaultValue);
225
+ return;
226
+ }
227
+ if (normalized === "y" || normalized === "yes") {
228
+ rl.close();
229
+ resolve(true);
230
+ return;
231
+ }
232
+ if (normalized === "n" || normalized === "no") {
233
+ rl.close();
234
+ resolve(false);
235
+ return;
236
+ }
237
+ ;
238
+ (options?.output ?? process.stdout).write(" Please answer with y or n\n");
239
+ ask();
240
+ });
241
+ };
242
+ ask();
243
+ });
244
+ }
245
+ function createReadline(options) {
246
+ return createInterface({
247
+ input: options?.input ?? process.stdin,
248
+ output: options?.output ?? process.stdout
249
+ });
250
+ }
251
+
252
+ // src/prompts/prompt-client.ts
253
+ var PromptCancelledError = class extends Error {
254
+ constructor(message = "Prompt cancelled by user") {
255
+ super(message);
256
+ this.name = "PromptCancelledError";
257
+ }
258
+ };
259
+ var ReadlinePromptClient = class {
260
+ async text(message, defaultValue) {
261
+ return promptText(message, defaultValue);
262
+ }
263
+ async select(message, options) {
264
+ return promptSelect(
265
+ message,
266
+ options.filter((option) => option.disabled !== true).map((option) => ({ label: option.label, value: option.value }))
267
+ );
268
+ }
269
+ async confirm(message, defaultValue = false) {
270
+ return promptConfirm(message, defaultValue);
271
+ }
272
+ intro(message) {
273
+ void message;
274
+ }
275
+ outro(message) {
276
+ void message;
277
+ }
278
+ };
279
+ function createPromptClient() {
280
+ const canUseInteractiveClack = typeof process !== "undefined" && process.stdin.isTTY && process.stdout.isTTY;
281
+ if (canUseInteractiveClack) {
282
+ return new ClackPromptClient();
283
+ }
284
+ return new ReadlinePromptClient();
285
+ }
286
+ var ClackPromptClient = class {
287
+ async text(message, defaultValue) {
288
+ const result = await clackText({
289
+ message,
290
+ placeholder: defaultValue,
291
+ defaultValue
292
+ });
293
+ if (clackIsCancel(result)) {
294
+ clackCancel("Operation cancelled.");
295
+ throw new PromptCancelledError();
296
+ }
297
+ const value = result.trim();
298
+ if (value.length > 0) return value;
299
+ return defaultValue ?? "";
300
+ }
301
+ async select(message, options) {
302
+ const mappedOptions = options.map((option) => ({
303
+ label: option.label,
304
+ value: option.value,
305
+ hint: option.hint,
306
+ disabled: option.disabled
307
+ }));
308
+ const result = await clackSelect({
309
+ message,
310
+ options: mappedOptions
311
+ });
312
+ if (clackIsCancel(result)) {
313
+ clackCancel("Operation cancelled.");
314
+ throw new PromptCancelledError();
315
+ }
316
+ return result;
317
+ }
318
+ async confirm(message, defaultValue = false) {
319
+ const result = await clackConfirm({
320
+ message,
321
+ initialValue: defaultValue
322
+ });
323
+ if (clackIsCancel(result)) {
324
+ clackCancel("Operation cancelled.");
325
+ throw new PromptCancelledError();
326
+ }
327
+ return result;
328
+ }
329
+ intro(message) {
330
+ clackIntro(message);
331
+ }
332
+ outro(message) {
333
+ clackOutro(message);
334
+ }
335
+ };
336
+
337
+ // src/commands/create/project-name.ts
338
+ import validateNpmPackageName from "validate-npm-package-name";
339
+ function validateProjectName(name) {
340
+ const trimmedName = name.trim();
341
+ if (trimmedName.length === 0) {
342
+ return {
343
+ valid: false,
344
+ issues: ["Project name cannot be empty."]
345
+ };
346
+ }
347
+ const validation = validateNpmPackageName(trimmedName);
348
+ const issues = [...validation.errors ?? [], ...validation.warnings ?? []];
349
+ if (!validation.validForNewPackages && issues.length === 0) {
350
+ return {
351
+ valid: false,
352
+ issues: ["Project name is not a valid npm package name."]
353
+ };
354
+ }
355
+ return {
356
+ valid: validation.validForNewPackages,
357
+ issues
358
+ };
359
+ }
360
+
361
+ // src/commands/create/options.ts
362
+ function determineTemplateFromSelections(input) {
363
+ if (input.platform === "desktop-tauri") return "tauri-react";
364
+ const shouldSync = input.sync && input.db !== "none";
365
+ if (input.framework === "vue") {
366
+ if (input.tailwind && shouldSync) return "vue-tailwind-sync";
367
+ if (input.tailwind && !shouldSync) return "vue-tailwind";
368
+ return shouldSync ? "vue-sync" : "vue-basic";
369
+ }
370
+ if (input.framework === "svelte") {
371
+ if (input.tailwind && shouldSync) return "svelte-tailwind-sync";
372
+ if (input.tailwind && !shouldSync) return "svelte-tailwind";
373
+ return shouldSync ? "svelte-sync" : "svelte-basic";
374
+ }
375
+ if (input.framework === "solid") {
376
+ throw new Error("Solid templates are not available yet. Use react, vue, or svelte.");
377
+ }
378
+ if (input.tailwind && shouldSync) return "react-tailwind-sync";
379
+ if (input.tailwind && !shouldSync) return "react-tailwind";
380
+ if (!input.tailwind && shouldSync) return "react-sync";
381
+ return "react-basic";
382
+ }
383
+ function isPlatformValue(value) {
384
+ return value === "web" || value === "desktop-tauri";
385
+ }
386
+ function isFrameworkValue(value) {
387
+ return value === "react" || value === "vue" || value === "svelte" || value === "solid";
388
+ }
389
+ function isAuthValue(value) {
390
+ return value === "none" || value === "email-password" || value === "oauth";
391
+ }
392
+ function isDatabaseValue(value) {
393
+ return value === "none" || value === "sqlite" || value === "postgres";
394
+ }
395
+ function isDatabaseProviderValue(value) {
396
+ return value === "none" || value === "local" || value === "supabase" || value === "neon" || value === "railway" || value === "vercel-postgres" || value === "custom";
397
+ }
398
+ function isSupportedWebFramework(framework) {
399
+ return framework === "react" || framework === "vue" || framework === "svelte";
400
+ }
401
+
402
+ // src/prompts/preferences.ts
403
+ import Conf from "conf";
404
+ var DEFAULT_PREFERENCES = {
405
+ platform: "web",
406
+ framework: "react",
407
+ tailwind: true,
408
+ sync: true,
409
+ db: "sqlite",
410
+ dbProvider: "none",
411
+ auth: "none",
412
+ packageManager: "pnpm"
413
+ };
414
+ var PREFERENCES_KEY = "create.defaults";
415
+ var PreferenceStore = class {
416
+ store;
417
+ constructor() {
418
+ this.store = new Conf({
419
+ projectName: "korajs-cli"
420
+ });
421
+ }
422
+ getCreatePreferences() {
423
+ return this.store.get(PREFERENCES_KEY) ?? null;
424
+ }
425
+ saveCreatePreferences(preferences) {
426
+ this.store.set(PREFERENCES_KEY, preferences);
427
+ }
428
+ clearCreatePreferences() {
429
+ this.store.delete(PREFERENCES_KEY);
430
+ }
431
+ };
432
+ function getCreatePreferencesOrDefault(store) {
433
+ return store.getCreatePreferences() ?? DEFAULT_PREFERENCES;
434
+ }
435
+ function getDefaultCreatePreferences() {
436
+ return { ...DEFAULT_PREFERENCES };
437
+ }
438
+
439
+ // src/commands/create/preferences-flow.ts
440
+ async function resolveCreatePreferencesFlow(params) {
441
+ const { flags, prompts, store } = params;
442
+ const stored = store.getCreatePreferences();
443
+ const base = getCreatePreferencesOrDefault(store);
444
+ const hasExplicitFlags = hasExplicitPreferenceFlags(flags);
445
+ const canOfferStored = !flags.useDefaults && !hasExplicitFlags && stored !== null && promptSupportsRichOptions();
446
+ let effective = { ...base };
447
+ let usedStoredPreferences = false;
448
+ if (flags.useDefaults) {
449
+ effective = getDefaultCreatePreferences();
450
+ } else if (canOfferStored && stored !== null) {
451
+ const reuseStored = await prompts.select("Welcome back! Choose setup mode:", [
452
+ { label: formatStoredPreferenceLabel(stored), value: "reuse" },
453
+ { label: "Customize", value: "customize" }
454
+ ]);
455
+ if (reuseStored === "reuse") {
456
+ effective = { ...stored };
457
+ usedStoredPreferences = true;
458
+ }
459
+ }
460
+ if (flags.platform !== void 0) {
461
+ if (!isPlatformValue(flags.platform)) {
462
+ throw new Error(
463
+ `Invalid --platform value "${flags.platform}". Expected one of: web, desktop-tauri.`
464
+ );
465
+ }
466
+ effective.platform = flags.platform;
467
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
468
+ effective.platform = await prompts.select("Platform:", [
469
+ { label: "Web (browser)", value: "web" },
470
+ { label: "Desktop (Tauri \u2014 native SQLite)", value: "desktop-tauri" }
471
+ ]);
472
+ }
473
+ const isTauri = effective.platform === "desktop-tauri";
474
+ if (isTauri) {
475
+ effective.framework = "react";
476
+ effective.tailwind = false;
477
+ effective.auth = "none";
478
+ if (flags.sync !== void 0) {
479
+ effective.sync = flags.sync;
480
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
481
+ effective.sync = await prompts.confirm("Enable multi-device sync?", true);
482
+ }
483
+ if (flags.db !== void 0) {
484
+ if (!isDatabaseValue(flags.db)) {
485
+ throw new Error(
486
+ `Invalid --db value "${flags.db}". Expected one of: none, sqlite, postgres.`
487
+ );
488
+ }
489
+ effective.db = flags.db;
490
+ } else if (!effective.sync) {
491
+ effective.db = "none";
492
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
493
+ effective.db = await prompts.select("Sync server database:", [
494
+ { label: "SQLite (zero-config; local, LAN, small teams)", value: "sqlite" },
495
+ { label: "PostgreSQL (production-scale)", value: "postgres" }
496
+ ]);
497
+ }
498
+ if (effective.db === "none") {
499
+ effective.sync = false;
500
+ }
501
+ if (effective.db !== "postgres") {
502
+ effective.dbProvider = "none";
503
+ } else if (flags.dbProvider !== void 0) {
504
+ if (!isDatabaseProviderValue(flags.dbProvider)) {
505
+ throw new Error(
506
+ `Invalid --db-provider value "${flags.dbProvider}". Expected one of: none, local, supabase, neon, railway, vercel-postgres, custom.`
507
+ );
508
+ }
509
+ effective.dbProvider = flags.dbProvider;
510
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
511
+ effective.dbProvider = await prompts.select("Database provider:", [
512
+ { label: "Local Postgres", value: "local" },
513
+ { label: "Supabase", value: "supabase" },
514
+ { label: "Neon", value: "neon" },
515
+ { label: "Railway", value: "railway" },
516
+ { label: "Vercel Postgres", value: "vercel-postgres" },
517
+ { label: "Custom connection string", value: "custom" }
518
+ ]);
519
+ }
520
+ } else {
521
+ if (flags.framework !== void 0) {
522
+ if (!isFrameworkValue(flags.framework)) {
523
+ throw new Error(
524
+ `Invalid --framework value "${flags.framework}". Expected one of: react, vue, svelte, solid.`
525
+ );
526
+ }
527
+ effective.framework = flags.framework;
528
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
529
+ effective.framework = await prompts.select("UI framework:", [
530
+ { label: "React", value: "react" },
531
+ { label: "Vue 3", value: "vue" },
532
+ { label: "Svelte 5", value: "svelte" },
533
+ { label: "Solid (coming soon)", value: "solid", disabled: true }
534
+ ]);
535
+ }
536
+ if (flags.auth !== void 0) {
537
+ if (!isAuthValue(flags.auth)) {
538
+ throw new Error(
539
+ `Invalid --auth value "${flags.auth}". Expected one of: none, email-password, oauth.`
540
+ );
541
+ }
542
+ effective.auth = flags.auth;
543
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
544
+ effective.auth = await prompts.select("Authentication:", [
545
+ { label: "None", value: "none" },
546
+ { label: "Email + Password (coming soon)", value: "email-password", disabled: true },
547
+ { label: "OAuth (coming soon)", value: "oauth", disabled: true }
548
+ ]);
549
+ }
550
+ if (flags.tailwind !== void 0) {
551
+ effective.tailwind = flags.tailwind;
552
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
553
+ effective.tailwind = await prompts.confirm("Use Tailwind CSS?", true);
554
+ }
555
+ if (flags.sync !== void 0) {
556
+ effective.sync = flags.sync;
557
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
558
+ effective.sync = await prompts.confirm("Enable multi-device sync?", true);
559
+ }
560
+ if (flags.db !== void 0) {
561
+ if (!isDatabaseValue(flags.db)) {
562
+ throw new Error(
563
+ `Invalid --db value "${flags.db}". Expected one of: none, sqlite, postgres.`
564
+ );
565
+ }
566
+ effective.db = flags.db;
567
+ } else if (!effective.sync) {
568
+ effective.db = "none";
569
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
570
+ effective.db = await prompts.select("Server-side database:", [
571
+ { label: "SQLite (zero-config)", value: "sqlite" },
572
+ { label: "PostgreSQL (production-scale)", value: "postgres" }
573
+ ]);
574
+ }
575
+ if (effective.db !== "postgres") {
576
+ effective.dbProvider = "none";
577
+ } else if (flags.dbProvider !== void 0) {
578
+ if (!isDatabaseProviderValue(flags.dbProvider)) {
579
+ throw new Error(
580
+ `Invalid --db-provider value "${flags.dbProvider}". Expected one of: none, local, supabase, neon, railway, vercel-postgres, custom.`
581
+ );
582
+ }
583
+ effective.dbProvider = flags.dbProvider;
584
+ } else if (!flags.useDefaults && !usedStoredPreferences) {
585
+ effective.dbProvider = await prompts.select("Database provider:", [
586
+ { label: "Local Postgres", value: "local" },
587
+ { label: "Supabase", value: "supabase" },
588
+ { label: "Neon", value: "neon" },
589
+ { label: "Railway", value: "railway" },
590
+ { label: "Vercel Postgres", value: "vercel-postgres" },
591
+ { label: "Custom connection string", value: "custom" }
592
+ ]);
593
+ }
594
+ }
595
+ const template = determineTemplateFromSelections({
596
+ platform: effective.platform,
597
+ framework: effective.framework,
598
+ tailwind: effective.tailwind,
599
+ sync: effective.sync,
600
+ db: effective.db
601
+ });
602
+ return {
603
+ platform: effective.platform,
604
+ framework: effective.framework,
605
+ auth: effective.auth,
606
+ db: effective.db,
607
+ dbProvider: effective.dbProvider,
608
+ tailwind: effective.tailwind,
609
+ sync: effective.sync,
610
+ template,
611
+ usedStoredPreferences
612
+ };
613
+ }
614
+ function shouldSavePreferences(flags) {
615
+ return !flags.useDefaults;
616
+ }
617
+ function saveResolvedPreferences(store, resolution) {
618
+ store.saveCreatePreferences({
619
+ platform: resolution.platform,
620
+ framework: resolution.framework,
621
+ tailwind: resolution.tailwind,
622
+ sync: resolution.sync,
623
+ db: resolution.db,
624
+ dbProvider: resolution.dbProvider,
625
+ auth: resolution.auth,
626
+ packageManager: resolution.packageManager
627
+ });
628
+ }
629
+ function hasExplicitPreferenceFlags(flags) {
630
+ return flags.platform !== void 0 || flags.framework !== void 0 || flags.auth !== void 0 || flags.db !== void 0 || flags.dbProvider !== void 0 || flags.tailwind !== void 0 || flags.sync !== void 0;
631
+ }
632
+ function promptSupportsRichOptions() {
633
+ return typeof process !== "undefined" && process.stdin.isTTY && process.stdout.isTTY;
634
+ }
635
+ function formatStoredPreferenceLabel(preferences) {
636
+ if (preferences.platform === "desktop-tauri") {
637
+ return `Use previous settings (tauri-desktop + ${preferences.packageManager})`;
638
+ }
639
+ const syncLabel = preferences.sync ? `sync/${preferences.db}` : "local-only";
640
+ const styleLabel = preferences.tailwind ? "tailwind" : "css";
641
+ return `Use previous settings (${preferences.framework} + ${styleLabel} + ${syncLabel} + ${preferences.packageManager})`;
642
+ }
643
+
644
+ // src/commands/create/sync-provider-preset.ts
645
+ import { readFile, writeFile } from "fs/promises";
646
+ import { join } from "path";
647
+ async function applySyncProviderPreset(options) {
648
+ if (!isSyncTemplate(options.template)) {
649
+ return;
650
+ }
651
+ if (options.db !== "postgres") {
652
+ return;
653
+ }
654
+ const providerName = getProviderDisplayName(options.dbProvider);
655
+ const providerConnectionString = getProviderConnectionStringExample(options.dbProvider);
656
+ const envPath = join(options.targetDir, ".env.example");
657
+ const readmePath = join(options.targetDir, "README.md");
658
+ const existingReadme = await readFile(readmePath, "utf-8");
659
+ const existingEnv = await readFile(envPath, "utf-8");
660
+ const trimmedReadme = existingReadme.trimEnd();
661
+ const trimmedEnv = existingEnv.trimEnd();
662
+ const envSuffix = [
663
+ "",
664
+ `# PostgreSQL provider preset: ${providerName}`,
665
+ `# Example: ${providerConnectionString}`
666
+ ].join("\n");
667
+ const readmeSuffix = [
668
+ "",
669
+ "## PostgreSQL Provider Preset",
670
+ "",
671
+ `Selected DB provider: ${options.dbProvider}`,
672
+ "",
673
+ "This scaffold keeps one sync server entrypoint. When `DATABASE_URL` is set, `server.ts` uses PostgreSQL. When it is empty, the same server uses SQLite at `KORA_SERVER_DB`.",
674
+ "",
675
+ "The generated server uses `createPostgresServerStore` automatically when `DATABASE_URL` is present.",
676
+ ""
677
+ ].join("\n");
678
+ const readmeTemplate = `${trimmedReadme}${readmeSuffix}`;
679
+ await writeFile(envPath, `${trimmedEnv}${envSuffix}
680
+ `, "utf-8");
681
+ await writeFile(readmePath, readmeTemplate, "utf-8");
682
+ }
683
+ function isSyncTemplate(template) {
684
+ return template === "react-sync" || template === "react-tailwind-sync" || template === "vue-sync" || template === "vue-tailwind-sync" || template === "svelte-sync" || template === "svelte-tailwind-sync" || template === "tauri-react";
685
+ }
686
+ function getProviderDisplayName(provider) {
687
+ switch (provider) {
688
+ case "supabase":
689
+ return "Supabase";
690
+ case "neon":
691
+ return "Neon";
692
+ case "railway":
693
+ return "Railway";
694
+ case "vercel-postgres":
695
+ return "Vercel Postgres";
696
+ case "custom":
697
+ return "Custom";
698
+ case "local":
699
+ return "Local Postgres";
700
+ case "none":
701
+ return "PostgreSQL";
702
+ }
703
+ }
704
+ function getProviderConnectionStringExample(provider) {
705
+ switch (provider) {
706
+ case "supabase":
707
+ return "postgresql://postgres:<password>@db.<project-ref>.supabase.co:5432/postgres?sslmode=require";
708
+ case "neon":
709
+ return "postgresql://<user>:<password>@<branch>.<project>.neon.tech/neondb?sslmode=require";
710
+ case "railway":
711
+ return "postgresql://postgres:<password>@<host>.railway.app:<port>/railway?sslmode=require";
712
+ case "vercel-postgres":
713
+ return "postgresql://<user>:<password>@<host>.pooler.vercel-storage.com:5432/verceldb?sslmode=require";
714
+ case "custom":
715
+ return "postgresql://<user>:<password>@<host>:5432/<database>";
716
+ case "local":
717
+ return "postgresql://postgres:postgres@localhost:5432/kora";
718
+ case "none":
719
+ return "postgresql://postgres:postgres@localhost:5432/kora";
720
+ }
721
+ }
722
+
723
+ // src/utils/logger.ts
724
+ var RESET = "\x1B[0m";
725
+ var BOLD = "\x1B[1m";
726
+ var DIM = "\x1B[2m";
727
+ var GREEN = "\x1B[32m";
728
+ var YELLOW = "\x1B[33m";
729
+ var RED = "\x1B[31m";
730
+ var CYAN = "\x1B[36m";
731
+ function createLogger(options) {
732
+ const colorDisabled = options?.noColor === true || process.env.NO_COLOR !== void 0 || !process.stdout.isTTY;
733
+ function color(code, text) {
734
+ return colorDisabled ? text : `${code}${text}${RESET}`;
735
+ }
736
+ return {
737
+ info(message) {
738
+ console.log(color(CYAN, message));
739
+ },
740
+ success(message) {
741
+ console.log(color(GREEN, ` \u2713 ${message}`));
742
+ },
743
+ warn(message) {
744
+ console.warn(color(YELLOW, ` \u26A0 ${message}`));
745
+ },
746
+ error(message) {
747
+ console.error(color(RED, ` \u2717 ${message}`));
748
+ },
749
+ step(message) {
750
+ console.log(color(DIM, ` ${message}`));
751
+ },
752
+ blank() {
753
+ console.log();
754
+ },
755
+ banner() {
756
+ console.log();
757
+ console.log(
758
+ color(BOLD + CYAN, " Kora.js") + color(DIM, ", the offline-first application framework")
759
+ );
760
+ console.log();
761
+ }
762
+ };
763
+ }
764
+
765
+ export {
766
+ PACKAGE_MANAGERS,
767
+ TEMPLATES,
768
+ TEMPLATE_INFO,
769
+ CliError,
770
+ DeployPlatformUnavailableError,
771
+ ProjectExistsError,
772
+ SchemaNotFoundError,
773
+ InvalidProjectError,
774
+ DevServerError,
775
+ createLogger,
776
+ promptConfirm,
777
+ PromptCancelledError,
778
+ ReadlinePromptClient,
779
+ createPromptClient,
780
+ ClackPromptClient,
781
+ validateProjectName,
782
+ determineTemplateFromSelections,
783
+ isFrameworkValue,
784
+ isAuthValue,
785
+ isDatabaseValue,
786
+ isDatabaseProviderValue,
787
+ isSupportedWebFramework,
788
+ PreferenceStore,
789
+ getCreatePreferencesOrDefault,
790
+ getDefaultCreatePreferences,
791
+ resolveCreatePreferencesFlow,
792
+ shouldSavePreferences,
793
+ saveResolvedPreferences,
794
+ applySyncProviderPreset
795
+ };
796
+ //# sourceMappingURL=chunk-7Y4J2GXP.js.map