fix(generators): register 'list' prompt type alias for newer inquirer…#3688
Open
rawestmoreland wants to merge 1 commit into
Open
fix(generators): register 'list' prompt type alias for newer inquirer…#3688rawestmoreland wants to merge 1 commit into
rawestmoreland wants to merge 1 commit into
Conversation
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem: Running
npx @feathersjs/cli generate app(or any generator command) fails on newer installations with:The root cause is a breaking change in
inquirerintroduced in a post-9.3.x release: thelistprompt type was renamed toselect. Because@featherscloud/piniondeclares"inquirer": "^9.3.2", npm can resolve a newer version wherelistno longer exists — but all generator prompts usetype: 'list'. The issue only manifested on global/npx installs where npm resolved the newer inquirer; local monorepo dev happened to pin to 9.3.8 (which still haslist), masking it.Fix: Added a one-time compatibility shim in
packages/generators/src/commons.tsthat runs at module load. It accesses the inquirer prompt singleton via pinion'sgetConfig()and, iflistis not registered butselectis, registerslistas an alias usingregisterPrompt. No prompt definitions were changed — generators continue to usetype: 'list'and work regardless of which inquirer version npm resolves.Related issues: None found, but this affects anyone running the CLI via
npxor a fresh global install where npm resolves a newer inquirer 9.x.Dependent PRs in other repos: None. The fix is self-contained in
@feathersjs/generators.Other Information
The shim is a two-line guard that is a no-op on older inquirer versions that already have
list, so there is no regression risk for existing installations: