chore(web): remove dead deps + safe version bumps
Removed motion v12.38 (zero imports) and @radix-ui/react-accordion (unused) from runtime deps. Removed 4 dead components: code-block, option-table, accordion, mdx-components — all had zero references. Bumped safe caret deps via bun update: - marked 18.0.3 → 18.0.4 - @opennextjs/cloudflare 1.19.10 → 1.19.11 - wrangler 4.92.0 → 4.93.0 - postcss override 8.5.14 → 8.5.15 (closes GHSA-qx2v-qp2m-jg93) - @types/node 25.8.0 → 25.9.1 - @types/react 19.2.14 → 19.2.15 - typescript-eslint 8.59.3 → 8.59.4 Bundle shrinks by removing motion (≈ 60 KB) from node_modules even though it had no runtime usage.
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
||||
import { ChevronDown } from "lucide-react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const Accordion = AccordionPrimitive.Root
|
||||
|
||||
const AccordionItem = React.forwardRef<
|
||||
React.ElementRef<typeof AccordionPrimitive.Item>,
|
||||
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />
|
||||
))
|
||||
AccordionItem.displayName = "AccordionItem"
|
||||
|
||||
const AccordionTrigger = React.forwardRef<
|
||||
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
||||
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
||||
>(({ className, children, ...props }, ref) => (
|
||||
<AccordionPrimitive.Header className="flex">
|
||||
<AccordionPrimitive.Trigger
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex flex-1 items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
<ChevronDown className="text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200" />
|
||||
</AccordionPrimitive.Trigger>
|
||||
</AccordionPrimitive.Header>
|
||||
))
|
||||
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
||||
|
||||
const AccordionContent = React.forwardRef<
|
||||
React.ElementRef<typeof AccordionPrimitive.Content>,
|
||||
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
||||
>(({ className, children, ...props }, ref) => (
|
||||
<AccordionPrimitive.Content
|
||||
ref={ref}
|
||||
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
|
||||
{...props}
|
||||
>
|
||||
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
||||
</AccordionPrimitive.Content>
|
||||
))
|
||||
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
||||
|
||||
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
||||
@@ -1,23 +0,0 @@
|
||||
import type * as React from "react"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
interface CodeBlockProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
code: string
|
||||
language?: string
|
||||
}
|
||||
|
||||
export function CodeBlock({ code, language = "json", className, ...props }: CodeBlockProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"border-border/50 relative my-4 overflow-x-auto rounded-lg border bg-[#1e1e2e] p-4 font-mono text-sm text-[#cdd6f4] shadow-sm",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<pre>
|
||||
<code className={`language-${language}`}>{code}</code>
|
||||
</pre>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
import type * as React from "react"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface Option {
|
||||
name: string
|
||||
type: string
|
||||
default?: string
|
||||
description: string
|
||||
}
|
||||
|
||||
interface OptionTableProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
options: Option[]
|
||||
}
|
||||
|
||||
export function OptionTable({ options, className, ...props }: OptionTableProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn("border-border my-4 w-full overflow-x-auto rounded-lg border", className)}
|
||||
{...props}
|
||||
>
|
||||
<table className="w-full text-sm">
|
||||
<thead className="bg-muted/50 text-left font-medium">
|
||||
<tr>
|
||||
<th className="p-3">Option</th>
|
||||
<th className="p-3">Type</th>
|
||||
<th className="p-3">Default</th>
|
||||
<th className="p-3">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-border divide-y">
|
||||
{options.map((opt) => (
|
||||
<tr key={opt.name}>
|
||||
<td className="text-primary p-3 font-mono font-medium">{opt.name}</td>
|
||||
<td className="p-3">
|
||||
<Badge variant="outline" className="font-mono text-xs">
|
||||
{opt.type}
|
||||
</Badge>
|
||||
</td>
|
||||
<td className="text-muted-foreground p-3 font-mono">{opt.default || "-"}</td>
|
||||
<td className="text-muted-foreground p-3">{opt.description}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user