Files
zpan/server/entry-vercel.ts
T
Jasper VanandBob 5593eec3ce feat: v2.5.0 T3 — Vercel deployment (entry + vercel.json + workflow + docs) (#328)
* feat: add Vercel deployment target (Node runtime + Turso)

Adds first-class Vercel support: server/entry-vercel.ts using hono/vercel
handler, deploy/vercel/vercel.json with nodejs22.x function config and SPA
rewrites, build:vercel npm script producing api/entry-vercel.js + dist/,
deploy-vercel GitHub Actions workflow (8-step: secrets check, tag resolve,
checkout, install, migrate, build, link, deploy), and docs/deploy/vercel.md
documenting secrets, quick-start, local dev, and pricing notes.

Edge runtime is explicitly not used — @aws-sdk/client-s3 requires Node APIs.

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

* fix: auto-generate BETTER_AUTH_SECRET on first Vercel deploy

Remove BETTER_AUTH_SECRET from the required secrets check. Add a
dedicated step that detects whether the secret already exists in the
Vercel project env via `vercel env ls production`, then either upserts
the user-supplied GitHub secret, auto-generates one with openssl on
first deploy, or skips if already present. Auto-generation case appends
a backup warning to GITHUB_STEP_SUMMARY. Docs move BETTER_AUTH_SECRET
to Optional Secrets with a note about the auto-gen behaviour.

Matches the existing CF Workers deploy.yml pattern (step 8 contract).

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

---------

Co-authored-by: Bob <aibob@mails.agent-kanban.dev>
2026-04-22 01:14:54 -04:00

22 lines
622 B
TypeScript

import { handle } from 'hono/vercel'
import { createBootstrap } from './bootstrap'
import { createLibsqlPlatform } from './platform/libsql'
const tursoUrl = process.env.TURSO_DATABASE_URL
if (!tursoUrl) {
throw new Error('TURSO_DATABASE_URL is required for Vercel deployment.')
}
const platform = await createLibsqlPlatform({
TURSO_DATABASE_URL: tursoUrl,
TURSO_AUTH_TOKEN: process.env.TURSO_AUTH_TOKEN,
})
const app = await createBootstrap(platform)
export const GET = handle(app)
export const POST = handle(app)
export const PUT = handle(app)
export const PATCH = handle(app)
export const DELETE = handle(app)