-
-
Notifications
You must be signed in to change notification settings - Fork 140
feat(cli): Upgrade to Prisma 6.13.0 #431
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
Conversation
WalkthroughThis change updates dependency versions for several packages, automates the injection of dotenv imports into Prisma config files, standardizes naming conventions for "Prisma Postgres," modifies database URL defaults, updates Prisma configuration templates, and simplifies related scripts and user instructions. Several minor string and import order adjustments are also included. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant FileSystem
participant PrismaConfig
User->>CLI: Initiate Prisma Postgres setup
CLI->>FileSystem: Write .env file
CLI->>PrismaConfig: addDotenvImportToPrismaConfig()
PrismaConfig->>FileSystem: Prepend import "dotenv/config" to prisma.config.ts
CLI->>User: Continue setup or show error if dotenv injection fails
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
🦋 Changeset detectedLatest commit: 5bdafbc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/cli/templates/backend/server/next/package.json.hbs (1)
14-14
: Verify dotenv major version compatibilitySame as the previous package.json template, this updates dotenv from
^16.5.0
to^17.2.1
, which is a major version bump.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
apps/cli/src/constants.ts
(2 hunks)apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts
(5 hunks)apps/cli/src/helpers/project-generation/env-setup.ts
(1 hunks)apps/cli/src/helpers/project-generation/post-installation.ts
(1 hunks)apps/cli/src/helpers/project-generation/project-config.ts
(1 hunks)apps/cli/src/prompts/addons.ts
(1 hunks)apps/cli/templates/backend/server/next/package.json.hbs
(2 hunks)apps/cli/templates/backend/server/server-base/package.json.hbs
(1 hunks)apps/cli/templates/db/prisma/mongodb/prisma.config.ts.hbs
(1 hunks)apps/cli/templates/db/prisma/mysql/prisma.config.ts.hbs
(1 hunks)apps/cli/templates/db/prisma/postgres/prisma.config.ts.hbs
(1 hunks)apps/cli/templates/db/prisma/sqlite/prisma.config.ts.hbs
(1 hunks)apps/web/src/app/(home)/showcase/page.tsx
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
apps/cli/templates/backend/server/server-base/package.json.hbs (1)
Learnt from: Vijayabaskar56
PR: #310
File: apps/cli/templates/frontend/angular/src/app.component.html:1-7
Timestamp: 2025-06-08T17:57:33.083Z
Learning: The Angular frontend template uses Tailwind CSS v4, which doesn't require a traditional tailwind.config.js configuration file.
🧬 Code Graph Analysis (3)
apps/cli/templates/db/prisma/postgres/prisma.config.ts.hbs (1)
apps/cli/src/types.ts (1)
BetterTStackConfig
(152-167)
apps/cli/src/helpers/project-generation/post-installation.ts (2)
apps/cli/src/helpers/project-generation/create-readme.ts (1)
generateDatabaseSetup
(472-564)apps/cli/src/helpers/database-providers/turso-setup.ts (3)
setupTurso
(209-307)writeEnvFile
(180-195)createTursoDatabase
(140-178)
apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts (1)
apps/cli/src/helpers/setup/db-setup.ts (1)
setupDatabase
(16-103)
🔇 Additional comments (16)
apps/web/src/app/(home)/showcase/page.tsx (1)
5-5
: LGTM: Import reorderingThe import statement has been reordered to appear after the Footer import. This is a minor formatting improvement with no functional impact.
apps/cli/src/prompts/addons.ts (1)
26-26
: LGTM: Simplified PWA labelShortening the label from "PWA (Progressive Web App)" to just "PWA" improves the user interface by reducing visual clutter while the hint text maintains the necessary context.
apps/cli/templates/backend/server/server-base/package.json.hbs (1)
11-11
: dotenv v17 Compatibility – Safe to BumpVerified that the only breaking change in v17 is a new default runtime log informing about
.env
injection (no other API signatures or behavior have changed). If you require silent startup logs, you can suppress it with:•
require('dotenv').config({ quiet: true });
• or set the environment variableDOTENV_QUIET=true
All existing
dotenv.config()
usages and import/require patterns remain fully compatible. You can proceed with the dependency update from ^16.4.7 to ^17.2.1 without further changes.apps/cli/templates/backend/server/next/package.json.hbs (1)
24-24
: LGTM: zod devDependency additionAdding zod as a development dependency is beneficial for enhanced schema validation and type safety capabilities in the development workflow.
apps/cli/templates/db/prisma/mysql/prisma.config.ts.hbs (1)
7-9
: LGTM! Standardized Prisma configuration update.The addition of the
migrations
property with proper path configuration aligns with Prisma best practices and the removal of theearlyAccess
flag indicates the feature is now stable in version 6.13.0.apps/cli/src/constants.ts (1)
31-32
: LGTM! Better-auth version updates.The minor version updates for better-auth packages likely include bug fixes and improvements.
apps/cli/templates/db/prisma/mongodb/prisma.config.ts.hbs (1)
7-9
: LGTM! Consistent standardization across templates.The addition of the
migrations
property maintains consistency with other Prisma database templates and follows best practices.apps/cli/src/helpers/project-generation/post-installation.ts (1)
256-263
: LGTM! More specific condition for Turso setup.The change from
database === "sqlite"
todbSetup === "turso"
is more precise and appropriate. This correctly targets the specific Turso database setup scenario that requires Early Access documentation, rather than applying to all SQLite databases.apps/cli/templates/db/prisma/sqlite/prisma.config.ts.hbs (1)
7-9
: LGTM! Completes the standardization effort.The addition of the
migrations
property completes the consistent standardization across all Prisma database templates (MySQL, MongoDB, Postgres, and SQLite), improving maintainability and user experience.apps/cli/src/helpers/project-generation/project-config.ts (1)
251-253
: LGTM! Simplified Prisma commands align with config-based schema path.The removal of explicit
--schema ./prisma/schema
arguments from the Prisma CLI commands is appropriate since the schema path is now defined in theprisma.config.ts
file. This reduces duplication and follows Prisma's best practices for configuration management.apps/cli/templates/db/prisma/postgres/prisma.config.ts.hbs (2)
1-3
: Well-designed conditional dotenv import logic.The inverted conditional logic correctly excludes the dotenv import for
prisma-postgres
setups, where it will be injected programmatically by theaddDotenvImportToPrismaConfig
function in the setup process. This prevents duplication while ensuring the import is present when needed.
9-11
: Good addition of explicit migrations configuration.Adding the
migrations
property with an explicit path makes the Prisma configuration more complete and self-documenting. This follows Prisma best practices for configuration management and ensures migrations are stored in a predictable location.apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts (4)
2-2
: Good cleanup of unused import.Removing the unused
spinner
import keeps the imports clean and reduces bundle size.
26-26
: Consistent naming standardization to "Prisma Postgres".The standardization from "Prisma PostgreSQL" to "Prisma Postgres" across all user-facing messages creates a consistent experience and aligns with the PR objectives.
Also applies to: 243-243, 270-270, 279-279
152-164
: Well-implemented automation for dotenv import injection.The
addDotenvImportToPrismaConfig
function effectively automates what was previously a manual step for users. The implementation has:
- Proper file path construction
- Simple and reliable string prepending logic
- Appropriate error handling that logs failures without breaking the setup flow
- Clear function naming and purpose
This automation improves the user experience by eliminating manual configuration steps.
264-264
: Correct placement of dotenv import automation.Calling
addDotenvImportToPrismaConfig
after writing the env file and whenprismaConfig
is available ensures the automation runs at the optimal time in the setup flow.
"@prisma/client": "^6.13.0", | ||
prisma: "^6.13.0", |
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.
💡 Verification agent
🧩 Analysis chain
Verify Prisma 6.13.0 compatibility and changelog.
The Prisma version upgrade to 6.13.0 aligns with the PR objectives. Ensure this version is compatible with the configuration changes made to the templates.
🌐 Web query:
What are the key changes and breaking changes in Prisma 6.13.0?
💡 Result:
As of July 29, 2025, Prisma ORM has not released a version 6.13.0. The latest stable release is 6.12.0, which introduced several notable features and improvements.
Key Changes in Prisma ORM 6.12.0:
-
ESM-Compatible
prisma-client
Generator (Preview): The newprisma-client
generator offers enhanced flexibility and control over the generated Prisma Client code. It supports ECMAScript Modules (ESM) and allows developers to specify the output directory, moving away from the previous automatic generation intonode_modules
. (prisma.io) -
TypeScript-Based Configuration with
prisma.config.ts
(Early Access): Prisma ORM now supports a TypeScript-based configuration file,prisma.config.ts
, enabling developers to write custom code for configuration purposes. This feature is in Early Access and provides greater flexibility in managing Prisma's settings. (prisma.io) -
Case-Insensitive Mode in JSON Filters: Developers can now perform case-insensitive filtering on JSON data using the
mode
option with values like"insensitive"
. This enhancement simplifies queries that need to be case-insensitive. (prisma.io) -
Improved CockroachDB Migration Speed: Optimizations have been made to the migration engine, resulting in significantly faster migrations for CockroachDB. (prisma.io)
Breaking Changes:
-
Deprecation of
NotFoundError
: TheNotFoundError
has been removed in favor ofPrismaClientKnownRequestError
with error codeP2025
in methods likefindUniqueOrThrow()
andfindFirstOrThrow()
. Developers should update their error handling code accordingly. (github.com) -
Reserved Keywords for Model Names: The keywords
async
,await
, andusing
are now reserved and cannot be used as model names in the Prisma schema. (github.com)
For a comprehensive list of changes and detailed information, please refer to the official Prisma changelog. (prisma.io)
Citations:
- 1: https://www.prisma.io/changelog?utm_source=openai
- 2: https://www.prisma.io/changelog?utm_source=openai
- 3: https://www.prisma.io/changelog?utm_source=openai
- 4: https://www.prisma.io/changelog?utm_source=openai
- 5: https://github.com/prisma/prisma/releases?Bjce2XCBZ=uEiWg2&utm_source=openai
- 6: https://github.com/prisma/prisma/releases?Bjce2XCBZ=uEiWg2&utm_source=openai
- 7: https://www.prisma.io/changelog?utm_source=openai
Action Required: Correct Prisma dependency versions
It looks like Prisma 6.13.0 isn’t publicly released yet—the latest stable is 6.12.0. Please update your dependencies to a valid version or confirm you intend to use a prerelease.
• File: apps/cli/src/constants.ts
Lines 47–48
Current:
"@prisma/client": "^6.13.0",
prisma: "^6.13.0",
Suggested fix:
"@prisma/client": "^6.12.0",
prisma: "^6.12.0",
• If you’re on an early-access or alpha build of 6.13.0, switch to the correct prerelease tag (e.g. 6.13.0-alpha.x
) and document it.
• Verify compatibility against the official changelog once 6.13.0 is formally released.
🤖 Prompt for AI Agents
In apps/cli/src/constants.ts at lines 47-48, the Prisma dependency versions are
set to 6.13.0, which is not yet publicly released. Update both "@prisma/client"
and "prisma" versions to the latest stable 6.12.0, or if you intend to use a
prerelease, specify the correct prerelease tag like 6.13.0-alpha.x and document
this choice accordingly.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/legal-bears-feel.md (1)
5-6
: Consider a slightly richer summaryThe description could mention whether there are migration steps or template updates users should know about (e.g. “Upgrade internal Prisma templates & scripts to 6.13.0”). A bit more context helps future audits.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.changeset/legal-bears-feel.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/legal-bears-feel.md
[locale-violation] ~4-~4: 'Upgrade' é un xenismo. É preferíbel dicir "promoción"
Context: ...--- "create-better-t-stack": patch --- Upgrade to Prisma 6.13.0
(GL_BARBARISM_REPLACE)
🔇 Additional comments (1)
.changeset/legal-bears-feel.md (1)
2-3
: Confirm that a “patch” bump is sufficient for a Prisma 6.12 → 6.13 upgradePrisma 6.13.0 is a minor-version release. If any new features are exposed in your CLI templates or generated code, a
minor
bump forcreate-better-t-stack
might be more semantically accurate thanpatch
.
Please double-check the impact and adjust if needed.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes