Skip to content
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

Permit rc versions when using gleam add #3971

Open
hayleigh-dot-dev opened this issue Dec 8, 2024 · 3 comments
Open

Permit rc versions when using gleam add #3971

hayleigh-dot-dev opened this issue Dec 8, 2024 · 3 comments
Labels
discussion The approach has not yet been decided help wanted Contributions encouraged priority:medium

Comments

@hayleigh-dot-dev
Copy link
Member

When attempting to specify an rc version while adding a package, Gleam reports the following error:

› gleam add lustre_ui@1.0.0-rc.1
error: Invalid version format

I was unable to parse the version "1.0.0-rc.1".
The error from the parser was:

    Expected up to 3 numbers in version specifier (MAJOR.MINOR.PATCH), found 4

This is unfortunately correct, as per the semver spec:

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-].

They also list some valid examples:

  • 1.0.0-alpha
  • 1.0.0-alpha.1
  • 1.0.0-0.3.7
  • 1.0.0-x.7.z.92
  • 1.0.0-x-y-z.--.

It'd be great if Gleam understood how to add all valid version identifiers so we don't have to dip into editing gleam.toml!

@hayleigh-dot-dev hayleigh-dot-dev added the bug Something isn't working label Dec 8, 2024
@lpil lpil changed the title Cannot specify rc versions when using gleam add. Permit rc versions when using gleam add Dec 9, 2024
@lpil
Copy link
Member

lpil commented Dec 9, 2024

Sounds reasonable. What constraint would it add to gleam.toml?

@lpil lpil added help wanted Contributions encouraged discussion The approach has not yet been decided priority:medium and removed bug Something isn't working labels Dec 9, 2024
@hayleigh-dot-dev
Copy link
Member Author

Whenever someone specifies a full version MAJOR.MINOR.PATCH with or without the prelease version I'd expect the gleam.toml to produce an exact constraint.

@lpil
Copy link
Member

lpil commented Dec 10, 2024

That's not what it does and we will not be changing it to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion The approach has not yet been decided help wanted Contributions encouraged priority:medium
Projects
None yet
Development

No branches or pull requests

2 participants