Skip to content

Conversation

@JonoPrest
Copy link
Collaborator

@JonoPrest JonoPrest commented Dec 2, 2025

Do not merge to main!

Summary by CodeRabbit

  • Breaking Changes

    • Transaction field renamed from type to kind
  • Chores

    • Updated package version to 0.7.0-hyperindex-v2-compatible

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Walkthrough

This PR renames the Transaction field from "type" to "kind" across TypeScript definitions, Rust types, NAPI bindings, and conversion implementations. All platform-specific package versions are updated to 0.7.0-hyperindex-v2-compatible with corresponding version validation checks.

Changes

Cohort / File(s) Summary
TypeScript Type Definitions
index.d.ts
Updated Transaction interface field from type?: number to kind?: number; changed TransactionField literal from 'Type' to 'Kind'
NAPI Binding Configuration
src/types.rs
Changed NAPI binding attribute from js_name = "type" to js_name = "kind" for the Transaction.type_ field, altering the exposed JavaScript property name
Rust Enum & Conversions
src/query.rs
Renamed TransactionField::Type enum variant to TransactionField::Kind; updated From trait implementations to map TransactionField::Kindnet_types::TransactionField::Type
Version Updates
index.js, package.json, npm/darwin-arm64/package.json, npm/darwin-x64/package.json, npm/linux-arm64-gnu/package.json, npm/linux-x64-gnu/package.json, npm/linux-x64-musl/package.json, npm/win32-arm64-msvc/package.json, npm/win32-x64-msvc/package.json
Updated all version fields from 0.7.1 to 0.7.0-hyperindex-v2-compatible; updated version validation check in index.js to expect the new version string

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Extra attention points:
    • Verify all mapping conversions between TransactionField::Kind and net_types::TransactionField::Type are bidirectional and correct
    • Confirm NAPI binding attribute change correctly exposes the field as kind in JavaScript while maintaining backward compatibility considerations
    • Ensure version check in index.js is consistently applied across all platform branches

Possibly related PRs

  • Client Upgrades #45: Updates the same public transaction field/enum names (Transaction.type ↔ kind, TransactionField Type/Kind) in type bindings across multiple layers.

Suggested reviewers

  • JasoonS

Poem

🐰 A field once named "type" hops away,
Kind wishes rename it today—
From TypeScript to Rust, bindings align,
Through versions they dance (0-point-7 divine),
Type-safety whispers, the refactor's in play! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main changes: renaming the Transaction 'type' field to 'kind' and updating version to 0.7.0-hyperindex-v2-compatible for backwards compatibility with hyperindex v2.
✨ 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 jp/make-backwards-compatable-client

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69fe502 and c8116ef.

📒 Files selected for processing (12)
  • index.d.ts (2 hunks)
  • index.js (26 hunks)
  • npm/darwin-arm64/package.json (2 hunks)
  • npm/darwin-x64/package.json (2 hunks)
  • npm/linux-arm64-gnu/package.json (2 hunks)
  • npm/linux-x64-gnu/package.json (2 hunks)
  • npm/linux-x64-musl/package.json (2 hunks)
  • npm/win32-arm64-msvc/package.json (2 hunks)
  • npm/win32-x64-msvc/package.json (2 hunks)
  • package.json (1 hunks)
  • src/query.rs (3 hunks)
  • src/types.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • npm/win32-x64-msvc/package.json
  • npm/darwin-arm64/package.json
  • index.d.ts
  • npm/win32-arm64-msvc/package.json
  • npm/darwin-x64/package.json
  • npm/linux-arm64-gnu/package.json
  • index.js
  • npm/linux-x64-musl/package.json
  • npm/linux-x64-gnu/package.json
  • package.json
🧰 Additional context used
🧬 Code graph analysis (1)
src/query.rs (1)
index.d.ts (1)
  • TransactionField (789-834)
🔇 Additional comments (2)
src/types.rs (1)

72-73: NAPI rename of transaction type_ → JS kind looks consistent; ensure external docs are aligned

Exposing this field as kind on the JS side while keeping the Rust/simple_types field name type_ preserves internal compatibility and matches the v2-facing surface. Please double-check any user-facing docs and TypeScript declarations that previously referenced transaction.type so they’re updated to transaction.kind where appropriate.

src/query.rs (1)

745-805: Bidirectional mapping between Kind and net_types::TransactionField::Type is consistent

Both conversion impls:

  • TransactionField::Kind => net_types::TransactionField::Type (Lines 745-805)
  • net_types::TransactionField::Type => TransactionField::Kind (Lines 1147-1205)

form a symmetric bridge so that the client surface uses Kind while the underlying net_types layer continues to use Type. This keeps FieldSelection and related conversions coherent in both directions without changing the wire-level representation.

Also applies to: 1147-1205


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

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5962431 and 69fe502.

📒 Files selected for processing (13)
  • index.d.ts (2 hunks)
  • index.js (26 hunks)
  • npm/darwin-arm64/package.json (1 hunks)
  • npm/darwin-x64/package.json (1 hunks)
  • npm/linux-arm64-gnu/package.json (1 hunks)
  • npm/linux-x64-gnu/package.json (1 hunks)
  • npm/linux-x64-musl/package.json (1 hunks)
  • npm/win32-arm64-msvc/README.md (1 hunks)
  • npm/win32-arm64-msvc/package.json (1 hunks)
  • npm/win32-x64-msvc/package.json (1 hunks)
  • package.json (1 hunks)
  • src/query.rs (3 hunks)
  • src/types.rs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/query.rs (1)
