Skip to content
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

feat(@clack/core,@clack/prompts): path prompt #148

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

Mist3rBru
Copy link
Contributor

@Mist3rBru Mist3rBru commented Aug 24, 2023

PathPrompt

The path component allows user to select a file/folder using one of two approaches:

Select

Selecting the file/folder with a tree based select with free navigation by arrow keys.

const projectPath = await path({
  type: 'select',
  message: 'Pick a project:',
  initialValue: process.cwd(),
  onlyShowDir: true,
  maxItems: 12
});

Demo

2023-11-10_10-16-15.mov

Text:

Typing the path with built-in autosuggestion and autocomplete features.

const projectPath = await path({
  type: 'text',
  message: 'Pick a project:',
  initialValue: process.cwd(),
  placeholder: './app',
  onlyShowDir: true,
});

Demo

2023-11-10_10-15-33.mov

This PR includes:

  • Code
  • Docs
  • Changeset
  • Example

Relates #35
Closes #32
Closes #96

@changeset-bot
Copy link

changeset-bot bot commented Aug 24, 2023

🦋 Changeset detected

Latest commit: 8c854c1

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

This PR includes changesets to release 2 packages
Name Type
@clack/core Minor
@clack/prompts 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

@cpreston321
Copy link
Collaborator

@Mist3rBru It would nice to include a video for reference! So we show it off in the release & also just see the functionality!

@Mist3rBru
Copy link
Contributor Author

@cpreston321 great idea!

I included the video on PR description, now you can copy the link and paste on release

@Mist3rBru Mist3rBru mentioned this pull request Aug 25, 2023
@Mist3rBru Mist3rBru marked this pull request as draft November 3, 2023 12:04
@Mist3rBru Mist3rBru marked this pull request as ready for review November 10, 2023 13:22
@ricky11
Copy link

ricky11 commented Mar 24, 2024

is the path now usable? or not merged yet?

@Mist3rBru
Copy link
Contributor Author

@cpreston321 I was looking at this code after a while and it looks messy with both logics, what do you think about split it into 2 prompts, like PathPrompt and SelectPathPrompt, and do the same for @clack/prompts with path and selectPath?

@Mist3rBru Mist3rBru marked this pull request as draft May 13, 2024 19:16
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 [Feature Request] file selection
3 participants