Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
Sophos-Elias-Vasylenko opened this issue Aug 6, 2024 · 1 comment
Open
1 task done
Labels
Bug thing that needs fixing Needs Triage needs an initial review

Comments

@Sophos-Elias-Vasylenko
Copy link

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:
@Sophos-Elias-Vasylenko Sophos-Elias-Vasylenko added Bug thing that needs fixing Needs Triage needs an initial review labels Aug 6, 2024
@mbtools
Copy link
Contributor

mbtools commented Aug 21, 2024

This is trying to integrate the includePrerelease option into the range definition. This makes it very confusing.

This package already has the corresponding option available in the satisfies function. Letting users specify includePrerelease in package.json would be a much cleaner solution (see my comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs an initial review
Projects
None yet
Development

No branches or pull requests

2 participants