Skip to content

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Dec 5, 2025

Summary by CodeRabbit

  • Documentation
    • Updated NestJS and Prisma integration guide to document ES module support, including configuration changes and updated import paths for modern JavaScript projects.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Walkthrough

This PR updates the NestJS guide documentation to support ES modules by adding "type": "module" to package.json, converting local import paths to include .js extensions, and removing the CommonJS moduleFormat from the Prisma generator configuration.

Changes

Cohort / File(s) Summary
NestJS Guide ES Module Migration
content/800-guides/430-nestjs.mdx
Adds ES module support via package.json configuration; updates import paths to include .js extensions for Prisma client and NestJS services/controllers; removes moduleFormat = "cjs" from Prisma generator configuration; updates code examples throughout to reflect ES module imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that all import path conversions correctly include .js extensions and maintain functional equivalence
  • Confirm the removal of moduleFormat = "cjs" doesn't introduce unintended side effects in the Prisma generator config
  • Ensure the ES module examples will actually execute as documented (particularly around the PrismaClient and service imports)

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'nestjs guide updated to esm' directly and clearly summarizes the main change: converting the NestJS guide documentation to ES modules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2268
✅ Successful 2238
⏳ Timeouts 0
🔀 Redirected 5
👻 Excluded 24
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 1

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
content/800-guides/430-nestjs.mdx (1)

1-521: Consider briefly explaining why .js extensions are required in ESM.

This is an excellent, complete migration of the NestJS guide to ESM. The examples are correct and will work correctly when users implement them. One small enhancement: a brief note explaining why .js extensions are necessary in ESM (i.e., explicit file extensions are required in ESM, unlike CommonJS) could help readers understand the rationale and feel more confident in the pattern. This is optional but can reduce confusion for developers unfamiliar with ESM strictness.

If you'd like, consider adding a brief callout box (using :::note or similar) near line 45 or in section 3 that explains: "In ES modules, file extensions are required on relative imports. Since TypeScript source files (.ts) are compiled to .js, we import using the .js extension."

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf7a40 and fdb386a.

📒 Files selected for processing (1)
  • content/800-guides/430-nestjs.mdx (7 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: jy-joung-bitor
Repo: prisma/docs PR: 0
File: :0-0
Timestamp: 2025-10-15T06:36:42.423Z
Learning: The `npm init` command supports the `--init-type=module` flag to initialize a project with ES module type in package.json. This is a valid npm CLI option documented at https://docs.npmjs.com/cli/v11/commands/npm-init#init-type
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7301
File: content/800-guides/410-cloudflare-workers.mdx:87-107
Timestamp: 2025-11-20T21:00:02.587Z
Learning: Do not suggest changes to `prisma.config.ts` files in the prisma/docs repository, as the code examples are intentional for documentation purposes.
📚 Learning: 2025-10-09T21:32:50.340Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.

Applied to files:

  • content/800-guides/430-nestjs.mdx
📚 Learning: 2025-11-20T21:00:02.587Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7301
File: content/800-guides/410-cloudflare-workers.mdx:87-107
Timestamp: 2025-11-20T21:00:02.587Z
Learning: Do not suggest changes to `prisma.config.ts` files in the prisma/docs repository, as the code examples are intentional for documentation purposes.

Applied to files:

  • content/800-guides/430-nestjs.mdx
⏰ 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 (2)
content/800-guides/430-nestjs.mdx (2)

45-52: ESM configuration properly established in package.json.

The addition of "type": "module" signals to Node.js that .js files should be treated as ES modules. This is the standard and correct approach for enabling ESM support in a Node.js project.


179-179: Import paths consistently and correctly updated for ESM.

All local module imports include .js extensions (e.g., './prisma.service.js', './generated/prisma/client.js'), while external dependencies (NestJS, Prisma ecosystem packages) correctly omit extensions. This is the idiomatic ESM pattern for TypeScript projects: source .ts files are compiled to .js output, and imports reference the compiled extensions.

The consistency across all service, controller, and module imports reinforces that this migration is thorough and follows a single clear convention.

Also applies to: 203-204, 271-272, 348-351, 464-464, 466-468

@cloudflare-workers-and-pages
Copy link

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: fdb386a
Status: ✅  Deploy successful!
Preview URL: https://ddfafe42.docs-51g.pages.dev
Branch Preview URL: https://update-nest-js-guide.docs-51g.pages.dev

View logs

@aidankmcalister aidankmcalister merged commit 432af39 into main Dec 5, 2025
8 checks passed
@aidankmcalister aidankmcalister deleted the update-nest-js-guide branch December 5, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants