From e53b28f7771f6a095d6a13033a7dc3df0a6d7276 Mon Sep 17 00:00:00 2001 From: MotorTruck1221 Date: Mon, 5 May 2025 00:16:07 -0600 Subject: [PATCH] Format --- package.json | 3 ++- server/index.ts | 30 +++++++++++++++++++----------- src/layouts/Layout.astro | 14 +++++--------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 7f4c0cb..0eeef01 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build": "npm run build:server & npm run build:client", "start": "node server/index.js", "bstart": "npm run build && npm run start", - "astro": "astro" + "astro": "astro", + "format": "biome format --write ." }, "dependencies": { "@astrojs/check": "^0.9.4", diff --git a/server/index.ts b/server/index.ts index 2353863..c5f354e 100644 --- a/server/index.ts +++ b/server/index.ts @@ -1,4 +1,10 @@ -import Fastify, { FastifyReply, FastifyRequest, FastifyServerFactory, FastifyServerFactoryHandler, RawServerDefault } from "fastify"; +import Fastify, { + FastifyReply, + FastifyRequest, + FastifyServerFactory, + FastifyServerFactoryHandler, + RawServerDefault +} from "fastify"; import fastifyMiddie from "@fastify/middie"; import fastifyStatic from "@fastify/static"; import { fileURLToPath } from "node:url"; @@ -9,17 +15,19 @@ import { handler as astroHandler } from "../dist/server/entry.mjs"; import { createServer } from "node:http"; import { Socket } from "node:net"; -const serverFactory: FastifyServerFactory = ( handler: FastifyServerFactoryHandler): RawServerDefault => { +const serverFactory: FastifyServerFactory = ( + handler: FastifyServerFactoryHandler +): RawServerDefault => { return createServer() - .on('request', (req, res) => { - handler(req, res); - }) - .on('upgrade', (req, socket, head) => { - if (req.url?.endsWith('/wisp/')) { - wisp.routeRequest(req, socket as Socket, head); - } - }) -} + .on("request", (req, res) => { + handler(req, res); + }) + .on("upgrade", (req, socket, head) => { + if (req.url?.endsWith("/wisp/")) { + wisp.routeRequest(req, socket as Socket, head); + } + }); +}; const app = Fastify({ logger: false, diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 0bc50ae..2314304 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -8,15 +8,11 @@ import Header from "@components/Header.astro"; import "@styles/global.css"; import "@styles/default.css"; -readdir( - pathJoin("src", "styles", "themes"), - { encoding: "utf-8" }, - (err, files) => { - files.forEach(async (name) => { - await import(`../styles/themes/${name.replace(".css", "")}.css`); - }); - } -); +readdir(pathJoin("src", "styles", "themes"), { encoding: "utf-8" }, (err, files) => { + files.forEach(async (name) => { + await import(`../styles/themes/${name.replace(".css", "")}.css`); + }); +}); ---