index.d.ts (1)
  • TransactionField (789-834)
🔇 Additional comments (14)
npm/darwin-x64/package.json (1)

11-11: LGTM on metadata updates.

The addition of the description field and OS declaration are appropriate and consistent with the platform specification.

Also applies to: 16-18

npm/darwin-arm64/package.json (1)

11-11: LGTM on metadata updates.

The description and OS field additions align with the pattern across other platforms.

Also applies to: 16-18

npm/linux-x64-musl/package.json (1)

11-11: LGTM on metadata updates.

Structure is correct for linux-x64-musl platform with proper libc constraint.

Also applies to: 16-18

npm/linux-arm64-gnu/package.json (1)

11-11: LGTM on metadata updates.

Platform constraints (arm64, linux, glibc) are correctly specified.

Also applies to: 16-18

npm/win32-arm64-msvc/package.json (1)

1-19: Windows ARM64 platform support structure looks good.

The new win32-arm64-msvc platform package is properly structured with correct CPU (arm64) and OS (win32) constraints, following the established pattern across other platforms.

Please verify that:

  1. Native bindings are being built for the aarch64-pc-windows-msvc target in your build pipeline
  2. index.js has been updated to recognize this new platform variant
npm/win32-arm64-msvc/README.md (1)

1-3: README provides basic documentation for new platform.

The documentation correctly identifies the binary target. For consistency, you may want to verify that other platform-specific README files in npm/* directories follow a similar format.

npm/linux-x64-gnu/package.json (1)

11-11: LGTM on metadata updates.

Platform configuration (x64, linux, glibc) is correct.

Also applies to: 16-18

npm/win32-x64-msvc/package.json (1)

11-11: LGTM on metadata updates.

Windows x64 MSVC platform specification is correctly configured.

Also applies to: 16-18

index.d.ts (2)

767-767: Field rename from type to kind is consistent with Rust bindings.

The change aligns with the #[napi(js_name = "kind")] annotation in src/types.rs and the TransactionField::Kind variant in src/query.rs.


816-816: TransactionField enum value rename is consistent.

The Kind value correctly corresponds to the enum variant rename in src/query.rs and the conversion logic mapping it to net_types::TransactionField::Type.

src/types.rs (1)

72-73: LGTM!

The #[napi(js_name = "kind")] attribute correctly changes only the JavaScript-facing property name while keeping the Rust field as type_. This maintains internal Rust code compatibility while achieving the API rename for JavaScript consumers.

index.js (1)

80-81: Version checks updated consistently across all platform bindings.

All 26 platform-specific binding version checks are updated to match the new version. Note that the "compatability" typo from package.json propagates here. If the typo is fixed in package.json, these will need to be regenerated via NAPI-RS.

src/query.rs (2)

777-777: Forward conversion correctly maps Kind to Type.

The mapping TransactionField::Kind => net_types::TransactionField::Type ensures that when users select the Kind field in queries, it correctly requests the Type field from the hypersync server.


1178-1178: Reverse conversion correctly maps Type back to Kind.

The mapping net_types::TransactionField::Type => TransactionField::Kind ensures bidirectional consistency for round-trip conversions.

"os": [
"darwin"
],
"version": "0.7.0-hyperindex-v2-compatability",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix spelling error in version string across all platform packages.

The version string contains a spelling error: 0.7.0-hyperindex-v2-compatability should be 0.7.0-hyperindex-v2-compatibility. Since this version will be published to npm and becomes part of the public API contract, this typo should be corrected in all platform-specific package.json files before merge.

Please update the version string in:

  • npm/darwin-x64/package.json
  • npm/darwin-arm64/package.json
  • npm/linux-x64-musl/package.json
  • npm/linux-arm64-gnu/package.json
  • npm/win32-x64-msvc/package.json
  • npm/linux-x64-gnu/package.json
  • npm/win32-arm64-msvc/package.json

Change from: "0.7.0-hyperindex-v2-compatability"
Change to: "0.7.0-hyperindex-v2-compatibility"

🤖 Prompt for AI Agents
npm/darwin-x64/package.json (line 3) and the other platform package.json files
listed below at the same location: npm/darwin-arm64/package.json,
npm/linux-x64-musl/package.json, npm/linux-arm64-gnu/package.json,
npm/win32-x64-msvc/package.json, npm/linux-x64-gnu/package.json,
npm/win32-arm64-msvc/package.json — the version string on line 3 contains a
spelling mistake ("0.7.0-hyperindex-v2-compatability"); update each file's
version property to the corrected value "0.7.0-hyperindex-v2-compatibility" so
all platform-specific package.json files match exactly.

…perindex v2

Update npm packages

Add windows arm package

Rename typo

Fix test
@JonoPrest JonoPrest force-pushed the jp/make-backwards-compatable-client branch from 385cab5 to c8116ef Compare December 2, 2025 17:49
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