Skip to content

docs: add sandbox and ensv2readiness#2103

Open
sevenzing wants to merge 19 commits into
mainfrom
ll/docs-query-sandbox
Open

docs: add sandbox and ensv2readiness#2103
sevenzing wants to merge 19 commits into
mainfrom
ll/docs-query-sandbox

Conversation

@sevenzing
Copy link
Copy Markdown
Member

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

  • What changed (1-3 bullets, no essays).

Why

  • Why this change exists. Link to related GitHub issues where relevant.

Testing

  • How this was tested.
  • If you didn't test it, say why.

Notes for Reviewer (Optional)

  • Anything non-obvious or worth a heads-up.

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

@sevenzing sevenzing requested a review from a team as a code owner May 13, 2026 11:54
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
enskit-react-example.ensnode.io Ready Ready Preview, Comment May 15, 2026 4:19pm
ensnode.io Ready Ready Preview, Comment May 15, 2026 4:19pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
admin.ensnode.io Skipped Skipped May 15, 2026 4:19pm
ensrainbow.io Skipped Skipped May 15, 2026 4:19pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

⚠️ No Changeset found

Latest commit: 9e7be1a

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Review Change Stack

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

Adds interactive StackBlitz playground infrastructure, Omnigraph example metadata/pages and response-fetching, UI components to embed and display examples (query/variables/response/curl), Starlight llms-txt plugin + patch to exclude examples from llms outputs, and docs package wiring (aliases, tsconfig, Vitest).

Changes

Omnigraph Examples & Example Query Infrastructure

Layer / File(s) Summary
SDK example query model & export
packages/ensnode-sdk/src/omnigraph-api/example-queries.ts
Adds GraphqlApiExampleQuery with id, getGraphqlApiExampleQueryById(), and updates GRAPHQL_API_EXAMPLE_QUERIES entries to include id and new local Sepolia constants.
Examples metadata & docs data
docs/ensnode.io/src/data/omnigraph-examples/meta.ts, docs/ensnode.io/src/data/omnigraph-examples/examples.ts
Introduces OMNIGRAPH_EXAMPLES_META, builds graphqlApiOmnigraphExamples by merging example queries, namespaced variables, optional per-id responses, and validates shapes via Zod schema; exports getOmnigraphExampleById.
Fetch example responses script
docs/ensnode.io/scripts/fetch-omnigraph-example-responses.mts
CLI script to POST example queries to an ENSNode Omnigraph endpoint and write responses.json, supports partial refresh and abort/timeouts.
Tests for example tests naming/variables
apps/ensapi/src/omnigraph-api/schema/example-queries*.test.ts
Adjusts test-case naming to use entry.id and uses getNamespaceSpecificValue(namespace, entry.variables) for per-namespace variables.

StackBlitz Playground Runtime Infrastructure

Layer / File(s) Summary
Playground types & contracts
docs/ensnode.io/src/lib/playground/example-project/types.ts, docs/ensnode.io/src/lib/playground/types.ts
Defines PlaygroundProject, runtimes, views, manifests, and ExampleProjectConfig used by loaders.
Project assembly and tsconfig builders
docs/ensnode.io/src/lib/playground/example-project/assemblePlaygroundProject.ts, docs/ensnode.io/src/lib/playground/example-project/buildPlaygroundTsconfig.ts
Compose assembled project with injected tsconfig.json and provide Vite/Node TS config builders.
Env replacement and file helpers
docs/ensnode.io/src/lib/playground/example-project/replaceEnvWithValues.ts, docs/ensnode.io/src/lib/playground/example-project/fetchRawExampleProject.ts
Apply regex-based env/file replacements and normalize eager import.meta.glob(...?raw) modules into raw project shapes.
Monorepo specifier resolver & pinned deps
docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts, docs/ensnode.io/src/lib/playground/example-project/resolvePinnedDependencies.ts
Resolve catalog: and workspace: specifiers to concrete versions and produce playground manifests with peers for enskit/enssdk examples (with tests).
Loader orchestration
docs/ensnode.io/src/lib/playground/example-project/loadExampleProject.ts, docs/ensnode.io/src/lib/playground/loadEnskitExampleProject.ts, docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.ts
High-level loader builds final PlaygroundProject by fetching raw files, applying replacements, resolving manifests, and assembling the project; enskit/enssdk specific loaders wire in globs and replacements.
Utilities & constants
docs/ensnode.io/src/lib/playground/utils.ts, docs/ensnode.io/src/lib/playground/constants.ts
stringifyJsonForDocs, getNiceHeightForCodeSnippet, buildOmnigraphCurlExample, and ENSNODE_URL/DOCS_OMNIGRAPH_NAMESPACE.

Interactive Playground UI Components

Layer / File(s) Summary
StackBlitz embed component
docs/ensnode.io/src/components/molecules/CodePlayground.tsx
Maps a PlaygroundProject to a StackBlitz Project (generated package.json/tsconfig), computes embed options, and mounts via sdk.embedProject with safe lifecycle cleanup.
Omnigraph panels & example orchestration
docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro, docs/ensnode.io/src/components/organisms/OmnigraphAPIExample.astro
Astro UI for query display, tabs for Variables/Response/Curl, copy-to-clipboard, and top-level component that looks up example by id and passes derived data to panels.
Example-specific wrappers
docs/ensnode.io/src/components/organisms/EnskitExampleInteractivePlayground.tsx, docs/ensnode.io/src/components/organisms/EnssdkExampleInteractivePlayground.tsx
React wrappers that load respective example projects and render CodePlayground with sensible default heights.
Schema explorer
docs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsx
GraphiQL Doc Explorer rendering a local SDL under a GraphiQLProvider (light theme).

Docs pages, sidebar, redirects, and styling

