Skip to content

Commit

Permalink
chore: fix release diff tag detection (#17331)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored May 28, 2024
1 parent bed3faa commit e861168
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@types/micromatch": "^4.0.7",
"@types/node": "^20.12.12",
"@types/picomatch": "^2.3.3",
"@types/semver": "^7.5.8",
"@types/stylus": "^0.48.42",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.10.0",
Expand All @@ -75,7 +74,6 @@
"prettier": "3.2.5",
"rimraf": "^5.0.7",
"rollup": "^4.13.0",
"semver": "^7.6.2",
"simple-git-hooks": "^2.11.1",
"tslib": "^2.6.2",
"tsx": "^4.11.0",
Expand Down
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions scripts/releaseUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { readdirSync, writeFileSync } from 'node:fs'
import path from 'node:path'
import semver from 'semver'
import colors from 'picocolors'
import type { Options as ExecaOptions, ResultPromise } from 'execa'
import { execa } from 'execa'
Expand All @@ -15,15 +14,9 @@ export function run<EO extends ExecaOptions>(
}

export async function getLatestTag(pkgName: string): Promise<string> {
const tags = (await run('git', ['tag'], { stdio: 'pipe' })).stdout
.split(/\n/)
.filter(Boolean)
const prefix = pkgName === 'vite' ? 'v' : `${pkgName}@`
return tags
.filter((tag) => tag.startsWith(prefix))
.sort((a, b) =>
semver.rcompare(a.slice(prefix.length), b.slice(prefix.length)),
)[0]
const pkgJson = await fs.readJson(`packages/${pkgName}/package.json`)
const version = pkgJson.version
return pkgName === 'vite' ? `v${version}` : `${pkgName}@${version}`
}

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

0 comments on commit e861168

Please sign in to comment.