Squash merge beta into main

This commit is contained in:
Aman Varshney
2025-04-19 17:30:59 +05:30
parent 724d32b913
commit 0de49d4e45
27 changed files with 113 additions and 130 deletions

View File

@@ -1,6 +1,5 @@
import path from "node:path";
import type { AvailableDependencies } from "../constants";
import type { ProjectBackend, ProjectRuntime } from "../types";
import { addPackageDependency } from "../utils/add-package-deps";
import type { ProjectConfig } from "../types";
@@ -8,7 +7,7 @@ import type { ProjectConfig } from "../types";
export async function setupBackendDependencies(
config: ProjectConfig,
): Promise<void> {
const { projectName, backend, runtime } = config;
const { projectName, backend, runtime, api } = config;
const projectDir = path.resolve(process.cwd(), projectName);
const framework = backend;
const serverDir = path.join(projectDir, "apps/server");
@@ -17,15 +16,20 @@ export async function setupBackendDependencies(
const devDependencies: AvailableDependencies[] = [];
if (framework === "hono") {
dependencies.push("hono", "@hono/trpc-server");
dependencies.push("hono");
if (api === "trpc") {
dependencies.push("@hono/trpc-server");
}
if (runtime === "node") {
dependencies.push("@hono/node-server");
devDependencies.push("tsx", "@types/node");
}
} else if (framework === "elysia") {
dependencies.push("elysia", "@elysiajs/cors", "@elysiajs/trpc");
dependencies.push("elysia", "@elysiajs/cors");
if (api === "trpc") {
dependencies.push("@elysiajs/trpc");
}
if (runtime === "node") {
dependencies.push("@elysiajs/node");
devDependencies.push("tsx", "@types/node");