1
0

ref: rename import alias

This commit is contained in:
alikia2x (寒寒) 2025-11-17 05:04:24 +08:00
parent 9f84003544
commit 2851491eaa
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 56209E0CCD8420C6
30 changed files with 53 additions and 50 deletions

View File

@ -1,5 +1,5 @@
import { Elysia } from "elysia";
import { validateSession, User } from "@elysia/lib/auth";
import { validateSession, User } from "@backend/lib/auth";
export interface AuthenticatedContext {
user: User;

View File

@ -1,6 +1,6 @@
import { Elysia, t } from "elysia";
import { ip } from "elysia-ip";
import { verifyUser, createSession, getSessionExpirationDate } from "@elysia/lib/auth";
import { verifyUser, createSession, getSessionExpirationDate } from "@backend/lib/auth";
export const loginHandler = new Elysia({ prefix: "/auth" }).use(ip()).post(
"/session",

View File

@ -1,5 +1,5 @@
import { Elysia, t } from "elysia";
import { deactivateSession } from "@elysia/lib/auth";
import { deactivateSession } from "@backend/lib/auth";
export const logoutHandler = new Elysia({ prefix: "/auth" })
.delete(

View File

@ -1,4 +1,4 @@
import { VERSION } from "@elysia/src";
import { VERSION } from "@backend/src";
import { Elysia, t } from "elysia";
export const pingHandler = new Elysia({ prefix: "/ping" }).get(

View File

@ -1,5 +1,5 @@
import { getSingerForBirthday, pickSinger, pickSpecialSinger, Singer } from "@elysia/lib/singers";
import { VERSION } from "@elysia/src";
import { getSingerForBirthday, pickSinger, pickSpecialSinger, Singer } from "@backend/lib/singers";
import { VERSION } from "@backend/src";
import { Elysia, t } from "elysia";
const SingerObj = t.Object({

View File

@ -1,10 +1,10 @@
import { Elysia } from "elysia";
import { db, bilibiliMetadata, latestVideoSnapshot, songs } from "@core/drizzle";
import { eq, like } from "drizzle-orm";
import { BiliAPIVideoMetadataSchema, BiliVideoSchema, SongSchema } from "@elysia/lib/schema";
import { BiliAPIVideoMetadataSchema, BiliVideoSchema, SongSchema } from "@backend/lib/schema";
import { z } from "zod";
import { getVideoInfo } from "@core/net/getVideoInfo";
import { biliIDToAID } from "@elysia/lib/bilibiliID";
import { biliIDToAID } from "@backend/lib/bilibiliID";
import { retrieveVideoInfoFromCache } from "../video/metadata";
import { redis } from "@core/db/redis";

View File

@ -1,7 +1,7 @@
import { Elysia, t } from "elysia";
import { biliIDToAID } from "@elysia/lib/bilibiliID";
import { requireAuth } from "@elysia/middlewares/auth";
import { LatestVideosQueue } from "@elysia/lib/mq";
import { biliIDToAID } from "@backend/lib/bilibiliID";
import { requireAuth } from "@backend/middlewares/auth";
import { LatestVideosQueue } from "@backend/lib/mq";
import { db, songs } from "@core/drizzle";
import { eq, and } from "drizzle-orm";

View File

@ -1,5 +1,5 @@
import { Elysia, t } from "elysia";
import { requireAuth } from "@elysia/middlewares/auth";
import { requireAuth } from "@backend/middlewares/auth";
import { songs, history, db } from "@core/drizzle";
import { eq } from "drizzle-orm";

View File

@ -1,8 +1,8 @@
import { Elysia, t } from "elysia";
import { db, history, songs } from "@core/drizzle";
import { eq, and } from "drizzle-orm";
import { bv2av } from "@elysia/lib/bilibiliID";
import { requireAuth } from "@elysia/middlewares/auth";
import { bv2av } from "@backend/lib/bilibiliID";
import { requireAuth } from "@backend/middlewares/auth";
async function getSongIDFromBiliID(id: string) {
let aid: number;

View File

@ -1,9 +1,9 @@
import { Elysia, t } from "elysia";
import { db, bilibiliMetadata, eta } from "@core/drizzle";
import { eq, and, gte, lt } from "drizzle-orm";
import serverTiming from "@elysia/middlewares/timing";
import serverTiming from "@backend/middlewares/timing";
import z from "zod";
import { BiliVideoSchema } from "@elysia/lib/schema";
import { BiliVideoSchema } from "@backend/lib/schema";
type MileStoneType = "dendou" | "densetsu" | "shinwa";

View File

@ -1,7 +1,7 @@
import { Elysia, t } from "elysia";
import { db, eta } from "@core/drizzle";
import { eq } from "drizzle-orm";
import { biliIDToAID } from "@elysia/lib/bilibiliID";
import { biliIDToAID } from "@backend/lib/bilibiliID";
export const songEtaHandler = new Elysia({ prefix: "/video" }).get(
"/:id/eta",

View File

@ -1,9 +1,9 @@
import { Elysia, t } from "elysia";
import { db, videoSnapshot } from "@core/drizzle";
import { bv2av } from "@elysia/lib/bilibiliID";
import { bv2av } from "@backend/lib/bilibiliID";
import { getVideoInfo } from "@core/net/getVideoInfo";
import { redis } from "@core/db/redis";
import { ErrorResponseSchema } from "@elysia/src/schema";
import { ErrorResponseSchema } from "@backend/src/schema";
import type { VideoInfoData } from "@core/net/bilibili.d.ts";
export async function retrieveVideoInfoFromCache(aid: number) {

View File

@ -1,10 +1,10 @@
import { Elysia } from "elysia";
import { db, videoSnapshot } from "@core/drizzle";
import { bv2av } from "@elysia/lib/bilibiliID";
import { ErrorResponseSchema } from "@elysia/src/schema";
import { bv2av } from "@backend/lib/bilibiliID";
import { ErrorResponseSchema } from "@backend/src/schema";
import { eq, desc } from "drizzle-orm";
import z from "zod";
import { SnapshotQueue } from "@elysia/lib/mq";
import { SnapshotQueue } from "@backend/lib/mq";
export const getVideoSnapshotsHandler = new Elysia({ prefix: "/video" }).get(
"/:id/snapshots",

View File

@ -1,19 +1,19 @@
import { Elysia, file } from "elysia";
import { getBindingInfo, logStartup } from "./startMessage";
import { pingHandler } from "@elysia/routes/ping";
import { pingHandler } from "@backend/routes/ping";
import openapi from "@elysiajs/openapi";
import { cors } from "@elysiajs/cors";
import { songInfoHandler } from "@elysia/routes/song/info";
import { rootHandler } from "@elysia/routes/root";
import { getVideoMetadataHandler } from "@elysia/routes/video/metadata";
import { closeMileStoneHandler } from "@elysia/routes/song/milestone";
import { authHandler } from "@elysia/routes/auth";
import { songInfoHandler } from "@backend/routes/song/info";
import { rootHandler } from "@backend/routes/root";
import { getVideoMetadataHandler } from "@backend/routes/video/metadata";
import { closeMileStoneHandler } from "@backend/routes/song/milestone";
import { authHandler } from "@backend/routes/auth";
import { onAfterHandler } from "./onAfterHandle";
import { searchHandler } from "@elysia/routes/search";
import { getVideoSnapshotsHandler } from "@elysia/routes/video/snapshots";
import { addSongHandler } from "@elysia/routes/song/add";
import { deleteSongHandler } from "@elysia/routes/song/delete";
import { songEtaHandler } from "@elysia/routes/video/eta";
import { searchHandler } from "@backend/routes/search";
import { getVideoSnapshotsHandler } from "@backend/routes/video/snapshots";
import { addSongHandler } from "@backend/routes/song/add";
import { deleteSongHandler } from "@backend/routes/song/delete";
import { songEtaHandler } from "@backend/routes/video/eta";
import "./mq";
const [host, port] = getBindingInfo();

View File

@ -11,7 +11,7 @@
"skipLibCheck": true,
"paths": {
"@core/*": ["../core/*"],
"@elysia/*": ["./*"],
"@backend/*": ["./*"],
"@crawler/*": ["../crawler/*"]
}
}

View File

@ -23,6 +23,8 @@ export function Layout({ children }: { children: React.ReactNode }) {
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
<link rel="manifest" href="/site.webmanifest" />
<title>V档案馆</title>
<Meta />
<Links />
@ -44,20 +46,20 @@ export default function App() {
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
let status = 0;
let details = "出错了!";
let stack: string | undefined;
if (isRouteErrorResponse(error)) {
status = error.status
status = error.status;
details = error.status === 404 ? "找不到页面" : error.statusText || details;
} else if (import.meta.env.DEV && error && error instanceof Error) {
details = error.message;
stack = error.stack;
}
return (
<ErrPage error={{
status: status || 500,
value: { message: details },
}} />
<ErrPage
error={{
status: status || 500,
value: { message: details },
}}
/>
);
}

View File

@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { treaty } from "@elysiajs/eden";
import type { App } from "@elysia/src";
import type { App } from "@backend/src";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Skeleton } from "@/components/ui/skeleton";
import { formatDateTime } from "@/components/SearchResults";

View File

@ -4,7 +4,7 @@ import { Input } from "@/components/ui/input";
import { useState } from "react";
import { useNavigate } from "react-router";
import { treaty } from "@elysiajs/eden";
import type { App } from "@elysia/src";
import type { App } from "@backend/src";
// @ts-expect-error anyway...
const app = treaty<App>(import.meta.env.VITE_API_URL!);

View File

@ -1,5 +1,5 @@
import { treaty } from "@elysiajs/eden";
import type { App } from "@elysia/src";
import type { App } from "@backend/src";
import { useEffect, useState } from "react";
import { Skeleton } from "@/components/ui/skeleton";
import { Error } from "@/components/Error";

View File

@ -1,6 +1,6 @@
import type { Route } from "./+types/add";
import { treaty } from "@elysiajs/eden";
import type { App } from "@elysia/src";
import type { App } from "@backend/src";
import { useEffect, useState } from "react";
import { Skeleton } from "@/components/ui/skeleton";
import { TriangleAlert, CheckCircle, Clock, AlertCircle } from "lucide-react";

View File

@ -1,6 +1,6 @@
import type { Route } from "./+types/index";
import { treaty } from "@elysiajs/eden";
import type { App } from "@elysia/src";
import type { App } from "@backend/src";
import { memo, useEffect, useState, useMemo } from "react";
import { Skeleton } from "@/components/ui/skeleton";
import { TriangleAlert } from "lucide-react";
@ -29,7 +29,7 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { av2bv } from "@elysia/lib/bilibiliID";
import { av2bv } from "@backend/lib/bilibiliID";
import { columns, type Snapshot } from "./columns";
import { HOUR } from "@core/lib";

View File

@ -1,6 +1,6 @@
import type { Route } from "./+types/index";
import { treaty } from "@elysiajs/eden";
import type { App } from "@elysia/src";
import type { App } from "@backend/src";
import { useEffect, useState } from "react";
import { Skeleton } from "@/components/ui/skeleton";
import { TriangleAlert } from "lucide-react";
@ -10,7 +10,7 @@ import { Error } from "@/components/Error";
import { Layout } from "@/components/Layout";
import { formatDateTime } from "@/components/SearchResults";
import { Button } from "@/components/ui/button";
import { av2bv } from "@elysia/lib/bilibiliID";
import { av2bv } from "@backend/lib/bilibiliID";
// @ts-ignore idk
const app = treaty<App>(import.meta.env.VITE_API_URL!);

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}

View File

@ -11,7 +11,7 @@
"baseUrl": ".",
"paths": {
"@/*": ["./app/*"],
"@elysia/*": ["../elysia/*"],
"@backend/*": ["../backend/*"],
"@core/*": ["../core/*"]
},
"esModuleInterop": true,