feat(inquirerer): add boolean alias and json question types#69
Merged
pyramation merged 1 commit intomainfrom Mar 5, 2026
Merged
Conversation
- Add BooleanQuestion type as semantic alias for confirm (y/n prompt) - Add JsonQuestion type with JSON.parse validation - Add json handler method to Inquirerer class - Route 'boolean' type to confirm handler in handleQuestionType - Add (JSON) hint in prompt message for json type - Add tests for both new types (interactive, noTty, CLI flag override) - Fix inputQueue/currentInputIndex not being reset in beforeEach - Update README with Boolean Question and JSON Question docs - Update TypeScript imports section and Table of Contents
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
4 tasks
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.
feat(inquirerer): add boolean alias and json question types
Summary
Adds two new question types to inquirerer:
boolean— Semantic alias forconfirm. Routes to the same y/n handler but provides a more natural type name when generating CLI prompts from schema types where the field isBoolean.json— New handler that accepts raw JSON string input, validates withJSON.parse(), and returns the parsed object. Shows a(JSON)hint in the prompt. Returnsnullfor invalid JSON.Also fixes a pre-existing test isolation bug where
inputQueue/currentInputIndexweren't reset between tests inbeforeEach.Review & Testing Checklist for Human
json()return type isRecord<string, unknown>butJSON.parse()can return arrays, primitives, etc. Verify this is intentionally restrictive or should be widened tounknownnullinstead of re-prompting or showing a parse error message. Confirm this is acceptable UX for interactive use — users get no feedback about why their input was rejectedas unknown as ConfirmQuestioncast inhandleQuestionTypefor the boolean case — works becauseconfirm()only readsquestion.default(which isbooleanon both types), but is fragile ifconfirm()ever reads aConfirmQuestion-specific propertyjson()noTty path returns implicitundefined(via barereturn;) when no default exists, which doesn't match the declared return typePromise<Record<string, unknown> | null>. Check if this causes downstream issuesRecommended test: Run the test suite locally with
npx jest --config jest.config.jsfrompackages/inquirerer/and verify all 150 tests pass.Notes