Repository navigation
fix: replace removed inquirer list prompt with select - #599
Conversation
|
@all-contributors add @nhktmdzhg for bug |
|
I've put up a pull request to add @nhktmdzhg! 🎉 |
|
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). |
lwasser
left a comment
There was a problem hiding this comment.
Approving and merging. we have other pr's in the pipelines to handle updates and i'm thinking about tests.
|
current error relates to a missing alt tag that i have already fixed and will be merged soon. merging. |
|
@all-contributors please add nhktmdzhg for code.
|
|
@github-actions[bot] I've put up a pull request to add @nhktmdzhg! 🎉 |
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>
What:
Replace the three
type: 'list'questions withtype: 'select', and add a regression test that everyinitquestion uses a prompt type registered by inquirer.src/cli.js— the "What do you want to do?" menusrc/init/prompt.js— the repository type and commit convention questionssrc/init/prompt.js—questionsis now exported so the prompt types can be asserted in a testsrc/init/__tests__/prompt.js— new test: asserts each questiontypeexists ininquirer.prompt.promptsWhy:
Closes #586.
all-contributors-cli@7.0.0depends oninquirer ^14.0.2(resolved 14.2.5), but inquirer 14 removed thelistprompt type in favour ofselectand does not alias it.PromptsRunner.prepareQuestionthrows before any TTY work, so bothall-contributors(no command) andall-contributors initcrash with:How:
Only the
typeliteral is changed;message,choices,whenanddefaultare left untouched, because the legacyinquirer.prompt()wrapper still resolves them per question in v14.selectaccepts the same shape already in use (choicesas strings or{name, value}objects, plusdefault), so no question restructuring was needed and no downgrade ofinquirerwas required.Verified:
bun dist/cli.jsexits 1 with theUnknownPromptTypeErrorabove.initruns to completion through a PTY, writing.all-contributorsrcwithrepoType: "github"andcommitConvention: "angular".expected [ 'list' ] to deeply equal []) and passes after.bunx vitest run— 16 files / 130 tests pass.bun run buildandbun installwork unchanged; no dependency or lockfile changes.Checklist: