Skip to content

fix: accept any webpack 5 as the optional peer dependency - #244

Merged
alexander-akait merged 1 commit into
mainfrom
fix/peer-webpack-range
Nov 6, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
fix/peer-webpack-range

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

#235 added webpack as an optional peer dependency with the range ^5.112.0. npm still checks an optional peer's range whenever that package is installed. So any project with an older webpack 5 now fails npm ls with invalid / ELSPROBLEMS. NestJS CLI hits this because it pins webpack@5.106.2 (reported in #235 (comment) and nestjs/nest-cli#3674).

Only precompile with minify needs webpack 5.112.0 or later. It already throws Install webpack 5.112.0 or later to minify a precompiled check when webpack is older, and the README already says so. This PR widens the peer range to ^5.0.0.

Changes

  • peerDependencies.webpack: ^5.112.0 → ^5.0.0, in package.json and package-lock.json. The devDependency stays at ^5.112.0, so tests still minify.
  • A patch changeset.

Tests

  • Packed the package and installed it with webpack@5.106.2: npm ls passes, which it didn't before.
  • With that webpack, precompile(schema) works and precompile(schema, { minify: true }) gives the existing clear error.
  • npm run lint and the full suite (1046 tests) pass.

Generated by Claude Code

Summary by CodeRabbit

  • Compatibility
    • The optional webpack peer dependency now accepts webpack 5 versions starting at 5.0.0. Using precompile with minification still requires webpack 5.112.0 or later; older versions will produce an error.

The ^5.112.0 peer range added in #235 broke installs that use an older
webpack 5 (e.g. NestJS CLI pins webpack@5.106.2): npm reports the peer
as invalid even though it is optional. Only precompile with minify needs
webpack 5.112.0+, and it already throws a clear error otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FhutRAVeDugCL2BfYpLty
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via:

Co-authored-by: name <email>

Supported Co-authored-by: formats include:

  1. Anything <id+login@users.noreply.github.com> - it will locate your GitHub user by id part.
  2. Anything <login@users.noreply.github.com> - it will locate your GitHub user by login part.
  3. Anything <public-email> - it will locate your GitHub user by public-email part. Note that this email must be made public on Github.
  4. Anything <other-email> - it will locate your GitHub user by other-email part but only if that email was used before for any other CLA as a main commit author.
  5. login <any-valid-email> - it will locate your GitHub user by login part, note that login part must be at least 3 characters long.

Alternatively, if the co-author should not be included, remove the Co-authored-by: line from the commit message.

Please update your commit message(s) by doing git commit --amend and then git push [--force] and then request re-running CLA check via commenting on this pull request:

/easycla

@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.23%. Comparing base (2d6aaec) to head (c8c795a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #244   +/-   ##
=======================================
  Coverage   97.23%   97.23%           
=======================================
  Files          13       13           
  Lines        1231     1231           
  Branches      476      476           
=======================================
  Hits         1197     1197           
  Misses         32       32           
  Partials        2        2           
Flag Coverage Δ
integration 97.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The optional webpack peer dependency range changes from ^5.112.0 to ^5.0.0. A patch changeset states that precompile with minify requires webpack 5.112.0 or later.

Merge Risk: Minimal · up to c8c79

The change accepts older webpack 5 peers while retaining the documented minification requirement. No merge-blocking risk was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the change to the optional webpack peer dependency range.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7892bdff-bc38-4018-8d31-eb875f3d6771
Commits

Reviewing files that changed from the base of the PR and between 2d6aaec and c8c795a.

Files ignored due to path filters: 1

  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 2

  • .changeset/peer-webpack-range.md
  • package.json

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@alexander-akait
alexander-akait merged commit 6dbe083 into main Nov 6, 2026
32 of 33 checks passed
@alexander-akait
alexander-akait deleted the fix/peer-webpack-range branch November 6, 2026 12:16
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.

2 participants