Introduce a schema-first validation layer and an AI blog generation feature, plus one-command Cloudflare provisioning. - src/schemas/ holds Zod input schemas for post, content, case, settings, AI, and keywords; parseForm() in src/lib/form.ts validates FormData and returns per-field errors. - Migrate all admin POST handlers to parseForm, showing field-level errors and only redirecting once validation passes. - Add blog_keywords table and posts.focus_keyword (migration 0002); uniqueSlug() centralised in src/data/content.ts. - Add src/lib/ai.ts (OpenAI-compatible chat completions + optional Tavily research) and /admin/ai for AI settings, keyword queue, and draft generation. - Add scripts/setup.mjs (npm run setup) to provision D1/KV, set secrets, and optionally migrate, seed, and deploy. - Document AI secrets, Workers Builds deploy flow, and new schemas across README and AGENTS docs.
47 lines
1.5 KiB
JSON
47 lines
1.5 KiB
JSON
{
|
|
"name": "cf-dash",
|
|
"private": true,
|
|
"version": "0.2.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "astro dev",
|
|
"build": "astro build",
|
|
"preview": "astro build && wrangler dev --port 8787",
|
|
"deploy": "astro build && wrangler deploy",
|
|
"astro": "astro",
|
|
"login": "wrangler login",
|
|
"db:create": "wrangler d1 create yingfung-solar-db",
|
|
"db:generate": "drizzle-kit generate",
|
|
"db:migrate": "wrangler d1 migrations apply yingfung-solar-db --remote",
|
|
"db:migrate:local": "wrangler d1 migrations apply yingfung-solar-db --local",
|
|
"db:seed": "wrangler d1 execute yingfung-solar-db --remote --file=./migrations/seed.sql",
|
|
"db:seed:local": "wrangler d1 execute yingfung-solar-db --local --file=./migrations/seed.sql",
|
|
"db:studio": "drizzle-kit studio",
|
|
"kv:create": "wrangler kv namespace create CACHE",
|
|
"secret": "wrangler secret put ADMIN_PASSWORD",
|
|
"types": "wrangler types",
|
|
"setup": "node scripts/setup.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@astrojs/cloudflare": "^14.3.1",
|
|
"@astrojs/react": "^6.0.5",
|
|
"@chakra-ui/react": "^3.37.0",
|
|
"@emotion/cache": "^11.14.0",
|
|
"@emotion/react": "^11.14.0",
|
|
"@emotion/server": "^11.11.0",
|
|
"astro": "^7.3.2",
|
|
"drizzle-orm": "^0.45.2",
|
|
"lucide-react": "^1.44.0",
|
|
"marked": "^18.0.12",
|
|
"react": "^19.3.0",
|
|
"react-dom": "^19.3.0",
|
|
"zod": "^4.6.2"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.20.2",
|
|
"drizzle-kit": "^0.31.10",
|
|
"typescript": "^7.0.2",
|
|
"wrangler": "^4.130.0"
|
|
}
|
|
}
|