Skip to content

feat(docs/ensnode.io): Add API Reference#1805

Open
shrugs wants to merge 17 commits intomainfrom
temp/scalar-astro-example
Open

feat(docs/ensnode.io): Add API Reference#1805
shrugs wants to merge 17 commits intomainfrom
temp/scalar-astro-example

Conversation

@shrugs
Copy link
Copy Markdown
Collaborator

@shrugs shrugs commented Mar 20, 2026

Summary

  • Added interactive Scalar API reference component embedded within Starlight documentation
  • Overrode Starlight's TwoColumnContent to always render the right sidebar column and remove isolation: isolate from .main-pane
  • Disabled dark mode across the docs site
  • Removed the separate standalone API reference page

Why

Embedding the Scalar API reference directly in Starlight provides an integrated documentation experience.

How it was tested

  • Opened the API reference page and clicked "Test Request" and observed the modal rendering
  • Verified other pages with tableOfContents enabled still display the TOC and TelegramInvite correctly
  • Verified the API reference page (with tableOfContents: false) shows TelegramInvite in the right sidebar
  • Confirmed content width is consistent between pages with and without TOC

Notes

  • The TwoColumnContent override is a near-copy of Starlight's original with three changes
    • Removed the toc && guard on the <aside>
    • removed isolation: isolate from .main-pane
    • changed [data-has-sidebar][data-has-toc] to [data-has-sidebar] in the width selector. These are all internal to the component and can't be achieved by wrapping the default.
  • If Starlight updates TwoColumnContent upstream, this override may need to be synced.
  • Scalar's CSS uses .scalar-app .z-overlay (descendant selector) for the modal's z-index, but both classes are on the same element. This is a Scalar bug, but removing isolation: isolate makes it moot since the modal's stacking context is no longer trapped.

Copilot AI review requested due to automatic review settings March 20, 2026 21:56
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 20, 2026

⚠️ No Changeset found

Latest commit: 17c8ff1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 20, 2026

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

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Mar 31, 2026 5:12pm
ensnode.io Ready Ready Preview, Comment Mar 31, 2026 5:12pm
ensrainbow.io Ready Ready Preview, Comment Mar 31, 2026 5:12pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The changes integrate Scalar API reference functionality into the Starlight documentation, adding new layout components to replace existing overrides, introducing an interactive API reference page, and adjusting styling to accommodate the restructured layout.

Changes

Cohort / File(s) Summary
Scalar API Integration
package.json, config/integrations/starlight.ts, src/content/docs/ensapi/reference/api-reference.mdx
Added @scalar/api-reference and @scalar/astro dependencies; configured "Reference" sidebar group in Starlight; created interactive API reference page rendering OpenAPI spec with ScalarComponent, disabling multiple UI elements and enforcing light mode.
Layout Component Overrides
src/components/overrides/PageSidebar.astro, src/components/overrides/TwoColumnContent.astro, src/components/overrides/TableOfContents.astro
Created PageSidebar to conditionally render mobile/desktop TOC and persist TelegramInvite in right sidebar; added TwoColumnContent to manage fixed right sidebar layout with Starlight CSS variables; removed TelegramInvite from TableOfContents override.
Styling & Minor Fixes
src/components/organisms/Header.astro, src/styles/starlight.css, src/components/molecules/StaticHeader.astro
Fixed malformed lg::mr-[76px] class to lg:mr-[76px] in Header; added isolation: auto override to .main-pane to allow fixed-position elements (Scalar modals) above layout regions; applied minor whitespace formatting in StaticHeader.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Config as Starlight Config
    participant Layout as Layout Overrides
    participant PageSidebar as PageSidebar
    participant TwoColumnContent as TwoColumnContent
    participant API as ScalarComponent
    
    User->>Config: Navigates to Reference page
    Config->>Layout: Activates PageSidebar & TwoColumnContent overrides
    Layout->>PageSidebar: Initializes with starlightRoute
    PageSidebar->>PageSidebar: Render TOC (conditional) + TelegramInvite
    Layout->>TwoColumnContent: Manages two-column layout structure
    TwoColumnContent->>TwoColumnContent: Apply fixed sidebar positioning
    TwoColumnContent->>API: Right sidebar slot contains main content
    API->>API: Render OpenAPI spec with custom config
    API-->>User: Display interactive API reference
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

