Skip to content

feat(cli/unstable): add generic for promptSelect() and promptMultipleSelect() #6713

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MAKS11060
Copy link

This PR adds generic for

  • promptSelect()
  • promptMultipleSelect()

If we pass a read-only array, then the output value is already known.

const result = promptSelect('Select browser:', ["safari", "chrome", "firefox"])
result // 'safari' | 'chrome' | 'firefox' | null

const result2 = promptMultipleSelect('Select browser:', ["safari", "chrome", "firefox"])
result2 // ('safari' | 'chrome' | 'firefox')[] | null

@MAKS11060 MAKS11060 requested a review from kt3k as a code owner June 5, 2025 11:11
@CLAassistant
Copy link

CLAassistant commented Jun 5, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the cli label Jun 5, 2025
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.63%. Comparing base (b2b2d57) to head (5683fc7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6713      +/-   ##
==========================================
- Coverage   94.70%   94.63%   -0.07%     
==========================================
  Files         569      575       +6     
  Lines       46832    47013     +181     
  Branches     6588     6604      +16     
==========================================
+ Hits        44350    44491     +141     
- Misses       2440     2480      +40     
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice!

@kt3k
Copy link
Member

kt3k commented Jun 6, 2025

Does anyone have any concern on this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants