Files
pkgsp50777_楊舒諠andClaude Opus 5.5 6a6a1806ba setup-project-foundation: backup, CI, e2e split, CLAUDE.md
- npm run backup: SQLite online backup + attachments copy, keep last
  BACKUP_KEEP (default 14), atomic via temp dir; tests included
- docs/operations/backup.md: schedule, restore steps, single-instance
  limits (restore verified once against a scratch copy)
- .github/workflows/ci.yml: npm ci, lint, format:check, typecheck, test
- e2e: test:e2e:prepare (build + reset/migrate/seed e2e DB) and
  test:e2e (next start only); shared env in tests/e2e/env.ts;
  PLAYWRIGHT_CHANNEL to use the installed Chrome/Edge
- CLAUDE.md: commands, code layout, domain import rule
- Prettier fix in transaction.test.ts

Tasks 6.1-7.2 done. 5.2 pending: the home test passes, but Playwright
hangs on Chrome profile cleanup in this environment; to be verified in
a normal terminal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 19:01:04 +08:00

14 lines
610 B
TypeScript

import { execSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";
import { e2eEnv } from "../tests/e2e/env";
// 準備 e2e 環境:重建測試資料庫並產生正式建置。程式有改動時才需要重跑;
// 之後 `npm run test:e2e` 只會啟動 next start,不再 build。
Object.assign(process.env, e2eEnv);
fs.rmSync(path.dirname(path.resolve(e2eEnv.DATABASE_PATH)), { recursive: true, force: true });
execSync("npx next build", { stdio: "inherit" });
execSync("npm run db:migrate", { stdio: "inherit" });
execSync("npm run db:seed", { stdio: "inherit" });