question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

URL Regex for SemVer doesn't match suffixed version names (alpha, beta, etc.)

See original GitHub issue

Navigating to eslint@6.0.0-rc.0 (alpha, beta, etc. as well) causes a redirect that 404s because of a duplicated version suffix.

# Inputed clean URL
https://runpkg.com/?eslint@6.0.0-rc.0
# Redirect with extra `-rc.0` suffix
https://runpkg.com/?eslint@6.0.0-rc.0-rc.0/lib/api.js

I’ve narrowed it down to the regex on Nav.js which will never match the suffixes, and will history.pushState the full version (selectedVersion = "6.0.0-rc.0") concatenated with suffix again in the path (path = "-rc.0/lib/api.js").

https://github.com/FormidableLabs/runpkg/blob/c8b36774ca50730a7335ff87e2c37aaf741545c9/components/Nav.js#L30-L33

Since the version doesn’t seem to be validated, is it possible to reuse something similar to index.js’s parseUrl() which parses by using the path slashes?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
evelynhathawaycommented, Jun 12, 2019

I got the excitement jitters from being able to track down the cause of this issue quickly (and hopefully accurately 😅), so I’d love to contribute a PR for this when confirmed if that would be helpful.

0reactions
evelynhathawaycommented, Jun 21, 2019

Awesome! I made a pull request with the fix and a test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

regex for semver - semantic versioning - Stack Overflow
Is there a suggested regular expression (RegEx) to check a SemVer string? ... This is a somewhat simpler version missing the capture groups ......
Read more >
PEP 440 – Version Identification and Dependency Specification
Public version identifiers MUST be unique within a given distribution. Installation tools SHOULD ignore any public versions which do not comply with this...
Read more >
[policy, no patch] Switch to Semantic Versioning for Drupal ...
Yes, I agree it's not completely semantic versioning, ... There's no more dev/alpha/beta denoted in the filename or the version string
Read more >
Regex for semantic versioning - iHateRegex
Match a SemVer as specified in https://semver.org/ ... 1.2.3-SNAPSHOT-123 1.0.0 2.0.0+build.1848 2.0.1-alpha.1227 1.0.0-alpha+beta 1.0.0-alpha_beta ...
Read more >
python packaging version
You dont have to append For example, if you had chosen the "b", or "rc") and the prerelease number (an integer). : Allows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found