-
Notifications
You must be signed in to change notification settings - Fork 4
Create a backwards compatible version for hyperindex v2 #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (10)
🧰 Additional context used🧬 Code graph analysis (1)src/query.rs (1)
🔇 Additional comments (2)
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. Comment |
There was a problem hiding this 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
📒 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:
- Native bindings are being built for the aarch64-pc-windows-msvc target in your build pipeline
- 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 fromtypetokindis consistent with Rust bindings.The change aligns with the
#[napi(js_name = "kind")]annotation insrc/types.rsand theTransactionField::Kindvariant insrc/query.rs.
816-816: TransactionField enum value rename is consistent.The
Kindvalue correctly corresponds to the enum variant rename insrc/query.rsand the conversion logic mapping it tonet_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 astype_. 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.jsonpropagates here. If the typo is fixed inpackage.json, these will need to be regenerated via NAPI-RS.src/query.rs (2)
777-777: Forward conversion correctly mapsKindtoType.The mapping
TransactionField::Kind => net_types::TransactionField::Typeensures that when users select theKindfield in queries, it correctly requests theTypefield from the hypersync server.
1178-1178: Reverse conversion correctly mapsTypeback toKind.The mapping
net_types::TransactionField::Type => TransactionField::Kindensures bidirectional consistency for round-trip conversions.
npm/darwin-x64/package.json
Outdated
| "os": [ | ||
| "darwin" | ||
| ], | ||
| "version": "0.7.0-hyperindex-v2-compatability", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
385cab5 to
c8116ef
Compare
Do not merge to main!
Summary by CodeRabbit
Breaking Changes
typetokindChores
✏️ Tip: You can customize this high-level summary in your review settings.