at-node-nix
at-node-nix copied to clipboard
Semver Range Parsing TODOs
The Semver Range parser works in the vast majority of cases, but needs a bit of edge case coverage to be ready for use.
The following patterns fail to parse with parseVersionConstraint'
:
[x] "~0.1.2" [x] "3.x", "3.X" [ ] "1 - 2" -> "2.0.3" [ ] "1 - 3" -> "3.0.1" [ ] "2 - 3" -> "3.0.1" [x] "^2.4.1 || ^3.0.0" = "3.3.3" [x] "^3.0.0 || ^4.0.0" = "4.0.0"
This list is from a relatively large set of ~4,000 packages and includes all dependency descriptors that appear across them. It is not a "complete" list and I am sure there will be edge cases to deal with beyond this list.
Aside from the fact that the parser is ugly as fuck, it's functional.
There's edge case handling missing for 4 - 20
style "partials" in range constraints and other oddballs but until there's a real plan to implement a proper sat for descriptor resolutions I don't see a compelling reason to fool with it.