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

fix: respect the default for a text prompt #3466

Merged
merged 6 commits into from
Aug 18, 2024
Merged

Conversation

cdierkens
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This PR respects the default value passed in when creating a

Example

const prompt = Prompt.text({
  message: "This is a prompt with a default value",
  default: "default-value", // <-- This value does not populate before this PR
});

Warning

I attempted to model the Wizard tests, but could not get the Enter key to effect the program exit.

Related

@cdierkens cdierkens requested a review from IMax153 as a code owner August 16, 2024 18:08
Copy link

changeset-bot bot commented Aug 16, 2024

🦋 Changeset detected

Latest commit: 338e718

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

This PR includes changesets to release 1 package
Name Type
@effect/cli Patch

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

packages/cli/src/internal/prompt/text.ts Outdated Show resolved Hide resolved
packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
@cdierkens cdierkens requested a review from IMax153 August 18, 2024 03:48
Copy link
Member

@IMax153 IMax153 left a comment

Choose a reason for hiding this comment

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

@cdierkens - just a few tiny additional comments. Otherwise everything looks good. Once you make these additional changes, I'll trigger CI and as long as everything passes we can get this merged 👍

packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
packages/cli/test/Prompt.test.ts Outdated Show resolved Hide resolved
@cdierkens cdierkens requested a review from IMax153 August 18, 2024 15:42
@IMax153
Copy link
Member

IMax153 commented Aug 18, 2024

@cdierkens - looks like there are some linting issues. If you run pnpm lint-fix it should take care of those issues.

@cdierkens
Copy link
Contributor Author

@cdierkens - looks like there are some linting issues. If you run pnpm lint-fix it should take care of those issues.

@IMax153 Done and done.

@IMax153 IMax153 merged commit 72dd535 into Effect-TS:main Aug 18, 2024
11 checks passed
@github-actions github-actions bot mentioned this pull request Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Passing a default value to Prompt.text from @effect/cli has no effect.
2 participants