Skip to content

refactor(ensnode-sdk): move ENSNodeClient into ENSApi module#1636

Merged
tk-o merged 3 commits intomainfrom
refactor/ensnode-sdk-ensapi-client
Feb 16, 2026
Merged

refactor(ensnode-sdk): move ENSNodeClient into ENSApi module#1636
tk-o merged 3 commits intomainfrom
refactor/ensnode-sdk-ensapi-client

Conversation

@tk-o
Copy link
Contributor

@tk-o tk-o commented Feb 16, 2026

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

  • ENSNodeClient has been moved into ENSApi module

Why

  • This change will enable an update where ENSNode SDK will have two separate API modules, one for ENSApi (./ensapi/api) and one for ENSIndexer (./ensindexer/api). Each of those separate API modules will be able to use shared Indexing Status data model.
  • For now, we just have ENSNodeClient which works with ENSApi. However, to achieve goals of issue ENSApi: Persist ENSIndexerPublicConfig to the database #1252, we'll also need ENSIndexerClient that will use data model distinct from ENSNodeClient.

Testing

  • Ran static code checks and testing suite.
  • Tested major HTTP API endpoints for ENSApi service.
  • Tested UI views on local ENSAdmin UI connected to local ENSApi instance.

Notes for Reviewer (Optional)


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)

@tk-o tk-o requested a review from a team as a code owner February 16, 2026 13:06
Copilot AI review requested due to automatic review settings February 16, 2026 13:06
@vercel
Copy link
Contributor

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Feb 16, 2026 1:29pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
ensnode.io Skipped Skipped Feb 16, 2026 1:29pm
ensrainbow.io Skipped Skipped Feb 16, 2026 1:29pm

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

⚠️ No Changeset found

Latest commit: ab75d0a

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

coderabbitai bot commented Feb 16, 2026

📝 Walkthrough

Walkthrough

Reorganizes the SDK API surface: renames exported client class from ENSNodeClientENSApiClient (adds a deprecated ENSNodeClient wrapper), moves client-related exports into ensapi submodule, and updates import paths across tests and implementation files. No runtime logic changes.

Changes

Cohort / File(s) Summary
Client rename & compatibility wrapper
packages/ensnode-sdk/src/ensapi/client.ts
Renamed exported class ENSNodeClientENSApiClient; added a deprecated ENSNodeClient class that extends ENSApiClient; updated internal references and default options resolution.
Index export reorganization
packages/ensnode-sdk/src/ensapi/index.ts, packages/ensnode-sdk/src/index.ts
Moved exports for client types/symbols into ensapi/index.ts and removed those exports from the package root src/index.ts. Re-exported client-error and deployments from ensapi.
Import path adjustments (runtime types)
packages/ensnode-sdk/src/ensapi/client-error.ts
Adjusted import path for ErrorResponse to a shallower relative path; no logic change.
Tests — import updates / rewiring
packages/ensnode-sdk/src/ensapi/client.test.ts, packages/ensnode-sdk/src/ensapi/deployments.test.ts
Updated test imports and references to use ENSApiClient and new ../ module paths (e.g., ../ens, ../ensindexer/...) and adjusted symbol sources (ENSNamespaceIds, public types).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ensnode-sdk

Poem

🐰 I hopped through code with nimble feet,

Changed a name and moved a seat,
ENSApiClient now leads the race,
ENSNodeClient keeps a backward place,
A tidy burrow, exports in their space.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: moving ENSNodeClient into the ENSApi module, which is the core refactoring objective clearly conveyed.
Description check ✅ Passed The description follows the Lite PR template with all required sections completed: Summary, Why, Testing, Notes for Reviewer, and Pre-Review Checklist are all filled out with substantive information.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/ensnode-sdk-ensapi-client

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

