Skip to content

Commit fb7ed98

Browse files
committed
fix: improve version classification to handle v-prefixed versions
This fixes the issue where Composer packages like laravel/framework v10.48.29→v12.21.0 and symfony/console v6.4.23→v7.3.1 were incorrectly classified as patch updates instead of major updates. The regex now includes 'v' prefix in the version cleaning pattern.
1 parent 099610d commit fb7ed98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ export function sortUpdatesByPriority(updates: PackageUpdate[]): PackageUpdate[]
256256
* Parse version string and determine update type using Bun's semver
257257
*/
258258
export function getUpdateType(currentVersion: string, newVersion: string): 'major' | 'minor' | 'patch' {
259-
// Remove any prefixes like ^, ~, >=, etc.
260-
const cleanCurrent = currentVersion.replace(/^[\^~>=<]+/, '')
261-
const cleanNew = newVersion.replace(/^[\^~>=<]+/, '')
259+
// Remove any prefixes like ^, ~, >=, v, etc.
260+
const cleanCurrent = currentVersion.replace(/^[v\^~>=<]+/, '')
261+
const cleanNew = newVersion.replace(/^[v\^~>=<]+/, '')
262262

263263
const currentParts = cleanCurrent.split('.').map(Number)
264264
const newParts = cleanNew.split('.').map(Number)

0 commit comments

Comments
 (0)