Repository navigation
chore(deps): update dependencies, rechoir v1 and ejs v7; harden stderr assertions - #4873
Conversation
Refresh every direct dependency to the newest version in its current major (supersedes #4870, #4869 and #4859): @babel/*, @swc/core, @types/node, cspell, eslint, eslint-config-webpack, jest, js-yaml, lint-staged, pkg-pr-new, prettier, readable-stream, sass, tsx, webpack, webpack-bundle-analyzer and @inquirer/*, plus transitive updates such as webpack-dev-middleware 8.3.0 and source-map-js 1.2.2. webpack 5.112 types `MultiConfiguration` as a readonly array with multi-compiler options, so `Array.isArray` no longer narrows it and the union no longer fits a single `webpack()` overload. Narrow with the existing `isMultipleConfiguration` guard and call `webpack()` per shape. Make tests resilient to third-party output: a single `cleanStderr` helper drops Node.js experimental warnings, Node.js core deprecations raised inside dependencies and webpack infrastructure info logs (`<i> ...`), while keeping webpack deprecations, warnings and errors. Every "stderr is empty" assertion goes through it. The analyze tests look for webpack-bundle-analyzer's message on both streams, since 5.4 moved it to stderr. The non-writable-path init test now skips when the directory is writable anyway (root in containers). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbymRVCYb4Cyn9e5vCaU8n
🦋 Changeset detectedLatest commit: 9cadf5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
This PR is packaged and the instant preview is available (9def039). Install it locally:
npm i -D create-webpack-app@https://pkg.pr.new/create-webpack-app@9def039 webpack-cli@https://pkg.pr.new/webpack-cli@9def039
yarn add -D create-webpack-app@https://pkg.pr.new/create-webpack-app@9def039 webpack-cli@https://pkg.pr.new/webpack-cli@9def039
pnpm add -D create-webpack-app@https://pkg.pr.new/create-webpack-app@9def039 webpack-cli@https://pkg.pr.new/webpack-cli@9def039 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4873 +/- ##
==========================================
- Coverage 94.86% 94.85% -0.01%
==========================================
Files 14 14
Lines 5626 5637 +11
Branches 841 846 +5
==========================================
+ Hits 5337 5347 +10
- Misses 288 289 +1
Partials 1 1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe CLI now uses Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments: 1
packages/webpack-cli/src/webpack-cli.ts: 1
3655-3674: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: Reduce the duplicated branches in
createCompiler.The two
webpack()calls in each branch are identical in shape. The only difference is the type ofconfig.options. The nested ternary is hard to read. The wrapper keeps the validation-error reporting and exit code 2, so runtime behavior is preserved.A small helper or an
if/elseblock with an early assignment would be easier to read. This is optional, because the current code is correct and type-safe.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
63eeb9e3-0326-4244-9705-62c67db8486a
⛔ Files ignored due to path filters: 1
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing: 110
package.jsonpackages/create-webpack-app/package.jsonpackages/webpack-cli/src/webpack-cli.tstest/build/analyze/analyze-flag.test.jstest/build/bail/bail.test.jstest/build/basic/basic.test.jstest/build/build-errors/errors.test.jstest/build/build-variable/build-variable.test.jstest/build/build-warnings/warnings.test.jstest/build/bundle-variable/bundle-variable.test.jstest/build/colors/colors.test.jstest/build/config-format/auto/auto.test.mjstest/build/config-format/babel-commonjs/babel-esm.test.jstest/build/config-format/coffee/coffee.test.jstest/build/config-format/commonjs-default/commonjs-default.test.jstest/build/config-format/commonjs/commonjs.test.jstest/build/config-format/disable-interpret/disable-interpret.test.jstest/build/config-format/esm-top-level-await/index.test.jstest/build/config-format/esm/mjs.test.jstest/build/config-format/json/json.test.jstest/build/config-format/json5/json5.test.jstest/build/config-format/typescript-auto/typescript.test.mjstest/build/config-format/typescript-cjs/typescript.test.mjstest/build/config-format/typescript-mjs/typescript.test.mjstest/build/config-format/typescript-tsx/typescript.test.mjstest/build/config-format/yaml/yaml.test.jstest/build/config-lookup/custom-name/custom-name.test.jstest/build/config-lookup/dotfolder-array/dotfolder-array.test.jstest/build/config-lookup/dotfolder-single/dotfolder-single.test.jstest/build/config-lookup/relative/basic-config.test.jstest/build/config-name/config-name.test.jstest/build/config-node-env/config-node-env.test.jstest/build/config/basic/basic-config.test.jstest/build/config/defaults/basic-config/default-js-config.test.jstest/build/config/defaults/cjs-config/default-cjs-config.test.jstest/build/config/defaults/dot-webpack-directory-webpackfile/dot-webpack-webpackfile.test.jstest/build/config/defaults/dot-webpack-directory/dot-webpack-config.test.jstest/build/config/defaults/mjs-config/default-mjs-config.test.jstest/build/config/defaults/with-mode/default-config-with-mode.test.jstest/build/config/empty-array/empty-array.test.jstest/build/config/empty-function/empty-function.test.jstest/build/config/empty-promise/empty-promise.test.jstest/build/config/empty/empty.test.jstest/build/config/function/functional-config.test.jstest/build/config/multi-compiler-options/multi-compiler-options.test.jstest/build/config/multi-compiler/multi-compiler.test.jstest/build/config/multiple-with-one-compilation/multiple-with-one-compilation.test.jstest/build/config/multiple/multiple-config.test.jstest/build/config/no-code/no-code.test.jstest/build/config/no-config-array/no-config-array.test.jstest/build/config/no-config-object/no-config-object.test.jstest/build/config/object-freeze-partial/index.test.jstest/build/config/object-freeze/index.test.jstest/build/config/type/array-function-with-argv/function-with-argv.test.jstest/build/config/type/array-function-with-env/array-function-with-env.test.jstest/build/config/type/array-functions/array-functions.test.jstest/build/config/type/array-promises/array-promises.test.jstest/build/config/type/array/array.test.jstest/build/config/type/function-array/function-array.test.jstest/build/config/type/function-async/function-async.test.jstest/build/config/type/function-promise/function-promise.test.jstest/build/config/type/function-with-argv/function-with-argv.test.jstest/build/config/type/function-with-env/function-with-env.test.jstest/build/config/type/function/function.test.jstest/build/config/type/promise-array/promise-array.test.jstest/build/config/type/promise-function/promise-function.test.jstest/build/config/type/promise/promise.test.jstest/build/core-flags/core-flags.test.jstest/build/custom-webpack/custom-webpack.test.jstest/build/defaults/output-defaults.test.jstest/build/devtool/array/source-map-array.test.jstest/build/devtool/object/source-map-object.test.jstest/build/entry/config-entry/entry-with-config/entry-with-config.test.jstest/build/entry/config-entry/entry-with-index/entry-with-config.test.jstest/build/entry/defaults-empty/entry-single-arg.test.jstest/build/entry/defaults-index/entry-multi-args.test.jstest/build/entry/flag-entry/entry-with-flag.test.jstest/build/entry/multiple-entries/multi-entries.test.jstest/build/env/array/array-env.test.jstest/build/env/object/object-env.test.jstest/build/extends/extends.test.jstest/build/import-local/import-local.test.jstest/build/json/json.test.jstest/build/merge/config/merge-config.test.jstest/build/mode/mode-single-arg/mode-single-arg.test.jstest/build/mode/mode-with-config/mode-with-config.test.jstest/build/multi-compiler-options/multi-compiler-options.test.jstest/build/name/name.test.jstest/build/node/node.test.jstest/build/output/output-named-bundles.test.jstest/build/stats/config-no/no-stats-with-config.test.jstest/build/stats/config/stats.test.jstest/build/stats/flags/stats.test.jstest/build/target/flag-test/target-flag.test.jstest/build/zero-config/entry-absent/zero-config.test.jstest/build/zero-config/entry-present/zero-config.test.jstest/complete/complete.test.jstest/create-webpack-app/init/init.test.jstest/external-command/external-command.test.jstest/info/additional-package.test.jstest/info/basic.test.jstest/info/output.test.jstest/utils/cli-plugin-test/plugin.test.jstest/utils/test-utils.jstest/version/basic.test.jstest/version/output.test.jstest/watch/analyze/analyze-flag.test.jstest/watch/bail/bail.test.jstest/watch/basic/basic.test.jstest/watch/stats/stats-and-watch.test.js
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
rechoir 1.0 replaces the `resolve` package with Node.js's own
`require.resolve(id, { paths })`, so loader packages are now resolved
through their `exports` maps; its API is unchanged. It declares
`node >= 22.15.0`, but the code runs on the Node.js 20 baseline (the
config-format suites pass on Node.js 20.20).
ejs 7 stops reading render options out of the data object.
create-webpack-app passes its options as the third argument to
`ejs.render`, so it is unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbymRVCYb4Cyn9e5vCaU8n
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0ab2b299-b6ec-4458-a36c-462a9ec29257
⛔ Files ignored due to path filters: 1
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing: 5
.changeset/update-ejs-v7.md.changeset/update-rechoir-v1.mdpackages/create-webpack-app/package.jsonpackages/webpack-cli/package.jsonpackages/webpack-cli/src/webpack-cli.ts
🚧 Files skipped from review as they are similar to previous changes: 1
- packages/webpack-cli/src/webpack-cli.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
A warning message can span several lines, and only its first line was removed. Drop continuation lines up to the `(Use node --trace-...)` hint, without crossing a line that starts another record, so CLI output is never swallowed. Cover the helper with unit tests. Also replace the nested ternary in `createCompiler` with if/else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbymRVCYb4Cyn9e5vCaU8n
Node.js 25 is an odd-numbered release that never becomes LTS and is EOL. Test on the Node.js 20 line, which holds the declared minimum, and on the LTS lines 22, 24 and 26 (promoted to LTS in October 2026). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbymRVCYb4Cyn9e5vCaU8n
Summary
Supersedes #4870, #4869 and #4859.
Dependencies: every direct dependency goes to the newest release in its current major:
@babel/*,@swc/core,@types/node,cspell,eslint,eslint-config-webpack,jest,js-yaml,lint-staged,pkg-pr-new,prettier,readable-stream,sass,tsx,webpack5.112,webpack-bundle-analyzer5.4 and@inquirer/*. The lockfile refresh also brings inwebpack-dev-middleware8.3.0 andsource-map-js1.2.2.Two major updates (each with a changeset):
rechoir0.8 → 1.0 (webpack-cli)resolvepackage with Node'srequire.resolve(id, { paths }), so loader packages now resolve through theirexportsmaps. The API is unchanged.node >= 22.15.0, but nothing in the code needs it: the config-format and create-webpack-app/init suites pass on Node 20.20 as well.EBADENGINEwarning from npm. Strict engine checks (Yarn 1,engine-strict) would refuse the install. Node 20 has been EOL since April 2026.ejs6 → 7 (create-webpack-app)generate-files.tspasses its options as the third argument toejs.render, so it is unaffected.Type fix (webpack 5.112):
MultiConfigurationis now typed asReadonlyArray<Configuration> & MultiCompilerOptions. That meansArray.isArrayno longer narrows it, and the union no longer matches a singlewebpack()overload. The code now narrows with the existingisMultipleConfigurationguard and callswebpack()once per shape. Runtime behaviour is unchanged.Test hardening: #4870 went red because
webpack-bundle-analyzer5.4 now logs<i> [webpack-bundle-analyzer] ...to stderr. This is the same kind of break #4837 had to patch for Node's experimental warnings. Changes:Added a
cleanStderrhelper intest/utils/test-utils.js. It replaceswithoutExperimentalWarningsand removes three kinds of third-party noise:DEP0xxx) raised inside dependencies<i> ...)It keeps webpack's own deprecations (
DEP_WEBPACK_*) and<w>/<e>logs, so tests still catch the CLI misusing webpack.test/api/clean-stderr.test.jshas unit tests for the helper.Every
expect(stderr).toBeFalsy()now goes throughcleanStderr.The analyze tests look for the analyzer's message on both stdout and stderr.
The "not writable path" init test skips when the directory is writable anyway. Root in containers ignores permission bits.
CI: dropped Node.js 25 from the test matrix. It is an odd-numbered release that never becomes LTS. The matrix is now 20.x (holds the declared minimum), 22.x, 24.x and 26.x (promoted to LTS in late October 2026).
Still held back (major updates)
Test plan
npm run build,npm run lint,npm run fmt:checknpm run test:base -- --cilocally on Node 22: 154/154 suites, 804 passed, 1 skipped🤖 Generated with Claude Code
https://claude.ai/code/session_01KbymRVCYb4Cyn9e5vCaU8n
Summary by CodeRabbit