Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#736 1 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
tooling

Hướng nghiên cứu

Start by reviewing the semver parser behavior described in issue #510 and the npm RFC #397 context. Decide which wildcard prerelease semantics are intended for ranges such as 1..-*, then add focused coverage for parsing and matching; done means the behavior is specified and consistently tested.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug Needs Triage
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

I came across the behaviour described in this issue: https://github.com/npm/node-semver/issues/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 https://github.com/npm/rfcs/pull/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:
Ngôn ngữ chính
JavaScript
Star
5.5k
Fork
607
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của npm/node-semver

Tất cả issue của npm/node-semver

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.