Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ markup:
],
};

default:
default: {
// Try to find specific workflow
const workflow = DOCUMENTATION_WORKFLOWS[workflowType || ''];
if (workflow) {
Expand All @@ -546,6 +546,7 @@ markup:
};
}
throw new Error(`Unknown workflow: ${workflowType}`);
}
}
}

Expand Down Expand Up @@ -726,7 +727,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
});

// Start the server
async function main() {
async function main(): Promise<void> {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('DocuMCP server started successfully');
Expand Down
37 changes: 18 additions & 19 deletions src/tools/populate-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ interface ContentPlan {
explanation: any[];
}

interface ProjectContext {
primaryLanguage: string;
frameworks: any[];
testingFrameworks: any[];
dependencies: any;
devopsTools?: DevOpsToolProfile;
}

interface DevOpsToolProfile {
containerization: ContainerTechnology[];
Expand Down Expand Up @@ -430,7 +423,7 @@ app.start();`,
];
}

private generateNodeSetupContent(analysis: any): string {
private generateNodeSetupContent(_analysis: any): string {
return `# Setting Up Your Development Environment

This guide will help you configure a complete Node.js and TypeScript development environment.
Expand Down Expand Up @@ -570,7 +563,7 @@ npm test -- --coverage
`;
}

private generateTestingExamples(analysis: any): string[] {
private generateTestingExamples(_analysis: any): string[] {
return [
`// Unit test example
import { calculateTotal } from './calculator';
Expand Down Expand Up @@ -1534,7 +1527,9 @@ ${analysis.technologies.database ? `### Database
try {
await fs.access(filePath);
continue;
} catch {}
} catch {
// File doesn't exist, continue to create it
}
}

await fs.writeFile(filePath, howTo.content, 'utf-8');
Expand All @@ -1550,7 +1545,9 @@ ${analysis.technologies.database ? `### Database
try {
await fs.access(filePath);
continue;
} catch {}
} catch {
// File doesn't exist, continue to create it
}
}

await fs.writeFile(filePath, ref.content, 'utf-8');
Expand All @@ -1566,7 +1563,9 @@ ${analysis.technologies.database ? `### Database
try {
await fs.access(filePath);
continue;
} catch {}
} catch {
// File doesn't exist, continue to create it
}
}

await fs.writeFile(filePath, exp.content, 'utf-8');
Expand Down Expand Up @@ -1803,7 +1802,7 @@ ${contentPlan.explanation.map(e => `- [${e.title}](explanation/${this.slugify(e.
return files.some((f: any) => f.content?.includes(content));
}

private extractDockerVersion(analysis: any): string | undefined {
private extractDockerVersion(_analysis: any): string | undefined {
return undefined; // Could be implemented to parse Dockerfile
}

Expand All @@ -1828,11 +1827,11 @@ ${contentPlan.explanation.map(e => `- [${e.title}](explanation/${this.slugify(e.
.map((f: any) => f.name);
}

private analyzeKubernetesResources(analysis: any): string[] {
private analyzeKubernetesResources(_analysis: any): string[] {
return ['Deployment', 'Service', 'ConfigMap']; // Simplified
}

private extractNamespaces(analysis: any): string[] {
private extractNamespaces(_analysis: any): string[] {
return ['default']; // Simplified
}

Expand Down Expand Up @@ -2159,7 +2158,7 @@ python manage.py runserver
`;
}

private generateFastAPITutorialContent(analysis: any): string {
private generateFastAPITutorialContent(_analysis: any): string {
return `# Building APIs with FastAPI

Create modern, fast APIs with automatic documentation using FastAPI.
Expand Down Expand Up @@ -2226,7 +2225,7 @@ FastAPI automatically generates interactive API documentation:
`;
}

private generateFlaskTutorialContent(analysis: any): string {
private generateFlaskTutorialContent(_analysis: any): string {
return `# Building Applications with Flask

Create lightweight web applications and APIs using Flask's minimalist approach.
Expand Down Expand Up @@ -2303,7 +2302,7 @@ Popular Flask extensions:
}

// Helper methods for container content generation
private generateContainerFileContent(analysis: any, containerTech: ContainerTechnology): string {
private generateContainerFileContent(analysis: any, _containerTech: ContainerTechnology): string {
const language = analysis.metadata.primaryLanguage?.toLowerCase();

if (language === 'python') {
Expand Down Expand Up @@ -2404,7 +2403,7 @@ ${containerTech.name} ps`
];
}

private generateOrchestrationExamples(analysis: any, orchestrationTech: OrchestrationTechnology): string[] {
private generateOrchestrationExamples(analysis: any, _orchestrationTech: OrchestrationTechnology): string[] {
return [
`# Deploy the application
kubectl apply -f k8s/`,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/test-local-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export async function testLocalDeployment(args: unknown): Promise<{ content: any
// Step 2: Install dependencies if needed
if (config.installCommand && !skipBuild) {
try {
const { stdout: _stdout, stderr } = await execAsync(config.installCommand, {
const { stderr } = await execAsync(config.installCommand, {
cwd: repositoryPath,
timeout: timeout * 1000
});
Expand Down
12 changes: 6 additions & 6 deletions src/tools/validate-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import * as fs from 'fs/promises';
import * as path from 'path';
import { exec } from 'child_process';
import { promisify } from 'util';
import { fileURLToPath } from 'url';

// ESM-compatible __dirname replacement - fallback for test environments
function getDirname(): string {
try {
if (typeof import.meta !== 'undefined' && import.meta.url) {
const { fileURLToPath } = require('url');
return path.dirname(fileURLToPath(import.meta.url));
}
} catch {
Expand Down Expand Up @@ -245,8 +245,6 @@ class ContentAccuracyValidator {
): Promise<void> {
if (!this.projectContext) return;

const dependencies = this.projectContext.dependencies?.packages || [];

// Check if mentioned versions align with project dependencies
const versionPattern = /@(\d+\.\d+\.\d+)/g;
const matches = content.match(versionPattern);
Expand Down Expand Up @@ -615,7 +613,7 @@ class ContentAccuracyValidator {
await fs.writeFile(tempFile, code, 'utf-8');

// Try to compile with TypeScript
const { stdout, stderr } = await execAsync(`npx tsc --noEmit --skipLibCheck ${tempFile}`);
const { stderr } = await execAsync(`npx tsc --noEmit --skipLibCheck ${tempFile}`);

if (stderr && stderr.includes('error')) {
validation.issues.push({
Expand Down Expand Up @@ -647,7 +645,9 @@ class ContentAccuracyValidator {
// Clean up temp file
try {
await fs.unlink(tempFile);
} catch {}
} catch {
// Ignore cleanup errors
}
}
}

Expand Down Expand Up @@ -826,7 +826,7 @@ class ContentAccuracyValidator {
}
}

private generateRecommendations(result: ValidationResult, options: ValidationOptions): void {
private generateRecommendations(result: ValidationResult, _options: ValidationOptions): void {
const recommendations: string[] = [];
const nextSteps: string[] = [];

Expand Down
2 changes: 1 addition & 1 deletion tests/edge-cases/error-handling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ describe('Edge Cases and Error Handling', () => {
try {
await Promise.race([longOperation, timeoutPromise]);
} catch (error) {
if (error.message === 'Operation timed out') {
if (error instanceof Error && error.message === 'Operation timed out') {
console.warn('Long operation test timed out - this is expected behavior');
} else {
throw error;
Expand Down