Skip to content

feat: auto-generate supported routes docs page (#949)#979

Open
nud3l wants to merge 9 commits intomasterfrom
feat/949-auto-generate-routes-docs
Open

feat: auto-generate supported routes docs page (#949)#979
nud3l wants to merge 9 commits intomasterfrom
feat/949-auto-generate-routes-docs

Conversation

@nud3l
Copy link
Copy Markdown
Contributor

@nud3l nud3l commented Mar 9, 2026

Summary

  • TypeScript script (docs/gateway/scripts/generate-routes.ts) that fetches supported routes from the gateway API, resolves token symbols from the tokenlist, and generates a Mintlify docs page
  • The generated page (docs/gateway/gateway/supported-routes.mdx) shows all supported routes grouped by source chain
  • Added 16 missing token deployments (Optimism + Base) to the tokenlist to ensure complete coverage
  • Removed unused docusaurus-theme-openapi-docs and related deps that caused Vercel build failures

How it works

  • Runs as part of make openapi or standalone via make routes-docs
  • Fetches live routes from https://gateway-api-mainnet.gobob.xyz/v1/get-routes
  • Resolves token symbols by address lookup against tokenlist/tokenlist.json — no chain ID mapping needed
  • Automatically handles new chains from the API as long as token addresses are in the tokenlist
  • Logs warnings for any unresolved tokens

Changes since initial PR

  • Fixed all 28 "Unknown" token entries (now 0)
  • Added missing Optimism and Base token deployments to tokenlist (151 → 167 tokens)
  • Simplified script from 211 → 59 lines by removing chain ID mapping and using address-only lookup
  • Fixed "Bob" → "BOB" display
  • Removed unused docusaurus-theme-openapi-docs, docusaurus-plugin-openapi-docs, react-redux, @reduxjs/toolkit, and the Redux provider in Root.js — API docs are served by Mintlify, and the transitive postman-code-generators dep was causing webpack path polyfill errors on Vercel

Test plan

  • Run npx tsx docs/gateway/scripts/generate-routes.ts and verify the generated MDX file
  • Verify 0 "Unknown" tokens in output
  • Verify Docusaurus build passes (pnpm docusaurus build in docs/)
  • Verify Vercel deployment succeeds
  • Verify Mintlify deployment succeeds

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 9, 2026

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

Project Deployment Actions Updated (UTC)
bob-docs Ready Ready Preview, Comment Mar 30, 2026 0:55am

Request Review

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces an automated way to generate and maintain a documentation page detailing the supported routes and assets within the BOB Gateway. By fetching live data from the API and tokenlist, the generated MDX page provides an up-to-date reference for developers and users.

Highlights

  • New Documentation Page: Introduced a new documentation page for supported routes and assets in the BOB Gateway, providing a comprehensive list of supported chains and tokens.
  • Automated Generation: Implemented a TypeScript script to automatically generate the supported routes documentation page from the live Gateway API and BOB tokenlist, ensuring up-to-date information.
  • Makefile Integration: Updated the Makefile to include a routes-docs target, allowing easy generation of the documentation page as part of the build process.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Makefile
    • Added a routes-docs target to generate the supported routes documentation page.
    • Integrated the routes-docs target into the openapi target to automatically generate the documentation page during the OpenAPI build process.
  • docs/gateway/docs.json
    • Added gateway/supported-routes to the Overview group in the Gateway documentation navigation.
  • docs/gateway/gateway/supported-routes.mdx
    • Created a new MDX page to display the supported routes and assets, auto-generated from the Gateway API and BOB tokenlist.
  • docs/gateway/scripts/generate-routes.ts
    • Implemented a TypeScript script to fetch routes from the Gateway API, resolve token symbols from the tokenlist, and generate the MDX documentation page.
Activity
  • nud3l added a script to auto-generate a supported routes documentation page.
  • nud3l updated the Makefile to include a routes-docs target.
  • nud3l added the generated page to the Gateway docs navigation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an automated process to generate documentation for supported routes from the gateway API, enriching it with token symbols from the tokenlist. The changes include adding a new routes-docs target to the Makefile, integrating it into the openapi target, updating the docs.json navigation, and adding the TypeScript script responsible for generating the MDX documentation page. This is a valuable addition for keeping the documentation up-to-date with the live API.

Comment on lines +74 to +78
// Load tokenlist
const tokenlistPath = resolve(
dirname(new URL(import.meta.url).pathname),
"../../../tokenlist/tokenlist.json"
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The tokenlistPath is resolved using a fragile relative path (../../../tokenlist/tokenlist.json). This path is sensitive to changes in the script's location or the tokenlist's location. Using an environment variable, a configuration file, or a more robust path resolution utility would improve the script's maintainability and resilience to file system structure changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The path is resolved relative to the script's own location using import.meta.url, which is the standard ESM approach. It doesn't break if the CWD changes — only if the script or tokenlist move relative to each other. Given both live in the same repo, this is stable.

@gregdhill
Copy link
Copy Markdown
Contributor

Closes #949

Copy link
Copy Markdown
Contributor

@gregdhill gregdhill left a comment

Choose a reason for hiding this comment

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

Can we have the token addresses in the table? Also is there a way to fetch this dynamically rather than PR based? The routes may often change without us directly updating the spec

nud3l and others added 8 commits March 30, 2026 11:03
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nd fallback lookup

Add swell (1923) and telos (40) to chain ID mapping, handle aptos as
non-EVM chain, and add address-based fallback for cross-chain tokens
like WBTCOFT that share the same address across chains. Reduces
"Unknown" token entries from 28 to 0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge token addresses from @eth-optimism/tokenlist for gateway-supported
chains. Adds 16 new entries: WETH, wstETH, rETH, sfrxETH, UNI, FRAX,
FXS, USDT, T, TRB on Optimism, and WETH, wstETH, rETH, tBTC, UNI, TRB
on Base. Total tokens: 151 -> 167.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the hardcoded CHAIN_NAME_TO_ID mapping entirely. Since each token
has a unique contract address in the tokenlist, we can resolve symbols
by address alone without needing chain IDs. This means new chains added
to the gateway API are automatically supported as long as the token
addresses exist in the tokenlist. Also logs warnings for unresolved
tokens to surface gaps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove interfaces, intermediate data structures, and redundant passes.
211 -> 87 lines. Same output, zero dependencies, auto-handles new chains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove truncated address columns from tables (users can check tokenlist
for addresses), use Map.groupBy, trim MDX boilerplate. 87 -> 58 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace static generated MDX with an inline React component that fetches
routes from the Gateway API and token symbols from the GitHub-hosted
tokenlist at page load. Adds source/destination address columns.
Removes the generate-routes.ts script and routes-docs Makefile target.

Addresses review feedback: routes stay current without PRs, and token
addresses are now visible in the table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nud3l
Copy link
Copy Markdown
Contributor Author

nud3l commented Mar 30, 2026

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