diff --git a/.gitignore b/.gitignore index fe4c90f..3712ddf 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ packages/media/.env .history **/*/.db/* **/*/.configs/* +**/*/.template/* **/*/*.db **/*/*.db-shm **/*/*.db-wal diff --git a/app/package.json b/app/package.json index 87be1c9..c6ceb33 100644 --- a/app/package.json +++ b/app/package.json @@ -60,6 +60,7 @@ }, "devDependencies": { "@aws-sdk/client-s3": "^3.613.0", + "@bluwy/giget-core": "^0.1.2", "@dagrejs/dagre": "^1.1.4", "@hono/typebox-validator": "^0.2.6", "@hono/vite-dev-server": "^0.17.0", @@ -219,4 +220,4 @@ "bun", "node" ] -} +} \ No newline at end of file diff --git a/app/src/cli/commands/create/create.ts b/app/src/cli/commands/create/create.ts new file mode 100644 index 0000000..49ac6f0 --- /dev/null +++ b/app/src/cli/commands/create/create.ts @@ -0,0 +1,251 @@ +import fs from "node:fs"; +import { downloadTemplate } from "@bluwy/giget-core"; +import * as $p from "@clack/prompts"; +import type { CliCommand } from "cli/types"; +import { typewriter, wait } from "cli/utils/cli"; +import { exec, getVersion } from "cli/utils/sys"; +import { Option } from "commander"; +import color from "picocolors"; +import { updateBkndPackages } from "./npm"; +import { type Template, templates } from "./templates"; + +const config = { + types: { + runtime: "Runtime", + framework: "Framework" + }, + runtime: { + node: "Node.js", + bun: "Bun", + cloudflare: "Cloudflare" + }, + framework: { + nextjs: "Next.js", + remix: "Remix", + astro: "Astro" + } +} as const; + +export const create: CliCommand = (program) => { + program + .command("create") + .addOption(new Option("-i, --integration ", "integration to use")) + .addOption(new Option("-t, --template