Skip to content

Commit 2116f0e

Browse files
chore: fix order of commits since in release script (#15058)
Co-authored-by: 翠 / green <[email protected]>
1 parent 47551a6 commit 2116f0e

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"@types/micromatch": "^4.0.5",
5959
"@types/node": "^20.9.0",
6060
"@types/picomatch": "^2.3.3",
61+
"@types/semver": "^7.5.4",
6162
"@types/sass": "~1.43.1",
6263
"@types/stylus": "^0.48.42",
6364
"@types/ws": "^8.5.9",
@@ -80,6 +81,7 @@
8081
"prettier": "3.1.0",
8182
"rimraf": "^5.0.5",
8283
"rollup": "^4.2.0",
84+
"semver": "^7.5.4",
8385
"simple-git-hooks": "^2.9.0",
8486
"tslib": "^2.6.2",
8587
"tsx": "^4.1.2",

pnpm-lock.yaml

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/releaseUtils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { readdirSync, writeFileSync } from 'node:fs'
22
import path from 'node:path'
3+
import semver from 'semver'
34
import colors from 'picocolors'
45
import type { Options as ExecaOptions, ExecaReturnValue } from 'execa'
56
import { execa } from 'execa'
@@ -20,8 +21,9 @@ export async function getLatestTag(pkgName: string): Promise<string> {
2021
const prefix = pkgName === 'vite' ? 'v' : `${pkgName}@`
2122
return tags
2223
.filter((tag) => tag.startsWith(prefix))
23-
.sort((a, b) => a.localeCompare(b, 'en', { numeric: true }))
24-
.reverse()[0]
24+
.sort((a, b) =>
25+
semver.rcompare(a.slice(prefix.length), b.slice(prefix.length)),
26+
)[0]
2527
}
2628

2729
export async function logRecentCommits(pkgName: string): Promise<void> {

0 commit comments

Comments
 (0)