Skip to content

fix: replace removed inquirer list prompt with select - #599

Merged
lwasser merged 3 commits into
all-contributors:mainfrom
nhktmdzhg:fix/586
Nov 8, 2026
Merged

lwasser merged 3 commits into
all-contributors:mainfrom
nhktmdzhg:fix/586

Conversation

@nhktmdzhg

Copy link
Copy Markdown
Contributor

What:

Replace the three type: 'list' questions with type: 'select', and add a regression test that every init question uses a prompt type registered by inquirer.

  • src/cli.js — the "What do you want to do?" menu
  • src/init/prompt.js — the repository type and commit convention questions
  • src/init/prompt.js — questions is now exported so the prompt types can be asserted in a test
  • src/init/__tests__/prompt.js — new test: asserts each question type exists in inquirer.prompt.prompts

Why:

Closes #586. all-contributors-cli@7.0.0 depends on inquirer ^14.0.2 (resolved 14.2.5), but inquirer 14 removed the list prompt type in favour of select and does not alias it. PromptsRunner.prepareQuestion throws before any TTY work, so both all-contributors (no command) and all-contributors init crash with:

                                                                                                                                            
UnknownPromptTypeError: Prompt type "list" is not registered.                                                                               
Available prompt types: checkbox, confirm, editor, expand, input, number, password, rawlist, search, select                                 
                                                                                                                                            

How:

Only the type literal is changed; message, choices, when and default are left untouched, because the legacy inquirer.prompt() wrapper still resolves them per question in v14. select accepts the same shape already in use (choices as strings or {name, value} objects, plus default), so no question restructuring was needed and no downgrade of inquirer was required.

Verified:

  • Before the fix: bun dist/cli.js exits 1 with the UnknownPromptTypeError above.
  • After the fix: the menu renders and init runs to completion through a PTY, writing .all-contributorsrc with repoType: "github" and commitConvention: "angular".
  • The new test fails on the pre-fix tree (expected [ 'list' ] to deeply equal []) and passes after.
  • bunx vitest run — 16 files / 130 tests pass.
  • bun run build and bun install work unchanged; no dependency or lockfile changes.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@lwasser

lwasser commented Nov 7, 2026

Copy link
Copy Markdown
Member

@all-contributors add @nhktmdzhg for bug

@allcontributors

Copy link
Copy Markdown
Contributor

@lwasser

I've put up a pull request to add @nhktmdzhg! 🎉

@lwasser

lwasser commented Nov 7, 2026

Copy link
Copy Markdown
Member

hey @all-contributors/maintainers i'd love a second review here. This fixes the bug and adds a test.

It makes me think we want another test or two to cover all use cases. We'd want to do that before merging this as this will trigger a minor release (which we can also chose to not merge yet).

@michaelfaith michaelfaith left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 👍 Thanks!

@lwasser lwasser 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.

Approving and merging. we have other pr's in the pipelines to handle updates and i'm thinking about tests.

@lwasser

lwasser commented Nov 8, 2026

Copy link
Copy Markdown
Member

current error relates to a missing alt tag that i have already fixed and will be merged soon. merging.

@lwasser
lwasser merged commit 11c66e6 into all-contributors:main Nov 8, 2026
6 of 7 checks passed
@github-actions

Copy link
Copy Markdown

@all-contributors please add nhktmdzhg for code.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

@allcontributors

Copy link
Copy Markdown
Contributor

@github-actions[bot]

I've put up a pull request to add @nhktmdzhg! 🎉

michaelfaith pushed a commit that referenced this pull request Nov 25, 2026
Adds @nhktmdzhg as a contributor for code.

This was requested by github-actions[bot] [in this
comment](#599 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
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.

Invalid inquirer API access when running npx all-contributors init with v7.0.0

3 participants