Skip to content

[ENHANCEMENT] Allow * prerelease versions for * version ranges. #736

Description

@Sophos-Elias-Vasylenko

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I came across the behaviour described in this issue: #510

The behaviour is that 1.x.x-whatever ranges as parsed, but the prerelease version is just ignored. I agree with the comment on that issue that something like 1.0.*-rc doesn't really make much sense and isn't terribly useful. Presumably the resolution to this problem is one of the following:

  • Fail to parse these ranges
  • Allow these ranges, and ONLY match versions with the exact prerelease
  • Allow these ranges and allow 1.x.x OR versions with the exact prerelease

However I do think that something like 1.*.*-* could serve a genuine purpose. Currently this version range does not parse.

Expected Behavior

For context, I was trying to find work-arounds for npm/rfcs#397. This is an RFC to update NPM behaviour to make development of peer dependencies more convenient, so that we can satisfy a peer dependency range with a prerelease version if the host app explicitly specifies one.

In lieu of a happy resolution to the RFC, it would be useful to allow a peer dependency to signal that it is intended to accept pre-releases at the discretion of the importing package. And a 1.*.*-* style version range could satisfy this purpose.

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm:
  • Node:
  • OS:
  • platform:

Activity

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

    Bugthing that needs fixingNeeds Triageneeds an initial review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions