Skip to content

refactor: replace got with native fetch API#4189

Merged
MarshallOfSound merged 1 commit intonextfrom
claude/remove-got-dependency-lKSlY
Mar 24, 2026
Merged

refactor: replace got with native fetch API#4189
MarshallOfSound merged 1 commit intonextfrom
claude/remove-got-dependency-lKSlY

Conversation

@MarshallOfSound
Copy link
Member

@MarshallOfSound MarshallOfSound commented Mar 24, 2026

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

This PR removes the got HTTP client library dependency and replaces it with the native fetch API, which is now available in Node.js. This reduces external dependencies and simplifies the codebase.

Changes:

  • Removed got dependency from @electron-forge/maker-zip and @electron-forge/core packages
  • Updated MakerZIP.ts to use native fetch() instead of got.get() for HTTP requests to the macOS update manifest URL
  • Updated response handling to use the Fetch API's Response object properties (status, json()) instead of got's response format (statusCode, body)
  • Updated test mocks in MakerZip.spec.ts to stub the global fetch function using vi.stubGlobal() instead of mocking the got module
  • Updated test assertions to verify mockFetch calls instead of got.get calls

The functionality remains identical - the code still fetches the RELEASES.json manifest from the configured URL and handles both successful (200) and not-found (404) responses appropriately.

https://claude.ai/code/session_01BYVpGL3mf7JBUZSnABvRR3

Replace the got HTTP client with native fetch in the zip maker for
fetching RELEASES.json manifests. Native fetch has been stable in
Node.js since v18 and the package already requires Node >= 22.12.0.

Also remove the unused got dependency from @electron-forge/core.
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner March 24, 2026 08:55
@github-actions github-actions bot added the next label Mar 24, 2026
@MarshallOfSound MarshallOfSound changed the title Replace got with native fetch API refactor: replace got with native fetch API Mar 24, 2026
@MarshallOfSound MarshallOfSound merged commit 392ca31 into next Mar 24, 2026
13 of 19 checks passed
@MarshallOfSound MarshallOfSound deleted the claude/remove-got-dependency-lKSlY branch March 24, 2026 16:46
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.

3 participants