chore: scaffold monorepo and migrate uhd_web design system (W0-A)
- pnpm workspace: apps/{web,server}, packages/{contracts,db,domain,adapters,tasks,agent,testkit}
- server: Hono + zod-openapi, API Key auth with scopes, redacting pino logger, SSE event bus with replay, worker heartbeat
- db: Kysely + pg, file migrator, 0001_init (settings/api_key/audit_event/outbox_event)
- web: React Router 7 SPA console shell with 12 workspace placeholders, uhd_web tokens/ui/guard scripts
- docs: ADR-001 (Node over Deno), dev runbook, design system rules
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
commit
b22c440139
138 files changed
+14455
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { json, testApp } from "./helpers";
|
||||
|
||||
describe("GET /api/v1/health", () => {
|
||||
it("免鉴权返回 ok 信封", async () => {
|
||||
const { app } = testApp();
|
||||
const res = await app.request("/api/v1/health");
|
||||
expect(res.status).toBe(200);
|
||||
const body = await json(res);
|
||||
expect(body.ok).toBe(true);
|
||||
expect(body.data.status).toBe("ok");
|
||||
expect(body.data.db).toBe("unknown");
|
||||
expect(body.data.role).toBe("all");
|
||||
});
|
||||
|
||||
it("未知路由返回 not_found 信封", async () => {
|
||||
const { app } = testApp();
|
||||
const res = await app.request("/nope");
|
||||
expect(res.status).toBe(404);
|
||||
expect((await json(res)).error.code).toBe("not_found");
|
||||
});
|
||||
|
||||
it("OpenAPI 文档包含 health", async () => {
|
||||
const { app } = testApp();
|
||||
const doc = await json(await app.request("/api/openapi.json"));
|
||||
expect(doc.paths["/api/v1/health"]).toBeDefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user