Skip to content

Refactor/prompts readline node prefix - #3353

Open
Nehachavan03 wants to merge 3 commits into
Karanjot786:mainfrom
Nehachavan03:refactor/prompts-readline-node-prefix
Open

Refactor/prompts readline node prefix#3353
Nehachavan03 wants to merge 3 commits into
Karanjot786:mainfrom
Nehachavan03:refactor/prompts-readline-node-prefix

Conversation

@Nehachavan03

@Nehachavan03 Nehachavan03 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request refactors the built-in readline imports in the @termuijs/ui package to use the node: protocol prefix (i.e. node:readline). This ensures compliance with the workspace rules defined in AGENTS.md:

Use the node: prefix for Node built-ins: import { readFileSync } from 'node:fs', not 'fs'.

Changes:

  • prompts.ts: Changed import * as readline from 'readline' to import * as readline from 'node:readline'.
  • prompts.test.ts: Changed the mock and import path for readline to node:readline.

Related Issues

Closes #3350

Type of Change

  • Refactoring (non-breaking change which improves code quality and style alignment)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Verification & Testing

Before opening this PR, the following verification commands were run and passed successfully:

  • bun run build (All packages built successfully)
  • bun vitest run packages/ui (All 2,176 tests in the UI package passed)
  • bun run typecheck (No TypeScript / type-checking errors)

Summary by CodeRabbit

  • Chores
    • Updated internal Node.js module references for improved consistency and compatibility.
    • Updated related test coverage to match the standardized module reference.

@github-actions github-actions Bot added area:ui @termuijs/ui type:testing +10 pts. Tests. labels Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 644e50b8-1bb6-4283-b7a4-d155505ee446

📥 Commits

Reviewing files that changed from the base of the PR and between 48f63a1 and b363a17.

📒 Files selected for processing (2)
  • packages/ui/src/prompts.test.ts
  • packages/ui/src/prompts.ts

📝 Walkthrough

Walkthrough

The UI prompt module now imports Node.js readline through node:readline. Its test mock uses the same module specifier.

Changes

Readline import alignment

Layer / File(s) Summary
Update readline specifiers
packages/ui/src/prompts.ts, packages/ui/src/prompts.test.ts
The production import and test mock target now use node:readline.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested labels: quality:clean, type:refactor

Suggested reviewers: karanjot786

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, links issue #3350, identifies the refactor, and reports testing, but omits several template sections and checklist details. Complete the package, checklist, GSSoC participation/profile, and reviewer notes sections; state when UI screenshots are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the readline import refactor and the node: prefix change.
Linked Issues check ✅ Passed The PR updates both the production import and its test mock to node:readline, fully satisfying issue #3350.
Out of Scope Changes check ✅ Passed The two changed files directly support issue #3350, and no unrelated code changes are identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui @termuijs/ui type:testing +10 pts. Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] refactor(ui): prefix built-in 'readline' import with 'node:' in prompts

1 participant