-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Upgrade Prisma to 7.2.0 #710
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 44217f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
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 |
WalkthroughUpgrades Prisma packages to v7, updates fastify generator pins and templates to emit Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
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: 1
🧹 Nitpick comments (2)
.claude/skills/package-upgrade/SKILL.md (2)
15-15: Consider using more formal phrasing.The phrase "get injected" could be replaced with "are injected" for a more formal tone in documentation.
🔎 Suggested fix
-2. **Generator constants** - Defines versions that get injected into generated projects +2. **Generator constants** - Defines versions that are injected into generated projects
172-172: Consider hyphenating compound adjective."Batch Related Updates" should be hyphenated as "Batch-Related Updates" when used as a compound adjective modifying "Updates".
🔎 Suggested fix
-1. **Batch Related Updates** - Group related packages together (e.g., React ecosystem, Vite ecosystem) +1. **Batch-Related Updates** - Group related packages together (e.g., React ecosystem, Vite ecosystem)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
examples/blog-with-auth/apps/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlexamples/todo-with-auth0/apps/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
.changeset/upgrade-prisma-7.md.claude/skills/package-upgrade/SKILL.mdPACKAGE-UPGRADE-PLAYBOOK.mdexamples/blog-with-auth/apps/backend/package.jsonexamples/todo-with-auth0/apps/backend/package.jsonpackages/fastify-generators/src/constants/fastify-packages.ts
💤 Files with no reviewable changes (1)
- PACKAGE-UPGRADE-PLAYBOOK.md
🧰 Additional context used
📓 Path-based instructions (4)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
Add a new Changeset in the
.changeset/directory for new features or changes, with format'package-name': patchand description of the feature or change
Files:
.changeset/upgrade-prisma-7.md
examples/blog-with-auth/**/package.json
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/package.json: Enforce pnpm 10+ as the package manager
Use ESM only with"type": "module"in package.json
Files:
examples/blog-with-auth/apps/backend/package.json
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing theanytype is necessary, do not iterate too much - leave the typing as broken and let the user fix itIf target code is not easily testable, refactor it to be more testable (e.g., export types or functions)
**/*.{ts,tsx}: Import components from '@baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Use form components with React Hook Form controller variants (InputField, TextareaField, SelectField, CheckboxField, SwitchField, ComboboxField, MultiComboboxField, ColorPickerField, DatePickerField, DateTimePickerField)
Use SidebarLayout, Card, Breadcrumb, NavigationMenu, and NavigationTabs components for consistent layout structure from @baseplate-dev/ui-components
Use Dialog, ConfirmDialog, and useConfirmDialog from @baseplate-dev/ui-components for modal dialogs and confirmation interactions
Always usecompareStringsfrom@baseplate-dev/utilsinstead ofString.prototype.localeCompare()for code generation, file sorting, and internal data structures
If a particular interface or type is not exported, modify the file to export it
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments when generating TypeScript code
Create generators usingcreateGeneratorwith configuration via descriptor schema (Zod), organizing into one or more tasks created withcreateGeneratorTask
Tasks should haverun(initialization) andbuild(code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Use provider scopes to control visibility and prevent collisions be...
Files:
packages/fastify-generators/src/constants/fastify-packages.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g.export * from './foo.js'instead of individual named exports
Use console.info/warn/error instead of console.log
Files:
packages/fastify-generators/src/constants/fastify-packages.ts
🧠 Learnings (3)
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/package.json : Enforce pnpm 10+ as the package manager
Applied to files:
examples/blog-with-auth/apps/backend/package.jsonexamples/todo-with-auth0/apps/backend/package.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Use pnpm 10+ as the package manager (enforced)
Applied to files:
examples/blog-with-auth/apps/backend/package.jsonexamples/todo-with-auth0/apps/backend/package.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to .changeset/*.md : Add a new Changeset in the `.changeset/` directory for new features or changes, with format `'package-name': patch` and description of the feature or change
Applied to files:
.claude/skills/package-upgrade/SKILL.md
🪛 LanguageTool
.claude/skills/package-upgrade/SKILL.md
[style] ~15-~15: The verb “get” can be informal. Consider replacing it with a form of “to be”.
Context: ...tor constants** - Defines versions that get injected into generated projects Both locations...
(GET_USED_ARE_USED)
[grammar] ~172-~172: Use a hyphen to join words.
Context: ...mentation ## Best Practices 1. Batch Related Updates - Group related packag...
(QB_NEW_EN_HYPHEN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Lint
- GitHub Check: Test E2E
- GitHub Check: test
🔇 Additional comments (3)
examples/todo-with-auth0/apps/backend/package.json (1)
47-47: LGTM! Version updates are consistent with generator constants.The Prisma-related package versions correctly match the updated constants in
packages/fastify-generators/src/constants/fastify-packages.ts.Also applies to: 53-54, 101-101
.changeset/upgrade-prisma-7.md (1)
1-10: LGTM! Changeset correctly documents the Prisma upgrade.The changeset follows the proper format and accurately lists all upgraded packages with their version changes.
examples/blog-with-auth/apps/backend/package.json (1)
42-42: LGTM! Version updates are consistent with generator constants.The Prisma-related package versions correctly match the updated constants in
packages/fastify-generators/src/constants/fastify-packages.ts.Also applies to: 48-49, 83-83
| '@pothos/plugin-simple-objects': '4.1.3', | ||
| '@pothos/plugin-relay': '4.6.2', | ||
| '@pothos/plugin-prisma': '4.12.0', | ||
| '@pothos/plugin-prisma': '4.14.1', |
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.
Update @pothos/plugin-prisma version and add Prisma 7 configuration requirements.
Version 4.14.1 does not exist in npm; the latest is 4.12.0. @pothos/plugin-prisma 4.13.0+ requires the dmmf option when configuring the Prisma plugin for Prisma 7 compatibility, since Prisma 7 no longer exposes DMMF data on client internals—import getDatamodel from generated Pothos types and pass it to the prisma config.
Verify these migration steps:
- Move datasource URL from schema to prisma.config.ts and pass either adapter for direct connection or accelerateUrl to PrismaClient constructor
- Remove automatic seed script execution; explicitly run prisma generate
- Check for @Map attributes on enums—a breaking change in v7 requires code updates before upgrading
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: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (9)
examples/blog-with-auth/apps/backend/baseplate/generated/prisma/schema.prismais excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/apps/backend/src/generated/prisma/client.tsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/apps/backend/baseplate/generated/prisma/schema.prismais excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/apps/backend/src/generated/prisma/client.tsis excluded by!**/generated/**,!**/generated/**tests/simple/apps/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/apps/backend/baseplate/generated/prisma/schema.prismais excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/apps/backend/package.jsonis excluded by!tests/**tests/simple/apps/backend/prisma/schema.prismais excluded by!tests/**tests/simple/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!tests/**
📒 Files selected for processing (5)
examples/blog-with-auth/apps/backend/prisma/schema.prismaexamples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diffexamples/todo-with-auth0/apps/backend/prisma/schema.prismapackages/fastify-generators/src/generators/prisma/prisma/prisma.generator.tspackages/fastify-generators/src/writers/prisma-schema/schema.ts
💤 Files with no reviewable changes (4)
- packages/fastify-generators/src/writers/prisma-schema/schema.ts
- examples/todo-with-auth0/apps/backend/prisma/schema.prisma
- packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
- examples/blog-with-auth/apps/backend/prisma/schema.prisma
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Use pnpm 10+ as the package manager (enforced)
Applied to files:
examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: test
- GitHub Check: Lint
- GitHub Check: Test E2E
🔇 Additional comments (1)
examples/todo-with-auth0/apps/backend/.baseplate-snapshot/diffs/package.json.diff (1)
10-10: The versionsentry-testkit@^6.2.2is valid and has no known security issues.The package exists and is actively maintained. If this addition is intentional (e.g., part of testing infrastructure updates), it's appropriate. However, clarify whether this belongs in the scope of the Prisma upgrade PR, or if it should be a separate change.
| "prettier": "3.6.2", | ||
| "prettier-plugin-packagejson": "2.5.19", | ||
| "prisma": "6.17.1", | ||
| "prisma": "7.2.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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the diff file and examine its context
echo "=== Checking the diff file ==="
find . -path "*/.baseplate-snapshot/diffs/package.json.diff" -type f | head -5
# Check for package.json files in the backend directory
echo -e "\n=== Finding package.json files ==="
find . -path "*todo-with-auth0/apps/backend*" -name "package.json" -type f
# Look for prisma.config.ts files
echo -e "\n=== Checking for prisma.config.ts files ==="
find . -path "*todo-with-auth0/apps/backend*" -name "prisma.config.ts" -type f
# Check git status around this change
echo -e "\n=== Git files in backend directory ==="
git ls-files | grep -i "todo-with-auth0/apps/backend" | grep -E "(package\.json|prisma\.config\.ts|schema\.prisma)" | head -10Repository: halfdomelabs/baseplate
Length of output: 696
Create prisma.config.ts and move DATABASE_URL from schema.prisma — critical for Prisma 7.2.0.
Upgrading to Prisma v7 requires several mandatory configuration changes that appear to be missing:
-
Create prisma.config.ts — Starting with Prisma ORM v7, a prisma.config.ts file is automatically created, and the database connection URL is now configured in this file instead of in the schema.prisma file. This file does not currently exist in the project.
-
Move DATABASE_URL — The datasource property url is no longer supported in schema files; move connection URLs to prisma.config.ts and pass either adapter for a direct database connection or accelerateUrl to the PrismaClient constructor.
-
Configure database adapter — @prisma/adapter-pg + pg is now the default combo for PostgreSQL. Verify this adapter is installed and properly instantiated in PrismaClient.
-
Update scripts — Migrate dev and db push no longer run prisma generate automatically; you must run prisma generate explicitly.
-
Verify related packages — Ensure @prisma/client and other Prisma-related packages (@pothos/plugin-prisma) are also upgraded to compatible v7 versions.
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: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (12)
examples/blog-with-auth/apps/backend/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/apps/backend/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/prisma/prisma/generated/template-paths.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/prisma/prisma/generated/typed-templates.tsis excluded by!**/generated/**,!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yamltests/simple/apps/backend/baseplate/file-id-map.jsonis excluded by!tests/**tests/simple/apps/backend/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/apps/backend/eslint.config.jsis excluded by!tests/**tests/simple/apps/backend/prisma.config.tsis excluded by!tests/**
📒 Files selected for processing (12)
examples/blog-with-auth/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/blog-with-auth/apps/backend/prisma.config.tsexamples/todo-with-auth0/apps/backend/.templates-info.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.tspackages/fastify-generators/package.jsonpackages/fastify-generators/src/generators/prisma/prisma/extractor.jsonpackages/fastify-generators/src/generators/prisma/prisma/prisma.generator.tspackages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts
🧰 Additional context used
📓 Path-based instructions (6)
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}: Always use .js extensions in import statements, even for TypeScript files (e.g.,import { getSystemInfo } from '@src/system-info.js';)
Follow ESM module resolution with TypeScript'sNodeNextsetting
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Files:
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/eslint.config.js
examples/blog-with-auth/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/*.{ts,tsx}: Useimport typefor type-only imports in TypeScript
Always specify explicit return types for functions in TypeScript
Files:
examples/blog-with-auth/apps/backend/prisma.config.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing theanytype is necessary, do not iterate too much - leave the typing as broken and let the user fix itIf target code is not easily testable, refactor it to be more testable (e.g., export types or functions)
**/*.{ts,tsx}: Import components from '@baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Use form components with React Hook Form controller variants (InputField, TextareaField, SelectField, CheckboxField, SwitchField, ComboboxField, MultiComboboxField, ColorPickerField, DatePickerField, DateTimePickerField)
Use SidebarLayout, Card, Breadcrumb, NavigationMenu, and NavigationTabs components for consistent layout structure from @baseplate-dev/ui-components
Use Dialog, ConfirmDialog, and useConfirmDialog from @baseplate-dev/ui-components for modal dialogs and confirmation interactions
Always usecompareStringsfrom@baseplate-dev/utilsinstead ofString.prototype.localeCompare()for code generation, file sorting, and internal data structures
If a particular interface or type is not exported, modify the file to export it
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments when generating TypeScript code
Create generators usingcreateGeneratorwith configuration via descriptor schema (Zod), organizing into one or more tasks created withcreateGeneratorTask
Tasks should haverun(initialization) andbuild(code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Use provider scopes to control visibility and prevent collisions be...
Files:
examples/blog-with-auth/apps/backend/prisma.config.tspackages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.tsexamples/todo-with-auth0/apps/backend/prisma.config.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g.export * from './foo.js'instead of individual named exports
Use console.info/warn/error instead of console.log
Files:
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/eslint.config.jspackages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.tsexamples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
examples/todo-with-auth0/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
Always use .js extensions in import statements, even for TypeScript files. Example:
import { getSystemInfo } from '@src/system-info.js';
Files:
examples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
examples/todo-with-auth0/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
examples/todo-with-auth0/**/*.{ts,tsx}: Useimport typefor type-only imports
Always specify explicit return types for functions
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Files:
examples/todo-with-auth0/apps/backend/prisma.config.ts
🧠 Learnings (30)
📚 Learning: 2025-11-24T19:45:27.654Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-11-24T19:45:27.654Z
Learning: Applies to +(*.tsx|packages/project-builder-web/**/*.tsx|packages/ui-components/**/*.tsx) : Use ShadCN-based components from `baseplate-dev/ui-components` instead of creating custom components
Applied to files:
packages/fastify-generators/package.jsonexamples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Import components from 'baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Applied to files:
packages/fastify-generators/package.jsonexamples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Create generators using `createGenerator` with configuration via descriptor schema (Zod), organizing into one or more tasks created with `createGeneratorTask`
Applied to files:
examples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/.templates-info.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Follow task-based architecture for generators, use provider scopes for explicit wiring, leverage TypeScript rendering system for code generation, organize complex generation with Task Phases, and use Dynamic Tasks for data-driven generation
Applied to files:
examples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Always use `compareStrings` from `baseplate-dev/utils` instead of `String.prototype.localeCompare()` for code generation, file sorting, and internal data structures
Applied to files:
examples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Use Dynamic Tasks for data-driven generation where code generation is driven by data
Applied to files:
examples/blog-with-auth/apps/backend/baseplate/file-id-map.jsonexamples/todo-with-auth0/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/.templates-info.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx} : Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Applied to files:
examples/todo-with-auth0/apps/backend/.templates-info.jsonexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx} : Use `import type` for type-only imports
Applied to files:
examples/todo-with-auth0/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-07-07T18:24:17.522Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 592
File: plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-required-user-id.ts:1-2
Timestamp: 2025-07-07T18:24:17.522Z
Learning: Files under templates/** directories can use `// ts-nocheck` because they are templates meant for code generation, not direct type checking.
Applied to files:
examples/todo-with-auth0/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx} : Use `import type` for type-only imports in TypeScript
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use `NodeNext` module resolution in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-06-11T18:31:22.247Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 571
File: packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts:102-106
Timestamp: 2025-06-11T18:31:22.247Z
Learning: For `templateExtractorBarrelExportPlugin.addGeneratedBarrelExport`, the generated barrel exports are written into `generated/index.ts`, therefore the `moduleSpecifier` must be specified relative to that file (e.g., `./typed-templates.js`), not the project root.
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.json
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping when using explicit relative paths (with "./"). Removing baseUrl from tsconfig.json while updating paths to use relative paths (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`src/` is the alias for `src/`)
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.jsonexamples/todo-with-auth0/apps/backend/baseplate/file-id-map.json
📚 Learning: 2025-07-16T17:15:56.714Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 613
File: packages/react-generators/src/generators/core/react-components/templates/components/ui/circular-progress/circular-progress.tsx:0-0
Timestamp: 2025-07-16T17:15:56.714Z
Learning: For imports starting with `$` (template aliases), do not require `.js` extensions as these are resolved differently during the generation process, unlike regular file imports which require explicit `.js` extensions under Node 16 module resolution.
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.json
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, modify the file to export it
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.jsonexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx,js} : Node 16 module resolution - include file extensions in imports (`.js`)
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-07-14T12:02:36.595Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 609
File: packages/ui-components/src/components/badge/badge-with-icon.stories.tsx:3-3
Timestamp: 2025-07-14T12:02:36.595Z
Learning: For TypeScript/TSX files: `#src/` is the new path alias standard for `src/` directory imports, replacing the previous `src/` convention.
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/extractor.json
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use strict type checking in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/.templates-info.jsonexamples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx,js,jsx} : Always use .js extensions in import statements, even for TypeScript files (e.g., `import { getSystemInfo } from 'src/system-info.js';`)
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx,js,jsx} : Follow ESM module resolution with TypeScript's `NodeNext` setting
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Enable `isolatedModules` in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : Run `pnpm lint:affected` and `pnpm typecheck` before committing changes
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:45:19.136Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-11-24T19:45:19.136Z
Learning: Applies to **/*.unit.test.{ts,tsx} : Unit tests are colocated with source files using `.unit.test.ts` suffix
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Use `.unit.test.ts` or `.int.test.ts` suffixes for test files in TypeScript
Applied to files:
examples/blog-with-auth/apps/backend/eslint.config.jsexamples/todo-with-auth0/apps/backend/eslint.config.js
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx,js,jsx} : Always use .js extensions in import statements, even for TypeScript files. Example: `import { getSystemInfo } from 'src/system-info.js';`
Applied to files:
examples/todo-with-auth0/apps/backend/eslint.config.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Lint Examples (todo-with-auth0)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: test
- GitHub Check: Lint
- GitHub Check: Test E2E
🔇 Additional comments (8)
examples/blog-with-auth/apps/backend/baseplate/file-id-map.json (1)
76-76: LGTM!Mapping correctly updated to reference
prisma.config.tsinstead ofprisma.config.mts, consistent with the broader migration in this PR.packages/fastify-generators/src/generators/prisma/prisma/extractor.json (1)
29-30: LGTM!Template paths correctly updated to reference
prisma.config.ts, aligning with the migration from.mtsto.tsextension across the codebase.examples/blog-with-auth/apps/backend/.templates-info.json (1)
14-18: LGTM!Template entry correctly renamed to
prisma.config.ts, consistent with the file rename across the repository.examples/todo-with-auth0/apps/backend/.templates-info.json (1)
14-18: LGTM!Template entry correctly renamed to
prisma.config.ts, maintaining consistency with the file rename pattern across the repository.examples/blog-with-auth/apps/backend/prisma.config.ts (1)
1-19: The Prisma v7 configuration API is correct. The use ofdefineConfig()andenv()from'prisma/config'matches the standard Prisma v7 pattern.However, the environment loading approach deviates from the Prisma v7 standard. In Prisma ORM v7, the generated prisma.config.ts file includes
import 'dotenv/config'by default, rather than usingloadEnvFile()fromnode:processwith a conditionalexistsSynccheck. When using prisma.config.ts, environment variables need to be loaded explicitly—consider aligning with the documented approach for consistency.examples/todo-with-auth0/apps/backend/baseplate/file-id-map.json (1)
111-111: LGTM!The file path update from
prisma.config.mtstoprisma.config.tsaligns with the Prisma 7 upgrade and is consistent with changes across the PR.packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.ts (1)
1-21: LGTM!The template structure correctly mirrors the example configuration files. The
@ts-nocheckdirective is appropriate for a template with placeholders likeTPL_SEED_COMMAND, and the template will generate the same structure seen in the example files.examples/todo-with-auth0/apps/backend/prisma.config.ts (1)
3-3: No issues found. The Prisma 7.2.0 APIs are correctly implemented and follow the official configuration standards.
| const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [ | ||
| 'prisma.config.mts', | ||
| 'prisma.config.ts', | ||
| 'vitest.config.ts', | ||
| 'vitest.config.ts', | ||
| ]; /* TPL_DEFAULT_PROJECT_FILES:END */ |
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.
Remove duplicate vitest.config.ts entry.
Lines 39-40 contain duplicate entries of 'vitest.config.ts' in the TS_DEFAULT_PROJECT_FILES array.
🔎 Proposed fix
const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
'prisma.config.ts',
'vitest.config.ts',
- 'vitest.config.ts',
]; /* TPL_DEFAULT_PROJECT_FILES:END */📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [ | |
| 'prisma.config.mts', | |
| 'prisma.config.ts', | |
| 'vitest.config.ts', | |
| 'vitest.config.ts', | |
| ]; /* TPL_DEFAULT_PROJECT_FILES:END */ | |
| const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [ | |
| 'prisma.config.ts', | |
| 'vitest.config.ts', | |
| ]; /* TPL_DEFAULT_PROJECT_FILES:END */ |
🤖 Prompt for AI Agents
In examples/blog-with-auth/apps/backend/eslint.config.js around lines 37 to 41,
the TS_DEFAULT_PROJECT_FILES array contains a duplicated 'vitest.config.ts'
entry; remove the duplicate so the array lists each filename only once (e.g.,
keep one 'vitest.config.ts' and the other entries unchanged) to ensure the
project files array has unique entries.
| const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [ | ||
| 'prisma.config.mts', | ||
| 'prisma.config.ts', | ||
| 'vitest.config.ts', | ||
| 'vitest.config.ts', | ||
| ]; /* TPL_DEFAULT_PROJECT_FILES:END */ |
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.
Remove duplicate vitest.config.ts entry.
Lines 39-40 contain duplicate entries of 'vitest.config.ts' in the TS_DEFAULT_PROJECT_FILES array.
🔎 Proposed fix
const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [
'prisma.config.ts',
'vitest.config.ts',
- 'vitest.config.ts',
]; /* TPL_DEFAULT_PROJECT_FILES:END */📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [ | |
| 'prisma.config.mts', | |
| 'prisma.config.ts', | |
| 'vitest.config.ts', | |
| 'vitest.config.ts', | |
| ]; /* TPL_DEFAULT_PROJECT_FILES:END */ | |
| const TS_DEFAULT_PROJECT_FILES = /* TPL_DEFAULT_PROJECT_FILES:START */ [ | |
| 'prisma.config.ts', | |
| 'vitest.config.ts', | |
| ]; /* TPL_DEFAULT_PROJECT_FILES:END */ |
🤖 Prompt for AI Agents
In examples/todo-with-auth0/apps/backend/eslint.config.js around lines 37 to 41,
the TS_DEFAULT_PROJECT_FILES array contains a duplicate 'vitest.config.ts'
entry; remove the duplicated 'vitest.config.ts' so each file appears only once
(leave 'prisma.config.ts' and one 'vitest.config.ts').
| "@baseplate-dev/sync": "workspace:*", | ||
| "@baseplate-dev/utils": "workspace:*", | ||
| "@prisma/internals": "6.17.1", | ||
| "@prisma/internals": "7.2.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.
Verify Prisma/internals version and address breaking changes before upgrade.
Prisma 7.2.0 is released and stable, but this major version introduces significant breaking changes and unresolved security concerns that require attention:
Breaking Changes:
Environment variables are not loaded by default in Prisma 7.0.0; developers must explicitly load them when calling the Prisma CLI. Additionally, as of Prisma 7, driver adapters are required, and Prisma Config is now the default place for configuring database URL, schema location, and migrations.
Security Concerns:
Prisma 7 depends on hono <=4.10.2, which has multiple high-severity vulnerabilities including body limit middleware bypass, improper authorization, and CORS bypass. This was confirmed to be fixed in Prisma 7.0.1, though ongoing issues have been reported.
Note: The specified version @prisma/[email protected] differs from the latest published version (7.0.1). Verify the correct version and ensure all configuration changes for Prisma 7 are addressed.
🤖 Prompt for AI Agents
packages/fastify-generators/package.json around line 53: the dependency is
pinned to @prisma/[email protected] which may introduce Prisma v7 breaking changes
and known security issues (hono vulnerabilities); change the dependency to a
vetted safe version (e.g., 7.0.1) or the semver range your project supports, run
dependency install and npm/yarn audit, update any Prisma v7 configuration
(explicitly load env vars where Prisma CLI is used, add required driver
adapters, and move DB config to Prisma Config if upgrading), run the test suite
and migration scripts to catch breaking changes, and if you must keep 7.2.0
create a mitigation plan (patch or upgrade hono transitive dep, or add a direct
safe hono resolution) and document the rationale in package.json or PR notes.
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: 1
♻️ Duplicate comments (1)
packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.ts (1)
5-5: Remove unused import or use theenvhelper.Same issue as in the example file:
envis imported but never used. Line 19 usesprocess.env.DATABASE_URLdirectly instead of the importedenvhelper.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
examples/blog-with-auth/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!**/generated/**tests/simple/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/apps/backend/prisma.config.tsis excluded by!tests/**
📒 Files selected for processing (3)
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/todo-with-auth0/apps/backend/prisma.config.tspackages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- examples/todo-with-auth0/apps/backend/prisma.config.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing theanytype is necessary, do not iterate too much - leave the typing as broken and let the user fix itIf target code is not easily testable, refactor it to be more testable (e.g., export types or functions)
**/*.{ts,tsx}: Import components from '@baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Use form components with React Hook Form controller variants (InputField, TextareaField, SelectField, CheckboxField, SwitchField, ComboboxField, MultiComboboxField, ColorPickerField, DatePickerField, DateTimePickerField)
Use SidebarLayout, Card, Breadcrumb, NavigationMenu, and NavigationTabs components for consistent layout structure from @baseplate-dev/ui-components
Use Dialog, ConfirmDialog, and useConfirmDialog from @baseplate-dev/ui-components for modal dialogs and confirmation interactions
Always usecompareStringsfrom@baseplate-dev/utilsinstead ofString.prototype.localeCompare()for code generation, file sorting, and internal data structures
If a particular interface or type is not exported, modify the file to export it
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments when generating TypeScript code
Create generators usingcreateGeneratorwith configuration via descriptor schema (Zod), organizing into one or more tasks created withcreateGeneratorTask
Tasks should haverun(initialization) andbuild(code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Use provider scopes to control visibility and prevent collisions be...
Files:
packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.tsexamples/blog-with-auth/apps/backend/prisma.config.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g.export * from './foo.js'instead of individual named exports
Use console.info/warn/error instead of console.log
Files:
packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.tsexamples/blog-with-auth/apps/backend/prisma.config.ts
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}: Always use .js extensions in import statements, even for TypeScript files (e.g.,import { getSystemInfo } from '@src/system-info.js';)
Follow ESM module resolution with TypeScript'sNodeNextsetting
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Files:
examples/blog-with-auth/apps/backend/prisma.config.ts
examples/blog-with-auth/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/*.{ts,tsx}: Useimport typefor type-only imports in TypeScript
Always specify explicit return types for functions in TypeScript
Files:
examples/blog-with-auth/apps/backend/prisma.config.ts
🧠 Learnings (8)
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Applied to files:
packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.tsexamples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx} : Use `import type` for type-only imports in TypeScript
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use `NodeNext` module resolution in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use strict type checking in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping when using explicit relative paths (with "./"). Removing baseUrl from tsconfig.json while updating paths to use relative paths (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, modify the file to export it
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
🪛 GitHub Check: Lint Examples (blog-with-auth)
examples/blog-with-auth/apps/backend/prisma.config.ts
[failure] 3-3:
'env' is defined but never used
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: test
- GitHub Check: Test E2E
- GitHub Check: Lint
🔇 Additional comments (1)
examples/blog-with-auth/apps/backend/prisma.config.ts (1)
16-18: Verify datasource configuration approach.Confirm whether using
process.env.DATABASE_URLdirectly is the intended pattern for Prisma 7, or if the importedenvhelper should be used instead (e.g.,env.DATABASE_URL).
|
|
||
| import { existsSync } from 'node:fs'; | ||
| import { loadEnvFile } from 'node:process'; | ||
| import { defineConfig, env } from 'prisma/config'; |
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.
Use the imported env helper instead of process.env.DATABASE_URL.
The env helper from prisma/config is imported but never used. Use the env() helper to enforce that the environment variable exists. Replace process.env.DATABASE_URL on line 17 with env('DATABASE_URL') to follow Prisma 7 best practices.
🧰 Tools
🪛 GitHub Check: Lint Examples (blog-with-auth)
[failure] 3-3:
'env' is defined but never used
🤖 Prompt for AI Agents
In examples/blog-with-auth/apps/backend/prisma.config.ts around line 3 and
specifically line 17, the imported env helper from 'prisma/config' is unused and
the code reads process.env.DATABASE_URL; replace the direct process.env access
with env('DATABASE_URL') so the Prisma config validates the variable at startup,
keeping the existing import and removing reliance on raw process.env access.
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
examples/blog-with-auth/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!**/generated/**tests/simple/apps/backend/baseplate/generated/prisma.config.tsis excluded by!**/generated/**,!tests/**,!**/generated/**tests/simple/apps/backend/prisma.config.tsis excluded by!tests/**
📒 Files selected for processing (3)
examples/blog-with-auth/apps/backend/prisma.config.tsexamples/todo-with-auth0/apps/backend/prisma.config.tspackages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/fastify-generators/src/generators/prisma/prisma/templates/package/prisma.config.ts
🧰 Additional context used
📓 Path-based instructions (6)
examples/todo-with-auth0/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
Always use .js extensions in import statements, even for TypeScript files. Example:
import { getSystemInfo } from '@src/system-info.js';
Files:
examples/todo-with-auth0/apps/backend/prisma.config.ts
examples/todo-with-auth0/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
examples/todo-with-auth0/**/*.{ts,tsx}: Useimport typefor type-only imports
Always specify explicit return types for functions
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Files:
examples/todo-with-auth0/apps/backend/prisma.config.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
If a particular interface or type is not exported, change the file so it is exported
If caught on a typing loop where forcing theanytype is necessary, do not iterate too much - leave the typing as broken and let the user fix itIf target code is not easily testable, refactor it to be more testable (e.g., export types or functions)
**/*.{ts,tsx}: Import components from '@baseplate-dev/ui-components' package for UI development (e.g., Button, Input, Card, Dialog, etc.)
Use form components with React Hook Form controller variants (InputField, TextareaField, SelectField, CheckboxField, SwitchField, ComboboxField, MultiComboboxField, ColorPickerField, DatePickerField, DateTimePickerField)
Use SidebarLayout, Card, Breadcrumb, NavigationMenu, and NavigationTabs components for consistent layout structure from @baseplate-dev/ui-components
Use Dialog, ConfirmDialog, and useConfirmDialog from @baseplate-dev/ui-components for modal dialogs and confirmation interactions
Always usecompareStringsfrom@baseplate-dev/utilsinstead ofString.prototype.localeCompare()for code generation, file sorting, and internal data structures
If a particular interface or type is not exported, modify the file to export it
Use TsCodeFragment for composable code pieces and TsCodeUtils for manipulating fragments when generating TypeScript code
Create generators usingcreateGeneratorwith configuration via descriptor schema (Zod), organizing into one or more tasks created withcreateGeneratorTask
Tasks should haverun(initialization) andbuild(code generation) phases, export and consume providers, and may be organized into phases for ordered execution
Use provider scopes to control visibility and prevent collisions be...
Files:
examples/todo-with-auth0/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/prisma.config.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
Prefer using nullish coalescing operator (??) instead of logical or (||), enforced via ESLint rule
Prefer barrel exports e.g.export * from './foo.js'instead of individual named exports
Use console.info/warn/error instead of console.log
Files:
examples/todo-with-auth0/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/prisma.config.ts
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/*.{ts,tsx,js,jsx}: Always use .js extensions in import statements, even for TypeScript files (e.g.,import { getSystemInfo } from '@src/system-info.js';)
Follow ESM module resolution with TypeScript'sNodeNextsetting
Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Files:
examples/blog-with-auth/apps/backend/prisma.config.ts
examples/blog-with-auth/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/**/*.{ts,tsx}: Useimport typefor type-only imports in TypeScript
Always specify explicit return types for functions in TypeScript
Files:
examples/blog-with-auth/apps/backend/prisma.config.ts
🧠 Learnings (11)
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx} : Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Applied to files:
examples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{unit,int}.test.ts : Import test functions explicitly from 'vitest' instead of using globals. Example: `import { describe, expect, it } from 'vitest';`
Applied to files:
examples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:46.506Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:46.506Z
Learning: Applies to examples/todo-with-auth0/**/*.{ts,tsx} : Use `import type` for type-only imports
Applied to files:
examples/todo-with-auth0/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:45:01.582Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-11-24T19:45:01.582Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Applied to files:
examples/todo-with-auth0/apps/backend/prisma.config.tsexamples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx} : Use `import type` for type-only imports in TypeScript
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use `NodeNext` module resolution in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/tsconfig.json : Use strict type checking in TypeScript configuration
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping when using explicit relative paths (with "./"). Removing baseUrl from tsconfig.json while updating paths to use relative paths (e.g., changing "src/*": ["src/*"] to "src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-24T19:44:33.994Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:44:33.994Z
Learning: Applies to examples/blog-with-auth/**/*.{ts,tsx,js,jsx} : Add JSDocs to all exported functions, interfaces, and classes with documentation of the function, its parameters, return value, and all fields
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
📚 Learning: 2025-11-25T22:46:20.505Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T22:46:20.505Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, modify the file to export it
Applied to files:
examples/blog-with-auth/apps/backend/prisma.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Lint Examples (todo-with-auth0)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Test E2E
- GitHub Check: Lint
- GitHub Check: test
🔇 Additional comments (2)
examples/todo-with-auth0/apps/backend/prisma.config.ts (2)
1-3: LGTM! Imports are correct for Prisma 7 migration.The imports correctly use Node built-ins and the new
defineConfigfunction from 'prisma/config'. No file extensions needed for package imports per coding guidelines.
5-8: LGTM! Conditional environment loading is appropriate.The conditional check prevents errors when
.envis absent, which is a good defensive practice.
|
|
||
| import { existsSync } from 'node:fs'; | ||
| import { loadEnvFile } from 'node:process'; | ||
| import { defineConfig } from 'prisma/config'; |
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.
Use the env() helper for validated environment variable access.
Import and use the env('DATABASE_URL') helper from 'prisma/config' to validate that the environment variable exists at startup. This provides fail-fast behavior with clear error messages and follows Prisma 7 best practices, as noted in the previous review.
🔎 Proposed fix
-import { defineConfig } from 'prisma/config';
+import { defineConfig, env } from 'prisma/config'; datasource: {
- url: process.env.DATABASE_URL,
+ url: env('DATABASE_URL'),
},Also applies to: 17-17
🤖 Prompt for AI Agents
In examples/blog-with-auth/apps/backend/prisma.config.ts around lines 3 and 17,
the code imports defineConfig but does not use the env() helper to validate
DATABASE_URL; update the import to also bring in env from 'prisma/config' and
replace any direct process.env or raw string usage of the DATABASE_URL with
env('DATABASE_URL') so the value is validated at startup and fails fast with a
clear error if missing.
| export default defineConfig({ | ||
| schema: './prisma/schema.prisma', | ||
| migrations: { | ||
| path: './prisma/migrations', | ||
| seed: /* TPL_SEED_COMMAND:START */ 'tsx --env-file-if-exists=.env --env-file-if-exists=.seed.env src/prisma/seed.ts' /* TPL_SEED_COMMAND:END */, | ||
| }, | ||
| } satisfies PrismaConfig; | ||
| datasource: { | ||
| url: process.env.DATABASE_URL, | ||
| }, | ||
| }); |
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.
Use env() helper for type-safe DATABASE_URL validation instead of direct process.env access.
The defineConfig API with configuration shape shown is correct. However, the current code uses process.env.DATABASE_URL directly. The env() helper function from prisma/config provides type-safe access to environment variables and throws an error if the specified environment variable is not defined, which is important because every Prisma CLI command loads the prisma.config.ts file, though only some commands actually need the datasource.url value.
Using process.env.DATABASE_URL instead means validation is deferred to runtime rather than failing fast during config load. Consider:
import { defineConfig, env } from 'prisma/config';
export default defineConfig({
schema: './prisma/schema.prisma',
migrations: {
path: './prisma/migrations',
seed: /* TPL_SEED_COMMAND:START */ 'tsx --env-file-if-exists=.env --env-file-if-exists=.seed.env src/prisma/seed.ts' /* TPL_SEED_COMMAND:END */,
},
datasource: {
url: env('DATABASE_URL'),
},
});If the environment variable isn't guaranteed to exist (e.g., in CI/CD pipelines where you only run prisma generate for type-checking), use process.env directly with an optional fallback; use env() when you want to enforce that an environment variable exists, and use process.env directly when the variable may be optional depending on the command being run.
🤖 Prompt for AI Agents
In examples/todo-with-auth0/apps/backend/prisma.config.ts around lines 10 to 19,
replace the direct process.env.DATABASE_URL usage with the prisma config env()
helper to perform type-safe validation at config load; import env from
'prisma/config' alongside defineConfig and set datasource.url to
env('DATABASE_URL'). If DATABASE_URL is intentionally optional for some CI
commands, instead leave process.env access or provide a safe fallback, but
prefer env() when you want the config load to fail fast if the variable is
missing.
Summary by CodeRabbit
Chores
Documentation
Behavior
✏️ Tip: You can customize this high-level summary in your review settings.