@korajs/cli 0.5.0 → 1.0.0-beta.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/LICENSE +21 -0
- package/dist/bin.cjs +2656 -207
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +152 -96
- package/dist/bin.js.map +1 -1
- package/dist/chunk-5NI2FEQL.js +92 -0
- package/dist/chunk-5NI2FEQL.js.map +1 -0
- package/dist/chunk-6C4BHSRA.js +82 -0
- package/dist/chunk-6C4BHSRA.js.map +1 -0
- package/dist/{chunk-3WNFM3QB.js → chunk-B5YS4STN.js} +78 -99
- package/dist/chunk-B5YS4STN.js.map +1 -0
- package/dist/{chunk-PSRM56B7.js → chunk-BWTKRKNJ.js} +60 -7
- package/dist/chunk-BWTKRKNJ.js.map +1 -0
- package/dist/{chunk-SOTZIWIF.js → chunk-EOWLAAIV.js} +5 -3
- package/dist/{chunk-SOTZIWIF.js.map → chunk-EOWLAAIV.js.map} +1 -1
- package/dist/create.cjs +82 -7
- package/dist/create.cjs.map +1 -1
- package/dist/create.js +3 -2
- package/dist/create.js.map +1 -1
- 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 +3 -2
- package/dist/lab-manager-KUDII6BT.js +280 -0
- package/dist/lab-manager-KUDII6BT.js.map +1 -0
- package/dist/schema-loader-GGHECMTM.js +9 -0
- package/dist/schema-loader-GGHECMTM.js.map +1 -0
- package/dist/spectator-manager-E2LH2P54.js +142 -0
- package/dist/spectator-manager-E2LH2P54.js.map +1 -0
- package/dist/studio-server-NIFKZI4F.js +1738 -0
- package/dist/studio-server-NIFKZI4F.js.map +1 -0
- package/package.json +8 -6
- package/templates/react-basic/AGENTS.md +87 -0
- package/templates/react-sync/AGENTS.md +87 -0
- package/templates/react-sync/src/App.tsx +8 -0
- package/templates/react-sync/src/index.css +11 -0
- package/templates/react-tailwind/AGENTS.md +87 -0
- package/templates/react-tailwind-sync/AGENTS.md +87 -0
- package/templates/react-tailwind-sync/src/App.tsx +28 -0
- package/templates/svelte-basic/.env.example +3 -0
- package/templates/svelte-basic/AGENTS.md +76 -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 +127 -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/AGENTS.md +76 -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 +150 -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/AGENTS.md +76 -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 +75 -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/AGENTS.md +76 -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 +192 -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/tauri-react/AGENTS.md +91 -0
- package/templates/vue-basic/AGENTS.md +84 -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/AGENTS.md +84 -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 +47 -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/AGENTS.md +84 -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 +135 -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/AGENTS.md +84 -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/create.cjs
CHANGED
|
@@ -259,6 +259,14 @@ var TEMPLATES = [
|
|
|
259
259
|
"react-tailwind",
|
|
260
260
|
"react-sync",
|
|
261
261
|
"react-basic",
|
|
262
|
+
"vue-sync",
|
|
263
|
+
"vue-basic",
|
|
264
|
+
"vue-tailwind-sync",
|
|
265
|
+
"vue-tailwind",
|
|
266
|
+
"svelte-sync",
|
|
267
|
+
"svelte-basic",
|
|
268
|
+
"svelte-tailwind-sync",
|
|
269
|
+
"svelte-tailwind",
|
|
262
270
|
"tauri-react"
|
|
263
271
|
];
|
|
264
272
|
|
|
@@ -459,6 +467,19 @@ async function findNearestAncestorWithEntry(startDir, entryName) {
|
|
|
459
467
|
function determineTemplateFromSelections(input) {
|
|
460
468
|
if (input.platform === "desktop-tauri") return "tauri-react";
|
|
461
469
|
const shouldSync = input.sync && input.db !== "none";
|
|
470
|
+
if (input.framework === "vue") {
|
|
471
|
+
if (input.tailwind && shouldSync) return "vue-tailwind-sync";
|
|
472
|
+
if (input.tailwind && !shouldSync) return "vue-tailwind";
|
|
473
|
+
return shouldSync ? "vue-sync" : "vue-basic";
|
|
474
|
+
}
|
|
475
|
+
if (input.framework === "svelte") {
|
|
476
|
+
if (input.tailwind && shouldSync) return "svelte-tailwind-sync";
|
|
477
|
+
if (input.tailwind && !shouldSync) return "svelte-tailwind";
|
|
478
|
+
return shouldSync ? "svelte-sync" : "svelte-basic";
|
|
479
|
+
}
|
|
480
|
+
if (input.framework === "solid") {
|
|
481
|
+
throw new Error("Solid templates are not available yet. Use react, vue, or svelte.");
|
|
482
|
+
}
|
|
462
483
|
if (input.tailwind && shouldSync) return "react-tailwind-sync";
|
|
463
484
|
if (input.tailwind && !shouldSync) return "react-tailwind";
|
|
464
485
|
if (!input.tailwind && shouldSync) return "react-sync";
|
|
@@ -479,6 +500,9 @@ function isDatabaseValue(value) {
|
|
|
479
500
|
function isDatabaseProviderValue(value) {
|
|
480
501
|
return value === "none" || value === "local" || value === "supabase" || value === "neon" || value === "railway" || value === "vercel-postgres" || value === "custom";
|
|
481
502
|
}
|
|
503
|
+
function isSupportedWebFramework(framework) {
|
|
504
|
+
return framework === "react" || framework === "vue" || framework === "svelte";
|
|
505
|
+
}
|
|
482
506
|
|
|
483
507
|
// src/commands/create/preferences-flow.ts
|
|
484
508
|
async function resolveCreatePreferencesFlow(params) {
|
|
@@ -572,8 +596,8 @@ async function resolveCreatePreferencesFlow(params) {
|
|
|
572
596
|
} else if (!flags.useDefaults && !usedStoredPreferences) {
|
|
573
597
|
effective.framework = await prompts.select("UI framework:", [
|
|
574
598
|
{ label: "React", value: "react" },
|
|
575
|
-
{ label: "Vue
|
|
576
|
-
{ label: "Svelte
|
|
599
|
+
{ label: "Vue 3", value: "vue" },
|
|
600
|
+
{ label: "Svelte 5", value: "svelte" },
|
|
577
601
|
{ label: "Solid (coming soon)", value: "solid", disabled: true }
|
|
578
602
|
]);
|
|
579
603
|
}
|
|
@@ -638,6 +662,7 @@ async function resolveCreatePreferencesFlow(params) {
|
|
|
638
662
|
}
|
|
639
663
|
const template = determineTemplateFromSelections({
|
|
640
664
|
platform: effective.platform,
|
|
665
|
+
framework: effective.framework,
|
|
641
666
|
tailwind: effective.tailwind,
|
|
642
667
|
sync: effective.sync,
|
|
643
668
|
db: effective.db
|
|
@@ -748,7 +773,7 @@ async function applySyncProviderPreset(options) {
|
|
|
748
773
|
await (0, import_promises3.writeFile)(readmePath, readmeTemplate, "utf-8");
|
|
749
774
|
}
|
|
750
775
|
function isSyncTemplate(template) {
|
|
751
|
-
return template === "react-sync" || template === "react-tailwind-sync" || template === "tauri-react";
|
|
776
|
+
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";
|
|
752
777
|
}
|
|
753
778
|
function getProviderDisplayName(provider) {
|
|
754
779
|
switch (provider) {
|
|
@@ -876,6 +901,54 @@ function createCompatibilityLayerPlan(templateName) {
|
|
|
876
901
|
authLayer
|
|
877
902
|
]
|
|
878
903
|
};
|
|
904
|
+
case "vue-sync":
|
|
905
|
+
return {
|
|
906
|
+
compatibilityTarget: templateName,
|
|
907
|
+
layers: [{ category: "base", name: "vue-sync", sourceTemplate: "vue-sync" }]
|
|
908
|
+
};
|
|
909
|
+
case "vue-basic":
|
|
910
|
+
return {
|
|
911
|
+
compatibilityTarget: templateName,
|
|
912
|
+
layers: [{ category: "base", name: "vue-basic", sourceTemplate: "vue-basic" }]
|
|
913
|
+
};
|
|
914
|
+
case "svelte-sync":
|
|
915
|
+
return {
|
|
916
|
+
compatibilityTarget: templateName,
|
|
917
|
+
layers: [{ category: "base", name: "svelte-sync", sourceTemplate: "svelte-sync" }]
|
|
918
|
+
};
|
|
919
|
+
case "svelte-basic":
|
|
920
|
+
return {
|
|
921
|
+
compatibilityTarget: templateName,
|
|
922
|
+
layers: [{ category: "base", name: "svelte-basic", sourceTemplate: "svelte-basic" }]
|
|
923
|
+
};
|
|
924
|
+
case "vue-tailwind-sync":
|
|
925
|
+
return {
|
|
926
|
+
compatibilityTarget: templateName,
|
|
927
|
+
layers: [
|
|
928
|
+
{ category: "base", name: "vue-tailwind-sync", sourceTemplate: "vue-tailwind-sync" }
|
|
929
|
+
]
|
|
930
|
+
};
|
|
931
|
+
case "vue-tailwind":
|
|
932
|
+
return {
|
|
933
|
+
compatibilityTarget: templateName,
|
|
934
|
+
layers: [{ category: "base", name: "vue-tailwind", sourceTemplate: "vue-tailwind" }]
|
|
935
|
+
};
|
|
936
|
+
case "svelte-tailwind-sync":
|
|
937
|
+
return {
|
|
938
|
+
compatibilityTarget: templateName,
|
|
939
|
+
layers: [
|
|
940
|
+
{
|
|
941
|
+
category: "base",
|
|
942
|
+
name: "svelte-tailwind-sync",
|
|
943
|
+
sourceTemplate: "svelte-tailwind-sync"
|
|
944
|
+
}
|
|
945
|
+
]
|
|
946
|
+
};
|
|
947
|
+
case "svelte-tailwind":
|
|
948
|
+
return {
|
|
949
|
+
compatibilityTarget: templateName,
|
|
950
|
+
layers: [{ category: "base", name: "svelte-tailwind", sourceTemplate: "svelte-tailwind" }]
|
|
951
|
+
};
|
|
879
952
|
}
|
|
880
953
|
}
|
|
881
954
|
async function composeTemplateLayers(plan, targetDir, context) {
|
|
@@ -938,7 +1011,7 @@ var createCommand = (0, import_citty.defineCommand)({
|
|
|
938
1011
|
},
|
|
939
1012
|
template: {
|
|
940
1013
|
type: "string",
|
|
941
|
-
description: "Project template (react-tailwind-sync, react-
|
|
1014
|
+
description: "Project template (react-tailwind-sync, react-sync, vue-sync, svelte-sync, tauri-react, ...)"
|
|
942
1015
|
},
|
|
943
1016
|
pm: {
|
|
944
1017
|
type: "string",
|
|
@@ -1023,8 +1096,10 @@ var createCommand = (0, import_citty.defineCommand)({
|
|
|
1023
1096
|
prompts,
|
|
1024
1097
|
store: preferenceStore
|
|
1025
1098
|
});
|
|
1026
|
-
if (selection.framework
|
|
1027
|
-
logger.error(
|
|
1099
|
+
if (!isSupportedWebFramework(selection.framework)) {
|
|
1100
|
+
logger.error(
|
|
1101
|
+
`Framework "${selection.framework}" is not available yet. Use react, vue, or svelte.`
|
|
1102
|
+
);
|
|
1028
1103
|
if (!useDefaults) {
|
|
1029
1104
|
prompts.outro("Project creation aborted.");
|
|
1030
1105
|
}
|
|
@@ -1169,7 +1244,7 @@ function isValidPackageManager(value) {
|
|
|
1169
1244
|
return PACKAGE_MANAGERS.includes(value);
|
|
1170
1245
|
}
|
|
1171
1246
|
function isSyncTemplate2(template) {
|
|
1172
|
-
return template === "react-sync" || template === "react-tailwind-sync" || template === "tauri-react";
|
|
1247
|
+
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";
|
|
1173
1248
|
}
|
|
1174
1249
|
function formatDbProviderForLog(dbProvider) {
|
|
1175
1250
|
switch (dbProvider) {
|