Skip to content

Commit 7d50063

Browse files
committed
chore(deps): migrate semver to verkit
1 parent eb97ade commit 7d50063

4 files changed

Lines changed: 23 additions & 28 deletions

File tree

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,20 @@
7070
"p-limit": "catalog:deps",
7171
"pathe": "catalog:",
7272
"retriv": "catalog:",
73-
"semver": "catalog:",
7473
"skilld-protocol": "workspace:*",
7574
"sqlite-vec": "catalog:deps",
7675
"std-env": "catalog:",
7776
"typebox": "catalog:",
7877
"typescript": "catalog:",
79-
"unagent": "catalog:"
78+
"unagent": "catalog:",
79+
"verkit": "catalog:"
8080
},
8181
"optionalDependencies": {
8282
"@napi-rs/keyring": "^1.3.0"
8383
},
8484
"devDependencies": {
8585
"@antfu/eslint-config": "catalog:dev-lint",
8686
"@types/node": "catalog:dev-build",
87-
"@types/semver": "catalog:",
8887
"@vitest/coverage-v8": "catalog:dev-test",
8988
"bumpp": "catalog:",
9089
"eslint": "catalog:dev-lint",

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
catalogMode: prefer
2+
minimumReleaseAgeExclude:
3+
- verkit@0.2.0
24
shellEmulator: true
35

46
trustPolicy: no-downgrade
@@ -11,7 +13,6 @@ catalog:
1113
'@arethetypeswrong/cli': ^0.18.2
1214
'@earendil-works/pi-ai': ^0.76.0
1315
'@mdream/crawl': ^1.2.2
14-
'@types/semver': ^7.7.1
1516
bumpp: ^11.1.0
1617
giget: ^3.2.0
1718
hookable: ^6.1.1
@@ -21,12 +22,12 @@ catalog:
2122
pathe: ^2.0.3
2223
publint: ^0.3.21
2324
retriv: ^0.14.7
24-
semver: ^7.8.1
2525
std-env: ^4.1.0
2626
tsx: ^4.22.3
2727
typebox: ^1.1.38
2828
typescript: 6.0.3
2929
unagent: ^0.0.8
30+
verkit: ^0.2.0
3031
zod: ^4.4.3
3132
catalogs:
3233
deps:

src/core/semver.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
* Centralized so the loose flag stays consistent across the project.
44
*/
55

6-
import { diff as _diff, gt as _gt, valid as _valid } from 'semver'
6+
import { difference, isGreater, normalize } from 'verkit'
77

88
/** Returns the cleaned version if valid semver, null otherwise. */
99
export function semverValid(v: string): string | null {
10-
return _valid(v, true)
10+
return normalize(v, { loose: true })
1111
}
1212

1313
/** Compare two semver strings: returns true if a > b. Handles prereleases. */
1414
export function semverGt(a: string, b: string): boolean {
15-
return _gt(a, b, true)
15+
return isGreater(a, b, { loose: true })
1616
}
1717

1818
/** Returns the semver diff type between two versions, or null if equal/invalid. */
1919
export function semverDiff(a: string, b: string): string | null {
20-
return _diff(a, b)
20+
return difference(a, b)
2121
}

0 commit comments

Comments
 (0)