Uh oh!
There was an error while loading. Please reload this page.
fix: handle empty server command input properly - #73
Conversation
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
2dad60d to
f549b9aCompareUh oh!
There was an error while loading. Please reload this page.
93a1222Uh oh!
There was an error while loading. Please reload this page.
fix: handle empty server command input properly