Fix npx command execution by correcting bin entry point#30
Conversation
Co-authored-by: a-25 <6087455+a-25@users.noreply.github.com>
Co-authored-by: a-25 <6087455+a-25@users.noreply.github.com>
package-lock.json
Outdated
| { | ||
| "name": "ios-mcp-code-quality-server", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", |
There was a problem hiding this comment.
@copilot: fix this version to 0.1.3. Fix the same version to package.json file as well.
There was a problem hiding this comment.
Updated version to 0.1.3 in both package.json and package-lock.json, as well as in the CLI source code and tests. The fix is in commit 43fc15d.
|
@copilot: prove that the fix is working. Build the app, start it as server, catch output, check that localhost:3000 port is working, kill the process and check that it was killed. |
…e, and tests Co-authored-by: a-25 <6087455+a-25@users.noreply.github.com>
✅ Fix verified working successfully: Build: Server startup:
Port verification:
Process termination:
CLI functionality:
The fix completely resolves the original npx execution issue. The bin field now correctly points to |
There was a problem hiding this comment.
Pull Request Overview
Fixes the npx command execution by correcting the bin entry point from dist/index.js to dist/cli/index.js, which was causing "import: command not found" errors when users tried to run the CLI tool.
Key Changes:
- Updated
package.jsonbin field to point to the correct CLI entry point - Bumped version to 0.1.3 across the codebase
- Updated corresponding test assertions to match the new version
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Corrected bin entry point from dist/index.js to dist/cli/index.js and bumped version to 0.1.3 |
| src/cli/index.ts | Updated CLI version string to match new package version |
| src/tests/cliIntegration.test.ts | Updated test assertions to expect version 0.1.3 instead of 0.1.1 |
Fix for Server Not Starting When Used as MCP Server
The
binfield inpackage.jsonwas incorrectly pointing todist/index.js(the MCP server entry point) instead ofdist/cli/index.js(the CLI entry point). This caused the shell to try interpreting ES module import statements as shell commands when users rannpx ios-mcp-code-quality-server server, resulting in errors like:The fix changes the bin field to point to the correct CLI entry point that can parse commands and route to the appropriate functionality:
This ensures that
npx ios-mcp-code-quality-server serverproperly starts the MCP server through the CLI command parser, while maintaining backward compatibility with direct execution ofnode dist/index.js.Changes Made:
dist/cli/index.js)Verification:
ios-mcp-code-quality-server --helpshows CLI helpios-mcp-code-quality-server server --helpshows server command helpios-mcp-code-quality-server serverstarts the MCP server successfullyios-mcp-code-quality-server --versionshows version 0.1.3node dist/index.jsstill worksFixes #28.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.