setup swc

This commit is contained in:
olehhapuk
2026-12-01 12:22:44 +02:00
parent ebf6ec2e39
commit f8de87955b
19 changed files with 1302 additions and 164 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ Validation works with Zod, Valibot, ArkType or any other Standard Schema library
A route handler can return a web `Response`, a `ReadableStream` or an async generator, and Nest streams it as it's produced (https://docs.nestjs.com/http/streaming-responses.md).
Nest's packages are ESM only, and this project is ESM too: relative imports end in `.js`, `__dirname` doesn't exist (use `import.meta.dirname`), and tests run on Vitest, so mocks are `vi.fn()`, not `jest.fn()`.
Nest's packages are ESM only, and this project is ESM too: relative imports are written without a file extension (the SWC build adds `.js`; `nest generate` still writes `.js`, which works but should be trimmed to match), `__dirname` doesn't exist (use `import.meta.dirname`), and tests run on Vitest, so mocks are `vi.fn()`, not `jest.fn()`.
In this project, `src/main.ts` creates the app and listens on `PORT` (3000 by default), `src/app.module.ts` is the root module that imports the others, and `AppController` and `AppService` are samples. Unit tests sit beside the code as `*.spec.ts` and the e2e test is in `test/`; Vitest runs them (`npm test`, `npm run test:e2e`).