Skip to content

Commit 3bc9fa1

Browse files
devin-ai-integration[bot]benny@cal.comhbjORbj
authored
chore: remove @calcom/lib barrel file (calcom#21267)
* refactor: replace imports from @calcom/lib barrel file with direct imports Co-Authored-By: benny@cal.com <benny@cal.com> * fix: add deprecated barrel file with warning to support tests Co-Authored-By: benny@cal.com <benny@cal.com> * remove barrel file * fix: restore barrel file with deprecation notice and add CreditType enum export Co-Authored-By: benny@cal.com <benny@cal.com> * fix: add CreditType enum definition to barrel file Co-Authored-By: benny@cal.com <benny@cal.com> * fix: add mock for CreditType enum in credit-service test Co-Authored-By: benny@cal.com <benny@cal.com> * fix: use importOriginal in CreditType enum mock Co-Authored-By: benny@cal.com <benny@cal.com> * fix: remove barrel file completely Co-Authored-By: benny@cal.com <benny@cal.com> * fix: restore barrel file with deprecation notice to support tests Co-Authored-By: benny@cal.com <benny@cal.com> * fix: update test-setup to use direct import from @calcom/ui/classNames Co-Authored-By: benny@cal.com <benny@cal.com> * fix: completely remove barrel file Co-Authored-By: benny@cal.com <benny@cal.com> * fix: update package.json to remove references to index.ts Co-Authored-By: benny@cal.com <benny@cal.com> * fix: remove main and types fields from package.json Co-Authored-By: benny@cal.com <benny@cal.com> * fix: restore barrel file with deprecation notice to support tests Co-Authored-By: benny@cal.com <benny@cal.com> * remove barrel file * fix --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: benny@cal.com <benny@cal.com> Co-authored-by: hbjORbj <sldisek783@gmail.com>
1 parent 7e699ab commit 3bc9fa1

27 files changed

Lines changed: 44 additions & 32 deletions

File tree

apps/api/v2/src/ee/event-types/event-types_2024_06_14/constants/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OrganizerIntegrationLocation } from "@calcom/lib";
1+
import { OrganizerIntegrationLocation } from "@calcom/lib/event-types/transformers/internal/locations";
22

