fix: sort package versions semantically in patch command (#9601)

This commit is contained in:
Azat S.
2025-06-04 12:23:18 +03:00
committed by GitHub
parent b0ead519b3
commit d385b71d9c
2 changed files with 7 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/plugin-commands-patching": patch
"pnpm": patch
---
Sort versions printed by `pnpm patch` using semantic versioning rules.

View File

@@ -105,6 +105,7 @@ export async function getVersionsFromLockfile (dep: ParseWantedDependencyResult,
}
})
.filter(({ name }) => name === pkgName)
.sort((v1, v2) => semver.compare(v1.version, v2.version))
return {
versions,