docs: add sandbox and ensv2readiness#2103
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 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). ChangesOmnigraph Examples & Example Query Infrastructure
StackBlitz Playground Runtime Infrastructure
Interactive Playground UI Components
Docs pages, sidebar, redirects, and styling
Starlight llms-txt plugin & pnpm patch
Docs package config and helpers
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
Greptile SummaryThis PR adds interactive sandbox playgrounds (StackBlitz embeds for
Confidence Score: 5/5Safe 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
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
Reviews (10): Last reviewed commit: "fix production bug" | Re-trigger Greptile |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (2)
docs/ensnode.io/public/ensomnigraph.pngis excluded by!**/*.pngpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
docs/ensnode.io/package.jsondocs/ensnode.io/src/components/molecules/CodePlayground.tsxdocs/ensnode.io/src/components/molecules/EnssdkPlayground.tsxdocs/ensnode.io/src/components/playgrounds/EnssdkResolutionApi.tsxdocs/ensnode.io/src/components/playgrounds/common.tsdocs/ensnode.io/src/content/docs/docs/integrate/ensv2-readiness.mdxdocs/ensnode.io/src/content/docs/docs/integrate/index.mdx
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
docs/ensnode.io/config/integrations/llms-txt.tsdocs/ensnode.io/config/integrations/starlight/index.tspackage.jsonpatches/starlight-llms-txt@0.5.1.patch
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
apps/ensapi/src/omnigraph-api/schema/example-queries.integration.test.tsapps/ensapi/src/omnigraph-api/schema/example-queries.test.tsdocs/ensnode.io/config/integrations/llms-txt.tsdocs/ensnode.io/config/integrations/starlight/sidebar-topics/integrate.tsdocs/ensnode.io/package.jsondocs/ensnode.io/src/components/docs/EnssdkExamplePanels.astrodocs/ensnode.io/src/components/docs/OmnigraphRecipeExample.astrodocs/ensnode.io/src/components/docs/OmnigraphRecipePanels.astrodocs/ensnode.io/src/components/organisms/ExampleCard.astrodocs/ensnode.io/src/components/playgrounds/EnssdkResolutionApi.tsxdocs/ensnode.io/src/components/playgrounds/common.tsdocs/ensnode.io/src/components/playgrounds/quickstartResolveDomainSnippet.tsdocs/ensnode.io/src/content.config.tsdocs/ensnode.io/src/content/docs/docs/integrate/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/cookbook/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/cookbook/resolution-api.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook/account-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook/domain-by-name.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/cookbook/index.mdxdocs/ensnode.io/src/content/snippets/omnigraphAdmin.tsdocs/ensnode.io/src/data/ens-v1-examples-queries.tsdocs/ensnode.io/src/data/ens-v2-examples-queries/account-domains.tsdocs/ensnode.io/src/data/ens-v2-examples-queries/common.tsdocs/ensnode.io/src/data/ens-v2-examples-queries/domain-by-name.tsdocs/ensnode.io/src/data/ens-v2-examples-queries/index.tsdocs/ensnode.io/src/lib/omnigraph-recipe.tspackages/ensnode-sdk/package.jsonpackages/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
lightwalker-eth
left a comment
There was a problem hiding this comment.
@sevenzing Please take the lead to merge after you've completed your own review and feel good about merging 👍 Thanks!
There was a problem hiding this comment.
Actionable comments posted: 19
♻️ Duplicate comments (2)
docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro (1)
244-249:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd error handling for clipboard operation.
If
navigator.clipboard.writeTextfails (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 winAdd 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (62)
AGENTS.mddocs/ensnode.io/astro.config.mjsdocs/ensnode.io/config/integrations/llms-txt.tsdocs/ensnode.io/config/integrations/starlight/index.tsdocs/ensnode.io/config/integrations/starlight/sidebar-topics/integrate.tsdocs/ensnode.io/package.jsondocs/ensnode.io/scripts/fetch-omnigraph-example-responses.mtsdocs/ensnode.io/src/components/molecules/CodePlayground.tsxdocs/ensnode.io/src/components/molecules/IntegrateHostedEnsNodeTip.astrodocs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astrodocs/ensnode.io/src/components/organisms/EnskitExampleInteractivePlayground.tsxdocs/ensnode.io/src/components/organisms/EnssdkExampleInteractivePlayground.tsxdocs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsxdocs/ensnode.io/src/components/organisms/OmnigraphAPIExample.astrodocs/ensnode.io/src/components/overrides/PageFrame.astrodocs/ensnode.io/src/content.config.tsdocs/ensnode.io/src/content/docs/docs/integrate/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/example.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/example.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-events.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-resolver-permissions.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-by-name.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-events.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-resolver.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-subdomains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domains-by-address.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/find-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/namegraph.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-contract.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-user.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/registry-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/why-ensnode.mdxdocs/ensnode.io/src/data/omnigraph-examples/examples.tsdocs/ensnode.io/src/data/omnigraph-examples/meta.tsdocs/ensnode.io/src/data/omnigraph-examples/responses.jsondocs/ensnode.io/src/lib/playground/constants.tsdocs/ensnode.io/src/lib/playground/example-project/assemblePlaygroundProject.tsdocs/ensnode.io/src/lib/playground/example-project/buildPlaygroundTsconfig.tsdocs/ensnode.io/src/lib/playground/example-project/fetchRawExampleProject.tsdocs/ensnode.io/src/lib/playground/example-project/loadExampleProject.tsdocs/ensnode.io/src/lib/playground/example-project/replaceEnvWithValues.test.tsdocs/ensnode.io/src/lib/playground/example-project/replaceEnvWithValues.tsdocs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.test.tsdocs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.tsdocs/ensnode.io/src/lib/playground/example-project/resolvePinnedDependencies.tsdocs/ensnode.io/src/lib/playground/example-project/types.tsdocs/ensnode.io/src/lib/playground/loadEnskitExampleProject.test.tsdocs/ensnode.io/src/lib/playground/loadEnskitExampleProject.tsdocs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.test.tsdocs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.tsdocs/ensnode.io/src/lib/playground/types.tsdocs/ensnode.io/src/lib/playground/utils.tsdocs/ensnode.io/src/styles/starlight.cssdocs/ensnode.io/tsconfig.jsondocs/ensnode.io/vitest.config.tspackage.jsonpackages/ensnode-sdk/src/omnigraph-api/example-queries.tsvitest.config.ts
💤 Files with no reviewable changes (1)
- docs/ensnode.io/src/content/docs/docs/integrate/why-ensnode.mdx
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (2)
docs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astro (1)
244-249:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd error handling for clipboard operation.
If
navigator.clipboard.writeTextfails (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 winFix incomplete null-guard in key expression.
section.sectionHeader?.toString()returnsstring | undefined. When it'sundefined, 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (53)
docs/ensnode.io/astro.config.mjsdocs/ensnode.io/config/integrations/llms-txt.tsdocs/ensnode.io/package.jsondocs/ensnode.io/src/components/molecules/CodePlayground.tsxdocs/ensnode.io/src/components/molecules/HeaderButtons.tsxdocs/ensnode.io/src/components/molecules/HeaderMobileNavigation.tsxdocs/ensnode.io/src/components/molecules/JoinTelegram.tsxdocs/ensnode.io/src/components/molecules/OmnigraphAPIExamplePanels.astrodocs/ensnode.io/src/components/molecules/StaticHeader.astrodocs/ensnode.io/src/components/molecules/TelegramInvite.astrodocs/ensnode.io/src/components/organisms/ENSNodeSuite.tsxdocs/ensnode.io/src/components/organisms/ExampleCard.astrodocs/ensnode.io/src/components/organisms/Header.astrodocs/ensnode.io/src/components/organisms/InfrastructureInnovations.tsxdocs/ensnode.io/src/components/organisms/OmnigraphAPIExample.astrodocs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsxdocs/ensnode.io/src/components/overrides/Hero.astrodocs/ensnode.io/src/content/docs/docs/integrate/hosted-instances.mdxdocs/ensnode.io/src/content/docs/docs/integrate/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/ensdb.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/example.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/example.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/omnigraph-graphql-api.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-events.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/account-resolver-permissions.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-by-name.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-events.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-resolver.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domain-subdomains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/domains-by-address.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/find-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/index.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/namegraph.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-contract.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/permissions-by-user.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/examples/registry-domains.mdxdocs/ensnode.io/src/content/docs/docs/integrate/omnigraph/schema-reference.mdxdocs/ensnode.io/src/content/docs/docs/services/ensadmin/index.mdxdocs/ensnode.io/src/content/docs/docs/services/ensdb/index.mdxdocs/ensnode.io/src/data/ens-v1-examples-queries.tsdocs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.test.tsdocs/ensnode.io/src/lib/playground/example-project/resolveMonorepoSpecifier.tsdocs/ensnode.io/src/lib/playground/example-project/types.tsdocs/ensnode.io/src/lib/playground/loadEnskitExampleProject.tsdocs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.tsdocs/ensnode.io/src/lib/playground/types.tsdocs/ensnode.io/src/pages/404.astrodocs/ensnode.io/src/pages/examples.astrodocs/ensnode.io/src/pages/index.astrodocs/ensnode.io/tsconfig.jsondocs/ensnode.io/vitest.config.ts
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
Why
Testing
Notes for Reviewer (Optional)
Pre-Review Checklist (Blocking)