Migrate /numbers to TS part 1#852
Conversation
|
Size Change: -137 B (0%) Total Size: 3.51 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Pull request overview
Migrates the first set of large integer number helpers under /numbers to TypeScript, adding local @stellar/js-xdr typings to unblock TS typechecking during the broader JS→TS transition.
Changes:
- Converted
int128,int256,uint128,uint256implementations to typed TS signatures. - Added new Vitest unit tests covering constructors, boundaries, parsing, and conversions for the migrated types.
- Added a local
@stellar/js-xdrdeclaration package and updatedtsconfigto load local typings viatypeRoots.
Reviewed changes
Copilot reviewed 9 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| types/stellar__js-xdr/index.d.ts | Adds local ambient typings for @stellar/js-xdr during migration. |
| tsconfig.base.json | Configures typeRoots so the local typings directory is used by TS. |
| src/numbers/uint256.ts | Adds TS annotations to the Uint256 wrapper. |
| src/numbers/uint128.ts | Adds TS annotations to the Uint128 wrapper. |
| src/numbers/int256.ts | Adds TS annotations to the Int256 wrapper. |
| src/numbers/int128.ts | Adds TS annotations to the Int128 wrapper. |
| test/unit/numbers/uint256.test.ts | Introduces Vitest coverage for Uint256 behavior. |
| test/unit/numbers/uint128.test.ts | Introduces Vitest coverage for Uint128 behavior. |
| test/unit/numbers/int256.test.ts | Introduces Vitest coverage for Int256 behavior. |
| test/unit/numbers/int128.test.ts | Introduces Vitest coverage for Int128 behavior. |
| type_validation/numbers/uint256.d.ts | Adds/updates emitted declaration for Uint256. |
| type_validation/numbers/uint128.d.ts | Adds/updates emitted declaration for Uint128. |
| type_validation/numbers/int256.d.ts | Adds/updates emitted declaration for Int256. |
| type_validation/numbers/int128.d.ts | Adds/updates emitted declaration for Int128. |
Comments suppressed due to low confidence (1)
src/numbers/int128.ts:8
- JSDoc tag spacing is inconsistent with the other migrated number types (
@param args ...). Consider normalizing this to@param args ...for consistency.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 14 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/numbers/int128.ts:8
- JSDoc
@paramtag has an extra space (@param args) which is inconsistent with the other migrated number classes in this PR. Consider normalizing to@param argsto keep generated docs consistent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ryang-21
left a comment
There was a problem hiding this comment.
Nice find on the typeRoots field
int128,int256,uint128, anduint256files to TS.@stellar/js-xdrand updatedtsconfigto use them.