@korajs/cli 0.6.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 +2582 -202
- 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-VLTPEATY.js → chunk-B5YS4STN.js} +9 -96
- package/dist/chunk-B5YS4STN.js.map +1 -0
- package/dist/{chunk-EEZNRI5W.js → chunk-BWTKRKNJ.js} +13 -5
- package/dist/{chunk-EEZNRI5W.js.map → chunk-BWTKRKNJ.js.map} +1 -1
- package/dist/{chunk-Q2FBCOQD.js → chunk-EOWLAAIV.js} +5 -3
- package/dist/{chunk-Q2FBCOQD.js.map → chunk-EOWLAAIV.js.map} +1 -1
- package/dist/create.cjs +8 -2
- package/dist/create.cjs.map +1 -1
- package/dist/create.js +3 -2
- package/dist/create.js.map +1 -1
- 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/AGENTS.md +76 -0
- package/templates/svelte-basic/src/App.svelte +27 -31
- package/templates/svelte-basic/src/Root.svelte +4 -4
- package/templates/svelte-basic/src/modules/todos/useTodos.ts +1 -1
- package/templates/svelte-basic/vite.config.ts +1 -1
- package/templates/svelte-sync/AGENTS.md +76 -0
- package/templates/svelte-sync/src/App.svelte +31 -35
- package/templates/svelte-sync/src/Root.svelte +6 -6
- package/templates/svelte-sync/src/modules/todos/useTodos.ts +1 -1
- package/templates/svelte-tailwind/AGENTS.md +76 -0
- package/templates/svelte-tailwind/src/App.svelte +17 -21
- package/templates/svelte-tailwind/src/Root.svelte +4 -4
- package/templates/svelte-tailwind/src/modules/todos/useTodos.ts +1 -1
- package/templates/svelte-tailwind/vite.config.ts +2 -2
- package/templates/svelte-tailwind-sync/AGENTS.md +76 -0
- package/templates/svelte-tailwind-sync/src/App.svelte +52 -56
- package/templates/svelte-tailwind-sync/src/Root.svelte +6 -6
- package/templates/svelte-tailwind-sync/src/modules/todos/useTodos.ts +1 -1
- package/templates/svelte-tailwind-sync/vite.config.ts +1 -1
- package/templates/tauri-react/AGENTS.md +91 -0
- package/templates/vue-basic/AGENTS.md +84 -0
- package/templates/vue-basic/src/modules/todos/useTodos.ts +1 -1
- package/templates/vue-sync/AGENTS.md +84 -0
- package/templates/vue-sync/src/main.ts +5 -1
- package/templates/vue-sync/src/modules/todos/useTodos.ts +1 -1
- package/templates/vue-tailwind/AGENTS.md +84 -0
- package/templates/vue-tailwind/src/App.vue +1 -8
- package/templates/vue-tailwind/src/modules/todos/useTodos.ts +1 -1
- package/templates/vue-tailwind-sync/AGENTS.md +84 -0
- package/templates/vue-tailwind-sync/src/modules/todos/useTodos.ts +1 -1
- package/dist/chunk-VLTPEATY.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/create/create-command.ts","../src/utils/package-manager.ts","../src/commands/create/environment-detection.ts","../src/templates/composer.ts","../src/commands/create/template-engine.ts"],"sourcesContent":["import { execSync } from 'node:child_process'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { defineCommand } from 'citty'\nimport { ProjectExistsError } from '../../errors'\nimport { PreferenceStore } from '../../prompts/preferences'\nimport { PromptCancelledError, createPromptClient } from '../../prompts/prompt-client'\nimport { PACKAGE_MANAGERS, TEMPLATES } from '../../types'\nimport type { PackageManager, TemplateName } from '../../types'\nimport { directoryExists } from '../../utils/fs-helpers'\nimport { createLogger } from '../../utils/logger'\nimport {\n\tdetectPackageManager,\n\tgetInstallCommand,\n\tgetRunDevCommand,\n} from '../../utils/package-manager'\nimport {\n\tapplyEditorWorkspacePreset,\n\tdetectEditorFromEnvironment,\n\tdetectGitContext,\n\tdetectMonorepoContext,\n\tresolveMonorepoTargetDirectory,\n} from './environment-detection'\nimport {\n\ttype CreateFlags,\n\tresolveCreatePreferencesFlow,\n\tsaveResolvedPreferences,\n\tshouldSavePreferences,\n} from './preferences-flow'\nimport { isSupportedWebFramework } from './options'\nimport { validateProjectName } from './project-name'\nimport { applySyncProviderPreset } from './sync-provider-preset'\nimport { scaffoldTemplate } from './template-engine'\n\n/**\n * The `create` command — scaffolds a new Kora project.\n * Used as `kora create <name>` or `create-kora-app <name>`.\n */\nexport const createCommand = defineCommand({\n\tmeta: {\n\t\tname: 'create',\n\t\tdescription: 'Create a new Kora application',\n\t},\n\targs: {\n\t\tname: {\n\t\t\ttype: 'positional',\n\t\t\tdescription: 'Project directory name',\n\t\t\trequired: false,\n\t\t},\n\t\tplatform: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Target platform (web, desktop-tauri)',\n\t\t},\n\t\ttemplate: {\n\t\t\ttype: 'string',\n\t\t\tdescription:\n\t\t\t\t'Project template (react-tailwind-sync, react-sync, vue-sync, svelte-sync, tauri-react, ...)',\n\t\t},\n\t\tpm: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Package manager (pnpm, npm, yarn, bun)',\n\t\t},\n\t\tframework: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'UI framework (react, vue, svelte, solid)',\n\t\t},\n\t\tdb: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Database backend for sync templates (sqlite, postgres)',\n\t\t},\n\t\t'db-provider': {\n\t\t\ttype: 'string',\n\t\t\tdescription:\n\t\t\t\t'Database provider for postgres (local, supabase, neon, railway, vercel-postgres, custom)',\n\t\t},\n\t\tauth: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Authentication mode (none, email-password, oauth)',\n\t\t},\n\t\t'skip-install': {\n\t\t\ttype: 'boolean',\n\t\t\tdescription: 'Skip installing dependencies',\n\t\t\tdefault: false,\n\t\t},\n\t\tyes: {\n\t\t\ttype: 'boolean',\n\t\t\talias: 'y',\n\t\t\tdescription: 'Accept all defaults (react-tailwind-sync + detected package manager)',\n\t\t\tdefault: false,\n\t\t},\n\t\ttailwind: {\n\t\t\ttype: 'boolean',\n\t\t\tdescription: 'Use Tailwind CSS (use --no-tailwind to skip)',\n\t\t},\n\t\tsync: {\n\t\t\ttype: 'boolean',\n\t\t\tdescription: 'Include sync server (use --no-sync to skip)',\n\t\t},\n\t},\n\tasync run({ args }) {\n\t\tconst logger = createLogger()\n\t\tconst prompts = createPromptClient()\n\t\tconst preferenceStore = new PreferenceStore()\n\t\tlogger.banner()\n\t\ttry {\n\t\t\tconst useDefaults = args.yes === true\n\t\t\tif (!useDefaults) {\n\t\t\t\tprompts.intro('Kora.js — Offline-first application framework')\n\t\t\t}\n\n\t\t\t// Resolve project name\n\t\t\tconst projectName =\n\t\t\t\targs.name ||\n\t\t\t\t(useDefaults ? 'my-kora-app' : await prompts.text('Project name', 'my-kora-app'))\n\t\t\tif (!projectName) {\n\t\t\t\tlogger.error('Project name is required')\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst nameValidation = validateProjectName(projectName)\n\t\t\tif (!nameValidation.valid) {\n\t\t\t\tlogger.error('Invalid project name.')\n\t\t\t\tfor (const issue of nameValidation.issues) {\n\t\t\t\t\tlogger.step(`- ${issue}`)\n\t\t\t\t}\n\t\t\t\tif (!useDefaults) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst preferenceFlags: CreateFlags = {\n\t\t\t\tplatform: typeof args.platform === 'string' ? args.platform : undefined,\n\t\t\t\tframework: typeof args.framework === 'string' ? args.framework : undefined,\n\t\t\t\tauth: typeof args.auth === 'string' ? args.auth : undefined,\n\t\t\t\tdb: typeof args.db === 'string' ? args.db : undefined,\n\t\t\t\tdbProvider: typeof args['db-provider'] === 'string' ? args['db-provider'] : undefined,\n\t\t\t\ttailwind: args.tailwind,\n\t\t\t\tsync: args.sync,\n\t\t\t\tuseDefaults,\n\t\t\t}\n\n\t\t\tconst selection = await resolveCreatePreferencesFlow({\n\t\t\t\tflags: preferenceFlags,\n\t\t\t\tprompts,\n\t\t\t\tstore: preferenceStore,\n\t\t\t})\n\t\t\tif (!isSupportedWebFramework(selection.framework)) {\n\t\t\t\tlogger.error(\n\t\t\t\t\t`Framework \"${selection.framework}\" is not available yet. Use react, vue, or svelte.`,\n\t\t\t\t)\n\t\t\t\tif (!useDefaults) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (selection.auth !== 'none') {\n\t\t\t\tlogger.error(`Auth mode \"${selection.auth}\" is not available yet. Use \"none\".`)\n\t\t\t\tif (!useDefaults) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Resolve template (explicit --template still overrides all selections).\n\t\t\tconst template: TemplateName =\n\t\t\t\targs.template && isValidTemplate(args.template) ? args.template : selection.template\n\n\t\t\t// Resolve package manager\n\t\t\tlet pm: PackageManager\n\t\t\tif (args.pm && isValidPackageManager(args.pm)) {\n\t\t\t\tpm = args.pm\n\t\t\t} else if (useDefaults) {\n\t\t\t\tpm = detectPackageManager()\n\t\t\t} else if (selection.usedStoredPreferences) {\n\t\t\t\tpm = preferenceStore.getCreatePreferences()?.packageManager ?? detectPackageManager()\n\t\t\t} else {\n\t\t\t\tconst detected = detectPackageManager()\n\t\t\t\tpm = await prompts.select(\n\t\t\t\t\t'Package manager:',\n\t\t\t\t\tPACKAGE_MANAGERS.map((p) => ({\n\t\t\t\t\t\tlabel: p === detected ? `${p} (detected)` : p,\n\t\t\t\t\t\tvalue: p,\n\t\t\t\t\t})),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst editorDetection = detectEditorFromEnvironment()\n\t\t\tconst gitContext = await detectGitContext(process.cwd())\n\t\t\tconst monorepoContext = await detectMonorepoContext(process.cwd())\n\n\t\t\tlet targetDir = resolve(process.cwd(), projectName)\n\t\t\tif (!useDefaults && monorepoContext.isMonorepo && monorepoContext.root !== null) {\n\t\t\t\tconst useWorkspaceTarget = await prompts.confirm(\n\t\t\t\t\t`Detected ${formatMonorepoKind(monorepoContext.kind)} at ${monorepoContext.root}. Create app under packages/${projectName}?`,\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t\tif (useWorkspaceTarget) {\n\t\t\t\t\ttargetDir = resolveMonorepoTargetDirectory(monorepoContext.root, projectName)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate target directory\n\t\t\tif (await directoryExists(targetDir)) {\n\t\t\t\tthrow new ProjectExistsError(projectName)\n\t\t\t}\n\n\t\t\t// Resolve kora version from this package's own package.json\n\t\t\tconst koraVersion = resolveKoraVersion()\n\n\t\t\t// Scaffold\n\t\t\tlogger.step(`Creating ${projectName} with ${template} template...`)\n\t\t\tawait scaffoldTemplate(template, targetDir, {\n\t\t\t\tprojectName,\n\t\t\t\tpackageManager: pm,\n\t\t\t\tkoraVersion,\n\t\t\t\tdbProvider: selection.dbProvider,\n\t\t\t})\n\t\t\tawait applySyncProviderPreset({\n\t\t\t\ttargetDir,\n\t\t\t\ttemplate,\n\t\t\t\tdb: selection.db,\n\t\t\t\tdbProvider: selection.dbProvider,\n\t\t\t})\n\t\t\tif (!useDefaults && editorDetection.editor !== 'unknown') {\n\t\t\t\tconst shouldApplyEditorPreset = await prompts.confirm(\n\t\t\t\t\t`Detected ${formatEditor(editorDetection.editor)}. Add workspace recommendations for ${formatEditor(editorDetection.editor)}?`,\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t\tif (shouldApplyEditorPreset) {\n\t\t\t\t\tconst appliedPreset = await applyEditorWorkspacePreset({\n\t\t\t\t\t\ttargetDir,\n\t\t\t\t\t\teditor: editorDetection.editor,\n\t\t\t\t\t})\n\t\t\t\t\tif (appliedPreset.applied) {\n\t\t\t\t\t\tlogger.step(\n\t\t\t\t\t\t\t`Added editor recommendations at ${relativeToTarget(targetDir, appliedPreset.filePath)}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selection.db === 'postgres' && isSyncTemplate(template)) {\n\t\t\t\tlogger.info(\n\t\t\t\t\t`Applied PostgreSQL sync preset (${formatDbProviderForLog(selection.dbProvider)}). Update DATABASE_URL in .env.example before running the sync server.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (gitContext.hasRepository) {\n\t\t\t\tlogger.step(\n\t\t\t\t\t`Detected existing git repository at ${gitContext.repositoryRoot}. Skipping git initialization.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tlogger.success('Project scaffolded')\n\n\t\t\tif (shouldSavePreferences(preferenceFlags)) {\n\t\t\t\tsaveResolvedPreferences(preferenceStore, {\n\t\t\t\t\tplatform: selection.platform,\n\t\t\t\t\tframework: selection.framework,\n\t\t\t\t\tauth: selection.auth,\n\t\t\t\t\tdb: selection.db,\n\t\t\t\t\tdbProvider: selection.dbProvider,\n\t\t\t\t\ttailwind: selection.tailwind,\n\t\t\t\t\tsync: selection.sync,\n\t\t\t\t\tpackageManager: pm,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// Install dependencies\n\t\t\tif (!args['skip-install']) {\n\t\t\t\tlogger.step('Installing dependencies...')\n\t\t\t\ttry {\n\t\t\t\t\texecSync(getInstallCommand(pm), { cwd: targetDir, stdio: 'inherit' })\n\t\t\t\t\tlogger.success('Dependencies installed')\n\t\t\t\t} catch {\n\t\t\t\t\tlogger.warn('Failed to install dependencies. Run install manually.')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print next steps\n\t\t\tlogger.blank()\n\t\t\tlogger.info('Done! Next steps:')\n\t\t\tlogger.blank()\n\t\t\tlogger.step(` cd ${targetDir}`)\n\t\t\tlogger.step(` ${getRunDevCommand(pm)}`)\n\t\t\tlogger.blank()\n\t\t\tif (!useDefaults) {\n\t\t\t\tprompts.outro('Project ready. Happy building with Kora!')\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof PromptCancelledError) {\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (error instanceof Error && error.message.startsWith('Invalid --')) {\n\t\t\t\tlogger.error(error.message)\n\t\t\t\tif (!args.yes) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\t},\n})\n\nfunction isValidTemplate(value: string): value is TemplateName {\n\treturn (TEMPLATES as readonly string[]).includes(value)\n}\n\nfunction isValidPackageManager(value: string): value is PackageManager {\n\treturn (PACKAGE_MANAGERS as readonly string[]).includes(value)\n}\n\nfunction isSyncTemplate(template: TemplateName): boolean {\n\treturn (\n\t\ttemplate === 'react-sync' ||\n\t\ttemplate === 'react-tailwind-sync' ||\n\t\ttemplate === 'vue-sync' ||\n\t\ttemplate === 'vue-tailwind-sync' ||\n\t\ttemplate === 'svelte-sync' ||\n\t\ttemplate === 'svelte-tailwind-sync' ||\n\t\ttemplate === 'tauri-react'\n\t)\n}\n\nfunction formatDbProviderForLog(dbProvider: string): string {\n\tswitch (dbProvider) {\n\t\tcase 'supabase':\n\t\t\treturn 'Supabase'\n\t\tcase 'neon':\n\t\t\treturn 'Neon'\n\t\tcase 'railway':\n\t\t\treturn 'Railway'\n\t\tcase 'vercel-postgres':\n\t\t\treturn 'Vercel Postgres'\n\t\tcase 'custom':\n\t\t\treturn 'Custom'\n\t\tcase 'local':\n\t\t\treturn 'Local Postgres'\n\t\tcase 'none':\n\t\t\treturn 'PostgreSQL'\n\t\tdefault:\n\t\t\treturn dbProvider\n\t}\n}\n\nfunction formatEditor(editor: string): string {\n\tswitch (editor) {\n\t\tcase 'vscode':\n\t\t\treturn 'VS Code'\n\t\tcase 'cursor':\n\t\t\treturn 'Cursor'\n\t\tcase 'windsurf':\n\t\t\treturn 'Windsurf'\n\t\tcase 'zed':\n\t\t\treturn 'Zed'\n\t\tdefault:\n\t\t\treturn editor\n\t}\n}\n\nfunction formatMonorepoKind(kind: string): string {\n\tswitch (kind) {\n\t\tcase 'pnpm-workspace':\n\t\t\treturn 'pnpm workspace'\n\t\tcase 'npm-workspaces':\n\t\t\treturn 'npm workspace'\n\t\tcase 'turborepo':\n\t\t\treturn 'Turborepo'\n\t\tdefault:\n\t\t\treturn 'monorepo'\n\t}\n}\n\nfunction relativeToTarget(targetDir: string, filePath: string | null): string {\n\tif (filePath === null) return '.'\n\tconst normalizedTarget = targetDir.endsWith('/') ? targetDir : `${targetDir}/`\n\tif (filePath.startsWith(normalizedTarget)) {\n\t\treturn filePath.slice(normalizedTarget.length)\n\t}\n\tif (filePath === targetDir) {\n\t\treturn '.'\n\t}\n\treturn filePath\n}\n\n/**\n * Reads the version from @korajs/cli's own package.json and derives a\n * compatible version range for all @korajs packages.\n *\n * The CLI may be a patch ahead of other packages (e.g. CLI-only fixes),\n * so we use the major.minor range (^major.minor.0) which matches all\n * packages in the same release series.\n */\nfunction resolveKoraVersion(): string {\n\ttry {\n\t\tlet dir = dirname(fileURLToPath(import.meta.url))\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tconst pkgPath = resolve(dir, 'package.json')\n\t\t\tif (existsSync(pkgPath)) {\n\t\t\t\tconst pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')) as { name?: string; version: string }\n\t\t\t\tif (pkg.name === '@korajs/cli') {\n\t\t\t\t\tif (pkg.version === '0.0.0') return 'latest'\n\t\t\t\t\t// Use ^major.minor.0 so all packages in the series match\n\t\t\t\t\tconst parts = pkg.version.split('.')\n\t\t\t\t\treturn `^${parts[0]}.${parts[1]}.0`\n\t\t\t\t}\n\t\t\t}\n\t\t\tdir = dirname(dir)\n\t\t}\n\t\treturn 'latest'\n\t} catch {\n\t\treturn 'latest'\n\t}\n}\n","import { execSync } from 'node:child_process'\nimport type { PackageManager } from '../types'\n\n/**\n * Detects the package manager used to invoke the current process\n * by reading the npm_config_user_agent environment variable.\n * Falls back to 'npm' if detection fails.\n */\nexport function detectPackageManager(): PackageManager {\n\tconst userAgent = process.env.npm_config_user_agent\n\tif (!userAgent) return 'npm'\n\n\tif (userAgent.startsWith('pnpm/')) return 'pnpm'\n\tif (userAgent.startsWith('yarn/')) return 'yarn'\n\tif (userAgent.startsWith('bun/')) return 'bun'\n\treturn 'npm'\n}\n\n/** Returns the install command for the given package manager */\nexport function getInstallCommand(pm: PackageManager): string {\n\treturn pm === 'yarn' ? 'yarn' : `${pm} install`\n}\n\n/** Returns the dev server run command for the given package manager */\nexport function getRunDevCommand(pm: PackageManager): string {\n\tif (pm === 'npm') return 'npm run dev'\n\treturn `${pm} dev`\n}\n\n/** Checks if a package manager is available on PATH */\nexport function isPackageManagerAvailable(pm: PackageManager): boolean {\n\ttry {\n\t\texecSync(`${pm} --version`, { stdio: 'ignore' })\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n","import { access, mkdir, readFile, stat, writeFile } from 'node:fs/promises'\nimport { dirname, join, resolve } from 'node:path'\n\nexport type SupportedEditor = 'vscode' | 'cursor' | 'windsurf' | 'zed' | 'unknown'\n\nexport interface EditorDetectionResult {\n\teditor: SupportedEditor\n\tsource: 'env' | 'none'\n}\n\nexport interface GitContextResult {\n\thasRepository: boolean\n\trepositoryRoot: string | null\n}\n\nexport interface MonorepoContextResult {\n\tisMonorepo: boolean\n\troot: string | null\n\tkind: 'pnpm-workspace' | 'npm-workspaces' | 'turborepo' | 'none'\n}\n\nexport interface EditorWorkspacePresetResult {\n\tapplied: boolean\n\tfilePath: string | null\n}\n\n/**\n * Detects which editor is most likely being used by inspecting environment\n * variables commonly set by integrated terminals.\n */\nexport function detectEditorFromEnvironment(\n\tenv: Record<string, string | undefined> = process.env,\n): EditorDetectionResult {\n\tconst termProgram = String(env.TERM_PROGRAM ?? '').toLowerCase()\n\tconst editorValue = `${String(env.EDITOR ?? '')} ${String(env.VISUAL ?? '')}`.toLowerCase()\n\n\tif (\n\t\ttermProgram.includes('cursor') ||\n\t\tenv.CURSOR_TRACE_ID !== undefined ||\n\t\tenv.CURSOR_SESSION_ID !== undefined ||\n\t\teditorValue.includes('cursor')\n\t) {\n\t\treturn { editor: 'cursor', source: 'env' }\n\t}\n\tif (\n\t\ttermProgram.includes('windsurf') ||\n\t\tenv.WINDSURF_SESSION_ID !== undefined ||\n\t\teditorValue.includes('windsurf')\n\t) {\n\t\treturn { editor: 'windsurf', source: 'env' }\n\t}\n\tif (\n\t\ttermProgram.includes('vscode') ||\n\t\tenv.VSCODE_GIT_IPC_HANDLE !== undefined ||\n\t\tenv.VSCODE_IPC_HOOK !== undefined ||\n\t\tenv.VSCODE_PID !== undefined ||\n\t\teditorValue.includes('code')\n\t) {\n\t\treturn { editor: 'vscode', source: 'env' }\n\t}\n\tif (termProgram.includes('zed') || env.ZED_TERM !== undefined || editorValue.includes('zed')) {\n\t\treturn { editor: 'zed', source: 'env' }\n\t}\n\treturn { editor: 'unknown', source: 'none' }\n}\n\n/**\n * Finds the nearest ancestor directory that contains a `.git` entry.\n */\nexport async function detectGitContext(startDir: string): Promise<GitContextResult> {\n\tconst root = await findNearestAncestorWithEntry(startDir, '.git')\n\treturn {\n\t\thasRepository: root !== null,\n\t\trepositoryRoot: root,\n\t}\n}\n\n/**\n * Detects whether the given path is inside a monorepo workspace.\n * Detection currently supports pnpm workspaces, npm workspaces, and Turborepo.\n */\nexport async function detectMonorepoContext(startDir: string): Promise<MonorepoContextResult> {\n\tlet current = resolve(startDir)\n\tfor (;;) {\n\t\tif (await fileExists(join(current, 'pnpm-workspace.yaml'))) {\n\t\t\treturn { isMonorepo: true, root: current, kind: 'pnpm-workspace' }\n\t\t}\n\n\t\tif (await fileExists(join(current, 'turbo.json'))) {\n\t\t\treturn { isMonorepo: true, root: current, kind: 'turborepo' }\n\t\t}\n\n\t\tconst packageJsonPath = join(current, 'package.json')\n\t\tif (await fileExists(packageJsonPath)) {\n\t\t\ttry {\n\t\t\t\tconst packageJsonRaw = await readFile(packageJsonPath, 'utf-8')\n\t\t\t\tconst parsed = JSON.parse(packageJsonRaw) as { workspaces?: unknown }\n\t\t\t\tif (Array.isArray(parsed.workspaces) || isNpmWorkspaceObject(parsed.workspaces)) {\n\t\t\t\t\treturn { isMonorepo: true, root: current, kind: 'npm-workspaces' }\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Ignore malformed package.json and keep walking upward.\n\t\t\t}\n\t\t}\n\n\t\tconst parent = dirname(current)\n\t\tif (parent === current) {\n\t\t\treturn { isMonorepo: false, root: null, kind: 'none' }\n\t\t}\n\t\tcurrent = parent\n\t}\n}\n\n/**\n * Applies editor-specific workspace configuration. For VS Code-compatible\n * editors this creates or updates `.vscode/extensions.json` recommendations.\n */\nexport async function applyEditorWorkspacePreset(params: {\n\ttargetDir: string\n\teditor: SupportedEditor\n}): Promise<EditorWorkspacePresetResult> {\n\tconst { targetDir, editor } = params\n\tif (editor !== 'vscode' && editor !== 'cursor' && editor !== 'windsurf') {\n\t\treturn { applied: false, filePath: null }\n\t}\n\n\tconst vscodeDir = join(targetDir, '.vscode')\n\tconst extensionsPath = join(vscodeDir, 'extensions.json')\n\tawait mkdir(vscodeDir, { recursive: true })\n\n\tconst recommendations = ['korajs.kora-devtools']\n\tconst existing = await readJsonObject(extensionsPath)\n\tconst existingRecommendations = Array.isArray(existing?.recommendations)\n\t\t? existing.recommendations.filter((item): item is string => typeof item === 'string')\n\t\t: []\n\tconst mergedRecommendations = dedupeStrings([...existingRecommendations, ...recommendations])\n\n\tconst next = {\n\t\trecommendations: mergedRecommendations,\n\t}\n\tawait writeFile(extensionsPath, `${JSON.stringify(next, null, 2)}\\n`, 'utf-8')\n\treturn { applied: true, filePath: extensionsPath }\n}\n\n/**\n * Returns a workspace-aware target directory under the detected monorepo root.\n * This keeps generated apps in conventional package folders.\n */\nexport function resolveMonorepoTargetDirectory(monorepoRoot: string, projectName: string): string {\n\treturn join(monorepoRoot, 'packages', projectName)\n}\n\nfunction dedupeStrings(values: readonly string[]): string[] {\n\treturn Array.from(new Set(values))\n}\n\nasync function readJsonObject(path: string): Promise<Record<string, unknown> | null> {\n\ttry {\n\t\tconst content = await readFile(path, 'utf-8')\n\t\tconst parsed: unknown = JSON.parse(content)\n\t\tif (typeof parsed === 'object' && parsed !== null) {\n\t\t\treturn parsed as Record<string, unknown>\n\t\t}\n\t\treturn null\n\t} catch {\n\t\treturn null\n\t}\n}\n\nfunction isNpmWorkspaceObject(value: unknown): value is { packages: unknown } {\n\tif (typeof value !== 'object' || value === null) return false\n\tconst record = value as Record<string, unknown>\n\treturn Array.isArray(record.packages)\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path)\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n\nasync function findNearestAncestorWithEntry(\n\tstartDir: string,\n\tentryName: string,\n): Promise<string | null> {\n\tlet current = resolve(startDir)\n\tfor (;;) {\n\t\tconst candidate = join(current, entryName)\n\t\ttry {\n\t\t\tawait stat(candidate)\n\t\t\treturn current\n\t\t} catch {\n\t\t\t// keep walking upward\n\t\t}\n\t\tconst parent = dirname(current)\n\t\tif (parent === current) {\n\t\t\treturn null\n\t\t}\n\t\tcurrent = parent\n\t}\n}\n","import { existsSync } from 'node:fs'\nimport { copyFile, mkdir, readFile, readdir, stat, writeFile } from 'node:fs/promises'\nimport { dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { TemplateContext, TemplateName } from '../types'\n\nexport type TemplateLayerCategory = 'base' | 'ui' | 'style' | 'sync' | 'db' | 'auth'\n\nexport interface TemplateLayer {\n\tcategory: TemplateLayerCategory\n\tname: string\n\tsourceTemplate: TemplateName | null\n}\n\nexport interface TemplateLayerPlan {\n\tlayers: readonly TemplateLayer[]\n\tcompatibilityTarget: TemplateName\n}\n\n/**\n * Replaces {{variable}} placeholders in a template string with context values.\n *\n * @param template - The template string containing {{variable}} placeholders\n * @param context - Key-value pairs to substitute\n * @returns The template with all placeholders replaced\n */\nexport function substituteVariables(template: string, context: Record<string, string>): string {\n\treturn template.replace(/\\{\\{(\\w+)\\}\\}/g, (_match, key: string) => {\n\t\tconst value = context[key]\n\t\treturn value !== undefined ? value : `{{${key}}}`\n\t})\n}\n\n/**\n * Resolves the absolute path to a bundled template directory.\n *\n * After tsup bundling, import.meta.url points to dist/<file>.js (1 level from root).\n * In source, it's src/templates/composer.ts (2 levels from root).\n * We walk up from the current file to find the package root containing templates/.\n *\n * @param templateName - Name of the template (for example, 'react-basic')\n * @returns Absolute path to the template directory\n */\nexport function getTemplatePath(templateName: TemplateName): string {\n\tlet dir = dirname(fileURLToPath(import.meta.url))\n\tfor (let i = 0; i < 7; i++) {\n\t\tconst candidate = resolve(dir, 'templates', templateName)\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate\n\t\t}\n\t\tdir = dirname(dir)\n\t}\n\t// Fallback: assume bundled output and step to package root.\n\tconst currentDir = dirname(fileURLToPath(import.meta.url))\n\treturn resolve(currentDir, '..', '..', '..', 'templates', templateName)\n}\n\n/**\n * Returns a v1 compatibility layer plan that composes to one of the existing\n * four concrete templates. This establishes the layer architecture while\n * preserving byte-for-byte output compatibility for current templates.\n */\nexport function createCompatibilityLayerPlan(templateName: TemplateName): TemplateLayerPlan {\n\tconst baseLayer: TemplateLayer = { category: 'base', name: 'base', sourceTemplate: 'react-basic' }\n\tconst uiLayer: TemplateLayer = { category: 'ui', name: 'react', sourceTemplate: null }\n\tconst authLayer: TemplateLayer = { category: 'auth', name: 'none', sourceTemplate: null }\n\n\tswitch (templateName) {\n\t\tcase 'react-basic':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'plain', sourceTemplate: null },\n\t\t\t\t\t{ category: 'sync', name: 'disabled', sourceTemplate: null },\n\t\t\t\t\t{ category: 'db', name: 'none', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'react-tailwind':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'tailwind', sourceTemplate: 'react-tailwind' },\n\t\t\t\t\t{ category: 'sync', name: 'disabled', sourceTemplate: null },\n\t\t\t\t\t{ category: 'db', name: 'none', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'react-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'plain', sourceTemplate: null },\n\t\t\t\t\t{ category: 'sync', name: 'enabled', sourceTemplate: 'react-sync' },\n\t\t\t\t\t{ category: 'db', name: 'sqlite', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'react-tailwind-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'tailwind', sourceTemplate: 'react-tailwind' },\n\t\t\t\t\t{ category: 'sync', name: 'enabled', sourceTemplate: 'react-tailwind-sync' },\n\t\t\t\t\t{ category: 'db', name: 'sqlite', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'tauri-react':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\t{ category: 'base', name: 'tauri', sourceTemplate: 'tauri-react' },\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'plain', sourceTemplate: null },\n\t\t\t\t\t{ category: 'sync', name: 'enabled', sourceTemplate: null },\n\t\t\t\t\t{ category: 'db', name: 'tauri-sqlite', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'vue-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-sync', sourceTemplate: 'vue-sync' }],\n\t\t\t}\n\t\tcase 'vue-basic':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-basic', sourceTemplate: 'vue-basic' }],\n\t\t\t}\n\t\tcase 'svelte-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'svelte-sync', sourceTemplate: 'svelte-sync' }],\n\t\t\t}\n\t\tcase 'svelte-basic':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'svelte-basic', sourceTemplate: 'svelte-basic' }],\n\t\t\t}\n\t\tcase 'vue-tailwind-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-tailwind-sync', sourceTemplate: 'vue-tailwind-sync' }],\n\t\t\t}\n\t\tcase 'vue-tailwind':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-tailwind', sourceTemplate: 'vue-tailwind' }],\n\t\t\t}\n\t\tcase 'svelte-tailwind-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\t{ category: 'base', name: 'svelte-tailwind-sync', sourceTemplate: 'svelte-tailwind-sync' },\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'svelte-tailwind':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'svelte-tailwind', sourceTemplate: 'svelte-tailwind' }],\n\t\t\t}\n\t}\n}\n\n/**\n * Composes a project by applying template layers in order. Later layers\n * overwrite earlier files, which allows progressive specialization.\n *\n * @param plan - Layer plan describing the composition\n * @param targetDir - Destination directory (must not exist yet)\n * @param context - Variables for template substitution\n */\nexport async function composeTemplateLayers(\n\tplan: TemplateLayerPlan,\n\ttargetDir: string,\n\tcontext: TemplateContext,\n): Promise<void> {\n\tconst vars: Record<string, string> = {\n\t\tprojectName: context.projectName,\n\t\tpackageManager: context.packageManager,\n\t\tkoraVersion: context.koraVersion,\n\t\tdbProvider: context.dbProvider ?? 'none',\n\t}\n\n\tfor (const layer of plan.layers) {\n\t\tif (layer.sourceTemplate === null) {\n\t\t\tcontinue\n\t\t}\n\t\tconst sourceDir = getTemplatePath(layer.sourceTemplate)\n\t\tawait copyDirectory(sourceDir, targetDir, vars)\n\t}\n}\n\nasync function copyDirectory(\n\tsrc: string,\n\tdest: string,\n\tvars: Record<string, string>,\n): Promise<void> {\n\tawait mkdir(dest, { recursive: true })\n\tconst entries = await readdir(src)\n\n\tfor (const entry of entries) {\n\t\tconst srcPath = join(src, entry)\n\t\tconst srcStat = await stat(srcPath)\n\n\t\tif (srcStat.isDirectory()) {\n\t\t\tawait copyDirectory(srcPath, join(dest, entry), vars)\n\t\t\tcontinue\n\t\t}\n\t\tif (entry.endsWith('.hbs')) {\n\t\t\tconst content = await readFile(srcPath, 'utf-8')\n\t\t\tconst outputName = entry.slice(0, -4)\n\t\t\tawait writeFile(join(dest, outputName), substituteVariables(content, vars), 'utf-8')\n\t\t\tcontinue\n\t\t}\n\t\tawait copyFile(srcPath, join(dest, entry))\n\t}\n}\n","import { composeTemplateLayers, createCompatibilityLayerPlan } from '../../templates/composer'\nimport type { TemplateContext, TemplateName } from '../../types'\n\n/**\n * Replaces {{variable}} placeholders in a template string with context values.\n *\n * @param template - The template string containing {{variable}} placeholders\n * @param context - Key-value pairs to substitute\n * @returns The template with all placeholders replaced\n */\nexport { substituteVariables, getTemplatePath } from '../../templates/composer'\n\n/**\n * Scaffolds a project from a bundled template.\n * Copies all files from the template directory to the target, applying\n * variable substitution to .hbs files and stripping the .hbs extension.\n *\n * @param templateName - Which template to use\n * @param targetDir - Destination directory (must not exist yet)\n * @param context - Variables for template substitution\n */\nexport async function scaffoldTemplate(\n\ttemplateName: TemplateName,\n\ttargetDir: string,\n\tcontext: TemplateContext,\n): Promise<void> {\n\tconst plan = createCompatibilityLayerPlan(templateName)\n\tawait composeTemplateLayers(plan, targetDir, context)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAAA,iBAAgB;AACzB,SAAS,cAAAC,aAAY,oBAAoB;AACzC,SAAS,WAAAC,UAAS,WAAAC,gBAAe;AACjC,SAAS,iBAAAC,sBAAqB;AAC9B,SAAS,qBAAqB;;;ACJ9B,SAAS,gBAAgB;AAQlB,SAAS,uBAAuC;AACtD,QAA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ACD;","names":["execSync","existsSync","dirname","resolve","fileURLToPath","mkdir","readFile","stat","writeFile","dirname","join","resolve","resolve","execSync","dirname","fileURLToPath","existsSync"]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/create/create-command.ts","../src/utils/package-manager.ts","../src/commands/create/environment-detection.ts","../src/templates/composer.ts","../src/commands/create/template-engine.ts"],"sourcesContent":["import { execSync } from 'node:child_process'\nimport { existsSync, readFileSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { defineCommand } from 'citty'\nimport { ProjectExistsError } from '../../errors'\nimport { PreferenceStore } from '../../prompts/preferences'\nimport { PromptCancelledError, createPromptClient } from '../../prompts/prompt-client'\nimport { PACKAGE_MANAGERS, TEMPLATES } from '../../types'\nimport type { PackageManager, TemplateName } from '../../types'\nimport { directoryExists } from '../../utils/fs-helpers'\nimport { createLogger } from '../../utils/logger'\nimport {\n\tdetectPackageManager,\n\tgetInstallCommand,\n\tgetRunDevCommand,\n} from '../../utils/package-manager'\nimport {\n\tapplyEditorWorkspacePreset,\n\tdetectEditorFromEnvironment,\n\tdetectGitContext,\n\tdetectMonorepoContext,\n\tresolveMonorepoTargetDirectory,\n} from './environment-detection'\nimport { isSupportedWebFramework } from './options'\nimport {\n\ttype CreateFlags,\n\tresolveCreatePreferencesFlow,\n\tsaveResolvedPreferences,\n\tshouldSavePreferences,\n} from './preferences-flow'\nimport { validateProjectName } from './project-name'\nimport { applySyncProviderPreset } from './sync-provider-preset'\nimport { scaffoldTemplate } from './template-engine'\n\n/**\n * The `create` command — scaffolds a new Kora project.\n * Used as `kora create <name>` or `create-kora-app <name>`.\n */\nexport const createCommand = defineCommand({\n\tmeta: {\n\t\tname: 'create',\n\t\tdescription: 'Create a new Kora application',\n\t},\n\targs: {\n\t\tname: {\n\t\t\ttype: 'positional',\n\t\t\tdescription: 'Project directory name',\n\t\t\trequired: false,\n\t\t},\n\t\tplatform: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Target platform (web, desktop-tauri)',\n\t\t},\n\t\ttemplate: {\n\t\t\ttype: 'string',\n\t\t\tdescription:\n\t\t\t\t'Project template (react-tailwind-sync, react-sync, vue-sync, svelte-sync, tauri-react, ...)',\n\t\t},\n\t\tpm: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Package manager (pnpm, npm, yarn, bun)',\n\t\t},\n\t\tframework: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'UI framework (react, vue, svelte, solid)',\n\t\t},\n\t\tdb: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Database backend for sync templates (sqlite, postgres)',\n\t\t},\n\t\t'db-provider': {\n\t\t\ttype: 'string',\n\t\t\tdescription:\n\t\t\t\t'Database provider for postgres (local, supabase, neon, railway, vercel-postgres, custom)',\n\t\t},\n\t\tauth: {\n\t\t\ttype: 'string',\n\t\t\tdescription: 'Authentication mode (none, email-password, oauth)',\n\t\t},\n\t\t'skip-install': {\n\t\t\ttype: 'boolean',\n\t\t\tdescription: 'Skip installing dependencies',\n\t\t\tdefault: false,\n\t\t},\n\t\tyes: {\n\t\t\ttype: 'boolean',\n\t\t\talias: 'y',\n\t\t\tdescription: 'Accept all defaults (react-tailwind-sync + detected package manager)',\n\t\t\tdefault: false,\n\t\t},\n\t\ttailwind: {\n\t\t\ttype: 'boolean',\n\t\t\tdescription: 'Use Tailwind CSS (use --no-tailwind to skip)',\n\t\t},\n\t\tsync: {\n\t\t\ttype: 'boolean',\n\t\t\tdescription: 'Include sync server (use --no-sync to skip)',\n\t\t},\n\t},\n\tasync run({ args }) {\n\t\tconst logger = createLogger()\n\t\tconst prompts = createPromptClient()\n\t\tconst preferenceStore = new PreferenceStore()\n\t\tlogger.banner()\n\t\ttry {\n\t\t\tconst useDefaults = args.yes === true\n\t\t\tif (!useDefaults) {\n\t\t\t\tprompts.intro('Kora.js — Offline-first application framework')\n\t\t\t}\n\n\t\t\t// Resolve project name\n\t\t\tconst projectName =\n\t\t\t\targs.name ||\n\t\t\t\t(useDefaults ? 'my-kora-app' : await prompts.text('Project name', 'my-kora-app'))\n\t\t\tif (!projectName) {\n\t\t\t\tlogger.error('Project name is required')\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst nameValidation = validateProjectName(projectName)\n\t\t\tif (!nameValidation.valid) {\n\t\t\t\tlogger.error('Invalid project name.')\n\t\t\t\tfor (const issue of nameValidation.issues) {\n\t\t\t\t\tlogger.step(`- ${issue}`)\n\t\t\t\t}\n\t\t\t\tif (!useDefaults) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst preferenceFlags: CreateFlags = {\n\t\t\t\tplatform: typeof args.platform === 'string' ? args.platform : undefined,\n\t\t\t\tframework: typeof args.framework === 'string' ? args.framework : undefined,\n\t\t\t\tauth: typeof args.auth === 'string' ? args.auth : undefined,\n\t\t\t\tdb: typeof args.db === 'string' ? args.db : undefined,\n\t\t\t\tdbProvider: typeof args['db-provider'] === 'string' ? args['db-provider'] : undefined,\n\t\t\t\ttailwind: args.tailwind,\n\t\t\t\tsync: args.sync,\n\t\t\t\tuseDefaults,\n\t\t\t}\n\n\t\t\tconst selection = await resolveCreatePreferencesFlow({\n\t\t\t\tflags: preferenceFlags,\n\t\t\t\tprompts,\n\t\t\t\tstore: preferenceStore,\n\t\t\t})\n\t\t\tif (!isSupportedWebFramework(selection.framework)) {\n\t\t\t\tlogger.error(\n\t\t\t\t\t`Framework \"${selection.framework}\" is not available yet. Use react, vue, or svelte.`,\n\t\t\t\t)\n\t\t\t\tif (!useDefaults) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (selection.auth !== 'none') {\n\t\t\t\tlogger.error(`Auth mode \"${selection.auth}\" is not available yet. Use \"none\".`)\n\t\t\t\tif (!useDefaults) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Resolve template (explicit --template still overrides all selections).\n\t\t\tconst template: TemplateName =\n\t\t\t\targs.template && isValidTemplate(args.template) ? args.template : selection.template\n\n\t\t\t// Resolve package manager\n\t\t\tlet pm: PackageManager\n\t\t\tif (args.pm && isValidPackageManager(args.pm)) {\n\t\t\t\tpm = args.pm\n\t\t\t} else if (useDefaults) {\n\t\t\t\tpm = detectPackageManager()\n\t\t\t} else if (selection.usedStoredPreferences) {\n\t\t\t\tpm = preferenceStore.getCreatePreferences()?.packageManager ?? detectPackageManager()\n\t\t\t} else {\n\t\t\t\tconst detected = detectPackageManager()\n\t\t\t\tpm = await prompts.select(\n\t\t\t\t\t'Package manager:',\n\t\t\t\t\tPACKAGE_MANAGERS.map((p) => ({\n\t\t\t\t\t\tlabel: p === detected ? `${p} (detected)` : p,\n\t\t\t\t\t\tvalue: p,\n\t\t\t\t\t})),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tconst editorDetection = detectEditorFromEnvironment()\n\t\t\tconst gitContext = await detectGitContext(process.cwd())\n\t\t\tconst monorepoContext = await detectMonorepoContext(process.cwd())\n\n\t\t\tlet targetDir = resolve(process.cwd(), projectName)\n\t\t\tif (!useDefaults && monorepoContext.isMonorepo && monorepoContext.root !== null) {\n\t\t\t\tconst useWorkspaceTarget = await prompts.confirm(\n\t\t\t\t\t`Detected ${formatMonorepoKind(monorepoContext.kind)} at ${monorepoContext.root}. Create app under packages/${projectName}?`,\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t\tif (useWorkspaceTarget) {\n\t\t\t\t\ttargetDir = resolveMonorepoTargetDirectory(monorepoContext.root, projectName)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate target directory\n\t\t\tif (await directoryExists(targetDir)) {\n\t\t\t\tthrow new ProjectExistsError(projectName)\n\t\t\t}\n\n\t\t\t// Resolve kora version from this package's own package.json\n\t\t\tconst koraVersion = resolveKoraVersion()\n\n\t\t\t// Scaffold\n\t\t\tlogger.step(`Creating ${projectName} with ${template} template...`)\n\t\t\tawait scaffoldTemplate(template, targetDir, {\n\t\t\t\tprojectName,\n\t\t\t\tpackageManager: pm,\n\t\t\t\tkoraVersion,\n\t\t\t\tdbProvider: selection.dbProvider,\n\t\t\t})\n\t\t\tawait applySyncProviderPreset({\n\t\t\t\ttargetDir,\n\t\t\t\ttemplate,\n\t\t\t\tdb: selection.db,\n\t\t\t\tdbProvider: selection.dbProvider,\n\t\t\t})\n\t\t\tif (!useDefaults && editorDetection.editor !== 'unknown') {\n\t\t\t\tconst shouldApplyEditorPreset = await prompts.confirm(\n\t\t\t\t\t`Detected ${formatEditor(editorDetection.editor)}. Add workspace recommendations for ${formatEditor(editorDetection.editor)}?`,\n\t\t\t\t\ttrue,\n\t\t\t\t)\n\t\t\t\tif (shouldApplyEditorPreset) {\n\t\t\t\t\tconst appliedPreset = await applyEditorWorkspacePreset({\n\t\t\t\t\t\ttargetDir,\n\t\t\t\t\t\teditor: editorDetection.editor,\n\t\t\t\t\t})\n\t\t\t\t\tif (appliedPreset.applied) {\n\t\t\t\t\t\tlogger.step(\n\t\t\t\t\t\t\t`Added editor recommendations at ${relativeToTarget(targetDir, appliedPreset.filePath)}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selection.db === 'postgres' && isSyncTemplate(template)) {\n\t\t\t\tlogger.info(\n\t\t\t\t\t`Applied PostgreSQL sync preset (${formatDbProviderForLog(selection.dbProvider)}). Update DATABASE_URL in .env.example before running the sync server.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (gitContext.hasRepository) {\n\t\t\t\tlogger.step(\n\t\t\t\t\t`Detected existing git repository at ${gitContext.repositoryRoot}. Skipping git initialization.`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tlogger.success('Project scaffolded')\n\n\t\t\tif (shouldSavePreferences(preferenceFlags)) {\n\t\t\t\tsaveResolvedPreferences(preferenceStore, {\n\t\t\t\t\tplatform: selection.platform,\n\t\t\t\t\tframework: selection.framework,\n\t\t\t\t\tauth: selection.auth,\n\t\t\t\t\tdb: selection.db,\n\t\t\t\t\tdbProvider: selection.dbProvider,\n\t\t\t\t\ttailwind: selection.tailwind,\n\t\t\t\t\tsync: selection.sync,\n\t\t\t\t\tpackageManager: pm,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// Install dependencies\n\t\t\tif (!args['skip-install']) {\n\t\t\t\tlogger.step('Installing dependencies...')\n\t\t\t\ttry {\n\t\t\t\t\texecSync(getInstallCommand(pm), { cwd: targetDir, stdio: 'inherit' })\n\t\t\t\t\tlogger.success('Dependencies installed')\n\t\t\t\t} catch {\n\t\t\t\t\tlogger.warn('Failed to install dependencies. Run install manually.')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print next steps\n\t\t\tlogger.blank()\n\t\t\tlogger.info('Done! Next steps:')\n\t\t\tlogger.blank()\n\t\t\tlogger.step(` cd ${targetDir}`)\n\t\t\tlogger.step(` ${getRunDevCommand(pm)}`)\n\t\t\tlogger.blank()\n\t\t\tif (!useDefaults) {\n\t\t\t\tprompts.outro('Project ready. Happy building with Kora!')\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof PromptCancelledError) {\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (error instanceof Error && error.message.startsWith('Invalid --')) {\n\t\t\t\tlogger.error(error.message)\n\t\t\t\tif (!args.yes) {\n\t\t\t\t\tprompts.outro('Project creation aborted.')\n\t\t\t\t}\n\t\t\t\tprocess.exitCode = 1\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\t},\n})\n\nfunction isValidTemplate(value: string): value is TemplateName {\n\treturn (TEMPLATES as readonly string[]).includes(value)\n}\n\nfunction isValidPackageManager(value: string): value is PackageManager {\n\treturn (PACKAGE_MANAGERS as readonly string[]).includes(value)\n}\n\nfunction isSyncTemplate(template: TemplateName): boolean {\n\treturn (\n\t\ttemplate === 'react-sync' ||\n\t\ttemplate === 'react-tailwind-sync' ||\n\t\ttemplate === 'vue-sync' ||\n\t\ttemplate === 'vue-tailwind-sync' ||\n\t\ttemplate === 'svelte-sync' ||\n\t\ttemplate === 'svelte-tailwind-sync' ||\n\t\ttemplate === 'tauri-react'\n\t)\n}\n\nfunction formatDbProviderForLog(dbProvider: string): string {\n\tswitch (dbProvider) {\n\t\tcase 'supabase':\n\t\t\treturn 'Supabase'\n\t\tcase 'neon':\n\t\t\treturn 'Neon'\n\t\tcase 'railway':\n\t\t\treturn 'Railway'\n\t\tcase 'vercel-postgres':\n\t\t\treturn 'Vercel Postgres'\n\t\tcase 'custom':\n\t\t\treturn 'Custom'\n\t\tcase 'local':\n\t\t\treturn 'Local Postgres'\n\t\tcase 'none':\n\t\t\treturn 'PostgreSQL'\n\t\tdefault:\n\t\t\treturn dbProvider\n\t}\n}\n\nfunction formatEditor(editor: string): string {\n\tswitch (editor) {\n\t\tcase 'vscode':\n\t\t\treturn 'VS Code'\n\t\tcase 'cursor':\n\t\t\treturn 'Cursor'\n\t\tcase 'windsurf':\n\t\t\treturn 'Windsurf'\n\t\tcase 'zed':\n\t\t\treturn 'Zed'\n\t\tdefault:\n\t\t\treturn editor\n\t}\n}\n\nfunction formatMonorepoKind(kind: string): string {\n\tswitch (kind) {\n\t\tcase 'pnpm-workspace':\n\t\t\treturn 'pnpm workspace'\n\t\tcase 'npm-workspaces':\n\t\t\treturn 'npm workspace'\n\t\tcase 'turborepo':\n\t\t\treturn 'Turborepo'\n\t\tdefault:\n\t\t\treturn 'monorepo'\n\t}\n}\n\nfunction relativeToTarget(targetDir: string, filePath: string | null): string {\n\tif (filePath === null) return '.'\n\tconst normalizedTarget = targetDir.endsWith('/') ? targetDir : `${targetDir}/`\n\tif (filePath.startsWith(normalizedTarget)) {\n\t\treturn filePath.slice(normalizedTarget.length)\n\t}\n\tif (filePath === targetDir) {\n\t\treturn '.'\n\t}\n\treturn filePath\n}\n\n/**\n * Reads the version from @korajs/cli's own package.json and derives a\n * compatible version range for all @korajs packages.\n *\n * The CLI may be a patch ahead of other packages (e.g. CLI-only fixes),\n * so we use the major.minor range (^major.minor.0) which matches all\n * packages in the same release series.\n */\nfunction resolveKoraVersion(): string {\n\ttry {\n\t\tlet dir = dirname(fileURLToPath(import.meta.url))\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tconst pkgPath = resolve(dir, 'package.json')\n\t\t\tif (existsSync(pkgPath)) {\n\t\t\t\tconst pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')) as { name?: string; version: string }\n\t\t\t\tif (pkg.name === '@korajs/cli') {\n\t\t\t\t\tif (pkg.version === '0.0.0') return 'latest'\n\t\t\t\t\t// Use ^major.minor.0 so all packages in the series match\n\t\t\t\t\tconst parts = pkg.version.split('.')\n\t\t\t\t\treturn `^${parts[0]}.${parts[1]}.0`\n\t\t\t\t}\n\t\t\t}\n\t\t\tdir = dirname(dir)\n\t\t}\n\t\treturn 'latest'\n\t} catch {\n\t\treturn 'latest'\n\t}\n}\n","import { execSync } from 'node:child_process'\nimport type { PackageManager } from '../types'\n\n/**\n * Detects the package manager used to invoke the current process\n * by reading the npm_config_user_agent environment variable.\n * Falls back to 'npm' if detection fails.\n */\nexport function detectPackageManager(): PackageManager {\n\tconst userAgent = process.env.npm_config_user_agent\n\tif (!userAgent) return 'npm'\n\n\tif (userAgent.startsWith('pnpm/')) return 'pnpm'\n\tif (userAgent.startsWith('yarn/')) return 'yarn'\n\tif (userAgent.startsWith('bun/')) return 'bun'\n\treturn 'npm'\n}\n\n/** Returns the install command for the given package manager */\nexport function getInstallCommand(pm: PackageManager): string {\n\treturn pm === 'yarn' ? 'yarn' : `${pm} install`\n}\n\n/** Returns the dev server run command for the given package manager */\nexport function getRunDevCommand(pm: PackageManager): string {\n\tif (pm === 'npm') return 'npm run dev'\n\treturn `${pm} dev`\n}\n\n/** Checks if a package manager is available on PATH */\nexport function isPackageManagerAvailable(pm: PackageManager): boolean {\n\ttry {\n\t\texecSync(`${pm} --version`, { stdio: 'ignore' })\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n","import { access, mkdir, readFile, stat, writeFile } from 'node:fs/promises'\nimport { dirname, join, resolve } from 'node:path'\n\nexport type SupportedEditor = 'vscode' | 'cursor' | 'windsurf' | 'zed' | 'unknown'\n\nexport interface EditorDetectionResult {\n\teditor: SupportedEditor\n\tsource: 'env' | 'none'\n}\n\nexport interface GitContextResult {\n\thasRepository: boolean\n\trepositoryRoot: string | null\n}\n\nexport interface MonorepoContextResult {\n\tisMonorepo: boolean\n\troot: string | null\n\tkind: 'pnpm-workspace' | 'npm-workspaces' | 'turborepo' | 'none'\n}\n\nexport interface EditorWorkspacePresetResult {\n\tapplied: boolean\n\tfilePath: string | null\n}\n\n/**\n * Detects which editor is most likely being used by inspecting environment\n * variables commonly set by integrated terminals.\n */\nexport function detectEditorFromEnvironment(\n\tenv: Record<string, string | undefined> = process.env,\n): EditorDetectionResult {\n\tconst termProgram = String(env.TERM_PROGRAM ?? '').toLowerCase()\n\tconst editorValue = `${String(env.EDITOR ?? '')} ${String(env.VISUAL ?? '')}`.toLowerCase()\n\n\tif (\n\t\ttermProgram.includes('cursor') ||\n\t\tenv.CURSOR_TRACE_ID !== undefined ||\n\t\tenv.CURSOR_SESSION_ID !== undefined ||\n\t\teditorValue.includes('cursor')\n\t) {\n\t\treturn { editor: 'cursor', source: 'env' }\n\t}\n\tif (\n\t\ttermProgram.includes('windsurf') ||\n\t\tenv.WINDSURF_SESSION_ID !== undefined ||\n\t\teditorValue.includes('windsurf')\n\t) {\n\t\treturn { editor: 'windsurf', source: 'env' }\n\t}\n\tif (\n\t\ttermProgram.includes('vscode') ||\n\t\tenv.VSCODE_GIT_IPC_HANDLE !== undefined ||\n\t\tenv.VSCODE_IPC_HOOK !== undefined ||\n\t\tenv.VSCODE_PID !== undefined ||\n\t\teditorValue.includes('code')\n\t) {\n\t\treturn { editor: 'vscode', source: 'env' }\n\t}\n\tif (termProgram.includes('zed') || env.ZED_TERM !== undefined || editorValue.includes('zed')) {\n\t\treturn { editor: 'zed', source: 'env' }\n\t}\n\treturn { editor: 'unknown', source: 'none' }\n}\n\n/**\n * Finds the nearest ancestor directory that contains a `.git` entry.\n */\nexport async function detectGitContext(startDir: string): Promise<GitContextResult> {\n\tconst root = await findNearestAncestorWithEntry(startDir, '.git')\n\treturn {\n\t\thasRepository: root !== null,\n\t\trepositoryRoot: root,\n\t}\n}\n\n/**\n * Detects whether the given path is inside a monorepo workspace.\n * Detection currently supports pnpm workspaces, npm workspaces, and Turborepo.\n */\nexport async function detectMonorepoContext(startDir: string): Promise<MonorepoContextResult> {\n\tlet current = resolve(startDir)\n\tfor (;;) {\n\t\tif (await fileExists(join(current, 'pnpm-workspace.yaml'))) {\n\t\t\treturn { isMonorepo: true, root: current, kind: 'pnpm-workspace' }\n\t\t}\n\n\t\tif (await fileExists(join(current, 'turbo.json'))) {\n\t\t\treturn { isMonorepo: true, root: current, kind: 'turborepo' }\n\t\t}\n\n\t\tconst packageJsonPath = join(current, 'package.json')\n\t\tif (await fileExists(packageJsonPath)) {\n\t\t\ttry {\n\t\t\t\tconst packageJsonRaw = await readFile(packageJsonPath, 'utf-8')\n\t\t\t\tconst parsed = JSON.parse(packageJsonRaw) as { workspaces?: unknown }\n\t\t\t\tif (Array.isArray(parsed.workspaces) || isNpmWorkspaceObject(parsed.workspaces)) {\n\t\t\t\t\treturn { isMonorepo: true, root: current, kind: 'npm-workspaces' }\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Ignore malformed package.json and keep walking upward.\n\t\t\t}\n\t\t}\n\n\t\tconst parent = dirname(current)\n\t\tif (parent === current) {\n\t\t\treturn { isMonorepo: false, root: null, kind: 'none' }\n\t\t}\n\t\tcurrent = parent\n\t}\n}\n\n/**\n * Applies editor-specific workspace configuration. For VS Code-compatible\n * editors this creates or updates `.vscode/extensions.json` recommendations.\n */\nexport async function applyEditorWorkspacePreset(params: {\n\ttargetDir: string\n\teditor: SupportedEditor\n}): Promise<EditorWorkspacePresetResult> {\n\tconst { targetDir, editor } = params\n\tif (editor !== 'vscode' && editor !== 'cursor' && editor !== 'windsurf') {\n\t\treturn { applied: false, filePath: null }\n\t}\n\n\tconst vscodeDir = join(targetDir, '.vscode')\n\tconst extensionsPath = join(vscodeDir, 'extensions.json')\n\tawait mkdir(vscodeDir, { recursive: true })\n\n\tconst recommendations = ['korajs.kora-devtools']\n\tconst existing = await readJsonObject(extensionsPath)\n\tconst existingRecommendations = Array.isArray(existing?.recommendations)\n\t\t? existing.recommendations.filter((item): item is string => typeof item === 'string')\n\t\t: []\n\tconst mergedRecommendations = dedupeStrings([...existingRecommendations, ...recommendations])\n\n\tconst next = {\n\t\trecommendations: mergedRecommendations,\n\t}\n\tawait writeFile(extensionsPath, `${JSON.stringify(next, null, 2)}\\n`, 'utf-8')\n\treturn { applied: true, filePath: extensionsPath }\n}\n\n/**\n * Returns a workspace-aware target directory under the detected monorepo root.\n * This keeps generated apps in conventional package folders.\n */\nexport function resolveMonorepoTargetDirectory(monorepoRoot: string, projectName: string): string {\n\treturn join(monorepoRoot, 'packages', projectName)\n}\n\nfunction dedupeStrings(values: readonly string[]): string[] {\n\treturn Array.from(new Set(values))\n}\n\nasync function readJsonObject(path: string): Promise<Record<string, unknown> | null> {\n\ttry {\n\t\tconst content = await readFile(path, 'utf-8')\n\t\tconst parsed: unknown = JSON.parse(content)\n\t\tif (typeof parsed === 'object' && parsed !== null) {\n\t\t\treturn parsed as Record<string, unknown>\n\t\t}\n\t\treturn null\n\t} catch {\n\t\treturn null\n\t}\n}\n\nfunction isNpmWorkspaceObject(value: unknown): value is { packages: unknown } {\n\tif (typeof value !== 'object' || value === null) return false\n\tconst record = value as Record<string, unknown>\n\treturn Array.isArray(record.packages)\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n\ttry {\n\t\tawait access(path)\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n\nasync function findNearestAncestorWithEntry(\n\tstartDir: string,\n\tentryName: string,\n): Promise<string | null> {\n\tlet current = resolve(startDir)\n\tfor (;;) {\n\t\tconst candidate = join(current, entryName)\n\t\ttry {\n\t\t\tawait stat(candidate)\n\t\t\treturn current\n\t\t} catch {\n\t\t\t// keep walking upward\n\t\t}\n\t\tconst parent = dirname(current)\n\t\tif (parent === current) {\n\t\t\treturn null\n\t\t}\n\t\tcurrent = parent\n\t}\n}\n","import { existsSync } from 'node:fs'\nimport { copyFile, mkdir, readFile, readdir, stat, writeFile } from 'node:fs/promises'\nimport { dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { TemplateContext, TemplateName } from '../types'\n\nexport type TemplateLayerCategory = 'base' | 'ui' | 'style' | 'sync' | 'db' | 'auth'\n\nexport interface TemplateLayer {\n\tcategory: TemplateLayerCategory\n\tname: string\n\tsourceTemplate: TemplateName | null\n}\n\nexport interface TemplateLayerPlan {\n\tlayers: readonly TemplateLayer[]\n\tcompatibilityTarget: TemplateName\n}\n\n/**\n * Replaces {{variable}} placeholders in a template string with context values.\n *\n * @param template - The template string containing {{variable}} placeholders\n * @param context - Key-value pairs to substitute\n * @returns The template with all placeholders replaced\n */\nexport function substituteVariables(template: string, context: Record<string, string>): string {\n\treturn template.replace(/\\{\\{(\\w+)\\}\\}/g, (_match, key: string) => {\n\t\tconst value = context[key]\n\t\treturn value !== undefined ? value : `{{${key}}}`\n\t})\n}\n\n/**\n * Resolves the absolute path to a bundled template directory.\n *\n * After tsup bundling, import.meta.url points to dist/<file>.js (1 level from root).\n * In source, it's src/templates/composer.ts (2 levels from root).\n * We walk up from the current file to find the package root containing templates/.\n *\n * @param templateName - Name of the template (for example, 'react-basic')\n * @returns Absolute path to the template directory\n */\nexport function getTemplatePath(templateName: TemplateName): string {\n\tlet dir = dirname(fileURLToPath(import.meta.url))\n\tfor (let i = 0; i < 7; i++) {\n\t\tconst candidate = resolve(dir, 'templates', templateName)\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate\n\t\t}\n\t\tdir = dirname(dir)\n\t}\n\t// Fallback: assume bundled output and step to package root.\n\tconst currentDir = dirname(fileURLToPath(import.meta.url))\n\treturn resolve(currentDir, '..', '..', '..', 'templates', templateName)\n}\n\n/**\n * Returns a v1 compatibility layer plan that composes to one of the existing\n * four concrete templates. This establishes the layer architecture while\n * preserving byte-for-byte output compatibility for current templates.\n */\nexport function createCompatibilityLayerPlan(templateName: TemplateName): TemplateLayerPlan {\n\tconst baseLayer: TemplateLayer = { category: 'base', name: 'base', sourceTemplate: 'react-basic' }\n\tconst uiLayer: TemplateLayer = { category: 'ui', name: 'react', sourceTemplate: null }\n\tconst authLayer: TemplateLayer = { category: 'auth', name: 'none', sourceTemplate: null }\n\n\tswitch (templateName) {\n\t\tcase 'react-basic':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'plain', sourceTemplate: null },\n\t\t\t\t\t{ category: 'sync', name: 'disabled', sourceTemplate: null },\n\t\t\t\t\t{ category: 'db', name: 'none', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'react-tailwind':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'tailwind', sourceTemplate: 'react-tailwind' },\n\t\t\t\t\t{ category: 'sync', name: 'disabled', sourceTemplate: null },\n\t\t\t\t\t{ category: 'db', name: 'none', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'react-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'plain', sourceTemplate: null },\n\t\t\t\t\t{ category: 'sync', name: 'enabled', sourceTemplate: 'react-sync' },\n\t\t\t\t\t{ category: 'db', name: 'sqlite', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'react-tailwind-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\tbaseLayer,\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'tailwind', sourceTemplate: 'react-tailwind' },\n\t\t\t\t\t{ category: 'sync', name: 'enabled', sourceTemplate: 'react-tailwind-sync' },\n\t\t\t\t\t{ category: 'db', name: 'sqlite', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'tauri-react':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\t{ category: 'base', name: 'tauri', sourceTemplate: 'tauri-react' },\n\t\t\t\t\tuiLayer,\n\t\t\t\t\t{ category: 'style', name: 'plain', sourceTemplate: null },\n\t\t\t\t\t{ category: 'sync', name: 'enabled', sourceTemplate: null },\n\t\t\t\t\t{ category: 'db', name: 'tauri-sqlite', sourceTemplate: null },\n\t\t\t\t\tauthLayer,\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'vue-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-sync', sourceTemplate: 'vue-sync' }],\n\t\t\t}\n\t\tcase 'vue-basic':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-basic', sourceTemplate: 'vue-basic' }],\n\t\t\t}\n\t\tcase 'svelte-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'svelte-sync', sourceTemplate: 'svelte-sync' }],\n\t\t\t}\n\t\tcase 'svelte-basic':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'svelte-basic', sourceTemplate: 'svelte-basic' }],\n\t\t\t}\n\t\tcase 'vue-tailwind-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\t{ category: 'base', name: 'vue-tailwind-sync', sourceTemplate: 'vue-tailwind-sync' },\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'vue-tailwind':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'vue-tailwind', sourceTemplate: 'vue-tailwind' }],\n\t\t\t}\n\t\tcase 'svelte-tailwind-sync':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcategory: 'base',\n\t\t\t\t\t\tname: 'svelte-tailwind-sync',\n\t\t\t\t\t\tsourceTemplate: 'svelte-tailwind-sync',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\tcase 'svelte-tailwind':\n\t\t\treturn {\n\t\t\t\tcompatibilityTarget: templateName,\n\t\t\t\tlayers: [{ category: 'base', name: 'svelte-tailwind', sourceTemplate: 'svelte-tailwind' }],\n\t\t\t}\n\t}\n}\n\n/**\n * Composes a project by applying template layers in order. Later layers\n * overwrite earlier files, which allows progressive specialization.\n *\n * @param plan - Layer plan describing the composition\n * @param targetDir - Destination directory (must not exist yet)\n * @param context - Variables for template substitution\n */\nexport async function composeTemplateLayers(\n\tplan: TemplateLayerPlan,\n\ttargetDir: string,\n\tcontext: TemplateContext,\n): Promise<void> {\n\tconst vars: Record<string, string> = {\n\t\tprojectName: context.projectName,\n\t\tpackageManager: context.packageManager,\n\t\tkoraVersion: context.koraVersion,\n\t\tdbProvider: context.dbProvider ?? 'none',\n\t}\n\n\tfor (const layer of plan.layers) {\n\t\tif (layer.sourceTemplate === null) {\n\t\t\tcontinue\n\t\t}\n\t\tconst sourceDir = getTemplatePath(layer.sourceTemplate)\n\t\tawait copyDirectory(sourceDir, targetDir, vars)\n\t}\n}\n\nasync function copyDirectory(\n\tsrc: string,\n\tdest: string,\n\tvars: Record<string, string>,\n): Promise<void> {\n\tawait mkdir(dest, { recursive: true })\n\tconst entries = await readdir(src)\n\n\tfor (const entry of entries) {\n\t\tconst srcPath = join(src, entry)\n\t\tconst srcStat = await stat(srcPath)\n\n\t\tif (srcStat.isDirectory()) {\n\t\t\tawait copyDirectory(srcPath, join(dest, entry), vars)\n\t\t\tcontinue\n\t\t}\n\t\tif (entry.endsWith('.hbs')) {\n\t\t\tconst content = await readFile(srcPath, 'utf-8')\n\t\t\tconst outputName = entry.slice(0, -4)\n\t\t\tawait writeFile(join(dest, outputName), substituteVariables(content, vars), 'utf-8')\n\t\t\tcontinue\n\t\t}\n\t\tawait copyFile(srcPath, join(dest, entry))\n\t}\n}\n","import { composeTemplateLayers, createCompatibilityLayerPlan } from '../../templates/composer'\nimport type { TemplateContext, TemplateName } from '../../types'\n\n/**\n * Replaces {{variable}} placeholders in a template string with context values.\n *\n * @param template - The template string containing {{variable}} placeholders\n * @param context - Key-value pairs to substitute\n * @returns The template with all placeholders replaced\n */\nexport { substituteVariables, getTemplatePath } from '../../templates/composer'\n\n/**\n * Scaffolds a project from a bundled template.\n * Copies all files from the template directory to the target, applying\n * variable substitution to .hbs files and stripping the .hbs extension.\n *\n * @param templateName - Which template to use\n * @param targetDir - Destination directory (must not exist yet)\n * @param context - Variables for template substitution\n */\nexport async function scaffoldTemplate(\n\ttemplateName: TemplateName,\n\ttargetDir: string,\n\tcontext: TemplateContext,\n): Promise<void> {\n\tconst plan = createCompatibilityL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aAAa,SAAS,OAAO,CAAC;AACrD,YAAI,IAAI,SAAS,eAAe;AAC/B,cAAI,IAAI,YAAY,QAAS,QAAO;AAEpC,gBAAM,QAAQ,IAAI,QAAQ,MAAM,GAAG;AACnC,iBAAO,IAAI,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,QAChC;AAAA,MACD;AACA,YAAMF,SAAQ,GAAG;AAAA,IAClB;AACA,WAAO;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD;","names":["execSync","existsSync","dirname","resolve","fileURLToPath","mkdir","readFile","stat","writeFile","dirname","join","resolve","resolve","execSync","dirname","fileURLToPath","existsSync"]}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
InvalidProjectError,
|
|
4
4
|
createLogger,
|
|
5
|
-
createPromptClient
|
|
5
|
+
createPromptClient
|
|
6
|
+
} from "./chunk-B5YS4STN.js";
|
|
7
|
+
import {
|
|
6
8
|
findProjectRoot,
|
|
7
9
|
resolveProjectBinaryEntryPoint
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5NI2FEQL.js";
|
|
9
11
|
|
|
10
12
|
// src/commands/deploy/adapters/adapter.ts
|
|
11
13
|
var DEPLOY_PLATFORMS = [
|
|
@@ -2338,4 +2340,4 @@ export {
|
|
|
2338
2340
|
deployCommand,
|
|
2339
2341
|
generateTypes
|
|
2340
2342
|
};
|
|
2341
|
-
//# sourceMappingURL=chunk-
|
|
2343
|
+
//# sourceMappingURL=chunk-EOWLAAIV.js.map
|