Skip to content

[cli] standardize uses of confirm on confirm.ts#12834

Merged
erikareads merged 3 commits intomainfrom
erikarowland/standardize-confirm-usage
Jan 10, 2025
Merged

[cli] standardize uses of confirm on confirm.ts#12834
erikareads merged 3 commits intomainfrom
erikarowland/standardize-confirm-usage

Conversation

@erikareads
Copy link
Copy Markdown
Contributor

@erikareads erikareads commented Jan 6, 2025

Prior to this PR, we had a mixed usage of the confirm interactive input component. Some came through client.input.confirm and some came through the function confirm that wraps it. This PR standardizes on the function confirm since that was in use in more places and restricts the options that a call site can use.

This PR doesn't prevent client.input.confirm from being called directly in the future. It may be worth considering an input-manager similar to the previous output-manager refactor.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 6, 2025

🦋 Changeset detected

Latest commit: 4426aef

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

This PR includes changesets to release 1 package
Name Type
vercel 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

@erikareads erikareads marked this pull request as ready for review January 6, 2025 21:39
@erikareads erikareads changed the title [cli] standardizes uses of confirm on confirm.ts [cli] standardize uses of confirm on confirm.ts Jan 9, 2025
Copy link
Copy Markdown
Contributor

@onsclom onsclom left a comment

Choose a reason for hiding this comment

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

I slightly prefer going the other way: converting await confirm() usages into await client.input.confirm(). Then we'd be able do delete confirm.ts and better match how the rest of the codebase seems to prefer client.input.confirm. Maybe we also change the implementation to restrict the options.

However, I think making things more consistent is helpful regardless, so approving this!

@erikareads erikareads added this pull request to the merge queue Jan 9, 2025
@erikareads
Copy link
Copy Markdown
Contributor Author

I slightly prefer going the other way: converting await confirm() usages into await client.input.confirm(). Then we'd be able do delete confirm.ts and better match how the rest of the codebase seems to prefer client.input.confirm. Maybe we also change the implementation to restrict the options.

However, I think making things more consistent is helpful regardless, so approving this!

With this PR, we make everything consistent, which makes it easier to switch in the future. With your comment in mind, I'm reminded that client.input.confirm is still our own wrapper of the confirm component, and we can move the restrictive call signature to that definition.

I'll do a fast-follow PR that migrates everything to that one location, thus removing the confusion of which confirm method/function to use for people wanting to add confirm logic to their commands.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 10, 2025
@erikareads erikareads added this pull request to the merge queue Jan 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 10, 2025
@erikareads erikareads added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit 8a9dd16 Jan 10, 2025
@erikareads erikareads deleted the erikarowland/standardize-confirm-usage branch January 10, 2025 21:08
EndangeredMassa pushed a commit that referenced this pull request Jan 13, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- [cli] add compile cache to improve startup performance
([#12783](#12783))

### Patch Changes

- [cli] standardizes uses of confirm on confirm.ts
([#12834](#12834))

- [cli] sort imports in build/index.ts
([#12833](#12833))

- Updated dependencies
\[[`5fea2c49103adf6f7153f04378bff6f571375b0e`](5fea2c4)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Add support for in-function concurrency
([#12850](#12850))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Jan 13, 2025
…ace (#12846)

Moves the restrictive interface for the `confirm` function to
`client.input.confirm`, and refactors all call sites to use the updated
interface. This PR removes any confusion about whether to use the
`input.confirm` method or the `confirm` function.

Previous discussion:
#12834 (comment)
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- [cli] add compile cache to improve startup performance
([#12783](vercel/vercel#12783))

### Patch Changes

- [cli] standardizes uses of confirm on confirm.ts
([#12834](vercel/vercel#12834))

- [cli] sort imports in build/index.ts
([#12833](vercel/vercel#12833))

- Updated dependencies
\[[`ac7961adcbbcf65b9cc6231b581e1f04a78bba2a`](vercel/vercel@ac7961a)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Add support for in-function concurrency
([#12850](vercel/vercel#12850))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
…ace (#12846)

Moves the restrictive interface for the `confirm` function to
`client.input.confirm`, and refactors all call sites to use the updated
interface. This PR removes any confusion about whether to use the
`input.confirm` method or the `confirm` function.

Previous discussion:
vercel/vercel#12834 (comment)
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.

3 participants