Skip to content

refactor: replace axios with native fetch API - #67

Merged
designcode merged 4 commits into
mainfrom
refactor/replace-axios-with-fetch
Apr 6, 2026
Merged

designcode merged 4 commits into
mainfrom
refactor/replace-axios-with-fetch

Conversation

@designcode

@designcode designcode commented Apr 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Replace all axios usage in src/auth/client.ts and src/auth/fly.ts with the native fetch API
  • Remove axios dependency, eliminating 23 transitive packages
  • Use URLSearchParams for application/x-www-form-urlencoded request bodies
  • Handle error responses via response.ok checks instead of axios.isAxiosError

Test plan

  • All 529 existing tests pass
  • TypeScript compiles with no errors
  • Lint and format checks pass
  • Manual: tigris login device flow works end-to-end
  • Manual: token refresh succeeds after expiry

🤖 Generated with Claude Code


Note

Medium Risk
Touches the CLI’s Auth0 device-flow and token refresh HTTP calls; behavior changes around request encoding and error handling could break login/refresh in subtle ways.

Overview
Replaces axios with native fetch for Auth0 calls in src/auth/client.ts (device authorization, token polling, refresh) and src/auth/fly.ts (/userinfo).

Requests now use URLSearchParams for application/x-www-form-urlencoded bodies and switch to response.ok/manual JSON parsing for error handling. The axios dependency is removed from package.json.

Reviewed by Cursor Bugbot for commit d6690f2. Bugbot is set up for automated code reviews on this repo. Configure here.

Remove axios dependency and use the built-in fetch API for all HTTP
requests in the auth module. This eliminates 23 transitive packages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 54fb3a7. Configure here.

Comment thread src/auth/client.ts Resolved
designcode and others added 3 commits April 5, 2026 20:50
Remove @semantic-release/git and @semantic-release/changelog from
devDependencies — neither is listed in the release.plugins config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Check tokenSet.refreshToken is defined before using it, since
URLSearchParams converts undefined to the literal string "undefined".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Running npm uninstall on macOS pruned the lockfile entries for
non-local platform native binaries (rolldown linux/win bindings),
breaking npm ci on Linux CI runners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@designcode
designcode merged commit dbe50e1 into main Apr 6, 2026
3 checks passed
@designcode
designcode deleted the refactor/replace-axios-with-fetch branch April 6, 2026 14:55
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants