From 7aa988f0fea56a0becbd5131fc35276dfc93a1b1 Mon Sep 17 00:00:00 2001 From: alikia2x Date: Sun, 30 Mar 2025 19:07:02 +0800 Subject: [PATCH] fix: remove deno from building & previewing --- packages/frontend/deno.json | 7 +++++++ packages/frontend/main.ts | 7 +++++++ packages/frontend/src/pages/song/[id]/info.astro | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 packages/frontend/deno.json create mode 100644 packages/frontend/main.ts diff --git a/packages/frontend/deno.json b/packages/frontend/deno.json new file mode 100644 index 0000000..acc30c9 --- /dev/null +++ b/packages/frontend/deno.json @@ -0,0 +1,7 @@ +{ + "name": "@cvsa/frontend", + "tasks": { + "preview": "bun run astro preview" + }, + "exports": "./main.ts" +} diff --git a/packages/frontend/main.ts b/packages/frontend/main.ts new file mode 100644 index 0000000..f31ba12 --- /dev/null +++ b/packages/frontend/main.ts @@ -0,0 +1,7 @@ +// DENO ASK ME TO EXPORT SOMETHING WHEN 'name' IS SPECIFIED +// AND IF I DON'T SPECIFY 'name', THE --filter FLAG IN `deno task` WON'T WORK. +// I DONT'T KNOW WHY +// SO HERE'S A PLACHOLDER EXPORT FOR DENO: +export const DENO = "FUCK YOU DENO"; +// Oh, maybe export the version is a good idea +export const VERSION = "1.0.13"; diff --git a/packages/frontend/src/pages/song/[id]/info.astro b/packages/frontend/src/pages/song/[id]/info.astro index 6651ca3..f6fd40b 100644 --- a/packages/frontend/src/pages/song/[id]/info.astro +++ b/packages/frontend/src/pages/song/[id]/info.astro @@ -2,10 +2,23 @@ import Layout from "@layouts/Layout.astro"; import TitleBar from "@components/TitleBar.astro"; import pg from "pg"; -import { postgresConfig } from "@core/db/pgConfig.ts"; import { format } from 'date-fns'; import { zhCN } from 'date-fns/locale'; +const databaseHost = process.env.DB_HOST +const databaseName = process.env.DB_NAME +const databaseUser = process.env.DB_USER +const databasePassword = process.env.DB_PASSWORD +const databasePort = process.env.DB_PORT + +const postgresConfig = { + hostname: databaseHost, + port: parseInt(databasePort!), + database: databaseName, + user: databaseUser, + password: databasePassword, +}; + // 路由参数 const { id } = Astro.params; const { Client } = pg;