Skip to content

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

Merged
merged 4 commits into from
Jul 29, 2025
Merged

Conversation

AmanVarshney01
Copy link
Owner

@AmanVarshney01 AmanVarshney01 commented Jul 29, 2025

Summary by CodeRabbit

  • New Features

    • Automated addition of dotenv import to Prisma config for improved environment variable handling.
    • Added migration path configuration in Prisma setup templates for all supported databases.
  • Improvements

    • Updated dependency versions for better-auth, @prisma/client, prisma, and dotenv.
    • Added zod as a development dependency.
    • Simplified Prisma database scripts and removed explicit schema path references.
    • Standardized naming from "Prisma PostgreSQL" to "Prisma Postgres" in user-facing messages.
    • Updated default SQLite database path for non-worker runtimes.
    • Shortened the PWA addon label for clarity.
    • Improved notes and instructions for Turso and Prisma integrations.
    • Removed deprecated or unnecessary configuration properties in Prisma templates.
    • Removed conditional Prisma schema path from package templates.
    • Minor import order cleanup for improved code consistency.
  • Bug Fixes

    • Removed unused imports and redundant user instructions in CLI flows.

Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

This 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

Cohort / File(s) Change Summary
Dependency Version Updates
apps/cli/src/constants.ts,
apps/cli/templates/backend/server/next/package.json.hbs,
apps/cli/templates/backend/server/server-base/package.json.hbs
Bumped versions for "better-auth", "@better-auth/expo", "@prisma/client", "prisma", and "dotenv"; added "zod" to devDependencies; removed conditional "prisma" config block from server-base template.
Prisma Postgres Setup Automation & Naming
apps/cli/src/helpers/database-providers/prisma-postgres-setup.ts
Removed unused imports, standardized "Prisma Postgres" naming, added function to inject dotenv import into Prisma config, simplified fallback flow and error messages.
Prisma Config Template Updates
apps/cli/templates/db/prisma/mongodb/prisma.config.ts.hbs,
apps/cli/templates/db/prisma/mysql/prisma.config.ts.hbs,
apps/cli/templates/db/prisma/postgres/prisma.config.ts.hbs,
apps/cli/templates/db/prisma/sqlite/prisma.config.ts.hbs
Removed earlyAccess: true, added migrations property with path, updated conditional dotenv import for Postgres template.
Prisma Script Simplification
apps/cli/src/helpers/project-generation/project-config.ts
Removed explicit schema path from Prisma db scripts in package.json generation.
Database URL Default Update
apps/cli/src/helpers/project-generation/env-setup.ts
Changed default SQLite DB URL from "file:./local.db" to "file:../local.db" for non-worker runtimes.
Prisma Instructions and Notes
apps/cli/src/helpers/project-generation/post-installation.ts
Changed note logic for Prisma+SQLite to Prisma+Turso, removed Bun runtime note.
Addon Display Label
apps/cli/src/prompts/addons.ts
Shortened "PWA (Progressive Web App)" label to "PWA".
Import Order
apps/web/src/app/(home)/showcase/page.tsx
Reordered import statements for clarity.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Poem

A hop and a skip, some versions anew,
Dotenv now auto-injected—no more to-do!
Prisma’s configs are cleaner and neat,
Migrations in place, the setup’s complete.
With scripts and instructions all tidy and terse,
This bunny’s delighted—onward we traverse! 🐇✨

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch aman/update-prisma-0.13

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

pkg-pr-new bot commented Jul 29, 2025

Open in StackBlitz

npx https://pkg.pr.new/AmanVarshney01/create-better-t-stack@431

commit: 5bdafbc

Copy link

changeset-bot bot commented Jul 29, 2025

🦋 Changeset detected

Latest commit: 5bdafbc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-better-t-stack Patch

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 compatibility

Same 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

📥 Commits

Reviewing files that changed from the base of the PR and between ec808ff and e8a6942.

📒 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 reordering

The 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 label

Shortening 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 Bump

Verified 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 variable DOTENV_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 addition

Adding 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 the earlyAccess 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" to dbSetup === "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 the prisma.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 the addDotenvImportToPrismaConfig 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 when prismaConfig is available ensures the automation runs at the optimal time in the setup flow.

Comment on lines +47 to +48
"@prisma/client": "^6.13.0",
prisma: "^6.13.0",
Copy link
Contributor

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 new prisma-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 into node_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: The NotFoundError has been removed in favor of PrismaClientKnownRequestError with error code P2025 in methods like findUniqueOrThrow() and findFirstOrThrow(). Developers should update their error handling code accordingly. (github.com)

  • Reserved Keywords for Model Names: The keywords async, await, and using 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:


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 summary

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between e8a6942 and aac74b1.

📒 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 upgrade

Prisma 6.13.0 is a minor-version release. If any new features are exposed in your CLI templates or generated code, a minor bump for create-better-t-stack might be more semantically accurate than patch.
Please double-check the impact and adjust if needed.

@AmanVarshney01 AmanVarshney01 merged commit 16c4d42 into main Jul 29, 2025
3 checks passed
@AmanVarshney01 AmanVarshney01 deleted the aman/update-prisma-0.13 branch July 29, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant