refactor: migrate monorepo from pnpm to Bun runtime and workspaces

- root: bun workspaces via package.json, packageManager bun@1.4.0, scripts use bun --filter
- backend: Bun.serve, bun test (vitest removed), bun --watch dev script, tsconfig types bun
- tests: migrate 6 test files from vitest to bun:test (mock.module)
- validate: replace @hono/zod-validator with hono validator + zod safeParse (fixes TS2589)
- lockfile: bunfig.toml saveTextLockfile, regenerated bun.lock (text) for turbo
- docs: AGENTS.md, README.md, stack.md updated to Bun stack
This commit is contained in:
Jose Selesan
2026-09-14 10:58:56 -03:00
parent 4b1f356fab
commit 6246bf2341
21 changed files with 1125 additions and 4936 deletions

View File

@@ -1,11 +1,11 @@
import { beforeEach, describe, expect, it, mock, vi } from 'bun:test';
import { Hono } from 'hono';
import { beforeEach, describe, expect, it, vi } from 'vitest';
vi.mock('@/lib/prisma', () => ({
mock.module('@/lib/prisma', () => ({
default: {
$queryRaw: vi.fn(),
$queryRaw: mock(),
},
getPrismaClient: vi.fn(),
getPrismaClient: mock(),
UnitOfWork: class {},
}));
@@ -21,7 +21,7 @@ describe('health check routes', () => {
});
it('reports ok when the database answers', async () => {
vi.mocked(prisma.$queryRaw).mockResolvedValue([{ '?column?': 1 }]);
prisma.$queryRaw.mockResolvedValue([{ '?column?': 1 }]);
const res = await app.request('/health');
@@ -32,7 +32,7 @@ describe('health check routes', () => {
});
it('reports degraded when the database is unreachable', async () => {
vi.mocked(prisma.$queryRaw).mockRejectedValue(new Error('connection refused'));
prisma.$queryRaw.mockRejectedValue(new Error('connection refused'));
const res = await app.request('/health');