-
Notifications
You must be signed in to change notification settings - Fork 0
fix: handle empty server command input properly #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
12ab693 to
2ff1f9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the handling of empty server command input by properly validating user input and conditionally including the serverCommand field in project creation requests. Instead of always setting a default value ('npm run start'), the code now only includes serverCommand when it has a non-empty value.
Key Changes
- Modified server command handling to use conditional spread operator, only including serverCommand in GraphQL mutations when it's non-empty after trimming
- Refactored server command prompt logic to check for empty input and only set config.serverCommand when a valid value is provided
- Added comprehensive test coverage for server command scenarios including empty input, whitespace handling, framework support checks, and flag-based configuration
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/adapters/github.ts | Updated createNewProject to conditionally include serverCommand using spread operator; refactored prepareForNewProjectCreation to validate and conditionally set serverCommand from user input |
| src/adapters/file-upload.ts | Applied same serverCommand handling logic as github adapter - conditional inclusion in mutation and validated assignment from user input |
| src/adapters/github.test.ts | Added test suite covering server command prompt behavior across different scenarios: framework support, empty input, provided flags, and missing framework |
| src/adapters/file-upload.test.ts | Added comprehensive test suite for file upload adapter mirroring github adapter test coverage for server command handling |
| AGENTS.md | Added testing guideline to use only jest for writing test cases and reference existing unit tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2dad60d to
f549b9a
Compare
f549b9a to
c703cd2
Compare
93a1222
c703cd2 to
93a1222
Compare
fix: handle empty server command input properly