Skip to content

fix: correct optional peer dependencies#1238

Closed
alumni wants to merge 1 commit intonest-modules:mainfrom
alumni:correct-package-json
Closed

fix: correct optional peer dependencies#1238
alumni wants to merge 1 commit intonest-modules:mainfrom
alumni:correct-package-json

Conversation

@alumni
Copy link
Copy Markdown

@alumni alumni commented Dec 6, 2024

Currently optional peer dependencies are not declared correctly, they are declared twice: as mandatory peer dependencies as well as optional direct dependencies.

This often causes false positives during security scans. E.g.: preview-email is not needed in production, however it has often been the cause of failing security audits.

This PR aims to declare them according to the package.json spec, i.e. using peerDependenciesMeta. This is available since npm@6.11 (August 2019), so any package manager in use nowadays should be able to handle this:

With this change, apps relying on @nestjs-modules/mailer will be able to avoid installing some of these optional peer dependencies if they are not needed (e.g. via pnpm.ignoredOptionalDependencies).

@alumni
Copy link
Copy Markdown
Author

alumni commented Dec 6, 2024

@juandav Could you please review? Thank you :)

juandav added a commit that referenced this pull request Mar 21, 2026
- fix(service): use logger.log instead of debug for transporter ready message (#1239, #1248, #1249)
- fix(service): reuse createTransporter in addTransporter for consistent verification and hooks (#1234)
- fix(liquid): initialize config with default empty object to prevent TypeError (#1232)
- fix(mjml): add optional chaining for others param to prevent crash when undefined
- fix(deps): add peerDependenciesMeta to mark template engines as optional (#1238, #1244)
- fix(deps): move tslib from devDependencies to dependencies for PnP runtime support (#1230)
- chore(deps): update devDependencies to latest compatible versions (#1242, #1250)
- docs: add Liquid adapter examples, MJML clarifications, multi-transporter docs (#1246)
- docs: add pnpm installation instructions and liquidjs to README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
juandav added a commit that referenced this pull request Mar 21, 2026
- fix(service): use logger.log instead of debug for transporter ready message (#1239, #1248, #1249)
- fix(service): reuse createTransporter in addTransporter for consistent verification and hooks (#1234)
- fix(liquid): initialize config with default empty object to prevent TypeError (#1232)
- fix(mjml): add optional chaining for others param to prevent crash when undefined
- fix(deps): add peerDependenciesMeta to mark template engines as optional (#1238, #1244)
- fix(deps): move tslib from devDependencies to dependencies for PnP runtime support (#1230)
- chore(deps): update devDependencies to latest compatible versions (#1242, #1250)
- docs: add Liquid adapter examples, MJML clarifications, multi-transporter docs (#1246)
- docs: add pnpm installation instructions and liquidjs to README

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@juandav
Copy link
Copy Markdown
Member

juandav commented Mar 21, 2026

Superseded by branch fix/multiple-issues-and-dependency-updates which includes peerDependenciesMeta marking all template engines as optional, along with other bug fixes, dependency updates, and documentation improvements. Thank you for your contribution!

@juandav juandav closed this Mar 21, 2026
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.

5 participants