@korajs/cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/bin.cjs +76 -7
  2. package/dist/bin.cjs.map +1 -1
  3. package/dist/bin.js +3 -3
  4. package/dist/{chunk-PSRM56B7.js → chunk-EEZNRI5W.js} +51 -6
  5. package/dist/chunk-EEZNRI5W.js.map +1 -0
  6. package/dist/{chunk-SOTZIWIF.js → chunk-Q2FBCOQD.js} +2 -2
  7. package/dist/{chunk-3WNFM3QB.js → chunk-VLTPEATY.js} +70 -4
  8. package/dist/chunk-VLTPEATY.js.map +1 -0
  9. package/dist/create.cjs +76 -7
  10. package/dist/create.cjs.map +1 -1
  11. package/dist/create.js +2 -2
  12. package/dist/index.cjs +65 -3
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +3 -3
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +2 -2
  17. package/package.json +6 -6
  18. package/templates/svelte-basic/.env.example +3 -0
  19. package/templates/svelte-basic/README.md.hbs +62 -0
  20. package/templates/svelte-basic/index.html.hbs +12 -0
  21. package/templates/svelte-basic/kora.config.ts +12 -0
  22. package/templates/svelte-basic/package.json.hbs +27 -0
  23. package/templates/svelte-basic/src/App.svelte +131 -0
  24. package/templates/svelte-basic/src/Root.svelte +14 -0
  25. package/templates/svelte-basic/src/index.css +287 -0
  26. package/templates/svelte-basic/src/kora-worker.ts +9 -0
  27. package/templates/svelte-basic/src/main.ts +16 -0
  28. package/templates/svelte-basic/src/modules/todos/todo.mutations.ts +25 -0
  29. package/templates/svelte-basic/src/modules/todos/todo.queries.ts +5 -0
  30. package/templates/svelte-basic/src/modules/todos/todo.schema.ts +10 -0
  31. package/templates/svelte-basic/src/modules/todos/useTodos.ts +25 -0
  32. package/templates/svelte-basic/src/schema.ts +9 -0
  33. package/templates/svelte-basic/src/vite-env.d.ts +12 -0
  34. package/templates/svelte-basic/svelte.config.js +5 -0
  35. package/templates/svelte-basic/tsconfig.json.hbs +14 -0
  36. package/templates/svelte-basic/vite.config.ts +52 -0
  37. package/templates/svelte-sync/.env.example +25 -0
  38. package/templates/svelte-sync/README.md.hbs +105 -0
  39. package/templates/svelte-sync/index.html.hbs +12 -0
  40. package/templates/svelte-sync/kora.config.ts +17 -0
  41. package/templates/svelte-sync/package.json.hbs +43 -0
  42. package/templates/svelte-sync/server.ts +90 -0
  43. package/templates/svelte-sync/src/App.svelte +154 -0
  44. package/templates/svelte-sync/src/Root.svelte +22 -0
  45. package/templates/svelte-sync/src/auth.ts +25 -0
  46. package/templates/svelte-sync/src/index.css +339 -0
  47. package/templates/svelte-sync/src/kora-worker.ts +9 -0
  48. package/templates/svelte-sync/src/main.ts +32 -0
  49. package/templates/svelte-sync/src/modules/todos/todo.mutations.ts +25 -0
  50. package/templates/svelte-sync/src/modules/todos/todo.queries.ts +5 -0
  51. package/templates/svelte-sync/src/modules/todos/todo.schema.ts +10 -0
  52. package/templates/svelte-sync/src/modules/todos/useTodos.ts +25 -0
  53. package/templates/svelte-sync/src/schema.ts +9 -0
  54. package/templates/svelte-sync/src/vite-env.d.ts +21 -0
  55. package/templates/svelte-sync/svelte.config.js +5 -0
  56. package/templates/svelte-sync/tsconfig.json.hbs +14 -0
  57. package/templates/svelte-sync/vite.config.ts +79 -0
  58. package/templates/svelte-tailwind/README.md.hbs +62 -0
  59. package/templates/svelte-tailwind/index.html.hbs +12 -0
  60. package/templates/svelte-tailwind/kora.config.ts +12 -0
  61. package/templates/svelte-tailwind/package.json.hbs +30 -0
  62. package/templates/svelte-tailwind/src/App.svelte +79 -0
  63. package/templates/svelte-tailwind/src/Root.svelte +14 -0
  64. package/templates/svelte-tailwind/src/index.css +7 -0
  65. package/templates/svelte-tailwind/src/kora-worker.ts +9 -0
  66. package/templates/svelte-tailwind/src/main.ts +16 -0
  67. package/templates/svelte-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  68. package/templates/svelte-tailwind/src/modules/todos/todo.queries.ts +5 -0
  69. package/templates/svelte-tailwind/src/modules/todos/todo.schema.ts +10 -0
  70. package/templates/svelte-tailwind/src/modules/todos/useTodos.ts +25 -0
  71. package/templates/svelte-tailwind/src/schema.ts +9 -0
  72. package/templates/svelte-tailwind/src/vite-env.d.ts +12 -0
  73. package/templates/svelte-tailwind/svelte.config.js +5 -0
  74. package/templates/svelte-tailwind/tsconfig.json.hbs +14 -0
  75. package/templates/svelte-tailwind/vite.config.ts +53 -0
  76. package/templates/svelte-tailwind-sync/.env.example +25 -0
  77. package/templates/svelte-tailwind-sync/README.md.hbs +105 -0
  78. package/templates/svelte-tailwind-sync/index.html.hbs +12 -0
  79. package/templates/svelte-tailwind-sync/kora.config.ts +17 -0
  80. package/templates/svelte-tailwind-sync/package.json.hbs +46 -0
  81. package/templates/svelte-tailwind-sync/server.ts +90 -0
  82. package/templates/svelte-tailwind-sync/src/App.svelte +196 -0
  83. package/templates/svelte-tailwind-sync/src/Root.svelte +26 -0
  84. package/templates/svelte-tailwind-sync/src/auth.ts +25 -0
  85. package/templates/svelte-tailwind-sync/src/index.css +7 -0
  86. package/templates/svelte-tailwind-sync/src/kora-worker.ts +9 -0
  87. package/templates/svelte-tailwind-sync/src/main.ts +32 -0
  88. package/templates/svelte-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
  89. package/templates/svelte-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  90. package/templates/svelte-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  91. package/templates/svelte-tailwind-sync/src/modules/todos/useTodos.ts +25 -0
  92. package/templates/svelte-tailwind-sync/src/schema.ts +9 -0
  93. package/templates/svelte-tailwind-sync/src/vite-env.d.ts +21 -0
  94. package/templates/svelte-tailwind-sync/svelte.config.js +5 -0
  95. package/templates/svelte-tailwind-sync/tsconfig.json.hbs +14 -0
  96. package/templates/svelte-tailwind-sync/vite.config.ts +80 -0
  97. package/templates/vue-basic/README.md.hbs +62 -0
  98. package/templates/vue-basic/index.html.hbs +12 -0
  99. package/templates/vue-basic/kora.config.ts +12 -0
  100. package/templates/vue-basic/package.json.hbs +26 -0
  101. package/templates/vue-basic/src/App.vue +117 -0
  102. package/templates/vue-basic/src/index.css +287 -0
  103. package/templates/vue-basic/src/kora-worker.ts +9 -0
  104. package/templates/vue-basic/src/main.ts +20 -0
  105. package/templates/vue-basic/src/modules/todos/todo.mutations.ts +25 -0
  106. package/templates/vue-basic/src/modules/todos/todo.queries.ts +5 -0
  107. package/templates/vue-basic/src/modules/todos/todo.schema.ts +10 -0
  108. package/templates/vue-basic/src/modules/todos/useTodos.ts +32 -0
  109. package/templates/vue-basic/src/schema.ts +9 -0
  110. package/templates/vue-basic/src/vite-env.d.ts +17 -0
  111. package/templates/vue-basic/tsconfig.json.hbs +15 -0
  112. package/templates/vue-basic/vite.config.ts +69 -0
  113. package/templates/vue-sync/.env.example +25 -0
  114. package/templates/vue-sync/README.md.hbs +105 -0
  115. package/templates/vue-sync/index.html.hbs +12 -0
  116. package/templates/vue-sync/kora.config.ts +17 -0
  117. package/templates/vue-sync/package.json.hbs +42 -0
  118. package/templates/vue-sync/server.ts +90 -0
  119. package/templates/vue-sync/src/App.vue +135 -0
  120. package/templates/vue-sync/src/auth.ts +25 -0
  121. package/templates/vue-sync/src/index.css +339 -0
  122. package/templates/vue-sync/src/kora-worker.ts +9 -0
  123. package/templates/vue-sync/src/main.ts +43 -0
  124. package/templates/vue-sync/src/modules/todos/todo.mutations.ts +25 -0
  125. package/templates/vue-sync/src/modules/todos/todo.queries.ts +5 -0
  126. package/templates/vue-sync/src/modules/todos/todo.schema.ts +10 -0
  127. package/templates/vue-sync/src/modules/todos/useTodos.ts +32 -0
  128. package/templates/vue-sync/src/schema.ts +9 -0
  129. package/templates/vue-sync/src/vite-env.d.ts +26 -0
  130. package/templates/vue-sync/tsconfig.json.hbs +15 -0
  131. package/templates/vue-sync/vite.config.ts +79 -0
  132. package/templates/vue-tailwind/README.md.hbs +62 -0
  133. package/templates/vue-tailwind/index.html.hbs +12 -0
  134. package/templates/vue-tailwind/kora.config.ts +12 -0
  135. package/templates/vue-tailwind/package.json.hbs +29 -0
  136. package/templates/vue-tailwind/src/App.vue +142 -0
  137. package/templates/vue-tailwind/src/index.css +7 -0
  138. package/templates/vue-tailwind/src/kora-worker.ts +9 -0
  139. package/templates/vue-tailwind/src/main.ts +31 -0
  140. package/templates/vue-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  141. package/templates/vue-tailwind/src/modules/todos/todo.queries.ts +5 -0
  142. package/templates/vue-tailwind/src/modules/todos/todo.schema.ts +10 -0
  143. package/templates/vue-tailwind/src/modules/todos/useTodos.ts +32 -0
  144. package/templates/vue-tailwind/src/schema.ts +9 -0
  145. package/templates/vue-tailwind/src/vite-env.d.ts +17 -0
  146. package/templates/vue-tailwind/tsconfig.json.hbs +15 -0
  147. package/templates/vue-tailwind/vite.config.ts +70 -0
  148. package/templates/vue-tailwind-sync/.env.example +25 -0
  149. package/templates/vue-tailwind-sync/README.md.hbs +105 -0
  150. package/templates/vue-tailwind-sync/index.html.hbs +12 -0
  151. package/templates/vue-tailwind-sync/kora.config.ts +17 -0
  152. package/templates/vue-tailwind-sync/package.json.hbs +45 -0
  153. package/templates/vue-tailwind-sync/server.ts +90 -0
  154. package/templates/vue-tailwind-sync/src/App.vue +245 -0
  155. package/templates/vue-tailwind-sync/src/auth.ts +25 -0
  156. package/templates/vue-tailwind-sync/src/index.css +7 -0
  157. package/templates/vue-tailwind-sync/src/kora-worker.ts +9 -0
  158. package/templates/vue-tailwind-sync/src/main.ts +56 -0
  159. package/templates/vue-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
  160. package/templates/vue-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  161. package/templates/vue-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  162. package/templates/vue-tailwind-sync/src/modules/todos/useTodos.ts +32 -0
  163. package/templates/vue-tailwind-sync/src/schema.ts +9 -0
  164. package/templates/vue-tailwind-sync/src/vite-env.d.ts +26 -0
  165. package/templates/vue-tailwind-sync/tsconfig.json.hbs +15 -0
  166. package/templates/vue-tailwind-sync/vite.config.ts +80 -0
  167. package/dist/chunk-3WNFM3QB.js.map +0 -1
  168. package/dist/chunk-PSRM56B7.js.map +0 -1
  169. /package/dist/{chunk-SOTZIWIF.js.map → chunk-Q2FBCOQD.js.map} +0 -0
