fix(npm): warn when install hooks are skipped#10280
Conversation
📝 WalkthroughWalkthroughnpm install now parses Changesnpm lifecycle scripts warning
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR adds a post-install warning to the npm backend when lifecycle scripts (
Confidence Score: 5/5Safe to merge — the change is additive (warning only) and the default install behaviour is unchanged. The logic is additive: no install behaviour changes, only a post-install warning when scripts are provably skipped. The argument parser correctly handles every npm boolean form (true/false/1/0, bare flag, --no- prefix, last-arg-wins), the path lookup covers both Linux/macOS and Windows node_modules layouts, and unit tests exercise all branches. Previous iterator and parse_bool_arg issues from earlier rounds have been addressed. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "fix(npm): document omitted prepare hook" | Re-trigger Greptile |
|
Addressed the latest Greptile feedback in 4aa6b7b: removed Verified with This comment was generated by an AI coding assistant. |
|
Addressed the latest Greptile clarification in d318ad7: added a short comment explaining why Verified with This comment was generated by an AI coding assistant. |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.1 x -- echo |
19.1 ± 1.0 | 17.1 | 24.3 | 1.00 |
mise x -- echo |
19.8 ± 1.4 | 17.8 | 34.0 | 1.03 ± 0.09 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.1 env |
18.4 ± 0.9 | 16.4 | 22.7 | 1.00 |
mise env |
19.1 ± 0.9 | 17.2 | 22.8 | 1.04 ± 0.07 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.1 hook-env |
18.9 ± 0.8 | 17.2 | 22.4 | 1.00 |
mise hook-env |
19.6 ± 0.9 | 18.0 | 22.8 | 1.04 ± 0.07 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.1 ls |
15.4 ± 0.8 | 13.7 | 19.6 | 1.00 |
mise ls |
16.0 ± 0.8 | 14.5 | 18.9 | 1.04 ± 0.07 |
xtasks/test/perf
| Command | mise-2026.6.1 | mise | Variance |
|---|---|---|---|
| install (cached) | 135ms | 136ms | +0% |
| ls (cached) | 58ms | 58ms | +0% |
| bin-paths (cached) | 64ms | 64ms | +0% |
| task-ls (cached) | 124ms | 125ms | +0% |
Summary
npm_args = "--ignore-scripts=false"and other ignore-scripts overrides before deciding to warnTests
cargo fmt --checkcargo test backend::npm::testsgit diff --checkThis PR was generated by an AI coding assistant.
Note
Low Risk
Install behavior is unchanged aside from optional post-install warnings; risk is limited to noisy logs for packages with install scripts.
Overview
After npm global installs, mise now warns when the installed package defines preinstall / install / postinstall scripts that were not run because mise still passes
--ignore-scripts=true.Warning is emitted only when parsed
npm_argsindicate scripts are still skipped. New logic walksnpm_args(including--ignore-scripts=false,--no-ignore-scripts, and=true/=falseforms, with later flags winning) so opting in vianpm_args = "--ignore-scripts=false"does not produce a false alarm.The warning names the hooks, points at the installed
package.json, and suggests reviewing the package before enabling scripts.Reviewed by Cursor Bugbot for commit d318ad7. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Tests