Scheduling infrastructure for absolutely everyone.
perf: Use built types for appRouter (#20083)
Keith Williams587af33179e3
diff --git a/apps/web/app/_trpc/client.ts b/apps/web/app/_trpc/client.tsindex 6f1cb3a2eb7..978570ed050 100644--- a/apps/web/app/_trpc/client.ts+++ b/apps/web/app/_trpc/client.ts@@ -1,4 +1,4 @@-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import { createTRPCReact } from "@trpc/react-query";diff --git a/apps/web/app/_trpc/trpc-provider.tsx b/apps/web/app/_trpc/trpc-provider.tsxindex 2b8f3b8c3bf..9c0cbcd0484 100644--- a/apps/web/app/_trpc/trpc-provider.tsx+++ b/apps/web/app/_trpc/trpc-provider.tsx@@ -7,7 +7,7 @@ import { useState } from "react";import superjson from "superjson";import { ENDPOINTS } from "@calcom/trpc/react/shared";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import { httpBatchLink, httpLink, loggerLink, splitLink, TRPCClientError } from "@trpc/client";diff --git a/apps/web/components/apps/MultiDisconnectIntegration.tsx b/apps/web/components/apps/MultiDisconnectIntegration.tsxindex ad9d48b5bab..fdf09d3e446 100644--- a/apps/web/components/apps/MultiDisconnectIntegration.tsx+++ b/apps/web/components/apps/MultiDisconnectIntegration.tsx@@ -2,7 +2,7 @@ import { useState } from "react";import { useLocale } from "@calcom/lib/hooks/useLocale";import { trpc } from "@calcom/trpc/react";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import {Button,Dropdown,diff --git a/apps/web/components/getting-started/steps-views/SetupAvailability.tsx b/apps/web/components/getting-started/steps-views/SetupAvailability.tsxindex 81085371259..e077aa06de0 100644--- a/apps/web/components/getting-started/steps-views/SetupAvailability.tsx+++ b/apps/web/components/getting-started/steps-views/SetupAvailability.tsx@@ -4,7 +4,7 @@ import { Schedule } from "@calcom/features/schedules";import { DEFAULT_SCHEDULE } from "@calcom/lib/availability";import { useLocale } from "@calcom/lib/hooks/useLocale";import { trpc } from "@calcom/trpc/react";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import { Button, Form } from "@calcom/ui";import type { TRPCClientErrorLike } from "@trpc/client";diff --git a/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx b/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsxindex ac9e0282dbf..ecfcf456a01 100644--- a/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx+++ b/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx@@ -14,7 +14,7 @@ import { useDebounce } from "@calcom/lib/hooks/useDebounce";import { useLocale } from "@calcom/lib/hooks/useLocale";import type { RouterOutputs } from "@calcom/trpc/react";import { trpc } from "@calcom/trpc/react";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import { Button, Dialog, DialogClose, DialogContent, DialogFooter, Input, Label } from "@calcom/ui";import { Icon } from "@calcom/ui";diff --git a/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx b/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsxindex 0b472302fa3..47502be4b8d 100644--- a/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx+++ b/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx@@ -9,7 +9,7 @@ import { fetchUsername } from "@calcom/lib/fetchUsername";import { useDebounce } from "@calcom/lib/hooks/useDebounce";import { useLocale } from "@calcom/lib/hooks/useLocale";import { trpc } from "@calcom/trpc/react";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import { Button, Dialog, DialogClose, DialogContent, TextField, DialogFooter, Tooltip } from "@calcom/ui";import { Icon } from "@calcom/ui";diff --git a/apps/web/components/ui/UsernameAvailability/index.tsx b/apps/web/components/ui/UsernameAvailability/index.tsxindex 530ca656f86..820cf123acd 100644--- a/apps/web/components/ui/UsernameAvailability/index.tsx+++ b/apps/web/components/ui/UsernameAvailability/index.tsx@@ -7,7 +7,7 @@ import { Controller, useForm } from "react-hook-form";import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider";import { WEBSITE_URL, IS_SELF_HOSTED } from "@calcom/lib/constants";import { trpc } from "@calcom/trpc/react";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import useRouterQuery from "@lib/hooks/useRouterQuery";diff --git a/apps/web/modules/settings/my-account/profile-view.tsx b/apps/web/modules/settings/my-account/profile-view.tsxindex e049aba3613..ae9f926a022 100644--- a/apps/web/modules/settings/my-account/profile-view.tsx+++ b/apps/web/modules/settings/my-account/profile-view.tsx@@ -21,7 +21,7 @@ import turndown from "@calcom/lib/turndownService";import { IdentityProvider } from "@calcom/prisma/enums";import type { RouterOutputs } from "@calcom/trpc/react";import { trpc } from "@calcom/trpc/react";-import type { AppRouter } from "@calcom/trpc/server/routers/_app";+import type { AppRouter } from "@calcom/trpc/types/server/routers/_app";import {Alert,Button,diff --git a/packages/trpc/tsconfig.json b/packages/trpc/tsconfig.jsonindex 4a192b93e4e..101aeb3e01d 100644--- a/packages/trpc/tsconfig.json+++ b/packages/trpc/tsconfig.json@@ -21,9 +21,9 @@"../types/tanstack-table.d.ts","../types/next.d.ts","../types/window.d.ts",- "react"+ "./server"],- "exclude": ["**/node_modules/**", "types/router.d.ts"],+ "exclude": ["**/node_modules/**", "./react", "./server/**/*.test.ts", "./server/**/*.spec.ts"],"compilerOptions": {"isolatedModules": false,"noEmit": false,@@ -32,6 +32,7 @@"experimentalDecorators": true,"declarationMap": false,"resolveJsonModule": true,- "outFile": "types/router.d.ts"+ "declarationDir": "types/server",+ "moduleResolution": "node"}}diff --git a/turbo.json b/turbo.jsonindex 09cb06cd781..f725dea3eb3 100644--- a/turbo.json+++ b/turbo.json@@ -183,10 +183,12 @@"outputs": ["dist/**", "build/**"]},"type-check": {- "cache": false+ "cache": false,+ "dependsOn": ["@calcom/trpc#build"]},"type-check:ci": {- "cache": false+ "cache": false,+ "dependsOn": ["@calcom/trpc#build"]},"@calcom/prisma#db-reset": {"cache": false,