Repository navigation
refactor: extract 'prisma-client-js' into PRISMA_CLIENT_JS_PROVIDER constant - #29317
jacek-prisma merged 5 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
WalkthroughA new exported constant Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6d41f57b-41e0-4f71-b864-384b371d4c45
📒 Files selected for processing (9)
packages/cli/src/Generate.tspackages/cli/src/utils/checkpoint.tspackages/client-generator-js/src/generator.tspackages/client-generator-js/src/utils/types/dmmfToTypes.tspackages/client/src/utils/getTestClient.tspackages/internals/src/cli/getGeneratorSuccessMessage.tspackages/internals/src/index.tspackages/internals/src/prisma-client-js-provider.tspackages/internals/src/utils/extractPreviewFeatures.ts
|
Hey! Just a heads-up that the "Milestone Check" is blocking this PR because no milestone has been assigned yet — and as an external contributor I can't set it myself. Would a maintainer be able to set the right milestone here (I'm guessing |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 53321e7c-8438-4b17-a906-325cd2bc767d
📒 Files selected for processing (9)
packages/cli/src/Generate.tspackages/cli/src/utils/checkpoint.tspackages/client-generator-js/src/generator.tspackages/client-generator-js/src/utils/types/dmmfToTypes.tspackages/client/src/utils/getTestClient.tspackages/internals/src/cli/getGeneratorSuccessMessage.tspackages/internals/src/index.tspackages/internals/src/prisma-client-js-provider.tspackages/internals/src/utils/extractPreviewFeatures.ts
|
Hey Jacek! Applied both suggestions — grouped the providers into a |
Create PRISMA_CLIENT_JS_PROVIDER constant in @prisma/internals and replace all hardcoded 'prisma-client-js' string literals across cli, client, client-generator-js, and internals packages.
Group built-in provider strings into a single const enum as suggested in code review, also replacing the hardcoded 'prisma-client' literal.
d32eb75 to
fd02429
Compare
|
Hey @jacek-prisma! Quick update on the latest changes: Fixed the CI failures — the Changes in the latest push:
Still need maintainer action:
Thanks! |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/internals/src/built-in-provider.ts (1)
1-4: 🧹 Nitpick | 🔵 TrivialAdd a documentation comment for the exported
BuiltInProviderconstant.The exported constant is missing a documentation comment. As per coding guidelines: "Write documentation comments for exported items."
📝 Proposed documentation
+/** + * Built-in generator provider identifiers used across Prisma packages. + */ export const BuiltInProvider = { PrismaClientJs: 'prisma-client-js', PrismaClientTs: 'prisma-client', } as const
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9ce5f11b-8344-4747-a621-b4b1dc43bd0c
📒 Files selected for processing (2)
packages/cli/src/utils/checkpoint.tspackages/internals/src/built-in-provider.ts
…ROVIDER constant (prisma#29317)" This reverts commit 329aebb.
…ENT_JS_PROVIDER constant (prisma#29317)"" This reverts commit 90abab9.
Summary
Closes #29316
Extracts the hardcoded
'prisma-client-js'string literal into a sharedPRISMA_CLIENT_JS_PROVIDERconstant defined in@prisma/internals, replacing all occurrences across the codebase.Changes
packages/internals/src/prisma-client-js-provider.ts— single source of truth for the constantpackages/internals/src/index.ts— export the constantpackages/internals/src/cli/getGeneratorSuccessMessage.ts— use constantpackages/internals/src/utils/extractPreviewFeatures.ts— use constantpackages/cli/src/Generate.ts— use constant (2 occurrences)packages/cli/src/utils/checkpoint.ts— use constantpackages/client-generator-js/src/generator.ts— use constantpackages/client-generator-js/src/utils/types/dmmfToTypes.ts— use constant (2 occurrences)packages/client/src/utils/getTestClient.ts— use constantMotivation
This was identified during the review of #29315 by @coderabbitai. Having a single constant:
Test plan
pnpm buildpasses (43 tasks)getGeneratorstests pass (40/40, 33 snapshots)Summary by CodeRabbit