Skip to content

fix: replace direct axios usage with native fetch#615

Merged
ECWireless merged 6 commits intomainfrom
fix/remove-axios-supply-chain
Apr 1, 2026
Merged

fix: replace direct axios usage with native fetch#615
ECWireless merged 6 commits intomainfrom
fix/remove-axios-supply-chain

Conversation

@rickstaa
Copy link
Copy Markdown
Member

@rickstaa rickstaa commented Apr 1, 2026

Summary

  • Replace axios with native fetch — removes direct axios usage (and wait-on) from the project, reducing supply chain attack surface while preserving identical error-handling and 10s timeout behavior
  • Note: axios still exists as a transitive dependency (via @coinbase/cdp-sdk)

Stack (3/3): #617#616#615 (this PR). Merge in order.

Test plan

  • Verify the app builds successfully (pnpm build)
  • Verify SWR data fetching still works (orchestrator list, gateway pages)
  • Confirm error responses from /api/* routes surface correct error messages

🤖 Generated with Claude Code

@rickstaa rickstaa requested a review from ECWireless as a code owner April 1, 2026 10:59
Copilot AI review requested due to automatic review settings April 1, 2026 10:59
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Apr 1, 2026 0:39am

Request Review

@rickstaa rickstaa changed the base branch from main to feat/dev-container-supply-chain April 1, 2026 11:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to harden the project’s supply chain by removing direct axios usage in the app’s SWR fetcher, adding development isolation via a VS Code dev container, and introducing install-time guardrails via .npmrc.

Changes:

  • Replace the axios-based SWR fetcher with a native fetch implementation (10s timeout + API error formatting).
  • Add a VS Code Dev Container configuration to run development inside a container.
  • Add .npmrc restrictions (frozen-lockfile, ignore-scripts) and ignore .pnpm-store in tooling.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Documents the dev container workflow and the new .npmrc guardrails.
package.json Removes direct axios and wait-on dependencies; updates app import to new fetcher.
pnpm-lock.yaml Updates lockfile to reflect removed direct dependencies and transitive cleanup.
pages/_app.tsx Switches SWR config to import fetcher from @lib/fetcher.
lib/fetcher.ts Introduces the new fetch-based SWR fetcher with timeout and error handling.
lib/axios.ts Removes the previous axios client + fetcher implementation.
.npmrc Enforces frozen lockfile installs and disables lifecycle scripts.
.prettierignore Ignores .pnpm-store from formatting.
.gitignore Ignores .pnpm-store from git.
.devcontainer/devcontainer.json Adds the dev container definition and post-create install command.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/fetcher.ts Outdated
Comment thread lib/fetcher.ts Outdated
Comment thread package.json
@rickstaa rickstaa changed the title fix: remove axios and harden supply chain fix: replace direct axios usage with native fetch Apr 1, 2026
rickstaa and others added 3 commits April 1, 2026 14:25
prettier was used in format scripts and pre-commit hooks but was never
declared as a dependency — it only worked as a ghost dependency via
transitive hoisting. This breaks on pnpm 10+ which is stricter about
hoisting.

Also ignore .pnpm-store in .gitignore and .prettierignore.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Isolate development in a container to limit blast radius of compromised
packages, and enforce frozen-lockfile + ignore-scripts via .npmrc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pnpm 10+ blocks dependency install scripts (postinstall, preinstall) by
default, replacing the need for ignore-scripts in .npmrc. This protects
against malicious packages without breaking the project's own lifecycle
hooks (e.g. prepare: husky).

See: https://pnpm.io/supply-chain-security

Changes:
- Remove .npmrc (ignore-scripts no longer needed, frozen-lockfile is
  enforced by CI via --frozen-lockfile flag)
- Bump packageManager to pnpm@10.33.0
- Update CI workflows to use pnpm 10.33.0
- Update README to document pnpm 10 approach and link to docs
- Update devcontainer image tag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rickstaa rickstaa force-pushed the feat/dev-container-supply-chain branch from 7830d01 to e3b563d Compare April 1, 2026 12:27
rickstaa and others added 3 commits April 1, 2026 14:34
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rface

Remove axios and wait-on dependencies, replacing the axios-based fetcher
with a native fetch implementation that preserves the same error handling
and timeout behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address Copilot review: move clearTimeout after body read so the
AbortController covers slow-streaming responses, and enrich non-2xx
errors with statusText.

Co-Authored-By: copilot-pull-request-reviewer[bot] <noreply@github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this from Triage to Ready to Merge in Engineering Roadmap Apr 1, 2026
Base automatically changed from feat/dev-container-supply-chain to main April 1, 2026 22:02
@ECWireless ECWireless merged commit c2a7d06 into main Apr 1, 2026
3 checks passed
@ECWireless ECWireless deleted the fix/remove-axios-supply-chain branch April 1, 2026 22:07
@github-project-automation github-project-automation Bot moved this from Ready to Merge to Done in Engineering Roadmap Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants