drizzle-team / drizzle-team/drizzle-orm

[BUG]: Beta versioning format breaks SemVer sorting (beta.10 vs beta.9)

Open
#5,254 0 comments 4 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [x] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

1.0.0-beta.10-4a43a22

### What version of `drizzle-kit` are you using?

1.0.0-beta.10-4a43a22

### Other packages

_No response_

### Describe the Bug

Hi Drizzle team,

I noticed that the current version naming convention causes package manager to incorrectly downgrade dependencies when running updates.

The Issue: The version 1.0.0-beta.10-4a43a22 is treated as older than 1.0.0-beta.9-e89174b due to SemVer string comparison rules.

beta.10-4a43a22 -> The prerelease identifier 10-4a43a22 is treated as a string because it contains a hyphen.

In ASCII sorting, the string "1..." comes before "9...".

### Steps to reproduce:

``` shell
bun add -D drizzle-kit@beta # installs ...beta.10-4a43a22
```
Then run
``` shell
bun update # The package manager forces a downgrade to ...beta.9-e89174b because it believes it is the "newer" version.
```

### Suggestion from Gemini:

Option 1 (Dot separator): 1.0.0-beta.10.4a43a22 (Parses 10 as a number).

Option 2 (Build metadata): 1.0.0-beta.10+4a43a22 (Ignores the hash for sorting).

Thanks for the great work on Drizzle!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.