Skip to content

Update reference regex to not break on beta versions #808

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

Open
davepagurek opened this issue Apr 17, 2025 · 0 comments
Open

Update reference regex to not break on beta versions #808

davepagurek opened this issue Apr 17, 2025 · 0 comments
Labels
Bug Something isn't working

Comments

@davepagurek
Copy link
Collaborator

Most appropriate sections of the p5.js website?

Reference

What is your operating system?

Mac OS

Web browser and version

Firefox

Actual Behavior

In the reference builder, we add a v to the start of the latest release if it seems to all be numeric:

if (/^\d+\.\d+\.\d+$/.exec(latestRelease)) {
latestRelease = 'v' + latestRelease;
}

This regex breaks for beta releases, e.g. 2.0.0-beta.5. We're about to release 2.0 so we won't have beta releases for a while, but we may want this working for the future when we do beta 3.0 releases.

Expected Behavior

The regex should match strings like 2.0.0-beta.5 too.

Steps to reproduce

Manually edit this

export const p5Version = "v2.0.0-beta.8" as const;
to not start with a v

Would you like to work on the issue?

Feel free to take this on for me!

@davepagurek davepagurek added the Bug Something isn't working label Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant