[QUESTION] Very confusing behavior for pre-release range matching
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
Direzione di ricerca
Start by reproducing the listed npx semver --range and --include-prerelease commands, then read the README's “Prerelease Tags” section. Compare the documented behavior with the examples and related issues mentioned in the report. Done means the expected matching rules are resolved and clearly documented, or the discrepancy is narrowed to a specific implementation change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When checking pre-release ranges, the results are very confusing. I have read the documentation many times, run a bunch of tests and reviewed all bug tickets. There are several open and closed issues that seem related to this, but I still can't figure out how this is expected to work. For example:
npx semver --range ">=1.0.2-0" "1.0.3-6"
Results in a non-match. Why if the range is ">=" and the range explicitly includes prereleases via "-0"? This seems to be incorrect.
npx semver --range "^1.0.2-0" "1.0.3-6"
Also results in a non-match. This seems to also be incorrect.
npx semver --range "^1.0.2-0" "1.0.3"
Results in a match. This is correct, but doesn't make sense that this would match when "1.0.3-6" does not.
npx semver --range ">=1.0.2-0" "1.0.2-6"
Results in a match. This is correct.
So then I looked at using --include-prerelease. This seemed like the right approach based on the "Prerelease Tags" section in the README. However, this causes behavior to seem incorrect in the other extreme:
npx semver --include-prerelease --range "^1.0.2" "1.0.3-6"
Results in a match. Wait, what? This seems to completely contradict motivation expressed in the "Prerelease Tags" section.
So how can this be used effectively in automation to match versions in situations where we do want to include pre-releases from those where we do not if we cannot express that purely from the range expression itself? It seems to me that, the way this is designed, the range expression is barely (if at all) being used to decide if pre-releases are included.
- Lingua principale
- JavaScript
- Stelle
- 5.5k
- Fork
- 635
- Merge medio
- 1h 24m
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di npm/node-semver
-
[BUG] minVersion returns 0.0.0 when a 0.0.0 prerelease is the true minimumForse già presa @thisisshivamtiwari l’ha presa 32 giorni fa. ApertaBug Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
npm/node-semver#934 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] new Range(comparator).test() throws TypeError for a prerelease versionForse già presa @Boulea7 l’ha presa 60 giorni fa. ApertaBug Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
npm/node-semver#908 ·
I maintainer di solito rispondono entro 1 giorno
-
semver:major
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
npm/node-semver#108 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
npm/node-semver#954 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
npm/node-semver#951 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di npm/node-semver
Issue simili
-
bug triage needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 1 giorno
-
[Resource]: PersephoneApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
hesreallyhim/awesome-claude-code#3773 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
tabatkins/railroad-diagrams#129 ·
-
web: api() turns a null or object-valued error body into a TypeError or "[object Object]" and loses the statusForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno