From 3f31f505f8f189be9cb8d8d75b422be2de5f263a Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 16 Mar 2026 21:35:14 +0800 Subject: [PATCH] fix: restore frontend ci for better-auth upgrade --- .prettierrc.mjs | 22 ++++++++++ apps/desktop/AGENTS.md | 2 +- .../layer/main/src/ipc/services/auth.ts | 3 +- .../layer/renderer/src/lib/api-client.ts | 7 ++-- .../layer/renderer/src/modules/auth/Form.tsx | 23 ++++++----- apps/ssr/client/pages/(login)/register.tsx | 41 ++++++++++--------- apps/ssr/tailwind.config.ts | 2 +- eslint.config.mjs | 8 ++++ .../components/src/ui/avatar/index.tsx | 2 +- .../src/ui/button/action-button.tsx | 6 +-- .../components/src/ui/button/index.tsx | 2 +- .../internal/components/src/ui/card/index.tsx | 4 +- .../components/src/ui/checkbox/index.tsx | 2 +- .../src/ui/collapse/CollapseCss.tsx | 2 +- .../src/ui/context-menu/context-menu.tsx | 24 +++++------ .../src/ui/divider/PanelSplitter.tsx | 2 +- .../components/src/ui/drop-zone/index.tsx | 2 +- .../src/ui/effect/MagneticHoverEffect.tsx | 2 +- .../internal/components/src/ui/form/index.tsx | 4 +- .../components/src/ui/hover-card/index.tsx | 4 +- .../src/ui/input/DateTimePicker.tsx | 6 +-- .../components/src/ui/input/Input.tsx | 4 +- .../components/src/ui/input/InputV2.tsx | 8 ++-- .../internal/components/src/ui/input/OTP.tsx | 8 ++-- .../src/ui/input/TextAreaWrapper.tsx | 6 +-- .../components/src/ui/input/TimeSelect.tsx | 6 +-- .../src/ui/json-highlighter/index.tsx | 4 +- .../internal/components/src/ui/kbd/Kbd.tsx | 4 +- .../lexical-rich-editor/LexicalRichEditor.tsx | 4 +- .../components/src/ui/markdown/html.tsx | 2 +- .../src/ui/navigation-menu/index.tsx | 8 ++-- .../components/src/ui/popover/index.tsx | 4 +- .../components/src/ui/progress/index.tsx | 4 +- .../src/ui/radio-group/RadioCard.tsx | 2 +- .../components/src/ui/radio-group/motion.tsx | 2 +- .../components/src/ui/segment/index.tsx | 8 ++-- .../components/src/ui/select/index.tsx | 22 +++++----- .../components/src/ui/select/responsive.tsx | 6 +-- .../components/src/ui/sheet/Sheet.tsx | 4 +- .../src/ui/shiny-text/ShinyText.tsx | 2 +- .../components/src/ui/skeleton/index.tsx | 2 +- .../components/src/ui/slider/index.tsx | 2 +- .../components/src/ui/switch/index.tsx | 4 +- .../components/src/ui/table/index.tsx | 8 ++-- .../internal/components/src/ui/tabs/index.tsx | 12 +++--- 45 files changed, 171 insertions(+), 135 deletions(-) diff --git a/.prettierrc.mjs b/.prettierrc.mjs index 6a48a4e79..61f7912ce 100644 --- a/.prettierrc.mjs +++ b/.prettierrc.mjs @@ -1,3 +1,4 @@ +/** @type {import("prettier").Config & import("prettier-plugin-tailwindcss").PluginOptions} */ export default { semi: false, singleQuote: false, @@ -6,4 +7,25 @@ export default { trailingComma: "all", objectWrap: "preserve", plugins: ["prettier-plugin-tailwindcss"], + tailwindConfig: "./apps/desktop/tailwind.config.ts", + overrides: [ + { + files: "apps/mobile/**/*.{css,js,jsx,ts,tsx}", + options: { + tailwindConfig: "./apps/mobile/tailwind.config.ts", + }, + }, + { + files: "apps/mobile/web-app/html-renderer/**/*.{css,js,jsx,ts,tsx}", + options: { + tailwindConfig: "./apps/mobile/web-app/html-renderer/tailwind.config.ts", + }, + }, + { + files: "apps/ssr/**/*.{css,html,js,jsx,ts,tsx}", + options: { + tailwindConfig: "./apps/ssr/tailwind.config.ts", + }, + }, + ], } diff --git a/apps/desktop/AGENTS.md b/apps/desktop/AGENTS.md index 67b689b6c..7a27276fb 100644 --- a/apps/desktop/AGENTS.md +++ b/apps/desktop/AGENTS.md @@ -173,7 +173,7 @@ For hover states on buttons or interactive areas within glass containers: }} > {/* Subtle shine effect */} -
+
``` diff --git a/apps/desktop/layer/main/src/ipc/services/auth.ts b/apps/desktop/layer/main/src/ipc/services/auth.ts index 4e46d72bd..5426fa08b 100644 --- a/apps/desktop/layer/main/src/ipc/services/auth.ts +++ b/apps/desktop/layer/main/src/ipc/services/auth.ts @@ -22,7 +22,8 @@ export class AuthService extends IpcService { const apiURL = env.VITE_API_URL const url = new URL(apiURL) - const isSecure = url.protocol === "https:" || url.hostname === "localhost" || url.hostname === "127.0.0.1" + const isSecure = + url.protocol === "https:" || url.hostname === "localhost" || url.hostname === "127.0.0.1" const isLocalhost = url.hostname === "localhost" || url.hostname === "127.0.0.1" const cookieNames = [ BETTER_AUTH_COOKIE_NAME_SESSION_TOKEN, diff --git a/apps/desktop/layer/renderer/src/lib/api-client.ts b/apps/desktop/layer/renderer/src/lib/api-client.ts index 654002bbf..21d29d740 100644 --- a/apps/desktop/layer/renderer/src/lib/api-client.ts +++ b/apps/desktop/layer/renderer/src/lib/api-client.ts @@ -1,5 +1,5 @@ -import { env } from "@follow/shared/env.desktop" import { IN_ELECTRON } from "@follow/shared/constants" +import { env } from "@follow/shared/env.desktop" import { whoami } from "@follow/store/user/getters" import { userActions } from "@follow/store/user/store" import { createDesktopAPIHeaders } from "@follow/utils/headers" @@ -9,8 +9,7 @@ import PKG from "@pkg" import { NetworkStatus, setApiStatus } from "~/atoms/network" import { setLoginModalShow } from "~/atoms/user" -import { getAuthSessionToken } from "./client-session" -import { getClientId, getSessionId } from "./client-session" +import { getAuthSessionToken, getClientId, getSessionId } from "./client-session" export const followClient = new FollowClient({ credentials: "include", @@ -34,7 +33,7 @@ followClient.addRequestInterceptor(async (ctx) => { if (authSessionToken && !headers.has("Cookie") && !headers.has("cookie")) { headers.set( "Cookie", - `__Secure-better-auth.session_token=${authSessionToken}; better-auth.session_token=${authSessionToken}` + `__Secure-better-auth.session_token=${authSessionToken}; better-auth.session_token=${authSessionToken}`, ) } diff --git a/apps/desktop/layer/renderer/src/modules/auth/Form.tsx b/apps/desktop/layer/renderer/src/modules/auth/Form.tsx index 1427f06d0..96b0d7a9a 100644 --- a/apps/desktop/layer/renderer/src/modules/auth/Form.tsx +++ b/apps/desktop/layer/renderer/src/modules/auth/Form.tsx @@ -372,17 +372,20 @@ export function RegisterForm({ headers, }), ) - : await signUp.email({ - email: values.email, - password: values.password, - name: values.email.split("@")[0]!, - callbackURL: "/", - }, { - onError(context) { - toast.error(context.error.message) + : await signUp.email( + { + email: values.email, + password: values.password, + name: values.email.split("@")[0]!, + callbackURL: "/", }, - headers, - }) + { + onError(context) { + toast.error(context.error.message) + }, + headers, + }, + ) if (result?.error) { return result diff --git a/apps/ssr/client/pages/(login)/register.tsx b/apps/ssr/client/pages/(login)/register.tsx index e2c2085c3..f551befeb 100644 --- a/apps/ssr/client/pages/(login)/register.tsx +++ b/apps/ssr/client/pages/(login)/register.tsx @@ -69,27 +69,30 @@ function RegisterForm() { try { const recaptchaToken = await requestRecaptchaToken("ssr_register") - await signUp.email({ - email: values.email, - password: values.password, - name: values.email.split("@")[0]!, - callbackURL: "/", - }, { - onSuccess() { - tracker.register({ - type: "email", - }) - navigate("/login") + await signUp.email( + { + email: values.email, + password: values.password, + name: values.email.split("@")[0]!, + callbackURL: "/", }, - onError(context) { - toast.error(context.error.message) + { + onSuccess() { + tracker.register({ + type: "email", + }) + navigate("/login") + }, + onError(context) { + toast.error(context.error.message) + }, + headers: recaptchaToken + ? { + "x-token": `r3:${recaptchaToken}`, + } + : undefined, }, - headers: recaptchaToken - ? { - "x-token": `r3:${recaptchaToken}`, - } - : undefined, - }) + ) } finally { setIsSubmitting(false) } diff --git a/apps/ssr/tailwind.config.ts b/apps/ssr/tailwind.config.ts index b702de37e..0266b83a5 100644 --- a/apps/ssr/tailwind.config.ts +++ b/apps/ssr/tailwind.config.ts @@ -1,7 +1,7 @@ import { extendConfig } from "@follow/configs/tailwindcss/web" import daisyui from "daisyui" -import { withUIKit } from "tailwindcss-uikit-colors/macos" import type { Config } from "tailwindcss" +import { withUIKit } from "tailwindcss-uikit-colors/macos" /** @type {import('tailwindcss').Config} */ export default withUIKit( diff --git a/eslint.config.mjs b/eslint.config.mjs index 1c032ec94..b8f59ce91 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -37,6 +37,14 @@ export default defineConfig( }, rules: { "no-debug/no-debug-stack": "error", + "tailwindcss/classnames-order": "off", + "tailwindcss/enforces-negative-arbitrary-values": "off", + "tailwindcss/enforces-shorthand": "off", + "tailwindcss/migration-from-tailwind-2": "off", + "tailwindcss/no-arbitrary-value": "off", + "tailwindcss/no-contradicting-classname": "off", + "tailwindcss/no-custom-classname": "off", + "tailwindcss/no-unnecessary-arbitrary-value": "off", "@eslint-react/no-clone-element": 0, "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": 0, "@eslint-react/dom/no-flush-sync": 1, diff --git a/packages/internal/components/src/ui/avatar/index.tsx b/packages/internal/components/src/ui/avatar/index.tsx index 0842052e3..c881dde16 100644 --- a/packages/internal/components/src/ui/avatar/index.tsx +++ b/packages/internal/components/src/ui/avatar/index.tsx @@ -42,7 +42,7 @@ export const AvatarFallback = ({ {tooltipDescription ? ( -
{tooltipDescription}
+
{tooltipDescription}
) : null} diff --git a/packages/internal/components/src/ui/button/index.tsx b/packages/internal/components/src/ui/button/index.tsx index a21b9a404..2c3c05324 100644 --- a/packages/internal/components/src/ui/button/index.tsx +++ b/packages/internal/components/src/ui/button/index.tsx @@ -129,7 +129,7 @@ export const IconButton = ({ styledButtonVariant({ variant: "ghost", }), - "bg-accent/10 hover:bg-accent/20 active:bg-accent/30 dark:bg-accent/20 dark:hover:bg-accent/30 dark:active:bg-accent/40 group relative gap-2 px-4 transition-all duration-300", + "group relative gap-2 bg-accent/10 px-4 transition-all duration-300 hover:bg-accent/20 active:bg-accent/30 dark:bg-accent/20 dark:hover:bg-accent/30 dark:active:bg-accent/40", rest.className, )} > diff --git a/packages/internal/components/src/ui/card/index.tsx b/packages/internal/components/src/ui/card/index.tsx index fa697bb78..3b78138af 100644 --- a/packages/internal/components/src/ui/card/index.tsx +++ b/packages/internal/components/src/ui/card/index.tsx @@ -8,7 +8,7 @@ const Card = ({ }: React.HTMLAttributes & { ref?: React.Ref }) => (
) @@ -44,7 +44,7 @@ const CardDescription = ({ ...props }: React.HTMLAttributes & { ref?: React.Ref -}) =>

+}) =>

CardDescription.displayName = "CardDescription" const CardContent = ({ diff --git a/packages/internal/components/src/ui/checkbox/index.tsx b/packages/internal/components/src/ui/checkbox/index.tsx index 53441d5e4..af36162a6 100644 --- a/packages/internal/components/src/ui/checkbox/index.tsx +++ b/packages/internal/components/src/ui/checkbox/index.tsx @@ -38,7 +38,7 @@ function Checkbox({ = ({ > {title} {!hideArrow && ( -

+
| null> }) => ( ) @@ -194,7 +194,7 @@ const ContextMenuSeparator = ({ ref?: React.Ref | null> }) => ( ({ "relative", "inline-block transition-transform duration-200 ease-out will-change-transform", "hover:before:bg-fill-tertiary", - "before:backdrop-blur-background before:absolute before:-inset-x-2 before:inset-y-0 before:z-[-1] before:scale-0 before:rounded-xl before:opacity-0 before:transition-all before:duration-200 before:[transform-origin:var(--origin-x)_var(--origin-y)] hover:before:scale-100 hover:before:opacity-100", + "before:absolute before:-inset-x-2 before:inset-y-0 before:z-[-1] before:scale-0 before:rounded-xl before:opacity-0 before:backdrop-blur-background before:transition-all before:duration-200 before:[transform-origin:var(--origin-x)_var(--origin-y)] hover:before:scale-100 hover:before:opacity-100", rest.className, )} > diff --git a/packages/internal/components/src/ui/form/index.tsx b/packages/internal/components/src/ui/form/index.tsx index e73f0c34a..9acb76080 100644 --- a/packages/internal/components/src/ui/form/index.tsx +++ b/packages/internal/components/src/ui/form/index.tsx @@ -126,7 +126,7 @@ const FormDescription = ({

) @@ -152,7 +152,7 @@ const FormMessage = ({

{body} diff --git a/packages/internal/components/src/ui/hover-card/index.tsx b/packages/internal/components/src/ui/hover-card/index.tsx index 2412d619c..1a08eb919 100644 --- a/packages/internal/components/src/ui/hover-card/index.tsx +++ b/packages/internal/components/src/ui/hover-card/index.tsx @@ -23,8 +23,8 @@ const HoverCardContent = ({ align={align} sideOffset={sideOffset} className={cn( - "bg-material-medium backdrop-blur-background border-border text-text z-[60] w-fit overflow-hidden rounded-md border shadow-lg", - "motion-scale-in-95 motion-duration-200 text-body", + "z-[60] w-fit overflow-hidden rounded-md border border-border bg-material-medium text-text shadow-lg backdrop-blur-background", + "text-body motion-scale-in-95 motion-duration-200", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className, )} diff --git a/packages/internal/components/src/ui/input/DateTimePicker.tsx b/packages/internal/components/src/ui/input/DateTimePicker.tsx index 3db2bf4c5..fc2d021ea 100644 --- a/packages/internal/components/src/ui/input/DateTimePicker.tsx +++ b/packages/internal/components/src/ui/input/DateTimePicker.tsx @@ -235,7 +235,7 @@ export const DateTimePicker = memo( {viewMode === "days" && ( <> {/* Weekdays */} -

+
{weekDays.map((day) => (
{day.slice(0, 2)} @@ -362,9 +362,9 @@ export const DateTimePicker = memo( {/* Time Selection (only single mode) */} {!isRangeMode && ( -
+
- Time + Time {icon && ( -
+
{icon}
)} @@ -52,9 +52,9 @@ export const InputV2 = ({ className={cn( "min-w-0 flex-auto appearance-none rounded-lg text-sm", "bg-theme-background py-[calc(theme(spacing.2)-1px)]", - "ring-accent/20 focus:border-accent/80 duration-200 focus:outline-none focus:ring-2", + "ring-accent/20 duration-200 focus:border-accent/80 focus:outline-none focus:ring-2", "focus:!bg-accent/5", - "border-border border", + "border border-border", "placeholder:text-text-tertiary dark:bg-zinc-700/[0.15] dark:text-zinc-200", "hover:border-accent/60", props.type === "password" && "font-mono placeholder:font-sans", @@ -73,7 +73,7 @@ export const InputV2 = ({