FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

replace `enquirer+inquirer` with `@clack/prompts+launch-editor` by beeequeue · Pull Request #1879 · changesets/changesets · GitHub

replace enquirer+inquirer with @clack/prompts+launch-editor - #1879

Merged
beeequeue merged 14 commits into
changesets:nextfrom
beeequeue:clack
May 12, 2026
Merged

replace enquirer+inquirer with @clack/prompts+launch-editor#1879
beeequeue merged 14 commits into
changesets:nextfrom
beeequeue:clack

Conversation

beeequeue commented Mar 8, 2026
edited by bluwy
Loading

Copy link
Copy Markdown
Member

closes #1814
closes #1043
closes #1861
closes #1814
part of #1869

replaces enquirer with the slightly smaller and more modern @clack/prompts, whose API is also a lot nicer in my opinion

it also replaces @inquirer/external-editor with launch-editor, which is quite a lot smaller, works better in my experience, and is more flexible allowing us to remove the hack in packages/cli/src/commands/add/index.ts

  • should we remove the versions from the labels when selecting packages? it would be nice to minimize each item's size since the list(s) can get pretty big

things to do in follow-up PRs

  • replace remaining console logs with throwing errors or similar patterns #X
  • remove noop log silencer functions everywhere since logs are always silenced now #X
  • migrate from mri to cleye or gunshi #X
    • implement dynamic text for intro step based on command being run

recordings / screenshots

Recordings

cancelling at any point: https://asciinema.org/a/HxMUViS932Pwi5Oj

changeset add: https://asciinema.org/a/1JFbvyuuVbbfOjuy

changeset init with existing config:

changeset version with pre-release:

changeset tag: https://asciinema.org/a/aVKLczi02OzZWHrk

changeset status --verbose:

changeset publish:

non-interactive (otp, oidc): https://asciinema.org/a/7tjKcMe3d1NNshUc

interactive (passkey): https://asciinema.org/a/yF9PEOwG2sROT5Zz

changes to messages/texts

changes

general rules i tried to follow

  • paths are blue
  • package names are blue
  • commands are cyan
  • git refs are cyan
  • "Changesets" is green
  • "major" is red
  • "minor" is green
  • "patch" is blue

texts

legend:

  • when text is shown
    • before
    • after

add

  • Selecting packages to write changeset for
    • Which packages would you like to include?
    • Which packages were affected by the changes you made?
  • No versionable packages found
    • Ensure the packages to version are not in the "ignore" config
    • Ensure the packages to version are not ignored by the config
  • Failed to find changed packages warning
    • Failed to find changed packages from the "${branch}" ${"ref" | "base branch"} due to error below
    • Failed to identify which packages have changed since the ${"ref" | "base branch"} due to an error:
      ${error.toString()}
  • No contents in externally edited file
    • A summary is required! Please enter a summary
    • Did not find a summary in the edited file. Please enter one:
  • Multiple packages note
    • Note: All dependents of these packages that will be incompatible with the new version will be pc.redBright("patch bumped") when this changeset is applied.
    • Note: All packages that depend on these whose required versions will be incompatible will also be ${pc.green("patch")} bumped when this changeset is applied.

changeset-bot Bot commented Mar 8, 2026
edited
Loading

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7c81b29

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

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

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "@changesets/apply-release-plan" depends on the ignored package "@changesets/test-utils", but "@changesets/apply-release-plan" is not being ignored. Please add "@changesets/apply-release-plan" to the `ignore` option.
The package "@changesets/cli" depends on the ignored package "@changesets/test-utils", but "@changesets/cli" is not being ignored. Please add "@changesets/cli" to the `ignore` option.
The package "@changesets/config" depends on the ignored package "@changesets/test-utils", but "@changesets/config" is not being ignored. Please add "@changesets/config" to the `ignore` option.
The package "@changesets/get-dependents-graph" depends on the ignored package "@changesets/test-utils", but "@changesets/get-dependents-graph" is not being ignored. Please add "@changesets/get-dependents-graph" to the `ignore` option.
The package "@changesets/git" depends on the ignored package "@changesets/test-utils", but "@changesets/git" is not being ignored. Please add "@changesets/git" to the `ignore` option.
The package "@changesets/pre" depends on the ignored package "@changesets/test-utils", but "@changesets/pre" is not being ignored. Please add "@changesets/pre" to the `ignore` option.
The package "@changesets/read" depends on the ignored package "@changesets/test-utils", but "@changesets/read" is not being ignored. Please add "@changesets/read" to the `ignore` option.
The package "@changesets/release-utils" depends on the ignored package "@changesets/test-utils", but "@changesets/release-utils" is not being ignored. Please add "@changesets/release-utils" to the `ignore` option.
The package "@changesets/should-skip-package" depends on the ignored package "@changesets/test-utils", but "@changesets/should-skip-package" is not being ignored. Please add "@changesets/should-skip-package" to the `ignore` option.
The package "@changesets/write" depends on the ignored package "@changesets/test-utils", but "@changesets/write" is not being ignored. Please add "@changesets/write" to the `ignore` option.

Comment thread packages/cli/src/commands/add/index.ts Outdated

Andarist commented Mar 8, 2026

Copy link
Copy Markdown
Member

It would be great to include some before/after screenshots in the PR summary + call out behavior differences (if there are any)