package/dist/bin.cjs CHANGED
@@ -830,6 +830,14 @@ var TEMPLATES = [
830
830
  "react-tailwind",
831
831
  "react-sync",
832
832
  "react-basic",
833
+ "vue-sync",
834
+ "vue-basic",
835
+ "vue-tailwind-sync",
836
+ "vue-tailwind",
837
+ "svelte-sync",
838
+ "svelte-basic",
839
+ "svelte-tailwind-sync",
840
+ "svelte-tailwind",
833
841
  "tauri-react"
834
842
  ];
835
843
 
@@ -976,6 +984,19 @@ async function findNearestAncestorWithEntry(startDir, entryName) {
976
984
  function determineTemplateFromSelections(input) {
977
985
  if (input.platform === "desktop-tauri") return "tauri-react";
978
986
  const shouldSync = input.sync && input.db !== "none";
987
+ if (input.framework === "vue") {
988
+ if (input.tailwind && shouldSync) return "vue-tailwind-sync";
989
+ if (input.tailwind && !shouldSync) return "vue-tailwind";
990
+ return shouldSync ? "vue-sync" : "vue-basic";
991
+ }
992
+ if (input.framework === "svelte") {
993
+ if (input.tailwind && shouldSync) return "svelte-tailwind-sync";
994
+ if (input.tailwind && !shouldSync) return "svelte-tailwind";
995
+ return shouldSync ? "svelte-sync" : "svelte-basic";
996
+ }
997
+ if (input.framework === "solid") {
998
+ throw new Error("Solid templates are not available yet. Use react, vue, or svelte.");
999
+ }
979
1000
  if (input.tailwind && shouldSync) return "react-tailwind-sync";
980
1001
  if (input.tailwind && !shouldSync) return "react-tailwind";
981
1002
  if (!input.tailwind && shouldSync) return "react-sync";
@@ -996,6 +1017,9 @@ function isDatabaseValue(value) {
996
1017
  function isDatabaseProviderValue(value) {
997
1018
  return value === "none" || value === "local" || value === "supabase" || value === "neon" || value === "railway" || value === "vercel-postgres" || value === "custom";
998
1019
  }
1020
+ function isSupportedWebFramework(framework) {
1021
+ return framework === "react" || framework === "vue" || framework === "svelte";
1022
+ }
999
1023
 
1000
1024
  // src/commands/create/preferences-flow.ts
1001
1025
  async function resolveCreatePreferencesFlow(params) {
@@ -1089,8 +1113,8 @@ async function resolveCreatePreferencesFlow(params) {
1089
1113
  } else if (!flags.useDefaults && !usedStoredPreferences) {
1090
1114
  effective.framework = await prompts.select("UI framework:", [
1091
1115
  { label: "React", value: "react" },
1092
- { label: "Vue (coming soon)", value: "vue", disabled: true },
1093
- { label: "Svelte (coming soon)", value: "svelte", disabled: true },
1116
+ { label: "Vue 3", value: "vue" },
1117
+ { label: "Svelte 5", value: "svelte" },
1094
1118
  { label: "Solid (coming soon)", value: "solid", disabled: true }
1095
1119
  ]);
1096
1120
  }
@@ -1155,6 +1179,7 @@ async function resolveCreatePreferencesFlow(params) {
1155
1179
  }
1156
1180
  const template = determineTemplateFromSelections({
1157
1181
  platform: effective.platform,
1182
+ framework: effective.framework,
1158
1183
  tailwind: effective.tailwind,
1159
1184
  sync: effective.sync,
1160
1185
  db: effective.db
@@ -1265,7 +1290,7 @@ async function applySyncProviderPreset(options) {
1265
1290
  await (0, import_promises5.writeFile)(readmePath, readmeTemplate, "utf-8");
1266
1291
  }
1267
1292
  function isSyncTemplate(template) {
1268
- return template === "react-sync" || template === "react-tailwind-sync" || template === "tauri-react";
1293
+ 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";
1269
1294
  }
1270
1295
  function getProviderDisplayName(provider) {
1271
1296
  switch (provider) {
@@ -1393,6 +1418,48 @@ function createCompatibilityLayerPlan(templateName) {
1393
1418
  authLayer
1394
1419
  ]
1395
1420
  };
1421
+ case "vue-sync":
1422
+ return {
1423
+ compatibilityTarget: templateName,
1424
+ layers: [{ category: "base", name: "vue-sync", sourceTemplate: "vue-sync" }]
1425
+ };
1426
+ case "vue-basic":
1427
+ return {
1428
+ compatibilityTarget: templateName,
1429
+ layers: [{ category: "base", name: "vue-basic", sourceTemplate: "vue-basic" }]
1430
+ };
1431
+ case "svelte-sync":
1432
+ return {
1433
+ compatibilityTarget: templateName,
1434
+ layers: [{ category: "base", name: "svelte-sync", sourceTemplate: "svelte-sync" }]
1435
+ };
1436
+ case "svelte-basic":
1437
+ return {
1438
+ compatibilityTarget: templateName,
1439
+ layers: [{ category: "base", name: "svelte-basic", sourceTemplate: "svelte-basic" }]
1440
+ };
1441
+ case "vue-tailwind-sync":
1442
+ return {
1443
+ compatibilityTarget: templateName,
1444
+ layers: [{ category: "base", name: "vue-tailwind-sync", sourceTemplate: "vue-tailwind-sync" }]
1445
+ };
1446
+ case "vue-tailwind":
1447
+ return {
1448
+ compatibilityTarget: templateName,
1449
+ layers: [{ category: "base", name: "vue-tailwind", sourceTemplate: "vue-tailwind" }]
1450
+ };
1451
+ case "svelte-tailwind-sync":
1452
+ return {
1453
+ compatibilityTarget: templateName,
1454
+ layers: [
1455
+ { category: "base", name: "svelte-tailwind-sync", sourceTemplate: "svelte-tailwind-sync" }
1456
+ ]
1457
+ };
1458
+ case "svelte-tailwind":
1459
+ return {
1460
+ compatibilityTarget: templateName,
1461
+ layers: [{ category: "base", name: "svelte-tailwind", sourceTemplate: "svelte-tailwind" }]
1462
+ };
1396
1463
  }
1397
1464
  }
1398
1465
  async function composeTemplateLayers(plan, targetDir, context) {
@@ -1455,7 +1522,7 @@ var createCommand = (0, import_citty3.defineCommand)({
1455
1522
  },
1456
1523
  template: {
1457
1524
  type: "string",
1458
- description: "Project template (react-tailwind-sync, react-tailwind, react-sync, react-basic, tauri-react)"
1525
+ description: "Project template (react-tailwind-sync, react-sync, vue-sync, svelte-sync, tauri-react, ...)"
1459
1526
  },
1460
1527
  pm: {
1461
1528
  type: "string",
@@ -1540,8 +1607,10 @@ var createCommand = (0, import_citty3.defineCommand)({
1540
1607
  prompts,
1541
1608
  store: preferenceStore
1542
1609
  });
1543
- if (selection.framework !== "react") {
1544
- logger.error(`Framework "${selection.framework}" is not available yet. Use "react".`);
1610
+ if (!isSupportedWebFramework(selection.framework)) {
1611
+ logger.error(
1612
+ `Framework "${selection.framework}" is not available yet. Use react, vue, or svelte.`
1613
+ );
1545
1614
  if (!useDefaults) {
1546
1615
  prompts.outro("Project creation aborted.");
1547
1616
  }
@@ -1686,7 +1755,7 @@ function isValidPackageManager(value) {
1686
1755
  return PACKAGE_MANAGERS.includes(value);
1687
1756
  }
1688
1757
  function isSyncTemplate2(template) {
1689
- return template === "react-sync" || template === "react-tailwind-sync" || template === "tauri-react";
1758
+ 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";
1690
1759
  }
1691
1760
  function formatDbProviderForLog(dbProvider) {
1692
1761
  switch (dbProvider) {