refactor: route next/link through compat re-export (#33632)

This commit is contained in:
yyh
2026-03-18 12:14:59 +08:00
committed by GitHub
parent 6100acb780
commit 69d1ccb7a7
86 changed files with 94 additions and 89 deletions

View File

@ -1,7 +1,7 @@
'use client'
import Link from 'next/link'
import { useTranslation } from 'react-i18next'
import Link from '@/next/link'
import { useAccountIntegrates } from '@/service/use-common'
import { cn } from '@/utils/classnames'
import s from './index.module.css'

View File

@ -16,7 +16,7 @@ vi.mock('next-themes', () => ({
useTheme: vi.fn(),
}))
vi.mock('next/link', () => ({
vi.mock('@/next/link', () => ({
default: ({ children, href }: { children: React.ReactNode, href: string }) => (
<a href={href} data-testid="mock-link">{children}</a>
),

View File

@ -4,7 +4,6 @@ import {
RiArrowRightUpLine,
} from '@remixicon/react'
import { useTheme } from 'next-themes'
import Link from 'next/link'
import {
memo,
useCallback,
@ -15,6 +14,7 @@ import Divider from '@/app/components/base/divider'
import Loading from '@/app/components/base/loading'
import List from '@/app/components/plugins/marketplace/list'
import ProviderCard from '@/app/components/plugins/provider-card'
import Link from '@/next/link'
import { cn } from '@/utils/classnames'
import { getMarketplaceUrl } from '@/utils/var'
import {

View File

@ -7,7 +7,7 @@ import { useMarketplaceAllPlugins } from '../hooks'
import InstallFromMarketplace from '../install-from-marketplace'
// Mock dependencies
vi.mock('next/link', () => ({
vi.mock('@/next/link', () => ({
default: ({ children, href }: { children: React.ReactNode, href: string }) => <a href={href}>{children}</a>,
}))

View File

@ -3,13 +3,13 @@ import type {
} from './declarations'
import type { Plugin } from '@/app/components/plugins/types'
import { useTheme } from 'next-themes'
import Link from 'next/link'
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Divider from '@/app/components/base/divider'
import Loading from '@/app/components/base/loading'
import List from '@/app/components/plugins/marketplace/list'
import ProviderCard from '@/app/components/plugins/provider-card'
import Link from '@/next/link'
import { cn } from '@/utils/classnames'
import { getMarketplaceUrl } from '@/utils/var'
import {

View File

@ -1,7 +1,7 @@
import { RiErrorWarningFill } from '@remixicon/react'
import Link from 'next/link'
import Tooltip from '@/app/components/base/tooltip'
import { SwitchPluginVersion } from '@/app/components/workflow/nodes/_base/components/switch-plugin-version'
import Link from '@/next/link'
import { useInstalledPluginList } from '@/service/use-plugins'
type StatusIndicatorsProps = {

View File

@ -1,7 +1,7 @@
import type { PluginProvider } from '@/models/common'
import { LockClosedIcon } from '@heroicons/react/24/solid'
import Link from 'next/link'
import { useTranslation } from 'react-i18next'
import Link from '@/next/link'
import { usePluginProviders } from '@/service/use-common'
import SerpapiPlugin from './SerpapiPlugin'