Skip to content

Remove node-fetch fallback and drop CJS support#641

Merged
sr229 merged 4 commits into
masterfrom
remove-node-fetch-fallback-4499436934085221465
May 18, 2026
Merged

Remove node-fetch fallback and drop CJS support#641
sr229 merged 4 commits into
masterfrom
remove-node-fetch-fallback-4499436934085221465

Conversation

@sr229

@sr229 sr229 commented May 18, 2026

Copy link
Copy Markdown
Collaborator

This PR removes the legacy node-fetch fallback and drops CommonJS (CJS) support, as the latest Node.js LTS versions now natively support the Fetch API. The library is now ESM-only and has a leaner code base.

Key changes:

  • Removed node-fetch and @types/node-fetch dependencies.
  • Updated src/sagiri.ts to use the global fetch API.
  • Removed the main field and require export from package.json.
  • Removed Node.js specific test and coverage scripts.
  • Deleted test/node/commonjs.test.cjs.
  • Cleaned up unused test-related devDependencies.
  • Updated CHANGELOG.md with version 4.3.0 notes.

PR created automatically by Jules for task 4499436934085221465 started by @sr229

- Removed node-fetch from optionalDependencies and @types/node-fetch from devDependencies.
- Refactored src/sagiri.ts to use native fetch and removed legacy fallback logic.
- Dropped CommonJS (CJS) support, making the library ESM-only.
- Updated package.json exports and removed Node.js specific scripts.
- Deleted CJS test file test/node/commonjs.test.cjs.
- Cleaned up unused devDependencies (mocha, nyc).
- Updated CHANGELOG.md for version 4.3.0.

Co-authored-by: sr229 <14976516+sr229@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits May 18, 2026 10:20
- Fixed Deno type check errors by using type-only import for IResult in util.ts.
- Added Deno namespace reference to Deno tests.
- Updated GitHub Actions test-node job to use bun for coverage instead of removed coverage:nodejs.

Co-authored-by: sr229 <14976516+sr229@users.noreply.github.com>
The test-node job was failing because it tried to run `bun run coverage` without having Bun installed in that job's environment. Added `oven-sh/setup-bun@v2` to the `test-node` job.

Co-authored-by: sr229 <14976516+sr229@users.noreply.github.com>
Since we are no longer running Node.js specific tests (dropped CJS/mocha), the `test-node` job was redundant and actually incorrect as it tried to use `bun`. We now rely on `test-bun` and `test-deno` jobs.

- Removed `test-node` job from `.github/workflows/test.yml`.
- Removed empty `test/node` directory.

Co-authored-by: sr229 <14976516+sr229@users.noreply.github.com>
@sr229 sr229 marked this pull request as ready for review May 18, 2026 10:36
@sr229 sr229 merged commit ad82dec into master May 18, 2026
6 of 7 checks passed
@sr229 sr229 deleted the remove-node-fetch-fallback-4499436934085221465 branch May 18, 2026 10:41
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.

1 participant