Skip to content

feat(core+prompts): Add suggestion + path prompt #314

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 2 commits into
base: main
Choose a base branch
from

Conversation

MacFJA
Copy link
Contributor

@MacFJA MacFJA commented May 10, 2025

Add two new prompts:

path prompt is a specialized version of suggestion prompt (<=> The function that generate the suggestion list is predefined)

Copy link

changeset-bot bot commented May 10, 2025

🦋 Changeset detected

Latest commit: f641a8e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clack/prompts Minor
@clack/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented May 10, 2025

@example/basic@example/changesets

npm i https://pkg.pr.new/bombshell-dev/clack/@clack/core@314
npm i https://pkg.pr.new/bombshell-dev/clack/@clack/prompts@314

commit: f641a8e

Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

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

Hey @MacFJA, this looks pretty cool, but I would like to see some tests for this 😁

@MacFJA
Copy link
Contributor Author

MacFJA commented May 10, 2025

Hey @MacFJA, this looks pretty cool, but I would like to see some tests for this 😁

Added unit tests for core.

prompt will follow soon

}
if (this.suggestion.length === 0) {
result.push({
text: color.hidden('_'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't really like this solution, but wrap-ansi remove trailing spaces, so I need to put a char 😕

Any idea to improve this part?

Copy link
Member

Choose a reason for hiding this comment

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

i have 2 alternatives which are using a non-breaking space with (\u00A0) or using a zero-width space (u200B) but they're also hacky and some tools/editors may not handle zero-width spaces and for the case of non-breaking spaces may still be visible in some terminals, and not truly "empty" 😭. so i'd say we stick with this for now, what do you think @43081j 😁?

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

Successfully merging this pull request may close these issues.

[Request] Path input
2 participants