Skip to content

Commit 320bfb1

Browse files
feat: complete Task 1 - Setup core infrastructure and shared types
- Create comprehensive shared types package with core interfaces - UploadResult, Dataset, AccessCondition interfaces in core.ts - MCP protocol types (MCPToolDefinition, MCPRequest, MCPResponse) - Authentication types (AuthConfig, TokenInfo, APICredentials) - Error handling types (LighthouseError, RetryConfig) - Workspace context types (WorkspaceContext, ProjectFile) - Configure Jest testing framework with robust patterns - Jest config with 80% coverage thresholds - Custom matchers and test utilities - Mock factories and fixtures for consistent testing - Timer utilities and async testing helpers - Comprehensive test patterns established - Setup build scripts and development workflows - Turbo.js monorepo configuration - TypeScript compilation for all packages - Package scripts for build, test, lint, format - Development tools: Prettier, ESLint, Husky, lint-staged - Create shared utilities and constants - File size limits, supported file types - Default configurations, encryption settings - Error handling with retry logic - Async operations and concurrency utilities - Comprehensive logging system
1 parent ce409b2 commit 320bfb1

File tree

10 files changed

+2358
-1140
lines changed

10 files changed

+2358
-1140
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"eslint.useFlatConfig": true,
55
"eslint.validate": ["javascript", "typescript", "typescriptreact"],
66
"editor.codeActionsOnSave": {
7-
"source.fixAll.eslint": true
7+
"source.fixAll.eslint": "explicit"
88
}
99
}

apps/mcp-server/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,18 @@
77
"test": "jest",
88
"test:watch": "jest --watch",
99
"test:coverage": "jest --coverage",
10-
"lint": "eslint src/**/*.ts",
1110
"clean": "rm -rf dist",
12-
"dev": "ts-node src/index.ts"
11+
"dev": "ts-node src/index.ts",
12+
"lint": "eslint .",
13+
"lint:fix": "eslint . --fix",
14+
"format": "prettier --write .",
15+
"format:check": "prettier --check ."
1316
},
1417
"dependencies": {
1518
"@lighthouse-tooling/sdk-wrapper": "workspace:*",
1619
"@lighthouse-tooling/types": "workspace:*",
1720
"@modelcontextprotocol/sdk": "latest"
1821
},
19-
"scripts": {
20-
"lint": "eslint .",
21-
"lint:fix": "eslint . --fix",
22-
"format": "prettier --write .",
23-
"format:check": "prettier --check ."
2422
"devDependencies": {
2523
"jest": "^29.7.0",
2624
"ts-jest": "^29.1.1",

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"ci:local": "pnpm run lint && pnpm run format:check",
1919
"test": "turbo run test",
2020
"clean": "turbo run clean",
21-
"prepare": "husky"
21+
"prepare": "husky",
2222
"test:coverage": "turbo run test:coverage",
2323
"verify-tests": "node scripts/verify-tests.js"
2424
},
@@ -42,7 +42,10 @@
4242
"eslint": "^9.36.0",
4343
"prettier": "^3.3.3",
4444
"husky": "^9.1.6",
45-
"lint-staged": "^15.2.10"
45+
"lint-staged": "^15.2.10",
46+
"jest": "^29.7.0",
47+
"ts-jest": "^29.1.1",
48+
"@types/jest": "^29.5.5"
4649
},
4750
"pnpm": {
4851
"overrides": {
@@ -52,10 +55,5 @@
5255
"typescript-eslint": "8.36.0",
5356
"@eslint/js": "^9.31.0"
5457
}
55-
"eslint": "^8.0.0",
56-
"prettier": "^3.0.0",
57-
"jest": "^29.7.0",
58-
"ts-jest": "^29.1.1",
59-
"@types/jest": "^29.5.5"
6058
}
6159
}

packages/shared/package.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,23 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8-
"build": "tsc",
8+
"build": "tsc -p tsconfig.build.json",
99
"test": "jest",
1010
"test:watch": "jest --watch",
1111
"test:coverage": "jest --coverage",
12-
"lint": "eslint src/**/*.ts",
12+
"lint": "eslint .",
13+
"lint:fix": "eslint . --fix",
14+
"format": "prettier --write .",
15+
"format:check": "prettier --check .",
1316
"clean": "rm -rf dist"
1417
},
1518
"devDependencies": {
1619
"jest": "^29.7.0",
1720
"ts-jest": "^29.1.1",
1821
"@types/jest": "^29.5.5",
1922
"typescript": "^5.0.0"
20-
"dev": "tsc --watch",
21-
"lint": "eslint src/**/*.ts",
22-
"lint:fix": "eslint src/**/*.ts --fix",
23-
"clean": "rm -rf dist"
2423
},
2524
"dependencies": {
2625
"@lighthouse-tooling/types": "workspace:*"
27-
},
28-
"scripts": {
29-
"lint": "eslint .",
30-
"lint:fix": "eslint . --fix",
31-
"format": "prettier --write .",
32-
"format:check": "prettier --check ."
3326
}
3427
}

packages/shared/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ export type {
2323
LoggerConfig,
2424
ConcurrencyConfig,
2525
} from "./utils";
26+
27+
// Test utilities are only exported in development/test environments
28+
// They are not included in the production build
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Test utilities export - only for testing environments
3+
* This file is excluded from the main build
4+
*/
5+
6+
export * from "./test-utils";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": [
4+
"dist",
5+
"node_modules",
6+
"**/*.test.ts",
7+
"**/*.spec.ts",
8+
"src/test-utils/**/*",
9+
"src/test-utils-export.ts",
10+
"__tests__/**/*"
11+
]
12+
}

packages/shared/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"noFallthroughCasesInSwitch": true
1414
},
1515
"include": ["src/**/*"],
16-
"exclude": ["dist", "node_modules", "**/*.test.ts", "**/*.spec.ts"]
16+
"exclude": ["dist", "node_modules", "**/*.test.ts", "**/*.spec.ts", "src/test-utils"]
1717
}

packages/types/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"lint:fix": "eslint . --fix",
1010
"format": "prettier --write .",
1111
"format:check": "prettier --check ."
12+
},
1213
"exports": {
1314
".": {
1415
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)