33
type BaseEventType = {
44
length: number;

apps/web/app/api/cron/bookingReminder/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { NextResponse } from "next/server";
55
import dayjs from "@calcom/dayjs";
66
import { sendOrganizerRequestReminderEmail } from "@calcom/emails";
77
import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
8-
import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
8+
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
9+
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
910
import { getTranslation } from "@calcom/lib/server/i18n";
1011
import prisma, { bookingMinimalSelect } from "@calcom/prisma";
1112
import { BookingStatus, ReminderType } from "@calcom/prisma/enums";

apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { z } from "zod";
55
import { orgDomainConfig } from "@calcom/ee/organizations/lib/orgDomains";
66
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
77
import getBookingInfo from "@calcom/features/bookings/lib/getBookingInfo";
8-
import { parseRecurringEvent } from "@calcom/lib";
98
import { getDefaultEvent } from "@calcom/lib/defaultEvents";
9+
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
1010
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
1111
import { maybeGetBookingUidFromSeat } from "@calcom/lib/server/maybeGetBookingUidFromSeat";
1212
import { BookingRepository } from "@calcom/lib/server/repository/booking";

apps/web/modules/event-types/views/event-types-listing-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { EventTypeDescription } from "@calcom/features/eventtypes/components";
1515
import CreateEventTypeDialog from "@calcom/features/eventtypes/components/CreateEventTypeDialog";
1616
import { DuplicateDialog } from "@calcom/features/eventtypes/components/DuplicateDialog";
1717
import { InfiniteSkeletonLoader } from "@calcom/features/eventtypes/components/SkeletonLoader";
18-
import { parseEventTypeColor } from "@calcom/lib";
1918
import { APP_NAME, WEBSITE_URL } from "@calcom/lib/constants";
2019
import { useCopy } from "@calcom/lib/hooks/useCopy";
2120
import { useDebounce } from "@calcom/lib/hooks/useDebounce";
@@ -24,6 +23,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
2423
import { useGetTheme } from "@calcom/lib/hooks/useTheme";
2524
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
2625
import { HttpError } from "@calcom/lib/http-error";
26+
import { parseEventTypeColor } from "@calcom/lib/isEventTypeColor";
2727
import type { MembershipRole } from "@calcom/prisma/enums";
2828
import { SchedulingType } from "@calcom/prisma/enums";
2929
import type { RouterOutputs } from "@calcom/trpc/react";

packages/app-store/test-setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ vi.mock("@calcom/atoms/hooks/useIsPlatform", () => ({
2626
return false;
2727
},
2828
}));
29-
vi.mock("@calcom/lib", () => ({
30-
classNames: (...args: string[]) => {
29+
vi.mock("@calcom/ui/classNames", () => ({
30+
default: (...args: string[]) => {
3131
return args.filter(Boolean).join(" ");
3232
},
3333
}));

packages/features/bookings/lib/handleCancelBooking.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
1212
import { deleteWebhookScheduledTriggers } from "@calcom/features/webhooks/lib/scheduleTrigger";
1313
import sendPayload from "@calcom/features/webhooks/lib/sendOrSchedulePayload";
1414
import type { EventTypeInfo } from "@calcom/features/webhooks/lib/sendPayload";
15-
import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
1615
import EventManager from "@calcom/lib/EventManager";
1716
import { getBookerBaseUrl } from "@calcom/lib/getBookerUrl/server";
1817
import getOrgIdFromMemberOrTeamId from "@calcom/lib/getOrgIdFromMemberOrTeamId";
1918
import { getTeamIdFromEventType } from "@calcom/lib/getTeamIdFromEventType";
2019
import { HttpError } from "@calcom/lib/http-error";
20+
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
21+
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
2122
import logger from "@calcom/lib/logger";
2223
import { processPaymentRefund } from "@calcom/lib/payment/processPaymentRefund";
2324
import { safeStringify } from "@calcom/lib/safeStringify";

packages/features/bookings/lib/handleNewBooking/createBooking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { z } from "zod";
44

55
import type { routingFormResponseInDbSchema } from "@calcom/app-store/routing-forms/zod";
66
import dayjs from "@calcom/dayjs";
7-
import { isPrismaObjOrUndefined } from "@calcom/lib";
7+
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
88
import { withReporting } from "@calcom/lib/sentryWrapper";
99
import prisma from "@calcom/prisma";
1010
import { BookingStatus } from "@calcom/prisma/enums";

packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { LocationObject } from "@calcom/app-store/locations";
22
import { workflowSelect } from "@calcom/ee/workflows/lib/getAllWorkflows";
33
import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields";
4-
import { parseRecurringEvent } from "@calcom/lib";
54
import type { DefaultEvent } from "@calcom/lib/defaultEvents";
5+
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
66
import { withSelectedCalendars } from "@calcom/lib/server/repository/user";
77
import prisma, { userSelect } from "@calcom/prisma";
88
import { credentialForCalendarServiceSelect } from "@calcom/prisma/selects/credential";

packages/features/credentials/handleDeleteCredential.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
66
import { sendCancelledEmailsAndSMS } from "@calcom/emails";
77
import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
88
import { deleteWebhookScheduledTriggers } from "@calcom/features/webhooks/lib/scheduleTrigger";
9-
import { isPrismaObjOrUndefined, parseRecurringEvent } from "@calcom/lib";
109
import { buildNonDelegationCredential } from "@calcom/lib/delegationCredential/server";
10+
import { isPrismaObjOrUndefined } from "@calcom/lib/isPrismaObj";
11+
import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
1112
import { DailyLocationType } from "@calcom/lib/location";
1213
import { deletePayment } from "@calcom/lib/payment/deletePayment";
1314
import { getTranslation } from "@calcom/lib/server/i18n";

packages/features/ee/billing/credit-service.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ vi.mock("@calcom/lib/constants", async () => {
2222
};
2323
});
2424

25+
vi.mock("@calcom/prisma/enums", async (importOriginal) => {
26+
const actual = await importOriginal();
27+
return {
28+
...actual,
29+
CreditType: {
30+
MONTHLY: "MONTHLY",
31+
ADDITIONAL: "ADDITIONAL",
32+
},
33+
};
34+
});
35+
2536
vi.mock("@calcom/lib/server/repository/credits");
2637
vi.mock("@calcom/lib/server/repository/membership");
2738
vi.mock("@calcom/lib/server/repository/team");

0 commit comments

Comments
 (0)