Skip to content

Commit e805d5a

Browse files
authored
refactor: replace semver with verkit (#5544)
1 parent 8ffc07c commit e805d5a

3 files changed

Lines changed: 7 additions & 18 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
"@types/minimist": "^1.2.5",
136136
"@types/node": "^26.6.5",
137137
"@types/picomatch": "^4.0.3",
138-
"@types/semver": "^7.8.0",
139138
"@volar/typescript": "^2.4.28",
140139
"@vue/language-core": "^3.3.12",
141140
"conventional-changelog": "^8.1.3",
@@ -167,13 +166,13 @@
167166
"prettier": "^3.9.9",
168167
"publint": "^0.3.25",
169168
"rolldown": "^1.2.13",
170-
"semver": "^7.8.5",
171169
"simple-git-hooks": "^2.14.0",
172170
"sirv": "^3.0.2",
173171
"sitemap": "^9.0.1",
174172
"tinyglobby": "^0.2.17",
175173
"tsdown": "^0.23.0",
176174
"typescript": "^6.0.3",
175+
"verkit": "^0.5.0",
177176
"vitest": "^5.0.3",
178177
"vue-sfc-transformer": "^0.3.0",
179178
"vue-tsc": "^3.3.12",

‎pnpm-lock.yaml‎

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

‎scripts/release.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@ import { fileURLToPath } from 'node:url'
66

77
import * as prompts from '@clack/prompts'
88
import { spawn } from 'cross-spawn'
9-
import semver from 'semver'
9+
import { increment, isValid, type IncrementType } from 'verkit'
1010

1111
import pkg from '../package.json' with { type: 'json' }
1212

13-
const { inc: _inc, valid } = semver
14-
1513
const versionIncrements = ['patch', 'minor', 'major'] as const
1614

1715
const tags = ['latest', 'next'] as const
1816

1917
const dir = fileURLToPath(new URL('.', import.meta.url))
20-
const inc = (i: semver.ReleaseType) => _inc(pkg.version, i)
18+
const inc = (i: IncrementType) => increment(pkg.version, i)
2119
const run = async (bin: string, args: string[], opts: SpawnOptions = {}) => {
2220
const child = spawn(bin, args, { stdio: 'inherit', ...opts })
2321
const [code, signal] = (await once(child, 'close')) as [
@@ -58,7 +56,7 @@ async function main() {
5856
targetVersion = versions[release].match(/\((.*)\)/)![1]
5957
}
6058

61-
if (!valid(targetVersion)) {
59+
if (!isValid(targetVersion)) {
6260
throw new Error(`Invalid target version: ${targetVersion}`)
6361
}
6462

0 commit comments

Comments
 (0)