Repository navigation
fix: accept any webpack 5 as the optional peer dependency - #244
Conversation
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
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. WalkthroughThe optional Merge Risk:
|
Summary
#235 added
webpackas 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 failsnpm lswithinvalid/ELSPROBLEMS. NestJS CLI hits this because it pinswebpack@5.106.2(reported in #235 (comment) and nestjs/nest-cli#3674).Only
precompilewithminifyneeds webpack 5.112.0 or later. It already throwsInstall webpack 5.112.0 or later to minify a precompiled checkwhen 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, inpackage.jsonandpackage-lock.json. The devDependency stays at^5.112.0, so tests still minify.Tests
webpack@5.106.2:npm lspasses, which it didn't before.precompile(schema)works andprecompile(schema, { minify: true })gives the existing clear error.npm run lintand the full suite (1046 tests) pass.Generated by Claude Code
Summary by CodeRabbit
precompilewith minification still requires webpack 5.112.0 or later; older versions will produce an error.