Skip to content

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

Open
beeequeue wants to merge 44 commits intochangesets:nextfrom
beeequeue:clack
Open

replace enquirer+inquirer with @clack/prompts+launch-editor#1879
beeequeue wants to merge 44 commits intochangesets:nextfrom
beeequeue:clack

Conversation

@beeequeue
Copy link
Copy Markdown

@beeequeue beeequeue commented Mar 8, 2026

closes #1814
closes #1043
closes #1861
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:
image

changeset version with pre-release:
image

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

changeset status --verbose:
image

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
Copy link
Copy Markdown

changeset-bot Bot commented Mar 8, 2026

🦋 Changeset detected

Latest commit: d3bca0c

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

This PR includes changesets to release 4 packages
Name Type
@changesets/config Patch
@changesets/cli Major
@changesets/apply-release-plan Patch
@changesets/get-release-plan 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

Comment thread packages/cli/src/commands/add/createChangeset.ts Outdated
Comment thread packages/cli/src/commands/add/createChangeset.ts Outdated
Comment thread packages/cli/src/commands/add/createChangeset.ts Outdated
Comment thread packages/cli/src/commands/add/index.ts Outdated
@Andarist
Copy link
Copy Markdown
Member

Andarist commented Mar 8, 2026

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

@Andarist
Copy link
Copy Markdown
Member

Andarist commented Mar 8, 2026

This will kinda also close #1043 and #1814

@beeequeue
Copy link
Copy Markdown
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
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 60.71429% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.93%. Comparing base (d165b4e) to head (d3bca0c).

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% 12 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 76.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   82.61%   83.93%   +1.31%     
==========================================
  Files          54       55       +1     
  Lines        2422     2359      -63     
  Branches      718      721       +3     
==========================================
- Hits         2001     1980      -21     
+ Misses        379      340      -39     
+ Partials       42       39       -3     

☔ 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.

@beeequeue
Copy link
Copy Markdown
Author

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

@Andarist
Copy link
Copy Markdown
Member

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

@beeequeue beeequeue marked this pull request as ready for review March 12, 2026 11:07
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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 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
@Andarist
Copy link
Copy Markdown
Member

@beeequeue could you sync this with next?

Comment thread packages/config/src/index.ts
Comment thread packages/cli/src/index.ts Outdated
Comment thread packages/cli/src/index.ts
Comment thread packages/cli/src/index.ts Outdated
@beeequeue
Copy link
Copy Markdown
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

@Andarist
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?

@beeequeue
Copy link
Copy Markdown
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 image

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

screenshot image

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

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