feat: add streaming option during project creation#160
feat: add streaming option during project creation#160chhavi-mandowara-cstk wants to merge 9 commits into
Conversation
Upgrade Node.js to v22, add Astro & Analog presets, fix Apollo withDisabledDeprecations error.
Upgrade Node.js to v22, add Astro & Analog presets, fix Apollo withDisabledDeprecations error.
Upgrade Node.js to v22, add Astro & Analog presets, fix Apollo withDisabledDeprecations error.
Fix improve handling of Launch deployment file upload size errors , avoid duplicate env-var prompt & duplicate choice list and upgrade packages
Fix improve handling of Launch deployment file upload size errors , avoid duplicate env-var prompt & duplicate choice list and upgrade packages
chore: upgrade @contentstack/cli-command and cli-utilities version and remove axios override
Mocking @contentstack/cli-utilities so ESM uuid does not break the test suite
Mocking @contentstack/cli-utilities to avoid ESM uuid issues and upgrade cli dependencies
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
Pull request overview
Adds an optional --enable-streaming-response boolean flag to the launch command so users can opt into streaming responses when creating a new project. When the flag is omitted (and the chosen framework supports server commands), the CLI prompts the user interactively. The selected value is forwarded to the importProject mutation for both GitHub and FileUpload adapters.
Changes:
- New
--enable-streaming-responseflag and matching usage example added toLaunchcommand. github.ts/file-upload.tsadapters now read the flag, prompt when undefined (only inside the server-command-supported branch), and includeisStreamingEnabledin the import-project mutation variables.- Adds
isStreamingEnabled?: booleanto theConfigTypeand adds unit tests covering the prompt, flag-provided, and unsupported-framework branches for both adapters.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/commands/launch/index.ts | Registers the new enable-streaming-response boolean flag and adds a usage example. |
| src/adapters/github.ts | Destructures the new flag, prompts when undefined, stores on this.config, and sends isStreamingEnabled in the GraphQL mutation. |
| src/adapters/file-upload.ts | Mirrors the GitHub adapter changes for the file-upload flow. |
| src/types/launch.ts | Adds optional isStreamingEnabled to ConfigType. |
| src/adapters/github.test.ts | Tests for prompting, flag-provided, and unsupported-framework cases. |
| src/adapters/file-upload.test.ts | Same set of tests for the FileUpload adapter. |
Comments suppressed due to low confidence (1)
src/adapters/github.ts:244
- Minor: the prompt message "Enable Streaming Responses" reads as a statement rather than a question. For a
confirm-type prompt, phrasing it as a question (e.g. "Enable streaming responses?") would be clearer and consistent with typical inquirer prompt wording.
message: 'Enable Streaming Responses',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| this.config.isStreamingEnabled = isStreamingEnabledInput as boolean; | ||
| } else { | ||
| this.config.isStreamingEnabled = isStreamingEnabled as unknown as boolean; | ||
| } |
| if (isStreamingEnabled === undefined) { | ||
| const isStreamingEnabledInput = await cliux.inquire({ | ||
| type: 'confirm', | ||
| name: 'isStreamingEnabled', | ||
| message: 'Enable Streaming Responses', | ||
| default: false, | ||
| }); | ||
| this.config.isStreamingEnabled = isStreamingEnabledInput as boolean; | ||
| } else { | ||
| this.config.isStreamingEnabled = isStreamingEnabled as unknown as boolean; | ||
| } |
naeem-shakh-cs
left a comment
There was a problem hiding this comment.
is it getting merged directly to main?
No description provided.