From 7ce71856d3a53aba0cfce7de8985abe1c4dcd483 Mon Sep 17 00:00:00 2001 From: ReaJason Date: Wed, 13 Aug 2025 22:16:43 +0800 Subject: [PATCH] style(web): format code --- web/biome.json | 2 +- web/bun.lockb | Bin 208796 -> 208828 bytes web/copy-build.js | 13 ++- web/src/components/code-viewer.tsx | 44 +++++--- web/src/components/copyable-field.tsx | 20 +++- .../components/magicui/line-shadow-text.tsx | 8 +- web/src/components/magicui/rainbow-button.tsx | 6 +- .../components/memshell/main-config-card.tsx | 94 ++++++++++-------- .../memshell/package-config-card.tsx | 42 +++++--- web/src/components/memshell/quick-usage.tsx | 7 +- web/src/components/memshell/results/agent.tsx | 14 +-- .../memshell/results/basic-info.tsx | 30 +++--- .../memshell/results/jar-result.tsx | 8 +- .../memshell/results/multi-packer.tsx | 13 ++- .../memshell/results/result-component.tsx | 34 +++++-- web/src/components/memshell/shell-result.tsx | 25 +++-- .../components/memshell/tabs/antsword-tab.tsx | 25 +++-- .../components/memshell/tabs/behinder-tab.tsx | 20 ++-- .../memshell/tabs/classname-field.tsx | 20 ++-- .../components/memshell/tabs/command-tab.tsx | 37 ++++--- .../components/memshell/tabs/custom-tab.tsx | 34 ++++--- .../components/memshell/tabs/godzilla-tab.tsx | 20 ++-- .../components/memshell/tabs/neoreg-tab.tsx | 20 ++-- .../memshell/tabs/shelltype-field.tsx | 21 +++- web/src/components/memshell/tabs/suo5-tab.tsx | 20 ++-- .../memshell/tabs/urlpattern-field.tsx | 17 ++-- web/src/components/mode-toggle.tsx | 12 ++- web/src/components/modile-nav.tsx | 20 +++- web/src/components/tailwind-indicator.tsx | 4 +- web/src/components/theme-provider.tsx | 12 ++- web/src/config.ts | 4 +- web/src/lib/utils.ts | 14 ++- web/src/pages/memshell.tsx | 46 +++++---- web/src/pages/probeshell.tsx | 30 ++++-- web/src/providers/query-client-provider.tsx | 8 +- web/src/router.tsx | 68 ++++++++----- web/src/types/memshell.ts | 6 +- web/src/types/probeshell.ts | 10 +- web/src/utils/transformer.ts | 25 +++-- web/tsconfig.json | 6 +- 40 files changed, 551 insertions(+), 308 deletions(-) diff --git a/web/biome.json b/web/biome.json index 7d10a3fc..652dfcd4 100644 --- a/web/biome.json +++ b/web/biome.json @@ -21,7 +21,7 @@ "formatter": { "enabled": true, "indentStyle": "space", - "includes": ["!**/test/snapshots/**/*"] + "indentWidth": 2 }, "linter": { "enabled": true, diff --git a/web/bun.lockb b/web/bun.lockb index f00f21a7510ac2be8c4aa4df0e16f4ae65a2c2c9..2cfc647b9ec590603278dfd8a0641f8ba0521a60 100755 GIT binary patch delta 19046 zcmeHOd3+Sb*6r?OAOm6F2_XasgluGk7$#(liY$tPpeV8>5Fu=VB&bng1_ecYxV7Ia zH$*@Mc`PDGh>!=kfg%cs3NC>91OyQRDn^NX=k(mkWHjRNeEvuO=Jct$x9Zk*tE!jj zrw@c~JP`WuHG145*JimI8=7XEZ{f+D-b&+3|15Ax06`rwy^3-c#W&MnZi zn-FKdg52!UMVh8X27BU9Lf*2PytU0EpHh%lIB9&Lwit2Rn^((Xm-`+B>M#Si5jeND zrZoT$K|Bnc32p_B12+ag0Rv3m8>Ke~r+}M+Z!gN7JO&jBL!1?`iT>vhO{$pBd^;7*92gaI0!2ZIo~`+zwRBZRL;>FmK&F!f_m z5Yul*cQymJg`DZV6}CLb1wk1~V~ZX}EjZFHFk2ea))RjRhFC#23~^}oz$#m?1WbdW z5BFY~{gcX?qMiTcpu!{zoqj@x#2?67~5od*>C2k@Y^^st@ z=Csb9ifoMbxL8r)#Jn81prebY2bM$5{0hthZ;J5@ts8NebdN`Vy5`>I=zkh4L#gEF z!R)#uFcXG?qrhLo3i7z$0;3n*tH9K|z--BQFn;aA`*wH`%F2w3o0^e+<}6n+`Zt~0?bcv5~*UjAfF>!N#{vPp`^dF^02ZFjRgxJ9c* z&|22eC#+WEZk}o$TN7y;8>Hu~xj!Vox&EG6(blPlnduQu{RXob=LgMFoVS@35l*8{ zklCYMrhbiC+|H>#YL?=B$gF7R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&KCrR9|lt+ZUaT*6OUE;lPEysE=jNhDR;?NVxZT*;-SR7IjJ{B#sP zOC-FkJ~CIFD$Eh9iB+E*yhF9Gh^4*~nBkYg;WO77#j4(WR5~(NKm5kMfUH=cIkp~I$lm#5AsTnOx7bc{DJ1%LcK{HIH^;je}m)?CHk@m*N*9UUxO`5Et{_Q zQ%9!jJzYKSvt(~7?|u3i)qjSbFmGiqg$4q VUaOy;>Z-x_huCT>EjeP{{{r5yZ=V1F diff --git a/web/copy-build.js b/web/copy-build.js index 3be0c363..afade1e0 100644 --- a/web/copy-build.js +++ b/web/copy-build.js @@ -1,4 +1,11 @@ -import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { + existsSync, + mkdirSync, + readdirSync, + readFileSync, + rmSync, + writeFileSync, +} from "node:fs"; import { cp } from "node:fs/promises"; import { join, resolve } from "node:path"; @@ -44,7 +51,9 @@ async function main() { const INDEX_DEST = join(TEMPLATES_DIR, "index.html"); if (!existsSync(INDEX_SRC)) { - console.error(`Error: ${INDEX_SRC} does not exist. Make sure you built the frontend project first.`); + console.error( + `Error: ${INDEX_SRC} does not exist. Make sure you built the frontend project first.`, + ); process.exit(1); } diff --git a/web/src/components/code-viewer.tsx b/web/src/components/code-viewer.tsx index 9e1f3440..87f65533 100644 --- a/web/src/components/code-viewer.tsx +++ b/web/src/components/code-viewer.tsx @@ -1,14 +1,20 @@ -import type {VariantProps} from "class-variance-authority"; -import {Check, Copy} from "lucide-react"; -import {type HTMLProps, type ReactNode, useCallback, useEffect, useState} from "react"; -import {CopyToClipboard} from "react-copy-to-clipboard"; -import {useTranslation} from "react-i18next"; -import {PrismLight as SyntaxHighlighter} from "react-syntax-highlighter"; +import type { VariantProps } from "class-variance-authority"; +import { Check, Copy } from "lucide-react"; +import { + type HTMLProps, + type ReactNode, + useCallback, + useEffect, + useState, +} from "react"; +import { CopyToClipboard } from "react-copy-to-clipboard"; +import { useTranslation } from "react-i18next"; +import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter"; import java from "react-syntax-highlighter/dist/esm/languages/prism/java"; -import {materialDark} from "react-syntax-highlighter/dist/esm/styles/prism"; -import {toast} from "sonner"; -import {Button, type buttonVariants} from "@/components/ui/button"; -import {cn} from "@/lib/utils"; +import { materialDark } from "react-syntax-highlighter/dist/esm/styles/prism"; +import { toast } from "sonner"; +import { Button, type buttonVariants } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; SyntaxHighlighter.registerLanguage("java", java); interface CopyButtonProps extends React.ComponentProps<"button"> { @@ -16,7 +22,9 @@ interface CopyButtonProps extends React.ComponentProps<"button"> { src?: string; } -export function CopyButton({ value }: Readonly>) { +export function CopyButton({ + value, +}: Readonly>) { const [hasCopied, setHasCopied] = useState(false); const { t } = useTranslation(); @@ -60,12 +68,18 @@ export default function CodeViewer({ showLineNumbers = true, wrapLongLines = true, }: Readonly) { - const lineProps: lineTagPropsFunction | HTMLProps | undefined = wrapLongLines - ? { style: { overflowWrap: "break-word", whiteSpace: "pre-wrap" } } - : undefined; + const lineProps: lineTagPropsFunction | HTMLProps | undefined = + wrapLongLines + ? { style: { overflowWrap: "break-word", whiteSpace: "pre-wrap" } } + : undefined; return (
-
+
{header}
{button} diff --git a/web/src/components/copyable-field.tsx b/web/src/components/copyable-field.tsx index afd2f569..7c26e4b4 100644 --- a/web/src/components/copyable-field.tsx +++ b/web/src/components/copyable-field.tsx @@ -12,7 +12,11 @@ interface CopyableFieldProps { text?: string; } -export function CopyableField({ label, value, text }: Readonly) { +export function CopyableField({ + label, + value, + text, +}: Readonly) { const [hasCopied, setHasCopied] = useState(false); const { t } = useTranslation(); @@ -40,8 +44,18 @@ export function CopyableField({ label, value, text }: Readonly{label}: {value && ( - )} diff --git a/web/src/components/magicui/line-shadow-text.tsx b/web/src/components/magicui/line-shadow-text.tsx index f034cd3f..c8618d47 100644 --- a/web/src/components/magicui/line-shadow-text.tsx +++ b/web/src/components/magicui/line-shadow-text.tsx @@ -1,7 +1,9 @@ -import {type MotionProps, motion } from "motion/react"; -import {cn} from "@/lib/utils"; +import { type MotionProps, motion } from "motion/react"; +import { cn } from "@/lib/utils"; -interface LineShadowTextProps extends Omit, keyof MotionProps>, MotionProps { +interface LineShadowTextProps + extends Omit, keyof MotionProps>, + MotionProps { shadowColor?: string; as?: React.ElementType; } diff --git a/web/src/components/magicui/rainbow-button.tsx b/web/src/components/magicui/rainbow-button.tsx index 3a67dc72..57bb689e 100644 --- a/web/src/components/magicui/rainbow-button.tsx +++ b/web/src/components/magicui/rainbow-button.tsx @@ -1,7 +1,7 @@ -import {Slot} from "@radix-ui/react-slot"; -import {cva, type VariantProps} from "class-variance-authority"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; import React from "react"; -import {cn} from "@/lib/utils"; +import { cn } from "@/lib/utils"; const rainbowButtonVariants = cva( cn( diff --git a/web/src/components/memshell/main-config-card.tsx b/web/src/components/memshell/main-config-card.tsx index 6396aab3..5a8c8936 100644 --- a/web/src/components/memshell/main-config-card.tsx +++ b/web/src/components/memshell/main-config-card.tsx @@ -1,41 +1,56 @@ import { - ArrowUpRightIcon, - AxeIcon, - CommandIcon, - NetworkIcon, - ServerIcon, - ShieldOffIcon, - SwordIcon, - WaypointsIcon, - ZapIcon, + ArrowUpRightIcon, + AxeIcon, + CommandIcon, + NetworkIcon, + ServerIcon, + ShieldOffIcon, + SwordIcon, + WaypointsIcon, + ZapIcon, } from "lucide-react"; -import {type JSX, useCallback, useEffect, useId, useState} from "react"; -import {FormProvider, type UseFormReturn} from "react-hook-form"; -import {useTranslation} from "react-i18next"; -import {AntSwordTabContent} from "@/components/memshell/tabs/antsword-tab"; -import {BehinderTabContent} from "@/components/memshell/tabs/behinder-tab"; -import {CommandTabContent} from "@/components/memshell/tabs/command-tab"; +import { type JSX, useCallback, useEffect, useState } from "react"; +import { FormProvider, type UseFormReturn } from "react-hook-form"; +import { useTranslation } from "react-i18next"; +import { AntSwordTabContent } from "@/components/memshell/tabs/antsword-tab"; +import { BehinderTabContent } from "@/components/memshell/tabs/behinder-tab"; +import { CommandTabContent } from "@/components/memshell/tabs/command-tab"; import CustomTabContent from "@/components/memshell/tabs/custom-tab"; -import {GodzillaTabContent} from "@/components/memshell/tabs/godzilla-tab"; -import {NeoRegTabContent} from "@/components/memshell/tabs/neoreg-tab"; -import {Suo5TabContent} from "@/components/memshell/tabs/suo5-tab"; -import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card.tsx"; +import { GodzillaTabContent } from "@/components/memshell/tabs/godzilla-tab"; +import { NeoRegTabContent } from "@/components/memshell/tabs/neoreg-tab"; +import { Suo5TabContent } from "@/components/memshell/tabs/suo5-tab"; import { - FormControl, - FormDescription, - FormField, - FormFieldItem, - FormFieldLabel, - FormItem, - FormLabel, - FormMessage, + Card, + CardContent, + CardHeader, + CardTitle, +} from "@/components/ui/card.tsx"; +import { + FormControl, + FormDescription, + FormField, + FormFieldItem, + FormFieldLabel, + FormItem, + FormLabel, + FormMessage, } from "@/components/ui/form.tsx"; -import {Label} from "@/components/ui/label.tsx"; -import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue} from "@/components/ui/select.tsx"; -import {Switch} from "@/components/ui/switch.tsx"; -import {Tabs, TabsList, TabsTrigger} from "@/components/ui/tabs"; -import {type MainConfig, type ServerConfig, ShellToolType} from "@/types/memshell"; -import type {MemShellFormSchema} from "@/types/schema.ts"; +import { Label } from "@/components/ui/label.tsx"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select.tsx"; +import { Switch } from "@/components/ui/switch.tsx"; +import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { + type MainConfig, + type ServerConfig, + ShellToolType, +} from "@/types/memshell"; +import type { MemShellFormSchema } from "@/types/schema.ts"; const shellToolIcons: Record = { [ShellToolType.Behinder]: , @@ -79,7 +94,9 @@ export default function MainConfigCard({ const shellTool = form.watch("shellTool"); const { t } = useTranslation(); - const [serverVersionOptions, setServerVersionOptions] = useState(defaultServerVersionOptions); + const [serverVersionOptions, setServerVersionOptions] = useState( + defaultServerVersionOptions, + ); // 处理一下 shellTypes 由于 server 或 shellTool 变更时无法正常为 form.shellType 赋值的问题 useEffect(() => { @@ -95,7 +112,10 @@ export default function MainConfigCard({ setShellToolMap(newShellToolMap); const newShellTools = Object.keys(newShellToolMap); - setShellTools([...newShellTools.map((tool) => tool as ShellToolType), ShellToolType.Custom]); + setShellTools([ + ...newShellTools.map((tool) => tool as ShellToolType), + ShellToolType.Custom, + ]); const currentShellTool = form.getValues("shellTool"); @@ -233,10 +253,6 @@ export default function MainConfigCard({ [form, servers, shellToolMap], ); - const debugId = useId(); - const bypassId = useId(); - const shrinkId = useId(); - return ( diff --git a/web/src/components/memshell/package-config-card.tsx b/web/src/components/memshell/package-config-card.tsx index 7934a5be..ce287821 100644 --- a/web/src/components/memshell/package-config-card.tsx +++ b/web/src/components/memshell/package-config-card.tsx @@ -1,12 +1,22 @@ -import {PackageIcon} from "lucide-react"; -import {useEffect, useState} from "react"; -import {FormProvider, type UseFormReturn} from "react-hook-form"; -import {useTranslation} from "react-i18next"; -import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card.tsx"; -import {FormControl, FormField, FormItem, FormLabel} from "@/components/ui/form.tsx"; -import {RadioGroup, RadioGroupItem} from "@/components/ui/radio-group.tsx"; -import type {PackerConfig} from "@/types/memshell"; -import type {MemShellFormSchema} from "@/types/schema.ts"; +import { PackageIcon } from "lucide-react"; +import { useEffect, useState } from "react"; +import { FormProvider, type UseFormReturn } from "react-hook-form"; +import { useTranslation } from "react-i18next"; +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "@/components/ui/card.tsx"; +import { + FormControl, + FormField, + FormItem, + FormLabel, +} from "@/components/ui/form.tsx"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group.tsx"; +import type { PackerConfig } from "@/types/memshell"; +import type { MemShellFormSchema } from "@/types/schema.ts"; type Option = { name: string; @@ -49,7 +59,10 @@ export default function PackageConfigCard({ setOptions(mappedOptions); const currentValue = form.getValues("packingMethod"); - if (filteredOptions.length > 0 && (!currentValue || !filteredOptions.includes(currentValue))) { + if ( + filteredOptions.length > 0 && + (!currentValue || !filteredOptions.includes(currentValue)) + ) { form.setValue("packingMethod", filteredOptions[0]); } }, [form, packerConfig, server, shellType, t]); @@ -78,7 +91,10 @@ export default function PackageConfigCard({ className="grid grid-cols-2 md:grid-cols-3" > {options.map(({ name, value }) => ( - + @@ -96,7 +112,9 @@ export default function PackageConfigCard({ ) : (
- {t("loading")} + + {t("loading")} +
)} diff --git a/web/src/components/memshell/quick-usage.tsx b/web/src/components/memshell/quick-usage.tsx index d3f993b2..e34f0c44 100644 --- a/web/src/components/memshell/quick-usage.tsx +++ b/web/src/components/memshell/quick-usage.tsx @@ -1,6 +1,11 @@ import { ScrollTextIcon } from "lucide-react"; import { useTranslation } from "react-i18next"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx"; +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "@/components/ui/card.tsx"; export function QuickUsage() { const { t } = useTranslation(); diff --git a/web/src/components/memshell/results/agent.tsx b/web/src/components/memshell/results/agent.tsx index 1656a471..dd0db625 100644 --- a/web/src/components/memshell/results/agent.tsx +++ b/web/src/components/memshell/results/agent.tsx @@ -1,10 +1,10 @@ -import {ScrollTextIcon} from "lucide-react"; -import {useTranslation} from "react-i18next"; -import {Button} from "@/components/ui/button"; -import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card"; -import {Separator} from "@/components/ui/separator"; -import {downloadBytes, formatBytes} from "@/lib/utils"; -import type {MemShellResult} from "@/types/memshell"; +import { ScrollTextIcon } from "lucide-react"; +import { useTranslation } from "react-i18next"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Separator } from "@/components/ui/separator"; +import { downloadBytes, formatBytes } from "@/lib/utils"; +import type { MemShellResult } from "@/types/memshell"; export function AgentResult({ packMethod, diff --git a/web/src/components/memshell/results/basic-info.tsx b/web/src/components/memshell/results/basic-info.tsx index 9307bb0a..3c080c19 100644 --- a/web/src/components/memshell/results/basic-info.tsx +++ b/web/src/components/memshell/results/basic-info.tsx @@ -1,20 +1,20 @@ -import {FileTextIcon} from "lucide-react"; -import {useTranslation} from "react-i18next"; -import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card"; -import {Separator} from "@/components/ui/separator"; -import {shouldHidden} from "@/lib/utils"; +import { FileTextIcon } from "lucide-react"; +import { useTranslation } from "react-i18next"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Separator } from "@/components/ui/separator"; +import { shouldHidden } from "@/lib/utils"; import { - type AntSwordShellToolConfig, - type BehinderShellToolConfig, - type CommandShellToolConfig, - type GodzillaShellToolConfig, - type MemShellResult, - type NeoreGeorgShellToolConfig, - ShellToolType, - type Suo5ShellToolConfig, + type AntSwordShellToolConfig, + type BehinderShellToolConfig, + type CommandShellToolConfig, + type GodzillaShellToolConfig, + type MemShellResult, + type NeoreGeorgShellToolConfig, + ShellToolType, + type Suo5ShellToolConfig, } from "@/types/memshell"; -import {CopyableField} from "../../copyable-field"; -import {FeedbackAlert} from "./feedback-alert"; +import { CopyableField } from "../../copyable-field"; +import { FeedbackAlert } from "./feedback-alert"; export function BasicInfo({ generateResult }: Readonly<{ generateResult?: MemShellResult }>) { const { t } = useTranslation(); diff --git a/web/src/components/memshell/results/jar-result.tsx b/web/src/components/memshell/results/jar-result.tsx index 56e0376a..dab152b0 100644 --- a/web/src/components/memshell/results/jar-result.tsx +++ b/web/src/components/memshell/results/jar-result.tsx @@ -1,7 +1,7 @@ -import {useTranslation} from "react-i18next"; -import {Button} from "@/components/ui/button"; -import {downloadBytes} from "@/lib/utils"; -import type {MemShellResult} from "@/types/memshell"; +import { useTranslation } from "react-i18next"; +import { Button } from "@/components/ui/button"; +import { downloadBytes } from "@/lib/utils"; +import type { MemShellResult } from "@/types/memshell"; export function JarResult({ packResult, diff --git a/web/src/components/memshell/results/multi-packer.tsx b/web/src/components/memshell/results/multi-packer.tsx index b220abff..46f93f21 100644 --- a/web/src/components/memshell/results/multi-packer.tsx +++ b/web/src/components/memshell/results/multi-packer.tsx @@ -1,7 +1,14 @@ import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import CodeViewer from "@/components/code-viewer"; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; + export function MultiPackResult({ allPackResults, packMethod, @@ -30,7 +37,9 @@ export function MultiPackResult({