fix(prompts): replace removed inquirer "list" prompt type with "select"#406
Conversation
inquirer v14 (the @inquirer/prompts rewrite) removed the legacy "list" prompt type (renamed "select" in v10). Five call sites still used it, crashing interactive flows at runtime with 'Prompt type "list" is not registered' — notably the signup prompt during `archgate login`. Nothing in the pipeline could catch this class of bug: - tsc cannot: inquirer's legacy prompt() types accept any `type: string` via the CustomQuestion escape hatch that exists for registerPrompt() (verified: `type: "bogus-nonsense"` compiles clean under strict mode) - tests cannot: interactive prompts need a TTY, so every test mocks the inquirer module entirely and the runtime prompt registry never runs Add a custom oxlint JS plugin (.archgate/lint/oxlint.ts) with rule archgate/valid-inquirer-prompt-type that validates `type:` literals in inquirer.prompt() question objects. The registered set is read from the installed inquirer at plugin load (Object.keys(inquirer.prompt.prompts)), so the rule self-updates on dependency bumps: a future rename/removal makes stale call sites fail `bun run lint` in the bump PR itself. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
📝 WalkthroughWalkthroughThe PR adds a custom oxlint rule to validate inquirer prompt types against the installed registry at lint time, updates five interactive prompts across commands and helpers to use the "select" type instead of "list", configures the new rule in oxlintrc, and documents the enforcement strategy for static invariants. ChangesInquirer Prompt Type Validation
🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Deploying archgate-cli with
|
| Latest commit: |
62f5136
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f803e123.archgate-cli.pages.dev |
| Branch Preview URL: | https://fix-inquirer-v14-select-prom.archgate-cli.pages.dev |
Code Coverage
Full HTML report available in workflow artifacts. Per-directory breakdown
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
@.claude/agent-memory/archgate-developer/feedback_prefer_tests_over_adr_rules.md:
- Around line 8-18: Add a top-level markdown heading after the document
frontmatter to satisfy the static linter: insert a single-line heading beginning
with "#" (e.g., "# Archgate guidance: prefer tests over ADR rules") immediately
following the YAML/frontmatter block so the file starts with a top-level heading
while preserving the existing content; ensure the heading is the first
non-frontmatter line so the linter no longer flags the missing top-level
heading.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 689944f4-f1e2-495b-ac86-959e132150e2
📒 Files selected for processing (9)
.archgate/lint/oxlint.ts.claude/agent-memory/archgate-developer/MEMORY.md.claude/agent-memory/archgate-developer/feedback_prefer_tests_over_adr_rules.md.oxlintrc.jsonsrc/commands/adr/create.tssrc/commands/adr/sync.tssrc/commands/init.tssrc/helpers/editor-detect.tssrc/helpers/login-flow.ts
|
@coderabbitai resolve |
✅ Action performedComments resolved and changes approved. |
# archgate ## [0.45.2](v0.45.1...v0.45.2) (2026-06-11) ### Bug Fixes * **prompts:** replace removed inquirer "list" prompt type with "select" ([#406](#406)) ([34b72d7](34b72d7)) --- This PR was generated with [simple-release](https://github.com/TrigenSoftware/simple-release). <details> <summary>📄 Cheatsheet</summary> <br> You can configure the bot's behavior through a pull request comment using the `!simple-release/set-options` command. ### Command Format ````md !simple-release/set-options ```json { "bump": {}, "publish": {} } ``` ```` ### Useful Parameters #### Bump | Parameter | Type | Description | |-----------|------|-------------| | `version` | `string` | Force set specific version | | `as` | `'major' \| 'minor' \| 'patch' \| 'prerelease'` | Release type | | `prerelease` | `string` | Pre-release identifier (e.g., "alpha", "beta") | | `firstRelease` | `boolean` | Whether this is the first release | | `skip` | `boolean` | Skip version bump | | `byProject` | `Record<string, object>` | Per-project bump options for monorepos | #### Publish | Parameter | Type | Description | |-----------|------|-------------| | `skip` | `boolean` | Skip publishing | | `access` | `'public' \| 'restricted'` | Package access level | | `tag` | `string` | Tag for npm publication | ### Usage Examples #### Force specific version ````md !simple-release/set-options ```json { "bump": { "version": "2.0.0" } } ``` ```` #### Force major bump ````md !simple-release/set-options ```json { "bump": { "as": "major" } } ``` ```` #### Create alpha pre-release ````md !simple-release/set-options ```json { "bump": { "prerelease": "alpha" } } ``` ```` #### Publish with specific access and tag ````md !simple-release/set-options ```json { "bump": { "prerelease": "beta" }, "publish": { "access": "public", "tag": "beta" } } ``` ```` ### Access Restrictions The command can only be used by users with permissions: - repository owner - organization member - collaborator ### Notes - The last comment with `!simple-release/set-options` command takes priority - JSON must be valid, otherwise the command will be ignored - Parameters apply only to the current release execution - The command can be updated by editing the comment or adding a new one </details> <!-- Please do not edit this comment. simple-release-pull-request: true simple-release-branch-from: release simple-release-branch-to: main --> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Summary
archgate loginsignup (and four other interactive flows) crashed at runtime with:inquirer v14 (the
@inquirer/promptsrewrite) removed the legacy"list"prompt type — it was renamed"select"in v10. Five call sites still used it after the dependency bump.Fix
type: "list"withtype: "select"inlogin-flow.ts,editor-detect.ts,init.ts,adr/create.ts,adr/sync.ts.Why nothing caught it
prompt()types accept anytype: stringvia theCustomQuestionescape hatch that exists forregisterPrompt(). Verified empirically —type: "bogus-nonsense"compiles clean under strict mode.mock.module); the runtime prompt registry is never exercised.Regression guard
New custom oxlint JS plugin
.archgate/lint/oxlint.tswith rulearchgate/valid-inquirer-prompt-type:type:string literals ininquirer.prompt()question objects (bothprompt({...})andprompt([{...}])forms).Object.keys(inquirer.prompt.prompts)) — no hardcoded allowlist. If a future inquirer version renames or removes a type again, stale call sites failbun run lintdirectly in the dependency-bump PR.Test plan
type: "list"failsbun run lintwith a span-precise diagnostic atlogin-flow.ts:135bun run validatefully green (lint 0/0, typecheck, format, 1262 tests, archgate check 39/39, knip, build)Summary by CodeRabbit
New Features
Chores