-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: move WebWrapper files from packages/platform to apps/web/modules #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: coderabbit_full_base_refactor_move_webwrapper_files_from_packages_platform_to_apps_web_modules_pr9
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,8 @@ | ||||||||||||||
| "use client"; | ||||||||||||||
|
|
||||||||||||||
| import { useSession } from "next-auth/react"; | ||||||||||||||
| import { useSearchParams, usePathname, useRouter } from "next/navigation"; | ||||||||||||||
| import { useMemo, useCallback, useEffect, useRef } from "react"; | ||||||||||||||
| import { useSearchParams, usePathname } from "next/navigation"; | ||||||||||||||
| import { useMemo, useCallback, useEffect } from "react"; | ||||||||||||||
| import React from "react"; | ||||||||||||||
|
Comment on lines
+4
to
6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | head -50Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 2890 🏁 Script executed: cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '190,240p'Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 2125 🏁 Script executed: cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '40,100p'Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 2927 🏁 Script executed: rg "const router\s*=" apps/web/modules/bookings/components/BookerWebWrapper.tsxRepository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 68 🏁 Script executed: rg "router" apps/web/modules/bookings/components/BookerWebWrapper.tsx -B 2 -A 2Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 1414 🏁 Script executed: cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '100,180p'Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 3280 🏁 Script executed: cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | sed -n '180,210p'Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 1308 🏁 Script executed: wc -l apps/web/modules/bookings/components/BookerWebWrapper.tsxRepository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 147 🏁 Script executed: grep -n "router" apps/web/modules/bookings/components/BookerWebWrapper.tsxRepository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 454 🏁 Script executed: cat -n apps/web/modules/bookings/components/BookerWebWrapper.tsx | grep -E "(function|const.*=.*\(|router\s*:|router\s*=)" | head -30Repository: qodo-benchmark/cal.com-combined-coderabbit Length of output: 1946
🛠️ Proposed fix-import { useSearchParams, usePathname } from "next/navigation";
+import { useSearchParams, usePathname, useRouter } from "next/navigation"; const BookerWebWrapperComponent = (props: BookerWebWrapperAtomProps) => {
const pathname = usePathname();
const searchParams = useSearchParams();
+ const router = useRouter();📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| import { shallow } from "zustand/shallow"; | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -12,7 +12,6 @@ import { | |||||||||||||
| } from "@calcom/embed-core/embed-iframe"; | ||||||||||||||
| import { useBookerEmbedEvents } from "@calcom/embed-core/src/embed-iframe/react-hooks"; | ||||||||||||||
| import type { BookerProps } from "@calcom/features/bookings/Booker"; | ||||||||||||||
| import { Booker as BookerComponent } from "@calcom/web/modules/bookings/components/Booker"; | ||||||||||||||
| import { | ||||||||||||||
| BookerStoreProvider, | ||||||||||||||
| useInitializeBookerStoreContext, | ||||||||||||||
|
|
@@ -33,12 +32,13 @@ import { DEFAULT_LIGHT_BRAND_COLOR, DEFAULT_DARK_BRAND_COLOR, WEBAPP_URL } from | |||||||||||||
| import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery"; | ||||||||||||||
| import { localStorage } from "@calcom/lib/webstorage"; | ||||||||||||||
|
|
||||||||||||||
| import { Booker as BookerComponent } from "./Booker"; | ||||||||||||||
|
|
||||||||||||||
| export type BookerWebWrapperAtomProps = BookerProps & { | ||||||||||||||
| eventData?: NonNullable<Awaited<ReturnType<typeof getPublicEvent>>>; | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| const BookerWebWrapperComponent = (props: BookerWebWrapperAtomProps) => { | ||||||||||||||
| const router = useRouter(); | ||||||||||||||
| const pathname = usePathname(); | ||||||||||||||
| const searchParams = useSearchParams(); | ||||||||||||||
| const clientFetchedEvent = useEvent({ | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 7713
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 988
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 179
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 884
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 800
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 258
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 1508
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 1705
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 3731
🏁 Script executed:
Repository: qodo-benchmark/cal.com-combined-coderabbit
Length of output: 746
Add
@calcom/platform-atomsto transpilePackages and prefer entry-point exports.Lines 3–4 import directly from package source paths (atoms-wrapper and DestinationCalendar file), bypassing the main entry point. The AtomsWrapper is not exported from the package entry, but DestinationCalendarSettings is available as
DestinationCalendarSettingsPlatformWrapperfrompackages/platform/atoms. Additionally,@calcom/platform-atomsis not listed in Next.js transpilePackages at apps/web/next.config.ts (which currently includes@calcom/app-store,@calcom/features,@calcom/lib, etc.), which may cause transpilation issues in production. Either add@calcom/platform-atomsto transpilePackages or consider creating a tsconfig path alias to normalize these imports.🤖 Prompt for AI Agents