Skip to content

Commit 05d1746

Browse files
Fixing quality checks
1 parent f66a85c commit 05d1746

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

mcp-server/vitest.setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
* Uses shared test setup utilities to ensure consistent database setup
55
*/
66

7-
// Removed unused 'vi' import (lint)
8-
import { setupStandardTestDatabase } from '@turn-based-mcp/shared/dist/testing/vitest-setup.js'
7+
import { setupStandardTestDatabase } from '@turn-based-mcp/shared/testing'
98

109
// Setup standard test database using shared utility
1110
setupStandardTestDatabase()

shared/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
"type": "module",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.js",
11+
"types": "./dist/index.d.ts"
12+
},
13+
"./testing": {
14+
"import": "./dist/testing/index.js",
15+
"types": "./dist/testing/index.d.ts"
16+
},
17+
"./constants": {
18+
"import": "./dist/constants/index.js",
19+
"types": "./dist/constants/index.d.ts"
20+
}
21+
},
822
"scripts": {
923
"build": "tsc && fix-esm-import-path dist",
1024
"dev": "tsc --watch",

shared/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ export * from './games/index';
44
export * from './utils/index';
55
export * from './storage/index';
66
export * from './constants/index';
7-
export * from './testing/index';

web/src/components/shared/DifficultyBadge.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import React from 'react'
77
import { render, screen } from '@testing-library/react'
88
import { DifficultyBadge } from './DifficultyBadge'
99

10-
// Mock the shared library constants
11-
vi.mock('@turn-based-mcp/shared/dist/constants/game-constants', () => ({
10+
vi.mock('@turn-based-mcp/shared/constants', () => ({
1211
getDifficultyDisplay: vi.fn((difficulty: string) => {
1312
const displays: Record<string, { emoji: string; label: string }> = {
1413
easy: { emoji: '😌', label: 'Easy' },

web/src/components/shared/DifficultyBadge.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client'
22

3-
import { getDifficultyDisplay } from '@turn-based-mcp/shared/dist/constants/game-constants'
4-
import type { Difficulty } from '@turn-based-mcp/shared/dist/types/game'
3+
import { getDifficultyDisplay, type Difficulty } from '@turn-based-mcp/shared/constants'
54

65
/**
76
* Props for the DifficultyBadge component

web/src/test-utils/api-route-mocks.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
import { vi } from 'vitest'
99
import { NextRequest } from 'next/server'
1010
import type { GameType } from '@turn-based-mcp/shared'
11-
import {
12-
createSharedGameMocks,
11+
12+
import {
13+
createSharedGameMocks,
1314
createStorageMocks,
1415
createMockTicTacToeGameState,
1516
createMockRPSGameState,
1617
createMockGameSession
17-
} from '@turn-based-mcp/shared'
18+
} from '@turn-based-mcp/shared/testing'
1819

1920
/**
2021
* Setup standard API route mocks for a specific game type

web/vitest.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { vi } from 'vitest'
33
import '@testing-library/jest-dom'
44

55
// Use shared test database setup
6-
import { setupStandardTestDatabase } from '@turn-based-mcp/shared/dist/testing/vitest-setup.js'
6+
import { setupStandardTestDatabase } from '@turn-based-mcp/shared/testing'
77

88
// Setup standard test database using shared utility
99
setupStandardTestDatabase()

0 commit comments

Comments
 (0)