mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
init create cli, added node and partially cloudflare
This commit is contained in:
49
app/src/cli/commands/create/templates/index.ts
Normal file
49
app/src/cli/commands/create/templates/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { cloudflare } from "./cloudflare";
|
||||
|
||||
export type TemplateSetupCtx = {
|
||||
template: Template;
|
||||
dir: string;
|
||||
};
|
||||
|
||||
export type Integration = "node" | "bun" | "cloudflare" | "nextjs" | "remix" | "astro" | "custom";
|
||||
|
||||
export type Template = {
|
||||
/**
|
||||
* unique key for the template
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* the integration this template is for
|
||||
*/
|
||||
integration: Integration;
|
||||
title: string;
|
||||
description?: string;
|
||||
path: string;
|
||||
/**
|
||||
* adds a ref "#{ref}" to the path. If "true", adds the current version of bknd
|
||||
*/
|
||||
ref?: true | string;
|
||||
preinstall?: (ctx: TemplateSetupCtx) => Promise<void>;
|
||||
postinstall?: (ctx: TemplateSetupCtx) => Promise<void>;
|
||||
setup?: (ctx: TemplateSetupCtx) => Promise<void>;
|
||||
};
|
||||
|
||||
export const templates = [
|
||||
{
|
||||
key: "node",
|
||||
title: "Node.js Basic",
|
||||
integration: "node",
|
||||
description: "A basic bknd Node.js server",
|
||||
path: "gh:bknd-io/bknd/examples/node",
|
||||
ref: true
|
||||
},
|
||||
{
|
||||
key: "bun",
|
||||
title: "Bun Basic",
|
||||
integration: "bun",
|
||||
description: "A basic bknd Bun server",
|
||||
path: "gh:bknd-io/bknd/examples/bun",
|
||||
ref: true
|
||||
},
|
||||
cloudflare
|
||||
] as const satisfies Template[];
|
||||
Reference in New Issue
Block a user