diff --git a/README.md b/README.md index 5531563572..249baaa30f 100644 --- a/README.md +++ b/README.md @@ -339,18 +339,18 @@ Please see our [contributing guide](/CONTRIBUTING.md). ### Good First Issues We have a list of [help wanted](https://github.com/calcom/cal.com/issues?q=is:issue+is:open+label:%22%F0%9F%99%8B%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8Fhelp+wanted%22) that contain small features and bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process. - + ### Bounties - + Bounties of cal - + diff --git a/apps/docs/README.md b/apps/docs/README.md index 8b13789179..e69de29bb2 100644 --- a/apps/docs/README.md +++ b/apps/docs/README.md @@ -1 +0,0 @@ - diff --git a/apps/docs/package.json b/apps/docs/package.json index 89083b5cdf..6c4d2445eb 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -25,6 +25,6 @@ }, "devDependencies": { "@calcom/config": "*", - "eslint": "^8.22.0" + "eslint": "^8.34.0" } } diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx index 6c92686cfb..e8aad3b926 100644 --- a/apps/docs/pages/_app.tsx +++ b/apps/docs/pages/_app.tsx @@ -1,4 +1,4 @@ -import { AppProps } from "next/app"; +import type { AppProps } from "next/app"; import "nextra-theme-docs/style.css"; import "./style.css"; diff --git a/apps/storybook/package.json b/apps/storybook/package.json index f0791e14ef..082834a918 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -15,7 +15,7 @@ "@radix-ui/react-dialog": "^1.0.0", "@radix-ui/react-dropdown-menu": "^1.0.0", "@radix-ui/react-id": "^1.0.0", - "@radix-ui/react-popover": "^1.0.0", + "@radix-ui/react-popover": "^1.0.2", "@radix-ui/react-radio-group": "^1.0.0", "@radix-ui/react-slider": "^1.0.0", "@radix-ui/react-switch": "^1.0.0", @@ -36,8 +36,8 @@ "@storybook/manager-webpack5": "^6.5.13", "@storybook/react": "^6.5.13", "@storybook/testing-library": "^0.0.13", - "@types/react": "^18.0.17", - "@types/react-dom": "^18.0.6", + "@types/react": "18.0.26", + "@types/react-dom": "18.0.9", "@vitejs/plugin-react": "^2.1.0", "autoprefixer": "^10.4.12", "babel-loader": "^8.2.5", diff --git a/apps/swagger/package.json b/apps/swagger/package.json index 69fe1c4ee9..4d0580860a 100644 --- a/apps/swagger/package.json +++ b/apps/swagger/package.json @@ -22,8 +22,8 @@ }, "devDependencies": { "@types/node": "16.9.1", - "@types/react": "^18.0.17", - "@types/react-dom": "^18.0.6", + "@types/react": "18.0.26", + "@types/react-dom": "18.0.9", "typescript": "^4.9.4" } } diff --git a/apps/swagger/pages/index.tsx b/apps/swagger/pages/index.tsx index 6fc36fe451..10dbee9c13 100644 --- a/apps/swagger/pages/index.tsx +++ b/apps/swagger/pages/index.tsx @@ -1,5 +1,5 @@ import dynamic from "next/dynamic"; -import { SwaggerUI } from "swagger-ui-react"; +import type { SwaggerUI } from "swagger-ui-react"; import { SnippedGenerator, requestSnippets } from "@lib/snippets"; diff --git a/apps/web/components/AdditionalCalendarSelector.tsx b/apps/web/components/AdditionalCalendarSelector.tsx index 0faf3880ae..30b020b679 100644 --- a/apps/web/components/AdditionalCalendarSelector.tsx +++ b/apps/web/components/AdditionalCalendarSelector.tsx @@ -1,6 +1,6 @@ import React from "react"; import Select from "react-select"; -import { OptionProps } from "react-select"; +import type { OptionProps } from "react-select"; import { InstallAppButton } from "@calcom/app-store/components"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/AppListCard.tsx b/apps/web/components/AppListCard.tsx index 621a7497c3..4a1696e6b9 100644 --- a/apps/web/components/AppListCard.tsx +++ b/apps/web/components/AppListCard.tsx @@ -1,5 +1,6 @@ import { useRouter } from "next/router"; -import { ReactNode, useEffect, useRef, useState } from "react"; +import type { ReactNode } from "react"; +import { useEffect, useRef, useState } from "react"; import { z } from "zod"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/DestinationCalendarSelector.tsx b/apps/web/components/DestinationCalendarSelector.tsx index 78889b0434..d2e752dd84 100644 --- a/apps/web/components/DestinationCalendarSelector.tsx +++ b/apps/web/components/DestinationCalendarSelector.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import Select from "react-select"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { DestinationCalendar } from "@calcom/prisma/client"; +import type { DestinationCalendar } from "@calcom/prisma/client"; import { trpc } from "@calcom/trpc/react"; interface Props { diff --git a/apps/web/components/Embed.tsx b/apps/web/components/Embed.tsx index b7fb17a5a8..503e50b8da 100644 --- a/apps/web/components/Embed.tsx +++ b/apps/web/components/Embed.tsx @@ -1,8 +1,11 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible"; import classNames from "classnames"; -import { NextRouter, useRouter } from "next/router"; -import { createRef, forwardRef, MutableRefObject, RefObject, useRef, useState } from "react"; -import { components, ControlProps } from "react-select"; +import type { NextRouter } from "next/router"; +import { useRouter } from "next/router"; +import type { MutableRefObject, RefObject } from "react"; +import { createRef, forwardRef, useRef, useState } from "react"; +import type { ControlProps } from "react-select"; +import { components } from "react-select"; import { APP_NAME, EMBED_LIB_URL, WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -675,7 +678,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ return `${router.asPath.split("?")[0]}?${searchParams.toString()}`; }; const parsedTabs = tabs.map((t) => ({ ...t, href: s(t.href) })); - const embedCodeRefs: Record> = {}; + const embedCodeRefs: Record<(typeof tabs)[0]["name"], RefObject> = {}; tabs .filter((tab) => tab.type === "code") .forEach((codeTab) => { @@ -719,7 +722,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ const calLink = decodeURIComponent(embedUrl); - const addToPalette = (update: typeof previewState["palette"]) => { + const addToPalette = (update: (typeof previewState)["palette"]) => { setPreviewState((previewState) => { return { ...previewState, @@ -1060,7 +1063,7 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ defaultValue="#000000" onChange={(color) => { addToPalette({ - [palette.name as keyof typeof previewState["palette"]]: color, + [palette.name as keyof (typeof previewState)["palette"]]: color, }); }} /> diff --git a/apps/web/components/Gates.tsx b/apps/web/components/Gates.tsx index 2b86cb88e1..77bba763ff 100644 --- a/apps/web/components/Gates.tsx +++ b/apps/web/components/Gates.tsx @@ -1,6 +1,7 @@ import dynamic from "next/dynamic"; -import { Dispatch, useState, useEffect } from "react"; -import { JSONObject } from "superjson/dist/types"; +import type { Dispatch } from "react"; +import { useState, useEffect } from "react"; +import type { JSONObject } from "superjson/dist/types"; export type Gate = undefined | "rainbow"; // Add more like ` | "geolocation" | "payment"` diff --git a/apps/web/components/ImageUploader.tsx b/apps/web/components/ImageUploader.tsx index 11ceeeb394..9bc0b51cce 100644 --- a/apps/web/components/ImageUploader.tsx +++ b/apps/web/components/ImageUploader.tsx @@ -1,10 +1,12 @@ -import { FormEvent, useCallback, useEffect, useState } from "react"; +import type { FormEvent } from "react"; +import { useCallback, useEffect, useState } from "react"; import Cropper from "react-easy-crop"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button, Dialog, DialogClose, DialogContent, DialogTrigger } from "@calcom/ui"; -import { Area, getCroppedImg } from "@lib/cropImage"; +import type { Area } from "@lib/cropImage"; +import { getCroppedImg } from "@lib/cropImage"; import { useFileReader } from "@lib/hooks/useFileReader"; import Slider from "@components/Slider"; diff --git a/apps/web/components/NavTabs.tsx b/apps/web/components/NavTabs.tsx index 99fca44164..06e4c30b47 100644 --- a/apps/web/components/NavTabs.tsx +++ b/apps/web/components/NavTabs.tsx @@ -1,13 +1,15 @@ import { AdminRequired } from "components/ui/AdminRequired"; import noop from "lodash/noop"; -import Link, { LinkProps } from "next/link"; +import type { LinkProps } from "next/link"; +import Link from "next/link"; import { useRouter } from "next/router"; -import { FC, Fragment, MouseEventHandler } from "react"; +import type { FC, MouseEventHandler } from "react"; +import { Fragment } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import classNames from "@lib/classNames"; -import { SVGComponent } from "@lib/types/SVGComponent"; +import type { SVGComponent } from "@lib/types/SVGComponent"; export interface NavTabProps { tabs: { diff --git a/apps/web/components/SettingsShell.tsx b/apps/web/components/SettingsShell.tsx index 67ffc46f3c..d5f0b2c905 100644 --- a/apps/web/components/SettingsShell.tsx +++ b/apps/web/components/SettingsShell.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps } from "react"; +import type { ComponentProps } from "react"; +import React from "react"; import Shell from "@calcom/features/shell/Shell"; import { ErrorBoundary } from "@calcom/ui"; diff --git a/apps/web/components/apps/AdditionalCalendarSelector.tsx b/apps/web/components/apps/AdditionalCalendarSelector.tsx index d264da6f06..85f76483d6 100644 --- a/apps/web/components/apps/AdditionalCalendarSelector.tsx +++ b/apps/web/components/apps/AdditionalCalendarSelector.tsx @@ -1,4 +1,4 @@ -import { OptionProps } from "react-select"; +import type { OptionProps } from "react-select"; import { InstallAppButton } from "@calcom/app-store/components"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/apps/App.tsx b/apps/web/components/apps/App.tsx index cca5dd5cdf..529836ea8d 100644 --- a/apps/web/components/apps/App.tsx +++ b/apps/web/components/apps/App.tsx @@ -11,7 +11,7 @@ import classNames from "@calcom/lib/classNames"; import { APP_NAME, COMPANY_NAME, SUPPORT_MAIL_ADDRESS } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { App as AppType } from "@calcom/types/App"; +import type { App as AppType } from "@calcom/types/App"; import { Button, showToast, SkeletonButton, SkeletonText, HeadSeo, Badge } from "@calcom/ui"; import { FiBookOpen, diff --git a/apps/web/components/apps/DestinationCalendarSelector.tsx b/apps/web/components/apps/DestinationCalendarSelector.tsx index fe033fcbd7..bf73456fe6 100644 --- a/apps/web/components/apps/DestinationCalendarSelector.tsx +++ b/apps/web/components/apps/DestinationCalendarSelector.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import Select from "react-select"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { DestinationCalendar } from "@calcom/prisma/client"; +import type { DestinationCalendar } from "@calcom/prisma/client"; import { trpc } from "@calcom/trpc/react"; interface Props { diff --git a/apps/web/components/apps/layouts/AppsLayout.tsx b/apps/web/components/apps/layouts/AppsLayout.tsx index 9ed2458510..737aa990a7 100644 --- a/apps/web/components/apps/layouts/AppsLayout.tsx +++ b/apps/web/components/apps/layouts/AppsLayout.tsx @@ -1,6 +1,7 @@ import { useSession } from "next-auth/react"; import { useRouter } from "next/router"; -import React, { ComponentProps } from "react"; +import type { ComponentProps } from "react"; +import React from "react"; import Shell from "@calcom/features/shell/Shell"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/apps/layouts/InstalledAppsLayout.tsx b/apps/web/components/apps/layouts/InstalledAppsLayout.tsx index 69a13aa7e1..42481f299d 100644 --- a/apps/web/components/apps/layouts/InstalledAppsLayout.tsx +++ b/apps/web/components/apps/layouts/InstalledAppsLayout.tsx @@ -1,7 +1,8 @@ -import React, { ComponentProps } from "react"; +import type { ComponentProps } from "react"; +import React from "react"; import AppCategoryNavigation from "@calcom/app-store/_components/AppCategoryNavigation"; -import { InstalledAppVariants } from "@calcom/app-store/utils"; +import type { InstalledAppVariants } from "@calcom/app-store/utils"; import Shell from "@calcom/features/shell/Shell"; import { trpc } from "@calcom/trpc/react"; import type { HorizontalTabItemProps, VerticalTabItemProps } from "@calcom/ui"; @@ -44,7 +45,7 @@ export default function InstalledAppsLayout({ children, ...rest }: { children: React.ReactNode } & ComponentProps) { - const variant: typeof InstalledAppVariants[number] = "payment"; + const variant: (typeof InstalledAppVariants)[number] = "payment"; const query = trpc.viewer.integrations.useQuery({ variant, diff --git a/apps/web/components/auth/layouts/AdminLayout.tsx b/apps/web/components/auth/layouts/AdminLayout.tsx index efa0aeb733..6d992b687d 100644 --- a/apps/web/components/auth/layouts/AdminLayout.tsx +++ b/apps/web/components/auth/layouts/AdminLayout.tsx @@ -1,13 +1,13 @@ +import { UserPermissionRole } from "@prisma/client"; import { useSession } from "next-auth/react"; import { useRouter } from "next/router"; -import React, { ComponentProps, useEffect } from "react"; +import type { ComponentProps } from "react"; +import React, { useEffect } from "react"; import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; -import Shell from "@calcom/features/shell/Shell"; +import type Shell from "@calcom/features/shell/Shell"; import { ErrorBoundary } from "@calcom/ui"; -import { UserPermissionRole } from ".prisma/client"; - export default function AdminLayout({ children, diff --git a/apps/web/components/booking/AvailableEventLocations.tsx b/apps/web/components/booking/AvailableEventLocations.tsx index e8d0b9d1b5..16825862c8 100644 --- a/apps/web/components/booking/AvailableEventLocations.tsx +++ b/apps/web/components/booking/AvailableEventLocations.tsx @@ -4,7 +4,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Tooltip } from "@calcom/ui"; import { FiLink } from "@calcom/ui/components/icon"; -import { Props } from "./pages/AvailabilityPage"; +import type { Props } from "./pages/AvailabilityPage"; export function AvailableEventLocations({ locations }: { locations: Props["eventType"]["locations"] }) { const { t } = useLocale(); diff --git a/apps/web/components/booking/AvailableTimes.tsx b/apps/web/components/booking/AvailableTimes.tsx index 83fa573140..2a05ba94e3 100644 --- a/apps/web/components/booking/AvailableTimes.tsx +++ b/apps/web/components/booking/AvailableTimes.tsx @@ -1,8 +1,10 @@ import Link from "next/link"; import { useRouter } from "next/router"; -import { FC, useEffect, useState } from "react"; +import type { FC } from "react"; +import { useEffect, useState } from "react"; -import dayjs, { Dayjs } from "@calcom/dayjs"; +import type { Dayjs } from "@calcom/dayjs"; +import dayjs from "@calcom/dayjs"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { TimeFormat } from "@calcom/lib/timeFormat"; import { nameOfDay } from "@calcom/lib/weekday"; diff --git a/apps/web/components/booking/BookingDescription.tsx b/apps/web/components/booking/BookingDescription.tsx index b8df86e024..2a639616b2 100644 --- a/apps/web/components/booking/BookingDescription.tsx +++ b/apps/web/components/booking/BookingDescription.tsx @@ -1,5 +1,6 @@ import { SchedulingType } from "@prisma/client"; -import { FC, ReactNode, useEffect } from "react"; +import type { FC, ReactNode } from "react"; +import { useEffect } from "react"; import dayjs from "@calcom/dayjs"; import { classNames } from "@calcom/lib"; diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index 0e0f66db79..01086f7dfa 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -2,14 +2,17 @@ import { BookingStatus } from "@prisma/client"; import { useRouter } from "next/router"; import { useState } from "react"; -import { EventLocationType, getEventLocationType } from "@calcom/app-store/locations"; +import type { EventLocationType } from "@calcom/app-store/locations"; +import { getEventLocationType } from "@calcom/app-store/locations"; import dayjs from "@calcom/dayjs"; import ViewRecordingsDialog from "@calcom/features/ee/video/ViewRecordingsDialog"; import classNames from "@calcom/lib/classNames"; import { formatTime } from "@calcom/lib/date-fns"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { getEveryFreqFor } from "@calcom/lib/recurringStrings"; -import { RouterInputs, RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterInputs, RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; +import type { ActionType } from "@calcom/ui"; import { Badge, Button, @@ -20,7 +23,6 @@ import { MeetingTimeInTimezones, showToast, Tooltip, - ActionType, TableActions, TextAreaField, } from "@calcom/ui"; diff --git a/apps/web/components/booking/TimeOptions.tsx b/apps/web/components/booking/TimeOptions.tsx index eb498dd51a..e700e80acc 100644 --- a/apps/web/components/booking/TimeOptions.tsx +++ b/apps/web/components/booking/TimeOptions.tsx @@ -1,7 +1,9 @@ -import { FC, useEffect, useState } from "react"; +import type { FC } from "react"; +import { useEffect, useState } from "react"; import useTheme from "@calcom/lib/hooks/useTheme"; -import { ITimezoneOption, TimezoneSelect } from "@calcom/ui"; +import type { ITimezoneOption } from "@calcom/ui"; +import { TimezoneSelect } from "@calcom/ui"; import useMeQuery from "@lib/hooks/useMeQuery"; diff --git a/apps/web/components/booking/UserAvatars.tsx b/apps/web/components/booking/UserAvatars.tsx index c34bda5216..da87a2aba4 100644 --- a/apps/web/components/booking/UserAvatars.tsx +++ b/apps/web/components/booking/UserAvatars.tsx @@ -1,5 +1,6 @@ import { CAL_URL } from "@calcom/lib/constants"; -import { AvatarGroup, AvatarGroupProps } from "@calcom/ui"; +import type { AvatarGroupProps } from "@calcom/ui"; +import { AvatarGroup } from "@calcom/ui"; export const UserAvatars = ({ profile, diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index 7ce7809778..5a76522b8e 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -1,5 +1,5 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; -import { EventType } from "@prisma/client"; +import type { EventType } from "@prisma/client"; import dynamic from "next/dynamic"; import { useRouter } from "next/router"; import { useEffect, useMemo, useReducer, useState } from "react"; @@ -9,7 +9,8 @@ import { z } from "zod"; import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager"; import { getEventTypeAppData } from "@calcom/app-store/utils"; -import dayjs, { Dayjs } from "@calcom/dayjs"; +import type { Dayjs } from "@calcom/dayjs"; +import dayjs from "@calcom/dayjs"; import { useEmbedNonStylesConfig, useEmbedStyles, @@ -27,7 +28,7 @@ import notEmpty from "@calcom/lib/notEmpty"; import { getRecurringFreq } from "@calcom/lib/recurringStrings"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import { detectBrowserTimeFormat, setIs24hClockInLocalStorage, TimeFormat } from "@calcom/lib/timeFormat"; -import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; +import type { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { trpc } from "@calcom/trpc/react"; import { HeadSeo } from "@calcom/ui"; import { FiCreditCard, FiGlobe, FiRefreshCcw } from "@calcom/ui/components/icon"; @@ -35,7 +36,8 @@ import { FiCreditCard, FiGlobe, FiRefreshCcw } from "@calcom/ui/components/icon" import { timeZone as localStorageTimeZone } from "@lib/clock"; import useRouterQuery from "@lib/hooks/useRouterQuery"; -import Gates, { Gate, GateState } from "@components/Gates"; +import type { Gate, GateState } from "@components/Gates"; +import Gates from "@components/Gates"; import BookingDescription from "@components/booking/BookingDescription"; import TimeOptions from "@components/booking/TimeOptions"; diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index 796cd8a81a..28c91d10fd 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -10,10 +10,11 @@ import { v4 as uuidv4 } from "uuid"; import { z } from "zod"; import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager"; -import { EventLocationType, getEventLocationType, locationKeyToString } from "@calcom/app-store/locations"; +import type { EventLocationType } from "@calcom/app-store/locations"; +import { getEventLocationType, locationKeyToString } from "@calcom/app-store/locations"; import { createPaymentLink } from "@calcom/app-store/stripepayment/lib/client"; import { getEventTypeAppData } from "@calcom/app-store/utils"; -import { LocationObject } from "@calcom/core/location"; +import type { LocationObject } from "@calcom/core/location"; import dayjs from "@calcom/dayjs"; import { useEmbedNonStylesConfig, @@ -48,12 +49,13 @@ import createBooking from "@lib/mutations/bookings/create-booking"; import createRecurringBooking from "@lib/mutations/bookings/create-recurring-booking"; import { parseDate, parseRecurringDates } from "@lib/parseDate"; -import Gates, { Gate, GateState } from "@components/Gates"; +import type { Gate, GateState } from "@components/Gates"; +import Gates from "@components/Gates"; import BookingDescription from "@components/booking/BookingDescription"; -import { BookPageProps } from "../../../pages/[user]/book"; -import { HashLinkPageProps } from "../../../pages/d/[link]/book"; -import { TeamBookingPageProps } from "../../../pages/team/[slug]/book"; +import type { BookPageProps } from "../../../pages/[user]/book"; +import type { HashLinkPageProps } from "../../../pages/d/[link]/book"; +import type { TeamBookingPageProps } from "../../../pages/team/[slug]/book"; type BookingPageProps = BookPageProps | TeamBookingPageProps | HashLinkPageProps; const BookingFields = ({ diff --git a/apps/web/components/dialog/EditLocationDialog.tsx b/apps/web/components/dialog/EditLocationDialog.tsx index 5d997f33a9..6f10c6a7ed 100644 --- a/apps/web/components/dialog/EditLocationDialog.tsx +++ b/apps/web/components/dialog/EditLocationDialog.tsx @@ -7,23 +7,24 @@ import { useEffect } from "react"; import { Controller, useForm, useWatch, useFormContext } from "react-hook-form"; import { z } from "zod"; +import type { EventLocationType, LocationObject } from "@calcom/app-store/locations"; import { - EventLocationType, getEventLocationType, getHumanReadableLocationValue, getMessageForOrganizer, - LocationObject, LocationType, } from "@calcom/app-store/locations"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import { Button, Dialog, DialogContent, DialogFooter, Form, PhoneInput } from "@calcom/ui"; import { FiMapPin } from "@calcom/ui/components/icon"; import { QueryCell } from "@lib/QueryCell"; import CheckboxField from "@components/ui/form/CheckboxField"; -import LocationSelect, { LocationOption } from "@components/ui/form/LocationSelect"; +import type { LocationOption } from "@components/ui/form/LocationSelect"; +import LocationSelect from "@components/ui/form/LocationSelect"; type BookingItem = RouterOutputs["viewer"]["bookings"]["get"]["bookings"][number]; diff --git a/apps/web/components/dialog/RescheduleDialog.tsx b/apps/web/components/dialog/RescheduleDialog.tsx index 6b910f1909..efbf219027 100644 --- a/apps/web/components/dialog/RescheduleDialog.tsx +++ b/apps/web/components/dialog/RescheduleDialog.tsx @@ -1,4 +1,5 @@ -import { Dispatch, SetStateAction, useState } from "react"; +import type { Dispatch, SetStateAction } from "react"; +import { useState } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; diff --git a/apps/web/components/eventtype/AvailabilityTab.tsx b/apps/web/components/eventtype/AvailabilityTab.tsx index 33da157354..656a252c7f 100644 --- a/apps/web/components/eventtype/AvailabilityTab.tsx +++ b/apps/web/components/eventtype/AvailabilityTab.tsx @@ -1,6 +1,7 @@ -import { FormValues } from "pages/event-types/[type]"; +import type { FormValues } from "pages/event-types/[type]"; import { Controller, useFormContext } from "react-hook-form"; -import { components, OptionProps, SingleValueProps } from "react-select"; +import type { OptionProps, SingleValueProps } from "react-select"; +import { components } from "react-select"; import dayjs from "@calcom/dayjs"; import classNames from "@calcom/lib/classNames"; diff --git a/apps/web/components/eventtype/EventAppsTab.tsx b/apps/web/components/eventtype/EventAppsTab.tsx index 958aa67ef2..725a3f0a4f 100644 --- a/apps/web/components/eventtype/EventAppsTab.tsx +++ b/apps/web/components/eventtype/EventAppsTab.tsx @@ -1,10 +1,10 @@ -import { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; +import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; import { useFormContext } from "react-hook-form"; -import { GetAppData, SetAppData } from "@calcom/app-store/EventTypeAppContext"; +import type { GetAppData, SetAppData } from "@calcom/app-store/EventTypeAppContext"; import { EventTypeAppCard } from "@calcom/app-store/_components/EventTypeAppCardInterface"; -import { EventTypeAppCardComponentProps } from "@calcom/app-store/types"; -import { EventTypeAppsList } from "@calcom/app-store/utils"; +import type { EventTypeAppCardComponentProps } from "@calcom/app-store/types"; +import type { EventTypeAppsList } from "@calcom/app-store/utils"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Button, EmptyScreen } from "@calcom/ui"; diff --git a/apps/web/components/eventtype/EventLimitsTab.tsx b/apps/web/components/eventtype/EventLimitsTab.tsx index a5e7a30d2a..ffa7ba5e14 100644 --- a/apps/web/components/eventtype/EventLimitsTab.tsx +++ b/apps/web/components/eventtype/EventLimitsTab.tsx @@ -1,14 +1,16 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; import * as RadioGroup from "@radix-ui/react-radio-group"; -import { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; +import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; import React, { useEffect, useState } from "react"; -import { Controller, useFormContext, UseFormRegisterReturn, useWatch } from "react-hook-form"; +import type { UseFormRegisterReturn } from "react-hook-form"; +import { Controller, useFormContext, useWatch } from "react-hook-form"; import { classNames } from "@calcom/lib"; -import convertToNewDurationType, { DurationType } from "@calcom/lib/convertToNewDurationType"; +import type { DurationType } from "@calcom/lib/convertToNewDurationType"; +import convertToNewDurationType from "@calcom/lib/convertToNewDurationType"; import findDurationType from "@calcom/lib/findDurationType"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { PeriodType } from "@calcom/prisma/client"; +import type { PeriodType } from "@calcom/prisma/client"; import type { BookingLimit } from "@calcom/types/Calendar"; import { Button, DateRangePicker, Input, InputField, Label, Select, SettingsToggle } from "@calcom/ui"; import { FiPlus, FiTrash } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/eventtype/EventRecurringTab.tsx b/apps/web/components/eventtype/EventRecurringTab.tsx index 1c55f6f6c3..2b41ca4679 100644 --- a/apps/web/components/eventtype/EventRecurringTab.tsx +++ b/apps/web/components/eventtype/EventRecurringTab.tsx @@ -1,4 +1,4 @@ -import { EventTypeSetupProps } from "pages/event-types/[type]"; +import type { EventTypeSetupProps } from "pages/event-types/[type]"; import getPaymentAppData from "@calcom/lib/getPaymentAppData"; diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 4f427e2874..0633b7288b 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -6,15 +6,11 @@ import Link from "next/link"; import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; import { useState } from "react"; import { Controller, useForm, useFormContext } from "react-hook-form"; -import { MultiValue } from "react-select"; +import type { MultiValue } from "react-select"; import { z } from "zod"; -import { - EventLocationType, - getEventLocationType, - MeetLocationType, - LocationType, -} from "@calcom/app-store/locations"; +import type { EventLocationType } from "@calcom/app-store/locations"; +import { getEventLocationType, MeetLocationType, LocationType } from "@calcom/app-store/locations"; import { CAL_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { slugify } from "@calcom/lib/slugify"; @@ -22,10 +18,8 @@ import { Button, Label, Select, SettingsToggle, Skeleton, TextField } from "@cal import { FiEdit2, FiCheck, FiX, FiPlus } from "@calcom/ui/components/icon"; import { EditLocationDialog } from "@components/dialog/EditLocationDialog"; -import LocationSelect, { - SingleValueLocationOption, - LocationOption, -} from "@components/ui/form/LocationSelect"; +import type { SingleValueLocationOption, LocationOption } from "@components/ui/form/LocationSelect"; +import LocationSelect from "@components/ui/form/LocationSelect"; const getLocationFromType = ( type: EventLocationType["type"], @@ -81,7 +75,7 @@ export const EventSetupTab = ( setShowLocationModal(true); }; - const removeLocation = (selectedLocation: typeof eventType.locations[number]) => { + const removeLocation = (selectedLocation: (typeof eventType.locations)[number]) => { formMethods.setValue( "locations", formMethods.getValues("locations").filter((location) => { diff --git a/apps/web/components/eventtype/EventTeamTab.tsx b/apps/web/components/eventtype/EventTeamTab.tsx index afe0b0ba49..1014ac0d0c 100644 --- a/apps/web/components/eventtype/EventTeamTab.tsx +++ b/apps/web/components/eventtype/EventTeamTab.tsx @@ -1,12 +1,12 @@ import { SchedulingType } from "@prisma/client"; -import { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; -import { ComponentProps } from "react"; -import { Controller, useFormContext, useWatch, Control } from "react-hook-form"; -import { Options } from "react-select"; +import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; +import type { ComponentProps } from "react"; +import type { Control } from "react-hook-form"; +import { Controller, useFormContext, useWatch } from "react-hook-form"; +import type { Options } from "react-select"; -import CheckedTeamSelect, { - CheckedSelectOption, -} from "@calcom/features/eventtypes/components/CheckedTeamSelect"; +import type { CheckedSelectOption } from "@calcom/features/eventtypes/components/CheckedTeamSelect"; +import CheckedTeamSelect from "@calcom/features/eventtypes/components/CheckedTeamSelect"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Label, Select } from "@calcom/ui"; diff --git a/apps/web/components/eventtype/EventTeamWebhooksTab.tsx b/apps/web/components/eventtype/EventTeamWebhooksTab.tsx index 54eeb2b8f8..4a293c4745 100644 --- a/apps/web/components/eventtype/EventTeamWebhooksTab.tsx +++ b/apps/web/components/eventtype/EventTeamWebhooksTab.tsx @@ -1,13 +1,13 @@ -import { EventTypeSetupProps } from "pages/event-types/[type]"; +import type { EventTypeSetupProps } from "pages/event-types/[type]"; import { useState } from "react"; import { TbWebhook } from "react-icons/tb"; import { WebhookForm } from "@calcom/features/webhooks/components"; -import { WebhookFormSubmitData } from "@calcom/features/webhooks/components/WebhookForm"; +import type { WebhookFormSubmitData } from "@calcom/features/webhooks/components/WebhookForm"; import WebhookListItem from "@calcom/features/webhooks/components/WebhookListItem"; import { APP_NAME } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Webhook } from "@calcom/prisma/client"; +import type { Webhook } from "@calcom/prisma/client"; import { trpc } from "@calcom/trpc/react"; import { Button, Dialog, DialogContent, EmptyScreen, showToast } from "@calcom/ui"; import { FiPlus } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/eventtype/EventTypeSingleLayout.tsx b/apps/web/components/eventtype/EventTypeSingleLayout.tsx index 6afeea1dff..f291693965 100644 --- a/apps/web/components/eventtype/EventTypeSingleLayout.tsx +++ b/apps/web/components/eventtype/EventTypeSingleLayout.tsx @@ -1,8 +1,8 @@ -import { TFunction } from "next-i18next"; +import type { TFunction } from "next-i18next"; import { useRouter } from "next/router"; -import { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; +import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; import { useMemo, useState, Suspense } from "react"; -import { UseFormReturn } from "react-hook-form"; +import type { UseFormReturn } from "react-hook-form"; import { TbWebhook } from "react-icons/tb"; import Shell from "@calcom/features/shell/Shell"; diff --git a/apps/web/components/eventtype/RequiresConfirmationController.tsx b/apps/web/components/eventtype/RequiresConfirmationController.tsx index 2be9a06891..bc628b9be0 100644 --- a/apps/web/components/eventtype/RequiresConfirmationController.tsx +++ b/apps/web/components/eventtype/RequiresConfirmationController.tsx @@ -1,13 +1,14 @@ import * as RadioGroup from "@radix-ui/react-radio-group"; -import { UnitTypeLongPlural } from "dayjs"; +import type { UnitTypeLongPlural } from "dayjs"; import { Trans } from "next-i18next"; import type { FormValues } from "pages/event-types/[type]"; -import { Dispatch, SetStateAction, useEffect, useState } from "react"; +import type { Dispatch, SetStateAction } from "react"; +import { useEffect, useState } from "react"; import { Controller, useFormContext } from "react-hook-form"; -import z from "zod"; +import type z from "zod"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; +import type { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { Alert, Input, Label, SettingsToggle } from "@calcom/ui"; type RequiresConfirmationControllerProps = { diff --git a/apps/web/components/getting-started/components/CreateEventsOnCalendarSelect.tsx b/apps/web/components/getting-started/components/CreateEventsOnCalendarSelect.tsx index e170a7763e..5aa3edffa3 100644 --- a/apps/web/components/getting-started/components/CreateEventsOnCalendarSelect.tsx +++ b/apps/web/components/getting-started/components/CreateEventsOnCalendarSelect.tsx @@ -1,5 +1,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterInputs, trpc } from "@calcom/trpc/react"; +import type { RouterInputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import DestinationCalendarSelector from "@components/DestinationCalendarSelector"; diff --git a/apps/web/components/getting-started/steps-views/SetupAvailability.tsx b/apps/web/components/getting-started/steps-views/SetupAvailability.tsx index 25cac4fe45..38a3a8675b 100644 --- a/apps/web/components/getting-started/steps-views/SetupAvailability.tsx +++ b/apps/web/components/getting-started/steps-views/SetupAvailability.tsx @@ -5,8 +5,9 @@ import { useForm } from "react-hook-form"; import { Schedule } from "@calcom/features/schedules"; import { DEFAULT_SCHEDULE } from "@calcom/lib/availability"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { trpc, TRPCClientErrorLike } from "@calcom/trpc/react"; -import { AppRouter } from "@calcom/trpc/server/routers/_app"; +import type { TRPCClientErrorLike } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; +import type { AppRouter } from "@calcom/trpc/server/routers/_app"; import { Button, Form } from "@calcom/ui"; interface ISetupAvailabilityProps { diff --git a/apps/web/components/getting-started/steps-views/UserProfile.tsx b/apps/web/components/getting-started/steps-views/UserProfile.tsx index cd2abba87b..0e4e894fd7 100644 --- a/apps/web/components/getting-started/steps-views/UserProfile.tsx +++ b/apps/web/components/getting-started/steps-views/UserProfile.tsx @@ -1,7 +1,8 @@ import { ArrowRightIcon } from "@heroicons/react/solid"; import MarkdownIt from "markdown-it"; import { useRouter } from "next/router"; -import { FormEvent, useRef, useState } from "react"; +import type { FormEvent } from "react"; +import { useRef, useState } from "react"; import { useForm } from "react-hook-form"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/integrations/SubHeadingTitleWithConnections.tsx b/apps/web/components/integrations/SubHeadingTitleWithConnections.tsx index 44178c6aa5..bc9e4d5a6a 100644 --- a/apps/web/components/integrations/SubHeadingTitleWithConnections.tsx +++ b/apps/web/components/integrations/SubHeadingTitleWithConnections.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { Badge } from "@calcom/ui"; diff --git a/apps/web/components/security/ChangePasswordSection.tsx b/apps/web/components/security/ChangePasswordSection.tsx index 93cfce7e2e..e64d68285a 100644 --- a/apps/web/components/security/ChangePasswordSection.tsx +++ b/apps/web/components/security/ChangePasswordSection.tsx @@ -1,4 +1,5 @@ -import { SyntheticEvent, useState } from "react"; +import type { SyntheticEvent } from "react"; +import { useState } from "react"; import { ErrorCode } from "@calcom/lib/auth"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/security/EnableTwoFactorModal.tsx b/apps/web/components/security/EnableTwoFactorModal.tsx index 9dfdcb7d13..ba787152a7 100644 --- a/apps/web/components/security/EnableTwoFactorModal.tsx +++ b/apps/web/components/security/EnableTwoFactorModal.tsx @@ -1,4 +1,5 @@ -import React, { BaseSyntheticEvent, useState } from "react"; +import type { BaseSyntheticEvent } from "react"; +import React, { useState } from "react"; import { useForm } from "react-hook-form"; import { ErrorCode } from "@calcom/lib/auth"; diff --git a/apps/web/components/settings/EnableTwoFactorModal.tsx b/apps/web/components/settings/EnableTwoFactorModal.tsx index 5e800b0a1f..ef4060864d 100644 --- a/apps/web/components/settings/EnableTwoFactorModal.tsx +++ b/apps/web/components/settings/EnableTwoFactorModal.tsx @@ -1,4 +1,5 @@ -import React, { BaseSyntheticEvent, useState } from "react"; +import type { BaseSyntheticEvent } from "react"; +import React, { useState } from "react"; import { useForm } from "react-hook-form"; import { ErrorCode } from "@calcom/lib/auth"; diff --git a/apps/web/components/setup/EnterpriseLicense.tsx b/apps/web/components/setup/EnterpriseLicense.tsx index 88fded6c58..4f596891da 100644 --- a/apps/web/components/setup/EnterpriseLicense.tsx +++ b/apps/web/components/setup/EnterpriseLicense.tsx @@ -7,7 +7,8 @@ import * as z from "zod"; import { classNames } from "@calcom/lib"; import { CONSOLE_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterInputs, RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterInputs, RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import { Button, TextField } from "@calcom/ui"; import { FiCheck, FiExternalLink, FiLoader } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/setup/StepDone.tsx b/apps/web/components/setup/StepDone.tsx index 88c8b004c7..c4ca401efa 100644 --- a/apps/web/components/setup/StepDone.tsx +++ b/apps/web/components/setup/StepDone.tsx @@ -1,5 +1,5 @@ import { useRouter } from "next/router"; -import { Dispatch, SetStateAction } from "react"; +import type { Dispatch, SetStateAction } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { FiCheck } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/team/screens/Team.tsx b/apps/web/components/team/screens/Team.tsx index c3527cc6fc..f8b245ac9e 100644 --- a/apps/web/components/team/screens/Team.tsx +++ b/apps/web/components/team/screens/Team.tsx @@ -1,6 +1,6 @@ import MarkdownIt from "markdown-it"; import Link from "next/link"; -import { TeamPageProps } from "pages/team/[slug]"; +import type { TeamPageProps } from "pages/team/[slug]"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/components/ui/AdminRequired.tsx b/apps/web/components/ui/AdminRequired.tsx index 97b33f4e40..34458396b0 100644 --- a/apps/web/components/ui/AdminRequired.tsx +++ b/apps/web/components/ui/AdminRequired.tsx @@ -1,5 +1,6 @@ import { useSession } from "next-auth/react"; -import { FC, Fragment } from "react"; +import type { FC } from "react"; +import { Fragment } from "react"; type AdminRequiredProps = { as?: keyof JSX.IntrinsicElements; diff --git a/apps/web/components/ui/EditableHeading.tsx b/apps/web/components/ui/EditableHeading.tsx index 9d36025d27..fa57a8e428 100644 --- a/apps/web/components/ui/EditableHeading.tsx +++ b/apps/web/components/ui/EditableHeading.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import { useState } from "react"; -import { ControllerRenderProps } from "react-hook-form"; +import type { ControllerRenderProps } from "react-hook-form"; import { FiEdit2 } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/ui/LinkIconButton.tsx b/apps/web/components/ui/LinkIconButton.tsx index 7835330edb..00ca1e926e 100644 --- a/apps/web/components/ui/LinkIconButton.tsx +++ b/apps/web/components/ui/LinkIconButton.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { SVGComponent } from "@lib/types/SVGComponent"; +import type { SVGComponent } from "@lib/types/SVGComponent"; interface LinkIconButtonProps extends React.ButtonHTMLAttributes { Icon: SVGComponent; diff --git a/apps/web/components/ui/ModalContainer.tsx b/apps/web/components/ui/ModalContainer.tsx index 03d061fc11..a55e63cc11 100644 --- a/apps/web/components/ui/ModalContainer.tsx +++ b/apps/web/components/ui/ModalContainer.tsx @@ -1,5 +1,6 @@ import classNames from "classnames"; -import React, { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; +import React from "react"; import { Dialog, DialogContent } from "@calcom/ui"; diff --git a/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx b/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx index 88eb17bf29..3d81133c51 100644 --- a/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx +++ b/apps/web/components/ui/UsernameAvailability/PremiumTextfield.tsx @@ -1,15 +1,17 @@ import classNames from "classnames"; import { debounce, noop } from "lodash"; import { useRouter } from "next/router"; -import { RefCallback, useEffect, useMemo, useState } from "react"; +import type { RefCallback } from "react"; +import { useEffect, useMemo, useState } from "react"; import { getPremiumPlanPriceValue } from "@calcom/app-store/stripepayment/lib/utils"; import { fetchUsername } from "@calcom/lib/fetchUsername"; import hasKeyInMetadata from "@calcom/lib/hasKeyInMetadata"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { User } from "@calcom/prisma/client"; -import { TRPCClientErrorLike } from "@calcom/trpc/client"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { User } from "@calcom/prisma/client"; +import type { TRPCClientErrorLike } from "@calcom/trpc/client"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import type { AppRouter } from "@calcom/trpc/server/routers/_app"; import { Button, Dialog, DialogClose, DialogContent, DialogHeader, Input, Label } from "@calcom/ui"; import { FiCheck, FiEdit2, FiExternalLink, StarIconSolid } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx b/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx index 4ccc5b1296..f672b94c70 100644 --- a/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx +++ b/apps/web/components/ui/UsernameAvailability/UsernameTextfield.tsx @@ -1,12 +1,13 @@ import classNames from "classnames"; import { debounce, noop } from "lodash"; -import { RefCallback, useEffect, useMemo, useState } from "react"; +import type { RefCallback } from "react"; +import { useEffect, useMemo, useState } from "react"; import { fetchUsername } from "@calcom/lib/fetchUsername"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { TRPCClientErrorLike } from "@calcom/trpc/client"; +import type { TRPCClientErrorLike } from "@calcom/trpc/client"; import { trpc } from "@calcom/trpc/react"; -import { AppRouter } from "@calcom/trpc/server/routers/_app"; +import type { AppRouter } from "@calcom/trpc/server/routers/_app"; import { Button, Dialog, DialogClose, DialogContent, DialogHeader, TextField } from "@calcom/ui"; import { FiCheck, FiEdit2 } from "@calcom/ui/components/icon"; diff --git a/apps/web/components/ui/UsernameAvailability/index.tsx b/apps/web/components/ui/UsernameAvailability/index.tsx index 2a673e2ea2..d2c1c9c5b1 100644 --- a/apps/web/components/ui/UsernameAvailability/index.tsx +++ b/apps/web/components/ui/UsernameAvailability/index.tsx @@ -3,9 +3,9 @@ import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { IS_SELF_HOSTED } from "@calcom/lib/constants"; -import { User } from "@calcom/prisma/client"; -import { TRPCClientErrorLike } from "@calcom/trpc/client"; -import { AppRouter } from "@calcom/trpc/server/routers/_app"; +import type { User } from "@calcom/prisma/client"; +import type { TRPCClientErrorLike } from "@calcom/trpc/client"; +import type { AppRouter } from "@calcom/trpc/server/routers/_app"; import useRouterQuery from "@lib/hooks/useRouterQuery"; diff --git a/apps/web/components/ui/form/CheckboxField.tsx b/apps/web/components/ui/form/CheckboxField.tsx index edb92232f2..ba735bb89a 100644 --- a/apps/web/components/ui/form/CheckboxField.tsx +++ b/apps/web/components/ui/form/CheckboxField.tsx @@ -1,4 +1,5 @@ -import React, { forwardRef, InputHTMLAttributes } from "react"; +import type { InputHTMLAttributes } from "react"; +import React, { forwardRef } from "react"; import classNames from "@calcom/lib/classNames"; diff --git a/apps/web/components/ui/form/CheckedSelect.tsx b/apps/web/components/ui/form/CheckedSelect.tsx index 42225e6613..a44c00bab3 100644 --- a/apps/web/components/ui/form/CheckedSelect.tsx +++ b/apps/web/components/ui/form/CheckedSelect.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Props } from "react-select"; +import type { Props } from "react-select"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Avatar } from "@calcom/ui"; diff --git a/apps/web/components/ui/form/LocationSelect.tsx b/apps/web/components/ui/form/LocationSelect.tsx index 310826593b..60b2e838da 100644 --- a/apps/web/components/ui/form/LocationSelect.tsx +++ b/apps/web/components/ui/form/LocationSelect.tsx @@ -1,4 +1,5 @@ -import { components, GroupBase, Props, SingleValue } from "react-select"; +import type { GroupBase, Props, SingleValue } from "react-select"; +import { components } from "react-select"; import type { EventLocationType } from "@calcom/app-store/locations"; import { classNames } from "@calcom/lib"; diff --git a/apps/web/components/ui/form/MinutesField.tsx b/apps/web/components/ui/form/MinutesField.tsx index 16b5786f55..8924431ad8 100644 --- a/apps/web/components/ui/form/MinutesField.tsx +++ b/apps/web/components/ui/form/MinutesField.tsx @@ -1,5 +1,6 @@ import classNames from "classnames"; -import React, { forwardRef, InputHTMLAttributes, ReactNode } from "react"; +import type { InputHTMLAttributes, ReactNode } from "react"; +import React, { forwardRef } from "react"; type Props = InputHTMLAttributes & { label?: ReactNode; diff --git a/apps/web/components/ui/form/Select.tsx b/apps/web/components/ui/form/Select.tsx index b1e552518e..2005ab60a0 100644 --- a/apps/web/components/ui/form/Select.tsx +++ b/apps/web/components/ui/form/Select.tsx @@ -1,5 +1,6 @@ import React, { useCallback, useEffect, useState } from "react"; -import ReactSelect, { components, GroupBase, Props, InputProps, SingleValue, MultiValue } from "react-select"; +import type { GroupBase, Props, InputProps, SingleValue, MultiValue } from "react-select"; +import ReactSelect, { components } from "react-select"; import classNames from "@calcom/lib/classNames"; import useTheme from "@calcom/lib/hooks/useTheme"; diff --git a/apps/web/lib/QueryCell.tsx b/apps/web/lib/QueryCell.tsx index acefdc2884..aeeeedb007 100644 --- a/apps/web/lib/QueryCell.tsx +++ b/apps/web/lib/QueryCell.tsx @@ -1,11 +1,11 @@ -import { +import type { QueryObserverLoadingErrorResult, QueryObserverLoadingResult, QueryObserverRefetchErrorResult, QueryObserverSuccessResult, UseQueryResult, } from "@tanstack/react-query"; -import { ReactNode } from "react"; +import type { ReactNode } from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { TRPCClientErrorLike } from "@calcom/trpc/client"; diff --git a/apps/web/lib/app-providers.tsx b/apps/web/lib/app-providers.tsx index 78b43d3d59..b302f7336f 100644 --- a/apps/web/lib/app-providers.tsx +++ b/apps/web/lib/app-providers.tsx @@ -1,11 +1,12 @@ import { TooltipProvider } from "@radix-ui/react-tooltip"; import { SessionProvider } from "next-auth/react"; import { EventCollectionProvider } from "next-collect/client"; -import { appWithTranslation, SSRConfig } from "next-i18next"; +import type { SSRConfig } from "next-i18next"; +import { appWithTranslation } from "next-i18next"; import { ThemeProvider } from "next-themes"; import type { AppProps as NextAppProps, AppProps as NextJsAppProps } from "next/app"; -import { NextRouter } from "next/router"; -import { ComponentProps, ReactNode } from "react"; +import type { NextRouter } from "next/router"; +import type { ComponentProps, ReactNode } from "react"; import DynamicHelpscoutProvider from "@calcom/features/ee/support/lib/helpscout/providerDynamic"; import DynamicIntercomProvider from "@calcom/features/ee/support/lib/intercom/providerDynamic"; @@ -13,7 +14,7 @@ import { trpc } from "@calcom/trpc/react"; import { MetaProvider } from "@calcom/ui"; import usePublicPage from "@lib/hooks/usePublicPage"; -import { WithNonceProps } from "@lib/withNonce"; +import type { WithNonceProps } from "@lib/withNonce"; const I18nextAdapter = appWithTranslation & { children: React.ReactNode }>( ({ children }) => <>{children} diff --git a/apps/web/lib/auth.ts b/apps/web/lib/auth.ts index 32f3d85bc3..cf2267e208 100644 --- a/apps/web/lib/auth.ts +++ b/apps/web/lib/auth.ts @@ -1,7 +1,8 @@ import { IdentityProvider } from "@prisma/client"; import { compare, hash } from "bcryptjs"; -import { Session } from "next-auth"; -import { getSession as getSessionInner, GetSessionParams } from "next-auth/react"; +import type { Session } from "next-auth"; +import type { GetSessionParams } from "next-auth/react"; +import { getSession as getSessionInner } from "next-auth/react"; /** @deprecated use the one from `@calcom/lib/auth` */ export async function hashPassword(password: string) { diff --git a/apps/web/lib/auth/next-auth-custom-adapter.ts b/apps/web/lib/auth/next-auth-custom-adapter.ts index 64aded038a..cfa3c733b8 100644 --- a/apps/web/lib/auth/next-auth-custom-adapter.ts +++ b/apps/web/lib/auth/next-auth-custom-adapter.ts @@ -1,4 +1,11 @@ -import { Account, IdentityProvider, Prisma, PrismaClient, User, VerificationToken } from "@prisma/client"; +import type { + Account, + IdentityProvider, + Prisma, + PrismaClient, + User, + VerificationToken, +} from "@prisma/client"; import { PrismaClientKnownRequestError } from "@prisma/client/runtime"; import { identityProviderNameMap } from "@lib/auth"; diff --git a/apps/web/lib/config/next-seo.config.ts b/apps/web/lib/config/next-seo.config.ts index 7e3e68f00d..d58c47d542 100644 --- a/apps/web/lib/config/next-seo.config.ts +++ b/apps/web/lib/config/next-seo.config.ts @@ -1,4 +1,4 @@ -import { DefaultSeoProps, NextSeoProps } from "next-seo"; +import type { DefaultSeoProps, NextSeoProps } from "next-seo"; import { APP_NAME, SEO_IMG_DEFAULT, SEO_IMG_OGIMG } from "@calcom/lib/constants"; diff --git a/apps/web/lib/core/i18n/i18n.utils.ts b/apps/web/lib/core/i18n/i18n.utils.ts index 9a4353a3a4..d951f68149 100644 --- a/apps/web/lib/core/i18n/i18n.utils.ts +++ b/apps/web/lib/core/i18n/i18n.utils.ts @@ -1,7 +1,7 @@ import parser from "accept-language-parser"; -import { IncomingMessage } from "http"; +import type { IncomingMessage } from "http"; -import { Maybe } from "@calcom/trpc/server"; +import type { Maybe } from "@calcom/trpc/server"; import { getSession } from "@lib/auth"; diff --git a/apps/web/lib/csp.ts b/apps/web/lib/csp.ts index 8505f99dc7..56deedd0a2 100644 --- a/apps/web/lib/csp.ts +++ b/apps/web/lib/csp.ts @@ -1,5 +1,5 @@ import crypto from "crypto"; -import { IncomingMessage, OutgoingMessage } from "http"; +import type { IncomingMessage, OutgoingMessage } from "http"; import { z } from "zod"; import { IS_PRODUCTION } from "@calcom/lib/constants"; diff --git a/apps/web/lib/getBooking.tsx b/apps/web/lib/getBooking.tsx index 87be46b45d..953422f67e 100644 --- a/apps/web/lib/getBooking.tsx +++ b/apps/web/lib/getBooking.tsx @@ -1,9 +1,9 @@ -import { Prisma, PrismaClient } from "@prisma/client"; -import { z } from "zod"; +import type { Prisma, PrismaClient } from "@prisma/client"; +import type { z } from "zod"; import { getBookingResponsesPartialSchema } from "@calcom/features/bookings/lib/getBookingResponsesSchema"; import slugify from "@calcom/lib/slugify"; -import { eventTypeBookingFields } from "@calcom/prisma/zod-utils"; +import type { eventTypeBookingFields } from "@calcom/prisma/zod-utils"; type BookingSelect = { description: true; diff --git a/apps/web/lib/mutations/bookings/create-booking.ts b/apps/web/lib/mutations/bookings/create-booking.ts index 70ace028ba..d0b677adab 100644 --- a/apps/web/lib/mutations/bookings/create-booking.ts +++ b/apps/web/lib/mutations/bookings/create-booking.ts @@ -1,7 +1,7 @@ -import { BookingCreateBody } from "@calcom/prisma/zod-utils"; +import type { BookingCreateBody } from "@calcom/prisma/zod-utils"; import * as fetch from "@lib/core/http/fetch-wrapper"; -import { BookingResponse } from "@lib/types/booking"; +import type { BookingResponse } from "@lib/types/booking"; type BookingCreateBodyForMutation = Omit; const createBooking = async (data: BookingCreateBodyForMutation) => { diff --git a/apps/web/lib/mutations/bookings/create-recurring-booking.ts b/apps/web/lib/mutations/bookings/create-recurring-booking.ts index f1debbbeb0..8cec5b82b4 100644 --- a/apps/web/lib/mutations/bookings/create-recurring-booking.ts +++ b/apps/web/lib/mutations/bookings/create-recurring-booking.ts @@ -1,8 +1,8 @@ -import { BookingCreateBody } from "@calcom/prisma/zod-utils"; -import { AppsStatus } from "@calcom/types/Calendar"; +import type { BookingCreateBody } from "@calcom/prisma/zod-utils"; +import type { AppsStatus } from "@calcom/types/Calendar"; import * as fetch from "@lib/core/http/fetch-wrapper"; -import { BookingResponse } from "@lib/types/booking"; +import type { BookingResponse } from "@lib/types/booking"; type ExtendedBookingCreateBody = BookingCreateBody & { noEmail?: boolean; diff --git a/apps/web/lib/parseDate.ts b/apps/web/lib/parseDate.ts index 0a141d2a84..5da576358e 100644 --- a/apps/web/lib/parseDate.ts +++ b/apps/web/lib/parseDate.ts @@ -1,7 +1,8 @@ -import { I18n } from "next-i18next"; +import type { I18n } from "next-i18next"; import { RRule } from "rrule"; -import dayjs, { Dayjs } from "@calcom/dayjs"; +import type { Dayjs } from "@calcom/dayjs"; +import dayjs from "@calcom/dayjs"; import { detectBrowserTimeFormat } from "@calcom/lib/timeFormat"; import type { RecurringEvent } from "@calcom/types/Calendar"; diff --git a/apps/web/lib/types/booking.ts b/apps/web/lib/types/booking.ts index 8eed9ad79f..ec70cb254c 100644 --- a/apps/web/lib/types/booking.ts +++ b/apps/web/lib/types/booking.ts @@ -1,6 +1,6 @@ -import { Attendee, Booking } from "@prisma/client"; +import type { Attendee, Booking } from "@prisma/client"; -import { AppsStatus } from "@calcom/types/Calendar"; +import type { AppsStatus } from "@calcom/types/Calendar"; export type BookingResponse = Booking & { paymentUid?: string; diff --git a/apps/web/lib/withEmbedSsr.tsx b/apps/web/lib/withEmbedSsr.tsx index 3f269f77bc..26c0be9bde 100644 --- a/apps/web/lib/withEmbedSsr.tsx +++ b/apps/web/lib/withEmbedSsr.tsx @@ -1,4 +1,4 @@ -import { GetServerSideProps, GetServerSidePropsContext, GetServerSidePropsResult } from "next"; +import type { GetServerSideProps, GetServerSidePropsContext, GetServerSidePropsResult } from "next"; export type EmbedProps = { isEmbed?: boolean; diff --git a/apps/web/lib/withNonce.tsx b/apps/web/lib/withNonce.tsx index a07f901b8f..b720daf3d0 100644 --- a/apps/web/lib/withNonce.tsx +++ b/apps/web/lib/withNonce.tsx @@ -1,4 +1,4 @@ -import { GetServerSideProps, GetServerSidePropsContext } from "next"; +import type { GetServerSideProps, GetServerSidePropsContext } from "next"; import { csp } from "@lib/csp"; diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index 143445d58b..ca5eb7e6a4 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -1,6 +1,7 @@ import { get } from "@vercel/edge-config"; import { collectEvents } from "next-collect/server"; -import { NextMiddleware, NextResponse, userAgent } from "next/server"; +import type { NextMiddleware } from "next/server"; +import { NextResponse, userAgent } from "next/server"; import { CONSOLE_URL, WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants"; import { isIpInBanlist } from "@calcom/lib/getIP"; diff --git a/apps/web/package.json b/apps/web/package.json index 89db8fafb3..a85770f508 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -50,7 +50,7 @@ "@radix-ui/react-dialog": "^1.0.0", "@radix-ui/react-dropdown-menu": "^1.0.0", "@radix-ui/react-id": "^1.0.0", - "@radix-ui/react-popover": "^1.0.0", + "@radix-ui/react-popover": "^1.0.2", "@radix-ui/react-radio-group": "^1.0.0", "@radix-ui/react-slider": "^1.0.0", "@radix-ui/react-switch": "^1.0.0", @@ -69,7 +69,7 @@ "bcryptjs": "^2.4.3", "classnames": "^2.3.1", "dotenv-cli": "^6.0.0", - "eslint-config-next": "^13.1.1", + "eslint-config-next": "^13.1.6", "googleapis": "^84.0.0", "gray-matter": "^4.0.3", "handlebars": "^4.7.7", @@ -81,10 +81,10 @@ "lottie-react": "^2.3.1", "markdown-it": "^13.0.1", "memory-cache": "^0.2.0", - "micro": "^9.4.1", + "micro": "^10.0.1", "mime-types": "^2.1.35", "next": "^13.1.1", - "next-auth": "^4.10.3", + "next-auth": "^4.18.8", "next-axiom": "^0.16.0", "next-collect": "^0.2.1", "next-i18next": "^11.3.0", @@ -146,7 +146,7 @@ "@types/node": "16.9.1", "@types/nodemailer": "^6.4.5", "@types/qrcode": "^1.4.3", - "@types/react": "^18.0.17", + "@types/react": "18.0.26", "@types/react-phone-number-input": "^3.0.14", "@types/react-virtualized-auto-sizer": "^1.0.1", "@types/react-window": "^1.8.5", @@ -157,7 +157,7 @@ "copy-webpack-plugin": "^11.0.0", "detect-port": "^1.3.0", "env-cmd": "^10.1.0", - "eslint": "^8.22.0", + "eslint": "^8.34.0", "mockdate": "^3.0.5", "module-alias": "^2.2.2", "msw": "^0.42.3", diff --git a/apps/web/pages/404.tsx b/apps/web/pages/404.tsx index 5aa7f89cfd..7d7abeef0e 100644 --- a/apps/web/pages/404.tsx +++ b/apps/web/pages/404.tsx @@ -1,4 +1,4 @@ -import { GetStaticPropsContext } from "next"; +import type { GetStaticPropsContext } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx index cbeb12b59c..88f4c4f88f 100644 --- a/apps/web/pages/[user].tsx +++ b/apps/web/pages/[user].tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import MarkdownIt from "markdown-it"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect } from "react"; @@ -30,8 +30,8 @@ import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { HeadSeo, AvatarGroup, Avatar } from "@calcom/ui"; import { BadgeCheckIcon, FiArrowRight } from "@calcom/ui/components/icon"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; -import { EmbedProps } from "@lib/withEmbedSsr"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { EmbedProps } from "@lib/withEmbedSsr"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/[user]/[type].tsx b/apps/web/pages/[user]/[type].tsx index 998f4d0967..11c4da78a4 100644 --- a/apps/web/pages/[user]/[type].tsx +++ b/apps/web/pages/[user]/[type].tsx @@ -1,15 +1,16 @@ import MarkdownIt from "markdown-it"; -import { GetStaticPaths, GetStaticPropsContext } from "next"; +import type { GetStaticPaths, GetStaticPropsContext } from "next"; import { z } from "zod"; -import { privacyFilteredLocations, LocationObject } from "@calcom/app-store/locations"; +import type { LocationObject } from "@calcom/app-store/locations"; +import { privacyFilteredLocations } from "@calcom/app-store/locations"; import { getAppFromSlug } from "@calcom/app-store/utils"; import { IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants"; import { getDefaultEvent, getGroupName, getUsernameList } from "@calcom/lib/defaultEvents"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent"; import prisma from "@calcom/prisma"; -import { User } from "@calcom/prisma/client"; +import type { User } from "@calcom/prisma/client"; import { EventTypeMetaDataSchema, teamMetadataSchema, @@ -17,8 +18,8 @@ import { } from "@calcom/prisma/zod-utils"; import { isBrandingHidden } from "@lib/isBrandingHidden"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; -import { EmbedProps } from "@lib/withEmbedSsr"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { EmbedProps } from "@lib/withEmbedSsr"; import AvailabilityPage from "@components/booking/pages/AvailabilityPage"; @@ -132,7 +133,7 @@ async function getUserPageProps(context: GetStaticPropsContext) { if (!user || !user.eventTypes.length) return { notFound: true }; - const [eventType]: (typeof user.eventTypes[number] & { + const [eventType]: ((typeof user.eventTypes)[number] & { users: Pick[]; })[] = [ { diff --git a/apps/web/pages/[user]/[type]/embed.tsx b/apps/web/pages/[user]/[type]/embed.tsx index 4b701ce151..31d34e03f4 100644 --- a/apps/web/pages/[user]/[type]/embed.tsx +++ b/apps/web/pages/[user]/[type]/embed.tsx @@ -1,4 +1,4 @@ -import { GetStaticPropsContext } from "next"; +import type { GetStaticPropsContext } from "next"; import { getStaticProps as _getStaticProps } from "../[type]"; diff --git a/apps/web/pages/[user]/book.tsx b/apps/web/pages/[user]/book.tsx index fe382dc389..6886395074 100644 --- a/apps/web/pages/[user]/book.tsx +++ b/apps/web/pages/[user]/book.tsx @@ -1,6 +1,7 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; -import { LocationObject, privacyFilteredLocations } from "@calcom/app-store/locations"; +import type { LocationObject } from "@calcom/app-store/locations"; +import { privacyFilteredLocations } from "@calcom/app-store/locations"; import { getAppFromSlug } from "@calcom/app-store/utils"; import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields"; import { parseRecurringEvent } from "@calcom/lib"; @@ -20,8 +21,9 @@ import { } from "@calcom/prisma/zod-utils"; import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull"; -import getBooking, { GetBookingType } from "@lib/getBooking"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { GetBookingType } from "@lib/getBooking"; +import getBooking from "@lib/getBooking"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import BookingPage from "@components/booking/pages/BookingPage"; diff --git a/apps/web/pages/[user]/calendar-cache/[month].tsx b/apps/web/pages/[user]/calendar-cache/[month].tsx index 423eedc054..d1a8bfbf54 100644 --- a/apps/web/pages/[user]/calendar-cache/[month].tsx +++ b/apps/web/pages/[user]/calendar-cache/[month].tsx @@ -3,7 +3,7 @@ * caching system that NextJS uses SSG pages. * TODO: Redirect to user profile on browser */ -import { GetStaticPaths, GetStaticProps } from "next"; +import type { GetStaticPaths, GetStaticProps } from "next"; import { z } from "zod"; import { getCachedResults } from "@calcom/core"; diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index c83f7c88b4..a086947b01 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -6,7 +6,8 @@ import "@calcom/embed-core/src/embed-iframe"; import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; import { trpc } from "@calcom/trpc/react"; -import AppProviders, { AppProps } from "@lib/app-providers"; +import type { AppProps } from "@lib/app-providers"; +import AppProviders from "@lib/app-providers"; import { seoConfig } from "@lib/config/next-seo.config"; import I18nLanguageHandler from "@components/I18nLanguageHandler"; diff --git a/apps/web/pages/_document.tsx b/apps/web/pages/_document.tsx index c5a42edc03..eddbff9943 100644 --- a/apps/web/pages/_document.tsx +++ b/apps/web/pages/_document.tsx @@ -1,4 +1,5 @@ -import Document, { DocumentContext, Head, Html, Main, NextScript, DocumentProps } from "next/document"; +import type { DocumentContext, DocumentProps } from "next/document"; +import Document, { Head, Html, Main, NextScript } from "next/document"; import Script from "next/script"; import { z } from "zod"; diff --git a/apps/web/pages/_error.tsx b/apps/web/pages/_error.tsx index bc98d49d22..528294e7a5 100644 --- a/apps/web/pages/_error.tsx +++ b/apps/web/pages/_error.tsx @@ -3,8 +3,9 @@ * @link https://nextjs.org/docs/advanced-features/custom-error-page */ import * as Sentry from "@sentry/nextjs"; -import { NextPage, NextPageContext } from "next"; -import NextError, { ErrorProps } from "next/error"; +import type { NextPage, NextPageContext } from "next"; +import type { ErrorProps } from "next/error"; +import NextError from "next/error"; import React from "react"; import { getErrorFromUnknown } from "@calcom/lib/errors"; diff --git a/apps/web/pages/api/auth/[...nextauth].tsx b/apps/web/pages/api/auth/[...nextauth].tsx index 54976e8202..4030bdbd6d 100644 --- a/apps/web/pages/api/auth/[...nextauth].tsx +++ b/apps/web/pages/api/auth/[...nextauth].tsx @@ -1,13 +1,16 @@ -import { IdentityProvider, UserPermissionRole } from "@prisma/client"; +import type { UserPermissionRole } from "@prisma/client"; +import { IdentityProvider } from "@prisma/client"; import { readFileSync } from "fs"; import Handlebars from "handlebars"; -import NextAuth, { Session } from "next-auth"; +import type { Session } from "next-auth"; +import NextAuth from "next-auth"; import { encode } from "next-auth/jwt"; -import { Provider } from "next-auth/providers"; +import type { Provider } from "next-auth/providers"; import CredentialsProvider from "next-auth/providers/credentials"; import EmailProvider from "next-auth/providers/email"; import GoogleProvider from "next-auth/providers/google"; -import nodemailer, { TransportOptions } from "nodemailer"; +import type { TransportOptions } from "nodemailer"; +import nodemailer from "nodemailer"; import { authenticator } from "otplib"; import path from "path"; diff --git a/apps/web/pages/api/auth/forgot-password.ts b/apps/web/pages/api/auth/forgot-password.ts index 2e31ebace5..c9bd079797 100644 --- a/apps/web/pages/api/auth/forgot-password.ts +++ b/apps/web/pages/api/auth/forgot-password.ts @@ -1,5 +1,5 @@ -import { ResetPasswordRequest } from "@prisma/client"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { ResetPasswordRequest } from "@prisma/client"; +import type { NextApiRequest, NextApiResponse } from "next"; import dayjs from "@calcom/dayjs"; import { sendPasswordResetEmail } from "@calcom/emails"; diff --git a/apps/web/pages/api/auth/oidc.ts b/apps/web/pages/api/auth/oidc.ts index 1cd2af2c69..f8cd8799eb 100644 --- a/apps/web/pages/api/auth/oidc.ts +++ b/apps/web/pages/api/auth/oidc.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import jackson from "@calcom/features/ee/sso/lib/jackson"; diff --git a/apps/web/pages/api/auth/reset-password.ts b/apps/web/pages/api/auth/reset-password.ts index 16db8d1fa0..56504a505b 100644 --- a/apps/web/pages/api/auth/reset-password.ts +++ b/apps/web/pages/api/auth/reset-password.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import prisma from "@calcom/prisma"; diff --git a/apps/web/pages/api/auth/saml/authorize.ts b/apps/web/pages/api/auth/saml/authorize.ts index 7dd9acd865..8d42bec42e 100644 --- a/apps/web/pages/api/auth/saml/authorize.ts +++ b/apps/web/pages/api/auth/saml/authorize.ts @@ -1,9 +1,9 @@ -import { OAuthReq } from "@boxyhq/saml-jackson"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { OAuthReq } from "@boxyhq/saml-jackson"; +import type { NextApiRequest, NextApiResponse } from "next"; import jackson from "@calcom/features/ee/sso/lib/jackson"; -import { HttpError } from "@lib/core/http/error"; +import type { HttpError } from "@lib/core/http/error"; export default async function handler(req: NextApiRequest, res: NextApiResponse) { const { oauthController } = await jackson(); diff --git a/apps/web/pages/api/auth/saml/callback.ts b/apps/web/pages/api/auth/saml/callback.ts index f7c91928ff..fd51d97314 100644 --- a/apps/web/pages/api/auth/saml/callback.ts +++ b/apps/web/pages/api/auth/saml/callback.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import jackson from "@calcom/features/ee/sso/lib/jackson"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/apps/web/pages/api/auth/saml/token.ts b/apps/web/pages/api/auth/saml/token.ts index 703a010850..dce000f484 100644 --- a/apps/web/pages/api/auth/saml/token.ts +++ b/apps/web/pages/api/auth/saml/token.ts @@ -1,4 +1,4 @@ -import { NextApiRequest } from "next"; +import type { NextApiRequest } from "next"; import jackson from "@calcom/features/ee/sso/lib/jackson"; import { defaultHandler, defaultResponder } from "@calcom/lib/server"; diff --git a/apps/web/pages/api/auth/saml/userinfo.ts b/apps/web/pages/api/auth/saml/userinfo.ts index e408357a37..b2caa1691f 100644 --- a/apps/web/pages/api/auth/saml/userinfo.ts +++ b/apps/web/pages/api/auth/saml/userinfo.ts @@ -1,4 +1,4 @@ -import { NextApiRequest } from "next"; +import type { NextApiRequest } from "next"; import z from "zod"; import jackson from "@calcom/features/ee/sso/lib/jackson"; diff --git a/apps/web/pages/api/auth/setup.ts b/apps/web/pages/api/auth/setup.ts index c44caec059..fc5186bd29 100644 --- a/apps/web/pages/api/auth/setup.ts +++ b/apps/web/pages/api/auth/setup.ts @@ -1,5 +1,5 @@ import { IdentityProvider } from "@prisma/client"; -import { NextApiRequest } from "next"; +import type { NextApiRequest } from "next"; import z from "zod"; import { isPasswordValid } from "@calcom/lib/auth"; diff --git a/apps/web/pages/api/auth/signup.ts b/apps/web/pages/api/auth/signup.ts index a838f0d47d..5d098a772f 100644 --- a/apps/web/pages/api/auth/signup.ts +++ b/apps/web/pages/api/auth/signup.ts @@ -1,5 +1,5 @@ import { IdentityProvider } from "@prisma/client"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { hashPassword } from "@calcom/lib/auth"; import slugify from "@calcom/lib/slugify"; diff --git a/apps/web/pages/api/auth/two-factor/totp/disable.ts b/apps/web/pages/api/auth/two-factor/totp/disable.ts index 02e83a66f9..7dc0557225 100644 --- a/apps/web/pages/api/auth/two-factor/totp/disable.ts +++ b/apps/web/pages/api/auth/two-factor/totp/disable.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { authenticator } from "otplib"; import { symmetricDecrypt } from "@calcom/lib/crypto"; diff --git a/apps/web/pages/api/auth/two-factor/totp/enable.ts b/apps/web/pages/api/auth/two-factor/totp/enable.ts index 5a580a39cc..6f95a4b8a9 100644 --- a/apps/web/pages/api/auth/two-factor/totp/enable.ts +++ b/apps/web/pages/api/auth/two-factor/totp/enable.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { authenticator } from "otplib"; import { symmetricDecrypt } from "@calcom/lib/crypto"; diff --git a/apps/web/pages/api/auth/two-factor/totp/setup.ts b/apps/web/pages/api/auth/two-factor/totp/setup.ts index 565c5c3391..e40f5622f8 100644 --- a/apps/web/pages/api/auth/two-factor/totp/setup.ts +++ b/apps/web/pages/api/auth/two-factor/totp/setup.ts @@ -1,5 +1,5 @@ import { IdentityProvider } from "@prisma/client"; -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { authenticator } from "otplib"; import qrcode from "qrcode"; diff --git a/apps/web/pages/api/email.ts b/apps/web/pages/api/email.ts index 8681aa3d65..e353dfa4c6 100644 --- a/apps/web/pages/api/email.ts +++ b/apps/web/pages/api/email.ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { renderEmail } from "@calcom/emails"; import { getTranslation } from "@calcom/lib/server/i18n"; diff --git a/apps/web/pages/api/integrations/[...args].ts b/apps/web/pages/api/integrations/[...args].ts index b1598dfd3a..f72574cac6 100644 --- a/apps/web/pages/api/integrations/[...args].ts +++ b/apps/web/pages/api/integrations/[...args].ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import type { Session } from "next-auth"; import getInstalledAppPath from "@calcom/app-store/_utils/getInstalledAppPath"; diff --git a/apps/web/pages/api/revalidate-calendar-cache/[username].ts b/apps/web/pages/api/revalidate-calendar-cache/[username].ts index 1c37729466..3b42b64b46 100644 --- a/apps/web/pages/api/revalidate-calendar-cache/[username].ts +++ b/apps/web/pages/api/revalidate-calendar-cache/[username].ts @@ -1,4 +1,4 @@ -import { NextApiRequest, NextApiResponse } from "next"; +import type { NextApiRequest, NextApiResponse } from "next"; import { z } from "zod"; import { revalidateCalendarCache } from "@calcom/lib/server/revalidateCalendarCache"; diff --git a/apps/web/pages/api/social/og/image.tsx b/apps/web/pages/api/social/og/image.tsx index c82f97fc5e..6c71d8256a 100644 --- a/apps/web/pages/api/social/og/image.tsx +++ b/apps/web/pages/api/social/og/image.tsx @@ -1,5 +1,5 @@ import { ImageResponse } from "@vercel/og"; -import { NextApiRequest } from "next"; +import type { NextApiRequest } from "next"; import type { SatoriOptions } from "satori"; import { z } from "zod"; diff --git a/apps/web/pages/apps/[slug]/[...pages].tsx b/apps/web/pages/apps/[slug]/[...pages].tsx index 80c3fd0f6e..2c1729009a 100644 --- a/apps/web/pages/apps/[slug]/[...pages].tsx +++ b/apps/web/pages/apps/[slug]/[...pages].tsx @@ -1,12 +1,12 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useRouter } from "next/router"; import RoutingFormsRoutingConfig from "@calcom/app-store/ee/routing-forms/pages/app-routing.config"; import TypeformRoutingConfig from "@calcom/app-store/typeform/pages/app-routing.config"; import prisma from "@calcom/prisma"; -import { AppGetServerSideProps } from "@calcom/types/AppGetServerSideProps"; +import type { AppGetServerSideProps } from "@calcom/types/AppGetServerSideProps"; -import { AppProps } from "@lib/app-providers"; +import type { AppProps } from "@lib/app-providers"; import { getSession } from "@lib/auth"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/apps/[slug]/index.tsx b/apps/web/pages/apps/[slug]/index.tsx index 03c3ffe37b..fc6398cc1b 100644 --- a/apps/web/pages/apps/[slug]/index.tsx +++ b/apps/web/pages/apps/[slug]/index.tsx @@ -1,14 +1,14 @@ import fs from "fs"; import matter from "gray-matter"; import MarkdownIt from "markdown-it"; -import { GetStaticPaths, GetStaticPropsContext } from "next"; +import type { GetStaticPaths, GetStaticPropsContext } from "next"; import path from "path"; import { getAppWithMetadata } from "@calcom/app-store/_appRegistry"; import ExisitingGoogleCal from "@calcom/app-store/googlevideo/components/ExistingGoogleCal"; import prisma from "@calcom/prisma"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import App from "@components/apps/App"; diff --git a/apps/web/pages/apps/[slug]/setup.tsx b/apps/web/pages/apps/[slug]/setup.tsx index d72d29e2e2..f2d840d1a3 100644 --- a/apps/web/pages/apps/[slug]/setup.tsx +++ b/apps/web/pages/apps/[slug]/setup.tsx @@ -1,4 +1,4 @@ -import { GetStaticPaths, InferGetStaticPropsType } from "next"; +import type { GetStaticPaths, InferGetStaticPropsType } from "next"; import { useSession } from "next-auth/react"; import { useRouter } from "next/router"; diff --git a/apps/web/pages/apps/categories/[category].tsx b/apps/web/pages/apps/categories/[category].tsx index 1d0e638125..3829db7470 100644 --- a/apps/web/pages/apps/categories/[category].tsx +++ b/apps/web/pages/apps/categories/[category].tsx @@ -1,5 +1,5 @@ import { AppCategories } from "@prisma/client"; -import { GetStaticPropsContext, InferGetStaticPropsType } from "next"; +import type { GetStaticPropsContext, InferGetStaticPropsType } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/apps/web/pages/apps/categories/index.tsx b/apps/web/pages/apps/categories/index.tsx index 7cfbcef51c..0fc363b4e6 100644 --- a/apps/web/pages/apps/categories/index.tsx +++ b/apps/web/pages/apps/categories/index.tsx @@ -1,4 +1,4 @@ -import { InferGetStaticPropsType } from "next"; +import type { InferGetStaticPropsType } from "next"; import Link from "next/link"; import { getAppRegistry } from "@calcom/app-store/_appRegistry"; diff --git a/apps/web/pages/apps/index.tsx b/apps/web/pages/apps/index.tsx index b244b36997..974c1918c7 100644 --- a/apps/web/pages/apps/index.tsx +++ b/apps/web/pages/apps/index.tsx @@ -1,20 +1,15 @@ -import { GetServerSidePropsContext } from "next"; -import { ChangeEventHandler, useState } from "react"; +import type { GetServerSidePropsContext } from "next"; +import type { ChangeEventHandler } from "react"; +import { useState } from "react"; import { getAppRegistry, getAppRegistryWithCredentials } from "@calcom/app-store/_appRegistry"; import { classNames } from "@calcom/lib"; import { getSession } from "@calcom/lib/auth"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { AppCategories } from "@calcom/prisma/client"; -import { inferSSRProps } from "@calcom/types/inferSSRProps"; -import { - AllApps, - AppStoreCategories, - HorizontalTabItemProps, - HorizontalTabs, - TextField, - PopularAppsSlider, -} from "@calcom/ui"; +import type { inferSSRProps } from "@calcom/types/inferSSRProps"; +import type { HorizontalTabItemProps } from "@calcom/ui"; +import { AllApps, AppStoreCategories, HorizontalTabs, TextField, PopularAppsSlider } from "@calcom/ui"; import { FiSearch } from "@calcom/ui/components/icon"; import AppsLayout from "@components/apps/layouts/AppsLayout"; diff --git a/apps/web/pages/apps/installed/[category].tsx b/apps/web/pages/apps/installed/[category].tsx index 94fbc01f10..f5e9a0f528 100644 --- a/apps/web/pages/apps/installed/[category].tsx +++ b/apps/web/pages/apps/installed/[category].tsx @@ -4,14 +4,16 @@ import z from "zod"; import { AppSettings } from "@calcom/app-store/_components/AppSettings"; import { InstallAppButton } from "@calcom/app-store/components"; -import { EventLocationType, getEventLocationTypeFromApp } from "@calcom/app-store/locations"; +import type { EventLocationType } from "@calcom/app-store/locations"; +import { getEventLocationTypeFromApp } from "@calcom/app-store/locations"; import { InstalledAppVariants } from "@calcom/app-store/utils"; import { AppSetDefaultLinkDailog } from "@calcom/features/apps/components/AppSetDefaultLinkDialog"; import DisconnectIntegrationModal from "@calcom/features/apps/components/DisconnectIntegrationModal"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; -import { App } from "@calcom/types/App"; -import { AppGetServerSidePropsContext } from "@calcom/types/AppGetServerSideProps"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; +import type { App } from "@calcom/types/App"; +import type { AppGetServerSidePropsContext } from "@calcom/types/AppGetServerSideProps"; import { Alert, Button, @@ -97,8 +99,8 @@ function ConnectOrDisconnectIntegrationMenuItem(props: { } interface IntegrationsContainerProps { - variant?: typeof InstalledAppVariants[number]; - exclude?: typeof InstalledAppVariants[number][]; + variant?: (typeof InstalledAppVariants)[number]; + exclude?: (typeof InstalledAppVariants)[number][]; handleDisconnect: (credentialId: number) => void; } diff --git a/apps/web/pages/auth/error.tsx b/apps/web/pages/auth/error.tsx index 8179fa99e2..e76d12cea2 100644 --- a/apps/web/pages/auth/error.tsx +++ b/apps/web/pages/auth/error.tsx @@ -1,4 +1,4 @@ -import { GetStaticPropsContext } from "next"; +import type { GetStaticPropsContext } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import z from "zod"; diff --git a/apps/web/pages/auth/forgot-password/[id].tsx b/apps/web/pages/auth/forgot-password/[id].tsx index 35450c2f59..145a396b7d 100644 --- a/apps/web/pages/auth/forgot-password/[id].tsx +++ b/apps/web/pages/auth/forgot-password/[id].tsx @@ -1,6 +1,6 @@ -import { ResetPasswordRequest } from "@prisma/client"; +import type { ResetPasswordRequest } from "@prisma/client"; import debounce from "lodash/debounce"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { getCsrfToken } from "next-auth/react"; import Link from "next/link"; import React, { useMemo } from "react"; diff --git a/apps/web/pages/auth/forgot-password/index.tsx b/apps/web/pages/auth/forgot-password/index.tsx index b995d33c4c..08becc2793 100644 --- a/apps/web/pages/auth/forgot-password/index.tsx +++ b/apps/web/pages/auth/forgot-password/index.tsx @@ -1,9 +1,10 @@ import debounce from "lodash/debounce"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { getCsrfToken } from "next-auth/react"; import Link from "next/link"; import { useRouter } from "next/router"; -import React, { SyntheticEvent } from "react"; +import type { SyntheticEvent } from "react"; +import React from "react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button, EmailField } from "@calcom/ui"; diff --git a/apps/web/pages/auth/login.tsx b/apps/web/pages/auth/login.tsx index c9876f1800..9f1f6f148e 100644 --- a/apps/web/pages/auth/login.tsx +++ b/apps/web/pages/auth/login.tsx @@ -1,5 +1,5 @@ import classNames from "classnames"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { getCsrfToken, signIn } from "next-auth/react"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -18,8 +18,9 @@ import prisma from "@calcom/prisma"; import { Alert, Button, EmailField, PasswordField } from "@calcom/ui"; import { FiArrowLeft } from "@calcom/ui/components/icon"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; -import withNonce, { WithNonceProps } from "@lib/withNonce"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { WithNonceProps } from "@lib/withNonce"; +import withNonce from "@lib/withNonce"; import AddToHomescreen from "@components/AddToHomescreen"; import TwoFactor from "@components/auth/TwoFactor"; diff --git a/apps/web/pages/auth/logout.tsx b/apps/web/pages/auth/logout.tsx index 587a9cfbe0..686546fd13 100644 --- a/apps/web/pages/auth/logout.tsx +++ b/apps/web/pages/auth/logout.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { signOut, useSession } from "next-auth/react"; import { useRouter } from "next/router"; import { useEffect } from "react"; @@ -8,7 +8,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@calcom/ui"; import { FiCheck } from "@calcom/ui/components/icon"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import AuthContainer from "@components/ui/AuthContainer"; diff --git a/apps/web/pages/auth/setup/index.tsx b/apps/web/pages/auth/setup/index.tsx index 4f88a28d83..fd8a75ea5f 100644 --- a/apps/web/pages/auth/setup/index.tsx +++ b/apps/web/pages/auth/setup/index.tsx @@ -1,5 +1,5 @@ import { UserPermissionRole } from "@prisma/client"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; @@ -8,7 +8,7 @@ import { getDeploymentKey } from "@calcom/features/ee/deployment/lib/getDeployme import { getSession } from "@calcom/lib/auth"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import prisma from "@calcom/prisma"; -import { inferSSRProps } from "@calcom/types/inferSSRProps"; +import type { inferSSRProps } from "@calcom/types/inferSSRProps"; import { Meta, WizardForm } from "@calcom/ui"; import { AdminUserContainer as AdminUser } from "@components/setup/AdminUser"; diff --git a/apps/web/pages/auth/signin.tsx b/apps/web/pages/auth/signin.tsx index 0d0e78f173..8c6f542e16 100644 --- a/apps/web/pages/auth/signin.tsx +++ b/apps/web/pages/auth/signin.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { getProviders, signIn, getSession, getCsrfToken } from "next-auth/react"; import { Button } from "@calcom/ui"; diff --git a/apps/web/pages/auth/sso/[provider].tsx b/apps/web/pages/auth/sso/[provider].tsx index 2f63d5044e..ab81a482a8 100644 --- a/apps/web/pages/auth/sso/[provider].tsx +++ b/apps/web/pages/auth/sso/[provider].tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { signIn } from "next-auth/react"; import { useRouter } from "next/router"; import { useEffect } from "react"; @@ -17,7 +17,7 @@ import prisma from "@calcom/prisma"; import { asStringOrNull } from "@lib/asStringOrNull"; import { getSession } from "@lib/auth"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/availability/[schedule].tsx b/apps/web/pages/availability/[schedule].tsx index cbd5663f46..9b8673d75e 100644 --- a/apps/web/pages/availability/[schedule].tsx +++ b/apps/web/pages/availability/[schedule].tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { Controller, useFieldArray, useForm } from "react-hook-form"; import { z } from "zod"; diff --git a/apps/web/pages/availability/index.tsx b/apps/web/pages/availability/index.tsx index c12f8c40d9..7c6f79a2a6 100644 --- a/apps/web/pages/availability/index.tsx +++ b/apps/web/pages/availability/index.tsx @@ -1,10 +1,11 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { NewScheduleButton, ScheduleListItem } from "@calcom/features/schedules"; import Shell from "@calcom/features/shell/Shell"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import { EmptyScreen, showToast } from "@calcom/ui"; import { FiClock } from "@calcom/ui/components/icon"; diff --git a/apps/web/pages/availability/troubleshoot.tsx b/apps/web/pages/availability/troubleshoot.tsx index e39e75d122..5290c7edac 100644 --- a/apps/web/pages/availability/troubleshoot.tsx +++ b/apps/web/pages/availability/troubleshoot.tsx @@ -1,7 +1,8 @@ import dayjs from "@calcom/dayjs"; import Shell from "@calcom/features/shell/Shell"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import { SkeletonText } from "@calcom/ui"; import useRouterQuery from "@lib/hooks/useRouterQuery"; diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsx index e49b02fe12..f94a333132 100644 --- a/apps/web/pages/booking/[uid].tsx +++ b/apps/web/pages/booking/[uid].tsx @@ -2,7 +2,7 @@ import { BookingStatus } from "@prisma/client"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible"; import classNames from "classnames"; import { createEvent } from "ics"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useSession } from "next-auth/react"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -11,14 +11,12 @@ import { RRule } from "rrule"; import { z } from "zod"; import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager"; -import { - getEventLocationValue, - getSuccessPageLocationMessage, - guessEventLocationType, -} from "@calcom/app-store/locations"; +import type { getEventLocationValue } from "@calcom/app-store/locations"; +import { getSuccessPageLocationMessage, guessEventLocationType } from "@calcom/app-store/locations"; import { getEventTypeAppData } from "@calcom/app-store/utils"; import { getEventName } from "@calcom/core/event"; -import dayjs, { ConfigType } from "@calcom/dayjs"; +import type { ConfigType } from "@calcom/dayjs"; +import dayjs from "@calcom/dayjs"; import { sdkActionManager, useEmbedNonStylesConfig, @@ -32,7 +30,11 @@ import { import { parseRecurringEvent } from "@calcom/lib"; import CustomBranding from "@calcom/lib/CustomBranding"; import { APP_NAME } from "@calcom/lib/constants"; -import { formatTime } from "@calcom/lib/date-fns"; +import { + formatToLocalizedDate, + formatToLocalizedTime, + formatToLocalizedTimezone, +} from "@calcom/lib/date-fns"; import { getDefaultEvent } from "@calcom/lib/defaultEvents"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useTheme from "@calcom/lib/hooks/useTheme"; @@ -41,14 +43,14 @@ import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calco import { getIs24hClockFromLocalStorage, isBrowserLocale24h } from "@calcom/lib/timeFormat"; import { localStorage } from "@calcom/lib/webstorage"; import prisma from "@calcom/prisma"; -import { Prisma } from "@calcom/prisma/client"; +import type { Prisma } from "@calcom/prisma/client"; import { customInputSchema, bookingMetadataSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { Button, EmailInput, HeadSeo, Label } from "@calcom/ui"; import { FiX, FiChevronLeft, FiCheck, FiCalendar, FiExternalLink } from "@calcom/ui/components/icon"; import { timeZone } from "@lib/clock"; import { getBookingWithResponses } from "@lib/getBooking"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import CancelBooking from "@components/booking/CancelBooking"; import EventReservationSchema from "@components/schemas/EventReservationSchema"; @@ -780,7 +782,10 @@ export function RecurringBookings({ isCancelled, }: RecurringBookingsProps) { const [moreEventsVisible, setMoreEventsVisible] = useState(false); - const { t } = useLocale(); + const { + t, + i18n: { language }, + } = useLocale(); const recurringBookingsSorted = recurringBookings ? recurringBookings.sort((a: ConfigType, b: ConfigType) => (dayjs(a).isAfter(dayjs(b)) ? 1 : -1)) @@ -803,11 +808,13 @@ export function RecurringBookings({ {eventType.recurringEvent?.count && recurringBookingsSorted.slice(0, 4).map((dateStr: string, idx: number) => (
- {dayjs.tz(dateStr, timeZone()).format("dddd, DD MMMM YYYY")} + {formatToLocalizedDate(dayjs.tz(dateStr, timeZone()), language, "full")}
- {formatTime(dateStr, is24h ? 24 : 12, timeZone().toLowerCase())} -{" "} - {formatTime(dayjs(dateStr).add(duration, "m"), is24h ? 24 : 12, timeZone().toLowerCase())}{" "} - ({timeZone()}) + {formatToLocalizedTime(dayjs(dateStr), language, undefined, !is24h)} -{" "} + {formatToLocalizedTime(dayjs(dateStr).add(duration, "m"), language, undefined, !is24h)}{" "} + + ({formatToLocalizedTimezone(dayjs(dateStr), language)}) +
))} {recurringBookingsSorted.length > 4 && ( @@ -821,11 +828,13 @@ export function RecurringBookings({ {eventType.recurringEvent?.count && recurringBookingsSorted.slice(4).map((dateStr: string, idx: number) => (
- {dayjs.tz(dateStr, timeZone()).format("dddd, DD MMMM YYYY")} + {formatToLocalizedDate(dayjs.tz(date, timeZone()), language, "full")}
- {formatTime(dateStr, is24h ? 24 : 12, timeZone().toLowerCase())} -{" "} - {formatTime(dayjs(dateStr).add(duration, "m"), is24h ? 24 : 12, timeZone().toLowerCase())}{" "} - ({timeZone()}) + {formatToLocalizedTime(date, language, undefined, !is24h)} -{" "} + {formatToLocalizedTime(dayjs(date).add(duration, "m"), language, undefined, !is24h)}{" "} + + ({formatToLocalizedTimezone(dayjs(dateStr), language)}) +
))} @@ -837,11 +846,11 @@ export function RecurringBookings({ return (
- {dayjs.tz(date, timeZone()).format("dddd, DD MMMM YYYY")} + {formatToLocalizedDate(dayjs.tz(date, timeZone()), language, "full")}
- {formatTime(date, is24h ? 24 : 12, timeZone().toLowerCase())} -{" "} - {formatTime(dayjs(date).add(duration, "m"), is24h ? 24 : 12, timeZone().toLowerCase())}{" "} - ({timeZone()}) + {formatToLocalizedTime(date, language, undefined, !is24h)} -{" "} + {formatToLocalizedTime(dayjs(date).add(duration, "m"), language, undefined, !is24h)}{" "} + ({formatToLocalizedTimezone(date, language)})
); } diff --git a/apps/web/pages/bookings/[status].tsx b/apps/web/pages/bookings/[status].tsx index a2faa08121..d3b036b147 100644 --- a/apps/web/pages/bookings/[status].tsx +++ b/apps/web/pages/bookings/[status].tsx @@ -1,14 +1,16 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; -import { GetStaticPaths, GetStaticProps } from "next"; +import type { GetStaticPaths, GetStaticProps } from "next"; import { useRouter } from "next/router"; import { Fragment } from "react"; import { z } from "zod"; import { WipeMyCalActionButton } from "@calcom/app-store/wipemycalother/components"; import BookingLayout from "@calcom/features/bookings/layout/BookingLayout"; -import { filterQuerySchema, useFilterQuery } from "@calcom/features/bookings/lib/useFilterQuery"; +import type { filterQuerySchema } from "@calcom/features/bookings/lib/useFilterQuery"; +import { useFilterQuery } from "@calcom/features/bookings/lib/useFilterQuery"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import { Alert, Button, EmptyScreen } from "@calcom/ui"; import { FiCalendar } from "@calcom/ui/components/icon"; diff --git a/apps/web/pages/d/[link]/[slug].tsx b/apps/web/pages/d/[link]/[slug].tsx index 0ae6ea9d4d..29ec5b3f80 100644 --- a/apps/web/pages/d/[link]/[slug].tsx +++ b/apps/web/pages/d/[link]/[slug].tsx @@ -1,16 +1,17 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { z } from "zod"; -import { privacyFilteredLocations, LocationObject } from "@calcom/core/location"; +import type { LocationObject } from "@calcom/core/location"; +import { privacyFilteredLocations } from "@calcom/core/location"; import { parseRecurringEvent } from "@calcom/lib"; import { getWorkingHours } from "@calcom/lib/availability"; import { availiblityPageEventTypeSelect } from "@calcom/prisma"; import prisma from "@calcom/prisma"; import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; -import { GetBookingType } from "@lib/getBooking"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; -import { EmbedProps } from "@lib/withEmbedSsr"; +import type { GetBookingType } from "@lib/getBooking"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { EmbedProps } from "@lib/withEmbedSsr"; import AvailabilityPage from "@components/booking/pages/AvailabilityPage"; diff --git a/apps/web/pages/d/[link]/book.tsx b/apps/web/pages/d/[link]/book.tsx index 77e74af28d..4985b2ccc3 100644 --- a/apps/web/pages/d/[link]/book.tsx +++ b/apps/web/pages/d/[link]/book.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { parseRecurringEvent } from "@calcom/lib"; import prisma from "@calcom/prisma"; @@ -6,7 +6,7 @@ import { bookEventTypeSelect } from "@calcom/prisma/selects"; import { customInputSchema, eventTypeBookingFields, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import BookingPage from "@components/booking/pages/BookingPage"; diff --git a/apps/web/pages/event-types/[type]/index.tsx b/apps/web/pages/event-types/[type]/index.tsx index 1e3b19d12b..5808efe651 100644 --- a/apps/web/pages/event-types/[type]/index.tsx +++ b/apps/web/pages/event-types/[type]/index.tsx @@ -1,13 +1,14 @@ /* eslint-disable @typescript-eslint/no-empty-function */ import { useAutoAnimate } from "@formkit/auto-animate/react"; import { zodResolver } from "@hookform/resolvers/zod"; -import { PeriodType, SchedulingType } from "@prisma/client"; -import { GetServerSidePropsContext } from "next"; +import type { PeriodType } from "@prisma/client"; +import { SchedulingType } from "@prisma/client"; +import type { GetServerSidePropsContext } from "next"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; -import { EventLocationType } from "@calcom/core/location"; +import type { EventLocationType } from "@calcom/core/location"; import { validateBookingLimitOrder } from "@calcom/lib"; import { CAL_URL } from "@calcom/lib/constants"; import getEventTypeById from "@calcom/lib/getEventTypeById"; @@ -15,14 +16,16 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery"; import { HttpError } from "@calcom/lib/http-error"; import prisma from "@calcom/prisma"; -import { customInputSchema, eventTypeBookingFields, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; -import { trpc, RouterOutputs } from "@calcom/trpc/react"; +import { eventTypeBookingFields } from "@calcom/prisma/zod-utils"; +import type { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import type { BookingLimit, RecurringEvent } from "@calcom/types/Calendar"; import { Form, showToast } from "@calcom/ui"; import { asStringOrThrow } from "@lib/asStringOrNull"; import { getSession } from "@lib/auth"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import { AvailabilityTab } from "@components/eventtype/AvailabilityTab"; // These can't really be moved into calcom/ui due to the fact they use infered getserverside props typings @@ -305,7 +308,7 @@ const EventTypePage = (props: EventTypeSetupProps) => { ...input } = values; - const hosts: (typeof hostsInput[number] & { isFixed?: boolean })[] = []; + const hosts: ((typeof hostsInput)[number] & { isFixed?: boolean })[] = []; if (hostsInput || hostsFixed) { hosts.push(...hostsInput.concat(hostsFixed.map((host) => ({ isFixed: true, ...host })))); } diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index f005d34f5b..430a5975f5 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -1,8 +1,9 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; -import { FC, useEffect, useState, memo } from "react"; +import type { FC } from "react"; +import { useEffect, useState, memo } from "react"; import { z } from "zod"; import { @@ -14,7 +15,8 @@ import { APP_NAME, CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useMediaQuery from "@calcom/lib/hooks/useMediaQuery"; import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery"; -import { RouterOutputs, trpc, TRPCClientError } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc, TRPCClientError } from "@calcom/trpc/react"; import { Avatar, AvatarGroup, diff --git a/apps/web/pages/getting-started/[[...step]].tsx b/apps/web/pages/getting-started/[[...step]].tsx index 88f457b456..c360b4c40e 100644 --- a/apps/web/pages/getting-started/[[...step]].tsx +++ b/apps/web/pages/getting-started/[[...step]].tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import Head from "next/head"; import { useRouter } from "next/router"; @@ -10,7 +10,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import prisma from "@calcom/prisma"; import { Button, StepCard, Steps } from "@calcom/ui"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import { ConnectedCalendars } from "@components/getting-started/steps-views/ConnectCalendars"; import { SetupAvailability } from "@components/getting-started/steps-views/SetupAvailability"; @@ -22,7 +22,7 @@ export type IOnboardingPageProps = inferSSRProps; const INITIAL_STEP = "user-settings"; const steps = ["user-settings", "connected-calendar", "setup-availability", "user-profile"] as const; -const stepTransform = (step: typeof steps[number]) => { +const stepTransform = (step: (typeof steps)[number]) => { const stepIndex = steps.indexOf(step); if (stepIndex > -1) { return steps[stepIndex]; diff --git a/apps/web/pages/index.tsx b/apps/web/pages/index.tsx index 8730636947..ddfb7116b9 100644 --- a/apps/web/pages/index.tsx +++ b/apps/web/pages/index.tsx @@ -1,4 +1,4 @@ -import { NextPageContext } from "next"; +import type { NextPageContext } from "next"; import { getSession } from "@lib/auth"; diff --git a/apps/web/pages/payment/[uid].tsx b/apps/web/pages/payment/[uid].tsx index 6fa998361d..296462f34d 100644 --- a/apps/web/pages/payment/[uid].tsx +++ b/apps/web/pages/payment/[uid].tsx @@ -1,6 +1,6 @@ import PaymentPage from "@calcom/features/ee/payments/components/PaymentPage"; import { getServerSideProps } from "@calcom/features/ee/payments/pages/payment"; -import { inferSSRProps } from "@calcom/types/inferSSRProps"; +import type { inferSSRProps } from "@calcom/types/inferSSRProps"; export default function Payment(props: inferSSRProps) { return ; diff --git a/apps/web/pages/reschedule/[uid].tsx b/apps/web/pages/reschedule/[uid].tsx index 9baeb7c1af..8f5193c6d0 100644 --- a/apps/web/pages/reschedule/[uid].tsx +++ b/apps/web/pages/reschedule/[uid].tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { getDefaultEvent } from "@calcom/lib/defaultEvents"; import prisma, { bookingMinimalSelect } from "@calcom/prisma"; diff --git a/apps/web/pages/settings/admin/apps/[category].tsx b/apps/web/pages/settings/admin/apps/[category].tsx index f2ed6c9943..0fcc2c0dd0 100644 --- a/apps/web/pages/settings/admin/apps/[category].tsx +++ b/apps/web/pages/settings/admin/apps/[category].tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import AdminAppsList from "@calcom/features/apps/AdminAppsList"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/pages/settings/admin/impersonation.tsx b/apps/web/pages/settings/admin/impersonation.tsx index dacdbfa948..dbce021dc3 100644 --- a/apps/web/pages/settings/admin/impersonation.tsx +++ b/apps/web/pages/settings/admin/impersonation.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { signIn } from "next-auth/react"; import { useRef } from "react"; diff --git a/apps/web/pages/settings/admin/index.tsx b/apps/web/pages/settings/admin/index.tsx index 83cd7f53c0..71e729a468 100644 --- a/apps/web/pages/settings/admin/index.tsx +++ b/apps/web/pages/settings/admin/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { Meta } from "@calcom/ui"; diff --git a/apps/web/pages/settings/billing/index.tsx b/apps/web/pages/settings/billing/index.tsx index 528c47e137..5193b6af6c 100644 --- a/apps/web/pages/settings/billing/index.tsx +++ b/apps/web/pages/settings/billing/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useRouter } from "next/router"; import { useState } from "react"; import { HelpScout, useChat } from "react-live-chat-loader"; diff --git a/apps/web/pages/settings/developer/api-keys.tsx b/apps/web/pages/settings/developer/api-keys.tsx index 9d890edca6..aaf3b7eab0 100644 --- a/apps/web/pages/settings/developer/api-keys.tsx +++ b/apps/web/pages/settings/developer/api-keys.tsx @@ -1,7 +1,7 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useState } from "react"; -import { TApiKeys } from "@calcom/ee/api-keys/components/ApiKeyListItem"; +import type { TApiKeys } from "@calcom/ee/api-keys/components/ApiKeyListItem"; import LicenseRequired from "@calcom/ee/common/components/v2/LicenseRequired"; import ApiKeyDialogForm from "@calcom/features/ee/api-keys/components/ApiKeyDialogForm"; import ApiKeyListItem from "@calcom/features/ee/api-keys/components/ApiKeyListItem"; diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx index 0a665570b7..92ebffe2b2 100644 --- a/apps/web/pages/settings/my-account/appearance.tsx +++ b/apps/web/pages/settings/my-account/appearance.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { Controller, useForm } from "react-hook-form"; import ThemeLabel from "@calcom/features/settings/ThemeLabel"; diff --git a/apps/web/pages/settings/my-account/calendars.tsx b/apps/web/pages/settings/my-account/calendars.tsx index 5479b7d604..67957ba4da 100644 --- a/apps/web/pages/settings/my-account/calendars.tsx +++ b/apps/web/pages/settings/my-account/calendars.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { Trans } from "next-i18next"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/apps/web/pages/settings/my-account/conferencing.tsx b/apps/web/pages/settings/my-account/conferencing.tsx index cc73c98ec4..3e14dbef27 100644 --- a/apps/web/pages/settings/my-account/conferencing.tsx +++ b/apps/web/pages/settings/my-account/conferencing.tsx @@ -1,6 +1,7 @@ import { useState } from "react"; -import { EventLocationType, getEventLocationTypeFromApp } from "@calcom/app-store/locations"; +import type { EventLocationType } from "@calcom/app-store/locations"; +import { getEventLocationTypeFromApp } from "@calcom/app-store/locations"; import { AppSetDefaultLinkDailog } from "@calcom/features/apps/components/AppSetDefaultLinkDialog"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/pages/settings/my-account/general.tsx b/apps/web/pages/settings/my-account/general.tsx index 7de2e10bf7..a7373f91d3 100644 --- a/apps/web/pages/settings/my-account/general.tsx +++ b/apps/web/pages/settings/my-account/general.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useRouter } from "next/router"; import { useMemo } from "react"; import { Controller, useForm } from "react-hook-form"; @@ -6,7 +6,8 @@ import { Controller, useForm } from "react-hook-form"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { nameOfDay } from "@calcom/lib/weekday"; -import { RouterOutputs, trpc } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; +import { trpc } from "@calcom/trpc/react"; import { Button, Form, diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx index a3d576335c..ab0acd99d4 100644 --- a/apps/web/pages/settings/my-account/profile.tsx +++ b/apps/web/pages/settings/my-account/profile.tsx @@ -1,9 +1,10 @@ import { IdentityProvider } from "@prisma/client"; import crypto from "crypto"; import MarkdownIt from "markdown-it"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { signOut } from "next-auth/react"; -import { BaseSyntheticEvent, useRef, useState } from "react"; +import type { BaseSyntheticEvent } from "react"; +import { useRef, useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; @@ -11,9 +12,9 @@ import { ErrorCode } from "@calcom/lib/auth"; import { APP_NAME } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import turndown from "@calcom/lib/turndownService"; -import { TRPCClientErrorLike } from "@calcom/trpc/client"; +import type { TRPCClientErrorLike } from "@calcom/trpc/client"; import { trpc } from "@calcom/trpc/react"; -import { AppRouter } from "@calcom/trpc/server/routers/_app"; +import type { AppRouter } from "@calcom/trpc/server/routers/_app"; import { Alert, Avatar, diff --git a/apps/web/pages/settings/security/impersonation.tsx b/apps/web/pages/settings/security/impersonation.tsx index cea19bbd20..f8c7f84ce7 100644 --- a/apps/web/pages/settings/security/impersonation.tsx +++ b/apps/web/pages/settings/security/impersonation.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useForm } from "react-hook-form"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; diff --git a/apps/web/pages/settings/security/password.tsx b/apps/web/pages/settings/security/password.tsx index 37f8e217b0..eea4adf821 100644 --- a/apps/web/pages/settings/security/password.tsx +++ b/apps/web/pages/settings/security/password.tsx @@ -1,5 +1,5 @@ import { IdentityProvider } from "@prisma/client"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { signOut, useSession } from "next-auth/react"; import { useForm } from "react-hook-form"; diff --git a/apps/web/pages/settings/security/sso.tsx b/apps/web/pages/settings/security/sso.tsx index e38d927f45..ae8027dcf9 100644 --- a/apps/web/pages/settings/security/sso.tsx +++ b/apps/web/pages/settings/security/sso.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/settings/security/two-factor-auth.tsx b/apps/web/pages/settings/security/two-factor-auth.tsx index 33795f82f1..6d09a09e0a 100644 --- a/apps/web/pages/settings/security/two-factor-auth.tsx +++ b/apps/web/pages/settings/security/two-factor-auth.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { useState } from "react"; import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; diff --git a/apps/web/pages/settings/teams/[id]/appearance.tsx b/apps/web/pages/settings/teams/[id]/appearance.tsx index 182e6fbdd4..f40cbf75fb 100644 --- a/apps/web/pages/settings/teams/[id]/appearance.tsx +++ b/apps/web/pages/settings/teams/[id]/appearance.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/settings/teams/[id]/billing.tsx b/apps/web/pages/settings/teams/[id]/billing.tsx index 4da2121863..8b89a9480f 100644 --- a/apps/web/pages/settings/teams/[id]/billing.tsx +++ b/apps/web/pages/settings/teams/[id]/billing.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/settings/teams/[id]/members.tsx b/apps/web/pages/settings/teams/[id]/members.tsx index c6150cc754..d40ef1b94f 100644 --- a/apps/web/pages/settings/teams/[id]/members.tsx +++ b/apps/web/pages/settings/teams/[id]/members.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/settings/teams/[id]/profile.tsx b/apps/web/pages/settings/teams/[id]/profile.tsx index 02434b0c86..ca1e3e9f0d 100644 --- a/apps/web/pages/settings/teams/[id]/profile.tsx +++ b/apps/web/pages/settings/teams/[id]/profile.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/settings/teams/[id]/sso.tsx b/apps/web/pages/settings/teams/[id]/sso.tsx index 97db4771eb..dbb0bf0225 100644 --- a/apps/web/pages/settings/teams/[id]/sso.tsx +++ b/apps/web/pages/settings/teams/[id]/sso.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/settings/teams/new/index.tsx b/apps/web/pages/settings/teams/new/index.tsx index 85a8039937..b119e6f6d3 100644 --- a/apps/web/pages/settings/teams/new/index.tsx +++ b/apps/web/pages/settings/teams/new/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import Head from "next/head"; import { CreateANewTeamForm } from "@calcom/features/ee/teams/components"; diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx index 0fca86f626..0fac2ad1e4 100644 --- a/apps/web/pages/signup.tsx +++ b/apps/web/pages/signup.tsx @@ -1,7 +1,8 @@ import type { GetServerSidePropsContext } from "next"; import { signIn } from "next-auth/react"; import { useRouter } from "next/router"; -import { FormProvider, SubmitHandler, useForm } from "react-hook-form"; +import type { SubmitHandler } from "react-hook-form"; +import { FormProvider, useForm } from "react-hook-form"; import LicenseRequired from "@calcom/features/ee/common/components/v2/LicenseRequired"; import { isSAMLLoginEnabled } from "@calcom/features/ee/sso/lib/saml"; @@ -9,7 +10,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import prisma from "@calcom/prisma"; -import { inferSSRProps } from "@calcom/types/inferSSRProps"; +import type { inferSSRProps } from "@calcom/types/inferSSRProps"; import { Alert, Button, EmailField, HeadSeo, PasswordField, TextField } from "@calcom/ui"; import { asStringOrNull } from "../lib/asStringOrNull"; diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx index 1855c3f32d..bb0b2a32da 100644 --- a/apps/web/pages/team/[slug].tsx +++ b/apps/web/pages/team/[slug].tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import MarkdownIt from "markdown-it"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect } from "react"; @@ -17,7 +17,7 @@ import { Avatar, Button, HeadSeo, AvatarGroup } from "@calcom/ui"; import { FiArrowRight } from "@calcom/ui/components/icon"; import { useToggleQuery } from "@lib/hooks/useToggleQuery"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import Team from "@components/team/screens/Team"; diff --git a/apps/web/pages/team/[slug]/[type].tsx b/apps/web/pages/team/[slug]/[type].tsx index d8baf45332..4a4fa6019d 100644 --- a/apps/web/pages/team/[slug]/[type].tsx +++ b/apps/web/pages/team/[slug]/[type].tsx @@ -1,6 +1,7 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; -import { privacyFilteredLocations, LocationObject } from "@calcom/core/location"; +import { privacyFilteredLocations } from "@calcom/core/location"; +import type { LocationObject } from "@calcom/core/location"; import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields"; import { parseRecurringEvent } from "@calcom/lib"; import { getWorkingHours } from "@calcom/lib/availability"; @@ -8,9 +9,10 @@ import prisma from "@calcom/prisma"; import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { asStringOrNull } from "@lib/asStringOrNull"; -import getBooking, { GetBookingType } from "@lib/getBooking"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; -import { EmbedProps } from "@lib/withEmbedSsr"; +import type { GetBookingType } from "@lib/getBooking"; +import getBooking from "@lib/getBooking"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { EmbedProps } from "@lib/withEmbedSsr"; import AvailabilityPage from "@components/booking/pages/AvailabilityPage"; diff --git a/apps/web/pages/team/[slug]/book.tsx b/apps/web/pages/team/[slug]/book.tsx index 193ccad03f..f1700bbeed 100644 --- a/apps/web/pages/team/[slug]/book.tsx +++ b/apps/web/pages/team/[slug]/book.tsx @@ -1,14 +1,16 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; -import { LocationObject, privacyFilteredLocations } from "@calcom/app-store/locations"; +import type { LocationObject } from "@calcom/app-store/locations"; +import { privacyFilteredLocations } from "@calcom/app-store/locations"; import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields"; import { parseRecurringEvent } from "@calcom/lib"; import prisma from "@calcom/prisma"; import { customInputSchema, eventTypeBookingFields, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { asStringOrNull, asStringOrThrow } from "@lib/asStringOrNull"; -import getBooking, { GetBookingType } from "@lib/getBooking"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { GetBookingType } from "@lib/getBooking"; +import getBooking from "@lib/getBooking"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; import BookingPage from "@components/booking/pages/BookingPage"; diff --git a/apps/web/pages/teams/index.tsx b/apps/web/pages/teams/index.tsx index e5e651f29d..25e9934942 100644 --- a/apps/web/pages/teams/index.tsx +++ b/apps/web/pages/teams/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { TeamsListing } from "@calcom/features/ee/teams/components"; import Shell from "@calcom/features/shell/Shell"; diff --git a/apps/web/pages/video/[uid].tsx b/apps/web/pages/video/[uid].tsx index 0601265375..bf8b57917e 100644 --- a/apps/web/pages/video/[uid].tsx +++ b/apps/web/pages/video/[uid].tsx @@ -1,5 +1,5 @@ import DailyIframe from "@daily-co/daily-js"; -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { getSession } from "next-auth/react"; import Head from "next/head"; import { useEffect } from "react"; @@ -7,7 +7,7 @@ import { useEffect } from "react"; import { APP_NAME, SEO_IMG_OGIMG_VIDEO, WEBSITE_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import prisma, { bookingMinimalSelect } from "@calcom/prisma"; -import { inferSSRProps } from "@calcom/types/inferSSRProps"; +import type { inferSSRProps } from "@calcom/types/inferSSRProps"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/pages/video/meeting-ended/[uid].tsx b/apps/web/pages/video/meeting-ended/[uid].tsx index d3c709cd87..8ff650478b 100644 --- a/apps/web/pages/video/meeting-ended/[uid].tsx +++ b/apps/web/pages/video/meeting-ended/[uid].tsx @@ -1,4 +1,4 @@ -import { NextPageContext } from "next"; +import type { NextPageContext } from "next"; import dayjs from "@calcom/dayjs"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -7,7 +7,7 @@ import prisma, { bookingMinimalSelect } from "@calcom/prisma"; import { Button, HeadSeo } from "@calcom/ui"; import { FiArrowRight, FiCalendar, FiX } from "@calcom/ui/components/icon"; -import { inferSSRProps } from "@lib/types/inferSSRProps"; +import type { inferSSRProps } from "@lib/types/inferSSRProps"; export default function MeetingUnavailable(props: inferSSRProps) { const { t } = useLocale(); diff --git a/apps/web/pages/video/meeting-not-started/[uid].tsx b/apps/web/pages/video/meeting-not-started/[uid].tsx index 11bda5d35a..87c361e926 100644 --- a/apps/web/pages/video/meeting-not-started/[uid].tsx +++ b/apps/web/pages/video/meeting-not-started/[uid].tsx @@ -1,4 +1,4 @@ -import { NextPageContext } from "next"; +import type { NextPageContext } from "next"; import dayjs from "@calcom/dayjs"; import { useLocale } from "@calcom/lib/hooks/useLocale"; diff --git a/apps/web/pages/workflows/[workflow].tsx b/apps/web/pages/workflows/[workflow].tsx index 02cf9fa15b..1be2ceb1bc 100644 --- a/apps/web/pages/workflows/[workflow].tsx +++ b/apps/web/pages/workflows/[workflow].tsx @@ -1,4 +1,4 @@ -import { GetStaticPaths, GetStaticProps } from "next"; +import type { GetStaticPaths, GetStaticProps } from "next"; import { z } from "zod"; export { default } from "@calcom/features/ee/workflows/pages/workflow"; diff --git a/apps/web/pages/workflows/index.tsx b/apps/web/pages/workflows/index.tsx index 7e2a4b8500..ec67dd2d82 100644 --- a/apps/web/pages/workflows/index.tsx +++ b/apps/web/pages/workflows/index.tsx @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import { ssrInit } from "@server/lib/ssr"; diff --git a/apps/web/playwright/embed-code-generator.e2e.ts b/apps/web/playwright/embed-code-generator.e2e.ts index 0d6ccec579..30579183c6 100644 --- a/apps/web/playwright/embed-code-generator.e2e.ts +++ b/apps/web/playwright/embed-code-generator.e2e.ts @@ -1,4 +1,5 @@ -import { expect, Page } from "@playwright/test"; +import type { Page } from "@playwright/test"; +import { expect } from "@playwright/test"; import { test } from "./lib/fixtures"; diff --git a/apps/web/playwright/event-types.e2e.ts b/apps/web/playwright/event-types.e2e.ts index 760804a27b..54cc43a04d 100644 --- a/apps/web/playwright/event-types.e2e.ts +++ b/apps/web/playwright/event-types.e2e.ts @@ -62,7 +62,7 @@ test.describe("Event Types tests", () => { }); await page.click("[data-testid=vertical-tab-recurring]"); - await expect(page.locator("[data-testid=recurring-event-collapsible]")).not.toBeVisible(); + await expect(page.locator("[data-testid=recurring-event-collapsible]")).toBeHidden(); await page.click("[data-testid=recurring-event-check]"); await expect(page.locator("[data-testid=recurring-event-collapsible]")).toBeVisible(); diff --git a/apps/web/playwright/fixtures/users.ts b/apps/web/playwright/fixtures/users.ts index c0e485dad3..3896ecea52 100644 --- a/apps/web/playwright/fixtures/users.ts +++ b/apps/web/playwright/fixtures/users.ts @@ -7,7 +7,7 @@ import dayjs from "@calcom/dayjs"; import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/availability"; import { prisma } from "@calcom/prisma"; -import { TimeZoneEnum } from "./types"; +import type { TimeZoneEnum } from "./types"; // Don't import hashPassword from app as that ends up importing next-auth and initializing it before NEXTAUTH_URL can be updated during tests. export async function hashPassword(password: string) { diff --git a/apps/web/playwright/integrations.e2e.ts b/apps/web/playwright/integrations.e2e.ts index f5383ef834..3b89b19013 100644 --- a/apps/web/playwright/integrations.e2e.ts +++ b/apps/web/playwright/integrations.e2e.ts @@ -1,4 +1,5 @@ -import { expect, Page, Route } from "@playwright/test"; +import type { Page, Route } from "@playwright/test"; +import { expect } from "@playwright/test"; import { rest } from "msw"; import { setupServer } from "msw/node"; import { v4 as uuidv4 } from "uuid"; diff --git a/apps/web/playwright/lib/next-server.ts b/apps/web/playwright/lib/next-server.ts index 34c57969a4..c7433f62a6 100644 --- a/apps/web/playwright/lib/next-server.ts +++ b/apps/web/playwright/lib/next-server.ts @@ -1,5 +1,6 @@ import detect from "detect-port"; -import { createServer, Server } from "http"; +import type { Server } from "http"; +import { createServer } from "http"; import next from "next"; import { parse } from "url"; diff --git a/apps/web/playwright/lib/teardown.ts b/apps/web/playwright/lib/teardown.ts index ba5fb0e277..0bcbb1a81c 100644 --- a/apps/web/playwright/lib/teardown.ts +++ b/apps/web/playwright/lib/teardown.ts @@ -1,4 +1,4 @@ -import { Prisma } from "@prisma/client"; +import type { Prisma } from "@prisma/client"; import prisma from "@calcom/prisma"; diff --git a/apps/web/playwright/lib/testUtils.ts b/apps/web/playwright/lib/testUtils.ts index ae898ff789..ef64586a92 100644 --- a/apps/web/playwright/lib/testUtils.ts +++ b/apps/web/playwright/lib/testUtils.ts @@ -1,5 +1,7 @@ -import { expect, Page, test } from "@playwright/test"; -import { createServer, IncomingMessage, ServerResponse } from "http"; +import type { Page } from "@playwright/test"; +import { expect, test } from "@playwright/test"; +import type { IncomingMessage, ServerResponse } from "http"; +import { createServer } from "http"; import noop from "lodash/noop"; export function todo(title: string) { diff --git a/apps/web/playwright/reschedule.e2e.ts b/apps/web/playwright/reschedule.e2e.ts index 036d1d08bb..d69470daa6 100644 --- a/apps/web/playwright/reschedule.e2e.ts +++ b/apps/web/playwright/reschedule.e2e.ts @@ -35,7 +35,7 @@ test.describe("Reschedule Tests", async () => { await page.fill('[data-testid="reschedule_reason"]', "I can't longer have it"); await page.locator('button[data-testid="send_request"]').click(); - await expect(page.locator('[id="modal-title"]')).not.toBeVisible(); + await expect(page.locator('[id="modal-title"]')).toBeHidden(); const updatedBooking = await booking.self(); diff --git a/apps/web/server/lib/ssg.ts b/apps/web/server/lib/ssg.ts index 8fa773e935..c21f5f3b2d 100644 --- a/apps/web/server/lib/ssg.ts +++ b/apps/web/server/lib/ssg.ts @@ -1,4 +1,4 @@ -import { GetStaticPropsContext } from "next"; +import type { GetStaticPropsContext } from "next"; import { i18n } from "next-i18next.config"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import superjson from "superjson"; diff --git a/apps/web/server/lib/ssr.ts b/apps/web/server/lib/ssr.ts index 709aa4f9dc..a177615943 100644 --- a/apps/web/server/lib/ssr.ts +++ b/apps/web/server/lib/ssr.ts @@ -1,4 +1,4 @@ -import { GetServerSidePropsContext } from "next"; +import type { GetServerSidePropsContext } from "next"; import superjson from "superjson"; import { createProxySSGHelpers } from "@calcom/trpc/react/ssg"; diff --git a/apps/web/test/lib/checkBookingLimits.test.ts b/apps/web/test/lib/checkBookingLimits.test.ts index fe61a2ab23..8054535038 100644 --- a/apps/web/test/lib/checkBookingLimits.test.ts +++ b/apps/web/test/lib/checkBookingLimits.test.ts @@ -1,7 +1,7 @@ import dayjs from "@calcom/dayjs"; import { validateBookingLimitOrder } from "@calcom/lib/isBookingLimits"; import { checkBookingLimits, checkLimit } from "@calcom/lib/server"; -import { BookingLimit } from "@calcom/types/Calendar"; +import type { BookingLimit } from "@calcom/types/Calendar"; import { prismaMock } from "../../../../tests/config/singleton"; diff --git a/apps/web/test/lib/getAvailabilityFromSchedule.test.ts b/apps/web/test/lib/getAvailabilityFromSchedule.test.ts index fcee4dcf6a..bac272f260 100644 --- a/apps/web/test/lib/getAvailabilityFromSchedule.test.ts +++ b/apps/web/test/lib/getAvailabilityFromSchedule.test.ts @@ -1,5 +1,5 @@ import { expect, it } from "@jest/globals"; -import { Availability } from "@prisma/client"; +import type { Availability } from "@prisma/client"; import MockDate from "mockdate"; import dayjs from "@calcom/dayjs"; diff --git a/apps/web/test/lib/getSchedule.test.ts b/apps/web/test/lib/getSchedule.test.ts index 9c7025e680..b865d6c614 100644 --- a/apps/web/test/lib/getSchedule.test.ts +++ b/apps/web/test/lib/getSchedule.test.ts @@ -1,4 +1,4 @@ -import { +import type { EventType as PrismaEventType, User as PrismaUser, Booking as PrismaBooking, @@ -10,8 +10,9 @@ import { v4 as uuidv4 } from "uuid"; import logger from "@calcom/lib/logger"; import prisma from "@calcom/prisma"; -import { BookingStatus } from "@calcom/prisma/client"; -import { getSchedule, Slot } from "@calcom/trpc/server/routers/viewer/slots"; +import type { BookingStatus } from "@calcom/prisma/client"; +import type { Slot } from "@calcom/trpc/server/routers/viewer/slots"; +import { getSchedule } from "@calcom/trpc/server/routers/viewer/slots"; import { prismaMock, CalendarManagerMock } from "../../../../tests/config/singleton"; diff --git a/package.json b/package.json index 1e2d6979ec..8f2d9a0878 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "jest-watch-select-projects": "^2.0.0", "jest-watch-typeahead": "^2.0.0", "lint-staged": "^12.5.0", - "prettier": "^2.7.1", + "prettier": "^2.8.4", "ts-jest": "^28.0.8" }, "dependencies": { @@ -85,8 +85,8 @@ "resolutions": { "@apidevtools/json-schema-ref-parser": "9.0.9", "@types/node": "16.9.1", - "@types/react": "^18.0.17", - "@types/react-dom": "^18.0.6" + "@types/react": "18.0.26", + "@types/react-dom": "18.0.9" }, "lint-staged": { "(apps|packages)/**/*.{js,ts,jsx,tsx}": [ diff --git a/packages/app-store-cli/README.md b/packages/app-store-cli/README.md index 48153efd01..17618b6719 100644 --- a/packages/app-store-cli/README.md +++ b/packages/app-store-cli/README.md @@ -1,9 +1,11 @@ ## How to build an App using the CLI + Refer to https://developer.cal.com/guides/how-to-build-an-app ## TODO + - Merge app-store:watch and app-store commands; introduce app-store --watch - An app created through CLI should be able to completely skip API validation for testing purposes. Credentials should be created with no API specified specific to the app. It would allow us to test any app end to end not worrying about the corresponding API endpoint. - Someone can add wrong directory name(which doesn't satisfy slug requirements) manually. How to handle it. - Allow editing and updating app from the cal app itself - including assets uploading when developing locally. -- Use AppDeclarativeHandler across all apps. Whatever isn't supported in it, support that. \ No newline at end of file +- Use AppDeclarativeHandler across all apps. Whatever isn't supported in it, support that. diff --git a/packages/app-store-cli/package.json b/packages/app-store-cli/package.json index 3b76be06c0..20085091a7 100644 --- a/packages/app-store-cli/package.json +++ b/packages/app-store-cli/package.json @@ -25,7 +25,7 @@ "react": "^18.2.0" }, "devDependencies": { - "@types/react": "^18.0.17", + "@types/react": "18.0.26", "chokidar": "^3.5.3", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/packages/app-store/BookingPageTagManager.tsx b/packages/app-store/BookingPageTagManager.tsx index ef2ff57ad0..72abf76c59 100644 --- a/packages/app-store/BookingPageTagManager.tsx +++ b/packages/app-store/BookingPageTagManager.tsx @@ -3,7 +3,7 @@ import Script from "next/script"; import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData"; import { getEventTypeAppData } from "@calcom/app-store/utils"; -import { appDataSchemas } from "./apps.schemas.generated"; +import type { appDataSchemas } from "./apps.schemas.generated"; export default function BookingPageTagManager({ eventType, @@ -26,7 +26,7 @@ export default function BookingPageTagManager({ val ? (val.replace(/\{TRACKING_ID\}/g, trackingId) as T) : val; return tag.scripts.map((script, index) => { - const parsedAttributes: NonNullable = {}; + const parsedAttributes: NonNullable<(typeof tag.scripts)[number]["attrs"]> = {}; const attrs = script.attrs || {}; Object.entries(attrs).forEach(([name, value]) => { if (typeof value === "string") { diff --git a/packages/app-store/EventTypeAppContext.tsx b/packages/app-store/EventTypeAppContext.tsx index 0aa4cfb832..042044d8d8 100644 --- a/packages/app-store/EventTypeAppContext.tsx +++ b/packages/app-store/EventTypeAppContext.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { z, ZodType } from "zod"; +import type { z, ZodType } from "zod"; export type GetAppData = (key: string) => unknown; export type SetAppData = (key: string, value: unknown) => void; diff --git a/packages/app-store/_appRegistry.ts b/packages/app-store/_appRegistry.ts index ec63be2ba4..c7915da10f 100644 --- a/packages/app-store/_appRegistry.ts +++ b/packages/app-store/_appRegistry.ts @@ -1,7 +1,7 @@ import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData"; import prisma, { safeAppSelect, safeCredentialSelect } from "@calcom/prisma"; -import { AppFrontendPayload as App } from "@calcom/types/App"; -import { CredentialFrontendPayload as Credential } from "@calcom/types/Credential"; +import type { AppFrontendPayload as App } from "@calcom/types/App"; +import type { CredentialFrontendPayload as Credential } from "@calcom/types/Credential"; export async function getAppWithMetadata(app: { dirName: string }) { const appMetadata: App | null = appStoreMetadata[app.dirName as keyof typeof appStoreMetadata] as App; diff --git a/packages/app-store/_components/AppCard.tsx b/packages/app-store/_components/AppCard.tsx index 1350a2cf2a..00a938da3f 100644 --- a/packages/app-store/_components/AppCard.tsx +++ b/packages/app-store/_components/AppCard.tsx @@ -1,11 +1,11 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; import Link from "next/link"; -import { RouterOutputs } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; import { Switch } from "@calcom/ui"; -import { SetAppDataGeneric } from "../EventTypeAppContext"; -import { eventTypeAppCardZod } from "../eventTypeAppCardZod"; +import type { SetAppDataGeneric } from "../EventTypeAppContext"; +import type { eventTypeAppCardZod } from "../eventTypeAppCardZod"; import OmniInstallAppButton from "./OmniInstallAppButton"; export default function AppCard({ diff --git a/packages/app-store/_components/EventTypeAppCardInterface.tsx b/packages/app-store/_components/EventTypeAppCardInterface.tsx index 102edf53a5..559d40d69f 100644 --- a/packages/app-store/_components/EventTypeAppCardInterface.tsx +++ b/packages/app-store/_components/EventTypeAppCardInterface.tsx @@ -1,9 +1,10 @@ -import EventTypeAppContext, { GetAppData, SetAppData } from "@calcom/app-store/EventTypeAppContext"; +import type { GetAppData, SetAppData } from "@calcom/app-store/EventTypeAppContext"; +import EventTypeAppContext from "@calcom/app-store/EventTypeAppContext"; import { EventTypeAddonMap } from "@calcom/app-store/apps.browser.generated"; -import { RouterOutputs } from "@calcom/trpc/react"; +import type { RouterOutputs } from "@calcom/trpc/react"; import { ErrorBoundary } from "@calcom/ui"; -import { EventTypeAppCardComponentProps } from "../types"; +import type { EventTypeAppCardComponentProps } from "../types"; import { DynamicComponent } from "./DynamicComponent"; export const EventTypeAppCard = (props: { diff --git a/packages/app-store/_pages/setup/_getStaticProps.tsx b/packages/app-store/_pages/setup/_getStaticProps.tsx index 0e8b631199..5e1f963ef6 100644 --- a/packages/app-store/_pages/setup/_getStaticProps.tsx +++ b/packages/app-store/_pages/setup/_getStaticProps.tsx @@ -1,4 +1,4 @@ -import { GetStaticPropsContext } from "next"; +import type { GetStaticPropsContext } from "next"; export const AppSetupPageMap = { zapier: import("../../zapier/pages/setup/_getStaticProps"), diff --git a/packages/app-store/_utils/decodeOAuthState.ts b/packages/app-store/_utils/decodeOAuthState.ts index 9c593ad175..082d61177f 100644 --- a/packages/app-store/_utils/decodeOAuthState.ts +++ b/packages/app-store/_utils/decodeOAuthState.ts @@ -1,6 +1,6 @@ -import { NextApiRequest } from "next"; +import type { NextApiRequest } from "next"; -import { IntegrationOAuthCallbackState } from "../types"; +import type { IntegrationOAuthCallbackState } from "../types"; export function decodeOAuthState(req: NextApiRequest) { if (typeof req.query.state !== "string") { diff --git a/packages/app-store/_utils/encodeOAuthState.ts b/packages/app-store/_utils/encodeOAuthState.ts index ba4f67c365..03cfaafbbd 100644 --- a/packages/app-store/_utils/encodeOAuthState.ts +++ b/packages/app-store/_utils/encodeOAuthState.ts @@ -1,6 +1,6 @@ -import { NextApiRequest } from "next"; +import type { NextApiRequest } from "next"; -import { IntegrationOAuthCallbackState } from "../types"; +import type { IntegrationOAuthCallbackState } from "../types"; export function encodeOAuthState(req: NextApiRequest) { if (typeof req.query.state !== "string") { diff --git a/packages/app-store/_utils/getCalendar.ts b/packages/app-store/_utils/getCalendar.ts index 9ae28c128b..342e1cd74a 100644 --- a/packages/app-store/_utils/getCalendar.ts +++ b/packages/app-store/_utils/getCalendar.ts @@ -1,6 +1,6 @@ import logger from "@calcom/lib/logger"; import type { Calendar } from "@calcom/types/Calendar"; -import { CredentialPayload } from "@calcom/types/Credential"; +import type { CredentialPayload } from "@calcom/types/Credential"; import appStore from ".."; diff --git a/packages/app-store/_utils/useAddAppMutation.ts b/packages/app-store/_utils/useAddAppMutation.ts index a5a67ad4d0..48dc918af0 100644 --- a/packages/app-store/_utils/useAddAppMutation.ts +++ b/packages/app-store/_utils/useAddAppMutation.ts @@ -1,8 +1,9 @@ -import { useMutation, UseMutationOptions } from "@tanstack/react-query"; +import type { UseMutationOptions } from "@tanstack/react-query"; +import { useMutation } from "@tanstack/react-query"; import type { IntegrationOAuthCallbackState } from "@calcom/app-store/types"; import { WEBAPP_URL } from "@calcom/lib/constants"; -import { App } from "@calcom/types/App"; +import type { App } from "@calcom/types/App"; import getInstalledAppPath from "./getInstalledAppPath"; diff --git a/packages/app-store/amie/DESCRIPTION.md b/packages/app-store/amie/DESCRIPTION.md index c2c1986343..011c2862b2 100644 --- a/packages/app-store/amie/DESCRIPTION.md +++ b/packages/app-store/amie/DESCRIPTION.md @@ -15,4 +15,3 @@ items: - Track what you listened to when - Send scheduling links guests love - Always know what your team is up to - diff --git a/packages/app-store/amie/api/add.ts b/packages/app-store/amie/api/add.ts index 2537562817..d939f9cf79 100644 --- a/packages/app-store/amie/api/add.ts +++ b/packages/app-store/amie/api/add.ts @@ -1,4 +1,4 @@ -import { AppDeclarativeHandler } from "@calcom/types/AppHandler"; +import type { AppDeclarativeHandler } from "@calcom/types/AppHandler"; import { createDefaultInstallation } from "../../_utils/installation"; import appConfig from "../config.json"; diff --git a/packages/app-store/appStoreMetaData.ts b/packages/app-store/appStoreMetaData.ts index c5212788d8..000861575d 100644 --- a/packages/app-store/appStoreMetaData.ts +++ b/packages/app-store/appStoreMetaData.ts @@ -1,4 +1,4 @@ -import { AppMeta } from "@calcom/types/App"; +import type { AppMeta } from "@calcom/types/App"; import { appStoreMetadata as rawAppStoreMetadata } from "./apps.metadata.generated"; diff --git a/packages/app-store/applecalendar/lib/CalendarService.ts b/packages/app-store/applecalendar/lib/CalendarService.ts index 2b7aac1291..4565ba2d7d 100644 --- a/packages/app-store/applecalendar/lib/CalendarService.ts +++ b/packages/app-store/applecalendar/lib/CalendarService.ts @@ -1,5 +1,5 @@ import CalendarService from "@calcom/lib/CalendarService"; -import { CredentialPayload } from "@calcom/types/Credential"; +import type { CredentialPayload } from "@calcom/types/Credential"; export default class AppleCalendarService extends CalendarService { constructor(credential: CredentialPayload) { diff --git a/packages/app-store/around/DESCRIPTION.md b/packages/app-store/around/DESCRIPTION.md index 12bf570c0e..c03182bf88 100644 --- a/packages/app-store/around/DESCRIPTION.md +++ b/packages/app-store/around/DESCRIPTION.md @@ -10,4 +10,4 @@ items: - /api/app-store/around/8.jpg --- -Discover radically unique video calls designed to help hybrid-remote teams create, collaborate and celebrate together. \ No newline at end of file +Discover radically unique video calls designed to help hybrid-remote teams create, collaborate and celebrate together. diff --git a/packages/app-store/caldavcalendar/DESCRIPTION.md b/packages/app-store/caldavcalendar/DESCRIPTION.md index a542acfddd..39f9e1c4cd 100644 --- a/packages/app-store/caldavcalendar/DESCRIPTION.md +++ b/packages/app-store/caldavcalendar/DESCRIPTION.md @@ -16,4 +16,4 @@ Every CalDav Provider is different and needs minor adjustments. Follow our CalDav Roadmap here: https://github.com/calcom/cal.com/issues/3457. -If your CalDav connection is not working, please try another Calendar provider (Google Mail or another CalDav). \ No newline at end of file +If your CalDav connection is not working, please try another Calendar provider (Google Mail or another CalDav). diff --git a/packages/app-store/caldavcalendar/lib/CalendarService.ts b/packages/app-store/caldavcalendar/lib/CalendarService.ts index 13bc20daf0..7c6b2db659 100644 --- a/packages/app-store/caldavcalendar/lib/CalendarService.ts +++ b/packages/app-store/caldavcalendar/lib/CalendarService.ts @@ -1,5 +1,5 @@ import CalendarService from "@calcom/lib/CalendarService"; -import { CredentialPayload } from "@calcom/types/Credential"; +import type { CredentialPayload } from "@calcom/types/Credential"; export default class CalDavCalendarService extends CalendarService { constructor(credential: CredentialPayload) { diff --git a/packages/app-store/campfire/DESCRIPTION.md b/packages/app-store/campfire/DESCRIPTION.md index 87d30abbc4..f69dd985ac 100644 --- a/packages/app-store/campfire/DESCRIPTION.md +++ b/packages/app-store/campfire/DESCRIPTION.md @@ -9,20 +9,25 @@ items: