File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,7 @@ import { accessToken } from "@/stores/auth";
1111import { ensureResponseOk , fetch } from "@/utils/fetch" ;
1212
1313const VersionResponse = v . object ( {
14- version : v . fallback (
15- v . nullable (
16- v . pipe (
17- v . string ( ) ,
18- v . transform ( ( version ) => parseSemver ( version , true , false ) ) ,
19- ) ,
20- ) ,
21- null ,
22- ) ,
14+ version : v . nullable ( v . string ( ) ) ,
2315 edition : v . fallback ( v . nullable ( v . picklist ( [ "community" , "pro" ] ) ) , null ) ,
2416} ) ;
2517
@@ -64,5 +56,6 @@ export const useEssVariant = (
6456
6557export const useEssVersion = ( synapseRoot : string ) : null | SemVer => {
6658 const { data } = useSuspenseQuery ( essVersionQuery ( synapseRoot ) ) ;
67- return data ?. version ;
59+ if ( ! data ) return null ;
60+ return parseSemver ( data . version ) ;
6861} ;
Original file line number Diff line number Diff line change 33// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
44
55import { queryOptions } from "@tanstack/react-query" ;
6- import parseSemver from "semver/functions/parse" ;
76import * as v from "valibot" ;
87
98import { ensureResponseOk , fetch } from "@/utils/fetch" ;
109
1110const ReleaseResponse = v . object ( {
1211 html_url : v . string ( ) ,
1312 name : v . string ( ) ,
14- // XXX: this parses the version from the tag as semver; maybe we want to do
15- // that in a separate field?
16- tag_name : v . pipe (
17- v . string ( ) ,
18- v . transform ( ( version ) => parseSemver ( version , true , false ) ) ,
19- ) ,
13+ tag_name : v . string ( ) ,
2014 created_at : v . pipe ( v . string ( ) , v . isoTimestamp ( ) ) ,
2115 body : v . string ( ) ,
2216} ) ;
You can’t perform that action at this time.
0 commit comments