Skip to content

chore: fix tsconfig to check setupDashClient with correct ESM settings#64

Merged
thephez merged 2 commits intochore/minor-updatesfrom
chore/tsconfig-lint
Mar 18, 2026
Merged

chore: fix tsconfig to check setupDashClient with correct ESM settings#64
thephez merged 2 commits intochore/minor-updatesfrom
chore/tsconfig-lint

Conversation

@thephez
Copy link
Collaborator

@thephez thephez commented Mar 17, 2026

Update tsconfig.json to use module/moduleResolution node16 for proper .mjs ESM support, scope include to setupDashClient.mjs only, and set maxNodeModuleJsDepth to 0. Add @types/node and @types/mocha devDeps.
Add JSDoc type annotations to setupDashClient.mjs to pass strict tsc check.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced identity validation to detect missing on-chain identities with improved error handling and clearer error messages.
  • Developer Experience

    • Updated TypeScript configuration and development dependencies; added comprehensive type annotations and improved documentation for better IDE support and developer experience.

Update tsconfig.json to use module/moduleResolution node16 for proper
.mjs ESM support, scope include to setupDashClient.mjs only, and set
maxNodeModuleJsDepth to 0. Add @types/node and @types/mocha devDeps.
Add JSDoc type annotations to setupDashClient.mjs to pass strict tsc check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c09e088a-fba2-419c-aee7-8067479fa91a

📥 Commits

Reviewing files that changed from the base of the PR and between b3cc55e and fa4f915.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • package.json
  • setupDashClient.mjs
  • test/setupDashClient.test.mjs
  • tsconfig.json

📝 Walkthrough

Walkthrough

The pull request adds TypeScript type annotations and JSDoc documentation to setupDashClient.mjs, updates TypeScript compiler configuration for improved type checking, adds type definition packages to devDependencies, and introduces a test case validating error handling when identities are not found on-chain.

Changes

Cohort / File(s) Summary
Type System Setup
package.json, tsconfig.json
Added @types/mocha and @types/node dev dependencies. Updated TypeScript compiler options from commonjs to node16 module system and restricted include paths to setupDashClient.mjs.
Type Annotations
setupDashClient.mjs
Extensive JSDoc typedefs and type annotations added to existing functions and classes (Identity, IdentityPublicKey, PlatformAddress, NetworkLike types). Documented return types for IdentityKeyManager.create(), getSigner(), and AddressKeyManager methods. getSigner() now validates identity presence on-chain and throws if missing.
Test Coverage
test/setupDashClient.test.mjs
Added test case for IdentityKeyManager.getAuth() asserting error handling when identity is not found on-chain.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With types and docs, we hop with care,
Type hints declared everywhere!
JSDoc ribbons, neat and new,
Our interfaces ring crisp and true.
From jest to node, validation's fair—
A TypeScript warren, beyond compare! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating tsconfig.json to support ESM (.mjs) files with correct TypeScript settings, which is the primary focus reflected across the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/tsconfig-lint
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Add JSDoc typedef imports for Identity, IdentityPublicKey, PlatformAddress,
PlatformAddressInfo, and NetworkLike. Define DerivedKeyEntry and AddressEntry
typedefs. Replace all any params/returns with real SDK types. Add missing
@returns to create(), convenience signer methods, and exported functions.
Add identity-not-found guard in getSigner() with corresponding test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thephez thephez marked this pull request as ready for review March 18, 2026 15:05
@thephez
Copy link
Collaborator Author

thephez commented Mar 18, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

✅ Actions performed

Full review triggered.

@thephez thephez merged commit 3b539e3 into chore/minor-updates Mar 18, 2026
1 check passed
@thephez thephez deleted the chore/tsconfig-lint branch March 18, 2026 15:21
thephez added a commit that referenced this pull request Mar 18, 2026
…notations (#63)

* chore: remove old sdk files

* chore: fix main in package.json

* fix: use || instead of ?? for env var defaults to handle empty strings

?? only falls back on null/undefined, so an empty env var (e.g.
DATA_CONTRACT_ID='') would be used as-is instead of the intended default.

* chore: fmt

* chore: fix tsconfig to check setupDashClient with correct ESM settings (#64)

* chore: fix tsconfig to check setupDashClient with correct ESM settings

Update tsconfig.json to use module/moduleResolution node16 for proper
.mjs ESM support, scope include to setupDashClient.mjs only, and set
maxNodeModuleJsDepth to 0. Add @types/node and @types/mocha devDeps.
Add JSDoc type annotations to setupDashClient.mjs to pass strict tsc check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: replace any types with precise SDK types in setupDashClient

Add JSDoc typedef imports for Identity, IdentityPublicKey, PlatformAddress,
PlatformAddressInfo, and NetworkLike. Define DerivedKeyEntry and AddressEntry
typedefs. Replace all any params/returns with real SDK types. Add missing
@returns to create(), convenience signer methods, and exported functions.
Add identity-not-found guard in getSigner() with corresponding test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant