GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — chore: replace import-local and cross-spawn with Node.js built-ins by alexander-akait · Pull Request #4889 · webpack/webpack-cli Conversation
|
🦋 Changeset detectedLatest commit: 7c0b979 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This PR is packaged and the instant preview is available (3942417). Install it locally:
npm i -D webpack-cli@https://pkg.pr.new/webpack-cli@3942417
yarn add -D webpack-cli@https://pkg.pr.new/webpack-cli@3942417
pnpm add -D webpack-cli@https://pkg.pr.new/webpack-cli@3942417 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #4889 +/- ## ========================================== + Coverage 95.08% 95.24% +0.16% ========================================== Files 14 14 Lines 5874 5950 +76 Branches 894 915 +21 ========================================== + Hits 5585 5667 +82 + Misses 288 282 -6 Partials 1 1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The generated project installs the published Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
[email protected] depends on rechoir 1, which requires Node.js 22.15, and Yarn 1 fails the install on Node.js 20. Claude-Session: https://claude.ai/code/session_013FhutRFjuQemBzekJMYcqL
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
.cmd shim escaping on Windows. · webpack-cli.ts:646-663
packages/webpack-cli/src/webpack-cli.ts:646-663
Minor · Functional Correctness · Quick win Preserve cross-spawn’s
.cmdshim escaping on Windows.On Windows, when
npm,yarn, orpnpmresolves through anode_modules/.bin/*.cmdshim, the helper escapes arguments once beforecmd.exeparses the joined command. The shim then parses the forwarded arguments again. Cross-spawn applies a second metacharacter escape for this case.Without that second escape, a package spec containing
&,", or another cmd metacharacter can be split or corrupted. The package installation can then fail or receive the wrong package spec.Use cross-spawn’s command resolution and conditional second escape for
.cmdshims. Do not apply the second escape unconditionally.
84ff2eef-9034-4e5a-9642-54e6ad215bb3test/create-webpack-app/test.utils.jsIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Run .exe and .com files without a shell and escape the arguments twice for the .cmd shims of packages, they pass them to another shell. Claude-Session: https://claude.ai/code/session_013FhutRFjuQemBzekJMYcqL
|
The finding about
The escaping gives the same output as Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
webpack-cli.ts:736
packages/webpack-cli/src/webpack-cli.ts:736
Minor · Functional Correctness · Quick win Package-manager probes always succeed, even when the tool is missing.
spawnSyncdoes not throw when the executable is missing. It returns a result object, and that object is always truthy. Theif (await this.#spawnSync(...))checks therefore pass on the first probe. The comments above them say an error is thrown, but none is.
- When no lockfile exists,
getDefaultPackageManagerreturns"npm"even if npm is not installed.- The
yarnandpnpmprobes and the "No package manager found." exit are never reached.On non-Windows platforms, a missing binary shows up as
error.code === "ENOENT". On the Windows shell path, a missing command shows up as a non-zerostatus. A start failure withEACCESorEPERMmeans the binary exists but could not be launched, so do not report it as "not installed".
cross-spawnalso returned a result object, so this behavior existed before. This PR touches these exact lines. Add a helper that checkserrorandstatus, then use it in all three probes. Updatetest/api/get-default-package-manager.test.jsto match.Proposed fix (npm probe shown, repeat for yarn and pnpm)
- if (await this.#spawnSync("npm", ["--version"])) { + const result = await this.#spawnSync("npm", ["--version"]); + + if (!result.error && result.status === 0) { return "npm"; }Based on learnings: check that a spawn failure has code
ENOENTbefore inferring "not installed". Do not treatEACCES/EPERMas missing.Also applies to: 746-746, 756-756
Source: Learnings
08bb82f7-a427-43f1-ac04-1ace33b0e8a1.cspell.jsonpackages/webpack-cli/src/webpack-cli.tstest/api/install-package.test.jsIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
spawnSync returns a result instead of throwing, so the CLI always chose npm without a lock file, even when npm was missing. Check the error and the exit status, so yarn and pnpm are found too. Claude-Session: https://claude.ai/code/session_013FhutRFjuQemBzekJMYcqL
|
The finding that the package-manager probes always succeed ( The tests now cover falling back to yarn and to pnpm, and a missing package manager is simulated with an Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
getDefaultPackageManager and installPackage are async, so spawn the commands and look up their files on Windows without blocking. Claude-Session: https://claude.ai/code/session_013FhutRFjuQemBzekJMYcqL
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
2b450a86-c283-456e-82ce-4675b2b210ff.changeset/detect-missing-package-managers.mdpackages/webpack-cli/src/webpack-cli.tstest/api/get-default-package-manager.test.jstest/api/install-package.test.jsIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The result of the package manager was ignored, so the CLI continued as if the package was installed. Claude-Session: https://claude.ai/code/session_013FhutRFjuQemBzekJMYcqL
There was an error while loading. Please reload this page.
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [webpack-cli](https://github.com/webpack/webpack-cli/tree/main/packages/webpack-cli) ([source](https://github.com/webpack/webpack-cli)) | [`7.2.3` → `7.3.1`](https://renovatebot.com/diffs/npm/webpack-cli/7.2.3/7.3.1) |  |  | --- ### Release Notes <details> <summary>webpack/webpack-cli (webpack-cli)</summary> ### [`v7.3.1`](https://github.com/webpack/webpack-cli/blob/HEAD/CHANGELOG.md#731) [Compare Source](https://github.com/webpack/webpack-cli/compare/[email protected]@7.3.1) ##### Patch Changes - fix: detect missing package managers and failed installations, without a lock file the CLI chose npm even when it wasn't installed instead of yarn or pnpm, and it continued after a package failed to install (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4889](webpack/webpack-cli#4889)) - chore: replace the `import-local` and `cross-spawn` dependencies with Node.js built-ins (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4889](webpack/webpack-cli#4889)) - chore: load configuration files with `import()` instead of `eval` (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4893](webpack/webpack-cli#4893)) ### [`v7.3.0`](https://github.com/webpack/webpack-cli/blob/HEAD/CHANGELOG.md#730) [Compare Source](https://github.com/webpack/webpack-cli/compare/[email protected]@7.3.0) ##### Minor Changes - feat: run `webpack-dev-server@6` as a compiler plugin. The CLI drives watch compilation, prints build stats and closes the compiler on shutdown. Older dev servers continue to manage their own compilation. (by [@​bjohansebas](https://github.com/bjohansebas) in [#​4847](webpack/webpack-cli#4847)) In multi-compiler mode, every dev server serves all compilers by default. Use the new `--dev-server-per-compiler` option of `webpack serve` to serve each compiler only by the dev server from its own configuration. - feat: add shell completions for zsh, bash, fish and powershell through the `complete` command (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4840](webpack/webpack-cli#4840)) ##### Patch Changes - fix: keep multi-compiler options such as `parallelism` and `plugins` set on a configuration array when `--config-name` or `extends` rebuild it (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4871](webpack/webpack-cli#4871)) - perf: share the compile cache with child processes and worker threads, such as minimizer workers, so they start warm too (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4872](webpack/webpack-cli#4872)) - fix: assign distinct ports to dev servers of configurations that share the same `devServer` object. (by [@​alexander-akait](https://github.com/alexander-akait) in [#​4886](webpack/webpack-cli#4886)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on tuesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE4OC4yIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2163
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.