-
Notifications
You must be signed in to change notification settings - Fork 870
nestjs guide updated to esm #7360
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
WalkthroughThis PR updates the NestJS guide documentation to support ES modules by adding Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
Comment |
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
|
🍈 Lychee Link Check Report
📊 Results Overview
|
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
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/430-nestjs.mdx (1)
1-521: Consider briefly explaining why.jsextensions 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
.jsextensions 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
:::noteor 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.jsextension."
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 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
.jsextensions (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.tsfiles are compiled to.jsoutput, 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
Deploying docs with
|
| 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 |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.