From ba99642e973ba937019046e1a9c4fcad33793852 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Wed, 26 Nov 2025 00:40:07 -0500 Subject: [PATCH] [FA-11] Fix build errors, try to fix cache miss on node build --- .gitea/workflows/build-subgraphs.yml | 4 ++-- .gitea/workflows/build.yml | 2 +- fictionarchive-web/eslint.config.js | 2 +- fictionarchive-web/src/apolloClient.ts | 2 +- fictionarchive-web/src/auth/AuthContext.tsx | 4 ++-- fictionarchive-web/src/components/ui/badge.tsx | 1 + fictionarchive-web/src/components/ui/button.tsx | 1 + fictionarchive-web/src/components/ui/input.tsx | 3 +-- fictionarchive-web/src/pages/NovelsPage.tsx | 5 ++--- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/build-subgraphs.yml b/.gitea/workflows/build-subgraphs.yml index c8bc6b4..54f6751 100644 --- a/.gitea/workflows/build-subgraphs.yml +++ b/.gitea/workflows/build-subgraphs.yml @@ -50,8 +50,8 @@ jobs: - name: Export schema run: | - dotnet run --project ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj \ - --no-build -c Release --no-launch-profile \ + dotnet run -c Release --no-build --no-launch-profile \ + --project ${{ matrix.service.project }}/${{ matrix.service.project }}.csproj \ -- schema export --output ${{ matrix.service.project }}/schema.graphql - name: Pack subgraph diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2d59136..e71146a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6.0.0 with: node-version: '20' cache: 'npm' diff --git a/fictionarchive-web/eslint.config.js b/fictionarchive-web/eslint.config.js index 5e6b472..7dd669d 100644 --- a/fictionarchive-web/eslint.config.js +++ b/fictionarchive-web/eslint.config.js @@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint' import { defineConfig, globalIgnores } from 'eslint/config' export default defineConfig([ - globalIgnores(['dist']), + globalIgnores(['dist', 'src/__generated__']), { files: ['**/*.{ts,tsx}'], extends: [ diff --git a/fictionarchive-web/src/apolloClient.ts b/fictionarchive-web/src/apolloClient.ts index 1bc87ed..058e4e0 100644 --- a/fictionarchive-web/src/apolloClient.ts +++ b/fictionarchive-web/src/apolloClient.ts @@ -6,7 +6,7 @@ const uri = import.meta.env.VITE_GRAPHQL_URI ?? 'https://localhost:5001/graphql' const httpLink = new HttpLink({ uri }) -const authLink = new SetContextLink(async ({ headers }, _) => { +const authLink = new SetContextLink(async ({ headers }) => { if (!userManager) return { headers } try { const user = await userManager.getUser() diff --git a/fictionarchive-web/src/auth/AuthContext.tsx b/fictionarchive-web/src/auth/AuthContext.tsx index d3d781d..6ccb637 100644 --- a/fictionarchive-web/src/auth/AuthContext.tsx +++ b/fictionarchive-web/src/auth/AuthContext.tsx @@ -14,12 +14,11 @@ const AuthContext = createContext(undefined) export function AuthProvider({ children }: { children: ReactNode }) { const [user, setUser] = useState(null) - const [isLoading, setIsLoading] = useState(true) + const [isLoading, setIsLoading] = useState(!!userManager) const callbackHandledRef = useRef(false) useEffect(() => { if (!userManager) { - setIsLoading(false) return } @@ -121,6 +120,7 @@ export function AuthProvider({ children }: { children: ReactNode }) { return {children} } +// eslint-disable-next-line react-refresh/only-export-components export function useAuth() { const context = useContext(AuthContext) if (!context) { diff --git a/fictionarchive-web/src/components/ui/badge.tsx b/fictionarchive-web/src/components/ui/badge.tsx index 8cf516f..fa47ef3 100644 --- a/fictionarchive-web/src/components/ui/badge.tsx +++ b/fictionarchive-web/src/components/ui/badge.tsx @@ -31,4 +31,5 @@ function Badge({ className, variant, ...props }: BadgeProps) { ) } +// eslint-disable-next-line react-refresh/only-export-components export { Badge, badgeVariants } diff --git a/fictionarchive-web/src/components/ui/button.tsx b/fictionarchive-web/src/components/ui/button.tsx index fb25275..ab026f2 100644 --- a/fictionarchive-web/src/components/ui/button.tsx +++ b/fictionarchive-web/src/components/ui/button.tsx @@ -51,4 +51,5 @@ const Button = React.forwardRef( ) Button.displayName = 'Button' +// eslint-disable-next-line react-refresh/only-export-components export { Button, buttonVariants } diff --git a/fictionarchive-web/src/components/ui/input.tsx b/fictionarchive-web/src/components/ui/input.tsx index dfff7a2..3e75349 100644 --- a/fictionarchive-web/src/components/ui/input.tsx +++ b/fictionarchive-web/src/components/ui/input.tsx @@ -2,8 +2,7 @@ import * as React from 'react' import { cn } from '../../lib/utils' -export interface InputProps - extends React.InputHTMLAttributes {} +export type InputProps = React.InputHTMLAttributes const Input = React.forwardRef( ({ className, type, ...props }, ref) => { diff --git a/fictionarchive-web/src/pages/NovelsPage.tsx b/fictionarchive-web/src/pages/NovelsPage.tsx index 1b56ef5..21171ca 100644 --- a/fictionarchive-web/src/pages/NovelsPage.tsx +++ b/fictionarchive-web/src/pages/NovelsPage.tsx @@ -13,14 +13,13 @@ export function NovelsPage() { notifyOnNetworkStatusChange: true, }) - const edges = data?.novels?.edges ?? [] const pageInfo = data?.novels?.pageInfo const hasNextPage = pageInfo?.hasNextPage ?? false const endCursor = pageInfo?.endCursor ?? null const novels = useMemo( - () => edges.map((edge) => edge?.node).filter(Boolean), - [edges] + () => (data?.novels?.edges ?? []).map((edge) => edge?.node).filter(Boolean), + [data?.novels?.edges] ) async function handleLoadMore() {