You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pm): accept positional package names for vp rebuild (#1564)
vp rebuild previously only accepted -- pass-through args, so running
vp rebuild better-sqlite3 errored with "Unexpected argument". Combined
with pnpm v10+ only rebuilding packages whose build scripts are
approved,
bare vp rebuild was a no-op for native modules like better-sqlite3 (71ms
vs 11.7s for pnpm rebuild better-sqlite3) and the user had no
discoverable way to name a package.
Add a packages: Vec<String> positional to the Rebuild clap variant,
matching what the RFC (rfcs/pm-command-group.md §17, lines 660-680 and
mapping table at 1283-1304) already specifies. Forward the names to
pnpm/npm rebuild before the pass-through args. Yarn/Bun paths are
unchanged (warn-and-skip).
Snap test packages/cli/snap-tests-global/command-rebuild-pnpm11 captures
both the help output and the previously-broken positional form.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: limited to `rebuild` CLI parsing/argument forwarding plus
tests/docs; no security- or data-sensitive behavior changes.
>
> **Overview**
> `vp rebuild` now accepts positional package names (e.g. `vp rebuild
better-sqlite3 sharp`) and forwards them to the underlying npm/pnpm
`rebuild` invocation, fixing the previous “Unexpected argument”
behavior.
>
> This threads a new `packages` field through `RebuildCommandOptions`,
updates the CLI/handler wiring, and extends unit + snapshot tests and
docs to cover the new usage (Yarn/Bun remain warn-and-skip).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a92cba8. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: docs/guide/install.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,15 +121,19 @@ Use these when you need to understand the current state of dependencies.
121
121
Use `vp rebuild` when native modules need to be recompiled, for example after switching Node.js versions or when a C/C++ addon fails to load.
122
122
123
123
-`vp rebuild` rebuilds all native modules
124
+
-`vp rebuild <package...>` rebuilds the listed packages only
124
125
-`vp rebuild -- <args>` passes extra arguments to the underlying package manager
125
126
126
127
```bash
127
128
vp rebuild
129
+
vp rebuild better-sqlite3 sharp
128
130
vp rebuild -- --update-binary
129
131
```
130
132
131
133
`vp rebuild` is a shorthand for `vp pm rebuild`.
132
134
135
+
With pnpm v10+, bare `vp rebuild` only rebuilds packages whose build scripts are listed in `onlyBuiltDependencies` (or approved via `pnpm approve-builds`); name the package explicitly to force a rebuild that bypasses the approval gate.
136
+
133
137
#### Advanced
134
138
135
139
Use these when you need lower-level package-manager behavior.
0 commit comments