Skip to content

Warn for unsupported package manager flags instead of silently ignoring #1914

Closed

Description

@liangmiQwQ

Description

vp pm is a package manager compatibility layer, since different underlying package managers can have some small differences. It is common to meet cases that there is a --abc flag can be passed to Xpm, but not to Ypm.

The current Vite+'s behavior is not united. It sometimes prints a warning (e.g. --fix-lockfile, --offline, --latest) but it also silently ignores some of them (e.g. --workspace, --save-catalog), which may make users confused.

Suggested solution

We are supposed to show warnings for these cases instead of silently ignoring, it can help users or agents know how to use the package manager correctly.

As for the implementation, I think checking and writing all of them by hand can be a little bit troublesome. We'd better to find a way to check them unitedly or use Rust's language feature like macro or Drop trait to reduce complex works.

Activity

  1. added
    enhancement
    on Jun 22, 2026
  2. liangmiQwQ commented on Jun 22, 2026

    @liangmiQwQ
    CollaboratorAuthor

    Maybe a feasible solution is to borrow JavaScript's getter concept, we can extend *CommandOptions structure, and ask all internal implementation call options.<field>.get() to know user's option, if there is a option provided but not be read, we prints warnings before run the internal command.

  3. self-assigned this
    on Jun 25, 2026
  4. removed their assignment
    on Jul 11, 2026
  5. fengmk2 commented on Nov 19, 2026

    @fengmk2
    Member

    Vite+ now reports an error and stops the operation when the selected package manager does not support a named option. This change in #2775 resolved #2764 and shipped in Vite+ v1.1.0.

    With Vite+ 1.7.0 and npm 11.20.0, I verified that --workspace, --save-catalog, --save-catalog-name, and --fix-lockfile each report an unsupported option and exit with status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions