Skip to content

fix(deps): drop @octokit/rest and inquirer-autocomplete-prompt - #8549

Merged
paulo merged 3 commits into
mainfrom
chore/trim-deps-octokit-autocomplete
Oct 2, 2026
Merged

paulo merged 3 commits into
mainfrom
chore/trim-deps-octokit-autocomplete

Conversation

@paulo

@paulo paulo commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The installed CLI is about 340 MB. This PR removes two dependencies that cost far more than they give us:

Removed Replaced with Why it was heavy
@octokit/rest src/utils/github-api.ts, a small fetch wrapper Mostly @octokit/openapi-types (types only, 3 copies) for the 7 endpoints we call
inquirer-autocomplete-prompt (+ @types/…) @inquirer/search (580 KB) Ships its own copy of rxjs 6 (~17 MB on disk)

Measured by installing a packed tarball with --ignore-scripts on 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 an HttpError-named error carrying status, so the existing 404 handling still works.
  • It keeps Octokit's exact output:
    • message format: <message>[: <errors>][ - <documentation_url>]
    • the v3 Accept header
    • the application/json; charset=utf-8 body type
  • Users see the same errors as before, and addDeployHook still detects Hook already exists on this repository.
  • Call sites in gh-auth.ts, create-action.ts and init/config-github.ts now pass the token around instead of an Octokit instance.

Search prompt

  • Converted the workspace picker (base-command.ts), the multiple-frameworks prompt (build-info.ts) and the template picker (functions-create.ts).
  • functions-create uses @inquirer/search's Separator. inquirer 8's Separator would render as undefined in the new prompt.
  • Ctrl+C makes @inquirer/search reject with ExitPromptError. BaseCommand.onEnd now exits with a new EXIT_CODES.INTERRUPTED (130) and prints nothing, which matches a SIGINT-terminated process. On main, Ctrl+C at any prompt exits 13 with an "unsettled top-level await" warning.

Known UX difference

  • @inquirer/search doesn'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.

  • Open a bug/issue before writing your code 🧑‍💻
  • Read the contribution guidelines 📖
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: d2ab30d8-beb4-4cf1-8ece-08a0f93290a8

📥 Commits

Reviewing files that changed from the base of the PR and between e2b1875 and 9115225.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • tests/integration/__snapshots__/framework-detection.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • package.json
 __________________________________________________________________
< Series-B funding secured. Now, I can afford to review your code. >
 ------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: f2398afa-4130-4715-a109-dab809c35569

📥 Commits

Reviewing files that changed from the base of the PR and between f845e14 and e2b1875.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • tests/integration/__snapshots__/framework-detection.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (13)
  • package.json
  • src/commands/base-command.ts
  • src/commands/create/create-action.ts
  • src/commands/functions/functions-create.ts
  • src/utils/build-info.ts
  • src/utils/exit-codes.ts
  • src/utils/gh-auth.ts
  • src/utils/github-api.ts
  • src/utils/init/config-github.ts
  • tests/unit/commands/base-command-on-end.test.ts
  • tests/unit/utils/exit-codes.test.ts
  • tests/unit/utils/github-api.test.ts
  • tests/unit/utils/init/config-github.test.ts
🔗 Linked repositories identified

CodeRabbit 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.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Interactive workspace and template selection now uses searchable prompts.
    • Canceling an interactive prompt with Ctrl+C exits with the standard interrupted status.
  • Bug Fixes

    • GitHub API errors now include relevant response details, including validation information when available.

Walkthrough

The 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 @inquirer/search for workspace, function-template, and settings selection. It also adds an interrupted exit code and handles prompt cancellation in BaseCommand.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: serhalp

Merge Risk: ⚪ Minimal · up to e2b18

The reviewed changes are mergeable after normal checks; no concrete new failure remains identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 12 files. (1 skipped: 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main dependency removals implemented by the pull request.
Description check ✅ Passed The description directly explains the dependency replacements, GitHub client changes, prompt changes, size reduction, behavior differences, and test updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

📊 Benchmark results

Comparing with 1900952

  • Dependency count: 1,053 ⬇️ 1.61% decrease vs. 1900952
  • Package size: 400 MB ⬇️ 6.25% decrease vs. 1900952
  • Number of ts-expect-error directives: 333 ⬇️ 3.00% decrease vs. 1900952

@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/netlify-cli@8549

commit: 9115225

@paulo
paulo added this pull request to stack #8552 October 2, 2026 09:16
@paulo

paulo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@paulo
paulo requested a review from JakeChampion October 2, 2026 10:22
@paulo
paulo marked this pull request as ready for review October 2, 2026 10:22
@paulo
paulo requested a review from a team as a code owner October 2, 2026 10:22
paulo added 3 commits October 2, 2026 16:03
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.
@paulo
paulo force-pushed the chore/trim-deps-octokit-autocomplete branch from e2b1875 to 9115225 Compare October 2, 2026 14:03
@paulo
paulo removed this pull request from stack #8552 October 2, 2026 14:08
@paulo
paulo enabled auto-merge (squash) October 2, 2026 14:08
@paulo
paulo merged commit 511c37d into main Oct 2, 2026
36 of 37 checks passed
@paulo
paulo deleted the chore/trim-deps-octokit-autocomplete branch October 2, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants