diff --git a/bun.lockb b/bun.lockb index 3265e485c..5027d45e2 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 854a8e63a..92eb0b6eb 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,13 @@ "build:assets": "bun --filter=@blitzkit/scripts run build:assets", "build:averages": "bun --filter=@blitzkit/scripts run build:averages", "build:bot": "rm -rf dist/bot && mkdir -p dist/bot/prisma && bun build src/index.ts src/workers/bot.ts src/workers/render.ts --outdir dist/bot --target=bun --splitting --sourcemap=inline --external sharp && cp -R src/lang dist/bot/lang && prisma generate && cp prisma/schema.prisma dist/bot/prisma/schema.prisma && cp -R node_modules/prisma/*.node dist/bot/prisma && cd dist/bot && bun init -y && bun add sharp", - "build:website": "prisma generate && cd packages/website && bun run build && cd ../..", + "build:website": "prisma generate && cd packages/website && bun run build", "build:sitemap": "bun scripts/sitemap.ts", "build:docs": "vitepress build docs", "build:ratingleaderboard": "bun --script scripts/buildRatingLeaderboard.ts", "dev:bot": "bun build:bot && bun start:bot", "dev:docs": "vitepress dev docs", - "dev:website": "cd packages/website && bun run dev && cd ../..", + "dev:website": "cd packages/website && bun run dev", "dev:api": "bun --filter=@blitzkit/api run dev", "start:bot": "bun dist/bot/index.js", "start:website": "bun --filter=@blitzkit/website run start", @@ -29,7 +29,8 @@ "update": "yarn upgrade --latest", "tunnel": "cloudflared tunnel --url http://localhost:3000", "discoverids": "scripts/discoverIds.ts", - "build:protos": "bun packages/scripts/src/protos.ts" + "build:protos": "bun packages/scripts/src/protos.ts", + "preview:website": "cd packages/website && bun run preview" }, "license": "MIT", "dependencies": { diff --git a/packages/website/.gitignore b/packages/website/.gitignore index 16d54bb13..5fea4397f 100644 --- a/packages/website/.gitignore +++ b/packages/website/.gitignore @@ -12,7 +12,6 @@ yarn-debug.log* yarn-error.log* pnpm-debug.log* - # environment variables .env .env.production @@ -22,3 +21,4 @@ pnpm-debug.log* # jetbrains setting folder .idea/ +.vercel/ diff --git a/packages/website/astro.config.mjs b/packages/website/astro.config.mjs index 71d69098d..c0792cf8b 100644 --- a/packages/website/astro.config.mjs +++ b/packages/website/astro.config.mjs @@ -1,10 +1,15 @@ // @ts-check import react from '@astrojs/react'; +import vercel from '@astrojs/vercel/serverless'; import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; import { defineConfig } from 'astro/config'; export default defineConfig({ + devToolbar: { enabled: false }, + output: 'hybrid', + adapter: vercel(), + integrations: [react()], vite: { plugins: [vanillaExtractPlugin()], @@ -15,7 +20,4 @@ export default defineConfig({ }, }, }, - - devToolbar: { enabled: false }, - outDir: '../../dist/website', }); diff --git a/packages/website/package.json b/packages/website/package.json index d1ca28212..8cbda1602 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -10,8 +10,6 @@ "astro": "astro" }, "dependencies": { - "@astrojs/check": "^0.9.3", - "@astrojs/react": "^3.6.2", "@blitzkit/core": "workspace:*", "@nanostores/persistent": "^0.10.2", "@nanostores/react": "^0.7.3", @@ -22,12 +20,10 @@ "@react-three/fiber": "^8.17.6", "@vanilla-extract/css": "^1.15.5", "@vanilla-extract/dynamic": "^2.1.2", - "astro": "^4.15.6", "compare-versions": "^6.1.1", "immer": "^10.1.1", "markdown-to-jsx": "^7.5.0", "nanostores": "^0.11.3", - "purgecss": "^6.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-promise-suspense": "^0.3.4", @@ -35,9 +31,13 @@ "zustand": "^4.5.5" }, "devDependencies": { + "@astrojs/check": "^0.9.3", + "@astrojs/react": "^3.6.2", + "@astrojs/vercel": "^7.8.1", + "@types/react": "^18.3.5", + "@types/react-dom": "^18", "@types/three": "^0.160.0", "@vanilla-extract/vite-plugin": "^4.0.15", - "@types/react-dom": "^18", - "@types/react": "^18.3.5" + "astro": "^4.15.6" } } diff --git a/packages/website/src/layouts/ToolLayout.astro b/packages/website/src/layouts/ToolLayout.astro index 56e8de8aa..1457a2ccc 100644 --- a/packages/website/src/layouts/ToolLayout.astro +++ b/packages/website/src/layouts/ToolLayout.astro @@ -13,52 +13,41 @@ const tool = TOOLS.find((tool) => tool.id === toolId); { - tool && ( + tool && isToolRoot && ( <> - {isToolRoot && ( - <> - {tool.title} - + {tool.title} + - {tool.pageDescription !== undefined && ( - <> - - - - )} + {tool.pageDescription !== undefined && ( + <> + + )} - - ) - } - { - pathSplit.length === 3 && ( - - - {tool?.title} - {tool?.description} - - + + {tool?.title} + {tool?.description} + + + ) } diff --git a/packages/website/src/pages/api/patreon/membership/index.ts b/packages/website/src/pages/api/patreon/membership/index.ts new file mode 100644 index 000000000..baa8e5611 --- /dev/null +++ b/packages/website/src/pages/api/patreon/membership/index.ts @@ -0,0 +1,7 @@ +import type { APIContext } from 'astro'; + +export const prerender = false; + +export async function GET({}: APIContext) { + return Response.json({ hello: 'world' }); +}