refactor: move to std-semver (#33682)

This commit is contained in:
Stephen Zhou
2026-03-18 22:00:25 +08:00
committed by GitHub
parent 49256770c9
commit 37ffa262ae
12 changed files with 60 additions and 119 deletions

View File

@ -4,7 +4,6 @@ import type { Placement } from '@/app/components/base/ui/placement'
import * as React from 'react'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { lt } from 'semver'
import Badge from '@/app/components/base/badge'
import {
Popover,
@ -14,6 +13,7 @@ import {
import useTimestamp from '@/hooks/use-timestamp'
import { useVersionListOfPlugin } from '@/service/use-plugins'
import { cn } from '@/utils/classnames'
import { isEarlierThanVersion } from '@/utils/semver'
type Props = {
disabled?: boolean
@ -100,7 +100,7 @@ const PluginVersionPicker: FC<Props> = ({
onClick={() => handleSelect({
version: version.version,
unique_identifier: version.unique_identifier,
isDowngrade: lt(version.version, currentVersion),
isDowngrade: isEarlierThanVersion(version.version, currentVersion),
})}
>
<div className="flex grow items-center">