Scheduling infrastructure for absolutely everyone.
fix: future build and type fixes
zomars9076a7eb42b0
diff --git a/apps/web/app/future/booking/[uid]/embed/page.tsx b/apps/web/app/future/booking/[uid]/embed/page.tsxindex d3fcef1febb..4fab8011c66 100644--- a/apps/web/app/future/booking/[uid]/embed/page.tsx+++ b/apps/web/app/future/booking/[uid]/embed/page.tsx@@ -1,10 +1,9 @@-import OldPage from "@pages/booking/[uid]";+import OldPage, { type PageProps, getServerSideProps } from "@pages/booking/[uid]";+import { withAppDirSsr } from "app/WithAppDirSsr";import withEmbedSsrAppDir from "app/WithEmbedSSR";import { WithLayout } from "app/layoutHOC";-import { getData } from "../page";-+const getData = withAppDirSsr<PageProps>(getServerSideProps);const getEmbedData = withEmbedSsrAppDir(getData);-// @ts-expect-error Type '(context: GetServerSidePropsContext) => Promise<any>' is not assignable to type '(arg: {export default WithLayout({ getLayout: null, getData: getEmbedData, Page: OldPage });diff --git a/apps/web/app/future/booking/[uid]/page.tsx b/apps/web/app/future/booking/[uid]/page.tsxindex e0db2efa6f8..b7019972051 100644--- a/apps/web/app/future/booking/[uid]/page.tsx+++ b/apps/web/app/future/booking/[uid]/page.tsx@@ -41,7 +41,7 @@ export const generateMetadata = async () =>() => "");-export const getData = async (context: GetServerSidePropsContext) => {+const getData = async (context: GetServerSidePropsContext) => {const ssr = await ssrInit(context);const session = await getServerSession(context);let tz: string | null = null;diff --git a/apps/web/app/future/team/[slug]/[type]/embed/page.tsx b/apps/web/app/future/team/[slug]/[type]/embed/page.tsxindex 7577b566818..a39a2b28f9b 100644--- a/apps/web/app/future/team/[slug]/[type]/embed/page.tsx+++ b/apps/web/app/future/team/[slug]/[type]/embed/page.tsx@@ -1,9 +1,10 @@-import LegacyPage from "@pages/team/[slug]/[type]/embed";+import LegacyPage, { getServerSideProps } from "@pages/team/[slug]/[type]/embed";+import { withAppDirSsr } from "app/WithAppDirSsr";import withEmbedSsrAppDir from "app/WithEmbedSSR";import { WithLayout } from "app/layoutHOC";-import { getData } from "../page";-+const getData = withAppDirSsr(getServerSideProps);const getEmbedData = withEmbedSsrAppDir(getData);+// @ts-expect-error Type is missing the following properties from type: entity, duration, booking, away, and 7 more.export default WithLayout({ getLayout: null, getData: getEmbedData, Page: LegacyPage })<"P">;diff --git a/apps/web/app/future/team/[slug]/[type]/page.tsx b/apps/web/app/future/team/[slug]/[type]/page.tsxindex f6b971de732..424faf6fb34 100644--- a/apps/web/app/future/team/[slug]/[type]/page.tsx+++ b/apps/web/app/future/team/[slug]/[type]/page.tsx@@ -1,5 +1,5 @@import LegacyPage, { type PageProps, getServerSideProps } from "@pages/team/[slug]/[type]";-import { withAppDir } from "app/AppDirSSRHOC";+import { withAppDirSsr } from "app/WithAppDirSsr";import { _generateMetadata } from "app/_utils";import { WithLayout } from "app/layoutHOC";import { type GetServerSidePropsContext } from "next";@@ -7,8 +7,14 @@ import { cookies, headers } from "next/headers";import { buildLegacyCtx } from "@lib/buildLegacyCtx";-export const generateMetadata = async ({ params }: { params: Record<string, string | string[]> }) => {- const legacyCtx = buildLegacyCtx(headers(), cookies(), params);+export const generateMetadata = async ({+ params,+ searchParams,+}: {+ params: Record<string, string | string[]>;+ searchParams: { [key: string]: string | string[] | undefined };+}) => {+ const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams);const props = await getData(legacyCtx as unknown as GetServerSidePropsContext);const { entity, user, slug, booking } = props;const { trpc } = await import("@calcom/trpc");@@ -25,7 +31,7 @@ export const generateMetadata = async ({ params }: { params: Record<string, stri(t) => `${booking?.uid ? t("reschedule") : ""} ${title}`);};-export const getData = withAppDir<PageProps>(getServerSideProps);+const getData = withAppDirSsr<PageProps>(getServerSideProps);export default WithLayout({Page: LegacyPage,diff --git a/apps/web/app/future/team/[slug]/embed/page.tsx b/apps/web/app/future/team/[slug]/embed/page.tsxindex df0d97365e4..407fb30e443 100644--- a/apps/web/app/future/team/[slug]/embed/page.tsx+++ b/apps/web/app/future/team/[slug]/embed/page.tsx@@ -1,9 +1,9 @@-import LegacyPage from "@pages/team/[slug]/embed";+import LegacyPage, { type PageProps, getServerSideProps } from "@pages/team/[slug]";+import { withAppDirSsr } from "app/WithAppDirSsr";import withEmbedSsrAppDir from "app/WithEmbedSSR";import { WithLayout } from "app/layoutHOC";-import { getData } from "../page";-+const getData = withAppDirSsr<PageProps>(getServerSideProps);const getEmbedData = withEmbedSsrAppDir(getData);export default WithLayout({ getLayout: null, getData: getEmbedData, Page: LegacyPage })<"P">;diff --git a/apps/web/app/future/team/[slug]/page.tsx b/apps/web/app/future/team/[slug]/page.tsxindex df6569a226e..f1f447eebe3 100644--- a/apps/web/app/future/team/[slug]/page.tsx+++ b/apps/web/app/future/team/[slug]/page.tsx@@ -1,5 +1,5 @@-import LegacyPage, { type PageProps, getServerSideProps } from "@pages/team/[slug]";-import { withAppDir } from "app/AppDirSSRHOC";+import LegacyPage, { getServerSideProps, type PageProps } from "@pages/team/[slug]";+import { withAppDirSsr } from "app/WithAppDirSsr";import { _generateMetadata } from "app/_utils";import { WithLayout } from "app/layoutHOC";import { type GetServerSidePropsContext } from "next";@@ -7,9 +7,15 @@ import { cookies, headers } from "next/headers";import { buildLegacyCtx } from "@lib/buildLegacyCtx";-export const generateMetadata = async ({ params }: { params: Record<string, string | string[]> }) => {+export const generateMetadata = async ({+ params,+ searchParams,+}: {+ params: Record<string, string | string[]>;+ searchParams: { [key: string]: string | string[] | undefined };+}) => {const props = await getData(- buildLegacyCtx(headers(), cookies(), params) as unknown as GetServerSidePropsContext+ buildLegacyCtx(headers(), cookies(), params, searchParams) as unknown as GetServerSidePropsContext);const teamName = props.team.name || "Nameless Team";@@ -19,7 +25,7 @@ export const generateMetadata = async ({ params }: { params: Record<string, stri);};-export const getData = withAppDir<PageProps>(getServerSideProps);+const getData = withAppDirSsr<PageProps>(getServerSideProps);export default WithLayout({Page: LegacyPage,diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsxindex cdb7f679784..0e40412a621 100644--- a/apps/web/pages/booking/[uid].tsx+++ b/apps/web/pages/booking/[uid].tsx@@ -54,6 +54,8 @@ import EventReservationSchema from "@components/schemas/EventReservationSchema";export { getServerSideProps };+export type PageProps = inferSSRProps<typeof getServerSideProps>;+const stringToBoolean = z.string().optional()diff --git a/apps/web/pages/team/[slug]/[type]/embed.tsx b/apps/web/pages/team/[slug]/[type]/embed.tsxindex 9b0fb7a7a8b..63531e5f392 100644--- a/apps/web/pages/team/[slug]/[type]/embed.tsx+++ b/apps/web/pages/team/[slug]/[type]/embed.tsx@@ -4,6 +4,6 @@ import withEmbedSsr from "@lib/withEmbedSsr";import { getServerSideProps as _getServerSideProps } from "../[type]";-export { default } from "../[type]";+export { default, type PageProps } from "../[type]";export const getServerSideProps = withEmbedSsr(_getServerSideProps);