feat(client): migrate to pnpm

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit was merged in pull request #5.
This commit is contained in:
2026-01-20 13:32:37 +08:00
parent b8a2e24bd0
commit 7edcda544b
6 changed files with 7947 additions and 1822 deletions

File diff suppressed because it is too large Load Diff

7943
client/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,32 +0,0 @@
import { Badge } from '@/components/ui/badge';
import { Card, CardAction, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
import { useUserInfo } from '@/hooks/data/useUserInfo';
import { QrDialog } from '../checkin/qr-dialog';
import { withFallback } from '../hoc/with-fallback';
import { CardSkeleton } from './card-skeleton';
function CheckinCard_() {
const { data } = useUserInfo();
return (
<Card className="@container/card">
<CardHeader>
<CardDescription></CardDescription>
<CardTitle className="text-2xl font-semibold tabular-nums @[250px]/card:text-3xl">
{data.checkin !== null ? '已签到' : '未签到'}
{data.checkin !== null && <span className="text-sm font-medium ml-2">{`${new Date(data.checkin).toLocaleString()}`}</span>}
</CardTitle>
<CardAction>
<Badge variant="outline">Day 1</Badge>
</CardAction>
</CardHeader>
<CardFooter className="flex-col items-start gap-1.5 text-sm">
<QrDialog
eventId="019b5bf2-90ce-75f5-93a4-a66914c2ef11"
>
</QrDialog>
</CardFooter>
</Card>
);
}
export const CheckinCard = withFallback(CheckinCard_, <CardSkeleton />);

View File

@@ -36,7 +36,7 @@ axiosClient.interceptors.response.use(undefined, async (error: AxiosError) => {
}
catch (e) {
if (e instanceof AxiosError && e.status === 401) {
await router.navigate({ to: '/login' });
await router.navigate({ to: '/authorize' });
return Promise.reject(error);
}
}

View File

@@ -47,11 +47,11 @@ const SidebarLayoutProfileRoute = SidebarLayoutProfileRouteImport.update({
} as any)
export interface FileRoutesByFullPath {
'/': typeof SidebarLayoutIndexRoute
'/authorize': typeof AuthorizeRoute
'/magicLinkSent': typeof MagicLinkSentRoute
'/token': typeof TokenRoute
'/profile': typeof SidebarLayoutProfileRoute
'/': typeof SidebarLayoutIndexRoute
}
export interface FileRoutesByTo {
'/authorize': typeof AuthorizeRoute
@@ -71,7 +71,7 @@ export interface FileRoutesById {
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/authorize' | '/magicLinkSent' | '/token' | '/profile' | '/'
fullPaths: '/' | '/authorize' | '/magicLinkSent' | '/token' | '/profile'
fileRoutesByTo: FileRoutesByTo
to: '/authorize' | '/magicLinkSent' | '/token' | '/profile' | '/'
id:
@@ -117,7 +117,7 @@ declare module '@tanstack/react-router' {
'/_sidebarLayout': {
id: '/_sidebarLayout'
path: ''
fullPath: ''
fullPath: '/'
preLoaderRoute: typeof SidebarLayoutRouteImport
parentRoute: typeof rootRouteImport
}

View File

@@ -1,5 +1,4 @@
import { createFileRoute, redirect } from '@tanstack/react-router';
import { CheckinCard } from '@/components/workbenchCards/checkin';
import { hasToken } from '@/lib/token';
export const Route = createFileRoute('/_sidebarLayout/')({
@@ -21,7 +20,6 @@ function Index() {
grid grid-cols-1 gap-4 px-4 auto-rows-[minmax(175px,auto)] items-stretch
*:data-[slot=card]:bg-linear-to-t *:data-[slot=card]:shadow-xs lg:px-6 @xl/main:grid-cols-2 @5xl/main:grid-cols-4"
>
<CheckinCard />
</div>
</div>
);