Files
zpan/package.json
T
Jasper VanandBob d33800f23e feat: Azure Functions deployment target (v4, Node 22) (#330)
* feat: add Azure Functions deployment target (v4, Node 22)

- server/entry-azure.ts: Azure Functions v4 handler wrapping the Hono
  app via app.http(); uses createLibsqlPlatform for Turso and serves
  the SPA from ./dist via @hono/node-server/serve-static
- server/azure-host.json: runtime manifest (extensionBundle v4)
- deploy/azure-functions/main.bicep: idempotent Bicep template
  provisioning Storage Account, Consumption plan and Function App;
  BETTER_AUTH_SECRET handled separately by the workflow
- .github/workflows/deploy-azure.yml: 8-step workflow (secret check,
  checkout, Node setup, az login, Bicep deploy, build, db:migrate,
  func publish) with BETTER_AUTH_SECRET generate-if-missing logic
- package.json: build:azure script + @azure/functions dependency
- docs/deploy/azure-functions.md: setup guide covering SP JSON format,
  required secrets, and local emulation with func start

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

* fix: address review issues in Azure Functions deploy

- Move BETTER_AUTH_SECRET and APP_URL setup to before func publish
  (bootstrap.ts throws on missing secret; any request between publish
  and the old secret-set step would have returned 500)
- Remove placeholder appUrl Bicep param; workflow sets APP_URL and
  BETTER_AUTH_URL via appsettings after Bicep, before publish
- Fix HttpRequest→Request body handling: construct a proper Web API
  Request with body cast and duplex option instead of double-casting
  HttpRequest, ensuring POST/PUT/PATCH body-reading routes work
- Add push: branches: [master] trigger + upstream guard to match other
  deploy workflow conventions; document the auto-deploy behaviour
- Update docs/deploy/azure-functions.md to reflect the push trigger

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

* ci: re-trigger CI for review fixes

---------

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

137 lines
5.2 KiB
JSON

{
"name": "zpan",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "CLOUDFLARE_ENV=staging vite dev",
"dev:node": "node --env-file=.dev.vars node_modules/vite/bin/vite.js dev --mode node",
"build": "[ \"$WORKERS_CI\" = \"1\" ] && [ \"$WORKERS_CI_BRANCH\" != \"master\" ] && export CLOUDFLARE_ENV=staging; vite build",
"build:node": "vite build --mode node && tsup server/entry-node.ts --format esm --outDir dist-server --external better-sqlite3 --external @libsql/client",
"build:lambda": "tsup server/entry-lambda.ts --format cjs --outDir dist-lambda --external @libsql/client",
"build:vercel": "vite build --mode node && tsup server/entry-vercel.ts --format esm --outDir api --external @libsql/client",
"build:netlify": "tsup server/entry-netlify.ts --format esm --outDir netlify/functions --external @libsql/client",
"build:azure": "vite build && tsup server/entry-azure.ts --format esm --outDir azure-functions --external @azure/functions --external @libsql/client && cp server/azure-host.json azure-functions/host.json && cp -r dist azure-functions/dist",
"deploy": "npm run db:migrate:d1:prod && wrangler deploy",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:migrate:d1": "wrangler d1 migrations apply zpan-db-staging --local --env staging",
"db:migrate:d1:staging": "wrangler d1 migrations apply zpan-db-staging --remote --env staging",
"db:migrate:d1:prod": "wrangler d1 migrations apply zpan-db --remote",
"db:reset": "tsx --env-file=.dev.vars scripts/db-reset.ts",
"db:reset:d1": "tsx --env-file=.dev.vars scripts/db-reset.ts --d1",
"typecheck": "tsc --noEmit -p tsconfig.server.json && tsc --noEmit -p tsconfig.web.json",
"test": "vitest run",
"test:cf": "vitest run --config vitest.cloudflare.config.ts",
"test:libsql": "vitest run --config vitest.libsql.config.ts",
"test:watch": "vitest",
"lint": "biome check .",
"lint:fix": "biome check --write .",
"prepare": "husky",
"format": "biome format --write .",
"e2e": "playwright test"
},
"engines": {
"node": ">=24"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.1022.0",
"@aws-sdk/s3-request-presigner": "^3.1022.0",
"@azure/functions": "^4.12.0",
"@better-auth/api-key": "^1.6.2",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@hono/node-server": "^1.13.0",
"@hono/zod-validator": "^0.7.6",
"@hookform/resolvers": "^5.2.2",
"@libsql/client": "^0.17.2",
"@opentelemetry/api": "^1.9.1",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.0",
"@radix-ui/react-dropdown-menu": "^2.1.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.0",
"@tanstack/react-query": "^5.62.0",
"@tanstack/react-router": "^1.93.0",
"@tanstack/react-table": "^8.21.3",
"@vidstack/react": "^1.12.13",
"better-auth": "^1.6.2",
"better-sqlite3": "^11.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"drizzle-orm": "^0.45.2",
"hono": "^4.12.14",
"i18next": "^26.0.3",
"i18next-browser-languagedetector": "^8.2.1",
"lucide-react": "^0.469.0",
"nanoid": "^5.1.0",
"next-themes": "^0.4.6",
"nodemailer": "^8.0.5",
"pdfjs-dist": "^5.6.205",
"radix-ui": "^1.4.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-dropzone": "^15.0.0",
"react-hook-form": "^7.54.0",
"react-i18next": "^17.0.2",
"react-markdown": "^10.1.0",
"react-pdf": "^10.4.1",
"remark-gfm": "^4.0.1",
"shiki": "^4.0.2",
"sonner": "^1.7.0",
"tailwind-merge": "^2.6.0",
"yet-another-react-lightbox": "^3.30.1",
"zod": "^3.24.0"
},
"devDependencies": {
"@biomejs/biome": "^2.4.10",
"@cloudflare/vite-plugin": "^1.31.2",
"@cloudflare/vitest-pool-workers": "^0.14.0",
"@cloudflare/workers-types": "^4.20260401.1",
"@hono/vite-dev-server": "^0.25.1",
"@playwright/test": "1.58.2",
"@tailwindcss/vite": "^4.2.2",
"@tanstack/router-plugin": "^1.167.12",
"@testing-library/dom": "^10.4.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/better-sqlite3": "^7.6.0",
"@types/nodemailer": "^8.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react-swc": "^4.3.0",
"@vitest/coverage-v8": "^4.1.2",
"drizzle-kit": "^0.31.10",
"husky": "^9.1.7",
"jsdom": "^29.0.2",
"lint-staged": "^16.4.0",
"tailwindcss": "^4.1.0",
"tsup": "^8.0.0",
"tsx": "^4.0.0",
"tw-animate-css": "^1.4.0",
"typescript": "^5.7.0",
"vite": "^7.3.2",
"vitest": "^4.1.2",
"wrangler": "^4.0.0"
},
"cloudflare": {
"bindings": {
"BETTER_AUTH_SECRET": {
"description": "Signing secret for auth sessions. Generate with: `openssl rand -base64 32`"
},
"DB": {
"description": "D1 database for storing users, files, and settings"
}
}
},
"lint-staged": {
"*.{ts,tsx,js,jsx,json,jsonc}": "biome check --write --no-errors-on-unmatched"
},
"volta": {
"node": "24.14.1"
}
}