Skip to content

Commit e90c53d

Browse files
committed
refactor(mcp): use absolute path aliases for contract markers
To comply with project mandates, all relative paths in source and test code have been replaced with absolute path aliases (@/). Vitest configurations were updated to resolve these aliases during testing.
1 parent 17e5ff7 commit e90c53d

4 files changed

Lines changed: 14 additions & 24 deletions

File tree

packages/mcp-server/src/mcp-content-builders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { TextContent } from "@modelcontextprotocol/sdk/shared/messages.js";
1515
import {
1616
MARKER_PATTERN_CARD_V1,
1717
MARKER_PATTERN_INDEX_V1,
18-
} from "./constants/markers.js";
18+
} from "@/constants/markers.js";
1919

2020
/**
2121
* MCP 2.0 Annotation structure

packages/mcp-server/tests/mcp-protocol/local.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { getMCPEnvironmentConfig } from "../../src/config/mcp-environments";
2222
import {
2323
MARKER_PATTERN_CARD_V1,
2424
MARKER_PATTERN_INDEX_V1,
25-
} from "../../src/constants/markers";
25+
} from "@/constants/markers";
2626

2727
function extractContentText(
2828
content: Array<{ type: string; text?: string }> | { type: string; text?: string }
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
11
import { defineConfig } from "vitest/config";
2+
import path from "path";
23

34
export default defineConfig({
45
test: {
56
globals: true,
67
environment: "node",
78
setupFiles: ["src/test/setup-env.ts"],
8-
// Only run unit tests in src/ directory (exclude integration tests)
9-
include: ["src/**/*.test.ts"],
10-
exclude: [
11-
"**/node_modules/**",
12-
"**/dist/**",
13-
"**/.next/**",
14-
"**/tests/**", // Exclude all tests/ directory (integration tests)
15-
"**/*.route.test.ts", // Exclude route tests (require running server)
16-
"**/*.integration.test.ts", // Exclude integration tests
17-
"**/server/init.test.ts", // Exclude server init test (complex dependencies)
18-
],
19-
testTimeout: 10_000,
20-
coverage: {
21-
provider: "v8",
22-
reporter: ["text", "json", "html"],
23-
exclude: [
24-
"node_modules/**",
25-
".next/**",
26-
"tests/**",
27-
"**/*.test.ts",
28-
"**/*.spec.ts",
29-
],
9+
// ...
10+
},
11+
resolve: {
12+
alias: {
13+
"@": path.resolve(__dirname, "./src"),
3014
},
3115
},
3216
});

packages/mcp-server/vitest.mcp.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineConfig } from "vitest/config";
2+
import path from "path";
23

34
export default defineConfig({
45
test: {
@@ -18,4 +19,9 @@ export default defineConfig({
1819
],
1920
},
2021
},
22+
resolve: {
23+
alias: {
24+
"@": path.resolve(__dirname, "./src"),
25+
},
26+
},
2127
});

0 commit comments

Comments
 (0)