fix(deps): drop @octokit/rest and inquirer-autocomplete-prompt - #8549
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (13)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC. 📝 SummarySummary by CodeRabbit
WalkthroughThe pull request adds a fetch-based GitHub REST API helper and migrates GitHub authentication and repository setup calls to use it. It replaces autocomplete prompts with Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reviewed changes are mergeable after normal checks; no concrete new failure remains identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
commit: |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Replace @octokit/rest with a small fetch-based GitHub client covering the handful of endpoints the CLI calls, and replace inquirer-autocomplete-prompt with @inquirer/search. Together they remove ~32 MB, 30 packages and ~3,600 files from the installed CLI.
Keep 'HttpError: <message> - <documentation_url>' output, the v3 Accept header and the JSON charset that Octokit sent, so error output and requests are unchanged for users.
@inquirer/search rejects with ExitPromptError on Ctrl+C, which surfaced as a logged error with exit code 1. Exit with a new INTERRUPTED (130) code instead, matching a SIGINT-terminated process.
e2b1875 to
9115225
Compare
Summary
The installed CLI is about 340 MB. This PR removes two dependencies that cost far more than they give us:
@octokit/restsrc/utils/github-api.ts, a smallfetchwrapper@octokit/openapi-types(types only, 3 copies) for the 7 endpoints we callinquirer-autocomplete-prompt(+@types/…)@inquirer/search(580 KB)Measured by installing a packed tarball with
--ignore-scriptson macOS arm64: 342 MB → 310 MB, 30 fewer packages, about 3,600 fewer files. #8551 is stacked on this PR, moves the remaining prompts off inquirer, and brings the total to 288 MB.GitHub client
requestGitHub<T>(token, method, path, { query, body })throws anHttpError-named error carryingstatus, so the existing 404 handling still works.<message>[: <errors>][ - <documentation_url>]v3Acceptheaderapplication/json; charset=utf-8body typeaddDeployHookstill detectsHook already exists on this repository.gh-auth.ts,create-action.tsandinit/config-github.tsnow pass the token around instead of an Octokit instance.Search prompt
base-command.ts), the multiple-frameworks prompt (build-info.ts) and the template picker (functions-create.ts).functions-createuses@inquirer/search'sSeparator. inquirer 8'sSeparatorwould render asundefinedin the new prompt.@inquirer/searchreject withExitPromptError.BaseCommand.onEndnow exits with a newEXIT_CODES.INTERRUPTED(130) and prints nothing, which matches a SIGINT-terminated process. Onmain, Ctrl+C at any prompt exits 13 with an "unsettled top-level await" warning.Known UX difference
@inquirer/searchdoesn't wrap around: pressing ↑ on the first item stays there instead of jumping to the last. The library hardcodes this. Typing to filter and ↓ navigation behave the same.