Skip to content

Loosen packageManager field to support any package on npm #354

Closed
@styfle

Description

@styfle

Could we consider changing the behavior of Corepack to loosen the definition of the packageManager field?

That way you could define any npm package name in the packageManager field and Corepack would fetch from the npm registry if its not found in the hardcoded known package manager list.

Examples

Pros

  1. Less gatekeeping because a new package manager can be used immediately without changing Corepack's src code.
  2. A little more intuitive since the packageManager field feels a lot more like dependencies

Cons

  1. We might lose the ability to catch typos since today those are caught with Usage Error: Unsupported package manager specification.
  2. We might lose the ability to catch wrong package manager install with Usage Error: This project is configured to use

I think number 1 is okay but number 2 sounds problematic. Perhaps number 2 still requires a PR to Corepack.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions