mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: vercel adapter
This commit is contained in:
1 parent
53662c1174
commit
e52063c12d
7 files changed
+50
-51
No files matched your search
+4
-3
@@ -12,13 +12,13 @@
|
|||||||
"build:assets": "bun --filter=@blitzkit/scripts run build:assets",
|
"build:assets": "bun --filter=@blitzkit/scripts run build:assets",
|
||||||
"build:averages": "bun --filter=@blitzkit/scripts run build:averages",
|
"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: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:sitemap": "bun scripts/sitemap.ts",
|
||||||
"build:docs": "vitepress build docs",
|
"build:docs": "vitepress build docs",
|
||||||
"build:ratingleaderboard": "bun --script scripts/buildRatingLeaderboard.ts",
|
"build:ratingleaderboard": "bun --script scripts/buildRatingLeaderboard.ts",
|
||||||
"dev:bot": "bun build:bot && bun start:bot",
|
"dev:bot": "bun build:bot && bun start:bot",
|
||||||
"dev:docs": "vitepress dev docs",
|
"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",
|
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||||
"start:bot": "bun dist/bot/index.js",
|
"start:bot": "bun dist/bot/index.js",
|
||||||
"start:website": "bun --filter=@blitzkit/website run start",
|
"start:website": "bun --filter=@blitzkit/website run start",
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"update": "yarn upgrade --latest",
|
"update": "yarn upgrade --latest",
|
||||||
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
"tunnel": "cloudflared tunnel --url http://localhost:3000",
|
||||||
"discoverids": "scripts/discoverIds.ts",
|
"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",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ yarn-debug.log*
|
|||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
.env
|
.env
|
||||||
.env.production
|
.env.production
|
||||||
@@ -22,3 +21,4 @@ pnpm-debug.log*
|
|||||||
|
|
||||||
# jetbrains setting folder
|
# jetbrains setting folder
|
||||||
.idea/
|
.idea/
|
||||||
|
.vercel/
|
||||||
@@ -1,10 +1,15 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
import react from '@astrojs/react';
|
import react from '@astrojs/react';
|
||||||
|
import vercel from '@astrojs/vercel/serverless';
|
||||||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
devToolbar: { enabled: false },
|
||||||
|
output: 'hybrid',
|
||||||
|
adapter: vercel(),
|
||||||
|
|
||||||
integrations: [react()],
|
integrations: [react()],
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [vanillaExtractPlugin()],
|
plugins: [vanillaExtractPlugin()],
|
||||||
@@ -15,7 +20,4 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
devToolbar: { enabled: false },
|
|
||||||
outDir: '../../dist/website',
|
|
||||||
});
|
});
|
||||||
@@ -10,8 +10,6 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.9.3",
|
|
||||||
"@astrojs/react": "^3.6.2",
|
|
||||||
"@blitzkit/core": "workspace:*",
|
"@blitzkit/core": "workspace:*",
|
||||||
"@nanostores/persistent": "^0.10.2",
|
"@nanostores/persistent": "^0.10.2",
|
||||||
"@nanostores/react": "^0.7.3",
|
"@nanostores/react": "^0.7.3",
|
||||||
@@ -22,12 +20,10 @@
|
|||||||
"@react-three/fiber": "^8.17.6",
|
"@react-three/fiber": "^8.17.6",
|
||||||
"@vanilla-extract/css": "^1.15.5",
|
"@vanilla-extract/css": "^1.15.5",
|
||||||
"@vanilla-extract/dynamic": "^2.1.2",
|
"@vanilla-extract/dynamic": "^2.1.2",
|
||||||
"astro": "^4.15.6",
|
|
||||||
"compare-versions": "^6.1.1",
|
"compare-versions": "^6.1.1",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
"markdown-to-jsx": "^7.5.0",
|
"markdown-to-jsx": "^7.5.0",
|
||||||
"nanostores": "^0.11.3",
|
"nanostores": "^0.11.3",
|
||||||
"purgecss": "^6.0.0",
|
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-promise-suspense": "^0.3.4",
|
"react-promise-suspense": "^0.3.4",
|
||||||
@@ -35,9 +31,13 @@
|
|||||||
"zustand": "^4.5.5"
|
"zustand": "^4.5.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"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",
|
"@types/three": "^0.160.0",
|
||||||
"@vanilla-extract/vite-plugin": "^4.0.15",
|
"@vanilla-extract/vite-plugin": "^4.0.15",
|
||||||
"@types/react-dom": "^18",
|
"astro": "^4.15.6"
|
||||||
"@types/react": "^18.3.5"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,52 +13,41 @@ const tool = TOOLS.find((tool) => tool.id === toolId);
|
|||||||
|
|
||||||
<RootLayout>
|
<RootLayout>
|
||||||
{
|
{
|
||||||
tool && (
|
tool && isToolRoot && (
|
||||||
<>
|
<>
|
||||||
{isToolRoot && (
|
<title>{tool.title}</title>
|
||||||
<>
|
<meta property="og:image" content={imgur(tool.image)} />
|
||||||
<title>{tool.title}</title>
|
|
||||||
<meta property="og:image" content={imgur(tool.image)} />
|
|
||||||
|
|
||||||
{tool.pageDescription !== undefined && (
|
{tool.pageDescription !== undefined && (
|
||||||
<>
|
<>
|
||||||
<meta name="description" content={tool.pageDescription} />
|
<meta name="description" content={tool.pageDescription} />
|
||||||
<meta
|
<meta property="og:description" content={tool.pageDescription} />
|
||||||
property="og:description"
|
|
||||||
content={tool.pageDescription}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
<Box
|
||||||
pathSplit.length === 3 && (
|
|
||||||
<Box
|
|
||||||
style={{
|
|
||||||
backgroundImage: `url(${imgur(tool!.image, {
|
|
||||||
format: 'jpeg',
|
|
||||||
size: ImgurSize.SmallThumbnail,
|
|
||||||
})})`,
|
|
||||||
backgroundSize: 'cover',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Flex
|
|
||||||
direction="column"
|
|
||||||
align="center"
|
|
||||||
py="6"
|
|
||||||
style={{
|
style={{
|
||||||
backdropFilter: 'blur(4rem)',
|
backgroundImage: `url(${imgur(tool!.image, {
|
||||||
WebkitBackdropFilter: 'blur(4rem)',
|
format: 'jpeg',
|
||||||
|
size: ImgurSize.SmallThumbnail,
|
||||||
|
})})`,
|
||||||
|
backgroundSize: 'cover',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Heading size="7">{tool?.title}</Heading>
|
<Flex
|
||||||
<Text>{tool?.description}</Text>
|
direction="column"
|
||||||
</Flex>
|
align="center"
|
||||||
</Box>
|
py="6"
|
||||||
|
style={{
|
||||||
|
backdropFilter: 'blur(4rem)',
|
||||||
|
WebkitBackdropFilter: 'blur(4rem)',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Heading size="7">{tool?.title}</Heading>
|
||||||
|
<Text>{tool?.description}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import type { APIContext } from 'astro';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
|
export async function GET({}: APIContext) {
|
||||||
|
return Response.json({ hello: 'world' });
|
||||||
|
}
|
||||||
Reference in new issue
Block a user