Repository navigation
fix(pm): skip unavailable commands and reject unsupported options - #3286
jong-kyung wants to merge 6 commits into
Conversation
Warn and skip commands unavailable in the selected package manager version, and reject unsupported pnpm pack options before execution. Preserve Yarn Classic behavior and existing npm fallback semantics. Cover version boundaries and prereleases in unit tests and existing CLI snapshots. Leave dlx compatibility and Yarn optional-plugin detection out of scope.
00354ad to
26dce19
Compare
Reject --shell-mode before pnpm 7.21.0 while preserving ordinary dlx. Cover older releases, the boundary prerelease, and the first supported stable version, with rejection snapshots for local and global CLIs. Leave npm-backed dlx behavior unchanged.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| impl Resolve<UnlinkArgs> for Yarn { | ||
| fn resolve(&self, args: &UnlinkArgs, _diag: &mut Diagnostics) -> CommandResolution { | ||
| fn resolve(&self, args: &UnlinkArgs, diag: &mut Diagnostics) -> CommandResolution { | ||
| if self.is_berry() && !self.supports_v3_commands() { |
There was a problem hiding this comment.
[P2] Use the effective Yarn version before skipping commands
With packageManager: "yarn@2.4.2" and yarnPath pointing to Yarn 3.8.7, the downloaded Yarn 2 launcher delegates to Yarn 3, but this check uses 2.4.2 and skips a supported unlink command. I reproduced the PR's production dispatcher returning exit code 0 while retaining the portal: resolution; running the same Yarn launcher directly removed it. Please determine the effective version in the project, respecting yarnPath and ignorePath, before applying this gate, and add coverage where the launcher and effective versions differ. The new patch-commit --save guard has the same issue.
There was a problem hiding this comment.
I've implemented a fix, but it requires spawning a process to check the effective Yarn version, which adds some overhead to each command. Could you review whether this trade-off is acceptable? 🙇♂️
There was a problem hiding this comment.
Is there a better way? If not, this issue can be left unaddressed for now.
Query the selected Yarn launcher before resolving commands so yarnPath and ignorePath determine the version used by command and option gates. Cover delegated unlink and patch saving, version overrides, and query failures with real Yarn CLI snapshots.
A user preload that prints to stdout made the Yarn version query unparseable, so every Yarn command failed. Remove NODE_OPTIONS from the query the same way the npm version query already does. Cover the case with a snapshot step that runs a printing preload.
Summary
Prevent Vite+ from forwarding commands and named options to package manager versions that do not support them.
dlxandpackoptions before execution while keeping the base commands available.Version Reference
stagestageapprove-buildspatchandpatch-commitdlx --shell-modepack --outpack --jsonpack --pack-gzip-levelunlinkandpatch-commit --savenpm audit