@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.
- package/dist/bin.cjs +76 -7
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +3 -3
- package/dist/{chunk-PSRM56B7.js → chunk-EEZNRI5W.js} +51 -6
- package/dist/chunk-EEZNRI5W.js.map +1 -0
- package/dist/{chunk-SOTZIWIF.js → chunk-Q2FBCOQD.js} +2 -2
- package/dist/{chunk-3WNFM3QB.js → chunk-VLTPEATY.js} +70 -4
- package/dist/chunk-VLTPEATY.js.map +1 -0
- package/dist/create.cjs +76 -7
- package/dist/create.cjs.map +1 -1
- package/dist/create.js +2 -2
- package/dist/index.cjs +65 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/package.json +6 -6
- package/templates/svelte-basic/.env.example +3 -0
- package/templates/svelte-basic/README.md.hbs +62 -0
- package/templates/svelte-basic/index.html.hbs +12 -0
- package/templates/svelte-basic/kora.config.ts +12 -0
- package/templates/svelte-basic/package.json.hbs +27 -0
- package/templates/svelte-basic/src/App.svelte +131 -0
- package/templates/svelte-basic/src/Root.svelte +14 -0
- package/templates/svelte-basic/src/index.css +287 -0
- package/templates/svelte-basic/src/kora-worker.ts +9 -0
- package/templates/svelte-basic/src/main.ts +16 -0
- package/templates/svelte-basic/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/svelte-basic/src/modules/todos/todo.queries.ts +5 -0
- package/templates/svelte-basic/src/modules/todos/todo.schema.ts +10 -0
- package/templates/svelte-basic/src/modules/todos/useTodos.ts +25 -0
- package/templates/svelte-basic/src/schema.ts +9 -0
- package/templates/svelte-basic/src/vite-env.d.ts +12 -0
- package/templates/svelte-basic/svelte.config.js +5 -0
- package/templates/svelte-basic/tsconfig.json.hbs +14 -0
- package/templates/svelte-basic/vite.config.ts +52 -0
- package/templates/svelte-sync/.env.example +25 -0
- package/templates/svelte-sync/README.md.hbs +105 -0
- package/templates/svelte-sync/index.html.hbs +12 -0
- package/templates/svelte-sync/kora.config.ts +17 -0
- package/templates/svelte-sync/package.json.hbs +43 -0
- package/templates/svelte-sync/server.ts +90 -0
- package/templates/svelte-sync/src/App.svelte +154 -0
- package/templates/svelte-sync/src/Root.svelte +22 -0
- package/templates/svelte-sync/src/auth.ts +25 -0
- package/templates/svelte-sync/src/index.css +339 -0
- package/templates/svelte-sync/src/kora-worker.ts +9 -0
- package/templates/svelte-sync/src/main.ts +32 -0
- package/templates/svelte-sync/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/svelte-sync/src/modules/todos/todo.queries.ts +5 -0
- package/templates/svelte-sync/src/modules/todos/todo.schema.ts +10 -0
- package/templates/svelte-sync/src/modules/todos/useTodos.ts +25 -0
- package/templates/svelte-sync/src/schema.ts +9 -0
- package/templates/svelte-sync/src/vite-env.d.ts +21 -0
- package/templates/svelte-sync/svelte.config.js +5 -0
- package/templates/svelte-sync/tsconfig.json.hbs +14 -0
- package/templates/svelte-sync/vite.config.ts +79 -0
- package/templates/svelte-tailwind/README.md.hbs +62 -0
- package/templates/svelte-tailwind/index.html.hbs +12 -0
- package/templates/svelte-tailwind/kora.config.ts +12 -0
- package/templates/svelte-tailwind/package.json.hbs +30 -0
- package/templates/svelte-tailwind/src/App.svelte +79 -0
- package/templates/svelte-tailwind/src/Root.svelte +14 -0
- package/templates/svelte-tailwind/src/index.css +7 -0
- package/templates/svelte-tailwind/src/kora-worker.ts +9 -0
- package/templates/svelte-tailwind/src/main.ts +16 -0
- package/templates/svelte-tailwind/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/svelte-tailwind/src/modules/todos/todo.queries.ts +5 -0
- package/templates/svelte-tailwind/src/modules/todos/todo.schema.ts +10 -0
- package/templates/svelte-tailwind/src/modules/todos/useTodos.ts +25 -0
- package/templates/svelte-tailwind/src/schema.ts +9 -0
- package/templates/svelte-tailwind/src/vite-env.d.ts +12 -0
- package/templates/svelte-tailwind/svelte.config.js +5 -0
- package/templates/svelte-tailwind/tsconfig.json.hbs +14 -0
- package/templates/svelte-tailwind/vite.config.ts +53 -0
- package/templates/svelte-tailwind-sync/.env.example +25 -0
- package/templates/svelte-tailwind-sync/README.md.hbs +105 -0
- package/templates/svelte-tailwind-sync/index.html.hbs +12 -0
- package/templates/svelte-tailwind-sync/kora.config.ts +17 -0
- package/templates/svelte-tailwind-sync/package.json.hbs +46 -0
- package/templates/svelte-tailwind-sync/server.ts +90 -0
- package/templates/svelte-tailwind-sync/src/App.svelte +196 -0
- package/templates/svelte-tailwind-sync/src/Root.svelte +26 -0
- package/templates/svelte-tailwind-sync/src/auth.ts +25 -0
- package/templates/svelte-tailwind-sync/src/index.css +7 -0
- package/templates/svelte-tailwind-sync/src/kora-worker.ts +9 -0
- package/templates/svelte-tailwind-sync/src/main.ts +32 -0
- package/templates/svelte-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/svelte-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
- package/templates/svelte-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
- package/templates/svelte-tailwind-sync/src/modules/todos/useTodos.ts +25 -0
- package/templates/svelte-tailwind-sync/src/schema.ts +9 -0
- package/templates/svelte-tailwind-sync/src/vite-env.d.ts +21 -0
- package/templates/svelte-tailwind-sync/svelte.config.js +5 -0
- package/templates/svelte-tailwind-sync/tsconfig.json.hbs +14 -0
- package/templates/svelte-tailwind-sync/vite.config.ts +80 -0
- package/templates/vue-basic/README.md.hbs +62 -0
- package/templates/vue-basic/index.html.hbs +12 -0
- package/templates/vue-basic/kora.config.ts +12 -0
- package/templates/vue-basic/package.json.hbs +26 -0
- package/templates/vue-basic/src/App.vue +117 -0
- package/templates/vue-basic/src/index.css +287 -0
- package/templates/vue-basic/src/kora-worker.ts +9 -0
- package/templates/vue-basic/src/main.ts +20 -0
- package/templates/vue-basic/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/vue-basic/src/modules/todos/todo.queries.ts +5 -0
- package/templates/vue-basic/src/modules/todos/todo.schema.ts +10 -0
- package/templates/vue-basic/src/modules/todos/useTodos.ts +32 -0
- package/templates/vue-basic/src/schema.ts +9 -0
- package/templates/vue-basic/src/vite-env.d.ts +17 -0
- package/templates/vue-basic/tsconfig.json.hbs +15 -0
- package/templates/vue-basic/vite.config.ts +69 -0
- package/templates/vue-sync/.env.example +25 -0
- package/templates/vue-sync/README.md.hbs +105 -0
- package/templates/vue-sync/index.html.hbs +12 -0
- package/templates/vue-sync/kora.config.ts +17 -0
- package/templates/vue-sync/package.json.hbs +42 -0
- package/templates/vue-sync/server.ts +90 -0
- package/templates/vue-sync/src/App.vue +135 -0
- package/templates/vue-sync/src/auth.ts +25 -0
- package/templates/vue-sync/src/index.css +339 -0
- package/templates/vue-sync/src/kora-worker.ts +9 -0
- package/templates/vue-sync/src/main.ts +43 -0
- package/templates/vue-sync/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/vue-sync/src/modules/todos/todo.queries.ts +5 -0
- package/templates/vue-sync/src/modules/todos/todo.schema.ts +10 -0
- package/templates/vue-sync/src/modules/todos/useTodos.ts +32 -0
- package/templates/vue-sync/src/schema.ts +9 -0
- package/templates/vue-sync/src/vite-env.d.ts +26 -0
- package/templates/vue-sync/tsconfig.json.hbs +15 -0
- package/templates/vue-sync/vite.config.ts +79 -0
- package/templates/vue-tailwind/README.md.hbs +62 -0
- package/templates/vue-tailwind/index.html.hbs +12 -0
- package/templates/vue-tailwind/kora.config.ts +12 -0
- package/templates/vue-tailwind/package.json.hbs +29 -0
- package/templates/vue-tailwind/src/App.vue +142 -0
- package/templates/vue-tailwind/src/index.css +7 -0
- package/templates/vue-tailwind/src/kora-worker.ts +9 -0
- package/templates/vue-tailwind/src/main.ts +31 -0
- package/templates/vue-tailwind/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/vue-tailwind/src/modules/todos/todo.queries.ts +5 -0
- package/templates/vue-tailwind/src/modules/todos/todo.schema.ts +10 -0
- package/templates/vue-tailwind/src/modules/todos/useTodos.ts +32 -0
- package/templates/vue-tailwind/src/schema.ts +9 -0
- package/templates/vue-tailwind/src/vite-env.d.ts +17 -0
- package/templates/vue-tailwind/tsconfig.json.hbs +15 -0
- package/templates/vue-tailwind/vite.config.ts +70 -0
- package/templates/vue-tailwind-sync/.env.example +25 -0
- package/templates/vue-tailwind-sync/README.md.hbs +105 -0
- package/templates/vue-tailwind-sync/index.html.hbs +12 -0
- package/templates/vue-tailwind-sync/kora.config.ts +17 -0
- package/templates/vue-tailwind-sync/package.json.hbs +45 -0
- package/templates/vue-tailwind-sync/server.ts +90 -0
- package/templates/vue-tailwind-sync/src/App.vue +245 -0
- package/templates/vue-tailwind-sync/src/auth.ts +25 -0
- package/templates/vue-tailwind-sync/src/index.css +7 -0
- package/templates/vue-tailwind-sync/src/kora-worker.ts +9 -0
- package/templates/vue-tailwind-sync/src/main.ts +56 -0
- package/templates/vue-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
- package/templates/vue-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
- package/templates/vue-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
- package/templates/vue-tailwind-sync/src/modules/todos/useTodos.ts +32 -0
- package/templates/vue-tailwind-sync/src/schema.ts +9 -0
- package/templates/vue-tailwind-sync/src/vite-env.d.ts +26 -0
- package/templates/vue-tailwind-sync/tsconfig.json.hbs +15 -0
- package/templates/vue-tailwind-sync/vite.config.ts +80 -0
- package/dist/chunk-3WNFM3QB.js.map +0 -1
- package/dist/chunk-PSRM56B7.js.map +0 -1
- /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
|
|
1093
|
-
{ label: "Svelte
|
|
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-
|
|
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
|
|
1544
|
-
logger.error(
|
|
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) {
|