❤️ Share

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR moves ENSNodeClient and related files (client-error, deployments) from the root level (./client, ./client-error, ./deployments) into the ENSApi module (./ensapi/client, ./ensapi/client-error, ./ensapi/deployments). This is the third PR in a refactoring series (following #1633 and #1635) that reorganizes the ENSNode SDK to support separate API modules for ENSApi and ENSIndexer, enabling future work on issue #1252 which requires creating a dedicated ENSIndexerClient.

Changes:

  • Moved ENSNodeClient implementation and related files from root to ./ensapi subdirectory
  • Updated all internal import paths to reflect the new file locations
  • Re-exported client exports through ./ensapi module to maintain public API compatibility

Reviewed changes

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

Show a summary per file
File Description
packages/ensnode-sdk/src/index.ts Removed direct exports of client-related modules (now exported via ensapi)
packages/ensnode-sdk/src/ensapi/index.ts Added exports for client, client-error, and deployments modules
packages/ensnode-sdk/src/ensapi/deployments.ts Moved from root level to ensapi subdirectory
packages/ensnode-sdk/src/ensapi/deployments.test.ts Updated import path for ENSNamespaceIds from ./ens to ../ens
packages/ensnode-sdk/src/ensapi/client.ts Updated import paths to reference local modules and relative paths
packages/ensnode-sdk/src/ensapi/client.test.ts Updated all import paths to reflect new file structure
packages/ensnode-sdk/src/ensapi/client-error.ts Updated import path for ErrorResponse from ./ensapi/api to ./api

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

Copy link
Contributor Author

@tk-o tk-o left a comment

Choose a reason for hiding this comment

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

Self-review completed

@@ -1,2 +1,5 @@
export * from "./api";
export { type ClientOptions, ENSNodeClient } from "./client";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lightwalker-eth, I wonder if we should rename ENSNodeClient to ENSApiClient? Of course, we'd keep ENSNodeClient as alias for now. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

@tk-o Yes I think we should do this 👍

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 16, 2026

Greptile Summary

This PR moves ENSNodeClient, ClientError, and deployments code from the top-level src/ directory into the src/ensapi/ module, co-locating ENSApi client code with its API definitions.

  • File relocations: client.ts, client-error.ts, deployments.ts and their test files moved from src/ to src/ensapi/
  • Import path updates: All relative imports adjusted to reflect new file locations; no logic changes in any file
  • Public API preserved: src/ensapi/index.ts now re-exports the moved symbols (ENSNodeClient, ClientOptions, ClientError, deployment constants), and src/index.ts continues to re-export ./ensapi, so the public API surface (@ensnode/ensnode-sdk) remains unchanged
  • Verified consumers: ensnode-react, namehash-ui, and other dependent packages all import from the public @ensnode/ensnode-sdk entry point — no breakage from this refactor
  • No issues found: This is a clean structural refactoring with no functional changes

Confidence Score: 5/5

  • This PR is safe to merge — it is a pure structural refactor with no logic changes and a fully preserved public API.
  • All changes are file moves and import path updates. No logic, types, or behavior is modified. The public API export chain (src/index.tssrc/ensapi/index.ts → moved files) correctly preserves all previously-exported symbols. All downstream consumers import from the package entry point and are unaffected.
  • No files require special attention.

Important Files Changed

Filename Overview
packages/ensnode-sdk/src/ensapi/client.ts Moved from src/client.ts to src/ensapi/client.ts. Import paths updated from ./client-error, ./deployments, ./ensapi/api, ./resolution to their new relative equivalents. No logic changes.
packages/ensnode-sdk/src/ensapi/client-error.ts Moved from src/client-error.ts to src/ensapi/client-error.ts. Import path for ErrorResponse updated from ./ensapi/api/shared/errors/response to ./api/shared/errors/response. No logic changes.
packages/ensnode-sdk/src/ensapi/deployments.ts Moved from src/deployments.ts to src/ensapi/deployments.ts. File content is identical — no import path changes needed as it only imports from @ensnode/datasources.
packages/ensnode-sdk/src/ensapi/client.test.ts Moved from src/client.test.ts to src/ensapi/client.test.ts. All import paths updated to reflect the new location. Test logic unchanged, imports now use relative ../ paths for cross-module dependencies and ./ paths for sibling modules.
packages/ensnode-sdk/src/ensapi/deployments.test.ts Moved from src/deployments.test.ts to src/ensapi/deployments.test.ts. Import for ENSNamespaceIds updated from ./ens to ../ens. Test logic unchanged.
packages/ensnode-sdk/src/ensapi/index.ts Added re-exports for ENSNodeClient, ClientOptions, ClientError, and all deployments exports. This ensures the public API remains accessible via the ensapi barrel export, which is itself re-exported by src/index.ts.
packages/ensnode-sdk/src/index.ts Removed direct exports of ENSNodeClient, ClientOptions, ClientError, and deployments. These are now re-exported through ./ensapi, preserving the public API surface.

Flowchart

flowchart TD
    A["@ensnode/ensnode-sdk<br/>(src/index.ts)"] -->|"export * from './ensapi'"| B["src/ensapi/index.ts"]
    B -->|"export * from './api'"| C["src/ensapi/api/"]
    B -->|"export ENSNodeClient, ClientOptions"| D["src/ensapi/client.ts"]
    B -->|"export * from './client-error'"| E["src/ensapi/client-error.ts"]
    B -->|"export * from './config'"| F["src/ensapi/config/"]
    B -->|"export * from './deployments'"| G["src/ensapi/deployments.ts"]

    D -->|imports| C
    D -->|imports| E
    D -->|imports| G
    D -->|"imports ResolverRecordsSelection"| H["src/resolution/"]
    E -->|"imports ErrorResponse"| C

    style A fill:#e1f5fe
    style B fill:#fff9c4
    style D fill:#c8e6c9
    style E fill:#c8e6c9
    style G fill:#c8e6c9
Loading

Last reviewed commit: 42db185

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@tk-o tk-o changed the title Refactor/ensnode sdk ensapi client refactor(ensnode-sdk): move ENSNodeClient into ENSApi module Feb 16, 2026
Keeps deprecated `ENSNodeClient` to be an alias for `ENSApiClient`.
Copy link
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.

@tk-o Looks good 👍 Please merge when ready

Copy link

@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: 2

🤖 Fix all issues with AI agents
In `@packages/ensnode-sdk/src/ensapi/client.test.ts`:
- Line 205: Add a test block verifying the deprecated ENSNodeClient wrapper
still behaves as an alias for ENSApiClient: create an ENSNodeClient instance and
assert it is instanceof ENSApiClient and that its options equal
ENSApiClient.defaultOptions() (use client.getOptions() to fetch options). Place
the new describe/it alongside the existing ENSApiClient tests so the deprecated
wrapper’s construction and basic API are covered by the test suite.

In `@packages/ensnode-sdk/src/ensapi/client.ts`:
- Around line 672-678: Update the JSDoc on the ENSNodeClient declaration to
include a version/timeline and migration guidance: replace the bare
"@deprecated" with something like "@deprecated since vX.Y.Z — scheduled for
removal in vA.B.C; use ENSApiClient instead" and add a short note about
migration (e.g., constructor/signature compatibility) to help consumers; modify
the docblock above the ENSNodeClient class (which extends ENSApiClient)
accordingly so tooling and IDEs surface the deprecation version and removal
target.

@tk-o tk-o merged commit 7e97ef7 into main Feb 16, 2026
16 checks passed
@tk-o tk-o deleted the refactor/ensnode-sdk-ensapi-client branch February 16, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants