diff --git a/package.json b/package.json index de6e0b54f14328..79a6715587ae0e 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80add7ee5ae12a..e44c26daaaab29 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,9 +66,6 @@ importers: '@types/picomatch': specifier: ^2.3.3 version: 2.3.3 - '@types/semver': - specifier: ^7.5.8 - version: 7.5.8 '@types/stylus': specifier: ^0.48.42 version: 0.48.42 @@ -129,9 +126,6 @@ importers: rollup: specifier: ^4.13.0 version: 4.13.0 - semver: - specifier: ^7.6.2 - version: 7.6.2 simple-git-hooks: specifier: ^2.11.1 version: 2.11.1 diff --git a/scripts/releaseUtils.ts b/scripts/releaseUtils.ts index 233a60957b33dc..fbbe7c5b780f4f 100644 --- a/scripts/releaseUtils.ts +++ b/scripts/releaseUtils.ts @@ -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' @@ -15,15 +14,9 @@ export function run( } export async function getLatestTag(pkgName: string): Promise { - 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 {