[CLEAN] Synthetic Benchmark PR #23475 - refactor: remove circular dependency between prisma and app-store packages#87
Conversation
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
Benchmark PR calcom#23475
Type: Clean (correct implementation)
Original PR Title: refactor: remove circular dependency between prisma and app-store packages
Original PR Description: ## What does this PR do?
Removes the circular dependency between
@calcom/prismaand@calcom/app-storepackages by eliminating schema exports from the prisma package and moving validation closer to consuming code.Key Changes:
EventTypeAppMetadataSchemaandeventTypeAppMetadataOptionalSchemaexports from@calcom/prisma/zod-utilsimport { appDataSchemas } from "@calcom/app-store/apps.schemas.generated"from prisma packageappDataSchemasdirectly and create local typed schemas usingz.object(appDataSchemas).partial().optional()patternappSlug as keyof typeof appsRequested by: @keithwillcode
Devin Session: https://app.devin.ai/sessions/e26d7a824c6d4c9d8ea0803a3714ce33
Visual Demo (For contributors especially)
N/A - This is an internal refactoring with no user-facing changes.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Critical Testing Areas:
Environment Setup:
Expected Behavior:
Checklist
appSlug as keyof typeof apps) handle edge cases safelyFiles with Highest Risk:
packages/lib/payment/handlePayment.ts- Dynamic property access for payment datapackages/trpc/server/routers/viewer/eventTypes/update.handler.ts- Complex app iteration logicpackages/lib/server/service/eventTypeService.ts- Changed function signature from strict to flexible typingOriginal PR URL: refactor: remove circular dependency between prisma and app-store packages calcom/cal.com#23475
PR Type
Enhancement
Description
Move app metadata schemas from prisma to app-store package
Eliminate circular dependency between @calcom/prisma and @calcom/app-store
Update 40+ files to import schemas from new location
Create new
packages/app-store/zod-utils.tswith typed app schemasDiagram Walkthrough
File Walkthrough
42 files
New file with typed app metadata schemasRemove app metadata schema exportsImport schema from app-store packageUpdate mock imports for new schema locationImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageUpdate import path for EventTypeServiceImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schemas from app-store packageImport schema from app-store packageImport schema from app-store packageImport schemas from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageReplace typed schema with generic Record typeImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store packageImport schema from app-store package