-
Notifications
You must be signed in to change notification settings - Fork 870
docs: update nuxt guide #7387
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
docs: update nuxt guide #7387
Conversation
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
WalkthroughDeprecates the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
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 |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
🍈 Lychee Link Check Report
📊 Results Overview
Errors per inputErrors in 200-orm/050-overview/300-prisma-in-your-stack/01-rest.mdx
Errors in 200-orm/050-overview/300-prisma-in-your-stack/02-graphql.mdx
|
Deploying docs with
|
| Latest commit: |
0bdfd67
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://092665d4.docs-51g.pages.dev |
| Branch Preview URL: | https://dr-6475-update-existing-guid.docs-51g.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
content/800-guides/100-nuxt.mdx (3)
28-29: Confirm the postinstall hook runs during deployment. Line 260 adds"postinstall": "prisma generate"to ensure Prisma Client is generated during the build. This is a solid pattern, but the guide should clarify that this step is essential before the first local run and during all deployments, especially since the generated client isn't committed to source control.Consider adding a note after the dependencies installation (lines 25-30) or in the "Run the app" section reminding developers to run
npx prisma generatelocally before the firstnpm run dev, in case the postinstall doesn't run in their local setup.
127-151: API routes follow Nuxt 3 conventions correctly. ThedefineEventHandlerusage, auto-importedprismainstance, and fetch patterns are idiomatic. However, the guide should mention error handling best practices (e.g., returning proper HTTP status codes, validation). Consider a note or reference to error handling for production use.Add a brief note after the POST route example mentioning input validation and error handling, or link to Nuxt error handling documentation for production readiness.
225-278: Deployment guidance covers both main paths. The two options (Vercel CLI and Git integration) are clear. However, the guide assumes developers know that the.envfile withDATABASE_URLmust be set in Vercel's environment variables before deployment. Consider emphasizing that the.env.localis for local development only and must never be committed; Vercel requires the variable to be set in the dashboard.Add a brief security note or callout before the deployment section reminding users: "
⚠️ Never commit.envto version control. Set environment variables in Vercel's dashboard before deploying."
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/200-orm/800-more/600-help-and-troubleshooting/900-prisma-nuxt-module.mdx(1 hunks)content/800-guides/100-nuxt.mdx(3 hunks)
⏰ 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). (2)
- GitHub Check: Check internal links
- GitHub Check: Cloudflare Pages
🔇 Additional comments (7)
content/200-orm/800-more/600-help-and-troubleshooting/900-prisma-nuxt-module.mdx (1)
8-9: Clear deprecation path. The warning is concise and directs users to the recommended guide.content/800-guides/100-nuxt.mdx (6)
42-67: Schema structure looks solid. The User and Post models with proper relationships and PrismaClient adapter usage are correct.
256-265: Postinstall script placement is correct. Including"postinstall": "prisma generate"ensures the generated client is ready after dependency installation during deployment. This is good practice.
189-217: Seed script is simplified well. Using a single user example is cleaner than the previous version and easier for new users to understand and modify.
1-14: Guide overview and structure are clear. The step-by-step flow from project creation through deployment is logical and complete. The new prisma.config.ts and modern Nuxt 3 patterns align well with current best practices.
103-121: The import path is correct and aligns with the schema configuration. The schema'soutput = "./generated"(line 45) places the generated client atprisma/generated/, and fromserver/utils/db.ts, the relative path../../prisma/generated/clientcorrectly resolves to that location. No change needed.
71-85: Clarify thatprisma.config.tsis an early-access feature. ThedefineConfigandenvhelpers from'prisma/config'are indeed supported by Prisma, but this feature is marked as early-access in the official documentation. Since the guide targets developers following it, explicitly mention the minimum Prisma version required (or note the early-access status) so readers understand they're adopting a feature that may evolve. This prevents unexpected breaking changes down the road.
…es-with-prisma-7-changes
🍈 Lychee Link Check Report
📊 Results Overview
Errors per inputErrors in 200-orm/050-overview/100-introduction/200-why-prisma.mdx
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
content/800-guides/100-nuxt.mdx (1)
256-265:postinstallscript works for Prisma 7 on Vercel, but strengthen it with build-step generation.Your three concerns all check out technically:
- ✅
prisma generateis the correct command in Prisma 7- ✅ Vercel's
postinstallhook runs before the build step- ✅ The generated client is available to your build
However, Vercel's dependency caching can leave the client out-of-date between deployments. Best practice is to also run
prisma generateduring the build step (e.g.,"build": "prisma generate && nuxt build") to guarantee a fresh client. Additionally, ensureprismais independencies(notdevDependencies) so the CLI is available during install.Also flag that Prisma 7 changed the default generator provider to
"prisma-client"(from"prisma-client-js") and requires explicit output configuration in the schema; guide readers using v7 should verify theirprisma.schemagenerator block matches their setup and runtime requirements (e.g., driver adapters).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
content/800-guides/100-nuxt.mdx(3 hunks)
⏰ 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). (2)
- GitHub Check: Check internal links
- GitHub Check: Cloudflare Pages
🔇 Additional comments (7)
content/800-guides/100-nuxt.mdx (7)
1-4: Well-structured guide with clear, modern approach.The updated documentation provides a clear, step-by-step Nuxt 3 + Prisma integration guide with explicit focus on Prisma Postgres. The prerequisites (Node.js 18+, Prisma Postgres) and description are appropriately scoped, and the guide aligns with modern Prisma 7 patterns (explicit adapter usage, PrismaPg).
Also applies to: 14-19
21-97: Project setup, schema, and migration flow are clear.The progression from project creation (with correct dependencies including adapter-pg) through schema definition to database migration is well-explained and follows Nuxt/Prisma best practices. The User/Post schema example is concrete and appropriate for demonstration.
99-173: Excellent Nuxt 3 integration patterns (singleton, API routes, fetch).The Prisma Client singleton pattern (lines 107–120) correctly prevents multiple client instances in development. The auto-import from
server/utils/is idiomatic Nuxt 3, and the API route examples (GET/POST) paired with theuseFetchcomposable inapp.vueform a cohesive, practical demonstration.
185-223: Seed script is concise and follows best practices.The seed file uses the same adapter pattern as the main client code, implements proper error handling with
$disconnect(), and provides a clear, minimal example (single user with a related post). The seed script is easy to understand and modify.
225-278: Deployment guidance covers both common Vercel workflows.Option A (Vercel CLI) and Option B (Git integration) provide clear, distinct paths for deployment. Environment variable configuration is explained in both cases. The note about
postinstallscript (Option B, line 260) correctly identifies the need to generate Prisma Client during deployment, which is essential.
71-85: No action needed—theprisma.config.tsconfiguration is valid and follows the official Prisma 7 pattern.The
defineConfigandenvexports fromprisma/configare standard in Prisma v7, and the configuration structure shown (withschema,migrations,datasource, andseedproperties) is correctly documented. The seed command syntax using'tsx ./prisma/seed.ts'is the expected format. This guide's configuration accurately reflects how Prisma 7 handles configuration files.
104-109: The code snippet is accurate and requires no changes. This documentation guide demonstrates correct patterns:
- The relative path
../../prisma/generated/clientis correct fromserver/utils/db.tswhen the schema specifiesoutput = "./generated"(as shown in the guide)- The
PrismaPgadapter instantiation withconnectionStringmatches the official API exactly- The full setup, from schema configuration through client initialization, is internally consistent and follows Prisma's recommended patterns for using the PostgreSQL adapter with Nuxt
Likely an incorrect or invalid review comment.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.