fix import paths in getting started tutorials#7100
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughDocumentation TypeScript examples now import PrismaClient from a locally generated path ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (1)
138-149: Type sample mismatches MongoDB (numeric ids)MongoDB ids are strings/ObjectIds; the sample shows numbers. Correct the types to avoid confusing readers.
export type Post = { - id: number + id: string title: string body: string | null published: boolean - authorId: number | null + authorId: string | null }content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx (1)
48-48: Update the explanatory bullet to match the new import path.Readers will be confused by the reference to @prisma/client after switching the snippet to ./generated/prisma.
Apply:
-1. Import the `PrismaClient` constructor from the `@prisma/client` node module +1. Import the `PrismaClient` constructor from the local module at `./generated/prisma`content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx (1)
48-48: Align the prose with the new import.The bullet still points to @prisma/client; update to reflect ./generated/prisma.
Apply:
-1. Import the `PrismaClient` constructor from the `@prisma/client` node module +1. Import the `PrismaClient` constructor from the local module at `./generated/prisma`
🧹 Nitpick comments (9)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (4)
24-42: Align code fence language with TypeScriptThe snippet declares index.ts; use ts fence for correct highlighting/copy UX.
-```js file=index.ts copy +```ts file=index.ts copy
46-52: Docs text still references @prisma/clientUpdate step 1 to match the new import path.
-1. Import the `PrismaClient` constructor from the `@prisma/client` node module +1. Import the `PrismaClient` constructor from `./generated/prisma` (using a generator `output` of `./generated/prisma`)
75-76: MongoDB uses collections, not tablesMinor terminology fix.
-The `findMany` query you used in the previous section only _reads_ data from the database (although it was still empty). In this section, you'll learn how to write a query to _write_ new records into the `Post`, `User` and `Comment` tables. +The `findMany` query you used in the previous section only _reads_ data from the database (although it was still empty). In this section, you'll learn how to write a query to _write_ new records into the `Post`, `User`, and `Comment` collections.
171-171: Grammar/wording tweak for clarity“reference” → “references”; avoid “column” in MongoDB context.
-> **Note**: The unique identifier in the `authorId` document field on `Post` reference the `_id` document field in the `User` collection, meaning the `_id` value `60cc9b0e001e3bfd00a6eddf` column therefore refers to the first (and only) `User` record in the database. +> **Note**: The unique identifier in the `authorId` document field on `Post` references the `_id` document field in the `User` collection, meaning the `_id` value `60cc9b0e001e3bfd00a6eddf` refers to the first (and only) `User` record in the database.content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (2)
118-123: Call out the generator output explicitly (prevents confusion)Since examples import from a local client path, add the generator block to the page to make it self-contained.
Install the required dependencies to use Prisma Postgres: ```terminal npm install prisma --save-dev npm install @prisma/extension-accelerate
+Add the Prisma Client generator to your
prisma/schema.prismaand direct the output to./generated/prisma:
+
+```prisma file=prisma/schema.prisma
+generator client {
- provider = "prisma-client-js"
- output = "./generated/prisma"
+}
+```--- `83-96`: **.gitignore suggestion for generated client directory** To avoid committing build artifacts, suggest ignoring the generated client. ```diff Navigate into your project folder: ```terminal cd ./hello-prismaNow that your project is in the correct location, continue with the setup.
+
+Addgenerated/to your.gitignoreto avoid committing the generated client:
+
+gitignore +generated/ +</blockquote></details> <details> <summary>content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx (1)</summary><blockquote> `47-52`: **Docs text still references @prisma/client** Update step 1 to reflect the new import path. ```diff -1. Import the `PrismaClient` constructor from the `@prisma/client` node module +1. Import the `PrismaClient` constructor from `./generated/prisma` (generator `output` set to `./generated/prisma`)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx (1)
48-53: Docs text still references @prisma/clientAlign the explanatory bullet with the updated import.
-1. Import the `PrismaClient` constructor from the `@prisma/client` node module +1. Import the `PrismaClient` constructor from `./generated/prisma` (using a generator `output` of `./generated/prisma`)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx (1)
46-53: Docs text still references @prisma/clientAdjust the bullet to match the new import path.
-1. Import the `PrismaClient` constructor from the `@prisma/client` node module +1. Import the `PrismaClient` constructor from `./generated/prisma` (with generator `output` set to `./generated/prisma`)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx(1 hunks)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx(1 hunks)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx(1 hunks)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx(1 hunks)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx(1 hunks)content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx(1 hunks)content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx(5 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). (4)
- GitHub Check: runner / linkspector
- GitHub Check: Check internal links
- GitHub Check: Lost Pixel
- GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (1)
25-25: Import path change looks good—verify generator output is configuredUsing ./generated/prisma requires generator client output to point there. Please ensure the preceding “Install Prisma Client” page for MongoDB instructs:
generator client { provider = "prisma-client-js" output = "./generated/prisma" }content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (1)
166-166: Import updates LGTM—ensure generator output matchesAll updated imports to ./generated/prisma look consistent. Please confirm this guide (or a prerequisite page) tells users to set the generator output accordingly, otherwise imports will fail at runtime.
Also applies to: 193-193, 251-251, 305-305, 370-370
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx (1)
26-26: Import path change looks good—verify generator output is configuredEnsure the corresponding “Install Prisma Client” step for PostgreSQL instructs setting
output = "./generated/prisma"in the generator.content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx (1)
27-27: Import path change looks good—verify generator output is configuredConfirm the PlanetScale “Install Prisma Client” page sets the generator
outputto./generated/prisma.content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx (1)
27-27: Import path change looks good—verify generator output is configuredPlease confirm the MySQL “Install Prisma Client” step instructs
output = "./generated/prisma"in the generator block.content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx (1)
27-27: Import path change looks good; verify generation and resolution.Same as the CockroachDB page: confirm this guide (or a prerequisite) creates ./generated/prisma and that tsx resolves it without an extension.
You can reuse the grep script from the other comment to scan all getting-started pages.
...isting-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx
Show resolved
Hide resolved
Deploying docs with
|
| Latest commit: |
92339dd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://005eb496.docs-51g.pages.dev |
| Branch Preview URL: | https://docs-fix-client-imports.docs-51g.pages.dev |
...sma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
Show resolved
Hide resolved
…g-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
...sma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
Outdated
Show resolved
Hide resolved
…g-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
Summary by CodeRabbit