perf: Remove circular dependencies - wip (#24586)

* wip

* refactor(emails): remove circular dependencies from packages/emails

- Extract renderEmail imports to use direct path (../src/renderEmail) instead of index
- Create utility files for shared types and functions:
  - lib/utils/team-invite-utils.ts: TeamInvite type and utility functions
  - lib/utils/booking-redirect-types.ts: IBookingRedirect type
  - lib/utils/email-types.ts: OrganizationCreation and EmailVerifyCode types
  - lib/utils/date-formatting.ts: getFormattedDate utility function
- Update all template files to import renderEmail directly from ../src/renderEmail
- Update React template components to import from utility files instead of class templates
- This eliminates all circular dependencies within packages/emails (reduced from 234 to 0 internal circular deps)

Co-Authored-By: Volnei Munhoz <[email protected]>

* refactor(trpc): remove circular dependency in routing-forms

- Extract ZFormByResponseIdInputSchema to separate schema file
- Create getResponseWithFormFields.schema.ts to break circular dependency
- Update imports in _router.ts and getResponseWithFormFields.handler.ts
- Fix eslint warnings by updating deprecated rule names
- This eliminates the circular dependency within packages/trpc (reduced from 1 to 0 internal circular deps)

Co-Authored-By: Volnei Munhoz <[email protected]>

* fix(emails): correct TeamInvite type definition

- Make isExistingUserMovedToOrg required (not optional)
- Make prevLink and newLink non-optional (string | null)
- Add back JSDoc comment for isAutoJoin field
- This fixes type check errors in CI

Co-Authored-By: Volnei Munhoz <[email protected]>

* wip

* Fixes types folder

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Volnei MunhozandDevin AI authored and GitHub committed 2025-10-21 12:24:47 +00:00
1 parent 6aa21aceb8
commit d82f87aa2a
56 files changed
+190 -155

No files matched your search

+3 -5
View File
@@ -6,7 +6,6 @@ import type { Frequency } from "rrule";
import type z from "zod";
import type { bookingResponse } from "@calcom/features/bookings/lib/getBookingResponsesSchema";
import type { Calendar } from "@calcom/features/calendars/weeklyview";
import type { TimeFormat } from "@calcom/lib/timeFormat";
import type {
BookingSeat,
@@ -66,7 +65,6 @@ export type EventBusyDetails = EventBusyDate & {
userId?: number | null;
};
export type CalendarServiceType = typeof Calendar;
export type AdditionalInfo = Record<string, unknown> & { calWarnings?: string[] };
export type NewCalendarEventType = {
@@ -104,9 +102,9 @@ export type CalendarEventType = {
isNegative: boolean;
};
organizer: string;
attendees: any[][];
attendees: unknown[][];
recurrenceId: Time;
timezone: any;
timezone: string | object;
};
export type BatchResponse = {
@@ -314,7 +312,7 @@ export interface Calendar {
/**
* @see [How to inference class type that implements an interface](https://stackoverflow.com/a/64765554/6297100)
*/
type Class<I, Args extends any[] = any[]> = new (...args: Args) => I;
type Class<I, Args extends unknown[] = unknown[]> = new (...args: Args) => I;
export type CalendarClass = Class<Calendar, [CredentialForCalendarService]>;