Skip to content
Merged
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
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"name": "ios-mcp-code-quality-server",
"version": "0.1.3",
"version": "0.1.4",
"type": "module",
"description": "A CLI and MCP server for analyzing iOS code quality using AI suggestions and test results.",
"main": "dist/index.js",
"bin": {
"ios-mcp-code-quality-server": "dist/cli/index.js"
},
"files": [
"dist/",
"README.md",
"LICENSE"
],
"keywords": [
"ios",
"xcode",
Expand All @@ -26,7 +31,8 @@
"start:prod": "node dist/index.js",
"lint": "eslint . --ext .ts",
"test": "vitest run",
"test:coverage": "vitest run --coverage"
"test:coverage": "vitest run --coverage",
"prepublishOnly": "npm run build"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.17.0",
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/cliIntegration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe('CLI Integration', () => {
it('should show version when --version flag is provided', () => {
try {
const output = execSync(`node ${cliPath} --version`, { encoding: 'utf8' });
expect(output.trim()).toBe('0.1.3');
expect(output.trim()).toBe('0.1.4');
} catch (error: any) {
// commander.js version exits with code 0 but execSync might capture it differently
if (error.status === 0) {
expect(error.stdout.trim()).toBe('0.1.3');
expect(error.stdout.trim()).toBe('0.1.4');
} else {
throw error;
}
Expand Down
11 changes: 9 additions & 2 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const program = new Command();
program
.name('ios-mcp-code-quality-server')
.description('iOS MCP Code Quality CLI - Run tests and linting for iOS projects')
.version('0.1.3');
.version('0.1.4');

/**
* CLI Test Command
Expand Down Expand Up @@ -195,9 +195,16 @@ export async function runCLI(): Promise<void> {
}

// If running directly (not imported), execute CLI
// Handle both direct execution and npm binary symlinks
const scriptPath = process.argv[1];
const currentFile = import.meta.url.replace('file://', '');
if (scriptPath && (scriptPath === currentFile || scriptPath.endsWith('/dist/cli/index.js'))) {
const isDirectExecution = scriptPath && (
scriptPath === currentFile ||
scriptPath.endsWith('/dist/cli/index.js') ||
scriptPath.endsWith('/ios-mcp-code-quality-server')
);

if (isDirectExecution) {
runCLI().catch(error => {
logger.error('CLI execution failed:', error);
console.error('❌ CLI failed:', error instanceof Error ? error.message : String(error));
Expand Down