Skip to content

Detect Nub (@nubjs/nub) as a package manager in vp install #1959

Description

@MagsMagnoli

Description

As a developer using Vite+, I want vp to recognize Nub (@nubjs/nub) when a project uses it as its package manager, so that vp install and the managed shims defer to Nub instead of silently falling back to pnpm.

Nub is a Rust Node.js toolkit whose installer is pnpm-CLI-shaped and lockfile-compatible: it round-trips pnpm-lock.yaml, package-lock.json, and bun.lock, and its own native lockfile is lock.yaml (pnpm v9 format). Because Nub augments stock Node rather than replacing the runtime, it can coexist with Vite+ — but today there's no detection for it:

  • vp install's detection order covers pnpm/npm/yarn/bun only, so a Nub-managed project is treated as pnpm (or the default fallback) and is never routed through nub.
  • vp env managed mode generates alias pairs for pnpm/pnpx, yarn/yarnpkg, and bun/bunx, but not nub/nubx, so a project pinning Nub can't have its package-manager shims resolved.

To be clear, this is not a request for Vite+ to bundle or re-implement Nub. It's about detection and coexistence for projects that have already adopted it.

Suggested solution

  1. Add Nub to the package-manager detection used by vp install (and add/remove/update/dlx), recognizing it via the packageManager field (e.g. nub@x.y.z) and/or a Nub marker such as its lock.yaml, then routing those commands through nub/nubx when detected.
  2. In vp env managed mode, emit the nub/nubx shim alias pair when packageManager pins Nub, matching the existing pnpm/pnpx and bun/bunx behavior.

Alternative

Since Nub round-trips the pnpm/npm/bun lockfiles, a Nub project can leave packageManager set to a supported manager and let vp install operate on that lockfile while developers invoke nub directly, paired with vp env off so Vite+ doesn't contend with Nub's Node provisioning. This works today, but it means two installers maintain one lockfile and vp never actually routes through Nub. Documenting this interim path would help even if first-class detection isn't pursued.

Additional context

  • Nub: https://github.com/nubjs/nub · docs: https://nubjs.com/docs · package @nubjs/nub (binaries nub, nubx).
  • Nub and Vite+ both transpile via oxc, so there may be room for tighter alignment later; this request is intentionally limited to package-manager detection and shims.
  • I searched the issues, PRs, and Discussions for "nub" and found no existing request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions