[Bug] `text` validate function for text when value is empty with default value
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- node.js, typescript
- 領域
- cli
調査の方向性
core/prompts/text から始め、リンク先の StackBlitz の例を使って空入力のケースを再現してください。draft PR #396 と、提案されている2つの修正方針を確認してください。完了条件は、設定済みのデフォルト値がある状態で Enter を押すと、そのデフォルト値を使ってバリデーションが行われ、文書に記載されたテキストプロンプトの動作が維持されることです。
索引モデルが issue の本文から書いたものです。
説明
Environment
- OS: macOS
- Node Version:
22.5.1 - Package:
@clack/promts - Package Version: 0.11.0
Describe the bug
When calling the text's validate function without user input but with a default value defined, it should use the default value instead of relying solely on user input.
To Reproduce
Steps to reproduce the behavior:
- Open repro link
- Run
node index.js - Don't type anything, just press
[Enter] - See behavior described on terminal
Expected behavior
Clear use case example:
CLI dev creates a text step for user to enter a path as input. There's some predefined value that CLI dev established to be the default use case for most users, but still allowing for that value to be changed.
Currently, the user would have to type/copy that entire path, causing a terrible user experience.
Fix Recommendation (starting a convo)
I see 2 possible ways to fix this:
- Keep
validateas is and add a check to the value oncore/prompts/text- link to draft PR - Add a second optional argument, which would be the default value to
validate. That way, Devs would have another quick option when using thevalidatefunction, without adding extra checks to thecorelibrary.
My goal with this section is to start a conversation and introduce my ideas about this issue, not a way for me to impose how I think things should be.
This would be my first contribution, so I'm pretty new here. Let me know what you think and hopefully let's get this fixed!
- 主要言語
- TypeScript
- スター
- 8.1k
- フォーク
- 217
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 5
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bombshell-dev/clack のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
bombshell-dev/clack#597 ·
-
rfc: accessible mode オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
bombshell-dev/clack#585 · コメント 1 件 · リアクション 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
bombshell-dev/clack#573 · コメント 1 件 · リアクション 2 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
bombshell-dev/clack#565 · コメント 1 件 · リアクション 1 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
bombshell-dev/clack#564 · リアクション 1 件 ·
bombshell-dev/clack の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/claude-code#96687 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/DebateAI#582 · コメント 2 件 ·