docs

Poem

🐰 Hop, hop! The docs now shine so bright,
With Scalar's API in fixed sidebar light,
Two columns dance, TOC hops between,
The finest reference docs you've seen!
Isolation freed, the modals now fly—
A rabbit's joy as pages satisfy!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely empty, missing all required sections from the template including summary, why, testing, and pre-review checklist. Add a complete PR description following the 'Lite PR' template with: summary of changes (sidebar/layout overrides, API reference page, Scalar package additions), rationale for the changes, testing methodology, and pre-review checklist confirmation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main objective of the PR: adding an API Reference feature to the documentation site using the Scalar/Astro integration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch temp/scalar-astro-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Adds a Scalar-based OpenAPI reference experience to the docs/ensnode.io Astro/Starlight docs site, including a new “separate” API reference page and the required dependencies.

Changes:

  • Add Scalar API Reference dependencies (Scalar + Vue) to the docs app and update the pnpm lockfile accordingly.
  • Introduce a new standalone Astro page rendering Scalar’s API reference from the generated ensapi-openapi.json.
  • Add an MDX-based reference page and wire “Reference” and “API Reference (Separate)” into the Starlight sidebar.

Reviewed changes

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

Show a summary per file
File Description
pnpm-lock.yaml Updates lockfile for Scalar/Vue additions and postcss-related transitive changes.
docs/ensnode.io/package.json Adds @scalar/* packages and Vue dependencies needed by Scalar.
docs/ensnode.io/config/integrations/starlight.ts Adds ENSApi “Reference” section and a separate API reference link in the sidebar.
docs/ensnode.io/src/pages/ensapi/reference/separate-api-reference.astro New standalone Scalar API reference page with custom header.
docs/ensnode.io/src/content/docs/ensapi/reference/api-reference.mdx New MDX page using @scalar/astro’s ScalarComponent.
docs/ensnode.io/src/components/molecules/StaticHeader.astro Minor formatting changes in header markup (touched region includes a Tailwind class issue).

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ensnode.io/package.json`:
- Around line 29-33: The astro.config.mjs is missing the `@astrojs/vue`
integration required for SSR of Vue components; open astro.config.mjs, import
the Vue integration (e.g., import vue from '@astrojs/vue') and add vue() to the
existing integrations array (next to mermaid(), starlight(), sitemap(), react(),
mdx(), icon()) so it becomes integrations: [mermaid(), starlight(), sitemap(),
react(), mdx(), icon(), vue()], ensuring Vue-based components (used by
`@scalar/astro`) are properly server-rendered.

In `@docs/ensnode.io/src/content/docs/ensapi/reference/api-reference.mdx`:
- Around line 11-33: The ScalarComponent configuration contains conflicting UI
settings: keep the desired UX consistent by either enabling download controls or
removing download type, and by restoring navigation if you want endpoint
discoverability; specifically, in the ScalarComponent props (configuration
object) reconcile hideDownloadButton and documentDownloadType by either setting
hideDownloadButton: false when you want downloads (and keep
documentDownloadType: "both") or remove/clear documentDownloadType when
downloads are intentionally hidden, and similarly decide whether to provide
navigation by setting showSidebar: true if you need endpoint navigation (and/or
set hideSearch: false) or leave both off for a minimal embedded view.
- Around line 1-6: Update the frontmatter "description" value in this document
(the YAML block containing title: ENSApi API Reference and sidebar:) to
accurately describe the page purpose; replace the current "Learn how to run
ENSApi locally for development and contributions." with a succinct API-focused
description such as "Interactive API reference documentation for ENSApi
endpoints." so the description matches the API reference content.

In `@docs/ensnode.io/src/pages/ensapi/reference/separate-api-reference.astro`:
- Around line 74-75: The code uses non-null assertions for
document.getElementById("scalar-api-reference") and el.dataset.config which can
throw at runtime; update the logic around the const el and const config
declarations to guard against missing DOM or dataset by checking that
document.getElementById("scalar-api-reference") returned an element and that
el.dataset.config is defined before calling JSON.parse, and handle failure paths
(e.g., log/error and bail out or provide a default config) and wrap JSON.parse
in try/catch to surface parse errors; reference the "el" and "config" variables
and the "scalar-api-reference" id when making these checks.
- Line 69: The JSX/HTML element rendering the scalar API reference has a
malformed attribute sequence—add a space between the id attribute and the
data-config attribute on the element that contains id="scalar-api-reference" and
data-config={scalarConfig} so it becomes two separate attributes
(id="scalar-api-reference" and data-config={scalarConfig}) to produce valid
markup.
- Line 51: The Tailwind class string in the div element contains a typo:
`lg::mr-[76px]` uses a double colon; update the class value in the element (the
div with classes "flex flex-row justify-between items-center gap-2 sm:gap-[14px]
cursor-pointer flex-shrink-0 sm:mr-10 lg::mr-[76px]") to use a single breakpoint
colon `lg:mr-[76px]` so Tailwind applies the large-screen right margin
correctly.
- Around line 48-63: Replace the duplicated header block with the existing
StaticHeader component: remove the inline <header>... block and import/use
StaticHeader (ensure HeaderButtons and ENSNode2DLight usage is preserved or
passed as props if StaticHeader expects them); while doing so, fix the typo
"lg::mr-[76px]" to "lg:mr-[76px]" either in this file before replacing or inside
StaticHeader so the spacing is correct; verify StaticHeader's layout (and
whether CustomSearch is intentionally omitted) and adjust props or composition
so the visual/behavioral output remains identical.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c4ca732-eff5-4c13-a345-6457bbf9f08f

📥 Commits

Reviewing files that changed from the base of the PR and between 4838dc7 and fc1d687.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • docs/ensnode.io/config/integrations/starlight.ts
  • docs/ensnode.io/package.json
  • docs/ensnode.io/src/components/molecules/StaticHeader.astro
  • docs/ensnode.io/src/content/docs/ensapi/reference/api-reference.mdx
  • docs/ensnode.io/src/pages/ensapi/reference/separate-api-reference.astro

Copy link
Copy Markdown
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

Missing @astrojs/vue integration in astro.config.mjs prevents Vue components from being rendered

Fix on Vercel

Copilot AI review requested due to automatic review settings March 31, 2026 16:53
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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.


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

@notrab notrab marked this pull request as ready for review March 31, 2026 17:01
@notrab notrab requested a review from a team as a code owner March 31, 2026 17:01
@notrab notrab changed the title API Reference @scalar/astro example feat(docs/ensnode.io): Add API Reference Mar 31, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR integrates the interactive Scalar API reference widget into the ENSNode Starlight documentation site by embedding ScalarComponent in a new ensapi/reference/api-reference.mdx page. To keep the TelegramInvite call-to-action visible on all pages (including those with tableOfContents: false), the TableOfContents component override is replaced by a TwoColumnContent override that unconditionally renders the right sidebar. The override also removes isolation: isolate from .main-pane, fixing the stacking-context bug that trapped Scalar's modal z-index. Additionally, a pre-existing Tailwind CSS typo (lg::mr-[76px]lg:mr-[76px]) is corrected in both header components.

Key changes:

  • New TwoColumnContent.astro override — always renders the right sidebar; removes isolation: isolate; places TelegramInvite below the TOC slot
  • New ensapi/reference/api-reference.mdx — embeds ScalarComponent with the ENSApi OpenAPI spec; disables dark-mode toggle, sidebar, and search inside Scalar
  • starlight.ts — swaps override registration from TableOfContentsTwoColumnContent; adds ensapi/reference autogenerated sidebar group
  • pnpm-lock.yaml — adds @scalar/api-reference@1.49.3 and @scalar/astro@0.2.4; tailwindcss catalog version regressed from 4.2.24.1.18, likely driven by Scalar's peer-dependency constraints — worth verifying that no 4.2.x-only utilities are in use
  • api-reference.mdx customCss contains a bare .section selector that is injected globally and may affect non-Scalar elements

Confidence Score: 4/5

Safe to merge after verifying the tailwindcss catalog downgrade is intentional and scoping the generic .section customCss rule.

Two P1 findings prevent a clean 5: (1) the .section selector in Scalar's customCss is injected globally and will zero out padding-inline on any other .section element on the page, and (2) adding the Scalar packages caused the workspace-wide tailwindcss catalog to regress from 4.2.2 to 4.1.18, which could silently break utilities elsewhere in the monorepo. All other changes are well-reasoned and low-risk.

docs/ensnode.io/src/content/docs/ensapi/reference/api-reference.mdx (customCss selector scope) and pnpm-lock.yaml (tailwindcss version regression)

Important Files Changed

Filename Overview
docs/ensnode.io/src/components/overrides/TwoColumnContent.astro New Starlight override that always renders the right sidebar column (removing the toc guard) and inlines TelegramInvite below the TOC slot; also removes isolation: isolate from .main-pane to fix Scalar modal z-index stacking.
docs/ensnode.io/src/content/docs/ensapi/reference/api-reference.mdx New MDX page embedding the ScalarComponent with the ENSApi OpenAPI spec; contains a generic .section customCss selector that leaks globally, and a redundant documentDownloadType setting paired with hideDownloadButton: true.
docs/ensnode.io/config/integrations/starlight.ts Swaps the TableOfContents component override for TwoColumnContent, and adds the new Reference autogenerated sidebar group under ENSApi.
pnpm-lock.yaml Adds @scalar/api-reference and @scalar/astro; the Scalar peer-dependency appears to have driven a workspace-wide tailwindcss catalog downgrade from 4.2.2 to 4.1.18, potentially breaking 4.2.x-only utilities across the monorepo.
docs/ensnode.io/package.json Adds @scalar/api-reference@^1.49.3 and @scalar/astro@^0.2.4 as new dependencies.
docs/ensnode.io/src/components/molecules/StaticHeader.astro Fixes a Tailwind CSS typo: lg::mr-[76px] (double colon) corrected to lg:mr-[76px]; also minor indentation cleanup.
docs/ensnode.io/src/components/organisms/Header.astro Same lg::mr-[76px] to lg:mr-[76px] typo fix as StaticHeader.
docs/ensnode.io/src/components/overrides/TableOfContents.astro Deleted — TelegramInvite injection responsibility moved to the new TwoColumnContent override.
docs/ensnode.io/src/styles/starlight.css Only a blank line added between a comment and an existing @media rule; no functional change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Starlight Page Request] --> B{tableOfContents enabled?}
    B -- Yes --> C[TwoColumnContent renders:
right-sidebar slot = TOC
below = TelegramInvite]
    B -- No
(api-reference page) --> D[TwoColumnContent renders:
right-sidebar slot = empty
below = TelegramInvite only]
    C --> E[main-pane: page content]
    D --> F[main-pane: ScalarComponent
with ENSApi OpenAPI spec]
    F --> G{User clicks Test Request?}
    G -- Yes --> H[Modal opens — stacking context
not trapped because isolation:isolate
was removed from .main-pane]
Loading

Comments Outside Diff (1)

  1. pnpm-lock.yaml, line 210-211 (link)

    P1 Unintended tailwindcss catalog downgrade

    The workspace-wide tailwindcss catalog resolved version dropped from 4.2.2 to 4.1.18 after adding the Scalar packages. The specifier (^4.1.18) hasn't changed, so this is likely caused by a stricter peer-dependency constraint in @scalar/api-reference forcing pnpm to pick the lower version.

    This affects every workspace package that consumes tailwindcss from the catalog (e.g., apps/ensadmin, docs/ensnode.io). Any utility or variant introduced in Tailwind CSS 4.2.x would silently stop compiling. It is worth verifying:

    1. Whether @scalar/api-reference@1.49.3 declares tailwindcss: ">=4.0.0 <4.2.0" (or similar) as a peer dependency.
    2. That no existing CSS in the repo relies on features added in 4.2.x that would break at 4.1.18.

    If the downgrade is an unintended side-effect of pnpm's peer-resolution strategy, you may be able to use a pnpm peerDependencyRules override to prevent it.

Reviews (1): Last reviewed commit: "empty line cleanup" | Re-trigger Greptile

Comment on lines +29 to +30
documentDownloadType: "both",
hideTestRequestButton: false,
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.

P2 Contradictory download configuration

hideDownloadButton: true suppresses the download button entirely, making documentDownloadType: "both" dead configuration. The download-type setting has no effect when the button isn't rendered. Consider removing it to keep the configuration tidy.

Suggested change
documentDownloadType: "both",
hideTestRequestButton: false,
hideDownloadButton: true,

hideDarkModeToggle: true,
withDefaultFonts: true,
expandAllModelSections: true,
customCss: `.scalar-mcp-layer { display: none !important; } .section { padding-inline: 0 !important; }`,
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.

P1 Generic .section selector may leak into the Starlight page

Scalar's customCss is injected as a global <style> tag (not scoped to the Scalar component), so .section { padding-inline: 0 !important; } will match any element with class section on the full page — not just inside the API reference widget. If Starlight or any other component uses a .section class, its padding-inline will be zeroed out silently.

Consider scoping the rule to the Scalar root to limit the blast radius:

Suggested change
customCss: `.scalar-mcp-layer { display: none !important; } .section { padding-inline: 0 !important; }`,
customCss: `.scalar-mcp-layer { display: none !important; } .scalar-app .section { padding-inline: 0 !important; }`,

showDeveloperTools: "never",
isEditable: false,
isLoading: false,
documentDownloadType: "both",
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.

Suggested change
documentDownloadType: "both",

Dead configuration: hideDownloadButton: true and documentDownloadType: "both" are contradictory, making the download type setting unused

Fix on Vercel

hideDarkModeToggle: true,
withDefaultFonts: true,
expandAllModelSections: true,
customCss: `.scalar-mcp-layer { display: none !important; } .section { padding-inline: 0 !important; }`,
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.

Suggested change
customCss: `.scalar-mcp-layer { display: none !important; } .section { padding-inline: 0 !important; }`,
customCss: `.scalar-mcp-layer { display: none !important; } .scalar-api-reference .section { padding-inline: 0 !important; }`,

Generic .section CSS selector in customCss causes style leakage affecting all elements with class="section" on the page, not just within the Scalar component

Fix on Vercel

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

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.


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

"@namehash/namekit-react": "catalog:",
"@namehash/namehash-ui": "workspace:*",
"@octokit/rest": "^20.1.2",
"@scalar/api-reference": "^1.49.3",
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

@scalar/api-reference is added as a direct dependency but isn’t imported/used anywhere in this docs app (only @scalar/astro is referenced). If it’s not required as a runtime peer for @scalar/astro, removing it would significantly reduce install size and transitive dependencies; if it is required, consider adding an inline comment explaining why it must be direct.

Suggested change
"@scalar/api-reference": "^1.49.3",

Copilot uses AI. Check for mistakes.
/**
* Override of Starlight's TwoColumnContent that always renders the right
* sidebar column. The original conditionally hides it when tableOfContents
* is disabled, which also removes our TelegramInvite.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This override is a forked/copy of Starlight’s internal TwoColumnContent, which will likely need manual syncing on Starlight upgrades. To make future updates safer, please include the upstream Starlight version (and ideally a link/path to the original source) in this header comment so reviewers know what it was copied from.

Suggested change
* is disabled, which also removes our TelegramInvite.
* is disabled, which also removes our TelegramInvite.
*
* Forked from Starlight's internal `TwoColumnContent` component.
* Starlight upstream version at time of copy: TODO-update-with-exact-version (e.g. v0.XX.X).
* Upstream source path (for reference when syncing): see Starlight's internal `TwoColumnContent`
* component in the Starlight repo (packages/starlight/.../TwoColumnContent.astro or equivalent).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a fair tradeoff. It hasn't been updated much from what I can tell, and the page looks better without the single list item in the TOC.

Comment on lines +10 to +14
import openapiSpec from "@workspace/docs/docs.ensnode.io/ensapi-openapi.json";

<ScalarComponent
configuration={{
content: openapiSpec,
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Importing the full OpenAPI JSON at build time will bundle the entire spec into the page’s JS payload. If Scalar supports loading from a URL or static asset path, consider switching to that approach to reduce client bundle size and improve initial load performance (especially as the spec grows).

Suggested change
import openapiSpec from "@workspace/docs/docs.ensnode.io/ensapi-openapi.json";
<ScalarComponent
configuration={{
content: openapiSpec,
<ScalarComponent
configuration={{
spec: { url: "/ensapi-openapi.json" },

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@notrab notrab Mar 31, 2026

Choose a reason for hiding this comment

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

Doing so would (URL) mean we can't view in our preview deployments the upcoming API spec changes. Need to investigate the static asset path though... I assume this means just putting it in the public directory, instead of where it is now in the root.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i think not worth optimizing, is a-ok

@shrugs
Copy link
Copy Markdown
Collaborator Author

shrugs commented Mar 31, 2026

lgtm

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.

4 participants