Andarist commented Mar 8, 2026

Copy link
Copy Markdown
Member

This will kinda also close #1043 and #1814

Copy link
Copy Markdown
Member Author

It would be great to include some before/after screenshots in the PR summary + call out behavior differences (if there are any)

yep, will add more info when theres more progress but for now i have one recording and will add more later

codecov Bot commented Mar 12, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.45455% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.09%. Comparing base (c7294d6) to head (7c81b29).

Files with missing lines Patch % Lines
packages/cli/src/utils/cli-utilities.ts 8.69% 18 Missing and 3 partials ⚠️
packages/cli/src/utils/askWithEditor.ts 0.00% 11 Missing and 1 partial ⚠️
...ckages/cli/src/commands/publish/publishPackages.ts 63.33% 11 Missing ⚠️
packages/cli/src/commands/publish/index.ts 52.38% 10 Missing ⚠️
packages/cli/src/commands/publish/npm-utils.ts 0.00% 8 Missing and 1 partial ⚠️
packages/cli/src/run.ts 36.36% 6 Missing and 1 partial ⚠️
packages/cli/src/commands/add/createChangeset.ts 75.00% 5 Missing and 1 partial ⚠️
packages/cli/src/commands/status/index.ts 82.60% 4 Missing ⚠️
packages/cli/src/commands/add/index.ts 80.00% 3 Missing ⚠️
packages/cli/src/commands/version/index.ts 71.42% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1879      +/-   ##
==========================================
+ Coverage   79.64%   81.09%   +1.44%     
==========================================
  Files          52       53       +1     
  Lines        2412     2348      -64     
  Branches      710      714       +4     
==========================================
- Hits         1921     1904      -17     
+ Misses        441      402      -39     
+ Partials       50       42       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member Author

Do we still need to handle v1 configs in v3 or should we just remove that code?

Copy link
Copy Markdown
Member

iI think it's safe to remove any mentions of v1 configs from the codebase

beeequeue marked this pull request as ready for review March 12, 2026 11:07

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

i'm thinking that the log silencers for the tests should probably always be on and the functions removed, but that would be a ton of changes so i left them as-is in this PR

beeequeue changed the title (wip) replace enquirer+inquirer with @clack/prompts+launch-editor replace enquirer+inquirer with @clack/prompts+launch-editor Mar 12, 2026
Comment thread packages/config/src/index.test.ts Outdated

Copy link
Copy Markdown
Member

@beeequeue could you sync this with next?

Comment thread packages/cli/src/index.ts Outdated
Comment thread packages/cli/src/index.ts
Comment thread packages/cli/src/index.ts Outdated

Copy link
Copy Markdown
Member Author

i added a section in the pr body for the current follow-ups that will be needed if we don't do them in this pr

Copy link
Copy Markdown
Member

One extra thing we should do before landing this is to check out how the "delegated auth mode" renders now. It's when we spawn npm so it can handle OTP-related prompting. Would you be able to test that out?

Copy link
Copy Markdown
Member Author

im not sure how to trigger it, but when i tried to publish a package and it failed i got a very weird looking output:

screenshot

after i logged in and tried again it worked and looks a bit weird but okay-ish

screenshot

i think this is because i added the spinner after i migrated the npm publishing files, and didn't check how it affected them. i would love if we could use tasks for it but it would require larger refactoring of the publishing functions which is why i dropped that idea

Copy link
Copy Markdown
Member

Hm, that's weird that both runs ended up being indented differently... 🤔

As an experiment, I also wanted to take a look how this would look like completely without the "guide". For that, I had to open a PR here: bombshell-dev/clack#500

I think it's worth waiting a couple of days for that PR to possibly get merged in so we could test both versions in the repo here

Copy link
Copy Markdown
Member Author

presumably the different indentation is from the npm command's output being logged without going through clack's formatting, unlike in the error one where they are handled and printed with them

Andarist commented Apr 1, 2026

Copy link
Copy Markdown
Member

Overall, this looks great. The only thing I'd like to do now is to properly compare the withGuide: true/false variants to decide which one feels better. I'll try to find the time to do that this week.

Copy link
Copy Markdown
Member Author

imo the publish command needs to be redone, but i would also be okay with leaving it as-is for another pr

Andarist commented Apr 1, 2026

Copy link
Copy Markdown
Member

What kind of a makeover do u think about?

bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Since this merges to next, we'd need to manually close the issue after merge.

This was linked to issues May 12, 2026

beeequeue commented May 12, 2026
edited
Loading

Copy link
Copy Markdown
Member Author

we can add them manually via the Development section to the right, but for some reason github can't find #1043 in the dropdown 💤

beeequeue commented May 12, 2026
edited
Loading

Copy link
Copy Markdown
Member Author

i'm gonna do a final check that each command still looks okay after all the rebasing, then i'll merge it.

bluwy commented May 12, 2026

Copy link
Copy Markdown
Member

Maybe I'm misremembering, but I think the auto-close only works when merging to the default branch. So next wouldn't work.

beeequeue merged commit c76b232 into changesets:next May 12, 2026
10 of 11 checks passed
beeequeue deleted the clack branch May 12, 2026 13:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Migrate away from enquirer Cancelation error

4 participants


Back | FazBrowse Home | New Git URL