Layer / File(s) Summary
Examples index and 13 pages
docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/index.mdx, .../examples/*.mdx
Adds examples index page and 13 example MDX pages each embedding OmnigraphAPIExample with frontmatter and ordering.
Integration guide changes
docs/ensnode.io/src/content/docs/docs/integrate/index.mdx, .../integration-options/*
Replaces static GraphQL snippet with OmnigraphAPIExample, adds interactive LinkCards for enskit/enssdk, and creates interactive example MDX pages.
Sidebar restructure
docs/ensnode.io/config/integrations/starlight/sidebar-topics/integrate.ts
Removes “Why ENSNode?”, replaces “Cookbook” with “Examples” subgroup listing the new example pages, and nests enskit/enssdk items with interactive example links.
Astro redirects & Vite aliases
docs/ensnode.io/astro.config.mjs
Adds Vite alias mappings for @assets, @components, etc., and redirects legacy cookbook routes to the new examples routes.
PageFrame override & CSS
docs/ensnode.io/src/components/overrides/PageFrame.astro, docs/ensnode.io/src/styles/starlight.css
New PageFrame with fixed header and optional docked sidebar; desktop-only docked sidebar CSS with peek strip and hover expansion.
Small docs import/alias updates
multiple docs/ensnode.io/src/... files
Bulk rewrite of many relative imports to @assets, @components, @scripts, @styles, and related small changes (hero image, header, example card imports, etc.).

Starlight llms-txt plugin & pnpm patch

Layer / File(s) Summary
llms-txt plugin config & registration
docs/ensnode.io/config/integrations/llms-txt.ts, docs/ensnode.io/config/integrations/starlight/index.ts
Exports starlightLlmsTxtPlugin configured with excludes for example pages and registers it in Starlight plugins array.
Patch upstream & pnpm mapping
patches/starlight-llms-txt@0.5.1.patch, package.json
Patch injects starlightLllmsTxtContext.exclude into generateLlmsTxt exclude option and registers the patch in root pnpm.patchedDependencies.

Docs package config and helpers

Layer / File(s) Summary
Docs package.json & vitest config
docs/ensnode.io/package.json, docs/ensnode.io/vitest.config.ts, vitest.config.ts
Adds scripts (omnigraph-examples:refresh-responses, test, typecheck), dependencies (@stackblitz/sdk, GraphiQL bits), devDeps (tsx, vitest), and includes docs Vitest project in root Vitest config.
ENSAdmin URL snippet & SDK export
docs/ensnode.io/src/content/snippets/omnigraphAdmin.ts, packages/ensnode-sdk/package.json, AGENTS.md
Adds ENSAdmin Omnigraph URL builder, exposes SDK subpath ./omnigraph-api/example-queries, and documents the response-refresh workflow.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • namehash/ensnode#1867 — Modifies example queries; closely related to SDK example-query model changes.
  • namehash/ensnode#2106 — Related edits to IntegrateHostedEnsNodeTip and sidebar wiring; overlap with this PR's docs rework.
  • namehash/ensnode#2051 — Prior docs-structure reorganization touching Starlight config and sidebar that this PR extends.

Suggested labels

docs

Poem

🐰 I hopped through docs to make them play,
StackBlitz gardens where examples stay,
Queries, panels, and a curl or two,
Sidebars docked and examples new,
A tiny rabbit cheers — enjoy the display!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ll/docs-query-sandbox

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 13, 2026

Greptile Summary

This PR adds interactive sandbox playgrounds (StackBlitz embeds for enssdk and enskit examples), a browsable Omnigraph schema explorer, per-example GraphQL query pages with tabbed variable/response/curl panels, and a collapsible "docked" sidebar layout for wide playground pages.

  • Playground infrastructure (src/lib/playground/): new utilities resolve pnpm catalog:/workspace: specifiers to npm versions, load example source from Vite glob imports, substitute env vars at build time, and assemble a PlaygroundProject consumed by the new CodePlayground React component (which now includes proper cleanup and full memoized dependency tracking).
  • Omnigraph examples: a static response cache (responses.json) and a refresh script power tabbed example panels with ENSAdmin deep-links across twelve new per-example MDX pages.
  • SDK change: all example queries gain stable id fields and a new getGraphqlApiExampleQueryById lookup function.

Confidence Score: 5/5

Safe to merge; all changes are confined to the docs site and the SDK example-query utilities, with no production runtime paths affected.

The new playground infrastructure is well-structured and tested. The only issues found are test assertions that pin exact catalog version strings, which will cause spurious failures on routine dependency bumps but do not affect the shipped docs.

The two test files (resolveMonorepoSpecifier.test.ts, loadEnssdkExampleProject.test.ts) use hardcoded catalog versions that will drift. The starlight-llms-txt patch items from the previous review thread also deserve a second look.

Important Files Changed

Filename Overview
docs/ensnode.io/src/components/molecules/CodePlayground.tsx New StackBlitz embed component; this revision adds a proper cleanup function and full dependency array in useEffect, addressing the issues present in the previously reviewed version.
docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts Resolves pnpm catalog: and workspace: specifiers to npm-installable version strings for StackBlitz; logic is sound and covered by tests.
docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.test.ts Tests hardcode exact catalog version strings (24.10.9, ^5.7.3) that will cause false failures on any routine catalog bump.
docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.test.ts Same version-pinning issue; @types/node, gql.tada, and tsx versions are hardcoded.
docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro New Astro component rendering tabbed GraphQL query/variables/curl panels with an ENSAdmin deep-link; tab and copy wiring looks correct.
docs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsx Embeds GraphiQL doc-explorer with a pre-built schema from the enssdk SDL; no-op fetcher is intentional since this is a browse-only component.
docs/ensnode.io/src/content.config.ts Extends the Starlight docs schema with a custom sidebar.docked boolean; uses _def.innerType to unwrap ZodDefault, which is an internal Zod API that could break across Zod minor versions.
patches/starlight-llms-txt@0.5.1.patch Forwards the exclude list into generateLlmsTxt for llms-full.txt only; llms-small.txt is not patched (flagged in prior review thread), and the import identifier uses three consecutive l's which must match the package's actual export name.
packages/ensnode-sdk/src/omnigraph-api/example-queries.ts Adds id fields to all example queries and a getGraphqlApiExampleQueryById lookup; the Map initialization at the bottom is safely referenced by the exported function at call time.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    MDX["MDX page"]
    MDX -->|imports| PG["EnssdkExampleInteractivePlayground or EnskitExampleInteractivePlayground"]
    MDX -->|imports| OAE["OmnigraphAPIExample.astro"]
    PG -->|calls| LEP["loadEnssdkExampleProject or loadEnskitExampleProject"]
    LEP -->|glob + normalize| FRE["fetchRawExampleProject (Vite import.meta.glob)"]
    LEP -->|catalog/workspace resolve| RPD["resolvePinnedDependencies -> resolveMonorepoSpecifier"]
    LEP -->|env substitution| REV["replaceEnvWithValues"]
    LEP -->|assemble| APP["assemblePlaygroundProject -> PlaygroundProject"]
    APP -->|rendered by| CP["CodePlayground.tsx (StackBlitz SDK embed)"]
    OAE -->|lookup| GBN["getOmnigraphExampleById"]
    GBN -->|reads| META["OMNIGRAPH_EXAMPLES_META"]
    GBN -->|reads| SDK["getGraphqlApiExampleQueryById (ensnode-sdk)"]
    GBN -->|reads| RESP["responses.json (static snapshot)"]
    OAE -->|renders| PANELS["OmnigraphAPIExamplePanels.astro"]
    PANELS -->|deep-link| ADMIN["ENSAdmin playground"]
    REFRESH["fetch-omnigraph-example-responses.mts (pnpm script)"] -->|writes| RESP
Loading

Reviews (10): Last reviewed commit: "fix production bug" | Re-trigger Greptile

Comment thread docs/ensnode.io/src/components/playgrounds/common.ts Outdated
Comment thread docs/ensnode.io/src/components/molecules/EnssdkPlayground.tsx Outdated
Comment thread docs/ensnode.io/src/components/molecules/CodePlayground.tsx Outdated
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ensnode.io/src/components/molecules/CodePlayground.tsx`:
- Around line 25-79: The useEffect that calls sdk.embedProject is missing
dependencies and a cleanup: include title, description, files, dependencies,
entryFileName, height, and terminalHeight in the effect dependency array (or
compute stable values via useMemo for packageJson/tsconfig/projectFiles if the
embed should remain static) so prop changes re-embed correctly, and return a
cleanup function that disposes or unmounts the embed (call the SDK's
cleanup/unmount method or remove the iframe/container referenced by ref) to
avoid leaks; update the effect around useEffect, ref, and sdk.embedProject
accordingly and add a brief comment if you intentionally keep an empty deps
array after memoizing values.

In `@docs/ensnode.io/src/components/playgrounds/common.ts`:
- Around line 1-2: The ENSNODE_URL constant in common.ts currently points at a
Sepolia testnet endpoint; update it to the production ENSNode URL and remove the
TODO. Locate the exported constant ENSNODE_URL in
docs/ensnode.io/src/components/playgrounds/common.ts and replace the testnet
string with the official production endpoint (or make ENSNODE_URL read from an
environment variable like process.env.ENSNODE_URL with a production default) so
the live playground queries mainnet data.

In `@docs/ensnode.io/src/components/playgrounds/EnssdkResolutionApi.tsx`:
- Around line 4-29: The playground snippet imports createEnsNodeClient,
omnigraph, graphql and asInterpretedName from packages `enssdk/core`,
`enssdk/omnigraph`, and `enssdk`, but the EnssdkPlayground dependency is
declared as `@ensnode/ensnode-sdk` which does not export those modules; update
the playground dependency to use "enssdk": "latest" (so imports like
createEnsNodeClient, omnigraph, graphql, asInterpretedName resolve) or
alternatively rewrite the snippet to only use exports provided by
`@ensnode/ensnode-sdk` (e.g., replace imports and calls in the snippet such as
createEnsNodeClient, omnigraph, graphql, asInterpretedName to their equivalents
from the installed package).
🪄 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: 27c8010f-9a94-4ed0-b672-0cadddfc4a35

📥 Commits

Reviewing files that changed from the base of the PR and between 75e8aac and d391047.

⛔ Files ignored due to path filters (2)
  • docs/ensnode.io/public/ensomnigraph.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • docs/ensnode.io/package.json
  • docs/ensnode.io/src/components/molecules/CodePlayground.tsx
  • docs/ensnode.io/src/components/molecules/EnssdkPlayground.tsx
  • docs/ensnode.io/src/components/playgrounds/EnssdkResolutionApi.tsx
  • docs/ensnode.io/src/components/playgrounds/common.ts
  • docs/ensnode.io/src/content/docs/docs/integrate/ensv2-readiness.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/index.mdx

Comment thread docs/ensnode.io/src/components/molecules/CodePlayground.tsx Outdated
Comment thread docs/ensnode.io/src/components/playgrounds/common.ts Outdated
Comment thread docs/ensnode.io/src/components/playgrounds/EnssdkResolutionApi.tsx Outdated
Comment thread docs/ensnode.io/src/content/docs/docs/integrate/index.mdx Outdated
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@patches/starlight-llms-txt`@0.5.1.patch:
- Around line 1-18: You added use of starlightLllmsTxtContext.exclude in
llms-full.txt.ts (inside the GET handler that calls generateLlmsTxt), which is a
fragile local patch to starlight-llms-txt@0.5.1; to make this maintainable, add
a clear inline comment in llms-full.txt.ts above the import/use of
starlightLllmsTxtContext stating the patch intent and target version
(starlight-llms-txt@0.5.1) and whether it’s temporary, open a short upstream PR
against starlight-llms-txt to request official exclude support (reference
generateLlmsTxt API and the exclude option), and add a note in the repo
docs/changelog describing the patch with instructions to remove/update it when
the upstream releases a fix.
🪄 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: 620b72a5-0759-47ee-ad68-6925791c0548

📥 Commits

Reviewing files that changed from the base of the PR and between d391047 and 787609b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • docs/ensnode.io/config/integrations/llms-txt.ts
  • docs/ensnode.io/config/integrations/starlight/index.ts
  • package.json
  • patches/starlight-llms-txt@0.5.1.patch

Comment thread patches/starlight-llms-txt@0.5.1.patch
Comment thread patches/starlight-llms-txt@0.5.1.patch
Comment thread patches/starlight-llms-txt@0.5.1.patch
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ensnode.io/src/components/docs/EnssdkExamplePanels.astro`:
- Line 14: The "TypeScript (enssdk)" label paragraph in
EnssdkExamplePanels.astro uses a hardcoded class "text-gray-900" which is too
dark for dark mode—update the class on the <p> element (the element containing
the "TypeScript (enssdk)" text) to use dark-mode variants or semantic colors,
e.g. replace "text-gray-900" with "text-gray-900 dark:text-gray-100" or with a
semantic token like "text-neutral-900 dark:text-neutral-100" so the label
remains readable in both themes; apply the same change to the other similar
label instance.

In `@docs/ensnode.io/src/components/docs/OmnigraphRecipePanels.astro`:
- Around line 245-250: navigator.clipboard.writeText call lacks error handling
so failures give no user feedback; wrap the writeText call in a promise catch
(or use async/await with try/catch) and on error set copyBtn.textContent to a
failure message (e.g., "Copy failed" or "Permission denied"), optionally log the
error (console.error) and revert to defaultLabel after the same timeout; update
the branch that currently sets "Copied!" to also handle and display failures,
referencing navigator.clipboard.writeText, copyBtn and defaultLabel so users get
visible feedback when the copy operation fails.

In `@packages/ensnode-sdk/package.json`:
- Line 23: The package.json currently lists subpath exports ("./internal" and
"./omnigraph-api/example-queries") at the top-level exports but
publishConfig.exports only publishes the root ("."); update
publishConfig.exports to mirror the top-level "exports" entries so those
subpaths are included in the published package. Specifically, add entries for
"./internal" and "./omnigraph-api/example-queries" (pointing to the same targets
as the top-level exports) into the publishConfig.exports object, ensuring the
published artifact exposes the same subpath mappings as the development package.
🪄 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: ad387b8f-414a-4e38-8623-e904d04a5b95

📥 Commits

Reviewing files that changed from the base of the PR and between 787609b and f01ce76.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • apps/ensapi/src/omnigraph-api/schema/example-queries.integration.test.ts
  • apps/ensapi/src/omnigraph-api/schema/example-queries.test.ts
  • docs/ensnode.io/config/integrations/llms-txt.ts
  • docs/ensnode.io/config/integrations/starlight/sidebar-topics/integrate.ts
  • docs/ensnode.io/package.json
  • docs/ensnode.io/src/components/docs/EnssdkExamplePanels.astro
  • docs/ensnode.io/src/components/docs/OmnigraphRecipeExample.astro
  • docs/ensnode.io/src/components/docs/OmnigraphRecipePanels.astro
  • docs/ensnode.io/src/components/organisms/ExampleCard.astro
  • docs/ensnode.io/src/components/playgrounds/EnssdkResolutionApi.tsx
  • docs/ensnode.io/src/components/playgrounds/common.ts
  • docs/ensnode.io/src/components/playgrounds/quickstartResolveDomainSnippet.ts
  • docs/ensnode.io/src/content.config.ts
  • docs/ensnode.io/src/content/docs/docs/integrate/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/cookbook/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/cookbook/resolution-api.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook/account-domains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook/domain-by-name.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook/index.mdx
  • docs/ensnode.io/src/content/snippets/omnigraphAdmin.ts
  • docs/ensnode.io/src/data/ens-v1-examples-queries.ts
  • docs/ensnode.io/src/data/ens-v2-examples-queries/account-domains.ts
  • docs/ensnode.io/src/data/ens-v2-examples-queries/common.ts
  • docs/ensnode.io/src/data/ens-v2-examples-queries/domain-by-name.ts
  • docs/ensnode.io/src/data/ens-v2-examples-queries/index.ts
  • docs/ensnode.io/src/lib/omnigraph-recipe.ts
  • packages/ensnode-sdk/package.json
  • packages/ensnode-sdk/src/omnigraph-api/example-queries.ts
💤 Files with no reviewable changes (1)
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook.mdx

Comment thread docs/ensnode.io/src/components/docs/EnssdkExamplePanels.astro Outdated
Comment thread packages/ensnode-sdk/package.json
Comment thread docs/ensnode.io/src/components/docs/OmnigraphRecipePanels.astro Outdated
Comment thread docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro Outdated
Copy link
Copy Markdown
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@sevenzing Please take the lead to merge after you've completed your own review and feel good about merging 👍 Thanks!

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: 19

♻️ Duplicate comments (2)
docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro (1)

244-249: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add error handling for clipboard operation.

If navigator.clipboard.writeText fails (e.g., permissions denied or insecure context), the user receives no feedback. Consider adding error handling to inform the user when the copy operation fails.

🛡️ Proposed fix to add error handling
-      void navigator.clipboard.writeText(text).then(() => {
-        copyBtn.textContent = "Copied!";
-        setTimeout(() => {
-          copyBtn.textContent = defaultLabel;
-        }, 1600);
-      });
+      void navigator.clipboard.writeText(text)
+        .then(() => {
+          copyBtn.textContent = "Copied!";
+          setTimeout(() => {
+            copyBtn.textContent = defaultLabel;
+          }, 1600);
+        })
+        .catch(() => {
+          copyBtn.textContent = "Failed";
+          setTimeout(() => {
+            copyBtn.textContent = defaultLabel;
+          }, 1600);
+        });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro`
around lines 244 - 249, The clipboard call using navigator.clipboard.writeText
lacks error handling so failures give no user feedback; wrap the writeText call
with a promise catch (or use async/try-catch) and in the error path update
copyBtn.textContent to a failure message (e.g., "Copy failed") and revert to
defaultLabel after the same timeout, and also console.error the caught error;
update the block around navigator.clipboard.writeText, copyBtn, and defaultLabel
to implement this fallback behavior.
docs/ensnode.io/src/components/molecules/CodePlayground.tsx (1)

114-117: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add cleanup to prevent memory leaks.

The effect dependencies are now correct, but cleanup is still missing. When the component unmounts or re-embeds due to prop changes, the previous StackBlitz embed instance is not disposed, potentially causing memory leaks from orphaned WebContainer instances and iframes.

🧹 Proposed cleanup implementation
  useEffect(() => {
    if (!ref.current) return;
-   sdk.embedProject(ref.current, project, embedOptions);
-  }, [project, embedOptions]);
+   const vm = sdk.embedProject(ref.current, project, embedOptions);
+   
+   return () => {
+     // Clear the container to clean up the embed
+     if (ref.current) {
+       ref.current.innerHTML = '';
+     }
+   };
+  }, [project, embedOptions]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ensnode.io/src/components/molecules/CodePlayground.tsx` around lines 114
- 117, The useEffect in the CodePlayground component calls
sdk.embedProject(ref.current, project, embedOptions) but does not clean up the
previous embed; change the effect to capture the embed instance returned by
sdk.embedProject (e.g., const embed = sdk.embedProject(...)) and return a
cleanup function that disposes it (e.g., embed?.dispose?.() ||
embed?.terminate?.()) and/or remove the iframe from ref.current
(ref.current.innerHTML = '') to ensure WebContainer/iframe resources are
released when project/embedOptions change or the component unmounts; keep refs
to ref.current, sdk.embedProject, project, and embedOptions when implementing
this cleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ensnode.io/scripts/fetch-omnigraph-example-responses.mts`:
- Around line 52-56: The current initialization of out (using argIds,
existsSync, outputPath and readFileSync) can throw a SyntaxError if
responses.json is invalid; wrap the JSON.parse of readFileSync(outputPath,
"utf8") in a try/catch so you handle parse errors gracefully (log a clear error
including err.message or String(err) and exit with non‑zero status) and ensure
out remains a sane Record<string, unknown> when parsing fails; modify the block
that sets out (the ternary using argIds and existsSync) to perform the guarded
parse instead of calling JSON.parse directly.
- Around line 65-76: Wrap the fetch(...) call (the POST using
AbortSignal.timeout) in a try/catch so network errors (DNS, refused, timeout,
etc.) are caught; on catch call logError including the caught error message (use
err instanceof Error ? err.message : String(err)) along with the id, then
process.exit(1); keep the existing response.ok handling intact inside the try
block so HTTP error bodies are still logged as before.

In
`@docs/ensnode.io/src/components/organisms/EnssdkExampleInteractivePlayground.tsx`:
- Line 17: The current fallback silently returns an empty string for entrySource
when enssdkExampleProject.files lacks the key named by entryFileName; update the
initialization to validate that enssdkExampleProject.entryFileName exists in
enssdkExampleProject.files and fail fast (throw an error or call a
development-only assertion/log and throw) when missing so the playground
surfaces misconfiguration during build/dev. Locate the declaration of
entrySource and add a check that references enssdkExampleProject and
entryFileName (e.g., in EnssdkExampleInteractivePlayground) to produce a clear
error message that includes the missing entryFileName and the project identifier
instead of defaulting to "".

In `@docs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsx`:
- Line 33: The key expression for <InnovationSection> uses
section.sectionHeader?.toString().replace(" ", "-") which can throw because
optional chaining only guards toString(); ensure you produce a safe string
before calling replace. Update the key computation (the expression passed to the
key prop) to coerce a safe string from section.sectionHeader (e.g., use
String(section.sectionHeader ?? "") or (section.sectionHeader?.toString() ?? "")
to get a non-null string) and then call replace (and consider global replace or
trimming) so the key generation for InnovationSection is null-safe.

In `@docs/ensnode.io/src/content/docs/docs/integrate/index.mdx`:
- Line 10: The import in index.mdx uses a fragile deep-relative path for
OmnigraphAPIExample; define a path alias in tsconfig.json (for example
"@components/*" mapping to your components directory) and update the import to
use that alias (e.g., import OmnigraphAPIExample from
"@components/organisms/OmnigraphAPIExample.astro") so future moves won’t break;
ensure your build/astro config resolves the same alias if separate
(vite/tsconfig paths) to keep imports working end-to-end.

In
`@docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/example.mdx`:
- Line 18: Replace the string "npm start" with "pnpm start" in the example text
so the sentence reads "After the project is ready, edit the app and run `pnpm
start` in the terminal to restart the Vite dev server," ensuring docs align with
the monorepo's pnpm workspace tooling and package-manager standard.

In
`@docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/index.mdx`:
- Line 7: The import for IntegrateHostedEnsNodeTip uses a fragile deep relative
path; add a path alias in your TypeScript config (e.g., map "@components/*" to
the components directory in tsconfig.json/tsconfig.paths) and then replace the
import of IntegrateHostedEnsNodeTip (the current
'../../../../../../components/molecules/IntegrateHostedEnsNodeTip.astro' usage)
with the aliased form (e.g.,
'@components/molecules/IntegrateHostedEnsNodeTip.astro'); ensure your build/IDE
respects the alias by updating any Vite/ESBuild/TS config and restart the dev
server.

In
`@docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/example.mdx`:
- Line 18: Replace the occurrence of the command string "npm start" in the
example text with "pnpm start" so the docs' runnable instruction matches the
repository's pnpm workspace standard; search for the literal "npm start" in the
example.mdx content and update it to "pnpm start".

In
`@docs/ensnode.io/src/lib/playground/example-project/buildPlaygroundTsconfig.ts`:
- Around line 21-39: The buildNodePlaygroundTsconfig function currently includes
"DOM" and "DOM.Iterable" in the compilerOptions.lib which is unnecessary for a
Node-only playground; remove those entries from the lib array so only
Node-relevant libs remain (e.g., keep "ESNext" and rely on types: ["node"])
unless you intentionally need browser DOM types for isomorphic/testing
reasons—update the lib array in buildNodePlaygroundTsconfig accordingly.

In `@docs/ensnode.io/src/lib/playground/example-project/replaceEnvWithValues.ts`:
- Around line 15-16: The loop in replaceEnvWithValues.ts uses
next.replace(pattern, replacement) which only replaces the first match for
string or non-global RegExp patterns; update the logic in the
replaceEnvWithValues function (the loop over replacements and the variables
pattern/replacement) to perform global replacements—either call
next.replaceAll(pattern, replacement) when pattern is a string or already-global
RegExp, or, if pattern may be a non-global RegExp, convert it to a global RegExp
(e.g., new RegExp(pattern.source, (pattern.flags || '') + 'g')) before
replacing; ensure you handle both string and RegExp cases and preserve the
replacement behavior.

In
`@docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.test.ts`:
- Around line 6-9: The test currently hardcodes exact versions for
resolveMonorepoSpecifier which will break when the pnpm catalog changes; change
the test to assert behavior rather than exact values by either mocking/stubbing
the catalog lookup used by resolveMonorepoSpecifier (so it returns stable,
controllable values) or by asserting version shape/semantics (e.g., match a
semver or range regex, or assert that the result is a non-empty string and
optionally startsWith/^/ for ranges) instead of exact "24.10.9" and "^5.7.3";
update the test around resolveMonorepoSpecifier to use the chosen approach.

In
`@docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts`:
- Around line 33-59: The parsePnpmCatalog function can silently return an empty
catalog if the pnpm-workspace.yaml format changes; after parsing inside
parsePnpmCatalog, validate the result (e.g., check Object.keys(catalog).length)
and either throw a clear Error like "Failed to parse pnpm catalog from
pnpm-workspace.yaml" or explicitly document that an empty catalog is acceptable;
update parsePnpmCatalog to perform this validation so callers (e.g.,
resolveMonorepoSpecifier) won't proceed with an unexpected empty catalog.

In
`@docs/ensnode.io/src/lib/playground/example-project/resolvePinnedDependencies.ts`:
- Around line 17-32: The parameter name packages in addPeerDependencies is
ambiguous vs the hardcoded resolution context [enssdkPackageJson,
enskitPackageJson]; rename the parameter (e.g., to sourcePackages or
packagesWithPeers) and update its type and all internal references inside
addPeerDependencies so the intent is clear (function
addPeerDependencies(manifest: PlaygroundPackageManifest, sourcePackages: Array<{
peerDependencies: Record<string, string> }>){ ... } and iterate over
sourcePackages), and update any callers of addPeerDependencies to use the new
name; keep resolvePeerSpecifier, enssdkPackageJson, enskitPackageJson and
manifest usage unchanged.

In `@docs/ensnode.io/src/lib/playground/loadEnskitExampleProject.test.ts`:
- Around line 24-25: The semver regex in loadEnskitExampleProject.test.ts is too
strict and will fail for pre-release or build metadata; update the two
assertions that reference project.dependencies.enskit and
project.dependencies.enssdk to accept prerelease/build suffixes by either
replacing the regex with a more flexible pattern that allows an optional
prerelease/build segment (e.g., accept - or + followed by
alphanumerics/dots/hyphens) or, better, use a proper semver validator (e.g.,
import semver and assert semver.valid(project.dependencies.enskit) and
semver.valid(project.dependencies.enssdk) is truthy) so the tests accept
versions like 1.0.0-beta.1 or 1.0.0+meta.

In `@docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.test.ts`:
- Around line 19-29: The test currently only checks presence for many
devDependencies (using the loop over enssdkExamplePackageJson.devDependencies
and expect(...).toBeDefined()), which lets version drift slip through; replace
that presence-only check with a strict comparison of versions by asserting
project.devDependencies matches the example manifest (use
expect(project.devDependencies).toMatchObject(enssdkExamplePackageJson.devDependencies)
or
expect(project.devDependencies).toEqual(enssdkExamplePackageJson.devDependencies)
as appropriate), and likewise assert exact versions for
project.dependencies.enssdk (use the exact string from
enssdkExamplePackageJson.dependencies.enssdk) instead of the loose regex; update
or remove individual loose expects (e.g., for "@types/node", "gql.tada", "tsx")
so the test validates versions against enssdkExamplePackageJson.devDependencies.

In `@docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.ts`:
- Around line 21-26: Update the envReplacements pattern to a more flexible regex
so it matches variations in whitespace and optional non-null assertions;
specifically replace the current pattern in the envReplacements entry that
targets ENSNODE_URL with a regex like
/const\s+ENSNODE_URL\s*=\s*process\.env\.ENSNODE_URL!?;?/ (or equivalent) and
keep the same replacement `const ENSNODE_URL = ${JSON.stringify(ENSNODE_URL)};`
so matches succeed even if the source has extra spaces, different formatting, or
the trailing `!`/`;` is absent.

In `@docs/ensnode.io/src/lib/playground/types.ts`:
- Line 1: The file imports the Zod utility from the wrong module; update the
import of z in docs/ensnode.io/src/lib/playground/types.ts so that the symbol z
is imported from "astro/zod" instead of "astro:content" (i.e., change the import
statement that references z to use "astro/zod" to match other files like
content.config.ts).

In `@docs/ensnode.io/src/lib/playground/utils.ts`:
- Around line 6-16: Add brief one-line inline comments clarifying that the
numeric layout constants in getNiceHeightForCodeSnippet are pixel/UI dimensions:
annotate lineHeight = 18 as "line height in pixels for code lines", headerHeight
= 38 as "header height in pixels for the code block", and footerHeight = 32 as
"footer/controls height in pixels"; you can also add a short note next to
terminalHeightPercentage explaining it represents the portion of vertical space
reserved for the terminal. Keep comments concise and colocated with the
variables in the getNiceHeightForCodeSnippet function.

In `@docs/ensnode.io/tsconfig.json`:
- Around line 6-9: Remove the problematic wildcard path mapping in tsconfig.json
that maps "*" -> ["./*"]; update the "paths" object to only include the
workspace alias (e.g., keep "@workspace/*": ["../../*"]) and delete the line
with "\"*\": [\"./*\"]" so TypeScript can fall back to node_modules resolution
for external packages.

---

Duplicate comments:
In `@docs/ensnode.io/src/components/molecules/CodePlayground.tsx`:
- Around line 114-117: The useEffect in the CodePlayground component calls
sdk.embedProject(ref.current, project, embedOptions) but does not clean up the
previous embed; change the effect to capture the embed instance returned by
sdk.embedProject (e.g., const embed = sdk.embedProject(...)) and return a
cleanup function that disposes it (e.g., embed?.dispose?.() ||
embed?.terminate?.()) and/or remove the iframe from ref.current
(ref.current.innerHTML = '') to ensure WebContainer/iframe resources are
released when project/embedOptions change or the component unmounts; keep refs
to ref.current, sdk.embedProject, project, and embedOptions when implementing
this cleanup.

In `@docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro`:
- Around line 244-249: The clipboard call using navigator.clipboard.writeText
lacks error handling so failures give no user feedback; wrap the writeText call
with a promise catch (or use async/try-catch) and in the error path update
copyBtn.textContent to a failure message (e.g., "Copy failed") and revert to
defaultLabel after the same timeout, and also console.error the caught error;
update the block around navigator.clipboard.writeText, copyBtn, and defaultLabel
to implement this fallback behavior.
🪄 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: e9c1b6a8-311e-4692-85da-189107c0a159

📥 Commits

Reviewing files that changed from the base of the PR and between f01ce76 and 0b720c5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (62)
  • AGENTS.md
  • docs/ensnode.io/astro.config.mjs
  • docs/ensnode.io/config/integrations/llms-txt.ts
  • docs/ensnode.io/config/integrations/starlight/index.ts
  • docs/ensnode.io/config/integrations/starlight/sidebar-topics/integrate.ts
  • docs/ensnode.io/package.json
  • docs/ensnode.io/scripts/fetch-omnigraph-example-responses.mts
  • docs/ensnode.io/src/components/molecules/CodePlayground.tsx
  • docs/ensnode.io/src/components/molecules/IntegrateHostedEnsNodeTip.astro
  • docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro
  • docs/ensnode.io/src/components/organisms/EnskitExampleInteractivePlayground.tsx
  • docs/ensnode.io/src/components/organisms/EnssdkExampleInteractivePlayground.tsx
  • docs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsx
  • docs/ensnode.io/src/components/organisms/OmnigraphAPIExample.astro
  • docs/ensnode.io/src/components/overrides/PageFrame.astro
  • docs/ensnode.io/src/content.config.ts
  • docs/ensnode.io/src/content/docs/docs/integrate/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/example.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/example.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-events.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-resolver-permissions.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-by-name.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-events.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-resolver.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-subdomains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domains-by-address.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/find-domains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/namegraph.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-contract.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-user.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/registry-domains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/why-ensnode.mdx
  • docs/ensnode.io/src/data/omnigraph-examples/examples.ts
  • docs/ensnode.io/src/data/omnigraph-examples/meta.ts
  • docs/ensnode.io/src/data/omnigraph-examples/responses.json
  • docs/ensnode.io/src/lib/playground/constants.ts
  • docs/ensnode.io/src/lib/playground/example-project/assemblePlaygroundProject.ts
  • docs/ensnode.io/src/lib/playground/example-project/buildPlaygroundTsconfig.ts
  • docs/ensnode.io/src/lib/playground/example-project/fetchRawExampleProject.ts
  • docs/ensnode.io/src/lib/playground/example-project/loadExampleProject.ts
  • docs/ensnode.io/src/lib/playground/example-project/replaceEnvWithValues.test.ts
  • docs/ensnode.io/src/lib/playground/example-project/replaceEnvWithValues.ts
  • docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.test.ts
  • docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts
  • docs/ensnode.io/src/lib/playground/example-project/resolvePinnedDependencies.ts
  • docs/ensnode.io/src/lib/playground/example-project/types.ts
  • docs/ensnode.io/src/lib/playground/loadEnskitExampleProject.test.ts
  • docs/ensnode.io/src/lib/playground/loadEnskitExampleProject.ts
  • docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.test.ts
  • docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.ts
  • docs/ensnode.io/src/lib/playground/types.ts
  • docs/ensnode.io/src/lib/playground/utils.ts
  • docs/ensnode.io/src/styles/starlight.css
  • docs/ensnode.io/tsconfig.json
  • docs/ensnode.io/vitest.config.ts
  • package.json
  • packages/ensnode-sdk/src/omnigraph-api/example-queries.ts
  • vitest.config.ts
💤 Files with no reviewable changes (1)
  • docs/ensnode.io/src/content/docs/docs/integrate/why-ensnode.mdx

Comment thread docs/ensnode.io/scripts/fetch-omnigraph-example-responses.mts
Comment thread docs/ensnode.io/scripts/fetch-omnigraph-example-responses.mts
Comment thread docs/ensnode.io/src/content/docs/docs/integrate/index.mdx Outdated
Comment thread docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.test.ts
Comment thread docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.ts
Comment thread docs/ensnode.io/src/lib/playground/types.ts Outdated
Comment thread docs/ensnode.io/src/lib/playground/utils.ts
Comment thread docs/ensnode.io/tsconfig.json
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: 5

♻️ Duplicate comments (2)
docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro (1)

244-249: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add error handling for clipboard operation.

If navigator.clipboard.writeText fails (e.g., permissions denied or insecure context), the user receives no feedback. Add a .catch() to inform the user when the copy operation fails.

🛡️ Proposed fix
-      void navigator.clipboard.writeText(text).then(() => {
-        copyBtn.textContent = "Copied!";
-        setTimeout(() => {
-          copyBtn.textContent = defaultLabel;
-        }, 1600);
-      });
+      void navigator.clipboard.writeText(text)
+        .then(() => {
+          copyBtn.textContent = "Copied!";
+          setTimeout(() => {
+            copyBtn.textContent = defaultLabel;
+          }, 1600);
+        })
+        .catch(() => {
+          copyBtn.textContent = "Failed";
+          setTimeout(() => {
+            copyBtn.textContent = defaultLabel;
+          }, 1600);
+        });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro`
around lines 244 - 249, The clipboard.writeText call currently assumes success;
add error handling by chaining a .catch on navigator.clipboard.writeText(text)
to handle failures: set copyBtn.textContent to a failure message (e.g., "Copy
failed") or revert to defaultLabel, optionally call setTimeout to restore
defaultLabel, and log the error (console.error) so users get feedback when
navigator.clipboard.writeText, copyBtn, or defaultLabel fail due to
permissions/insecure context.
docs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsx (1)

33-33: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix incomplete null-guard in key expression.

section.sectionHeader?.toString() returns string | undefined. When it's undefined, calling .replace(" ", "-") on it will throw. The optional chaining only guards .toString(), not .replace().

🛡️ Proposed fix
-        <InnovationSection key={section.sectionHeader?.toString().replace(" ", "-")} {...section} />
+        <InnovationSection
+          key={section.sectionHeader?.toString()?.replace(/\s+/g, "-") ?? "innovation-section"}
+          {...section}
+        />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsx` at
line 33, The key expression uses section.sectionHeader?.toString().replace(...)
which can call .replace on undefined; update the key to guard the replace call
by first deriving a safe string (e.g. use nullish coalescing or a conditional)
before calling .replace, for example compute a safeHeader =
(section.sectionHeader?.toString() ?? "") or use a conditional fallback and then
call .replace on that safe value when rendering <InnovationSection ... /> so the
key generation never invokes .replace on undefined.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ensnode.io/src/components/molecules/CodePlayground.tsx`:
- Around line 84-88: The projectFiles object currently allows user-supplied
files to override the generated package.json because "...files" is spread after
the explicit "package.json": packageJson; update the projectFiles construction
in CodePlayground.tsx so the generated manifest is authoritative by either
placing "package.json" after the spread or using the same fallback pattern as
tsconfig.json (i.e. "package.json": files["package.json"] ?? packageJson) to
ensure intentional precedence and prevent callers from silently replacing the
baked-in runtime/dependencies/devDependencies.

In `@docs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsx`:
- Around line 12-13: The component OmnigraphSchemaDocExplorer is wrapping the
module-level omnigraphSchema in a redundant useMemo; remove the useMemo call and
pass omnigraphSchema directly to GraphiQLProvider (replace the const schema =
useMemo(() => omnigraphSchema, []); and any reference to schema with
omnigraphSchema) so the provider consumes the module constant without
unnecessary memoization.

In `@docs/ensnode.io/src/content/docs/docs/integrate/index.mdx`:
- Line 14: Update the wording in the sentence that mentions ENSv2 to use the
standard spelling "on-chain" instead of "onchain" — locate the sentence
containing "ENSv2 is the next generation of the Ethereum Name Service — a
protocol upgrade that fundamentally changes the onchain data model of ENS" and
replace "onchain" with "on-chain" so it reads "...changes the on-chain data
model of ENS."

In
`@docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts`:
- Around line 33-63: Replace the fragile hand-rolled line/regex parser in
parsePnpmCatalog with a real YAML parser: import { parse } from "yaml" and call
parse(source) to get the document, then read doc.catalog as a
Record<string,string> (e.g. const catalog = (doc as any).catalog ?? {}), keep
the existing error throw if Object.keys(catalog).length === 0, and return
catalog; ensure the function name parsePnpmCatalog remains and remove the manual
line-splitting/regex logic.
- Around line 94-97: This file exports an unused deprecated helper
resolveEnssdkPeerSpecifier; delete the entire function/export (and any test or
re-export referencing it) to avoid shipping dead API, and ensure no remaining
mention of resolveEnssdkPeerSpecifier in the repo; if you prefer to keep it
temporarily, instead replace the current single-line JSDoc with an explicit
deprecation removal plan (add `@deprecated` with a target removal version/date and
rationale) while keeping the implementation that forwards to
resolvePeerSpecifier(…, [enssdkPackageJson]).

---

Duplicate comments:
In `@docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro`:
- Around line 244-249: The clipboard.writeText call currently assumes success;
add error handling by chaining a .catch on navigator.clipboard.writeText(text)
to handle failures: set copyBtn.textContent to a failure message (e.g., "Copy
failed") or revert to defaultLabel, optionally call setTimeout to restore
defaultLabel, and log the error (console.error) so users get feedback when
navigator.clipboard.writeText, copyBtn, or defaultLabel fail due to
permissions/insecure context.

In `@docs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsx`:
- Line 33: The key expression uses
section.sectionHeader?.toString().replace(...) which can call .replace on
undefined; update the key to guard the replace call by first deriving a safe
string (e.g. use nullish coalescing or a conditional) before calling .replace,
for example compute a safeHeader = (section.sectionHeader?.toString() ?? "") or
use a conditional fallback and then call .replace on that safe value when
rendering <InnovationSection ... /> so the key generation never invokes .replace
on undefined.
🪄 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: 840bb5cf-3dd2-4188-97b6-ddce0b0e8adb

📥 Commits

Reviewing files that changed from the base of the PR and between 0b720c5 and e4045e4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (53)
  • docs/ensnode.io/astro.config.mjs
  • docs/ensnode.io/config/integrations/llms-txt.ts
  • docs/ensnode.io/package.json
  • docs/ensnode.io/src/components/molecules/CodePlayground.tsx
  • docs/ensnode.io/src/components/molecules/HeaderButtons.tsx
  • docs/ensnode.io/src/components/molecules/HeaderMobileNavigation.tsx
  • docs/ensnode.io/src/components/molecules/JoinTelegram.tsx
  • docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro
  • docs/ensnode.io/src/components/molecules/StaticHeader.astro
  • docs/ensnode.io/src/components/molecules/TelegramInvite.astro
  • docs/ensnode.io/src/components/organisms/ENSNodeSuite.tsx
  • docs/ensnode.io/src/components/organisms/ExampleCard.astro
  • docs/ensnode.io/src/components/organisms/Header.astro
  • docs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsx
  • docs/ensnode.io/src/components/organisms/OmnigraphAPIExample.astro
  • docs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsx
  • docs/ensnode.io/src/components/overrides/Hero.astro
  • docs/ensnode.io/src/content/docs/docs/integrate/hosted-instances.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/ensdb.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/example.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/example.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-events.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-resolver-permissions.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-by-name.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-events.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-resolver.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-subdomains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domains-by-address.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/find-domains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/index.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/namegraph.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-contract.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-user.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/registry-domains.mdx
  • docs/ensnode.io/src/content/docs/docs/integrate/omnigraph/schema-reference.mdx
  • docs/ensnode.io/src/content/docs/docs/services/ensadmin/index.mdx
  • docs/ensnode.io/src/content/docs/docs/services/ensdb/index.mdx
  • docs/ensnode.io/src/data/ens-v1-examples-queries.ts
  • docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.test.ts
  • docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts
  • docs/ensnode.io/src/lib/playground/example-project/types.ts
  • docs/ensnode.io/src/lib/playground/loadEnskitExampleProject.ts
  • docs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.ts
  • docs/ensnode.io/src/lib/playground/types.ts
  • docs/ensnode.io/src/pages/404.astro
  • docs/ensnode.io/src/pages/examples.astro
  • docs/ensnode.io/src/pages/index.astro
  • docs/ensnode.io/tsconfig.json
  • docs/ensnode.io/vitest.config.ts

Comment thread docs/ensnode.io/src/components/molecules/CodePlayground.tsx
Comment thread docs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsx Outdated
Comment thread docs/ensnode.io/src/content/docs/docs/integrate/index.mdx
Comment thread docs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.ts Outdated
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.

3 participants