chore: remove fumadocs-twoslash dependency and clean up imports

- Deleted the fumadocs-twoslash dependency from package.json and pnpm-lock.yaml.
- Updated accordion documentation to remove unnecessary twoslash syntax.
- Cleaned up imports in the DocPage component by removing unused Popup components.
This commit is contained in:
javayhu 2025-03-31 00:06:39 +08:00
parent 5a20dc5837
commit 1270058e99
4 changed files with 1 additions and 79 deletions

View File

@ -9,7 +9,7 @@ preview: accordion
Based on
[Radix UI Accordion](https://www.radix-ui.com/primitives/docs/components/accordion), useful for FAQ sections.
```tsx twoslash
```tsx
import React from 'react';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';

View File

@ -76,7 +76,6 @@
"embla-carousel-react": "^8.5.2",
"framer-motion": "^12.4.7",
"fumadocs-core": "^15.1.2",
"fumadocs-twoslash": "^3.1.0",
"fumadocs-ui": "^15.1.2",
"geist": "^1.3.1",
"input-otp": "^1.4.2",

73
pnpm-lock.yaml generated
View File

@ -203,9 +203,6 @@ importers:
fumadocs-core:
specifier: ^15.1.2
version: 15.1.2(@types/react@19.0.9)(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
fumadocs-twoslash:
specifier: ^3.1.0
version: 3.1.0(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-ui@15.1.2(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-core@15.1.2(@types/react@19.0.9)(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(tailwindcss@4.0.14))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(shiki@2.4.2)(typescript@5.7.3)
fumadocs-ui:
specifier: ^15.1.2
version: 15.1.2(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-core@15.1.2(@types/react@19.0.9)(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(tailwindcss@4.0.14)
@ -2721,11 +2718,6 @@ packages:
'@shikijs/transformers@3.2.1':
resolution: {integrity: sha512-oIT40p8LOPV/6XLnUrVPeRtJtbu0Mpl+BjGFuMXw870eX9zTSQlidg7CsksFDVyUiSAOC/CH1RQm+ldZp0/6eQ==}
'@shikijs/twoslash@3.2.1':
resolution: {integrity: sha512-2ZiL9xXY8JRXHG5BdJXE9KoIeSsyH9/yK+YTN90/SUIKkq7Nf5dWqXp5wJ6+4SL0FQO8mq2HUutwqU+gamOgOA==}
peerDependencies:
typescript: '>=5.5.0'
'@shikijs/types@2.4.2':
resolution: {integrity: sha512-e28aFDPwVgK8H2nPrEA5CexLa5yumBvb5aF6nN4SlmqaBFOuGQdxX/Cfh8rwRFALepJtlj0P3wvJ4oL+ndxgSA==}
@ -3169,11 +3161,6 @@ packages:
'@types/unist@3.0.3':
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
'@typescript/vfs@1.6.1':
resolution: {integrity: sha512-JwoxboBh7Oz1v38tPbkrZ62ZXNHAk9bJ7c9x0eI5zBfBnBYGhURdbnh7Z4smN/MV48Y5OCcZb58n972UtbazsA==}
peerDependencies:
typescript: '*'
'@ungap/structured-clone@1.3.0':
resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
@ -3886,13 +3873,6 @@ packages:
react-dom:
optional: true
fumadocs-twoslash@3.1.0:
resolution: {integrity: sha512-5O+lFOv4cTQqBevS/yxCrjKZjBhZNggZQis14QzGXzyL75pe+Uv7UjcMsxo4Jmt8jJOLt0pGVLhJwFf11u/9BA==}
peerDependencies:
fumadocs-ui: ^15.0.0
react: 18.x.x || 19.x.x
shiki: 1.x.x || 2.x.x || 3.x.x
fumadocs-ui@15.1.2:
resolution: {integrity: sha512-Jel9zhg85BfMfzDW2YX0lE0qeqnQmWj4s9QpbdKnPnrqeq2jRJJnpJExk3kaeWGG5KousEWG5ihsz3sFQvYCYw==}
peerDependencies:
@ -5330,14 +5310,6 @@ packages:
tw-animate-css@1.2.4:
resolution: {integrity: sha512-yt+HkJB41NAvOffe4NweJU6fLqAlVx/mBX6XmHRp15kq0JxTtOKaIw8pVSWM1Z+n2nXtyi7cW6C9f0WG/F/QAQ==}
twoslash-protocol@0.3.1:
resolution: {integrity: sha512-BMePTL9OkuNISSyyMclBBhV2s9++DiOCyhhCoV5Kaht6eaWLwVjCCUJHY33eZJPsyKeZYS8Wzz0h+XI01VohVw==}
twoslash@0.3.1:
resolution: {integrity: sha512-OGqMTGvqXTcb92YQdwGfEdK0nZJA64Aj/ChLOelbl3TfYch2IoBST0Yx4C0LQ7Lzyqm9RpgcpgDxeXQIz4p2Kg==}
peerDependencies:
typescript: ^5.5.0
type-fest@4.35.0:
resolution: {integrity: sha512-2/AwEFQDFEy30iOLjrvHDIH7e4HEWH+f1Yl1bI5XMqzuoCUqwYCdxachgsgv0og/JdVZUhbfjcJAoHj5L1753A==}
engines: {node: '>=16'}
@ -7957,15 +7929,6 @@ snapshots:
'@shikijs/core': 3.2.1
'@shikijs/types': 3.2.1
'@shikijs/twoslash@3.2.1(typescript@5.7.3)':
dependencies:
'@shikijs/core': 3.2.1
'@shikijs/types': 3.2.1
twoslash: 0.3.1(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@shikijs/types@2.4.2':
dependencies:
'@shikijs/vscode-textmate': 10.0.2
@ -8519,13 +8482,6 @@ snapshots:
'@types/unist@3.0.3': {}
'@typescript/vfs@1.6.1(typescript@5.7.3)':
dependencies:
debug: 4.4.0
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@ungap/structured-clone@1.3.0': {}
abbrev@3.0.0: {}
@ -9249,25 +9205,6 @@ snapshots:
- '@types/react'
- supports-color
fumadocs-twoslash@3.1.0(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-ui@15.1.2(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-core@15.1.2(@types/react@19.0.9)(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(tailwindcss@4.0.14))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(shiki@2.4.2)(typescript@5.7.3):
dependencies:
'@radix-ui/react-popover': 1.1.6(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
'@shikijs/twoslash': 3.2.1(typescript@5.7.3)
fumadocs-ui: 15.1.2(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-core@15.1.2(@types/react@19.0.9)(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(tailwindcss@4.0.14)
mdast-util-from-markdown: 2.0.2
mdast-util-gfm: 3.1.0
mdast-util-to-hast: 13.2.0
react: 19.0.0
shiki: 2.4.2
tailwind-merge: 3.0.2
twoslash: 0.3.1(typescript@5.7.3)
transitivePeerDependencies:
- '@types/react'
- '@types/react-dom'
- react-dom
- supports-color
- typescript
fumadocs-ui@15.1.2(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(fumadocs-core@15.1.2(@types/react@19.0.9)(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(next@15.2.1(@babel/core@7.24.5)(@opentelemetry/api@1.9.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(tailwindcss@4.0.14):
dependencies:
'@radix-ui/react-accordion': 1.2.3(@types/react-dom@19.0.3(@types/react@19.0.9))(@types/react@19.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
@ -11216,16 +11153,6 @@ snapshots:
tw-animate-css@1.2.4: {}
twoslash-protocol@0.3.1: {}
twoslash@0.3.1(typescript@5.7.3):
dependencies:
'@typescript/vfs': 1.6.1(typescript@5.7.3)
twoslash-protocol: 0.3.1
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
type-fest@4.35.0: {}
type-flag@3.0.0: {}

View File

@ -5,7 +5,6 @@ import { LOCALES } from '@/i18n/routing';
import { source } from '@/lib/docs/source';
import { MDXContent } from '@content-collections/mdx/react';
import Link from 'fumadocs-core/link';
import { Popup, PopupContent, PopupTrigger } from 'fumadocs-twoslash/ui';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
import { Callout } from 'fumadocs-ui/components/callout';
import { File, Files, Folder } from 'fumadocs-ui/components/files';
@ -139,9 +138,6 @@ export default async function DocPage({
</HoverCard>
);
},
Popup,
PopupContent,
PopupTrigger,
Tabs,
Tab,
TypeTable,