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,14 +1,14 @@
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: {
payment: {
findMany: vi.fn(),
count: vi.fn(),
findMany: mock(),
count: mock(),
},
},
getPrismaClient: vi.fn(),
getPrismaClient: mock(),
UnitOfWork: class {},
}));
@@ -37,8 +37,8 @@ describe('payments routes', () => {
});
it('lists payments with pagination and converts Decimal amounts', async () => {
vi.mocked(prisma.payment.findMany).mockResolvedValue([payment]);
vi.mocked(prisma.payment.count).mockResolvedValue(1);
prisma.payment.findMany.mockResolvedValue([payment]);
prisma.payment.count.mockResolvedValue(1);
const res = await app.request('/payments');