add cloudflare workers support (#326)

This commit is contained in:
Aman Varshney
2025-06-16 22:55:26 +05:30
committed by GitHub
parent 5fc1ba164e
commit b34e94a09e
34 changed files with 556 additions and 538 deletions

View File

@@ -1,7 +1,7 @@
import { cancel, isCancel, select } from "@clack/prompts";
import pc from "picocolors";
import { DEFAULT_CONFIG } from "../constants";
import type { Backend, Database, ORM } from "../types";
import type { Backend, Database, ORM, Runtime } from "../types";
const ormOptions = {
prisma: {
@@ -26,6 +26,7 @@ export async function getORMChoice(
hasDatabase: boolean,
database?: Database,
backend?: Backend,
runtime?: Runtime,
): Promise<ORM> {
if (backend === "convex") {
return "none";
@@ -34,6 +35,10 @@ export async function getORMChoice(
if (!hasDatabase) return "none";
if (orm !== undefined) return orm;
if (runtime === "workers") {
return "drizzle";
}
const options = [
...(database === "mongodb"
? [ormOptions.prisma, ormOptions.mongoose]