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:
@@ -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();
|
||||
|
@@ -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(),
|
||||
|
@@ -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;
|
||||
|
@@ -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";
|
||||
|
||||
|
@@ -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");
|
||||
|
@@ -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 () => {
|
||||
|
@@ -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(),
|
||||
|
@@ -5,10 +5,11 @@
|
||||
"outDir": "server-dist",
|
||||
"sourceMap": false,
|
||||
"declaration": false,
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"allowImportingTsExtensions": false,
|
||||
"target": "ES2022"
|
||||
"target": "ES2022",
|
||||
"baseUrl": "."
|
||||
},
|
||||
"include": [
|
||||
"src/server/**/*.ts",
|
||||
|
Reference in New Issue
Block a user