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

@ -2,7 +2,7 @@ import { cleanup, render, screen } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import DeprecationNotice from '../deprecation-notice'
vi.mock('next/link', () => ({
vi.mock('@/next/link', () => ({
default: ({ children, href }: { children: React.ReactNode, href: string }) => (
<a data-testid="link" href={href}>{children}</a>
),

View File

@ -2,10 +2,10 @@ import type { FC } from 'react'
import { useTranslation } from '#i18n'
import { RiAlertFill } from '@remixicon/react'
import { camelCase } from 'es-toolkit/string'
import Link from 'next/link'
import * as React from 'react'
import { useMemo } from 'react'
import { Trans } from 'react-i18next'
import Link from '@/next/link'
import { cn } from '@/utils/classnames'
type DeprecationNoticeProps = {

View File

@ -7,7 +7,6 @@ import type { FC } from 'react'
import type { Node } from 'reactflow'
import type { ToolValue } from '@/app/components/workflow/block-selector/types'
import type { NodeOutPutVar } from '@/app/components/workflow/types'
import Link from 'next/link'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import {
@ -16,6 +15,7 @@ import {
PortalToFollowElemTrigger,
} from '@/app/components/base/portal-to-follow-elem'
import { CollectionType } from '@/app/components/tools/types'
import Link from '@/next/link'
import { cn } from '@/utils/classnames'
import {
ToolAuthorizationSection,

View File

@ -9,7 +9,6 @@ import {
} from '@remixicon/react'
import { useBoolean } from 'ahooks'
import { noop } from 'es-toolkit/function'
import Link from 'next/link'
import { useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
@ -21,6 +20,7 @@ import { useGlobalPublicStore } from '@/context/global-public-context'
import { useDocLink } from '@/context/i18n'
import useDocumentTitle from '@/hooks/use-document-title'
import { usePluginInstallation } from '@/hooks/use-query-params'
import Link from '@/next/link'
import { fetchBundleInfoFromMarketPlace, fetchManifestFromMarketPlace } from '@/service/plugins'
import { sleep } from '@/utils'
import { cn } from '@/utils/classnames'