fix(server-build): entferne Pfadalias '@/server/*' im Server-Code, nutze relative Imports; passe RPC-Route-Import und OpenAI-Import an; Server-Build nutzt CommonJS/Node Resolution

This commit is contained in:
2025-10-01 22:11:30 +02:00
parent f44164c957
commit 3d1bbe7265
8 changed files with 18 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
import { RPCHandler } from "@orpc/server/fetch";
import { router } from "@/server/rpc";
import { router } from "../rpc";
import { Hono } from "hono";
export const rpcApp = new Hono();

View File

@@ -1,7 +1,7 @@
import { call, os } from "@orpc/server";
import { z } from "zod";
import { randomUUID } from "crypto";
import { createKV } from "@/server/lib/create-kv";
import { createKV } from "../lib/create-kv";
const AvailabilitySchema = z.object({
id: z.string(),

View File

@@ -1,15 +1,15 @@
import { call, os } from "@orpc/server";
import { z } from "zod";
import { randomUUID } from "crypto";
import { createKV } from "@/server/lib/create-kv";
import { createKV as createAvailabilityKV } from "@/server/lib/create-kv";
import { sendEmail, sendEmailWithAGB, sendEmailWithAGBAndCalendar, sendEmailWithInspirationPhoto } from "@/server/lib/email";
import { renderBookingPendingHTML, renderBookingConfirmedHTML, renderBookingCancelledHTML, renderAdminBookingNotificationHTML } from "@/server/lib/email-templates";
import { router as rootRouter } from "@/server/rpc";
import { createKV } from "../lib/create-kv";
import { createKV as createAvailabilityKV } from "../lib/create-kv";
import { sendEmail, sendEmailWithAGB, sendEmailWithAGBAndCalendar, sendEmailWithInspirationPhoto } from "../lib/email";
import { renderBookingPendingHTML, renderBookingConfirmedHTML, renderBookingCancelledHTML, renderAdminBookingNotificationHTML } from "../lib/email-templates";
import { router as rootRouter } from "..";
import { createORPCClient } from "@orpc/client";
import { RPCLink } from "@orpc/client/fetch";
import { checkBookingRateLimit, getClientIP } from "@/server/lib/rate-limiter";
import { validateEmail } from "@/server/lib/email-validator";
import { checkBookingRateLimit, getClientIP } from "../lib/rate-limiter";
import { validateEmail } from "../lib/email-validator";
// Create a server-side client to call other RPC endpoints
const link = new RPCLink({ url: "http://localhost:5173/rpc" });
@@ -59,7 +59,7 @@ type Availability = {
const availabilityKV = createAvailabilityKV<Availability>("availability");
// Import treatments KV for admin notifications
import { createKV as createTreatmentsKV } from "@/server/lib/create-kv";
import { createKV as createTreatmentsKV } from "../lib/create-kv";
type Treatment = {
id: string;
name: string;

View File

@@ -1,6 +1,6 @@
import { call, os } from "@orpc/server";
import { z } from "zod";
import { createKV } from "@/server/lib/create-kv";
import { createKV } from "../lib/create-kv";
import { createKV as createAvailabilityKV } from "@/server/lib/create-kv";
import { randomUUID } from "crypto";

View File

@@ -2,7 +2,7 @@ import OpenAI from "openai";
import { os } from "@orpc/server";
import { z } from "zod";
import { zodResponseFormat } from "@/server/lib/openai";
import { zodResponseFormat } from "../../lib/openai";
if (!process.env.OPENAI_BASE_URL) {
throw new Error("OPENAI_BASE_URL is not set");

View File

@@ -1,5 +1,5 @@
import { os } from "@orpc/server";
import { getLegalConfig } from "@/server/lib/legal-config";
import { getLegalConfig } from "../lib/legal-config";
export const router = {
getConfig: os.handler(async () => {

View File

@@ -1,7 +1,7 @@
import { call, os } from "@orpc/server";
import { z } from "zod";
import { randomUUID } from "crypto";
import { createKV } from "@/server/lib/create-kv";
import { createKV } from "../lib/create-kv";
const TreatmentSchema = z.object({
id: z.string(),