- Added GameApiConfig interface and configuration resolver from environment variables. - Created GameApiContext for managing database and transport dependencies. - Implemented InMemoryTurnDaemonTransport for testing purposes. - Developed RedisTurnDaemonTransport for command and status handling via Redis streams. - Defined TurnDaemonStreamKeys for namespacing Redis streams by profile. - Established TRPC router with endpoints for health check, world state retrieval, and turn daemon commands (run, pause, resume, status). - Integrated Fastify server with TRPC and Redis transport. - Added unit tests for router functionality and stream key generation. - Configured Vitest for testing environment.
18 lines
408 B
TypeScript
18 lines
408 B
TypeScript
import path from 'node:path';
|
|
|
|
import { defineConfig } from 'vitest/config';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
tsconfigPaths({
|
|
projects: [path.resolve(__dirname, '../../tsconfig.paths.json')],
|
|
}),
|
|
],
|
|
test: {
|
|
environment: 'node',
|
|
globals: true,
|
|
include: ['test/**/*.test.ts'],
|
|
},
|
|
});
|