-
Notifications
You must be signed in to change notification settings - Fork 539
[Docs] Add Onramp extension to sidebar and typedoc #7167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Add Onramp extension to sidebar and typedoc #7167
Conversation
|
WalkthroughA new "Onramp" subsection was added to the sidebar in the portal app, dynamically generating links for functions tagged with Changes
Sequence Diagram(s)sequenceDiagram
participant Sidebar as Sidebar Component
participant Docs as docs.functions Array
Sidebar->>Docs: Filter functions with @bridge and extension "Onramp"
Docs-->>Sidebar: Return filtered functions
Sidebar->>Sidebar: Map each function to sidebar link (name, URL)
Sidebar->>User: Display "Onramp" subsection with generated links
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/portal/src/app/typescript/v5/sidebar.tsx (1)
287-315
: Correct implementation but consider refactoring for DRY principle.The "Onramp" subsection implementation is functionally correct and follows the established pattern used by "Buy" and "Sell" subsections. However, there's significant code duplication across all three subsections.
Consider extracting the common filtering and mapping logic into a reusable function:
+const createBridgeSubsection = (extensionName: string) => ({ + name: extensionName, + links: docs.functions + ?.filter((f) => { + const [tag] = getCustomTag(f) || []; + if (tag !== "@bridge") return false; + const blockTag = f.signatures?.[0]?.blockTags?.find( + (b) => b.tag === "@bridge", + ); + const actualExtensionName = blockTag + ? getExtensionName(blockTag) || "Common" + : "Common"; + return actualExtensionName === extensionName; + }) + .map((f) => { + const blockTag = f.signatures?.[0]?.blockTags?.find( + (b) => b.tag === "@bridge", + ); + const actualExtensionName = blockTag + ? getExtensionName(blockTag) || "Common" + : "Common"; + return { + name: f.name, + href: `${slug}/${actualExtensionName.toLowerCase()}/${f.name}`, + }; + }) || [], +}); { name: "Bridge, Swap, and Onramp", links: [ - { - name: "Buy", - links: /* ... existing Buy logic ... */ - }, - { - name: "Sell", - links: /* ... existing Sell logic ... */ - }, - { - name: "Onramp", - links: /* ... new Onramp logic ... */ - }, + createBridgeSubsection("Buy"), + createBridgeSubsection("Sell"), + createBridgeSubsection("Onramp"), /* ... rest of links ... */ ], }This would eliminate the duplicated filtering and mapping logic while maintaining the same functionality.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/portal/src/app/typescript/v5/sidebar.tsx
(1 hunks)packages/thirdweb/scripts/typedoc.mjs
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/portal/src/app/typescript/v5/sidebar.tsx (1)
apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts (2)
getCustomTag
(108-138)getExtensionName
(409-427)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
packages/thirdweb/scripts/typedoc.mjs (1)
16-16
: LGTM! Consistent with existing bridge entry points.The addition of
"src/bridge/Onramp.ts"
follows the established pattern and naming convention used for other bridge-related entry points likeBuy.ts
andSell.ts
.
size-limit report 📦
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7167 +/- ##
=======================================
Coverage 55.66% 55.67%
=======================================
Files 904 904
Lines 58391 58391
Branches 4112 4119 +7
=======================================
+ Hits 32505 32510 +5
+ Misses 25780 25775 -5
Partials 106 106
🚀 New features to boost your workflow:
|
PR-Codex overview
This PR introduces support for an
Onramp
feature in the codebase, enhancing the documentation generation by filtering and mapping functions related toOnramp
.Detailed summary
src/bridge/Onramp.ts
to the project.Onramp
in the sidebar of the documentation.@bridge
and belonging to theOnramp
extension.Summary by CodeRabbit